diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index 31440bc..585ab8a 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -106,7 +106,7 @@ data() { return { screenHeight: null, - checkedCities: [], + checkedCities: ['腐蚀速率监测仪', '气体流量计', '气体泄漏检测仪', '供水泄漏检测仪'], left: '', mapMark: '-', deviceTypeList: [], // 设备类型列表 @@ -442,13 +442,47 @@ window.map.addLayer(street) for (let j = 0; j < positions.length; j++) { flow.addGraphic(this.addFlow(positions[j].items, positions[j].type)) - street.addGraphic(this.addStreet(positions[j].items)) + street.addGraphic(this.addStreet(positions[j].items, positions[j].type)) } flow.show = false }).catch((error) => { console.log('get position error...' + error) }) }, + // 道路线 + addStreet(positions, repeat) { + var style = {} + if (repeat === 1) { + style = { + width: 8, + color: 'red', + clampToGround: true + } + } else if (repeat === 2) { + style = { + width: 8, + color: 'cyan', + clampToGround: true + } + } else if (repeat === 3) { + style = { + width: 8, + color: 'yellow', + clampToGround: true + } + } else if (repeat === 4) { + style = { + width: 8, + color: 'green', + clampToGround: true + } + } + var graphic = new mars3d.graphic.PolylineEntity({ + positions: positions, + style: style + }) + return graphic + }, // 流向线 addFlow(positions, repeat) { var style = {} @@ -610,6 +644,7 @@ fsModel() { const params = '14' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======腐蚀速率监测仪=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -658,7 +693,7 @@ qtModel() { const params = '15' getMapping(params, this.listQuery.keywords).then(response => { - console.log(response) + console.log(response.data[0].latitude, '======气体流量计=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -707,6 +742,7 @@ rqModel() { const params = '4' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======气体泄露监测仪(原燃气)=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -755,6 +791,7 @@ zsMoel() { const params = '8' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======供水泄露监测仪(原噪声))=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -800,18 +837,6 @@ } }) }, - // 道路线 - addStreet(positions) { - var graphic = new mars3d.graphic.PolylineEntity({ - positions: positions, - style: { - width: 8, - color: Cesium.Color.AQUA, - clampToGround: true - } - }) - return graphic - }, // 回到原点 flyToInit() { let center diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index 31440bc..585ab8a 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -106,7 +106,7 @@ data() { return { screenHeight: null, - checkedCities: [], + checkedCities: ['腐蚀速率监测仪', '气体流量计', '气体泄漏检测仪', '供水泄漏检测仪'], left: '', mapMark: '-', deviceTypeList: [], // 设备类型列表 @@ -442,13 +442,47 @@ window.map.addLayer(street) for (let j = 0; j < positions.length; j++) { flow.addGraphic(this.addFlow(positions[j].items, positions[j].type)) - street.addGraphic(this.addStreet(positions[j].items)) + street.addGraphic(this.addStreet(positions[j].items, positions[j].type)) } flow.show = false }).catch((error) => { console.log('get position error...' + error) }) }, + // 道路线 + addStreet(positions, repeat) { + var style = {} + if (repeat === 1) { + style = { + width: 8, + color: 'red', + clampToGround: true + } + } else if (repeat === 2) { + style = { + width: 8, + color: 'cyan', + clampToGround: true + } + } else if (repeat === 3) { + style = { + width: 8, + color: 'yellow', + clampToGround: true + } + } else if (repeat === 4) { + style = { + width: 8, + color: 'green', + clampToGround: true + } + } + var graphic = new mars3d.graphic.PolylineEntity({ + positions: positions, + style: style + }) + return graphic + }, // 流向线 addFlow(positions, repeat) { var style = {} @@ -610,6 +644,7 @@ fsModel() { const params = '14' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======腐蚀速率监测仪=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -658,7 +693,7 @@ qtModel() { const params = '15' getMapping(params, this.listQuery.keywords).then(response => { - console.log(response) + console.log(response.data[0].latitude, '======气体流量计=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -707,6 +742,7 @@ rqModel() { const params = '4' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======气体泄露监测仪(原燃气)=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -755,6 +791,7 @@ zsMoel() { const params = '8' getMapping(params, this.listQuery.keywords).then(response => { + console.log(response.data[0].latitude, '======供水泄露监测仪(原噪声))=======') // 过滤掉该单位不支持的设备(通过部门id) const deptIds = this.$store.getters.deptId const responses = [] @@ -800,18 +837,6 @@ } }) }, - // 道路线 - addStreet(positions) { - var graphic = new mars3d.graphic.PolylineEntity({ - positions: positions, - style: { - width: 8, - color: Cesium.Color.AQUA, - clampToGround: true - } - }) - return graphic - }, // 回到原点 flyToInit() { let center diff --git a/src/views/overview/overviewSimple.vue b/src/views/overview/overviewSimple.vue index 9a0df46..2770b53 100644 --- a/src/views/overview/overviewSimple.vue +++ b/src/views/overview/overviewSimple.vue @@ -397,7 +397,7 @@ window.map.addLayer(watch_icon_layer) for (let i = 0; i < response.data.length; i++) { watch_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude - 0.0000030, -0.5], + position: [response.data[i].longitude, response.data[i].latitude, -0.5], style: { url: '../static/model/sb.glb', scale: 2,