Browse Source

fix bugs:告警页面全选无效

dev
zhaobing’ 1 year ago
parent
commit
d996142cc9
  1. 7
      web/client/src/sections/problem/components/tableData.jsx

7
web/client/src/sections/problem/components/tableData.jsx

@ -19,7 +19,6 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
const groupId = useRef()
let title = { dataLnterrupt: "数据中断详情", dataAbnormal: "数据异常详情", strategyHit: "策略命中详情", videoAbnormal: "视频异常详情", useAbnormal: "应用异常详情", deviceAbnormal: "设备异常详情" }
const [exportUrl, setExportUrl] = useState('')
useEffect(() => {
switch (route) {
case 'useAbnormal':
@ -27,6 +26,7 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
if (res.success) {
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" }
let tableDatas = res.payload.data?.rows.map(v => ({
key: v.id,
id: v.id,
projectName: v.app?.projectCorrelations?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {
id: r.id, name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus
@ -52,6 +52,7 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
dispatch(problem.getAlarmVideoList({ ...search.current, pepProjectId: pepProjectId })).then((res) => {
if (res.success) {
let tableDatas = res.payload.data?.map(v => ({
key: v.alarmId,
id: v.alarmId,
StructureName: v.struc,
projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {
@ -86,6 +87,7 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
if (res.success) {
setCount(res.payload.data?.count || 0)
let tableDatas = res.payload.data?.rows?.map(v => ({
key: v.AlarmId,
id: v.AlarmId,
StructureName: v.StructureName,
projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {
@ -234,7 +236,6 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
break;
}
}
return (
<>
<div style={{ backgroundColor: '#FFFFFF', margin: "20px 12px 12px", padding: "20px 20px 40px" }}>
@ -408,6 +409,7 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
// name: record.name,
}),
onSelect: (record, selected) => {
// console.log(`select row: ${selected}`, record);
},
// onSelectAll: (selected, selectedRows) => {
@ -417,6 +419,7 @@ const TableData = ({alarmDataGroup, route, dispatch, actions, collectData, setSe
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
setSelected(selectedRows?.map(v => v.id))
},
}}
/>
})()}

Loading…
Cancel
Save