diff --git a/src/view/yl.vue b/src/view/yl.vue
index 02d6a3c..15075f0 100644
--- a/src/view/yl.vue
+++ b/src/view/yl.vue
@@ -161,12 +161,12 @@
男性总人数
-
2307303
+
{{ data.ylLnrkgk.rkzsman }}
女性总人数
-
230730
+
{{ data.ylLnrkgk.rkzswomen }}
@@ -480,19 +480,19 @@ const getTownDetail = () => {
};
const btList = ref([
{
- name: "60-70岁",
+ name: "61-70岁",
value: ["17824", "17824", "17824"],
},
{
- name: "70-80岁",
+ name: "71-80岁",
value: ["18742", "18742", "18742"],
},
{
- name: "80-90岁",
+ name: "81-90岁",
value: ["3407", "3407", "3407"],
},
{
- name: "90-100岁",
+ name: "91-100岁",
value: ["144", "144", "144"],
},
{
@@ -500,6 +500,13 @@ const btList = ref([
value: ["10", "10", "10"],
},
]);
+const ageGroups = [
+ { ageRange: "6170", index: 0 },
+ { ageRange: "7180", index: 1 },
+ { ageRange: "8190", index: 2 },
+ { ageRange: "91100", index: 3 },
+ { ageRange: "100", index: 4 },
+];
//扇形图颜色数据
const colorList = [
{ color2: "#FFE35F" },
@@ -549,7 +556,23 @@ const data = reactive({
data: [{ nf: "2024", yf: "5", rq: "22", fwcs: "16", sc: "22" }],
day: ["5.22"],
},
+ ylLnrkgk: {
+ rkzs: "390545",
+ rkzsman: "390545",
+ rkzswomen: "390545",
+ man6170: "28896",
+ man7180: "20001",
+ man8190: "5619",
+ man91100: "754",
+ man100: "8",
+ women6170: "28905",
+ women7180: "20835",
+ women8190: "5646",
+ women91100: "1155",
+ women100: "19",
+ },
});
+
onBeforeMount(() => {
getData();
});
@@ -600,6 +623,26 @@ const getData = () => {
data.oldAgeTotal = res.data.lnrgnljzb.oldAgeTotal;
data.rkgk = res.data.lnrgnljzb.rkgk;
+ // 更新 data.ylLnrkgk
+ data.ylLnrkgk = res.data.ylLnrkgk;
+ data.ylLnrkgk.rkzsman = ageGroups.reduce(
+ (acc, group) => acc + parseInt(data.ylLnrkgk[`man${group.ageRange}`]),
+ 0
+ );
+ data.ylLnrkgk.rkzswomen = ageGroups.reduce(
+ (acc, group) => acc + parseInt(data.ylLnrkgk[`women${group.ageRange}`]),
+ 0
+ );
+
+ // 更新 btList
+ ageGroups.forEach((group) => {
+ const manCount = parseInt(data.ylLnrkgk[`man${group.ageRange}`]);
+ const womenCount = parseInt(data.ylLnrkgk[`women${group.ageRange}`]);
+ btList.value[group.index].value[0] = manCount + womenCount;
+ btList.value[group.index].value[1] = manCount;
+ btList.value[group.index].value[2] = womenCount;
+ });
+
// 计划生育
res.data.familyPlanning.familyPlanningData.forEach((element) => {
data.centerBottom1.push(element.jhsyrs); // 人次