gxfor添加

This commit is contained in:
姚宇浩 2024-08-06 15:17:03 +08:00
parent 06c8c955b1
commit 2c42020acf
1 changed files with 50 additions and 15 deletions

View File

@ -159,14 +159,14 @@
:pagination="pagination"
@close="close"
@handle="handlePagination"
@openMessage="openMessage"
@openMessage="openMessage"
>
<template #jzzt="{ currentCol, currentData }">
<div v-if="currentData.jzzt == 1">居住</div>
<div v-else>未居住</div>
</template>
</Dialog>
<personDetail
<personDetail
class="detail"
style="width: 1920px; height: 1080px"
v-show="!openD"
@ -1113,7 +1113,7 @@ const buten2 = async (item) => {
};
//
const getData = async (e) => {
let e1=e;
let e1 = e;
if (e == "9999") {
e = "";
}
@ -1195,7 +1195,7 @@ const getData = async (e) => {
} catch (error) {
console.error("Error fetching data:", error);
}
if (e1) {
if (e1) {
changeRs(e1);
}
};
@ -1232,7 +1232,7 @@ const getDatas = async (e, i) => {
personTotal.value[1].ages = "近一年死亡";
personTotal.value[1].percent = res.data.swrsPercent;
res.data.age.forEach((item, index) => {
if (index == 0) {
if (index == 0 && item.age == 0) {
personTotal.value.push({
rksl: item.rksl,
age: item.age + "",
@ -1240,7 +1240,6 @@ const getDatas = async (e, i) => {
percent: item.percent,
});
before_age = item.age;
console.log("执行111", before_age);
} else {
if (item.age - before_age == 1) {
personTotal.value.push({
@ -1251,8 +1250,8 @@ const getDatas = async (e, i) => {
});
before_age = item.age;
} else {
for (let i = 0; i < item.age - before_age - 1; i++) {
++before_age;
for (let k = before_age; k < item.age - 1; k++) {
before_age = before_age + 1;
personTotal.value.push({
rksl: 0,
age: before_age + "",
@ -1407,7 +1406,44 @@ const getDatas2 = async (e, i, cs) => {
// });
let before_age = "";
res.data.age.forEach((item, index) => {
if (index == 0) {
// if (index == 0) {
// personTotal.value.push({
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// percent: item.percent,
// });
// before_age = item.age;
// console.log("111", before_age);
// } else {
// if (item.age - before_age == 1) {
// personTotal.value.push({
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// percent: item.percent,
// });
// before_age = item.age;
// } else {
// for (let i = 0; i < item.age - before_age - 1; i++) {
// ++before_age;
// personTotal.value.push({
// rksl: 0,
// age: before_age + "",
// ages: before_age + "",
// percent: 0.0,
// });
// }
// personTotal.value.push({
// rksl: item.rksl,
// age: item.age + "",
// ages: item.age + "",
// percent: item.percent,
// });
// before_age = item.age;
// }
// }
if (index == 0 && item.age == 0) {
personTotal.value.push({
rksl: item.rksl,
age: item.age + "",
@ -1415,7 +1451,6 @@ const getDatas2 = async (e, i, cs) => {
percent: item.percent,
});
before_age = item.age;
console.log("执行111", before_age);
} else {
if (item.age - before_age == 1) {
personTotal.value.push({
@ -1426,8 +1461,8 @@ const getDatas2 = async (e, i, cs) => {
});
before_age = item.age;
} else {
for (let i = 0; i < item.age - before_age - 1; i++) {
++before_age;
for (let k = before_age; k < item.age - 1; k++) {
before_age = before_age + 1;
personTotal.value.push({
rksl: 0,
age: before_age + "",
@ -1878,12 +1913,12 @@ const openMessage = (e) => {
openD.value = false;
reset_font2();
//
window.addEventListener('resize', reset_font2);
window.addEventListener("resize", reset_font2);
};
//
const closeDetail = () => {
openD.value = true;
window.removeEventListener('resize', reset_font2);
window.removeEventListener("resize", reset_font2);
};
//
const person_detail = (age) => {
@ -2990,7 +3025,7 @@ const reset_font2 = () => {
"scale(" + width / 1920 + "," + height / 1080 + ")";
};
onMounted(() => {
tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
// tools.data.set("token", "6b0e380b4a8f46baae4923f83faf670d");
reset_font();
initMap();
getData();