Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
X
xiaomai-cloud-class-web
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
xiaomai-cloud-class
xiaomai-cloud-class-web
Commits
14445fa0
Commit
14445fa0
authored
Aug 06, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理刷新列表
parent
024f23bc
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
31 deletions
+62
-31
src/modules/college-manage/EmployeeManage.tsx
+3
-3
src/modules/college-manage/components/DepartMentTabCon.jsx
+2
-2
src/modules/college-manage/components/LeftStructureTree.jsx
+55
-24
src/modules/college-manage/modal/AddOrEditPostGroupModal.jsx
+2
-2
No files found.
src/modules/college-manage/EmployeeManage.tsx
View file @
14445fa0
...
...
@@ -185,7 +185,7 @@ function EmployeeManage() {
// return <span><WWOpenDataCom type="departmentName" openid={item}/>{index<(record.depNameList.length -1)?';':''}</span>;
// })
return
<
Tooltip
title=
{
<
div
>
{
handleDepName
(
record
.
depNameList
)
}
</
div
>
}
placement=
'top'
arrowPointAtCenter
><
div
className=
"post-name"
>
{
record
.
depNameList
.
map
((
item
,
index
)
=>
{
return
<
span
><
WWOpenDataCom
type=
"departmentName"
openid=
{
item
}
/>
{
index
<
(
record
.
depNameList
.
length
-
1
)?
'
;
'
:
''
}
</
span
>
return
<
span
><
WWOpenDataCom
type=
"departmentName"
openid=
{
item
}
/>
{
index
<
(
record
.
depNameList
.
length
-
1
)?
'
;
'
:
''
}
</
span
>
})
}
</
div
>
</
Tooltip
>
...
...
@@ -242,7 +242,7 @@ function EmployeeManage() {
function
handleDepName
(
depArray
:
any
):
any
{
const
depArrayDom
=
depArray
.
map
((
item
:
any
,
index
:
any
)
=>
{
return
<
WWOpenDataCom
type=
"departmentName"
openid=
{
item
}
/
>
return
<
span
><
WWOpenDataCom
type=
"departmentName"
openid=
{
item
}
/>
;
</
span
>
});
return
depArrayDom
;
};
...
...
@@ -352,10 +352,10 @@ function EmployeeManage() {
userType
:
'USER'
}
StoreService
.
syncWorkWeChatDepartment
(
params
).
then
((
res
)
=>
{
getEmployeeList
();
message
.
success
(
'已更新'
);
});
}
return
(
<
div
className=
"page employee-manage-page"
>
<
div
className=
"content-header"
>
员工管理
</
div
>
...
...
src/modules/college-manage/components/DepartMentTabCon.jsx
View file @
14445fa0
...
...
@@ -80,7 +80,7 @@ function DepartMentTabCon(props) {
return
<
span
>
-
</
span
>
}
return
<
Tooltip
title=
{
handleDepName
(
record
.
depNameList
)
}
placement=
'top'
arrowPointAtCenter
><
div
className=
"post-name"
>
{
record
.
depNameList
.
map
((
item
,
index
)
=>
{
return
<
span
>
{
item
}{
index
!==
record
.
depNameList
.
length
-
1
&&
<
span
>
;
</
span
>
}
</
span
>;
return
<
span
>
{
item
}{
index
!==
record
.
depNameList
.
length
-
1
&&
<
span
>
;
</
span
>
}
</
span
>
})
}
</
div
>
</
Tooltip
>
...
...
@@ -127,7 +127,7 @@ function DepartMentTabCon(props) {
let
depStr
=
''
;
depArray
.
forEach
((
item
,
index
)
=>
{
if
(
index
<
depArray
.
length
-
1
)
{
depStr
=
depStr
+
item
+
'
、
'
;
depStr
=
depStr
+
item
+
'
;
'
;
}
else
{
depStr
=
depStr
+
item
;
}
...
...
src/modules/college-manage/components/LeftStructureTree.jsx
View file @
14445fa0
...
...
@@ -24,10 +24,32 @@ function LeftStructureTree(props) {
const
[
currentGroupData
,
setCurrentGroupData
]
=
useState
({});
const
[
completeOptions
,
setCompleteOption
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
// 设置选中的部门key值
const
[
queryName
,
setQueryName
]
=
useState
(
''
);
const
[
queryName
,
setQueryName
]
=
useState
(
''
);
// 搜索框内的值
const
[
selctQueryName
,
setSelctQueryName
]
=
useState
(
''
);
// 搜索出结果后最终选择的名字
const
[
postGroupTreeData
,
setPostGroupTreeData
]
=
useState
([]);
// 为了判定创建和编辑时的数据会不会重明
const
[
open
,
setOpen
]
=
useState
(
false
);
useEffect
(()
=>
{
setQueryName
(
''
);
//切换tab时搜索置空
setCompleteOption
([]);
setOpen
(
false
);
//切换tab时搜索的下拉框置为空
getTreeData
().
then
((
res
)
=>
{
const
_defaultSelectedKeys
=
[];
if
(
res
.
length
>
0
){
_defaultSelectedKeys
.
push
(
res
[
0
].
id
);
setSelectedKeys
(
_defaultSelectedKeys
);
props
.
onChangeSelectDep
(
res
[
0
])
props
.
searchUserList
(
res
[
0
],
treeType
,
1
);
}
});
},[
props
.
treeType
]);
useEffect
(()
=>
{
Bus
.
bind
(
"addCustomer"
,(
record
)
=>
{
addCustomer
(
record
.
treeType
,
record
.
query
)})
},[]);
useEffect
(()
=>
{
Bus
.
bind
(
"changeTreeData"
,(
record
)
=>
{
getTreeData
(
record
.
treeType
)})
},[]);
const
renderTitle
=
(
title
)
=>
(
<
span
>
{
title
}
...
...
@@ -80,9 +102,10 @@ function LeftStructureTree(props) {
return
placeholder
}
function
confirmSearchSelect
(
value
,
option
){
console
.
log
(
'option'
,
option
);
setOpen
(
false
);
setQueryName
(
value
);
// console.log('option',option);
// setSelctQueryName(option)
props
.
searchUserList
({
queryName
:
value
},
treeType
,
1
);
}
...
...
@@ -160,27 +183,7 @@ function LeftStructureTree(props) {
});
}
useEffect
(()
=>
{
setQueryName
(
''
);
//切换tab时搜索置空
setCompleteOption
([]);
setOpen
(
false
);
//切换tab时搜索的下拉框置为空
getTreeData
().
then
((
res
)
=>
{
const
_defaultSelectedKeys
=
[];
if
(
res
.
length
>
0
){
_defaultSelectedKeys
.
push
(
res
[
0
].
id
);
setSelectedKeys
(
_defaultSelectedKeys
);
props
.
onChangeSelectDep
(
res
[
0
])
props
.
searchUserList
(
res
[
0
],
treeType
,
1
);
}
});
},[
props
.
treeType
]);
useEffect
(()
=>
{
Bus
.
bind
(
"addCustomer"
,(
record
)
=>
{
addCustomer
(
record
.
treeType
,
record
.
query
)})
},[]);
useEffect
(()
=>
{
Bus
.
bind
(
"changeTreeData"
,(
record
)
=>
{
getTreeData
(
record
.
treeType
)})
},[]);
async
function
addCustomer
(
treeType
,
query
){
await
getTreeData
(
treeType
);
props
.
searchUserList
(
query
,
treeType
,
1
);
...
...
@@ -359,9 +362,10 @@ function LeftStructureTree(props) {
return
;
}
}
console
.
log
(
"record.sonDepartmentVOList"
,
record
.
sonDepartmentVOList
)
if
(
level
===
1
){
if
(
record
.
sonDepartmentVOList
){
if
(
record
.
sonDepartmentVOList
.
leng
ht
>
19
){
if
(
record
.
sonDepartmentVOList
.
leng
th
>
19
){
message
.
error
(
"自定义分组数量已达20个上限"
);
return
;
}
...
...
@@ -484,6 +488,7 @@ function LeftStructureTree(props) {
</
div
>
)
}
<
div
className=
"tree-con"
>
{
!
selctQueryName
?
<
DirectoryTree
defaultExpandAll
showIcon=
{
false
}
...
...
@@ -559,6 +564,32 @@ function LeftStructureTree(props) {
);
}
}
/>
:
<
div
>
{
(
props
.
treeType
===
'departMentTab'
)
&&
<
div
>
{
option
.
name
?
<
WWOpenDataCom
type=
"departmentName"
openid=
{
option
.
name
}
/>
:
<
WWOpenDataCom
type=
"userName"
openid=
{
option
.
userName
}
/>
}
</
div
>
}
{
(
props
.
treeType
===
'postGrouptab'
||
props
.
treeType
===
'customGroupTab'
)
&&
<
div
>
{
option
.
name
?
<
span
>
{
option
.
name
}
</
span
>
:
<
span
>
{
option
.
userName
}
</
span
>
}
</
div
>
}
</
div
>
}
</
div
>
</
div
>
{
addOrEditPostGroupShow
&&
(
...
...
src/modules/college-manage/modal/AddOrEditPostGroupModal.jsx
View file @
14445fa0
...
...
@@ -2,7 +2,7 @@
* @Author: wufan
* @Date: 2020-11-27 16:21:49
* @LastEditors: Please set LastEditors
* @LastEditTime: 2021-08-06 1
5:07:53
* @LastEditTime: 2021-08-06 1
7:10:50
* @Description: Description
* @@Copyrigh: © 2020 杭州杰竞科技有限公司 版权所有
*/
...
...
@@ -24,7 +24,7 @@ function AddOrEditPostGroupModal(props) {
setIsError
(
false
)
setValidateStatus
(
'success'
);
setNameErrorMsg
(
''
);
if
((
!
postGroupName
)
||
/^
\s
+$/
.
test
(
postGroupNam
e
)){
if
((
!
e
.
target
.
value
)
||
/^
\s
+$/
.
test
(
e
.
target
.
valu
e
)){
setValidateStatus
(
'error'
);
setNameErrorMsg
(
`
${
props
.
label
}
不能为空`
);
setIsError
(
true
)
...
...
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