Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
C
cocktail-party-server
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
cocktail-party
cocktail-party-server
Commits
d487ffc9
提交
d487ffc9
authored
12月 11, 2024
作者:
RuoYi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
用户管理过滤掉已禁用部门(IB5H7F)
上级
5a1e7bae
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
33 行增加
和
2 行删除
+33
-2
TreeSelect.java
...rc/main/java/com/ruoyi/common/core/domain/TreeSelect.java
+16
-0
index.vue
ruoyi-ui/src/views/system/user/index.vue
+17
-2
没有找到文件。
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/TreeSelect.java
浏览文件 @
d487ffc9
...
...
@@ -4,8 +4,10 @@ import java.io.Serializable;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.fasterxml.jackson.annotation.JsonInclude
;
import
com.ruoyi.common.constant.UserConstants
;
import
com.ruoyi.common.core.domain.entity.SysDept
;
import
com.ruoyi.common.core.domain.entity.SysMenu
;
import
com.ruoyi.common.utils.StringUtils
;
/**
* Treeselect树结构实体类
...
...
@@ -22,6 +24,9 @@ public class TreeSelect implements Serializable
/** 节点名称 */
private
String
label
;
/** 节点禁用 */
private
boolean
disabled
=
false
;
/** 子节点 */
@JsonInclude
(
JsonInclude
.
Include
.
NON_EMPTY
)
private
List
<
TreeSelect
>
children
;
...
...
@@ -35,6 +40,7 @@ public class TreeSelect implements Serializable
{
this
.
id
=
dept
.
getDeptId
();
this
.
label
=
dept
.
getDeptName
();
this
.
disabled
=
StringUtils
.
equals
(
UserConstants
.
DEPT_DISABLE
,
dept
.
getStatus
());
this
.
children
=
dept
.
getChildren
().
stream
().
map
(
TreeSelect:
:
new
).
collect
(
Collectors
.
toList
());
}
...
...
@@ -65,6 +71,16 @@ public class TreeSelect implements Serializable
this
.
label
=
label
;
}
public
boolean
isDisabled
()
{
return
disabled
;
}
public
void
setDisabled
(
boolean
disabled
)
{
this
.
disabled
=
disabled
;
}
public
List
<
TreeSelect
>
getChildren
()
{
return
children
;
...
...
ruoyi-ui/src/views/system/user/index.vue
浏览文件 @
d487ffc9
...
...
@@ -105,7 +105,7 @@
</el-col>
<el-col
:span=
"12"
>
<el-form-item
label=
"归属部门"
prop=
"deptId"
>
<treeselect
v-model=
"form.deptId"
:options=
"
d
eptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
<treeselect
v-model=
"form.deptId"
:options=
"
enabledD
eptOptions"
:show-count=
"true"
placeholder=
"请选择归属部门"
/>
</el-form-item>
</el-col>
</el-row>
...
...
@@ -230,8 +230,10 @@ export default {
userList
:
null
,
// 弹出层标题
title
:
""
,
// 部门树选项
//
所有
部门树选项
deptOptions
:
undefined
,
// 过滤掉已禁用部门树选项
enabledDeptOptions
:
undefined
,
// 是否显示弹出层
open
:
false
,
// 部门名称
...
...
@@ -343,6 +345,19 @@ export default {
getDeptTree
()
{
deptTreeSelect
().
then
(
response
=>
{
this
.
deptOptions
=
response
.
data
;
this
.
enabledDeptOptions
=
this
.
filterDisabledDept
(
JSON
.
parse
(
JSON
.
stringify
(
response
.
data
)));
});
},
// 过滤禁用的部门
filterDisabledDept
(
deptList
)
{
return
deptList
.
filter
(
dept
=>
{
if
(
dept
.
disabled
)
{
return
false
;
}
if
(
dept
.
children
&&
dept
.
children
.
length
)
{
dept
.
children
=
this
.
filterDisabledDept
(
dept
.
children
);
}
return
true
;
});
},
// 筛选节点
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论