|
|
|
@ -121,7 +121,7 @@
|
|
|
|
|
<el-form-item label="角色顺序" prop="roleSort">
|
|
|
|
|
<el-input-number v-model="form.roleSort" controls-position="right" :min="0"/>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-form-item label="状态" prop="status">
|
|
|
|
|
<el-radio-group v-model="form.status">
|
|
|
|
|
<el-radio label="0">正常</el-radio>
|
|
|
|
|
<el-radio label="1">禁用</el-radio>
|
|
|
|
@ -293,7 +293,7 @@ export default {
|
|
|
|
|
// roleKey: [
|
|
|
|
|
// {required: true, message: "权限字符不能为空", trigger: "blur"}
|
|
|
|
|
// ],
|
|
|
|
|
menuOptions:[
|
|
|
|
|
menuOptions: [
|
|
|
|
|
{required: true, message: "角色列表不能为空", trigger: "blur"}
|
|
|
|
|
],
|
|
|
|
|
roleSort: [
|
|
|
|
@ -378,8 +378,13 @@ export default {
|
|
|
|
|
let text = row.status === "0" ? "启用" : "禁用";
|
|
|
|
|
this.$modal.confirm('确认要"' + text + '""' + row.roleName + '"角色吗?').then(function () {
|
|
|
|
|
return changeRoleStatus(row.roleId, row.status);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.$modal.msgSuccess(text + "成功");
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.$modal.msgSuccess(text + "成功");
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError(res.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch(function () {
|
|
|
|
|
row.status = row.status === "0" ? "1" : "0";
|
|
|
|
|
});
|
|
|
|
@ -538,22 +543,22 @@ export default {
|
|
|
|
|
if (valid) {
|
|
|
|
|
if (this.form.roleId != undefined) {
|
|
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys();
|
|
|
|
|
if( this.form.menuIds.length==0){
|
|
|
|
|
if (this.form.menuIds.length == 0) {
|
|
|
|
|
this.$message.error("菜单权限不能为空");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
|
updateRole(this.form).then(response => {
|
|
|
|
|
if(response.code === 20000){
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
}else{
|
|
|
|
|
if (response.code === 20000) {
|
|
|
|
|
this.$modal.msgSuccess("修改成功");
|
|
|
|
|
this.open = false;
|
|
|
|
|
this.getList();
|
|
|
|
|
} else {
|
|
|
|
|
this.$message.error(response.message);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys();
|
|
|
|
|
if(this.form.menuIds.length==0){
|
|
|
|
|
if (this.form.menuIds.length == 0) {
|
|
|
|
|
this.$message.error("菜单权限不能为空");
|
|
|
|
|
return
|
|
|
|
|
}
|
|
|
|
@ -582,9 +587,14 @@ export default {
|
|
|
|
|
const roleIds = row.roleId || this.ids;
|
|
|
|
|
this.$modal.confirm('是否确认删除该角色?').then(function () {
|
|
|
|
|
return delRole(roleIds);
|
|
|
|
|
}).then(() => {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
if (res.code == 20000) {
|
|
|
|
|
this.getList();
|
|
|
|
|
this.$modal.msgSuccess("删除成功");
|
|
|
|
|
} else {
|
|
|
|
|
this.$modal.msgError(res.message);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|