From d996142cc9ff5bc267a9fe800ace884693c8ec05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?zhaobing=E2=80=99?= Date: Thu, 30 Nov 2023 20:27:22 +0800 Subject: [PATCH] =?UTF-8?q?fix=20bugs:=E5=91=8A=E8=AD=A6=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=85=A8=E9=80=89=E6=97=A0=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/sections/problem/components/tableData.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 5a3fa4c..d83a2f3 100644 --- a/web/client/src/sections/problem/components/tableData.jsx +++ b/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 ( <>
@@ -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)) }, + }} /> })()}