ListItem.vue 64 KB

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