| | |
| | | import { getCameraInfo } from "@/api/camera"; |
| | | import { getAllPolygon } from "@/api/polygon"; |
| | | import { getDirDetails, findAllFileByStackId } from "@/api/localVedio"; |
| | | import { getCameraSceneRule } from '@/api/scene' |
| | | import { getCameraSceneRule,getLinkSceneRule } from '@/api/scene' |
| | | |
| | | |
| | | export default class VideoRuleData { |
| | | public selectTask: Array<object>; |
| | |
| | | public resolutionOption: Array<any>; |
| | | public selectResolution: string; |
| | | public hasCtrlC: boolean; |
| | | public allSceneRule:Array<any>; |
| | | |
| | | constructor(id: string) { |
| | | this.loading = false; |
| | |
| | | this.type = 0; |
| | | this.selectTask = []; |
| | | this.polygonData = []; |
| | | this.allSceneRule = [] |
| | | this.canvasData = { |
| | | line: [], |
| | | arrow: [], |
| | |
| | | public async update() { |
| | | await this.getInfo(); |
| | | await this.getSceneRule(); |
| | | |
| | | await this.getPolygon(); |
| | | await this.getLinkRule() |
| | | } |
| | | |
| | | public async getInfo() { |
| | |
| | | this.dealWay = rsp.data.cameraInfo.run_type === 1 ? true : false |
| | | this.runServerName = rsp.data.cameraInfo.runServerName |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | public async getLinkRule() { |
| | | const rsp: any = await getLinkSceneRule({ cameraIds: [this.cameraId] }); |
| | | if (rsp && rsp.success) { |
| | | let rules = rsp.data.rules; |
| | | // 统一规则编辑的数据结构 |
| | | for (let i = 0; i < rules.length; i++) { |
| | | rules[i].group_rules = rules[i].rules; |
| | | } |
| | | rules = rsp.data.rules; |
| | | this.allSceneRule = this.rules.concat(rules) |
| | | } |
| | | } |
| | | } |