From e0529600d302c3e3190d802390417bd1a8b72a05 Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期五, 22 八月 2025 23:52:31 +0800
Subject: [PATCH] 1

---
 src/views/basesetting/machine.vue |  108 ++++++++++++++++++++++++++++++++++++++++++++---------
 1 files changed, 89 insertions(+), 19 deletions(-)

diff --git a/src/views/basesetting/machine.vue b/src/views/basesetting/machine.vue
index 12fbf28..d273399 100644
--- a/src/views/basesetting/machine.vue
+++ b/src/views/basesetting/machine.vue
@@ -27,23 +27,24 @@
           @on-load="onLoad"
         >
           <template #menu-left>
-            <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button>
+            <div class="menuLeft">
+              <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleExport">瀵煎嚭</el-button>
+              <!-- <el-upload :show-file-list="false" class="upload-demo"
+                  action="/api/blade-mdm/machine/import"
+                        :on-change="handleChange">
+                <el-button type="primary" plain size="default">瀵煎叆</el-button>
+              </el-upload> -->
+              <el-button type="primary" plain @click="importAction">瀵煎叆</el-button>
+              <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">鏂板</el-button>
+            </div>
 
-
-            <el-upload :show-file-list="false" class="upload-demo"
-                action="/api/blade-mdm/machine/import"
-                       :on-change="handleChange">
-              <el-button type="primary" plain size="default">瀵煎叆</el-button>
-            </el-upload>
-
-
-
-            <el-button type="primary" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">鏂板</el-button>
           </template>
           <template #menu="scope">
-            <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleEdit(scope.row, scope.index)">缂栬緫</el-button>
-            <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleDel(scope.row, scope.index)">鍒犻櫎</el-button>
+            <el-button type="primary" text size="default" icon="el-icon-edit" @click.stop="handleEdit(scope.row, scope.index)">缂栬緫</el-button>
+            <el-button type="primary" text size="default" icon="el-icon-delete" @click.stop="handleDel(scope.row, scope.index)">鍒犻櫎</el-button>
+            <!--
             <el-button type="primary" text size="default" icon="el-icon-upload" @click.stop="handleUp(scope.row, scope.index)">浜х敓鏈哄簥鍥炰紶鏈烘瀯鏍�</el-button>
+            -->
           </template>
 
           <template #status="{ row }">
@@ -57,6 +58,11 @@
               <el-tree-select v-model="editForm.ownerDept" :data="organizationTreeList" :props="treePropsConfig"/>
             </template>
           </avue-form>
+        </el-dialog>
+
+        <el-dialog title="" append-to-body v-model="excelBox" width="555px">
+            <avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter">
+            </avue-form>
         </el-dialog>
       </basic-container>
     </el-col>
@@ -74,6 +80,29 @@
   data() {
     var that = this;
     return {
+      excelBox: false,
+      excelOption: {
+          submitBtn: false,
+          emptyBtn: false,
+          column: [
+              {
+                  label: '鏂囦欢瀵煎叆',
+                  prop: 'file',
+                  type: 'upload',
+                  drag: true,
+                  loadText: '瀵煎叆涓紝璇风◢鍚�',
+                  span: 24,
+                  propsHttp: {
+                      res: 'data',
+                  },
+                  data: {
+                  },
+                  tip: '',
+                  action: '/blade-mdm/machine/import',
+              },
+          ],
+      },
+      excelForm: {},
       treeOption: {
         nodeKey: 'id',
         lazy: true,
@@ -277,7 +306,7 @@
             dataType: 'string',
           },
           {
-            label: '绯荤粺鎺у埗',
+            label: '鎺у埗绯荤粺',
             prop: 'controlSystem',
             type: 'select',
             span: 12,
@@ -298,11 +327,27 @@
             }]
           },
           {
+            label: '绋嬪簭涓存椂鐩綍',
+            prop: 'progTempDir',
+            type: 'input',
+            span: 12,
+            dataType: 'string',
+          },
+          {
             label: '绋嬪簭涓嬪彂鐩綍',
             prop: 'progSendDir',
             type: 'input',
             span: 12,
             dataType: 'string',
+          },
+          {
+            label: '涓嬪彂鐩綍淇濆瓨鏃堕棿',
+            prop: 'sendDirExpiryHours',
+            placeholder:"(灏忔椂)",
+            max:24,
+            min:1,
+            type: 'number',
+            span: 12,
           },
           {
             label: '绋嬪簭鍥炰紶鐩綍',
@@ -311,13 +356,16 @@
             span: 12,
             dataType: 'string',
           },
-		  {
-            label: '绋嬪簭涓存椂鐩綍',
-            prop: 'progTempDir',
-            type: 'input',
+          {
+            label: '鍥炰紶鐩綍淇濆瓨鏃堕棿',
+            prop: 'receiveDirExpiryHours',
+             max:24,
+            min:1,
+            placeholder:"(灏忔椂)",
+            type: 'number',
             span: 12,
-            dataType: 'string',
           },
+		      
           {
             label: '澶囨敞',
             prop: 'remark',
@@ -331,6 +379,24 @@
     };
   },
   methods: {
+    importAction() {
+      this.excelBox = true;
+    },
+    uploadAfter(res, done, loading, column) {
+        //window.console.log(column);
+        //console.log('res',res)
+        if(res.success>0){
+            //鏈夋垚鍔熺殑锛屽叧闂璇濇
+            this.excelBox = false;
+            this.$message.success(res.message);
+            this.onLoad(this.page);
+            //done();
+        }else{
+            //0鎴愬姛鐨勶紝浠呮彁绀�
+            this.$message.success(res.message);
+        }
+        
+    },
     handleChange(a,b,c) {
       console.log(a,b,c);
     },
@@ -523,4 +589,8 @@
   margin-left: 6px;
   margin-right: 6px;
 }
+.menuLeft {
+  display: flex;
+  align-items: center;
+}
 </style>

--
Gitblit v1.9.3