LogisticsVehicleOverview.vue
3.52 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
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
<script setup>
const vehicleData = [
{
icon: 'ri-car-line',
title: 'On the way',
time: '2hr 10min',
percentage: 39.7,
color: {
bg: 'rgba(var(--v-theme-on-surface), var(--v-hover-opacity))',
text: 'rgba(var(--v-theme-on-surface), var(--v-high-emphasis-opacity))',
},
},
{
icon: 'ri-download-cloud-2-line',
title: 'Unloading',
time: '3hr 15min',
percentage: 28.3,
color: {
bg: 'rgb(var(--v-theme-primary))',
text: 'rgb(var(--v-theme-on-primary))',
},
},
{
icon: 'ri-upload-line',
title: 'Loading',
time: '1hr 24min',
percentage: 17.4,
color: {
bg: 'rgb(var(--v-theme-info))',
text: 'rgb(var(--v-theme-on-primary))',
},
},
{
icon: 'ri-timer-line',
title: 'Waiting',
time: '5hr 19min',
percentage: 14.6,
color: {
bg: 'rgb(var(--v-tooltip-background))',
text: 'rgba(var(--v-theme-surface))',
},
},
]
</script>
<template>
<VCard>
<VCardItem title="Vehicles Overview">
<template #append>
<MoreBtn />
</template>
</VCardItem>
<VCardText>
<div class="d-flex mb-6">
<div
v-for="(item, index) in vehicleData"
:key="item.title"
:style="`inline-size: ${item.percentage}%;`"
>
<div class="vehicle-progress-label position-relative mb-4 text-body-1 d-none d-sm-block">
{{ item.title }}
</div>
<VProgressLinear
:color="item.color.bg"
model-value="100"
height="46"
:class="index === 0 ? 'rounded-s' : index === vehicleData.length - 1 ? 'rounded-e' : ''"
>
<p
class="text-sm font-weight-medium mb-0"
:style="`color: ${item.color.text}`"
>
{{ item.percentage }}%
</p>
</VProgressLinear>
</div>
</div>
<VTable class="text-no-wrap">
<tbody>
<tr
v-for="(vehicle, index) in vehicleData"
:key="index"
>
<td
width="70%"
class="ps-0"
>
<div class="d-flex align-center text-high-emphasis">
<VIcon
:icon="vehicle.icon"
size="24"
class="me-2"
/>
<h6 class="text-h6 font-weight-regular">
{{ vehicle.title }}
</h6>
</div>
</td>
<td>
<h6 class="text-h6">
{{ vehicle.time }}
</h6>
</td>
<td>
<span class="text-body-1">{{ vehicle.percentage }}%</span>
</td>
</tr>
</tbody>
</VTable>
</VCardText>
</VCard>
</template>
<style lang="scss" scoped>
.vehicle-progress-label {
padding-block-end: 1rem;
&::after {
position: absolute;
display: inline-block;
background-color: rgba(var(--v-theme-on-surface), var(--v-border-opacity));
block-size: 10px;
content: "";
inline-size: 2px;
inset-block-end: 0;
inset-inline-start: 0;
[dir="rtl"] & {
inset-inline: unset 0;
}
}
}
</style>
<style lang="scss">
.v-progress-linear__content {
justify-content: start;
padding-inline-start: 1rem;
}
@media (max-width: 1080px) {
.v-progress-linear__content {
padding-inline-start: 0.75rem !important;
}
}
@media (max-width: 576px) {
.v-progress-linear__content {
padding-inline-start: 0.3rem !important;
}
}
</style>