|
@@ -71,7 +71,7 @@
|
|
|
</ul>
|
|
|
</div>
|
|
|
<div>
|
|
|
- <Chart :items="data[this.activeIndex]" />
|
|
|
+ <Chart :items="chartData" :label="chartLabel" />
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -79,11 +79,18 @@
|
|
|
|
|
|
<script>
|
|
|
import Chart from './Chart.vue'
|
|
|
-import { getSxzb,getQhyys } from "@/api/index.js";
|
|
|
+import { getSxzbListToatl, getQhyyListToatl } from "@/api/index.js";
|
|
|
export default {
|
|
|
name: 'FireIndex',
|
|
|
components: {
|
|
|
- Chart
|
|
|
+ Chart,
|
|
|
+ },
|
|
|
+ props: {
|
|
|
+ qx: String,
|
|
|
+ type: {
|
|
|
+ type: Number,
|
|
|
+ default: 0
|
|
|
+ }
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
@@ -96,253 +103,57 @@ export default {
|
|
|
],
|
|
|
activeIndex: 0,
|
|
|
data: [
|
|
|
- [
|
|
|
- {
|
|
|
- "name": "一月",
|
|
|
- "value": 120
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "二月",
|
|
|
- "value": 200
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "三月",
|
|
|
- "value": 150
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "四月",
|
|
|
- "value": 80
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "五月",
|
|
|
- "value": 110
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "六月",
|
|
|
- "value": 130
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "七月",
|
|
|
- "value": 30
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "八月",
|
|
|
- "value": 210
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "九月",
|
|
|
- "value": 220
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十月",
|
|
|
- "value": 123
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十一月",
|
|
|
- "value": 234
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十二月",
|
|
|
- "value": 70
|
|
|
- }],
|
|
|
- [ {
|
|
|
- "name": "一月",
|
|
|
- "value": 1
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "二月",
|
|
|
- "value": 3
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "三月",
|
|
|
- "value": 2
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "四月",
|
|
|
- "value": 5
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "五月",
|
|
|
- "value": 5
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "六月",
|
|
|
- "value": 6
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "七月",
|
|
|
- "value": 7
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "八月",
|
|
|
- "value": 8
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "九月",
|
|
|
- "value": 3
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十月",
|
|
|
- "value": 3
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十一月",
|
|
|
- "value": 2
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十二月",
|
|
|
- "value": 1
|
|
|
- }],
|
|
|
- [ {
|
|
|
- "name": "一月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "二月",
|
|
|
- "value": 32
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "三月",
|
|
|
- "value": 23
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "四月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "五月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "六月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "七月",
|
|
|
- "value": 11
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "八月",
|
|
|
- "value": 18
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "九月",
|
|
|
- "value": 19
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十月",
|
|
|
- "value": 2
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十一月",
|
|
|
- "value": 4
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十二月",
|
|
|
- "value": 6
|
|
|
- }],
|
|
|
- [ {
|
|
|
- "name": "一月",
|
|
|
- "value": 7
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "二月",
|
|
|
- "value": 54
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "三月",
|
|
|
- "value": 43
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "四月",
|
|
|
- "value": 23
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "五月",
|
|
|
- "value": 11
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "六月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "七月",
|
|
|
- "value": 34
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "八月",
|
|
|
- "value": 56
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "九月",
|
|
|
- "value": 78
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十月",
|
|
|
- "value": 98
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十一月",
|
|
|
- "value": 23
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十二月",
|
|
|
- "value": 43
|
|
|
- }],
|
|
|
- [ {
|
|
|
- "name": "一月",
|
|
|
- "value": 43
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "二月",
|
|
|
- "value": 34
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "三月",
|
|
|
- "value": 56
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "四月",
|
|
|
- "value": 78
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "五月",
|
|
|
- "value": 23
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "六月",
|
|
|
- "value": 24
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "七月",
|
|
|
- "value": 25
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "八月",
|
|
|
- "value": 26
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "九月",
|
|
|
- "value": 45
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十月",
|
|
|
- "value": 12
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十一月",
|
|
|
- "value": 11
|
|
|
- },
|
|
|
- {
|
|
|
- "name": "十二月",
|
|
|
- "value": 22
|
|
|
- }]
|
|
|
+ [],
|
|
|
+ [],
|
|
|
+ [],
|
|
|
+ [],
|
|
|
+ []
|
|
|
],
|
|
|
params:{
|
|
|
pageSize:100,
|
|
|
- pageNum:1,
|
|
|
- qy:'万州区'
|
|
|
+ pageNum:1
|
|
|
+ },
|
|
|
+ // 年份横坐标轴标签
|
|
|
+ yearLabel: [],
|
|
|
+ // 年份数据
|
|
|
+ yearData: [],
|
|
|
+ // 月份纵坐标轴标签
|
|
|
+ monthLabel: [],
|
|
|
+ // 月份数据
|
|
|
+ monthData: [],
|
|
|
+ modeType: 0,
|
|
|
+ fireIndexLabel: [],
|
|
|
+ fireIndexData: [],
|
|
|
+ }
|
|
|
+ },
|
|
|
+ watch: {
|
|
|
+ type: {
|
|
|
+ handler(idx){
|
|
|
+ this.modeType = idx
|
|
|
},
|
|
|
+ immediate: true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ computed: {
|
|
|
+ chartLabel() {
|
|
|
+ if (this.activeIndex === 4) {
|
|
|
+ return this.fireIndexLabel[this.type]
|
|
|
+ }
|
|
|
+ if (this.type === 0) {
|
|
|
+ return this.monthLabel;
|
|
|
+ } else {
|
|
|
+ return this.yearLabel
|
|
|
+ }
|
|
|
+ },
|
|
|
+ chartData() {
|
|
|
+ if (this.activeIndex === 4) {
|
|
|
+ return this.fireIndexData[this.type]
|
|
|
+ }
|
|
|
+ if (this.type === 0) {
|
|
|
+ return this.monthData[this.activeIndex]
|
|
|
+ } else {
|
|
|
+ return this.yearData[this.activeIndex];
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
@@ -350,8 +161,51 @@ export default {
|
|
|
return this.activeIndex === index
|
|
|
},
|
|
|
getFrieList(){
|
|
|
- getQhyys(this.params).then(res=>{
|
|
|
- console.log(res.data.rows);
|
|
|
+ this.loadQhyyListToatl()
|
|
|
+ this.loadSxzbChartData()
|
|
|
+ },
|
|
|
+ loadQhyyListToatl() {
|
|
|
+ getQhyyListToatl({
|
|
|
+ ...this.params,
|
|
|
+ qx: this.qx === '重庆市' ? "" : this.qx
|
|
|
+ }).then(res=>{
|
|
|
+ const temp = res.data.data
|
|
|
+ const year =temp.qhyyListByYear
|
|
|
+ const month = temp.qhyyListByMonth
|
|
|
+ this.fireIndexLabel = [
|
|
|
+ month.map(item => item.qhyy),
|
|
|
+ year.map(item => item.qhyy)
|
|
|
+ ]
|
|
|
+ this.fireIndexData = [
|
|
|
+ month.map(item => ({ name: item.qhyy, value: item.hzqs })),
|
|
|
+ year.map(item => ({ name: item.qhyy, value: item.hzqs }))
|
|
|
+ ]
|
|
|
+ })
|
|
|
+ },
|
|
|
+ loadSxzbChartData() {
|
|
|
+ getSxzbListToatl({
|
|
|
+ ...this.params,
|
|
|
+ qx: this.qx === '重庆市' ? "" : this.qx
|
|
|
+ }).then(res => {
|
|
|
+ const temp = res.data.data
|
|
|
+ const year =temp.sxzbYear
|
|
|
+ const month = temp.sxzbMonth.splice(temp.sxzbMonth.length - 12, 12)
|
|
|
+ this.monthLabel = month.map(item => item.y)
|
|
|
+ this.yearLabel = year.map(item => item.n)
|
|
|
+ this.monthData = [
|
|
|
+ month.map(item => ({ name: item.y, value: item.hzqs })),
|
|
|
+ month.map(item => ({ name: item.y, value: item.wrs })),
|
|
|
+ month.map(item => ({ name: item.y, value: item.sss })),
|
|
|
+ month.map(item => ({ name: item.y, value: item.zzjjss })),
|
|
|
+ []
|
|
|
+ ]
|
|
|
+ this.yearData = [
|
|
|
+ year.map(item => ({ name: item.y, value: item.hzqs })),
|
|
|
+ year.map(item => ({ name: item.y, value: item.wrs })),
|
|
|
+ year.map(item => ({ name: item.y, value: item.sss })),
|
|
|
+ year.map(item => ({ name: item.y, value: item.zzjjss })),
|
|
|
+ []
|
|
|
+ ]
|
|
|
})
|
|
|
}
|
|
|
},
|