ListItem.vue 69 KB

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