用户管理更新
This commit is contained in:
@@ -90,7 +90,8 @@
|
||||
placeholder="选择部门"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="密码" prop="password">
|
||||
<br v-if="!crud.status.add">
|
||||
<el-form-item label="密码" prop="password" v-if="crud.status.add">
|
||||
<el-input v-model="form.password" style="width: 200px;" show-password/>
|
||||
</el-form-item>
|
||||
<el-form-item v-if="false" label="岗位" prop="jobs">
|
||||
@@ -199,16 +200,18 @@
|
||||
<el-table-column
|
||||
v-permission="['admin','user:edit','user:del']"
|
||||
label="操作"
|
||||
width="115"
|
||||
width="200"
|
||||
align="center"
|
||||
fixed="right"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<udOperation
|
||||
style="display: inline"
|
||||
:data="scope.row"
|
||||
:permission="permission"
|
||||
:disabled-dle="scope.row.id === user.id"
|
||||
/>
|
||||
<el-button type="text" slot="left" icon="el-icon-refresh-left" @click="resetPassword(scope.row)">重置密码</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -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: '取消输入'
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user