巴林闲侠 2 years ago
parent
commit
834bea191c
  1. 20
      api/app/lib/controllers/alarm/app.js
  2. 8
      api/app/lib/controllers/control/toolLink.js
  3. 2
      api/app/lib/schedule/alarms_handle_statistics.js
  4. 18
      web/client/src/sections/control/containers/control.jsx
  5. 211
      web/client/src/sections/problem/components/tableData.jsx
  6. 27
      web/client/src/sections/problem/containers/dataAlarm.jsx
  7. 1
      web/package.json

20
api/app/lib/controllers/alarm/app.js

@ -2,7 +2,7 @@
const moment = require('moment') const moment = require('moment')
const { alarmConfirmLog } = require('./alarmConfirmLog'); const { alarmConfirmLog } = require('./alarmConfirmLog');
async function inspection(ctx) { async function inspection (ctx) {
// 巡查 // 巡查
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -31,7 +31,7 @@ async function inspection(ctx) {
} }
} }
async function inspectionList(ctx) { async function inspectionList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
@ -116,7 +116,7 @@ async function inspectionList(ctx) {
} }
} }
async function notedInspection(ctx) { async function notedInspection (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { inspectionId } = ctx.request.body const { inspectionId } = ctx.request.body
@ -141,7 +141,7 @@ async function notedInspection(ctx) {
} }
} }
async function apiError(ctx) { async function apiError (ctx) {
try { try {
const { utils: { sendAppearToWeb } } = ctx.app.fs const { utils: { sendAppearToWeb } } = ctx.app.fs
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
@ -253,12 +253,12 @@ async function apiError(ctx) {
} }
} }
async function apiErrorList(ctx) { async function apiErrorList (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { clickHouse } = ctx.app.fs const { clickHouse } = ctx.app.fs
const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs
const { keyword, errType, confirmState, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query const { keyword, errType, confirmState, state, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query
let pomsProject = await pomsProjectRange({ let pomsProject = await pomsProjectRange({
ctx, pepProjectId, ctx, pepProjectId,
@ -311,10 +311,10 @@ async function apiErrorList(ctx) {
if (errType) { if (errType) {
findOption.where.type = errType // element / apiError findOption.where.type = errType // element / apiError
} }
if (confirmState) { if (confirmState || state) {
if (confirmState == 'confirmd') { if (confirmState == 'confirmd' || state == 'histroy') {
findOption.where.confirmTime = { $ne: null } findOption.where.confirmTime = { $ne: null }
} else if (confirmState == 'unconfirmed') { } else if (confirmState == 'unconfirmed' || state == 'new') {
findOption.where.confirmTime = null findOption.where.confirmTime = null
} }
} }
@ -365,7 +365,7 @@ async function apiErrorList(ctx) {
} }
} }
async function confirmApiError(ctx) { async function confirmApiError (ctx) {
try { try {
const models = ctx.fs.dc.models; const models = ctx.fs.dc.models;
const { confirm, appAlarmId = [], confirmPost } = ctx.request.body const { confirm, appAlarmId = [], confirmPost } = ctx.request.body

8
api/app/lib/controllers/control/toolLink.js

@ -164,8 +164,6 @@ async function count (ctx) {
alarms.StructureId IN (${anxinStrucIds.join(",")}) alarms.StructureId IN (${anxinStrucIds.join(",")})
AND AND
StartTime BETWEEN '${moment().startOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND '${moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')}' StartTime BETWEEN '${moment().startOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND '${moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')}'
AND
State < 3
GROUP BY AlarmGroup GROUP BY AlarmGroup
`).toPromise() `).toPromise()
//今日新增数据告警 //今日新增数据告警
@ -228,7 +226,7 @@ async function count (ctx) {
let dataAfter = new moment(); //验证后时间 let dataAfter = new moment(); //验证后时间
let dataduration = moment.duration(dataAfter.diff(dataFront))._data.milliseconds let dataduration = moment.duration(dataAfter.diff(dataFront))._data.milliseconds
console.log('数据',dataduration); console.log('数据', dataduration);
let yingyongFront = new moment(); //验证前时间 let yingyongFront = new moment(); //验证前时间
@ -250,7 +248,7 @@ async function count (ctx) {
let yingyongAfter = new moment(); //验证后时间 let yingyongAfter = new moment(); //验证后时间
let yingyongduration = moment.duration(yingyongAfter.diff(yingyongFront))._data.milliseconds let yingyongduration = moment.duration(yingyongAfter.diff(yingyongFront))._data.milliseconds
console.log('应用',yingyongduration); console.log('应用', yingyongduration);
let videoFront = new moment(); //验证前时间 let videoFront = new moment(); //验证前时间
@ -364,7 +362,7 @@ async function count (ctx) {
let videoAfter = new moment(); //验证后时间 let videoAfter = new moment(); //验证后时间
let videoduration = moment.duration(videoAfter.diff(videoFront))._data.milliseconds let videoduration = moment.duration(videoAfter.diff(videoFront))._data.milliseconds
console.log('视频',videoduration); console.log('视频', videoduration);
let findOptions = { let findOptions = {

2
api/app/lib/schedule/alarms_handle_statistics.js

@ -7,7 +7,7 @@ module.exports = function (app, opts) {
const { database: anxinyun } = clickHouse.anxinyun.opts.config const { database: anxinyun } = clickHouse.anxinyun.opts.config
const alarmHandleStatistics = app.fs.scheduleInit( const alarmHandleStatistics = app.fs.scheduleInit(
{ {
interval: '0 18 1 ? * 1',//每周一1点18触发 interval: '0 18 1 ? * 3',//每周一1点18触发
// immediate: true, // immediate: true,
proRun: true, proRun: true,
}, },

18
web/client/src/sections/control/containers/control.jsx

@ -23,8 +23,8 @@ let member
let web let web
const Control = (props) => { const Control = ({ dispatch, actions, user, history, loading, socket, pepProjectId }) => {
const { dispatch, actions, user, loading, socket, pepProjectId } = props
const { control, install } = actions const { control, install } = actions
const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])// const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//
@ -171,7 +171,7 @@ const Control = (props) => {
await dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => {
if (res.success) setAppBI(res.payload.data) if (res.success) setAppBI(res.payload.data)
}) })
await dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => { await dispatch(control.getAlarmsHandleStatistics({ projectCorrelationId: pepProjectId })).then(res => {
if (res.success) setEfficiencyBI(res.payload.data[0]) if (res.success) setEfficiencyBI(res.payload.data[0])
}) })
} }
@ -681,7 +681,7 @@ const Control = (props) => {
<div id='alarm' style={{ width: 'calc(100% - 200px)', position: 'relative', whiteSpace: 'nowrap', }}> <div id='alarm' style={{ width: 'calc(100% - 200px)', position: 'relative', whiteSpace: 'nowrap', }}>
{exhibition.current['workbench']?.map((item, index) => { {exhibition.current['workbench']?.map((item, index) => {
return ( return (
<div key={item.name} style={{ background: item.img, backgroundSize: "100% 100%", display: "inline-block", width: 270, height: 135, marginRight: 26 }}> pepProjectId && item.name == '关注的项目' ? '' : <div key={item.name} style={{ background: item.img, backgroundSize: "100% 100%", display: "inline-block", width: 270, height: 135, marginRight: 26 }}>
<div style={{ margin: '35px 0px 0px 134px' }}> <div style={{ margin: '35px 0px 0px 134px' }}>
<div> <div>
<span style={{ fontSize: 14, color: '#4A4A4A', fontWeight: 500, fontFamily: 'PingFangSC-Medium, PingFang SC' }}>{item.name}</span> <span style={{ fontSize: 14, color: '#4A4A4A', fontWeight: 500, fontFamily: 'PingFangSC-Medium, PingFang SC' }}>{item.name}</span>
@ -915,7 +915,13 @@ const Control = (props) => {
problemsList?.map((v, index) => { problemsList?.map((v, index) => {
return ( return (
<div style={{ marginBottom: 15, paddingRight: 30, }} key={'problems' + index} onClick={() => { <div style={{ marginBottom: 15, paddingRight: 30, }} key={'problems' + index} onClick={() => {
dispatch(push(v.url)) history.push({
pathname: v.url,
query: {
keywordTarget: v.groupName == '应用异常' ? "" : 'source',
keyword:v.SourceName,
}
})
}}> }}>
<div style={{ fontSize: 14, color: '#646566' }} > <div style={{ fontSize: 14, color: '#646566' }} >
{v.SourceName}{v.groupName}{v.groupName == '视频异常' ? "" : ',诊断为 '} <span style={{ color: '#0F7EFB', borderBottom: '1px dotted #0F7EFB', cursor: "pointer" }} >{v.typeName}请前往确认</span> {v.SourceName}{v.groupName}{v.groupName == '视频异常' ? "" : ',诊断为 '} <span style={{ color: '#0F7EFB', borderBottom: '1px dotted #0F7EFB', cursor: "pointer" }} >{v.typeName}请前往确认</span>
@ -1059,7 +1065,7 @@ const Control = (props) => {
text: v.name, text: v.name,
}, },
grid: { grid: {
left: '5%', left: '10%',
// right: '4%', // right: '4%',
// bottom: '3%', // bottom: '3%',
// containLabel: true // containLabel: true

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

@ -5,23 +5,29 @@ import { SkeletonScreen, } from "$components";
import moment from "moment"; import moment from "moment";
import { validate } from "schema-utils"; import { validate } from "schema-utils";
import { emit } from "superagent"; import { emit } from "superagent";
import qs from "qs";
const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, pepProjectId, const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition, pepProjectId,
selected, setSelected, setIfBulk, setConfirm, setGenre, query, setQuery, tableData, setTableData }) => { selected, setSelected, setIfBulk, setConfirm, genre, setGenre, query, setQuery, tableData, setTableData, location }) => {
const { problem } = actions const { problem } = actions
const [count, setCount] = useState(0) // const [count, setCount] = useState(0) //
const [search, setSearch] = useState({}) //
const [checkAll, setCheckAll] = useState(true) // const [checkAll, setCheckAll] = useState(true) //
const api = useRef(); const api = useRef();
const search = useRef({
state: '', keywordTarget: '', keyword: '', kindId: '', groupUnitId: '',
errType: '', confirmState: '', onlineState: '', sustainTimeStart: '', sustainTimeEnd: ''
})
const kindName = useRef()
const groupId = useRef()
let title = { dataLnterrupt: "数据中断详情", dataAbnormal: "数据异常详情", strategyHit: "策略命中详情", videoAbnormal: "视频异常详情", useAbnormal: "应用异常详情", deviceAbnormal: "设备异常详情" } let title = { dataLnterrupt: "数据中断详情", dataAbnormal: "数据异常详情", strategyHit: "策略命中详情", videoAbnormal: "视频异常详情", useAbnormal: "应用异常详情", deviceAbnormal: "设备异常详情" }
useEffect(() => { useEffect(() => {
switch (route) { switch (route) {
case 'useAbnormal': case 'useAbnormal':
dispatch(problem.getAlarmLnspectionApi({ ...search, pepProjectId: pepProjectId })).then((res) => { dispatch(problem.getAlarmLnspectionApi({ ...search.current, pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" } let typeData = { element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" }
let tableDatas = res.payload.data?.rows.map(v => ({ let tableDatas = res.payload.data?.rows.map(v => ({
@ -46,15 +52,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}) })
break; break;
case 'videoAbnormal': case 'videoAbnormal':
let cameraKind = [] dispatch(problem.getAlarmVideoList({ ...search.current, pepProjectId: pepProjectId })).then((res) => {
dispatch(problem.getAlarmVideoDeviceKind()).then((res) => {
if (res.success) {
cameraKind = res.payload.data.map(v => ({ name: v.kind, value: v.id }))
setGenre(res.payload.data.map(v => ({ name: v.kind, value: v.id })))
}
})
dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: pepProjectId })).then((res) => {
if (res.success) { if (res.success) {
let tableDatas = res.payload.data?.map(v => ({ let tableDatas = res.payload.data?.map(v => ({
key: v.alarmId, key: v.alarmId,
@ -72,7 +70,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
resolve: v.resolve || [], resolve: v.resolve || [],
cameraChannelNo: v.cameraChannelNo, cameraChannelNo: v.cameraChannelNo,
cameraSerialNo: v.cameraSerialNo, cameraSerialNo: v.cameraSerialNo,
cameraKindId: v.cameraKindId ? cameraKind?.find(u => u.value == v.cameraKindId)?.name : "", cameraKindId: v.cameraKindId ? kindName.current?.find(u => u.value == v.cameraKindId)?.name : "",
venderName: v.venderName, venderName: v.venderName,
platform: v.platform, platform: v.platform,
confirm: v.confirmContent, confirm: v.confirmContent,
@ -85,61 +83,80 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}) })
break; break;
default: default:
dispatch(problem.getAlarmDataGroup()).then((res) => { if (genre?.length > 0) {
if (res.success) { dispatch(problem.getAlarmDataList({ ...query, ...search.current, groupId: groupId.current.map(v => v.id).join(), pepProjectId: pepProjectId })).then((res) => {
let data if (res.success) {
if (route == 'dataLnterrupt') data = res.payload.data?.filter(v => v.desc == '数据中断') setCount(res.payload.data?.count || 0)
if (route == 'dataAbnormal') data = res.payload.data?.filter(v => v.desc == '数据异常') let tableDatas = res.payload.data?.rows?.map(v => ({
if (route == 'strategyHit') data = res.payload.data?.filter(v => v.desc == '策略命中') key: v.AlarmId,
if (route == 'deviceAbnormal') data = res.payload.data?.filter(v => v.desc == '掉线' || v.desc == '不活跃') StructureName: v.StructureName,
let genreData = [] projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : {
data?.map(v => { id: r.id, name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus
v?.unit?.map(vv => { }))?.filter(c => c),
genreData.push({ name: vv.name, value: vv.id }) 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") : "",
setGenre(genreData) SourceName: v.SourceName,
if (data && data[0]?.id) { AlarmGroupUnit: v.AlarmGroupUnit ? genre?.find(r => r.value == v.AlarmGroupUnit)?.name : "无",
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: pepProjectId })).then((res) => { Strategy: v.AlarmGroupUnit ? genre?.find(r => r.value == v.AlarmGroupUnit)?.name : "",
if (res.success) { type: route == 'deviceAbnormal' ? v.DeviceStatus == 0 ? "离线" : '' : v.AlarmGroupUnit ? genre?.find(r => r.value == v.AlarmGroupUnit)?.name : "",
setCount(res.payload.data?.count || 0) cameraKindId: v.AlarmGroupUnit ? genre?.find(r => r.value == v.AlarmGroupUnit)?.name : "",
let tableDatas = res.payload.data?.rows?.map(v => ({ AlarmCodeName: v.AlarmCodeName,
key: v.AlarmId, CurrentLevel: v.CurrentLevel,
StructureName: v.StructureName, detailCount: v.detailCount,
projectName: v.pomsProject?.map(r => (r.name ? { id: r.id, name: r.name, state: 'PMOS' } : { AlarmContent: v.AlarmContent,
id: r.id, name: r.pepProject?.projectName, state: r.pepProject?.constructionStatus State: v.State,
}))?.filter(c => c), alarmType: v.alarmType,
createTime: v.StartTime ? moment(v.StartTime).format("YYYY-MM-DD HH:mm:ss") : "", confirm: v.confirmedContent,
updateTime: v.EndTime ? moment(v.EndTime).format("YYYY-MM-DD HH:mm:ss") : "", station: v.StructureLongitude && v.StructureLatitude ? v.StructureLongitude + '. ' + v.StructureLatitude : "",
confirmTime: v.confirmedTime ? moment(v.confirmedTime).format("YYYY-MM-DD HH:mm:ss") : "", }))
SourceName: v.SourceName, setTableData(tableDatas)
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "无",
Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
type: route == 'deviceAbnormal' ? v.DeviceStatus == 0 ? "离线" : '' : v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
cameraKindId: 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,
station: v.StructureLongitude && v.StructureLatitude ? v.StructureLongitude + '. ' + v.StructureLatitude : "",
}))
setTableData(tableDatas)
}
})
} }
})
} }
})
break; break;
} }
}, [query, genre, pepProjectId])
useEffect(() => {
if (location) {
search.current = { ...search.current, ...location, state: 'new' }
api.current?.setValues({...location, state: 'new'})
}
if (route !== 'videoAbnormal' && route !== 'useAbnormal') {
dispatch(problem.getAlarmDataGroup()).then((res) => {
if (res.success) {
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 == '不活跃')
groupId.current = data
let genreData = []
data?.map(v => {
v?.unit?.map(vv => {
genreData.push({ name: vv.name, value: vv.id })
})
})
setGenre(genreData)
}
})
}
if (route == 'useAbnormal') {
setGenre({ element: "元素异常", apiError: "接口报错 ", timeout: "加载超时" })
}
if (route == 'videoAbnormal') {
dispatch(problem.getAlarmVideoDeviceKind()).then((res) => {
if (res.success) {
kindName.current = res.payload.data.map(v => ({ name: v.kind, value: v.id }))
setGenre(res.payload.data.map(v => ({ name: v.kind, value: v.id })))
}
})
}
}, [])
}, [query, search, pepProjectId])
// console.log(exhibition);
// console.log(tableData);
return ( return (
<> <>
@ -234,7 +251,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
style={{ width: 80, height: 32, borderRadius: 3, }} style={{ width: 80, height: 32, borderRadius: 3, }}
onClick={() => { onClick={() => {
api.current.validate().then((v) => { api.current.validate().then((v) => {
setSearch({ search.current = {
state: v.state, state: v.state,
keywordTarget: v.keywordTarget, keywordTarget: v.keywordTarget,
keyword: v.keyword, keyword: v.keyword,
@ -245,7 +262,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
onlineState: v.onlineState, onlineState: v.onlineState,
sustainTimeStart: v.time && v.time.length > 0 ? moment(v.time[0]).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") : "", sustainTimeEnd: v.time && v.time.length > 0 ? moment(v.time[1]).format("YYYY-MM-DD HH:mm:ss") : "",
}); }
setSelected([]) setSelected([])
setQuery({ limit: 10, page: 0 }) setQuery({ limit: 10, page: 0 })
}); });
@ -261,36 +278,40 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
active={true} active={true}
placeholder={SkeletonScreen()} placeholder={SkeletonScreen()}
> >
<Table {(() => {
columns={exhibition} // console.log(tableData);
dataSource={route == 'useAbnormal' || route == 'videoAbnormal' ? tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] : tableData} return <Table
bordered={false} columns={exhibition}
empty={<div><img src="/assets/images/problem/shield.png" style={{ width: 20 }} />暂无告警数据</div>} dataSource={route == 'useAbnormal' || route == 'videoAbnormal' ? tableData.slice(query.page * query.limit, (query.page + 1) * query.limit) || [] : tableData}
style={{}} bordered={false}
pagination={false} empty={<div><img src="/assets/images/problem/shield.png" style={{ width: 20 }} />暂无告警数据</div>}
onRow={(record, index) => { style={{}}
if (index % 1 === 0) { pagination={false}
return { style: { background: '#FAFCFF' } } onRow={(record, index) => {
} if (index % 1 === 0) {
}} return { style: { background: '#FAFCFF' } }
rowSelection={{ }
selectedRowKeys: selected || [], }}
getCheckboxProps: record => ({ rowSelection={{
disabled: record.confirmTime ? true : false, selectedRowKeys: selected || [],
// name: record.name, getCheckboxProps: record => ({
}), disabled: record.confirmTime ? true : false,
onSelect: (record, selected) => { // name: record.name,
// console.log(`select row: ${selected}`, record); }),
}, onSelect: (record, selected) => {
// onSelectAll: (selected, selectedRows) => { // console.log(`select row: ${selected}`, record);
// console.log(`select all rows: ${selected}`, selectedRows); },
// }, // onSelectAll: (selected, selectedRows) => {
onChange: (selectedRowKeys, selectedRows) => { // console.log(`select all rows: ${selected}`, selectedRows);
// console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows); // },
setSelected(selectedRows?.map(v => v.key)) onChange: (selectedRowKeys, selectedRows) => {
}, // console.log(`selectedRowKeys: ${selectedRowKeys}`, 'selectedRows: ', selectedRows);
}} setSelected(selectedRows?.map(v => v.key))
/> },
}}
/>
})()}
</Skeleton> </Skeleton>
<div <div
style={{ style={{

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

@ -14,7 +14,8 @@ import { request } from 'screenfull';
import { useRef } from 'react'; import { useRef } from 'react';
import { render } from 'less'; import { render } from 'less';
const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb }) => { const DataAlarm = (props) => {
const { match, dispatch, actions, user, loading, socket, iotVcmpWeb } = props
let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length) let route = match.url.substring(match.url.lastIndexOf("/") + 1, match.url.length)
const { problem } = actions const { problem } = actions
@ -127,10 +128,10 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
{ name: '元素异常', value: 'element' }] { name: '元素异常', value: 'element' }]
}, },
{ {
name: '异常状态', field: 'confirmState', name: '异常状态', field: 'state',
data: [ data: [
{ name: '当前', value: 'unconfirmed' }, { name: '当前', value: 'new' },
{ name: '历史', value: 'confirmd' }] { name: '历史', value: 'histroy' }]
}], }],
deviceAbnormal: [ // (deviceAbnormal) deviceAbnormal: [ // (deviceAbnormal)
{ name: '搜索', field: '1' }, { name: '搜索', field: '1' },
@ -304,14 +305,14 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
name: '操作', sort: 25, value: 'text', render: (_, r, index) => { name: '操作', sort: 25, value: 'text', render: (_, r, index) => {
return <div style={{ width: 195 }}> return <div style={{ width: 195 }}>
{r.State < 3 || route && ['videoAbnormal', 'useAbnormal'].includes(route) && !r.confirmTime ? {r.State < 3 || route && ['videoAbnormal', 'useAbnormal'].includes(route) && !r.confirmTime ?
<Button theme='borderless' style={{ width: 65 }} onClick={() => { <Button theme='borderless' style={{ width: 65 }} onClick={() => {
setConfirm(true) setConfirm(true)
setSelected([r.key]) setSelected([r.key])
}}>确认</Button> }}>确认</Button>
: r.State == 3 || r.autoRestore || r.confirmAuto ? : r.State == 3 || r.autoRestore || r.confirmAuto ?
<Button theme='borderless' style={{ width: 65 }} disabled>自动恢复</Button> : <Button theme='borderless' style={{ width: 65 }} disabled>自动恢复</Button> :
<Button theme='borderless' style={{ width: 65 }} disabled>已确认</Button> <Button theme='borderless' style={{ width: 65 }} disabled>已确认</Button>
} }
{route && ['dataLnterrupt', 'dataAbnormal', 'strategyHit', 'deviceAbnormal'].includes(route) ? <> {route && ['dataLnterrupt', 'dataAbnormal', 'strategyHit', 'deviceAbnormal'].includes(route) ? <>
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button> <Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button>
{route == 'deviceAbnormal' ? "" : <Button theme='borderless' style={{ width: 65 }} onClick={() => { {route == 'deviceAbnormal' ? "" : <Button theme='borderless' style={{ width: 65 }} onClick={() => {
@ -427,6 +428,8 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
setQuery={setQuery} setQuery={setQuery}
tableData={tableData} tableData={tableData}
setTableData={setTableData} setTableData={setTableData}
genre={genre}
location={props.location?.query}
/> />
{setup ? ( {setup ? (
<Setup <Setup
@ -596,7 +599,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
) )
} }
function mapStateToProps(state) { function mapStateToProps (state) {
const { auth, global, members, webSocket } = state const { auth, global, members, webSocket } = state
return { return {
// loading: members.isRequesting, // loading: members.isRequesting,

1
web/package.json

@ -69,7 +69,6 @@
"moment": "^2.29.3", "moment": "^2.29.3",
"npm": "^7.20.6", "npm": "^7.20.6",
"perfect-scrollbar": "^1.5.5", "perfect-scrollbar": "^1.5.5",
"qs": "^6.10.5",
"screenfull": "5.2.0", "screenfull": "5.2.0",
"socket.io-client": "^1.7.4", "socket.io-client": "^1.7.4",
"socket.io-parser": "^3.4.1", "socket.io-parser": "^3.4.1",

Loading…
Cancel
Save