Browse Source

项目展示保护

dev
wenlele 2 years ago
parent
commit
1facf98bca
  1. 25
      web/client/src/sections/problem/actions/problem.jsx
  2. 21
      web/client/src/sections/problem/components/tableData.jsx
  3. 13
      web/client/src/sections/problem/containers/dataAlarm.jsx
  4. 3
      web/client/src/utils/webapi.js

25
web/client/src/sections/problem/actions/problem.jsx

@ -122,3 +122,28 @@ export function putAlarmdataConfirm (data) { //确认数据告警
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: '' }
});
}

21
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 (
<>
<div style={{ backgroundColor: '#FFFFFF', paddingTop: 8 }}>

13
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 <div key={r.id + r.appName + index} style={{ width: 176, }}>
return v.name ? <div key={r.id + r.appName + index} style={{ width: 176, }}>
{OutHidden({
number: 7,
name: v.name
@ -186,7 +183,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
<img src={`/assets/images/install/${v.state == 'PMOS' ? 'icon_POMS' : 'icon_zhengque'}.png`} style={{ display: "inline-block", width: 10 }} />
<span style={{ display: "inline-block", color: v.state == 'PMOS' ? "rgb(255, 255, 255)" : "rgb(15, 126, 251)", width: 48, fontSize: 12, textAlign: "center" }}>{v.state}</span>
</div>
</div>
</div> : ""
})
}

3
web/client/src/utils/webapi.js

@ -43,6 +43,9 @@ export const ApiTable = {
getAlarmDataDetailAgg: 'alarm/data/detail_agg', //查询数据告警详情聚集数据
getAlarmDataDetail: 'alarm/data/detail', //查询数据告警详情
putAlarmdataConfirm: "alarm/data/confirm", //确认数据告警
getAlarmVideoList: 'alarm/video/list', //查询视频告警列表
getAlarmVideoDeviceKind: 'alarm/video/device_kind', //查询视频设备类型
};

Loading…
Cancel
Save