From 5e2aafeede13d337380f736567caf74f49713be7 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Fri, 09 Aug 2024 14:38:32 +0800
Subject: [PATCH] 代码优化

---
 src/views/system/user.vue |   24 ++++++++++++++----------
 1 files changed, 14 insertions(+), 10 deletions(-)

diff --git a/src/views/system/user.vue b/src/views/system/user.vue
index dd16303..898b687 100644
--- a/src/views/system/user.vue
+++ b/src/views/system/user.vue
@@ -244,6 +244,7 @@
               label: "登录账号",
               prop: "account",
               search: true,
+              searchLabelWidth: 76,
               display: false
             },
             // {
@@ -464,7 +465,8 @@
                   leafOnly: false,
                   dicData: [],
                   props: {
-                    label: "title"
+                    label: "title",
+                    value: "id"
                   },
                   rules: [{
                     required: true,
@@ -476,14 +478,15 @@
                   label: "所属部门",
                   prop: "deptId",
                   type: "tree",
-                  // multiple: true,
+                  multiple: true,
+                  leafOnly: false,
                   dicData: [],
-                  dataType: "string",
+                  // dataType: "string",
                   props: {
                     label: "title",
                     value: "id"
                   },
-                  // checkStrictly: true,
+                  checkStrictly: true,
                   slot: true,
                   span: 12,
                   rules: [{
@@ -717,7 +720,7 @@
         row['userType'] = 1
         row.deptId = func.join(row.deptId)
         row.roleId = func.join(row.roleId)
-        row.postId = func.join(row.postId)
+        // row.postId = func.join(row.postId)
         add(row).then(() => {
           this.initFlag = false
           this.onLoad(this.page)
@@ -736,7 +739,7 @@
         row['userType'] = 1
         row.deptId = func.join(row.deptId)
         row.roleId = func.join(row.roleId)
-        row.postId = func.join(row.postId)
+        // row.postId = func.join(row.postId)
         update(row).then(() => {
           this.initFlag = false
           this.onLoad(this.page)
@@ -877,6 +880,7 @@
       handleExport() {
         const account = func.toStr(this.search.account)
         const realName = func.toStr(this.search.realName)
+        const deptId = this.treeDeptId
         this.$confirm("是否导出用户数据?", "提示", {
           confirmButtonText: "确定",
           cancelButtonText: "取消",
@@ -884,7 +888,7 @@
         }).then(() => {
           NProgress.start()
           exportBlob(
-            `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}`
+            `/api/blade-system/user/export-user?${this.website.tokenHeader}=${getToken()}&account=${account}&realName=${realName}&deptId=${deptId}`
           ).then(res => {
             downloadXls(res.data, `用户数据表${dateNow()}.xlsx`)
             NProgress.done()
@@ -906,9 +910,9 @@
             if (this.form.hasOwnProperty("roleId")) {
               this.form.roleId = this.form.roleId.split(",")
             }
-            if (this.form.hasOwnProperty("postId")) {
-              this.form.postId = this.form.postId.split(",")
-            }
+            // if (this.form.hasOwnProperty("postId")) {
+            //     this.form.postId = this.form.postId.split(",")
+            // }
           })
         }
         this.initFlag = true

--
Gitblit v1.9.3