From fedefff43b2b2d9acda3d2edffb56e5f2f4ef904 Mon Sep 17 00:00:00 2001 From: yaoyuhao Date: Mon, 27 May 2024 15:56:16 +0800 Subject: [PATCH] 1 --- src/view/dialog/dialog.vue | 2 -- src/view/echarts_yl/ylXZZC.vue | 22 +++++++++++++--------- src/view/yl.vue | 5 ++++- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/src/view/dialog/dialog.vue b/src/view/dialog/dialog.vue index 063e9b9..9ad6810 100644 --- a/src/view/dialog/dialog.vue +++ b/src/view/dialog/dialog.vue @@ -230,7 +230,6 @@ const handle = (current) => { .bo { width: 100%; display: flex; - // align-items: center; } .title { margin: 10px auto; @@ -243,7 +242,6 @@ const handle = (current) => { height: 33px; width: 33px; } - .name { font-family: PangMenZhengDao, PangMenZhengDao; font-weight: 600; diff --git a/src/view/echarts_yl/ylXZZC.vue b/src/view/echarts_yl/ylXZZC.vue index fc491c1..ed743aa 100644 --- a/src/view/echarts_yl/ylXZZC.vue +++ b/src/view/echarts_yl/ylXZZC.vue @@ -13,7 +13,7 @@ import { } from "vue"; // 局部引入echarts核心模块 import * as echarts from "echarts"; - +const emit = defineEmits(["village"]); const props = defineProps({ list1: { type: Array, @@ -215,14 +215,14 @@ const getOption = () => { ]), }, }, - label:{ - show:true, - position:'right', - color:'#ffffff', - formatter:function(data){ - return data.value - } - }, + label: { + show: true, + position: "right", + color: "#ffffff", + formatter: function (data) { + return data.value; + }, + }, }, ], }; @@ -261,6 +261,10 @@ const setChart = () => { var myChart = echarts.init(chart.value); // 使用刚指定的配置项和数据显示图表。 myChart.setOption(data.option); + myChart.on("click", function (params) { + console.log(params); + emit('village',params.name); + }); }; // 使用生命钩子 onBeforeMount(() => { diff --git a/src/view/yl.vue b/src/view/yl.vue index 2410499..3433859 100644 --- a/src/view/yl.vue +++ b/src/view/yl.vue @@ -203,7 +203,7 @@ alt="" /> - + @@ -231,6 +231,9 @@ const leftchoose = ref({ const change = (name, index) => { leftchoose.value[name] = index; }; +const chooseVillage=(village)=>{ + console.log(village); +} const data = reactive({ leftTop1: [], leftTop2: [],