From b3c26d3067fe187aee181f421d05eb8e0ee8e82c Mon Sep 17 00:00:00 2001 From: wenlele Date: Tue, 27 Sep 2022 11:37:24 +0800 Subject: [PATCH] =?UTF-8?q?api=E8=AF=B7=E6=B1=82=E4=B8=A4=E6=AC=A1?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sections/problem/components/tableData.jsx | 6 +++--- .../sections/problem/containers/dataAlarm.jsx | 19 ++++--------------- 2 files changed, 7 insertions(+), 18 deletions(-) diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 62d310c..3921397 100644 --- a/web/client/src/sections/problem/components/tableData.jsx +++ b/web/client/src/sections/problem/components/tableData.jsx @@ -8,7 +8,7 @@ import { emit } from "superagent"; -const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition, +const TableData = ({ route,dispatch, actions, collectData, setSetup, exhibition, selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery }) => { const { problem } = actions @@ -101,13 +101,13 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition break; } - }, [route, query, search]) + }, [query, search]) return ( <> -
+
{ - - const [route, setRoute] = useState('') //子页面路由 + let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length) const [abnormalLenght, setAbnormalLenght] = useState(0) //异常数量 const [collect, setCollect] = useState([]) //搜索结构 const [setup, setSetup] = useState(false); //表格设置是否显现 @@ -33,16 +32,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' } const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' } - - useEffect(() => { - setRoute(match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length)) - // console.log(match.url) - // console.log(tableType); - - - }, []) - - useEffect(() => { if (route) { @@ -57,7 +46,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { : ""; } attribute(tableType[route], route); - }, [route]) + }, []) //搜索结构 @@ -285,7 +274,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { // } - console.log(data) + // console.log(data) // let TableDisplay = [] let TableDisplay = data?.map(v => { @@ -295,7 +284,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { } }) - console.log(TableDisplay); + // console.log(TableDisplay); TableDisplay.push({ title: '操作',