statisticsCard.vue
1.77 KB
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
<template>
<a-row class="statistics-card-main" :class="{ 'no-background': cardInfo.unBgColor }">
<a-col class="statistics-card-title">
<ul>
<li v-if="cardInfo.iconColor" class="statistics-card-icon" :class="cardInfo.iconColor"></li>
<li>{{ cardInfo.title }}</li>
<li class="statistics-card-unit" v-if="cardInfo.unit">/{{ cardInfo.unit }}</li>
</ul>
</a-col>
<a-col class="statistics-card-content">
{{ cardInfo.content }}
</a-col>
</a-row>
</template>
<script lang="ts" setup>
defineProps({
titleClass: {
type: String,
default: "",
},
contentClass: {
type: String,
default: "",
},
cardInfo: {
type: Object,
default() {
return {
title: "",
content: 0,
iconColor: "",
unBgColor: false
};
},
},
});
</script>
<style lang="less" scoped>
.statistics-card-main {
height: 70px;
background: #f1f1f1;
padding: 10px;
&.no-background {
background: none;
}
.statistics-card-title {
ul {
list-style: none;
display: flex;
align-items: center;
padding: 0;
margin: 0;
li {
margin-right: 8px;
&:last-child {
margin-right: 0;
}
&.statistics-card-icon {
width: 6px;
height: 6px;
border-radius: 50%;
&.lightGreen {
background: lightgreen;
}
&.green {
background: green;
}
&.deepGreen {
background: rgb(4, 76, 4);
}
&.orange {
background: orange;
}
}
&.statistics-card-unit {
color: rgb(182, 182, 182);
}
}
}
}
.statistics-card-content {
font-size: 20px;
}
}
</style>