This commit is contained in:
littleeewolf 2024-08-10 16:07:58 +08:00
parent fa8fce9798
commit ae1277651b
1 changed files with 248 additions and 177 deletions

View File

@ -374,37 +374,47 @@ const tsbq_id_total = ref([
{ {
name: "残疾人", name: "残疾人",
id: "cjr", id: "cjr",
tagId:5, tagId: 5,
}, },
{ {
name: "低边", name: "低边",
id: "dibian", id: "dibian",
tagId:2, tagId: 2,
}, },
{ {
name: "低保", name: "低保",
id: "db", id: "db",
tagId:1, tagId: 1,
}, },
{ {
name: "高血压", name: "高血压",
id: "gxy", id: "gxy",
tagId:9, tagId: 9,
}, },
{ {
name: "糖尿病", name: "糖尿病",
id: "tnb", id: "tnb",
tagId:7, tagId: 7,
}, },
{ {
name: "退役军人", name: "退役军人",
id: "tyjr", id: "tyjr",
tagId:8, tagId: 8,
}, },
{ {
name: "困境儿童", name: "困境儿童",
id: "kjer", id: "kjer",
tagId:3, tagId: 3,
},
{
name: "孤儿",
id: "ge",
tagId: 4,
},
{
name: "特困",
id: "tk",
tagId: 6,
}, },
]); ]);
// //
@ -770,7 +780,7 @@ const tableType = reactive({
label: "性别", label: "性别",
property: "gender", property: "gender",
}, },
{ {
label: "年龄", label: "年龄",
property: "age", property: "age",
}, },
@ -981,7 +991,8 @@ const getData = async (e) => {
changeRs(e1); changeRs(e1);
} }
}; };
const getDatas = async (e, i) => { const getDatas = async (e, i, y = true) => {
//y
if (i == "9999") { if (i == "9999") {
i = ""; i = "";
} }
@ -1104,10 +1115,12 @@ const getDatas = async (e, i) => {
}); });
} }
} else { } else {
if (choose.value.person == "") { if (y) {
addCs(); if (choose.value.person == "") {
} else { addCs();
addCs2(); } else {
addCs2();
}
} }
} }
} }
@ -1146,7 +1159,9 @@ const getDatas2 = async (e, i, cs) => {
i == "gxy" || i == "gxy" ||
i == "tnb" || i == "tnb" ||
i == "tyjr" || i == "tyjr" ||
i == "kjer" i == "kjer" ||
i == "ge" ||
i == "tk"
) { ) {
i = ""; i = "";
} }
@ -1301,7 +1316,9 @@ const getDatas2 = async (e, i, cs) => {
i1 == "gxy" || i1 == "gxy" ||
i1 == "tnb" || i1 == "tnb" ||
i1 == "tyjr" || i1 == "tyjr" ||
i1 == "kjer" i1 == "kjer" ||
i1 == "ge" ||
i1 == "tk"
) { ) {
} else { } else {
if (choose.value.person == "") { if (choose.value.person == "") {
@ -1315,28 +1332,51 @@ const getDatas2 = async (e, i, cs) => {
} }
} }
}; };
// //
// //
// //
const changeTagId = (bq) => {
tsbq_id_total.value.forEach((item, index) => {
if (bq == item.id) {
console.log(item.tagId);
return item.tagId;
}
});
};
const getDataBq = async (jd, cs) => { const getDataBq = async (jd, cs) => {
await http await http
.get(`/api/ggfwyth/ysyzt/getTsbq?csq=${cs || ""}&xzjd=${jd || ""}`) .get(`/api/ggfwyth/ysyzt/getBqRs?committee=${cs || ""}&town=${jd || ""}`)
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
tsbqTotal.value.length = 0; tsbqTotal.value.length = 0;
for (let name in res.data) { res.data.forEach((item, index) => {
let idd = ""; let idd = "";
for (let v = 0; v < tsbq_id_total.value.length; v++) { tsbq_id_total.value.forEach((itemm, indexx) => {
if (tsbq_id_total.value[v].name == name) { if (item.bq == itemm.name) {
idd = tsbq_id_total.value[v].id; idd = itemm.id;
} }
} });
tsbqTotal.value.push({ tsbqTotal.value.push({
id: idd, id: idd,
name: name, name: item.bq,
rksl: res.data[name] || 0, rksl: item.rs || 0,
tagId: item.tagId,
}); });
} });
// 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] || 0,
// });
// }
} }
}); });
}; };
@ -1361,178 +1401,199 @@ const getDataBqs2 = async (jd, cs, bq, f = true) => {
//fchangeRs2 //fchangeRs2
let data = {}; let data = {};
let vv = 0; let vv = 0;
let tagIdBq;
tsbq_id_total.value.forEach((item, index) => {
if (bq == item.id) {
tagIdBq = item.tagId;
}
});
if (cs == "" && jd == "") { if (cs == "" && jd == "") {
data = { data = {
tsbq: bq, tagId: tagIdBq,
}; };
vv = 1; vv = 1;
} else if (cs == "") { } else if (cs == "") {
data = { data = {
xzjd: jd, town: jd,
tsbq: bq, tagId: tagIdBq,
}; };
vv = 2; vv = 2;
} else { } else {
data = { data = {
xzjd: jd, town: jd,
tsbq: bq, tagId: tagIdBq,
csq: cs, committee: cs,
}; };
vv = 3; vv = 3;
} }
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => { await http
if (res.code == 200) { .get(`/api/ggfwyth/ysyzt/getBqRsByTownAndCommittee`, data)
if (cfJd.value != "") { .then((res) => {
xkzCenter.map((item) => { if (res.code == 200) {
item.numbers = 0; if (cfJd.value != "") {
res.data.map((items) => { xkzCenter.map((item) => {
if (items.csq == item.name) { item.numbers = 0;
item.numbers = items.rs; res.data.map((items) => {
} if (items.committee == item.name) {
item.numbers = items.rs;
}
});
}); });
}
if (f) {
changeRs2(bq);
}
cs_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_name_arr.value[index]);
}); });
} cs_number_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_number_name_arr.value[index]);
if (f) { });
changeRs2(bq); cs_dd_arr.value.forEach((item, index) => {
} map.removeOverlay(cs_dd_arr.value[index]);
});
cs_name_arr.value.forEach((item, index) => { if (title_jd.value == "") {
map.removeOverlay(cs_name_arr.value[index]);
});
cs_number_name_arr.value.forEach((item, index) => {
map.removeOverlay(cs_number_name_arr.value[index]);
});
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
if (title_jd.value == "") {
} else {
if (sfdd.value) {
if (choose.value.person == "") {
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
} else {
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
}
} else { } else {
if (choose.value.person == "") { if (sfdd.value) {
addCs(); if (choose.value.person == "") {
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
} else {
cs_dd_arr.value.forEach((item, index) => {
map.removeOverlay(cs_dd_arr.value[index]);
});
cs_dd_arr.value = [...xuanzhongCs.value];
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
}
} else { } else {
addCs2(); if (choose.value.person == "") {
addCs();
} else {
addCs2();
}
} }
} }
} }
} });
});
}; };
// //
const getDataBqs3 = async (jd, cs, bq) => { const getDataBqs3 = async (jd, cs, bq) => {
//fchangeRs2 //fchangeRs2
let data = {}; let data = {};
let vv = 0; let vv = 0;
let tagIdBq;
tsbq_id_total.value.forEach((item, index) => {
if (bq == item.id) {
tagIdBq = item.tagId;
}
});
if (cs == "" && jd == "") { if (cs == "" && jd == "") {
data = { data = {
tsbq: bq, tagId: btagIdBqq,
}; };
vv = 1; vv = 1;
} else if (cs == "") { } else if (cs == "") {
data = { data = {
xzjd: jd, town: jd,
tsbq: bq, tagId: tagIdBq,
}; };
vv = 2; vv = 2;
} else { } else {
data = { data = {
xzjd: jd, town: jd,
tsbq: bq, tagId: tagIdBq,
csq: cs, committee: cs,
}; };
vv = 3; vv = 3;
} }
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => { await http
if (res.code == 200) { .get(`/api/ggfwyth/ysyzt/getBqRsByTownAndCommittee`, data)
// if (cfJd.value != "") { .then((res) => {
xkzCenter.map((item) => { if (res.code == 200) {
item.numbers = 0; // if (cfJd.value != "") {
res.data.map((items) => { xkzCenter.map((item) => {
if (items.csq == item.name) {
item.numbers = items.rs;
}
});
});
// }
// cs_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_name_arr.value[index]);
// });
// cs_number_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_number_name_arr.value[index]);
// });
// cs_dd_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_dd_arr.value[index]);
// });
// if (title_jd.value == "") {
// } else {
// if (sfdd.value) {
cs_dd_arr.value = [...xuanzhongCs.value];
if (choose.value.person == "") {
// cs_dd_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_dd_arr.value[index]);
// });
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
} else {
// cs_dd_arr.value = [...xuanzhongCs.value];
console.log(cs_dd_arr.value);
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
}
// }
// else {
// if (choose.value.person == "") {
// addCs();
// } else {
// addCs2();
// }
// }
// }
}
});
};
//
const getDataBqJD = async (bq) => {
let data = {};
data = {
tsbq: bq,
};
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => {
if (res.code == 200) {
if (res?.data) {
mapTownCount.map((item) => {
item.numbers = 0; item.numbers = 0;
res.data.map((items) => { res.data.map((items) => {
if (items.xzjd == item.name) { if (items.committee == item.name) {
item.numbers = items.rs; item.numbers = items.rs;
} }
}); });
}); });
// }
// cs_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_name_arr.value[index]);
// });
// cs_number_name_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_number_name_arr.value[index]);
// });
// cs_dd_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_dd_arr.value[index]);
// });
// if (title_jd.value == "") {
// } else {
// if (sfdd.value) {
cs_dd_arr.value = [...xuanzhongCs.value];
if (choose.value.person == "") {
// cs_dd_arr.value.forEach((item, index) => {
// map.removeOverlay(cs_dd_arr.value[index]);
// });
cs_dd_arr.value.map((item, index) => {
DGcreateCs(item, index);
});
} else {
// cs_dd_arr.value = [...xuanzhongCs.value];
console.log(cs_dd_arr.value);
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
}
// }
// else {
// if (choose.value.person == "") {
// addCs();
// } else {
// addCs2();
// }
// }
// }
} }
});
};
//
const getDataBqJD = async (bq) => {
let data = {};
tsbq_id_total.value.forEach((item, index) => {
if (bq == item.id) {
data = {
tagId: item.tagId,
};
} }
}); });
await http
.get(`/api/ggfwyth/ysyzt/getBqRsByTownAndCommittee`, data)
.then((res) => {
if (res.code == 200) {
if (res?.data) {
mapTownCount.map((item) => {
item.numbers = 0;
res.data.map((items) => {
if (items.town == item.name) {
item.numbers = items.rs;
}
});
});
}
}
});
}; };
// //
const changeRs = (id) => { const changeRs = (id) => {
@ -1661,10 +1722,12 @@ const to_jd = (item_name) => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false); getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false);
getDatas(cfJd.value, ""); getDatas(cfJd.value, "",false);
} else if (choose.value.person != "") { } else if (choose.value.person != "") {
if (choose.value.person == "9999") { if (choose.value.person == "9999") {
getDatas(cfJd.value, ""); getDatas(cfJd.value, "");
@ -1708,15 +1771,17 @@ const open_detail = () => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
console.log(88888); console.log(88888);
age = ""; age = "";
tsbq_id_total.value.forEach((item,index)=>{ tsbq_id_total.value.forEach((item, index) => {
if(choose.value.person==item.id){ if (choose.value.person == item.id) {
tagId=item.tagId; tagId = item.tagId;
} }
}) });
person_detail(age, tagId); person_detail(age, tagId);
dialogShow.value = true; dialogShow.value = true;
} else { } else {
@ -1726,6 +1791,7 @@ const open_detail = () => {
} }
}; };
const close = () => { const close = () => {
cfCsZs.value = "";
dialogShow.value = false; dialogShow.value = false;
pagination.total = 100; pagination.total = 100;
pagination.currentPage = 1; pagination.currentPage = 1;
@ -1757,20 +1823,21 @@ const handlePagination = (current) => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
age = ""; age = "";
tsbq_id_total.value.forEach((item,index)=>{ tsbq_id_total.value.forEach((item, index) => {
if(choose.value.person==item.id){ if (choose.value.person == item.id) {
tagId=item.tagId; tagId = item.tagId;
} }
}) });
person_detail(age, tagId); person_detail(age, tagId);
} else { } else {
age = choose.value.person; age = choose.value.person;
person_detail(age); person_detail(age);
} }
}; };
// //
const openMessage = (e) => { const openMessage = (e) => {
@ -1793,9 +1860,7 @@ const person_detail = (age, tagId) => {
pagination.pageSize pagination.pageSize
}&age=${age || ""}&committee=${cfCsZs.value || ""}&town=${ }&age=${age || ""}&committee=${cfCsZs.value || ""}&town=${
cfJd.value || "" cfJd.value || ""
}&tagId=${ }&tagId=${tagId || ""}`
tagId || ""
}`
) )
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
@ -2216,20 +2281,16 @@ const addPolygonCounty = () => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false); getDataBqs2(cfJd.value, cfCs.value, choose.value.person, false);
getDatas(cfJd.value, ""); getDatas(cfJd.value, "", false);
} else if (choose.value.person != "") { } else if (choose.value.person != "") {
if (choose.value.person == "9999") { if (choose.value.person == "9999") {
getDatas(cfJd.value, ""); getDatas(cfJd.value, "");
} else { } else {
// if (choose.value.person == 1) {
// getDatas(cfJd.value, "0"); //0
// } else {
// getDatas(cfJd.value, choose.value.person - 1);
// }
getDatas(cfJd.value, choose.value.person); getDatas(cfJd.value, choose.value.person);
} }
} }
@ -2382,7 +2443,9 @@ const createCustomOverlayJd2 = (polygon, indexx) => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
num = "numbers"; num = "numbers";
} else { } else {
@ -2494,7 +2557,9 @@ const addPolygonCountyCs = () => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
getDataBqs3(cfJd.value, cfCs.value, choose.value.person); getDataBqs3(cfJd.value, cfCs.value, choose.value.person);
} else { } else {
@ -2630,7 +2695,9 @@ const addCsUnChoose = () => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
getDataBqs3(cfJd.value, cfCs.value, choose.value.person); getDataBqs3(cfJd.value, cfCs.value, choose.value.person);
} }
@ -2772,7 +2839,9 @@ const createCs2 = (polygon, indexx) => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
num = "numbers"; num = "numbers";
} else { } else {
@ -2918,7 +2987,9 @@ const DGcreateCs2 = (polygon, indexx) => {
choose.value.person == "gxy" || choose.value.person == "gxy" ||
choose.value.person == "tnb" || choose.value.person == "tnb" ||
choose.value.person == "tyjr" || choose.value.person == "tyjr" ||
choose.value.person == "kjer" choose.value.person == "kjer" ||
choose.value.person == "ge" ||
choose.value.person == "tk"
) { ) {
num = "numbers"; num = "numbers";
} else { } else {