|
|
@@ -1,20 +1,34 @@
|
|
|
-import { dimensionAiBox, getAiBoxEvent, getAiBoxList, getAiBoxPage, getStream, getSys, getTaskByClientId, reboot, refreshStream, refreshSys, refreshTask } from '@/api/cvs/aibox'
|
|
|
+import { addAiBoxForward, aiboxLevelUp, delAiBoxForward, dimensionAiBox, getAiBoxEvent, getAiBoxForward, getAiBoxList, getAiBoxPage, getStream, getSys, getTaskByClientId, reboot, refreshStream, refreshSys, refreshTask, updateAiBoxForward } from '@/api/cvs/aibox'
|
|
|
+import { updateForward } from '@/api/iot/rule'
|
|
|
import { message } from 'ant-design-vue'
|
|
|
|
|
|
export class AiboxController {
|
|
|
static eventType: {EventType: CVS.AiBox.eventType, EventName: string}[] = [
|
|
|
- { EventType: 0, EventName: '人脸识别' },
|
|
|
- { EventType: 1, EventName: '人流统计' },
|
|
|
- { EventType: 2, EventName: '明烟明火' },
|
|
|
- { EventType: 3, EventName: '抽烟打电话' },
|
|
|
- { EventType: 4, EventName: '口罩检测' },
|
|
|
- { EventType: 5, EventName: '安全帽检测' },
|
|
|
- { EventType: 6, EventName: '越线监测' },
|
|
|
- { EventType: 7, EventName: '区域围栏' },
|
|
|
- { EventType: 8, EventName: '反光衣检测' },
|
|
|
- { EventType: 9, EventName: '电动车检测' }
|
|
|
+ { EventType: '0', EventName: '人脸识别' },
|
|
|
+ { EventType: '1', EventName: '人流统计' },
|
|
|
+ { EventType: '2', EventName: '明烟明火' },
|
|
|
+ { EventType: '3', EventName: '抽烟打电话' },
|
|
|
+ { EventType: '4', EventName: '口罩检测' },
|
|
|
+ { EventType: '5', EventName: '安全帽检测' },
|
|
|
+ { EventType: '6', EventName: '越线监测' },
|
|
|
+ { EventType: '7', EventName: '区域围栏' },
|
|
|
+ { EventType: '8', EventName: '反光衣检测' },
|
|
|
+ { EventType: '9', EventName: '电动车检测' }
|
|
|
]
|
|
|
|
|
|
+ static eventTypeMap = new Map([
|
|
|
+ ['0', '人脸识别'],
|
|
|
+ ['1', '人流统计'],
|
|
|
+ ['2', '明烟明火'],
|
|
|
+ ['3', '抽烟打电话'],
|
|
|
+ ['4', '口罩检测'],
|
|
|
+ ['5', '安全帽检测'],
|
|
|
+ ['6', '越线监测'],
|
|
|
+ ['7', '区域围栏'],
|
|
|
+ ['8', '反光衣检测'],
|
|
|
+ ['9', '电动车检测']
|
|
|
+ ])
|
|
|
+
|
|
|
static async page (params: COMMON.API.QueryParams & {name?: string, state: 'OFFLINE' | 'ONLINE'}) {
|
|
|
return await getAiBoxPage(params)
|
|
|
}
|
|
|
@@ -31,6 +45,11 @@ export class AiboxController {
|
|
|
code === 200 ? message.success('修改成功') : message.error(msg)
|
|
|
}
|
|
|
|
|
|
+ static async levelUp (params: {devId: string, aiId: string, version: string, file: any}) {
|
|
|
+ const { code, data } = await aiboxLevelUp(params)
|
|
|
+ code === 200 && data ? message.success('升级成功') : message.error('升级失败')
|
|
|
+ }
|
|
|
+
|
|
|
static async taskById (clientId: string) {
|
|
|
const { code, data } = await getTaskByClientId(clientId)
|
|
|
if (code === 200) {
|
|
|
@@ -72,4 +91,23 @@ export class AiboxController {
|
|
|
static async event (params: {devId: string, eventType: CVS.AiBox.eventType, start: string, end: string}) {
|
|
|
return await getAiBoxEvent(params)
|
|
|
}
|
|
|
+
|
|
|
+ static async forward () {
|
|
|
+ return await getAiBoxForward()
|
|
|
+ }
|
|
|
+
|
|
|
+ static async addForward (data: CVS.AiBox.Forward) {
|
|
|
+ const { code, msg } = await addAiBoxForward(data)
|
|
|
+ code === 200 ? message.success('新增成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async updateForward (data: CVS.AiBox.Forward) {
|
|
|
+ const { code, msg } = await updateAiBoxForward(data)
|
|
|
+ code === 200 ? message.success('修改成功') : message.error(msg)
|
|
|
+ }
|
|
|
+
|
|
|
+ static async delForward (id: string, _data: CVS.AiBox.Forward) {
|
|
|
+ const { code, msg, data } = await delAiBoxForward(id, _data)
|
|
|
+ code === 200 && data ? message.success('删除成功') : message.error('删除失败')
|
|
|
+ }
|
|
|
}
|