Browse Source

确认提醒

dev
wenlele 2 years ago
parent
commit
71d0f2e30e
  1. 13
      web/client/src/sections/problem/components/inspection.jsx
  2. 1
      web/client/src/sections/problem/components/tableData.jsx
  3. 29
      web/client/src/sections/problem/containers/dataAlarm.jsx

13
web/client/src/sections/problem/components/inspection.jsx

@ -1,9 +1,10 @@
import React, { useState, useEffect, useRef } from "react"; import React, { useState, useEffect, useRef } from "react";
import { connect } from "react-redux"; import { connect } from "react-redux";
import { Button, Form, Modal, Skeleton, Pagination, Table } from "@douyinfe/semi-ui"; import { Button, Form, Modal, Skeleton, Pagination, Notification } from "@douyinfe/semi-ui";
import moment from "moment"; import moment from "moment";
import PerfectScrollbar from "perfect-scrollbar"; import PerfectScrollbar from "perfect-scrollbar";
import copy from "copy-to-clipboard";
import './inspection.less' import './inspection.less'
import { log } from "ezuikit-js"; import { log } from "ezuikit-js";
@ -213,7 +214,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} /> <img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} />
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}>
<span style={{ fontSize: 12 }}>获取时间{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> <span style={{ fontSize: 12 }}>获取时间{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<span >{v.app?.name}</span> <span style={{ color: '#4A4A4A' ,fontWeight: 500}}>{v.app?.name}</span>
</div> </div>
</div>)} </div>)}
@ -284,6 +285,14 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span> <span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<img src={`/assets/images/problem/link.png`} <img src={`/assets/images/problem/link.png`}
style={{ width: 16, height: 16, marginLeft: 6 }} style={{ width: 16, height: 16, marginLeft: 6 }}
onClick={() => {
console.log(pictureData);
copy(pictureData?.router || "无相关地址");
Notification.success({
content: "复制成功",
duration: 2,
})
}}
/> />
</div> </div>
<img src={`/_file-server/${pictureData.screenshot}`} <img src={`/_file-server/${pictureData.screenshot}`}

1
web/client/src/sections/problem/components/tableData.jsx

@ -254,6 +254,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
state: v.state, state: v.state,
keywordTarget: v.keywordTarget, keywordTarget: v.keywordTarget,
keyword: v.keyword, keyword: v.keyword,
kindId:v.kindId,
groupUnitId: v.groupUnitId, groupUnitId: v.groupUnitId,
errType: v.errType, errType: v.errType,
confirmState: v.confirmState, confirmState: v.confirmState,

29
web/client/src/sections/problem/containers/dataAlarm.jsx

@ -108,11 +108,11 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
videoAbnormal: [ // (videoAbnormal) videoAbnormal: [ // (videoAbnormal)
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
{ {
name: '设备类型', field: '2', name: '设备类型', field: 'kindId',
data: genre, data: genre,
}, },
{ {
name: '异常状态', field: '3', name: '异常状态', field: 'state',
data: [ data: [
{ name: '当前', value: 'new' }, { name: '当前', value: 'new' },
{ name: '历史', value: 'histroy' }] { name: '历史', value: 'histroy' }]
@ -148,7 +148,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
name: '异常类型', field: '4', name: '异常类型', field: '4',
data: [ data: [
{ name: '离线', value: '11' }] { name: '离线', value: '11' }]
}], }
],
common: { common: {
name: '告警时间', name: '告警时间',
field: 'time' field: 'time'
@ -160,7 +161,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'sustainTime', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',], dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'sustainTime', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',],
dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'], strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'cameraKindId', 'venderName', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'], videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'cameraKindId', 'venderName', 'point', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'],
useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'alarmContent', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'], deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'alarmContent', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
} }
@ -228,6 +229,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
</div> : "" </div> : ""
} }
}, },
{ name: '测点', sort: 4.1, value: 'point', render: (_, r, index) => r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.name}</div>) },
{ name: '中断类型', sort: 6, value: 'AlarmGroupUnit' }, { name: '中断类型', sort: 6, value: 'AlarmGroupUnit' },
{ name: '告警信息', sort: 5, value: 'AlarmContent' }, { name: '告警信息', sort: 5, value: 'AlarmContent' },
{ name: '常见原因', sort: 7, value: 'AlarmCodeName' }, { name: '常见原因', sort: 7, value: 'AlarmCodeName' },
@ -448,6 +450,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
dispatch(problem.postApiConfirm({ appAlarmId: selected, confirm: content })).then(res => { dispatch(problem.postApiConfirm({ appAlarmId: selected, confirm: content })).then(res => {
if (res.success) { if (res.success) {
setConfirm(false) setConfirm(false)
setSelected([])
setQuery({ limit: query.limit, page: query.page }) setQuery({ limit: query.limit, page: query.page })
} }
}) })
@ -457,6 +460,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
dispatch(problem.putAlarmVideoConfirm({ alarmId: selected, content: content })).then(res => { dispatch(problem.putAlarmVideoConfirm({ alarmId: selected, content: content })).then(res => {
if (res.success) { if (res.success) {
setConfirm(false) setConfirm(false)
setSelected([])
setQuery({ limit: query.limit, page: query.page }) setQuery({ limit: query.limit, page: query.page })
} }
}) })
@ -475,7 +479,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
}) || tableData }) || tableData
setTableData(data) setTableData(data)
setConfirm(false) setConfirm(false)
console.log(data) setSelected([])
// console.log(data)
} }
}) })
}) })
@ -494,6 +499,20 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
field='textData' field='textData'
onChange={(e) => setContent(e)} /> onChange={(e) => setContent(e)} />
</Form> </Form>
{(() => {
let data
if (selected.length == 1) {
data = tableData.find(v => v.key == selected[0])
}
return data ? <div style={{ width: 450, marginLeft: 80, background: '#FFF6E9', fontWeight: 400, color: '#FE9812', fontSize: 13 }}>
当前告警源-{data?.SourceName}在项目{data?.projectName?.map((v, index) => {
if (index > 0) {
return '、' + v.name
} else {
return v.name
}
})}中被多次绑定可能拥有不同的名称确认后该设备的同类型告警也会被一同确认</div> : ""
})()}
</div> </div>
</Modal> : ""} </Modal> : ""}

Loading…
Cancel
Save