Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
T
topology
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
姜立玮
topology
Commits
478fae0d
提交
478fae0d
authored
9月 19, 2020
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
菜单&数据权限新增(展开/折叠 全选/全不选 父子联动)
上级
0ecf27f8
变更
12
显示空白字符变更
内嵌
并排
正在显示
12 个修改的文件
包含
150 行增加
和
39 行删除
+150
-39
SysRole.java
...ain/java/com/ruoyi/common/core/domain/entity/SysRole.java
+26
-0
SysDeptMapper.java
.../src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
+2
-1
SysMenuMapper.java
.../src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
+3
-2
SysDeptServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
+7
-1
SysMenuServiceImpl.java
...ava/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
+7
-1
SysDeptMapper.xml
...system/src/main/resources/mapper/system/SysDeptMapper.xml
+5
-3
SysMenuMapper.xml
...system/src/main/resources/mapper/system/SysMenuMapper.xml
+5
-3
SysRoleMapper.xml
...system/src/main/resources/mapper/system/SysRoleMapper.xml
+21
-13
ruoyi.scss
ruoyi-ui/src/assets/styles/ruoyi.scss
+8
-0
index.vue
ruoyi-ui/src/views/system/role/index.vue
+49
-0
index.vue
ruoyi-ui/src/views/system/user/index.vue
+1
-1
ry_20200919.sql
sql/ry_20200919.sql
+16
-14
没有找到文件。
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java
浏览文件 @
478fae0d
...
@@ -37,6 +37,12 @@ public class SysRole extends BaseEntity
...
@@ -37,6 +37,12 @@ public class SysRole extends BaseEntity
@Excel
(
name
=
"数据范围"
,
readConverterExp
=
"1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限"
)
@Excel
(
name
=
"数据范围"
,
readConverterExp
=
"1=所有数据权限,2=自定义数据权限,3=本部门数据权限,4=本部门及以下数据权限"
)
private
String
dataScope
;
private
String
dataScope
;
/** 菜单树选择项是否关联显示(0:父子互相关联显示 1:父子不互相关联显示) */
private
boolean
menuCheckStrictly
;
/** 部门树选择项是否关联显示(0:父子互相关联显示 1:父子不互相关联显示) */
private
boolean
deptCheckStrictly
;
/** 角色状态(0正常 1停用) */
/** 角色状态(0正常 1停用) */
@Excel
(
name
=
"角色状态"
,
readConverterExp
=
"0=正常,1=停用"
)
@Excel
(
name
=
"角色状态"
,
readConverterExp
=
"0=正常,1=停用"
)
private
String
status
;
private
String
status
;
...
@@ -128,6 +134,26 @@ public class SysRole extends BaseEntity
...
@@ -128,6 +134,26 @@ public class SysRole extends BaseEntity
this
.
dataScope
=
dataScope
;
this
.
dataScope
=
dataScope
;
}
}
public
boolean
isMenuCheckStrictly
()
{
return
menuCheckStrictly
;
}
public
void
setMenuCheckStrictly
(
boolean
menuCheckStrictly
)
{
this
.
menuCheckStrictly
=
menuCheckStrictly
;
}
public
boolean
isDeptCheckStrictly
()
{
return
deptCheckStrictly
;
}
public
void
setDeptCheckStrictly
(
boolean
deptCheckStrictly
)
{
this
.
deptCheckStrictly
=
deptCheckStrictly
;
}
public
String
getStatus
()
public
String
getStatus
()
{
{
return
status
;
return
status
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
浏览文件 @
478fae0d
...
@@ -23,9 +23,10 @@ public interface SysDeptMapper
...
@@ -23,9 +23,10 @@ public interface SysDeptMapper
* 根据角色ID查询部门树信息
* 根据角色ID查询部门树信息
*
*
* @param roleId 角色ID
* @param roleId 角色ID
* @param deptCheckStrictly 部门树选择项是否关联显示
* @return 选中部门列表
* @return 选中部门列表
*/
*/
public
List
<
Integer
>
selectDeptListByRoleId
(
Long
roleId
);
public
List
<
Integer
>
selectDeptListByRoleId
(
@Param
(
"roleId"
)
Long
roleId
,
@Param
(
"deptCheckStrictly"
)
boolean
deptCheckStrictly
);
/**
/**
* 根据部门ID查询信息
* 根据部门ID查询信息
...
...
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysMenuMapper.java
浏览文件 @
478fae0d
...
@@ -61,9 +61,10 @@ public interface SysMenuMapper
...
@@ -61,9 +61,10 @@ public interface SysMenuMapper
* 根据角色ID查询菜单树信息
* 根据角色ID查询菜单树信息
*
*
* @param roleId 角色ID
* @param roleId 角色ID
* @param menuCheckStrictly 菜单树选择项是否关联显示
* @return 选中菜单列表
* @return 选中菜单列表
*/
*/
public
List
<
Integer
>
selectMenuListByRoleId
(
Long
roleId
);
public
List
<
Integer
>
selectMenuListByRoleId
(
@Param
(
"roleId"
)
Long
roleId
,
@Param
(
"menuCheckStrictly"
)
boolean
menuCheckStrictly
);
/**
/**
* 根据菜单ID查询信息
* 根据菜单ID查询信息
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysDeptServiceImpl.java
浏览文件 @
478fae0d
...
@@ -10,9 +10,11 @@ import com.ruoyi.common.annotation.DataScope;
...
@@ -10,9 +10,11 @@ import com.ruoyi.common.annotation.DataScope;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.domain.TreeSelect
;
import
com.ruoyi.common.core.domain.TreeSelect
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysRole
;
import
com.ruoyi.common.exception.CustomException
;
import
com.ruoyi.common.exception.CustomException
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.mapper.SysDeptMapper
;
import
com.ruoyi.system.mapper.SysDeptMapper
;
import
com.ruoyi.system.mapper.SysRoleMapper
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysDeptService
;
/**
/**
...
@@ -26,6 +28,9 @@ public class SysDeptServiceImpl implements ISysDeptService
...
@@ -26,6 +28,9 @@ public class SysDeptServiceImpl implements ISysDeptService
@Autowired
@Autowired
private
SysDeptMapper
deptMapper
;
private
SysDeptMapper
deptMapper
;
@Autowired
private
SysRoleMapper
roleMapper
;
/**
/**
* 查询部门管理数据
* 查询部门管理数据
*
*
...
@@ -93,7 +98,8 @@ public class SysDeptServiceImpl implements ISysDeptService
...
@@ -93,7 +98,8 @@ public class SysDeptServiceImpl implements ISysDeptService
@Override
@Override
public
List
<
Integer
>
selectDeptListByRoleId
(
Long
roleId
)
public
List
<
Integer
>
selectDeptListByRoleId
(
Long
roleId
)
{
{
return
deptMapper
.
selectDeptListByRoleId
(
roleId
);
SysRole
role
=
roleMapper
.
selectRoleById
(
roleId
);
return
deptMapper
.
selectDeptListByRoleId
(
roleId
,
role
.
isDeptCheckStrictly
());
}
}
/**
/**
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
浏览文件 @
478fae0d
...
@@ -13,12 +13,14 @@ import org.springframework.stereotype.Service;
...
@@ -13,12 +13,14 @@ import org.springframework.stereotype.Service;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.domain.TreeSelect
;
import
com.ruoyi.common.core.domain.TreeSelect
;
import
com.ruoyi.common.core.domain.entity.SysMenu
;
import
com.ruoyi.common.core.domain.entity.SysMenu
;
import
com.ruoyi.common.core.domain.entity.SysRole
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.vo.MetaVo
;
import
com.ruoyi.system.domain.vo.MetaVo
;
import
com.ruoyi.system.domain.vo.RouterVo
;
import
com.ruoyi.system.domain.vo.RouterVo
;
import
com.ruoyi.system.mapper.SysMenuMapper
;
import
com.ruoyi.system.mapper.SysMenuMapper
;
import
com.ruoyi.system.mapper.SysRoleMapper
;
import
com.ruoyi.system.mapper.SysRoleMenuMapper
;
import
com.ruoyi.system.mapper.SysRoleMenuMapper
;
import
com.ruoyi.system.service.ISysMenuService
;
import
com.ruoyi.system.service.ISysMenuService
;
...
@@ -35,6 +37,9 @@ public class SysMenuServiceImpl implements ISysMenuService
...
@@ -35,6 +37,9 @@ public class SysMenuServiceImpl implements ISysMenuService
@Autowired
@Autowired
private
SysMenuMapper
menuMapper
;
private
SysMenuMapper
menuMapper
;
@Autowired
private
SysRoleMapper
roleMapper
;
@Autowired
@Autowired
private
SysRoleMenuMapper
roleMenuMapper
;
private
SysRoleMenuMapper
roleMenuMapper
;
...
@@ -124,7 +129,8 @@ public class SysMenuServiceImpl implements ISysMenuService
...
@@ -124,7 +129,8 @@ public class SysMenuServiceImpl implements ISysMenuService
@Override
@Override
public
List
<
Integer
>
selectMenuListByRoleId
(
Long
roleId
)
public
List
<
Integer
>
selectMenuListByRoleId
(
Long
roleId
)
{
{
return
menuMapper
.
selectMenuListByRoleId
(
roleId
);
SysRole
role
=
roleMapper
.
selectRoleById
(
roleId
);
return
menuMapper
.
selectMenuListByRoleId
(
roleId
,
role
.
isMenuCheckStrictly
());
}
}
/**
/**
...
...
ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
浏览文件 @
478fae0d
...
@@ -44,12 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -44,12 +44,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
order by d.parent_id, d.order_num
order by d.parent_id, d.order_num
</select>
</select>
<select
id=
"selectDeptListByRoleId"
parameterType=
"Long"
resultType=
"Integer"
>
<select
id=
"selectDeptListByRoleId"
resultType=
"Integer"
>
select d.dept_id
, d.parent_id
select d.dept_id
from sys_dept d
from sys_dept d
left join sys_role_dept rd on d.dept_id = rd.dept_id
left join sys_role_dept rd on d.dept_id = rd.dept_id
where rd.role_id = #{roleId}
where rd.role_id = #{roleId}
<if
test=
"deptCheckStrictly"
>
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
and d.dept_id not in (select d.parent_id from sys_dept d inner join sys_role_dept rd on d.dept_id = rd.dept_id and rd.role_id = #{roleId})
</if>
order by d.parent_id, d.order_num
order by d.parent_id, d.order_num
</select>
</select>
...
...
ruoyi-system/src/main/resources/mapper/system/SysMenuMapper.xml
浏览文件 @
478fae0d
...
@@ -82,12 +82,14 @@
...
@@ -82,12 +82,14 @@
order by m.parent_id, m.order_num
order by m.parent_id, m.order_num
</select>
</select>
<select
id=
"selectMenuListByRoleId"
parameterType=
"Long"
resultType=
"Integer"
>
<select
id=
"selectMenuListByRoleId"
resultType=
"Integer"
>
select m.menu_id
, m.parent_id
select m.menu_id
from sys_menu m
from sys_menu m
left join sys_role_menu rm on m.menu_id = rm.menu_id
left join sys_role_menu rm on m.menu_id = rm.menu_id
where rm.role_id = #{roleId}
where rm.role_id = #{roleId}
<if
test=
"menuCheckStrictly"
>
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
and m.menu_id not in (select m.parent_id from sys_menu m inner join sys_role_menu rm on m.menu_id = rm.menu_id and rm.role_id = #{roleId})
</if>
order by m.parent_id, m.order_num
order by m.parent_id, m.order_num
</select>
</select>
...
...
ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
浏览文件 @
478fae0d
...
@@ -10,6 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -10,6 +10,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"roleKey"
column=
"role_key"
/>
<result
property=
"roleKey"
column=
"role_key"
/>
<result
property=
"roleSort"
column=
"role_sort"
/>
<result
property=
"roleSort"
column=
"role_sort"
/>
<result
property=
"dataScope"
column=
"data_scope"
/>
<result
property=
"dataScope"
column=
"data_scope"
/>
<result
property=
"menuCheckStrictly"
column=
"menu_check_strictly"
/>
<result
property=
"deptCheckStrictly"
column=
"dept_check_strictly"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"status"
column=
"status"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createBy"
column=
"create_by"
/>
<result
property=
"createBy"
column=
"create_by"
/>
...
@@ -20,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -20,7 +22,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
</resultMap>
<sql
id=
"selectRoleVo"
>
<sql
id=
"selectRoleVo"
>
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
select distinct r.role_id, r.role_name, r.role_key, r.role_sort, r.data_scope,
r.menu_check_strictly, r.dept_check_strictly,
r.status, r.del_flag, r.create_time, r.remark
r.status, r.del_flag, r.create_time, r.remark
from sys_role r
from sys_role r
left join sys_user_role ur on ur.role_id = r.role_id
left join sys_user_role ur on ur.role_id = r.role_id
...
@@ -95,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -95,6 +97,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"roleKey != null and roleKey != ''"
>
role_key,
</if>
<if
test=
"roleKey != null and roleKey != ''"
>
role_key,
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
role_sort,
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
role_sort,
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
data_scope,
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
data_scope,
</if>
<if
test=
"menuCheckStrictly != null and menuCheckStrictly != ''"
>
menu_check_strictly,
</if>
<if
test=
"deptCheckStrictly != null and deptCheckStrictly != ''"
>
dept_check_strictly,
</if>
<if
test=
"status != null and status != ''"
>
status,
</if>
<if
test=
"status != null and status != ''"
>
status,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
<if
test=
"remark != null and remark != ''"
>
remark,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
<if
test=
"createBy != null and createBy != ''"
>
create_by,
</if>
...
@@ -105,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -105,6 +109,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"roleKey != null and roleKey != ''"
>
#{roleKey},
</if>
<if
test=
"roleKey != null and roleKey != ''"
>
#{roleKey},
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
#{roleSort},
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
#{roleSort},
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
#{dataScope},
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
#{dataScope},
</if>
<if
test=
"menuCheckStrictly != null"
>
#{menu_check_strictly},
</if>
<if
test=
"deptCheckStrictly != null"
>
#{dept_check_strictly},
</if>
<if
test=
"status != null and status != ''"
>
#{status},
</if>
<if
test=
"status != null and status != ''"
>
#{status},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
<if
test=
"remark != null and remark != ''"
>
#{remark},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
<if
test=
"createBy != null and createBy != ''"
>
#{createBy},
</if>
...
@@ -119,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -119,6 +125,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"roleKey != null and roleKey != ''"
>
role_key = #{roleKey},
</if>
<if
test=
"roleKey != null and roleKey != ''"
>
role_key = #{roleKey},
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
role_sort = #{roleSort},
</if>
<if
test=
"roleSort != null and roleSort != ''"
>
role_sort = #{roleSort},
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
data_scope = #{dataScope},
</if>
<if
test=
"dataScope != null and dataScope != ''"
>
data_scope = #{dataScope},
</if>
<if
test=
"menuCheckStrictly != null"
>
menu_check_strictly = #{menuCheckStrictly},
</if>
<if
test=
"deptCheckStrictly != null"
>
dept_check_strictly = #{deptCheckStrictly},
</if>
<if
test=
"status != null and status != ''"
>
status = #{status},
</if>
<if
test=
"status != null and status != ''"
>
status = #{status},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
update_by = #{updateBy},
</if>
<if
test=
"updateBy != null and updateBy != ''"
>
update_by = #{updateBy},
</if>
...
...
ruoyi-ui/src/assets/styles/ruoyi.scss
浏览文件 @
478fae0d
...
@@ -92,6 +92,14 @@
...
@@ -92,6 +92,14 @@
padding
:
10px
20px
!
important
;
padding
:
10px
20px
!
important
;
}
}
/* tree border */
.tree-border
{
margin-top
:
5px
;
border
:
1px
solid
#e5e6e7
;
background
:
#FFFFFF
none
;
border-radius
:
4px
;
}
.pagination-container
.el-pagination
{
.pagination-container
.el-pagination
{
right
:
0
;
right
:
0
;
position
:
absolute
;
position
:
absolute
;
...
...
ruoyi-ui/src/views/system/role/index.vue
浏览文件 @
478fae0d
...
@@ -175,11 +175,16 @@
...
@@ -175,11 +175,16 @@
</el-radio-group>
</el-radio-group>
</el-form-item>
</el-form-item>
<el-form-item
label=
"菜单权限"
>
<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"
@
change=
"handleCheckedTreeConnect($event, 'menu')"
>
父子联动
</el-checkbox>
<el-tree
<el-tree
class=
"tree-border"
:data=
"menuOptions"
:data=
"menuOptions"
show-checkbox
show-checkbox
ref=
"menu"
ref=
"menu"
node-key=
"id"
node-key=
"id"
:check-strictly=
"!form.menuCheckStrictly"
empty-text=
"加载中,请稍后"
empty-text=
"加载中,请稍后"
:props=
"defaultProps"
:props=
"defaultProps"
></el-tree>
></el-tree>
...
@@ -214,12 +219,17 @@
...
@@ -214,12 +219,17 @@
</el-select>
</el-select>
</el-form-item>
</el-form-item>
<el-form-item
label=
"数据权限"
v-show=
"form.dataScope == 2"
>
<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"
@
change=
"handleCheckedTreeConnect($event, 'dept')"
>
父子联动
</el-checkbox>
<el-tree
<el-tree
class=
"tree-border"
:data=
"deptOptions"
:data=
"deptOptions"
show-checkbox
show-checkbox
default-expand-all
default-expand-all
ref=
"dept"
ref=
"dept"
node-key=
"id"
node-key=
"id"
:check-strictly=
"!form.deptCheckStrictly"
empty-text=
"加载中,请稍后"
empty-text=
"加载中,请稍后"
:props=
"defaultProps"
:props=
"defaultProps"
></el-tree>
></el-tree>
...
@@ -262,6 +272,10 @@ export default {
...
@@ -262,6 +272,10 @@ export default {
open
:
false
,
open
:
false
,
// 是否显示弹出层(数据权限)
// 是否显示弹出层(数据权限)
openDataScope
:
false
,
openDataScope
:
false
,
menuExpand
:
false
,
menuNodeAll
:
false
,
deptExpand
:
true
,
deptNodeAll
:
false
,
// 日期范围
// 日期范围
dateRange
:
[],
dateRange
:
[],
// 状态数据字典
// 状态数据字典
...
@@ -413,6 +427,10 @@ export default {
...
@@ -413,6 +427,10 @@ export default {
if
(
this
.
$refs
.
menu
!=
undefined
)
{
if
(
this
.
$refs
.
menu
!=
undefined
)
{
this
.
$refs
.
menu
.
setCheckedKeys
([]);
this
.
$refs
.
menu
.
setCheckedKeys
([]);
}
}
this
.
menuExpand
=
false
,
this
.
menuNodeAll
=
false
,
this
.
deptExpand
=
true
,
this
.
deptNodeAll
=
false
,
this
.
form
=
{
this
.
form
=
{
roleId
:
undefined
,
roleId
:
undefined
,
roleName
:
undefined
,
roleName
:
undefined
,
...
@@ -421,6 +439,7 @@ export default {
...
@@ -421,6 +439,7 @@ export default {
status
:
"0"
,
status
:
"0"
,
menuIds
:
[],
menuIds
:
[],
deptIds
:
[],
deptIds
:
[],
menuCheckStrictly
:
true
,
remark
:
undefined
remark
:
undefined
};
};
this
.
resetForm
(
"form"
);
this
.
resetForm
(
"form"
);
...
@@ -442,6 +461,36 @@ export default {
...
@@ -442,6 +461,36 @@ export default {
this
.
single
=
selection
.
length
!=
1
this
.
single
=
selection
.
length
!=
1
this
.
multiple
=
!
selection
.
length
this
.
multiple
=
!
selection
.
length
},
},
// 树权限(展开/折叠)
handleCheckedTreeExpand
(
value
,
type
)
{
if
(
type
==
'menu'
)
{
let
treeList
=
this
.
menuOptions
;
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
menu
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
;
}
}
else
if
(
type
==
'dept'
)
{
let
treeList
=
this
.
deptOptions
;
for
(
let
i
=
0
;
i
<
treeList
.
length
;
i
++
)
{
this
.
$refs
.
dept
.
store
.
nodesMap
[
treeList
[
i
].
id
].
expanded
=
value
;
}
}
},
// 树权限(全选/全不选)
handleCheckedTreeNodeAll
(
value
,
type
)
{
if
(
type
==
'menu'
)
{
this
.
$refs
.
menu
.
setCheckedNodes
(
value
?
this
.
menuOptions
:
[]);
}
else
if
(
type
==
'dept'
)
{
this
.
$refs
.
dept
.
setCheckedNodes
(
value
?
this
.
deptOptions
:
[]);
}
},
// 树权限(父子联动)
handleCheckedTreeConnect
(
value
,
type
)
{
if
(
type
==
'menu'
)
{
this
.
form
.
menuCheckStrictly
=
value
?
true
:
false
;
}
else
if
(
type
==
'dept'
)
{
this
.
form
.
deptCheckStrictly
=
value
?
true
:
false
;
}
},
/** 新增按钮操作 */
/** 新增按钮操作 */
handleAdd
()
{
handleAdd
()
{
this
.
reset
();
this
.
reset
();
...
...
ruoyi-ui/src/views/system/user/index.vue
浏览文件 @
478fae0d
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
</el-col>
</el-col>
<el-col
:span=
"12"
>
<el-col
:span=
"12"
>
<el-form-item
label=
"归属部门"
prop=
"deptId"
>
<el-form-item
label=
"归属部门"
prop=
"deptId"
>
<treeselect
v-model=
"form.deptId"
:options=
"deptOptions"
:
disable-branch-nodes=
"true"
:
show-count=
"true"
placeholder=
"请选择归属部门"
/>
<treeselect
v-model=
"form.deptId"
:options=
"deptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
</el-form-item>
</el-form-item>
</el-col>
</el-col>
</el-row>
</el-row>
...
...
sql/ry_202009
01
.sql
→
sql/ry_202009
19
.sql
浏览文件 @
478fae0d
...
@@ -107,6 +107,8 @@ create table sys_role (
...
@@ -107,6 +107,8 @@ create table sys_role (
role_key
varchar
(
100
)
not
null
comment
'角色权限字符串'
,
role_key
varchar
(
100
)
not
null
comment
'角色权限字符串'
,
role_sort
int
(
4
)
not
null
comment
'显示顺序'
,
role_sort
int
(
4
)
not
null
comment
'显示顺序'
,
data_scope
char
(
1
)
default
'1'
comment
'数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'
,
data_scope
char
(
1
)
default
'1'
comment
'数据范围(1:全部数据权限 2:自定数据权限 3:本部门数据权限 4:本部门及以下数据权限)'
,
menu_check_strictly
tinyint
(
1
)
default
1
comment
'菜单树选择项是否关联显示'
,
dept_check_strictly
tinyint
(
1
)
default
1
comment
'部门树选择项是否关联显示'
,
status
char
(
1
)
not
null
comment
'角色状态(0正常 1停用)'
,
status
char
(
1
)
not
null
comment
'角色状态(0正常 1停用)'
,
del_flag
char
(
1
)
default
'0'
comment
'删除标志(0代表存在 2代表删除)'
,
del_flag
char
(
1
)
default
'0'
comment
'删除标志(0代表存在 2代表删除)'
,
create_by
varchar
(
64
)
default
''
comment
'创建者'
,
create_by
varchar
(
64
)
default
''
comment
'创建者'
,
...
@@ -120,8 +122,8 @@ create table sys_role (
...
@@ -120,8 +122,8 @@ create table sys_role (
-- ----------------------------
-- ----------------------------
-- 初始化-角色信息表数据
-- 初始化-角色信息表数据
-- ----------------------------
-- ----------------------------
insert
into
sys_role
values
(
'1'
,
'超级管理员'
,
'admin'
,
1
,
1
,
'0'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'超级管理员'
);
insert
into
sys_role
values
(
'1'
,
'超级管理员'
,
'admin'
,
1
,
1
,
1
,
1
,
'0'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'超级管理员'
);
insert
into
sys_role
values
(
'2'
,
'普通角色'
,
'common'
,
2
,
2
,
'0'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'普通角色'
);
insert
into
sys_role
values
(
'2'
,
'普通角色'
,
'common'
,
2
,
2
,
1
,
1
,
'0'
,
'0'
,
'admin'
,
'2018-03-16 11-33-00'
,
'ry'
,
'2018-03-16 11-33-00'
,
'普通角色'
);
-- ----------------------------
-- ----------------------------
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论