Files
cz-web/src/views/home/cpns/HomeStats.vue
2026-10-01 17:24:57 +08:00

60 lines
1.1 KiB
Vue

<script setup lang="ts">
import type { HomeStats } from '@/types/business/home'
interface Props {
stats: HomeStats
}
defineProps<Props>()
const items = [
{ key: 'total', label: '累积项目' },
{ key: 'inProgress', label: '进行中' },
{ key: 'pending', label: '待您处理' },
] as const
</script>
<template>
<section class="home-stats">
<div
v-for="item in items"
:key="item.key"
class="home-stats__item"
>
<span class="home-stats__value">{{ stats[item.key] }}</span>
<span class="home-stats__label">{{ item.label }}</span>
</div>
</section>
</template>
<style lang="less" scoped>
.home-stats {
.flex(row, flex-end);
gap: 30px;
&__item {
.flex(column, center, center);
gap: 0;
width: 112px;
height: 112px;
min-width: 112px;
padding: 0;
border-radius: @radius-sm;
background: @primary-strong;
}
&__value {
font-size: 48px;
font-weight: 500;
line-height: 1.2;
color: @white;
}
&__label {
font-size: @font-size-base;
font-weight: 500;
color: @white;
}
}
</style>