whyczyk
2021-07-30 f0b1e71c2834109bd3fd333f37eca3c0c607dbd8
地图站点跳转
2个文件已修改
18 ■■■■ 已修改文件
src/components/chart/chinaMap.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/index.vue 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/chart/chinaMap.vue
@@ -1,6 +1,6 @@
<template>
    <div class="echarts-wrapper">
        <div class="echarts-content" ref="chart"></div>
        <div class="echarts-content" ref="chart" :id="id"></div>
    </div>
</template>
src/pages/index.vue
@@ -90,10 +90,23 @@
            })
          }
          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() {
@@ -262,7 +275,6 @@
            }]
          };
        }
        console.log(option)
        this.$refs.cityChart.setData(option);
      },
      mergeMapInfos(list) {