import{E as _}from"./index.A714wFO1.js";import{b as h}from"./api.DNygNRg8.js";import{u as f,a as y,g as w,c as b,d as k,h as g,f as x}from"./echarts.BvtxGb1Q.js";import{a as C,r as u,w as B,q as $,f as d,c as l,o as n,b as r,R as D,a9 as E,S as T,u as z,G as A,Q as G}from"./vue.YrNK8sx4.js";import{_ as N}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.BKEMpsLA.js";const R={class:"chart-container"},S={class:"filter-bar"},V=["onClick"],q={key:0},F={key:1,class:"empty-tip"},I=C({__name:"BorrowTrendsChart",setup(L){f([y,w,b,k,g,x]);const p=[{label:"近一周",value:"week"},{label:"近一个月",value:"month"},{label:"近一年",value:"year"}],i=u("week"),a=u([]),c=async()=>{const s=await h();s.code===2e3?a.value=s.data.trends:a.value=[]};B(i,c),$(c);const m=d(()=>a.value.length>0),v=d(()=>{const s=a.value.map(e=>e.date),o=a.value.map(e=>e.borrow_count),t=a.value.map(e=>e.total_duration);return{tooltip:{trigger:"axis"},legend:{data:["借用次数","使用时长"]},xAxis:{type:"category",data:s},yAxis:{type:"value",name:"数量"},series:[{name:"借用次数",type:"line",data:o,smooth:!0},{name:"使用时长",type:"line",data:t,smooth:!0}]}});return(s,o)=>(n(),l("div",R,[o[0]||(o[0]=r("div",{class:"panel-title"},[r("div",{class:"title"},"整体设备借用次数趋势")],-1)),r("div",S,[(n(),l(D,null,E(p,t=>r("button",{key:t.value,class:A({active:i.value===t.value}),onClick:e=>i.value=t.value},G(t.label),11,V)),64))]),m.value?(n(),l("div",q,[T(z(_),{option:v.value,autoresize:"",style:{height:"360px"}},null,8,["option"])])):(n(),l("div",F,"暂无数据"))]))}}),K=N(I,[["__scopeId","data-v-488330a4"]]);export{K as default};
