Browse Source

Merge branch 'dev_trial' of https://gitea.anxinyun.cn/free-sun/FS-IOT into dev_trial

release_1.3.0
wenlele 2 years ago
parent
commit
48c333d3f2
  1. 6
      code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js
  2. 4
      code/VideoAccess-VCMP/web/client/src/sections/offline/components/pushModal.jsx
  3. 2
      code/VideoAccess-VCMP/web/client/src/sections/offline/components/pushSideSheet.jsx
  4. 6
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx
  5. 8
      code/VideoAccess-VCMP/web/client/src/sections/offline/style.less

6
code/VideoAccess-VCMP/api/app/lib/schedule/cameraStatePush.js

@ -126,7 +126,7 @@ module.exports = function (app, opts) {
if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) { if (offArr.length && c.noticeWay && c.noticeWay.includes('offline') && receiver.length) {
if (c.pushWay == 'email') { if (c.pushWay == 'email') {
// 邮件 // 邮件
let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,${offArr.length}个设备掉线:\n` let text = `${corUser[0].username}】账号下的设备,截止【${moment(timeNow).format('MM月DD日 HH时mm分')}】,新增${offArr.length}个设备掉线:\n`
text += offArr.map(o => `${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n') text += offArr.map(o => `${o.name}】于【${moment(o.time).format('MM月DD日 HH时mm分')}】掉线,`).join('\n')
text += `\n请及时处理!` text += `\n请及时处理!`
await pushByEmail({ await pushByEmail({
@ -285,7 +285,7 @@ module.exports = function (app, opts) {
], ],
}) })
for (let c of configRes) { for (let c of configRes) {
// 查配置信息所对应的摄像头15min内的在离线状态 // 查配置信息所对应的摄像头在离线状态
const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId) const cameraIds = c.cameraStatusPushMonitors.map(m => m.cameraId)
const offlineRes = await models.Camera.findAll({ const offlineRes = await models.Camera.findAll({
where: { where: {
@ -330,7 +330,7 @@ module.exports = function (app, opts) {
group: ['cameraId'], group: ['cameraId'],
}) })
if (offlineTimeRes.length) { if (offlineTimeRes.length) {
let text = `${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')}${offlineRes.length}个设备掉线:\n` let text = `${corUser[0].username}】账号下的设备,截止${moment(timeNow).format('MM月DD日 HH时mm分')}新增${offlineRes.length}个设备掉线:\n`
text += offlineTimeRes.map(o => { text += offlineTimeRes.map(o => {
let corCamera = offlineRes.find(c => c.id == o.cameraId) let corCamera = offlineRes.find(c => c.id == o.cameraId)
if (corCamera) { if (corCamera) {

4
code/VideoAccess-VCMP/web/client/src/sections/offline/components/pushModal.jsx

@ -76,7 +76,7 @@ function pushModal (props) {
const [policyList, setPolicyList] = useState([// const [policyList, setPolicyList] = useState([//
{ {
strategy: '系统监听到设备离线时,进行一次邮件推送,并将当前所 有离线的设备一同推送至信息邮箱,每次起始推送间隔不少于15分钟。', strategy: '系统监听到设备离线时,进行一次邮件推送,并将当前所 有离线的设备一同推送至信息邮箱,每次起始推送间隔不少于15分钟。',
example: '【superadmin】账号下的设备:【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,请时处理!', example: '【superadmin】账号下的设备:【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,请时处理!',
}, },
{ {
strategy: '系统监听到设备上线时,推送至信息邮箱,每次推送间隔 不少于15分钟。', strategy: '系统监听到设备上线时,推送至信息邮箱,每次推送间隔 不少于15分钟。',
@ -84,7 +84,7 @@ function pushModal (props) {
}, },
{ {
strategy: '系统在设定时间前统计所有离线的设备信息,并推送至信 息邮箱。', strategy: '系统在设定时间前统计所有离线的设备信息,并推送至信 息邮箱。',
example: '【superadmin】账号下的设备,截止【2022年22时00分】,15个设备掉线:【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,请时处理!', example: '【superadmin】账号下的设备,截止【2022年22时00分】,新增15个设备掉线:【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,【智慧小蓝排涝-乡山站排口】于【2022年22时00分】掉线,请时处理!',
}, },
]);// ]);//
const [chooseCameraList, setChooseCameraList] = useState([]);// const [chooseCameraList, setChooseCameraList] = useState([]);//

2
code/VideoAccess-VCMP/web/client/src/sections/offline/components/pushSideSheet.jsx

@ -157,7 +157,7 @@ function pushSideSheet (props) {
}> }>
<div style={{ marginRight: 24, width: 133, textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>{itm.cameraList}</div> <div style={{ marginRight: 24, width: 133, textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>{itm.cameraList}</div>
</Popover> </Popover>
<div style={{ marginRight: 25, width: 83 }} className={itm.noticeWay == 'online' ? 'online' : itm.noticeWay == 'offline' ? 'offline' : 'timing'}>{itm.noticeWay == 'online' ? '上线时通知' : itm.noticeWay == 'offline' ? '离线即时通知' : '24时定时统计'}</div> <div style={{ marginRight: 25, width: 83 }} className={itm.noticeWay == 'online' ? 'online' : itm.noticeWay == 'offline' ? 'offline' : 'timing'}>{itm.noticeWay == 'online' ? '上线时通知' : itm.noticeWay == 'offline' ? '离线即时通知' : '24时定时统计'}</div>
</div> </div>
) )
})} })}

6
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx

@ -46,8 +46,8 @@ const Carrierpigeon = (props) => {
}, },
]; ];
const noticeWayObj = { const noticeWayObj = {
'offline':'离线时通知', 'offline':'离线时通知',
'online':'上线时通知', 'online':'上线时通知',
'timing':'定时统计', 'timing':'定时统计',
} }
useEffect(() => { useEffect(() => {
@ -206,7 +206,7 @@ const Carrierpigeon = (props) => {
let val = r.noticeWay[index] let val = r.noticeWay[index]
noticeWayValue.push(noticeWayObj[val]) noticeWayValue.push(noticeWayObj[val])
} }
let noticeWayString=noticeWayValue.join(';') let noticeWayString=noticeWayValue.join('')
return noticeWayString; return noticeWayString;
}, },
}, },

8
code/VideoAccess-VCMP/web/client/src/sections/offline/style.less

@ -0,0 +1,8 @@
.semi-table{
.semi-table-row:first-child{
.semi-table-row-head{
background: #2662DC;
color: #FFFFFF;
}
}
}
Loading…
Cancel
Save