2021-07-30 20:18:11 +00:00
|
|
|
<template>
|
2021-08-12 19:05:50 +00:00
|
|
|
<div id="v-pm-charts" ref="v-pm-charts" class="v-pm-charts vp-inline-block">
|
|
|
|
|
<vue-chart-lv-zero
|
|
|
|
|
v-show="level === 0"
|
|
|
|
|
@updateDataLevel="updateDataLevel"
|
|
|
|
|
/>
|
|
|
|
|
<vue-chart-lv-one
|
|
|
|
|
v-if="level === 1"
|
|
|
|
|
:data="data"
|
|
|
|
|
@onChangeLevel="onChangeLevel"
|
|
|
|
|
@updateDataLevel="updateDataLevel"
|
|
|
|
|
/>
|
|
|
|
|
<vue-chart-lv-two
|
|
|
|
|
v-if="level === 2"
|
|
|
|
|
:data="data"
|
|
|
|
|
@onChangeLevel="onChangeLevel"
|
|
|
|
|
/>
|
2021-07-30 20:18:11 +00:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-08-04 16:25:56 +00:00
|
|
|
import VueChartLvZero from "./VueChartLvZero.vue";
|
2021-07-30 20:18:11 +00:00
|
|
|
import VueChartLvOne from "./VueChartLvOne.vue";
|
2021-08-12 19:05:50 +00:00
|
|
|
import VueChartLvTwo from "./VueChartLvTwo.vue";
|
2021-07-30 20:18:11 +00:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: "VueCharts",
|
|
|
|
|
mixins: [],
|
|
|
|
|
components: {
|
2021-08-04 16:25:56 +00:00
|
|
|
VueChartLvZero,
|
2021-07-30 20:18:11 +00:00
|
|
|
VueChartLvOne,
|
2021-08-12 19:05:50 +00:00
|
|
|
VueChartLvTwo,
|
2021-07-30 20:18:11 +00:00
|
|
|
},
|
|
|
|
|
props: [],
|
|
|
|
|
data() {
|
|
|
|
|
let that = this;
|
|
|
|
|
return {
|
2021-08-12 19:05:50 +00:00
|
|
|
level: 0,
|
|
|
|
|
data: [],
|
|
|
|
|
dataBreadCrumbs: [],
|
2021-07-30 20:18:11 +00:00
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {},
|
|
|
|
|
mounted() {},
|
|
|
|
|
watch: {},
|
|
|
|
|
computed: {},
|
|
|
|
|
updated() {},
|
|
|
|
|
beforeCreate() {},
|
2021-08-12 19:05:50 +00:00
|
|
|
methods: {
|
|
|
|
|
/**
|
|
|
|
|
* Set data level 0
|
|
|
|
|
*/
|
|
|
|
|
updateDataLevel(data) {
|
|
|
|
|
this.data.push(data);
|
|
|
|
|
this.level = data.level + 1;
|
|
|
|
|
this.$emit("onChangeLevel", this.level);
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Format data to vue charts any level
|
|
|
|
|
*/
|
|
|
|
|
formatData() {
|
|
|
|
|
return {
|
|
|
|
|
level: this.level,
|
|
|
|
|
data: this.data,
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
onChangeLevel(lv) {
|
|
|
|
|
console.log("leveeeeeeeeeeeeeee");
|
|
|
|
|
this.level = lv;
|
|
|
|
|
this.$emit("onChangeLevel", this.level);
|
|
|
|
|
},
|
|
|
|
|
},
|
2021-07-30 20:18:11 +00:00
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
<style>
|
|
|
|
|
</style>
|