巴林闲侠 2 years ago
parent
commit
dbe85fee64
  1. 74
      api/app/lib/schedule/alarms_push.js
  2. 19
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

74
api/app/lib/schedule/alarms_push.js

@ -516,6 +516,66 @@ module.exports = function (app, opts) {
`).toPromise() : []
}
let dataAlarmTitle2 = [{
n: '项目',
k: '',
v: pepProjectName
}, {
n: '结构物',
k: '',
f: (d) => {
return (strucMap[d.StructureId] || { name: '' }).name
// return (strucListRes.find(s => s.id == d.StructureId) || { name: '' }).name
}
}, {
n: '告警源名称',
k: 'SourceName'
}, {
n: '告警源类型',
k: '',
f: (d) => {
switch (d.SourceTypeId) {
case 0:
return 'DTU'
case 1:
return '传感器'
case 2:
return '测点'
default:
return ''
}
}
}, {
n: '告警信息',
k: 'AlarmContent'
}, {
n: '合理值',
k: '',
f: (d) => d.AlarmTypeCode == 3018 ? "是" : "否"
}, {
n: '告警等级(当前)',
k: '',
f: (d) => {
switch (d.CurrentLevel) {
case 1:
return '一级'
case 2:
return '二级'
case 3:
return '三级'
default:
return ''
}
}
}, {
n: '持续时间',
k: '',
f: (d) => {
return d.StartTime ?
'超过' + calcMinute2DHM(moment().diff(moment(d.StartTime), 'minutes')) : ''
}
},]
let dataAlarmTitle = [{
n: '项目',
k: '',
@ -548,6 +608,8 @@ module.exports = function (app, opts) {
}, {
n: '告警信息',
k: 'AlarmContent'
}, {
}, {
n: '告警等级(当前)',
k: '',
@ -671,10 +733,6 @@ module.exports = function (app, opts) {
n: '告警源',
k: 'SourceName'
},
{
n: '合理值',
k: 'AlarmTypeCode'
},
{
n: '中断时间',
k: '',
@ -1106,8 +1164,7 @@ module.exports = function (app, opts) {
alarms.SourceId AS sourceId,
alarms.StartTime AS StartTime,
alarms.SourceName AS SourceName,
alarms.AlarmCode AS AlarmCode,
alarms.AlarmTypeCode AS AlarmTypeCode
alarms.AlarmCode AS AlarmCode
FROM
alarms
WHERE
@ -1288,9 +1345,6 @@ module.exports = function (app, opts) {
case 'SourceName':
tableData += `<td>${d[t.k] || ''}</td>`
break;
case 'AlarmTypeCode':
tableData += `<td>${d[t.k] == 3018 ? "是" : '否'}</td>`
break
default:
break;
}
@ -1360,7 +1414,7 @@ module.exports = function (app, opts) {
html += packageAlarmData2Table({
titlePrefix: '数据异常',
alarmData: dataAlarmG2,
alarmTitleArr: dataAlarmTitle,
alarmTitleArr: dataAlarmTitle2,
})
}
if (c.alarmType.includes('strategy_hit')) {

19
web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx

@ -1,5 +1,6 @@
import React, { useEffect } from 'react';
import { connect } from 'react-redux';
import { ApiTable, AxyRequest, EmisRequest } from '$utils'
@ -7,7 +8,23 @@ const Rest = (props) => {
const { dispatch, actions, user, loading, socket } = props
useEffect(() => {
EmisRequest.get('process-instance/my-apply-list',
{ userId: 1, offset: 0, limit: 10,businessType:'假勤管理' })
.then(user => {
// sessionStorage.setItem('pomsUser', JSON.stringify(user));
// return dispatch({
// type: LOGIN_SUCCESS,
// payload: { user: user },
// });
}, error => {
// let { body } = error.response;
// return dispatch({
// type: LOGIN_ERROR,
// payload: {
// error: body && body.message ? body.message : ''
// }
// })
});
}, [])

Loading…
Cancel
Save