地图补全年龄

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(() => { onMounted(() => {
dialogShow.value = props.dialogShow; 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 = () => { const closeDialog = () => {
dialogShow.value = false; dialogShow.value = false;

View File

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

View File

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