guanqb
2023-05-08 a8c6dfabddb4156f0334fb4e21cc2e2affb12e1d
src/views/activity/components/twoDrawBtnBox.vue
@@ -6,26 +6,29 @@
                <span>要素资源:</span>
                <ul>
                    <li>
                        <button @click="drawThreeArrow('billboard', 'police', 'policeman')" title="警员">
                        <button
                            @click="drawThreeArrow('billboard', 'police', 'policeman')"
                            title="警员"
                        >
                            <img src="/img/icon/police-people-btn.png" style="height:100%" />
                        </button>
                    </li>
                    <li>
                        <button @click="drawThreeArrow('billboard', 'police', 'policecar')" title="警车">
                        <button
                            @click="drawThreeArrow('billboard', 'police', 'policecar')"
                            title="警车"
                        >
                            <img src="/img/icon/car-btn.png" style="height:100%" />
                        </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>
                    </li>
                    <li>
                        <button @click="drawThreeArrow('billboard', 'icon', 'icon4')" title="自定义图片标注">自定义图片标注</button>
                        <button @click="drawThreeArrow('billboard', 'icon', 'icon5')" title="其他">其他</button>
                    </li>
                </ul>
            </div>
@@ -45,10 +48,16 @@
                        <button @click="drawArrow('tailed_attack_arrow', 4)" title="燕尾箭头">燕尾箭头</button>
                    </li>
                    <li>
                        <button @click="drawThreeArrow('polygon', 'polygon', 'polygon')" title="多边形">多边形</button>
                        <button
                            @click="drawThreeArrow('polygon', 'polygon', 'polygon')"
                            title="多边形"
                        >多边形</button>
                    </li>
                    <li>
                        <button @click="drawThreeArrow('brokenline', 'brokenline', 'brokenline')" title="折线">折线</button>
                        <button
                            @click="drawThreeArrow('brokenline', 'brokenline', 'brokenline')"
                            title="折线"
                        >折线</button>
                    </li>
                </ul>
            </div>
@@ -57,7 +66,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>
@@ -215,6 +224,10 @@
                    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') {
@@ -361,6 +374,8 @@
            addPlotOverlayData.attrParams = { id: item.id, color: item.color, item }
            addPlotOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.reeditArrowClick)
            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(' ')
@@ -376,9 +391,6 @@
                    lat: Number(position[1]),
                    alt: Number(height[0]),
                }
                addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver)
                addPlotOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut)
                this.$parent.isHaveFactor = true
            } else {
@@ -434,8 +446,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
@@ -531,6 +545,10 @@
            if ('remark' in params && params.remark != '') {
                overlay.attrParams.item.remark = params.remark
            }
            if ('type' in params && params.type != '') {
                overlay.attrParams.item.type = params.type
            }
        },
        // 修改警车样式
@@ -594,13 +612,16 @@
                    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()
@@ -622,6 +643,7 @@
                        message: '保存成功',
                        type: 'success'
                    })
                    this.$EventBus.$emit('activeDeleteLineOrPoint', 'policecar')
                } else {
                    this.$message({
                        message: '保存失败',
@@ -641,6 +663,7 @@
                        message: '保存成功',
                        type: 'success'
                    })
                    this.$EventBus.$emit('activeDeleteLineOrPoint', 'policeman')
                    this.editPoliceStyle(params, overlay)
                } else {
                    this.$message({
@@ -655,6 +678,8 @@
            updateSecurityPlot(params).then(res => {
                if (res.data.success) {
                    this.editPlotStyle(params, overlay)
                    this.$EventBus.$emit('activeDeletePolygon')
                    this.$message({
                        message: '修改成功',
                        type: 'success'
@@ -698,18 +723,18 @@
.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 {
        height: 100%;
        &>div {
        & > div {
            display: flex;
        }