From 1facf98bca8668a2f7a8b10e832253e5a7a17e9b Mon Sep 17 00:00:00 2001 From: wenlele Date: Thu, 29 Sep 2022 09:09:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=B1=95=E7=A4=BA=E4=BF=9D?= =?UTF-8?q?=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/sections/problem/actions/problem.jsx | 25 +++++++++++++++++++ .../sections/problem/components/tableData.jsx | 21 ++++++++++------ .../sections/problem/containers/dataAlarm.jsx | 17 ++++++------- web/client/src/utils/webapi.js | 3 +++ 4 files changed, 48 insertions(+), 18 deletions(-) diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx index 5789fe3..dbe4e3f 100644 --- a/web/client/src/sections/problem/actions/problem.jsx +++ b/web/client/src/sections/problem/actions/problem.jsx @@ -121,4 +121,29 @@ export function putAlarmdataConfirm (data) { //确认数据告警 msg: { error: '确认数据告警失败' }, reducer: { name: '' } }); +} + +export function getAlarmVideoList (query) { //查询视频告警列表 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + query, + actionType: 'GET_ALARM_VIDEO_LIST', + url: `${ApiTable.getAlarmVideoList}`, + msg: { error: '查询视频告警列表失败' }, + reducer: { name: '' } + }); +} + + + +export function getAlarmVideoDeviceKind () { //查询视频设备类型 + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_ALARM_VIDEO_DEVICE_KIND', + url: `${ApiTable.getAlarmVideoDeviceKind}`, + msg: { error: '查询视频设备类型失败' }, + reducer: { name: '' } + }); } \ No newline at end of file diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 6ae2bc0..7033ded 100644 --- a/web/client/src/sections/problem/components/tableData.jsx +++ b/web/client/src/sections/problem/components/tableData.jsx @@ -48,11 +48,16 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition // }) break; case 'videoAbnormal': - // dispatch(problem.getAlarmDataGroup()).then((res) => { - - - // if (res.success) { } - // }) + dispatch(problem.getAlarmVideoList({})).then((res) => { + if (res.success) { + // console.log(res); + } + }) + dispatch(problem.getAlarmVideoDeviceKind()).then((res) => { + if (res.success) { + setGenre(res.payload.data.map(v => ({ name: v.kind, value: v.id }))) + } + }) break; default: dispatch(problem.getAlarmDataGroup()).then((res) => { @@ -71,11 +76,11 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition genreData.push({ name: vv.name, value: vv.id }) }) }) - console.log(genreData); + // console.log(genreData); setGenre(genreData) if (data && data[0]?.id) { dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => { - console.log(res); + // console.log(res); if (res.success) { setCount(res.payload.data?.count || 0) let tableDatas = res.payload.data?.rows?.map(v => ({ @@ -112,8 +117,8 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition }, [query, search]) +// console.log(query); -console.log(query); return ( <>
diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx index ed158ab..f4d9106 100644 --- a/web/client/src/sections/problem/containers/dataAlarm.jsx +++ b/web/client/src/sections/problem/containers/dataAlarm.jsx @@ -92,16 +92,13 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { { name: '搜索', field: '1' }, { name: '设备类型', field: '2', - data: [ - { name: '枪机', value: '11' }, - { name: '球机', value: '22' }, - { name: '其他', value: '33' }] + data: genre, }, { name: '异常状态', field: '3', data: [ - { name: '当前', value: '11' }, - { name: '历史', value: '22' }] + { name: '当前', value: 'new' }, + { name: '历史', value: 'histroy' }] }], useAbnormal: [ // 应用异常(useAbnormal) { name: '搜索', field: 'errType' }, @@ -174,7 +171,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { name: '项目名称', sort: 3, value: 'projectName', render: (_, r, index) => { return <> {r.projectName?.map((v, index) => { - return
+ return v.name ?
{OutHidden({ number: 7, name: v.name @@ -186,8 +183,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { {v.state}
-
- }) +
: "" + }) } @@ -402,7 +399,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { }} >
- 确认信息: + 确认信息: