From 9311edbbc7a098fb0c6de773b52e43205cac39b2 Mon Sep 17 00:00:00 2001
From: yangys <y_ys79@sina.com>
Date: 星期五, 22 八月 2025 13:34:22 +0800
Subject: [PATCH] 修改图标

---
 src/views/basesetting/machine.vue |  228 +++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 157 insertions(+), 71 deletions(-)

diff --git a/src/views/basesetting/machine.vue b/src/views/basesetting/machine.vue
index 3c1e0f6..09df335 100644
--- a/src/views/basesetting/machine.vue
+++ b/src/views/basesetting/machine.vue
@@ -1,44 +1,66 @@
 <template>
-  <basic-container>
-    <avue-crud
-      :addBtn="false"
-      :option="option"
-      :table-loading="loading"
-      :data="data"
-      ref="crud"
-      v-model:search="search"
-      v-model:page="mypage"
-      @search-change="searchChange"
-      @search-reset="searchReset"
-      @current-change="currentChange"
-      @size-change="sizeChange"
-      @refresh-change="refreshChange"
-      @on-load="onLoad"
-    >
-      <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="handleView">瀵煎叆</el-button> -->
-        <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-upload" @click.stop="handleUp(scope.row, scope.index)">浜х敓鏈哄簥鍥炰紶鏈烘瀯鏍�</el-button>
-      </template>
+  <el-row>
+    <el-col :span="5">
+      <div class="box">
+        <el-scrollbar>
+          <basic-container>
+            <avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" />
+          </basic-container>
+        </el-scrollbar>
+      </div>
+    </el-col>
+    <el-col :span="19">
+      <basic-container>
+        <avue-crud
+          :addBtn="false"
+          :option="option"
+          :table-loading="loading"
+          :data="data"
+          ref="crud"
+          v-model:search="search"
+          v-model:page="mypage"
+          @search-change="searchChange"
+          @search-reset="searchReset"
+          @current-change="currentChange"
+          @size-change="sizeChange"
+          @refresh-change="refreshChange"
+          @on-load="onLoad"
+        >
+          <template #menu-left>
+            <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" size="default" icon="el-icon-circle-plus" plain @click="handleAdd">鏂板</el-button>
+            </div>
 
-      <template #status="{ row }">
-        <span>{{ row.status=="1"?"鍚敤":"绂佺敤" }}</span>
-      </template>
-    </avue-crud>
+          </template>
+          <template #menu="scope">
+            <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>
 
-    <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%">
-      <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm">
-        <template #ownerDept="{}">
-          <el-tree-select v-model="editForm.ownerDept" :data="organizationTreeList" :props="treePropsConfig"/>
-        </template>
-      </avue-form>
-    </el-dialog>
-  </basic-container>
+          <template #status="{ row }">
+            <span>{{ row.status=="1"?"鍚敤":"绂佺敤" }}</span>
+          </template>
+        </avue-crud>
+
+        <el-dialog :title="machineTitle" append-to-body v-model="editBox" width="60%">
+          <avue-form ref="editFormModal1" :option="editFormModal" v-model="editForm" @submit="formSubmit" @resetForm="resetForm">
+            <template #ownerDept="{}">
+              <el-tree-select v-model="editForm.ownerDept" :data="organizationTreeList" :props="treePropsConfig"/>
+            </template>
+          </avue-form>
+        </el-dialog>
+      </basic-container>
+    </el-col>
+  </el-row>
 </template>
 
 <script>
@@ -47,10 +69,38 @@
 import NProgress from 'nprogress';
 import { downloadXls } from '@/utils/util';
 import 'nprogress/nprogress.css';
+import { getDeptLazyTree } from '@/api/system/dept';
 export default {
   data() {
     var that = this;
     return {
+      treeOption: {
+        nodeKey: 'id',
+        lazy: true,
+        treeLoad: function (node, resolve) {
+          const parentId = node.level === 0 ? 0 : node.data.id;
+          getDeptLazyTree(parentId).then(res => {
+            resolve(
+              res.data.data.map(item => {
+                return {
+                  ...item,
+                  leaf: !item.hasChildren,
+                };
+              })
+            );
+          });
+        },
+        addBtn: false,
+        menu: false,
+        size: 'small',
+        props: {
+          labelText: '鏍囬',
+          label: 'title',
+          value: 'value',
+          children: 'children',
+        },
+      },
+      treeData: [],
       treePropsConfig: {
         value:  'id',
         label: 'title',
@@ -99,6 +149,7 @@
           {
             label: '鏈哄簥缁�',
             prop: 'machineGroupName',
+            filterable:true,
             search: true,
             type: 'select',
             dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
@@ -182,6 +233,7 @@
           {
             label: '鎵�灞炴満搴婄粍',
             prop: 'machineGroupCode',
+            filterable:true,
             type: 'select',
             span: 12,
             dicUrl: '/blade-system/dict-biz/dictionary?code=machine_group',
@@ -225,7 +277,7 @@
             dataType: 'string',
           },
           {
-            label: '绯荤粺鎺у埗',
+            label: '鎺у埗绯荤粺',
             prop: 'controlSystem',
             type: 'select',
             span: 12,
@@ -246,11 +298,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: '绋嬪簭鍥炰紶鐩綍',
@@ -259,6 +327,16 @@
             span: 12,
             dataType: 'string',
           },
+          {
+            label: '鍥炰紶鐩綍淇濆瓨鏃堕棿',
+            prop: 'receiveDirExpiryHours',
+             max:24,
+            min:1,
+            placeholder:"(灏忔椂)",
+            type: 'number',
+            span: 12,
+          },
+		      
           {
             label: '澶囨敞',
             prop: 'remark',
@@ -272,16 +350,13 @@
     };
   },
   methods: {
-    initData(tenantId) {
-      axios({
-        url: 'blade-system/dept/tree',
-        method: 'get'
-      }).then(
-        res => {
-          //const column = this.findObject(this.option.column, 'parentId');
-          //column.dicData = res.data.data;
-        }
-      );
+    handleChange(a,b,c) {
+      console.log(a,b,c);
+    },
+    nodeClick(data) {
+      this.treeDeptId = data.id;
+      this.mypage.current = 1;
+      this.onLoad(this.page);
     },
     handleAdd() {
       this.machineTitle = "鏂板";
@@ -410,28 +485,31 @@
       
     },
     onLoad() {
-      this.loading = true;
-      var obj = {
-        keyword: this.search.keyword,
-        machineGroupCode: this.search.machineGroupName,
-        current: this.mypage.current,
-        size: this.mypage.size,
-      }
-      axios({
-        url: '/blade-mdm/machine/page',
-        method: 'get',
-        params: obj,
-      }).then(
-        res => {
-          const data = res.data.data;
-          this.mypage.total = data.total;
-          this.data = data.records;
-          this.loading = false;
-        },
-        error => {
-            
+      this.$nextTick(()=> {
+        this.loading = true;
+        var obj = {
+          keyword: this.search.keyword,
+          machineGroupCode: this.search.machineGroupName,
+          current: this.mypage.current,
+          size: this.mypage.size,
+          deptId: this.treeDeptId
         }
-      );
+        axios({
+          url: '/blade-mdm/machine/page',
+          method: 'get',
+          params: obj,
+        }).then(
+          res => {
+            const data = res.data.data;
+            this.mypage.total = data.total;
+            this.data = data.records;
+            this.loading = false;
+          },
+          error => {
+              
+          }
+        );
+      })
     },
     traversalLabelValueToTree(tree) {  //閬嶅巻鏁扮粍
       return tree.map(node => {
@@ -459,5 +537,13 @@
 </script>
 
 <style lang="scss">
-
+.upload-demo {
+  display: inline-block;
+  margin-left: 6px;
+  margin-right: 6px;
+}
+.menuLeft {
+  display: flex;
+  align-items: center;
+}
 </style>

--
Gitblit v1.9.3