|
@@ -1,82 +1,32 @@
|
|
|
<template>
|
|
|
- <hc-drawer
|
|
|
- v-model="isShow"
|
|
|
- to-id="hc-main-box"
|
|
|
- is-close
|
|
|
- @close="drawerClose"
|
|
|
- >
|
|
|
+ <hc-drawer v-model="isShow" to-id="hc-main-box" is-close @close="drawerClose">
|
|
|
<hc-body split :options="{ sizes: [14, 96] }">
|
|
|
<template #left>
|
|
|
<hc-card scrollbar>
|
|
|
<h3 class="mb-2">引用元素表</h3>
|
|
|
- <ElTree
|
|
|
- v-if="isShowTree"
|
|
|
- :load="treeLoadNode"
|
|
|
- :props="treeProps"
|
|
|
- accordion
|
|
|
- highlight-current
|
|
|
- lazy
|
|
|
- @node-click="treeNodeTap"
|
|
|
- />
|
|
|
+ <ElTree v-if="isShowTree" :load="treeLoadNode" :props="treeProps" accordion highlight-current lazy @node-click="treeNodeTap" />
|
|
|
</hc-card>
|
|
|
</template>
|
|
|
<hc-card>
|
|
|
<template #header>
|
|
|
<div class="w-400px">
|
|
|
- <hc-search-input
|
|
|
- v-model="searchForm.titleName"
|
|
|
- @search="searchClick"
|
|
|
- />
|
|
|
+ <hc-search-input v-model="searchForm.titleName" @search="searchClick" />
|
|
|
</div>
|
|
|
</template>
|
|
|
<template #extra>
|
|
|
- <el-button hc-btn type="primary" @click="quteEleTableClick">
|
|
|
- 引用元素表单库
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- hc-btn
|
|
|
- type="danger"
|
|
|
- :loading="batchDelLoad"
|
|
|
- @click="batchDel"
|
|
|
- >
|
|
|
- 删除元素表
|
|
|
- </el-button>
|
|
|
+ <el-button hc-btn type="primary" @click="quteEleTableClick">引用元素表单库</el-button>
|
|
|
+ <el-button hc-btn type="danger" :loading="batchDelLoad" @click="batchDel">删除元素表</el-button>
|
|
|
</template>
|
|
|
<hc-table
|
|
|
- :column="tableColumn"
|
|
|
- :datas="tableData"
|
|
|
- :loading="tableLoading"
|
|
|
- :index-style="{ width: 60 }"
|
|
|
- is-check
|
|
|
- :check-style="{ width: 29 }"
|
|
|
- @selection-change="tableCheckChange"
|
|
|
+ :column="tableColumn" :datas="tableData" :loading="tableLoading" :index-style="{ width: 60 }"
|
|
|
+ is-check :check-style="{ width: 29 }" @selection-change="tableCheckChange"
|
|
|
>
|
|
|
<template #action="{ row }">
|
|
|
- <el-link type="primary" @click="linkExcelClick(row)">
|
|
|
- 关联清表
|
|
|
- </el-link>
|
|
|
- <el-link
|
|
|
- v-loading="editElementLoading"
|
|
|
- type="primary"
|
|
|
- :disabled="row.excelIds == -1"
|
|
|
- @click="editElement(row)"
|
|
|
- >
|
|
|
- 编辑元素
|
|
|
- </el-link>
|
|
|
- <el-link
|
|
|
- v-loading="adjustExcelLoading"
|
|
|
- type="primary"
|
|
|
- :disabled="row.excelIds == -1"
|
|
|
- @click="adjustExcelClick(row)"
|
|
|
- >
|
|
|
- 调整表单
|
|
|
- </el-link>
|
|
|
- <el-link type="primary" @click="rowFormulaClick(row)">
|
|
|
- 编辑公式
|
|
|
- </el-link>
|
|
|
- <el-link type="primary" @click="assignWbs(row)">
|
|
|
- 分配WBS
|
|
|
- </el-link>
|
|
|
+ <el-link type="primary" @click="linkExcelClick(row)">关联清表</el-link>
|
|
|
+ <el-link v-loading="editElementLoading" type="primary" :disabled="row.excelIds == -1" @click="editElement(row)">编辑元素</el-link>
|
|
|
+ <el-link v-loading="adjustExcelLoading" type="primary" :disabled="row.excelIds == -1" @click="adjustExcelClick(row)">调整表单</el-link>
|
|
|
+ <el-link type="primary" @click="rowFormulaClick(row)">编辑公式</el-link>
|
|
|
+ <el-link type="primary" @click="assignWbs(row)">分配WBS</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
<template #action>
|
|
@@ -85,38 +35,28 @@
|
|
|
</hc-card>
|
|
|
</hc-body>
|
|
|
<!-- 引用元素表 -->
|
|
|
- <quteElePage
|
|
|
- v-model="quteEleShow"
|
|
|
- :project-id="projectId"
|
|
|
- @close="quteEleClose"
|
|
|
- />
|
|
|
+ <quteElePage v-model="quteEleShow" :project-id="projectId" @close="quteEleClose" />
|
|
|
<!-- 关联清表 -->
|
|
|
- <HcAssociationList
|
|
|
- v-model="isAssociationShow"
|
|
|
- :info="associationInfo"
|
|
|
- :type="2"
|
|
|
- />
|
|
|
+ <HcAssociationList v-model="isAssociationShow" :info="associationInfo" :type="2" />
|
|
|
<!-- 编辑元素 -->
|
|
|
- <HcEditElement
|
|
|
- v-model="isEditElementShow"
|
|
|
- :info="editElementInfo"
|
|
|
- :data="editElementData"
|
|
|
- :type="2"
|
|
|
- @to-page="editElementToPage"
|
|
|
- />
|
|
|
+ <HcEditElement v-model="isEditElementShow" :info="editElementInfo" :data="editElementData" :type="2" @to-page="editElementToPage" />
|
|
|
<!-- 调整表单 -->
|
|
|
- <HcAdjustExcel
|
|
|
- v-model="isAdjustExcelShow"
|
|
|
- :info="adjustExcelInfo"
|
|
|
- :type="2"
|
|
|
- />
|
|
|
+ <HcAdjustExcel v-model="isAdjustExcelShow" :info="adjustExcelInfo" :type="2" />
|
|
|
<!-- 分配WBS -->
|
|
|
- <allocateWbs
|
|
|
- v-model="isAllocateShow"
|
|
|
- :wbs-type="wbsType"
|
|
|
- :project-id="projectId"
|
|
|
- :data="allocateWbsInfo"
|
|
|
- />
|
|
|
+ <allocateWbs v-model="isAllocateShow" :wbs-type="wbsType" :project-id="projectId" :data="allocateWbsInfo" />
|
|
|
+ <!-- 编辑元素公式 -->
|
|
|
+ <hc-dialog v-model="elementFormulasShow" :footer="false" title="元素公式" is-table widths="660px" @close="elementFormulasClose">
|
|
|
+ <template #search>
|
|
|
+ <hc-search-input v-model="formulaInput" @search="searchFormulaClick" />
|
|
|
+ </template>
|
|
|
+ <hc-table :column="formulaTableColumn" :datas="formulaTableData" :is-current-row="false" :is-index="false">
|
|
|
+ <template #action="{ row }">
|
|
|
+ <el-link :type="row.globalFormula === 1 ? 'warning' : 'primary'" @click="toFormulaGlobal(row)">全局公式</el-link>
|
|
|
+ </template>
|
|
|
+ </hc-table>
|
|
|
+ </hc-dialog>
|
|
|
+ <!-- 编辑公式 -->
|
|
|
+ <HcEditFormula v-model="isEditFormulaShow" :data="editFormulaData" @finish="editFormulaFinish" />
|
|
|
</hc-drawer>
|
|
|
</template>
|
|
|
|
|
@@ -124,13 +64,18 @@
|
|
|
import { nextTick, ref, watch } from 'vue'
|
|
|
import { HcDelMsg } from 'hc-vue3-ui'
|
|
|
import { arrToId, deepClone, getArrValue, isNullES } from 'js-fast-way'
|
|
|
-import privateApi from '~api/wbs/private'
|
|
|
-import excelApi from '~api/exctab/exceltab'
|
|
|
+
|
|
|
+import HcEditFormula from '~src/views/project/list/edit-formula.vue'
|
|
|
import quteElePage from './quteElePage.vue'
|
|
|
import HcAssociationList from '../association-list.vue'
|
|
|
import HcEditElement from '../edit-element.vue'
|
|
|
import HcAdjustExcel from '../adjust-excel.vue'
|
|
|
import allocateWbs from './allocateWbs.vue'
|
|
|
+
|
|
|
+import privateApi from '~api/wbs/private'
|
|
|
+import excelApi from '~api/exctab/exceltab'
|
|
|
+import treeApi from '~api/wbs/tree'
|
|
|
+
|
|
|
const props = defineProps({
|
|
|
projectId: {
|
|
|
type: String,
|
|
@@ -305,9 +250,70 @@ const linkExcelClick = async (item) => {
|
|
|
}
|
|
|
|
|
|
//公式配置
|
|
|
-const rowFormulaClick = (row) => {
|
|
|
+const elementFormulasObj = ref({})
|
|
|
+const elementFormulasShow = ref(false)
|
|
|
+const rowFormulaClick = async (row) => {
|
|
|
+ elementFormulasObj.value = row
|
|
|
+ elementFormulasShow.value = true
|
|
|
+ const { data } = await treeApi.getTableElments({
|
|
|
+ id: row.initTableId,
|
|
|
+ })
|
|
|
+ const arr = getArrValue(data)
|
|
|
+ formulaTableData.value = arr
|
|
|
+ formulaTableList.value = deepClone(arr)
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+//元素公式列表
|
|
|
+const formulaTableColumn = [
|
|
|
+ { key: 'eName', name: '字段信息' },
|
|
|
+ { key: 'action', name: '操作', width: 80, align: 'center' },
|
|
|
+]
|
|
|
+const formulaTableData = ref([])
|
|
|
+const formulaTableList = ref([])
|
|
|
|
|
|
+// 搜索元素公式
|
|
|
+const formulaInput = ref('')
|
|
|
+const searchFormulaClick = () => {
|
|
|
+ const arr = formulaTableList.value
|
|
|
+ formulaTableData.value = arr.filter(({ eName }) => {
|
|
|
+ return eName.indexOf(formulaInput.value) > -1
|
|
|
+ })
|
|
|
+}
|
|
|
+
|
|
|
+//编辑元素公式关闭
|
|
|
+const elementFormulasClose = () => {
|
|
|
+ elementFormulasShow.value = false
|
|
|
+ formulaTableData.value = []
|
|
|
+ formulaTableList.value = []
|
|
|
}
|
|
|
+
|
|
|
+//全局公式
|
|
|
+const editFormulaData = ref({})
|
|
|
+const isEditFormulaShow = ref(false)
|
|
|
+const toFormulaGlobal = async (row) => {
|
|
|
+ elementFormulasClose()
|
|
|
+ const obj = elementFormulasObj.value
|
|
|
+ const nodeId = nodeInfo.value.id
|
|
|
+ editFormulaData.value = {
|
|
|
+ node: obj,
|
|
|
+ pid: projectId.value,
|
|
|
+ //wbsId: wbsId.value,
|
|
|
+ nodeId: nodeId,
|
|
|
+ eleId: row.id,
|
|
|
+ eleType: true,
|
|
|
+ globalType: 1,
|
|
|
+ }
|
|
|
+ await nextTick()
|
|
|
+ isEditFormulaShow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//公式操作完成
|
|
|
+const editFormulaFinish = () => {
|
|
|
+
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//分配WBS
|
|
|
const isAllocateShow = ref(false)
|
|
|
const allocateWbsInfo = ref({})
|