From 4b94f114e561e0d53633259a04b3f4f71e293f1f Mon Sep 17 00:00:00 2001
From: su1124 <1583764726@qq.com>
Date: 星期四, 14 九月 2023 11:11:55 +0800
Subject: [PATCH] su

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

diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue
index c3a6932..bcc6e62 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;
       });
     },
 
@@ -1043,6 +1044,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 +1076,8 @@
     },
     /** 淇敼鎸夐挳鎿嶄綔 */
     handleUpdate(row) {
+      this.getPostList();
+      this.getlistHosp();
       this.reset();
       this.form = row;
       // this.form.userInfo.id = null;

--
Gitblit v1.8.0