Browse Source

监听数据变化重渲染echarts

master
j1ack 3 years ago
parent
commit
2ebdc58b8c
  1. 8
      src/components/companySummary/business.vue
  2. 9
      src/components/companySummary/talent.vue
  3. 8
      src/components/ringPie/index.vue
  4. 8
      src/components/scrollArc/index.vue
  5. 11
      src/components/szBar/index.vue

8
src/components/companySummary/business.vue

@ -17,6 +17,14 @@ export default {
data() { data() {
return { return {
} }
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchartLeft1()
}
}
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {

9
src/components/companySummary/talent.vue

@ -44,6 +44,15 @@ export default {
created() { created() {
}, },
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchartLeft2()
}
}
},
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
// console.log(this.chartData) // console.log(this.chartData)

8
src/components/ringPie/index.vue

@ -49,6 +49,14 @@ export default {
this.shenRate=100-this.dataRate this.shenRate=100-this.dataRate
this.getEchart(); this.getEchart();
}, 800); }, 800);
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
}, },
methods: { methods: {
getEchart() { getEchart() {

8
src/components/scrollArc/index.vue

@ -38,6 +38,14 @@ export default {
dataIn: [], dataIn: [],
dataOut: [], dataOut: [],
} }
},
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
}, },
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {

11
src/components/szBar/index.vue

@ -30,6 +30,14 @@ export default {
yData1: [], yData1: [],
} }
}, },
watch: {
chartData: {
deep: true,
handler: function () {
this.getEchart()
}
}
},
mounted() { mounted() {
setTimeout(() => { setTimeout(() => {
// console.log(this.chartData) // console.log(this.chartData)
@ -40,6 +48,7 @@ export default {
this.getEchart(); this.getEchart();
}, 800); }, 800);
}, },
methods: { methods: {
getEchart() { getEchart() {
let myChart = echarts.init(document.getElementById('chart_bar')); let myChart = echarts.init(document.getElementById('chart_bar'));
@ -195,11 +204,13 @@ export default {
height: 3rem; height: 3rem;
} }
} }
.sn-container { .sn-container {
left: 975px; left: 975px;
top: 690px; top: 690px;
width: 895px; width: 895px;
height: 400px; height: 400px;
.chartsdom { .chartsdom {
width: 100%; width: 100%;
height: 95%; height: 95%;

Loading…
Cancel
Save