This commit is contained in:
duanxiaohai 2024-07-29 09:10:57 +08:00
parent 1b46a95682
commit 0c736932c6
2 changed files with 31 additions and 46 deletions

View File

@ -5,8 +5,8 @@
<script setup>
import { onMounted, reactive, nextTick, ref, defineProps, watch } from "vue";
// import mapTown from '@/assets/json/330225.json'
// import m1 from "@/assets/images/map/m1.png";
// import m2 from "@/assets/images/map/m2.png";
import m1 from "@/assets/images/map/m1.png";
import m2 from "@/assets/images/map/m2.png";
import mapTown from '@/assets/json/ly.json'
let map = null;
//

View File

@ -1267,12 +1267,11 @@ const DGcreateCs2 = (polygon, indexx) => {
};
//
const addggfwq = () => {
// if (!fwqList || !fwqList.value) {
if (fwqList.value) {
fwqList.value.map((item, index) => {
createCustomOverlay(item, index);
});
// return;
// }
}
};
//
const createCustomOverlay = (polygon, indexx) => {
@ -1438,42 +1437,25 @@ const changebq = (id) => {
}
// choose.value.person = id;
};
//
const changeFwq = (id, list, center, name, names) => {
//
const changeFwq = async (id, list, center, name, names) => {
if (choose.value.fwq == id) {
// chooseArr.value = chooseArr.value.filter((item) => item !== "fwq");
choose.value.fwq = 9999;
csh();
addPolygonCounty();
setTimeout(() => {
drawACircle("hide");
}, 500);
//
choose.value.fwq = null;
csh(); //
addPolygonCounty(); //
fwq_list_arr.value.forEach((item, index) => {
map.removeOverlay(fwq_list_arr.value[index]);
map.removeOverlay(fwq_list_arr.value[index]); //
});
drawACircle("hide"); //
} else {
getServiceCircle(names, name);
console.log(jbfwqTotal.value[4].child[0], "乡镇");
await getServiceCircle(names, name);
choose.value.fwq = id;
fwqList.value = list;
//
console.log(22);
map.clearOverlays();
addggfwq();
map.clearOverlays(); //
addggfwq(); //
setTimeout(() => {
goMapCenter(center, 16);
}, 600);
goMapCenter(center, 16); //
}, 500);
}
// choose.value.fwq = id;
// removeAllPolygon("fwq");
// fwqList.value = list;
// goMapCenter(center, 17);
// fwqList.value.map((item) => {
// createCustomOverlay(item);
// });
};
const changeys = (id) => {
@ -1490,9 +1472,9 @@ const personTotal = ref([
},
{
id: 1,
name: "0岁",
name: "1岁以下",
value: "26737",
ages: "0岁",
ages: "1岁以下",
age: "1000",
},
{
@ -2201,29 +2183,32 @@ const buten2 = async (item) => {
getDataBqs(cfJd.value, cfCs.value, item.id);
};
const updateFwqList = (data, townName, communityName) => {
let updatedFwqList = [];
jbfwqTotal.value.forEach((town) => {
if (town.name === townName) {
town.child.forEach((community) => {
if (community.name === communityName) {
community.fwqList = data
updatedFwqList = data
.filter(
(item) => item.xzjd === townName && item.csq === communityName
)
.map((item) => ({
name: item.zyysmc,
point: [item.jd, item.wd],
bgColor: "#00b050",
img: fwqbg1,
img2: b2,
x: 33,
y: 0,
textColor: "#fff",
img: fwqbg1,
img2: b2,
name: item.zyysmc,
point: [item.jd, item.wd],
padding: "4px 8px 10px",
textColor: "#fff",
bgColor: "#00b050",
}));
community.fwqList = updatedFwqList;
}
});
}
});
fwqList.value = updatedFwqList;
// console.log(jbfwqTotal.value[4].child[0], "");
};
const getServiceCircle = async (communityName, townName) => {