import{d as x,b as C,o as d,c as b,g as m,_ as I,h as l,v as N,j as R,a as h,i as T,f as v}from"./index-DO6SfH87.js";import{E as w}from"./index-CauMwNF7.js";import{P as L}from"./index-B52vLzQM.js";import{C as P}from"./index-DfydRvcN.js";import{A as k}from"./index-BApXqHgh.js";import{_ as O}from"./index.vue_vue_type_script_setup_true_name_ECharts_lang-CAwyM1L_.js";import{E as S}from"./index-B9e-dLML.js";import{b as z}from"./fitnessMeasureApi-BPdMaL-v.js";import"./use-id-BMybvBFC.js";import"./index-DNrc9Gse.js";import"./installCanvasRenderer-q-7FW8Eq.js";const H={class:"chart-container"},B=x({__name:"HistoricalTrendChart",props:{years:{default:()=>[]},dimensions:{default:()=>[]}},setup(_){const i=_,s=["#5470c6","#91cc75","#fac858","#ee6666","#73c0de","#3ba272","#fc8452","#9a60b4","#ea7ccc","#48b8d0","#ff7f50","#87cefa","#da70d6","#32cd32"],o=C(()=>({color:s,tooltip:{trigger:"axis",axisPointer:{type:"cross"}},legend:{type:"scroll",top:0,textStyle:{fontSize:12},pageTextStyle:{fontSize:12},pageIconSize:12},grid:{left:"3%",right:"4%",bottom:0,top:"15%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:i.years,axisLabel:{fontSize:12}},yAxis:{type:"value",axisLabel:{fontSize:12}},series:i.dimensions.map((n,c)=>({name:n.name,type:"line",data:n.data,itemStyle:{color:S[c%S.length]}}))}));return(n,c)=>(d(),b("div",H,[m(O,{option:o.value,height:"400"},null,8,["option"])]))}}),$=I(B,[["__scopeId","data-v-950aa142"]]),F={class:"page-container"},G={class:"content-container"},M={class:"search-container"},U=x({__name:"index",setup(_){const i=[{field:"age3",name:"3岁组"},{field:"age4",name:"4岁组"},{field:"age5",name:"5岁组"},{field:"age6",name:"6岁组"},{field:"age2024",name:"20-24岁"},{field:"age2529",name:"25-29岁"},{field:"age3034",name:"30-34岁"},{field:"age3539",name:"35-39岁"},{field:"age4044",name:"40-44岁"},{field:"age4549",name:"45-49岁"},{field:"age5054",name:"50-54岁"},{field:"age5559",name:"55-59岁"},{field:"age6064",name:"60-64岁"},{field:"age6569",name:"65-69岁"}],s=l([]),o=l(!1),n=l(5),c=new Date().getFullYear().toString(),f=l({areaCodes:[],areaData:{},year:c}),Y=e=>new Date().getFullYear()-e,p=C(()=>{const e=s.value.map(t=>String(t.year)),a=i.map(t=>({name:t.name,data:s.value.map(r=>Number(r[t.field]||0))}));return{years:e,dimensions:a}}),A=N(),E=(e,a,t)=>{const{areaCodes:r,areaData:y}=e,g={provinceId:r[0]||A.userInfo.company_area_id,areaIdLevel:r.length||1,year:Y(n.value),page:a,size:t};return y.city&&(g.cityId=Number(r[1])),y.district&&(g.districtId=Number(r[2])),g},u=async()=>{var e;try{o.value=!0;const a=E(f.value,1,100),t=await z(a);s.value=((e=t.data)==null?void 0:e.list)||[]}catch(a){console.log("获取历年统计数据失败:",a),s.value=[]}finally{o.value=!1}},D=e=>{n.value=e,u()};return R(()=>{u()}),(e,a)=>{const t=w;return d(),b("div",F,[m(L),h("div",G,[h("div",M,[m(k,{params:f.value,"onUpdate:params":a[0]||(a[0]=r=>f.value=r),"show-year-picker":!1,"show-year-range-filter":!0,"default-year-range":n.value,onSearch:u,onYearRangeChange:D},null,8,["params","default-year-range"])]),m(P,{title:"历年统计趋势"},{default:T(()=>[!o.value&&p.value.years.length===0?(d(),v(t,{key:0,description:"暂无数据"})):(d(),v($,{key:1,years:p.value.years,dimensions:p.value.dimensions},null,8,["years","dimensions"]))]),_:1})])])}}}),te=I(U,[["__scopeId","data-v-36fd20e4"]]);export{te as default};
