8
0
ZaiZai vor 2 Monaten
Ursprung
Commit
35a8430d0b
2 geänderte Dateien mit 70 neuen und 349 gelöschten Zeilen
  1. 1 1
      public/version.json
  2. 69 348
      src/views/project/list/wbs-tree.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20241114180057"
+  "value": "20241119180243"
 }

+ 69 - 348
src/views/project/list/wbs-tree.vue

@@ -12,52 +12,26 @@
                         <template #dropdown>
                             <el-dropdown-menu>
                                 <template v-for="item in dataSyncMenu" :key="item.key">
-                                    <el-dropdown-item @click="dataSyncMenuClick(item)">
-                                        {{
-                                            item.name
-                                        }}
-                                    </el-dropdown-item>
+                                    <el-dropdown-item @click="dataSyncMenuClick(item)">{{ item.name }}</el-dropdown-item>
                                 </template>
                             </el-dropdown-menu>
                         </template>
                     </el-dropdown>
-                    <el-button v-if="isFormSet" class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">
-                        表单设置
-                    </el-button>
-                    <el-button v-else class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">
-                        元素设置
-                    </el-button>
-                    <el-button hc-btn type="danger" @click="nodeParamClick">
-                        节点参数
-                    </el-button>
-                    <el-button color="#626aef" hc-btn @click="toIndependent">
-                        独立表单库
-                    </el-button>
-                    <el-button hc-btn type="warning" @click="archiveClick">
-                        归档文件时间
-                    </el-button>
+                    <el-button v-if="isFormSet" class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">表单设置</el-button>
+                    <el-button v-else class="ml-3" hc-btn type="primary" @click="setIsFormSetValue">元素设置</el-button>
+                    <el-button hc-btn type="danger" @click="nodeParamClick">节点参数</el-button>
+                    <el-button color="#626aef" hc-btn @click="toIndependent">独立表单库</el-button>
+                    <el-button hc-btn type="warning" @click="archiveClick">归档文件时间</el-button>
                 </div>
             </div>
             <div class="body">
                 <hc-body padding="8px" split>
                     <template #left>
-                        <hc-card
-                            v-loading="isTreeLoading"
-                            class="is-tree"
-                            scrollbar
-                            title="工程节点信息"
-                        >
+                        <hc-card v-loading="isTreeLoading" class="is-tree" scrollbar title="工程节点信息">
                             <template #search>
-                                <hc-search-input
-                                    v-model="searchTree.queryValue"
-                                    @search="searchTreeClick"
-                                >
+                                <hc-search-input v-model="searchTree.queryValue" @search="searchTreeClick">
                                     <template #prepend>
-                                        <el-select
-                                            v-model="searchTree.type"
-                                            placeholder="类型"
-                                            style="width: 75px"
-                                        >
+                                        <el-select v-model="searchTree.type" placeholder="类型" style="width: 75px">
                                             <el-option label="节点" value="1" />
                                             <el-option label="表名" value="2" />
                                         </el-select>
@@ -65,43 +39,21 @@
                                 </hc-search-input>
                             </template>
                             <hc-data-tree
-                                v-if="isSearchTree"
-                                :auto-expand-keys="treeExpandKeys"
-                                :datas="treeLoadData"
-                                :h-props="treeProps"
-                                :menus="treeMenus"
-                                tree-key="id"
-                                @menu-tap="treeMenuClick"
-                                @node-tap="treeNodeClick"
+                                v-if="isSearchTree" :auto-expand-keys="treeExpandKeys" :datas="treeLoadData" :h-props="treeProps"
+                                :menus="treeMenus" tree-key="id" @menu-tap="treeMenuClick" @node-tap="treeNodeClick"
                             />
                             <hc-lazy-tree
-                                v-else
-                                :auto-expand-keys="treeExpandKeys"
-                                :h-props="treeProps"
-                                :menus="treeMenus"
-                                tree-key="id"
-                                @load="treeLoadNode"
-                                @menu-tap="treeMenuClick"
-                                @node-tap="treeNodeClick"
+                                v-else :auto-expand-keys="treeExpandKeys" :h-props="treeProps" :menus="treeMenus"
+                                tree-key="id" @load="treeLoadNode" @menu-tap="treeMenuClick" @node-tap="treeNodeClick"
                             />
                         </hc-card>
                     </template>
                     <template v-if="isFormSet">
                         <div class="body-top">
                             <hc-card title="节点信息">
-                                <hc-table
-                                    :column="nodeTableColumn"
-                                    :datas="nodeTableData"
-                                    :is-index="false"
-                                >
+                                <hc-table :column="nodeTableColumn" :datas="nodeTableData" :is-index="false">
                                     <template #nodeType="{ row }">
-                                        {{
-                                            getDictionaryName(
-                                                nodeTypelist,
-                                                row.nodeType,
-                                                true,
-                                            )
-                                        }}
+                                        {{ getDictionaryName(nodeTypelist, row.nodeType, true) }}
                                     </template>
                                 </hc-table>
                             </hc-card>
@@ -109,80 +61,22 @@
                         <div class="body-content">
                             <hc-card title="当前项目信息表">
                                 <template #extra>
-                                    <el-button
-                                        :disabled="infoTableData.length <= 0"
-                                        hc-btn
-                                        type="primary"
-                                        @click="editRowClick(row)"
-                                    >
-                                        编辑
-                                    </el-button>
-                                    <el-button
-                                        :disabled="infoTableData.length <= 0"
-                                        hc-btn
-                                        type="success"
-                                        @click="sortClick"
-                                    >
-                                        排序
-                                    </el-button>
+                                    <el-button :disabled="infoTableData.length <= 0" hc-btn type="primary" @click="editRowClick(row)">编辑</el-button>
+                                    <el-button :disabled="infoTableData.length <= 0" hc-btn type="success" @click="sortClick">排序</el-button>
                                 </template>
-                                <hc-table
-                                    v-loading="infoTableLoading"
-                                    :column="infoTableColumn"
-                                    :datas="infoTableData"
-                                    :is-index="false"
-                                >
+                                <hc-table v-loading="infoTableLoading" :column="infoTableColumn" :datas="infoTableData" :is-index="false">
                                     <template #tableType="{ row }">
-                                        {{
-                                            getDictionaryName(
-                                                tableTypelist,
-                                                row.tableType,
-                                                true,
-                                            )
-                                        }}
+                                        {{ getDictionaryName(tableTypelist, row.tableType, true) }}
                                     </template>
                                     <template #tableOwner="{ row }">
-                                        {{
-                                            getDictionaryName(
-                                                ownerTypeList,
-                                                row.tableOwner,
-                                                true,
-                                            )
-                                        }}
+                                        {{ getDictionaryName(ownerTypeList, row.tableOwner, true) }}
                                     </template>
                                     <template #action="{ row }">
-                                        <el-link
-                                            type="primary"
-                                            @click="previewClick(row)"
-                                        >
-                                            预览
-                                        </el-link>
-                                        <el-link
-                                            v-if="row.status === 1"
-                                            type="warning"
-                                            @click="hideClick(row)"
-                                        >
-                                            隐藏表单
-                                        </el-link>
-                                        <el-link
-                                            v-if="row.status === 0"
-                                            type="success"
-                                            @click="hideClick(row)"
-                                        >
-                                            取消隐藏
-                                        </el-link>
-                                        <el-link
-                                            type="primary"
-                                            @click="handleEdit(row)"
-                                        >
-                                            编辑
-                                        </el-link>
-                                        <el-link
-                                            v-del-com:[delInfoTableRow]="row"
-                                            type="danger"
-                                        >
-                                            删除
-                                        </el-link>
+                                        <el-link type="primary" @click="previewClick(row)">预览</el-link>
+                                        <el-link v-if="row.status === 1" type="warning" @click="hideClick(row)">隐藏表单</el-link>
+                                        <el-link v-if="row.status === 0" type="success" @click="hideClick(row)">取消隐藏</el-link>
+                                        <el-link type="primary" @click="handleEdit(row)">编辑</el-link>
+                                        <el-link v-del-com:[delInfoTableRow]="row" type="danger">删除</el-link>
                                     </template>
                                 </hc-table>
                             </hc-card>
@@ -190,93 +84,24 @@
                     </template>
                     <template v-else>
                         <hc-card>
-                            <hc-table
-                                v-loading="infoTableLoading"
-                                :column="infoTableColumn1"
-                                :datas="infoTableData"
-                                :is-index="false"
-                            >
+                            <hc-table v-loading="infoTableLoading" :column="infoTableColumn1" :datas="infoTableData" :is-index="false">
                                 <template #tableType="{ row }">
-                                    {{
-                                        getDictionaryName(
-                                            tableTypelist,
-                                            row.tableType,
-                                            true,
-                                        )
-                                    }}
+                                    {{ getDictionaryName(tableTypelist, row.tableType, true) }}
                                 </template>
                                 <template #isLinkTable="{ row }">
-                                    {{
-                                        row.isLinkTable === 2 ? '是' : '否'
-                                    }}
+                                    {{ row.isLinkTable === 2 ? '是' : '否' }}
                                 </template>
                                 <template #tableOwner="{ row }">
-                                    {{
-                                        getDictionaryName(
-                                            ownerTypeList,
-                                            row.tableOwner,
-                                            true,
-                                        )
-                                    }}
+                                    {{ getDictionaryName(ownerTypeList, row.tableOwner, true) }}
                                 </template>
                                 <template #action="{ row }">
-                                    <el-link
-                                        type="success"
-                                        @click="associationList(row)"
-                                    >
-                                        关联清表
-                                    </el-link>
-                                    <el-link
-                                        v-loading="editElementLoading"
-                                        :disabled="
-                                            row.excelId === -1
-                                                || isNullES(row.excelId)
-                                        "
-                                        type="primary"
-                                        @click="editElement(row)"
-                                    >
-                                        编辑元素
-                                    </el-link>
-                                    <el-link
-                                        v-loading="adjustExcelLoading"
-                                        :disabled="
-                                            row.excelId === -1
-                                                || isNullES(row.excelId)
-                                        "
-                                        type="warning"
-                                        @click="adjustExcelClick(row)"
-                                    >
-                                        调整表单
-                                    </el-link>
-                                    <el-link
-                                        type="primary"
-                                        @click="elementFormulasClick(row)"
-                                    >
-                                        编辑元素公式
-                                    </el-link>
-                                    <el-link
-                                        v-loading="syncTableLoading"
-                                        type="warning"
-                                        @click="syncTable(row)"
-                                    >
-                                        表单同步
-                                    </el-link>
-                                    <el-link
-                                        v-if="
-                                            treeItem.nodeType === 1000
-                                                || treeItem.nodeType === 1001
-                                        "
-                                        type="primary"
-                                        @click="linkNodeClick(row)"
-                                    >
-                                        关联节点
-                                    </el-link>
-                                    <el-link
-                                        v-del-com:[delInfoTableRow]="row"
-                                        type="danger"
-                                    >
-                                        删除表单
-                                    </el-link>
+                                    <el-link type="success" @click="associationList(row)">关联清表</el-link>
+                                    <el-link v-loading="editElementLoading" :disabled="row.excelId === -1 || isNullES(row.excelId) " type="primary" @click="editElement(row)">编辑元素</el-link>
+                                    <el-link v-loading="adjustExcelLoading" :disabled="row.excelId === -1 || isNullES(row.excelId)" type="warning" @click="adjustExcelClick(row)">调整表单</el-link>
+                                    <el-link type="primary" @click="elementFormulasClick(row)">编辑元素公式</el-link>
+                                    <el-link v-loading="syncTableLoading" type="warning" @click="syncTable(row)">表单同步</el-link>
+                                    <el-link v-if="treeItem.nodeType === 1000 || treeItem.nodeType === 1001" type="primary" @click="linkNodeClick(row)">关联节点</el-link>
+                                    <el-link v-del-com:[delInfoTableRow]="row" type="danger">删除表单</el-link>
                                 </template>
                             </hc-table>
                         </hc-card>
@@ -286,179 +111,70 @@
         </div>
         <!-- 编辑节点 -->
         <TreeNodeEditDialog
-            v-model="isTreeNodeEditShow"
-            :major-type="majorDataTypeList"
-            :node="treeInfo"
-            :node-type="nodeTypelist"
-            :pid="projectInfo.id"
-            :tree-props="treeProps"
-            :type="Number(isType)"
-            :wid="wbsId"
-            @change="treeNodeEditChange"
-            @close="treeNodeEditClose"
+            v-model="isTreeNodeEditShow" :major-type="majorDataTypeList" :node="treeInfo"
+            :node-type="nodeTypelist" :pid="projectInfo.id" :tree-props="treeProps" :type="Number(isType)"
+            :wid="wbsId" @change="treeNodeEditChange" @close="treeNodeEditClose"
         />
         <!-- 节点排序 -->
-        <hc-new-dialog
-            v-model="nodeSortModalShow"
-            is-table
-            title="调整排序"
-            widths="1100px"
-            @save="nodeSortModalSave"
-        >
+        <hc-new-dialog v-model="nodeSortModalShow" is-table title="调整排序" widths="1100px" @save="nodeSortModalSave">
             <hc-table
-                :column="nodeSortTableColumn"
-                :datas="nodeSortTableData"
-                :index-style="{ width: 80 }"
-                :loading="nodeSortNodeLoading"
-                is-row-drop
-                quick-sort
-                ui="hc-table-row-drop"
-                @row-drop="nodeSortTableRowDrop"
-                @row-sort="nodeSortTableRowDrop"
+                :column="nodeSortTableColumn" :datas="nodeSortTableData" :index-style="{ width: 80 }"
+                :loading="nodeSortNodeLoading" is-row-drop quick-sort ui="hc-table-row-drop"
+                @row-drop="nodeSortTableRowDrop" @row-sort="nodeSortTableRowDrop"
             >
                 <template #action="{ row, index }">
-                    <span
-                        :class="index === 0 ? 'text-gray' : 'text-link'"
-                        class="text-xl"
-                        @click="upNodeSortClick(row, index)"
-                    >
+                    <span :class="index === 0 ? 'text-gray' : 'text-link'" class="text-xl" @click="upNodeSortClick(row, index)">
                         <hc-icon fill name="arrow-up" />
                     </span>
-                    <span
-                        :class="
-                            index === nodeSortTableData.length - 1
-                                ? 'text-gray'
-                                : 'text-link'
-                        "
-                        class="ml-2 text-xl"
-                        @click="downNodeSortClick(row, index)"
-                    >
+                    <span :class=" index === nodeSortTableData.length - 1 ? 'text-gray' : 'text-link' " class="ml-2 text-xl" @click="downNodeSortClick(row, index)">
                         <hc-icon fill name="arrow-down" />
                     </span>
                 </template>
             </hc-table>
         </hc-new-dialog>
         <!-- 关联清表 -->
-        <HcAssociationList
-            v-model="isAssociationShow"
-            :info="associationInfo"
-            @change="getInfoTableData"
-        />
+        <HcAssociationList v-model="isAssociationShow" :info="associationInfo" @change="getInfoTableData" />
         <!-- 编辑元素 -->
-        <HcEditElement
-            v-model="isEditElementShow"
-            :data="editElementData"
-            :info="editElementInfo"
-            @to-page="editElementToPage"
-        />
+        <HcEditElement v-model="isEditElementShow" :data="editElementData" :info="editElementInfo" @to-page="editElementToPage" />
         <!-- 调整表单 -->
         <HcAdjustExcel v-model="isAdjustExcelShow" :info="adjustExcelInfo" />
         <!-- 编辑元素公式 -->
-        <hc-dialog
-            v-model="elementFormulasShow"
-            :footer="false"
-            :title="elementFormulasName"
-            is-table
-            widths="600px"
-            @close="elementFormulasClose"
-        >
+        <hc-dialog v-model="elementFormulasShow" :footer="false" :title="elementFormulasName" is-table widths="600px" @close="elementFormulasClose">
             <template #search>
-                <hc-search-input
-                    v-model="formulaInput"
-                    @search="searchFormulaClick"
-                />
+                <hc-search-input v-model="formulaInput" @search="searchFormulaClick" />
             </template>
-            <hc-table
-                v-loading="formulaTableLoading"
-                :column="formulaTableColumn"
-                :datas="formulaTableData"
-                :is-current-row="false"
-                :is-index="false"
-            >
+            <hc-table v-loading="formulaTableLoading" :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>
-                    <el-link
-                        v-show="row.hasPartFormula"
-                        :type="row.isSaveFormula === 1 ? 'warning' : 'primary'"
-                        @click="toFormulaNodes(row)"
-                    >
-                        节点公式
-                    </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"
-        />
+        <HcEditFormula v-model="isEditFormulaShow" :data="editFormulaData" @finish="editFormulaFinish" />
         <!-- 节点参数设置 -->
-        <nodeParamDialog
-            v-model="nodeParamShow"
-            :node-id="treeItem.id"
-            :node-info="treeItem"
-            :porject-id="projectInfo.id"
-            :scope-type="10"
-            @close="nodeParamClose"
-        />
+        <nodeParamDialog v-model="nodeParamShow" :node-id="treeItem.id" :node-info="treeItem" :porject-id="projectInfo.id" :scope-type="10" @close="nodeParamClose" />
         <!-- 独立表单库 -->
-        <independentPage
-            v-model="independentShow"
-            :project-id="projectInfo.id"
-            :wbs-id="wbsId"
-            :wbs-type="isType"
-            @close="independentClose"
-        />
+        <independentPage v-model="independentShow" :project-id="projectInfo.id" :wbs-id="wbsId" :wbs-type="isType" @close="independentClose" />
         <!-- 归档文件时间 -->
         <archiveTime v-model="isArchiveShow" />
 
         <!-- 编辑元素表信息 -->
-        <editElePage
-            v-model="editEleShow"
-            :owner-type-list="ownerTypeList"
-            :tab="infoTableData"
-            :table-typelist="tableTypelist"
-            @close="editClose"
-        />
+        <editElePage v-model="editEleShow" :owner-type-list="ownerTypeList" :tab="infoTableData" :table-typelist="tableTypelist" @close="editClose" />
         <!-- 表单调整排序 -->
-        <tableSort
-            v-model="tableSortShow"
-            :tab="infoTableData"
-            @close="tableSortShowClose"
-        />
+        <tableSort v-model="tableSortShow" :tab="infoTableData" @close="tableSortShowClose" />
         <!-- 预览 -->
         <previewPage v-model="previewShow" :info="previewInfo" />
 
         <!-- 创建新的元素表 -->
         <createNewExcel
-            v-model="isCreateShow"
-            :e-key="eKey"
-            :init-table-id="initTableId"
-            :init-table-name="initTableName"
-            :node="treeItem"
-            :owner-type-list="ownerTypeList"
-            :table-id="tableId"
-            :table-typelist="tableTypelist"
-            :title="modalTitle"
-            :type="0"
-            :wid="wbsId"
-            @close="createClose"
+            v-model="isCreateShow" :e-key="eKey" :init-table-id="initTableId" :init-table-name="initTableName"
+            :node="treeItem" :owner-type-list="ownerTypeList" :table-id="tableId" :table-typelist="tableTypelist"
+            :title="modalTitle" :type="0" :wid="wbsId" @close="createClose"
         />
 
         <!-- 分配WBS -->
-        <allocateWbs
-            v-model="isAllocateShow"
-            :data="allocateWbsInfo"
-            :project-id="projectInfo.id"
-            :type="1"
-            :wbs-type="isType"
-        />
+        <allocateWbs v-model="isAllocateShow" :data="allocateWbsInfo" :project-id="projectInfo.id" :type="1" :wbs-type="isType" />
     </hc-drawer>
 </template>
 
@@ -468,14 +184,13 @@ import { useAppStore } from '~src/store'
 import { HcFirmMsg, getStore, setStore } from 'hc-vue3-ui'
 import { deepClone, getArrValue, getObjValue, isNullES } from 'js-fast-way'
 import { getDictionaryData, reloadPage } from '~uti/tools'
+
+//组件
 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'
 import nodeParamDialog from '../../desk/wbs/node-param-dialog.vue'
 import independentPage from './independent/index.vue'
 import archiveTime from './archiveTime.vue'
@@ -485,6 +200,12 @@ import previewPage from './previewPage.vue'
 import createNewExcel from '../../desk/wbs/create-new-excel.vue'
 import allocateWbs from '../list/independent/allocateWbs.vue'
 
+//接口
+import excelApi from '~api/exctab/exceltab'
+import wbsTreeApi from '~api/wbs/tree'
+import mainApi from '~api/wbs/private'
+
+//参数
 const props = defineProps({
     type: {
         type: [String, Number],