You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
2.9 KiB
1 lines
2.9 KiB
import{d as B,ax as g,r as z,G as I,a as u,c as _,b as v,q as n,e as y,f as m,F as w,g as b,n as L,O as S,h as p,t as x,au as M,cP as q,aB as D,aq as N,ap as P,aE as A,aA as F,p as G,m as R,_ as U}from"./index-e450010e.js";const W=a=>(G("data-v-75a71c92"),a=a(),R(),a),$=W(()=>n("div",{class:"glm-title"},[n("span",{class:"bt"},"部室、中心、分厂离职率(%)")],-1)),j={class:"echarts-btn-box"},H=["id"],Q={class:"legend-box"},T=["title"],X=B({__name:"groupdimratepie",props:{id:{type:String,default:"barChart"},className:{type:String,default:""},width:{type:String,default:"100%",required:!0},height:{type:String,default:"200px",required:!0}},setup(a){const C=a,r=g([]),d=new Array,f=z(),s=g({});let c=g([]);function k(){M({id:313}).then(({data:l})=>{f.value=l,s.id=l.current}).finally(()=>{h()})}function h(){q(s).then(l=>{if(l.code==0){d.splice(0,d.length),r.splice(0,r.length),l.data.list.forEach(o=>{r.push({name:o.orgname,value:o.odds}),d.push({name:o.orgname,value:o.odds})});const e=D(document.getElementById(C.id));e.setOption(E),c=e.getOption().color,window.addEventListener("resize",()=>{e.resize()})}}).finally(()=>{})}const E={title:{text:"部室、中心、分厂离职率(%)",left:"center",show:!1},tooltip:{trigger:"item"},legend:{show:!1,orient:"vertical",right:"0",itemWidth:10,itemHeight:10,icon:"circle",data:r,top:"20",textStyle:{rich:{a:{width:"50px",fontSize:12,display:"inline-block",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",padding:[0,10,0,0]},b:{fontSize:12,backgroundColor:"transparent",align:"right",fontWeight:"bold",padding:[0,0,0,0]}}},formatter:function(l){let e;return d.forEach(o=>{l===o.name&&(e=o.value)}),[`{a|${l}}{b|${e}%}`].join("")}},grid:{left:"0",top:"30px",right:"0"},series:[{type:"pie",center:["25%","50%"],radius:["35%","55%"],data:d,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}},label:{show:!1}}]};return I(()=>{k()}),(l,e)=>{const o=N,V=P,O=A,Y=F;return u(),_(Y,{shadow:"never",style:{position:"relative"}},{default:v(()=>[$,n("div",j,[y(V,{modelValue:s.id,"onUpdate:modelValue":e[0]||(e[0]=t=>s.id=t),clearable:"",placeholder:"Select",onChange:h},{default:v(()=>{var t;return[(u(!0),m(w,null,b((t=f.value)==null?void 0:t.list,i=>(u(),_(o,{key:i.id,label:i.name,value:i.id},null,8,["label","value"]))),128))]}),_:1},8,["modelValue"]),y(O,{modelValue:s.time,"onUpdate:modelValue":e[1]||(e[1]=t=>s.time=t),type:"month",format:"YYYY-MM","value-format":"YYYY-MM",placeholder:"请选择时间",onChange:h},null,8,["modelValue"])]),n("div",{id:a.id,class:L(a.className),style:S({height:a.height,width:a.width})},null,14,H),n("div",Q,[n("div",null,[(u(!0),m(w,null,b(r,(t,i)=>(u(),m("div",{key:i},[n("i",{class:"legend-icon",style:S({background:[...p(c),...p(c),...p(c),...p(c)][i]})},null,4),n("span",{title:t.name},x(t.name),9,T),n("b",null,x(t.value)+"%",1)]))),128))])])]),_:1})}}});const K=U(X,[["__scopeId","data-v-75a71c92"]]);export{K as default};
|
|
|