ListItem.vue 65 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035
  1. <template>
  2. <div class="data-fill-list-box">
  3. <el-collapse v-model="ActiveKey" accordion @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" :name="`item-${index}-${item?.pKeyId}`">
  6. <template #title>
  7. <div class="hc-collapse-item-header">
  8. <!-- div class="real-fill-rate">
  9. <div class="tag" :class="item.realFillRate >= 80 ? 'yes' : ''">已填{{ item.realFillRate ?? 0 }}%</div>
  10. <HcTooltip keys="wbs_preview_table">
  11. <el-link v-if="item.isBussShow === 2 || item.isTabPdf === 1" type="primary" disabled>本 表 预 览</el-link>
  12. <el-link v-else type="primary" @click.stop="previewClick(item)">本 表 预 览</el-link>
  13. </HcTooltip>
  14. </div -->
  15. <div class="item-title truncate text-lg">{{ item.nodeName }}</div>
  16. <div class="hc-extra-text-box">
  17. <el-link type="primary" @click.stop="linkAcquisitionClick(item)">关联设备数据</el-link>
  18. <HcTooltip v-if="item.isCopyTab === 1" keys="wbs_del_table">
  19. <el-link type="danger" :disabled="item.isBussShow === 2 || delClickLoading" @click.stop="delClick(item, index)">删除本表</el-link>
  20. </HcTooltip>
  21. <HcTooltip keys="wbs_copy_table">
  22. <el-link type="primary" :disabled="item.isBussShow === 2 || copyClickLoading" @click.stop="copyClick(item, index)">复制本表</el-link>
  23. </HcTooltip>
  24. <HcTooltip keys="wbs_preview_table">
  25. <el-link v-if="item.isBussShow === 2 || item.isTabPdf === 1" type="primary" disabled>预览</el-link>
  26. <el-link v-else type="primary" @click.stop="previewClick(item)">预览</el-link>
  27. </HcTooltip>
  28. <HcTooltip keys="wbs_upload_table">
  29. <el-link :disabled="item.isBussShow === 2" :type="item.tabFileType === 2 ? 'success' : 'primary'" @click.stop="uploadClick(item, index)">
  30. <template v-if="item.tabFileType === 2">已上传</template>
  31. <template v-else>附件上传</template>
  32. </el-link>
  33. </HcTooltip>
  34. <HcTooltip keys="wbs_hide_table">
  35. <el-link type="primary" @click.stop="hideClick(item, index)">
  36. <template v-if="item.isBussShow === 1">隐藏本表</template>
  37. <template v-else>显示本表</template>
  38. </el-link>
  39. </HcTooltip>
  40. </div>
  41. </div>
  42. </template>
  43. <div class="data-fill-list-item-content">
  44. <div v-if="item?.isWindow" class="data-fill-table-form-box is-window">
  45. <div class="hc-window-tip">
  46. <div class="table-form-no">
  47. <img :src="NoDataSvg" alt="">
  48. <div class="desc">
  49. 当前表单处于窗口模式,关闭相关窗口后恢复
  50. </div>
  51. </div>
  52. </div>
  53. </div>
  54. <div v-else class="data-fill-table-form-box">
  55. <div :id="`table-form-${item?.pKeyId}`" class="hc-excel-table-form-view" />
  56. <div v-if="item?.isTableForm === false" class="hc-no-table-form">
  57. <div class="table-form-no">
  58. <img :src="notableform" alt="">
  59. <div class="desc">
  60. 暂无表单数据
  61. </div>
  62. </div>
  63. </div>
  64. <el-tooltip :content="item.isWindow ? '关闭窗口并恢复' : '当前表单窗口化'" :hide-after="0" placement="top">
  65. <div v-if="item.isWindow" class="form-window-icon" @click.stop="windowCloseClick(item, index)">
  66. <HcIcon name="fullscreen-exit" />
  67. </div>
  68. <div v-else class="form-window-icon" @click.stop="windowClick(item, index)">
  69. <HcIcon name="fullscreen" />
  70. </div>
  71. </el-tooltip>
  72. </div>
  73. <div class="data-fill-table-action">
  74. <div class="tip-action text-orange" @click="actionTipModal = true">
  75. <HcIcon fill name="information" ui="text-2xl" />
  76. </div>
  77. <div v-loading="downloadLoading" class="link-action">
  78. <HcTooltip keys="wbs_download_table">
  79. <el-link type="primary" @click="downModal(item)">下载导入模板</el-link>
  80. </HcTooltip>
  81. <HcTooltip keys="wbs_import_table">
  82. <el-link type="primary" @click="uploadFileClick(item)">导入表格数据</el-link>
  83. </HcTooltip>
  84. </div>
  85. <div class="btn-action">
  86. <HcTooltip keys="wbs_save_table">
  87. <el-button
  88. :disabled="NodeStatusval === '3'" :loading="tableFormSaveLoading"
  89. color="#3794FF" size="small" style="color: white"
  90. @click="tableFormSaveClick(item)"
  91. >
  92. 仅保存本表数据
  93. </el-button>
  94. </HcTooltip>
  95. </div>
  96. </div>
  97. </div>
  98. </el-collapse-item>
  99. </template>
  100. </el-collapse>
  101. </div>
  102. <!-- 右键菜单 -->
  103. <HcContextMenu ref="contextMenuRef" :datas="tableFormMenu" @item-click="handleMenuSelect" />
  104. <!-- 上传文件 -->
  105. <hc-new-dialog v-model="uploadModal" :footer="false" title="上传文件" widths="38rem">
  106. <HcUpload
  107. :base-data="baseData" :contract-id="contractId" :datas="uploadData" :file-list="fileListData"
  108. :table-type-value="tableTypeValue" @change="uploadChange"
  109. />
  110. </hc-new-dialog>
  111. <!-- 插入特殊字符 -->
  112. <hc-new-dialog v-model="specialModal" save-text="确认插入" title="插入特殊字符" widths="600px" @save="specialNodeClick">
  113. <el-form
  114. ref="specialFormRef" :model="specialFormModel" :rules="specialFormRules" class="mb-6" label-width="0px"
  115. size="large"
  116. >
  117. <el-form-item class="special-form-item" prop="val">
  118. <el-input
  119. id="specialId" ref="specialRef" v-model="specialFormModel.val"
  120. clearable placeholder="请选择特殊字符代码" @blur="specialInputBlur"
  121. />
  122. </el-form-item>
  123. </el-form>
  124. <el-row :gutter="20" style="margin: -10px;">
  125. <el-col v-for="item in specialCharacters" :key="item" :span="3" style="padding: 10px;">
  126. <div class="special-box" @click="specialClick">
  127. <span :title="`字符代码(C):${item !== 'K̅' ? item.slice(2, 7) : 'K̅'}`" class="font-EUDC" v-html="item" />
  128. </div>
  129. </el-col>
  130. </el-row>
  131. </hc-new-dialog>
  132. <!-- 引用容器参数 -->
  133. <hc-new-dialog v-model="vesselModal" is-table save-text="确认引用" title="引用容器参数" widths="84%" @close="vesselModalClose" @save="vesselModalSave">
  134. <div class="adding-form-dialog-box">
  135. <div class="dialog-tree-box">
  136. <el-scrollbar>
  137. <HcMenuSimple :datas="menus" :keys="menuKey" :props="menuProps" @change="menuChange" />
  138. </el-scrollbar>
  139. </div>
  140. <div class="dialog-table-box">
  141. <div class="dialog-table">
  142. <HcTable
  143. ref="vesselTableRef" :column="vesselTableColumn" :datas="vesselTableData" :loading="vesselTableLoading"
  144. is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  145. @selection-change="vesselTableSelection"
  146. />
  147. </div>
  148. <div class="dialog-pages">
  149. <HcPages :pages="vesselTablePage" @change="vesselTablePageChange" />
  150. </div>
  151. </div>
  152. </div>
  153. </hc-new-dialog>
  154. <!-- 引用设备仪器 -->
  155. <hc-new-dialog v-model="deviceModal" is-table save-text="确认引用" title="引用设备仪器" widths="84%" @close="deviceModalClose" @save="deviceModalSave">
  156. <!-- <HcTable ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading" isCheck @selection-change="deviceTableSelection"/> -->
  157. <div class="adding-form-dialog-box">
  158. <div class="dialog-tree-box">
  159. <el-scrollbar>
  160. <HcMenuSimple
  161. :datas="equipmentmenus" :keys="equipmentmenuKey" :props="equipmentmenuProps"
  162. @change="equipmentmenuChange"
  163. />
  164. </el-scrollbar>
  165. </div>
  166. <div class="dialog-table-box">
  167. <div class="dialog-table">
  168. <HcTable
  169. ref="deviceTableRef" :column="deviceTableColumn" :datas="deviceTableData" :loading="deviceTableLoading"
  170. is-new :index-style="{ width: 60 }" is-check :check-style="{ width: 29 }"
  171. @selection-change="deviceTableSelection"
  172. />
  173. </div>
  174. <div class="dialog-pages">
  175. <HcPages :pages="equipmentPage" @change="equipmentTablePageChange" />
  176. </div>
  177. </div>
  178. </div>
  179. </hc-new-dialog>
  180. <!-- 查看表单 -->
  181. <template v-for="(item, index) in DragModalTableForm">
  182. <HcDragModal
  183. :close-icon-arr="closeIconArr" :eid="item.pKeyId" :height="DragModalHeight" :is-show="item.isShow"
  184. :loading="item.loading" :loading-text="item.loadingText" :title="item.title"
  185. is-sort-top
  186. @close="TableFormClose(item, index, true)" @close-icon-tap="closeIconTap($event, item, index)"
  187. >
  188. <HcDragNode v-loading="item.tableFormSaveLoading" :more-menu="dragNodeMoreMenu" @menu-tap="dragNodeMoreMenuTap($event, item, index)">
  189. <div :id="`table-form-${item?.item.pKeyId}`" class="hc-excel-table-form-view" :style="`width:${item.width};height:${item.height};`" />
  190. <div v-if="item?.isTableForm === false" class="hc-no-table-form">
  191. <div class="table-form-no">
  192. <img :src="notableform" alt="">
  193. <div class="desc">
  194. 暂无表单数据
  195. </div>
  196. </div>
  197. </div>
  198. </HcDragNode>
  199. </HcDragModal>
  200. </template>
  201. <!-- 操作提示 -->
  202. <hc-new-dialog v-model="actionTipModal" :footer="false" title="操作提示" widths="38rem" @close="actionTipModalClose">
  203. <div class="data-fill-table-tip-box">
  204. <div class="tip-item text-gray-400">
  205. 1、灰色框代表可通过系统识别计算,公式自动引用,可通过公式计算少量数据,(表头数据及简单),也可只填写白色框数据
  206. </div>
  207. <div class="tip-item text-gray-400">
  208. 2、系统支持键盘中,shift + tab键向上一个填报框切换,tab向下一个填报框切换。暂不支持上下按键切换输入框
  209. </div>
  210. <div class="tip-item text-orange-500">3、完善资料填写后记得一定要保存哦</div>
  211. </div>
  212. </hc-new-dialog>
  213. <!-- 关联设备数据 -->
  214. <hc-new-dialog v-model="isLinkAcquisition" is-footer-center is-table title="关联设备数据" widths="80%" @close="linksAcquisitionClose">
  215. <LinkAcquisition v-if="isLinkAcquisition" v-model="linkAcquisitionItem.loadDataId" />
  216. <template #footer>
  217. <el-button @click="linksAcquisitionClose">取消</el-button>
  218. <el-button hc-btn type="primary" @click="linksAcquisitionClick">确定</el-button>
  219. </template>
  220. </hc-new-dialog>
  221. </template>
  222. <script setup>
  223. import { nextTick, ref, watch } from 'vue'
  224. import { useAppStore } from '~src/store'
  225. import { useRoute } from 'vue-router'
  226. import wbsApi from '~api/data-fill/wbs'
  227. import HcUpload from './HcUpload.vue'
  228. import LinkAcquisition from './linkAcquisition.vue'
  229. import HTableForm from '~src/plugins/HTableForm'
  230. import dataApi from '~api/tentative/detect/test'
  231. import dataApi1 from '~api/tentative/parameter/container'
  232. import dataApi2 from '~api/tentative/device/approach'
  233. import { getClassList } from '~api/tentative'
  234. import notableform from '~src/assets/view/notableform.svg'
  235. import NoDataSvg from '~src/assets/view/no-data.svg'
  236. import { setStoreValue } from '~uti/storage'
  237. import {
  238. arrIndex,
  239. base64ToFile,
  240. clog,
  241. deepClone,
  242. downloadBlob,
  243. formValidate,
  244. getArrValue,
  245. getObjVal,
  246. getObjValue,
  247. isString,
  248. setPosInsert,
  249. setPosRange,
  250. } from 'js-fast-way'
  251. import ossApi from '~api/oss'
  252. import { HcUploadFileApi } from 'hc-vue3-ui'
  253. import { toPdfPage } from '~uti/btn-auth'
  254. //初始
  255. const props = defineProps({
  256. datas: {
  257. type: Array,
  258. default: () => ([]),
  259. },
  260. status: {
  261. type: [String, Number],
  262. default: '',
  263. },
  264. baseData: {
  265. type: Object,
  266. default: () => ({}),
  267. },
  268. deviceUseIds: {
  269. type: String,
  270. default: () => (''),
  271. },
  272. authBtnTabKey: {
  273. type: String,
  274. default: () => (''),
  275. },
  276. checkTableId: {
  277. type: String,
  278. default: () => (''),
  279. },
  280. tabTypeKey: {
  281. type: String,
  282. default: () => (''),
  283. },
  284. nodeIdvalue: {
  285. type: String,
  286. default: () => (''),
  287. },
  288. alllistData: {
  289. type: Array,
  290. default: () => ([]),
  291. },
  292. newlistdata: {
  293. type: Array,
  294. default: () => ([]),
  295. },
  296. nodeStatus: {
  297. type: String,
  298. default: () => (''),
  299. },
  300. })
  301. //事件
  302. const emit = defineEmits(['renew', 'offsetTop', 'updeviceUseIds', 'upcheckTableId', 'changesdate', 'chageorinData', 'changeIscanclick', 'changesingSaveId', 'getList'])
  303. const useRoutes = useRoute()
  304. //路由参数
  305. const routerQuery = useRoutes?.query
  306. const isaddType = routerQuery?.isaddType || false
  307. const listDatas = ref(props.datas)
  308. const isStatus = ref(props.status)
  309. const baseData = ref(props.baseData)
  310. const authBtnTabKeyType = ref(props.authBtnTabKey)//所属方
  311. const useAppState = useAppStore()
  312. const projectId = ref(useAppState.getProjectId)
  313. const contractId = ref(useAppState.getContractId)
  314. const tabTypeKeyInfo = ref(props.tabTypeKey)
  315. const nodeIdvaluedata = ref(props.nodeIdvalue)
  316. const alllistDataval = ref(props.alllistData)
  317. const NodeStatusval = ref(props.NodeStatus)
  318. const newlistdata = ref(props.newlistdata)
  319. //监听
  320. watch(() => [
  321. props.datas,
  322. props.tabTypeKey,
  323. props.alllistData,
  324. props.NodeStatus,
  325. ], ([datas, TabTypeKey, AlllistData, NodeStatus]) => {
  326. listDatas.value = datas
  327. listDatas.value.forEach((item) => {
  328. if (item.pKeyId === singleSaveid.value) {
  329. item.isCancopy = true
  330. }
  331. })
  332. tabTypeKeyInfo.value = TabTypeKey
  333. alllistDataval.value = AlllistData
  334. NodeStatusval.value = NodeStatus
  335. setFormDataNum(datas)
  336. })
  337. //监听
  338. watch(() => [
  339. props.status,
  340. props.baseData,
  341. props.nodeIdvalue,
  342. props.newlistdata,
  343. ], ([val, base, NodeIdvalue, Newlistdata]) => {
  344. //1 未填报,2待上报,3已上报
  345. isStatus.value = val
  346. baseData.value = base
  347. nodeIdvaluedata.value = NodeIdvalue
  348. newlistdata.value = Newlistdata
  349. })
  350. //渲染完成
  351. nextTick(() => {
  352. setFormDataNum(props.datas)
  353. })
  354. //获取pKeyId
  355. const getValString = (val) => {
  356. return val ? val + '' : ''
  357. }
  358. //获取表单初始数据
  359. const getFormDataInit = ({ projectId, cid, pKeyId, isBussShow }) => {
  360. const { nodeId, contractId } = baseData.value
  361. return {
  362. projectId: projectId,
  363. contractId: cid || contractId,
  364. pkeyId: getValString(pKeyId),
  365. nodeId: nodeId,
  366. isBussShow: isBussShow,
  367. }
  368. }
  369. //设置表单对象的数量
  370. const formData = ref([])
  371. const formLinkIdData = ref({})
  372. const setFormDataNum = (datas) => {
  373. ActiveKey.value = ''
  374. let newArr = []
  375. for (let i = 0; i < datas.length; i++) {
  376. newArr.push({
  377. ...getFormDataInit(datas[i]),
  378. isCollapseLoad: false,
  379. })
  380. }
  381. formData.value = newArr
  382. //处理关联表
  383. let newDataObj = {}
  384. for (let i = 0; i < datas.length; i++) {
  385. const item = datas[i]
  386. newDataObj[item.pKeyId] = {
  387. tableId: item.initTableId,
  388. isMain: item.isCopyTab === 0,
  389. mainId: item.isCopyTab === 0 ? item.pKeyId : '',
  390. linkId: [],
  391. }
  392. //获取关联表
  393. datas.forEach((items) => {
  394. if (items.initTableId === item.initTableId && item.pKeyId !== items.pKeyId) {
  395. newDataObj[item.pKeyId].linkId.push(items.pKeyId)
  396. if (items.isCopyTab === 0) {
  397. newDataObj[item.pKeyId].mainId = items.pKeyId
  398. }
  399. }
  400. })
  401. }
  402. formLinkIdData.value = newDataObj
  403. }
  404. const sampledata = ref([])
  405. const positiondata = ref([])
  406. //展开事件
  407. const ActiveKey = ref('')
  408. const formKeyIds = ref('')
  409. const setCollapseKey = (key) => {
  410. CollapseChange(key)
  411. }
  412. const CollapseChange = async (name) => {
  413. setStoreValue('ActiveKey', name)
  414. ActiveKey.value = name
  415. const names = name ? name.split('-') : []
  416. formData.value.forEach((changeitem) => {
  417. if (changeitem.pkeyId === names[2]) {
  418. changeitem.isCollapseLoad = true
  419. }
  420. })
  421. if (names.length > 0) {
  422. getOffsetTop(name)
  423. const index = names[1]
  424. let item = listDatas.value[index]
  425. emit('upcheckTableId', item.pKeyId)
  426. emit('changeIscanclick', item.pKeyId)
  427. formKeyIds.value = getValString(item.pKeyId)
  428. alllistDataval.value.forEach((item1) => {
  429. // eslint-disable-next-line eqeqeq
  430. if (item1.pkeyId == item.pKeyId) {
  431. if (item1.oper) {
  432. item.isTableFormRender = true
  433. item = item1
  434. item.pKeyId = item1.pkeyId
  435. }
  436. }
  437. })
  438. if (!item.isTableFormRender) {
  439. await getBussDataInfo(item, index)
  440. } else {
  441. await getBussDataInfo1(item, index)
  442. }
  443. //渲染表单
  444. await getExcelHtml(item, index)
  445. const { key, data } = await getChartConfig()
  446. if (key) formData.value[index][key] = data
  447. } else {
  448. // await getExcelHtml(item,index)
  449. getOffsetTop()
  450. formKeyIds.value = ''
  451. }
  452. }
  453. //获取模板标签数据
  454. const formRegExpJson = ref({})
  455. const getExcelHtml = async (item, index) => {
  456. const pkeyIds = getValString(item.pKeyId)
  457. if (pkeyIds) {
  458. const { id } = baseData.value
  459. const { error, code, data } = await dataApi.getExcelHtml({
  460. id: id || nodeIdvaluedata.value || newaddId.value,
  461. primaryKeyId: pkeyIds,
  462. }, false)
  463. const resData = isString(data) ? data || '' : ''
  464. if (!error && code === 200 && resData) {
  465. item.isTableForm = true
  466. //渲染表单
  467. HTableForm.createForm({
  468. template: resData,
  469. tableForm: formData.value[index],
  470. appId: `#table-form-${pkeyIds}`,
  471. onChartRefs: (el, pKeyId, key) => {
  472. setChartRefs(el, pKeyId, key)
  473. },
  474. onRight: (event, KeyName) => {
  475. onRightClick(event, KeyName, index)
  476. },
  477. //表单正则效验
  478. onBlur: (event, key, reg, val, msg, type) => {
  479. setTableFormBlurReg(pkeyIds, event, key, reg, val, msg, item, index)
  480. if (type === 'chart') {
  481. chartKey.value = formData.value[index].formchartKeyShow
  482. getBlurChartConfig(formData.value[index])
  483. }
  484. },
  485. })
  486. item.isTableFormRender = true
  487. item.isRenderTableForm = true
  488. } else {
  489. item.isTableForm = false
  490. item.isRenderTableForm = true
  491. window?.$message?.warning('暂无表单')
  492. }
  493. } else {
  494. item.isTableForm = false
  495. item.isRenderTableForm = false
  496. window?.$message?.warning('pkeyId为空')
  497. }
  498. }
  499. //图表ref
  500. const chartRefs = ref([])
  501. const setChartRefs = async (el, pKeyId, key) => {
  502. if (el) {
  503. const { index } = await getChartRef(pKeyId, key)
  504. if (index !== -1) {
  505. chartRefs.value[index].ref = el
  506. } else {
  507. chartRefs.value.push({ pKeyId: pKeyId, key: key, ref: el })
  508. }
  509. }
  510. }
  511. //获取图表的ref
  512. const getChartRef = async (pKeyId, key) => {
  513. let refs = chartRefs.value, refVal, index = -1
  514. for (let i = 0; i < refs.length; i++) {
  515. if (refs[i].pKeyId === pKeyId && refs[i].key === key) {
  516. refVal = refs[i].ref
  517. index = i
  518. break
  519. }
  520. }
  521. return { ref: refVal, index: index }
  522. }
  523. //图表信息
  524. const chartKey = ref('')
  525. const getBlurChartConfig = async (form = {}) => {
  526. if (chartKey.value) {
  527. let { formChartKey } = form, formKeys = {}, keyId = formKeyIds.value
  528. formKeys[keyId] = {}
  529. const chartKeys = formChartKey ? formChartKey.split(',') : []
  530. chartKeys.forEach((item) => {
  531. formKeys[keyId][item] = form[item] ?? ''
  532. })
  533. //关联表单的key
  534. const { linkId } = formLinkIdData.value[keyId]
  535. for (let i = 0; i < linkId.length; i++) {
  536. const newKey = linkId[i]
  537. formKeys[newKey] = {}
  538. formKeys = await getFormChartKey(formKeys, newKey)
  539. }
  540. //更新图表配置
  541. const { key, data } = await getChartConfig(formKeys)
  542. if (key) {
  543. form[key] = data
  544. const { ref } = await getChartRef(keyId, key)
  545. ref?.setOptions(data)
  546. }
  547. } else {
  548. console.log('formchartKeyShow 为空')
  549. }
  550. }
  551. //获取表单的图表数据
  552. const getFormChartKey = async (formKeys, key) => {
  553. const index = formData.value.findIndex((item) => item.pkeyId === key)
  554. const form = formData.value[index], { formChartKey } = form
  555. const chartKeys = formChartKey ? formChartKey.split(',') : []
  556. chartKeys.forEach((item) => {
  557. formKeys[key][item] = form[item] ?? ''
  558. })
  559. return formKeys
  560. }
  561. //获取图片配置
  562. const getChartConfig = async (form = {}) => {
  563. if (chartKey.value) {
  564. const { id } = baseData.value
  565. const { data } = await dataApi.getChartInit({
  566. id: id || nodeIdvaluedata.value || newaddId.value,
  567. pkeyId: formKeyIds.value,
  568. data: form,
  569. })
  570. return {
  571. key: chartKey.value,
  572. data: getObjValue(data),
  573. }
  574. } else {
  575. console.log('formchartKeyShow 为空')
  576. return { key: '', data: {} }
  577. }
  578. }
  579. //正则效验
  580. const setTableFormBlurReg = (pkeyId, event, key, reg, val, msg, item, index) => {
  581. const dom = document.getElementById(key)?.parentElement ?? ''
  582. if (dom) {
  583. if (val && reg) {
  584. let regx = new RegExp(reg)
  585. let state = regx.test(val)
  586. if (state) {
  587. delete formRegExpJson.value[pkeyId]
  588. dom.style = ''
  589. } else {
  590. formRegExpJson.value[pkeyId] = {
  591. key,
  592. reg,
  593. val,
  594. msg,
  595. state,
  596. nodeName: item.nodeName,
  597. itemId: `item-${index}-${item?.pKeyId}`,
  598. }
  599. dom.style = '--el-input-border-color: #fe0000; box-shadow: 0 0 0 2px #fe0000 inset;'
  600. window?.$message?.warning(msg)
  601. }
  602. } else {
  603. delete formRegExpJson.value[pkeyId]
  604. dom.style = ''
  605. }
  606. }
  607. }
  608. //关联取样成功改变所有表格取样名称数据
  609. const getsampleData = () => {
  610. if (sampledata.value.length > 0) {
  611. formData.value.forEach((ele) => {
  612. sampledata.value.forEach((item) => {
  613. if (item.tabPKeyId === ele.pkeyId) {
  614. for (let i in item) {
  615. ele[i] = item[i]
  616. }
  617. }
  618. })
  619. })
  620. }
  621. }
  622. //getPositionData关联取样成功改变所有表格工程部位数据
  623. const getPositionData = () => {
  624. if (positiondata.value.length > 0) {
  625. formData.value.forEach((ele) => {
  626. positiondata.value.forEach((item) => {
  627. if (item.tabPKeyId === ele.pkeyId) {
  628. for (let i in item) {
  629. ele[i] = item[i]
  630. }
  631. }
  632. })
  633. })
  634. }
  635. }
  636. const changeSimpleInput = (infodata) => {
  637. sampledata.value = infodata
  638. getsampleData()
  639. }
  640. const changePositionInput = (infodata) => {
  641. positiondata.value = infodata
  642. getPositionData()
  643. }
  644. //获取已填写的数据
  645. const getBussDataInfo = async (item, index) => {
  646. const pkeyIds = getValString(item.pKeyId)
  647. const { contractId } = baseData.value
  648. if (pkeyIds) {
  649. const { id } = baseData.value
  650. const { error, code, data } = await dataApi.getBussDataInfo({
  651. id: id || nodeIdvaluedata.value || newaddId.value,
  652. pkeyId: pkeyIds,
  653. contractId: contractId,
  654. }, false)
  655. emit('changesingSaveId', pkeyIds)
  656. if (item.oper) {
  657. HTableForm.setPickerKey([item])
  658. formData.value[index] = {
  659. ...item,
  660. isCollapseLoad: true,
  661. }
  662. getsampleData()
  663. getPositionData()
  664. } else {
  665. data.forEach((item1) => {
  666. const resData = getObjVal(item1)
  667. if (!error && code === 200 && resData) {
  668. HTableForm.setPickerKey(resData)
  669. const InitObj = getFormDataInit(item) //有数据,关联数据
  670. formData.value[index] = {
  671. ...resData, ...InitObj,
  672. isCollapseLoad: true,
  673. }
  674. getsampleData()
  675. getPositionData()
  676. } else {
  677. formData.value[index] = {
  678. ...getFormDataInit(item),
  679. isCollapseLoad: true,
  680. }
  681. getsampleData()
  682. getPositionData()
  683. }
  684. })
  685. }
  686. chartKey.value = formData.value[index].formchartKeyShow
  687. } else {
  688. window?.$message?.warning('pkeyId为空')
  689. }
  690. }
  691. const getBussDataInfo1 = async (item, index) => {
  692. const pkeyIds = getValString(item.pKeyId)
  693. if (pkeyIds) {
  694. if (item.oper) {
  695. HTableForm.setPickerKey([item])
  696. formData.value[index] = {
  697. ...item,
  698. isCollapseLoad: true,
  699. }
  700. }
  701. chartKey.value = formData.value[index].formchartKeyShow
  702. } else {
  703. window?.$message?.warning('pkeyId为空')
  704. }
  705. }
  706. //单个保存
  707. const tableFormSaveLoading = ref(false)
  708. const singleSaveid = ref('')
  709. const tableFormSaveClick = async (item, index) => {
  710. if (isStatus.value !== '3') {
  711. singleSaveid.value = item.pKeyId
  712. emit('changesingSaveId', item.pKeyId)
  713. if (tabTypeKeyInfo.value === '2' && baseData.value['detectionResult'] === '') {
  714. window.$message?.warning('请选择是否合格')
  715. } else {
  716. const res = await saveExcelBussData(item, index)
  717. if (res) {
  718. // if (!isaddType) {
  719. // await getBussPdfInfo(item)
  720. // } else {
  721. // await getBussPdfInfo(item)
  722. // }
  723. renewData(newaddId.value)
  724. }
  725. }
  726. } else {
  727. window?.$message?.warning('已上报的资料,不允许保存。')
  728. }
  729. }
  730. //上传图表的图片
  731. const uploadChartImgFile = async (base64) => {
  732. let fileOfBlob = base64ToFile(base64)
  733. let formData = new FormData()
  734. formData.append('file', fileOfBlob)
  735. //上传文件
  736. const { error, code, data } = await ossApi.putFile(formData, false)
  737. if (!error && code === 200) {
  738. let res = getObjValue(data)
  739. if (res?.link) {
  740. return res.link
  741. } else {
  742. return ''
  743. }
  744. } else {
  745. return ''
  746. }
  747. }
  748. const newaddId = ref('')
  749. //保存表单数据
  750. const saveExcelBussData = async (item, index, showTip = true) => {
  751. let saveItem = {}
  752. formData.value.forEach((ele)=>{
  753. if (ele.pkeyId === item.pKeyId) {
  754. saveItem = ele
  755. }
  756. })
  757. if (!getObjVal(formRegExpJson.value)) {
  758. tableFormSaveLoading.value = true
  759. const InitObj = getFormDataInit(item)
  760. if (chartKey.value) {
  761. const { ref } = await getChartRef(item.pKeyId, chartKey.value)
  762. const url = await uploadChartImgFile(ref?.getImage())
  763. const name = `${chartKey.value}_url`
  764. InitObj[name] = url
  765. }
  766. baseData.value.tableType = tabTypeKeyInfo.value
  767. if (newaddId.value.length > 0) {
  768. baseData.value.id = newaddId.value
  769. }
  770. const { error, code, data, msg } = await dataApi.saveExcelBussData({
  771. ...baseData.value,
  772. isBatchSave: 0,
  773. dataInfo: {
  774. // orderList: [{ ...formData.value[index], ...InitObj }],
  775. orderList: [{ ...saveItem, ...InitObj }],
  776. },
  777. })
  778. //处理数据
  779. tableFormSaveLoading.value = false
  780. if (!error && code === 200) {
  781. if (showTip) window?.$message?.success('保存成功')
  782. newaddId.value = data
  783. return true
  784. } else {
  785. window.$message.error(msg)
  786. return false
  787. }
  788. } else {
  789. window?.$message?.warning('请先修改完红色输入框的数据')
  790. return false
  791. }
  792. }
  793. //预览PDF
  794. const getBussPdfInfo = async ({ pKeyId }, showTip = true) => {
  795. const pkeyIds = getValString(pKeyId)
  796. if (pkeyIds) {
  797. const { id } = baseData.value
  798. const { error, code, data } = await dataApi.getBussPdf({
  799. id: id.length > 0 ? id : newaddId.value,
  800. pKeyId: pkeyIds,
  801. }, false)
  802. if (!error && code === 200) {
  803. if (data) {
  804. toPdfPage(data)
  805. //window.open(data, '_blank')
  806. } else if (showTip) {
  807. window?.$message?.warning('PDF错误')
  808. }
  809. } else {
  810. if (showTip) {
  811. window?.$message?.warning(data.msg || '获取PDF失败')
  812. }
  813. }
  814. } else {
  815. window?.$message?.warning('pkeyId为空')
  816. }
  817. }
  818. const delClickLoading = ref(false)
  819. //删除本表
  820. const delClick = async ({ pKeyId }, index) => {
  821. const pkeyIds = getValString(pKeyId)
  822. if (pkeyIds) {
  823. const { id } = baseData.value
  824. delClickLoading.value = true
  825. const { error, code, msg } = await dataApi.removeBussTabInfo({
  826. // id: id,
  827. pKeyId: pkeyIds,
  828. })
  829. if (!error && code === 200) {
  830. window?.$message?.success('操作成功')
  831. // renewData(id)
  832. listDatas.value.splice(index, 1)
  833. formData.value.splice(index, 1)
  834. chageOrinData()
  835. delClickLoading.value = false
  836. } else {
  837. window.$message.error(msg)
  838. delClickLoading.value = false
  839. }
  840. } else {
  841. window?.$message?.warning('pkeyId为空')
  842. delClickLoading.value = false
  843. }
  844. }
  845. const copyClickLoading = ref(false)
  846. //复制本表
  847. const copyClick = async (item, index) => {
  848. const pkeyIds = getValString(item.pKeyId)
  849. if (pkeyIds) {
  850. if (isStatus.value !== '3') {
  851. if (item.isRenderTableForm && !item.isCancopy) {
  852. // window.$message.warning('请先保存数据再复制本表')
  853. copyClickLoading.value = true
  854. const res = await saveExcelBussData(item, index)
  855. if (res) {
  856. // renewData(newaddId.value)
  857. await copeBussTab(pkeyIds)
  858. } else {
  859. copyClickLoading.value = false
  860. window?.$message?.warning('复制本表操作失败')
  861. }
  862. } else {
  863. if (!item.isRenderTableForm) {
  864. await copeBussTab(pkeyIds)
  865. } else if (!item.isTableForm) {
  866. window?.$message?.warning('暂无表单数据')
  867. } else if (item.isRenderTableForm) {
  868. await copeBussTab(pkeyIds)
  869. } else {
  870. window?.$message?.warning(`数据异常了, isRenderTableForm: ${item.isRenderTableForm}, isTableForm: ${item.isTableForm}, pKeyId:${pkeyIds}`)
  871. }
  872. }
  873. } else {
  874. window?.$message?.warning('已上报的资料,不允许复制')
  875. }
  876. } else {
  877. window?.$message?.warning('pkeyId为空')
  878. }
  879. }
  880. const copeBussTab = async (pkeyIds) => {
  881. const { id, contractId } = baseData.value
  882. copyClickLoading.value = true
  883. const { error, code, msg } = await dataApi.copyBussTab({
  884. id: id || newaddId.value,
  885. pKeyId: pkeyIds,
  886. contractId: contractId,
  887. })
  888. if (!error && code === 200) {
  889. window?.$message?.success('操作成功')
  890. // renewData(id)
  891. chageOrinData()
  892. getNewList( )
  893. } else {
  894. window.$message.error(msg)
  895. }
  896. copyClickLoading.value = false
  897. }
  898. //获取表单列表
  899. const getNewList = (id)=>{
  900. emit('getList', id)
  901. setTimeout(() => {
  902. let newObj = newlistdata.value
  903. let oldObj = listDatas.value
  904. const addedObject = newObj.find(obj => !oldObj.some(oldObj => oldObj.pKeyId === obj.pKeyId))
  905. let index = arrIndex(newlistdata.value, 'pKeyId', addedObject.pKeyId) // 1
  906. listDatas.value.splice(index, 0, addedObject)
  907. formData.value.splice(index, 0, addedObject)
  908. }, 1000)
  909. }
  910. //隐藏本表
  911. const hideClick = async ({ pKeyId, isBussShow }, index) => {
  912. if (isBussShow === 1) {
  913. ActiveKey.value = ''
  914. }
  915. const pkeyIds = getValString(pKeyId)
  916. if (pkeyIds) {
  917. if (isStatus.value !== '3') {
  918. const { id } = baseData.value
  919. const isBussShows = isBussShow === 2 ? 1 : 2 //状态(1显示 2隐藏)
  920. const { error, code, msg } = await dataApi.showBussTab({
  921. id: id,
  922. pKeyId: pkeyIds,
  923. status: isBussShows,
  924. })
  925. if (!error && code === 200) {
  926. window?.$message?.success('操作成功')
  927. // renewData(id)
  928. listDatas.value[index].isBussShow = isBussShows
  929. changeisHide(pkeyIds, isBussShow, id)
  930. formData.value[index].isBussShow = isBussShows
  931. } else {
  932. window.$message.error(msg)
  933. }
  934. } else {
  935. window?.$message?.warning('已上报的资料,不允许隐藏')
  936. }
  937. } else {
  938. window?.$message?.warning('pkeyId为空')
  939. }
  940. }
  941. //预览
  942. const previewClick = async (item) => {
  943. await getBussPdfInfo(item)
  944. }
  945. //上传变量
  946. const uploadModal = ref(false)
  947. const fileListData = ref([])
  948. const uploadData = ref({})
  949. const tableTypeValue = ref('')
  950. //上传被点击
  951. const uploadClick = (item, index) => {
  952. const pkeyIds = item.pKeyId ? item.pKeyId + '' : ''
  953. const { id } = baseData.value
  954. const tableType = item.tableType ? item.tableType : ''
  955. tableTypeValue.value = item.tableType ? item.tableType : ''
  956. const classify = authBtnTabKeyType.value
  957. const keyName = `item-${index}-${pkeyIds}`
  958. if (pkeyIds) {
  959. if (isStatus.value !== '3' && item.isTableForm) {
  960. uploadModal.value = true
  961. uploadData.value = getFormDataInit(item, pkeyIds)
  962. uploadData.value.tableType = tableType
  963. uploadData.value.classify = classify
  964. uploadData.value.id = id
  965. //获取文件列表
  966. getBussFileList(pkeyIds)
  967. } else if (!item.isRenderTableForm) {
  968. CollapseChange(keyName)
  969. window?.$message?.warning('请再次点击上传')
  970. } else if (!item.isTableForm) {
  971. window?.$message?.warning('暂无表单数据')
  972. } else {
  973. window?.$message?.warning('已上报的资料,不允许上传')
  974. }
  975. } else {
  976. window?.$message?.warning('pkeyId为空')
  977. }
  978. }
  979. //获取文件列表
  980. const getBussFileList = async (pkeyId) => {
  981. const { id } = baseData.value
  982. const { error, code, data } = await wbsApi.getBussFileList1({
  983. pkeyid: pkeyId,
  984. id: id,
  985. })
  986. if (!error && code === 200) {
  987. fileListData.value = getArrValue(data)
  988. } else {
  989. fileListData.value = []
  990. }
  991. }
  992. //上传文件
  993. const uploadChange = async ({ type }) => {
  994. const { id } = baseData.value
  995. if (type === 'success') {
  996. uploadModal.value = false
  997. renewData(id)
  998. } else if (type === 'del') {
  999. renewData(id)
  1000. }
  1001. }
  1002. //相关变量
  1003. const tableFormItemNode = ref({})
  1004. //菜单数据
  1005. const tableFormMenu = ref([
  1006. { label: '容器参数', key: 'vessel' },
  1007. { label: '引用设备仪器', key: 'device' },
  1008. { label: '插入特殊字符', key: 'special' },
  1009. ])
  1010. //鼠标右键事件
  1011. const contextMenuRef = ref(null)
  1012. const onRightClick = (event, KeyName, index) => {
  1013. //取光标位置
  1014. const specialDom = document.getElementById(KeyName + '')
  1015. const startPos = specialDom?.selectionStart || 0
  1016. const endPos = specialDom?.selectionEnd || 0
  1017. //存储临时信息
  1018. tableFormItemNode.value = { KeyName, index, startPos, endPos, pkeyId: formKeyIds.value }
  1019. contextMenuRef.value?.showMenu(event) //展开菜单
  1020. }
  1021. //鼠标右键菜单被点击
  1022. const handleMenuSelect = ({ key }) => {
  1023. if (key === 'vessel') {
  1024. vesselModal.value = true
  1025. getMenusData()
  1026. } else if (key === 'special') {
  1027. specialModalShow()
  1028. } else if (key === 'device') {
  1029. deviceModal.value = true
  1030. nextTick(() => {
  1031. deviceTableRef.value?.clearSelection()
  1032. })
  1033. getequipmentMenusData()
  1034. }
  1035. }
  1036. //引用容器参数
  1037. const vesselModal = ref(false)
  1038. const vesselTableRef = ref(null)
  1039. //引用容器参数菜单数据
  1040. const menuProps = {
  1041. key: 'id',
  1042. label: 'containerName',
  1043. }
  1044. //引用容器参数菜单数据
  1045. const equipmentmenuProps = {
  1046. key: 'id',
  1047. label: 'className',
  1048. }
  1049. const menus = ref([])
  1050. const getMenusData = async () => {
  1051. const { data } = await dataApi1.queryClassification({
  1052. projectId: projectId.value,
  1053. contractId: contractId.value,
  1054. })
  1055. const arr = getArrValue(data)
  1056. menus.value = arr
  1057. if (arr.length > 0) {
  1058. const item = arr[0]
  1059. menuItem.value = item
  1060. menuKey.value = item?.id
  1061. vesselTableColumn.value = []
  1062. if (item?.fieldList && item?.fieldList.length > 0) {
  1063. item?.fieldList.forEach((item1) => {
  1064. vesselTableColumn.value.push(({
  1065. key: item1?.fieldKey,
  1066. name: item1?.fieldName,
  1067. }))
  1068. })
  1069. }
  1070. getVesselTableData()
  1071. }
  1072. }
  1073. //菜单被点击
  1074. const menuKey = ref()
  1075. const menuItem = ref({})
  1076. const menuChange = (item) => {
  1077. menuItem.value = item
  1078. menuKey.value = item?.id
  1079. vesselTableColumn.value = []
  1080. item?.fieldList.forEach((item1) => {
  1081. vesselTableColumn.value.push(({
  1082. key: item1?.fieldKey,
  1083. name: item1?.fieldName,
  1084. }))
  1085. })
  1086. getVesselTableData()
  1087. }
  1088. //表格数据
  1089. const vesselTableColumn = ref([
  1090. // {key:'key_1', name: '容器编号'},
  1091. ])
  1092. const vesselTableData = ref([])
  1093. const vesselTablePage = ref({ current: 1, size: 20, total: 0 })
  1094. const vesselTablePageChange = ({ current, size }) => {
  1095. vesselTablePage.value.current = current
  1096. vesselTablePage.value.size = size
  1097. getVesselTableData()
  1098. }
  1099. //获取表格数据
  1100. const vesselTableLoading = ref(false)
  1101. const getVesselTableData = async () => {
  1102. const { fieldList } = menuItem.value
  1103. const fieldLists = getArrValue(fieldList)
  1104. if (fieldLists.length > 0) {
  1105. vesselTableLoading.value = true
  1106. const { error, code, data } = await dataApi1.queryPage({
  1107. projectId: projectId.value,
  1108. contractId: contractId.value,
  1109. containerId: menuKey.value,
  1110. fieldKey: fieldList[0].fieldKey,
  1111. size: vesselTablePage.value.size,
  1112. current: vesselTablePage.value.current,
  1113. })
  1114. //处理数据
  1115. vesselTableLoading.value = false
  1116. if (!error && code === 200) {
  1117. vesselTableData.value = getArrValue(data['records'])
  1118. vesselTablePage.value.total = data.total || 0
  1119. } else {
  1120. vesselTableData.value = []
  1121. vesselTablePage.value.total = 0
  1122. }
  1123. }
  1124. }
  1125. //多选
  1126. const vesselTableKeys = ref([])
  1127. const vesselTableSelection = (rows) => {
  1128. vesselTableKeys.value = rows
  1129. }
  1130. //确认引用
  1131. const vesselModalSave = () => {
  1132. if (vesselTableKeys.value.length > 0) {
  1133. const item = tableFormItemNode.value
  1134. const form = formData.value[item.index]
  1135. const val = []
  1136. vesselTableKeys.value.forEach((item) => {
  1137. val.push(item.key_2)
  1138. })
  1139. const newval = val.join('、')
  1140. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
  1141. vesselModal.value = false
  1142. let posVal = item.startPos + newval.length
  1143. nextTick(() => {
  1144. setPosRange(item.KeyName, posVal)
  1145. })
  1146. } else {
  1147. window?.$message?.warning('请先选择引用容器参数')
  1148. }
  1149. }
  1150. //关闭
  1151. const vesselModalClose = () => {
  1152. vesselModal.value = false
  1153. }
  1154. const equipmentmenus = ref([])
  1155. const getequipmentMenusData = async () => {
  1156. const { data } = await getClassList({
  1157. projectId: projectId.value,
  1158. contractId: contractId.value,
  1159. })
  1160. const arr = getArrValue(data)
  1161. equipmentmenus.value = arr
  1162. if (arr.length > 0) {
  1163. const item = arr[0]
  1164. equipmentmenuItem.value = item
  1165. equipmentmenuKey.value = item?.id
  1166. getDeviceTableData()
  1167. }
  1168. }
  1169. //菜单被点击
  1170. const equipmentmenuKey = ref()
  1171. const equipmentmenuItem = ref({})
  1172. const equipmentmenuChange = (item) => {
  1173. equipmentmenuItem.value = item
  1174. equipmentmenuKey.value = item?.id
  1175. getDeviceTableData()
  1176. }
  1177. //引用设备仪器
  1178. const deviceModal = ref(false)
  1179. const deviceTableRef = ref(null)
  1180. //表格数据
  1181. const deviceTableColumn = ref([
  1182. { key: 'deviceNumber', name: '设备编号' },
  1183. { key: 'deviceName', name: '设备仪器名称' },
  1184. ])
  1185. const deviceTableData = ref([])
  1186. const equipmentPage = ref({ current: 1, size: 20, total: 0 })
  1187. const equipmentTablePageChange = ({ current, size }) => {
  1188. equipmentPage.value.current = current
  1189. equipmentPage.value.size = size
  1190. getDeviceTableData()
  1191. }
  1192. //数组去重
  1193. let temp = []
  1194. const getnewArr = (tempArr) => {
  1195. tempArr.forEach(function (a) {
  1196. let check = temp.every(function (b) {
  1197. return a.id !== b.id
  1198. })
  1199. check ? temp.push(a) : ''
  1200. })
  1201. return temp
  1202. }
  1203. //获取表格数据
  1204. const deviceTableLoading = ref(false)
  1205. const getDeviceTableData = async () => {
  1206. deviceTableLoading.value = true
  1207. const { error, code, data } = await dataApi2.queryPage({
  1208. projectId: projectId.value,
  1209. contractId: contractId.value,
  1210. deviceClassId: equipmentmenuKey.value,
  1211. size: equipmentPage.value.size,
  1212. current: equipmentPage.value.current,
  1213. })
  1214. //处理数据
  1215. deviceTableLoading.value = false
  1216. if (!error && code === 200) {
  1217. deviceTableData.value = getArrValue(data['records'])
  1218. equipmentPage.value.total = data.total || 0
  1219. //去重
  1220. let uniqueArray = getnewArr(checkList.value)
  1221. deviceTableKeys.value = uniqueArray
  1222. if (uniqueArray.length > 0) {
  1223. uniqueArray.forEach((item) => {
  1224. if (item.deviceClassId === equipmentmenuKey.value) {
  1225. deviceTableData.value.forEach((ele) => {
  1226. if (ele.id === item.id) {
  1227. item = ele
  1228. }
  1229. })
  1230. nextTick(() => {
  1231. deviceTableRef.value?.toggleRowSelection(item, true)
  1232. })
  1233. }
  1234. })
  1235. }
  1236. } else {
  1237. deviceTableData.value = []
  1238. equipmentPage.value.total = 0
  1239. }
  1240. }
  1241. //多选
  1242. const deviceTableKeys = ref([])
  1243. //选中的设备仪器
  1244. const checkList = ref([])
  1245. const deviceTableSelection = (rows) => {
  1246. // deviceTableKeys.value = rows
  1247. if (rows.length > 0) {
  1248. rows.forEach((item) => {
  1249. checkList.value.push(item)
  1250. })
  1251. //去重
  1252. let uniqueArray = getnewArr(checkList.value)
  1253. deviceTableKeys.value = uniqueArray
  1254. }
  1255. }
  1256. //确认引用
  1257. const deviceModalSave = () => {
  1258. if (deviceTableKeys.value.length > 0) {
  1259. const item = tableFormItemNode.value
  1260. const form = formData.value[item.index]
  1261. const val = []
  1262. const idarr = []
  1263. const listr = []
  1264. deviceTableKeys.value.forEach((item) => {
  1265. val.push(item.deviceNumber)
  1266. idarr.push(item.id)
  1267. listr.push(item.deviceNumber + '_' + item.deviceName)
  1268. })
  1269. const newval = listr.join('、')
  1270. const idval = idarr.join(',')
  1271. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], newval)
  1272. vesselModal.value = false
  1273. let posVal = item.startPos + newval.length
  1274. nextTick(() => {
  1275. setPosRange(item.KeyName, posVal)
  1276. })
  1277. deviceModal.value = false
  1278. emit('updeviceUseIds', idval)
  1279. } else {
  1280. window?.$message?.warning('请先选择引用容器设备')
  1281. }
  1282. deviceTableKeys.value = []
  1283. checkList.value = []
  1284. temp = []
  1285. }
  1286. //关闭
  1287. const deviceModalClose = () => {
  1288. deviceModal.value = false
  1289. deviceTableKeys.value = []
  1290. checkList.value = []
  1291. temp = []
  1292. }
  1293. //插入特殊字符
  1294. const specialModal = ref(false)
  1295. const specialCharacters = ref([
  1296. '&#57344;', '&#57345;', '&#57346;', '&#57347;', '&#8804;', '&#8805;', '&#8451;',
  1297. '&#9312;', '&#9313;', '&#9314;', '&#9315;', '&#9316;', '&#9317;', '&#9318;', '&#9319;', '&#9320;', '&#9321;', '&#9322;', '&#9323;',
  1298. '&#9324;', '&#9325;', '&#9326;', '&#9327;', '&#9328;', '&#9329;', '&#9330;', '&#9331;',
  1299. '&#8544;', '&#8545;', '&#8546;', '&#8547;', '&#8548;', '&#8549;', '&#8550;', '&#8551;', '&#8552;', '&#8553;', '&#8554;', '&#8555;', 'K̅',
  1300. ])
  1301. //输入框验证
  1302. const specialFormRef = ref(null)
  1303. const specialFormModel = ref({ val: '' })
  1304. const specialFormRules = {
  1305. val: {
  1306. required: true,
  1307. trigger: 'blur',
  1308. message: '请选择特殊字符代码',
  1309. },
  1310. }
  1311. //显示插入特殊字符
  1312. const specialRef = ref(null)
  1313. const specialModalShow = () => {
  1314. specialFormModel.value.val = ''
  1315. specialModal.value = true
  1316. nextTick(() => {
  1317. specialRef.value?.focus()
  1318. })
  1319. }
  1320. //失去焦点
  1321. const specialPos = ref({ start: 0, end: 0 })
  1322. const specialInputBlur = (e) => {
  1323. specialPos.value = {
  1324. start: e?.target?.selectionStart || 0,
  1325. end: e?.target?.selectionEnd || 0,
  1326. }
  1327. }
  1328. //点击符号
  1329. const specialClick = (event) => {
  1330. const text = event?.target?.innerText ?? ''
  1331. const start = specialPos.value.start
  1332. const end = specialPos.value.end
  1333. const form = specialFormModel.value.val
  1334. specialFormModel.value.val = setPosInsert(start, end, form, text)
  1335. specialRef.value?.focus()
  1336. let posVal = start + text.length
  1337. nextTick(() => {
  1338. setPosRange('specialId', posVal)
  1339. })
  1340. }
  1341. //确认插入
  1342. const specialNodeClick = async () => {
  1343. const res = await formValidate(specialFormRef.value)
  1344. if (res) {
  1345. const item = tableFormItemNode.value
  1346. const form = formData.value[item.index]
  1347. const val = specialFormModel.value.val ?? ''
  1348. formData.value[item.index][item.KeyName] = setPosInsert(item.startPos, item.endPos, form[item.KeyName], val)
  1349. specialModal.value = false
  1350. specialRef.value?.focus()
  1351. let posVal = item.startPos + val.length
  1352. nextTick(() => {
  1353. setPosRange(item.KeyName, posVal)
  1354. })
  1355. }
  1356. }
  1357. //被点击
  1358. const getOffsetTop = (key = '') => {
  1359. if (key) {
  1360. const dom = document.getElementById(key)
  1361. emit('offsetTop', dom.offsetTop)
  1362. } else {
  1363. emit('offsetTop', 0)
  1364. }
  1365. }
  1366. //通知数据更新
  1367. const renewData = (newaddId) => {
  1368. emit('renew', newaddId, ActiveKey.value)
  1369. ActiveKey.value = ''
  1370. }
  1371. const changeisHide = (pKeyId, isBussShow, id) => {
  1372. emit('changesdate', pKeyId, isBussShow, id)
  1373. }
  1374. const chageOrinData = () => {
  1375. emit('chageorinData')
  1376. }
  1377. //获取表单数据
  1378. const getFormData = () => {
  1379. const formArr = formData.value
  1380. return formArr.filter((item) => {
  1381. return item
  1382. })
  1383. }
  1384. const setFormChart = async () => {
  1385. const form = getFormData()
  1386. for (let i = 0; i < form.length; i++) {
  1387. const { pkeyId, formchartKeyShow } = form[i]
  1388. if (formchartKeyShow) {
  1389. const { ref } = await getChartRef(pkeyId, formchartKeyShow)
  1390. if (ref) {
  1391. const url = await uploadChartImgFile(ref?.getImage())
  1392. const name = `${formchartKeyShow}_url`
  1393. form[i][name] = url
  1394. }
  1395. }
  1396. }
  1397. return form
  1398. }
  1399. //获取表单效验数据
  1400. const getFormRegExpJson = () => {
  1401. return deepClone(formRegExpJson.value)
  1402. }
  1403. //获取当前展开项
  1404. const getActiveKey = () => {
  1405. return ActiveKey.value
  1406. }
  1407. //设置当前展开项
  1408. const setActiveKey = (key) => {
  1409. return ActiveKey.value = key
  1410. }
  1411. //打开窗口
  1412. const windowClick = (item, indexs)=>{
  1413. if (!item.isWindow) {
  1414. console.log(item, 'item')
  1415. const formSize = getTableFormSize(item?.pKeyId)
  1416. console.log(formSize, 'formSize')
  1417. const list = deepClone(DragModalTableForm.value)
  1418. let index = arrIndex(list, 'pKeyId', item.pKeyId)
  1419. const newTableForm = {
  1420. ...setInitDragModalTableForm(item, indexs),
  1421. ...formSize,
  1422. }
  1423. console.log(newTableForm, 'newTableForm')
  1424. item.isWindow = true
  1425. //弹窗表单的排序
  1426. if (index === -1) {
  1427. list.push(newTableForm)
  1428. } else if (index !== list.length - 1) {
  1429. //检查是否在最上层,不在则置顶,可以解决多次点击时,频繁更改全局状态的问题
  1430. list.splice(index, 1)
  1431. list.push(newTableForm)
  1432. }
  1433. DragModalTableForm.value = list
  1434. ActiveKey.value = ''
  1435. const { pKeyId } = item
  1436. let KeyId = `item-${indexs}-${pKeyId}`
  1437. CollapseChange(KeyId)
  1438. }
  1439. }
  1440. //获取表单的大小
  1441. const getTableFormSize = (pkeyId) => {
  1442. let formId = `table-form-${pkeyId}`
  1443. try {
  1444. const { clientWidth, clientHeight } = document.getElementById(formId).children[0]
  1445. return {
  1446. width: (clientWidth + 40) + 'px',
  1447. height: (clientHeight + 80) + 'px',
  1448. }
  1449. } catch {
  1450. return {
  1451. width: '100%',
  1452. height: '100%',
  1453. }
  1454. }
  1455. }
  1456. //初始拖动表单的内容
  1457. const setInitDragModalTableForm = (item, index) => {
  1458. console.log(item, 'item1111')
  1459. return {
  1460. projectId: projectId.value,
  1461. contractId: contractId.value,
  1462. pkeyId: item.pKeyId,
  1463. height: '100%',
  1464. width: '100%',
  1465. title: item.nodeName,
  1466. isShow: true,
  1467. index: index,
  1468. item: item,
  1469. }
  1470. }
  1471. //关闭窗口
  1472. const windowCloseClick = (item, indexs)=>{
  1473. ActiveKey.value = ''
  1474. }
  1475. const DragModalTableForm = ref([])
  1476. const DragModalHeight = ref(600)
  1477. const closeIconArr = [
  1478. { key: 'reduction', icon: 'picture-in-picture-2', name: '还原到面板内,并自动展开面板' },
  1479. ]
  1480. //关闭窗口
  1481. const TableFormClose = async ({ pkeyId, index }, indexs, type) => {
  1482. const list = deepClone(DragModalTableForm.value)
  1483. //取表单的数据
  1484. // await setChangeFormDatas(pkeyId, 'collapse')
  1485. //关闭窗口
  1486. list.splice(indexs, 1)
  1487. DragModalTableForm.value = list
  1488. listDatas.value[index].isWindow = false
  1489. if (type) {
  1490. ActiveKey.value = ''
  1491. }
  1492. }
  1493. const dragNodeMoreMenu = [
  1494. { key: 'save', icon: 'save-2', name: '保存' },
  1495. { key: 'preview', icon: 'eye', name: '预览' },
  1496. ]
  1497. //还原窗口
  1498. const closeIconTap = async (event, item, indexs) => {
  1499. item.isShow = false
  1500. item.isWindow = false
  1501. const { index, pkeyId } = item
  1502. let KeyId = `item-${index}-${pkeyId}`
  1503. await TableFormClose(item, indexs, false)
  1504. console.log(item, 'KeyId')
  1505. CollapseChange(KeyId)
  1506. item.isWindow = false
  1507. }
  1508. //菜单被点击
  1509. const dragNodeMoreMenuTap = async ({ key }, items, indexs) => {
  1510. const { item } = items
  1511. console.log(item, 'item')
  1512. console.log(items, 'items')
  1513. if (key === 'save') {
  1514. if (item?.isTableForm) {
  1515. items.tableFormSaveLoading = true
  1516. await tableFormSaveClick(item, indexs)
  1517. items.tableFormSaveLoading = false
  1518. } else {
  1519. window.$message.warning('此表单暂无数据和文件')
  1520. }
  1521. } else if (key === 'preview') {
  1522. if (item.isBussShow === 2 || item.isTabPdf === 1) {
  1523. window.$message.warning('此表单暂无可预览文件')
  1524. } else {
  1525. previewClick(item, items)
  1526. }
  1527. }
  1528. }
  1529. //清空窗口表单列表
  1530. const clearDragModalTableForm = ()=>{
  1531. DragModalTableForm.value = []
  1532. }
  1533. //下载导入模板
  1534. const downloadLoading = ref(false)
  1535. const getdownloadExcel = async (pKeyId)=>{
  1536. downloadLoading.value = true
  1537. const { error, disposition, res } = await wbsApi.downloadExcel({ pKeyId: pKeyId })
  1538. //处理数据
  1539. downloadLoading.value = false
  1540. if (!error) {
  1541. if (disposition) {
  1542. downloadBlob(res, disposition)
  1543. } else {
  1544. window.$message?.error('数据异常')
  1545. }
  1546. }
  1547. }
  1548. //下载模板
  1549. const downModal = (item)=>{
  1550. const { pKeyId } = item
  1551. getdownloadExcel(pKeyId)
  1552. }
  1553. //导入模板
  1554. const checkItem = ref({})
  1555. //打开文件选择框
  1556. const uploadFileClick = (item) => {
  1557. checkItem.value = item
  1558. HcUploadFileApi({
  1559. url: '/api/blade-manager/wbsTreeContract/import-excel',
  1560. accept: '.png,.jpg,jpeg,.xls,.xlsx,.pdf,.doc,.docx',
  1561. accept_tip: '图片(png、jpg、jpeg)<br/>Excel(xls、xlsx)<br/>PDF<br/>Word(doc、docx)',
  1562. size: 80,
  1563. multiple: false,
  1564. params: { pKeyId: item.pKeyId },
  1565. success: (file, res) => {
  1566. let changeitem = formData.value.filter(item => item.pkeyId === item.pKeyId)
  1567. let obj = changeitem[0]
  1568. for (let i in res.data) {
  1569. obj[i] = res[i]
  1570. }
  1571. window.$message.success('文件上传成功')
  1572. },
  1573. error: () => {
  1574. window.$message.error('文件上传失败')
  1575. },
  1576. })
  1577. }
  1578. //操作提示
  1579. const actionTipModal = ref(false)
  1580. const actionTipModalClose = () => {
  1581. actionTipModal.value = false
  1582. }
  1583. //关联设备数据
  1584. const isLinkAcquisition = ref(false)
  1585. const linkAcquisitionItem = ref({})
  1586. const linkAcquisitionClick = (item) => {
  1587. linkAcquisitionItem.value = item
  1588. isLinkAcquisition.value = true
  1589. }
  1590. //确定
  1591. const linksAcquisitionClick = () => {
  1592. linksAcquisitionClose()
  1593. }
  1594. //关闭关联
  1595. const linksAcquisitionClose = () => {
  1596. isLinkAcquisition.value = false
  1597. }
  1598. // 暴露出去
  1599. defineExpose({
  1600. setFormChart,
  1601. getFormData,
  1602. getFormRegExpJson,
  1603. getActiveKey,
  1604. setActiveKey,
  1605. changeSimpleInput,
  1606. changePositionInput,
  1607. clearDragModalTableForm,
  1608. setCollapseKey,
  1609. })
  1610. </script>
  1611. <style lang="scss" scoped>
  1612. .data-fill-list-box {
  1613. position: relative;
  1614. //margin-bottom: 25%;
  1615. .hc-collapse-item-header {
  1616. flex: 1;
  1617. position: relative;
  1618. margin-left: 10px;
  1619. display: flex;
  1620. align-items: center;
  1621. .real-fill-rate {
  1622. position: relative;
  1623. height: 100%;
  1624. line-height: initial;
  1625. margin-right: 18px;
  1626. padding-right: 18px;
  1627. &::after {
  1628. content: "";
  1629. background: #bfc8cf;
  1630. position: absolute;
  1631. right: 0;
  1632. height: 100%;
  1633. width: 1px;
  1634. top: 0;
  1635. }
  1636. .tag {
  1637. position: relative;
  1638. background: white;
  1639. font-size: 12px;
  1640. color: #BD3124;
  1641. padding: 1px 6px;
  1642. border-radius: 3px;
  1643. border: 1px solid #BD3124;
  1644. margin-bottom: 2px;
  1645. margin-top: 2px;
  1646. }
  1647. .tag.yes {
  1648. color: #88CF65;
  1649. border-color: #88CF65;
  1650. }
  1651. }
  1652. .item-title {
  1653. flex: 1;
  1654. position: relative;
  1655. user-select: none;
  1656. color: #591BB7;
  1657. font-size: 16px;
  1658. font-weight: bold;
  1659. cursor: pointer;
  1660. }
  1661. .hc-extra-text-box {
  1662. position: relative;
  1663. padding-right: 24px;
  1664. line-height: initial;
  1665. }
  1666. }
  1667. .data-fill-list-item-content {
  1668. position: relative;
  1669. height: calc(100vh - 265px);
  1670. .data-fill-table-form-box {
  1671. position: relative;
  1672. padding: 24px 20px;
  1673. height: calc(100% - 36px);
  1674. overflow: auto;
  1675. border: 4px solid #c4c4c4;
  1676. &.is-window {
  1677. border: 0;
  1678. .hc-window-tip {
  1679. position: relative;
  1680. height: 100%;
  1681. display: flex;
  1682. justify-content: center;
  1683. align-items: center;
  1684. .table-form-no {
  1685. position: relative;
  1686. img {
  1687. width: 380px;
  1688. }
  1689. .desc {
  1690. text-align: center;
  1691. font-size: 20px;
  1692. color: #aaa;
  1693. }
  1694. }
  1695. }
  1696. }
  1697. .form-window-icon {
  1698. position: absolute;
  1699. top: 10px;
  1700. right: 10px;
  1701. background: #3794FF;
  1702. color: white;
  1703. font-size: 20px;
  1704. width: 32px;
  1705. height: 32px;
  1706. display: flex;
  1707. justify-content: center;
  1708. align-items: center;
  1709. border-radius: 30px;
  1710. cursor: pointer;
  1711. &:hover {
  1712. background: #204DA0;
  1713. }
  1714. }
  1715. .hc-no-table-form {
  1716. position: relative;
  1717. height: 100%;
  1718. display: flex;
  1719. justify-content: center;
  1720. align-items: center;
  1721. .table-form-no {
  1722. position: relative;
  1723. img {
  1724. width: 350px;
  1725. }
  1726. .desc {
  1727. text-align: center;
  1728. font-size: 20px;
  1729. color: #aaa;
  1730. }
  1731. }
  1732. }
  1733. }
  1734. .data-fill-table-action {
  1735. position: relative;
  1736. display: flex;
  1737. align-items: center;
  1738. padding: 4px 10px;
  1739. .tip-action {
  1740. cursor: pointer;
  1741. margin-right: 24px;
  1742. }
  1743. .link-action {
  1744. position: relative;
  1745. flex: 1;
  1746. }
  1747. .btn-action {
  1748. position: relative;
  1749. }
  1750. }
  1751. }
  1752. }
  1753. .special-box {
  1754. position: relative;
  1755. display: flex;
  1756. justify-content: center;
  1757. align-items: center;
  1758. border: 1px solid #eee;
  1759. border-radius: 3px;
  1760. height: 52px;
  1761. width: 52px;
  1762. cursor: pointer;
  1763. user-select: none;
  1764. transition: color .3s, background-color .3s;
  1765. &:hover {
  1766. color: var(--el-color-primary);
  1767. background-color: var(--el-color-primary-light-8);
  1768. }
  1769. .font-EUDC {
  1770. font-size: 22px;
  1771. }
  1772. }
  1773. .data-fill-table-tip-box {
  1774. position: relative;
  1775. .tip-title {
  1776. font-size: 16px;
  1777. margin-bottom: 10px;
  1778. display: flex;
  1779. align-items: center;
  1780. }
  1781. .tip-item {
  1782. margin-bottom: 20px;
  1783. }
  1784. .table-tip-foot {
  1785. position: absolute;
  1786. bottom: 15px;
  1787. right: 0;
  1788. left: 0;
  1789. display: flex;
  1790. align-items: center;
  1791. padding: 0 15px;
  1792. .tip-left-btn {
  1793. flex: 1;
  1794. .dow-text {
  1795. cursor: pointer;
  1796. display: flex;
  1797. align-items: center;
  1798. }
  1799. }
  1800. }
  1801. }
  1802. </style>
  1803. <style lang="scss">
  1804. .data-fill-list-box {
  1805. .el-collapse {
  1806. --el-collapse-header-height: 50px;
  1807. border: 0;
  1808. .el-collapse-item {
  1809. margin: 0 0 6px;
  1810. background-color: #E6EEF4;
  1811. border: 1px solid #E9E9E9;
  1812. border-radius: 4px;
  1813. }
  1814. .el-collapse-item__header {
  1815. background-color: transparent;
  1816. font-weight: 400;
  1817. border-bottom: 0;
  1818. cursor: default;
  1819. font-size: 14px;
  1820. .el-collapse-item__arrow {
  1821. display: none;
  1822. }
  1823. }
  1824. .el-collapse-item.is-active .el-collapse-item__header.is-active {
  1825. background-color: #E7EEF4;
  1826. }
  1827. .el-collapse-item__wrap {
  1828. background-color: transparent;
  1829. border-bottom: 0;
  1830. .el-collapse-item__content {
  1831. position: relative;
  1832. padding-bottom: 0;
  1833. font-size: 14px;
  1834. color: #50545E;
  1835. line-height: initial;
  1836. }
  1837. }
  1838. }
  1839. .hc-collapse-item-header .real-fill-rate .el-link {
  1840. font-size: 12px;
  1841. }
  1842. .el-link {
  1843. text-decoration: underline;
  1844. &:hover {
  1845. text-decoration: auto;
  1846. }
  1847. }
  1848. .el-link + .el-link {
  1849. margin-left: 20px;
  1850. }
  1851. }
  1852. //插入特殊字符弹窗的输入框
  1853. .data-fill-list-box .data-fill-table-form-box td,
  1854. .data-fill-list-box .data-fill-table-form-box td .el-input .el-input__wrapper .el-input__inner,
  1855. .el-form-item.special-form-item .el-form-item__content .el-input .el-input__wrapper .el-input__inner {
  1856. font-family: "hc-eudc", hc-sans, 宋体, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  1857. }
  1858. //引用容器参数弹窗
  1859. //关联试验数据
  1860. .adding-form-dialog-box {
  1861. position: relative;
  1862. height: 100%;
  1863. display: flex;
  1864. .dialog-tree-box {
  1865. position: relative;
  1866. border-right: 1px solid #EEEEEE;
  1867. width: 500px;
  1868. height: 100%
  1869. }
  1870. .dialog-table-box {
  1871. position: relative;
  1872. flex: 1;
  1873. height: 100%;
  1874. padding: 18px;
  1875. .dialog-search {
  1876. position: relative;
  1877. display: flex;
  1878. }
  1879. .dialog-table {
  1880. position: relative;
  1881. height: calc(100% - 68px);
  1882. padding: 18px 0;
  1883. }
  1884. .dialog-pages {
  1885. position: relative;
  1886. }
  1887. }
  1888. }
  1889. .hc-window-switch-box {
  1890. display: flex;
  1891. align-items: center;
  1892. position: absolute;
  1893. top: 14px;
  1894. right: 260px;
  1895. .icon-btn-view {
  1896. padding: 0 18px;
  1897. height: 34px;
  1898. display: flex;
  1899. align-items: center;
  1900. justify-content: center;
  1901. color: #ffffff;
  1902. cursor: pointer;
  1903. user-select: none;
  1904. border-radius: 80px;
  1905. box-shadow: 4px 4px 8px 0 rgba(54, 92, 167, 0.15), -3px -2px 8px 0 #ffffff;
  1906. background: linear-gradient(to right, var(--el-color-primary-light-5), var(--el-color-primary), var(--el-color-primary-dark-2));
  1907. background-size: 200%;
  1908. transition: background-position .5s;
  1909. .icon {
  1910. font-size: 16px;
  1911. }
  1912. &:hover {
  1913. background-position: 100% 0;
  1914. }
  1915. }
  1916. }
  1917. </style>