import{E as f}from"./index-37bf2f99-1785478469326v=1.0.0.js";import{u as h,a as m}from"./workbench-c54758ec-1785478469326v=1.0.0.js";import{x as _,r as n,h as x,c as y,al as g,y as D,z as w,A as v,Q as l,I as C,M as b,u as E}from"./vendor-46662d77-1785478469326v=1.0.0.js";import{_ as S}from"./index-5a47c360-1785478469326v=1.0.0.js";import"./eleVendor-bc05bc4d-1785478469326v=1.0.0.js";const B={class:"five-year-test-records"},A={class:"down-btn"},F=_({__name:"Top10Departments",props:{chartData:{default:[]},searForm:{default:{}},searchParam:{default:{}}},setup(i){const o=i,r=n(null),u=(t,e)=>{if(t<=e)return{show:!1,start:0,end:100};{const p=100-e/t*100;return{show:!0,start:Math.max(0,p),end:100}}};x(()=>o.chartData,()=>{const t=o.chartData.length;s.value=u(t,10)},{deep:!0});const s=n({show:!1,start:0}),c=y(()=>({grid:{left:"10%",right:"12%",top:"15%",bottom:"10%"},dataZoom:[{show:s.value.show,type:"slider",yAxisIndex:0,start:s.value.start,end:100,right:"3%",width:20,handleSize:"80%",handleStyle:{color:"#8EA9D8"},orient:"vertical"}],tooltip:{trigger:"axis",axisPointer:{type:"shadow"},formatter:function(t){return`${t[0].name}: ${t[0].value}%`}},title:{text:"\u5404\u9662\u7CFB\u4F53\u6D4B\u5408\u683C\u7387\u6392\u540D",left:"left",top:"top",padding:[15,10,0,0],textStyle:{color:"#303133",fontSize:16,fontWeight:400}},xAxis:{type:"value",min:0,max:100,axisLine:{lineStyle:{color:"#606266"}},splitLine:{show:!0,lineStyle:{color:"#E4E7ED"}},axisLabel:{formatter:t=>`${t}%`}},yAxis:{type:"category",sort:!1,data:o.chartData.map(t=>t.collegeName),axisLine:{lineStyle:{color:"#606266"}},axisTick:{show:!1},axisLabel:{show:!0,width:200,formatter:function(t){const e=r.value.getDom().offsetWidth||0;let a=4;return e<300?a=1:e<500?a=2:e<700?a=3:e<900?a=6:a=8,console.warn({containerWidth:e,dynamicCharCount:a}),t.substring(0,a)+"..."}}},series:[{name:"\u5408\u683C\u7387",type:"bar",barWidth:"12px",itemStyle:{color:"#7AA2E8"},label:{show:!0,position:"right",formatter:t=>`${t.value}%`},data:o.chartData.map(t=>t.qualifiedRate)}]})),d=()=>{h(m,"\u5404\u9662\u7CFB\u4F53\u6D4B\u5408\u683C\u7387\u6392\u540D",{...o.searForm,...o.searchParam,grade:o.searchParam.grade===-1?"":o.searchParam.grade},!0,".xlsx")};return(t,e)=>{const a=g("el-button");return D(),w("div",B,[v("div",A,[l(a,{size:"small",onClick:d},{default:C(()=>e[0]||(e[0]=[b("\u4E0B\u8F7D",-1)])),_:1,__:[0]})]),l(f,{ref_key:"echartsRef",ref:r,option:E(c)},null,8,["option"])])}}});const z=S(F,[["__scopeId","data-v-789bc50e"]]);export{z as default};
