import{a as T}from"./index-BlRdZdal.js";import{D as m}from"./index-CfuzQhcF.js";import{d as v,o as d,c as p,g as r,_,b as h,v as C,h as u,j as Y,a as R,i as y}from"./index-DO6SfH87.js";import{P as $}from"./index-B52vLzQM.js";import{C as f}from"./index-DfydRvcN.js";import{A as L}from"./index-BApXqHgh.js";import{_ as g}from"./index.vue_vue_type_script_setup_true_name_ECharts_lang-CAwyM1L_.js";import{E as l}from"./index-B9e-dLML.js";import"./index-DNrc9Gse.js";import"./installCanvasRenderer-q-7FW8Eq.js";const N={class:"data-overview"},z=v({__name:"DataOverview",props:{overviewData:{}},setup(c){const e=a=>a===0?"0":a>0?`+${a}`:`${a}`;return(a,t)=>(d(),p("div",N,[r(m,{title:"总服务时长",value:String(a.overviewData.totalActivityDuration),unit:"小时",trend:{label:"同比",value:a.overviewData.lastYearTotalActivityDurationRate},"card-type":"type2"},null,8,["value","trend"]),r(m,{title:"总服务人数",value:String(a.overviewData.totalJoinNum),trend:{label:"同比",value:e(a.overviewData.diffYearTotalJoinNum)},"card-type":"type2"},null,8,["value","trend"]),r(m,{title:"人均服务时长",value:String(a.overviewData.avgActivityDuration),unit:"小时",trend:{label:"同比",value:e(a.overviewData.lastYearAvgActivityDurationRate)},"card-type":"type2"},null,8,["value","trend"]),r(m,{title:"服务项目数",value:String(a.overviewData.totalServiceTag),trend:{label:"同比",value:e(a.overviewData.diffTotalServiceTag)},"card-type":"type2"},null,8,["value","trend"])]))}}),J=_(z,[["__scopeId","data-v-9e5a30f1"]]),P={class:"bar-chart"},k=v({__name:"PersonnelAreaChart",props:{chartData:{}},setup(c){const e=c,a=h(()=>({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{data:["国家级","一级","二级","三级"],top:0,textStyle:{fontSize:12}},grid:{left:"3%",right:"4%",bottom:"3%",top:"40px",containLabel:!0},xAxis:{type:"category",data:e.chartData.map(t=>t.area_name),axisLabel:{fontSize:11,margin:15,rotate:45,formatter:t=>t.length>3?`${t.slice(0,3)}...`:t,interval:0,overflow:"truncate",width:60}},yAxis:{type:"value",axisLabel:{fontSize:12}},series:[{name:"国家级",type:"bar",stack:"total",data:e.chartData.map(t=>t.national),itemStyle:{color:l[0]}},{name:"一级",type:"bar",stack:"total",data:e.chartData.map(t=>t.level1),itemStyle:{color:l[1]}},{name:"二级",type:"bar",stack:"total",data:e.chartData.map(t=>t.level2),itemStyle:{color:l[2]}},{name:"三级",type:"bar",stack:"total",data:e.chartData.map(t=>t.level3),itemStyle:{color:l[3]}}]}));return(t,n)=>(d(),p("div",P,[r(g,{option:a.value,height:"300"},null,8,["option"])]))}}),O=_(k,[["__scopeId","data-v-5214104e"]]),I={class:"bar-chart"},E=v({__name:"ServiceDurationChart",props:{chartData:{}},setup(c){const e=c,a=h(()=>({tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},legend:{top:"5%",data:["服务时长(小时)"]},grid:{left:"3%",right:"4%",bottom:"3%",top:"15%",containLabel:!0},xAxis:{type:"category",data:e.chartData.map(t=>t.name),axisLabel:{fontSize:11,margin:15,rotate:45,formatter:t=>t.length>3?`${t.slice(0,3)}...`:t,interval:0,overflow:"truncate",width:60}},yAxis:{type:"value",axisLabel:{fontSize:12}},series:[{name:"服务时长(小时)",type:"bar",data:e.chartData.map(t=>t.value),itemStyle:{color:new Function(`return {
  type: "linear",
  x: 0,
  y: 0,
  x2: 0,
  y2: 1,
  colorStops: [{
    offset: 0, color: "#7c9ff4"
  }, {
    offset: 1, color: "#a0b9f6"
  }]
}`)()},barWidth:"40%"}]}));return(t,n)=>(d(),p("div",I,[r(g,{option:a.value,height:"300"},null,8,["option"])]))}}),V=_(E,[["__scopeId","data-v-bbbadbde"]]),j={class:"line-chart"},B=v({__name:"ResourceDistributionChart",props:{chartData:{}},setup(c){const e=c,a=h(()=>({tooltip:{trigger:"axis"},legend:{data:["志愿者数","活跃度"],top:0,textStyle:{fontSize:12}},grid:{left:"3%",right:"4%",bottom:"3%",top:"15%",containLabel:!0},xAxis:{type:"category",data:e.chartData.map(t=>t.region.replace("市","")),boundaryGap:!1,axisLabel:{fontSize:11,margin:15,rotate:45,formatter:t=>t.length>3?`${t.slice(0,3)}...`:t,interval:0,overflow:"truncate",width:60}},yAxis:{type:"value",axisLabel:{fontSize:12}},series:[{name:"志愿者数",type:"line",data:e.chartData.map(t=>t.volunteer_count),smooth:!0,itemStyle:{color:l[0]},lineStyle:{color:l[0]},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:e.chartData.map(t=>t.active_count),smooth:!0,showSymbol:!0,symbolSize:8,itemStyle:{color:l[1]},lineStyle:{color:l[1]},areaStyle:{color:{type:"linear",x:0,y:0,x2:0,y2:1,colorStops:[{offset:0,color:"rgba(137, 168, 244, 0.3)"},{offset:1,color:"rgba(137, 168, 244, 0.05)"}]}}}]}));return(t,n)=>(d(),p("div",j,[r(g,{option:a.value,height:"300"},null,8,["option"])]))}}),F=_(B,[["__scopeId","data-v-56a15529"]]),H={class:"page-container"},U={class:"content-container"},G=v({__name:"index",setup(c){const e=C(),a=new Date().getFullYear().toString(),t=u(e.userInfo.company_area_id||""),n=u({areaCodes:[t.value],areaData:{},year:a}),D=u({totalActivityDuration:0,lastYearTotalActivityDurationRate:"",totalJoinNum:0,lastYearTotalJoinNumRate:"",avgActivityDuration:0,lastYearAvgActivityDurationRate:"",totalServiceTag:0,lastTotalServiceTagRate:"",diffTotalServiceTag:0,diffYearAvgActivityDuration:0,diffYearTotalJoinNum:0}),S=u([]),b=u([]),A=u([]),x=async()=>{let w=n.value.areaCodes.length;const s=await T({company_area_id:n.value.areaCodes[w-1],year:n.value.year});if(s.code===200&&s.data){const o=s.data;D.value={totalActivityDuration:o.total_activity_duration,lastYearTotalActivityDurationRate:o.last_year_total_activity_duration_rate,totalJoinNum:o.total_join_num,lastYearTotalJoinNumRate:o.last_year_total_join_num_rate,avgActivityDuration:o.avg_activity_duration,lastYearAvgActivityDurationRate:o.last_year_avg_activity_duration_rate,totalServiceTag:o.total_service_tag,lastTotalServiceTagRate:o.last_total_service_tag_rate,diffTotalServiceTag:o.diff_total_service_tag,diffYearAvgActivityDuration:o.diff_year_avg_activity_duration,diffYearTotalJoinNum:o.diff_year_total_join_num},S.value=o.service_people_area.map(i=>({area_name:i.area_name.replace("市",""),total_num:i.total_num,national:i.national,level1:i.level1,level2:i.level2,level3:i.level3})),b.value=o.service_duration_area.map(i=>({name:i.region.replace("市",""),value:i.service_hours})),A.value=o.service_activity_num_area.map(i=>({region:i.region,volunteer_count:i.volunteer_count,active_count:i.active_count}))}};return Y(()=>{x()}),(w,s)=>(d(),p("div",H,[r($),R("div",U,[r(L,{params:n.value,"onUpdate:params":s[0]||(s[0]=o=>n.value=o),"show-year-picker":!0,onSearch:x},null,8,["params"]),r(J,{"overview-data":D.value},null,8,["overview-data"]),r(f,{title:"服务人员区域分布"},{default:y(()=>[r(O,{"chart-data":S.value},null,8,["chart-data"])]),_:1}),r(f,{title:"服务时长区域分布"},{default:y(()=>[r(V,{"chart-data":b.value},null,8,["chart-data"])]),_:1}),r(f,{title:"志愿服务资源分布",desc:"各区域志愿者数量与活跃度对比"},{default:y(()=>[r(F,{"chart-data":A.value},null,8,["chart-data"])]),_:1})])]))}}),ot=_(G,[["__scopeId","data-v-151bdced"]]);export{ot as default};
