大气gis右上角统计

This commit is contained in:
weicw
2022-02-03 15:37:12 +08:00
parent 98248a8415
commit 535ef79624
7 changed files with 529 additions and 457 deletions

View File

@@ -23,13 +23,13 @@
<div id="map" ref="map" style="overflow: hidden"></div>
<tip-tool :flag="tipFlag" :x="currentX" :y="currentY" :data="tipData"></tip-tool>
<!-- <mapNominal :param="nominalList"></mapNominal>-->
<!-- <map-table-center :rowData="pointData"></map-table-center>-->
<map-table-center :rowData="statisticData"></map-table-center>
<map-table :rowData="pointData"></map-table>
</div>
</template>
<script>
import {
getPlaceGis,
getPlaceGis, statisticCity, statisticCounty
} from "@/api/ecology/atmosphere/acid";
import {
getColumnOptions,
@@ -38,7 +38,8 @@ import {
import tipTool from "./components/tipTool";
// import mapNominal from "./components/mapNominal";
import mapTable from "./components/mapTable";
// import mapTableCenter from "./components/mapTableCenter";
import mapTableCenter from "./components/mapTableCenter";
import axios from 'axios';
let scene = null;
let pointLayer = null;
@@ -49,7 +50,7 @@ export default {
tipTool,
// mapNominal,
mapTable,
// mapTableCenter
mapTableCenter
},
data() {
return {
@@ -69,6 +70,7 @@ export default {
nominalList: [],
points: [],//数据准备
dataSource: [],
statisticData:[],
value: '',
result: [],
searchKey: "",
@@ -203,7 +205,7 @@ export default {
that.tipData = that.pointData[currentId.substring(2, currentId.length)]
that.currentX = e.pageX - calcWidth
that.currentY = e.pageY - 80
},true)
}, true)
myCompOverlay.addEventListener('mouseout', function () {
setTimeout(() => {
@@ -211,7 +213,7 @@ export default {
that.currentX = 30000
that.currentY = 0
that.tipFlag = false
},true)
}, true)
})
},
whereChange(e) {
@@ -239,6 +241,30 @@ export default {
if (scene && pointLayer) {
scene.removeLayer(pointLayer)
}
this.statisticData = [];
let req;
const params = {
timeStart: this.where.year + "-01-01 00:00:00",
timeEnd: this.where.year + "-12-31 59:59:59"
};
if (this.where.regionLevel == "市级") {
req = axios.post(statisticCity, params)
} else {
req = axios.post(statisticCounty, params)
}
req.then(res => {
if (res.data.code == 0 && res.data.data.length > 0) {
const list = [];
res.data.data.forEach(item => {
const key = Object.keys(item)[0]
const fData = item[key].filter(i=>i.periodType === "本年度")
list.push(...fData)
})
this.statisticData = list;
}
})
getPlaceGis(this.where).then((res) => {
that.pointData = []
that.dataSource = []