This commit is contained in:
姚宇浩 2024-07-25 17:31:02 +08:00
parent 6ed1237a8a
commit cb971efb1f
1 changed files with 54 additions and 44 deletions

View File

@ -33,7 +33,7 @@
class="content_item" class="content_item"
v-for="(item, index) in tsbqTotal" v-for="(item, index) in tsbqTotal"
:class="{ choose: item.id == choose.person }" :class="{ choose: item.id == choose.person }"
@click="changebq(item.id)" @click="buten2(item)"
:key="index" :key="index"
> >
<div class="content_item_name">{{ item.name }}</div> <div class="content_item_name">{{ item.name }}</div>
@ -517,6 +517,7 @@ const addPolygonCounty = () => {
BMAP(); BMAP();
if (choose.value.person == 0) { if (choose.value.person == 0) {
getDatas("溪口镇", ""); getDatas("溪口镇", "");
getDataBq(cfJd.value,'')
} else { } else {
getDatas("溪口镇", choose.value.person); getDatas("溪口镇", choose.value.person);
} }
@ -2059,8 +2060,10 @@ const buten = async (item) => {
getDatas("溪口镇", item.age); getDatas("溪口镇", item.age);
}; };
const buten2 = async (item) => { const buten2 = async (item) => {
getDataBq(item.id, item.age); console.log(item.id);
// getDataBq(item.id, item.age);
// getDatas("", item.age); // getDatas("", item.age);
getDataBqs(cfJd.value, cfCs.value, item.id);
}; };
// //
const getData = async (i, e) => { const getData = async (i, e) => {
@ -2219,10 +2222,11 @@ const getDatas2 = async (e, i, cs) => {
}); });
}; };
// //
const getDataBq = async (i, e) => { const getDataBq = async (jd, cs) => {
await http await http
.get(`/api/ggfwyth/ysyzt/getTsbq?csq=${e || ""}&xzjd=${i || ""}`) .get(`/api/ggfwyth/ysyzt/getTsbq?csq=${cs || ""}&xzjd=${jd || ""}`)
.then((res) => { .then((res) => {
console.log(66666666666);
if (res.code == 200) { if (res.code == 200) {
if (cfJd.value == "") { if (cfJd.value == "") {
tsbqTotal.value.length = 0; tsbqTotal.value.length = 0;
@ -2260,28 +2264,31 @@ const getDataBq = async (i, e) => {
} }
}); });
}; };
const getDataBqs= async(i,e,v)=>{ const getDataBqs = async (jd, cs, bq) => {
await http let data = {};
.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq?csq=${e || ""}&xzjd=${i || ""}&tsbq=${i || ""}`) let vv = 0;
.then((res) => { if (cs == "" && jd == "") {
data = {
tsbq: bq,
};
vv = 1;
} else if (cs == "") {
data = {
xzjd: jd,
tsbq: bq,
};
vv = 2;
} else {
data = {
xzjd: jd,
tsbq: bq,
csq: cs,
};
vv = 3;
}
await http.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq`, data).then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (cfJd.value == "") { // if (cfJd.value == "") {
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) => { // res.data.forEach((item, index) => {
// tsbqTotal.value.push({ // tsbqTotal.value.push({
// id: index + 1, // id: index + 1,
@ -2290,18 +2297,21 @@ const getDataBqs= async(i,e,v)=>{
// ages: 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;
// } // }
// }); if (vv == 1) {
// }); mapTownCount.map((item) => {
item.number = 0;
res.data.map((items) => {
if (items.xzjd == item.name) {
item.number = items.rs;
} }
}); });
} });
}
changeRs(bq)
}
});
};
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 =