This commit is contained in:
姚宇浩 2024-07-29 11:22:40 +08:00
parent 0c736932c6
commit 9e6c3be7c4
1 changed files with 95 additions and 71 deletions

View File

@ -19,7 +19,7 @@
@click="buten(item)" @click="buten(item)"
:key="index" :key="index"
> >
<div class="content_item_name">{{ item.ages }}</div> <div class="content_item_name">{{ ageLess0(item.ages) }}</div>
<div class="content_item_value">{{ item.rksl }}</div> <div class="content_item_value">{{ item.rksl }}</div>
</div> </div>
</div> </div>
@ -542,21 +542,9 @@ const addPolygonCounty = () => {
map.addOverlay(polygon); map.addOverlay(polygon);
polygon.addEventListener("click", () => { polygon.addEventListener("click", () => {
townName.value = item.name; townName.value = item.name;
console.log(11111, item.name, townName.value);
// if(item.name !== ""){
//   jrcs.value=false;
//   console.log( jrcs.value,'000');
// }
// if (jrcs.value && item.name != "") {
//   console.log(1);
// } else {
//   console.log(2);
// jrcs.value=true;
if (item.name == cfJd.value) { if (item.name == cfJd.value) {
// console.log(2222);
} else { } else {
// console.log(111); console.log(111, choose.value.person);
cfJd.value = item.name; cfJd.value = item.name;
let jdCenter = []; let jdCenter = [];
if (item.name == "溪口镇") { if (item.name == "溪口镇") {
@ -573,11 +561,10 @@ const addPolygonCounty = () => {
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer"
) { ) {
console.log(5555555555555555);
getDataBq(cfJd.value, ""); getDataBq(cfJd.value, "");
getDataBqs2(cfJd.value, cfCs.value, choose.value.person); getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false);
console.log(3);
} else { } else {
console.log(4);
getDatas("溪口镇", choose.value.person); getDatas("溪口镇", choose.value.person);
} }
@ -586,16 +573,17 @@ const addPolygonCounty = () => {
} }
loadCs(); loadCs();
addPolygonCountyCs(); addPolygonCountyCs();
mapTownCount.map((item) => {
if (item.name == "溪口镇") {
jdCenter = item.center;
}
});
// if (choose.value.person == "") { // if (choose.value.person == "") {
// addCs(); // addCs();
// } else { // } else {
// addCs2(); // addCs2();
// } // }
mapTownCount.map((item) => {
if (item.name == "溪口镇") {
jdCenter = item.center;
}
});
goMapCenter(jdCenter, 13); goMapCenter(jdCenter, 13);
} else { } else {
map.removeEventListener("click", markera); map.removeEventListener("click", markera);
@ -750,7 +738,7 @@ const addPolygonCountyCs = () => {
choose.value.person == "kjer" choose.value.person == "kjer"
) { ) {
getDataBq(cfJd.value, cfCs.value); getDataBq(cfJd.value, cfCs.value);
getDataBqs2(cfJd.value, cfCs.value, choose.value.person); getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false);
} else { } else {
console.log(2, "溪口镇"); console.log(2, "溪口镇");
getDataBqs(cfJd.value, cfCs.value); getDataBqs(cfJd.value, cfCs.value);
@ -848,17 +836,29 @@ const addCsUnChoose = () => {
}); });
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 == "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, false);
}
if (choose.value.person == "") { if (choose.value.person == "") {
cs_dd_arr.value.map((item, index) => { cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index); DGcreateCs(item, index);
}); });
} else { } else {
setTimeout(() => { // setTimeout(() => {
cs_dd_arr.value.map((item, index) => { cs_dd_arr.value.map((item, index) => {
console.log("渲染", item); console.log("渲染", item);
DGcreateCs2(item, index); DGcreateCs2(item, index);
}); });
}, 300); // }, 100);
} }
addCsChoose(); addCsChoose();
addCsUnChoose(); addCsUnChoose();
@ -1405,6 +1405,14 @@ const changeRs = (id) => {
} }
}; };
const changeRs2 = (id) => { const changeRs2 = (id) => {
if (choose.value.person == id) {
console.log("测试");
choose.value.person = "";
jdm_number_arr.value.forEach((item, index) => {
map.removeOverlay(jdm_number_arr.value[index]);
});
addJd();
} else {
choose.value.person = id; choose.value.person = id;
jdm_arr.value.forEach((item, index) => { jdm_arr.value.forEach((item, index) => {
map.removeOverlay(jdm_arr.value[index]); map.removeOverlay(jdm_arr.value[index]);
@ -1413,6 +1421,7 @@ const changeRs2 = (id) => {
map.removeOverlay(jdm_number_arr.value[index]); map.removeOverlay(jdm_number_arr.value[index]);
}); });
addJd2(); addJd2();
}
}; };
const changebq = (id) => { const changebq = (id) => {
if (choose.value.person == id) { if (choose.value.person == id) {
@ -1570,7 +1579,15 @@ const personTotal = ref([
age: "1000", age: "1000",
}, },
]); ]);
const ageLess0 = computed(() => {
return function (item) {
if (item == "0岁") {
return "小于1岁";
} else {
return item;
}
};
});
// //
const tsbqTotal = ref([ const tsbqTotal = ref([
{ {
@ -2375,9 +2392,7 @@ 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");
} else { } else {
console.log(2, "222222222");
addCs2(); addCs2();
} }
} }
@ -2486,26 +2501,23 @@ const getDataBqs = async (jd, cs, bq) => {
}; };
vv = 3; vv = 3;
} }
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => { await getDataBqJD(bq);
if (res.code == 200) { getDataBqs2(cfJd.value, cfCs.value, bq);
mapTownCount.map((item) => { // await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => {
item.numbers = 0; // if (res.code == 200) {
res.data.map((items) => { // mapTownCount.map((item) => {
if (items.xzjd == item.name) { // item.numbers = 0;
item.numbers = items.rs; // res.data.map((items) => {
} // if (items.xzjd == item.name) {
}); // item.numbers = items.rs;
});
console.log(mapTownCount, "mapTownCount");
// changeRs2(bq);
choose.value.person = bq;
// if (jd) {
getDataBqs2(cfJd.value, cfCs.value, choose.value.person);
// } // }
} // });
}); // });
// }
// });
}; };
const getDataBqs2 = async (jd, cs, bq) => { const getDataBqs2 = async (jd, cs, bq, f = true) => {
//fchangeRs2
let data = {}; let data = {};
let vv = 0; let vv = 0;
if (cs == "" && jd == "") { if (cs == "" && jd == "") {
@ -2529,16 +2541,6 @@ const getDataBqs2 = async (jd, cs, bq) => {
} }
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => { await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
// if (cfJd.value == "") {
// res.data.forEach((item, index) => {
// tsbqTotal.value.push({
// id: index + 1,
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// });
// });
// }
xkzCenter.map((item) => { xkzCenter.map((item) => {
item.numbers = 0; item.numbers = 0;
res.data.map((items) => { res.data.map((items) => {
@ -2547,8 +2549,9 @@ const getDataBqs2 = async (jd, cs, bq) => {
} }
}); });
}); });
console.log(mapTownCount); if (f) {
changeRs2(bq); changeRs2(bq);
}
cs_name_arr.value.forEach((item, index) => { cs_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_name_arr.value[index]); map.removeOverlay(cs_name_arr.value[index]);
@ -2591,6 +2594,27 @@ const getDataBqs2 = async (jd, cs, bq) => {
} }
}); });
}; };
//
const getDataBqJD = async (bq) => {
let data = {};
data = {
tsbq: bq,
};
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => {
if (res.code == 200) {
mapTownCount.map((item) => {
item.numbers = 0;
res.data.map((items) => {
if (items.xzjd == item.name) {
item.numbers = items.rs;
}
});
});
}
});
};
//
const reset_font = () => { const reset_font = () => {
let width = document.documentElement.clientWidth || document.body.clientWidth; let width = document.documentElement.clientWidth || document.body.clientWidth;
let height = let height =