2021-03-25 19:16:32 +08:00
|
|
|
<template>
|
|
|
|
<div class="rect-shape">
|
2021-04-01 11:38:30 +08:00
|
|
|
<chart-component :ref="element.propValue.id" class="chart-class" :chart="chart" />
|
2021-03-25 19:16:32 +08:00
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
|
|
|
import { post } from '@/api/panel/panel'
|
|
|
|
import ChartComponent from '@/views/chart/components/ChartComponent.vue'
|
2021-04-01 11:38:30 +08:00
|
|
|
|
2021-03-25 19:16:32 +08:00
|
|
|
export default {
|
|
|
|
name: 'UserView',
|
|
|
|
components: { ChartComponent },
|
|
|
|
props: {
|
|
|
|
element: {
|
|
|
|
type: Object
|
|
|
|
}
|
|
|
|
},
|
|
|
|
data() {
|
|
|
|
return {
|
2021-03-29 14:57:04 +08:00
|
|
|
chart: {}
|
2021-03-25 19:16:32 +08:00
|
|
|
}
|
|
|
|
},
|
|
|
|
created() {
|
2021-04-01 11:38:30 +08:00
|
|
|
this.getData(this.element.propValue.viewId)
|
2021-03-25 19:16:32 +08:00
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
getData(id) {
|
|
|
|
if (id) {
|
|
|
|
post('/chart/view/getData/' + id, null).then(response => {
|
|
|
|
// 将视图传入echart组件
|
|
|
|
this.chart = response.data
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.rect-shape {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
overflow: auto;
|
|
|
|
}
|
2021-03-26 12:26:48 +08:00
|
|
|
.chart-class{
|
|
|
|
height: 100%;
|
|
|
|
}
|
2021-03-25 19:16:32 +08:00
|
|
|
</style>
|