截止‘运力管理’模块
This commit is contained in:
@@ -172,6 +172,10 @@
|
||||
<el-icon><refresh /></el-icon>
|
||||
密码重置
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="setPassword" v-if="permission.user_reset">
|
||||
<el-icon><key /></el-icon>
|
||||
修改密码
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item command="delete" v-if="this.permission.user_delete">
|
||||
<el-icon><delete /></el-icon>
|
||||
删除用户
|
||||
@@ -265,6 +269,32 @@
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 管理员修改密码 -->
|
||||
<el-dialog title="修改密码" append-to-body v-model="passwordBox" width="460px">
|
||||
<el-form
|
||||
ref="passwordFormRef"
|
||||
:model="passwordForm"
|
||||
:rules="passwordRules"
|
||||
label-width="90px"
|
||||
>
|
||||
<el-form-item label="登录账号">
|
||||
<el-input v-model="passwordForm.account" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="新密码" prop="password">
|
||||
<el-input v-model="passwordForm.password" type="password" show-password />
|
||||
</el-form-item>
|
||||
<el-form-item label="确认密码" prop="password2">
|
||||
<el-input v-model="passwordForm.password2" type="password" show-password />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button @click="passwordBox = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitPassword">确 定</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 认证日志组件 -->
|
||||
<auth-log ref="authLog" />
|
||||
<!-- 认证锁定配置组件 -->
|
||||
@@ -285,6 +315,7 @@ import {
|
||||
add,
|
||||
grant,
|
||||
resetPassword,
|
||||
setPassword,
|
||||
auditPass,
|
||||
auditRefuse,
|
||||
setLeader,
|
||||
@@ -295,6 +326,7 @@ import { getDeptTree } from '@/api/system/dept';
|
||||
import { getRoleTree } from '@/api/system/role';
|
||||
import { getPostList } from '@/api/system/post';
|
||||
import { mapGetters } from 'vuex';
|
||||
import { h } from 'vue';
|
||||
import website from '@/config/website';
|
||||
import { getToken } from '@/utils/auth';
|
||||
import { downloadXls } from '@/utils/util';
|
||||
@@ -318,6 +350,7 @@ export default {
|
||||
grantUserId: '',
|
||||
excelBox: false,
|
||||
platformBox: false,
|
||||
passwordBox: false,
|
||||
initFlag: true,
|
||||
auditMode: false,
|
||||
selectionList: [],
|
||||
@@ -341,6 +374,17 @@ export default {
|
||||
platformFormOption: platformFormOption,
|
||||
data: [],
|
||||
platformForm: {},
|
||||
passwordForm: {},
|
||||
passwordRules: {
|
||||
password: [
|
||||
{ required: true, message: '请输入新密码', trigger: 'blur' },
|
||||
{ min: 6, max: 32, message: '密码长度在6到32个字符', trigger: 'blur' },
|
||||
],
|
||||
password2: [
|
||||
{ required: true, message: '请再次输入新密码', trigger: 'blur' },
|
||||
{ validator: this.validatePassword2, trigger: 'blur' },
|
||||
],
|
||||
},
|
||||
excelForm: {},
|
||||
excelOption: excelOption,
|
||||
};
|
||||
@@ -409,12 +453,14 @@ export default {
|
||||
this.handlePlatformForRow(row);
|
||||
} else if (command === 'resetPassword') {
|
||||
this.handleResetForRow(row);
|
||||
} else if (command === 'setPassword') {
|
||||
this.handlePasswordForRow(row);
|
||||
} else if (command === 'delete') {
|
||||
this.$refs.crud.rowDel(row, index);
|
||||
}
|
||||
},
|
||||
handleResetForRow(row) {
|
||||
this.$confirm(`确定将账号【${row.account}】的密码重置为初始密码?`, '提示', {
|
||||
this.$confirm(`确定将账号【${row.account}】的密码重置为随机密码?`, '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
@@ -422,11 +468,8 @@ export default {
|
||||
.then(() => {
|
||||
return resetPassword(row.id);
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '密码重置成功!',
|
||||
});
|
||||
.then(res => {
|
||||
this.showResetPassword(res.data.data);
|
||||
});
|
||||
},
|
||||
handleDataManageCommand(command) {
|
||||
@@ -642,7 +685,7 @@ export default {
|
||||
this.$message.warning('请选择至少一条数据');
|
||||
return;
|
||||
}
|
||||
this.$confirm('确定将选择账号密码重置为初始密码?', {
|
||||
this.$confirm('确定将选择账号密码重置为随机密码?', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning',
|
||||
@@ -650,14 +693,20 @@ export default {
|
||||
.then(() => {
|
||||
return resetPassword(this.ids);
|
||||
})
|
||||
.then(() => {
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: '操作成功!',
|
||||
});
|
||||
.then(res => {
|
||||
this.showResetPassword(res.data.data);
|
||||
this.$refs.crud.toggleSelection();
|
||||
});
|
||||
},
|
||||
showResetPassword(passwordMap) {
|
||||
const passwordList = Object.keys(passwordMap || {}).map(account =>
|
||||
h('div', null, `${account}:${passwordMap[account]}`)
|
||||
);
|
||||
this.$alert(h('div', null, passwordList), '密码重置成功,请立即保存', {
|
||||
confirmButtonText: '我已保存',
|
||||
type: 'success',
|
||||
});
|
||||
},
|
||||
handleGrant() {
|
||||
if (this.selectionList.length === 0) {
|
||||
this.$message.warning('请选择至少一条数据');
|
||||
@@ -759,6 +808,40 @@ export default {
|
||||
this.$message({ type: 'success', message: '操作成功!' });
|
||||
});
|
||||
},
|
||||
handlePasswordForRow(row) {
|
||||
this.passwordForm = {
|
||||
userId: row.id,
|
||||
account: row.account,
|
||||
password: '',
|
||||
password2: '',
|
||||
};
|
||||
this.passwordBox = true;
|
||||
this.$nextTick(() => {
|
||||
this.$refs.passwordFormRef && this.$refs.passwordFormRef.clearValidate();
|
||||
});
|
||||
},
|
||||
validatePassword2(rule, value, callback) {
|
||||
if (value !== this.passwordForm.password) {
|
||||
callback(new Error('两次输入密码不一致!'));
|
||||
} else {
|
||||
callback();
|
||||
}
|
||||
},
|
||||
submitPassword() {
|
||||
this.$refs.passwordFormRef.validate(valid => {
|
||||
if (!valid) {
|
||||
return;
|
||||
}
|
||||
setPassword(
|
||||
this.passwordForm.userId,
|
||||
this.passwordForm.password,
|
||||
this.passwordForm.password2
|
||||
).then(() => {
|
||||
this.passwordBox = false;
|
||||
this.$message({ type: 'success', message: '密码修改成功!' });
|
||||
});
|
||||
});
|
||||
},
|
||||
handleImport() {
|
||||
this.excelBox = true;
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user