diff --git a/api/app/lib/schedule/alarms_push.js b/api/app/lib/schedule/alarms_push.js index 81925f6..983ec83 100644 --- a/api/app/lib/schedule/alarms_push.js +++ b/api/app/lib/schedule/alarms_push.js @@ -516,6 +516,68 @@ 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 +610,8 @@ module.exports = function (app, opts) { }, { n: '告警信息', k: 'AlarmContent' + }, { + }, { n: '告警等级(当前)', k: '', @@ -671,10 +735,6 @@ module.exports = function (app, opts) { n: '告警源', k: 'SourceName' }, - { - n: '合理值', - k: 'AlarmTypeCode' - }, { n: '中断时间', k: '', @@ -1106,8 +1166,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 +1347,6 @@ module.exports = function (app, opts) { case 'SourceName': tableData += `${d[t.k] || ''}` break; - case 'AlarmTypeCode': - tableData += `${d[t.k] == 3018 ? "是" : '否'}` - break default: break; } @@ -1360,7 +1416,7 @@ module.exports = function (app, opts) { html += packageAlarmData2Table({ titlePrefix: '数据异常', alarmData: dataAlarmG2, - alarmTitleArr: dataAlarmTitle, + alarmTitleArr: dataAlarmTitle2, }) } if (c.alarmType.includes('strategy_hit')) { diff --git a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx b/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx index 27f758a..f3bccd2 100644 --- a/web/client/src/sections/workOrder/containers/stayDoWorkOrder.jsx +++ b/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 : '登录失败' + // } + // }) + }); }, []) diff --git a/web/client/src/utils/webapi.js b/web/client/src/utils/webapi.js index 529e6b2..8b0cb18 100644 --- a/web/client/src/utils/webapi.js +++ b/web/client/src/utils/webapi.js @@ -1,8 +1,8 @@ "use strict"; import { ProxyRequest, customWebUtils } from "@peace/utils"; -export const AxyRequest = new ProxyRequest("_axy"); -export const EmisRequest = new ProxyRequest("_emis") +export const AxyRequest = new ProxyRequest("_axy", 'pomsUser'); +export const EmisRequest = new ProxyRequest("_emis", 'pomsUser') export const webUtils = new customWebUtils({ userKey: 'pomsUser' diff --git a/web/package.json b/web/package.json index 50677c3..fb2c47e 100644 --- a/web/package.json +++ b/web/package.json @@ -7,7 +7,7 @@ "test": "mocha", "start-vite": "cross-env NODE_ENV=developmentVite 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", "build-dev": "cross-env NODE_ENV=development&&webpack --config webpack.config.js", "build": "cross-env NODE_ENV=production&&webpack --config webpack.config.prod.js"