| | |
| | | <template> |
| | | <div class="echarts-wrapper"> |
| | | <div class="echarts-content" ref="chart"></div> |
| | | <div class="echarts-content" ref="chart" :id="id"></div> |
| | | </div> |
| | | </template> |
| | | |
| | |
| | | }) |
| | | } |
| | | this.$nextTick(() => { |
| | | this.initCityChart(); |
| | | this.initPage(); |
| | | }); |
| | | }).catch((err) => { |
| | | console.log(err); |
| | | }); |
| | | }, |
| | | initPage() { |
| | | // 初始化地图 |
| | | this.initCityChart(); |
| | | chart = ECharts.init(document.getElementById('cityChart')); |
| | | chart.off('click'); //防止chart点击触发多次 |
| | | chart.on("click", params => { //点击跳转实时数据 |
| | | if (params.seriesType == "scatter") { |
| | | this.$router.push({ |
| | | path: '/functionList' |
| | | }) |
| | | } |
| | | }); |
| | | }, |
| | | initCityChart() { |
| | |
| | | }] |
| | | }; |
| | | } |
| | | console.log(option) |
| | | this.$refs.cityChart.setData(option); |
| | | }, |
| | | mergeMapInfos(list) { |