guanqb
2023-03-15 1f0cfb009e7348929325cb3f2af0107e4e524a52
警员新增修改
3 files modified
53 ■■■■■ changed files
src/store/modules/popupParams.js 1 ●●●● patch | view | raw | blame | history
src/views/activity/components/drawBtnBox.vue 15 ●●●●● patch | view | raw | blame | history
src/views/activity/index.vue 37 ●●●●● patch | view | raw | blame | history
src/store/modules/popupParams.js
@@ -33,6 +33,7 @@
        SET_ACTIVITYPOLICEPOPUP (state, activityPolicePopup) {
            state.activityPolicePopup = activityPolicePopup
            // console.log('isshowPopup', activityPolicePopup)
        },
        SET_ACTIVITYPOLICEPOPUPDATA (state, activityPolicePopupData) {
src/views/activity/components/drawBtnBox.vue
@@ -157,15 +157,13 @@
            global.viewer.tooltip.enable = true
            // this.policeType = ''  // ?
            plot && plot.draw(poltType, overlay => {
                if (isAddLabel) return
                if (poltType == 'billboard' && policeType == 'policeman') {
                    overlay.icon = '/img/icon/man3.png'
                } else if (poltType == 'billboard' && policeType == 'policecar') {
                    overlay.icon = '/img/car3.png'
                    overlay.icon = '/img/icon/car3.png'
                }
                if (overlay) {
@@ -195,6 +193,7 @@
                                } else if (policeType == 'policecar') {
                                    that.$emit('setPoliceOption')
                                    that.$parent.chooseCarColor = '#FF0000'
                                    that.$parent.policeType = ''
                                    that.$parent.policeChooseCarVisible = true
                                }
                                flag = false
@@ -348,8 +347,11 @@
        // 删除所有地图绘制元素
        removeDraw () {
            // drawLayers != null && drawLayers.clear()
            addPoliceIconOverlayData!= null && !addPoliceIconOverlayData.attrParams && addPoliceIconOverlayData.remove()
        },
        clearDraw(){
            drawLayers != null && drawLayers.clear()
        },
        removeDrawArrow () {
@@ -497,17 +499,18 @@
                    "outlineWidth": 0, //边框大小,
                    "pixelSize": 32,
                })
                point.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick)
                // point.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick)
                point.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver)
                point.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut)
                addPoliceIconOverlayData.attrParams = positionObj
                addPoliceIconOverlayData.attrParams.pointOverlayData = point
                addPoliceIconOverlayData.position = {
                 lng: Number(positionArr[0]),
                 lat: Number(positionArr[1]),
                 alt: 0.5,
                }
                addPoliceIconOverlayData.on(global.DC.MouseEventType.CLICK, this.$parent.overlayTypeClick)
                addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver)
                // addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OVER, this.$parent.pointMouseOver)
                addPoliceIconOverlayData.on(global.DC.MouseEventType.MOUSE_OUT, this.$parent.pointMouseOut)
        },
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 = []
@@ -628,7 +629,7 @@
            this.$refs.DRAWBTNBOX.removeDraw()
            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 })
@@ -1439,12 +1440,14 @@
        // 地图绘制元素点击事件
        overlayTypeClick (e) {
            console.log(e,336633);
            if (this.userInfo.dept_id == '1123598813738675201' || this.userInfo.dept_id == this.activityDeptId) {
                this.isChoosePoliceElementDisabled = false
            } 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
@@ -1644,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'
@@ -1654,7 +1661,7 @@
                        type: 'error'
                    })
                }
                this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, type)
                // this.getSecurityCarList(this.showingSecurityId, this.policeSwitch, this.polylineBtnSwitch, type)
            })
        },
@@ -1662,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'
@@ -1672,7 +1683,7 @@
                        type: 'error'
                    })
                }
                this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch)
                // this.getSecurityPoliceList(this.showingSecurityId, this.policeSwitch)
            })
        },
@@ -1809,9 +1820,9 @@
    },
    watch: {
        searchPoliceTreeName (val) {
            this.$refs.policeTree.filter(val)
        },
        // searchPoliceTreeName (val) {
        //     this.$refs.policeTree.filter(val)
        // },
        policeChooseVisible (val) {
            if (val) {