From 50f52beb0ed100105166f62027cd0b15e6b596dc Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期六, 12 十一月 2022 15:02:01 +0800
Subject: [PATCH] 重新

---
 src/views/userManage/userInfoManage.vue |  106 +++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 75 insertions(+), 31 deletions(-)

diff --git a/src/views/userManage/userInfoManage.vue b/src/views/userManage/userInfoManage.vue
index 21a9559..361dd6b 100644
--- a/src/views/userManage/userInfoManage.vue
+++ b/src/views/userManage/userInfoManage.vue
@@ -33,38 +33,52 @@
           </el-cascader>
         </el-form-item>
         <el-form-item>
-          <el-button @click="queryInfo()"
-            ><i class="el-icon-search"></i> &nbsp;{{
-              $t("operatManage.ELM.search")
-            }}</el-button
-          >
+          <el-button
+            size="small"
+            type="primary"
+            @click="queryInfo()"
+            icon="el-icon-search"
+            >{{ $t("operatManage.ELM.search") }}
+          </el-button>
         </el-form-item>
         <el-form-item>
-          <el-button @click="resetInfo('queryForm')"
-            ><i class="el-icon-delete"></i>&nbsp;{{
-              $t("operatManage.ELM.reset")
-            }}</el-button
+          <el-button
+            size="small"
+            @click="resetInfo('queryForm')"
+            icon="el-icon-refresh"
           >
+            {{ $t("operatManage.ELM.reset") }}
+          </el-button>
         </el-form-item>
         <br />
         <el-form-item>
-          <el-button type="success" size="small" @click="showAddDialog"
-            ><i class="el-icon-plus"></i>&nbsp;{{
-              $t("common.append")
-            }}</el-button
+          <el-button
+            type="success"
+            size="small"
+            @click="showAddDialog"
+            icon="el-icon-plus"
           >
+            {{ $t("common.append") }}
+          </el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type="danger" size="small" @click="deleteUserInfo"
-            ><i class="el-icon-delete"></i>&nbsp;{{
-              $t("common.delete")
-            }}</el-button
+          <el-button
+            type="danger"
+            size="small"
+            @click="deleteUserInfo"
+            icon="el-icon-delete"
           >
+            {{ $t("common.delete") }}
+          </el-button>
         </el-form-item>
         <el-form-item>
-          <el-button type="danger" size="small" @click="editPwd"
-            ><i class="el-icon-unlock"></i>&nbsp;閲嶇疆瀵嗙爜</el-button
-          >
+          <el-button
+            type="primary"
+            size="small"
+            @click="editPwd"
+            icon="el-icon-unlock"
+            >閲嶇疆瀵嗙爜
+          </el-button>
         </el-form-item>
       </el-form>
     </div>
@@ -182,6 +196,7 @@
           :label="$t('common.operate')"
           width="80px"
           fixed="right"
+          v-if="menuStatus.update"
         >
           <template slot-scope="scope">
             <!-- <el-button type="primary" size="small">淇敼</el-button> -->
@@ -491,6 +506,11 @@
       }
     };
     return {
+      menuStatus: {
+        delete: false,
+        insert: false,
+        update: false,
+      },
       isNewUser: false,
       currentPage: 1,
       pageSize: 10,
@@ -680,7 +700,7 @@
   },
   methods: {
     ...mapActions(["login", "getpublickey"]),
-    getUserInfo(params) {
+    getUserInfo() {
       queryDepTree()
         .then((res) => {
           if (res.code == 200) {
@@ -728,7 +748,7 @@
     //鎼滅储鎸夐挳
     queryInfo() {
       let searchData = {
-        uname: this.queryForm.uname,
+        uname: this.queryForm.uname.trim(),
         depid: this.queryForm.depid,
         pageIndex: this.pageIndex,
         pageSize: this.pageSize,
@@ -776,7 +796,7 @@
               setTimeout(() => {
                 this.fullscreenLoading = false;
                 if (res.code == 200) {
-                  this.getUserInfo(1, 10);
+                  this.getUserInfo();
                   this.$message({
                     message: "娣诲姞鎴愬姛",
                     type: "success",
@@ -795,6 +815,10 @@
           return false;
         }
       });
+    },
+    //澶氶��
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
     },
     //鍒犻櫎鎸夐挳
     deleteUserInfo() {
@@ -816,7 +840,7 @@
                   message: "鍒犻櫎鎴愬姛!",
                 });
                 this.multipleSelection = [];
-                this.getUserInfo(1, 10);
+                this.getUserInfo();
               } else {
                 this.$message.error("鍒犻櫎澶辫触");
               }
@@ -862,7 +886,7 @@
               setTimeout(() => {
                 this.fullscreenLoading = false;
                 if (res.code == 200) {
-                  this.getUserInfo(1, 10);
+                  this.getUserInfo();
                   this.$message({
                     message: "淇敼鎴愬姛",
                     type: "success",
@@ -951,7 +975,7 @@
               setTimeout(() => {
                 this.fullscreenLoading = false;
                 if (res.code == 200) {
-                  this.getUserInfo(1, 10);
+                  this.getUserInfo();
                   this.$message({
                     message: "淇敼鎴愬姛",
                     type: "success",
@@ -976,10 +1000,7 @@
         this.editForm = JSON.parse(this.initialForm);
       });
     },
-    //澶氶��
-    handleSelectionChange(val) {
-      this.multipleSelection = val;
-    },
+
     handleSizeChange(val) {
       // console.log(`姣忛〉 ${val} 鏉);
       this.pageSize = val;
@@ -991,11 +1012,34 @@
       this.currentPage = val;
       this.queryInfo();
     },
+    showPermsMenu(res) {
+      console.log(res.tag);
+      switch (res.tag) {
+        case "/delete":
+          this.menuStatus.delete = true;
+          break;
+        case "/insert":
+          this.menuStatus.insert = true;
+          break;
+        case "/update":
+          this.menuStatus.update = true;
+          break;
+      }
+    },
   },
   mounted() {
-    this.getUserInfo(1, 10);
+    this.getUserInfo();
     this.getpublickey();
   },
+  created() {
+    var val = this.$store.state.currentPerms;
+    var permsEntity = this.$store.state.permsEntity;
+    for (var i = 0; i < permsEntity.length; i++) {
+      if (permsEntity[i].perms == val) {
+        this.showPermsMenu(permsEntity[i]);
+      }
+    }
+  },
 };
 </script>
 <style>

--
Gitblit v1.9.3