From b685a4fb094d9bdac302ace28d7ae9781713e00c Mon Sep 17 00:00:00 2001 From: wenlele Date: Sun, 9 Oct 2022 09:08:58 +0800 Subject: [PATCH] =?UTF-8?q?=E6=92=AD=E6=94=BE=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/problem/actions/problem.jsx | 22 +++++----- .../sections/problem/components/sideSheet.jsx | 14 +++---- .../sections/problem/containers/dataAlarm.jsx | 41 +++++++++++-------- web/client/src/utils/webapi.js | 2 +- 4 files changed, 42 insertions(+), 37 deletions(-) diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx index 680078d..5004b48 100644 --- a/web/client/src/sections/problem/actions/problem.jsx +++ b/web/client/src/sections/problem/actions/problem.jsx @@ -148,14 +148,14 @@ export function getAlarmVideoDeviceKind () { //查询视频设备类型 }); } -// export function putAlarmdataConfirm (data) { //确认数据告警 -// return dispatch => basicAction({ -// type: 'put', -// dispatch: dispatch, -// data, -// actionType: 'PUT-AIARM-DATA-CONFIRM', -// url: `${ApiTable.putAlarmdataConfirm}`, -// msg: { option: '确认数据告警' }, -// reducer: { name: '' } -// }); -// } +export function putAlarmVideoConfirm (data) { //确认视频告警 + return dispatch => basicAction({ + type: 'put', + dispatch: dispatch, + data, + actionType: 'PUT-AIARM-VIDEO-CONFIRM', + url: `${ApiTable.putAlarmVideoConfirm}`, + msg: { option: '确认视频告警' }, + reducer: { name: '' } + }); +} diff --git a/web/client/src/sections/problem/components/sideSheet.jsx b/web/client/src/sections/problem/components/sideSheet.jsx index 94ff7fd..a8b119b 100644 --- a/web/client/src/sections/problem/components/sideSheet.jsx +++ b/web/client/src/sections/problem/components/sideSheet.jsx @@ -13,7 +13,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) { const { problem } = actions; const [clickStyle, setclickStyle] = useState(); - const [query, setQuery] = useState({ page: 1, pageSize: 10 }); + const [query, setQuery] = useState({ page: 0, pageSize: 10 }); const [dataSource, setdataSource] = useState([]); const [option, setOption] = useState({}); @@ -21,7 +21,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) { useEffect(() => { if (alarmId) { - dispatch(problem.getAlarmDataDetail({ alarmId: alarmId })).then((res) => { + dispatch(problem.getAlarmDataDetail({ alarmId: alarmId, ...query })).then((res) => { if (res?.success) { console.log(res.payload.data); setdataSource(res.payload.data); @@ -103,7 +103,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) { }); } - }, []); + }, [query]); useEffect(() => { @@ -163,7 +163,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
- +
告警详情 @@ -171,7 +171,7 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
{ console.log(currentPage, pageSize); - setQuery({ pageSize: pageSize, page: currentPage }); + setQuery({ pageSize: pageSize, page: currentPage - 1 }); }} /> : ""} diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx index f4d8bbd..e47cf20 100644 --- a/web/client/src/sections/problem/containers/dataAlarm.jsx +++ b/web/client/src/sections/problem/containers/dataAlarm.jsx @@ -227,7 +227,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { { name: '常见原因', sort: 7, value: 'AlarmCodeName' }, { name: '产生时间', sort: 22, value: 'createTime', render: (_, r, index) => r.createTime || '无' }, { name: '更新时间', sort: 23, value: 'updateTime', render: (_, r, index) => r.updateTime || '无' }, - { name: '服务器地址', sort: 12, value: '9' }, + // { name: '服务器地址', sort: 12, value: '9' }, { name: '告警等级', sort: 13, value: 'CurrentLevel', render: (_, r, index) => { let data = { 1: '一级', 2: '二级', 3: '三级' } @@ -444,7 +444,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { }) } else if (route == 'videoAbnormal') { TextAreaApi.current.validate().then((v) => { - dispatch(problem.postApiConfirm({ appAlarmId: selected, confirm: content })).then(res => { + dispatch(problem.putAlarmVideoConfirm({ alarmId: selected, content: content })).then(res => { if (res.success) { setConfirm(false) setQuery({ limit: query.limit, page: query.page }) @@ -490,30 +490,35 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { {videoModal ? setVideoModal(false)} onOk={() => { }} > -
+