Browse Source

应用巡检调整

dev
wenlele 2 years ago
parent
commit
66b91e57a3
  1. BIN
      web/client/assets/images/problem/banner.gif
  2. 259
      web/client/src/sections/problem/components/inspection.jsx
  3. 25
      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

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

@ -48,28 +48,31 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
useEffect(() => {
if (projectScrollbar) projectScrollbar.destroy()
const domEquipment = document.getElementById("inspection");
if (unfold) {
projectScrollbar = new PerfectScrollbar("#inspection", {
suppressScrollY: true,
});
if (domEquipment && projectScrollbar) projectScrollbar.update()
} else {
projectScrollbar = new PerfectScrollbar("#inspection", {
suppressScrollX: true,
})
if (domEquipment && projectScrollbar) projectScrollbar.update()
if (domEquipment) {
if (unfold) {
projectScrollbar = new PerfectScrollbar("#inspection", {
suppressScrollY: true,
});
if (domEquipment && projectScrollbar) projectScrollbar.update()
} else {
projectScrollbar = new PerfectScrollbar("#inspection", {
suppressScrollX: true,
})
if (domEquipment && projectScrollbar) projectScrollbar.update()
}
}
})
useEffect(() => {
dispatch(problem.getAlarmLnspection(checkPatrol)).then((res) => {
// console.log(res.payload.data);
// console.log(res.payload.data)
if (res.success) {
setPatrolAbnormal(res.payload.data)
setNotRead(res.payload.data.filter(v => !v.notedTime).length)
}
})
}, [checkPatrol]);
}, [checkPatrol])
useEffect(() => {
@ -91,7 +94,7 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
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={{ 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>
@ -192,118 +195,132 @@ const Inspection = ({ dispatch, actions, user, route, statistic }) => {
</Form>
</div>
</div>
<div
onMouseMove={() => document.getElementById('unfold').style.display = 'none'}
onMouseOut={() => document.getElementById('unfold').style.display = 'block'}
id="inspection" style={{ width: 'calc(100% - 20px)', marginLeft: 10, height: unfold ? 280 : 600, whiteSpace: unfold ? 'nowrap' : '', position: "relative", }}>
{patrolAbnormal?.map((v, i) =>
<div key={'name' + v.id}
style={{
width: 400, height: 238,
display: 'inline-block',
margin: '8px 20px 8px 0',
boxShadow: ' 0px 2px 12px 1px #F2F3F5',
borderRadius: 2, border: '1px solid rgba(220,222,224,0.2)',
position: 'relative',
}}
onClick={() => {
setPicturePop(true)
setPictureId(i);
setPictureData(patrolAbnormal[i])
}}
>
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} />
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}>
<span style={{ fontSize: 12 }}>获取时间{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<span style={{ color: '#4A4A4A', fontWeight: 500 }}>{v.app?.name}</span>
</div>
{v.notedPepUser ? <img src="/assets/images/problem/tick.png" style={{ width: 19, position: "absolute", top: -6, right: -10 }} /> : ""}
</div>)}
{patrolAbnormal?.length > 0 ?
<div
onMouseMove={() => document.getElementById('unfold').style.display = 'none'}
onMouseOut={() => document.getElementById('unfold').style.display = 'block'}
id="inspection" style={{ width: 'calc(100% - 20px)', marginLeft: 10, height: unfold ? 280 : 600, whiteSpace: unfold ? 'nowrap' : '', position: "relative", }}>
{patrolAbnormal?.map((v, i) =>
<div key={'name' + v.id}
style={{
width: 400, height: 238,
display: 'inline-block',
margin: '8px 20px 8px 0',
boxShadow: ' 0px 2px 12px 1px #F2F3F5',
borderRadius: 2, border: '1px solid rgba(220,222,224,0.2)',
position: 'relative',
}}
onClick={() => {
setPicturePop(true)
setPictureId(i);
setPictureData(patrolAbnormal[i])
}}
>
<img src={`/_file-server/${v.screenshot}`} style={{ width: 400, height: 182 }} />
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end', margin: '10px 6px 0', color: '#005ABD' }}>
<span style={{ fontSize: 12 }}>获取时间{moment(v.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<span style={{ color: '#4A4A4A', fontWeight: 500 }}>{v.app?.name}</span>
</div>
{v.notedPepUser ? <img src="/assets/images/problem/tick.png" style={{ width: 19, position: "absolute", top: -6, right: -10 }} /> : ""}
</div>)}
</div>
<div id="unfold"
onMouseMove={(e) => e.stopPropagation()}
onMouseOut={(e) => e.stopPropagation()}
onClick={() => setUnfold(!unfold)}
style={{
width: 'calc(100% - 20px)', marginLeft: 10, height: 24,
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.09) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)',
borderRadius: 3,
lineHeight: '24px',
fontSize: 12,
zIndex: 100,
position: 'relative',
top: unfold ? -20 : 6,
left: 0,
textAlign: 'center',
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799',
cursor: 'pointer',
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} />
</div>
{picturePop ? <Modal
title={<div style={{}}>{pictureData?.app?.name}
<span style={{
width: 80, height: 20, display: 'inline-block',
background: 'url(/assets/images/problem/preview.png)',
backgroundRepeat: 'no-repeat',
backgroundSize: '100% 100%',
color: '#FFFFFF', fontSize: 12,
textAlign: 'center', lineHeight: '20px', marginLeft: 10,
}}>
未阅 {notRead}/{patrolAbnormal.length}
</span>
</div>}
hasCancel={false}
footer={<div style={{ width: 425, margin: 'auto', display: "flex", justifyContent: 'space-around', }}>
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}
onClick={() => {
if (!pictureId == 0) setPictureId(pictureId - 1)
}}
>上一张</Button>
<a href={`/_file-server/${pictureData.screenshot + '?filename=' + encodeURIComponent(pictureData.app?.name)}.png`}>
<Button style={{ width: 92, height: 32, color: '#005ABD', border: '1px solid #005ABD', borderRadius: 2 }}>图片下载</Button>
</a>
<a href={pictureData.app?.url} target="_blank">
<Button style={{ width: 92, height: 32, color: '#FFFFFF', background: '#005ABD', border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}>进入系统</Button>
</a>
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}
onClick={() => {
if (pictureId < patrolAbnormal.length - 1) setPictureId(pictureId + 1)
}}
>下一张</Button>
</div>}
visible={true}
onOk={() => {
</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"
onMouseMove={(e) => e.stopPropagation()}
onMouseOut={(e) => e.stopPropagation()}
onClick={() => setUnfold(!unfold)}
style={{
width: 'calc(100% - 20px)', marginLeft: 10, height: 24,
background: unfold ? 'linear-gradient(180deg, rgba(36,139,255,0) 0%, rgba(36,139,255,0.09) 100%)' : 'linear-gradient(180deg, rgba(218,218,218,0) 0%, rgba(212,212,212,0.38) 100%)',
borderRadius: 3,
lineHeight: '24px',
fontSize: 12,
zIndex: 100,
position: 'relative',
top: unfold ? -20 : 14,
left: 0,
textAlign: 'center',
color: unfold ? 'rgba(0,90,189,0.7)' : '#969799',
cursor: 'pointer',
}}>{unfold ? '展开更多' : '收起'}<img style={{ width: 17, paddingTop: 8, marginLeft: 3 }} src={`/assets/images/problem/${unfold ? "dropDown" : 'pullUp'}.png`} />
</div> : ""}
{
picturePop ? <Modal
title={<div style={{}}>{pictureData?.app?.name}
<span style={{
width: 80, height: 20, display: 'inline-block',
background: 'url(/assets/images/problem/preview.png)',
backgroundRepeat: 'no-repeat',
backgroundSize: '100% 100%',
color: '#FFFFFF', fontSize: 12,
textAlign: 'center', lineHeight: '20px', marginLeft: 10,
}}>
未阅 {notRead}/{patrolAbnormal.length}
</span>
</div>}
hasCancel={false}
footer={<div style={{ width: 425, margin: 'auto', display: "flex", justifyContent: 'space-around', }}>
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}
onClick={() => {
if (!pictureId == 0) setPictureId(pictureId - 1)
}}
>上一张</Button>
<a href={`/_file-server/${pictureData.screenshot + '?filename=' + encodeURIComponent(pictureData.app?.name)}.png`}>
<Button style={{ width: 92, height: 32, color: '#005ABD', border: '1px solid #005ABD', borderRadius: 2 }}>图片下载</Button>
</a>
<a href={pictureData.app?.url} target="_blank">
<Button style={{ width: 92, height: 32, color: '#FFFFFF', background: '#005ABD', border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}>进入系统</Button>
</a>
<Button style={{ width: 92, height: 32, border: '1px solid rgba(0,0,0,0.15)', borderRadius: 2 }}
onClick={() => {
if (pictureId < patrolAbnormal.length - 1) setPictureId(pictureId + 1)
}}
>下一张</Button>
</div>}
visible={true}
onOk={() => {
}}
width={837}
onCancel={() => {
setPicturePop(false)
setPictureId('')
if (timer) clearTimeout(timer)
}}
>
<div style={{ marginBottom: 12 }}>
{pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息{pictureData.notedPepUser}&nbsp;{moment(pictureData.notedTime).format("YYYY-MM-DD HH:mm:ss")}</span> : ""}
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<img src={`/assets/images/problem/link.png`}
style={{ width: 16, height: 16, marginLeft: 6 }}
onClick={() => {
console.log(pictureData);
copy(pictureData?.router || "无相关地址");
Notification.success({
content: "复制成功",
duration: 2,
})
}}
}}
width={837}
onCancel={() => {
setPicturePop(false)
setPictureId('')
if (timer) clearTimeout(timer)
}}
>
<div style={{ marginBottom: 12 }}>
{pictureData.notedTime ? <span style={{ marginRight: 14 }}>核验信息{pictureData.notedPepUser}&nbsp;{moment(pictureData.notedTime).format("YYYY-MM-DD HH:mm:ss")}</span> : ""}
<span>截取时间:{moment(pictureData.createTime).format("YYYY-MM-DD HH:mm:ss")}</span>
<img src={`/assets/images/problem/link.png`}
style={{ width: 16, height: 16, marginLeft: 6 }}
onClick={() => {
console.log(pictureData);
copy(pictureData?.router || "无相关地址");
Notification.success({
content: "复制成功",
duration: 2,
})
}}
/>
</div>
<img src={`/_file-server/${pictureData.screenshot}`}
style={{ width: 789, height: 359 }}
/>
</div>
<img src={`/_file-server/${pictureData.screenshot}`}
style={{ width: 789, height: 359 }}
/>
</Modal>
: ""
</Modal>
: ""
}
</div >

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

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

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'],
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'],
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 = {
@ -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: 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> },
@ -279,11 +279,9 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
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.1, value: 'cameraChannelNo' },
@ -307,7 +305,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
{
name: '操作', sort: 25, value: 'text', render: (_, r, index) => {
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={() => {
setConfirm(true)
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>
}
{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 }} onClick={() => {
{route == 'deviceAbnormal' ? "" : <Button theme='borderless' style={{ width: 65 }} onClick={() => {
setCheckPop(true)
setAlarmId(r.key)
}}>查看</Button>
}}>查看</Button>}
</>
: route == 'videoAbnormal' ? <>
<Button theme='borderless' style={{ width: 65 }} disabled>已派单</Button>
@ -501,7 +499,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
field='textData'
onChange={(e) => setContent(e)} />
</Form>
{(() => {
{route == 'videoAbnormal' ? (() => {
let data
if (selected.length == 1) {
data = tableData.find(v => v.key == selected[0])
@ -514,7 +512,7 @@ const DataAlarm = ({ match, dispatch, actions, user, loading, socket, iotVcmpWeb
return v.name
}
})}中被多次绑定可能拥有不同的名称确认后该设备的同类型告警也会被一同确认</div> : ""
})()}
})() : ""}
</div>
</Modal> : ""}

Loading…
Cancel
Save