guanqb
2023-03-07 161d37b6d48f11175b4decfc337c83730ef15761
活动图标添加
4 files modified
1 files added
126 ■■■■ changed files
public/img/icon/icon1.png patch | view | raw | blame | history
public/img/icon/icon2.png patch | view | raw | blame | history
public/img/icon/icon3.png patch | view | raw | blame | history
src/views/activity/components/drawBtnBox.vue 29 ●●●● patch | view | raw | blame | history
src/views/activity/index.vue 97 ●●●● patch | view | raw | blame | history
public/img/icon/icon1.png

public/img/icon/icon2.png

public/img/icon/icon3.png
src/views/activity/components/drawBtnBox.vue
@@ -15,6 +15,15 @@
                            <img src="/img/icon/car-btn.png" style="height:100%" />
                        </button>
                    </li>
                    <li>
                        <button @click="drawArrow('billboard', 'icon1')" title="普通群众">普通群众</button>
                    </li>
                    <li>
                        <button @click="drawArrow('billboard', 'icon2')" title="保护对象">保护对象</button>
                    </li>
                    <li>
                        <button @click="drawArrow('billboard', 'icon3')" title="危险人物">危险人物</button>
                    </li>
                </ul>
            </div>
            <div>
@@ -35,9 +44,6 @@
                    </li>
                    <li>
                        <button @click="drawArrow('polygon')" title="多边形">多边形</button>
                    </li>
                    <li>
                        <button @click="drawArrow('billboard', 'icon1')" title="头像1">头像1</button>
                    </li>
                </ul>
            </div>
@@ -205,20 +211,26 @@
                plot && plot.draw(type, overlay => {
                    if (iconType == 'icon1') {
                        overlay.icon = '/img/icon/icon1.png'
                        that.$parent.plotSaveType = 6
                        overlay.size = [24, 24]
                    }else if (iconType == 'icon2') {
                        that.$parent.plotSaveType = 7
                        overlay.size = [32, 32]
                    }else if (iconType == 'icon3') {
                        that.$parent.plotSaveType = 8
                    }
                    overlay.icon = `/img/icon/${iconType}.png`
                    if (overlay) {
                        drawArrowLayers.addOverlay(overlay)
                        plot.edit(overlay, (e) => {
                            flag = true
                            that.$parent.plotPointPositionStr = overlay._positions._lng + ' ' + overlay._positions._lat
                            that.$parent.plotPointPositionStr = overlay._position._lng + ' ' + overlay._position._lat
                            document.oncontextmenu = function () {
                                if (flag) {
                                    that.$parent.choosePlotColor = '#409EFF'
                                    that.$parent.choosePlotColorAlpha = 48
                                    that.$parent.choosePlotColor = iconType == 'icon3'?'#d81e06':'#409EFF'
                                    that.$parent.choosePlotColorAlpha = 100
                                    that.$parent.polygonAddVisible = true
                                    that.$parent.isNeedName = false
                                    flag = false
@@ -332,7 +344,8 @@
                        type: 'error'
                    })
                }
                this.$parent.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch)
                this.$parent.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'billboard')
                this.$parent.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'plot')
            })
        },
    },
src/views/activity/index.vue
@@ -677,7 +677,9 @@
            this.getSecurityPoliceList(item.id, this.policeSwitch)
            this.getSecurityCarList(item.id, this.policeSwitch, this.polylineBtnSwitch)
            // 作战标绘
            this.getSecurityPlotList(item.id, this.arrowBtnSwitch)
            this.getSecurityPlotList(item.id, this.policeSwitch,'billboard')
            this.getSecurityPlotList(item.id, this.arrowBtnSwitch,'plot')
            this.activityDetails = item
@@ -708,16 +710,19 @@
            this.getSecurityList(this.currentPage, this.pagesize)
        },
        // 切换轨警力资源显示
        switchChange (e) {
            this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, 'car')
            this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch)
            this.getSecurityPlotList(this.showingSecurityId, this.policeSwitch,'billboard')
            this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'plot')
        },
        // 切换作战标绘
        switchArrowBtnChange (e) {
            this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch)
            this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'plot')
            this.getSecurityPlotList(this.showingSecurityId, this.policeSwitch,'billboard')
        },
        // 切换轨迹播放控件
@@ -726,7 +731,7 @@
        },
        // 获取活动标绘箭头列表
        getSecurityPlotList (securityId, arrowShow) {
        getSecurityPlotList (securityId, arrowShow, showType) {
            arrowsListLayer.clear()
            this.$refs.DRAWBTNBOX.removeDrawArrow()
@@ -750,19 +755,19 @@
                        let a = Math.floor(Number(item.color.split(',')[1]) * 2.55)
                        color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, a)
                    }
                    if (item.type == 1) {
                    if (item.type == 1 && showType == 'plot') {
                        chooseArrow = new global.DC.AttackArrow(position)
                        arrowsListLayer.addOverlay(chooseArrow)
                    } else if (item.type == 2) {
                    } else if (item.type == 2 && showType == 'plot') {
                        chooseArrow = new global.DC.DoubleArrow(position)
                        arrowsListLayer.addOverlay(chooseArrow)
                    } else if (item.type == 3) {
                    } else if (item.type == 3 && showType == 'plot') {
                        chooseArrow = new global.DC.FineArrow(position)
                        arrowsListLayer.addOverlay(chooseArrow)
                    } else if (item.type == 4) {
                    } else if (item.type == 4 && showType == 'plot') {
                        chooseArrow = new global.DC.TailedAttackArrow(position)
                        arrowsListLayer.addOverlay(chooseArrow)
                    } else if (item.type == 5) {
                    } else if (item.type == 5 && showType == 'plot') {
                        chooseArrow = new global.DC.Polygon(position)
                        arrowsListLayer.addOverlay(chooseArrow)
                        // 缓存区的话需要扣去包含的核心区
@@ -798,37 +803,45 @@
                        // nameLabel.setStyle({
                        //     "font": "30px",
                        // })
                    } else if (item.type == 6) {
                    } else if (showType == 'billboard' && (item.type == 6 || item.type == 7 || item.type == 8)) {
                        let iconImgName = ''
                        if (item.type == 6) {
                            iconImgName = 'icon1'
                        }else if (item.type == 7) {
                            iconImgName = 'icon2'
                        }else if (item.type == 8) {
                            iconImgName = 'icon3'
                        }
                        position = position.split(';')[0].split(',')
                        position = new global.DC.Position(Number(position[0]), Number(position[1]))
                        let pointPosition = new global.DC.Position(Number(position[0]), Number(position[1]))
                        position = new global.DC.Position(Number(position[0]), Number(position[1]),0.5)
                        chooseArrow = new global.DC.Billboard(position, `/img/icon/${iconImgName}.png`)
                        chooseArrow.size = item.type == 6 ?[24, 24]:[32,32]
                        arrowsListLayer.addOverlay(chooseArrow)
                        chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item }
                        chooseArrow.setStyle({
                            "material": color,
                        })
                        chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick)
                        // let point = new global.DC.Point(pointPosition)
                        // arrowsListLayer.addOverlay(point)
                        // point.attrParams = { 'id': item.id, 'color': item.color, item }
                        // point.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick)
                        // point.setStyle({
                        //     "color": color, //颜色
                        //     "outlineColor": color, //边框颜色
                        //     "outlineWidth": 0, //边框大小,
                        //     "pixelSize": 32,
                        // })
                        let point = new global.DC.Point(pointPosition)
                        arrowsListLayer.addOverlay(point)
                        point.attrParams = { 'id': item.id, 'color': item.color, item }
                        point.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick)
                        point.setStyle({
                            "color": color, //颜色
                            "outlineColor": color, //边框颜色
                            "outlineWidth": 0, //边框大小,
                            "pixelSize": 32,
                        })
                    }
                    chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item }
                    chooseArrow.setStyle({
                        "material": color,
                    })
                    chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick)
                    if(chooseArrow!=null){
                        chooseArrow.attrParams = { 'id': item.id, 'color': item.color, item }
                        chooseArrow.setStyle({
                            "material": color,
                        })
                        chooseArrow.on(global.DC.MouseEventType.CLICK, this.reeditArrowClick)
                    }
                    // let position1 = new global.DC.Position(117.94218262137659, 28.434842894894153)
                    // let Label = new global.DC.Label(position1, 'test')
@@ -1089,8 +1102,6 @@
            this.getSecurityList(this.currentPage, this.pagesize, this.activityType, this.searchActivity, startTime, endTime)
        },
        // 扁平化树状数据
        platFn (list) {
            let res = []
@@ -1156,8 +1167,6 @@
                this.getSecurityCarList(params.securityId, this.policeSwitch, this.polylineBtnSwitch, params.type == 1 ? 'line' : 'car')
            })
        },
        // 活动添加警员
        // policemanId警车id, position坐标, securityId活动id, type线面类型
@@ -1287,11 +1296,6 @@
        },
        // 关闭活动详情弹窗
        closeActivityDetails () {
            this.dialogVisible = false
@@ -1315,11 +1319,6 @@
                pointCircleCarLayer.clear()
            }
        },
        // 大小重置
        boxResize (val) {
@@ -1508,11 +1507,10 @@
                        type: 'error'
                    })
                }
                this.getSecurityPlotList(params.securityId, this.arrowBtnSwitch)
                this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'billboard')
                this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'plot')
            })
        },
        // 双击修改箭头
        reeditArrowDbClick (e) {
@@ -1524,7 +1522,7 @@
            plotOverlayData = e
            this.choosePlotColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color.slice(0, 7) : '#409EFF'
            this.choosePlotColorAlpha = e.overlay.attrParams.color != '' ? Number(e.overlay.attrParams.color.split(',')[1]) : 48
            this.choosePlotColorAlpha = e.overlay.attrParams.color != '' ? Number(e.overlay.attrParams.color.split(',')[1]) : 100
            if (e.overlay.attrParams.item.type == 5) {
                this.polygonAreaType = e.overlay.attrParams.item.areaType != '' ? e.overlay.attrParams.item.areaType : 1
@@ -1567,8 +1565,6 @@
            this.editPlotVisible = false
        },
        // 搜索数据地图对应场所
        getSearchInfo (deptId, search, iconType) {
            getSearchInfo(deptId, search).then(res => {
@@ -1591,8 +1587,6 @@
            })
        },
        // 保存巡逻路线信息
        saveLineInfo () {
            this.$refs.DRAWBTNBOX.updateActivityCar({ id: this.policeIconId, color: this.chooseColor, width: this.lineWidth })
@@ -1610,8 +1604,6 @@
            })
            this.cancelSaveLine()
        },
        // 修改巡逻路线位置信息
        editLineInfo () {
@@ -1724,7 +1716,8 @@
                        type: 'error'
                    })
                }
                this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch)
                this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'billboard')
                this.getSecurityPlotList(this.showingSecurityId, this.arrowBtnSwitch,'plot')
            })
        },