Browse Source

合理值修改

dev
wenlele 2 years ago
parent
commit
307d191610
  1. 76
      api/app/lib/schedule/alarms_push.js
  2. 19
      web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx
  3. 4
      web/client/src/utils/webapi.js
  4. 2
      web/package.json

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

@ -516,6 +516,68 @@ module.exports = function (app, opts) {
`).toPromise() : [] `).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 = [{ let dataAlarmTitle = [{
n: '项目', n: '项目',
k: '', k: '',
@ -548,6 +610,8 @@ module.exports = function (app, opts) {
}, { }, {
n: '告警信息', n: '告警信息',
k: 'AlarmContent' k: 'AlarmContent'
}, {
}, { }, {
n: '告警等级(当前)', n: '告警等级(当前)',
k: '', k: '',
@ -671,10 +735,6 @@ module.exports = function (app, opts) {
n: '告警源', n: '告警源',
k: 'SourceName' k: 'SourceName'
}, },
{
n: '合理值',
k: 'AlarmTypeCode'
},
{ {
n: '中断时间', n: '中断时间',
k: '', k: '',
@ -1106,8 +1166,7 @@ module.exports = function (app, opts) {
alarms.SourceId AS sourceId, alarms.SourceId AS sourceId,
alarms.StartTime AS StartTime, alarms.StartTime AS StartTime,
alarms.SourceName AS SourceName, alarms.SourceName AS SourceName,
alarms.AlarmCode AS AlarmCode, alarms.AlarmCode AS AlarmCode
alarms.AlarmTypeCode AS AlarmTypeCode
FROM FROM
alarms alarms
WHERE WHERE
@ -1288,9 +1347,6 @@ module.exports = function (app, opts) {
case 'SourceName': case 'SourceName':
tableData += `<td>${d[t.k] || ''}</td>` tableData += `<td>${d[t.k] || ''}</td>`
break; break;
case 'AlarmTypeCode':
tableData += `<td>${d[t.k] == 3018 ? "是" : '否'}</td>`
break
default: default:
break; break;
} }
@ -1360,7 +1416,7 @@ module.exports = function (app, opts) {
html += packageAlarmData2Table({ html += packageAlarmData2Table({
titlePrefix: '数据异常', titlePrefix: '数据异常',
alarmData: dataAlarmG2, alarmData: dataAlarmG2,
alarmTitleArr: dataAlarmTitle, alarmTitleArr: dataAlarmTitle2,
}) })
} }
if (c.alarmType.includes('strategy_hit')) { 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 React, { useEffect } from 'react';
import { connect } from 'react-redux'; 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 const { dispatch, actions, user, loading, socket } = props
useEffect(() => { 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 : ''
// }
// })
});
}, []) }, [])

4
web/client/src/utils/webapi.js

@ -1,8 +1,8 @@
"use strict"; "use strict";
import { ProxyRequest, customWebUtils } from "@peace/utils"; import { ProxyRequest, customWebUtils } from "@peace/utils";
export const AxyRequest = new ProxyRequest("_axy"); export const AxyRequest = new ProxyRequest("_axy", 'pomsUser');
export const EmisRequest = new ProxyRequest("_emis") export const EmisRequest = new ProxyRequest("_emis", 'pomsUser')
export const webUtils = new customWebUtils({ export const webUtils = new customWebUtils({
userKey: 'pomsUser' userKey: 'pomsUser'

2
web/package.json

@ -7,7 +7,7 @@
"test": "mocha", "test": "mocha",
"start-vite": "cross-env NODE_ENV=developmentVite npm run start-params", "start-vite": "cross-env NODE_ENV=developmentVite npm run start-params",
"start": "cross-env NODE_ENV=development npm run start-params", "start": "cross-env NODE_ENV=development npm run start-params",
"start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.112:14000 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt anxinyun-test --qndmn http://test.resources.anxinyun.cn --iotVcmpWeb https://mediaconsole.ngaiot.com --pomsMonitor http://monitor.anxinyun.cn/goto/PaEDLE84z?orgId=1 --pomsKubesphere https://k8sadmin.anxinyun.cn/ --pomsAmbari https://ambari.anxinyun.cn/ --pomsKowl https://kafka.anxinyun.cn/ --pomsPghero https://pghero.anxinyun.cn/ --pomsEs https://esc.anxinyun.cn/ --pomsNotebook https://inotebook.anxinyun.cn/ --dcWeb https://fsiot-oamss.anxinyun.cn", "start-params": "node server -p 5600 -u http://localhost:4600 --apiPomsUrl http://localhost:4600 --apiAnxinyunUrl http://10.8.30.112:4100 --apiEmisUrl http://10.8.30.161:1111 --qnak 5XrM4wEB9YU6RQwT64sPzzE6cYFKZgssdP5Kj3uu --qnsk w6j2ixR_i-aelc6I7S3HotKIX-ukMzcKmDfH6-M5 --qnbkt anxinyun-test --qndmn http://test.resources.anxinyun.cn --iotVcmpWeb https://mediaconsole.ngaiot.com --pomsMonitor http://monitor.anxinyun.cn/goto/PaEDLE84z?orgId=1 --pomsKubesphere https://k8sadmin.anxinyun.cn/ --pomsAmbari https://ambari.anxinyun.cn/ --pomsKowl https://kafka.anxinyun.cn/ --pomsPghero https://pghero.anxinyun.cn/ --pomsEs https://esc.anxinyun.cn/ --pomsNotebook https://inotebook.anxinyun.cn/ --dcWeb https://fsiot-oamss.anxinyun.cn",
"deploy": "export NODE_ENV=production&& npm run build && node server", "deploy": "export NODE_ENV=production&& npm run build && node server",
"build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js",
"build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js" "build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"

Loading…
Cancel
Save