地图补全年龄

This commit is contained in:
姚宇浩 2024-09-18 16:44:03 +08:00
parent 286a601018
commit fab6090612
3 changed files with 85 additions and 38 deletions

View File

@ -315,19 +315,8 @@ watch(
// 使
onMounted(() => {
dialogShow.value = props.dialogShow;
// data.columns = props.columns;
// data.title = props.title;
// data.tableData = props.tableData;
// console.log("", data);
});
// onBeforeMount(() => {
// dialogShow.value = props.dialogShow;
// data.columns = props.columns;
// data.title = props.title;
// data.typeId = props.typeId;
// data.tableData = props.tableData;
// console.log("3", data);
// });
const closeDialog = () => {
dialogShow.value = false;

View File

@ -166,19 +166,19 @@
/>
</div> -->
<img
style="width: 30px; height: 30px"
style="width: 30px; height: 30px;cursor: pointer;"
v-if="scope.row.deng == 0"
:src="lampImages[1]"
@click="statusDetails(scope.row)"
/>
<img
style="width: 30px; height: 30px"
style="width: 30px; height: 30px;cursor: pointer;"
v-if="scope.row.deng == 1"
:src="lampImages[3]"
@click="statusDetails(scope.row)"
/>
<img
style="width: 30px; height: 30px"
style="width: 30px; height: 30px;cursor: pointer;"
v-if="scope.row.deng == 2"
:src="lampImages[2]"
@click="statusDetails(scope.row)"

View File

@ -683,10 +683,11 @@ const mapTownCount = reactive([
},
]);
//
//choose.value.person(99996666)
const choose = ref({
person: "",
fwq: 9999,
yaosu: 9999,
// yaosu: 9999,
});
//
const personTotal = ref([
@ -1851,7 +1852,7 @@ const buten = async (item) => {
} else {
loadingss.value = true;
await getData(item.age);
await getDatas(cfJd.value, item.age);
await getDatasL(cfJd.value, item.age);
loadingss.value = false;
}
};
@ -1982,6 +1983,58 @@ const getData = async (e) => {
changeRs(e1);
}
};
//
const getDatasL = async (e, i) => {
//y
if (i == "9999") {
i = "";
}
http
.get(`/api/ggfwyth/ysyzt/getCssrksl?town=${e}&age=${i || ""}`)
.then((res) => {
if (res.code == 200) {
if (cfJd.value != "") {
xkzCenter.map((item) => {
item.swrs = 0;
res.data.committeeSwrs.map((items) => {
if (items.csq == item.name) {
item.swrs = items.swrs;
}
});
});
xkzCenter.map((item) => {
item.number = 0;
res.data.committee.map((items) => {
if (items.committee == item.name) {
item.number = items.rksl;
}
});
});
}
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 (cfCs.value) {
cs_dd_arr.value = [...xuanzhongCs.value];
cs_dd_arr.value.map((item, index) => {
DGcreateCs2(item, index);
});
} else {
addCs2();
}
}
}
});
};
//->
const getDatas = async (e, i, y = true) => {
//y
if (i == "9999") {
@ -2009,7 +2062,7 @@ const getDatas = async (e, i, y = true) => {
percent: "",
},
];
let before_age = "";
let before_age = 0;
personTotal.value[0].rksl = res.data.total;
personTotal.value[0].ages = "总人口";
personTotal.value[1].rksl = res.data.swrs;
@ -2023,25 +2076,26 @@ const getDatas = async (e, i, y = true) => {
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
// before_age = item.age;
before_age = 1;
} else {
if (item.age - before_age == 1) {
if (item.age - before_age == 0) {
personTotal.value.push({
rksl: item.rksl,
age: item.age + "",
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
before_age = before_age + 1;
} else {
for (let k = before_age; k < item.age - 1; k++) {
before_age = before_age + 1;
for (let k = before_age; k < item.age; k++) {
personTotal.value.push({
rksl: 0,
age: before_age + "",
ages: before_age + "岁",
percent: 0.0,
});
before_age = before_age + 1;
}
personTotal.value.push({
rksl: item.rksl,
@ -2049,7 +2103,7 @@ const getDatas = async (e, i, y = true) => {
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
before_age = item.age+1;
}
}
});
@ -2141,6 +2195,7 @@ const getDatas = async (e, i, y = true) => {
}
});
};
//->
const getDatas2 = async (e, i, cs) => {
//i1i
let i1 = i;
@ -2195,7 +2250,7 @@ const getDatas2 = async (e, i, cs) => {
// percent: item.percent,
// });
// });
let before_age = "";
let before_age = 0;
res.data.age.forEach((item, index) => {
if (index == 0 && item.age == 0) {
personTotal.value.push({
@ -2204,25 +2259,27 @@ const getDatas2 = async (e, i, cs) => {
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
// before_age = item.age;
before_age = 1;
} else {
if (item.age - before_age == 1) {
if (item.age - before_age == 0) {
personTotal.value.push({
rksl: item.rksl,
age: item.age + "",
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
before_age = before_age + 1;
// before_age = item.age;
} else {
for (let k = before_age; k < item.age - 1; k++) {
before_age = before_age + 1;
for (let k = before_age; k < item.age ; k++) {
personTotal.value.push({
rksl: 0,
age: before_age + "",
ages: before_age + "岁",
percent: 0.0,
});
before_age = before_age + 1;
}
personTotal.value.push({
rksl: item.rksl,
@ -2230,7 +2287,7 @@ const getDatas2 = async (e, i, cs) => {
ages: item.age + "岁",
percent: item.percent,
});
before_age = item.age;
before_age = item.age+1;
}
}
});
@ -2341,6 +2398,7 @@ const getDataBqFirst = async () => {
}
});
};
//
const getDataBqs = async (jd, cs, bq) => {
await getDataBqJD(bq);
if (cfJd.value == "") {
@ -2429,7 +2487,7 @@ const getDataBqs2 = async (jd, cs, bq) => {
}
});
};
//
//->
const getDataBqs3 = async (jd, cs, bq) => {
let data = {};
let tagIdBq;
@ -2472,7 +2530,7 @@ const getDataBqs3 = async (jd, cs, bq) => {
}
});
};
//await
//->await
const getDataBqs4 = async (jd, cs, bq) => {
let data = {};
let tagIdBq;
@ -3306,9 +3364,9 @@ const offsetPoint2 = (point, offsetX, offsetY) => {
return new BMapGL.Point(point.lng + offsetX, point.lat + offsetY);
};
//
let offsetX = 0.01095; //
let offsetX = 0.01095; //
let offsetY = 0.00314; //
let offsetX2 = 0.01; //
let offsetX2 = 0.01; //
let offsetY2 = 0.00328; //
const isclick = ref('');
const addPolygonCounty = () => {
@ -3323,9 +3381,9 @@ const addPolygonCounty = () => {
// itemm[1] = itemm[1] + 0.00314;
// });
item.point[0].map((p) => points.push(new BMapGL.Point(...p)));
let offsetPoints = points.map((point) =>
offsetPoint(point, offsetX, offsetY)
);
// let offsetPoints = points.map((point) =>
// offsetPoint(point, offsetX, offsetY)
// );
if (points.length) {
//
let polygon = new BMapGL.Polygon(points, {