import{P as j}from"./index-B52vLzQM.js";import{C as h}from"./index-DfydRvcN.js";import{A as E}from"./index-BApXqHgh.js";import{D as S}from"./index-CfuzQhcF.js";import{d as l,o as _,c as u,g as o,_ as m,b as v,s as x,h as c,v as L,j as z,a as R,i as y}from"./index-DO6SfH87.js";import{_ as f}from"./index.vue_vue_type_script_setup_true_name_ECharts_lang-CAwyM1L_.js";import{E as s}from"./index-B9e-dLML.js";import"./index-DNrc9Gse.js";import"./installCanvasRenderer-q-7FW8Eq.js";const T={class:"data-overview"},$=l({__name:"DataOverview",props:{overviewData:{default:()=>({count:0,join_num:0,match_number:0,last_year_count:0,last_year_match_number:0,last_year_join_num:0,year_on_year_rate_join_num:"",year_on_year_rate_count:"",year_on_year_rate_match_number:""})}},setup(n){return(t,i)=>(_(),u("div",T,[o(S,{title:"民族赛事数量",value:String(t.overviewData.count),unit:"场",trend:{label:"同比",value:t.overviewData.year_on_year_rate_count},"card-type":"type2"},null,8,["value","trend"]),o(S,{title:"参与总人数",value:String(t.overviewData.join_num),unit:"人",trend:{label:"同比",value:t.overviewData.year_on_year_rate_join_num},"card-type":"type2"},null,8,["value","trend"])]))}}),I=m($,[["__scopeId","data-v-41110659"]]),O={class:"pie-chart"},N=l({__name:"EventTypePieChart",props:{chartData:{default:()=>[]}},setup(n){const t=n,i=v(()=>{const a=t.chartData.filter(r=>r.count>0);return{tooltip:{trigger:"item",formatter:"{b}: {c} ({d}%)"},legend:{orient:"horizontal",top:0,textStyle:{fontSize:12},type:"scroll"},series:[{type:"pie",radius:"55%",center:["50%","58%"],data:a.map((r,d)=>({value:r.count,name:r.name,itemStyle:{color:s[d%s.length]}})),emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:!0,formatter:`{b}
{d}%`,fontSize:11}}]}});return(a,r)=>(_(),u("div",O,[o(f,{option:i.value,height:"400"},null,8,["option"])]))}}),P=m(N,[["__scopeId","data-v-35dc429e"]]),k={class:"line-chart"},B=l({__name:"EventTrendChart",props:{chartData:{default:()=>[]}},setup(n){const t=n,i=v(()=>({tooltip:{trigger:"axis"},legend:{data:["当月场次","累计场次"],textStyle:{fontSize:12}},grid:{left:"3%",right:"4%",bottom:"3%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:t.chartData.map(a=>a.month)},yAxis:{type:"value",axisLabel:{fontSize:12}},series:[{name:"当月场次",type:"line",data:t.chartData.map(a=>a.month_match_number),smooth:!0,itemStyle:{color:s[0]},lineStyle:{width:2},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(124, 159, 244, 0.3)"},{offset:1,color:"rgba(124, 159, 244, 0.05)"}]}}},{name:"累计场次",type:"line",data:t.chartData.map(a=>a.accumulate_match_number),smooth:!0,itemStyle:{color:s[1]},lineStyle:{width:2}}]}));return(a,r)=>(_(),u("div",k,[o(f,{option:i.value,height:"400"},null,8,["option"])]))}}),H=m(B,[["__scopeId","data-v-58444d98"]]),W={class:"bar-chart"},q=l({__name:"RegionStatsChart",props:{chartData:{default:()=>[]}},setup(n){const t=n,i=v(()=>{const a=[...t.chartData].reverse();return{tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{data:["举办场次","参赛人次"],bottom:0,textStyle:{color:"rgba(144, 147, 153, 1)",fontSize:10},itemWidth:10,itemHeight:10},grid:{left:"24%",right:"3%",top:"8%",bottom:"12%"},xAxis:[{type:"value",position:"top",axisLabel:{color:"rgba(64, 158, 255, 1)",fontSize:10},splitNumber:4,splitLine:{lineStyle:{color:"rgba(144, 147, 153, 0.1)"}}},{type:"value",position:"bottom",axisLabel:{color:"rgba(255, 170, 51, 1)",fontSize:10},splitNumber:4,splitLine:{show:!1}}],yAxis:{type:"category",data:a.map(r=>r.city_name),axisLabel:{color:"rgba(144, 147, 153, 1)",fontSize:12,interval:0,align:"right",overflow:"truncate",width:90},axisLine:{lineStyle:{color:"rgba(144, 147, 153, 0.3)"}}},series:[{name:"举办场次",type:"bar",xAxisIndex:0,data:a.map(r=>r.city_count),barWidth:"30%",itemStyle:{color:s[0],borderRadius:[0,4,4,0]}},{name:"参赛人次",type:"bar",xAxisIndex:1,data:a.map(r=>r.join_num_count),barWidth:"30%",itemStyle:{color:s[1],borderRadius:[0,4,4,0]}}]}});return(a,r)=>(_(),u("div",W,[o(f,{option:i.value,height:"400"},null,8,["option"])]))}}),U=m(q,[["__scopeId","data-v-f3f4aadf"]]),V=n=>x.request({url:"eventActivity/statistics/getNationActivity",method:"post",data:n}),Y=n=>x.request({url:"eventActivity/statistics/areaSumRank",method:"post",data:n}),F={class:"page-container"},G={class:"content-container"},rt=l({__name:"index",setup(n){const t=c({areaCodes:[],areaData:{},year:new Date().getFullYear().toString()}),i=c({count:0,join_num:0,match_number:0,last_year_count:0,last_year_match_number:0,last_year_join_num:0,year_on_year_rate_join_num:"",year_on_year_rate_count:"",year_on_year_rate_match_number:""}),a=c([]),r=c([]),d=c([]),w=L(),g=e=>{const p=w.userInfo.company_area_id;return e.areaCodes[e.areaCodes.length-1]||p},b=async()=>{try{const e=await V({company_area_id:g(t.value),year:t.value.year});e.code===200&&e.data&&(i.value=e.data.total_num,a.value=e.data.type_tag_counts,r.value=e.data.match_number_trend)}catch(e){console.error("获取民族赛事活动统计失败",e)}},D=async()=>{try{const e=await Y({company_area_id:g(t.value),year:t.value.year,event_activity_type:2});e.code===200&&e.data&&(d.value=e.data)}catch(e){console.error("获取区域统计失败",e)}},A=()=>{b(),D()};return z(()=>{A()}),(e,p)=>(_(),u("div",F,[o(j),R("div",G,[o(E,{params:t.value,"onUpdate:params":p[0]||(p[0]=C=>t.value=C),"show-year-picker":!0,onSearch:b},null,8,["params"]),o(I,{"overview-data":i.value},null,8,["overview-data"]),o(h,{title:"赛事项目类型占比"},{default:y(()=>[o(P,{"chart-data":a.value},null,8,["chart-data"])]),_:1}),o(h,{title:"赛事场次增长趋势"},{default:y(()=>[o(H,{"chart-data":r.value},null,8,["chart-data"])]),_:1}),o(h,{title:"区域统计"},{default:y(()=>[o(U,{"chart-data":d.value},null,8,["chart-data"])]),_:1})])]))}});export{rt as default};
