import{E as c}from"./index.D6H9PPaW.js";import{c as m}from"./api.JeMNPeN4.js";import{u,a as f,k as p,c as d,d as _,j as h,f as x}from"./echarts.Bm4fHez2.js";import{a as y,r as $,q as v,f as b,c as g,o as z,b as k,S as w,u as B}from"./vue.D1BjjNmv.js";import{_ as C}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.Df8UJ10K.js";const D={class:"chart-container"},E=y({__name:"UtilizationTrend",setup(S){u([f,p,d,_,h,x]);const o=$([]);v(async()=>{const a=await m();a.code===2e3&&(o.value=a.data.monthly_utilization)});const r=b(()=>{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)=>(z(),g("div",D,[e[0]||(e[0]=k("h3",null,"设备月度利用率变化趋势",-1)),w(B(c),{option:r.value,autoresize:""},null,8,["option"])]))}}),q=C(E,[["__scopeId","data-v-99bc6591"]]);export{q as default};
