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 { token } = ctx.fs.api
await models.CameraStatusPushMonitor.destroy({
where: {
cameraId: cameraId
}
})
await models.CameraAbilityBind.destroy({
where: {
cameraId: cameraId
},
transaction
})
await models.CameraRemark.destroy({
where: {
cameraId: cameraId
},
transaction
})
await models.Camera.destroy({
where: {
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 { limit, page, orderBy, orderDirection, name, pushWay } = ctx.query
const sequelize = ctx.fs.dc.ORM;
let findOption = {
where: {},
order: [
@ -155,21 +154,6 @@ async function get (ctx) {
delete findOption.offset
const configIds = configLimitRes.map(c => c.id)
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 = [
[orderBy || 'id', orderDirection || 'DESC']
]
@ -186,7 +170,7 @@ async function get (ctx) {
},
{
model: models.CameraStatusPushLog,
attributes: [],
attributes: ['id'],
duplicating: false,
required: false,
},
@ -200,14 +184,17 @@ async function get (ctx) {
const configRes = await models.CameraStatusPushConfig.findAll(findOption)
delete findOption.attributes
delete findOption.group
delete findOption.order
delete findOption.distinct
delete findOption.subQuery
delete findOption.include
delete findOption.where.id
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.body = {
count: count,

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

@ -41,8 +41,8 @@ const Carrierpigeon = (props) => {
list: [
{ name: "策略类型", value: "pushWay" },
{ 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",
key: "logCount",
render: (_, r, index) => {
return r.logCount
return (r.logCount + '次')
},
},
{
title: "累计推送次数",
title: "监听设备数量",
dataIndex: "monitorCount",
key: "monitorCount",
render: (_, r, index) => {
return (r.monitorCount + '次')
return r.monitorCount
},
},
{
title: "策略类型",
dataIndex: "pushWay",

Loading…
Cancel
Save