2021-06-20 13:31:55 +08:00
|
|
|
<template>
|
2021-07-09 10:10:06 +08:00
|
|
|
<div class="cn-chart cn-chart__echarts" :class="{'cn-chart__echarts--statistics': isEchartsWithStatistics}">
|
2021-06-20 13:31:55 +08:00
|
|
|
<div class="cn-chart__header" v-if="layout.indexOf(layoutConstant.HEADER) > -1">
|
|
|
|
|
<div class="header__title">
|
|
|
|
|
<slot name="title"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="header__operations">
|
|
|
|
|
<slot name="operations"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-08-11 22:14:23 +08:00
|
|
|
<div class="cn-chart__body" :class="{'pie-with-table': isPieWithTable}" v-loading="loading">
|
2021-06-20 13:31:55 +08:00
|
|
|
<slot></slot>
|
|
|
|
|
</div>
|
2021-08-11 22:14:23 +08:00
|
|
|
<div class="cn-chart__footer" v-if="layout.indexOf(layoutConstant.FOOTER) > -1" :class="{'pie-with-table': isPieWithTable}" v-loading="loading">
|
2021-06-20 13:31:55 +08:00
|
|
|
<slot name="footer"></slot>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-07-09 10:10:06 +08:00
|
|
|
import { layoutConstant, isEchartsWithTable, isEchartsWithStatistics } from '@/components/charts/chart-options'
|
2021-06-20 13:31:55 +08:00
|
|
|
export default {
|
|
|
|
|
name: 'EchartsFrame',
|
|
|
|
|
props: {
|
2021-06-23 15:57:34 +08:00
|
|
|
layout: Array,
|
2021-08-11 22:14:23 +08:00
|
|
|
chartInfo: Object,
|
|
|
|
|
loading: Boolean
|
2021-06-20 13:31:55 +08:00
|
|
|
},
|
2021-06-23 15:57:34 +08:00
|
|
|
setup (props) {
|
2021-06-20 13:31:55 +08:00
|
|
|
return {
|
2021-06-23 15:57:34 +08:00
|
|
|
layoutConstant,
|
2021-07-09 10:10:06 +08:00
|
|
|
isPieWithTable: isEchartsWithTable(props.chartInfo.type),
|
|
|
|
|
isEchartsWithStatistics: isEchartsWithStatistics(props.chartInfo.type)
|
2021-06-20 13:31:55 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
mounted () {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2021-07-14 15:40:05 +08:00
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
.cn-panel .cn-chart__echarts {
|
|
|
|
|
.cn-chart__body.pie-with-table {
|
|
|
|
|
flex-basis: 40%;
|
|
|
|
|
}
|
|
|
|
|
.cn-chart__footer.pie-with-table {
|
|
|
|
|
flex-basis: 60%;
|
|
|
|
|
padding: 10px 30px 30px;
|
|
|
|
|
}
|
2021-06-23 15:57:34 +08:00
|
|
|
}
|
|
|
|
|
</style>
|