This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
cyber-narrator-cn-ui/src/components/charts/EchartsFrame.vue

52 lines
1.4 KiB
Vue
Raw Normal View History

<template>
<div class="cn-chart cn-chart__echarts" :class="{'cn-chart__echarts--statistics': isEchartsWithStatistics}">
<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">
<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">
<slot name="footer"></slot>
</div>
</div>
</template>
<script>
import { layoutConstant, isEchartsWithTable, isEchartsWithStatistics } from '@/components/charts/chart-options'
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-23 15:57:34 +08:00
setup (props) {
return {
2021-06-23 15:57:34 +08:00
layoutConstant,
isPieWithTable: isEchartsWithTable(props.chartInfo.type),
isEchartsWithStatistics: isEchartsWithStatistics(props.chartInfo.type)
}
},
mounted () {
}
}
</script>
<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>