This commit is contained in:
duanxiaohai 2024-07-26 00:09:31 +08:00
parent e0972e71ab
commit e24f117182
2 changed files with 67 additions and 98 deletions

BIN
dist.zip Normal file

Binary file not shown.

View File

@ -32,12 +32,12 @@
<div <div
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.bq }"
@click="changebq(item.id)" @click="changebq(item.id)"
:key="index" :key="index"
> >
<div class="content_item_name">{{ item.name }}</div> <div class="content_item_name">{{ item.name }}</div>
<div class="content_item_value">{{ item.rksl }}</div> <div class="content_item_value">{{ item.value }}</div>
</div> </div>
</div> </div>
</div> </div>
@ -1292,25 +1292,26 @@ const changeRs = (id) => {
} }
}; };
const changebq = (id) => { const changebq = (id) => {
if (choose.value.person == id) { // choose.value.bq = id;
choose.value.person = ""; // choose.value.person = "";
jdm_number_arr.value.forEach((item, index) => { if (choose.value.bq == id) {
map.removeOverlay(jdm_number_arr.value[index]); choose.value.bq = 999;
}); // jdm_number_arr.value.forEach((item, index) => {
jdm_arr.value.forEach((item, index) => { // map.removeOverlay(jdm_number_arr.value[index]);
map.removeOverlay(jdm_arr.value[index]); // });
}); // jdm_arr.value.forEach((item, index) => {
addJd(); // map.removeOverlay(jdm_arr.value[index]);
// });
// addJd();
} else { } else {
choose.value.person = id; choose.value.bq = 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]);
}); // });
jdm_number_arr.value.forEach((item, index) => { // jdm_number_arr.value.forEach((item, index) => {
map.removeOverlay(jdm_number_arr.value[index]); // map.removeOverlay(jdm_number_arr.value[index]);
}); // });
// addJd2(); // addJd();
addJd();
} }
// choose.value.person = id; // choose.value.person = id;
}; };
@ -2083,18 +2084,9 @@ const getData = async (i, e) => {
age: "", age: "",
value: "res.data.total", value: "res.data.total",
}, },
{
id: "6666",
name: "死亡总人口",
value: "5650",
ages: "死亡总人口",
age: "1000",
},
]; ];
personTotal.value[0].rksl = res.data.total; personTotal.value[0].rksl = res.data.total;
personTotal.value[0].ages = "总人口"; personTotal.value[0].ages = "总人口";
personTotal.value[1].rksl = res.data.swrs;
personTotal.value[1].ages = "死亡";
res.data.age.forEach((item, index) => { res.data.age.forEach((item, index) => {
personTotal.value.push({ personTotal.value.push({
id: index + 1, id: index + 1,
@ -2242,6 +2234,24 @@ const getDataBq = async (i, e) => {
.then((res) => { .then((res) => {
if (res.code == 200) { if (res.code == 200) {
if (cfJd.value == "") { 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; tsbqTotal.value.length = 0;
for (let name in res.data) { for (let name in res.data) {
let idd = ""; let idd = "";
@ -2277,48 +2287,6 @@ const getDataBq = async (i, e) => {
} }
}); });
}; };
const getDataBqs= async(i,e,v)=>{
await http
.get(`/api/ggfwyth/ysyzt/getTsbqByXzjdOrCsq?csq=${e || ""}&xzjd=${i || ""}&tsbq=${i || ""}`)
.then((res) => {
if (res.code == 200) {
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) => {
// 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 = () => { const reset_font = () => {
let width = document.documentElement.clientWidth || document.body.clientWidth; let width = document.documentElement.clientWidth || document.body.clientWidth;
let height = let height =
@ -2339,7 +2307,7 @@ onMounted(() => {
reset_font(); reset_font();
initMap(); initMap();
getData(); getData();
getDataBq(); // getDataBq();
BMAP(); BMAP();
}); });
</script> </script>
@ -2428,19 +2396,19 @@ onMounted(() => {
background-size: 100% 100%; background-size: 100% 100%;
margin-bottom: 12px; margin-bottom: 12px;
} }
.content_item:nth-child(2) { // .content_item:last-child {
box-sizing: border-box; // box-sizing: border-box;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: space-between; // justify-content: space-between;
padding: 24px; // padding: 24px;
width: 100%; // width: 100%;
height: 57px; // height: 57px;
background-image: url(@/assets/images/map/unchoose.png); // background-image: url(@/assets/images/map/unchoose.png);
background-repeat: no-repeat; // background-repeat: no-repeat;
background-size: 100% 100%; // background-size: 100% 100%;
margin-bottom: 12px; // margin-bottom: 12px;
} // }
.content_item_name { .content_item_name {
position: relative; position: relative;
@ -2499,19 +2467,19 @@ onMounted(() => {
margin-bottom: 12px; margin-bottom: 12px;
} }
.content_item:last-child { // .content_item:last-child {
box-sizing: border-box; // box-sizing: border-box;
display: flex; // display: flex;
align-items: center; // align-items: center;
justify-content: space-between; // justify-content: space-between;
padding: 24px; // padding: 24px;
width: 100%; // width: 100%;
height: 57px; // height: 57px;
background-image: url(@/assets/images/map/unchoose.png); // background-image: url(@/assets/images/map/unchoose.png);
background-repeat: no-repeat; // background-repeat: no-repeat;
background-size: 100% 100%; // background-size: 100% 100%;
margin-bottom: 12px; // margin-bottom: 12px;
} // }
.content_item_name { .content_item_name {
position: relative; position: relative;
@ -2709,6 +2677,7 @@ onMounted(() => {
-webkit-text-fill-color: transparent; -webkit-text-fill-color: transparent;
span { span {
cursor: pointer;
display: block; display: block;
font-family: YouSheBiaoTiHei; font-family: YouSheBiaoTiHei;
font-size: 34px; font-size: 34px;