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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
| <template>
| <div class="total" @click="goToPage">
| <!-- 图 -->
| <div class="content">
| <div class="value">{{ value }}</div>
| </div>
| <!-- 标签 -->
| <div class="tag">{{ tag }}</div>
| </div>
| </template>
|
| <script>
| const types = ['站点', '电源', '电池组', '本年已放数'];
| export default {
| name: '',
| props: {
| type: {
| type: Number,
| default: 0
| },
| value: {
| type: [String, Number],
| default: 0
| }
| },
| data() {
| return {
| }
| },
| computed: {
| tag() {
| // console.log(types, this.type)
| return types[this.type] || '未知';
| }
| },
| components: {
|
| },
| methods: {
| goToPage() {
| let type = this.type;
| switch (type) {
| case 0:
| this.$router.push("/dataMager/totalStation");
| break;
| case 1:
| this.$router.push("/dataMager/powerMager");
| break;
| case 2:
| this.$router.push("/dataMager/battGroupMager");
| break;
| case 3:
| this.$router.push("/dataMager/battGroupMager");
| break;
| }
| }
| },
|
| mounted() {
|
| }
|
| }
| </script>
|
| <style scoped>
| .total {
| display: flex;
| flex-direction: column;
| justify-content: flex-start;
| align-items: center;
| cursor: pointer;
| }
|
| .content {
| position: relative;
| /* border: 1px #ccc solid; */
| width: 200px;
| height: 146px;
| background: url('../images/total_0.png') center center / contain no-repeat;
| }
|
| .value {
| position: absolute;
| top: 36px;
| left: 50%;
| transform: translateX(-50%);
| font-size: 30px;
| font-weight: bold;
| color: #ffff00;
| }
|
| .tag {
| margin-top: 0.6em;
| display: flex;
| justify-content: center;
| align-items: center;
| color: #011f39;
| font-size: 18px;
| height: 2em;
| width: 6.6em;
| font-weight: bold;
| background: url('../images/tag.png') center center / 100% 100% no-repeat;
| }
| </style>
|
|