Browse Source

Merge remote-tracking branch 'origin/gzb' into wzl

gzb
wangzhonglu 9 months ago
parent
commit
1e2f8b6991

+ 12
- 1
src/utils/index.js View File

2
 let _timezone = 8; //目标时区时间,东八区   东时区正数 西时区负数
2
 let _timezone = 8; //目标时区时间,东八区   东时区正数 西时区负数
3
 let _offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
3
 let _offset_GMT = new Date().getTimezoneOffset(); // 本地时间和格林威治的时间差,单位为分钟
4
 let diffTime = _offset_GMT * 60 * 1000 + _timezone * 60 * 60 * 1000; //0
4
 let diffTime = _offset_GMT * 60 * 1000 + _timezone * 60 * 60 * 1000; //0
5
+
6
+export const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/;
7
+// 密码验证
8
+export const pwdCheck = (rule, value, callback) => {
9
+  const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,16}$/;
10
+  if (!reg.test(value)) {
11
+    return callback(new Error("密码格式不正确!"));
12
+  } else {
13
+    callback();
14
+  }
15
+};
5
 export const weekDay = [
16
 export const weekDay = [
6
   {
17
   {
7
     label: "周日",
18
     label: "周日",
342
   return rgbaColor;
353
   return rgbaColor;
343
 }
354
 }
344
 // 包含大小写字母和数字的随机组合
355
 // 包含大小写字母和数字的随机组合
345
-export const generateRandomString = (n = 8) => {
356
+export const generateRandomString = (n = 6) => {
346
   let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
357
   let chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
347
   let result = "";
358
   let result = "";
348
   let hasUpperCase = false;
359
   let hasUpperCase = false;

+ 2
- 10
src/views/layout.vue View File

85
         "
85
         "
86
       >
86
       >
87
         <div style="color: #b50000">
87
         <div style="color: #b50000">
88
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
88
+          注:密码必须是6-16位的大小写英文字母、数字组合
89
         </div>
89
         </div>
90
         <div>
90
         <div>
91
           <Button @click="pwInfo.show = false">取消</Button>
91
           <Button @click="pwInfo.show = false">取消</Button>
161
 import { admin_detail, admin_edit_phone, admin_edit_pwd } from "@/api/admin";
161
 import { admin_detail, admin_edit_phone, admin_edit_pwd } from "@/api/admin";
162
 import { login_msg_code } from "@/api/login";
162
 import { login_msg_code } from "@/api/login";
163
 import { logdoperatemsg_get_nrn } from "@/api/log";
163
 import { logdoperatemsg_get_nrn } from "@/api/log";
164
-
164
+import { pwdCheck, reg } from "@/utils";
165
 export default {
165
 export default {
166
   data() {
166
   data() {
167
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
168
-    // 密码验证
169
-    const pwdCheck = (rule, value, callback) => {
170
-      if (!reg.test(value)) {
171
-        return callback(new Error("密码格式不正确!"));
172
-      }
173
-      callback();
174
-    };
175
     // 重复密码验证
167
     // 重复密码验证
176
     const pwdAgainCheck = async (rule, value, callback) => {
168
     const pwdAgainCheck = async (rule, value, callback) => {
177
       if (!reg.test(value)) {
169
       if (!reg.test(value)) {

+ 1
- 0
src/views/login/login.vue View File

317
     transform: translateY(-50%);
317
     transform: translateY(-50%);
318
     right: 16%;
318
     right: 16%;
319
     .welcome {
319
     .welcome {
320
+      margin-bottom: 20px;
320
       height: 30px;
321
       height: 30px;
321
       color: #000000;
322
       color: #000000;
322
       font-size: 24px;
323
       font-size: 24px;

+ 3
- 12
src/views/platformSection/regionManage/adminManage.vue View File

198
         "
198
         "
199
       >
199
       >
200
         <div style="color: #b50000">
200
         <div style="color: #b50000">
201
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
201
+          注:密码必须是6-16位的大小写英文字母、数字组合
202
         </div>
202
         </div>
203
         <div>
203
         <div>
204
           <Button @click="adminInfo.show = false">取消</Button>
204
           <Button @click="adminInfo.show = false">取消</Button>
259
 } from "@/api/admin";
259
 } from "@/api/admin";
260
 import { region_list_sel_pt } from "@/api/region";
260
 import { region_list_sel_pt } from "@/api/region";
261
 import { login_msg_code } from "@/api/login";
261
 import { login_msg_code } from "@/api/login";
262
-import { generateRandomString } from "@/utils";
262
+import { generateRandomString, pwdCheck, reg } from "@/utils";
263
 export default {
263
 export default {
264
   data() {
264
   data() {
265
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
266
-    // 密码验证
267
-    const pwdCheck = (rule, value, callback) => {
268
-      if (!reg.test(this.adminInfo.loginpwd)) {
269
-        return callback(new Error("密码格式不正确。"));
270
-      } else {
271
-        callback();
272
-      }
273
-    };
274
     // 重复密码验证
265
     // 重复密码验证
275
     const pwdAgainCheck = async (rule, value, callback) => {
266
     const pwdAgainCheck = async (rule, value, callback) => {
276
       if (!reg.test(this.adminInfo.loginpwd1)) {
267
       if (!reg.test(this.adminInfo.loginpwd1)) {
501
         adminid: null,
492
         adminid: null,
502
         aname: "",
493
         aname: "",
503
         loginname: "",
494
         loginname: "",
504
-        loginpwd: generateRandomString(8),
495
+        loginpwd: generateRandomString(),
505
         loginpwd1: "",
496
         loginpwd1: "",
506
         phone: "",
497
         phone: "",
507
         msgcode: "",
498
         msgcode: "",

+ 3
- 12
src/views/platformSection/regionManage/regionManage.vue View File

142
         "
142
         "
143
       >
143
       >
144
         <div style="color: #b50000">
144
         <div style="color: #b50000">
145
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
145
+          注:密码必须是6-16位的大小写英文字母、数字组合
146
         </div>
146
         </div>
147
         <div>
147
         <div>
148
           <Button @click="regionInfo.show = false">取消</Button>
148
           <Button @click="regionInfo.show = false">取消</Button>
230
 </template>
230
 </template>
231
 
231
 
232
 <script>
232
 <script>
233
-import { generateRandomString } from "@/utils";
233
+import { generateRandomString, pwdCheck, reg } from "@/utils";
234
 import {
234
 import {
235
   region_list_pt,
235
   region_list_pt,
236
   region_list_admin,
236
   region_list_admin,
241
 import { login_msg_code } from "@/api/login";
241
 import { login_msg_code } from "@/api/login";
242
 export default {
242
 export default {
243
   data() {
243
   data() {
244
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
245
-    // 密码验证
246
-    const pwdCheck = (rule, value, callback) => {
247
-      if (!reg.test(this.regionInfo.admin.loginpwd)) {
248
-        return callback(new Error("密码格式不正确。"));
249
-      } else {
250
-        callback();
251
-      }
252
-    };
253
     // 重复密码验证
244
     // 重复密码验证
254
     const pwdAgainCheck = async (rule, value, callback) => {
245
     const pwdAgainCheck = async (rule, value, callback) => {
255
       if (!reg.test(this.regionInfo.admin.loginpwd1)) {
246
       if (!reg.test(this.regionInfo.admin.loginpwd1)) {
522
         admin: {
513
         admin: {
523
           aname: "",
514
           aname: "",
524
           loginname: "",
515
           loginname: "",
525
-          loginpwd: generateRandomString(8),
516
+          loginpwd: generateRandomString(),
526
           loginpwd1: "",
517
           loginpwd1: "",
527
           phone: "",
518
           phone: "",
528
           msgcode: "",
519
           msgcode: "",

+ 107
- 60
src/views/regionSection/regionManage/adminManage.vue View File

178
             placeholder="请输入描述信息"
178
             placeholder="请输入描述信息"
179
           ></Input>
179
           ></Input>
180
         </FormItem>
180
         </FormItem>
181
-        <FormItem label="账号类型" style="width: 100%">
182
-          <RadioGroup v-model="adminInfo.userType">
183
-            <Radio :label="1">区域管理员</Radio>
184
-            <Radio :label="2">学校管理员</Radio>
185
-          </RadioGroup>
186
-        </FormItem>
187
-        <FormItem label="所属区域" prop="regionid" style="width: 100%">
188
-          <Select
189
-            :transfer="true"
190
-            v-model="adminInfo.regionid"
191
-            style="width: calc(50% - 65px)"
192
-          >
193
-            <Option
194
-              v-for="item in searchForm.dropList"
195
-              :value="item.regionid"
196
-              :key="item.regionid"
197
-              >{{ item.regionName }}</Option
181
+        <div v-if="!adminInfo.adminid">
182
+          <FormItem label="账号类型" style="width: 100%">
183
+            <RadioGroup v-model="adminInfo.atype">
184
+              <Radio :label="2">区域管理员</Radio>
185
+              <Radio :label="3">学校管理员</Radio>
186
+            </RadioGroup>
187
+          </FormItem>
188
+          <FormItem label="所属区域" prop="regionid" style="width: 100%">
189
+            <Select
190
+              :transfer="true"
191
+              v-model="adminInfo.regionid"
192
+              @on-change="regionidChange"
193
+              style="width: calc(50% - 65px)"
198
             >
194
             >
199
-          </Select>
200
-        </FormItem>
201
-        <FormItem
202
-          v-if="adminInfo.userType === 2"
203
-          label="选择学校"
204
-          prop="schoolid"
205
-          style="width: 100%"
206
-        >
207
-          <Select
208
-            :transfer="true"
209
-            v-model="adminInfo.schoolid"
210
-            style="width: calc(50% - 65px)"
195
+              <Option
196
+                v-for="item in searchForm.dropList"
197
+                :value="item.regionid"
198
+                :key="item.regionid"
199
+                >{{ item.regionName }}</Option
200
+              >
201
+            </Select>
202
+          </FormItem>
203
+          <FormItem
204
+            v-if="adminInfo.atype === 3"
205
+            label="选择学校"
206
+            prop="schoolid"
207
+            style="width: 100%"
211
           >
208
           >
212
-            <Option
213
-              v-for="item in searchForm.schoolList"
214
-              :value="item.schoolid"
215
-              :key="item.schoolid"
216
-              >{{ item.schoolName }}</Option
209
+            <Select
210
+              :transfer="true"
211
+              v-model="adminInfo.schoolid"
212
+              @on-open-change="openSchoolList"
213
+              style="width: calc(50% - 65px)"
217
             >
214
             >
218
-          </Select>
219
-        </FormItem>
215
+              <Option
216
+                v-for="item in searchForm.schoolList"
217
+                :value="item.schoolid"
218
+                :key="item.schoolid"
219
+                >{{ item.schoolName }}</Option
220
+              >
221
+            </Select>
222
+          </FormItem>
223
+        </div>
220
       </Form>
224
       </Form>
221
       <div
225
       <div
222
         slot="footer"
226
         slot="footer"
227
         "
231
         "
228
       >
232
       >
229
         <div style="color: #b50000">
233
         <div style="color: #b50000">
230
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
234
+          注:密码必须是6-16位的大小写英文字母、数字组合
231
         </div>
235
         </div>
232
         <div>
236
         <div>
233
           <Button @click="adminInfo.show = false">取消</Button>
237
           <Button @click="adminInfo.show = false">取消</Button>
261
         <FormItem label="所属区域" style="margin-bottom: 0; width: 100%">{{
265
         <FormItem label="所属区域" style="margin-bottom: 0; width: 100%">{{
262
           viewInfo.regionName
266
           viewInfo.regionName
263
         }}</FormItem>
267
         }}</FormItem>
268
+        <FormItem
269
+          label="地址"
270
+          style="margin-bottom: 0; width: calc(50% - 10px)"
271
+          >{{ viewInfo.address }}</FormItem
272
+        >
273
+        <FormItem label="描述信息" style="margin-bottom: 0; width: 100%">{{
274
+          viewInfo.comm
275
+        }}</FormItem>
264
       </Form>
276
       </Form>
265
       <div slot="footer" style="text-align: center">
277
       <div slot="footer" style="text-align: center">
266
         <Button @click="viewInfo.show = false">关闭</Button>
278
         <Button @click="viewInfo.show = false">关闭</Button>
285
 } from "@/api/admin";
297
 } from "@/api/admin";
286
 import { region_list_sel_qy } from "@/api/region";
298
 import { region_list_sel_qy } from "@/api/region";
287
 import { login_msg_code } from "@/api/login";
299
 import { login_msg_code } from "@/api/login";
288
-import { generateRandomString } from "@/utils";
300
+import { generateRandomString, pwdCheck, reg } from "@/utils";
301
+import { school_list_rs } from "@/api/school";
289
 export default {
302
 export default {
290
   data() {
303
   data() {
291
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
292
-    // 密码验证
293
-    const pwdCheck = (rule, value, callback) => {
294
-      if (!reg.test(this.adminInfo.loginpwd)) {
295
-        return callback(new Error("密码格式不正确!"));
296
-      } else {
297
-        callback();
298
-      }
299
-    };
300
     // 重复密码验证
304
     // 重复密码验证
301
     const pwdAgainCheck = async (rule, value, callback) => {
305
     const pwdAgainCheck = async (rule, value, callback) => {
302
       if (!reg.test(this.adminInfo.loginpwd1)) {
306
       if (!reg.test(this.adminInfo.loginpwd1)) {
395
         msgcode: "",
399
         msgcode: "",
396
         address: "",
400
         address: "",
397
         comm: "",
401
         comm: "",
398
-        userType: 1,
402
+        atype: 2,
399
         enabled: 1,
403
         enabled: 1,
404
+        schoolid: null,
400
         regionid: null
405
         regionid: null
401
       },
406
       },
402
       // 查看
407
       // 查看
406
         aname: "",
411
         aname: "",
407
         loginname: "",
412
         loginname: "",
408
         phone: "",
413
         phone: "",
409
-        regionName: ""
414
+        regionName: "",
415
+        address: "",
416
+        comm: ""
410
       },
417
       },
411
       columns: [
418
       columns: [
412
         {
419
         {
490
     this.searchList();
497
     this.searchList();
491
   },
498
   },
492
   methods: {
499
   methods: {
500
+    regionidChange() {
501
+      this.showLoading = true;
502
+      school_list_rs({ regionid: this.adminInfo.regionid }).then((res) => {
503
+        this.showLoading = false;
504
+        if (res.code === 0) {
505
+          this.searchForm.schoolList = res.obj;
506
+        } else {
507
+          this.$Message.error(res.msg);
508
+        }
509
+      });
510
+    },
511
+    openSchoolList(val) {
512
+      //展开
513
+      if (val) {
514
+        if (!this.adminInfo.regionid) {
515
+          this.$Message.error("请选择区域!");
516
+        }
517
+      }
518
+    },
493
     // 获取搜索区域列表
519
     // 获取搜索区域列表
494
     getSearchRegionList() {
520
     getSearchRegionList() {
495
       this.showLoading = true;
521
       this.showLoading = true;
552
         adminid: null,
578
         adminid: null,
553
         aname: "",
579
         aname: "",
554
         loginname: "",
580
         loginname: "",
555
-        loginpwd: generateRandomString(8),
581
+        loginpwd: generateRandomString(),
556
         loginpwd1: "",
582
         loginpwd1: "",
557
         phone: "",
583
         phone: "",
558
         msgcode: "",
584
         msgcode: "",
559
         enabled: 1,
585
         enabled: 1,
560
         address: "",
586
         address: "",
561
         comm: "",
587
         comm: "",
562
-        userType: 1,
588
+        atype: 2,
589
+        schoolid: null,
563
         regionid: null
590
         regionid: null
564
       };
591
       };
565
     },
592
     },
644
             phone: this.adminInfo.phone,
671
             phone: this.adminInfo.phone,
645
             msgcode: this.adminInfo.msgcode,
672
             msgcode: this.adminInfo.msgcode,
646
             enabled: this.adminInfo.enabled,
673
             enabled: this.adminInfo.enabled,
674
+            atype: this.adminInfo.atype,
675
+            schoolid: this.adminInfo.schoolid || null,
647
             regionid: this.adminInfo.regionid,
676
             regionid: this.adminInfo.regionid,
648
             address: this.adminInfo.address,
677
             address: this.adminInfo.address,
649
             comm: this.adminInfo.comm
678
             comm: this.adminInfo.comm
653
             form.adminid = this.adminInfo.adminid;
682
             form.adminid = this.adminInfo.adminid;
654
             form.rversion = this.adminInfo.rversion;
683
             form.rversion = this.adminInfo.rversion;
655
           }
684
           }
685
+          console.log(form);
656
           this.showLoading = true;
686
           this.showLoading = true;
657
           api(form).then((data) => {
687
           api(form).then((data) => {
658
             this.showLoading = false;
688
             this.showLoading = false;
668
     },
698
     },
669
     // 查看
699
     // 查看
670
     toView(row) {
700
     toView(row) {
671
-      this.viewInfo = {
672
-        show: true,
673
-        enabled: row.enabled,
674
-        aname: row.aname,
675
-        loginname: row.loginname,
676
-        phone: row.phone,
677
-        regionName: row.regionName
678
-      };
701
+      this.showLoading = true;
702
+      admin_detail({
703
+        rtype: this.powerParams.rtype,
704
+        objectid: this.powerParams.objectid,
705
+        adminid: row.adminid
706
+      }).then((res) => {
707
+        this.showLoading = false;
708
+        if (res.code === 0) {
709
+          this.viewInfo = {
710
+            show: true,
711
+            enabled: res.obj.enabled,
712
+            aname: res.obj.aname,
713
+            loginname: res.obj.loginname,
714
+            phone: res.obj.phone,
715
+            regionName: res.obj.regionName,
716
+            address: res.obj.address,
717
+            comm: res.obj.comm
718
+          };
719
+        } else {
720
+          this.$Message.error(res.msg);
721
+        }
722
+      });
679
     },
723
     },
680
     // 编辑
724
     // 编辑
681
     toEdit(row) {
725
     toEdit(row) {
699
             phone: res.obj.phone,
743
             phone: res.obj.phone,
700
             msgcode: "",
744
             msgcode: "",
701
             enabled: res.obj.enabled,
745
             enabled: res.obj.enabled,
746
+            atype: res.obj.atype,
702
             regionid: res.obj.regionid,
747
             regionid: res.obj.regionid,
703
-            rversion: row.rversion
748
+            rversion: row.rversion,
749
+            address: res.obj.address,
750
+            comm: res.obj.comm
704
           };
751
           };
705
         } else {
752
         } else {
706
           this.$Message.error(res.msg);
753
           this.$Message.error(res.msg);

+ 14
- 17
src/views/regionSection/regionManage/regionManage.vue View File

14
       <Table :columns="columns" :data="searchForm.list">
14
       <Table :columns="columns" :data="searchForm.list">
15
         <template slot-scope="{ row }" slot="actionSlot">
15
         <template slot-scope="{ row }" slot="actionSlot">
16
           <div class="action_list">
16
           <div class="action_list">
17
-            <div v-if="row.regionid != powerParams.objectid" @click="toEnter(row)">进入</div>
17
+            <div
18
+              v-if="row.regionid != powerParams.objectid"
19
+              @click="toEnter(row)"
20
+            >
21
+              进入
22
+            </div>
18
             <div @click="toView(row)">查看</div>
23
             <div @click="toView(row)">查看</div>
19
             <div @click="toEdit(row)">编辑</div>
24
             <div @click="toEdit(row)">编辑</div>
20
             <div class="action_del" @click="toDel(row)">删除</div>
25
             <div class="action_del" @click="toDel(row)">删除</div>
127
         </FormItem>
132
         </FormItem>
128
         <FormItem label="地址" style="width: 100%">
133
         <FormItem label="地址" style="width: 100%">
129
           <Input
134
           <Input
130
-              v-model="regionInfo.admin.address"
131
-              placeholder="请输入地址"
135
+            v-model="regionInfo.admin.address"
136
+            placeholder="请输入地址"
132
           ></Input>
137
           ></Input>
133
         </FormItem>
138
         </FormItem>
134
         <FormItem label="描述信息" style="width: 100%">
139
         <FormItem label="描述信息" style="width: 100%">
135
           <Input
140
           <Input
136
-              type="textarea"
137
-              v-model="regionInfo.admin.comm"
138
-              placeholder="请输入描述信息"
141
+            type="textarea"
142
+            v-model="regionInfo.admin.comm"
143
+            placeholder="请输入描述信息"
139
           ></Input>
144
           ></Input>
140
         </FormItem>
145
         </FormItem>
141
       </Form>
146
       </Form>
148
         "
153
         "
149
       >
154
       >
150
         <div style="color: #b50000">
155
         <div style="color: #b50000">
151
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
156
+          注:密码必须是6-16位的大小写英文字母、数字组合
152
         </div>
157
         </div>
153
         <div>
158
         <div>
154
           <Button @click="regionInfo.show = false">取消</Button>
159
           <Button @click="regionInfo.show = false">取消</Button>
285
 </template>
290
 </template>
286
 
291
 
287
 <script>
292
 <script>
288
-import { generateRandomString } from "@/utils";
293
+import { generateRandomString, pwdCheck, reg } from "@/utils";
289
 import {
294
 import {
290
   region_list_admin,
295
   region_list_admin,
291
   region_delete,
296
   region_delete,
298
 import { login_msg_code } from "@/api/login";
303
 import { login_msg_code } from "@/api/login";
299
 export default {
304
 export default {
300
   data() {
305
   data() {
301
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
302
-    // 密码验证
303
-    const pwdCheck = (rule, value, callback) => {
304
-      if (!reg.test(value)) {
305
-        return callback(new Error("密码格式不正确!"));
306
-      }
307
-      callback();
308
-    };
309
     // 重复密码验证
306
     // 重复密码验证
310
     const pwdAgainCheck = async (rule, value, callback) => {
307
     const pwdAgainCheck = async (rule, value, callback) => {
311
       if (!reg.test(value)) {
308
       if (!reg.test(value)) {
731
         admin: {
728
         admin: {
732
           aname: "",
729
           aname: "",
733
           loginname: "",
730
           loginname: "",
734
-          loginpwd: generateRandomString(8),
731
+          loginpwd: generateRandomString(),
735
           loginpwd1: "",
732
           loginpwd1: "",
736
           phone: "",
733
           phone: "",
737
           msgcode: "",
734
           msgcode: "",

+ 27
- 55
src/views/regionSection/regionManage/schoolManage.vue View File

261
               }}
261
               }}
262
             </div>
262
             </div>
263
           </FormItem>
263
           </FormItem>
264
+          <FormItem label="地址" style="width: 100%">
265
+            <Input
266
+              v-model="adminInfo.admin.address"
267
+              placeholder="请输入地址"
268
+            ></Input>
269
+          </FormItem>
270
+          <FormItem label="描述信息" style="width: 100%">
271
+            <Input
272
+              type="textarea"
273
+              v-model="adminInfo.admin.comm"
274
+              placeholder="请输入描述信息"
275
+            ></Input>
276
+          </FormItem>
264
         </div>
277
         </div>
265
       </Form>
278
       </Form>
266
       <div
279
       <div
272
         "
285
         "
273
       >
286
       >
274
         <div style="color: #b50000">
287
         <div style="color: #b50000">
275
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间。
288
+          <span v-if="adminInfo.createAdmin"
289
+            >注:密码必须是6-16位的大小写英文字母、数字组合。</span
290
+          >
276
         </div>
291
         </div>
277
         <div>
292
         <div>
278
           <Button @click="adminInfo.show = false">取消</Button>
293
           <Button @click="adminInfo.show = false">取消</Button>
280
         </div>
295
         </div>
281
       </div>
296
       </div>
282
     </Modal>
297
     </Modal>
283
-    <!-- 查看 -->
284
-    <Modal
285
-      class="modal1"
286
-      :mask-closable="false"
287
-      v-model="viewInfo.show"
288
-      title="查看"
289
-    >
290
-      <div class="view_title">
291
-        <div>{{ viewInfo.aname }}</div>
292
-        <div v-if="viewInfo.enabled === 1" class="enabled_1">启用</div>
293
-        <div v-if="viewInfo.enabled === 2" class="enabled_2">禁用</div>
294
-      </div>
295
-      <Form :label-width="80" inline>
296
-        <FormItem
297
-          label="登录账号"
298
-          style="margin-bottom: 0; width: calc(50% - 10px)"
299
-          >{{ viewInfo.loginname }}</FormItem
300
-        >
301
-        <FormItem
302
-          label="手机号码"
303
-          style="margin-bottom: 0; width: calc(50% - 10px)"
304
-          >{{ viewInfo.phone }}</FormItem
305
-        >
306
-        <FormItem label="所属区域" style="margin-bottom: 0; width: 100%">{{
307
-          viewInfo.regionName
308
-        }}</FormItem>
309
-      </Form>
310
-      <div slot="footer" style="text-align: center">
311
-        <Button @click="viewInfo.show = false">关闭</Button>
312
-      </div>
313
-    </Modal>
314
     <Spin fix v-if="showLoading" style="background-color: transparent">
298
     <Spin fix v-if="showLoading" style="background-color: transparent">
315
       <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
299
       <Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
316
       <div>加载中</div>
300
       <div>加载中</div>
321
 <script>
305
 <script>
322
 import { region_list_sel_qy } from "@/api/region";
306
 import { region_list_sel_qy } from "@/api/region";
323
 import { login_msg_code } from "@/api/login";
307
 import { login_msg_code } from "@/api/login";
324
-import { generateRandomString } from "@/utils";
308
+import { generateRandomString, pwdCheck, reg } from "@/utils";
325
 import {
309
 import {
326
   area_list_sel,
310
   area_list_sel,
327
   school_add,
311
   school_add,
334
 } from "@/api/school";
318
 } from "@/api/school";
335
 export default {
319
 export default {
336
   data() {
320
   data() {
337
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
338
-    // 密码验证
339
-    const pwdCheck = (rule, value, callback) => {
340
-      if (!reg.test(this.adminInfo.admin.loginpwd)) {
341
-        return callback(new Error("密码格式不正确!"));
342
-      } else {
343
-        callback();
344
-      }
345
-    };
346
     // 重复密码验证
321
     // 重复密码验证
347
     const pwdAgainCheck = async (rule, value, callback) => {
322
     const pwdAgainCheck = async (rule, value, callback) => {
348
       if (!reg.test(this.adminInfo.admin.loginpwd1)) {
323
       if (!reg.test(this.adminInfo.admin.loginpwd1)) {
389
           loginname: "",
364
           loginname: "",
390
           loginpwd: "",
365
           loginpwd: "",
391
           phone: "",
366
           phone: "",
392
-          msgcode: ""
367
+          msgcode: "",
368
+          address: "",
369
+          comm: ""
393
         }
370
         }
394
       },
371
       },
395
       rules: {
372
       rules: {
429
           }
406
           }
430
         ]
407
         ]
431
       },
408
       },
432
-      // 查看
433
-      viewInfo: {
434
-        show: false,
435
-        enabled: "",
436
-        aname: "",
437
-        loginname: "",
438
-        phone: "",
439
-        regionName: ""
440
-      },
441
       columns: [
409
       columns: [
442
         {
410
         {
443
           title: "序号",
411
           title: "序号",
647
         admin: {
615
         admin: {
648
           aname: "",
616
           aname: "",
649
           loginname: "",
617
           loginname: "",
650
-          loginpwd: generateRandomString(8),
618
+          loginpwd: generateRandomString(),
651
           loginpwd1: "",
619
           loginpwd1: "",
652
           phone: "",
620
           phone: "",
653
-          msgcode: ""
621
+          msgcode: "",
622
+          address: "",
623
+          cpmm: ""
654
         }
624
         }
655
       };
625
       };
656
     },
626
     },
749
               loginname: this.adminInfo.admin.loginname,
719
               loginname: this.adminInfo.admin.loginname,
750
               loginpwd: this.adminInfo.admin.loginpwd,
720
               loginpwd: this.adminInfo.admin.loginpwd,
751
               phone: this.adminInfo.admin.phone,
721
               phone: this.adminInfo.admin.phone,
752
-              msgcode: this.adminInfo.admin.msgcode
722
+              msgcode: this.adminInfo.admin.msgcode,
723
+              address: this.adminInfo.admin.address,
724
+              comm: this.adminInfo.admin.comm
753
             };
725
             };
754
           }
726
           }
755
           this.showLoading = true;
727
           this.showLoading = true;

+ 5
- 14
src/views/schoolSection/userManage/userManage.vue View File

302
         "
302
         "
303
       >
303
       >
304
         <div style="color: #b50000">
304
         <div style="color: #b50000">
305
-          注:密码必须包含大小写字母和数字的组合,长度在8-32之间
305
+          注:密码必须是6-16位的大小写英文字母、数字组合
306
         </div>
306
         </div>
307
         <div>
307
         <div>
308
           <Button @click="addInfo.show = false">取消</Button>
308
           <Button @click="addInfo.show = false">取消</Button>
333
 } from "@/api/school";
333
 } from "@/api/school";
334
 import { user_add, user_edit } from "@/api/school";
334
 import { user_add, user_edit } from "@/api/school";
335
 import { exportToExcel } from "@/utils/exportToExcel";
335
 import { exportToExcel } from "@/utils/exportToExcel";
336
-
336
+import { generateRandomString, pwdCheck, reg} from "@/utils";
337
 export default {
337
 export default {
338
   data() {
338
   data() {
339
-    const reg = /^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{8,32}$/;
340
-    // 密码验证
341
-    const pwdCheck = (rule, value, callback) => {
342
-      if (!reg.test(value)) {
343
-        return callback(new Error("密码格式不正确!"));
344
-      }
345
-      callback();
346
-    };
347
     // 重复密码验证
339
     // 重复密码验证
348
     const pwdAgainCheck = async (rule, value, callback) => {
340
     const pwdAgainCheck = async (rule, value, callback) => {
349
-      if (!value) {
350
-        return callback(new Error("确认密码不能为空!"));
351
-      }
352
       if (!reg.test(value)) {
341
       if (!reg.test(value)) {
353
         return callback(new Error("密码格式不正确!"));
342
         return callback(new Error("密码格式不正确!"));
354
       }
343
       }
417
         username: "",
406
         username: "",
418
         loginname: "",
407
         loginname: "",
419
         loginpwd: "",
408
         loginpwd: "",
409
+        loginpwd1: "",
420
         classid: "",
410
         classid: "",
421
         classname: "",
411
         classname: "",
422
         schoolid: null,
412
         schoolid: null,
654
         usersex: 1,
644
         usersex: 1,
655
         username: "",
645
         username: "",
656
         loginname: "",
646
         loginname: "",
657
-        loginpwd: "",
647
+        loginpwd: generateRandomString(),
648
+        loginpwd1: "",
658
         classid: "",
649
         classid: "",
659
         classname: "",
650
         classname: "",
660
         schoolid: null,
651
         schoolid: null,

Loading…
Cancel
Save