From 8bccb706c92501f1eae7698b021431ae3b221642 Mon Sep 17 00:00:00 2001 From: "gao.zhiyuan" Date: Tue, 1 Aug 2023 21:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=87=E6=BB=A4=E8=BD=A6=E8=BE=86=E5=AE=9E?= =?UTF-8?q?=E6=97=B6=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api/app/lib/controllers/overview/operation.js | 6 ++++-- web/client/src/sections/quanju/actions/example.js | 11 +++++++++++ 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/api/app/lib/controllers/overview/operation.js b/api/app/lib/controllers/overview/operation.js index 47a47205..03f9414e 100644 --- a/api/app/lib/controllers/overview/operation.js +++ b/api/app/lib/controllers/overview/operation.js @@ -1,6 +1,6 @@ 'use strict'; const zhidiaoSystem = require('../../../../utils/zhidiaoSystem.js'); - +const moment = require('moment') async function busCarLevelList (ctx) { try { const models = ctx.fs.dc.models; @@ -144,8 +144,10 @@ async function busRunRealTime (ctx) { } }) + let now = moment() + let hourBefour = now.subtract(1, 'h') ctx.status = 200; - ctx.body = (busRunRes || []).filter(b => busCarRes.some(bc => bc.vehicleLicensePlateNumber == b.busNoChar)) + ctx.body = (busRunRes || []).filter(b => b.runState == 1 && moment(b.siteTime).isAfter(hourBefour) && busCarRes.some(bc => bc.vehicleLicensePlateNumber == b.busNoChar)) } catch (error) { ctx.fs.logger.error(`path: ${ctx.path}, error: error`); ctx.status = 400; diff --git a/web/client/src/sections/quanju/actions/example.js b/web/client/src/sections/quanju/actions/example.js index 00371410..dd5c1ed5 100644 --- a/web/client/src/sections/quanju/actions/example.js +++ b/web/client/src/sections/quanju/actions/example.js @@ -178,4 +178,15 @@ export function getVideoCenterList () { msg: { error: '获取视频中心列表失败' }, reducer: { name: 'videoCenterList' } }); +} + +export function getBusRuntTime () { + return dispatch => basicAction({ + type: 'get', + dispatch: dispatch, + actionType: 'GET_VIDEO_CENTER_LIST', + url: ApiTable.videoCenterList, + msg: { error: '获取视频中心列表失败' }, + reducer: { name: 'videoCenterList' } + }); } \ No newline at end of file