Преглед изворни кода

工程划分树根节点添加菜单

duy пре 2 недеља
родитељ
комит
b9f60e04d4
3 измењених фајлова са 19 додато и 29 уклоњено
  1. 1 1
      public/version.json
  2. 18 27
      src/views/data-fill/division.vue
  3. 0 1
      src/views/data-fill/wbs.vue

+ 1 - 1
public/version.json

@@ -1,3 +1,3 @@
 {
-  "value": "20251203114425"
+  "value": "20251203164042"
 }

+ 18 - 27
src/views/data-fill/division.vue

@@ -35,22 +35,10 @@
             >
                 <el-scrollbar>
                     <HcLazyTree
-                        v-model:loading="isLoading"
-                        is-form-date
-                        :check-strictly="true"
-
-                        :show-checkbox="isShowCheckbox"
-                        :auto-expand-keys="treeAutoExpandKeys"
-                        is-counts
-                        is-type
-                        :menus="ElTreeMenu"
-                        ui="page-division-tree"
-                     
-                        @load="treeLoadNode"
-                        @menu-tap="ElTreeMenuClick"
-                        @node-loading="treeNodeLoading"
-                        @node-tap="wbsElTreeClick"
-                        @load-menu="loadMenu"
+                        v-model:loading="isLoading" is-form-date :check-strictly="true"
+                        :show-checkbox="isShowCheckbox" :auto-expand-keys="treeAutoExpandKeys" is-counts is-type
+                        :menus="ElTreeMenu" :root-menu="rootMenu" ui="page-division-tree" @load="treeLoadNode" @menu-tap="ElTreeMenuClick"
+                        @node-loading="treeNodeLoading" @node-tap="wbsElTreeClick" @load-menu="loadMenu"
                         @check="leftCheckChange"
                     />
                 </el-scrollbar>
@@ -1236,12 +1224,8 @@ onMounted(() => {
     getMajorDataTypeOptions()
 })
 const setElTreeMenu = (contractType) => {
- 
-    
-    let newArr = []
+    let newArr = [], rootNewArr = []
     if (contractType == 1 && contractInfo.value?.contractType !== 2) {
- 
-        
         if (HcIsButton('wbs_tree_add')) {
             newArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
             newArr.push({
@@ -1254,6 +1238,17 @@ const setElTreeMenu = (contractType) => {
                 label: '自定义节点(数字化文件)',
                 key: 'add2',
             })
+            rootNewArr.push({ icon: 'add-circle', label: '新增节点', key: 'add' })
+            rootNewArr.push({
+                icon: 'add-circle',
+                label: '自定义节点(水利工程)',
+                key: 'add1',
+            })
+            rootNewArr.push({
+                icon: 'add-circle',
+                label: '自定义节点(数字化文件)',
+                key: 'add2',
+            })
         }
         if (HcIsButton('wbs_tree_edit')) {
             newArr.push({ icon: 'draft', label: '编辑节点', key: 'edit' })
@@ -1265,16 +1260,12 @@ const setElTreeMenu = (contractType) => {
                 key: 'copy',
             })
         }
-       
-    
         if (HcIsButton('wbs_tree_sort')) {
             newArr.push({ icon: 'sort-asc', label: '调整排序', key: 'sort' })
         }
         if (HcIsButton('wbs_tree_del')) {
             newArr.push({ icon: 'delete-bin', label: '删除节点', key: 'del' })
         }
-    
-    
     } else if (contractType == 2) {
         newArr = []
         if (HcIsButton('wbs_tree_copy')) {
@@ -1287,8 +1278,7 @@ const setElTreeMenu = (contractType) => {
 
     }
     ElTreeMenu.value = newArr
-   
-    
+    rootMenu.value = rootNewArr
 }
 //缓存被激活时
 onActivated(() => {
@@ -1501,6 +1491,7 @@ const ElTreeMenu = ref([
     { icon: 'sort-asc', label: '调整排序', key: 'sort' },
     { icon: 'delete-bin', label: '删除节点', key: 'del' },
 ])
+const rootMenu = ref([])
 const orString = ref('')
 //树菜单被点击
 const ElTreeMenuClick = async ({ key, node, data, keys }) => {

+ 0 - 1
src/views/data-fill/wbs.vue

@@ -1882,7 +1882,6 @@ const setElTreeMenu = (contractType) => {
                 label: '自定义节点(数字化文件)',
                 key: 'add2',
             })
-
         }
         if (HcIsButton('wbs_tree_edit')) {
             newArr.push({ icon: 'draft', label: '编辑节点', key: 'edit' })