From cd3c5e597ad75051941dab65119b510fb16485e1 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期四, 28 八月 2025 15:10:29 +0800
Subject: [PATCH] 文件修改增加对比

---
 src/views/tasks/machinereturnfiles.vue |   89 ++++++++++++++++++++++++++++++++++++++------
 1 files changed, 76 insertions(+), 13 deletions(-)

diff --git a/src/views/tasks/machinereturnfiles.vue b/src/views/tasks/machinereturnfiles.vue
index 73431d1..1a3492c 100644
--- a/src/views/tasks/machinereturnfiles.vue
+++ b/src/views/tasks/machinereturnfiles.vue
@@ -1,4 +1,9 @@
 <template>
+  <div class="gongkongMain">
+  <div>
+      <el-tree :data="treeData" :props="defaultProps" node-key="id" :default-expand-all="false" :default-expanded-keys="defaultKeys" @node-click="handleNodeClick" />
+    </div>
+    <div>
   <basic-container>
     <avue-crud
       :addBtn="false"
@@ -18,7 +23,7 @@
     >
       <template #menu-left>
         <!-- el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button> -->
-        <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">鎵归噺鎺ユ敹</el-button>
+        <el-button type="primary" :disabled="this.selection.length==0" size="default" icon="el-icon-circle-plus" plain @click="receiveBtn">鎵归噺鎺ユ敹</el-button>
       </template>
       <template #menu="scope">
         <el-button type="primary" text size="default" icon="el-icon-document-delete" @click.stop="rejectBtn(scope.row, scope.index)">鎷掔粷</el-button>
@@ -26,6 +31,8 @@
       </template>
     </avue-crud>
   </basic-container>
+  </div>
+  </div>
 </template>
 
 <script>
@@ -44,6 +51,13 @@
         machineGroupCode: ""
       },
       loading: true,
+      treeData: [],
+      defaultProps: {
+        children: 'children',
+        label: 'name',
+        isLeaf: (data) => !data.hasChildren
+      },
+      currentNode:{},//褰撳墠鑺傜偣鏁版嵁
       mypage: {
         size: 10,
         current: 1,
@@ -65,18 +79,15 @@
             prop: 'programName',
             hide: true
           },
-          {
-            label: '鏂囦欢缂栧彿',
-            prop: ''
+		  {
+            label: '鏂囦欢鍚嶇О',
+            prop: 'name',
           },
           {
             label: '鏈哄簥鍙�',
             prop: 'machineCode',
           },
-          {
-            label: '鏂囦欢鍚嶇О',
-            prop: 'name',
-          },
+          
           {
             label: '鏂囦欢鍥哄寲鐘舵��',
             prop: 'isCured',
@@ -84,11 +95,11 @@
           {
             label: '鏂囦欢鍒拌揪鏃堕棿',
             prop: 'arrivedTime',
-          },
+          },/*
           {
             label: '鏂囦欢鏁版嵁搴撶紪鍙�',
             prop: '',
-          },
+          },*/
           {
             label: '鍏抽敭淇℃伅',
             prop: 'keyword',
@@ -223,6 +234,10 @@
         machineSpec: this.search.machineSpec,
         current: this.mypage.current,
         size: this.mypage.size,
+        nodeType: this.currentNode.nodeType, 
+        nodeId: this.currentNode.nodeType!='dir'?this.currentNode.id:undefined,
+        dirType:this.currentNode.dirType,
+        machineCode: this.currentNode.machineCode,
       }
       axios({
         url: '/blade-mdm/machineback/file/page',
@@ -240,11 +255,59 @@
         }
       );
 
-    }
+    },
+    handleNodeClick(treeNode,b,c,d) {
+      console.log(treeNode)
+      this.currentNode = treeNode;
+      this.onLoad();
+      //this.fileName = "";
+      //this.searchTable(TreeNode);
+    },
+    treeLoad () {
+      axios({
+        url: '/blade-mdm/gkw/node/load-tree',
+        method: 'get',
+      }).then(
+        res => {
+          this.treeData = res.data.data;
+          var firstIndex = 0;
+          res.data.data.forEach((item,index)=> {
+            if(item.children.length != 0) {
+              firstIndex = index;
+            }
+          })
+          //defaultKeys.push(item.id);
+          this.defaultKeys = [res.data.data[firstIndex].id];
+        }
+      )
+    },
   },
+  mounted() {
+    this.treeLoad();
+  }
 };
 </script>
-
 <style lang="scss">
-
+.gongkongMain {
+  display: flex;
+  padding: 0px;
+  margin: 0px 7px 10px 7px;
+  background-color: #fff;
+  border-top: 1px solid #ccc;
+  > div {
+    padding: 12px;
+  }
+}
+.gongkongMain > div:nth-child(1) {
+  width:25%;
+  border-right: 1px solid #ccc;
+}
+.gongkongMain div:nth-child(2) {
+  flex: 1;
+}
+.paginationTree {
+  margin-top: 12px;
+  display: flex;
+  justify-content: flex-end;
+}
 </style>
\ No newline at end of file

--
Gitblit v1.9.3