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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
| <template>
| <div class="total" @click="goToPage" :class="size">
| <!-- 图 -->
| <div class="content">
| <div class="value">{{ value }}</div>
| </div>
| <!-- 标签 -->
| <div class="tag">{{ label?label:tag }}</div>
| </div>
| </template>
|
| <script>
| const types = ['设备', '电源', '电池组', '本年已放组数'];
| export default {
| name: '',
| props: {
| type: {
| type: Number,
| default: 0
| },
| value: {
| type: [String, Number],
| default: 0
| },
| label: {
| type: String,
| default: ""
| },
| size: {
| type: String,
| default: ''
| },
| },
| data() {
| return {
| }
| },
| computed: {
| tag() {
| // console.log(types, this.type)
| return types[this.type] || '未知';
| }
| },
| components: {
|
| },
| methods: {
| goToPage() {
| let type = this.type;
| let random = Math.random();
| switch (type) {
| case 0:
| this.$router.push("/dataMager/totalStation?pageFlag="+random);
| break;
| case 1:
| this.$router.push("/dataMager/powerMager?pageFlag="+random);
| break;
| case 2:
| this.$router.push("/dataMager/battGroupMager?pageFlag="+random);
| break;
| case 3:
| // this.$router.push("/reportStatistics/eleAssess");
| // break;
| default:
| this.$emit('click', true);
| 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;
| }
|
| .mini .content {
| width: 150px;
| height: 100px;
| }
|
| .value {
| position: absolute;
| top: 36px;
| left: 50%;
| transform: translateX(-50%);
| font-size: 30px;
| font-weight: bold;
| color: #ffff00;
| }
|
| .mini .value {
| top: 20px;
| }
|
| .tag {
| margin-top: 0.6em;
| display: flex;
| justify-content: center;
| align-items: center;
| color: #011f39;
| font-size: 18px;
| min-height: 2em;
| min-width: 6.6em;
| padding: 0 16px;
| font-weight: bold;
| background: url('../images/tag.png') center center / 100% 100% no-repeat;
| }
| .mini .tag {
| font-size: 16px;
| }
| </style>
|
|