Browse Source

告警优化

dev
wenlele 2 years ago
parent
commit
87ce373e59
  1. BIN
      web/client/assets/images/problem/CurrentLevel1.png
  2. BIN
      web/client/assets/images/problem/CurrentLevel2.png
  3. BIN
      web/client/assets/images/problem/CurrentLevel3.png
  4. 2
      web/client/src/layout/containers/layout/index.jsx
  5. 24
      web/client/src/sections/problem/actions/problem.jsx
  6. 14
      web/client/src/sections/problem/components/inspection.jsx
  7. 16
      web/client/src/sections/problem/components/sideSheet.jsx
  8. 16
      web/client/src/sections/problem/components/statistics.jsx
  9. 38
      web/client/src/sections/problem/components/tableData.jsx
  10. 93
      web/client/src/sections/problem/containers/dataAlarm.jsx

BIN
web/client/assets/images/problem/CurrentLevel1.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

BIN
web/client/assets/images/problem/CurrentLevel2.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 303 B

BIN
web/client/assets/images/problem/CurrentLevel3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 321 B

2
web/client/src/layout/containers/layout/index.jsx

@ -173,7 +173,7 @@ const LayoutContainer = props => {
// websocket 使
useEffect(() => {
console.log(socket)
// console.log(socket)
if (socket) {
socket.on('CAMERA_ONLINE', function (msg) {
console.info(msg);

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

@ -8,7 +8,7 @@ export function getProjectPoms () { //获取已绑定项目
dispatch: dispatch,
actionType: 'GET_PROJECT_POMS',
url: `${ApiTable.getProjectPoms}`,
msg: { error: '获取已绑定项目失败' },
msg: { option: '获取已绑定项目' },
reducer: { name: '' }
});
}
@ -21,7 +21,7 @@ export function getAlarmLnspection (query) { //查询应用巡检信息
query,
actionType: 'GET_ALARM_LNICSPECTION',
url: `${ApiTable.getAlarmLnspection}`,
msg: { error: '查询应用巡检信息失败' },
msg: { option: '查询应用巡检信息' },
reducer: { name: '' }
});
}
@ -34,7 +34,7 @@ export function putAlarmApplicationNoted (data) { //预览状态
data,
actionType: 'PUT-AIARM-APPLICATIO-NNOTED',
url: `${ApiTable.putAlarmApplicationNoted}`,
msg: { error: '预览失败' },
msg: { option: '预览失败' },
reducer: { name: '' }
});
}
@ -46,7 +46,7 @@ export function getAlarmLnspectionApi (query) { //查询应用接口/元素错
query,
actionType: 'GET_ALARM_LNICSPECTION-API',
url: `${ApiTable.getAlarmLnspectionApi}`,
msg: { error: '查询应用接口/元素错误信息失败' },
msg: { option: '查询应用接口/元素错误信息' },
reducer: { name: '' }
});
}
@ -58,7 +58,7 @@ export function postApiConfirm (data) { //确认应用接口/元素错误信
data,
actionType: 'POST-API-CONFIRM',
url: `${ApiTable.postApiConfirm}`,
msg: { error: '添加确认信息失败' },
msg: { option: '添加确认信息' },
reducer: { name: '' }
});
}
@ -69,7 +69,7 @@ export function getAlarmDataGroup () { //获取数据告警分类
dispatch: dispatch,
actionType: 'GET_ALARM_DATA_GROUP',
url: `${ApiTable.getAlarmDataGroup}`,
msg: { error: '获取数据告警分类失败' },
msg: { option: '获取数据告警分类' },
reducer: { name: '' }
});
}
@ -82,7 +82,7 @@ export function getAlarmDataList (query) { //查询数据告警列表
query,
actionType: 'GET_ALARM_DATA_LIST',
url: `${ApiTable.getAlarmDataList}`,
msg: { error: '查询数据告警列表失败' },
msg: { option: '查询数据告警列表' },
reducer: { name: '' }
});
}
@ -94,7 +94,7 @@ export function getAlarmDataDetail (query) { //查询数据告警详情
query,
actionType: 'GET_ALARM_DATA_DATAIL',
url: `${ApiTable.getAlarmDataDetail}`,
msg: { error: '查询数据告警详情失败' },
msg: { option: '查询数据告警详情' },
reducer: { name: '' }
});
}
@ -106,7 +106,7 @@ export function getAlarmDataDetailAgg (query) { //查询数据告警详情聚
query,
actionType: 'GET_ALARM_DATA_DATAIL_AGG',
url: `${ApiTable.getAlarmDataDetailAgg}`,
msg: { error: '查询数据告警详情聚集数据失败' },
msg: { option: '查询数据告警详情聚集数据' },
reducer: { name: '' }
});
}
@ -118,7 +118,7 @@ export function putAlarmdataConfirm (data) { //确认数据告警
data,
actionType: 'PUT-AIARM-DATA-CONFIRM',
url: `${ApiTable.putAlarmdataConfirm}`,
msg: { error: '确认数据告警失败' },
msg: { option: '确认数据告警' },
reducer: { name: '' }
});
}
@ -130,7 +130,7 @@ export function getAlarmVideoList (query) { //查询视频告警列表
query,
actionType: 'GET_ALARM_VIDEO_LIST',
url: `${ApiTable.getAlarmVideoList}`,
msg: { error: '查询视频告警列表失败' },
msg: { option: '查询视频告警列表' },
reducer: { name: '' }
});
}
@ -143,7 +143,7 @@ export function getAlarmVideoDeviceKind () { //查询视频设备类型
dispatch: dispatch,
actionType: 'GET_ALARM_VIDEO_DEVICE_KIND',
url: `${ApiTable.getAlarmVideoDeviceKind}`,
msg: { error: '查询视频设备类型失败' },
msg: { option: '查询视频设备类型' },
reducer: { name: '' }
});
}

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

@ -91,13 +91,13 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
return (
<div style={{ width: '100%', backgroundColor: 'white', marginBottom: 20 }}>
<div style={{ width: 'clac(100%)', backgroundColor: 'white',margin:"8px 12px",padding:"20px 20px 0" }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginLeft: 10 }}>
<div style={{ width: 400, }}>
<span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 0px" }}></span>
<div style={{ width: 450, }}>
<span style={{ width: 0, height: 20, display:"inline-block",margin: "0 8px 0 0", borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></span>
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', marginRight: 10 }}>{statistic[route]}</span>
<span style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>APPLY SEMI-AUTOMATIC INSPECTION</span>
<div style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>仅保留48小时内的图片数据,每小时覆盖执行一次 <span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>未阅共{notRead}</span></div>
<div style={{ fontSize: 12, color: 'rgb(150, 151, 153)' }}>仅保留48小时内的图片数据每日8时1417时系统巡检一次<span style={{ fontWeight: 500, color: '#005ABD', fontSize: 12 }}>未阅共{notRead}</span></div>
</div>
<div style={{ flex: 1, position: 'relative' }}>
<Form
@ -224,10 +224,10 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
onClick={() => setUnfold(!unfold)}
style={{
width: 'calc(100% - 20px)', marginLeft: 10, height: 24,
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.38) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)',
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.09) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)',
borderRadius: 3,
lineHeight: '24px',
fontSize: 14,
fontSize: 12,
zIndex: 100,
position: 'relative',
top: unfold ? -20 : 6,
@ -235,7 +235,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
textAlign: 'center',
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799',
cursor: 'pointer',
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 20, height: 20, paddingTop: 8 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} />
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} />
</div>
{picturePop ? <Modal
title={<div style={{}}>{pictureData.app?.name}

16
web/client/src/sections/problem/components/sideSheet.jsx

@ -105,25 +105,31 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
rowKey: 'AlarmState',
render: (_, r, index) => {
let data = { 0: '首次产生', 1: '持续产生', 2: '等级提升', 3: '自动恢复', 4: '人工恢复' }
return data[r.AlarmState] || ''
return data[r.AlarmState] ? <div style={{ width: 60 }}>{data[r.AlarmState]}</div> : ''
},
}, {
title: "告警信息",
dataIndex: "Content",
rowKey: 'Content',
render: (_, r, index) => {
return !(r.AlarmState == 3) && !r.Content ? '由安心云集成侧确认,无确认信息' : r.AlarmState == 3 ? '无' : r.Content
},
}, {
title: "等级",
dataIndex: "CurrentLevel",
rowKey: 'CurrentLevel',
render: (_, r, index) => {
let data = { 1: '一级', 2: '二级', 3: '三级' }
return data[r.CurrentLevel] || ""
return <div style={{ width: 52 }}>
<img src={`/assets/images/problem/${'CurrentLevel' + r.CurrentLevel}.png`} style={{ display: "inline-block", width: 18, marginRight: 6 }} />
{data[r.CurrentLevel]}
</div>
},
}, {
title: "产生时间",
dataIndex: "Time",
rowKey: 'Time',
render: (_, r, index) => r.Time ? moment(r.Time).format("YYYY-MM-DD HH:mm:ss") : ""
render: (_, r, index) => r.Time ? <div style={{ width: 136 }}>{moment(r.Time).format("YYYY-MM-DD HH:mm:ss")}</div> : ""
},
]
@ -141,13 +147,13 @@ function SideSheets ({ dispatch, actions, close, alarmId }) {
>
<Tabs type="line">
<TabPane tab="告警信息" itemKey="1">
<div id='Alarm' style={{ position: 'relative', height: document.body.clientHeight - 126 }}>
<div id='Alarm' style={{ position: 'relative', height: document.body.clientHeight - 126, marginTop: 12 }}>
<Table
columns={columns}
dataSource={dataSource.slice((query.page - 1) * query.pageSize, query.page * query.pageSize)}
bordered={false}
empty="暂无数据"
style={{ padding: "0px 20px", }}
style={{}}
pagination={false}
onRow={(record, index) => {
if (index % 1 === 0) {

16
web/client/src/sections/problem/components/statistics.jsx

@ -3,15 +3,19 @@ import { connect } from "react-redux";
import { DatePicker } from "@douyinfe/semi-ui";
import Inspection from "./inspection";
const Statistics = ({ dispatch, actions, route ,statistic}) => {
const Statistics = ({ dispatch, actions, route, statistic }) => {
let title = { dataLnterrupt: "DATA ABORTS", dataAbnormal: "DATA ABORTS", strategyHit: "DATA ABORTS" }
// console.log(route);
return (
<>{route == 'useAbnormal' ?
<Inspection statistic={statistic} route={route} /> :
<div style={{ width: '100%', height: 234, backgroundColor: 'white', marginBottom: 20 }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div style={{ width: 190, fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', }}><span style={{ width: 3, height: 20, background: '#005ABD', display: 'inline-block', margin: "0 10px 0 10px" }}></span>{statistic[route]}</div>
<div style={{ width: 'clac(100% - 20px)', height: 260, backgroundColor: 'white', margin: '8px 12px', padding: '20px 20px 0' }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center',marginBottom:6 }}>
<div style={{ display: 'flex', alignItems: 'center' }}>
<span style={{ width: 0, height: 20, margin: "0 8px 0 0", borderLeft: '3px solid #005ABD', borderTop: '3px solid transparent', borderBottom: '3px solid transparent' }}></span>
<span style={{ fontSize: 24, fontFamily: 'YouSheBiaoTiHei', color: '#101531', }}>{statistic[route]}</span>
<span style={{ marginLeft: 6, fontSize: 12, color: "rgb(150, 151, 153)", fontFamily: 'DINExp' }}>{title[route]}</span>
</div>
{/* <DatePicker
type="dateTimeRange"
style={{ width: 405 }}
@ -34,7 +38,7 @@ const Statistics = ({ dispatch, actions, route ,statistic}) => {
暂未开放 敬请期待
</div> */}
<img src="/assets/images/problem/bitmap.png" style={{ width: 'calc(100% - 20px)', height: 196, margin: '0 0 0 10px' }} />
<img src="/assets/images/problem/bitmap.png" style={{ width: 'calc(100%)', height: 196, }} />
</div >
}</>

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

@ -9,10 +9,9 @@ import { emit } from "superagent";
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition,
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery }) => {
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery,tableData,setTableData }) => {
const { problem } = actions
const [tableData, setTableData] = useState([]) //
const [count, setCount] = useState(0) //
const [search, setSearch] = useState({}) //
const [checkAll, setCheckAll] = useState(true) //
@ -50,7 +49,30 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
case 'videoAbnormal':
dispatch(problem.getAlarmVideoList({})).then((res) => {
if (res.success) {
// console.log(res);
console.log(res);
let tableDatas = res.payload.data?.rows?.map(v => ({
key: v.AlarmId,
// StructureName: v.StructureName,
// projectName: v.pomsProject?.map(r => (r.name ? { name: r.name, state: 'PMOS' } : {
// name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus
// }))?.filter(c => c),
// createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "",
// updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "",
// confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "",
// SourceName: v.SourceName,
// 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,
// AlarmContent: v.AlarmContent,
// State: v.State,
// alarmType: v.alarmType,
// confirm: v.confirmedContent,
}))
console.log(tableDatas);
setTableData(tableDatas)
}
})
dispatch(problem.getAlarmVideoDeviceKind()).then((res) => {
@ -104,7 +126,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
alarmType: v.alarmType,
confirm: v.confirmedContent,
}))
console.log(tableDatas);
// console.log(tableDatas);
setTableData(tableDatas)
}
})
@ -117,13 +139,13 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}, [query, search])
// console.log(query);
// console.log(query);
return (
<>
<div style={{ backgroundColor: '#FFFFFF', paddingTop: 8 }}>
<div style={{ backgroundColor: '#FFFFFF', margin:"20px 12px 12px",padding:"20px 20px 40px"}}>
<div style={{}}>
<div style={{ display: "flex", marginBottom: 16, marginLeft: 20 }}>
<div style={{ display: "flex", marginBottom: 16,}}>
<Form
onSubmit={(values) => console.log(values)}
// onValueChange={values=>console.log(values)}
@ -235,7 +257,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
// dataSource={[{ key: '1' }]}
bordered={false}
empty="暂无数据"
style={{ padding: "0px 20px", }}
style={{ }}
pagination={false}
onRow={(record, index) => {
if (index % 1 === 0) {

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

@ -10,6 +10,7 @@ import moment from "moment";
import '../style.less'
import { request } from 'screenfull';
import { useRef } from 'react';
const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length)
@ -30,6 +31,11 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
const [checkPop, setCheckPop] = useState(false) //
const [alarmId, setAlarmId] = useState(false) //alarmId
const [query, setQuery] = useState({ limit: 10, page: 0 }) //
const [tableData, setTableData] = useState([]) //
const TextAreaApi = useRef('')
const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' }
const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' }
@ -133,16 +139,16 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '离线', value: '11' }]
}],
common: {
name: '持续时间',
name: '告警时间',
field: 'time'
}
}
//
const tableList = {
dataLnterrupt: ['index', 'projectName', 'StructureName', 'SourceName', 'AlarmGroupUnit', 'AlarmCodeName', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime',],
dataAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'type', 'alarmType', 'createTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', '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'],
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', 'createTime', 'sustainTime', 'AlarmContent', 'CurrentLevel', 'updateTime', 'detailCount', 'confirm', 'confirmTime'],
videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', '20', '21', '22', 'AlarmContent', '111', 'createTime', 'updateTime', 'confirm', 'confirmTime', '56115'],
useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', '19', 'alarmContent', '21', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
@ -171,7 +177,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
name: '项目名称', sort: 3, value: 'projectName', render: (_, r, index) => {
return <>
{r.projectName?.map((v, index) => {
return v.name ? <div key={r.id + r.appName + index} style={{ width: 176, }}>
return v.name ? <div key={r.id + r.appName + index} style={{ width: 176, height: 18, }}>
{OutHidden({
number: 7,
name: v.name
@ -199,7 +205,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
}
if (route == 'strategyHit') data = '测点'
return <div style={{ width: 136, display: 'flex', justifyContent: 'space-between' }}>
<div style={{ display: "inline-block", width: 84, }}>{r.SourceName}</div>
<div style={{ display: "inline-block", width: 84, lineHeight: "20px" }}>{r.SourceName}</div>
<div style={{ display: "inline-block", width: 44, height: 18, lineHeight: '18px', textAlign: "center", border: '1px solid #0F7EFB', fontWeight: 400, color: '#0F7EFB', fontSize: 12 }}>{data}</div>
</div>
}
@ -213,12 +219,23 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{
name: '告警等级', sort: 13, value: 'CurrentLevel', render: (_, r, index) => {
let data = { 1: '一级', 2: '二级', 3: '三级' }
return data[r.CurrentLevel]
return <div style={{ width: 52 }}>
<img src={`/assets/images/problem/${'CurrentLevel' + r.CurrentLevel}.png`} style={{ display: "inline-block", width: 18, marginRight: 6 }} />
{data[r.CurrentLevel]}
</div>
}
},
{ name: '产生次数', sort: 19, value: 'detailCount', render: (_, r, index) => r.detailCount + '次' },
{ name: '确认信息', sort: 20, value: 'confirm', render: (_, r, index) => r.confirm },
{ name: '确认/恢复时间', sort: 21, value: 'confirmTime', },
{
name: '持续时间', sort: 19.5, value: 'sustainTime', render: (_, r, index) => {
console.log(r.updateTime);
let time = moment(r.updateTime).diff(moment(r.createTime), 'seconds')
// console.log(time);
return time < 60 ? '< 1分钟' : time > 3600 ? Math.floor(time / 3600) + '小时' + Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟' : Math.floor((time - Math.floor(time / 3600) * 3600) / 60) + '分钟'
}
},
{
name: '异常信息', sort: 14, value: 'alarmContent', render: (_, r, index) => {
return <>{r.alarmContent}
@ -247,17 +264,19 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '在离线', sort: 18, value: '56115' },
{
name: '操作', sort: 25, value: 'text', render: (_, r, index) => {
return <div style={{ width: 190 }}>
{r.State || r.State == 0 ? r.State >= 0 && r.State < 3 ? <Button theme='borderless' onClick={() => {
setConfirm(true)
// console.log(r)
setSelected([r.key])
}}>确认</Button> :
<Button theme='borderless' disabled>已确认</Button> : ""
return <div style={{ width: 195 }}>
{r.State || r.State == 0 ? r.State >= 0 && r.State < 3 ?
<Button theme='borderless' style={{ width: 65 }} onClick={() => {
setConfirm(true)
setSelected([r.key])
}}>确认</Button>
: r.State == 3 ?
<Button theme='borderless' style={{ width: 65 }} disabled>自动恢复</Button> :
<Button theme='borderless' style={{ width: 65 }} disabled>已确</Button> : ""
}
{route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <>
<Button theme='borderless' disabled>已派单</Button>
<Button theme='borderless' onClick={() => {
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button>
<Button theme='borderless' style={{ width: 65 }} onClick={() => {
setCheckPop(true)
setAlarmId(r.key)
}}>查看</Button>
@ -344,6 +363,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
setGenre={setGenre}
query={query}
setQuery={setQuery}
tableData={tableData}
setTableData={setTableData}
/>
{setup ? (
<Setup
@ -377,6 +398,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
width={600}
onCancel={() => setConfirm(false)}
onOk={() => {
if (route == 'useAbnormal') {
dispatch(problem.postApiConfirm({ appAlarmId: selected, confirm: content })).then(res => {
if (res.success) {
@ -388,19 +410,40 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
} else if (route == 'videoAbnormal') {
setConfirm(false)
} else {
console.log(selected);
dispatch(problem.putAlarmdataConfirm({ alarmId: selected, content: content })).then(res => {
if (res.success) {
setConfirm(false)
setQuery({ limit: query.limit, page: query.page })
}
TextAreaApi.current.validate().then((v) => {
// console.log(selected);
// dispatch(problem.putAlarmdataConfirm({ alarmId: selected, content: content })).then(res => {
// if (res.success) {
// setConfirm(false)
let data = tableData?.map(v => {
if (selected.find(vv => vv == v.key)) {
return { ...v, confirm: '告警确认:' + content, confirmTime: moment().format("YYYY-MM-DD HH:mm:ss"), State: 4 }
} else {
return { ...v }
}
}) || tableData
setTableData(data)
setConfirm(false)
// console.log(data)
// setQuery({ limit: query.limit, page: query.page })
// }
// })
})
}
}}
>
<div style={{ display: 'flex', paddingLeft: 20 }}>
<span style={{ display: 'inline-block', width: 78 }}>确认信息:</span>
<TextArea maxCount={500} showClear onChange={(e) => setContent(e)} />
<div style={{ paddingLeft: 20 }}>
<Form
// onSubmit={(values) => console.log(values)}
getFormApi={(formApi) => (TextAreaApi.current = formApi)}
>
<Form.TextArea maxCount={500} showClear
label='确认信息'
labelPosition="left"
rules={[{ required: true, message: "请输入确认信息" }]}
field='textData'
onChange={(e) => setContent(e)} />
</Form>
</div>
</Modal> : ""}

Loading…
Cancel
Save