From 3bf90cf34b54addfca4072e68798fc13c60ae925 Mon Sep 17 00:00:00 2001 From: wangqi <magical1908@outlook.com> Date: 星期二, 13 四月 2021 16:35:39 +0800 Subject: [PATCH] 废气图表点击显示 --- src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue | 56 +++++++++++++++++++++++++++++++++++--------------------- 1 files changed, 35 insertions(+), 21 deletions(-) diff --git a/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue b/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue index 2dd2517..a0e98bd 100644 --- a/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue +++ b/src/components/BaseNav/PublicBounced/GasComponents/EChartsHour.vue @@ -30,16 +30,16 @@ </span> </div> </div> - <div> - 閲囨牱鐐规暟: - <el-select v-model="formInline.region"> - <el-option label="0" value="0"></el-option> - <el-option label="25" value="25"></el-option> - <el-option label="50" value="50"></el-option> - <el-option label="75" value="75"></el-option> - <el-option label="100" value="100"></el-option> - </el-select> - </div> +<!-- <div>--> +<!-- 閲囨牱鐐规暟:--> +<!-- <el-select v-model="formInline.region">--> +<!-- <el-option label="0" value="0"></el-option>--> +<!-- <el-option label="25" value="25"></el-option>--> +<!-- <el-option label="50" value="50"></el-option>--> +<!-- <el-option label="75" value="75"></el-option>--> +<!-- <el-option label="100" value="100"></el-option>--> +<!-- </el-select>--> +<!-- </div>--> <div class="detailbtn" @click="onSubmit">鏌ヨ</div> <div class="detailbtn" @click="dialogVisible = true" >鏄庣粏琛�</div> </div> @@ -141,20 +141,33 @@ } } }, - // mounted () { - // // this.$nextTick(() => { - // // console.log(1) - // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) - // // } - // }, + created () { + // this.$nextTick(() => { + // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) + // } + }, + mounted () { + this.onSubmit() + // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) + }, methods: { onSubmit () { - console.log(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) - this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) + this.CreateChart() + // console.log(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) + // this.CreateChart(this.JsonCtarts.id, this.JsonCtarts.title, this.JsonCtarts.legend, this.JsonCtarts.xdata, this.JsonCtarts.ydatas, this.JsonCtarts.yname, this.JsonCtarts.id, this.JsonCtarts.datatype) }, - CreateChart: function (id, title, legend, xdata, ydatas, yname, jcdID, datatype) { + CreateChart: function () { + // var id = this.JsonCtarts.id + // var title = this.JsonCtarts.title + var legend = this.JsonCtarts.legend + var xdata = this.JsonCtarts.xdata + var ydatas = this.JsonCtarts.ydatas + var yname = this.JsonCtarts.yname + // var jcdId = this.JsonCtarts.jcdID + var datatype = this.JsonCtarts.datatype + this.myChart = this.$echarts.init(this.$refs.main) - // this.myChart.clear() + this.myChart.clear() var dataUnit = '' if (datatype === 1) { dataUnit = '姘旈噺(m鲁/d)' @@ -339,7 +352,6 @@ }, legend: { // 鍥句緥 data: legend - // color: }, dataZoom: [{ type: 'inside', @@ -451,6 +463,7 @@ }], series: serLists } + console.log(option) this.myChart.setOption(option) /* this.myChart.on('legendselectchanged', function (params) { @@ -537,6 +550,7 @@ // } // } } + } </script> -- Gitblit v1.8.0