From 312e207ed418e190949f0c5f4eedda50fa40f360 Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期四, 14 九月 2023 17:53:39 +0800
Subject: [PATCH] su

---
 src/views/system/user/index.vue |   42 ++++++++++++++++++++++--------------------
 1 files changed, 22 insertions(+), 20 deletions(-)

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index c3a6932..89875c4 100644
--- a/src/views/system/user/index.vue
+++ b/src/views/system/user/index.vue
@@ -78,7 +78,7 @@
           <right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
         </el-row>
 
-        <el-table v-loading="loading" :data="userList" border @selection-change="handleSelectionChange"
+        <el-table  :data="userList" border @selection-change="handleSelectionChange" v-loading="loading"
           highlight-current-row>
           <el-table-column type="selection" width="50" align="center" fixed="left" />
           <el-table-column label="搴忓彿" align="center" key="newID" prop="newID" width="50px" fixed="left" />
@@ -657,9 +657,9 @@
       :visible.sync="dialogVisible1"
       width="30%"
       :before-close="handleClose">
-      <el-form>
+      <el-form :rules="rules1">
         <span>璇疯緭鍏モ�渰{row.userName}}鈥濈殑鏂板瘑鐮�</span>
-        <el-form-item>
+        <el-form-item prop="password">
           <el-input v-model="password" :type="type" auto-complete="off" placeholder="瀵嗙爜" ref="barcodeMsg">
             <svg-icon slot="prefix" icon-class="password" class="el-input__icon input-icon" />
             <i slot="suffix" class="icon-style" :class="elIcon" autocomplete="auto" @click="flag = !flag" /></el-input>
@@ -858,6 +858,17 @@
           },
         ],
       },
+      rules1: {
+        password: [
+          { required: true, message: "鐢ㄦ埛瀵嗙爜涓嶈兘涓虹┖", trigger: "blur" },
+          {
+            min: 5,
+            max: 20,
+            message: "鐢ㄦ埛瀵嗙爜闀垮害蹇呴』浠嬩簬 5 鍜� 20 涔嬮棿",
+            trigger: "blur",
+          },
+        ],
+      },
     };
   },
   watch: {
@@ -877,12 +888,10 @@
   created() {
     this.getList();
     this.getDeptTree();
-    this.getlistHosp();
-    this.getPostList();
-    this.getRoleList();
-    this.getConfigKey("sys.user.initPassword").then((response) => {
-      this.initPassword = response.msg;
-    });
+    // this.getRoleList();
+    // this.getConfigKey("sys.user.initPassword").then((response) => {
+    //   this.initPassword = response.msg;
+    // });
   },
   methods: {
     handleChange(val) { },
@@ -898,12 +907,6 @@
               1;
           });
           this.userList = response.rows;
-          // for(let key in this.userList){
-          //   for(let i = 0; i < this.userList[key].length; i++){
-          //     this.userList[key][i]["form"] = key;
-          //     this.userInfoList.push(this.userList[key][i])
-          //   }
-          // }
           this.total = response.total;
           this.loading = false;
         }
@@ -925,11 +928,9 @@
     },
     /** 鏌ヨ闄㈠尯淇℃伅鍒楄〃 */
     getlistHosp() {
-      this.loading = true;
       listHosp(this.queryParams).then((response) => {
         this.hospList = response.rows;
         this.total = response.total;
-        this.loading = false;
       });
     },
 
@@ -941,7 +942,6 @@
     getDeptTree() {
       deptTreeSelect().then((response) => {
         this.deptOptions = response.data;
-        console.log(this.deptOptions);
       });
     },
     // 绛涢�夎妭鐐�
@@ -1043,6 +1043,8 @@
       this.reset();
       this.open = true;
       this.title = "鐢ㄦ埛淇℃伅缁存姢";
+      this.getPostList();
+      this.getlistHosp();
       // getUser().then((response) => {
       //   this.postOptions = response.posts;
       //   this.roleOptions = response.roles;
@@ -1073,6 +1075,8 @@
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
+      this.getPostList();
+      this.getlistHosp();
       this.reset();
       this.form = row;
       // this.form.userInfo.id = null;
@@ -1106,7 +1110,6 @@
     },
     /** 閲嶇疆瀵嗙爜鎸夐挳鎿嶄綔 */
     handleResetPwd(row) {
-      console.log(row);
       this.dialogVisible1 = true;
       this.row = row;
       // this.$prompt('璇疯緭鍏�"' + row.userName + '"鐨勬柊瀵嗙爜', "鎻愮ず", {
@@ -1131,7 +1134,6 @@
         userId:this.row.userId,
       }
       resetUserPwd(data).then(res=>{
-        console.log(res);
         if(res.code == 200){
           this.$modal.msgSuccess("淇敼鎴愬姛");
           this.dialogVisible1 = false;

--
Gitblit v1.8.0