From f13afcb61276061871b30bce17a7877287df0b67 Mon Sep 17 00:00:00 2001
From: guanqb <18720758508@163.com>
Date: Sat, 20 Jan 2024 09:56:43 +0800
Subject: [PATCH] 1
---
src/views/activity/components/twoDrawBtnBox.vue | 73 +++++++++++++++++++++++++++---------
1 files changed, 54 insertions(+), 19 deletions(-)
diff --git a/src/views/activity/components/twoDrawBtnBox.vue b/src/views/activity/components/twoDrawBtnBox.vue
index 18532aa..f42ee79 100644
--- a/src/views/activity/components/twoDrawBtnBox.vue
+++ b/src/views/activity/components/twoDrawBtnBox.vue
@@ -16,13 +16,10 @@
</button>
</li>
<li>
- <button @click="drawThreeArrow('billboard', 'icon', 'icon1')" title="普通群众">普通群众</button>
+ <button @click="drawThreeArrow('billboard', 'icon', 'icon4')" title="自定义图片标注">自定义图片标注</button>
</li>
<li>
- <button @click="drawThreeArrow('billboard', 'icon', 'icon2')" title="保护对象">保护对象</button>
- </li>
- <li>
- <button @click="drawThreeArrow('billboard', 'icon', 'icon3')" title="危险人物">危险人物</button>
+ <button @click="drawThreeArrow('billboard', 'icon', 'icon5')" title="其他">其他</button>
</li>
</ul>
</div>
@@ -54,7 +51,7 @@
<ul>
<li>
<!-- <el-button
- ></el-button>-->
+ ></el-button>-->
<button @click="drawThreeArrow('polyline', 'policecar')" title="巡逻路线">
<img src="/img/icon/route1.png" style="height:100%" />
</button>
@@ -208,6 +205,14 @@
imgUrl = 'wxrw'
material = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 255)
break
+ case 'icon4':
+ imgUrl = 'custom'
+ material = global.DC.Namespace.Cesium.Color.fromBytes(255, 0, 0, 255)
+ break
+ case 'icon5':
+ imgUrl = 'rest'
+ material = global.DC.Namespace.Cesium.Color.fromBytes(0, 183, 238, 255)
+ break
}
if (type == 'polygon') {
@@ -230,7 +235,8 @@
material: global.DC.Namespace.Cesium.Color.fromBytes(64, 158, 255, 122),
outline: true,
outlineColor: global.DC.Namespace.Cesium.Color.fromBytes(64, 158, 255, 255),
- outlineWidth: 4.0,
+ outlineWidth: 1.0,
+ height: 0
})
} else if (type == 'brokenline') {
drawThreeTool && drawThreeTool.draw('polyline', overlay => {
@@ -353,9 +359,13 @@
addPlotOverlayData.attrParams = { id: item.id, color: item.color, item }
addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick)
- if (item.type == 6 || item.type == 7 || item.type == 8) {
+ addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver)
+ addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut)
+ if (item.type == 6 || item.type == 7 || item.type == 8 || item.type == 11) {
const height = item.altitude.split(',')
let position = item.position.slice(12, item.position.length - 2).split(',')[0].split(' ')
+
+ if (item.iconUrl != '') addPlotOverlayData.icon = item.iconUrl
addPlotOverlayData.setStyle({
color: color
@@ -407,8 +417,8 @@
lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255)
}
addPlotOverlayData.setStyle({
- material: lineColor,
- width: 3
+ material: new global.DC.PolylineArrowMaterialProperty(lineColor),
+ width: 10
})
data.linePositionStr = positionNewArr
@@ -421,8 +431,10 @@
layerName: 'newCarDrawLineLayers',
positions: positionStr,
material: color,
- params: data,
- incident: this.$parent.lineOverlayTypeClick
+ params: { ...data, item: data, data: data },
+ incident: this.$parent.lineOverlayTypeClick,
+ mouseOverIncident: this.$parent.pointMouseOver,
+ mouseOutIncident: this.$parent.pointMouseOut
})
this.$parent.isHaveLine = true
@@ -510,6 +522,18 @@
"font": `${params.width}px sans-serif`
})
}
+
+ if ('icon' in params && params.icon != '') {
+ overlay.icon = params.icon
+ }
+
+ if ('remark' in params && params.remark != '') {
+ overlay.attrParams.item.remark = params.remark
+ }
+
+ if ('type' in params && params.type != '') {
+ overlay.attrParams.item.type = params.type
+ }
},
// 修改警车样式
@@ -566,24 +590,31 @@
lineColor = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 255)
}
overlay.attrParams.lineObj.setStyle({
- "material": lineColor,
- 'width': 3
+ material: new global.DC.PolylineArrowMaterialProperty(lineColor),
+ width: 10
})
overlay.attrParams.linePositionStr = linePosition
overlay.attrParams.polygonPositionStr = positionStr
overlay.attrParams.color = params.color
overlay.attrParams.width = params.width
+ overlay.attrParams.remark = params.remark
this.$EventBus.$emit('layerPolygonAdd', {
layerName: 'newCarDrawLineLayers',
positions: positionStr,
material: color,
- params: overlay.attrParams,
- incident: this.$parent.lineOverlayTypeClick
+ params: { ...overlay.attrParams, item: overlay.attrParams, data: overlay.attrParams },
+ incident: this.$parent.lineOverlayTypeClick,
+ mouseOverIncident: this.$parent.pointMouseOver,
+ mouseOutIncident: this.$parent.pointMouseOut
})
overlay.remove()
}
+ }
+
+ if ('remark' in params) {
+ overlay.attrParams.data.remark = params.remark
}
},
@@ -597,6 +628,7 @@
message: '保存成功',
type: 'success'
})
+ this.$EventBus.$emit('activeDeleteLineOrPoint', 'policecar')
} else {
this.$message({
message: '保存失败',
@@ -616,6 +648,7 @@
message: '保存成功',
type: 'success'
})
+ this.$EventBus.$emit('activeDeleteLineOrPoint', 'policeman')
this.editPoliceStyle(params, overlay)
} else {
this.$message({
@@ -630,6 +663,8 @@
updateSecurityPlot(params).then(res => {
if (res.data.success) {
this.editPlotStyle(params, overlay)
+ this.$EventBus.$emit('activeDeletePolygon')
+
this.$message({
message: '修改成功',
type: 'success'
@@ -673,12 +708,12 @@
.draw-btn-box {
position: fixed;
display: flex;
- // left: 50%;
- bottom: 40px;
+ left: 50%;
+ bottom: 0px;
color: #fff;
background: $bg-one-color;
white-space: nowrap;
- // transform: translate(-50%, 0);
+ transform: translate(-50%, 0);
.left,
.right {
--
Gitblit v1.9.3