|
@@ -94,7 +94,7 @@
|
|
|
:radio-config="{trigger: 'row'}"
|
|
|
>
|
|
|
<vxe-column type="radio" width="60"/>
|
|
|
-<!-- <vxe-table-column field="roleId" title="角色编号"/>-->
|
|
|
+ <!-- <vxe-table-column field="roleId" title="角色编号"/>-->
|
|
|
<vxe-table-column field="roleName" title="角色名称"/>
|
|
|
<vxe-table-column field="roleType" title="类型" :formatter="typeFormat"/>
|
|
|
<vxe-table-column field="roleKey" title="字符标识"/>
|
|
@@ -245,7 +245,7 @@ export default {
|
|
|
{value: '0', label: '正常'},
|
|
|
{value: '1', label: '停用'}
|
|
|
],
|
|
|
- edit:false,
|
|
|
+ edit: false,
|
|
|
showTable: true,
|
|
|
// 遮罩层
|
|
|
loading: true,
|
|
@@ -345,7 +345,7 @@ export default {
|
|
|
return belongTo
|
|
|
},
|
|
|
/** 查询角色列表 */
|
|
|
- getList(){
|
|
|
+ getList() {
|
|
|
this.loading = true;
|
|
|
var searchParams = {
|
|
|
currentPage: this.currentPage,
|
|
@@ -411,7 +411,7 @@ export default {
|
|
|
}
|
|
|
this.$axios.get('/sysMenuController/roleMenuTreeselect',
|
|
|
{params: param}).then((res) => {
|
|
|
- console.log(res.data)
|
|
|
+ console.log(res.data)
|
|
|
this.menuOptions = res.data.menus;
|
|
|
return res.data
|
|
|
}).catch((error) => {
|
|
@@ -447,29 +447,29 @@ export default {
|
|
|
}
|
|
|
this.edit = false,
|
|
|
this.menuExpand = false,
|
|
|
- this.menuNodeAll = false,
|
|
|
- this.deptExpand = true,
|
|
|
- this.deptNodeAll = false,
|
|
|
- this.form = {
|
|
|
- roleId: undefined,
|
|
|
- roleName: undefined,
|
|
|
- roleKey: undefined,
|
|
|
- roleSort: 0,
|
|
|
- status: "0",
|
|
|
- roleType: "0",
|
|
|
- menuIds: [],
|
|
|
- deptIds: [],
|
|
|
- menuCheckStrictly: true,
|
|
|
- deptCheckStrictly: true,
|
|
|
- remark: undefined
|
|
|
- };
|
|
|
+ this.menuNodeAll = false,
|
|
|
+ this.deptExpand = true,
|
|
|
+ this.deptNodeAll = false,
|
|
|
+ this.form = {
|
|
|
+ roleId: undefined,
|
|
|
+ roleName: undefined,
|
|
|
+ roleKey: undefined,
|
|
|
+ roleSort: 0,
|
|
|
+ status: "0",
|
|
|
+ roleType: "0",
|
|
|
+ menuIds: [],
|
|
|
+ deptIds: [],
|
|
|
+ menuCheckStrictly: true,
|
|
|
+ deptCheckStrictly: true,
|
|
|
+ remark: undefined
|
|
|
+ };
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
- handleQuery:debounce(function(){
|
|
|
+ handleQuery: debounce(function () {
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
- },1000),
|
|
|
+ }, 1000),
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.dateRange = [];
|
|
@@ -527,10 +527,10 @@ export default {
|
|
|
this.getMenuTreeselect();
|
|
|
this.open = true;
|
|
|
this.title = "添加角色";
|
|
|
- this.edit=false;
|
|
|
+ this.edit = false;
|
|
|
}, 500),
|
|
|
/** 修改按钮操作 */
|
|
|
- handleUpdate:debounce(function () {
|
|
|
+ handleUpdate: debounce(function () {
|
|
|
this.reset();
|
|
|
const _selectData = this.$refs.xTable.getRadioRecord(true)
|
|
|
if (_selectData == null) {
|
|
@@ -541,32 +541,32 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (_selectData.roleKey=='system' || _selectData.roleKey=='audit'){
|
|
|
- this.edit=true;
|
|
|
+ if (_selectData.roleKey == 'system' || _selectData.roleKey == 'audit') {
|
|
|
+ this.edit = true;
|
|
|
}
|
|
|
|
|
|
const roleId = _selectData.roleId
|
|
|
// const roleMenu = this.getRoleMenuTreeselect(roleId);
|
|
|
- var param = {
|
|
|
- roleId: roleId
|
|
|
- }
|
|
|
- this.$axios.get('/sysRoleController/getInfo',
|
|
|
- {params: param}).then((res2) => {
|
|
|
- this.form = res2.data;
|
|
|
- this.open = true;
|
|
|
- this.$axios.get('/sysMenuController/roleMenuTreeselect',
|
|
|
- {params: param}).then((res) => {
|
|
|
- this.menuOptions = res.data.menus;
|
|
|
- let checkedKeys = res.data.checkedKeys
|
|
|
- console.log(checkedKeys)
|
|
|
- checkedKeys.forEach((v) => {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.menu.setChecked(v, true, false);
|
|
|
- })
|
|
|
+ var param = {
|
|
|
+ roleId: roleId
|
|
|
+ }
|
|
|
+ this.$axios.get('/sysRoleController/getInfo',
|
|
|
+ {params: param}).then((res2) => {
|
|
|
+ this.form = res2.data;
|
|
|
+ this.open = true;
|
|
|
+ this.$axios.get('/sysMenuController/roleMenuTreeselect',
|
|
|
+ {params: param}).then((res) => {
|
|
|
+ this.menuOptions = res.data.menus;
|
|
|
+ let checkedKeys = res.data.checkedKeys
|
|
|
+ console.log(checkedKeys)
|
|
|
+ checkedKeys.forEach((v) => {
|
|
|
+ this.$nextTick(() => {
|
|
|
+ this.$refs.menu.setChecked(v, true, false);
|
|
|
})
|
|
|
})
|
|
|
})
|
|
|
- this.title = "修改角色";
|
|
|
+ })
|
|
|
+ this.title = "修改角色";
|
|
|
}, 1000),
|
|
|
/** 选择角色权限范围触发 */
|
|
|
dataScopeSelectChange(value) {
|
|
@@ -583,8 +583,8 @@ export default {
|
|
|
submitForm: debounce(function () {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.roleKey.trim()=='system' || this.form.roleKey.trim()=='audit'){
|
|
|
- if (this.form.builtIn!='0'){
|
|
|
+ if (this.form.roleKey.trim() == 'system' || this.form.roleKey.trim() == 'audit') {
|
|
|
+ if (this.form.builtIn != '0') {
|
|
|
// 不是内置用户则拦截
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
@@ -645,7 +645,7 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
/** 删除按钮操作 */
|
|
|
- handleDelete(){
|
|
|
+ handleDelete() {
|
|
|
const _selectData = this.$refs.xTable.getRadioRecord(true)
|
|
|
if (_selectData == null) {
|
|
|
this.$message({
|
|
@@ -655,7 +655,7 @@ export default {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
- if (_selectData.roleKey=='system' || _selectData.roleKey=='audit'){
|
|
|
+ if (_selectData.roleKey == 'system' || _selectData.roleKey == 'audit') {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
message: '内置角色不能删除!'
|
|
@@ -675,7 +675,7 @@ export default {
|
|
|
/**
|
|
|
* 删除提交
|
|
|
*/
|
|
|
- doDelete:debounce(function(_selectData){
|
|
|
+ doDelete: debounce(function (_selectData) {
|
|
|
const param = {
|
|
|
roleId: _selectData.roleId
|
|
|
}
|
|
@@ -699,7 +699,7 @@ export default {
|
|
|
});
|
|
|
this.loading = false
|
|
|
})
|
|
|
- },1000)
|
|
|
+ }, 1000)
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
@@ -710,6 +710,6 @@ export default {
|
|
|
margin-top: 5px;
|
|
|
border: 1px solid #e5e6e7;
|
|
|
background: #FFFFFF none;
|
|
|
- border-radius:4px;
|
|
|
+ border-radius: 4px;
|
|
|
}
|
|
|
</style>
|