|
@@ -14,7 +14,7 @@
|
|
|
<div>
|
|
|
<div>
|
|
|
<div style="width: 910px; display: flex; position: relative;">
|
|
|
- <MapCharts :formatter="showLabel" :qx="qx" @selectArea="area => qx = area" />
|
|
|
+ <MapCharts :mapHeatData="heatMap" :formatter="showLabel" :qx="qx" @selectArea="area => qx = area" />
|
|
|
<div style="position: absolute;width: 500px; left: 10px;top: 10px;">
|
|
|
<search-box :area.sync="qx" />
|
|
|
</div>
|
|
@@ -41,7 +41,6 @@
|
|
|
<basic-modal top="120px" ref="basicInfoModal" name="火灾分析">
|
|
|
<hzfxCont :qx="qx" />
|
|
|
</basic-modal>
|
|
|
-
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
@@ -54,8 +53,10 @@
|
|
|
import SearchBox from '@/components/SearchBox.vue';
|
|
|
import MapCharts from "../Home/components/MapCharts.vue";
|
|
|
import hzfxCont from './components/hzfxCont.vue';
|
|
|
-
|
|
|
-
|
|
|
+ import { fireDistribution } from '@/api/hzfx'
|
|
|
+ import {
|
|
|
+ formatCityData
|
|
|
+ } from '../../utils'
|
|
|
export default {
|
|
|
name: "FireCondition",
|
|
|
components: {
|
|
@@ -72,13 +73,17 @@
|
|
|
data() {
|
|
|
return {
|
|
|
qx: '重庆市',
|
|
|
- type: 1
|
|
|
+ type: 1,
|
|
|
+ heatMap: []
|
|
|
}
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.loadData()
|
|
|
+ },
|
|
|
methods: {
|
|
|
showLabel(params) {
|
|
|
let res = params.name + "<br/>";
|
|
|
- res += `火灾起数<span style="font-size: 24px;color:red;font-weight:bold;">${params.value}</span>个`;
|
|
|
+ res += `本年火灾起数<span style="font-size: 24px;color:red;font-weight:bold;">${params.value}</span>个`;
|
|
|
return res;
|
|
|
},
|
|
|
change(e) {
|
|
@@ -90,7 +95,18 @@
|
|
|
openBasicModal() {
|
|
|
this.showModal("basicInfoModal");
|
|
|
},
|
|
|
-
|
|
|
+ loadData() {
|
|
|
+ fireDistribution({
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 100
|
|
|
+ }).then(res => {
|
|
|
+ const data = res.data.rows
|
|
|
+ this.heatMap = formatCityData(data.map(item => ({
|
|
|
+ name: item.qx,
|
|
|
+ value: item.bnhzqs
|
|
|
+ })))
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
};
|
|
|
</script>
|