leisure-core 0.6.23 → 0.6.25
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/le-home/src/main.vue +52 -10
- package/package.json +1 -1
package/le-home/src/main.vue
CHANGED
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
</span>
|
|
21
21
|
<el-dropdown-menu slot="dropdown">
|
|
22
22
|
<el-dropdown-item command="1">修改密码</el-dropdown-item>
|
|
23
|
-
<el-dropdown-item command="
|
|
23
|
+
<el-dropdown-item command="3">个人信息</el-dropdown-item>
|
|
24
24
|
<el-dropdown-item
|
|
25
25
|
v-for="item in extraDropdownItems"
|
|
26
26
|
:key="item.command"
|
|
@@ -29,6 +29,7 @@
|
|
|
29
29
|
>
|
|
30
30
|
{{ item.label }}
|
|
31
31
|
</el-dropdown-item>
|
|
32
|
+
<el-dropdown-item command="2">退出</el-dropdown-item>
|
|
32
33
|
</el-dropdown-menu>
|
|
33
34
|
</el-dropdown>
|
|
34
35
|
</div>
|
|
@@ -108,7 +109,7 @@
|
|
|
108
109
|
</el-main>
|
|
109
110
|
</el-container>
|
|
110
111
|
<el-dialog
|
|
111
|
-
title="
|
|
112
|
+
title="修改密码"
|
|
112
113
|
ref="elDialog"
|
|
113
114
|
:visible.sync="showChangePwd"
|
|
114
115
|
width="30%"
|
|
@@ -142,12 +143,6 @@
|
|
|
142
143
|
autocomplete="off"
|
|
143
144
|
></el-input>
|
|
144
145
|
</el-form-item>
|
|
145
|
-
<el-form-item label="昵称" prop="nick">
|
|
146
|
-
<el-input v-model="ruleForm.nick" autocomplete="off"></el-input>
|
|
147
|
-
</el-form-item>
|
|
148
|
-
<el-form-item label="手机号" prop="phone">
|
|
149
|
-
<el-input v-model="ruleForm.phone" autocomplete="off"></el-input>
|
|
150
|
-
</el-form-item>
|
|
151
146
|
</el-form>
|
|
152
147
|
<div
|
|
153
148
|
ref="pwdref"
|
|
@@ -167,6 +162,16 @@
|
|
|
167
162
|
>
|
|
168
163
|
</div>
|
|
169
164
|
</el-dialog>
|
|
165
|
+
<le-dialog-container :showDialog="showPerInfo" title="个人信息" width="30%">
|
|
166
|
+
<le-list-form
|
|
167
|
+
:formColumns="formColumns"
|
|
168
|
+
:formData="perInfo"
|
|
169
|
+
:columnsPerRow="1"
|
|
170
|
+
:handleStatus="2"
|
|
171
|
+
@closeDialog="cancelChangePerInfo"
|
|
172
|
+
@saveData="savePerInfo"
|
|
173
|
+
></le-list-form>
|
|
174
|
+
</le-dialog-container>
|
|
170
175
|
<div v-show="contextMenuVisible">
|
|
171
176
|
<ul
|
|
172
177
|
:style="{ left: menuLeft + 'px', top: menuTop + 'px' }"
|
|
@@ -249,6 +254,7 @@ export default {
|
|
|
249
254
|
title: "",
|
|
250
255
|
cacheView: [],
|
|
251
256
|
showChangePwd: false,
|
|
257
|
+
showPerInfo: false,
|
|
252
258
|
username: "",
|
|
253
259
|
changeUid: "",
|
|
254
260
|
tabNameCurrent: "",
|
|
@@ -256,6 +262,12 @@ export default {
|
|
|
256
262
|
ruleForm: {
|
|
257
263
|
pwd: "",
|
|
258
264
|
confirmPwd: "",
|
|
265
|
+
},
|
|
266
|
+
formColumns: [
|
|
267
|
+
{ prop: "nick", label: "昵称" },
|
|
268
|
+
{ prop: "phone", label: "手机号" },
|
|
269
|
+
],
|
|
270
|
+
perInfo: {
|
|
259
271
|
nick: this.$store.getters.userinfo.nick,
|
|
260
272
|
phone: this.$store.getters.userinfo.phone,
|
|
261
273
|
},
|
|
@@ -409,6 +421,7 @@ export default {
|
|
|
409
421
|
handleCommand(command) {
|
|
410
422
|
if (command === "1") this.changPwd();
|
|
411
423
|
else if (command === "2") this.signout();
|
|
424
|
+
else if (command === "3") this.changPerson();
|
|
412
425
|
else this.$emit("command", command); // 抛出外部命令
|
|
413
426
|
},
|
|
414
427
|
changPwd() {
|
|
@@ -417,6 +430,12 @@ export default {
|
|
|
417
430
|
this.ruleForm.confirmPwd = "";
|
|
418
431
|
this.showChangePwd = true;
|
|
419
432
|
},
|
|
433
|
+
changPerson() {
|
|
434
|
+
this.changeUid = this.$store.getters.userinfo.id;
|
|
435
|
+
this.perInfo.nick = this.$store.getters.userinfo.nick;
|
|
436
|
+
this.perInfo.phone = this.$store.getters.userinfo.phone;
|
|
437
|
+
this.showPerInfo = true;
|
|
438
|
+
},
|
|
420
439
|
validatePhone(phone) {
|
|
421
440
|
const phoneRegex = /^1[3-9]\d{9}$/;
|
|
422
441
|
return phoneRegex.test(phone);
|
|
@@ -427,6 +446,31 @@ export default {
|
|
|
427
446
|
this.ruleForm.pwd = "";
|
|
428
447
|
this.ruleForm.confirmPwd = "";
|
|
429
448
|
},
|
|
449
|
+
cancelChangePerInfo() {
|
|
450
|
+
this.showPerInfo = false;
|
|
451
|
+
this.perInfo.nick = "";
|
|
452
|
+
this.perInfo.phone = "";
|
|
453
|
+
},
|
|
454
|
+
savePerInfo(param) {
|
|
455
|
+
if (param.phone) {
|
|
456
|
+
if (!this.validatePhone(param.phone)) {
|
|
457
|
+
this.$message.error("请输入有效的手机号");
|
|
458
|
+
return;
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
if (!param.nick && !param.phone) {
|
|
463
|
+
this.$message.error("昵称和手机号至少填写一项");
|
|
464
|
+
return;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
let params = {
|
|
468
|
+
uid: this.$store.getters.userinfo.id,
|
|
469
|
+
nick: param.nick,
|
|
470
|
+
phone: param.phone,
|
|
471
|
+
};
|
|
472
|
+
this.$emit("savePerInfo", params);
|
|
473
|
+
},
|
|
430
474
|
saveChangePwd(formName) {
|
|
431
475
|
this.$refs[formName].validate((valid) => {
|
|
432
476
|
if (valid) {
|
|
@@ -434,8 +478,6 @@ export default {
|
|
|
434
478
|
pwd: this.ruleForm.pwd,
|
|
435
479
|
confirmPwd: this.ruleForm.confirmPwd,
|
|
436
480
|
uid: this.changeUid,
|
|
437
|
-
nick: this.ruleForm.nick,
|
|
438
|
-
phone: this.ruleForm.phone,
|
|
439
481
|
};
|
|
440
482
|
this.$emit("userChangePwd", params, this.changePwdAfter);
|
|
441
483
|
} else {
|