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
f4001def
Commit
f4001def
authored
Aug 03, 2023
by
皮倩雯
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: '巡检反馈搜索'
parent
37bbc3ba
Pipeline
#77021
waiting for manual action with stages
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
62 additions
and
53 deletions
+62
-53
patrolFeedback.jsx
...nager/patrolMaintenance/patrolFeedback/patrolFeedback.jsx
+62
-53
No files found.
src/pages/bsmanager/patrolMaintenance/patrolFeedback/patrolFeedback.jsx
View file @
f4001def
/* eslint-disable react-hooks/rules-of-hooks */
/* eslint-disable camelcase */
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Space
,
Table
,
Popconfirm
,
Tooltip
,
Button
,
notification
,
Spin
,
Card
,
Input
}
from
'antd'
;
import
{
CM_Feedback_LoadPatrolFeedbacks
,
...
...
@@ -36,7 +36,10 @@ const patrolFeedback = () => {
const
[
treeVisible
,
setTreeVisible
]
=
useState
(
true
);
// 左边列表是否可见
const
[
pickItem
,
setPickItem
]
=
useState
(
'区域巡检'
);
const
[
hoverItemIndex
,
setHoverItemIndex
]
=
useState
(
''
);
const
[
searchValue
,
setSearchValue
]
=
useState
(
''
);
// const [searchValue, setSearchValue] = useState('');
const
searchValue
=
useRef
(
null
);
const
[
keepSearch
,
setKeepSearch
]
=
useState
([]);
const
[
newTableData
,
setNewTableData
]
=
useState
([]);
const
columns
=
[
{
...
...
@@ -203,50 +206,61 @@ const patrolFeedback = () => {
];
useEffect
(()
=>
{
getTableList
();
},
[]);
const
getTableList
=
val
=>
{
setTreeLoading
(
true
);
CM_Feedback_LoadPatrolFeedbacks
({
pageIndex
:
1
,
pageSize
:
20
,
keyword
:
searchValue
}).
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
code
===
0
)
{
let
data
=
{};
if
(
res
.
data
.
list
.
length
>
0
)
{
let
area
=
[];
let
dma
=
[];
let
other
=
[];
res
.
data
.
list
.
map
(
i
=>
{
if
(
i
.
businessGroup
===
'区域巡检'
)
{
area
.
push
(
i
);
}
else
if
(
i
.
businessGroup
===
'DMA巡检'
)
{
dma
.
push
(
i
);
}
else
if
(
i
.
businessGroup
===
'区域巡检,DMA巡检'
||
i
.
businessGroup
===
'DMA巡检,区域巡检'
)
{
area
.
push
(
i
);
dma
.
push
(
i
);
}
else
{
other
.
push
(
i
);
}
});
data
.
区域巡检
=
area
;
data
.
DMA
巡检
=
dma
;
if
(
other
.
length
>
0
)
{
data
.
未分组
=
other
;
setGroupName
([
'区域巡检'
,
'DMA巡检'
,
'未分组'
]);
CM_Feedback_LoadPatrolFeedbacks
({
pageIndex
:
1
,
pageSize
:
20
,
keyword
:
val
?
val
:
searchValue
.
current
,
}).
then
(
res
=>
{
setTreeLoading
(
false
);
if
(
res
.
code
===
0
)
{
let
data
=
{};
if
(
res
.
data
.
list
.
length
>
0
)
{
let
area
=
[];
let
dma
=
[];
let
other
=
[];
res
.
data
.
list
.
map
(
i
=>
{
if
(
i
.
businessGroup
===
'区域巡检'
)
{
area
.
push
(
i
);
}
else
if
(
i
.
businessGroup
===
'DMA巡检'
)
{
dma
.
push
(
i
);
}
else
if
(
i
.
businessGroup
===
'区域巡检,DMA巡检'
||
i
.
businessGroup
===
'DMA巡检,区域巡检'
)
{
area
.
push
(
i
);
dma
.
push
(
i
);
}
else
{
setGroupName
([
'区域巡检'
,
'DMA巡检'
]
);
other
.
push
(
i
);
}
}
setTableData
(
data
);
let
list
=
[];
res
.
data
.
list
.
map
(
i
=>
{
list
.
push
(
i
.
layerName
);
});
setKeepTableData
(
list
);
data
.
区域巡检
=
area
;
data
.
DMA
巡检
=
dma
;
if
(
other
.
length
>
0
)
{
data
.
未分组
=
other
;
setGroupName
([
'区域巡检'
,
'DMA巡检'
,
'未分组'
]);
}
else
{
setGroupName
([
'区域巡检'
,
'DMA巡检'
]);
}
}
},
);
},
[
flag
]);
if
(
searchValue
.
current
)
{
setNewTableData
(
res
.
data
.
list
);
}
else
{
setNewTableData
(
data
[
pickItem
]);
}
setTableData
(
data
);
let
list
=
[];
res
.
data
.
list
.
map
(
i
=>
{
list
.
push
(
i
.
layerName
);
});
setKeepTableData
(
list
);
}
});
};
const
add
=
()
=>
{
setAddVisible
(
true
);
...
...
@@ -265,7 +279,7 @@ const patrolFeedback = () => {
duration
:
3
,
description
:
'删除成功'
,
});
setFlag
(
flag
+
1
);
getTableList
(
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -277,7 +291,7 @@ const patrolFeedback = () => {
};
const
onOK
=
()
=>
{
setFlag
(
flag
+
1
);
getTableList
(
);
};
const
sort
=
()
=>
{
...
...
@@ -303,7 +317,7 @@ const patrolFeedback = () => {
description
:
'批量删除成功'
,
});
setSelectedRowKeys
([]);
setFlag
(
flag
+
1
);
getTableList
(
);
}
else
{
notification
.
error
({
message
:
'提示'
,
...
...
@@ -320,12 +334,9 @@ const patrolFeedback = () => {
};
// 搜索
const
handleSearch
=
text
=>
{
setFlag
(
flag
+
1
);
};
// 搜索框改变时存储输入的值
const
handleChange
=
e
=>
{
setSearchValue
(
e
.
target
.
value
);
const
handleSearch
=
e
=>
{
searchValue
.
current
=
e
;
getTableList
(
e
);
};
return
(
...
...
@@ -426,8 +437,6 @@ const patrolFeedback = () => {
allowClear
placeholder=
"请输入巡检对象名称"
onSearch=
{
handleSearch
}
onChange=
{
handleChange
}
value=
{
searchValue
}
enterButton
style=
{
{
width
:
'300px'
}
}
/>
...
...
@@ -485,7 +494,7 @@ const patrolFeedback = () => {
},
// 双击
})
}
columns=
{
columns
}
dataSource=
{
tableData
[
pickItem
]
}
dataSource=
{
newTableData
}
scroll=
{
{
y
:
'calc(100% - 40px)'
,
x
:
'max-content'
}
}
pagination=
{
{
showTotal
:
(
total
,
range
)
=>
`第${range[0]}-${range[1]} 条/共 ${total} 条`
,
...
...
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