|
@@ -125,17 +125,19 @@
|
|
|
<!-- 调整表单 -->
|
|
|
<HcAdjustExcel v-model="isAdjustExcelShow" :info="adjustExcelInfo" />
|
|
|
<!-- 编辑元素公式 -->
|
|
|
- <hc-dialog v-model="elementFormulasShow" is-table widths="600px" title="编辑元素公式" :footer="false" @close="elementFormulasClose">
|
|
|
+ <hc-dialog v-model="elementFormulasShow" is-table widths="600px" :title="elementFormulasName" :footer="false" @close="elementFormulasClose">
|
|
|
<template #search>
|
|
|
<hc-search-input v-model="formulaInput" @search="searchFormulaClick" />
|
|
|
</template>
|
|
|
<hc-table v-loading="formulaTableLoading" :is-index="false" :is-current-row="false" :column="formulaTableColumn" :datas="formulaTableData">
|
|
|
<template #action="{ row }">
|
|
|
- <el-link :type="row.globalFormula === 1 ? 'warning' : 'primary'">全局公式</el-link>
|
|
|
- <el-link v-show="row.hasPartFormula" :type="row.isSaveFormula === 1 ? 'warning' : 'primary'">节点公式</el-link>
|
|
|
+ <el-link :type="row.globalFormula === 1 ? 'warning' : 'primary'" @click="toFormulaGlobal(row)">全局公式</el-link>
|
|
|
+ <el-link v-show="row.hasPartFormula" :type="row.isSaveFormula === 1 ? 'warning' : 'primary'" @click="toFormulaNodes(row)">节点公式</el-link>
|
|
|
</template>
|
|
|
</hc-table>
|
|
|
</hc-dialog>
|
|
|
+ <!-- 编辑公式 -->
|
|
|
+ <HcEditFormula v-model="isEditFormulaShow" :data="editFormulaData" @finish="editFormulaFinish" />
|
|
|
</hc-drawer>
|
|
|
</template>
|
|
|
|
|
@@ -149,6 +151,7 @@ import TreeNodeEditDialog from './tree-node-edit.vue'
|
|
|
import HcAdjustExcel from './adjust-excel.vue'
|
|
|
import HcAssociationList from './association-list.vue'
|
|
|
import HcEditElement from './edit-element.vue'
|
|
|
+import HcEditFormula from './edit-formula.vue'
|
|
|
import excelApi from '~api/exctab/exceltab'
|
|
|
import wbsTreeApi from '~api/wbs/tree'
|
|
|
import mainApi from '~api/wbs/private'
|
|
@@ -685,8 +688,12 @@ const editElementToPage = async (name) => {
|
|
|
}
|
|
|
|
|
|
//编辑元素公式
|
|
|
+const elementFormulasName = ref('')
|
|
|
+const elementFormulasObj = ref({})
|
|
|
const elementFormulasShow = ref(false)
|
|
|
const elementFormulasClick = async (row) => {
|
|
|
+ elementFormulasObj.value = row
|
|
|
+ elementFormulasName.value = row.tableName + ' 元素公式'
|
|
|
elementFormulasShow.value = true
|
|
|
formulaTableLoading.value = true
|
|
|
const { data } = await wbsTreeApi.selectFormElements({
|
|
@@ -721,10 +728,56 @@ const searchFormulaClick = () => {
|
|
|
const elementFormulasClose = () => {
|
|
|
elementFormulasShow.value = false
|
|
|
formulaTableLoading.value = false
|
|
|
+ elementFormulasName.value = ''
|
|
|
formulaTableData.value = []
|
|
|
formulaTableList.value = []
|
|
|
}
|
|
|
|
|
|
+//编辑公式
|
|
|
+const isEditFormulaShow = ref(false)
|
|
|
+const editFormulaData = ref({})
|
|
|
+
|
|
|
+//全局公式,10
|
|
|
+const toFormulaGlobal = async (row) => {
|
|
|
+ elementFormulasClose()
|
|
|
+ const formulasObj = elementFormulasObj.value
|
|
|
+ formulasObj.hasPartFormula = row.hasPartFormula
|
|
|
+ editFormulaData.value = {
|
|
|
+ node: formulasObj,
|
|
|
+ pid: projectInfo.value.id,
|
|
|
+ wbsId: wbsId.value,
|
|
|
+ nodeId: treeItem.value.id,
|
|
|
+ eleId: row.id,
|
|
|
+ eleType: false,
|
|
|
+ tableType: true,
|
|
|
+ globalType: 10,
|
|
|
+ }
|
|
|
+ await nextTick()
|
|
|
+ isEditFormulaShow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//节点公式,20
|
|
|
+const toFormulaNodes = async (row) => {
|
|
|
+ elementFormulasClose()
|
|
|
+ editFormulaData.value = {
|
|
|
+ node: treeItem.value,
|
|
|
+ pid: projectInfo.value.id,
|
|
|
+ wbsId: wbsId.value,
|
|
|
+ nodeId: treeItem.value.id,
|
|
|
+ eleId: row.id,
|
|
|
+ tableType: false,
|
|
|
+ globalType: 20,
|
|
|
+ }
|
|
|
+ await nextTick()
|
|
|
+ isEditFormulaShow.value = true
|
|
|
+}
|
|
|
+
|
|
|
+//公式操作完成
|
|
|
+const editFormulaFinish = () => {
|
|
|
+ isEditFormulaShow.value = false
|
|
|
+ editFormulaData.value = {}
|
|
|
+}
|
|
|
+
|
|
|
//离开了当前页面
|
|
|
onDeactivated(() => {
|
|
|
isAdjustExcelShow.value = false
|