diff --git a/api/app/lib/controllers/alarm/app.js b/api/app/lib/controllers/alarm/app.js index 50afafd..5959423 100644 --- a/api/app/lib/controllers/alarm/app.js +++ b/api/app/lib/controllers/alarm/app.js @@ -2,7 +2,7 @@ const moment = require('moment') const { alarmConfirmLog } = require('./alarmConfirmLog'); -async function inspection(ctx) { +async function inspection (ctx) { // 巡查 try { const models = ctx.fs.dc.models; @@ -31,7 +31,7 @@ async function inspection(ctx) { } } -async function inspectionList(ctx) { +async function inspectionList (ctx) { try { const models = ctx.fs.dc.models; const { clickHouse } = ctx.app.fs @@ -116,7 +116,7 @@ async function inspectionList(ctx) { } } -async function notedInspection(ctx) { +async function notedInspection (ctx) { try { const models = ctx.fs.dc.models; const { inspectionId } = ctx.request.body @@ -141,7 +141,7 @@ async function notedInspection(ctx) { } } -async function apiError(ctx) { +async function apiError (ctx) { try { const { utils: { sendAppearToWeb } } = ctx.app.fs const models = ctx.fs.dc.models; @@ -253,12 +253,12 @@ async function apiError(ctx) { } } -async function apiErrorList(ctx) { +async function apiErrorList (ctx) { try { const models = ctx.fs.dc.models; const { clickHouse } = ctx.app.fs const { utils: { anxinStrucIdRange, pomsProjectRange } } = ctx.app.fs - const { keyword, errType, confirmState, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query + const { keyword, errType, confirmState, state, sustainTimeStart, sustainTimeEnd, limit, page, pepProjectId } = ctx.query let pomsProject = await pomsProjectRange({ ctx, pepProjectId, @@ -311,10 +311,10 @@ async function apiErrorList(ctx) { if (errType) { findOption.where.type = errType // element / apiError } - if (confirmState) { - if (confirmState == 'confirmd') { + if (confirmState || state) { + if (confirmState == 'confirmd' || state == 'histroy') { findOption.where.confirmTime = { $ne: null } - } else if (confirmState == 'unconfirmed') { + } else if (confirmState == 'unconfirmed' || state == 'new') { findOption.where.confirmTime = null } } @@ -365,7 +365,7 @@ async function apiErrorList(ctx) { } } -async function confirmApiError(ctx) { +async function confirmApiError (ctx) { try { const models = ctx.fs.dc.models; const { confirm, appAlarmId = [], confirmPost } = ctx.request.body diff --git a/api/app/lib/controllers/control/toolLink.js b/api/app/lib/controllers/control/toolLink.js index 4d827dc..0f878b2 100644 --- a/api/app/lib/controllers/control/toolLink.js +++ b/api/app/lib/controllers/control/toolLink.js @@ -164,8 +164,6 @@ async function count (ctx) { alarms.StructureId IN (${anxinStrucIds.join(",")}) AND StartTime BETWEEN '${moment().startOf('day').format('YYYY-MM-DD HH:mm:ss')}' AND '${moment().endOf('day').format('YYYY-MM-DD HH:mm:ss')}' - AND - State < 3 GROUP BY AlarmGroup `).toPromise() //今日新增数据告警 @@ -228,7 +226,7 @@ async function count (ctx) { let dataAfter = new moment(); //验证后时间 let dataduration = moment.duration(dataAfter.diff(dataFront))._data.milliseconds - console.log('数据',dataduration); + console.log('数据', dataduration); let yingyongFront = new moment(); //验证前时间 @@ -250,7 +248,7 @@ async function count (ctx) { let yingyongAfter = new moment(); //验证后时间 let yingyongduration = moment.duration(yingyongAfter.diff(yingyongFront))._data.milliseconds - console.log('应用',yingyongduration); + console.log('应用', yingyongduration); let videoFront = new moment(); //验证前时间 @@ -364,7 +362,7 @@ async function count (ctx) { let videoAfter = new moment(); //验证后时间 let videoduration = moment.duration(videoAfter.diff(videoFront))._data.milliseconds - console.log('视频',videoduration); + console.log('视频', videoduration); let findOptions = { @@ -403,7 +401,7 @@ async function count (ctx) { p.dataValues.pepProjectIsDelete = corPro.isdelete } - + ctx.status = 200; ctx.body = { diff --git a/api/app/lib/schedule/alarms_handle_statistics.js b/api/app/lib/schedule/alarms_handle_statistics.js index c22fb65..7facab0 100644 --- a/api/app/lib/schedule/alarms_handle_statistics.js +++ b/api/app/lib/schedule/alarms_handle_statistics.js @@ -7,7 +7,7 @@ module.exports = function (app, opts) { const { database: anxinyun } = clickHouse.anxinyun.opts.config const alarmHandleStatistics = app.fs.scheduleInit( { - interval: '0 18 1 ? * 1',//每周一1点18触发 + interval: '0 18 1 ? * 3',//每周一1点18触发 // immediate: true, proRun: true, }, diff --git a/web/client/src/sections/control/containers/control.jsx b/web/client/src/sections/control/containers/control.jsx index 4b01663..2d301ac 100644 --- a/web/client/src/sections/control/containers/control.jsx +++ b/web/client/src/sections/control/containers/control.jsx @@ -23,8 +23,8 @@ let member let web -const Control = (props) => { - const { dispatch, actions, user, loading, socket, pepProjectId } = props +const Control = ({ dispatch, actions, user, history, loading, socket, pepProjectId }) => { + const { control, install } = actions const [timelineList, setTimelineList] = useState(['', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', ''])//最新动态列表 @@ -171,7 +171,7 @@ const Control = (props) => { await dispatch(control.getAppAlarmsAggDay({ pepProjectId: pepProjectId })).then(res => { if (res.success) setAppBI(res.payload.data) }) - await dispatch(control.getAlarmsHandleStatistics({ pepProjectId: pepProjectId })).then(res => { + await dispatch(control.getAlarmsHandleStatistics({ projectCorrelationId: pepProjectId })).then(res => { if (res.success) setEfficiencyBI(res.payload.data[0]) }) } @@ -681,7 +681,7 @@ const Control = (props) => {