Browse Source

Merge branch 'dev_trial' of https://gitea.anxinyun.cn/free-sun/FS-IOT into dev_trial

release_1.1.2
wenlele 3 years ago
parent
commit
e6682fe482
  1. 7
      code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js
  2. 29
      code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js
  3. 13
      code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx

7
code/VideoAccess-VCMP/api/app/lib/controllers/camera/index.js

@ -310,20 +310,23 @@ async function del (ctx) {
const { cameraId } = ctx.params const { cameraId } = ctx.params
const { token } = ctx.fs.api const { token } = ctx.fs.api
await models.CameraStatusPushMonitor.destroy({
where: {
cameraId: cameraId
}
})
await models.CameraAbilityBind.destroy({ await models.CameraAbilityBind.destroy({
where: { where: {
cameraId: cameraId cameraId: cameraId
}, },
transaction transaction
}) })
await models.CameraRemark.destroy({ await models.CameraRemark.destroy({
where: { where: {
cameraId: cameraId cameraId: cameraId
}, },
transaction transaction
}) })
await models.Camera.destroy({ await models.Camera.destroy({
where: { where: {
id: cameraId id: cameraId

29
code/VideoAccess-VCMP/api/app/lib/controllers/status/push.js

@ -125,7 +125,6 @@ async function get (ctx) {
const { userId, token } = ctx.fs.api const { userId, token } = ctx.fs.api
const { limit, page, orderBy, orderDirection, name, pushWay } = ctx.query const { limit, page, orderBy, orderDirection, name, pushWay } = ctx.query
const sequelize = ctx.fs.dc.ORM;
let findOption = { let findOption = {
where: {}, where: {},
order: [ order: [
@ -155,21 +154,6 @@ async function get (ctx) {
delete findOption.offset delete findOption.offset
const configIds = configLimitRes.map(c => c.id) const configIds = configLimitRes.map(c => c.id)
findOption.where.id = { $in: configIds } findOption.where.id = { $in: configIds }
findOption.attributes = {
include: [
[sequelize.fn('COUNT', sequelize.col('cameraStatusPushMonitors.id')), 'monitorCount'],
[sequelize.fn('COUNT', sequelize.col('cameraStatusPushLogs.id')), 'logCount']
],
}
findOption.distinct = true
findOption.subQuery = false
findOption.group = [
'cameraStatusPushConfig.id',
'cameraStatusPushMonitors.id',
'cameraStatusPushLogs.id',
'cameraStatusPushReceivers.id',
'cameraStatusPushMonitors->camera.id',
]
findOption.order = [ findOption.order = [
[orderBy || 'id', orderDirection || 'DESC'] [orderBy || 'id', orderDirection || 'DESC']
] ]
@ -186,7 +170,7 @@ async function get (ctx) {
}, },
{ {
model: models.CameraStatusPushLog, model: models.CameraStatusPushLog,
attributes: [], attributes: ['id'],
duplicating: false, duplicating: false,
required: false, required: false,
}, },
@ -200,14 +184,17 @@ async function get (ctx) {
const configRes = await models.CameraStatusPushConfig.findAll(findOption) const configRes = await models.CameraStatusPushConfig.findAll(findOption)
delete findOption.attributes
delete findOption.group
delete findOption.order delete findOption.order
delete findOption.distinct
delete findOption.subQuery
delete findOption.include delete findOption.include
delete findOption.where.id delete findOption.where.id
const count = await models.CameraStatusPushConfig.count(findOption) const count = await models.CameraStatusPushConfig.count(findOption)
for (let { dataValues: c } of configRes) {
c.monitorCount = c.cameraStatusPushMonitors.length;
c.logCount = c.cameraStatusPushLogs.length;
delete c.cameraStatusPushLogs
}
ctx.status = 200; ctx.status = 200;
ctx.body = { ctx.body = {
count: count, count: count,

13
code/VideoAccess-VCMP/web/client/src/sections/offline/containers/carrierpigeon.jsx

@ -41,8 +41,8 @@ const Carrierpigeon = (props) => {
list: [ list: [
{ name: "策略类型", value: "pushWay" }, { name: "策略类型", value: "pushWay" },
{ name: "推送机制", value: "noticeWay" }, { name: "推送机制", value: "noticeWay" },
{ name: "监听设备数量", value: "logCount" }, { name: "监听设备数量", value: "monitorCount" },
{ name: "累计推送次数", value: "monitorCount" }, { name: "累计推送次数", value: "logCount" },
] ]
}, },
]; ];
@ -238,22 +238,21 @@ const Carrierpigeon = (props) => {
}, },
}, },
{ {
title: "监听设备数量", title: "累计推送次数",
dataIndex: "logCount", dataIndex: "logCount",
key: "logCount", key: "logCount",
render: (_, r, index) => { render: (_, r, index) => {
return r.logCount return (r.logCount + '次')
}, },
}, },
{ {
title: "累计推送次数", title: "监听设备数量",
dataIndex: "monitorCount", dataIndex: "monitorCount",
key: "monitorCount", key: "monitorCount",
render: (_, r, index) => { render: (_, r, index) => {
return (r.monitorCount + '次') return r.monitorCount
}, },
}, },
{ {
title: "策略类型", title: "策略类型",
dataIndex: "pushWay", dataIndex: "pushWay",

Loading…
Cancel
Save