8
0

wbs-tree.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672
  1. <template>
  2. <hc-drawer v-model="isShow" is-close to-id="hc-project-list">
  3. <div class="hc-project-wbs-tree flex">
  4. <div class="header hc-flex">
  5. <div class="name flex-1">{{ typeLable }} - {{ projectInfo.projectName }}</div>
  6. <div class="hc-flex">
  7. <el-dropdown trigger="click">
  8. <el-button hc-btn type="success">
  9. <span>数据同步</span>
  10. <hc-icon name="arrow-down-s" />
  11. </el-button>
  12. <template #dropdown>
  13. <el-dropdown-menu>
  14. <template v-for="item in dataSyncMenu" :key="item.key">
  15. <el-dropdown-item @click="dataSyncMenuClick(item)">{{ item.name }}</el-dropdown-item>
  16. </template>
  17. </el-dropdown-menu>
  18. </template>
  19. </el-dropdown>
  20. <el-button v-if="isFormSet" class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">表单设置</el-button>
  21. <el-button v-else class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">元素设置</el-button>
  22. <el-button hc-btn type="danger">节点参数</el-button>
  23. <el-button hc-btn color="#626aef">独立表单库</el-button>
  24. <el-button hc-btn type="warning">归档文件时间</el-button>
  25. </div>
  26. </div>
  27. <div class="body">
  28. <hc-body split padding="8px">
  29. <template #left>
  30. <hc-card v-loading="isTreeLoading" title="工程节点信息" scrollbar class="is-tree">
  31. <template #search>
  32. <hc-search-input v-model="searchTree.queryValue" @search="searchTreeClick">
  33. <template #prepend>
  34. <el-select v-model="searchTree.type" placeholder="类型" style="width: 75px">
  35. <el-option label="节点" value="1" />
  36. <el-option label="表名" value="2" />
  37. </el-select>
  38. </template>
  39. </hc-search-input>
  40. </template>
  41. <hc-data-tree
  42. v-if="isSearchTree" :h-props="treeProps" :datas="treeLoadData" tree-key="id" :auto-expand-keys="treeExpandKeys"
  43. :menus="treeMenus" @menu-tap="treeMenuClick" @node-tap="treeNodeClick"
  44. />
  45. <hc-lazy-tree
  46. v-else :h-props="treeProps" tree-key="id" :auto-expand-keys="treeExpandKeys"
  47. :menus="treeMenus" @load="treeLoadNode" @menu-tap="treeMenuClick" @node-tap="treeNodeClick"
  48. />
  49. </hc-card>
  50. </template>
  51. <template v-if="isFormSet">
  52. <div class="body-top">
  53. <hc-card title="节点信息">
  54. <hc-table :is-index="false" :column="nodeTableColumn" :datas="nodeTableData">
  55. <template #nodeType="{ row }">{{ getDictionaryName(nodeTypelist, row.nodeType, true) }}</template>
  56. </hc-table>
  57. </hc-card>
  58. </div>
  59. <div class="body-content">
  60. <hc-card title="当前项目信息表">
  61. <template #extra>
  62. <el-button hc-btn type="primary" :disabled="infoTableData.length <= 0">编辑</el-button>
  63. <el-button hc-btn type="success" :disabled="infoTableData.length <= 0">排序</el-button>
  64. </template>
  65. <hc-table v-loading="infoTableLoading" :is-index="false" :column="infoTableColumn" :datas="infoTableData">
  66. <template #tableType="{ row }">{{ getDictionaryName(tableTypelist, row.tableType, true) }}</template>
  67. <template #tableOwner="{ row }">{{ getDictionaryName(ownerTypeList, row.tableOwner, true) }}</template>
  68. <template #action="{ row }">
  69. <el-link type="primary">预览</el-link>
  70. <el-link v-if="row.status === 1" type="warning">隐藏表单</el-link>
  71. <el-link v-if="row.status === 0" type="success">取消隐藏</el-link>
  72. <el-link v-del-com:[delInfoTableRow]="row" type="danger">删除</el-link>
  73. </template>
  74. </hc-table>
  75. </hc-card>
  76. </div>
  77. </template>
  78. <template v-else>
  79. <hc-card>
  80. <hc-table v-loading="infoTableLoading" :is-index="false" :column="infoTableColumn1" :datas="infoTableData">
  81. <template #tableType="{ row }">{{ getDictionaryName(tableTypelist, row.tableType, true) }}</template>
  82. <template #isLinkTable="{ row }">{{ row.isLinkTable === 2 ? '是' : '否' }}</template>
  83. <template #tableOwner="{ row }">{{ getDictionaryName(ownerTypeList, row.tableOwner, true) }}</template>
  84. <template #action="{ row }">
  85. <el-link type="success">关联清表</el-link>
  86. <el-link type="primary" :disabled="row.excelId === -1 || isNullES(row.excelId)">编辑元素</el-link>
  87. <el-link v-loading="adjustExcelLoading" type="warning" :disabled="row.excelId === -1 || isNullES(row.excelId)" @click="adjustExcelClick(row)">调整表单</el-link>
  88. <el-link type="primary">编辑元素公式</el-link>
  89. <el-link type="warning">表单同步</el-link>
  90. <el-link type="primary">关联节点</el-link>
  91. <el-link v-del-com:[delInfoTableRow]="row" type="danger">删除表单</el-link>
  92. </template>
  93. </hc-table>
  94. </hc-card>
  95. </template>
  96. </hc-body>
  97. </div>
  98. </div>
  99. <!-- 编辑节点 -->
  100. <TreeNodeEditDialog
  101. v-model="isTreeNodeEditShow" :node="treeInfo" :type="Number(isType)" :wid="wbsId" :pid="projectInfo.id" :tree-props="treeProps"
  102. :node-type="nodeTypelist" :major-type="majorDataTypeList" @close="treeNodeEditClose" @change="treeNodeEditChange"
  103. />
  104. <!-- 节点排序 -->
  105. <hc-new-dialog v-model="nodeSortModalShow" is-table widths="1100px" title="调整排序" @save="nodeSortModalSave">
  106. <hc-table
  107. ui="hc-table-row-drop" :column="nodeSortTableColumn" :datas="nodeSortTableData"
  108. :loading="nodeSortNodeLoading" is-row-drop quick-sort :index-style="{ width: 80 }"
  109. @row-drop="nodeSortTableRowDrop" @row-sort="nodeSortTableRowDrop"
  110. >
  111. <template #action="{ row, index }">
  112. <span class="text-xl" :class="index === 0 ? 'text-gray' : 'text-link'" @click="upNodeSortClick(row, index)">
  113. <hc-icon name="arrow-up" fill />
  114. </span>
  115. <span class="ml-2 text-xl" :class="index === (nodeSortTableData.length - 1) ? 'text-gray' : 'text-link'" @click="downNodeSortClick(row, index)">
  116. <hc-icon name="arrow-down" fill />
  117. </span>
  118. </template>
  119. </hc-table>
  120. </hc-new-dialog>
  121. <!-- 调整表单 -->
  122. <HcAdjustExcel v-model="isAdjustExcelShow" :info="adjustExcelInfo" />
  123. </hc-drawer>
  124. </template>
  125. <script setup>
  126. import { nextTick, onDeactivated, ref, watch } from 'vue'
  127. import { useAppStore } from '~src/store'
  128. import { HcFirmMsg, getStore, setStore } from 'hc-vue3-ui'
  129. import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
  130. import { getDictionaryData, reloadPage } from '~uti/tools'
  131. import TreeNodeEditDialog from './tree-node-edit.vue'
  132. import HcAdjustExcel from './adjust-excel.vue'
  133. import excelApi from '~api/exctab/exceltab'
  134. import wbsTreeApi from '~api/wbs/tree'
  135. import mainApi from '~api/wbs/private'
  136. const props = defineProps({
  137. type: {
  138. type: [String, Number],
  139. default: '1',
  140. },
  141. info: {
  142. type: Object,
  143. default: () => ({}),
  144. },
  145. })
  146. //事件
  147. const emit = defineEmits(['change', 'close'])
  148. //双向绑定
  149. // eslint-disable-next-line no-undef
  150. const isShow = defineModel('modelValue', {
  151. default: false,
  152. })
  153. const store = useAppStore()
  154. //监听数据
  155. const isType = ref(props.type)
  156. const projectInfo = ref(props.info)
  157. watch(() => [props.type, props.info], ([type, info]) => {
  158. isType.value = type
  159. projectInfo.value = info
  160. }, { deep: true })
  161. //监听显示
  162. watch(isShow, (val) => {
  163. if (val) {
  164. getProjectData()
  165. } else {
  166. //projectInfo.value = {}
  167. //isType.value = ''
  168. emit('close')
  169. }
  170. })
  171. //获取项目信息
  172. const typeLable = ref('')
  173. const wbsId = ref('')
  174. const getProjectData = () => {
  175. const type = isType.value ?? 1
  176. const wbsArr = ['WBS树管理', '实验划分', '计量管理', '日志树管理', '征拆划分']
  177. typeLable.value = wbsArr[Number(type) - 1]
  178. const wbsIds = [
  179. 'referenceWbsTemplateId', 'referenceWbsTemplateIdTrial',
  180. 'referenceWbsTemplateIdMeter', 'referenceLogWbsTemplateId',
  181. 'referenceWbsTemplateIdLar',
  182. ]
  183. wbsId.value = projectInfo.value[wbsIds[Number(type) - 1]]
  184. console.log('info: ', projectInfo.value)
  185. getNodeTypelist(Number(type) - 1)
  186. getTableTypelist(Number(type) - 1)
  187. getDataTypelist()
  188. getOwnerTypelist()
  189. getMajorDataTypeList()
  190. }
  191. //获取节点类型
  192. const nodeTypelist = ref([])
  193. const getNodeTypelist = async (type) => {
  194. //计量管理,征拆划分,实验划分,WBS树管理,日志树管理
  195. const types = ['wbs_node_type', 'trial_node_type', 'meter_node_type', 'wbs_node_type', 'lar_node_type']
  196. const data = await getDictionaryData(types[type])
  197. nodeTypelist.value = getArrValue(data)
  198. }
  199. //获取表单类型
  200. const tableTypelist = ref([])
  201. const getTableTypelist = async (type) => {
  202. //计量管理,征拆划分,实验划分,WBS树管理,日志树管理
  203. const types = ['table_type', 'trial_table_type', 'table_type', 'table_type', 'table_type']
  204. const data = await getDictionaryData(types[type])
  205. tableTypelist.value = getArrValue(data)
  206. }
  207. //获取数据类型
  208. const dataTypeList = ref([])
  209. const getDataTypelist = async () => {
  210. const data = await getDictionaryData('data_type')
  211. dataTypeList.value = getArrValue(data)
  212. }
  213. //获取业主类型
  214. const ownerTypeList = ref([])
  215. const getOwnerTypelist = async () => {
  216. const data = await getDictionaryData('owner_type')
  217. ownerTypeList.value = getArrValue(data)
  218. }
  219. //获取类型字典
  220. const majorDataTypeList = ref([])
  221. const getMajorDataTypeList = async () => {
  222. const data = await getDictionaryData('major_data_type')
  223. majorDataTypeList.value = getArrValue(data)
  224. }
  225. //获取字典里的数据
  226. const getDictionaryName = (arr, id, name) => {
  227. if (isNullES(id)) return name ? '' : {}
  228. const item = arr.find((item) => item.value === Number(id))
  229. return name ? item?.label : getObjValue(item)
  230. }
  231. //树节点搜索
  232. const isSearchTree = ref(false)
  233. const isTreeLoading = ref(false)
  234. const searchTree = ref({ queryValue: '', type: '1' })
  235. const searchTreeClick = () => {
  236. const { queryValue } = searchTree.value
  237. isSearchTree.value = !isNullES(queryValue)
  238. getTreeLoadData()
  239. }
  240. //获取搜索树的数据
  241. const treeLoadData = ref([])
  242. const getTreeLoadData = async () => {
  243. isTreeLoading.value = true
  244. const { data } = await wbsTreeApi.getQueryValueByType({
  245. ...searchTree.value,
  246. wbsId: wbsId.value,
  247. projectId: projectInfo.value.id,
  248. })
  249. treeLoadData.value = getArrValue(data)
  250. isTreeLoading.value = false
  251. }
  252. //树属性
  253. const treeExpandKeys = ref(getStore('project-wbs-tree-expand-keys') || [])
  254. const treeProps = {
  255. children: 'children',
  256. label: 'title',
  257. isLeaf: ({ hasChildren, isExistForm, majorDataType, nodeType }) => {
  258. let tag = false
  259. if (!hasChildren) {
  260. tag = true
  261. }
  262. if (isExistForm === 1) {
  263. tag = true
  264. }
  265. if (nodeType >= 6 && nodeType <= 13) {
  266. tag = true
  267. }
  268. //中间交工。开工报告、质量评定)
  269. if (majorDataType >= 1 && majorDataType <= 3) {
  270. tag = true
  271. }
  272. return tag
  273. },
  274. }
  275. //树的右键菜单
  276. const treeMenus = [
  277. { icon: 'draft', label: '编辑节点', key: 'edit' },
  278. { icon: 'refresh', label: '同步新增元素表单', key: 'sync1' },
  279. { icon: 'loop-left', label: '同步元素表单排序到合同段', key: 'sync3' },
  280. { icon: 'loop-right', label: '同步节点基础信息及表单URL', key: 'sync2' },
  281. { icon: 'arrow-up-down', label: '调整排序', key: 'rank' },
  282. { icon: 'delete-bin', label: '删除节点', key: 'del' },
  283. ]
  284. //菜单被点击
  285. const treeMenuItem = ref({})
  286. const treeMenuClick = async ({ key, node, data }) => {
  287. if (key === 'edit') { //编辑节点
  288. data.parentName = node?.parent?.data?.title ?? '' //获取父节点名称
  289. treeItem.value = data
  290. await getTreeDetail()
  291. await nextTick()
  292. isTreeNodeEditShow.value = true
  293. } else if (key === 'sync1') {
  294. const { primaryKeyId, pKeyId } = data
  295. const pid = primaryKeyId ? primaryKeyId : pKeyId
  296. if (isNullES(pid)) {
  297. window.$message.warning('参数异常,请稍后重试')
  298. return
  299. }
  300. //同步新增元素表单
  301. await HcFirmMsg({
  302. text: `是否同步节点【${data.title}】?`,
  303. loadingText: '数据同步中...',
  304. }, (resolve) => {
  305. const { isRes } = mainApi.syncNodeTable(pid)
  306. resolve() //关闭弹窗
  307. if (!isRes) return
  308. window.$message.success('同步成功')
  309. getInfoTableData()
  310. })
  311. } else if (key === 'sync3') {
  312. const { id } = projectInfo.value
  313. if (isNullES(id)) {
  314. window.$message.warning('参数异常,请稍后重试')
  315. return
  316. }
  317. //同步元素表单排序到合同段
  318. await HcFirmMsg({
  319. text: '同步元素表单排序到合同段?',
  320. loadingText: '数据同步中...',
  321. }, (resolve) => {
  322. const { isRes } = mainApi.syncContractTabSort(id)
  323. resolve() //关闭弹窗
  324. if (!isRes) return
  325. window.$message.success('同步成功')
  326. getInfoTableData()
  327. })
  328. } else if (key === 'sync2') {
  329. const { primaryKeyId, pKeyId } = data
  330. const pid = primaryKeyId ? primaryKeyId : pKeyId
  331. if (isNullES(pid)) {
  332. window.$message.warning('参数异常,请稍后重试')
  333. return
  334. }
  335. //同步节点基础信息及表单URL
  336. await HcFirmMsg({
  337. text: `是否同步节点【${data.title}】到合同段?`,
  338. loadingText: '数据同步中...',
  339. }, (resolve) => {
  340. const { isRes } = mainApi.syncNodeinfo(pid)
  341. resolve() //关闭弹窗
  342. if (!isRes) return
  343. window.$message.success('同步成功')
  344. getInfoTableData()
  345. })
  346. } else if (key === 'rank') {
  347. const { parentId } = data
  348. const { id } = projectInfo.value
  349. if (isNullES(id) || isNullES(wbsId.value)) {
  350. window.$message.warning('参数异常,请稍后重试')
  351. return
  352. }
  353. //调整排序
  354. nodeSortModalShow.value = true
  355. nodeSortNodeLoading.value = true
  356. const { data: apiData } = await wbsTreeApi.findWbsTreePrivateSameLevel({
  357. parentId: parentId,
  358. projectId: id,
  359. wbsId: wbsId.value,
  360. })
  361. nodeSortNodeLoading.value = false
  362. nodeSortTableData.value = getArrValue(apiData)
  363. } else if (key === 'del') {
  364. if (node.level <= 1) {
  365. window.$message.warning('当前节点无法删除')
  366. return
  367. }
  368. const { primaryKeyId, pKeyId } = data
  369. const pid = primaryKeyId ? primaryKeyId : pKeyId
  370. if (isNullES(pid)) {
  371. window.$message.warning('参数异常,请稍后重试')
  372. return
  373. }
  374. //删除节点
  375. await HcFirmMsg({
  376. text: `此操作将删除节点【${data.title}】,是否继续?`,
  377. loadingText: '删除节点中...',
  378. }, (resolve) => {
  379. const { isRes } = mainApi.del(pid)
  380. resolve() //关闭弹窗
  381. if (!isRes) return
  382. window.$message.success('删除成功')
  383. reloadPage()
  384. })
  385. }
  386. }
  387. //节点排序
  388. const nodeSortModalShow = ref(false)
  389. const nodeSortTableColumn = ref([
  390. { key:'tableName', name: '节点名称' },
  391. { key:'action', name: '排序', width: 90 },
  392. ])
  393. const nodeSortTableData = ref([])
  394. const nodeSortNodeLoading = ref(false)
  395. //拖动完成
  396. const nodeSortTableRowDrop = (rows) => {
  397. nodeSortTableData.value = [] // 先清空,否则排序会异常
  398. nextTick(() => {
  399. nodeSortTableData.value = rows
  400. })
  401. }
  402. //向上
  403. const upNodeSortClick = (row, index) => {
  404. const data = nodeSortTableData.value || []
  405. if (index !== 0) {
  406. const tmp = data.splice(index - 1, 1)
  407. nodeSortTableData.value.splice(index, 0, tmp[0])
  408. } else {
  409. window?.$message?.warning('已经处于置顶,无法上移')
  410. }
  411. }
  412. //向下
  413. const downNodeSortClick = (row, index) => {
  414. const indexs = index + 1
  415. const data = nodeSortTableData.value
  416. if (indexs !== data.length) {
  417. const tmp = data.splice(indexs, 1)
  418. nodeSortTableData.value.splice(index, 0, tmp[0])
  419. } else {
  420. window?.$message?.warning('已经处于置底,无法下移')
  421. }
  422. }
  423. //节点排序完成
  424. const nodeSortModalSave = async () => {
  425. const arr = deepClone(nodeSortTableData.value)
  426. if (arr.length <= 0) {
  427. window.$message.warning('数据异常,请稍后重试')
  428. nodeSortModalShow.value = false
  429. return
  430. }
  431. //处理顺序
  432. for (let i = 0; i < arr.length; i++) {
  433. arr[i].sort = i + 1
  434. }
  435. //发起请求
  436. const { isRes } = await wbsTreeApi.wbsTreePrivateSort(arr)
  437. if (!isRes) return
  438. window.$message.success('排序完成')
  439. nodeSortModalShow.value = false
  440. reloadPage()
  441. }
  442. //编辑节点
  443. const isTreeNodeEditShow = ref(false)
  444. //编辑节点被关闭
  445. const treeNodeEditClose = () => {
  446. isTreeNodeEditShow.value = false
  447. treeMenuItem.value = {}
  448. }
  449. //编辑节点被修改
  450. const treeNodeEditChange = () => {
  451. isTreeNodeEditShow.value = false
  452. treeMenuItem.value = {}
  453. console.log('编辑节点被修改')
  454. }
  455. //懒加载树
  456. const treeLoadNode = async ({ item, level }, resolve) => {
  457. let pid = level !== 0 ? item.id : 0
  458. const { data } = await mainApi.getLazytree({
  459. wbsId: wbsId.value,
  460. parentId: pid,
  461. tenantId: store.tenantId,
  462. projectId: projectInfo.value.id,
  463. wbsType: isType.value,
  464. })
  465. resolve(getArrValue(data))
  466. }
  467. //节点信息
  468. const nodeTableColumn = ref([
  469. { key: 'nodeName', name: '当前节点', align: 'center' },
  470. { key: 'nodeType', name: '节点类型', align: 'center' },
  471. { key: 'parentName', name: '上级节点', align: 'center' },
  472. ])
  473. const nodeTableData = ref([])
  474. //节点被点击
  475. const treeItem = ref({})
  476. const treeNodeClick = ({ node, data, keys }) => {
  477. //获取父节点名称
  478. let parentName = ''
  479. if (node?.parent?.data) {
  480. parentName = node.parent.data.title ?? ''
  481. }
  482. data.parentName = parentName
  483. //设置相关数据
  484. treeItem.value = getObjValue(data)
  485. setStore('project-wbs-tree-expand-keys', keys)
  486. treeExpandKeys.value = getArrValue(keys)
  487. //获取节点详情
  488. getTreeDetail()
  489. getInfoTableData()
  490. }
  491. //获取节点详情
  492. const treeInfo = ref({})
  493. const getTreeDetail = async () => {
  494. const { id, parentName } = treeItem.value
  495. const { data } = await mainApi.detail({
  496. id,
  497. wbsId: wbsId.value,
  498. projectId: projectInfo.value.id,
  499. })
  500. const res = getObjValue(data)
  501. res.parentName = parentName
  502. treeInfo.value = res
  503. nodeTableData.value = [res]
  504. }
  505. //当前项目信息表
  506. const infoTableLoading = ref(false)
  507. const infoTableColumn = ref([
  508. { key: 'tableName', name: '表单名称' },
  509. { key: 'elementTotal', name: '字段总量', align: 'center', width: 80 },
  510. { key: 'fillRate', name: '填报率', align: 'center', width: 80 },
  511. { key: 'tableType', name: '表单类型', align: 'center', width: 100 },
  512. { key: 'tableOwner', name: '所属方', align: 'center', width: 100 },
  513. { key: 'action', name: '操作', align: 'center', width: 160 },
  514. ])
  515. const infoTableData = ref([])
  516. const getInfoTableData = async () => {
  517. const { id } = treeItem.value
  518. infoTableLoading.value = true
  519. const { data } = await mainApi.findNodeTableByCondition({
  520. parentId: id,
  521. wbsId: wbsId.value,
  522. projectId: projectInfo.value.id,
  523. })
  524. infoTableData.value = getArrValue(data)
  525. infoTableLoading.value = false
  526. }
  527. //当前项目信息表删除
  528. const delInfoTableRow = async ({ item }, resolve) => {
  529. const { isRes } = await mainApi.removeTableByCondition({
  530. id: item.id,
  531. wbsId: wbsId.value,
  532. projectId: projectInfo.value.id,
  533. })
  534. resolve() //关闭弹窗
  535. if (!isRes) return
  536. window.$message.success('删除成功')
  537. getInfoTableData().then()
  538. }
  539. //表单设置
  540. const isFormSet = ref(true)
  541. const infoTableColumn1 = ref([
  542. { key: 'tableName', name: '表单名称' },
  543. { key: 'tableType', name: '表单类型', align: 'center', width: 80 },
  544. { key: 'fillRate', name: '填报率', align: 'center', width: 80 },
  545. { key: 'isLinkTable', name: '关联清表', align: 'center', width: 80 },
  546. { key: 'tableOwner', name: '所属方', align: 'center', width: 100 },
  547. { key: 'action', name: '操作', width: 490, align: 'center' },
  548. ])
  549. const setIsFormSetValue = () => {
  550. isFormSet.value = !isFormSet.value
  551. if (isFormSet.value) {
  552. getTreeDetail()
  553. }
  554. getInfoTableData()
  555. }
  556. //数据同步按钮菜单
  557. const dataSyncMenu = [
  558. { key: 'jdSync', name: '节点参数同步', load:false },
  559. { key: 'dqSync', name: '电签同步', load:false },
  560. { key: 'gsSync', name: '公式同步', load:false },
  561. ]
  562. const dataSyncMenuClick = (item) => {
  563. console.log( item)
  564. }
  565. //调整表单
  566. const isAdjustExcelShow = ref(false)
  567. const adjustExcelLoading = ref(false)
  568. const adjustExcelInfo = ref({})
  569. const adjustExcelClick = async (row) => {
  570. const { pkeyId, excelId } = row
  571. if (isNullES(pkeyId) || isNullES(excelId)) {
  572. window?.$message.warning('表单值异常,请联系管理员')
  573. return
  574. }
  575. adjustExcelLoading.value = true
  576. const { code, data } = await excelApi.getExcelHtml({ pkeyId })
  577. if (code !== 200 || isNullES(data)) {
  578. adjustExcelLoading.value = false
  579. window?.$message.warning('表单异常,请联系管理员')
  580. return
  581. }
  582. adjustExcelInfo.value = deepClone(row)
  583. adjustExcelLoading.value = false
  584. isAdjustExcelShow.value = true
  585. }
  586. //离开了当前页面
  587. onDeactivated(() => {
  588. isAdjustExcelShow.value = false
  589. })
  590. </script>
  591. <style scoped lang="scss">
  592. .hc-project-wbs-tree {
  593. position: relative;
  594. background: #ececec;
  595. border-radius: 4px;
  596. height: 100%;
  597. flex-direction: column;
  598. overflow: hidden;
  599. .header {
  600. color: white;
  601. background: #54565A;
  602. padding: 10px 14px;
  603. flex-shrink: 0;
  604. .name {
  605. white-space:nowrap;
  606. overflow:hidden;
  607. text-overflow:ellipsis;
  608. }
  609. }
  610. .body {
  611. flex: 1;
  612. flex-basis: auto;
  613. position: relative;
  614. }
  615. }
  616. </style>
  617. <style lang="scss">
  618. .hc-project-wbs-tree .body {
  619. .el-card.hc-card-box {
  620. --el-card-padding: 12px;
  621. --el-card-border-radius: 5px;
  622. }
  623. .hc-page-split-content {
  624. position: relative;
  625. .body-top {
  626. position: relative;
  627. height: 119.5px;
  628. }
  629. .body-content {
  630. position: relative;
  631. margin-top: 10px;
  632. height: calc(100% - 129.5px);
  633. }
  634. }
  635. }
  636. </style>