Browse Source

应用巡检调整

dev
wenlele 2 years ago
parent
commit
66b91e57a3
  1. BIN
      web/client/assets/images/problem/banner.gif
  2. 29
      web/client/src/sections/problem/components/inspection.jsx
  3. 23
      web/client/src/sections/problem/components/tableData.jsx
  4. 22
      web/client/src/sections/problem/containers/dataAlarm.jsx

BIN
web/client/assets/images/problem/banner.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 KiB

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

@ -48,6 +48,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
useEffect(() => { useEffect(() => {
if (projectScrollbar) projectScrollbar.destroy() if (projectScrollbar) projectScrollbar.destroy()
const domEquipment = document.getElementById("inspection"); const domEquipment = document.getElementById("inspection");
if (domEquipment) {
if (unfold) { if (unfold) {
projectScrollbar = new PerfectScrollbar("#inspection", { projectScrollbar = new PerfectScrollbar("#inspection", {
suppressScrollY: true, suppressScrollY: true,
@ -59,17 +60,19 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
}) })
if (domEquipment && projectScrollbar) projectScrollbar.update() if (domEquipment && projectScrollbar) projectScrollbar.update()
} }
}
}) })
useEffect(() => { useEffect(() => {
dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => { dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => {
// console.log(res.payload.data); // console.log(res.payload.data)
if (res.success) { if (res.success) {
setPatrolAbnormal(res.payload.data) setPatrolAbnormal(res.payload.data)
setNotRead(res.payload.data.filter(v => !v.notedTime).length) setNotRead(res.payload.data.filter(v => !v.notedTime).length)
} }
}) })
}, [checkPatrol]); }, [checkPatrol])
useEffect(() => { useEffect(() => {
@ -91,7 +94,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
return ( return (
<div style={{ width: 'clac(100%)', backgroundColor: 'white', margin: "8px 12px", padding: "20px 20px 0" }}> <div style={{ width: 'clac(100%)', height: unfold ? 420 : 760, backgroundColor: 'white', margin: "8px 12px", padding: "20px 20px 0" }}>
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginLeft: 10 }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-start', marginLeft: 10 }}>
<div style={{ width: 450, }}> <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={{ 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>
@ -192,6 +195,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
</Form> </Form>
</div> </div>
</div> </div>
{patrolAbnormal?.length > 0 ?
<div <div
onMouseMove={() => document.getElementById('unfold').style.display = 'none'} onMouseMove={() => document.getElementById('unfold').style.display = 'none'}
onMouseOut={() => document.getElementById('unfold').style.display = 'block'} onMouseOut={() => document.getElementById('unfold').style.display = 'block'}
@ -221,6 +225,18 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
</div>)} </div>)}
</div> </div>
: <div style={{
width: 'calc(100% - 20px)', marginLeft: 10, height: 280,
background: 'url(/assets/images/problem/banner.gif)',
backgroundSize: '100% 100%',
fontSize: 32, fontFamily: 'YouSheBiaoTiHei',
fontWeight: 500, color: '#005ABD', textIndent: 80,
lineHeight: "260px"
}}>
当前应用暂无自动巡检计划
</div>
}
{patrolAbnormal?.length > 0 ?
<div id="unfold" <div id="unfold"
onMouseMove={(e) => e.stopPropagation()} onMouseMove={(e) => e.stopPropagation()}
onMouseOut={(e) => e.stopPropagation()} onMouseOut={(e) => e.stopPropagation()}
@ -233,14 +249,15 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
fontSize: 12, fontSize: 12,
zIndex: 100, zIndex: 100,
position: 'relative', position: 'relative',
top: unfold ? -20 : 6, top: unfold ? -20 : 14,
left: 0, left: 0,
textAlign: 'center', textAlign: 'center',
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799', color: unfold ? 'rgba(0,90,189,0.7)' : '#969799',
cursor: 'pointer', cursor: 'pointer',
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} 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> </div> : ""}
{picturePop ? <Modal {
picturePop ? <Modal
title={<div style={{}}>{pictureData?.app?.name} title={<div style={{}}>{pictureData?.app?.name}
<span style={{ <span style={{
width: 80, height: 20, display: 'inline-block', width: 80, height: 20, display: 'inline-block',

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

@ -48,6 +48,14 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
}) })
break; break;
case 'videoAbnormal': case 'videoAbnormal':
let cameraKind = []
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: '' })).then((res) => { dispatch(problem.getAlarmVideoList({ ...search, pepProjectId: '' })).then((res) => {
if (res.success) { if (res.success) {
// console.log(res); // console.log(res);
@ -64,11 +72,11 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
yingshiToken: v.yingshiToken, yingshiToken: v.yingshiToken,
AlarmContent: v.statusDescribe, AlarmContent: v.statusDescribe,
// State: v.State, // State: v.State,
station: v.station, station: v.station || [],
resolve: v.resolve, resolve: v.resolve || [],
cameraChannelNo: v.cameraChannelNo, cameraChannelNo: v.cameraChannelNo,
cameraSerialNo: v.cameraSerialNo, cameraSerialNo: v.cameraSerialNo,
cameraKindId: v.cameraKindId, cameraKindId: v.cameraKindId ? cameraKind?.find(v => v.value == v.cameraKindId)?.name : "",
venderName: v.venderName, venderName: v.venderName,
platform: v.platform, platform: v.platform,
confirm: v.confirmedContent, confirm: v.confirmedContent,
@ -79,11 +87,6 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
setTableData(tableDatas) setTableData(tableDatas)
} }
}) })
dispatch(problem.getAlarmVideoDeviceKind()).then((res) => {
if (res.success) {
setGenre(res.payload.data.map(v => ({ name: v.kind, value: v.id })))
}
})
break; break;
default: default:
dispatch(problem.getAlarmDataGroup()).then((res) => { dispatch(problem.getAlarmDataGroup()).then((res) => {
@ -106,7 +109,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
setGenre(genreData) setGenre(genreData)
if (data && data[0]?.id) { if (data && data[0]?.id) {
dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => { dispatch(problem.getAlarmDataList({ ...query, ...search, groupId: data.map(v => v.id).join(), pepProjectId: '' })).then((res) => {
// console.log(res); console.log(res);
if (res.success) { if (res.success) {
setCount(res.payload.data?.count || 0) setCount(res.payload.data?.count || 0)
let tableDatas = res.payload.data?.rows?.map(v => ({ let tableDatas = res.payload.data?.rows?.map(v => ({
@ -122,6 +125,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
AlarmGroupUnit: v.AlarmGroupUnit ? genreData.find(r => r.value == 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 : "", Strategy: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
type: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "", type: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
cameraKindId: v.AlarmGroupUnit ? genreData.find(r => r.value == v.AlarmGroupUnit)?.name : "",
AlarmCodeName: v.AlarmCodeName, AlarmCodeName: v.AlarmCodeName,
CurrentLevel: v.CurrentLevel, CurrentLevel: v.CurrentLevel,
detailCount: v.detailCount, detailCount: v.detailCount,
@ -129,6 +133,7 @@ const TableData = ({ route, dispatch, actions, collectData, setSetup, exhibition
State: v.State, State: v.State,
alarmType: v.alarmType, alarmType: v.alarmType,
confirm: v.confirmedContent, confirm: v.confirmedContent,
station: v.StructureLongitude && v.StructureLatitude ? v.StructureLongitude + '. ' + v.StructureLatitude : "",
})) }))
// console.log(tableDatas); // console.log(tableDatas);
setTableData(tableDatas) setTableData(tableDatas)

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

@ -165,7 +165,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
strategyHit: ['index', 'projectName', 'StructureName', 'SourceName', 'Strategy', 'State', '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', 'station', 'cameraKindId', 'venderName', 'point', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'], videoAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'cameraKindId', 'venderName', 'point', 'cameraSerialNo', 'cameraChannelNo', 'platform', 'AlarmContent', 'resolve', 'createTime', 'updateTime', 'confirm', 'confirmTime', 'camerOnline'],
useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'], useAbnormal: ['index', 'projectName', 'appName', 'url', 'type', 'alarmContent', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'alarmContent', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'], deviceAbnormal: ['index', 'projectName', 'StructureName', 'SourceName', 'station', 'alarmContent', 'cameraKindId', 'venderName', 'AlarmContent', 'AlarmCodeName', 'createTime', 'updateTime', 'confirm', 'confirmTime'],
} }
// //
const columns = { const columns = {
@ -250,7 +250,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
{ name: '产生次数', sort: 19, value: 'detailCount', render: (_, r, index) => r.detailCount + '次' }, { name: '产生次数', sort: 19, value: 'detailCount', render: (_, r, index) => r.detailCount + '次' },
{ {
name: '确认信息', sort: 20, value: 'confirm', render: (_, r, index) => { name: '确认信息', sort: 20, value: 'confirm', render: (_, r, index) => {
return r.State == 3 ? '无' : r.State == 4 ? r.confirm : r.confirm || '未确认' return r.State == 3 ? '无' : r.State == 4 ? r.confirm || '无' : r.confirm || '未确认'
} }
}, },
{ name: '确认/恢复时间', sort: 21, value: 'confirmTime', render: (_, r, index) => <div style={{ width: 130 }}>{r.confirmTime ? r.confirmTime : "无"}</div> }, { name: '确认/恢复时间', sort: 21, value: 'confirmTime', render: (_, r, index) => <div style={{ width: 130 }}>{r.confirmTime ? r.confirmTime : "无"}</div> },
@ -279,11 +279,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
return '当前' return '当前'
} }
}, },
{ name: '位置信息', sort: 11, value: 'station', render: (_, r, index) => r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.position}</div>) }, { name: '位置信息', sort: 11, value: 'station', render: (_, r, index) => route == 'deviceAbnormal' ? r.station : r.station?.map(v => <div key={v.resolve + v.id} style={{ lineHeight: "22px" }}>{v.position}</div>) },
{ {
name: '设备类型', sort: 6, value: 'cameraKindId', render: (_, r, index) => { name: '设备类型', sort: 6, value: 'cameraKindId',
}
}, },
{ name: '设备厂家', sort: 10, value: 'venderName', render: (_, r, index) => r.platform ? '未知' : r.venderName }, { name: '设备厂家', sort: 10, value: 'venderName', render: (_, r, index) => r.platform ? '未知' : r.venderName },
{ name: '通道号', sort: 10.1, value: 'cameraChannelNo' }, { name: '通道号', sort: 10.1, value: 'cameraChannelNo' },
@ -307,7 +305,7 @@ 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 && r.State >= 0 && 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])
@ -316,12 +314,12 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
<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'].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>
<Button theme='borderless' style={{ width: 65 }} onClick={() => { {route == 'deviceAbnormal' ? "" : <Button theme='borderless' style={{ width: 65 }} onClick={() => {
setCheckPop(true) setCheckPop(true)
setAlarmId(r.key) setAlarmId(r.key)
}}>查看</Button> }}>查看</Button>}
</> </>
: route == 'videoAbnormal' ? <> : route == 'videoAbnormal' ? <>
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button> <Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button>
@ -501,7 +499,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
field='textData' field='textData'
onChange={(e) => setContent(e)} /> onChange={(e) => setContent(e)} />
</Form> </Form>
{(() => { {route == 'videoAbnormal' ? (() => {
let data let data
if (selected.length == 1) { if (selected.length == 1) {
data = tableData.find(v => v.key == selected[0]) data = tableData.find(v => v.key == selected[0])
@ -514,7 +512,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
return v.name return v.name
} }
})}中被多次绑定可能拥有不同的名称确认后该设备的同类型告警也会被一同确认</div> : "" })}中被多次绑定可能拥有不同的名称确认后该设备的同类型告警也会被一同确认</div> : ""
})()} })() : ""}
</div> </div>
</Modal> : ""} </Modal> : ""}

Loading…
Cancel
Save