Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jeecg-boot
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chenjunxiong
jeecg-boot
Commits
1e2a74a6
Commit
1e2a74a6
authored
Dec 06, 2021
by
zhangdaiscott
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户数据量较大时,功能测试报错(通过部门选择用户,左侧部门数据改成异步加载) issues/3196
parent
6c362861
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
8 deletions
+27
-8
ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
+27
-8
No files found.
ant-design-vue-jeecg/src/components/jeecgbiz/modal/JSelectUserByDepModal.vue
View file @
1e2a74a6
...
...
@@ -21,8 +21,8 @@
:dropdownStyle=
"
{maxHeight:'200px',overflow:'auto'}"
:treeData="departTree"
:expandAction="false"
:expandedKeys.sync="expandedKeys"
@select="onDepSelect"
:load-data="onLoadDepartment"
/>
</a-card>
</a-col>
...
...
@@ -57,7 +57,7 @@
<
script
>
import
{
pushIfNotExist
,
filterObj
}
from
'@/utils/util'
import
{
queryDepartTreeList
,
getUserList
,
queryUserByDepId
}
from
'@/api/api'
import
{
queryDepartTreeList
,
getUserList
,
queryUserByDepId
,
queryDepartTreeSync
}
from
'@/api/api'
import
{
getAction
}
from
'@/api/manage'
export
default
{
...
...
@@ -297,14 +297,34 @@
})
},
queryDepartTree
()
{
queryDepartTreeList
().
then
((
res
)
=>
{
//update-begin-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
this
.
expandedKeys
=
[]
queryDepartTreeSync
().
then
((
res
)
=>
{
if
(
res
.
success
)
{
this
.
departTree
=
res
.
result
;
// 默认展开父节点
this
.
expandedKeys
=
this
.
departTree
.
map
(
item
=>
item
.
id
)
for
(
let
i
=
0
;
i
<
res
.
result
.
length
;
i
++
)
{
let
temp
=
res
.
result
[
i
]
this
.
departTree
.
push
(
temp
)
}
}
})
},
onLoadDepartment
(
treeNode
){
return
new
Promise
(
resolve
=>
{
queryDepartTreeSync
({
pid
:
treeNode
.
dataRef
.
id
}).
then
((
res
)
=>
{
if
(
res
.
success
)
{
//判断chidlren是否为空,并修改isLeaf属性值
if
(
res
.
result
.
length
==
0
){
treeNode
.
dataRef
[
'isLeaf'
]
=
true
return
;
}
else
{
treeNode
.
dataRef
[
'children'
]
=
res
.
result
;
}
}
})
resolve
();
});
},
//update-end-author:taoyan date:20211202 for: 异步加载部门树 https://github.com/jeecgboot/jeecg-boot/issues/3196
modalFormOk
()
{
this
.
loadData
();
}
...
...
@@ -325,4 +345,4 @@
cursor
:
pointer
;
transition
:
color
.3s
;
}
</
style
>
\ No newline at end of file
</
style
>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment