From f7f0e44c4be8eb0e77fd310296c3b43bde21e4f9 Mon Sep 17 00:00:00 2001 From: ZZJ <10913410+zzj2100@user.noreply.gitee.com> Date: 星期四, 23 六月 2022 14:17:01 +0800 Subject: [PATCH] 新增联动场景 --- src/views/hashrate/CameraManage/CameraRules/index.vue | 44 ++++++++++++++++++++++++++++++++++++-------- 1 files changed, 36 insertions(+), 8 deletions(-) diff --git a/src/views/hashrate/CameraManage/CameraRules/index.vue b/src/views/hashrate/CameraManage/CameraRules/index.vue index 402d63d..f951851 100644 --- a/src/views/hashrate/CameraManage/CameraRules/index.vue +++ b/src/views/hashrate/CameraManage/CameraRules/index.vue @@ -178,7 +178,9 @@ <!-- 鎽勫儚鏈� --> <LinkageCameraBox :cameras="item.cameraIds" - @addLinkageRule="addLinkageRule(item.cameraIds)" + @addLinkageRule=" + addLinkageRule(item.cameraIds, item.camera_polygons) + " ></LinkageCameraBox> <div class="Anchor" :id="'linkage_camera' + index"></div> @@ -355,6 +357,7 @@ }, showNewLinkage: false, newLinkageIds: [], + newLinkPlg: null, // swiperOption: { // slidesPerView: 5, @@ -807,7 +810,9 @@ this.showAddBox = true; }, - addLinkageRule(ids) { + addLinkageRule(ids, camera_polygons) { + console.log(7979); + console.log(camera_polygons); if (ids.length < 2) { this.$message({ message: "璇疯嚦灏戦�夋嫨涓ゅ彴鎽勫儚鏈�", @@ -818,6 +823,7 @@ this.newLinkageIds = ids; this.ruleType = "linkage"; this.showAddBox = true; + this.newLinkPlg = camera_polygons; }, //鍥炲~鏂扮殑鐙珛鍦烘櫙 @@ -835,6 +841,9 @@ }); } else { //鑱斿姩鍦烘櫙 + if (this.newLinkPlg) { + newRule.data.camera_polygons = this.newLinkPlg; + } newRule.data.cameraIds = this.newLinkageIds; this.linkageRule.push(newRule.data); this.$nextTick(() => { @@ -901,13 +910,32 @@ }; if (this.addData.type === "linkage") { this.addData.cameras = []; - this.linkageRule[index].camera_polygons.forEach((item) => { - this.addData.cameras.push({ - polygonData: item.polygon, - cameraName: item.camera_name, - cameraId: item.camera_id, + if ( + this.linkageRule[index].camera_polygons && + this.linkageRule[index].camera_polygons.length > 0 + ) { + this.linkageRule[index].camera_polygons.forEach((camera) => { + this.addData.cameras.push({ + polygonData: camera.polygon, + cameraName: camera.camera_name, + cameraId: camera.camera_id, + }); }); - }); + } else { + this.linkageRule[index].camera_polygons = []; + this.Carmeras.forEach((camera) => { + this.addData.cameras.push({ + polygonData: camera.polygonData, + cameraName: camera.cameraName, + cameraId: camera.cameraId, + }); + this.linkageRule[index].camera_polygons.push({ + polygon: camera.polygonData, + camera_name: camera.cameraName, + camera_id: camera.cameraId, + }); + }); + } } this.showSdkBox = false; this.showSdkSettingBox = true; -- Gitblit v1.8.0