update 设备加工数量

This commit is contained in:
lb
2023-09-22 10:29:28 +08:00
parent ee3d6f9dc6
commit f43b1c1eab
2 changed files with 27 additions and 16 deletions

View File

@@ -17,11 +17,12 @@ import * as echarts from 'echarts';
export default {
name: 'LineChartInEquipmentProcessAmount',
components: {},
props: ['equipmentList'],
props: ['equipmentList', 'render'],
data() {
return {
chart: null,
option: {
color: ['#288AFF'],
grid: {
top: 64,
left: 56,
@@ -89,16 +90,19 @@ export default {
},
};
},
mounted() {
// console.log('this.eq list', this.equipmentList);
if (!this.chart) this.chart = echarts.init(this.$refs.chart);
this.$nextTick(() => {
this.chart.setOption(this.updateConfig(this.option));
});
watch: {
render: {
handler: function (newVal, oldVal) {
if (!this.chart) this.chart = echarts.init(this.$refs.chart);
this.$nextTick(() => {
if (this.chart) this.chart.setOption(this.updateConfig(this.option));
});
},
deep: true,
},
},
beforeDestroy() {
this.chart.dispose();
if (this.chart) this.chart.dispose();
},
methods: {
updateConfig(config) {
@@ -126,5 +130,6 @@ export default {
.chart {
height: 100%;
width: 100%;
// background: lightcoral;
}
</style>