|
|
@ -165,13 +165,13 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
//所有表格信息 |
|
|
|
const columnAll = [ |
|
|
|
{ |
|
|
|
name: "序号", value: "index", render: (_, r, index) => { |
|
|
|
name: "序号", sort: 1, value: "index", render: (_, r, index) => { |
|
|
|
return index + 1; |
|
|
|
}, |
|
|
|
}, |
|
|
|
{ name: '问题编号', value: 'serialNumber', render: (_, r, index) => r.serialNumber }, |
|
|
|
{ name: '问题编号', sort: 1, value: 'serialNumber', render: (_, r, index) => r.serialNumber }, |
|
|
|
{ |
|
|
|
name: '项目名称', value: 'projectName', render: (_, r, index) => { |
|
|
|
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, }}> |
|
|
@ -180,22 +180,22 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
name: v.name |
|
|
|
})} |
|
|
|
<div style={{ |
|
|
|
width: 58, height: 18, background: 'linear-gradient(rgb(235, 245, 255) 0%, rgb(235, 245, 255) 0%, rgb(211, 232, 255) 100%)', |
|
|
|
width: 58, height: 18, background: v.state == 'PMOS' ? 'linear-gradient(rgb(153, 199, 221) 0%, rgb(48, 72, 252) 100%)' : 'linear-gradient(rgb(235, 245, 255) 0%, rgb(235, 245, 255) 0%, rgb(211, 232, 255) 100%)', |
|
|
|
borderRadius: 2, display: "inline-block", marginLeft: 6 |
|
|
|
}}> |
|
|
|
<img src="/assets/images/install/icon_zhengque.png" style={{ display: "inline-block", width: 10 }} /> |
|
|
|
<span style={{ display: "inline-block", width: 48, fontSize: 12, textAlign: "center" }}>{v.state}</span> |
|
|
|
<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> |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
|
|
|
|
</> |
|
|
|
} |
|
|
|
}, |
|
|
|
{ name: '结构物名称', value: 'StructureName' }, |
|
|
|
{ name: '结构物名称', sort: 4, value: 'StructureName' }, |
|
|
|
{ |
|
|
|
name: '告警源', value: 'SourceName', render: (_, r, index) => { |
|
|
|
name: '告警源', sort: 2, value: 'SourceName', render: (_, r, index) => { |
|
|
|
let data = '' |
|
|
|
if (route == 'dataLnterrupt' || route == 'dataAbnormal') { |
|
|
|
data = '传感器' |
|
|
@ -207,47 +207,69 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
</div> |
|
|
|
} |
|
|
|
}, |
|
|
|
{ name: '中断类型', value: 'AlarmGroupUnit' }, |
|
|
|
{ name: '告警信息', value: 'AlarmContent' }, |
|
|
|
{ name: '常见原因', value: 'AlarmCodeName' }, |
|
|
|
{ name: '产生时间', value: 'createTime' }, |
|
|
|
{ name: '更新时间', value: 'updateTime' }, |
|
|
|
{ name: '服务器地址', value: '9' }, |
|
|
|
{ name: '中断类型', sort: 6, value: 'AlarmGroupUnit' }, |
|
|
|
{ name: '告警信息', sort: 5, value: 'AlarmContent' }, |
|
|
|
{ name: '常见原因', sort: 7, value: 'AlarmCodeName' }, |
|
|
|
{ name: '产生时间', sort: 22, value: 'createTime' }, |
|
|
|
{ name: '更新时间', sort: 23, value: 'updateTime' }, |
|
|
|
{ name: '服务器地址', sort: 12, value: '9' }, |
|
|
|
{ |
|
|
|
name: '告警等级', value: 'CurrentLevel', render: (_, r, index) => { |
|
|
|
name: '告警等级', sort: 13, value: 'CurrentLevel', render: (_, r, index) => { |
|
|
|
let data = { 1: '一级', 2: '二级', 3: '三级' } |
|
|
|
return data[r.CurrentLevel] |
|
|
|
} |
|
|
|
}, |
|
|
|
{ name: '产生次数', value: 'detailCount', render: (_, r, index) => r.detailCount + '次' }, |
|
|
|
{ name: '确认信息', value: 'confirm', render: (_, r, index) => r.confirm }, |
|
|
|
{ name: '确认/恢复时间', value: 'confirmTime', }, |
|
|
|
{ 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: '异常信息', value: 'alarmContent', render: (_, r, index) => { |
|
|
|
name: '异常信息', sort: 14, value: 'alarmContent', render: (_, r, index) => { |
|
|
|
return <>{r.alarmContent} |
|
|
|
{r.screenshot ? <img src="/assets/images/problem/anomaly.png" style={{ display: 'inline-block', width: 12 }} onClick={() => (setAnomaly(r.screenshot), setPictures(true))} /> : ""} |
|
|
|
</> |
|
|
|
} |
|
|
|
}, |
|
|
|
{ name: '异常原因', value: 'alarmType' }, |
|
|
|
{ name: '策略类型', value: 'Strategy' }, |
|
|
|
{ name: '异常原因', sort: 8, value: 'alarmType' }, |
|
|
|
{ name: '策略类型', sort: 6, value: 'Strategy' }, |
|
|
|
{ |
|
|
|
name: '命中状态', value: 'State', render: (_, r, index) => { |
|
|
|
name: '命中状态', sort: 15, value: 'State', render: (_, r, index) => { |
|
|
|
if (r.State == 3 || r.State == 4) { |
|
|
|
return '历史' |
|
|
|
} |
|
|
|
return '当前' |
|
|
|
} |
|
|
|
}, |
|
|
|
{ name: '位置信息', value: '19' }, |
|
|
|
{ name: '设备类型', value: '20' }, |
|
|
|
{ name: '设备厂家', value: '21' }, |
|
|
|
{ name: '接入方式', value: '22' }, |
|
|
|
{ name: '应用名称', value: 'appName' }, |
|
|
|
{ name: 'URL地址', value: 'url' }, |
|
|
|
{ name: '异常类型', value: 'type' }, |
|
|
|
{ name: '解决方案', value: '111' }, |
|
|
|
{ name: '在离线', value: '56115' }, |
|
|
|
{ name: '位置信息', sort: 11, value: '19' }, |
|
|
|
{ name: '设备类型', sort: 6, value: '20' }, |
|
|
|
{ name: '设备厂家', sort: 10, value: '21' }, |
|
|
|
{ name: '接入方式', sort: 9, value: '22' }, |
|
|
|
{ name: '应用名称', sort: 2, value: 'appName' }, |
|
|
|
{ name: 'URL地址', sort: 16, value: 'url' }, |
|
|
|
{ name: '异常类型', sort: 6, value: 'type' }, |
|
|
|
{ name: '解决方案', sort: 17, value: '111' }, |
|
|
|
{ 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> : "" |
|
|
|
} |
|
|
|
{route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <> |
|
|
|
<Button theme='borderless' disabled>已派单</Button> |
|
|
|
<Button theme='borderless' onClick={() => { |
|
|
|
setCheckPop(true) |
|
|
|
setAlarmId(r.key) |
|
|
|
}}>查看</Button> |
|
|
|
</> |
|
|
|
: "" : "" |
|
|
|
} |
|
|
|
</div> |
|
|
|
} |
|
|
|
}, |
|
|
|
] |
|
|
|
|
|
|
|
|
|
|
@ -265,7 +287,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
// data = ['AlarmCodeName'] |
|
|
|
// data.splice(1, 0, ...arr) |
|
|
|
// } else { |
|
|
|
data.splice(1, 0, ...arr) |
|
|
|
data.splice(1, 0, ...arr, 'text') |
|
|
|
// } |
|
|
|
|
|
|
|
|
|
|
@ -275,33 +297,12 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
let TableDisplay = data?.map(v => { |
|
|
|
let datas = columnAll?.find(vv => v == vv.value) |
|
|
|
if (datas) { |
|
|
|
return { title: datas.name, dataIndex: datas.value, rowKey: datas.value, render: datas.render } |
|
|
|
return { title: datas.name, sort: datas.sort, dataIndex: datas.value, rowKey: datas.value, render: datas.render } |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
// console.log(TableDisplay); |
|
|
|
TableDisplay.sort((a, b) => a.sort - b.sort) |
|
|
|
|
|
|
|
TableDisplay.push({ |
|
|
|
title: '操作', |
|
|
|
dataIndex: 'text', |
|
|
|
rowKey: 'text', |
|
|
|
render: (_, r) => { |
|
|
|
return <div style={{ width: 190 }}> |
|
|
|
{r.confirmTime ? <Button theme='borderless' disabled>已确认</Button> : |
|
|
|
<Button theme='borderless' onClick={() => (setConfirm(true), setSelected([r.id]))}>确认</Button> |
|
|
|
} |
|
|
|
{route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <> |
|
|
|
<Button theme='borderless' disabled>已派单</Button> |
|
|
|
<Button theme='borderless' onClick={() => { |
|
|
|
setCheckPop(true) |
|
|
|
setAlarmId(r.key) |
|
|
|
}}>查看</Button> |
|
|
|
</> |
|
|
|
: "" : "" |
|
|
|
} |
|
|
|
</div> |
|
|
|
} |
|
|
|
}) |
|
|
|
// console.log(TableDisplay); |
|
|
|
// console.log(setup); |
|
|
|
setExhibition(TableDisplay) |
|
|
@ -319,18 +320,10 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(selected); |
|
|
|
|
|
|
|
|
|
|
|
const distinguish = (route) => { |
|
|
|
switch (route) { |
|
|
|
case value: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
return ( |
|
|
|
<div style={{ minWidth: 1000 }}> |
|
|
|
{/* 滞留提醒 */} |
|
|
@ -352,6 +345,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
selected={selected} |
|
|
|
setSelected={setSelected} |
|
|
|
setGenre={setGenre} |
|
|
|
query={query} |
|
|
|
setQuery={setQuery} |
|
|
|
/> |
|
|
|
{setup ? ( |
|
|
|
<Setup |
|
|
@ -396,6 +391,7 @@ 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) |
|
|
@ -406,7 +402,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => { |
|
|
|
}} |
|
|
|
> |
|
|
|
<div style={{ display: 'flex', paddingLeft: 20 }}> |
|
|
|
<span style={{ display: 'inline-block', width: 78 }}>确认信息:</span> |
|
|
|
<span style={{ display: 'inline-block', width: 78 }}>确认信息:</span> |
|
|
|
<TextArea maxCount={500} showClear onChange={(e) => setContent(e)} /> |
|
|
|
</div> |
|
|
|
</Modal> : ""} |
|
|
|