wenlele 2 years ago
parent
commit
a60a819961
  1. 2
      web/client/src/sections/install/nav-item.jsx
  2. 66
      web/client/src/sections/problem/components/tableData.jsx
  3. 26
      web/client/src/sections/problem/containers/dataAlarm.jsx

2
web/client/src/sections/install/nav-item.jsx

@ -29,7 +29,7 @@ export function getNavItem (user, dispatch) {
itemKey: 'order ',
text: '工单管理',
icon: <iconpark-icon style={{ width: 20, height: 20 }} name="iconjianshezhong"></iconpark-icon>,
to: '/install/order /setup',
to: '/install/order/setup',
items: [{
itemKey: 'setup', to: '/install/order/setup', text: '工单设置'
}]

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

@ -6,7 +6,8 @@ import moment from "moment";
const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition, selected, setSelected, setIfBulk, setConfirm }) => {
const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition,
selected, setSelected, setIfBulk, setConfirm, setGenre }) => {
const { problem } = actions
const [tableData, setTableData] = useState([]) //
@ -37,34 +38,58 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
}
})
break;
case 'videoAbnormal':
break;
default:
dispatch(problem.getAlarmDataGroup()).then((res) => {
if (res.success) {
console.log(res.payload.data);
// console.log(res.payload.data);
let routeData = { dataLnterrupt: '数据中断', dataAbnormal: '数据异常', strategyHit: '策略命中', deviceAbnormal: '' }
let data
if (route == 'dataLnterrupt') data = res.payload.data?.filter(v => v.desc == '数据中断')
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);
let genreData = []
data?.map(v => {
v?.unit?.map(vv => {
genreData.push({ name: vv.name, value: vv.id })
})
})
console.log(genreData);
setGenre(genreData)
if (data || data[0]?.id) {
dispatch(problem.getAlarmDataList({})).then((res) => {
console.log(res);
})
}
}
}
// let tableDatas = res.payload.data?.rows.map(v => ({
// key: v.id,
// serialNumber: v.serialNumber,
// projectName: v.app?.projectCorrelations?.map(r => r.name)?.filter(c => c),
// appName: v.app?.name,
// url: v.app?.url,
// createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:MM:SS") : "",
// updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:MM:SS") : "",
// confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:MM:SS") : "",
// alarmContent: v.alarmContent,
// screenshot: v.screenshot,
// type: v.type,
// confirm: v.confirm,
// }))
// console.log(tableDatas);
// setTableData(tableDatas)
})
// let tableDatas = res.payload.data?.rows.map(v => ({
// key: v.id,
// serialNumber: v.serialNumber,
// projectName: v.app?.projectCorrelations?.map(r => r.name)?.filter(c => c),
// appName: v.app?.name,
// url: v.app?.url,
// createTime: v.createTime ? moment(v.createTime).format("YYYY-MM-DD HH:MM:SS") : "",
// updateTime: v.updateTime ? moment(v.updateTime).format("YYYY-MM-DD HH:MM:SS") : "",
// confirmTime: v.confirmTime ? moment(v.confirmTime).format("YYYY-MM-DD HH:MM:SS") : "",
// alarmContent: v.alarmContent,
// screenshot: v.screenshot,
// type: v.type,
// confirm: v.confirm,
// }))
// console.log(tableDatas);
// setTableData(tableDatas)
break;
}
@ -105,6 +130,7 @@ const TableData = ({ dispatch, actions, route, collectData, setSetup, exhibition
key={v.field}
style={{ width: 116, marginRight: 10, color: "#F9F9F9", }}
placeholder="全部"
filter
showClear
>
{v.data?.map((item) => {

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

@ -24,6 +24,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
const [ifBulk, setIfBulk] = useState(false); //
const [content, setContent] = useState(false); //
const [selected, setSelected] = useState([]) //
const [genre, setGenre] = useState([]) //
const tableType = { dataLnterrupt: 'dataLnterrupt', dataAbnormal: 'dataAbnormal', strategyHit: 'strategyHit', videoAbnormal: 'videoAbnormal', useAbnormal: 'useAbnormal', deviceAbnormal: 'deviceAbnormal' }
const statistic = { dataLnterrupt: '数据中断统计', dataAbnormal: '数据异常统计', strategyHit: '策略命中统计', videoAbnormal: '视频异常统计', useAbnormal: '应用异常统计', deviceAbnormal: '设备异常统计' }
@ -62,10 +63,7 @@ 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',
@ -77,9 +75,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' },
{
name: '异常类型', field: '2',
data: [
{ name: '超远程', value: '11' },
{ name: '超限幅', value: '22' }]
data: genre
},
{
name: '异常状态', field: '3',
@ -91,11 +87,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' },
{
name: '策略类型', field: '2',
data: [
{ name: '超阀值', value: '11' },
{ name: '防驶入告警', value: '22' },
{ name: '设备关闭', value: '33' },
{ name: '超围栏', value: '44' }]
data:genre
},
{
name: '命中状态', field: '3',
@ -137,10 +129,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
{ name: '搜索', field: '1' },
{
name: '设备类型', field: '2',
data: [
{ name: '传感器', value: '11' },
{ name: 'DTU', value: '22' },
{ name: '服务器', value: '33' }]
data: genre
},
{
name: '异常状态', field: '3',
@ -279,7 +268,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
}
})
TableDisplay.push({
title: '操作',
dataIndex: 'text',
@ -292,7 +281,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
</>
}
})
console.log(TableDisplay);
// console.log(TableDisplay);
// console.log(setup);
setExhibition(TableDisplay)
setTableSetup([{ list: setup }])
@ -341,6 +330,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket }) => {
setIfBulk={setIfBulk}
selected={selected}
setSelected={setSelected}
setGenre={setGenre}
/>
{setup ? (
<Setup

Loading…
Cancel
Save