diff --git a/mes/qd/src/views/system/user/index.vue b/mes/qd/src/views/system/user/index.vue index d16b4270..ef81a59c 100644 --- a/mes/qd/src/views/system/user/index.vue +++ b/mes/qd/src/views/system/user/index.vue @@ -90,7 +90,8 @@ placeholder="选择部门" /> - +
+ @@ -199,16 +200,18 @@ @@ -340,6 +343,7 @@ export default { }, // 新增前将多选的值设置为空 [CRUD.HOOK.beforeToAdd]() { + this.form.password = '123456' this.jobDatas = [] this.roleDatas = [] }, @@ -369,8 +373,8 @@ export default { userJobs.push(data) }) }, - [CRUD.HOOK.afterRefresh]() { - console.log(this.crud.data) + [CRUD.HOOK.beforeToCU]() { + console.log(this.crud.status) }, // 提交前做的操作 [CRUD.HOOK.afterValidateCU](crud) { @@ -503,6 +507,29 @@ export default { }, checkboxT(row, rowIndex) { return row.id !== this.user.id + }, + resetPassword(row) { + row.password = null + this.$prompt('', '重置密码', { + confirmButtonText: '确定', + cancelButtonText: '取消', + inputPlaceholder: '请输入新的密码', + inputPattern: /^[A-Z|a-z|0-9|(._~!@#$^&*)]{6,20}$/, + inputErrorMessage: '密码格式不正确,只能是6-20位密码', + closeOnClickModal: false + }).then(({ value }) => { + row.password = value + crudUser.edit(row).then(res => { + console.log(res) + this.crud.toQuery() + this.crud.notify('密码重置成功', CRUD.NOTIFICATION_TYPE.SUCCESS) + }) + }).catch(() => { + this.$message({ + type: 'info', + message: '取消输入' + }) + }) } } }