| | |
| | | let drawLabelStatus = 'end' |
| | | let curLinePolygonPosition = '' |
| | | let curLinePosition = '' |
| | | let realPoliceTimer = {} |
| | | |
| | | export default { |
| | | inject: ['userInfo'], |
| | |
| | | isNeedPolygonType: false, |
| | | plotPointPositionStr: '', |
| | | pointAreaWidth:100, |
| | | dataTreeCheckedNodes:[], |
| | | } |
| | | }, |
| | | |
| | |
| | | this.getSecurityList(this.currentPage, this.pagesize) |
| | | |
| | | //摄像头 |
| | | this.getEquipmentAll({ type: 1 }) |
| | | this.getEquipmentAll({ type: 1},'') |
| | | //警车 |
| | | this.getEquipmentAll({ type: 0 }); |
| | | this.getEquipmentAll({ type: 0},''); |
| | | //手台-公网 |
| | | this.getEquipmentAll({ type: "2-1" }); |
| | | this.getEquipmentAll({ type: "2-1" },''); |
| | | //手台-专网 |
| | | this.getEquipmentAll({ type: "2-2" }); |
| | | this.getEquipmentAll({ type: "2-2" },''); |
| | | //执法记录仪 |
| | | this.getEquipmentAll({ type: 3 }) |
| | | this.getEquipmentAll({ type: 3 },'') |
| | | |
| | | }, |
| | | |
| | |
| | | * @return {*} |
| | | */ |
| | | activityListClick (item, index) { |
| | | if (this.currentClickIndex !== '' && this.currentClickIndex == index) { |
| | | return |
| | | } |
| | | |
| | | this.policeSwitch = true |
| | | this.arrowBtnSwitch = true |
| | | this.polylineBtnSwitch = false |
| | |
| | | }) |
| | | |
| | | this.dialogVisible = true |
| | | |
| | | // 遍历实时警力 |
| | | this.eachDataTreeCheckedNodes(this.dataTreeCheckedNodes) |
| | | }, |
| | | |
| | | // 分页页码变化事件 |
| | |
| | | |
| | | // 树形控件选中事件 |
| | | treeCheckClick (e1, e2) { |
| | | // 没有选中活动就不展示实时图标 |
| | | const that = this |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'activeHeatLayer', |
| | | type: 'HeatLayer' |
| | | }) |
| | | |
| | | if (e1.label == '热力图' && e2.checkedKeys.some(item => { |
| | | return item == 777 |
| | | })) { |
| | |
| | | } |
| | | }) |
| | | } |
| | | |
| | | this.dataTreeCheckedNodes = e2.checkedNodes |
| | | this.eachDataTreeCheckedNodes(this.dataTreeCheckedNodes) |
| | | |
| | | }, |
| | | |
| | | e2.checkedNodes.some(item => { |
| | | return item.label == '视频监控' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/camera.png', cameraList, 'activityCameraLayers') : this.clearLayerIconForMap('activityCameraLayers'); |
| | | // 遍历树数据实时图标 |
| | | eachDataTreeCheckedNodes(data){ |
| | | // 清除定时器 |
| | | if(realPoliceTimer != {}) { |
| | | for(let item in realPoliceTimer) { |
| | | console.log(`定时器realPoliceTimer[${item}]关闭了`); |
| | | clearInterval(realPoliceTimer[item]) |
| | | } |
| | | } |
| | | if(data != []){ |
| | | data.some(item => { |
| | | return item.label == '视频监控' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/camera.png', '',cameraList, 'activityCameraLayers') : this.clearLayerIconForMap('activityCameraLayers'); |
| | | |
| | | e2.checkedNodes.some(item => { |
| | | return item.label == '警车' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/car.png', carList, 'activityCarLayers') : this.clearLayerIconForMap('activityCarLayers'); |
| | | data.some(item => { |
| | | return item.label == '警车' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/real-car.png','/img/icon/real-car-ok.png', carList, 'activityCarLayers') : this.clearLayerIconForMap('activityCarLayers'); |
| | | |
| | | e2.checkedNodes.some(item => { |
| | | return item.label == '公网' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/p-talk.png', talkBackEquipmentPublicList, 'activityTalkBackEquipmentPublicLayers') : this.clearLayerIconForMap('activityTalkBackEquipmentPublicLayers'); |
| | | data.some(item => { |
| | | return item.label == '公网' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/real-public-recorder.png','/img/icon/real-public-recorder-ok.png', talkBackEquipmentPublicList, 'activityTalkBackEquipmentPublicLayers') : this.clearLayerIconForMap('activityTalkBackEquipmentPublicLayers'); |
| | | |
| | | data.some(item => { |
| | | return item.label == '专网' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/real-recorder.png','/img/icon/real-recorder-ok.png', talkBackEquipmentList, 'activityTalkBackEquipmentLayers') : this.clearLayerIconForMap('activityTalkBackEquipmentLayers'); |
| | | |
| | | e2.checkedNodes.some(item => { |
| | | return item.label == '专网' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/p-b-talk.png', talkBackEquipmentList, 'activityTalkBackEquipmentLayers') : this.clearLayerIconForMap('activityTalkBackEquipmentLayers'); |
| | | |
| | | e2.checkedNodes.some(item => { |
| | | return item.label == '执法记录仪' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/p-b-camera.png', policeCarmeraList, 'activityPoliceCameraLayers') : this.clearLayerIconForMap('activityPoliceCameraLayers'); |
| | | |
| | | data.some(item => { |
| | | return item.label == '执法记录仪' |
| | | }) ? this.iconImageShowOrHidden('/img/icon/real-phone.png', '/img/icon/real-phone-ok.png',policeCarmeraList, 'activityPoliceCameraLayers') : this.clearLayerIconForMap('activityPoliceCameraLayers'); |
| | | } |
| | | }, |
| | | |
| | | /** |
| | |
| | | * @param {*} layerName 图层名称 |
| | | */ |
| | | clearLayerIconForMap(layerName) { |
| | | realPoliceTimer[layerName] && clearInterval(realPoliceTimer[layerName]) |
| | | console.log(`定时器realPoliceTimer[${layerName}]关闭了`); |
| | | this.$EventBus.$emit('mapClearLayer', { |
| | | layerName: layerName, |
| | | type: 'VectorLayer' |
| | |
| | | * @param {*} data 传入的数据(摄像头,手台等集合数据) |
| | | * @param {*} layerName 选中图层名称 |
| | | */ |
| | | iconImageShowOrHidden(img, data, layerName) { |
| | | if (data.length > 0) { |
| | | data.forEach(item => { |
| | | iconImageShowOrHidden(img, imgOk, data, layerName, isChooseSecurity) { |
| | | if(this.showingSecurityId && !isChooseSecurity) { |
| | | // 实时图标刷新时间间隔 |
| | | let refreshTime = 1000 |
| | | realPoliceTimer[layerName] = setInterval(()=> this.searchRealResources(layerName),refreshTime) |
| | | } else { |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: layerName, |
| | | type: 'VectorLayer' |
| | | }) |
| | | if (data.length > 0) { |
| | | data.forEach(item => { |
| | | if (item.longitude && item.latitude) { |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: layerName, |
| | |
| | | lng: item.longitude, |
| | | lat: item.latitude, |
| | | alt: 1, |
| | | url: img |
| | | url: item.clockStatus == 0 ? img:imgOk |
| | | }, |
| | | }) |
| | | } |
| | | }) |
| | | }) |
| | | } |
| | | } |
| | | }, |
| | | |
| | |
| | | if (pointCircleCarLayer != null) { |
| | | pointCircleCarLayer.clear() |
| | | } |
| | | }, |
| | | |
| | | // 定时查找实时警力资源 |
| | | searchRealResources(layerName){ |
| | | console.log(`定时器realPoliceTimer[${layerName}]开启了`); |
| | | let type = '' |
| | | if(layerName == 'activityCarLayers') { |
| | | type = 0 |
| | | }else if (layerName == 'activityTalkBackEquipmentPublicLayers'){ |
| | | type = '2-1' |
| | | }else if (layerName == 'activityTalkBackEquipmentLayers'){ |
| | | type = '2-2' |
| | | }else if (layerName == 'activityPoliceCameraLayers'){ |
| | | type = 3 |
| | | } |
| | | this.getEquipmentAll({ type: type ,query:this.showingSecurityId },layerName); |
| | | }, |
| | | |
| | | // 大小重置 |
| | |
| | | }, |
| | | |
| | | // 获取设备列表 |
| | | getEquipmentAll (params) { |
| | | getEquipmentAll (params,layerName) { |
| | | getEquipmentAll({ ...params, deptId: this.userInfo.dept_id }).then(res => { |
| | | if (params.type == 0) { |
| | | // 警车 |
| | | //警车 |
| | | carList = res.data.data |
| | | if(layerName){ |
| | | this.iconImageShowOrHidden('/img/icon/real-car.png','/img/icon/real-car-ok.png',carList, layerName,true) |
| | | } |
| | | } else if (params.type == 1) { |
| | | // 摄像头 |
| | | //摄像头 |
| | | cameraList = res.data.data |
| | | } else if (params.type == '2-1') { |
| | | // 公网-手台 |
| | | //公网-手台 |
| | | talkBackEquipmentPublicList = res.data.data |
| | | if(layerName){ |
| | | this.iconImageShowOrHidden('/img/icon/real-public-recorder.png','/img/icon/real-public-recorder-ok.png', talkBackEquipmentPublicList, layerName,true) |
| | | } |
| | | } else if (params.type == '2-2') { |
| | | // 专网-手台 |
| | | //专网-手台 |
| | | talkBackEquipmentList = res.data.data |
| | | if(layerName){ |
| | | this.iconImageShowOrHidden('/img/icon/real-recorder.png','/img/icon/real-recorder-ok.png', talkBackEquipmentList, layerName,true) |
| | | } |
| | | } else { |
| | | //执法记录仪 |
| | | policeCarmeraList = res.data.data |
| | | if(layerName){ |
| | | this.iconImageShowOrHidden('/img/icon/real-phone.png', '/img/icon/real-phone-ok.png', policeCarmeraList, layerName,true) |
| | | } |
| | | } |
| | | }) |
| | | }, |
| | |
| | | } |
| | | }, |
| | | |
| | | beforeDestroy() { |
| | | // 清除定时器 |
| | | if(realPoliceTimer != {}) { |
| | | for(let item in realPoliceTimer) { |
| | | console.log(`定时器realPoliceTimer[${item}]关闭了`); |
| | | clearInterval(realPoliceTimer[item]) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | destroyed () { |
| | | this.$EventBus.$emit('mapRemoveLayer', { |
| | | layerName: 'activeLayer', |