ny
昨天 282fbc6488f4e8ceb5fda759f963ee88fbf7b999
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<script lang="ts" setup>
import { CountTo } from '@vben/common-ui';
import { usePreferences } from '@vben/preferences';
 
import { Card } from 'ant-design-vue';
 
import { growCardList } from './data';
 
defineProps({
  loading: { type: Boolean },
});
 
const { isDark } = usePreferences();
</script>
<template>
  <div class="home-grow-card md:flex">
    <template v-for="(item, index) in growCardList" :key="item.title">
      <Card
        size="small"
        :loading="loading"
        class="home-grow-card-item w-full md:!mt-0 md:w-1/4"
        :class="{ 'md:!mr-[10px]': index + 1 < 4, '!mt-[10px]': index > 0 }"
        :style="{ background: !isDark ? item.bg : '' }">
        <div class="home-grow-card-item-main-img">
          <img :src="item.mainImg" />
        </div>
        <img :src="item.icon" class="home-grow-card-item-icon" />
        <div class="home-grow-card-item-content">
          <div class="mb-[6px] flex items-center justify-start">
            <span>总{{ item.title }}</span>
            <span class="item-tag" :style="{ background: item.tagBg, color: item.color }">{{ item.action }}</span>
          </div>
          <CountTo :start-val="1" :end-val="item.value" class="text-[24px] font-bold leading-[30px]" />
          <div class="mt-[53px] flex justify-between">
            <span>总{{ item.title }}:</span>
            <CountTo :start-val="1" :end-val="item.total" />
          </div>
        </div>
      </Card>
    </template>
  </div>
</template>
<style lang="scss" scoped>
.home-grow-card {
  .home-grow-card-item {
    height: 180px;
    overflow: hidden;
    border-radius: 10px !important;
 
    :deep(.ant-card-body) {
      position: relative;
      display: flex;
      height: 100%;
      padding: 20px 0 0 20px !important;
    }
 
    .home-grow-card-item-icon {
      flex-shrink: 0;
      width: 50px;
      height: 50px;
      margin-right: 13px;
    }
 
    .home-grow-card-item-main-img {
      position: absolute;
      right: 0;
      bottom: 0;
      z-index: 0;
      width: 163px;
      height: 153px;
    }
 
    .home-grow-card-item-content {
      position: relative;
      z-index: 1;
 
      .item-tag {
        display: inline-block;
        width: 32px;
        height: 20px;
        margin-left: 8px;
        font-size: 12px;
        line-height: 20px;
        text-align: center;
        border-radius: 5px;
      }
    }
  }
}
</style>