From 804eb8ca53ae3b002d96e2284f6f00632c74d9f3 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Wed, 22 Mar 2023 10:34:17 +0800
Subject: [PATCH] 警员警车预警范围显示问题修改

---
 src/views/activity/components/drawBtnBox.vue |   87 ++++++++++++++++++++++---------------------
 1 files changed, 45 insertions(+), 42 deletions(-)

diff --git a/src/views/activity/components/drawBtnBox.vue b/src/views/activity/components/drawBtnBox.vue
index 9730f1a..dde0266 100644
--- a/src/views/activity/components/drawBtnBox.vue
+++ b/src/views/activity/components/drawBtnBox.vue
@@ -683,51 +683,54 @@
             }
 
             if ('width' in params) {
-                if (overlay.attrParams && overlay.attrParams.data && overlay.attrParams.data.type && overlay.attrParams.data.type == 3) return
-                let linePosition = ''
-                if ('position' in params) {
-                    linePosition = params.position.replace(/,/g, ";").replace(/ /g, ",")
+                if (overlay.attrParams && overlay.attrParams.data && overlay.attrParams.data.type && overlay.attrParams.data.type == 3) {
+                    overlay.attrParams.data.width = params.width
                 } else {
-                    linePosition = overlay.attrParams.linePositionStr
-                }
-                let coords = global.DC.GeoTools.polylineBuffer(linePosition, params.width)
-                let positionStr = ''
-                coords.forEach((item, index) => {
-                    if (!(index == coords.length - 1)) {
-                        positionStr += item[0] + ',' + item[1] + ';'
+                    let linePosition = ''
+                    if ('position' in params) {
+                        linePosition = params.position.replace(/,/g, ";").replace(/ /g, ",")
+                    } else {
+                        linePosition = overlay.attrParams.linePositionStr
                     }
-                })
-                positionStr = positionStr.slice(0, positionStr.length - 1)
-                // 面颜色
-                let color = ''
-                // 线颜色
-                let lineColor = ''
-                if (params.color == '') {
-                    color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150)
-                } else {
-                    let r = parseInt(params.color.slice(1, 3), 16)
-                    let g = parseInt(params.color.slice(3, 5), 16)
-                    let b = parseInt(params.color.slice(5, 7), 16)
-                    color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150)
-                    lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255)
-                }
-                overlay.attrParams.lineObj.setStyle({
-                    "material": lineColor,
-                    'width': 3
-                })
-                overlay.attrParams.linePositionStr = linePosition
-                overlay.attrParams.polygonPositionStr = positionStr
-                overlay.attrParams.color = params.color
+                    let coords = global.DC.GeoTools.polylineBuffer(linePosition, params.width)
+                    let positionStr = ''
+                    coords.forEach((item, index) => {
+                        if (!(index == coords.length - 1)) {
+                            positionStr += item[0] + ',' + item[1] + ';'
+                        }
+                    })
+                    positionStr = positionStr.slice(0, positionStr.length - 1)
+                    // 面颜色
+                    let color = ''
+                    // 线颜色
+                    let lineColor = ''
+                    if (params.color == '') {
+                        color = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 150)
+                    } else {
+                        let r = parseInt(params.color.slice(1, 3), 16)
+                        let g = parseInt(params.color.slice(3, 5), 16)
+                        let b = parseInt(params.color.slice(5, 7), 16)
+                        color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150)
+                        lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255)
+                    }
+                    overlay.attrParams.lineObj.setStyle({
+                        "material": lineColor,
+                        'width': 3
+                    })
+                    overlay.attrParams.linePositionStr = linePosition
+                    overlay.attrParams.polygonPositionStr = positionStr
+                    overlay.attrParams.color = params.color
 
-                let areaPolygon = new global.DC.Polygon(positionStr)
-                drawLayers.addOverlay(areaPolygon)
-                areaPolygon.setStyle({
-                    'material': color,
-                    'height': 0.01,
-                })
-                areaPolygon.attrParams = overlay.attrParams
-                areaPolygon.on(global.DC.MouseEventType.CLICK, this.$parent.lineOverlayTypeClick)
-                overlay.remove()
+                    let areaPolygon = new global.DC.Polygon(positionStr)
+                    drawLayers.addOverlay(areaPolygon)
+                    areaPolygon.setStyle({
+                        'material': color,
+                        'height': 0.01,
+                    })
+                    areaPolygon.attrParams = overlay.attrParams
+                    areaPolygon.on(global.DC.MouseEventType.CLICK, this.$parent.lineOverlayTypeClick)
+                    overlay.remove()
+                }
             }
         },
 

--
Gitblit v1.9.3