From e430b1641816c9fafcb382cb5fea6864336405f8 Mon Sep 17 00:00:00 2001 From: wenlele Date: Sun, 9 Oct 2022 11:16:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=86=E9=A2=91=E6=92=AD=E6=94=BE=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/client/src/layout/actions/global.js | 1 + web/client/src/layout/reducers/global.js | 2 ++ .../src/sections/problem/actions/problem.jsx | 13 ++++++- .../sections/problem/components/tableData.jsx | 25 ++++++------- .../sections/problem/containers/dataAlarm.jsx | 36 ++++++++++++------- web/client/src/utils/webapi.js | 1 + web/config.js | 6 +++- web/package.json | 4 +-- web/routes/attachment/index.js | 3 +- 9 files changed, 59 insertions(+), 32 deletions(-) diff --git a/web/client/src/layout/actions/global.js b/web/client/src/layout/actions/global.js index 4d019aa..a33064a 100644 --- a/web/client/src/layout/actions/global.js +++ b/web/client/src/layout/actions/global.js @@ -38,6 +38,7 @@ export function initApiRoot () { type: INIT_API_ROOT, payload: { apiRoot: res.root, + iotVcmpWeb:res.iotVcmpWeb, } }) }); diff --git a/web/client/src/layout/reducers/global.js b/web/client/src/layout/reducers/global.js index 8187eb7..600c572 100644 --- a/web/client/src/layout/reducers/global.js +++ b/web/client/src/layout/reducers/global.js @@ -11,6 +11,7 @@ function global (state = { clientHeight: 768, clientWidth: 1024, apiRoot: '', + iotVcmpWeb: '', }, action) { const payload = action.payload; switch (action.type) { @@ -30,6 +31,7 @@ function global (state = { case INIT_API_ROOT: return Immutable.fromJS(state).merge({ apiRoot: payload.apiRoot, + iotVcmpWeb: payload.iotVcmpWeb }).toJS(); default: return state; diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx index 5004b48..329cca0 100644 --- a/web/client/src/sections/problem/actions/problem.jsx +++ b/web/client/src/sections/problem/actions/problem.jsx @@ -34,7 +34,7 @@ export function putAlarmApplicationNoted (data) { //预览状态 data, actionType: 'PUT-AIARM-APPLICATIO-NNOTED', url: `${ApiTable.putAlarmApplicationNoted}`, - msg: { option: '预览失败' }, + msg: { option: '预览' }, reducer: { name: '' } }); } @@ -159,3 +159,14 @@ export function putAlarmVideoConfirm (data) { //确认视频告警 reducer: { name: '' } }); } + +export function getVcmpAuth () { //获取视频平台应用鉴权token + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_VCMP_AUTH', + url: `${ApiTable.getVcmpAuth}`, + msg: { option: '获取视频平台应用鉴权token' }, + reducer: { name: '' } + }); +} diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx index 5a70c70..d560b6b 100644 --- a/web/client/src/sections/problem/components/tableData.jsx +++ b/web/client/src/sections/problem/components/tableData.jsx @@ -25,7 +25,6 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition console.log(res.payload.data) if (res.success) { let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } - setCount(res.payload.data?.count || 0) let tableDatas = res.payload.data?.rows.map(v => ({ key: v.id, // serialNumber: v.serialNumber, @@ -43,14 +42,15 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition confirm: v.confirm, })) // console.log(tableDatas); + setCount(tableDatas?.length || 0); setTableData(tableDatas) } }) break; case 'videoAbnormal': - dispatch(problem.getAlarmVideoList({})).then((res) => { + dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: '' })).then((res) => { if (res.success) { - console.log(res); + // console.log(res); let tableDatas = res.payload.data?.map(v => ({ key: v.alarmId, StructureName: v.struc, @@ -61,12 +61,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:mm:ss") : "", confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:mm:ss") : "", SourceName: v.cameraName, - // AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", - // Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", - // type: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", - // AlarmCodeName: v.AlarmCodeName, - // CurrentLevel: v.CurrentLevel, - // detailCount: v.detailCount, + yingshiToken: v.yingshiToken, AlarmContent: v.statusDescribe, // State: v.State, station: v.station, @@ -79,7 +74,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition confirm: v.confirmedContent, camerOnline: v.camerOnline, })) - console.log(tableDatas); + // console.log(tableDatas); setCount(tableDatas?.length || 0); setTableData(tableDatas) } @@ -180,7 +175,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition field={v.field} placeholder="项目或应用关键字" showClear - style={{ width: 115, marginRight: 16, marginBottom: 16 }} />) + style={{ width: 146, marginRight: 16, marginBottom: 16 }} />) } else { frame.push( @@ -282,7 +277,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition > 勾选{selected.length}条问题 : "" } @@ -322,7 +333,6 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { ] - const attribute = (name, route) => { let arr = localStorage.getItem(name) ? JSON.parse(localStorage.getItem(name)) @@ -505,12 +515,13 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {