From 2240e53ef2aa4cfb5033a0987149dc97482dd29d Mon Sep 17 00:00:00 2001
From: 李喆(开发组) <lzhe@yxqiche.com>
Date: 星期三, 16 七月 2025 17:36:59 +0800
Subject: [PATCH] 1

---
 src/views/wel/index.vue |   57 ++++++++++++++++++++++++---------------------------------
 1 files changed, 24 insertions(+), 33 deletions(-)

diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 75c5b13..0d9a11f 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -73,7 +73,7 @@
         emptyText: "鍙栨秷",
         menuPosition: "right",
         column: [{
-          label: '鍗囩増',
+          label: '宸ュ簭鐗堟',
           prop: 'processEdition',
           labelWidth: "80",
           span: 22
@@ -143,6 +143,12 @@
           {
             label: '鏈�鍚庝慨鏀规椂闂�',
             prop: 'updateTime',
+            disabled: true,
+            placeholder: " "
+          },
+          {
+            label: '澶囨敞',
+            prop: 'remark',
             disabled: true,
             placeholder: " "
           }
@@ -381,12 +387,13 @@
       axios({
         url: '/blade-mdm/program/ncfile/upgrade-process-edition',
         method: 'post',
-        data: {id:row.id,newProcessEdition: row.processEdition},
+        params: {bindNcNodeId:row.id,newProcessEdition: row.processEdition},
       }).then(
         res => {
             done();
             this.upgradeModal = false;
-            //this.$message.success('鎿嶄綔鎴愬姛');
+            this.$message.success('鎿嶄綔鎴愬姛');
+            this.addLocalTreeNode(row.parentId);
         }
       );
     },
@@ -397,8 +404,8 @@
       this.loading = true;
       axios({
         url: '/blade-mdm/program/ncfile/send-to-machine-by-nodeid',
-        method: 'get',
-        params: {nodeId:id},
+        method: 'post',
+        params: {nodeId:row.id},
       }).then(
         res => {
             this.loading = false;
@@ -407,7 +414,7 @@
       );
     },
     upgrade(row) {  //鍗囩増
-      this.upgradeModalForm = row;
+      this.upgradeModalForm = {...row};
       this.upgradeModal = true;
     },
     delFile(item) {
@@ -481,15 +488,15 @@
     tabsHandleChange(tabs) {
       this.tabsType = tabs.prop;
     },
-    showUpload(row) {
+    showUpload(row) {//鑾峰彇鏂囦欢鍐呭
       this.fileList = [];
       this.uploadmodalForm = row;
-      //鑾峰彇鏂囦欢鍐呭
       this.loading = true;
+      var obj = {parentId: row.id}
       axios({
-        url: '/blade-mdm/program/ncfile/list-by-node',
+        url: '/blade-mdm/program/node/lazy-list',
         method: 'get',
-        params: {nodeId: row.id},
+        params: obj,
       }).then(
         res => {
           this.loading = false;
@@ -531,9 +538,7 @@
         }).then(
           res => {
             this.loading = false;
-            var nodeArr = this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId];
-            var arr = nodeArr.filter(item => item.id !== row.id);
-            this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[row.parentId] = arr;
+            this.addLocalTreeNode(row.parentId);
           }
         );
       })
@@ -574,7 +579,7 @@
           this.modalBox = false;
           // 淇敼锛屾洿鏂版湰鍦版暟鎹�
           if (this.modalTitle === "淇敼") {
-            this.updateLocalTreeNode(this.modalForm);
+            this.addLocalTreeNode(row.parentId);
           }else {
             // 濡傛灉鏄柊澧炴搷浣滐紝鍙兘闇�瑕侀噸鏂板姞杞芥暟鎹�
             //this.$refs.crud.refreshTable();
@@ -601,28 +606,14 @@
       }).then(
         res => {
           var children = res.data.data || [];
-          this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
+          if(parentId == 0) {
+            this.data = [...children];
+          }else {
+            this.$refs.crud.$refs.table.store.states.lazyTreeNodeMap.value[parentId] = [...children];
+          }
           this.loading = false;
         }
       );
-    },
-    updateLocalTreeNode(nodeData) {   //淇敼鐨勬柟娉�
-      const updateNode = (nodes) => {
-        for (let i = 0; i < nodes.length; i++) {
-          if (nodes[i].id === nodeData.id) {
-            // 鏇存柊鑺傜偣鏁版嵁
-            Object.assign(nodes[i], nodeData);
-            return true;
-          }
-          if (Array.isArray(nodes[i].children) && nodes[i].children.length > 0) {
-            if (updateNode(nodes[i].children)) {
-              return true;
-            }
-          }
-        }
-        return false;
-      };
-      updateNode(this.data);
     },
     modalCancel() {
       this.modalBox = false;

--
Gitblit v1.9.3