Browse Source

过滤车辆实时信息

dev
巴林闲侠 1 year ago
parent
commit
8bccb706c9
  1. 6
      api/app/lib/controllers/overview/operation.js
  2. 11
      web/client/src/sections/quanju/actions/example.js

6
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;

11
web/client/src/sections/quanju/actions/example.js

@ -179,3 +179,14 @@ export function getVideoCenterList () {
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' }
});
}
Loading…
Cancel
Save