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
3db3e5a0
Commit
3db3e5a0
authored
Aug 01, 2021
by
zhangleyuan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:处理搜索模块
parent
c7471eda
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
49 additions
and
35 deletions
+49
-35
src/modules/college-manage/components/DepartMentTabCon.jsx
+36
-25
src/modules/college-manage/components/LeftStructureTree.jsx
+13
-10
No files found.
src/modules/college-manage/components/DepartMentTabCon.jsx
View file @
3db3e5a0
...
@@ -200,36 +200,47 @@ function DepartMentTabCon(props) {
...
@@ -200,36 +200,47 @@ function DepartMentTabCon(props) {
};
};
function
updateListData
(){
function
updateListData
(){
let
num
=
1
;
let
num
;
if
(
num
<
3
){
const
params
=
{
return
confirm
({
enterpriseId
:
User
.
getEnterpriseId
(),
title
:
"确定更新列表数据吗?"
,
storeId
:
User
.
getStoreId
(),
content
:
`员工数据来源企微通讯录,一天只能更新3次,今日还能更新
${
3
-
num
}
次。`
,
userType
:
'CUSTOMER'
icon
:
(
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>
),
okText
:
"确定"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
confirmUpdateListData
()
},
});
}
else
{
Modal
.
warning
({
title
:
'提示'
,
okText
:
'我知道了'
,
content
:
'员工数据今日更新次数已达上限(3次),无法继续更新。'
,
icon
:
(
<
span
className=
'icon iconfont default-confirm-icon'
style=
{
{
color
:
'#FFBB54 !important'
}
}
>

</
span
>
),
});
}
}
StoreService
.
getSyncCount
(
params
).
then
((
res
)
=>
{
num
=
res
.
result
;
if
(
num
<
3
){
return
confirm
({
title
:
"确定更新列表数据吗?"
,
content
:
`学员数据来源企微通讯录,一天只能更新3次,今日还能更新
${
3
-
num
}
次。`
,
icon
:
(
<
span
className=
"icon iconfont default-confirm-icon"
>

</
span
>
),
okText
:
"确定"
,
cancelText
:
"取消"
,
onOk
:
()
=>
{
confirmUpdateListData
()
},
});
}
else
{
Modal
.
warning
({
title
:
'提示'
,
okText
:
'我知道了'
,
content
:
'学员数据今日更新次数已达上限(3次),无法继续更新。'
,
icon
:
(
<
span
className=
'icon iconfont default-confirm-icon'
style=
{
{
color
:
'#FFBB54 !important'
}
}
>

</
span
>
),
});
}
});
}
}
function
confirmUpdateListData
(){
function
confirmUpdateListData
(){
const
params
=
{
const
params
=
{
enterpriseId
:
User
.
getEnterpriseId
(),
enterpriseId
:
User
.
getEnterpriseId
(),
storeId
:
User
.
getStoreId
(),
userType
:
'CUSTOMER'
}
}
StoreService
.
syncWorkWeChatDepartment
(
params
).
then
((
res
)
=>
{
StoreService
.
syncWorkWeChatDepartment
(
params
).
then
((
res
)
=>
{
message
.
success
(
'已更新'
);
message
.
success
(
'已更新'
);
...
...
src/modules/college-manage/components/LeftStructureTree.jsx
View file @
3db3e5a0
...
@@ -23,7 +23,7 @@ function LeftStructureTree(props) {
...
@@ -23,7 +23,7 @@ function LeftStructureTree(props) {
const
[
selectDepParams
,
setSelectDepParams
]
=
useState
({});
// 设置选择的部门、岗位组、自定分组的参数
const
[
selectDepParams
,
setSelectDepParams
]
=
useState
({});
// 设置选择的部门、岗位组、自定分组的参数
const
[
completeOptions
,
setCompleteOption
]
=
useState
([]);
const
[
completeOptions
,
setCompleteOption
]
=
useState
([]);
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
// 设置选中的部门key值
const
[
selectedKeys
,
setSelectedKeys
]
=
useState
([]);
// 设置选中的部门key值
const
[
queryName
,
setQueryName
]
=
useState
(
''
);
const
renderTitle
=
(
title
)
=>
(
const
renderTitle
=
(
title
)
=>
(
<
span
>
<
span
>
{
title
}
{
title
}
...
@@ -62,6 +62,7 @@ function LeftStructureTree(props) {
...
@@ -62,6 +62,7 @@ function LeftStructureTree(props) {
dropdownClassName=
"certain-category-search-dropdown"
dropdownClassName=
"certain-category-search-dropdown"
dropdownMatchSelectWidth=
{
250
}
dropdownMatchSelectWidth=
{
250
}
allowClear
allowClear
value=
{
queryName
}
onChange=
{
getCompleteOptionData
}
onChange=
{
getCompleteOptionData
}
notFoundContent=
{
notFoundContentNode
()
}
notFoundContent=
{
notFoundContentNode
()
}
style=
{
{
style=
{
{
...
@@ -69,12 +70,13 @@ function LeftStructureTree(props) {
...
@@ -69,12 +70,13 @@ function LeftStructureTree(props) {
}
}
}
}
options=
{
completeOptions
}
options=
{
completeOptions
}
>
>
<
Input
size=
"large"
placeholder=
"搜索部门/学员姓名"
/>
<
Input
.
Search
size=
"large"
placeholder=
"input here"
enterButton
/>
</
AutoComplete
>
</
AutoComplete
>
);
);
// 获取关键词的搜索结果
// 获取关键词的搜索结果
function
getCompleteOptionData
(
value
){
function
getCompleteOptionData
(
value
){
setQueryName
(
value
)
const
params
=
{
const
params
=
{
depType
:
DepType
[
props
.
treeType
],
depType
:
DepType
[
props
.
treeType
],
queryName
:
value
,
queryName
:
value
,
...
@@ -89,7 +91,7 @@ function LeftStructureTree(props) {
...
@@ -89,7 +91,7 @@ function LeftStructureTree(props) {
const
userObj
=
{};
const
userObj
=
{};
const
departmentGroupObj
=
{};
const
departmentGroupObj
=
{};
const
postobj
=
{};
const
postobj
=
{};
const
{
departmentUserVOList
,
departmentVOList
}
=
res
.
result
;
const
{
departmentUserVOList
=
[],
departmentVOList
=
[]
}
=
res
.
result
;
if
(
departmentUserVOList
.
records
.
length
>
0
){
if
(
departmentUserVOList
.
records
.
length
>
0
){
userObj
.
label
=
renderTitle
(
'员工'
);
userObj
.
label
=
renderTitle
(
'员工'
);
userObj
.
options
=
departmentUserVOList
.
records
.
map
((
item
,
index
)
=>
{
userObj
.
options
=
departmentUserVOList
.
records
.
map
((
item
,
index
)
=>
{
...
@@ -121,7 +123,14 @@ function LeftStructureTree(props) {
...
@@ -121,7 +123,14 @@ function LeftStructureTree(props) {
_completeOptions
.
push
(
departmentGroupObj
);
_completeOptions
.
push
(
departmentGroupObj
);
}
}
console
.
log
(
'_completeOptions'
,
_completeOptions
);
console
.
log
(
'_completeOptions'
,
_completeOptions
);
// setCompleteOption(_completeOptions);
const
options
=
[
{
label
:
renderTitle
(
'Libraries'
),
options
:
[
renderItem
({
name
:
'张乐园'
},
'department'
)],
}
];
setCompleteOption
(
_completeOptions
);
});
});
}
}
...
@@ -356,12 +365,6 @@ function LeftStructureTree(props) {
...
@@ -356,12 +365,6 @@ function LeftStructureTree(props) {
<
div
className=
"left-structure-tree"
>
<
div
className=
"left-structure-tree"
>
<
div
className=
"organization"
>
<
div
className=
"organization"
>
<
div
className=
"search-con"
>
<
div
className=
"search-con"
>
{
/* <Search
placeholder="搜索部门/学员姓名"
className="search search-input"
style={{ width: 245 }}
enterButton={<span className="icon iconfont"></span>}
/> */
}
<
Complete
/>
<
Complete
/>
</
div
>
</
div
>
{
(
props
.
treeType
===
'postGrouptab'
||
props
.
treeType
===
'customGroupTab'
)
&&
(
{
(
props
.
treeType
===
'postGrouptab'
||
props
.
treeType
===
'customGroupTab'
)
&&
(
...
...
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