Selaa lähdekoodia

编辑节点修改

duy 10 kuukautta sitten
vanhempi
commit
ea32974415
2 muutettua tiedostoa jossa 18 lisäystä ja 4 poistoa
  1. 9 2
      src/views/manager/projectinfo/tree.vue
  2. 9 2
      src/views/manager/wbsinfo/edit.vue

+ 9 - 2
src/views/manager/projectinfo/tree.vue

@@ -2968,14 +2968,21 @@ export default {
         res.data.data.forEach((element) => {
           element.dictKey = Number(element.dictKey);
         });
-        this.standardTypeOptions = res.data.data;
+        // 定义要过滤的 dictKey 值
+        const targetKeys = [1, 2, 3, 4];
+        // 过滤数组
+        const filteredOptions = res.data.data.filter((item) =>
+          targetKeys.includes(item.dictKey)
+        );
+
+        this.standardTypeOptions = filteredOptions;
       });
     },
     changeStandType(val) {
       let parentId = "";
       this.standardTypeOptions.forEach((item) => {
         if (item.dictKey == val) {
-          parentId = item.parentId; // 找到匹配项,提取 parentId
+          parentId = item.id; // 找到匹配项,提取 parentId
         }
       });
 

+ 9 - 2
src/views/manager/wbsinfo/edit.vue

@@ -2548,14 +2548,21 @@ export default {
         res.data.data.forEach((element) => {
           element.dictKey = Number(element.dictKey);
         });
-        this.standardTypeOptions = res.data.data;
+        // 定义要过滤的 dictKey 值
+        const targetKeys = [1, 2, 3, 4];
+        // 过滤数组
+        const filteredOptions = res.data.data.filter((item) =>
+          targetKeys.includes(item.dictKey)
+        );
+
+        this.standardTypeOptions = filteredOptions;
       });
     },
     changeStandType(val) {
       let parentId = "";
       this.standardTypeOptions.forEach((item) => {
         if (item.dictKey == val) {
-          parentId = item.parentId; // 找到匹配项,提取 parentId
+          parentId = item.id; // 找到匹配项,提取 parentId
         }
       });