From c2899beea1e55c2e4f55c679621b9f3bf0248586 Mon Sep 17 00:00:00 2001
From: zmj <1493694146@qq.com>
Date: Tue, 9 Jan 2024 22:15:10 +0800
Subject: [PATCH] a
---
src/App.vue | 52 ++++++++++++++++++++++++------------
src/components/areaMap.vue | 20 ++++++++------
src/components/farmerMap.vue | 7 +++++
3 files changed, 54 insertions(+), 25 deletions(-)
diff --git a/src/App.vue b/src/App.vue
index e598b15..6c95563 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,6 +1,6 @@
diff --git a/src/components/areaMap.vue b/src/components/areaMap.vue
index bd6634e..c336d25 100644
--- a/src/components/areaMap.vue
+++ b/src/components/areaMap.vue
@@ -50,11 +50,6 @@ import { areaObj } from "@/store/index.js"
import { landListApi } from "@/api.js"
import { globalEventBus } from '@/common/eventBus'
let geoJson = geoJsonLuxian
-
-
-
-
-
const areaStore = areaObj()
const showArea = (ref(true))
const router = useRouter()
@@ -348,7 +343,6 @@ const initTownMap = async (name) => {
...areaStore.userInfo
})
- console.log(showArea.value,"res")
res.data.list.forEach(item => {
@@ -367,6 +361,7 @@ const initTownMap = async (name) => {
townJson.features = townJson.features.filter((item) => {
return item.properties.name == name
})
+ console.log(townJson,"res")
var mapName = 'town';
const myChart = document.getElementById("chart3")
@@ -557,7 +552,11 @@ const initTownMap = async (name) => {
bg.on('click', function (params) {
+
+
let longInfo = params.data.coord
+console.log(params)
+ return
areaStore.areaCodeList.forEach(item => {
if (item.name == name) {
areaStore.changeUserInfoFn(510521, item.code)
@@ -645,14 +644,19 @@ globalEventBus.on('choserArea', data => {
})
globalEventBus.on('choseTown', data => {
getTowmName(data.name)
-
areaStore.areaCodeList.forEach(item => {
if (item.name == (data.name)) {
- areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code)
+ areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code,data.name)
}
})
areaStore.changeAddress('', data.name )
initTownMap(data.name)
+})
+
+globalEventBus.on('choseLand', data => {
+
+ router.push(`/detail?landId=${data.id}&town=${areaStore.userInfo.name}&parmas=${JSON.stringify(areaStore.userInfo)}&landName=${data.landName}`)
+
})
\ No newline at end of file
diff --git a/src/components/farmerMap.vue b/src/components/farmerMap.vue
index 3d360e1..cf997a4 100644
--- a/src/components/farmerMap.vue
+++ b/src/components/farmerMap.vue
@@ -40,6 +40,8 @@ import geoJsonLuxian from "/static/jsonData/luxian_geo.js"
import { useRoute } from "vue-router"
import { areaObj } from "@/store/index.js"
import { landListApi } from "@/api.js"
+import { globalEventBus } from '@/common/eventBus'
+
const icon = "https:\/\/ceshi-worker-task.lihaink.cn\/uploads\/images\/20231204\/202312041608529c9e21252.png"
@@ -362,7 +364,12 @@ onMounted(async () => {
+globalEventBus.on('detail', data => {
+ emit('changeLand', data)
+
+
+})
\ No newline at end of file