import{E as x}from"./index-37bf2f99-1785478469326v=1.0.0.js";import{x as D,r as m,c as A,al as N,y as S,z as F,A as p,L as g,Q as n,I as h,M as v,n as V}from"./vendor-46662d77-1785478469326v=1.0.0.js";import{_ as T}from"./index-5a47c360-1785478469326v=1.0.0.js";import"./eleVendor-bc05bc4d-1785478469326v=1.0.0.js";const z={class:"outContainer"},R={class:"header-controls"},k={class:"chart-type-selector"},w={class:"chart-container"},L=D({__name:"CourseDistributionChart",props:{height:{default:"100%"},chartData:{default:()=>({synSumCourseNameRespVOS:[],synSumSiteNameRespVOS:[]})}},setup(B){const c=B,d=m("course"),_=m(null),E=m(400),y=u=>{E.value=u>8?u*30+100:400,V(()=>{var t;(t=_.value)==null||t.resize()})},b=A(()=>{var f,C;const u=d.value==="course";let t="",s="",r="",l=[],i=[];if(c.chartData,u){t="\u8BFE\u7A0B\u9879\u76EE\u5206\u5E03\u60C5\u51B5-\u5404\u7C7B\u8BFE\u7A0B\u9879\u76EE\u73ED\u7EA7\u6570\u91CF\u6392\u540D",s="\u4E2A\u6570",r="#52A1FF";let a=((f=c.chartData)==null?void 0:f.synSumCourseNameRespVOS)||[];a=a.sort(function(e,o){return e.classTotalNum-o.classTotalNum}),l=a.map(e=>{var o;return((o=e.courseName)==null?void 0:o.length)>15?e.courseName.slice(0,15)+"...":e.courseName}),i=a.map(e=>e.classTotalNum)}else{t="\u4E0A\u8BFE\u5730\u70B9\u5206\u5E03\u60C5\u51B5-\u5404\u7C7B\u4E0A\u8BFE\u5730\u70B9\u73ED\u7EA7\u6570\u91CF\u6392\u540D",s="\u4E2A\u6570",r="#67C23A";let a=((C=c.chartData)==null?void 0:C.synSumSiteNameRespVOS)||[];a=a.sort(function(e,o){return e.classTotalNum-o.classTotalNum}),l=a.map(e=>{var o;return((o=e.siteName)==null?void 0:o.length)>15?e.siteName.slice(0,15)+"...":e.siteName}),i=a.map(e=>e.classTotalNum)}return y(i.length),{title:{text:t,padding:[15,15,0,0],textStyle:{color:"#303133",fontSize:16,fontWeight:400}},grid:{top:60,right:40,bottom:15,left:"15%",containLabel:!0},tooltip:{trigger:"axis",axisPointer:{type:"shadow"}},xAxis:{type:"value",name:s,axisLabel:{formatter:"{value}"}},yAxis:{type:"category",data:l,axisLabel:{fontSize:12,interval:0,color:"#606266"}},series:[{name:s,type:"bar",data:i,label:{show:!0,position:"right",formatter:"{c}",fontSize:12},itemStyle:{color:r,borderRadius:[0,4,4,0]},barWidth:20}]}});return(u,t)=>{const s=N("el-radio-button"),r=N("el-radio-group");return S(),F("div",z,[p("div",R,[g(' <el-button class="download-btn" size="small" @click="downloadChart">\u4E0B\u8F7D</el-button> '),p("div",k,[n(r,{modelValue:d.value,"onUpdate:modelValue":t[0]||(t[0]=l=>d.value=l),size:"small"},{default:h(()=>[n(s,{label:"course",value:"course"},{default:h(()=>t[1]||(t[1]=[v("\u8BFE\u7A0B\u9879\u76EE\u5206\u5E03",-1)])),_:1,__:[1]}),n(s,{label:"site",value:"site"},{default:h(()=>t[2]||(t[2]=[v("\u4E0A\u8BFE\u5730\u70B9\u5206\u5E03",-1)])),_:1,__:[2]})]),_:1},8,["modelValue"])])]),p("div",w,[g(" {{ echartHeight }} "),n(x,{ref_key:"echartsRef",ref:_,option:b.value,height:E.value},null,8,["option","height"])])])}}});const M=T(L,[["__scopeId","data-v-4e3d1646"]]);export{M as default};
