chart-wrapper.vue
5.09 KB
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
<template>
<div class="wrapper-list">
<!-- 标题 -->
<a-card :bordered="false" class="wrapper-list-card" :border="false" :body-style="{ height:'100%',padding:0 }">
<template #title>
<a-space class="card-title">
<!-- title,单位 -->
<a-typography-title class="title-left-title">
{{ title }}
<span>{{ unit }}</span>
</a-typography-title>
<!-- 按钮 -->
<slot name="button"></slot>
<!-- 处理状态 -->
<a-space class="title-process">
<slot name="process"></slot>
</a-space>
</a-space>
</template>
<template #extra>
<!-- 右侧 -->
<a-typography-title class="title-right-unit" @click="goDetail">
<slot name="extra"></slot>
</a-typography-title>
</template>
<!-- 图表 -->
<div class="chart-view">
<slot name="chart"/>
</div>
</a-card>
</div>
</template>
<script setup lang="ts">
import {useRoute, useRouter} from "vue-router";
import {notification} from "@/hooks/my-design";
const route = useRoute()
const router = useRouter()
const props = defineProps({
unit: {
type: String,
default: '',
},
title: {
type: String,
default: '',
},
public: {
type: Object,
default: () => {
return {}
},
},
requestParams: {
type: Object,
default: () => {
return {}
},
}
})
const goDetail = () => {
if (!props.public.dashboardConfigId) {
notification({
code: 500,
msg: '暂未配置卡片'
})
return
}
router.push({
path: '/biDetailDefault',
query:{
unit: props.unit,
...props.public,
...props.requestParams,
}
})
}
</script>
<style lang="less" scoped>
@font-size: 14px;
@font-size-mini: 12px;
@font-size-medium: 16px;
@font-size-large: 22px;
@color-w: white;
@font-family: Source Han Sans;
.wrapper-list {
background: rgba(0, 0, 100, 0.1);
height: 100%;
position: relative;
border: 1px solid #00DFDA;
border-radius: 8px;
&::before,
&::after {
content: '';
z-index: 1;
position: absolute;
width: 10px;
height: 10px;
border: 3px solid #00DFDA;
}
&::after {
bottom: -3px;
left: -3px;
border-right: none;
border-top: none;
border-bottom-left-radius: 8px;
}
&::before {
bottom: -3px;
right: -3px;
border-left: none;
border-top: none;
border-bottom-right-radius: 8px;
}
}
/* title样式 */
.wrapper-list-card {
background-color: rgba(0,56,55,0.3);
height: 100%;
padding: 0;
display: grid;
grid-template-rows: 30px 1fr;
:deep(.arco-card-body) {
height: 100%;
padding: 0;
overflow-y: hidden;
scrollbar-width: none; /* 适用于 Firefox */
-ms-overflow-style: none; /* 适用于 Internet Explorer 和 Edge */
}
&::-webkit-scrollbar {
display: none; /* 适用于 Chrome, Safari 和 Opera */
}
&::before,
&::after {
content: '';
z-index: 2500;
position: absolute;
width: 10px;
height: 10px;
border: 3px solid #00DFDA;
}
&::after {
top: -3px;
left: -3px;
border-right: none;
border-bottom: none;
border-top-left-radius: 8px;
}
&::before {
top: -3px;
right: -3px;
border-left: none;
border-bottom: none;
border-top-right-radius: 8px;
}
.card-title {
display: flex;
align-items: center;
.title-left-title {
margin: 0;
font-size: @font-size-medium;
color: @color-w;
//padding: 0 20px 0 12px;
font-weight: bold;
display: flex;
align-items: center;
span {
font-weight: 400;
font-size: @font-size-mini;
margin-left: 4px;
}
}
:deep(.arco-space-item) {
font-size: @font-size;
font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on;
color: @color-w;
.title-process {
span {
color: #F3921D;
}
}
}
/* 按钮样式 */
:deep(.arco-btn-primary, .arco-btn-primary[type='button'], .arco-btn-primary[type='submit']) {
display: inline-block;
height: 26px;
padding: 0 12px;
gap: 4px;
font-size: @font-size-mini;
color: @color-w;
margin-right: 8px;
letter-spacing: -0.01px;
background: #151494;
border: 2px solid #FFFFFF;
border-radius: 8px;
box-sizing: border-box;
&:hover {
background: #0000FF;
}
}
}
.chart-view {
height: 100%;
}
:deep(.arco-card-header) {
border: none;
padding: 0 14px 0 0;
background-size: 100% 100%;
height: auto;
background: linear-gradient(90deg, #00DFDA 0%, transparent 100%);
clip-path: inset(0 round 6px);
margin: 2px;
}
.title-right-unit {
margin: 0;
list-style: none;
text-align: right;
font-size: @font-size;
color: @color-w;
font-variation-settings: "opsz" auto;
font-feature-settings: "kern" on;
::v-deep(.arco-icon) {
color: #0E88F6;
font-size: @font-size-medium;
font-weight: bold;
}
}
.chart-view {
height: 100%;
}
}
</style>