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

Loading…
Cancel
Save