import{E as l}from"./index.A714wFO1.js";import{G as c}from"./api.DNygNRg8.js";import{u as p,a as m,b as d,c as u,d as f,f as _}from"./echarts.BvtxGb1Q.js";import{a as h,r as v,q as y,f as r,c as s,o,b as g,S as w,u as b}from"./vue.YrNK8sx4.js";import{_ as x}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.BKEMpsLA.js";const D={class:"chart-container"},k={key:0},B={key:1,class:"empty-tip"},$=h({__name:"ActiveUsersPie",setup(A){p([m,d,u,f,_]);const a=v([]);y(async()=>{const t=await c();t.code===2e3?a.value=t.data.active_users:a.value=[]});const i=r(()=>a.value.length>0),n=r(()=>{const t=a.value.map(e=>({name:e.user_name,value:e.borrow_count}));return{title:{text:"借用次数分布",left:"center"},tooltip:{trigger:"item",formatter:"{b}: {c}次 ({d}%)"},legend:{orient:"vertical",left:"left",data:t.map(e=>e.name)},series:[{name:"借用次数",type:"pie",radius:"60%",data:t,emphasis:{itemStyle:{shadowBlur:10,shadowOffsetX:0,shadowColor:"rgba(0, 0, 0, 0.5)"}}}]}});return(t,e)=>(o(),s("div",D,[e[0]||(e[0]=g("h3",null,"活跃用户 Top10 借用次数分布",-1)),i.value?(o(),s("div",k,[w(b(l),{option:n.value,autoresize:"",style:{height:"400px"}},null,8,["option"])])):(o(),s("div",B,"暂无数据"))]))}}),S=x($,[["__scopeId","data-v-7c359f81"]]);export{S as default};
