Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
CivManage
Project
Project
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
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ReactWeb5
CivManage
Commits
1db60f17
Commit
1db60f17
authored
Apr 07, 2021
by
mayongxin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:搜索返回null处理
parent
146f216e
Pipeline
#25627
passed with stages
in 21 minutes 49 seconds
Changes
1
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
3 deletions
+23
-3
UserModal.jsx
src/pages/userCenter/roleManage/UserModal.jsx
+23
-3
No files found.
src/pages/userCenter/roleManage/UserModal.jsx
View file @
1db60f17
...
...
@@ -4,7 +4,7 @@ import SiteModal from '@/components/Modal/SiteModa';
import
classnames
from
'classnames'
import
styles
from
'./UserModal.less'
;
import
lodash
,
{
clone
}
from
'lodash'
;
import
{
Card
,
Empty
,
Pagination
,
Checkbox
,
notification
}
from
'antd'
import
{
Card
,
Empty
,
Pagination
,
Checkbox
,
notification
,
Input
,
Row
,
Col
}
from
'antd'
import
{
getWebModuleTree
,
chooseUserToStation
,
...
...
@@ -21,6 +21,8 @@ import {
}
from
'@ant-design/icons'
;
import
qs
from
'qs'
;
const
{
Search
}
=
Input
;
const
placeholder
=
'请输入机构名称'
;
const
UserModal
=
props
=>
{
const
[
dataList
,
setdataList
]
=
useState
([]);
...
...
@@ -30,7 +32,7 @@ const UserModal = props => {
const
[
updatePageUser
,
setUpdatePageUser
]
=
useState
(
1
);
//
const
[
updateCheck
,
setUpdateCheck
]
=
useState
(
1
);
const
[
name
,
setName
]
=
useState
(
''
);
const
{
itemObj
,
confirmModal
}
=
props
const
{
itemObj
,
confirmModal
}
=
props
const
isAllChecked
=
index
=>
dataList
[
index
].
Users
.
filter
(
item
=>
item
.
isChecked
).
length
===
dataList
[
index
].
Users
.
length
;
...
...
@@ -94,7 +96,7 @@ const UserModal = props => {
}).
then
(
res
=>
{
let
list
=
[]
if
(
res
.
data
.
length
>
0
)
{
if
(
res
.
data
&&
res
.
data
.
length
>
0
)
{
res
.
data
.
map
((
item
,
index
)
=>
{
list
.
push
({
...
...
@@ -253,6 +255,11 @@ const UserModal = props => {
setSelectList
(
lodash
.
cloneDeep
(
selectList
));
setdataList
(
lodash
.
cloneDeep
(
dataList
));
};
// 获取搜索框的值
const
handleSearch
=
value
=>
{
setName
(
value
);
getList
(
value
);
};
return
(
<
SiteModal
{
...
props
}
...
...
@@ -272,6 +279,19 @@ const UserModal = props => {
[
styles
.
cardBoxR
]:
true
,
})
}
>
<
Row
align=
"middle"
>
<
Col
span=
{
1
}
>
搜索
</
Col
>
<
Col
span=
{
8
}
>
<
Search
allowClear
placeholder=
{
placeholder
}
onSearch=
{
handleSearch
}
// onChange={handleChange}
enterButton
/>
</
Col
>
</
Row
>
{
dataList
.
length
>
0
?
(
<>
...
...
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