import{e as S}from"./index-5c7e7a37.js";import{u as w,r as m,A,o as I,B as z,f as v,a as B,c as G,h as r,t as D,g as n,w as s,v as F,x as O}from"./index-ad591d72.js";import{_ as E}from"./_plugin-vue_export-helper-c27b6911.js";import"./request-2786ead7.js";import"./axios-4a70c6fc.js";const g=i=>(F("data-v-332b3051"),i=i(),O(),i),k={class:"card",style:{"padding-bottom":"100px"}},H={class:"title"},N=g(()=>r("div",{id:"genderChart",style:{height:"100%"}},null,-1)),M=g(()=>r("div",{id:"contestChart",style:{height:"100%"}},null,-1)),W=g(()=>r("div",{id:"ageGroupChart",style:{height:"100%"}},null,-1)),R=g(()=>r("div",{id:"nationChart",style:{height:"100%"}},null,-1)),V={__name:"statistics",setup(i){const{t:a,locale:b}=w(),l=m([]),C=m([]),y=m({}),_=m({});let c=A().appContext.config.globalProperties.$echarts,d,p,u,h;const x=()=>{S().then(e=>{console.log(e),e.pGenderCounts&&(localStorage.getItem("lang")=="zh"?l.value=e.pGenderCounts.map(t=>{if(t.name==="M")return{...t,name:"男"};if(t.name==="F")return{...t,name:"女"};if(t.name==="男")return{...t,name:"男"};if(t.name==="女")return{...t,name:"女"}}):l.value=e.pGenderCounts.map(t=>{if(t.name==="M")return{...t,name:"Male"};if(t.name==="F")return{...t,name:"Female"};if(t.name==="男")return{...t,name:"Male"};if(t.name==="女")return{...t,name:"Female"}}),console.log(l.value),C.value=e.pContestCounts,y.value=e.nationCounts,_.value=e.ageGroupChartData,d.setOption({title:{text:a("chipCheck.GenderDivision"),left:"center"},textStyle:{fontFamily:"Roboto, SourceHanSansCNs, Arial, Helvetica, sans-serif"},tooltip:{trigger:"item"},legend:{orient:"horizontal",left:"center",top:"bottom"},color:["#17609a","#91cd77","#ef6567","#f9c956","#75bedc"],series:[{type:"pie",radius:"50%",data:l.value,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}：{c}，{d}%",fontWeight:"normal",fontSize:15}}]}),p.setOption({title:{text:a("chipCheck.subitem"),left:"center"},textStyle:{fontFamily:"Roboto, SourceHanSansCNs, Arial, Helvetica, sans-serif"},tooltip:{trigger:"item"},legend:{orient:"horizontal",left:"center",top:"bottom"},color:["#17609a","#91cd77","#ef6567","#f9c956","#75bedc"],series:[{type:"pie",radius:"50%",data:C.value,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}：{c}，{d}%",fontWeight:"normal",fontSize:15}}]}),u.setOption({title:{text:a("participants.subnationality"),left:"center"},textStyle:{fontFamily:"Roboto, SourceHanSansCNs, Arial, Helvetica, sans-serif"},tooltip:{trigger:"item"},legend:{orient:"horizontal",left:"center",top:"bottom"},color:["#17609a","#91cd77","#ef6567","#f9c956","#75bedc","#37A2DA","#32C5E9","#E062AE","#FFDB5C","#ff9f7f","#eeeeee"],series:[{type:"pie",radius:"50%",data:y.value,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{formatter:"{b}：{c}，{d}%",fontWeight:"normal",fontSize:15}}]}),h.setOption({title:{text:a("overview.byAge"),left:"center"},textStyle:{fontFamily:"Roboto, SourceHanSansCNs, Arial, Helvetica, sans-serif"},xAxis:{type:"category",data:_.value.ageGroupData},yAxis:{type:"value"},legend:{data:["Forest","Steppe","Desert","Wetland"]},series:[{barWidth:40,data:_.value.ageGroupValues,type:"bar",showBackground:!0,backgroundStyle:{color:"rgba(180, 180, 180, 0.2)"},label:{show:!0,position:"top",fontSize:"15px",color:"#000",formatter:"{c}"},itemStyle:{color:function(t){var o=["#37A2DA","#32C5E9","#5470c6","#91cd77","#ef6567","#f9c956","#75bedc","#17609a"];return o[t.dataIndex]}}}]}),window.onresize=()=>{d.resize(),p.resize(),u.resize(),h.resize()})})};return I(()=>{const e=document.getElementById("genderChart");d=c.init(e);const t=document.getElementById("contestChart");p=c.init(t);const o=document.getElementById("nationChart");u=c.init(o);const f=document.getElementById("ageGroupChart");h=c.init(f),x()}),z(()=>b.value,()=>{d.setOption({title:{text:a("chipCheck.GenderDivision"),left:"center"}}),p.setOption({title:{text:a("chipCheck.subitem"),left:"center"}}),u.setOption({title:{text:a("participants.subnationality"),left:"center"}}),h.setOption({title:{text:a("overview.byAge"),left:"center"}})}),(e,t)=>{const o=v("el-col"),f=v("el-row");return B(),G("div",k,[r("div",H,D(e.$t("overview.statisticalData")),1),n(f,{style:{height:"300px","margin-top":"20px"}},{default:s(()=>[n(o,{span:12,style:{height:"100%"}},{default:s(()=>[N]),_:1}),n(o,{span:12},{default:s(()=>[M]),_:1})]),_:1}),n(f,{style:{height:"300px","margin-top":"100px"}},{default:s(()=>[n(o,{span:12},{default:s(()=>[W]),_:1}),n(o,{span:12},{default:s(()=>[R]),_:1})]),_:1})])}}},J=E(V,[["__scopeId","data-v-332b3051"]]);export{J as default};
