-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
/
Copy pathList.vue
75 lines (73 loc) · 1.82 KB
/
List.vue
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
<script setup>
import { VList } from 'virtua/vue'
defineProps({
metrics: {
type: Array,
required: true,
},
type: {
type: String,
required: true,
},
})
</script>
<template>
<div class="w-full text-sm">
<div
class="flex justify-between transition-colors border-b hover:bg-muted/50 leading-[48px]"
>
<div
class="h-12 px-4 font-medium text-left align-middle text-muted-foreground "
>
{{ $t('dashboard.name') }}
</div>
<div
class="h-12 px-4 font-medium text-right align-middle text-muted-foreground"
>
{{ $t('dashboard.count') }}
</div>
</div>
<VList
v-slot="{ item: metric }"
:data="metrics"
:style="{ height: '342px' }"
>
<div class="px-4 py-2 transition-colors border-b hover:bg-muted/50">
<div class="flex justify-between">
<div
class="flex-1 leading-5 truncate font-mediums"
>
<DashboardMetricsName
:name="metric.name"
:type="type"
/>
</div>
<div
class="text-right"
>
{{ formatNumber(metric.count) }}
<span class="text-xs text-gray-500">({{ metric.percent }}%)</span>
</div>
</div>
<div
class="flex-1"
>
<TooltipProvider>
<Tooltip>
<TooltipTrigger class="w-full">
<Progress
v-model="metric.percent"
class="h-2"
:color="metric.color"
/>
</TooltipTrigger>
<TooltipContent>
<p>{{ metric.percent }}%</p>
</TooltipContent>
</Tooltip>
</TooltipProvider>
</div>
</div>
</VList>
</div>
</template>