Blame view

ant-design-vue-jeecg/src/components/ChartCard.vue 1.87 KB
肖超群 authored
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
<template>
  <a-card :loading="loading" :body-style="{ padding: '20px 24px 8px' }" :bordered="false">
    <div class="chart-card-header">
      <div class="meta">
        <span class="chart-card-title">{{ title }}</span>
        <span class="chart-card-action">
          <slot name="action"></slot>
        </span>
      </div>
      <div class="total"><span>{{ total }}</span></div>
    </div>
    <div class="chart-card-content">
      <div class="content-fix">
        <slot></slot>
      </div>
    </div>
    <div class="chart-card-footer">
      <div class="field">
        <slot name="footer"></slot>
      </div>
    </div>
  </a-card>
</template>

<script>
肖超群 authored
26
27
28
29
30
31
32
33
34
35
36
37
38
39
export default {
  name: "ChartCard",
  props: {
    title: {
      type: String,
      default: ''
    },
    total: {
      type: String,
      default: ''
    },
    loading: {
      type: Boolean,
      default: false
肖超群 authored
40
41
    }
  }
肖超群 authored
42
}
肖超群 authored
43
44
45
</script>

<style lang="less" scoped>
肖超群 authored
46
47
48
49
50
51
.chart-card-header {
  position: relative;
  overflow: hidden;
  width: 100%;

  .meta {
肖超群 authored
52
53
54
    position: relative;
    overflow: hidden;
    width: 100%;
肖超群 authored
55
56
57
    color: rgba(0, 0, 0, .45);
    font-size: 14px;
    line-height: 22px;
肖超群 authored
58
  }
肖超群 authored
59
}
肖超群 authored
60
肖超群 authored
61
62
63
64
65
66
.chart-card-action {
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
}
肖超群 authored
67
肖超群 authored
68
69
70
71
.chart-card-footer {
  border-top: 1px solid #e8e8e8;
  padding-top: 9px;
  margin-top: 8px;
肖超群 authored
72
肖超群 authored
73
  > * {
肖超群 authored
74
75
76
    position: relative;
  }
肖超群 authored
77
78
  .field {
    white-space: nowrap;
肖超群 authored
79
80
    overflow: hidden;
    text-overflow: ellipsis;
肖超群 authored
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
    margin: 0;
  }
}

.chart-card-content {
  margin-bottom: 12px;
  position: relative;
  height: 46px;
  width: 100%;

  .content-fix {
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
肖超群 authored
96
  }
肖超群 authored
97
98
99
100
101
102
103
104
105
106
107
108
109
110
}

.total {
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
  white-space: nowrap;
  color: #000;
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 30px;
  line-height: 38px;
  height: 38px;
}
肖超群 authored
111
</style>