|
@@ -103,7 +103,7 @@
|
|
|
|
|
|
<el-table v-loading="loading" :data="roleList" @selection-change="handleSelectionChange">
|
|
|
<el-table-column type="selection" width="55" align="center" />
|
|
|
- <el-table-column label="角色编号" prop="roleId" width="120" />
|
|
|
+ <el-table-column label="角色编号" prop="id" width="120" />
|
|
|
<el-table-column label="角色名称" prop="roleName" :show-overflow-tooltip="true" width="150" />
|
|
|
<el-table-column label="权限字符" prop="roleKey" :show-overflow-tooltip="true" width="150" />
|
|
|
<el-table-column label="显示顺序" prop="roleSort" width="100" />
|
|
@@ -388,15 +388,15 @@ export default {
|
|
|
return checkedKeys;
|
|
|
},
|
|
|
/** 根据角色ID查询菜单树结构 */
|
|
|
- getRoleMenuTreeselect(roleId) {
|
|
|
- return roleMenuTreeselect(roleId).then(response => {
|
|
|
+ getRoleMenuTreeselect(id) {
|
|
|
+ return roleMenuTreeselect(id).then(response => {
|
|
|
this.menuOptions = response.menus;
|
|
|
return response;
|
|
|
});
|
|
|
},
|
|
|
/** 根据角色ID查询部门树结构 */
|
|
|
- getRoleDeptTreeselect(roleId) {
|
|
|
- return roleDeptTreeselect(roleId).then(response => {
|
|
|
+ getRoleDeptTreeselect(id) {
|
|
|
+ return roleDeptTreeselect(id).then(response => {
|
|
|
this.deptOptions = response.depts;
|
|
|
return response;
|
|
|
});
|
|
@@ -409,7 +409,7 @@ export default {
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(function() {
|
|
|
- return changeRoleStatus(row.roleId, row.status);
|
|
|
+ return changeRoleStatus(row.id, row.status);
|
|
|
}).then(() => {
|
|
|
this.msgSuccess(text + "成功");
|
|
|
}).catch(function() {
|
|
@@ -436,7 +436,7 @@ export default {
|
|
|
this.deptExpand = true,
|
|
|
this.deptNodeAll = false,
|
|
|
this.form = {
|
|
|
- roleId: undefined,
|
|
|
+ id: undefined,
|
|
|
roleName: undefined,
|
|
|
roleKey: undefined,
|
|
|
roleSort: 0,
|
|
@@ -462,7 +462,7 @@ export default {
|
|
|
},
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.roleId)
|
|
|
+ this.ids = selection.map(item => item.id)
|
|
|
this.single = selection.length!=1
|
|
|
this.multiple = !selection.length
|
|
|
},
|
|
@@ -506,9 +506,9 @@ export default {
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const roleId = row.roleId || this.ids
|
|
|
- const roleMenu = this.getRoleMenuTreeselect(roleId);
|
|
|
- getRole(roleId).then(response => {
|
|
|
+ const id = row.id || this.ids
|
|
|
+ const roleMenu = this.getRoleMenuTreeselect(id);
|
|
|
+ getRole(id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.open = true;
|
|
|
this.$nextTick(() => {
|
|
@@ -533,8 +533,8 @@ export default {
|
|
|
/** 分配数据权限操作 */
|
|
|
handleDataScope(row) {
|
|
|
this.reset();
|
|
|
- const roleDeptTreeselect = this.getRoleDeptTreeselect(row.roleId);
|
|
|
- getRole(row.roleId).then(response => {
|
|
|
+ const roleDeptTreeselect = this.getRoleDeptTreeselect(row.id);
|
|
|
+ getRole(row.id).then(response => {
|
|
|
this.form = response.data;
|
|
|
this.openDataScope = true;
|
|
|
this.$nextTick(() => {
|
|
@@ -549,7 +549,7 @@ export default {
|
|
|
submitForm: function() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.roleId != undefined) {
|
|
|
+ if (this.form.id != undefined) {
|
|
|
this.form.menuIds = this.getMenuAllCheckedKeys();
|
|
|
updateRole(this.form).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -569,7 +569,7 @@ export default {
|
|
|
},
|
|
|
/** 提交按钮(数据权限) */
|
|
|
submitDataScope: function() {
|
|
|
- if (this.form.roleId != undefined) {
|
|
|
+ if (this.form.id != undefined) {
|
|
|
this.form.deptIds = this.getDeptAllCheckedKeys();
|
|
|
dataScope(this.form).then(response => {
|
|
|
this.msgSuccess("修改成功");
|
|
@@ -580,13 +580,13 @@ export default {
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const roleIds = row.roleId || this.ids;
|
|
|
- this.$confirm('是否确认删除角色编号为"' + roleIds + '"的数据项?', "警告", {
|
|
|
+ const ids = row.id || this.ids;
|
|
|
+ this.$confirm('是否确认删除角色编号为"' + ids + '"的数据项?', "警告", {
|
|
|
confirmButtonText: "确定",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
}).then(function() {
|
|
|
- return delRole(roleIds);
|
|
|
+ return delRole(ids);
|
|
|
}).then(() => {
|
|
|
this.getList();
|
|
|
this.msgSuccess("删除成功");
|
|
@@ -600,4 +600,4 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
-</script>
|
|
|
+</script>
|