From 1a783e0a2068b1a99efb7a078f4a615f68dec18f Mon Sep 17 00:00:00 2001 From: heyujie <516346543@qq.com> Date: 星期一, 18 七月 2022 16:15:35 +0800 Subject: [PATCH] add desc --- src/views/hashrate/CameraManage/CameraRules/index.vue | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 42 insertions(+), 3 deletions(-) diff --git a/src/views/hashrate/CameraManage/CameraRules/index.vue b/src/views/hashrate/CameraManage/CameraRules/index.vue index abca946..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> @@ -242,7 +244,7 @@ :linkEditCamera=" ruleType === 'linkage' && editSdkObj ? editSdkObj.camera_polygons : null " - :Cameras="ruleType === 'linkage' ? Carmeras : [Camera]" + :Cameras="ruleType === 'linkage' ? addData.cameras : [Camera]" ></SdkSettingBox> <!-- 閬僵灞� --> @@ -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(() => { @@ -899,6 +908,35 @@ type, index, }; + if (this.addData.type === "linkage") { + this.addData.cameras = []; + 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; }, @@ -911,6 +949,7 @@ newRule.rule_with_pre = "&&"; newRule.is_save_anyhow = true; } + this.SeparateRules[this.addData.index].rules.push(newRule); } -- Gitblit v1.8.0