From 29a5477f5c121541ff30bf6b4e8da3b2e218d4b7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 15 Mar 2023 11:44:50 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/srs-police-affairs

---
 src/views/activity/index.vue |   38 +++++++++++++++++++++++++-------------
 1 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/src/views/activity/index.vue b/src/views/activity/index.vue
index 616ee5c..e1a0006 100644
--- a/src/views/activity/index.vue
+++ b/src/views/activity/index.vue
@@ -260,6 +260,7 @@
 let overlayObj = {}
 let lineObjdata = null
 let plotOverlayData = null
+let policeOverlayData = null
 let policecarOption = []
 let cameraList = []
 let carList = []
@@ -627,8 +628,8 @@
             this.polylineBtnSwitch = false
 
             this.$refs.DRAWBTNBOX.removeDraw()
-            this.$refs.DRAWBTNBOX.removeDrawArrow()
-
+            this.$refs.DRAWBTNBOX.clearDrawArrow()
+            this.$refs.DRAWBTNBOX.clearDraw()
             arrowsListLayer != null && arrowsListLayer.clear()
 
             this.$EventBus.$emit('mapClearLayer', {
@@ -970,9 +971,10 @@
                     "outlineWidth": 0, //边框大小,
                     "pixelSize": 32,
                 })
-                point.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick)
+                // point.on(global.DC.MouseEventType.CLICK, this.overlayTypeClick)
                 point.on(global.DC.MouseEventType.MOUSE_OVER, this.pointMouseOver)
                 point.on(global.DC.MouseEventType.MOUSE_OUT, this.pointMouseOut)
+                positionObj.pointOverlayData = point
                 this.$EventBus.$emit('layerPointAdd', {
                     layerName: mapLayer,
                     type: 'billboard',
@@ -1147,6 +1149,7 @@
         addCarAndRange (params) {
             addCarAndRange(params).then(res => {
                 if (res.data.success) {
+                    this.$refs.DRAWBTNBOX.addNewPolice(res.data.data,'policeman')
                     this.$message({
                         message: '添加成功',
                         type: 'success'
@@ -1157,7 +1160,7 @@
                         type: 'error'
                     })
                 }
-                this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch, params.type == 1 ? 'line' : 'car')
+                // this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch, params.type == 1 ? 'line' : 'car')
             })
         },
 
@@ -1357,14 +1360,14 @@
         policeChooseBeforeClose () {
             this.policeChooseVisible = false
             this.policeIconIsCreated = false
-            // this.$refs.DRAWBTNBOX.removeDraw()
+            this.$refs.DRAWBTNBOX.removeDraw()
         },
 
         // 选择警车关闭
         policeChooseCarBeforeClose () {
             this.policeChooseCarVisible = false
             this.policeIconIsCreated = false
-            // this.$refs.DRAWBTNBOX.removeDraw()
+            this.$refs.DRAWBTNBOX.removeDraw()
         },
 
         // 选择警员确认按钮
@@ -1418,9 +1421,7 @@
                         this.addActivityPolice({ policemanId: this.searchPoliceTreeId, position: position, securityId: this.showingSecurityId, type: type, color: this.choosePoliceColor })
                         this.policeIconIsCreated = false
                     }
-
                 }
-
             } else {
                 if (this.policeChooseVisible == true) {
                     this.updateActivityPolice({ id: this.policeIconId, policemanId: this.searchPoliceTreeId, color: this.choosePoliceColor })
@@ -1444,6 +1445,9 @@
             } else {
                 this.isChoosePoliceElementDisabled = true
             }
+
+            policeOverlayData = e
+
             if ('policemanId' in e.overlay.attrParams.data) {
                 this.policeIconId = e.overlay.attrParams.data.id
                 this.policeType = e.overlay.attrParams.data.policemanId
@@ -1643,6 +1647,10 @@
         deleteActivityCar (id, type) {
             deleteActivityCar(id).then(res => {
                 if (res.data.success) {
+                    policeOverlayData.overlay.remove()
+                    if('pointOverlayData' in policeOverlayData.overlay.attrParams){
+                        policeOverlayData.overlay.attrParams.pointOverlayData.remove()
+                    }
                     this.$message({
                         message: '删除成功',
                         type: 'success'
@@ -1653,7 +1661,7 @@
                         type: 'error'
                     })
                 }
-                this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, type)
+                // this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, type)
             })
         },
 
@@ -1661,6 +1669,10 @@
         deleteActivityPolice (id) {
             deleteActivityPolice(id).then(res => {
                 if (res.data.success) {
+                    policeOverlayData.overlay.remove()
+                    if('pointOverlayData' in policeOverlayData.overlay.attrParams){
+                        policeOverlayData.overlay.attrParams.pointOverlayData.remove()
+                    }
                     this.$message({
                         message: '删除成功',
                         type: 'success'
@@ -1671,7 +1683,7 @@
                         type: 'error'
                     })
                 }
-                this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch)
+                // this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch)
             })
         },
 
@@ -1808,9 +1820,9 @@
     },
 
     watch: {
-        searchPoliceTreeName (val) {
-            this.$refs.policeTree.filter(val)
-        },
+        // searchPoliceTreeName (val) {
+        //     this.$refs.policeTree.filter(val)
+        // },
 
         policeChooseVisible (val) {
             if (val) {

--
Gitblit v1.9.3