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

View File

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