2024-04-05 17:35:14 +07:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import AppBox from 'components/app/AppBox.vue';
|
|
|
|
|
|
2024-04-22 14:19:35 +07:00
|
|
|
const props = withDefaults(
|
|
|
|
|
defineProps<{
|
|
|
|
|
branch: {
|
|
|
|
|
count: number;
|
|
|
|
|
label: string;
|
2024-06-12 15:34:09 +07:00
|
|
|
color: 'pink' | 'purple' | 'green' | 'orange';
|
2024-04-22 14:19:35 +07:00
|
|
|
}[];
|
|
|
|
|
dark?: boolean;
|
2024-04-23 14:43:00 +07:00
|
|
|
labelI18n?: boolean;
|
2024-07-03 09:21:53 +00:00
|
|
|
nowrap?: boolean;
|
2024-04-22 14:19:35 +07:00
|
|
|
}>(),
|
|
|
|
|
{
|
2024-04-23 14:43:00 +07:00
|
|
|
labelI18n: false,
|
2024-04-22 14:19:35 +07:00
|
|
|
},
|
|
|
|
|
);
|
2024-04-05 17:35:14 +07:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<div
|
2024-07-03 09:21:53 +00:00
|
|
|
class="row full-width"
|
2024-04-05 17:35:14 +07:00
|
|
|
style="gap: var(--size-4)"
|
2024-07-04 04:14:41 +00:00
|
|
|
:class="{ dark, 'no-wrap': nowrap }"
|
2024-04-05 17:35:14 +07:00
|
|
|
>
|
2024-04-10 20:43:58 +07:00
|
|
|
<AppBox
|
2024-04-23 14:20:08 +07:00
|
|
|
v-for="v in props.branch"
|
2024-04-05 17:35:14 +07:00
|
|
|
:key="v.label"
|
2024-07-03 09:21:53 +00:00
|
|
|
class="bordered stat-card__wave"
|
2024-04-23 14:20:08 +07:00
|
|
|
:class="{ [`stat-card__${v.color}`]: true }"
|
2024-06-12 15:34:09 +07:00
|
|
|
style="
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
height: 75px;
|
2024-07-03 10:59:56 +00:00
|
|
|
min-width: 232px;
|
2024-06-12 15:34:09 +07:00
|
|
|
box-shadow: var(--shadow-2);
|
|
|
|
|
"
|
2024-04-05 17:35:14 +07:00
|
|
|
>
|
2024-06-25 17:25:33 +07:00
|
|
|
<svg
|
|
|
|
|
xmlns="http://www.w3.org/2000/svg"
|
|
|
|
|
viewBox="0 0 1440 320"
|
|
|
|
|
style="width: 100%"
|
|
|
|
|
>
|
2024-04-05 17:35:14 +07:00
|
|
|
<path
|
|
|
|
|
class="box-path"
|
|
|
|
|
d="M0,256L40,245.3C80,235,160,213,240,202.7C320,192,400,192,480,170.7C560,149,640,107,720,106.7C800,107,880,149,960,154.7C1040,160,1120,128,1200,96C1280,64,1360,32,1400,16L1440,0L1440,320L1400,320C1360,320,1280,320,1200,320C1120,320,1040,320,960,320C880,320,800,320,720,320C640,320,560,320,480,320C400,320,320,320,240,320C160,320,80,320,40,320L0,320Z"
|
|
|
|
|
></path>
|
|
|
|
|
</svg>
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
<div class="stat-card__content">
|
2024-04-13 16:49:34 +07:00
|
|
|
<div class="text-h5 text-weight-bold">{{ v.count }}</div>
|
2024-06-25 17:25:33 +07:00
|
|
|
<div class="text-weight-bold text-no-wrap">
|
2024-04-23 14:43:00 +07:00
|
|
|
{{ labelI18n ? $t(v.label) : v.label }}
|
2024-04-22 14:19:35 +07:00
|
|
|
</div>
|
2024-04-05 17:35:14 +07:00
|
|
|
</div>
|
2024-04-10 20:43:58 +07:00
|
|
|
</AppBox>
|
2024-04-05 17:35:14 +07:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
2024-04-23 14:20:08 +07:00
|
|
|
.stat-card {
|
|
|
|
|
--_color: var(--gray-6);
|
2024-06-25 17:25:33 +07:00
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media screen and (min-width: 1024px) {
|
|
|
|
|
.stat-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@media screen and (min-width: 1920px) {
|
|
|
|
|
.stat-card {
|
|
|
|
|
display: flex;
|
|
|
|
|
}
|
2024-04-23 14:20:08 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.stat-card__wave {
|
2024-04-05 17:35:14 +07:00
|
|
|
position: relative;
|
|
|
|
|
display: flex;
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
& svg {
|
|
|
|
|
width: 200px;
|
|
|
|
|
position: absolute;
|
|
|
|
|
left: 0px;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
opacity: 0.1;
|
2024-04-05 17:35:14 +07:00
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
& .box-path {
|
|
|
|
|
fill: var(--_color);
|
|
|
|
|
fill-opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-04-05 17:35:14 +07:00
|
|
|
}
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.stat-card__content {
|
2024-04-05 17:35:14 +07:00
|
|
|
z-index: 2;
|
2024-04-13 16:49:34 +07:00
|
|
|
color: var(--_color);
|
2024-04-05 17:35:14 +07:00
|
|
|
height: 100%;
|
|
|
|
|
width: 200px;
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.stat-card__purple {
|
2024-04-13 16:49:34 +07:00
|
|
|
--_color: var(--violet-11);
|
2024-04-05 17:35:14 +07:00
|
|
|
}
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.stat-card__pink {
|
2024-04-13 16:49:34 +07:00
|
|
|
--_color: var(--pink-6);
|
2024-04-05 17:35:14 +07:00
|
|
|
}
|
2024-04-11 09:43:09 +07:00
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.stat-card__green {
|
2024-04-23 13:03:12 +07:00
|
|
|
--_color: var(--teal-10);
|
|
|
|
|
}
|
|
|
|
|
|
2024-06-12 15:34:09 +07:00
|
|
|
.stat-card__orange {
|
|
|
|
|
--_color: var(--orange-5);
|
|
|
|
|
}
|
|
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.dark .stat-card__purple {
|
2024-06-11 11:23:31 +07:00
|
|
|
--_color: var(--purple-7);
|
2024-04-11 09:43:09 +07:00
|
|
|
}
|
2024-04-23 13:03:12 +07:00
|
|
|
|
2024-04-23 14:20:08 +07:00
|
|
|
.dark .stat-card__green {
|
2024-06-11 11:23:31 +07:00
|
|
|
--_color: var(--teal-7);
|
2024-04-23 13:03:12 +07:00
|
|
|
}
|
2024-06-12 15:34:09 +07:00
|
|
|
|
|
|
|
|
.dark .stat-card__orange {
|
|
|
|
|
--_color: var(--orange-8);
|
|
|
|
|
}
|
2024-04-05 17:35:14 +07:00
|
|
|
</style>
|