diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue index 65cdec7..479b9ad 100644 --- a/src/views/dashboard/components/waterNote.vue +++ b/src/views/dashboard/components/waterNote.vue @@ -3,25 +3,25 @@
场区用水事记 - - + +
-
{{index+1}}. {{item.content}}
+
{{ index+1 }}. {{ item.content }}
-
{{index+1}}.
- +
{{ index+1 }}.
+
- - - + + +
- +
@@ -30,13 +30,12 @@ - - diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue index 65cdec7..479b9ad 100644 --- a/src/views/dashboard/components/waterNote.vue +++ b/src/views/dashboard/components/waterNote.vue @@ -3,25 +3,25 @@
场区用水事记 - - + +
-
{{index+1}}. {{item.content}}
+
{{ index+1 }}. {{ item.content }}
-
{{index+1}}.
- +
{{ index+1 }}.
+
- - - + + +
- +
@@ -30,13 +30,12 @@ - - diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index bc2f67d..7b61965 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -64,46 +64,10 @@
-
-
- 设备列表 - - - - -
- - - - - - - - - - +
+ + {{ item.name }} +
@@ -135,11 +99,9 @@ components: {}, data() { return { + checkedCities: [], left: '', mapMark: '-', - typeShow: false, - showType: true, // 是否显示设备 - typeList: [], deviceTypeList: [], // 设备类型列表 multipleSelection: [], // 多选选中项 columnsType: [ @@ -254,239 +216,30 @@ this.initMars3D() }, methods: { - // table表格每行多选触发方法 - handleSelectionChange(val) { - console.log(val) - if (val.length === this.typeList.length || val.length === 0) { - this.initPoints() - } else if (val.length === 1) { - if (val[0].name === '远传水表') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - } else if (val[0].name === '供水泄漏检测仪') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) + // 设备展示 + handleCheckedCitiesChange(val) { + console.log(val, '000000000000000000000000000000') + val.forEach(item => { + if (item.indexOf('远传水表') === -1) { + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.zsMoel() + } else if (item.indexOf('供水泄露监测仪') === -1) { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.watchModel() + } else { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) } - } - // this.multipleSelection = val + }) }, // 获取设备类型 fetchDeviceType() { @@ -499,7 +252,6 @@ this.deviceTypeList.push(deviceType) } } - this.typeList = this.deviceTypeList }) }, // 初始化地球 @@ -635,9 +387,13 @@ }, // 初始化井,设备 async initPoints() { + this.wellMode() + this.watchModel() + this.zsMoel() + }, + wellMode() { // 井 - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { + getMapping(this.listQuery.keywords).then(response => { if (response.code === 200) { if (well_model_layer !== null) window.map.removeLayer(well_model_layer) well_model_layer = new mars3d.layer.GraphicLayer() @@ -676,7 +432,9 @@ } } }) - params = '13' + }, + watchModel() { + const params = '13' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) @@ -711,7 +469,9 @@ this.refreshAlarm() } }) - params = '8' + }, + zsMoel() { + const params = '8' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) @@ -797,11 +557,8 @@ // 获取当前报警列表 this.alarmList = response.data if (this.alarmList.length > 0) { - this.left = 621 this.hasAlarm = true - } else { - this.left = 0 - } + } for (const alarm of response.data) { for (const watch of watch_icon_layer.graphics) { if (alarm.devcode === watch.options.id) { @@ -934,6 +691,14 @@ cursor: pointer; } } + .map-type-div{ + position: absolute; + z-index: 100; + bottom: 2px; + right: 0px; + padding: 10px 0px 10px 10px; + background-color: rgba(255, 234, 241,0.8); + } // 报警列表 .map-alarm-div{ position: absolute; diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue index 65cdec7..479b9ad 100644 --- a/src/views/dashboard/components/waterNote.vue +++ b/src/views/dashboard/components/waterNote.vue @@ -3,25 +3,25 @@
场区用水事记 - - + +
-
{{index+1}}. {{item.content}}
+
{{ index+1 }}. {{ item.content }}
-
{{index+1}}.
- +
{{ index+1 }}.
+
- - - + + +
- +
@@ -30,13 +30,12 @@ - - diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index bc2f67d..7b61965 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -64,46 +64,10 @@
-
-
- 设备列表 - - - - -
- - - - - - - - - - +
+ + {{ item.name }} +
@@ -135,11 +99,9 @@ components: {}, data() { return { + checkedCities: [], left: '', mapMark: '-', - typeShow: false, - showType: true, // 是否显示设备 - typeList: [], deviceTypeList: [], // 设备类型列表 multipleSelection: [], // 多选选中项 columnsType: [ @@ -254,239 +216,30 @@ this.initMars3D() }, methods: { - // table表格每行多选触发方法 - handleSelectionChange(val) { - console.log(val) - if (val.length === this.typeList.length || val.length === 0) { - this.initPoints() - } else if (val.length === 1) { - if (val[0].name === '远传水表') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - } else if (val[0].name === '供水泄漏检测仪') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) + // 设备展示 + handleCheckedCitiesChange(val) { + console.log(val, '000000000000000000000000000000') + val.forEach(item => { + if (item.indexOf('远传水表') === -1) { + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.zsMoel() + } else if (item.indexOf('供水泄露监测仪') === -1) { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.watchModel() + } else { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) } - } - // this.multipleSelection = val + }) }, // 获取设备类型 fetchDeviceType() { @@ -499,7 +252,6 @@ this.deviceTypeList.push(deviceType) } } - this.typeList = this.deviceTypeList }) }, // 初始化地球 @@ -635,9 +387,13 @@ }, // 初始化井,设备 async initPoints() { + this.wellMode() + this.watchModel() + this.zsMoel() + }, + wellMode() { // 井 - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { + getMapping(this.listQuery.keywords).then(response => { if (response.code === 200) { if (well_model_layer !== null) window.map.removeLayer(well_model_layer) well_model_layer = new mars3d.layer.GraphicLayer() @@ -676,7 +432,9 @@ } } }) - params = '13' + }, + watchModel() { + const params = '13' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) @@ -711,7 +469,9 @@ this.refreshAlarm() } }) - params = '8' + }, + zsMoel() { + const params = '8' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) @@ -797,11 +557,8 @@ // 获取当前报警列表 this.alarmList = response.data if (this.alarmList.length > 0) { - this.left = 621 this.hasAlarm = true - } else { - this.left = 0 - } + } for (const alarm of response.data) { for (const watch of watch_icon_layer.graphics) { if (alarm.devcode === watch.options.id) { @@ -934,6 +691,14 @@ cursor: pointer; } } + .map-type-div{ + position: absolute; + z-index: 100; + bottom: 2px; + right: 0px; + padding: 10px 0px 10px 10px; + background-color: rgba(255, 234, 241,0.8); + } // 报警列表 .map-alarm-div{ position: absolute; diff --git a/src/views/gasOverview/overview.vue b/src/views/gasOverview/overview.vue deleted file mode 100644 index 936577c..0000000 --- a/src/views/gasOverview/overview.vue +++ /dev/null @@ -1,802 +0,0 @@ - - - - - - - diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue index 65cdec7..479b9ad 100644 --- a/src/views/dashboard/components/waterNote.vue +++ b/src/views/dashboard/components/waterNote.vue @@ -3,25 +3,25 @@
场区用水事记 - - + +
-
{{index+1}}. {{item.content}}
+
{{ index+1 }}. {{ item.content }}
-
{{index+1}}.
- +
{{ index+1 }}.
+
- - - + + +
- +
@@ -30,13 +30,12 @@ - - diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index bc2f67d..7b61965 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -64,46 +64,10 @@
-
-
- 设备列表 - - - - -
- - - - - - - - - - +
+ + {{ item.name }} +
@@ -135,11 +99,9 @@ components: {}, data() { return { + checkedCities: [], left: '', mapMark: '-', - typeShow: false, - showType: true, // 是否显示设备 - typeList: [], deviceTypeList: [], // 设备类型列表 multipleSelection: [], // 多选选中项 columnsType: [ @@ -254,239 +216,30 @@ this.initMars3D() }, methods: { - // table表格每行多选触发方法 - handleSelectionChange(val) { - console.log(val) - if (val.length === this.typeList.length || val.length === 0) { - this.initPoints() - } else if (val.length === 1) { - if (val[0].name === '远传水表') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - } else if (val[0].name === '供水泄漏检测仪') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) + // 设备展示 + handleCheckedCitiesChange(val) { + console.log(val, '000000000000000000000000000000') + val.forEach(item => { + if (item.indexOf('远传水表') === -1) { + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.zsMoel() + } else if (item.indexOf('供水泄露监测仪') === -1) { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.watchModel() + } else { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) } - } - // this.multipleSelection = val + }) }, // 获取设备类型 fetchDeviceType() { @@ -499,7 +252,6 @@ this.deviceTypeList.push(deviceType) } } - this.typeList = this.deviceTypeList }) }, // 初始化地球 @@ -635,9 +387,13 @@ }, // 初始化井,设备 async initPoints() { + this.wellMode() + this.watchModel() + this.zsMoel() + }, + wellMode() { // 井 - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { + getMapping(this.listQuery.keywords).then(response => { if (response.code === 200) { if (well_model_layer !== null) window.map.removeLayer(well_model_layer) well_model_layer = new mars3d.layer.GraphicLayer() @@ -676,7 +432,9 @@ } } }) - params = '13' + }, + watchModel() { + const params = '13' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) @@ -711,7 +469,9 @@ this.refreshAlarm() } }) - params = '8' + }, + zsMoel() { + const params = '8' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) @@ -797,11 +557,8 @@ // 获取当前报警列表 this.alarmList = response.data if (this.alarmList.length > 0) { - this.left = 621 this.hasAlarm = true - } else { - this.left = 0 - } + } for (const alarm of response.data) { for (const watch of watch_icon_layer.graphics) { if (alarm.devcode === watch.options.id) { @@ -934,6 +691,14 @@ cursor: pointer; } } + .map-type-div{ + position: absolute; + z-index: 100; + bottom: 2px; + right: 0px; + padding: 10px 0px 10px 10px; + background-color: rgba(255, 234, 241,0.8); + } // 报警列表 .map-alarm-div{ position: absolute; diff --git a/src/views/gasOverview/overview.vue b/src/views/gasOverview/overview.vue deleted file mode 100644 index 936577c..0000000 --- a/src/views/gasOverview/overview.vue +++ /dev/null @@ -1,802 +0,0 @@ - - - - - - - diff --git a/src/views/gasOverview/overviewBj.vue b/src/views/gasOverview/overviewBj.vue deleted file mode 100644 index 29c11ba..0000000 --- a/src/views/gasOverview/overviewBj.vue +++ /dev/null @@ -1,1240 +0,0 @@ - - - - - diff --git a/src/api/dashboard.js b/src/api/dashboard.js index aaadb23..ad0a916 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -79,7 +79,6 @@ }) } - // 用水事记查询 export function getNoteList() { return request({ diff --git a/src/api/data.js b/src/api/data.js index b7c9ba2..65c5071 100644 --- a/src/api/data.js +++ b/src/api/data.js @@ -85,6 +85,22 @@ params }) } +// 气体流量计数据查询 +export function getGasflowData(params) { + return request({ + url: 'gasflow/list', + method: 'get', + params + }) +} +// 腐蚀速率监测仪数据查询 +export function getCorrodeData(params) { + return request({ + url: 'corrode/data/list', + method: 'get', + params + }) +} // 批量导出井盖数据 export function batchExportWellData(params) { @@ -183,6 +199,26 @@ responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob }) } +// 腐蚀速率监测仪数据导出 +export function batchExportCorrodeData(params) { + return request({ + url: 'corrode/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} +// 气体流量计数据导出 +export function batchExportGasflowData(params) { + return request({ + url: 'gasflow/data/export', + method: 'get', + timeout: 120000, // 120s,2分钟 + params, + responseType: 'blob' // 这一步也很关键,一定要加上 responseType 值为 blob + }) +} // 温度压力数据查询 export function getTempPressData(params) { diff --git a/src/api/gasOverview.js b/src/api/gasOverview.js new file mode 100644 index 0000000..256bfb4 --- /dev/null +++ b/src/api/gasOverview.js @@ -0,0 +1,93 @@ +/** + * 动力管线 + */ +import request from '@/utils/request' + +// 用水量、噪声统计数据 +export function gasStatistic() { + return request({ + url: 'gasStatistic/overview', + method: 'get' + }) +} + +// 气体流量计数量 +export function deviceCount(params) { + return request({ + url: 'device/count/15', + method: 'get', + params + }) +} + +// 统计当前报警数 +export function alarmNowStatic(params) { + return request({ + url: 'statics/alarmsNow', + method: 'get', + params + }) +} + +// 查询二级分区各区用气量 +export function countBySecondArea(params) { + return request({ + url: 'gasStatistic/countBySecondArea', + method: 'get', + params + }) +} + +// 查询二级分区7日用气量 +export function countByDaySecond(params) { + return request({ + url: 'gasStatistic/countByDay', + method: 'get', + params + }) +} +// 查询二级分区各区用水量对比 +export function waterCompare(params) { + return request({ + url: 'gasStatistic/gasCompare', + method: 'get', + params + }) +} + +// 根据设备类型统计设备数量 +export function deviceStaticsByType(params) { + return request({ + url: 'statics/deviceStaticsByType', + method: 'get', + params + }) +} + +// 查询二级分区气体流量计告警 +export function alarmBySecondArea(params) { + return request({ + url: 'gasStatistic/alarmBySecondArea', + method: 'get', + params + }) +} + +// 用气事记查询 +export function getNoteList(params) { + return request({ + url: '/note/list', + method: 'get', + params + }) +} + +// 用气事记更新 +export function updateNoteList(data) { + return request({ + url: '/note/edit', + method: 'post', + data + }) +} + diff --git a/src/views/dashboard/components/waterNote.vue b/src/views/dashboard/components/waterNote.vue index 65cdec7..479b9ad 100644 --- a/src/views/dashboard/components/waterNote.vue +++ b/src/views/dashboard/components/waterNote.vue @@ -3,25 +3,25 @@
场区用水事记 - - + +
-
{{index+1}}. {{item.content}}
+
{{ index+1 }}. {{ item.content }}
-
{{index+1}}.
- +
{{ index+1 }}.
+
- - - + + +
- +
@@ -30,13 +30,12 @@ - - diff --git a/src/views/gasOverview/gasOverviewSimple.vue b/src/views/gasOverview/gasOverviewSimple.vue index bc2f67d..7b61965 100644 --- a/src/views/gasOverview/gasOverviewSimple.vue +++ b/src/views/gasOverview/gasOverviewSimple.vue @@ -64,46 +64,10 @@
-
-
- 设备列表 - - - - -
- - - - - - - - - - +
+ + {{ item.name }} +
@@ -135,11 +99,9 @@ components: {}, data() { return { + checkedCities: [], left: '', mapMark: '-', - typeShow: false, - showType: true, // 是否显示设备 - typeList: [], deviceTypeList: [], // 设备类型列表 multipleSelection: [], // 多选选中项 columnsType: [ @@ -254,239 +216,30 @@ this.initMars3D() }, methods: { - // table表格每行多选触发方法 - handleSelectionChange(val) { - console.log(val) - if (val.length === this.typeList.length || val.length === 0) { - this.initPoints() - } else if (val.length === 1) { - if (val[0].name === '远传水表') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - } else if (val[0].name === '供水泄漏检测仪') { - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (well_model_layer !== null) window.map.removeLayer(well_model_layer) - well_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(well_model_layer) - if (response.data.length > 0) { - let maxLng = parseFloat(response.data[0].longitude) - let minLng = parseFloat(response.data[0].longitude) - let maxLat = parseFloat(response.data[0].latitude) - let minLat = parseFloat(response.data[0].latitude) - for (let i = 0; i < response.data.length; i++) { - if (parseFloat(response.data[i].latitude) > 100) continue - const lng = parseFloat(response.data[i].longitude) - const lat = parseFloat(response.data[i].latitude) - - if (lng > maxLng) maxLng = lng - if (lng < minLng) minLng = lng - if (lat > maxLat) maxLat = lat - if (lat < minLat) minLat = lat - - well_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [lng, lat, 0], - style: { - url: '../static/model/ys.gltf', - scale: 2 - }, - popup: `给水井
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - const start = Cesium.Cartographic.fromDegrees(parseFloat(maxLng), parseFloat(maxLat)) - const end = Cesium.Cartographic.fromDegrees(parseFloat(minLng), parseFloat(minLat)) - const geodesic = new Cesium.EllipsoidGeodesic() - geodesic.setEndPoints(start, end) - const distance = geodesic.surfaceDistance - const center = { lat: (parseFloat(maxLat) + parseFloat(minLat)) / 2, lng: (parseFloat(maxLng) + parseFloat(minLng)) / 2, alt: distance + 1500, heading: 360, pitch: -90 } - window.map.setCameraView(center) - } - } - }) - params = '13' - getMapping(params, this.mapMark).then(response => { - if (response.code === 200) { - if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) - watch_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(watch_model_layer) - if (watch_icon_layer !== null) window.map.removeLayer(watch_icon_layer) - watch_icon_layer = new mars3d.layer.GraphicLayer() - 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.5], - style: { - url: '../static/model/sb.glb', - scale: 2, - heading: 90 - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - watch_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/sb.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `远程水表
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) - params = '8' - getMapping(params, this.listQuery.keywords).then(response => { - if (response.code === 200) { - if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) - zs_model_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_model_layer) - - if (zs_icon_layer !== null) window.map.removeLayer(zs_icon_layer) - zs_icon_layer = new mars3d.layer.GraphicLayer() - window.map.addLayer(zs_icon_layer) - for (let i = 0; i < response.data.length; i++) { - zs_model_layer.addGraphic(new mars3d.graphic.ModelPrimitive({ - position: [response.data[i].longitude, response.data[i].latitude, 0], - style: { - url: '../static/model/zs.glb', - scale: 1, - heading: 90 - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - zs_icon_layer.addGraphic(new mars3d.graphic.BillboardEntity({ - id: response.data[i].devcode, - position: [response.data[i].longitude, response.data[i].latitude, 1], - style: { - image: '../static/images/icon/zs.png', - scale: 1, - horizontalOrigin: Cesium.HorizontalOrigin.CENTER, - verticalOrigin: Cesium.VerticalOrigin.BOTTOM, - scaleByDistance: new Cesium.NearFarScalar(10, 1, 2000, 0.3) - }, - popup: `噪声记录仪
设备编号:${response.data[i].devcode}
设备型号:${response.data[i].modelName}
设备类型:${response.data[i].deviceTypeName}
井编号:${response.data[i].wellCode}
所属单位:${response.data[i].deptName}
详细位置:${response.data[i].position}` - })) - } - this.refreshAlarm() - } - }) + // 设备展示 + handleCheckedCitiesChange(val) { + console.log(val, '000000000000000000000000000000') + val.forEach(item => { + if (item.indexOf('远传水表') === -1) { + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.zsMoel() + } else if (item.indexOf('供水泄露监测仪') === -1) { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(well_model_layer) + this.wellMode() + this.watchModel() + } else { + window.map.removeLayer(zs_model_layer) + window.map.removeLayer(zs_icon_layer) + window.map.removeLayer(watch_model_layer) + window.map.removeLayer(watch_icon_layer) + window.map.removeLayer(well_model_layer) } - } - // this.multipleSelection = val + }) }, // 获取设备类型 fetchDeviceType() { @@ -499,7 +252,6 @@ this.deviceTypeList.push(deviceType) } } - this.typeList = this.deviceTypeList }) }, // 初始化地球 @@ -635,9 +387,13 @@ }, // 初始化井,设备 async initPoints() { + this.wellMode() + this.watchModel() + this.zsMoel() + }, + wellMode() { // 井 - let params = '' - getMapping(params, this.listQuery.keywords).then(response => { + getMapping(this.listQuery.keywords).then(response => { if (response.code === 200) { if (well_model_layer !== null) window.map.removeLayer(well_model_layer) well_model_layer = new mars3d.layer.GraphicLayer() @@ -676,7 +432,9 @@ } } }) - params = '13' + }, + watchModel() { + const params = '13' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (watch_model_layer !== null) window.map.removeLayer(watch_model_layer) @@ -711,7 +469,9 @@ this.refreshAlarm() } }) - params = '8' + }, + zsMoel() { + const params = '8' getMapping(params, this.listQuery.keywords).then(response => { if (response.code === 200) { if (zs_model_layer !== null) window.map.removeLayer(zs_model_layer) @@ -797,11 +557,8 @@ // 获取当前报警列表 this.alarmList = response.data if (this.alarmList.length > 0) { - this.left = 621 this.hasAlarm = true - } else { - this.left = 0 - } + } for (const alarm of response.data) { for (const watch of watch_icon_layer.graphics) { if (alarm.devcode === watch.options.id) { @@ -934,6 +691,14 @@ cursor: pointer; } } + .map-type-div{ + position: absolute; + z-index: 100; + bottom: 2px; + right: 0px; + padding: 10px 0px 10px 10px; + background-color: rgba(255, 234, 241,0.8); + } // 报警列表 .map-alarm-div{ position: absolute; diff --git a/src/views/gasOverview/overview.vue b/src/views/gasOverview/overview.vue deleted file mode 100644 index 936577c..0000000 --- a/src/views/gasOverview/overview.vue +++ /dev/null @@ -1,802 +0,0 @@ - - - - - - - diff --git a/src/views/gasOverview/overviewBj.vue b/src/views/gasOverview/overviewBj.vue deleted file mode 100644 index 29c11ba..0000000 --- a/src/views/gasOverview/overviewBj.vue +++ /dev/null @@ -1,1240 +0,0 @@ - - - - - diff --git a/src/views/gasOverview/overviewCesium.vue b/src/views/gasOverview/overviewCesium.vue deleted file mode 100644 index 9915f5f..0000000 --- a/src/views/gasOverview/overviewCesium.vue +++ /dev/null @@ -1,1211 +0,0 @@ - - - - - -