2021-06-20 13:31:55 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="cn-chart cn-chart__single-value" :class="singleValueClass(type)">
|
2021-07-05 09:28:04 +08:00
|
|
|
<div class="single-value-icon__box">
|
2021-07-06 17:51:17 +08:00
|
|
|
<div class="single-value__icon"><i :class="icon"></i></div>
|
2021-07-05 09:28:04 +08:00
|
|
|
</div>
|
2021-06-20 13:31:55 +08:00
|
|
|
<div class="single-value__content" v-if="type === 51">
|
2021-07-01 21:39:10 +08:00
|
|
|
<div class="content__data">
|
|
|
|
|
<slot name="data"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content__title">
|
|
|
|
|
<slot name="title"></slot>
|
|
|
|
|
</div>
|
2021-06-20 13:31:55 +08:00
|
|
|
</div>
|
2021-08-10 15:16:56 +08:00
|
|
|
<div class="single-value__content" v-if="type === 52" style="width: 100%;height: 100%;display: flex;flex-direction: column;justify-content: center;padding: 0px 10px">
|
|
|
|
|
<div class="content__title" style="height: 20%;">
|
|
|
|
|
<slot name="title"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content__data" style="height: 20%;">
|
|
|
|
|
<slot name="data"></slot>
|
|
|
|
|
</div>
|
2021-08-11 16:14:03 +08:00
|
|
|
<div class="content__chart" style="height: 40%;">
|
2021-08-10 15:16:56 +08:00
|
|
|
<slot name="chart"></slot>
|
|
|
|
|
</div>
|
2021-08-06 15:03:30 +08:00
|
|
|
</div>
|
2021-06-20 13:31:55 +08:00
|
|
|
<div class="single-value__content" v-if="type === 53">
|
2021-07-06 18:29:46 +08:00
|
|
|
<div class="content__title"></div>
|
|
|
|
|
<div class="content__data"></div>
|
2021-06-20 13:31:55 +08:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
export default {
|
|
|
|
|
name: 'ChartSingleValue',
|
|
|
|
|
props: {
|
2021-07-06 17:51:17 +08:00
|
|
|
type: Number,
|
|
|
|
|
icon: String
|
2021-06-20 13:31:55 +08:00
|
|
|
},
|
|
|
|
|
computed: {
|
|
|
|
|
singleValueClass () {
|
|
|
|
|
return function (type) {
|
|
|
|
|
let c
|
|
|
|
|
switch (type) {
|
|
|
|
|
case 51: {
|
|
|
|
|
c = 'cn-chart__single-value--icon-left'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case 52: {
|
|
|
|
|
c = 'cn-chart__single-value--chart'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
case 53: {
|
|
|
|
|
c = 'cn-chart__single-value--icon-right'
|
|
|
|
|
break
|
|
|
|
|
}
|
|
|
|
|
default: break
|
|
|
|
|
}
|
|
|
|
|
return c
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
|
2021-06-22 21:19:04 +08:00
|
|
|
</style>
|