analysis-overview.vue 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. <script setup lang="ts">
  2. import type { AnalysisOverviewItem } from '../typing';
  3. import {
  4. Card,
  5. CardContent,
  6. CardFooter,
  7. CardHeader,
  8. CardTitle,
  9. VbenCountToAnimator,
  10. VbenIcon,
  11. } from '@vben-core/shadcn-ui';
  12. interface Props {
  13. items: AnalysisOverviewItem[];
  14. }
  15. defineOptions({
  16. name: 'AnalysisOverview',
  17. });
  18. withDefaults(defineProps<Props>(), {
  19. items: () => [],
  20. });
  21. </script>
  22. <template>
  23. <div class="md:flex">
  24. <template v-for="(item, index) in items" :key="item.title">
  25. <Card
  26. :class="{ 'md:mr-4': index + 1 < 4 }"
  27. :title="item.title"
  28. class="mt-5 w-full md:mt-0 md:w-1/4"
  29. >
  30. <CardHeader>
  31. <CardTitle class="text-xl">{{ item.title }}</CardTitle>
  32. </CardHeader>
  33. <CardContent class="flex items-center justify-between">
  34. <VbenCountToAnimator
  35. :end-val="item.value"
  36. :start-val="1"
  37. class="text-xl"
  38. prefix=""
  39. />
  40. <VbenIcon :icon="item.icon" class="size-8 flex-shrink-0" />
  41. </CardContent>
  42. <CardFooter class="justify-between">
  43. <span>{{ item.totalTitle }}</span>
  44. <VbenCountToAnimator
  45. :end-val="item.totalValue"
  46. :start-val="1"
  47. prefix=""
  48. />
  49. </CardFooter>
  50. </Card>
  51. </template>
  52. </div>
  53. </template>