1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<template>
<div
class="Dashboard-DataCard EquipmentList"
v-loading="loading.equipment"
>
<div class="Dashboard-title">
<div class="Dashboard-title-icon equipment">
<img src="@/assets/images/dashboard/icon_paiming@2x.png" />
</div>
<div class="Dashboard-title-text">
<span class="serviceName">{{consumeServiceInfo.serviceName}}</span>设备消费排名
</div>
<el-radio-group v-model="showTopFive">
<el-radio-button :label="true">前五名</el-radio-button>
<el-radio-button :label="false">后五名</el-radio-button>
</el-radio-group>
</div>
<EquipmentListChart :data="showTopFive?consumeHardVos:consumeAfterVos" />
</div>
</template>
<script>
import EquipmentListChart from './EquipmentListChart';
import { mapGetters, mapActions } from 'vuex';
export default {
name: 'EquipmentList',
components: {
EquipmentListChart,
},
data() {
return {
showTopFive: true,
};
},
computed: {
...mapGetters('Dashboard', [
'consumeHardVos',
'consumeAfterVos',
'consumeServiceInfo',
'loading',
]),
},
methods: {
...mapActions('Dashboard', ['fetchConsumeList']),
},
};
</script>
<style lang="scss">
@import '@/assets/styles/variables.scss';
.EquipmentList {
.Dashboard-title {
border-bottom: 1px solid #f1f1f1;
&::before {
display: none;
}
.el-radio-button__inner {
line-height: 0;
padding: 12px 20px;
}
.serviceName {
color: #f10000;
}
}
}
@media screen and (max-width: $bigScreenWidth) {
.EquipmentList {
.Dashboard-title {
.el-radio-button__inner {
padding: 12px 5px;
}
}
}
}
</style>