This commit is contained in:
姚宇浩 2024-07-25 15:50:52 +08:00
parent f9dc5881bb
commit f8107a4e47
1 changed files with 112 additions and 79 deletions

View File

@ -32,12 +32,12 @@
<div
class="content_item"
v-for="(item, index) in tsbqTotal"
:class="{ choose: item.id == choose.bq }"
:class="{ choose: item.id == choose.person }"
@click="changebq(item.id)"
:key="index"
>
<div class="content_item_name">{{ item.name }}</div>
<div class="content_item_value">{{ item.value }}</div>
<div class="content_item_value">{{ item.rksl }}</div>
</div>
</div>
</div>
@ -133,7 +133,7 @@ import b6 from "@/assets/images/map/b6.png";
import xcbg from "@/assets/images/map/xcbg.png";
import http from "@/utils/request.js";
import AED from "@/assets/images/map/AED.png";
//
//()
const jdm_arr = ref([]);
const jdm_number_arr = ref([]);
const fwq_list_arr = ref([]);
@ -143,10 +143,7 @@ const cs_number_name_arr = ref([]);
const cs_choose_arr = ref([]);
const cs_un_choose_arr = ref([]);
const cs_dd_arr = ref([]);
//
const marker = ref([]);
//
const cfjiedao = ref("");
//
const jrcs = ref(false);
const title_choose = ref("");
//
@ -186,6 +183,29 @@ const colorList = [
bg: "RGBA(27, 91, 55, 1)",
},
];
//
const tsbq_id_total = ref([
{
name: "残疾人",
id: "cjr",
},
{
name: "低边",
id: "dibian",
},
{
name: "低保",
id: "db",
},
{
name: "高血压",
id: "gxy",
},
{
name: "糖尿病",
id: "tnb",
},
]);
//
const csh = () => {
xuanzhongCs.value = [];
@ -495,7 +515,6 @@ const addPolygonCounty = () => {
let jdCenter = [];
if (item.name == "溪口镇") {
BMAP();
console.log("cjhsbchjs vbchsj", choose.value.person);
if (choose.value.person == 0) {
getDatas("溪口镇", "");
} else {
@ -512,13 +531,11 @@ const addPolygonCounty = () => {
jdCenter = item.center;
}
});
console.log(jrcs.value);
if (choose.value.person == "") {
addCs();
} else {
addCs2();
}
console.log("dbfjdsbfjds", choose.value.person);
goMapCenter(jdCenter, 13);
} else {
map.removeEventListener("click", markera);
@ -653,7 +670,6 @@ const addPolygonCountyCs = () => {
map.addOverlay(cs_qk_arr.value[index]);
cs_qk_arr.value[index].addEventListener("click", () => {
cfCs.value = item.name;
console.log("cfCs.value", cfCs.value);
sfdd.value = true;
xkzCenter.forEach((a, b) => {
if (a.name == item.name) {
@ -690,8 +706,6 @@ const addPolygonCountyCs = () => {
});
}
getDatas2(cfJd.value, choose.value.person, cfCs.value);
console.log("chooseCsList.value", chooseCsList.value);
console.log("unChooseList.value", unChooseList.value);
addCsChoose();
addCsUnChoose();
});
@ -701,7 +715,6 @@ const addPolygonCountyCs = () => {
//
const addCsChoose = () => {
chooseCsList.value.map((item, index) => {
console.log("item11", item.name);
sqname.value = item.name;
let fillColor = "blue";
//
@ -742,15 +755,13 @@ const addCsUnChoose = () => {
});
map.addOverlay(cs_un_choose_arr.value[index]);
cs_un_choose_arr.value[index].addEventListener("click", () => {
console.log(cfCs.value, cfCs.value.length);
title_choose.value = title_choose.value.slice(
0,
-(cfCs.value.length + 1)
);
console.log("删除后", title_choose.value);
cfCs.value = item.name;
title_choose.value = title_choose.value + `>${cfCs.value}`;
console.log("添加后", title_choose.value);
sfdd.value = true;
@ -784,7 +795,6 @@ const addCsUnChoose = () => {
map.removeOverlay(cs_qk_arr.value[index]);
});
if (choose.value.person == "") {
console.log(1111111111, cs_dd_arr.value);
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
@ -915,7 +925,6 @@ const addCs = () => {
//(,)
const addCs2 = () => {
xkzCenter.map((item, index) => {
// console.log("addCs2", item);
createCs2(item, index);
});
};
@ -1036,7 +1045,6 @@ const createCs = (polygon, indexx) => {
};
//
const DGcreateCs = (polygon, indexx) => {
console.log("ppppppppp", polygon);
function createLabelDOM() {
var content = document.createElement("div");
content.style.display = "flex";
@ -1086,7 +1094,6 @@ const DGcreateCs = (polygon, indexx) => {
type: "customOverlay",
},
});
console.log(cs_dd_arr.value);
map.addOverlay(cs_dd_arr.value[indexx]);
};
const DGcreateCs2 = (polygon, indexx) => {
@ -1268,74 +1275,40 @@ const choose = ref({
});
const changeRs = (id) => {
if (choose.value.person == id) {
console.log("重复");
// chooseArr.value = chooseArr.value.filter((item) => item !== "person");
choose.value.person = "";
jdm_number_arr.value.forEach((item, index) => {
map.removeOverlay(jdm_number_arr.value[index]);
});
// if (cs_number_name_arr.value?.length) {
// cs_number_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_number_name_arr.value[index]);
// });
// cs_number_name_arr.value.length = 0;
// addCs();
// }
addJd();
// if (chooseArr.value.includes("jd_number")) {
// removeAllPolygon("person");
// xuanran();
// loadCs();
// addPolygonCountyCs();
// addCs();
// } else {
// removeAllPolygon("person");
// xuanran();
// addJd();
// }
} else {
// if(chooseArr.value.includes("jd_number")){
// chooseArr.value = chooseArr.value.filter((item) => item !== "jd_number");
// chooseArr.value.push("jd_noNumber");
// }
// chooseArr.value.push("person");
console.log("new");
choose.value.person = id;
choose.value.bq = 9999;
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 (cs_name_arr.value?.length) {
// cs_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_name_arr.value[index]);
// });
// cs_name_arr.value.length = 0;
// addCs2();
// }
// if (jdm_number_arr.value?.length) {
// jdm_number_arr.value.forEach((item, index) => {
// map.removeOverlay(jdm_number_arr.value[index]);
// });
// jdm_number_arr.value.length = 0;
// }
// jdm_arr.value.forEach((item, index) => {
// map.removeOverlay(jdm_arr.value[index]);
// });
// removeAllPolygon("person");
// xuanran();
}
};
const changebq = (id) => {
choose.value.bq = id;
if (choose.value.person == id) {
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();
}
// choose.value.person = id;
};
const changeFwq = (id, list, center) => {
if (choose.value.fwq == id) {
@ -2081,8 +2054,12 @@ const buten = async (item) => {
getData(item.id, item.age);
getDatas("溪口镇", item.age);
};
const buten2 = async (item) => {
getDataBq(item.id, item.age);
// getDatas("", item.age);
};
//
const getData = async (i, e) => {
console.log("iiii", i);
await http
.get(`/api/ggfwyth/ysyzt/getXzjdrksl?age=${e || ""}`)
.then((res) => {
@ -2163,7 +2140,7 @@ const getDatas = async (e, i) => {
// });
// });
xkzCenter.map((item) => {
item.number=0;
item.number = 0;
res.data.committee.map((items) => {
if (items.committee == item.name) {
item.number = items.rksl;
@ -2171,7 +2148,6 @@ const getDatas = async (e, i) => {
});
});
console.log(xkzCenter);
cs_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_name_arr.value[index]);
});
@ -2179,17 +2155,14 @@ const getDatas = async (e, i) => {
map.removeOverlay(cs_number_name_arr.value[index]);
});
console.log(cs_dd_arr.value, "cs_dd_arr.value");
if (title_choose.value == "") {
} else {
if (sfdd.value) {
console.log("yyyy");
if (choose.value.person == "") {
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
console.log("rrrrrrrrr", cs_dd_arr.value);
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
@ -2198,7 +2171,6 @@ const getDatas = async (e, i) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
console.log("rrrrriiii", cs_dd_arr.value);
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
@ -2242,6 +2214,66 @@ const getDatas2 = async (e, i, cs) => {
}
});
};
//
const getDataBq = async (i, e) => {
await http
.get(`/api/ggfwyth/ysyzt/getTsbq?csq=${e || ""}&xzjd=${i || ""}`)
.then((res) => {
if (res.code == 200) {
if (cfJd.value == "") {
// personTotal.value = [
// {
// id: "0",
// ages: "",
// age: "",
// value: "res.data.total",
// },
// ];
// personTotal.value[0].rksl = res.data.total;
// personTotal.value[0].ages = "";
// res.data.age.forEach((item, index) => {
// personTotal.value.push({
// id: index + 1,
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// });
// });
tsbqTotal.value.length = 0;
for (let name in res.data) {
let idd = "";
for (let v = 0; v < tsbq_id_total.value.length; v++) {
if (tsbq_id_total.value[v].name == name) {
idd = tsbq_id_total.value[v].id;
}
}
tsbqTotal.value.push({
id: idd,
name: name,
rksl: res.data[name],
});
}
console.log(1111111111, tsbqTotal.value);
// res.data.forEach((item, index) => {
// tsbqTotal.value.push({
// id: index + 1,
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// });
// });
}
// mapTownCount.map((item) => {
// item.number = 0;
// res.data.town.map((items) => {
// if (items.town == item.name) {
// item.number = items.rksl;
// }
// });
// });
}
});
};
const reset_font = () => {
let width = document.documentElement.clientWidth || document.body.clientWidth;
let height =
@ -2262,6 +2294,7 @@ onMounted(() => {
reset_font();
initMap();
getData();
getDataBq();
BMAP();
});
</script>