修改温湿度监控

boardTest
夜笙歌 1 year ago
parent 74071ac7d4
commit 3366540113

@ -10,8 +10,9 @@ export default {
watch:{ watch:{
chartOption: { chartOption: {
handler(newVal, oldVal) { handler(newVal, oldVal) {
console.log(newVal) if(newVal){
this.initChart(newVal) this.initChart(newVal)
}
}, },
deep: true, // deep: true, //
} }
@ -24,7 +25,9 @@ export default {
} }
}, },
mounted() { mounted() {
if(this.chartOption){
this.initChart(this.chartOption) this.initChart(this.chartOption)
}
}, },
beforeDestroy() { beforeDestroy() {
if (!this.chart) { if (!this.chart) {

@ -57,6 +57,7 @@
</el-form> </el-form>
<div v-for="item in list" class="chart"> <div v-for="item in list" class="chart">
<Chart ref="Chart1" style="width: 100%;height: 100%" :chartOption="getChart(item)"/> <Chart ref="Chart1" style="width: 100%;height: 100%" :chartOption="getChart(item)"/>
<div class="title">{{item.monitorName}}</div>
</div> </div>
</el-col> </el-col>
</el-row> </el-row>
@ -327,6 +328,15 @@ export default {
display: inline-block; display: inline-block;
width: 50%; width: 50%;
height: 40vh; height: 40vh;
position: relative;
}
.chart .title{
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
font-size: 1vw;
font-weight: 700;
} }
.chart2 { .chart2 {

@ -451,10 +451,9 @@ export default {
} }
] ]
} }
console.log(option1)
this.$refs.Chart1.setData(option1) this.$refs.Chart1.setData(option1)
// option1 && Chart1.setOption(option1);
// this.$refs.Chart2.setData(option2)
echarts.connect(this.$refs.Chart1.chart) echarts.connect(this.$refs.Chart1.chart)
// , this.$refs.Chart2.chart // , this.$refs.Chart2.chart
this.$refs.Chart1.chart.on('datazoom', (e) => { this.$refs.Chart1.chart.on('datazoom', (e) => {

Loading…
Cancel
Save