diff --git a/web/client/assets/images/problem/export.png b/web/client/assets/images/problem/export.png
index 2227ba8..db58c91 100644
Binary files a/web/client/assets/images/problem/export.png and b/web/client/assets/images/problem/export.png differ
diff --git a/web/client/assets/images/problem/setup.png b/web/client/assets/images/problem/setup.png
index 58aa294..ebbf5de 100644
Binary files a/web/client/assets/images/problem/setup.png and b/web/client/assets/images/problem/setup.png differ
diff --git a/web/client/src/sections/problem/actions/problem.jsx b/web/client/src/sections/problem/actions/problem.jsx
index bcd32ae..5789fe3 100644
--- a/web/client/src/sections/problem/actions/problem.jsx
+++ b/web/client/src/sections/problem/actions/problem.jsx
@@ -118,7 +118,7 @@ export function putAlarmdataConfirm (data) { //确认数据告警
data,
actionType: 'PUT-AIARM-DATA-CONFIRM',
url: `${ApiTable.putAlarmdataConfirm}`,
- msg: { error: '确认数据告警' },
+ msg: { error: '确认数据告警失败' },
reducer: { name: '' }
});
}
\ No newline at end of file
diff --git a/web/client/src/sections/problem/components/tableData.jsx b/web/client/src/sections/problem/components/tableData.jsx
index 788cde4..2614775 100644
--- a/web/client/src/sections/problem/components/tableData.jsx
+++ b/web/client/src/sections/problem/components/tableData.jsx
@@ -29,7 +29,8 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
let tableDatas = res.payload.data?.rows.map(v => ({
key: v.id,
// serialNumber: v.serialNumber,
- projectName: v.app?.projectCorrelations?.map(r => (r.name?{ name: r.name, state: '自定义' }:{ name: r.pepProject?.project_name, state: r.pepProject?.construction_status
+ projectName: v.app?.projectCorrelations?.map(r => (r.name ? { name: r.name, state: '自定义' } : {
+ name: r.pepProject?.project_name, state: r.pepProject?.construction_status
}))?.filter(c => c),
appName: v.app?.name,
url: v.app?.url,
@@ -58,14 +59,14 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
if (route == 'dataAbnormal') data = res.payload.data?.filter(v => v.desc == '数据异常')
if (route == 'strategyHit') data = res.payload.data?.filter(v => v.desc == '策略命中')
if (route == 'deviceAbnormal') data = res.payload.data?.filter(v => v.desc == '掉线' || v.desc == '不活跃')
- console.log(data);
+ // console.log(data);
let genreData = []
data?.map(v => {
v?.unit?.map(vv => {
- genreData.push({ name: vv.name, id: vv.id })
+ 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) => {
@@ -75,14 +76,16 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
let tableDatas = res.payload.data?.rows?.map(v => ({
key: v.AlarmId,
StructureName: v.StructureName,
- projectName: [],
+ projectName: v.pomsProject?.map(r => (r.name ? { name: r.name, state: '自定义' } : {
+ 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.id == v.AlarmGroupUnit)?.name : "",
- Strategy: v.AlarmGroupUnit ? genreData.find(r => r.id == v.AlarmGroupUnit)?.name : "",
- type: v.AlarmGroupUnit ? genreData.find(r => r.id == v.AlarmGroupUnit)?.name : "",
+ 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,
@@ -122,7 +125,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
let frame = []
collectData[route]?.map((v, index) => {
if (index == 0) {
- frame.push(
+ frame.push(
{[{ name: "告警源", value: "source" }, { name: "项目", value: "pepProject" }, { name: "结构物", value: "struc" },].map(vv => {
return {vv.name}
@@ -136,7 +139,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
labelPosition="left"
field={v.field}
key={v.field}
- style={{ width: 116, marginRight: 10, color: "#F9F9F9", }}
+ style={{ width: 116, marginRight: 16, color: "#F9F9F9", }}
placeholder="全部"
filter
showClear
@@ -171,7 +174,8 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
display: "flex",
justifyContent: "space-between",
alignItems: "flex-end",
- marginRight: 10
+ marginRight: 20,
+ marginBottom: 16
}}
>
@@ -191,15 +195,16 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
// sustainTimeStart: v.time ? moment(v.time[0]).format("YYYY-MM-DD HH:mm:ss") : "",
// sustainTimeEnd: v.time ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "",
// });
-
+ console.log(v.time);
setSearch({
state: v.state,
keywordTarget: v.keywordTarget,
keyword: v.keyword,
groupUnitId: v.groupUnitId,
- sustainTimeStart: v.time ? moment(v.time[0]).format("YYYY-MM-DD HH:mm:ss") : "",
- sustainTimeEnd: v.time ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "",
+ sustainTimeStart: v.time && v.time.length > 0 ? moment(v.time[0]).format("YYYY-MM-DD HH:mm:ss") : "",
+ sustainTimeEnd: v.time && v.time.length > 0 ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "",
});
+ setSelected([])
setQuery({ limit: 10, page: 0 })
});
}}
diff --git a/web/client/src/sections/problem/containers/dataAlarm.jsx b/web/client/src/sections/problem/containers/dataAlarm.jsx
index 32d001f..0252979 100644
--- a/web/client/src/sections/problem/containers/dataAlarm.jsx
+++ b/web/client/src/sections/problem/containers/dataAlarm.jsx
@@ -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
@@ -193,9 +193,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
>
}
},
- { 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 }) => {
}
},
- { 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 ? (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
+ {r.State || r.State == 0 ? r.State >= 0 && r.State < 3 ? :
+ : ""
+ }
+ {route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <>
+
+
+ >
+ : "" : ""
+ }
+
+ }
+ },
]
@@ -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
- {r.confirmTime ? :
-
- }
- {route ? ['dataLnterrupt', 'dataAbnormal', 'strategyHit'].includes(route) ? <>
-
-
- >
- : "" : ""
- }
-
- }
- })
// 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 (
{/* 滞留提醒 */}
@@ -396,6 +389,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)