This commit is contained in:
duanxiaohai 2024-07-26 18:45:34 +08:00
parent c7acd8d501
commit 1b46a95682
1 changed files with 288 additions and 250 deletions

View File

@ -264,7 +264,7 @@ const csh = () => {
} }
goMapCenter([119.178783, 29.034583], 11); goMapCenter([119.178783, 29.034583], 11);
getData(); getData();
getDataBq() getDataBq();
}; };
// //
const chooseCsList = ref([]); const chooseCsList = ref([]);
@ -574,7 +574,7 @@ const addPolygonCounty = () => {
choose.value.person == "kjer" choose.value.person == "kjer"
) { ) {
getDataBq(cfJd.value, ""); getDataBq(cfJd.value, "");
getDataBqs2(cfJd.value, cfCs.value, choose.value.person,); getDataBqs2(cfJd.value, cfCs.value, choose.value.person);
console.log(3); console.log(3);
} else { } else {
console.log(4); console.log(4);
@ -635,8 +635,7 @@ const addPolygonCounty = () => {
cs_un_choose_arr.value = []; cs_un_choose_arr.value = [];
cs_dd_arr.value = []; cs_dd_arr.value = [];
getData(); getData();
getDataBq() getDataBq();
} }
} }
@ -741,13 +740,21 @@ const addPolygonCountyCs = () => {
DGcreateCs2(item, index); DGcreateCs2(item, index);
}); });
} }
if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { if (
getDataBq(cfJd.value, cfCs.value) choose.value.person == "cjr" ||
choose.value.person == "dibian" ||
choose.value.person == "db" ||
choose.value.person == "gxy" ||
choose.value.person == "tnb" ||
choose.value.person == "tyjr" ||
choose.value.person == "kjer"
) {
getDataBq(cfJd.value, cfCs.value);
getDataBqs2(cfJd.value, cfCs.value, choose.value.person); getDataBqs2(cfJd.value, cfCs.value, choose.value.person);
} else { } else {
console.log(2, '溪口镇'); console.log(2, "溪口镇");
getDataBqs(cfJd.value, cfCs.value) getDataBqs(cfJd.value, cfCs.value);
getDatas2('溪口镇', choose.value.person, cfCs.value); getDatas2("溪口镇", choose.value.person, cfCs.value);
getDatas2("溪口镇", choose.value.person, cfCs.value); getDatas2("溪口镇", choose.value.person, cfCs.value);
} }
@ -839,7 +846,7 @@ const addCsUnChoose = () => {
cs_un_choose_arr.value.forEach((item, index) => { cs_un_choose_arr.value.forEach((item, index) => {
map.removeOverlay(cs_qk_arr.value[index]); map.removeOverlay(cs_qk_arr.value[index]);
}); });
getDataBqs(cfJd.value, cfCs.value) getDataBqs(cfJd.value, cfCs.value);
getDatas2(cfJd.value, choose.value.person, cfCs.value); getDatas2(cfJd.value, choose.value.person, cfCs.value);
if (choose.value.person == "") { if (choose.value.person == "") {
cs_dd_arr.value.map((item, index) => { cs_dd_arr.value.map((item, index) => {
@ -957,7 +964,15 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
if (choose.value.person == "6666") { if (choose.value.person == "6666") {
console.log(1); console.log(1);
num = "swrs"; num = "swrs";
} else if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { } else if (
choose.value.person == "cjr" ||
choose.value.person == "dibian" ||
choose.value.person == "db" ||
choose.value.person == "gxy" ||
choose.value.person == "tnb" ||
choose.value.person == "tyjr" ||
choose.value.person == "kjer"
) {
num = "numbers"; num = "numbers";
} else { } else {
num = "number"; num = "number";
@ -1037,7 +1052,15 @@ const createCs2 = (polygon, indexx) => {
let num = ""; let num = "";
if (choose.value.person == "6666") { if (choose.value.person == "6666") {
num = "swrs"; num = "swrs";
} else if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { } else if (
choose.value.person == "cjr" ||
choose.value.person == "dibian" ||
choose.value.person == "db" ||
choose.value.person == "gxy" ||
choose.value.person == "tnb" ||
choose.value.person == "tyjr" ||
choose.value.person == "kjer"
) {
num = "numbers"; num = "numbers";
} else { } else {
num = "number"; num = "number";
@ -1216,7 +1239,15 @@ const DGcreateCs2 = (polygon, indexx) => {
let num = ""; let num = "";
if (choose.value.person == "6666") { if (choose.value.person == "6666") {
num = "swrs"; num = "swrs";
} else if (choose.value.person == "cjr" || choose.value.person == "dibian" || choose.value.person == "db" || choose.value.person == "gxy" || choose.value.person == "tnb" || choose.value.person == "tyjr" || choose.value.person == "kjer") { } else if (
choose.value.person == "cjr" ||
choose.value.person == "dibian" ||
choose.value.person == "db" ||
choose.value.person == "gxy" ||
choose.value.person == "tnb" ||
choose.value.person == "tyjr" ||
choose.value.person == "kjer"
) {
num = "numbers"; num = "numbers";
} else { } else {
num = "number"; num = "number";
@ -1412,7 +1443,6 @@ const changeFwq = (id, list, center, name, names) => {
if (choose.value.fwq == id) { if (choose.value.fwq == id) {
// chooseArr.value = chooseArr.value.filter((item) => item !== "fwq"); // chooseArr.value = chooseArr.value.filter((item) => item !== "fwq");
choose.value.fwq = 9999; choose.value.fwq = 9999;
console.log(11);
csh(); csh();
addPolygonCounty(); addPolygonCounty();
setTimeout(() => { setTimeout(() => {
@ -1423,18 +1453,18 @@ const changeFwq = (id, list, center, name, names) => {
map.removeOverlay(fwq_list_arr.value[index]); map.removeOverlay(fwq_list_arr.value[index]);
}); });
} else { } else {
getServiceCircle(names, name);
console.log(jbfwqTotal.value[4].child[0], "乡镇");
choose.value.fwq = id; choose.value.fwq = id;
fwqList.value = list; fwqList.value = list;
getServiceCircle(names, name);
// //
console.log(22); console.log(22);
map.clearOverlays();
setTimeout(() => { map.clearOverlays();
// drawACircle();
addggfwq(); addggfwq();
setTimeout(() => {
goMapCenter(center, 16); goMapCenter(center, 16);
}, 500); }, 600);
} }
// choose.value.fwq = id; // choose.value.fwq = id;
@ -1687,216 +1717,215 @@ const jbfwqTotal = ref([
name: "新溪社区", name: "新溪社区",
center: [119.1845892, 28.8540481], center: [119.1845892, 28.8540481],
fwqList: [ fwqList: [
{ // {
name: "溪口幼儿园", // name: "",
point: [119.1856806, 28.8509359], // point: [119.1856806, 28.8509359],
bgColor: "#00b050", // bgColor: "#00b050",
img: fwqbg1, // img: fwqbg1,
img2: b2, // img2: b2,
x: 33, // x: 33,
y: 0, // y: 0,
textColor: "#fff", // textColor: "#fff",
// padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "衢州学院附属幼儿园", // point: [119.182056, 28.8566857],
point: [119.182056, 28.8566857], // bgColor: "#00b050",
bgColor: "#00b050", // img: fwqbg1,
img: fwqbg1, // img2: b2,
img2: b2, // x: 55,
x: 55, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "溪口中银小学", // point: [119.1845353, 28.8584533],
point: [119.1845353, 28.8584533], // bgColor: "#00b050",
bgColor: "#00b050", // img: fwqbg1,
img: fwqbg1, // img2: b2,
img2: b2, // x: 38,
x: 38, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "溪口初中", // point: [119.180978, 28.8525691],
point: [119.180978, 28.8525691], // bgColor: "#00b050",
bgColor: "#00b050", // img: fwqbg1,
img: fwqbg1, // img2: b2,
img2: b2, // x: 33,
x: 33, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "居家养老中心", // point: [119.186287, 28.8491049],
point: [119.186287, 28.8491049], // bgColor: "#f4c243",
bgColor: "#f4c243", // img: fwqbg5,
img: fwqbg5, // img2: b1,
img2: b1, // x: 38,
x: 38, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "共享食堂", // point: [119.184706, 28.8563179],
point: [119.184706, 28.8563179], // bgColor: "#f4c243",
bgColor: "#f4c243", // img: fwqbg5,
img: fwqbg5, // img2: b1,
img2: b1, // x: 33,
x: 33, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "老年活动中心", // point: [119.1839065, 28.8566106],
point: [119.1839065, 28.8566106], // bgColor: "#f4c243",
bgColor: "#f4c243", // img: fwqbg5,
img: fwqbg5, // img2: b1,
img2: b1, // x: 38,
x: 38, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "残疾人之家", // point: [119.1862825, 28.8491207],
point: [119.1862825, 28.8491207], // bgColor: "#f4c243",
bgColor: "#f4c243", // img: fwqbg5,
img: fwqbg5, // img2: b1,
img2: b1, // x: 35,
x: 35, // y: 0,
y: 0, // textColor: "#fff",
textColor: "#fff", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "智慧篮球场", // point: [119.1839873, 28.8560886],
point: [119.1839873, 28.8560886], // bgColor: "#00b0f0",
bgColor: "#00b0f0", // img: fwqbg2,
img: fwqbg2, // img2: b3,
img2: b3, // x: 34,
x: 34, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "",
name: "慢行步道", // point: [119.1843107, 28.8510743],
point: [119.1843107, 28.8510743], // bgColor: "#00b0f0",
bgColor: "#00b0f0", // img: fwqbg2,
img: fwqbg2, // img2: b3,
img2: b3, // x: 26,
x: 26, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "",
name: "文化礼堂", // point: [119.1845532, 28.8562072],
point: [119.1845532, 28.8562072], // bgColor: "#a1ce63",
bgColor: "#a1ce63", // img: fwqbg6,
img: fwqbg6, // img2: b4,
img2: b4, // x: 33,
x: 33, // y: 0,
y: 0, // textColor: "#79B72B",
textColor: "#79B72B", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "综合文化站", // point: [119.1845982, 28.8482348],
point: [119.1845982, 28.8482348], // bgColor: "#a1ce63",
bgColor: "#a1ce63", // img: fwqbg6,
img: fwqbg6, // img2: b4,
img2: b4, // x: 35,
x: 35, // y: 0,
y: 0, // textColor: "#79B72B",
textColor: "#79B72B", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "共享菜园", // point: [119.1834393, 28.8559858],
point: [119.1834393, 28.8559858], // bgColor: "#a1ce63",
bgColor: "#a1ce63", // img: fwqbg6,
img: fwqbg6, // img2: b4,
img2: b4, // x: 33,
x: 33, // y: 0,
y: 0, // textColor: "#79B72B",
textColor: "#79B72B", // padding: "4px 8px 2px",
padding: "4px 8px 2px", // },
}, // {
{ // name: "",
name: "零工市场", // point: [119.1811487, 28.8614348],
point: [119.1811487, 28.8614348], // bgColor: "#a1ce63",
bgColor: "#a1ce63", // img: fwqbg6,
img: fwqbg6, // img2: b4,
img2: b4, // x: 33,
x: 33, // y: 0,
y: 0, // textColor: "#79B72B",
textColor: "#79B72B", // padding: "4px 8px 10px",
padding: "4px 8px 10px", // },
}, // {
{ // name: "",
name: "溪口中心医院", // point: [119.1839334, 28.8516437],
point: [119.1839334, 28.8516437], // bgColor: "#0070c0",
bgColor: "#0070c0", // img: fwqbg3,
img: fwqbg3, // img2: b5,
img2: b5, // x: 10,
x: 10, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "",
name: "溪口菜市场", // point: [119.1848317, 28.8544673],
point: [119.1848317, 28.8544673], // bgColor: "#184e32",
bgColor: "#184e32", // img: fwqbg4,
img: fwqbg4, // img2: b6,
img2: b6, // x: -24,
x: -24, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "",
name: "大型超市", // point: [119.1845892, 28.8540481],
point: [119.1845892, 28.8540481], // bgColor: "#184e32",
bgColor: "#184e32", // img: fwqbg4,
img: fwqbg4, // img2: b6,
img2: b6, // x: -24,
x: -24, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "",
name: "智慧停车场", // point: [119.1865654, 28.8555824],
point: [119.1865654, 28.8555824], // bgColor: "#184e32",
bgColor: "#184e32", // img: fwqbg4,
img: fwqbg4, // img2: b6,
img2: b6, // x: -28,
x: -28, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
}, // {
{ // name: "便",
name: "溪口镇便民服务中心", // point: [119.1838436, 28.8565473],
point: [119.1838436, 28.8565473], // bgColor: "#184e32",
bgColor: "#184e32", // img: fwqbg4,
img: fwqbg4, // img2: b6,
img2: b6, // x: -40,
x: -40, // y: 50,
y: 50, // textColor: "#fff",
textColor: "#fff", // padding: "8px 8px 2px",
padding: "8px 8px 2px", // },
},
], ],
}, },
{ {
@ -2172,11 +2201,17 @@ 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) => {
data.forEach((item) => { jbfwqTotal.value.forEach((town) => {
if (item.csq === communityName) { if (town.name === townName) {
item.fwqList = data.map((item1) => ({ town.child.forEach((community) => {
name: item1.zyysmc, if (community.name === communityName) {
point: [item1.jd, item1.wd], community.fwqList = data
.filter(
(item) => item.xzjd === townName && item.csq === communityName
)
.map((item) => ({
name: item.zyysmc,
point: [item.jd, item.wd],
bgColor: "#00b050", bgColor: "#00b050",
img: fwqbg1, img: fwqbg1,
img2: b2, img2: b2,
@ -2187,12 +2222,16 @@ const updateFwqList = (data, townName, communityName) => {
})); }));
} }
}); });
}
});
// console.log(jbfwqTotal.value[4].child[0], "");
}; };
const getServiceCircle = async (communityName, townName) => { const getServiceCircle = async (communityName, townName) => {
try { try {
const response = await http.get(`/api/ggfwyth/ysyzt/zyysxx?csq=${communityName}&xzjd=${townName}`); const response = await http.get(
`/api/ggfwyth/ysyzt/zyysxx?csq=${communityName}&xzjd=${townName}`
);
if (response.code === 200) { if (response.code === 200) {
console.log(response.data);
updateFwqList(response.data, townName, communityName); updateFwqList(response.data, townName, communityName);
} }
} catch (error) { } catch (error) {
@ -2351,9 +2390,9 @@ const getDatas = async (e, i) => {
console.log("hhhhh", xkzCenter); console.log("hhhhh", xkzCenter);
if (choose.value.person == "") { if (choose.value.person == "") {
addCs(); addCs();
console.log(1, '222222222'); console.log(1, "222222222");
} else { } else {
console.log(2, '222222222'); console.log(2, "222222222");
addCs2(); addCs2();
} }
} }
@ -2472,11 +2511,11 @@ const getDataBqs = async (jd, cs, bq) => {
} }
}); });
}); });
console.log(mapTownCount, 'mapTownCount'); console.log(mapTownCount, "mapTownCount");
// changeRs2(bq); // changeRs2(bq);
choose.value.person = bq choose.value.person = bq;
// if (jd) { // if (jd) {
getDataBqs2(cfJd.value, cfCs.value, choose.value.person,); getDataBqs2(cfJd.value, cfCs.value, choose.value.person);
// } // }
} }
}); });
@ -2558,7 +2597,6 @@ const getDataBqs2 = async (jd, cs, bq) => {
} else { } else {
console.log("hhhhh", xkzCenter); console.log("hhhhh", xkzCenter);
if (choose.value.person == "") { if (choose.value.person == "") {
addCs(); addCs();
} else { } else {
addCs2(); addCs2();