Commit 2aae7781 by lyy

生产驾驶舱和设备驾驶舱

parent 64ee8d7e
......@@ -188,6 +188,7 @@
"manage-echarts": "url:${ctx}/HG/BI/components/hipi/002/manage-echarts.vue",
"right-manage-cockpit": "url:${ctx}/HG/BI/components/hipi/002/right-manage-cockpit.vue",
},
data() {
return {
date: new Date(),
......
<template>
<div ref="chartContainer" :style="{ width: '100%', height: '40vh' }"></div>
<div ref="chartContainer" :style="{ width: width+'vw', height: height + 'vh' }"></div>
</template>
<script>
module.exports = {
props: {
option: Object
option: {
type: Object,
required: true,
},
height: {
type: Number,
default: 35
},
width: {
type: Number,
default: 52
}
},
data() {
return {
chart: null,
};
},
watch: {
option: {
handler(newVal) {
if (this.chart) {
this.chart.setOption(newVal);
}
},
deep: true, // 监听对象内部属性的变化
immediate: true, // 在绑定时立即执行一次监听器
},
},
mounted() {
this.initChart();
......@@ -26,7 +53,7 @@ module.exports = {
if (this.chart) {
this.chart.resize();
}
}
}
},
},
};
</script>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment