zhangzeli
2021-10-22 ac82481de1ed2421eddbbffc51e4ac6c34ccf61f
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<template>
  <Card :padding="0" :style="{ backgroundColor: backgroundColor }">
    <div
      class="card-content card2"
      :style="{ backgroundImage: backgroundImage }"
    >
      <div class="card-body">
        <div :style="{ color: color }" class="card-title">{{ title }}</div>
        <div class="card-data">
          <count-up
            :prefix="prefix"
            :suffix="suffix"
            :id="id"
            :end-val="endVal"
            :color="dataColor"
            :countSize="countSize"
            :countWeight="countWeight"
          />
          <span
            class="card-description"
            :style="{
              color: descriptionColor,
              fontSize: descriptionSize,
              fontWeight: descriptionWeight,
            }"
            >{{ description }}</span
          >
        </div>
        <Progress
          :percent="endVal"
          :stroke-color="color"
          :stroke-width="strokeWidth"
          hide-info
        />
      </div>
    </div>
  </Card>
</template>
 
<script>
import countUp from "@/views/my-components/widget/countUp.vue";
 
export default {
  name: "card2",
  components: {
    countUp,
  },
  props: {
    id: String,
    backgroundColor: String,
    backgroundImage: String,
    title: String,
    prefix: String,
    suffix: String,
    endVal: Number,
    color: {
      type: String,
      default: "#19be6b",
    },
    dataColor: {
      type: String,
      default: "#3f4255",
    },
    countSize: {
      type: String,
      default: "24px",
    },
    countWeight: {
      type: Number,
      default: 600,
    },
    description: String,
    strokeWidth: {
      type: Number,
      default: 6.5,
    },
    descriptionColor: {
      type: String,
      default: "#b5b5c5",
    },
    descriptionSize: {
      type: String,
      default: "12px",
    },
    descriptionWeight: {
      type: Number,
      default: 500,
    },
  },
};
</script>
<style lang="less" scoped>
.card-content {
  height: 150px;
  padding: 26px 30px;
}
.card2 {
  background-position: right top;
  background-size: 30% auto;
  background-repeat: no-repeat;
  .card-body {
    display: flex;
    flex-direction: column;
    height: 102px;
    justify-content: space-around;
    align-items: flex-start;
    .card-title {
      font-weight: 600;
    }
    .card-data {
      display: flex;
      align-items: flex-end;
      .card-description {
        margin: 0 0 5px 5px;
      }
    }
  }
}
</style>