This commit is contained in:
lxz 2024-01-09 18:44:30 +08:00
parent 598e9622c4
commit 45f1b937cc
1 changed files with 8 additions and 5 deletions

View File

@ -348,6 +348,7 @@ const initTownMap = async (name) => {
...areaStore.userInfo ...areaStore.userInfo
}) })
console.log(showArea.value,"res")
res.data.list.forEach(item => { res.data.list.forEach(item => {
@ -367,7 +368,6 @@ const initTownMap = async (name) => {
return item.properties.name == name return item.properties.name == name
}) })
var mapName = 'town'; var mapName = 'town';
const myChart = document.getElementById("chart3") const myChart = document.getElementById("chart3")
let option = { let option = {
@ -588,9 +588,12 @@ const initTownMap = async (name) => {
// ) // )
watch(() => areaStore.userInfo, (value, oldValue) => { watch(() => areaStore.userInfo.areaCode, (value, oldValue) => {
if (value.areaCode) {
switch (value.areaCode) { console.log(value,'value')
if (value) {
switch (value) {
case "510503": case "510503":
geoJson = geoJsonNaxi geoJson = geoJsonNaxi
break; break;
@ -645,7 +648,7 @@ globalEventBus.on('choseTown', data => {
areaStore.areaCodeList.forEach(item => { areaStore.areaCodeList.forEach(item => {
if (item.name == (data.name)) { if (item.name == (data.name)) {
areaStore.changeUserInfoFn(510521, item.code) areaStore.changeUserInfoFn(areaStore.userInfo.areaCode, item.code)
} }
}) })
areaStore.changeAddress('', data.name ) areaStore.changeAddress('', data.name )