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