This commit is contained in:
姚宇浩 2024-09-06 13:18:56 +08:00
parent 73b48f9ba5
commit a0e8a79541
4 changed files with 65 additions and 62 deletions

View File

@ -26,43 +26,43 @@ const props = defineProps({
const data = reactive({ const data = reactive({
list: [ list: [
{ {
name: "1-10岁", name: "0-9岁",
value: 95, value: 95,
}, },
{ {
name: "11-20岁", name: "10-19岁",
value: 120, value: 120,
}, },
{ {
name: "21-30岁", name: "20-29岁",
value: 98, value: 98,
}, },
{ {
name: "31-40岁", name: "30-39岁",
value: 90, value: 90,
}, },
{ {
name: "41-50岁", name: "40-49岁",
value: 100, value: 100,
}, },
{ {
name: "51-60岁", name: "50-59岁",
value: 97, value: 97,
}, },
{ {
name: "61-70岁", name: "60-69岁",
value: 100, value: 100,
}, },
{ {
name: "71-80岁", name: "70-79岁",
value: 100, value: 100,
}, },
{ {
name: "81-90岁", name: "80-89岁",
value: 100, value: 100,
}, },
{ {
name: "91-100岁", name: "90-99岁",
value: 100, value: 100,
}, },
{ {
@ -146,17 +146,18 @@ const getOption1 = () => {
// data.list[2].value = data.list.nl3569; // data.list[2].value = data.list.nl3569;
// data.list[0].value = data.list.nl60; // data.list[0].value = data.list.nl60;
data.list[0].value = parseInt(data.list1.nl110); data.list[0].value = parseInt(data.list1.nl09);
data.list[1].value = parseInt(data.list1.nl1120); data.list[1].value = parseInt(data.list1.nl1019);
data.list[2].value = parseInt(data.list1.nl2130); data.list[2].value = parseInt(data.list1.nl2029);
data.list[3].value = parseInt(data.list1.nl3140); data.list[3].value = parseInt(data.list1.nl3039);
data.list[4].value = parseInt(data.list1.nl4150); data.list[4].value = parseInt(data.list1.nl4049);
data.list[5].value = parseInt(data.list1.nl5160); data.list[5].value = parseInt(data.list1.nl5059);
data.list[6].value = parseInt(data.list1.nl6170); data.list[6].value = parseInt(data.list1.nl6069);
data.list[7].value = parseInt(data.list1.nl7180); data.list[7].value = parseInt(data.list1.nl7079);
data.list[8].value = parseInt(data.list1.nl8190); data.list[8].value = parseInt(data.list1.nl8089);
data.list[9].value = parseInt(data.list1.nl91100); data.list[9].value = parseInt(data.list1.nl9099);
data.list[10].value = parseInt(data.list1.nl100); data.list[10].value = parseInt(data.list1.nl100);
console.log(666,data.list);
let sum = 0; let sum = 0;
@ -317,6 +318,8 @@ const setChart = () => {
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list1 = props.list; data.list1 = props.list;
console.log(777,data.list1);
getOption1(); getOption1();
getOption(); getOption();
setChart(); setChart();

View File

@ -68,19 +68,19 @@ const colorList = [
const pieData = reactive([ const pieData = reactive([
{ {
name: "61-70岁", // name: "60-69岁", //
value: 0, // value: 0, //
}, },
{ {
name: "71-80岁", name: "70-79岁",
value: 0, value: 0,
}, },
{ {
name: "81-90岁", name: "80-89岁",
value: 0, value: 0,
}, },
{ {
name: "91-100岁", name: "90-99岁",
value: 0, value: 0,
}, },
{ {
@ -561,10 +561,10 @@ const setChart = () => {
onBeforeMount(() => { onBeforeMount(() => {
setTimeout(() => { setTimeout(() => {
data.list = props.list; data.list = props.list;
pieData[0].value = data.list.nl6170; pieData[0].value = data.list.nl6069;
pieData[1].value = data.list.nl7180; pieData[1].value = data.list.nl7079;
pieData[2].value = data.list.nl8190; pieData[2].value = data.list.nl8089;
pieData[3].value = data.list.nl91100; pieData[3].value = data.list.nl9099;
pieData[4].value = data.list.nl100; pieData[4].value = data.list.nl100;
getOption(); getOption();

View File

@ -1274,29 +1274,29 @@ const getData = async () => {
"nl1834", "nl1834",
"nl3569", "nl3569",
"nl60", "nl60",
"nl110", "nl09",
"nl1120", "nl1019",
"nl2130", "nl2029",
"nl3140", "nl3039",
"nl4150", "nl4049",
"nl5160", "nl5059",
"nl6170", "nl6069",
"nl7180", "nl7079",
"nl8190", "nl8089",
"nl91100", "nl9099",
"nl100", "nl100",
]; ];
const ageBt = [ const ageBt = [
"nl110", "nl09",
"nl1120", "nl1019",
"nl2130", "nl2029",
"nl3140", "nl3039",
"nl4150", "nl4049",
"nl5160", "nl5059",
"nl6170", "nl6069",
"nl7180", "nl7079",
"nl8190", "nl8089",
"nl91100", "nl9099",
"nl100", "nl100",
]; ];
ageGroupKeys.forEach((key) => { ageGroupKeys.forEach((key) => {
@ -1757,43 +1757,43 @@ const bt = computed(() => {
}); });
const btList = ref([ const btList = ref([
{ {
name: "1-10岁人口总数", name: "0-9岁人口总数",
value: "", value: "",
}, },
{ {
name: "11-20岁人口总数", name: "10-19岁人口总数",
value: "", value: "",
}, },
{ {
name: "21-30岁人口总数", name: "20-29岁人口总数",
value: "", value: "",
}, },
{ {
name: "31-40岁人口总数", name: "30-39岁人口总数",
value: "", value: "",
}, },
{ {
name: "41-50岁人口总数", name: "40-49岁人口总数",
value: "", value: "",
}, },
{ {
name: "51-60岁人口总数", name: "50-59岁人口总数",
value: "", value: "",
}, },
{ {
name: "61-70岁人口总数", name: "60-69岁人口总数",
value: "", value: "",
}, },
{ {
name: "71-80岁人口总数", name: "70-79岁人口总数",
value: "", value: "",
}, },
{ {
name: "81-90岁人口总数", name: "80-89岁人口总数",
value: "", value: "",
}, },
{ {
name: "91-100岁人口总数", name: "90-99岁人口总数",
value: "", value: "",
}, },
{ {

View File

@ -509,10 +509,10 @@ const btList = ref([
}, },
]); ]);
const ageGroups = [ const ageGroups = [
{ ageRange: "6170", index: 0 }, { ageRange: "6069", index: 0 },
{ ageRange: "7180", index: 1 }, { ageRange: "7079", index: 1 },
{ ageRange: "8190", index: 2 }, { ageRange: "8089", index: 2 },
{ ageRange: "91100", index: 3 }, { ageRange: "9099", index: 3 },
{ ageRange: "100", index: 4 }, { ageRange: "100", index: 4 },
]; ];
// //