update 修改角色适配 采用 get set 转换数据类型

2.X
疯狂的狮子Li 3 years ago
parent f644709a99
commit 73eb9cc7d7

@ -137,4 +137,33 @@ public class SysRole extends BaseEntity {
return UserConstants.ADMIN_ID.equals(this.roleId);
}
public Boolean getMenuCheckStrictly() {
if (menuCheckStrictly == null) {
return null;
}
return menuCheckStrictly == 1;
}
public void setMenuCheckStrictly(Boolean menuCheckStrictly) {
if (menuCheckStrictly == null) {
this.menuCheckStrictly = null;
return;
}
this.menuCheckStrictly = menuCheckStrictly ? 1 : 0;
}
public Boolean getDeptCheckStrictly() {
if (deptCheckStrictly == null) {
return null;
}
return deptCheckStrictly == 1;
}
public void setDeptCheckStrictly(Boolean deptCheckStrictly) {
if (deptCheckStrictly == null) {
this.deptCheckStrictly = null;
return;
}
this.deptCheckStrictly = deptCheckStrictly ? 1 : 0;
}
}

@ -84,7 +84,7 @@ public class SysDeptServiceImpl implements ISysDeptService {
@Override
public List<Long> selectDeptListByRoleId(Long roleId) {
SysRole role = roleMapper.selectById(roleId);
return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly() == 1);
return baseMapper.selectDeptListByRoleId(roleId, role.getDeptCheckStrictly());
}
/**

@ -123,7 +123,7 @@ public class SysMenuServiceImpl implements ISysMenuService {
@Override
public List<Long> selectMenuListByRoleId(Long roleId) {
SysRole role = roleMapper.selectById(roleId);
return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly() == 1);
return baseMapper.selectMenuListByRoleId(roleId, role.getMenuCheckStrictly());
}
/**

@ -187,14 +187,14 @@
<el-form-item label="菜单权限">
<el-checkbox v-model="menuExpand" @change="handleCheckedTreeExpand($event, 'menu')">/</el-checkbox>
<el-checkbox v-model="menuNodeAll" @change="handleCheckedTreeNodeAll($event, 'menu')">/</el-checkbox>
<el-checkbox v-model="form.menuCheckStrictly == 1" @change="handleCheckedTreeConnect($event, 'menu')"></el-checkbox>
<el-checkbox v-model="form.menuCheckStrictly" @change="handleCheckedTreeConnect($event, 'menu')"></el-checkbox>
<el-tree
class="tree-border"
:data="menuOptions"
show-checkbox
ref="menu"
node-key="id"
:check-strictly="!form.menuCheckStrictly == 1"
:check-strictly="!form.menuCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
@ -231,7 +231,7 @@
<el-form-item label="数据权限" v-show="form.dataScope == 2">
<el-checkbox v-model="deptExpand" @change="handleCheckedTreeExpand($event, 'dept')">/</el-checkbox>
<el-checkbox v-model="deptNodeAll" @change="handleCheckedTreeNodeAll($event, 'dept')">/</el-checkbox>
<el-checkbox v-model="form.deptCheckStrictly == 1" @change="handleCheckedTreeConnect($event, 'dept')"></el-checkbox>
<el-checkbox v-model="form.deptCheckStrictly" @change="handleCheckedTreeConnect($event, 'dept')"></el-checkbox>
<el-tree
class="tree-border"
:data="deptOptions"
@ -239,7 +239,7 @@
default-expand-all
ref="dept"
node-key="id"
:check-strictly="!form.deptCheckStrictly == 1"
:check-strictly="!form.deptCheckStrictly"
empty-text="加载中,请稍候"
:props="defaultProps"
></el-tree>
@ -440,8 +440,8 @@ export default {
status: "0",
menuIds: [],
deptIds: [],
menuCheckStrictly: 1,
deptCheckStrictly: 1,
menuCheckStrictly: true,
deptCheckStrictly: true,
remark: undefined
};
this.resetForm("form");
@ -501,9 +501,9 @@ export default {
//
handleCheckedTreeConnect(value, type) {
if (type == 'menu') {
this.form.menuCheckStrictly = value ? 1: 0;
this.form.menuCheckStrictly = value ? true: false;
} else if (type == 'dept') {
this.form.deptCheckStrictly = value ? 1: 0;
this.form.deptCheckStrictly = value ? true: false;
}
},
/** 新增按钮操作 */

Loading…
Cancel
Save