workbench-project.vue 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <script setup lang="ts">
  2. import type { WorkbenchProjectItem } from '../typing';
  3. import {
  4. Card,
  5. CardContent,
  6. CardHeader,
  7. CardTitle,
  8. VbenIcon,
  9. } from '@vben-core/shadcn-ui';
  10. interface Props {
  11. items: WorkbenchProjectItem[];
  12. title: string;
  13. }
  14. defineOptions({
  15. name: 'WorkbenchProject',
  16. });
  17. withDefaults(defineProps<Props>(), {
  18. items: () => [],
  19. });
  20. </script>
  21. <template>
  22. <Card>
  23. <CardHeader class="py-4">
  24. <CardTitle class="text-lg">{{ title }}</CardTitle>
  25. </CardHeader>
  26. <CardContent class="flex flex-wrap p-0">
  27. <template v-for="(item, index) in items" :key="item.title">
  28. <div
  29. :class="{
  30. 'border-r-0': index % 3 === 2,
  31. 'border-b-0': index < 3,
  32. 'pb-4': index > 2,
  33. }"
  34. class="border-border group w-full cursor-pointer border-b border-r border-t p-4 transition-all hover:shadow-xl md:w-1/2 lg:w-1/3"
  35. >
  36. <div class="flex items-center">
  37. <VbenIcon
  38. :color="item.color"
  39. :icon="item.icon"
  40. class="size-8 transition-all duration-300 group-hover:scale-110"
  41. />
  42. <span class="ml-4 text-lg font-medium">{{ item.title }}</span>
  43. </div>
  44. <div class="text-foreground/80 mt-4 flex h-10">
  45. {{ item.content }}
  46. </div>
  47. <div class="text-foreground/80 flex justify-between">
  48. <span>{{ item.group }}</span>
  49. <span>{{ item.date }}</span>
  50. </div>
  51. </div>
  52. </template>
  53. </CardContent>
  54. </Card>
  55. </template>