he wei
2025-06-06 895129470d7ee48183fc15b9ee18ef0880503e5d
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
<template>
  <div class="chart-wrapper" :class="{ 'no-corner': noCorner }">
    <div class="chart-wrapper-corner top-right"></div>
    <div class="chart-wrapper-corner bottom-right"></div>
    <div
      class="chart-wrapper-title"
      v-if="title"
      :style="{ backgroundSize: bgSize, height: titHeight }"
    >
      <title-icon></title-icon>
      {{ title }}
    </div>
    <slot></slot>
  </div>
</template>
 
<script>
import TitleIcon from "./title-icon.vue";
export default {
  name: "ChartWrapper",
  components: {
    TitleIcon,
  },
  props: {
    title: {
      type: String,
    },
    bgSize: {
      type: String,
      default: "100% 100%",
    },
    titHeight: {
      type: String,
      default: "15%",
    },
    noCorner: {
      type: Boolean,
      default: false,
    },
  },
};
</script>
 
<style scoped>
.chart-wrapper {
  position: relative;
  box-sizing: border-box;
  height: 100%;
  background-image: radial-gradient(#0f339450, #3667ec40);
}
.chart-wrapper-title {
  position: absolute;
  top: 16px;
  left: 16px;
  color: #00feff;
  font-size: 14px;
  font-weight: bold;
  -webkit-z-index: 2;
  -moz-z-index: 2;
  -ms-z-index: 2;
  -o-z-index: 2;
  z-index: 2;
}
.chart-wrapper:before,
.chart-wrapper:after,
.chart-wrapper-corner {
  position: absolute;
  display: inline-block;
  content: " ";
}
.chart-wrapper.no-corner:before,
.chart-wrapper.no-corner:after,
.chart-wrapper.no-corner .chart-wrapper-corner {
  display: none;
}
.chart-wrapper:before {
  left: 0;
  top: 0;
  border-top: 2px solid #00feff;
  border-left: 2px solid #00feff;
}
.chart-wrapper:after {
  left: 0;
  bottom: 0;
  border-bottom: 2px solid #00feff;
  border-left: 2px solid #00feff;
}
.chart-wrapper-corner.top-right {
  top: 0;
  right: 0;
  border-top: 2px solid #00feff;
  border-right: 2px solid #00feff;
}
.chart-wrapper-corner.bottom-right {
  bottom: 0;
  right: 0;
  border-bottom: 2px solid #00feff;
  border-right: 2px solid #00feff;
}
.chart-wrapper-content {
  position: relative;
  top: 30px;
  height: calc(100% - 30px);
  box-sizing: border-box;
}
</style>