Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
D
dataease
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
zhu
dataease
Commits
1ffbe36c
提交
1ffbe36c
authored
5月 31, 2021
作者:
fit2cloud-chenyw
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: 整合xpack'组织管理'
上级
dccfd6ec
隐藏空白字符变更
内嵌
并排
正在显示
6 个修改的文件
包含
112 行增加
和
22 行删除
+112
-22
DeptServer.java
.../src/main/java/io/dataease/plugins/server/DeptServer.java
+80
-0
main.js
frontend/src/main.js
+12
-0
form.vue
frontend/src/views/system/dept/form.vue
+3
-6
index.vue
frontend/src/views/system/dept/index.vue
+3
-6
form.vue
frontend/src/views/system/user/form.vue
+10
-6
index.vue
frontend/src/views/system/user/index.vue
+4
-4
没有找到文件。
backend/src/main/java/io/dataease/plugins/server/DeptServer.java
0 → 100644
浏览文件 @
1ffbe36c
package
io
.
dataease
.
plugins
.
server
;
import
io.dataease.commons.utils.BeanUtils
;
import
io.dataease.controller.sys.response.DeptNodeResponse
;
import
io.dataease.plugins.common.entity.XpackGridRequest
;
import
io.dataease.plugins.config.SpringContextUtil
;
import
io.dataease.plugins.xpack.dept.dto.request.XpackCreateDept
;
import
io.dataease.plugins.xpack.dept.dto.request.XpackDeleteDept
;
import
io.dataease.plugins.xpack.dept.dto.response.XpackDeptTreeNode
;
import
io.dataease.plugins.xpack.dept.dto.response.XpackSysDept
;
import
io.dataease.plugins.xpack.dept.service.DeptXpackService
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@RequestMapping
(
"/plugin/dept"
)
@RestController
public
class
DeptServer
{
@PostMapping
(
"/childNodes/{pid}"
)
public
List
<
DeptNodeResponse
>
childNodes
(
@PathVariable
(
"pid"
)
Long
pid
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
List
<
XpackSysDept
>
nodes
=
deptService
.
nodesByPid
(
pid
);
List
<
DeptNodeResponse
>
nodeResponses
=
nodes
.
stream
().
map
(
node
->
{
DeptNodeResponse
deptNodeResponse
=
BeanUtils
.
copyBean
(
new
DeptNodeResponse
(),
node
);
deptNodeResponse
.
setHasChildren
(
node
.
getSubCount
()
>
0
);
deptNodeResponse
.
setLeaf
(
node
.
getSubCount
()
==
0
);
deptNodeResponse
.
setTop
(
node
.
getPid
()
==
0L
);
return
deptNodeResponse
;
}).
collect
(
Collectors
.
toList
());
return
nodeResponses
;
}
@PostMapping
(
"/search"
)
public
List
<
DeptNodeResponse
>
search
(
@RequestBody
XpackGridRequest
request
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
List
<
XpackSysDept
>
ndoes
=
deptService
.
nodesTreeByCondition
(
request
);
List
<
DeptNodeResponse
>
nodeResponses
=
ndoes
.
stream
().
map
(
node
->
{
DeptNodeResponse
deptNodeResponse
=
BeanUtils
.
copyBean
(
new
DeptNodeResponse
(),
node
);
deptNodeResponse
.
setHasChildren
(
node
.
getSubCount
()
>
0
);
deptNodeResponse
.
setLeaf
(
node
.
getSubCount
()
==
0
);
deptNodeResponse
.
setTop
(
node
.
getPid
()
==
0L
);
return
deptNodeResponse
;
}).
collect
(
Collectors
.
toList
());
return
nodeResponses
;
}
@PostMapping
(
"/root"
)
public
List
<
XpackSysDept
>
rootData
(){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
List
<
XpackSysDept
>
nodes
=
deptService
.
nodesByPid
(
null
);
return
nodes
;
}
@PostMapping
(
"/create"
)
public
void
create
(
@RequestBody
XpackCreateDept
dept
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
deptService
.
add
(
dept
);
}
@PostMapping
(
"/delete"
)
public
void
delete
(
@RequestBody
List
<
XpackDeleteDept
>
requests
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
deptService
.
batchDelete
(
requests
);
}
@PostMapping
(
"/update"
)
public
void
update
(
@RequestBody
XpackCreateDept
dept
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
deptService
.
update
(
dept
);
}
@PostMapping
(
"/nodesByDeptId/{deptId}"
)
public
List
<
XpackDeptTreeNode
>
nodesByDeptId
(
@PathVariable
(
"deptId"
)
Long
deptId
){
DeptXpackService
deptService
=
SpringContextUtil
.
getBean
(
DeptXpackService
.
class
);
return
deptService
.
searchTree
(
deptId
);
}
}
frontend/src/main.js
浏览文件 @
1ffbe36c
...
...
@@ -17,6 +17,8 @@ import filter from '@/filter/filter'
import
directives
from
'./directive'
import
VueClipboard
from
'vue-clipboard2'
import
widgets
from
'@/components/widget'
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
import
'./utils/dialog'
import
'@/components/canvas/custom-component'
// 注册自定义组件
...
...
@@ -62,6 +64,7 @@ Vue.use(VueAxios, axios)
Vue
.
use
(
filter
)
Vue
.
use
(
directives
)
Vue
.
use
(
message
)
Vue
.
component
(
'Treeselect'
,
Treeselect
)
Vue
.
config
.
productionTip
=
false
Vue
.
prototype
.
hasDataPermission
=
function
(
pTarget
,
pSource
)
{
...
...
@@ -70,6 +73,15 @@ Vue.prototype.hasDataPermission = function(pTarget, pSource) {
}
return
false
}
Vue
.
prototype
.
checkPermission
=
function
(
pers
)
{
const
permissions
=
store
.
getters
.
permissions
const
hasPermission
=
pers
.
every
(
needP
=>
{
const
result
=
permissions
.
includes
(
needP
)
return
result
})
return
hasPermission
}
new
Vue
({
router
,
...
...
frontend/src/views/system/dept/form.vue
浏览文件 @
1ffbe36c
...
...
@@ -41,13 +41,10 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
LOAD_CHILDREN_OPTIONS
,
LOAD_ROOT_OPTIONS
}
from
'@riophae/vue-treeselect'
import
{
getDeptTree
,
treeByDeptId
,
addDept
,
editDept
}
from
'@/api/system/dept'
export
default
{
components
:
{
LayoutContent
,
Treeselect
},
components
:
{
LayoutContent
},
data
()
{
return
{
defaultForm
:
{
deptId
:
null
,
top
:
true
,
pid
:
null
},
...
...
@@ -100,7 +97,7 @@ export default {
},
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
LOAD_ROOT_OPTIONS
&&
!
this
.
form
.
pid
)
{
if
(
action
===
'LOAD_ROOT_OPTIONS'
&&
!
this
.
form
.
pid
)
{
const
_self
=
this
treeByDeptId
(
0
).
then
(
res
=>
{
const
results
=
res
.
data
.
map
(
node
=>
{
...
...
@@ -114,7 +111,7 @@ export default {
})
}
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
'LOAD_CHILDREN_OPTIONS'
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
...
...
frontend/src/views/system/dept/index.vue
浏览文件 @
1ffbe36c
...
...
@@ -92,10 +92,8 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
TreeTable
from
'@/components/business/tree-table'
import
Treeselect
from
'@riophae/vue-treeselect'
import
{
formatCondition
,
formatQuickCondition
}
from
'@/utils/index'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
LOAD_CHILDREN_OPTIONS
,
LOAD_ROOT_OPTIONS
}
from
'@riophae/vue-treeselect'
import
{
checkPermission
}
from
'@/utils/permission'
import
{
getDeptTree
,
addDept
,
editDept
,
delDept
,
loadTable
}
from
'@/api/system/dept'
...
...
@@ -103,8 +101,7 @@ export default {
name
:
'MsOrganization'
,
components
:
{
LayoutContent
,
TreeTable
,
Treeselect
TreeTable
},
data
()
{
return
{
...
...
@@ -361,7 +358,7 @@ export default {
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
LOAD_ROOT_OPTIONS
)
{
if
(
action
===
'LOAD_ROOT_OPTIONS'
)
{
const
_self
=
this
!
this
.
depts
&&
getDeptTree
(
'0'
).
then
(
res
=>
{
_self
.
depts
=
res
.
data
.
map
(
node
=>
_self
.
normalizer
(
node
))
...
...
@@ -369,7 +366,7 @@ export default {
})
}
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
'LOAD_CHILDREN_OPTIONS'
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
...
...
frontend/src/views/system/user/form.vue
浏览文件 @
1ffbe36c
...
...
@@ -71,16 +71,17 @@
<
script
>
import
LayoutContent
from
'@/components/business/LayoutContent'
import
Treeselect
from
'@riophae/vue-treeselect'
import
'@riophae/vue-treeselect/dist/vue-treeselect.css'
//
import Treeselect from '@riophae/vue-treeselect'
//
import '@riophae/vue-treeselect/dist/vue-treeselect.css'
import
{
PHONE_REGEX
}
from
'@/utils/validate'
import
{
LOAD_CHILDREN_OPTIONS
,
LOAD_ROOT_OPTIONS
}
from
'@riophae/vue-treeselect'
//
import { LOAD_CHILDREN_OPTIONS, LOAD_ROOT_OPTIONS } from '@riophae/vue-treeselect'
import
{
getDeptTree
,
treeByDeptId
}
from
'@/api/system/dept'
import
{
allRoles
}
from
'@/api/system/role'
import
{
addUser
,
editUser
}
from
'@/api/system/user'
export
default
{
components
:
{
LayoutContent
,
Treeselect
},
// components: { LayoutContent, Treeselect },
components
:
{
LayoutContent
},
data
()
{
return
{
form
:
{
...
...
@@ -211,7 +212,7 @@ export default {
},
// 获取弹窗内部门数据
loadDepts
({
action
,
parentNode
,
callback
})
{
if
(
action
===
LOAD_ROOT_OPTIONS
&&
!
this
.
form
.
deptId
)
{
if
(
action
===
'LOAD_ROOT_OPTIONS'
&&
!
this
.
form
.
deptId
)
{
const
_self
=
this
treeByDeptId
(
0
).
then
(
res
=>
{
const
results
=
res
.
data
.
map
(
node
=>
{
...
...
@@ -225,7 +226,7 @@ export default {
})
}
if
(
action
===
LOAD_CHILDREN_OPTIONS
)
{
if
(
action
===
'LOAD_CHILDREN_OPTIONS'
)
{
const
_self
=
this
getDeptTree
(
parentNode
.
id
).
then
(
res
=>
{
parentNode
.
children
=
res
.
data
.
map
(
function
(
obj
)
{
...
...
@@ -279,6 +280,9 @@ export default {
this
.
$router
.
push
({
name
:
'system-user'
})
},
filterData
(
instanceId
)
{
if
(
!
this
.
depts
)
{
return
}
const
results
=
this
.
depts
.
map
(
node
=>
{
if
(
node
.
hasChildren
)
{
node
.
children
=
null
...
...
frontend/src/views/system/user/index.vue
浏览文件 @
1ffbe36c
...
...
@@ -162,7 +162,7 @@
import
LayoutContent
from
'@/components/business/LayoutContent'
import
ComplexTable
from
'@/components/business/complex-table'
import
{
checkPermission
}
from
'@/utils/permission'
//
import { checkPermission } from '@/utils/permission'
import
{
formatCondition
,
formatQuickCondition
}
from
'@/utils/index'
import
{
PHONE_REGEX
}
from
'@/utils/validate'
import
{
LOAD_CHILDREN_OPTIONS
,
LOAD_ROOT_OPTIONS
}
from
'@riophae/vue-treeselect'
...
...
@@ -183,13 +183,13 @@ export default {
buttons
:
[
{
label
:
this
.
$t
(
'commons.edit'
),
icon
:
'el-icon-edit'
,
type
:
'primary'
,
click
:
this
.
edit
,
show
:
checkPermission
([
'user:edit'
])
show
:
this
.
checkPermission
([
'user:edit'
])
},
{
label
:
this
.
$t
(
'commons.delete'
),
icon
:
'el-icon-delete'
,
type
:
'danger'
,
click
:
this
.
del
,
show
:
checkPermission
([
'user:del'
])
show
:
this
.
checkPermission
([
'user:del'
])
},
{
label
:
this
.
$t
(
'member.edit_password'
),
icon
:
'el-icon-s-tools'
,
type
:
'success'
,
click
:
this
.
editPassword
,
show
:
checkPermission
([
'user:editPwd'
])
show
:
this
.
checkPermission
([
'user:editPwd'
])
}
],
searchConfig
:
{
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论