update 设备加工数量
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user