|
@@ -13,9 +13,11 @@
|
|
|
<span class="time">{{ ['火灾总数', '死亡人数'][idx]}}</span>
|
|
|
<span class="unit">同比</span>
|
|
|
</div>
|
|
|
- <VueSeamlessScroll :data="list" :class-option="classOption" class="warp">
|
|
|
+ <VueSeamlessScroll v-if="reload" :data="list" :class-option="classOption" class="warp">
|
|
|
<ul class="item">
|
|
|
- <li class="row" v-for="(item, index) in list" :key="index">
|
|
|
+ <li class="row" :class="{
|
|
|
+ active: item.isActive
|
|
|
+ }" v-for="(item, index) in list" :key="index">
|
|
|
<span class="type">{{ index + 1 }}</span>
|
|
|
<span class="count">{{ item.qx }}</span>
|
|
|
<span class="time">{{ [item.bnhzqs, item.bnwrs ][idx] }}</span>
|
|
@@ -34,6 +36,7 @@ import VueSeamlessScroll from "vue-seamless-scroll";
|
|
|
import upIcon from '../../../assets/images/up-icon.svg';
|
|
|
import downIcon from '../../../assets/images/down-icon.svg';
|
|
|
import { fireDistribution } from '@/api/hzfx'
|
|
|
+import { toFirst } from '@/utils'
|
|
|
|
|
|
export default {
|
|
|
name: 'FireDistribution',
|
|
@@ -46,7 +49,8 @@ export default {
|
|
|
data() {
|
|
|
return {
|
|
|
idx: 0,
|
|
|
- list: []
|
|
|
+ list: [],
|
|
|
+ reload: true
|
|
|
};
|
|
|
},
|
|
|
created() {
|
|
@@ -80,24 +84,29 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
loadData() {
|
|
|
+ this.reload = false
|
|
|
fireDistribution({
|
|
|
pageSize: 100,
|
|
|
pageNum: 1,
|
|
|
// qx: this.qx
|
|
|
}).then(res => {
|
|
|
- this.list = res.data.rows.map(item => ({...item,
|
|
|
+ let tempData = res.data.rows.map(item => ({...item,
|
|
|
hzPercent: this.getPercent(item.bnhzqs, item.tqhzqs),
|
|
|
wrPercent: this.getPercent(item.bnwrs, item.tqwrs),
|
|
|
hzIcon: this.getIcon(item.bnhzqs, item.tqhzqs),
|
|
|
- wrIcon: this.getIcon(item.bnwrs, item.tqwrs)
|
|
|
+ wrIcon: this.getIcon(item.bnwrs, item.tqwrs),
|
|
|
+ isActive: item.qx === this.qx
|
|
|
}))
|
|
|
+ this.list = toFirst(tempData, this.qx, 'qx')
|
|
|
+ this.reload = true
|
|
|
})
|
|
|
}
|
|
|
},
|
|
|
computed: {
|
|
|
classOption() {
|
|
|
return {
|
|
|
- singleHeight: 51
|
|
|
+ singleHeight: 51,
|
|
|
+ autoPlay: this.qx === ""
|
|
|
};
|
|
|
},
|
|
|
},
|
|
@@ -137,6 +146,10 @@ li.row > span {
|
|
|
display: inline-block;
|
|
|
}
|
|
|
|
|
|
+li.row.active {
|
|
|
+ background-color: rgba(0, 213, 255, 0.2);
|
|
|
+}
|
|
|
+
|
|
|
li.row {
|
|
|
box-sizing: border-box;
|
|
|
}
|