Merge branch 'main' of git.zdool.com:xs/ggfwjsc

This commit is contained in:
duanxiaohai 2024-07-29 11:23:04 +08:00
commit 34ba9b497b
1 changed files with 95 additions and 71 deletions

View File

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