| | |
| | | getTagList |
| | | } from '@/api/pc/leftNav/index' |
| | | import { mapGetters } from 'vuex' |
| | | |
| | | const LeftNavLayer = { |
| | | leftTagLayer: null, |
| | | leftWayLayer: null, |
| | | leftSceneLayer: null, |
| | | leftMonitorLayer: null, |
| | | leftActivityLayer: null, |
| | | leftAedLayer: null, |
| | | leftParkLayer: null, |
| | | leftComeLayer: null |
| | | } |
| | | |
| | | export default { |
| | | name: 'leftNav', |
| | | computed: { |
| | |
| | | img: '/img/leftnav/tag-checked.png', |
| | | normal: '/img/leftnav/tag.png', |
| | | checked: '/img/leftnav/tag-checked.png', |
| | | layer: 'tagLayer' |
| | | layer: 'leftTagLayer' |
| | | }, |
| | | { |
| | | flag: false, |
| | |
| | | img: '/img/leftnav/way.png', |
| | | normal: '/img/leftnav/way.png', |
| | | checked: '/img/leftnav/way-checked.png', |
| | | layer: 'wayLayer' |
| | | layer: 'leftWayLayer' |
| | | }, |
| | | { |
| | | flag: false, |
| | |
| | | img: '/img/leftnav/scene.png', |
| | | normal: '/img/leftnav/scene.png', |
| | | checked: '/img/leftnav/scene-checked.png', |
| | | layer: 'sceneLayer' |
| | | layer: 'leftSceneLayer' |
| | | }, |
| | | { |
| | | flag: false, |
| | |
| | | img: '/img/leftnav/monitor.png', |
| | | normal: '/img/leftnav/monitor.png', |
| | | checked: '/img/leftnav/monitor-checked.png', |
| | | layer: 'monitorLayer' |
| | | layer: 'leftMonitorLayer' |
| | | }, |
| | | // { |
| | | // flag: false, |
| | |
| | | // img: '/img/leftnav/activity.png', |
| | | // normal: '/img/leftnav/activity.png', |
| | | // checked: '/img/leftnav/activity-checked.png', |
| | | // layer: 'activityLayer' |
| | | // layer: 'leftActivityLayer' |
| | | // }, |
| | | // { |
| | | // flag: false, |
| | |
| | | // img: '/img/leftnav/aed.png', |
| | | // normal: '/img/leftnav/aed.png', |
| | | // checked: '/img/leftnav/aed-checked.png', |
| | | // layer: 'aedLayer' |
| | | // layer: 'leftAedLayer' |
| | | // }, |
| | | { |
| | | flag: false, |
| | |
| | | img: '/img/leftnav/park.png', |
| | | normal: '/img/leftnav/park.png', |
| | | checked: '/img/leftnav/park-checked.png', |
| | | layer: 'parkLayer' |
| | | layer: 'leftParkLayer' |
| | | }, |
| | | { |
| | | flag: false, |
| | |
| | | img: '/img/leftnav/come.png', |
| | | normal: '/img/leftnav/come.png', |
| | | checked: '/img/leftnav/come-checked.png', |
| | | layer: 'comeLayer' |
| | | layer: 'leftComeLayer' |
| | | } |
| | | ], |
| | | tagLayer: null, |
| | | wayLayer: null, |
| | | sceneLayer: null, |
| | | monitorLayer: null, |
| | | activityLayer: null, |
| | | aedLayer: null, |
| | | parkLayer: null, |
| | | comeLayer: null |
| | | ] |
| | | } |
| | | }, |
| | | created () { |
| | |
| | | methods: { |
| | | reself () { |
| | | const that = this |
| | | if (this.tagLayer) { |
| | | this.tagLayer.clear() |
| | | if (LeftNavLayer.leftTagLayer) { |
| | | LeftNavLayer.leftTagLayer.clear() |
| | | } |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | |
| | | item: item |
| | | }) |
| | | }) |
| | | this.tagLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftTagLayer.addOverlay(divIcon) |
| | | if (!this.leftNavData[0].flag) { |
| | | this.tagLayer.show = false |
| | | LeftNavLayer.leftTagLayer.show = false |
| | | } |
| | | }) |
| | | }) |
| | |
| | | item.flag = !item.flag |
| | | if (item.flag == true) { |
| | | item.img = item.checked |
| | | this[item.layer].show = true |
| | | LeftNavLayer[item.layer].show = true |
| | | } else { |
| | | item.img = item.normal |
| | | this[item.layer].show = false |
| | | LeftNavLayer[item.layer].show = false |
| | | } |
| | | }, |
| | | initialize () { |
| | | var that = this |
| | | global.viewer.scene.globe.depthTestAgainstTerrain = false |
| | | this.tagLayer = new global.DC.HtmlLayer('tagLayer') |
| | | global.viewer.addLayer(this.tagLayer) |
| | | this.wayLayer = new global.DC.HtmlLayer('wayLayer') |
| | | global.viewer.addLayer(this.wayLayer) |
| | | this.sceneLayer = new global.DC.HtmlLayer('sceneLayer') |
| | | global.viewer.addLayer(this.sceneLayer) |
| | | this.monitorLayer = new global.DC.HtmlLayer('monitorLayer') |
| | | global.viewer.addLayer(this.monitorLayer) |
| | | this.aedLayer = new global.DC.VectorLayer('aedLayer') |
| | | global.viewer.addLayer(this.aedLayer) |
| | | this.parkLayer = new global.DC.HtmlLayer('parkLayer') |
| | | global.viewer.addLayer(this.parkLayer) |
| | | this.comeLayer = new global.DC.VectorLayer('comeLayer') |
| | | global.viewer.addLayer(this.comeLayer) |
| | | |
| | | LeftNavLayer.leftTagLayer = new global.DC.HtmlLayer('leftTagLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftTagLayer) |
| | | |
| | | LeftNavLayer.leftWayLayer = new global.DC.HtmlLayer('leftWayLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftWayLayer) |
| | | |
| | | LeftNavLayer.leftSceneLayer = new global.DC.HtmlLayer('leftSceneLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftSceneLayer) |
| | | |
| | | LeftNavLayer.leftMonitorLayer = new global.DC.HtmlLayer('leftMonitorLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftMonitorLayer) |
| | | |
| | | LeftNavLayer.leftAedLayer = new global.DC.VectorLayer('leftAedLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftAedLayer) |
| | | |
| | | LeftNavLayer.leftParkLayer = new global.DC.HtmlLayer('leftParkLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftParkLayer) |
| | | |
| | | LeftNavLayer.leftComeLayer = new global.DC.VectorLayer('leftComeLayer') |
| | | global.viewer.addLayer(LeftNavLayer.leftComeLayer) |
| | | |
| | | getTagList().then((res) => { |
| | | res.data.data.forEach((item) => { |
| | |
| | | item: item |
| | | }) |
| | | }) |
| | | this.tagLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftTagLayer.addOverlay(divIcon) |
| | | }) |
| | | // this.tagLayer.show = false |
| | | // LeftNavLayer.leftTagLayer.show = false |
| | | }) |
| | | |
| | | getWayList().then((res) => { |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | this.wayLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftWayLayer.addOverlay(divIcon) |
| | | }) |
| | | this.wayLayer.show = false |
| | | LeftNavLayer.leftWayLayer.show = false |
| | | }) |
| | | |
| | | getMonitorList().then((res) => { |
| | |
| | | ` |
| | | ) |
| | | divIcon.attrParams = item |
| | | this.monitorLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftMonitorLayer.addOverlay(divIcon) |
| | | |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | global.viewer.flyToPosition( |
| | |
| | | }) |
| | | }) |
| | | |
| | | this.monitorLayer.show = false |
| | | LeftNavLayer.leftMonitorLayer.show = false |
| | | }) |
| | | |
| | | getSceneList().then((res) => { |
| | |
| | | ` |
| | | ) |
| | | divIcon.attrParams = item |
| | | this.sceneLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftSceneLayer.addOverlay(divIcon) |
| | | |
| | | divIcon.on(global.DC.MouseEventType.CLICK, (e) => { |
| | | global.viewer.flyToPosition( |
| | |
| | | }) |
| | | }) |
| | | |
| | | this.sceneLayer.show = false |
| | | LeftNavLayer.leftSceneLayer.show = false |
| | | }) |
| | | |
| | | getLifeList({ lifetype: 9 }).then((res) => { |
| | |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -24 } |
| | | }) |
| | | this.aedLayer.addOverlay(label) |
| | | LeftNavLayer.leftAedLayer.addOverlay(label) |
| | | |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | |
| | | ) |
| | | billboard.size = [20, 20] |
| | | |
| | | this.aedLayer.addOverlay(billboard) |
| | | LeftNavLayer.leftAedLayer.addOverlay(billboard) |
| | | }) |
| | | this.aedLayer.show = false |
| | | LeftNavLayer.leftAedLayer.show = false |
| | | }) |
| | | |
| | | getLifeList({ lifetype: 11 }).then((res) => { |
| | |
| | | </div> |
| | | ` |
| | | ) |
| | | this.parkLayer.addOverlay(divIcon) |
| | | LeftNavLayer.leftParkLayer.addOverlay(divIcon) |
| | | }) |
| | | this.parkLayer.show = false |
| | | LeftNavLayer.leftParkLayer.show = false |
| | | }) |
| | | |
| | | getLifeList({ lifetype: 12 }).then((res) => { |
| | |
| | | font: '14px sans-serif', |
| | | pixelOffset: { x: 0, y: -40 } |
| | | }) |
| | | that.comeLayer.addOverlay(label) |
| | | LeftNavLayer.leftComeLayer.addOverlay(label) |
| | | |
| | | const billboard = new global.DC.Billboard( |
| | | new global.DC.Position(Number(item.jd), Number(item.wd), 0), |
| | |
| | | pixelOffset: { x: 0, y: -16 } |
| | | }) |
| | | |
| | | that.comeLayer.addOverlay(billboard) |
| | | LeftNavLayer.leftComeLayer.addOverlay(billboard) |
| | | }) |
| | | this.comeLayer.show = false |
| | | LeftNavLayer.leftComeLayer.show = false |
| | | }) |
| | | }, |
| | | openPopups (value) { |