import{E as c}from"./index.A714wFO1.js";import{c as m}from"./api.DNygNRg8.js";import{a as u,r as f,q as p,f as d,c as _,o as h,b as x,S as y,u as $}from"./vue.YrNK8sx4.js";import{u as v,a as g,g as b,c as z,d as w,h as B,f as C}from"./echarts.BvtxGb1Q.js";import{_ as D}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.BKEMpsLA.js";const E={class:"chart-container"},S=u({__name:"UtilizationTrend",setup(U){v([g,b,z,w,B,C]);const o=f([]);p(async()=>{const a=await m();a.code===2e3&&(o.value=a.data.monthly_utilization)});const r=d(()=>{const a=o.value.map(t=>t.month),e=o.value.map(t=>t.rate);console.log("rates:::",e);const i=o.value.map((t,s,n)=>s===0?0:+(t.rate-n[s-1].rate).toFixed(2));return{title:{text:"设备利用率提升幅度",left:"center"},tooltip:{trigger:"axis",formatter:t=>{const s=t[0].data,n=i[t[0].dataIndex],l=n>0?"+":"";return`
            月份：${t[0].name}<br/>
            利用率：${s}<br/>
            提升幅度：${l}${n}
          `}},xAxis:{type:"category",data:a},yAxis:{type:"value",name:"利用率"},series:[{name:"月度利用率",type:"line",data:e,smooth:!0,label:{show:!0,formatter:"{c}"},lineStyle:{color:"#5470C6"},itemStyle:{color:"#91cc75"}}]}});return(a,e)=>(h(),_("div",E,[e[0]||(e[0]=x("h3",null,"设备月度利用率变化趋势",-1)),y($(c),{option:r.value,autoresize:""},null,8,["option"])]))}}),F=D(S,[["__scopeId","data-v-99bc6591"]]);export{F as default};
