ListItem(已废弃).vue 71 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085
  1. <template>
  2. <div class="data-fill-list-box">
  3. <el-collapse v-model="ActiveKey" @change="CollapseChange">
  4. <template v-for="(item,index) in listDatas" :key="item?.pkeyId">
  5. <el-collapse-item :id="`item-${index}-${item?.pkeyId}`" :disabled="item['isBussShow'] === 2"
  6. :name="`item-${index}-${item?.pkeyId}`">
  7. <template #title>
  8. <div class="hc-collapse-item-header">
  9. <div class="text-lg truncate item-title">{{ item.nodeName }}</div>
  10. <div class="hc-extra-text-box">
  11. <HcTooltip v-if="item['isCopeTab'] === 2" keys="wbs_del_table">
  12. <el-button :disabled="item['isBussShow'] === 2" plain type="danger"
  13. @click.stop="delClick(item,index)">删除本表
  14. </el-button>
  15. </HcTooltip>
  16. <!-- <HcTooltip keys="wbs_copy_table">
  17. <el-button :disabled="item['isBussShow'] === 2" :loading="copyClickLoading" plain
  18. type="primary" @click.stop="copyClick(item,index)">
  19. 复制本表
  20. </el-button>
  21. </HcTooltip> -->
  22. <HcTooltip keys="wbs_copy_table">
  23. <el-button
  24. v-if="item['isLinkTable'] === 1"
  25. disabled plain
  26. type="info">
  27. 复制本表
  28. </el-button>
  29. <el-button v-else :loading="copyClickLoading" plain type="primary"
  30. @click.stop="copyClick(item,index)">复制本表
  31. </el-button>
  32. </HcTooltip>
  33. <HcTooltip keys="wbs_hide_table">
  34. <el-button plain type="primary" @click.stop="hideClick(item,index)">
  35. <template v-if="item['isBussShow'] === 1">隐藏本表</template>
  36. <template v-else>显示本表</template>
  37. </el-button>
  38. </HcTooltip>
  39. <HcTooltip v-if="isStatus != 3" keys="wbs_preview_table">
  40. <el-button
  41. v-if="item['isBussShow'] === 2 || item['isTabPdf'] === 1|| item['pdfUrl'] === ''"
  42. disabled plain
  43. type="info">
  44. 预览
  45. </el-button>
  46. <el-button v-else plain type="primary" @click.stop="previewClick(item,index)">预览
  47. </el-button>
  48. </HcTooltip>
  49. <HcTooltip keys="wbs_upload_table">
  50. <el-button :disabled="item['isBussShow'] === 2"
  51. :type="item['tabFileType'] === 2?'success':'primary'"
  52. plain
  53. @click.stop="uploadClick(item,index)">
  54. <template v-if="item['tabFileType'] === 2">已上传</template>
  55. <template v-else>上传</template>
  56. </el-button>
  57. </HcTooltip>
  58. </div>
  59. </div>
  60. </template>
  61. <div :style="`height: calc(100vh - ${drawType ? '555px' : '386px'});`"
  62. class="data-fill-list-item-content">
  63. <div class="data-fill-table-form-box">
  64. <div :id="`table-form-${item?.pkeyId}`" class="hc-excel-table-form-view"/>
  65. <div v-if="item?.isTableForm === false" class="hc-no-table-form">
  66. <div class="table-form-no">
  67. <img :src="notableform" alt=""/>
  68. <div class="desc">暂无表单数据</div>
  69. </div>
  70. </div>
  71. </div>
  72. <div class="data-fill-table-tip-box">
  73. <div class="text-orange tip-title">
  74. <HcIcon fill name="error" ui="text-2xl"/>
  75. <span class="ml-1">提示</span>
  76. </div>
  77. <div class="text-gray-400 tip-item">
  78. 1、灰色框代表可通过系统识别计算,公式自动引用,可通过公式计算少量数据,(表头数据及简单),也可只填写白色框数据
  79. </div>
  80. <div class="text-gray-400 tip-item">2、系统支持键盘中,shift +
  81. tab键向上一个填报框切换,tab向下一个填报框切换。Shift + 上 ( ↑ )、下 ( ↓ )、左 ( ← )、右 ( →
  82. )键,切换填报输入框焦点。
  83. </div>
  84. <div class="table-tip-foot">
  85. <div class="tip-left-btn">
  86. <HcTooltip keys="wbs_import_table">
  87. <div class="text-gray-400 dow-text">
  88. <HcIcon name="publish" ui="text-lg"/>
  89. <span class="ml-1">导入列表数据</span>
  90. </div>
  91. </HcTooltip>
  92. <HcTooltip keys="wbs_download_table">
  93. <div class="text-main dow-text">
  94. <HcIcon name="file_download" ui="text-lg"/>
  95. <span class="ml-1">下载导入模板</span>
  96. </div>
  97. </HcTooltip>
  98. </div>
  99. <div class="tip-right-btn">
  100. <HcTooltip keys="wbs_save_table">
  101. <el-button :disabled="item?.isTableForm === false"
  102. :loading="tableFormSaveLoading" hc-btn
  103. type="primary"
  104. @click="tableFormSaveClick(item,index)">
  105. <HcIcon name="save"/>
  106. <span>保存</span>
  107. </el-button>
  108. </HcTooltip>
  109. </div>
  110. </div>
  111. </div>
  112. </div>
  113. </el-collapse-item>
  114. </template>
  115. </el-collapse>
  116. </div>
  117. <!--右键菜单-->
  118. <HcContextMenu ref="contextMenuRef" :datas="tableFormMenu" @item-click="handleMenuSelect"/>
  119. <!--上传文件-->
  120. <HcDialog :footer="false" :show="uploadModal" title="上传文件" widths="38rem" @close="uploadModal = false">
  121. <HcUpload :datas="uploadData" :fileList="fileListData" @change='uploadChange'/>
  122. </HcDialog>
  123. <!--插入设计值/频率-->
  124. <HcDialog :show="IDVFModal" saveText="确认插入" title="插入设计值/频率" widths="600px" @close="closeIDVFModal"
  125. @save="IDVFModalSaveClick">
  126. <el-alert :closable="false" title="填写完设计值和频率,系统自动计算实测值" type="warning"/>
  127. <el-form ref="formIDVFRef" :model="formIDVFModel" label-width="auto" size="large">
  128. <div class="form-item-div text-center mb-3">
  129. <el-radio-group v-model="formIDVFModel.type" size="large">
  130. <el-radio :label="1">公路工程</el-radio>
  131. <el-radio :label="2" class="ml-4">水利水电</el-radio>
  132. </el-radio-group>
  133. </div>
  134. <el-form-item label="设计值">
  135. <!-- onkeyup="value = value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" -->
  136. <el-input v-model="formIDVFModel.design" placeholder="如果设计值存在两个,则使用 '/' 连接,例如12/23"/>
  137. </el-form-item>
  138. <el-form-item v-if="formIDVFModel.type === 1" label="频率">
  139. <!-- onkeyup="value = value.replace(/^(0+)|[^\d]+/g,'')" -->
  140. <el-input v-model="formIDVFModel.size"
  141. placeholder="如果设计值使用 '/' 连接,则频率也是用 '/' 连接,例如5/10"/>
  142. </el-form-item>
  143. <el-form-item v-if="formIDVFModel.type === 2" label="容量">
  144. <!-- onkeyup="value = value.replace(/^(0+)|[^\d]+/g,'')" -->
  145. <el-input v-model="formIDVFModel.capacity"
  146. placeholder="如果容量存在两个,则使用 '*',或者 '/' 连接例如2*4,5/7"/>
  147. </el-form-item>
  148. <el-form-item label="合格点数">
  149. <el-input v-model="formIDVFModel.pass"
  150. placeholder="如果设计值使用 '/' 连接,则合格点数也是用 '/' 连接,例如2/5"/>
  151. </el-form-item>
  152. <el-form-item label="偏差范围">
  153. <el-input v-model="formIDVFModel.dev"
  154. placeholder="如果设计值使用 '/' 连接,则偏差范围也是用 '/' 连接,例如±2/±3"/>
  155. </el-form-item>
  156. </el-form>
  157. </HcDialog>
  158. <!--插入特殊字符-->
  159. <HcDialog :show="specialModal" saveText="确认插入" title="插入特殊字符" widths="600px" @close="specialModal = false"
  160. @save="specialNodeClick">
  161. <el-form ref="specialFormRef" :model="specialFormModel" :rules="specialFormRules" class="mb-6" label-width="0px"
  162. size="large">
  163. <el-form-item class="special-form-item" prop="val">
  164. <el-input id="specialId" ref="specialRef" v-model="specialFormModel.val"
  165. clearable placeholder="请选择特殊字符代码" @blur="specialInputBlur"/>
  166. </el-form-item>
  167. </el-form>
  168. <el-row :gutter="20" style="margin: -10px;">
  169. <el-col v-for="item in specialCharacters" :span="3" style="padding: 10px;">
  170. <div class="special-box" @click="specialClick">
  171. <span :title="`字符代码(C):${item !== 'K̅'?item.slice(2,7):'K̅'}`" class="font-EUDC" v-html="item"/>
  172. </div>
  173. </el-col>
  174. </el-row>
  175. </HcDialog>
  176. <!--关联试验数据-->
  177. <HcDialog :footer="false" :show="CTDModal" title="关联试验数据" widths="84%" @close="CTDModal = false">
  178. <div class="adding-form-dialog-box">
  179. <div class="dialog-tree-box">
  180. <el-scrollbar>
  181. <ElTree ref="ElTreeRef"
  182. :autoExpandKeys="CTDTreeAutoExpandKeys"
  183. :default-expanded-keys="defaultExpandedCids"
  184. :indent="0"
  185. :load="ElTreeLoadNode"
  186. :props="ElTreeProps"
  187. accordion
  188. class="hc-tree-node tree-line"
  189. highlight-current
  190. lazy
  191. node-key="primaryKeyId"
  192. @node-click="CTDElTreeClick"
  193. >
  194. </ElTree>
  195. </el-scrollbar>
  196. </div>
  197. <div class="dialog-table-box">
  198. <div class="dialog-search">
  199. <div class="w-64 ml-2">
  200. <HcDatePicker :dates="CTDbetweenTime" clearable @change="CTDbetweenTimeUpdate"/>
  201. </div>
  202. <div class="ml-2">
  203. <el-button type="primary" @click="CTDsearchClick">
  204. <HcIcon name="search-2"/>
  205. <span>搜索</span>
  206. </el-button>
  207. </div>
  208. </div>
  209. <div class="dialog-table">
  210. <HcTable :column="CTDdialogTableColumn" :datas="CTDdialogTableData1"
  211. :loading="CTDdialogTableLoading">
  212. <template #reportNo="{row}">
  213. <span class="text-link" @click="CTDtableRowName(row)">{{ row?.reportNo }}</span>
  214. </template>
  215. </HcTable>
  216. </div>
  217. <div class="dialog-pages">
  218. <HcPages :pages="CTDsearchFormPage" @change="CTDsearchFormPageChange"/>
  219. </div>
  220. </div>
  221. </div>
  222. </HcDialog>
  223. <!-- 选择要插入的数据 -->
  224. <HcDialog :show="insertDataShow" saveText="保存" title="选择需要插入的数据" widths="84%" @close="cancelinsertData"
  225. @save="submitinsertData">
  226. <div>
  227. <div class="flex-1" style="padding-left:20px">
  228. <HcNewSwitch :datas="tabTypeTab" :keys="tabTypeKey" :round="false" size="default"
  229. @change="tabTypeChange"/>
  230. <el-select v-model="testReportId" :loading="insertDataSelectoading" :placeholder="placeholderType"
  231. class="ml-2 w-80"
  232. clearable @change="testReportIdchange">
  233. <el-option v-for="item in testReportData" :key="item.pKeyId" :label="item['nodeName']"
  234. :value="item['pKeyId']"/>
  235. </el-select>
  236. </div>
  237. <div class="dialog-table-box">
  238. <!-- <div class="dialog-table">
  239. <HcTable :column="insertDataTableColumn" :datas="insertDataTable" :loading="insertDataTableLoading">
  240. <template #tempLow="{row}">{{row['tempLow']}} ~ {{row['tempHigh']}}</template>
  241. <template #action="{row}">
  242. <el-checkbox size="large" @change="insertDataTableCheck(row)"/>
  243. </template>
  244. </HcTable>
  245. </div> -->
  246. <!-- <div class="dialog-pages">
  247. <HcPages :pages="insertDataPage" @change="insertDataPageChange"/>
  248. </div> -->
  249. <div class="copy-node-many-table">
  250. <el-scrollbar v-loading="insertDataTableLoading">
  251. <el-table :data="insertDataTable" border stripe @selection-change="insertDataTableCheck">
  252. <el-table-column type="selection" width="55"/>
  253. <!-- <el-table-column prop="key_12__3_1" label="数据名称"/> -->
  254. <el-table-column label="字段名称" prop="key"/>
  255. <el-table-column label="数值" prop="value"/>
  256. <!-- <el-table-column prop="action" label="操作" width="120" align="center">
  257. <template #default="{row}">
  258. <el-checkbox size="large" @change="insertDataTableCheck(row)"/>
  259. </template> -->
  260. <!-- </el-table-column> -->
  261. </el-table>
  262. </el-scrollbar>
  263. </div>
  264. </div>
  265. </div>
  266. </HcDialog>
  267. <!-- 复制本表 -->
  268. <HcDialog :show="CopyModal" saveText="确认复制" title="复制本表" widths="1200px" @close="CopyModal = false"
  269. @save="CopyModal = false">
  270. <el-alert :closable="false" title="复跨节点复制: 把当前表格已形成的数据复制到其他工程部位的相同表格里面"
  271. type="warning"/>
  272. <el-alert :closable="false" title="本节点复制:在当前节点内复制本表及数据" type="warning"/>
  273. <div class="radio-group-box">
  274. <el-radio-group v-model="CopyModalType">
  275. <el-radio label="1">跨节点复制</el-radio>
  276. <el-radio class="ml-4" label="2">本节点复制</el-radio>
  277. </el-radio-group>
  278. </div>
  279. <div v-if="CopyModalType=== '1'" class="copy-node-many-box">
  280. <div class="copy-node-many-tree">
  281. <el-scrollbar>
  282. <WbsTree
  283. :contractId="contractId"
  284. :projectId="projectId"
  285. @nodeLoading="ElTreeNodeLoading"
  286. @nodeTap="wbsElTreeClick"
  287. />
  288. </el-scrollbar>
  289. </div>
  290. <div class="copy-node-many-table">
  291. <el-scrollbar v-loading="ListItemLoading">
  292. <el-table :data="copyModalTable" border stripe>
  293. <el-table-column label="表格名称" prop="fullName"/>
  294. <el-table-column align="center" label="操作" prop="action" width="120">
  295. <template #default="{row}">
  296. <el-checkbox v-model="row.isCheck" size="large" @change="copyModalTableCheck(row)"/>
  297. </template>
  298. </el-table-column>
  299. </el-table>
  300. </el-scrollbar>
  301. </div>
  302. </div>
  303. </HcDialog>
  304. <!--关联试验文件-->
  305. <HcDialog :show="fileModal" saveText="保存" title="关联试验文件" widths="84%" @close="fileModal = false"
  306. @save="savefileModal">
  307. <div class="radio-box">
  308. <el-radio-group v-model="fileModalradio" @change="radioChange">
  309. <el-radio :label="1">试验检测</el-radio>
  310. <el-radio :label="2">第三方检测</el-radio>
  311. <el-radio :label="3">外委检测</el-radio>
  312. </el-radio-group>
  313. </div>
  314. <div class="adding-form-dialog-box">
  315. <div class="dialog-tree-box">
  316. <el-scrollbar>
  317. <!-- 试验检测树 -->
  318. <ElTree v-if="fileModalradio==1"
  319. :indent="0"
  320. :load="ElTreeLoadNode"
  321. :props="ElTreeProps"
  322. accordion
  323. class="hc-tree-node tree-line"
  324. highlight-current
  325. lazy
  326. node-key="primaryKeyId"
  327. @node-click="fileModalElTreeClick"
  328. >
  329. </ElTree>
  330. <!-- 第三方树 -->
  331. <ElTree
  332. v-else
  333. ref="ElTreeRef2" :data="thirdtreeDatas" :indent="0" :props="thirdElTreeProps"
  334. accordion class="hc-tree-node" highlight-current
  335. node-key="id" @node-click="thirdtreeDatasElTreeClick">
  336. </ElTree>
  337. </el-scrollbar>
  338. </div>
  339. <div class="dialog-table-box">
  340. <div class="dialog-search">
  341. <div class="w-64 ml-2">
  342. <HcDatePicker :dates="filebetweenTime" clearable @change="filebetweenTimeUpdate"/>
  343. </div>
  344. <div class="ml-2">
  345. <el-button type="primary" @click="filesearchClick">
  346. <HcIcon name="search-2"/>
  347. <span>搜索</span>
  348. </el-button>
  349. </div>
  350. </div>
  351. <div class="dialog-table">
  352. <HcTable v-if="fileModalradio==1" ref="dialogTableRef1" :column="filedialogTableColumn"
  353. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  354. @selection-change="filedialogTableSelection1">
  355. <template #reportNo="{row}">
  356. <span :class="[row?.isSelectedStatus==1?'text-green':'']">{{ row?.reportNo }}</span>
  357. </template>
  358. </HcTable>
  359. <HcTable v-if="fileModalradio==2" ref="dialogTableRef2" :column="filedialogTableColumn1"
  360. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  361. @selection-change="filedialogTableSelection">
  362. <template #reportNo="{row}">
  363. <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
  364. </template>
  365. </HcTable>
  366. <HcTable v-if="fileModalradio==3" ref="dialogTableRef" :column="filedialogTableColumn1"
  367. :datas="filedialogTableData" :loading="filedialogTableLoading" isCheck
  368. @selection-change="filedialogTableSelection">
  369. <template #reportNo="{row}">
  370. <span :class="[row?.isSelectedStatus===1?'text-green':'']">{{ row?.reportNo }}</span>
  371. </template>
  372. </HcTable>
  373. </div>
  374. <div class="dialog-pages">
  375. <HcPages :pages="filesearchFormPage" @change="filesearchFormPageChange"/>
  376. </div>
  377. </div>
  378. </div>
  379. </HcDialog>
  380. <!-- 公式参数配置 -->
  381. <HcDialog :show="formulaModal" saveText="保存" title="公式参数配置" widths="84%" @close="formulaModal = false"
  382. @save="PanelSaveClick">
  383. <div v-if="componentDetail['type']==='radio'">
  384. <el-form ref="formIDVFRef" :model="formulaModalinfo" label-width="auto" size="large">
  385. <el-form-item :label="componentDetail['info']['label']">
  386. <!-- onkeyup="value = value.replace(/^\D*(\d*(?:\.\d{0,2})?).*$/g,'$1')" -->
  387. <el-radio-group v-model="formulaModalinfo.type" size="large">
  388. <el-radio :label="componentDetail['info']['value'][0]['value']">
  389. {{ componentDetail['info']['value'][0]['label'] }}
  390. </el-radio>
  391. <el-radio :label="componentDetail['info']['value'][1]['value']" class="ml-4">
  392. {{ componentDetail['info']['value'][1]['label'] }}
  393. </el-radio>
  394. </el-radio-group>
  395. </el-form-item>
  396. </el-form>
  397. </div>
  398. </HcDialog>
  399. </template>
  400. <script setup>
  401. import {ref, watch, nextTick} from "vue";
  402. import {getStoreData, setStoreData} from '~src/utils/storage'
  403. import notableform from '~src/assets/view/notableform.svg';
  404. import HTableForm from "~src/plugins/HTableForm"
  405. import WbsTree from "../components/WbsTree.vue"
  406. import wbsApi from "~api/data-fill/wbs"
  407. import dataApi from "~api/tentative/detect/test";
  408. import thirdApi from "~api/tentative/detect/third";
  409. import {getTreeAll} from "~api/tentative/detect"
  410. import HcUpload from "./HcUpload.vue"
  411. import {utilsText, isType, formValidate, deepClone, getObjValue} from "vue-utils-plus"
  412. import {useAppStore} from "~src/store";
  413. import samplingApi from "~api/tentative/material/sampling"
  414. //初始
  415. const props = defineProps({
  416. datas: {
  417. type: Array,
  418. default: () => ([])
  419. },
  420. classify: {
  421. type: [String, Number],
  422. default: ''
  423. },
  424. status: {
  425. type: [String, Number],
  426. default: ''
  427. },
  428. primaryKeyId: {
  429. type: [String, Number],
  430. default: ''
  431. },
  432. contractId: {
  433. type: [String, Number],
  434. default: ''
  435. },
  436. projectInfo: {
  437. type: Object,
  438. default: () => ({})
  439. },
  440. authBtnTabKey: {
  441. type: [String, Number],
  442. default: ''
  443. },
  444. drawType: {
  445. type: Boolean,
  446. default: false
  447. },
  448. wbsTempId: {
  449. type: [String, Number],
  450. default: ''
  451. },
  452. tenantId: {
  453. type: [String, Number],
  454. default: ''
  455. },
  456. wbsType: {
  457. type: [String, Number],
  458. default: ''
  459. },
  460. })
  461. const {isString, getObjNullValue, getArrValue} = isType()
  462. const {setPosInsert, setPosRange} = utilsText()
  463. const listDatas = ref(props.datas)
  464. const classify = ref(props.classify)
  465. const isStatus = ref(props.status)
  466. const isPrimaryKeyId = ref(props.primaryKeyId)
  467. const contractId = ref(props.contractId)
  468. const projectInfo = ref(props.projectInfo)
  469. const useAppState = useAppStore()
  470. const authBtnTabKey = ref(props.authBtnTabKey)
  471. const drawType = ref(props.drawType)
  472. const wbsTempId = ref(props.wbsTempId);
  473. const tenantId = ref(props.tenantId);
  474. const wbsType = ref(props.wbsType);
  475. const menuBarShow = ref(useAppState.menuBarShow)
  476. //全局变量
  477. const projectId = ref(useAppState.getProjectId);
  478. const componentDetail = ref({
  479. type: 'radio',
  480. info: {
  481. label: '是否引用公式数据',
  482. value: [
  483. {label: '是', value: 1},
  484. {label: '否', value: 0},
  485. ]
  486. }
  487. })
  488. //监听
  489. watch(() => [
  490. props.datas,
  491. props.classify,
  492. props.primaryKeyId,
  493. props.contractId,
  494. props.projectInfo,
  495. useAppState.menuBarShow,
  496. ], ([datas, classifyVal, primaryKeyId, cid, pInfo, menuBar]) => {
  497. listDatas.value = datas
  498. classify.value = classifyVal
  499. isPrimaryKeyId.value = primaryKeyId
  500. contractId.value = cid
  501. projectInfo.value = pInfo
  502. menuBarShow.value = menuBar
  503. setFormDataNum(datas)
  504. })
  505. //监听
  506. // watch(() => [
  507. // props.status
  508. // ], ([val]) => {
  509. // //1 未填报,2待上报,3已上报
  510. // isStatus.value = val
  511. // })
  512. //监听
  513. watch(() => [
  514. props.autoExpandKeys,
  515. props.projectId,
  516. props.contractId,
  517. props.wbsTempId,
  518. props.tenantId,
  519. props.wbsType,
  520. props.status
  521. ], ([expandKeys, UserProjectId, UserContractId, UserWbsTempId, UserTenantId, UserIdPrefix, wbs_type, val]) => {
  522. projectId.value = UserProjectId
  523. contractId.value = UserContractId
  524. wbsTempId.value = UserWbsTempId
  525. tenantId.value = UserTenantId
  526. wbsType.value = wbs_type
  527. isStatus.value = val
  528. })
  529. //渲染完成
  530. nextTick(() => {
  531. setFormDataNum(props.datas)
  532. })
  533. //获取表单初始数据
  534. const getFormDataInit = (item, pkeyId) => {
  535. return {
  536. projectId: item?.projectId,
  537. contractId: item?.contractId,
  538. classify: classify.value,
  539. pkeyId: pkeyId ? pkeyId + '' : '',
  540. nodeId: isPrimaryKeyId.value
  541. }
  542. }
  543. //设置表单对象的数量
  544. const formData = ref([])
  545. const setFormDataNum = (datas) => {
  546. ActiveKey.value = []
  547. let newArr = [];
  548. for (let i = 0; i < datas.length; i++) {
  549. newArr.push({
  550. ...getFormDataInit(datas[i], datas[i].pkeyId),
  551. isCollapseLoad: false,
  552. })
  553. }
  554. formData.value = newArr
  555. setTableFormMenu(projectInfo.value)
  556. }
  557. //展开事件
  558. const ActiveKey = ref([])
  559. const formKeyIds = ref('')
  560. const formparentId = ref('')
  561. const CollapseChange = async (name) => {
  562. ActiveKey.value = name
  563. let names = []
  564. if (name.length > 0) {
  565. names = name[0] ? name[name.length - 1].split('-') : name[0]
  566. }
  567. if (names.length > 0) {
  568. getOffsetTop(name);
  569. const index = names[1]
  570. const item = listDatas.value[index]
  571. formKeyIds.value = item.pkeyId ? item.pkeyId + '' : ''
  572. formparentId.value = item.parentId ? item.parentId + '' : ''
  573. if (!item.isTableFormRender) {
  574. //获取已填写的数据
  575. await getBussDataInfo(item, item.pkeyId, index)
  576. //按键key列表
  577. const keys = await getHtmlBussColsApi(item.pkeyId)
  578. //渲染表单
  579. await getExcelHtml(item, index, keys)
  580. }
  581. } else {
  582. getOffsetTop()
  583. formKeyIds.value = ''
  584. }
  585. }
  586. //获取按键切换输入框的key列表
  587. const getHtmlBussColsApi = async (pkeyId) => {
  588. const pkeyIds = pkeyId ? pkeyId + '' : ''
  589. if (pkeyIds) {
  590. const {error, code, data} = await wbsApi.getHtmlBussCols({pkeyId: pkeyIds}, false)
  591. if (!error && code === 200) {
  592. let keys = getArrValue(data);
  593. for (let i = 0; i < keys.length; i++) {
  594. if (keys[i].length <= 0) {
  595. keys.splice(i, 1)
  596. }
  597. }
  598. return keys;
  599. } else {
  600. return [];
  601. }
  602. }
  603. }
  604. //获取模板标签数据
  605. const formRegExpJson = ref({})
  606. const getExcelHtml = async (item, index, keys) => {
  607. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  608. if (pkeyIds) {
  609. const {error, code, data} = await wbsApi.getExcelHtml({pkeyId: pkeyIds}, false)
  610. const resData = isString(data) ? data || '' : ''
  611. if (!error && code === 200 && resData) {
  612. item.isTableForm = true
  613. //渲染表单
  614. HTableForm.createForm({
  615. template: resData,
  616. tableForm: formData.value[index],
  617. keys: keys,
  618. appId: `#table-form-${pkeyIds}`,
  619. onRight: (event, KeyName) => {
  620. onRightClick(event, KeyName, index)
  621. },
  622. //表单正则效验
  623. onBlur: (event, key, reg, val, msg, leng) => {
  624. setTableFormBlurReg(pkeyIds, event, key, reg, val, msg, item, index, leng)
  625. }
  626. })
  627. item.isTableFormRender = true
  628. item.isRenderTableForm = true
  629. await nextTick(() => {
  630. HTableForm.setByClassKeyup(keys)
  631. })
  632. } else {
  633. item.isTableForm = false
  634. item.isRenderTableForm = true
  635. window?.$message?.warning('暂无表单')
  636. }
  637. } else {
  638. item.isTableForm = false
  639. item.isRenderTableForm = false
  640. window?.$message?.warning('pkeyId为空')
  641. }
  642. }
  643. //正则效验
  644. const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index, leng) => {
  645. const dom = document.getElementById(key)?.parentElement ?? ''
  646. if (dom) {
  647. if (val && reg) {
  648. let regx = new RegExp(reg);
  649. let state = regx.test(val);
  650. if (state) {
  651. delete formRegExpJson.value[pkeyId]
  652. dom.style = ''
  653. } else {
  654. formRegExpJson.value[pkeyId] = {
  655. key,
  656. reg,
  657. val,
  658. msg,
  659. state,
  660. nodeName: item.nodeName,
  661. itemId: `item-${index}-${item?.pkeyId}`
  662. }
  663. dom.style = '--el-input-border-color: #fe0000; box-shadow: 0 0 0 2px #fe0000 inset;'
  664. window?.$message?.warning(msg)
  665. }
  666. } else {
  667. delete formRegExpJson.value[pkeyId]
  668. dom.style = ''
  669. }
  670. /*let efficacyRegState = true, efficacyLengState = true;
  671. //正则效验
  672. if (val && reg) {
  673. let regx = new RegExp(reg);
  674. let state = regx.test(val);
  675. console.log('reg:', reg)
  676. console.log('val:', val)
  677. console.log('state:', state)
  678. if (!state) {
  679. efficacyRegState = true
  680. } else {
  681. efficacyRegState = false
  682. window?.$message?.warning(msg)
  683. }
  684. } else {
  685. efficacyRegState = true
  686. }
  687. //校验字符长度
  688. if (val && leng) {
  689. const num = val.toString().length;
  690. if (num > leng) {
  691. efficacyLengState = false
  692. window?.$message?.warning('长度不能超过' + leng)
  693. } else {
  694. efficacyLengState = true
  695. }
  696. } else {
  697. efficacyLengState = true
  698. }
  699. //处理效验结果
  700. if (efficacyRegState && efficacyLengState) {
  701. delete formRegExpJson.value[pkeyId]
  702. dom.style = ''
  703. } else {
  704. formRegExpJson.value[pkeyId] = {key, reg, val, msg, leng, state: efficacyRegState, lengState: efficacyLengState, nodeName: item.nodeName, itemId: `item-${index}-${item?.pkeyId}`}
  705. dom.style = '--el-input-border-color: #fe0000; box-shadow: 0 0 0 2px #fe0000 inset;'
  706. }*/
  707. }
  708. }
  709. //获取已填写的数据
  710. const getBussDataInfo = async (item, pkeyId, index) => {
  711. const pkeyIds = pkeyId ? pkeyId + '' : ''
  712. if (pkeyIds) {
  713. const {error, code, data} = await wbsApi.getBussDataInfo({
  714. pkeyId: pkeyIds
  715. }, false)
  716. const resData = getObjNullValue(data)
  717. if (!error && code === 200 && resData) {
  718. HTableForm.setPickerKey(resData)
  719. const InitObj = getFormDataInit(item, pkeyId) //有数据,关联数据
  720. formData.value[index] = {...resData, ...InitObj, isCollapseLoad: true}
  721. } else {
  722. formData.value[index] = {...getFormDataInit(item, pkeyId), isCollapseLoad: true}
  723. }
  724. } else {
  725. window?.$message?.warning('pkeyId为空')
  726. }
  727. }
  728. //单个保存
  729. const tableFormSaveLoading = ref(false)
  730. const tableFormSaveClick = async (item, index) => {
  731. if (isStatus.value !== '3') {
  732. const res = await saveExcelBussData(item, index)
  733. if (res) {
  734. await getBussPdfInfo(item)
  735. renewData()
  736. }
  737. } else {
  738. window?.$message?.warning('已上报的资料,不允许保存。')
  739. }
  740. }
  741. //保存表单数据
  742. const saveExcelBussData = async (item, index, showTip = true) => {
  743. const isRegExp = !!getObjNullValue(formRegExpJson.value)
  744. if (!isRegExp) {
  745. tableFormSaveLoading.value = true
  746. const InitObj = getFormDataInit(item, item.pkeyId)
  747. const {error, code} = await wbsApi.saveExcelBussData({
  748. ...formData.value[index],
  749. ...InitObj
  750. })
  751. //处理数据
  752. tableFormSaveLoading.value = false
  753. if (!error && code === 200) {
  754. if (showTip) window?.$message?.success('保存成功')
  755. return true
  756. } else {
  757. return false
  758. }
  759. } else {
  760. window?.$message?.warning('请先修改完红色输入框的数据')
  761. return false
  762. }
  763. }
  764. //预览PDF
  765. const getBussPdfInfo = async (item, showTip = true) => {
  766. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  767. if (pkeyIds) {
  768. const {error, code, data} = await wbsApi.getBussPdfInfo({
  769. pkeyId: pkeyIds
  770. }, false)
  771. if (!error && code === 200) {
  772. if (data) {
  773. window.open(data, '_blank')
  774. } else if (showTip) {
  775. window?.$message?.warning('PDF错误')
  776. }
  777. } else {
  778. if (showTip) {
  779. window?.$message?.warning(data.msg || '获取PDF失败')
  780. }
  781. }
  782. } else {
  783. window?.$message?.warning('pkeyId为空')
  784. }
  785. }
  786. //删除本表
  787. const delClick = async (item) => {
  788. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  789. if (pkeyIds) {
  790. if (isStatus.value !== '3') {
  791. const {error, code} = await wbsApi.removeBussTabInfo({
  792. pkeyid: pkeyIds,
  793. classify: classify.value,
  794. })
  795. if (!error && code === 200) {
  796. window?.$message?.success('操作成功')
  797. renewData()
  798. }
  799. } else {
  800. window?.$message?.warning('已上报的资料,不允许删除')
  801. }
  802. } else {
  803. window?.$message?.warning('pkeyId为空')
  804. }
  805. }
  806. //复制本表弹窗
  807. const CopyModal = ref(false);
  808. const CopyModalType = ref('1');
  809. const treeLoading = ref(false);
  810. const copyModalTable = ref([])
  811. const insertDataShow = ref(false);
  812. //类型tab数据和相关处理
  813. const tabTypeKey = ref('2')
  814. const tabTypeTab = ref([
  815. {key: '1', name: '试验记录表'},
  816. {key: '2', name: '试验报告单'},
  817. ]);
  818. let placeholderType = ref('试验报告单')
  819. const tabTypeChange = ({key}) => {
  820. tabTypeKey.value = key
  821. if (tabTypeKey.value === '1') {
  822. placeholderType = '试验记录表'
  823. } else {
  824. placeholderType = '试验报告单'
  825. }
  826. getSearchNodeTables()
  827. }
  828. const insertDataTableLoading = ref(false)
  829. const insertDataTableColumn = ref(
  830. [{key: 'key_12__3_1', name: '数据名称'}],
  831. )
  832. const insertDataTable = ref([])
  833. const multipleSelection = ref([])
  834. const insertDataTableCheck = (val) => {
  835. multipleSelection.value = val
  836. }
  837. //分页
  838. const insertDataPage = ref({current: 1, size: 20, total: 0})
  839. const insertDataPageChange = ({current, size}) => {
  840. insertDataPage.value.current = current
  841. insertDataPage.value.size = size
  842. // getDialogTableData()
  843. }
  844. const testReportId = ref('');
  845. const testReportData = ref([])
  846. let checPkd = ref('')
  847. const testReportIdchange = (key) => {
  848. testReportData.value.forEach((item) => {
  849. if (item.id = key) {
  850. checPkd.value = item.pKeyId
  851. }
  852. })
  853. getBussddataInfotrialData()
  854. }
  855. //树相关变量
  856. // const primaryKeyId = ref('')
  857. const nodeItemInfo = ref({})
  858. const nodeDataInfo = ref({})
  859. //树加载完成
  860. const ElTreeNodeLoading = () => {
  861. treeLoading.value = false
  862. }
  863. //获取数据列表
  864. const ListItemLoading = ref(false);
  865. const checked1 = ref(true)
  866. const searchNodeAllTable = async () => {
  867. copyModalTable.value = []
  868. const info = nodeDataInfo.value;
  869. ListItemLoading.value = true
  870. const {error, code, data} = await wbsApi.searchNodeAllTable({
  871. projectId: projectId.value,
  872. contractId: contractId.value,
  873. primaryKeyId: info['primaryKeyId'],
  874. type: authBtnTabKey.value
  875. })
  876. //处理数据
  877. ListItemLoading.value = false
  878. if (!error && code === 200) {
  879. copyModalTable.value = getArrValue(data);
  880. copyModalTable.value.forEach((item) => {
  881. item.isCheck = false
  882. })
  883. } else {
  884. copyModalTable.value = []
  885. }
  886. }
  887. const getTableDataAll = () => {
  888. searchNodeAllTable()
  889. }
  890. //树被点击
  891. const wbsElTreeClick = ({node, data, keys}) => {
  892. nodeItemInfo.value = node
  893. nodeDataInfo.value = data
  894. getTableDataAll();
  895. }
  896. const copyClickLoading = ref(false)
  897. //复制本表
  898. const copyClick = async (item, index) => {
  899. // CopyModal.value=true;
  900. // const copyModalTable=ref([])
  901. if (item.pkeyId) {
  902. if (isStatus.value !== '3') {
  903. copyClickLoading.value = true
  904. if (!item.isRenderTableForm) {
  905. await copeBussTab(item.pkeyId + '')
  906. } else if (!item.isTableForm) {
  907. window?.$message?.warning('暂无表单数据')
  908. } else if (item.isRenderTableForm) {
  909. const res = await saveExcelBussData(item, index, false)
  910. if (res) {
  911. await copeBussTab(item.pkeyId + '')
  912. } else {
  913. window?.$message?.warning('复制本表操作失败')
  914. }
  915. } else {
  916. window?.$message?.warning(`数据异常了, isRenderTableForm: ${item.isRenderTableForm}, isTableForm: ${item.isTableForm}, pkeyIds:${item.pkeyId}`)
  917. }
  918. } else {
  919. window?.$message?.warning('已上报的资料,不允许复制')
  920. }
  921. } else {
  922. window?.$message?.warning('pkeyId为空')
  923. }
  924. }
  925. //勾选复制本表
  926. const copyModalTableCheck = async (item) => {
  927. console.log('复制本表', item);
  928. }
  929. const copeBussTab = async (pkeyIds) => {
  930. const {error, code} = await wbsApi.copeBussTab({
  931. pkeyId: pkeyIds
  932. })
  933. if (!error && code === 200) {
  934. window?.$message?.success('操作成功')
  935. renewData()
  936. }
  937. }
  938. //隐藏本表
  939. const hideClick = async (item) => {
  940. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  941. if (pkeyIds) {
  942. if (isStatus.value !== '3') {
  943. const isBussShow = item['isBussShow'] === 2 ? 1 : 2 //状态(1显示 2隐藏)
  944. const {error, code} = await wbsApi.showBussTab({
  945. pkeyId: pkeyIds,
  946. status: isBussShow
  947. })
  948. if (!error && code === 200) {
  949. window?.$message?.success('操作成功')
  950. renewData()
  951. }
  952. } else {
  953. window?.$message?.warning('已上报的资料,不允许隐藏')
  954. }
  955. } else {
  956. window?.$message?.warning('pkeyId为空')
  957. }
  958. }
  959. //预览
  960. const previewClick = async (item, index) => {
  961. await getBussPdfInfo(item)
  962. }
  963. //上传变量
  964. const uploadModal = ref(false)
  965. const fileListData = ref([]);
  966. const uploadData = ref({})
  967. //上传被点击
  968. const uploadClick = (item, index) => {
  969. const pkeyIds = item.pkeyId ? item.pkeyId + '' : ''
  970. const keyName = `item-${index}-${pkeyIds}`
  971. if (pkeyIds) {
  972. if (isStatus.value !== '3' && item.isTableForm) {
  973. uploadModal.value = true
  974. uploadData.value = getFormDataInit(item, pkeyIds)
  975. //获取文件列表
  976. getBussFileList(pkeyIds)
  977. } else if (!item.isRenderTableForm) {
  978. CollapseChange([keyName])
  979. window?.$message?.warning('请再次点击上传')
  980. } else if (!item.isTableForm) {
  981. window?.$message?.warning('暂无表单数据')
  982. } else {
  983. window?.$message?.warning('已上报的资料,不允许上传')
  984. }
  985. } else {
  986. window?.$message?.warning('pkeyId为空')
  987. }
  988. }
  989. //获取文件列表
  990. const getBussFileList = async (pkeyId) => {
  991. const {error, code, data} = await wbsApi.getBussFileList({
  992. pkeyid: pkeyId
  993. })
  994. if (!error && code === 200) {
  995. fileListData.value = getArrValue(data)
  996. } else {
  997. fileListData.value = []
  998. }
  999. }
  1000. //上传文件
  1001. const uploadChange = async ({type}) => {
  1002. if (type === 'success') {
  1003. uploadModal.value = false
  1004. renewData()
  1005. } else if (type === 'del') {
  1006. renewData()
  1007. }
  1008. }
  1009. //相关变量
  1010. const tableFormItemNode = ref({})
  1011. //菜单数据
  1012. const tableFormMenu = ref([])
  1013. //设置菜单权限数据
  1014. const setTableFormMenu = (info) => {
  1015. const infos = getObjValue(info)
  1016. const isOpen = infos['isOpenRandomNumber'] ?? 0
  1017. let newArr = []
  1018. if (isOpen === 1) {
  1019. newArr.push({label: '插入设计值/频率', key: "IDVF"})
  1020. }
  1021. //newArr.push({label: '插入设计值/频率', key: "IDVF"})
  1022. newArr.push({label: '插入特殊字符', key: "special"})
  1023. newArr.push({label: '关联试验数据', key: "CTD"}),
  1024. newArr.push({label: '关联试验文件', key: "file"}),
  1025. newArr.push({label: '公式参数', key: "formula"})
  1026. tableFormMenu.value = newArr
  1027. }
  1028. //鼠标右键事件
  1029. const contextMenuRef = ref(null)
  1030. const onRightClick = (event, KeyName, index) => {
  1031. console.log(KeyName, 'KeyName');
  1032. //取光标位置
  1033. const specialDom = document.getElementById(KeyName + "")
  1034. const startPos = specialDom?.selectionStart || 0
  1035. const endPos = specialDom?.selectionEnd || 0
  1036. //存储临时信息
  1037. tableFormItemNode.value = {KeyName, index, startPos, endPos, pkeyId: formKeyIds.value}
  1038. contextMenuRef.value?.showMenu(event) //展开菜单
  1039. }
  1040. const formulaModal = ref(false)
  1041. const formulaModalinfo = ref({
  1042. type: ''
  1043. })
  1044. //鼠标右键菜单被点击
  1045. const handleMenuSelect = ({key}) => {
  1046. if (key === 'IDVF') {
  1047. IDVFModal.value = true
  1048. } else if (key === 'special') {
  1049. specialModalShow()
  1050. } else if (key === 'CTD') {
  1051. CTDModal.value = true
  1052. CTDbetweenTime.value = []
  1053. CTDdialogTableData1.value = []
  1054. } else if (key === 'file') {
  1055. fileModal.value = true;
  1056. fileModalradio.value = 1
  1057. filedialogTableData.value = []
  1058. } else if (key === 'formula') {
  1059. formulaModal.value = true
  1060. console.log(tableFormItemNode.value, 'tableFormItemNode.value');
  1061. getPanel()
  1062. }
  1063. }
  1064. //获取公式面板数据
  1065. const getPanel = async () => {
  1066. const pkeyIds = formKeyIds.value
  1067. if (pkeyIds) {
  1068. const {error, code, data} = await wbsApi.queryPanel({
  1069. key: tableFormItemNode.value['KeyName'],
  1070. contractId: contractId.value,
  1071. parentId: formparentId.value,
  1072. pkeyId: pkeyIds,
  1073. }, false)
  1074. if (!error && code === 200) {
  1075. componentDetail.value = getObjNullValue(data)
  1076. formulaModalinfo.value.type=componentDetail?.value.info?.data||''
  1077. } else {
  1078. componentDetail.value = []
  1079. }
  1080. } else {
  1081. window?.$message?.warning('pkeyId为空')
  1082. }
  1083. }
  1084. const PanelSaveClick = async (item, index) => {
  1085. const {res, error, code} = await wbsApi.savePanel({
  1086. parentId: formparentId.value,
  1087. key: tableFormItemNode.value['KeyName'],
  1088. contractId: contractId.value,
  1089. value: formulaModalinfo?.value?.type,
  1090. pkeyId: tableFormItemNode.value?.pkeyId,
  1091. scope: componentDetail?.value['scope'],
  1092. code: componentDetail?.value?.info['code'],
  1093. })
  1094. if (!error && code === 200) {
  1095. window?.$message?.success('操作成功')
  1096. formulaModal.value = false;
  1097. }
  1098. }
  1099. //插入设计值
  1100. const IDVFModal = ref(false)
  1101. const formIDVFRef = ref(null)
  1102. const formIDVFModel = ref({type: 1, design: '', size: '', dev: '', key: '', capacity: '', pass: '', pkId: ''})
  1103. //插入特殊字符
  1104. const specialModal = ref(false)
  1105. const specialCharacters = ref([
  1106. '&#57344;', "&#57345;", "&#57346;", "&#57347;", '&#8804;', '&#8805;', '&#8451;',
  1107. '&#9312;', '&#9313;', '&#9314;', '&#9315;', '&#9316;', '&#9317;', '&#9318;', '&#9319;', '&#9320;', '&#9321;', '&#9322;', '&#9323;',
  1108. '&#9324;', '&#9325;', '&#9326;', '&#9327;', '&#9328;', '&#9329;', '&#9330;', '&#9331;',
  1109. "&#8544;", "&#8545;", "&#8546;", "&#8547;", "&#8548;", "&#8549;", "&#8550;", "&#8551;", "&#8552;", "&#8553;", "&#8554;", "&#8555;", "K̅"
  1110. ])
  1111. //输入框验证
  1112. const specialFormRef = ref(null)
  1113. const specialFormModel = ref({val: ''})
  1114. const specialFormRules = {
  1115. val: {
  1116. required: true,
  1117. trigger: "blur",
  1118. message: "请选择特殊字符代码"
  1119. }
  1120. }
  1121. //显示插入特殊字符
  1122. const specialRef = ref(null)
  1123. const specialModalShow = () => {
  1124. specialFormModel.value.val = ''
  1125. specialModal.value = true
  1126. nextTick(() => {
  1127. specialRef.value?.focus();
  1128. })
  1129. }
  1130. //失去焦点
  1131. const specialPos = ref({start: 0, end: 0})
  1132. const specialInputBlur = (e) => {
  1133. specialPos.value = {
  1134. start: e?.target?.selectionStart || 0,
  1135. end: e?.target?.selectionEnd || 0
  1136. }
  1137. }
  1138. //点击符号
  1139. const specialClick = (event) => {
  1140. const text = event?.target?.innerText ?? ''
  1141. const start = specialPos.value.start
  1142. const end = specialPos.value.end
  1143. const form = specialFormModel.value.val
  1144. specialFormModel.value.val = setPosInsert(start, end, form, text)
  1145. specialRef.value?.focus();
  1146. let posVal = start + text.length;
  1147. nextTick(() => {
  1148. setPosRange('specialId', posVal)
  1149. })
  1150. }
  1151. //确认插入
  1152. const specialNodeClick = async () => {
  1153. const res = await formValidate(specialFormRef.value)
  1154. if (res) {
  1155. const item = tableFormItemNode.value
  1156. const form = formData.value[item.index]
  1157. const val = specialFormModel.value.val ?? ''
  1158. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], val)
  1159. specialModal.value = false
  1160. specialRef.value?.focus();
  1161. let posVal = item.startPos + val.length;
  1162. nextTick(() => {
  1163. setPosRange(item.KeyName, posVal)
  1164. })
  1165. }
  1166. }
  1167. //关联试验数据
  1168. const CTDModal = ref(false)
  1169. //树形结构异步加载数据
  1170. const defaultExpandedCids = ref([])
  1171. //自动展开缓存
  1172. const CTDTreeAutoExpandKeys = ref(getStoreData('CTDElTreeExpandKeys') || [])
  1173. const dialogTableRef = ref(null)
  1174. const dialogTableRef1 = ref(null)
  1175. const dialogTableRef2 = ref(null)
  1176. const ElTreeProps = ref({
  1177. label: 'title',
  1178. children: 'children',
  1179. isLeaf: 'hasChildren'
  1180. })
  1181. const ElTreeLoadNode = async (node, resolve) => {
  1182. let parentId = '0';
  1183. if (node.level !== 0) {
  1184. parentId = node?.data?.id
  1185. }
  1186. //获取数据
  1187. const {error, code, data} = await samplingApi.queryLazyTree({
  1188. wbsId: wbsTempId.value,
  1189. tenantId: tenantId.value,
  1190. projectId: projectId.value,
  1191. parentId,
  1192. wbsType: wbsType.value
  1193. })
  1194. //处理数据
  1195. if (!error && code === 200) {
  1196. let clickKey = '', defaultExpandedArr = [];
  1197. const keys = CTDTreeAutoExpandKeys.value || []
  1198. const resData = getArrValue(data)
  1199. for (let i = 0; i < resData.length; i++) {
  1200. resData[i].hasChildren = !resData[i].hasChildren
  1201. }
  1202. if (keys.length > 0) {
  1203. let lastKey = keys[keys.length - 1];
  1204. for (const item of resData) {
  1205. //自动展开
  1206. if (isItem(keys, item?.primaryKeyId)) {
  1207. defaultExpandedArr.push(item?.primaryKeyId)
  1208. }
  1209. //最后一个,选中点击
  1210. if (item?.primaryKeyId === lastKey) {
  1211. clickKey = item?.primaryKeyId
  1212. }
  1213. }
  1214. } else if (node.level === 0) {
  1215. defaultExpandedArr.push(resData[0]?.primaryKeyId)
  1216. }
  1217. //自动展开
  1218. defaultExpandedCids.value = defaultExpandedArr
  1219. if (node.level === 0) {
  1220. emit('nodeLoading')
  1221. if (resData.length <= 0) {
  1222. window?.$message?.warning('该项目未使用试验系统,无法获取数据')
  1223. }
  1224. }
  1225. resolve(resData)
  1226. //最后一个,执行点击
  1227. if (clickKey) {
  1228. await nextTick(() => {
  1229. // document.getElementById(`${idPrefix.value}${clickKey}`)?.click()
  1230. })
  1231. }
  1232. } else {
  1233. if (node.level === 0) {
  1234. emit('nodeLoading')
  1235. }
  1236. resolve([])
  1237. }
  1238. }
  1239. //节点被点击
  1240. const CTDnodeItemInfo = ref({})
  1241. const CTDnodeDataInfo = ref({})
  1242. const CTDdialogTableData1 = ref([])
  1243. const filedialogTableData = ref([])
  1244. //多选
  1245. const filetableCheckedKeys = ref([]);
  1246. const filedialogTableSelection1 = (rows) => {
  1247. filetableCheckedKeys.value = rows.filter((item) => {
  1248. return (item ?? '') !== '';
  1249. })
  1250. }
  1251. const filedialogTableSelection = (rows) => {
  1252. filetableCheckedKeys.value = rows.filter((item) => {
  1253. return (item ?? '') !== '';
  1254. })
  1255. }
  1256. //确认关联试验文件
  1257. const savefileModal = () => {
  1258. const idarr = []
  1259. filetableCheckedKeys.value.forEach((item) => {
  1260. idarr.push(item.id)
  1261. })
  1262. const idval = idarr.join(',')
  1263. savesubmitRelationFile(idval)
  1264. fileModal.value = false
  1265. }
  1266. const CTDdialogTableColumn = ref([
  1267. {key: 'reportNo', name: '报告编号'},
  1268. {key: 'reportDate', name: '报告日期'},
  1269. {key: 'projectPositionName', name: '工程用途及部位'},
  1270. {key: 'detectionResultName', name: '检测结果'},
  1271. ])
  1272. const filedialogTableColumn = ref([
  1273. // reportNo
  1274. {key: 'reportNo', name: '报告编号'},
  1275. {key: 'reportDate', name: '报告日期'},
  1276. {key: 'projectPositionName', name: '工程用途及部位'},
  1277. {key: 'detectionResultName', name: '检测结果'},
  1278. ])
  1279. const filedialogTableColumn1 = ref([
  1280. // reportNo
  1281. {key: 'reportNo', name: '报告编号'},
  1282. {key: 'reportDate', name: '报告日期'},
  1283. {key: 'projectPosition', name: '工程用途及部位'},
  1284. {key: 'detectionResultName', name: '检测结果'},
  1285. ])
  1286. const CTDElTreeClick = (data, node, keys) => {
  1287. CTDnodeItemInfo.value = node
  1288. CTDnodeDataInfo.value = data
  1289. getNodeData()
  1290. //缓存展开的节点
  1291. CTDTreeAutoExpandKeys.value = keys.value || []
  1292. setStoreData('CTDElTreeExpandKeys', keys.value)
  1293. }
  1294. //获取试验树节点下的记录信息
  1295. const getNodeData = async () => {
  1296. //获取数据
  1297. CTDdialogTableLoading.value = true
  1298. const {error, code, data} = await samplingApi.gettrialPage({
  1299. contractId: contractId.value,
  1300. nodeId: CTDnodeDataInfo.value.primaryKeyId,
  1301. current: CTDsearchFormPage.value.current,
  1302. size: CTDsearchFormPage.value.size,
  1303. startTime: CTDsearchFormPage.value.startTime,
  1304. endTime: CTDsearchFormPage.value.lastTime,
  1305. })
  1306. //处理数据
  1307. if (!error && code === 200) {
  1308. CTDdialogTableData1.value = getArrValue(data['records'])
  1309. CTDsearchFormPage.value.total = data.total || 0
  1310. CTDdialogTableLoading.value = false
  1311. } else {
  1312. CTDdialogTableData1.value = []
  1313. CTDsearchFormPage.value.total = 0
  1314. CTDdialogTableLoading.value = false
  1315. }
  1316. }
  1317. //试验文件节点下的数据
  1318. const getfileNodeData = async () => {
  1319. //获取数据
  1320. filedialogTableLoading.value = true
  1321. const {error, code, data} = await samplingApi.gettrialPage({
  1322. contractId: contractId.value,
  1323. nodeId: filenodeDataInfo.value.primaryKeyId,
  1324. current: filesearchFormPage.value.current,
  1325. size: filesearchFormPage.value.size,
  1326. startTime: filesearchFormPage.value.startTime,
  1327. endTime: filesearchFormPage.value.lastTime,
  1328. qualityTestPKeyId: isPrimaryKeyId.value
  1329. })
  1330. //处理数据
  1331. if (!error && code === 200) {
  1332. filedialogTableData.value = getArrValue(data['records'])
  1333. filesearchFormPage.value.total = data.total || 0
  1334. filedialogTableLoading.value = false
  1335. let defaultarr = []
  1336. filedialogTableData.value.forEach((item) => {
  1337. if (item.isSelectedStatus === 1) {
  1338. defaultarr.push(item)
  1339. }
  1340. tabtoggleSelection(defaultarr)
  1341. })
  1342. } else {
  1343. filedialogTableData.value = []
  1344. filesearchFormPage.value.total = 0
  1345. filesearchFormPage.value = false
  1346. }
  1347. }
  1348. const tabtoggleSelection = (rows) => {
  1349. if (rows) {
  1350. rows.forEach(row => {
  1351. nextTick(() => {
  1352. dialogTableRef1.value?.toggleRowSelection(row, true);
  1353. })
  1354. });
  1355. } else {
  1356. dialogTableRef1.value?.clearSelection();
  1357. }
  1358. }
  1359. const outtabtoggleSelection = (rows) => {
  1360. if (rows) {
  1361. rows.forEach(row => {
  1362. nextTick(() => {
  1363. dialogTableRef2.value?.toggleRowSelection(row, true);
  1364. })
  1365. });
  1366. } else {
  1367. dialogTableRef2.value?.clearSelection();
  1368. }
  1369. }
  1370. const thirdtabtoggleSelection = (rows) => {
  1371. console.log(rows, 'rows');
  1372. if (rows) {
  1373. rows.forEach(row => {
  1374. nextTick(() => {
  1375. if (fileModalradio.value == 2) {
  1376. dialogTableRef2.value?.toggleRowSelection(row, true);
  1377. } else {
  1378. dialogTableRef.value?.toggleRowSelection(row, true);
  1379. }
  1380. })
  1381. });
  1382. } else {
  1383. if (fileModalradio.value == 2) {
  1384. dialogTableRef2.value?.clearSelection();
  1385. } else {
  1386. dialogTableRef.value?.clearSelection();
  1387. }
  1388. }
  1389. }
  1390. //获取试验表中的data数据接口:
  1391. const getBussddataInfotrialData = async () => {
  1392. insertDataTableLoading.value = true;
  1393. console.log(checPkd.value, 'checPkd.value');
  1394. const {error, code, data} = await dataApi.getBussddataInfotrialList({
  1395. // id:testReportId.value,
  1396. id: currowid.value,
  1397. pkeyId: testReportId.value,
  1398. })
  1399. insertDataTableLoading.value = false
  1400. if (!error && code === 200) {
  1401. // insertDataTable.value = getArrValue(data)
  1402. let arrobj = getObjValue(data)
  1403. let arr = []
  1404. for (var key of Object.keys(arrobj)) {
  1405. arr.push({
  1406. key: key,
  1407. value: arrobj[key]
  1408. })
  1409. }
  1410. insertDataTable.value = arr
  1411. } else {
  1412. insertDataTable.value = []
  1413. }
  1414. }
  1415. //保存试验节点数据
  1416. //取消关联数据
  1417. const cancelinsertData = async () => {
  1418. insertDataShow.value = false
  1419. }
  1420. //确定关联试验数据数据
  1421. const submitinsertData = async () => {
  1422. if (multipleSelection.value.length > 0) {
  1423. const item = tableFormItemNode.value
  1424. const form = formData.value[item.index]
  1425. const val = []
  1426. multipleSelection.value.forEach((item) => {
  1427. val.push(item['value'])
  1428. })
  1429. const newval = val.join('、')
  1430. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
  1431. insertDataShow.value = false
  1432. CTDModal.value = false
  1433. let posVal = item.startPos + newval.length;
  1434. nextTick(() => {
  1435. setPosRange(item.KeyName, posVal)
  1436. })
  1437. } else {
  1438. window?.$message?.warning('请选择你要关联的数据')
  1439. }
  1440. }
  1441. //公式参数配置
  1442. const saveformulaModal = () => {
  1443. console.log('保存');
  1444. }
  1445. //节点被点击
  1446. const ElTreeClick = async (data, node) => {
  1447. console.log(data, mode);
  1448. let autoKeysArr = []
  1449. await getNodeExpandKeys(node, autoKeysArr)
  1450. const autoKeys = autoKeysArr.reverse()
  1451. emit('nodeTap', {node, data, keys: autoKeys})
  1452. }
  1453. //处理自动展开的节点KEY
  1454. const getNodeExpandKeys = async (node, newKeys) => {
  1455. const parent = node?.parent ?? []
  1456. const primaryKeyId = node?.data?.primaryKeyId ?? ''
  1457. if (primaryKeyId) {
  1458. newKeys.push(primaryKeyId)
  1459. await getNodeExpandKeys(parent, newKeys)
  1460. }
  1461. }
  1462. const CTDbetweenTime = ref([])
  1463. const filebetweenTime = ref([])
  1464. //搜索表单
  1465. const CTDsearchFormPage = ref({
  1466. startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0
  1467. })
  1468. const filesearchFormPage = ref({
  1469. startTime: null, lastTime: null, wbsId: null, current: 1, size: 20, total: 0
  1470. })
  1471. const CTDsearchFormPageChange = ({current, size}) => {
  1472. CTDsearchFormPage.value.current = current
  1473. CTDsearchFormPage.value.size = size
  1474. // getDialogTableData()
  1475. }
  1476. const filesearchFormPageChange = ({current, size}) => {
  1477. filesearchFormPage.value.current = current
  1478. filesearchFormPage.value.size = size
  1479. // getDialogTableData()
  1480. }
  1481. const CTDbetweenTimeUpdate = ({arr, query}) => {
  1482. CTDbetweenTime.value = arr
  1483. CTDsearchFormPage.value.startTime = arr[0]
  1484. CTDsearchFormPage.value.lastTime = arr[1]
  1485. }
  1486. const filebetweenTimeUpdate = ({arr, query}) => {
  1487. filebetweenTime.value = arr
  1488. filesearchFormPage.value.startTime = arr[0]
  1489. filesearchFormPage.value.lastTime = arr[1]
  1490. }
  1491. //搜索
  1492. const CTDsearchClick = () => {
  1493. CTDsearchFormPage.value.current = 1;
  1494. getNodeData()
  1495. }
  1496. const filesearchClick = () => {
  1497. filesearchFormPage.value.current = 1;
  1498. getfileNodeData()
  1499. }
  1500. const CTDdialogTableLoading = ref(false)
  1501. const filedialogTableLoading = ref(false)
  1502. const insertDataSelectoading = ref(false)
  1503. const CTDdialogTableKeys = ref([])
  1504. const currowid = ref('')
  1505. //名称被点击
  1506. const CTDtableRowName = (row) => {
  1507. currowid.value = row.id
  1508. insertDataShow.value = true
  1509. getSearchNodeTables()
  1510. }
  1511. const getSearchNodeTables = async () => {
  1512. insertDataSelectoading.value = true
  1513. const {error, code, data} = await dataApi.searchNodeTables({
  1514. id: currowid.value,
  1515. projectId: projectId.value,
  1516. contractId: contractId.value,
  1517. primaryKeyId: CTDnodeDataInfo.value.primaryKeyId,
  1518. // type: authBtnTabKey.value,
  1519. tableType: tabTypeKey.value
  1520. })
  1521. //处理数据
  1522. insertDataSelectoading.value = false
  1523. if (!error && code === 200) {
  1524. testReportData.value = getArrValue(data)
  1525. if (testReportData.value.length > 0) {
  1526. testReportId.value = testReportData.value[0].pKeyId
  1527. getBussddataInfotrialData()
  1528. }
  1529. } else {
  1530. testReportData.value = []
  1531. }
  1532. }
  1533. //关联试验文件
  1534. const fileModal = ref(false)
  1535. const fileModalradio = ref(1)
  1536. const radioChange = (val) => {
  1537. if (val !== 1) {
  1538. getthirdTreeDatas(val)
  1539. }
  1540. }
  1541. //获取试验文件树树数据
  1542. const fileModaltreeDatas = ref([])
  1543. //节点被点击
  1544. //节点被点击
  1545. const filenodeItemInfo = ref({})
  1546. const filenodeDataInfo = ref({})
  1547. const fileTableData1 = ref([])
  1548. const fileTableColumn = ref([
  1549. {key: 'recordNo', name: '报告编号'},
  1550. {key: 'reportDate', name: '报告日期'},
  1551. {key: 'projectPositionName', name: '工程用途及部位'},
  1552. {key: 'detectionResultName', name: '检测结果'},
  1553. ])
  1554. const fileModalElTreeClick = async (data, node) => {
  1555. filenodeItemInfo.value = node
  1556. filenodeDataInfo.value = data
  1557. getfileNodeData()
  1558. }
  1559. //获取第三方树试验文件
  1560. //获取树数据
  1561. const thirdtreeDatas = ref([])
  1562. const thirdElTreeProps = ref({
  1563. label: 'nodeName',
  1564. children: 'children',
  1565. isLeaf: 'hasChildren'
  1566. })
  1567. const getthirdTreeDatas = async (type) => {
  1568. const {error, code, data} = await getTreeAll({
  1569. projectId: projectId.value,
  1570. contractId: contractId.value
  1571. })
  1572. if (!error && code === 200) {
  1573. if (type == 2) {
  1574. thirdtreeDatas.value = getArrValue(data['rightTree'])
  1575. } else {
  1576. thirdtreeDatas.value = getArrValue(data['leftTree'])
  1577. }
  1578. } else {
  1579. thirdtreeDatas.value = []
  1580. }
  1581. }
  1582. const thirdfilenodeItemInfo = ref({})
  1583. const thirdfilenodeDataInfo = ref({})
  1584. //获取第三方树节点下的数据
  1585. const getthirdTreetavleDatas = async () => {
  1586. filedialogTableLoading.value = true
  1587. const {error, code, data} = await thirdApi.queryPage({
  1588. projectId: projectId.value,
  1589. contractId: contractId.value,
  1590. nodeId: thirdfilenodeDataInfo.value.id,
  1591. current: filesearchFormPage.value.current,
  1592. size: filesearchFormPage.value.size,
  1593. startTime: filesearchFormPage.value.startTime,
  1594. endTime: filesearchFormPage.value.lastTime,
  1595. qualityTestPKeyId: isPrimaryKeyId.value
  1596. })
  1597. //处理数据
  1598. if (!error && code === 200) {
  1599. filedialogTableData.value = getArrValue(data['records'])
  1600. filesearchFormPage.value.total = data.total || 0
  1601. filedialogTableLoading.value = false
  1602. if (filedialogTableData.value.length > 0) {
  1603. let defaultarr = []
  1604. filedialogTableData.value.forEach((item) => {
  1605. if (item.isSelectedStatus === 1) {
  1606. defaultarr.push(item)
  1607. }
  1608. if (fileModalradio === 2) {
  1609. outtabtoggleSelection(defaultarr)
  1610. } else {
  1611. thirdtabtoggleSelection(defaultarr)
  1612. }
  1613. })
  1614. }
  1615. } else {
  1616. filedialogTableData.value = []
  1617. filesearchFormPage.value.total = 0
  1618. filesearchFormPage.value = false
  1619. }
  1620. filedialogTableLoading.value = false
  1621. }
  1622. const thirdtreeDatasElTreeClick = (data, node) => {
  1623. thirdfilenodeItemInfo.value = node
  1624. thirdfilenodeDataInfo.value = data
  1625. getthirdTreetavleDatas()
  1626. }
  1627. //关联试验文件
  1628. const savesubmitRelationFile = async (ids) => {
  1629. console.log(isPrimaryKeyId.value, ' isPrimaryKeyId.value');
  1630. const {error, code, data} = await samplingApi.submitRelationFile({
  1631. projectId: projectId.value,
  1632. contractId: contractId.value,
  1633. nodeId: isPrimaryKeyId.value,
  1634. type: fileModalradio.value,
  1635. ids
  1636. })
  1637. if (!error && code === 200) {
  1638. window?.$message?.success('操作成功')
  1639. }
  1640. }
  1641. //设计值频率计算
  1642. const IDVFModalSaveClick = async () => {
  1643. const {pkeyId, KeyName, index} = tableFormItemNode.value
  1644. if (pkeyId) {
  1645. const {design, size} = formIDVFModel.value
  1646. const {error, code, data} = await wbsApi.queryFormulaRange({
  1647. ...formIDVFModel.value,
  1648. // dev: (!design && !size) ? '±5': '',
  1649. key: KeyName,
  1650. pkId: pkeyId,
  1651. })
  1652. //处理数据
  1653. const res = getObjNullValue(data)
  1654. if (!error && code === 200 && res) {
  1655. Object.keys(data).forEach(key => {
  1656. formData.value[index][key] = data[key]
  1657. })
  1658. IDVFModal.value = false
  1659. }
  1660. } else {
  1661. window?.$message?.warning('pkeyId为空')
  1662. }
  1663. }
  1664. const closeIDVFModal = () => {
  1665. IDVFModal.value = false
  1666. formIDVFModel.value = {type: 1, design: '', size: '', dev: '', key: '', capacity: '', pass: '', pkId: ''}
  1667. }
  1668. //事件
  1669. const emit = defineEmits(['renew', 'offsetTop'])
  1670. //被点击
  1671. const getOffsetTop = (key = '') => {
  1672. if (key) {
  1673. const dom = document.getElementById(key[key.length - 1])
  1674. if (!drawType.value) {
  1675. if (dom?.offsetTop >= 583 && ActiveKey.value.length > 1) {
  1676. const barWidth = menuBarShow.value ? 36 : 0;
  1677. emit('offsetTop', dom?.offsetTop - 583 + barWidth)
  1678. } else {
  1679. emit('offsetTop', dom?.offsetTop)
  1680. }
  1681. } else {
  1682. if (dom.offsetTop >= 424 && ActiveKey.value.length > 1) {
  1683. const barWidth = menuBarShow.value ? 18 : 0;
  1684. emit('offsetTop', dom?.offsetTop - 424 - barWidth)
  1685. } else {
  1686. emit('offsetTop', dom?.offsetTop)
  1687. }
  1688. }
  1689. } else {
  1690. emit('offsetTop', 0)
  1691. }
  1692. ActiveKey.value = ActiveKey.value[ActiveKey.value.length - 1]
  1693. }
  1694. //通知数据更新
  1695. const renewData = () => {
  1696. emit('renew')
  1697. ActiveKey.value = []
  1698. }
  1699. //获取表单数据
  1700. const getFormData = () => {
  1701. const formArr = formData.value;
  1702. return formArr.filter((item) => {
  1703. return (item.pkeyId ?? '') !== '' && item.isCollapseLoad;
  1704. })
  1705. }
  1706. //获取表单效验数据
  1707. const getFormRegExpJson = () => {
  1708. return deepClone(formRegExpJson.value);
  1709. }
  1710. //获取当前展开项
  1711. const getActiveKey = () => {
  1712. return ActiveKey.value;
  1713. }
  1714. //设置当前展开项
  1715. const setActiveKey = (key) => {
  1716. return ActiveKey.value = key;
  1717. }
  1718. //名称被点击
  1719. const tableRowName = (row) => {
  1720. console.log(row, 'row');
  1721. //如果 evisaPdfUrl 不为空,使用evisaPdfUrl,反之使用pdfUrl
  1722. // if (row['evisaPdfUrl']) {
  1723. // window.open(row['evisaPdfUrl'],'_blank')
  1724. // } else if (row['pdfUrl']) {
  1725. // window.open(row['pdfUrl'],'_blank')
  1726. // } else {
  1727. // window.$message?.warning('文件不存在')
  1728. // }
  1729. }
  1730. // 暴露出去
  1731. defineExpose({
  1732. getFormData,
  1733. getFormRegExpJson,
  1734. getActiveKey,
  1735. setActiveKey
  1736. })
  1737. </script>
  1738. <style lang="scss" scoped>
  1739. table {
  1740. width: 100%;
  1741. }
  1742. .data-fill-list-box {
  1743. position: relative;
  1744. //margin-bottom: 25%;
  1745. .hc-collapse-item-header {
  1746. flex: 1;
  1747. position: relative;
  1748. margin-left: 46px;
  1749. display: flex;
  1750. align-items: center;
  1751. .item-title {
  1752. flex: 1;
  1753. position: relative;
  1754. user-select: none;
  1755. color: #50545E;
  1756. font-size: 16px;
  1757. font-weight: 400;
  1758. cursor: pointer;
  1759. }
  1760. .hc-extra-text-box {
  1761. position: relative;
  1762. padding-right: 24px;
  1763. }
  1764. }
  1765. .data-fill-list-item-content {
  1766. position: relative;
  1767. display: flex;
  1768. height: calc(100vh - 386px);
  1769. .data-fill-table-form-box {
  1770. position: relative;
  1771. padding: 24px 20px;
  1772. height: 100%;
  1773. overflow: auto;
  1774. flex: 1;
  1775. border: 8px solid #50545E;
  1776. .hc-no-table-form {
  1777. position: relative;
  1778. height: 100%;
  1779. display: flex;
  1780. justify-content: center;
  1781. align-items: center;
  1782. .table-form-no {
  1783. position: relative;
  1784. img {
  1785. width: 350px;
  1786. }
  1787. .desc {
  1788. text-align: center;
  1789. font-size: 20px;
  1790. color: #aaa;
  1791. }
  1792. }
  1793. }
  1794. }
  1795. .data-fill-table-tip-box {
  1796. width: 240px;
  1797. position: relative;
  1798. border-left: 1px solid #E9E9E9;
  1799. padding: 20px 15px 80px;
  1800. .tip-title {
  1801. font-size: 16px;
  1802. margin-bottom: 10px;
  1803. display: flex;
  1804. align-items: center;
  1805. }
  1806. .tip-item {
  1807. margin-bottom: 20px;
  1808. }
  1809. .table-tip-foot {
  1810. position: absolute;
  1811. bottom: 15px;
  1812. right: 0;
  1813. left: 0;
  1814. display: flex;
  1815. align-items: center;
  1816. padding: 0 15px;
  1817. .tip-left-btn {
  1818. flex: 1;
  1819. .dow-text {
  1820. cursor: pointer;
  1821. display: flex;
  1822. align-items: center;
  1823. }
  1824. }
  1825. }
  1826. }
  1827. }
  1828. }
  1829. .special-box {
  1830. position: relative;
  1831. display: flex;
  1832. justify-content: center;
  1833. align-items: center;
  1834. border: 1px solid #eee;
  1835. border-radius: 3px;
  1836. height: 52px;
  1837. width: 52px;
  1838. cursor: pointer;
  1839. user-select: none;
  1840. transition: color .3s, background-color .3s;
  1841. &:hover {
  1842. color: var(--el-color-primary);
  1843. background-color: var(--el-color-primary-light-8);
  1844. }
  1845. .font-EUDC {
  1846. font-size: 22px;
  1847. }
  1848. }
  1849. .radio-group-box {
  1850. text-align: center;
  1851. }
  1852. </style>
  1853. <style lang="scss">
  1854. .data-fill-list-box {
  1855. .el-collapse {
  1856. --el-collapse-header-height: 60px;
  1857. border: 0;
  1858. .el-collapse-item {
  1859. margin: 0 0 16px;
  1860. background-color: #f1f5f8;
  1861. border: 1px solid #E9E9E9;
  1862. border-radius: 4px;
  1863. }
  1864. .el-collapse-item__header {
  1865. background-color: transparent;
  1866. font-weight: 400;
  1867. border-bottom: 0;
  1868. cursor: default;
  1869. font-size: 14px;
  1870. .el-collapse-item__arrow {
  1871. position: absolute;
  1872. color: #50545E;
  1873. cursor: pointer;
  1874. left: 20px;
  1875. margin: 0;
  1876. }
  1877. }
  1878. .el-collapse-item.is-active .el-collapse-item__header.is-active {
  1879. background-color: #E7EEF4;
  1880. }
  1881. .el-collapse-item__wrap {
  1882. background-color: transparent;
  1883. border-bottom: 0;
  1884. .el-collapse-item__content {
  1885. position: relative;
  1886. padding-bottom: 0;
  1887. font-size: 14px;
  1888. color: #50545E;
  1889. line-height: initial;
  1890. }
  1891. }
  1892. }
  1893. }
  1894. //插入特殊字符弹窗的输入框
  1895. .data-fill-list-box .data-fill-table-form-box td,
  1896. .data-fill-list-box .data-fill-table-form-box td .el-input .el-input__wrapper .el-input__inner,
  1897. .el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
  1898. font-family: "EUDC", 宋体, v-sans, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  1899. }
  1900. //复制本表弹窗
  1901. .copy-node-many-box {
  1902. position: relative;
  1903. height: 53vh;
  1904. display: flex;
  1905. margin-top: 24px;
  1906. margin-bottom: -30px;
  1907. border-top: 1px solid #efeff5;
  1908. .copy-node-many-tree {
  1909. position: relative;
  1910. flex: 1;
  1911. height: 100%;
  1912. padding: 20px 20px 20px 0;
  1913. border-right: 1px solid #efeff5;
  1914. }
  1915. .copy-node-many-table {
  1916. position: relative;
  1917. flex: 1;
  1918. height: 100%;
  1919. padding: 20px 0 20px 20px;
  1920. }
  1921. }
  1922. //关联试验数据
  1923. .adding-form-dialog-box {
  1924. position: relative;
  1925. height: 100%;
  1926. display: flex;
  1927. .dialog-tree-box {
  1928. position: relative;
  1929. border-right: 1px solid #EEEEEE;
  1930. width: 500px;
  1931. height: 100%
  1932. }
  1933. .dialog-table-box {
  1934. position: relative;
  1935. flex: 1;
  1936. height: 100%;
  1937. padding: 18px;
  1938. .dialog-search {
  1939. position: relative;
  1940. display: flex;
  1941. }
  1942. .dialog-table {
  1943. position: relative;
  1944. height: calc(100% - 68px);
  1945. padding: 18px 0;
  1946. }
  1947. .dialog-pages {
  1948. position: relative;
  1949. }
  1950. }
  1951. }
  1952. .copy-node-many-table {
  1953. position: relative;
  1954. flex: 1;
  1955. height: 100%;
  1956. padding: 20px 0 20px 20px;
  1957. }
  1958. .dialog-table-box {
  1959. position: relative;
  1960. flex: 1;
  1961. height: 100%;
  1962. padding: 18px;
  1963. .dialog-search {
  1964. position: relative;
  1965. display: flex;
  1966. }
  1967. .dialog-table {
  1968. position: relative;
  1969. height: calc(100% - 68px);
  1970. padding: 18px 0;
  1971. }
  1972. .dialog-pages {
  1973. position: relative;
  1974. }
  1975. }
  1976. .text-blue {
  1977. color: blue;
  1978. }
  1979. .text-green {
  1980. color: green
  1981. }
  1982. </style>