| | |
| | | }) |
| | | |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policeman', item.id, item.policemanId, item.deptId, item.color) |
| | | let positionObj = this.convertBillboardPositionDate(item, 'policeman') |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | } |
| | | point.attrParams = positionObj |
| | | pointCircleCarLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | 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) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newDrawLayers', |
| | | type: 'billboard', |
| | | params: positionObj, |
| | | incident: this.overlayTypeClick |
| | | incident: this.overlayTypeClick, |
| | | mouseOverIncident: this.pointMouseOver, |
| | | mouseOutIncident: this.pointMouseOut |
| | | }) |
| | | } |
| | | }) |
| | |
| | | }, |
| | | }) |
| | | } else if (item.type == 3 && pointShow) { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'policecar', item.id, item.carId, item.deptId, item.color) |
| | | let positionObj = this.convertBillboardPositionDate(item, 'policecar') |
| | | let position = new global.DC.Position(Number(positionObj.lng), Number(positionObj.lat)) |
| | | let point = new global.DC.Point(position) |
| | | let color = '' |
| | |
| | | let b = parseInt(item.color.slice(5, 7), 16) |
| | | color = global.DC.Namespace.Cesium.Color.fromBytes(r, g, b, 150) |
| | | } |
| | | point.attrParams = positionObj |
| | | pointCircleManLayer.addOverlay(point) |
| | | point.setStyle({ |
| | | "color": color, //颜色 |
| | |
| | | "outlineWidth": 0, //边框大小, |
| | | "pixelSize": 32, |
| | | }) |
| | | |
| | | 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) |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'newCarDrawLayers', |
| | | type: 'billboard', |
| | |
| | | getCarList () { |
| | | getCarList().then(res => { |
| | | res.data.data.forEach(item => { |
| | | this.policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}` }) |
| | | this.policecarOption.push({ value: `${item.id}`, label: `${item.serialNumber}` , carType: `${item.carType}` }) |
| | | }) |
| | | }) |
| | | }, |
| | |
| | | // 添加活动图标 |
| | | addActivityPoint () { |
| | | this.activityList.forEach(item => { |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'activity') |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | this.$EventBus.$emit('layerPointAdd', { |
| | | layerName: 'activityLayers', |
| | | type: "billboard", |
| | |
| | | }, |
| | | |
| | | // 转换 点 坐标数据 |
| | | convertBillboardPositionDate (data, iconName, plotId, policeId, deptId, color) { |
| | | let positionStr = data |
| | | positionStr = data.slice(6, positionStr.length - 1) |
| | | convertBillboardPositionDate (data, iconName) { |
| | | let positionStr = data.position |
| | | positionStr = data.position.slice(6, positionStr.length - 1) |
| | | let positionArr = positionStr.split(" ") |
| | | let positionObj = {} |
| | | if (iconName == 'activity') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0, url: '/img/icon/activity.png' } |
| | | } else if (iconName == 'policeman') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.05, url: '/img/icon/man3.png', id: plotId, policemanId: policeId, deptId: deptId, color: color } |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.05, url: '/img/icon/man3.png', data:data} |
| | | } else if (iconName == 'policecar') { |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.05, url: '/img/icon/car3.png', id: plotId, carId: policeId, deptId: deptId, color: color } |
| | | positionObj = { lng: `${positionArr[0]}`, lat: `${positionArr[1]}`, alt: 0.05, url: '/img/icon/car3.png', data:data} |
| | | } |
| | | return positionObj |
| | | }, |
| | |
| | | analyseLayer.clear() |
| | | } |
| | | |
| | | let positionObj = this.convertBillboardPositionDate(item.position, 'activity') |
| | | let positionObj = this.convertBillboardPositionDate(item, 'activity') |
| | | |
| | | let point = new global.DC.Point(`${positionObj.lng}, ${positionObj.lat}`) |
| | | analyseLayer.addOverlay(point) |
| | |
| | | } else { |
| | | this.isChoosePoliceElementDisabled = true |
| | | } |
| | | if ('policemanId' in e.overlay.attrParams) { |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.policemanId |
| | | this.choosePoliceColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#FF0000' |
| | | let choosePoliceName = this.platFn(this.policeTreeData).find(item => item.id == e.overlay.attrParams.policemanId).name |
| | | if ('policemanId' in e.overlay.attrParams.data) { |
| | | this.policeIconId = e.overlay.attrParams.data.id |
| | | this.policeType = e.overlay.attrParams.data.policemanId |
| | | this.choosePoliceColor = e.overlay.attrParams.data.color != '' ? e.overlay.attrParams.data.color : '#FF0000' |
| | | let choosePoliceName = this.platFn(this.policeTreeData).find(item => item.id == e.overlay.attrParams.data.policemanId).name |
| | | this.searchPoliceTreeName = choosePoliceName |
| | | this.policeIconIsCreated = true |
| | | this.policeChooseVisible = true |
| | | } else if ('carId' in e.overlay.attrParams) { |
| | | } else if ('carId' in e.overlay.attrParams.data) { |
| | | this.policeOption = this.policecarOption |
| | | this.policeIconId = e.overlay.attrParams.id |
| | | this.policeType = e.overlay.attrParams.carId |
| | | this.chooseCarColor = e.overlay.attrParams.color != '' ? e.overlay.attrParams.color : '#FF0000' |
| | | this.policeIconId = e.overlay.attrParams.data.id |
| | | this.policeType = e.overlay.attrParams.data.carId |
| | | this.chooseCarColor = e.overlay.attrParams.data.color != '' ? e.overlay.attrParams.data.color : '#FF0000' |
| | | this.policeIconIsCreated = true |
| | | this.policeChooseCarVisible = true |
| | | } |
| | |
| | | // 鼠标移入图标事件 |
| | | pointMouseOver (e) { |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUP', true) |
| | | let hoverData = {} |
| | | if('carId' in e.overlay.attrParams.data){ |
| | | hoverData = this.policecarOption.filter(item=>item.value == e.overlay.attrParams.data.carId)[0] |
| | | hoverData.policeData={'name': 'none'} |
| | | hoverData.policeStationName = 'none' |
| | | }else{ |
| | | let policeArr = this.filterTree (this.policeTreeData) |
| | | hoverData.policeData = policeArr.filter(item=>item.id == e.overlay.attrParams.data.policemanId)[0] |
| | | hoverData.policeStationName = policeArr.filter(item=>item.id == policeArr.filter(item=>item.id == e.overlay.attrParams.data.policemanId)[0].parentId)[0].name |
| | | hoverData.carType = 'none' |
| | | hoverData.label = 'none' |
| | | } |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUPDATA', hoverData) |
| | | |
| | | var popup = new global.DC.DivForms(global.viewer, { |
| | | domId: 'ActivityPoliceDomBox', |
| | |
| | | * @return {*} |
| | | */ |
| | | pointMouseOut (e) { |
| | | console.log(6666333) |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUP', false) |
| | | }, |
| | | |
| | | // 树形数据传数组 |
| | | filterTree (tree, arr = []) { |
| | | if (!tree.length) return [] |
| | | arr.push(...tree) |
| | | for(let item of tree){ |
| | | if(item.children && item.children.length){ |
| | | this.filterTree(item.children,arr) |
| | | } |
| | | } |
| | | return arr |
| | | } |
| | | |
| | | }, |
| | |
| | | searchPoliceTreeName (val) { |
| | | this.$refs.policeTree.filter(val) |
| | | }, |
| | | |
| | | policeChooseVisible(val) { |
| | | if(val){ |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUP', false) |
| | | } |
| | | }, |
| | | |
| | | policeChooseCarVisible(val){ |
| | | if(val){ |
| | | this.$store.commit('SET_ACTIVITYPOLICEPOPUP', false) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | destroyed () { |