UtilizationTrend.DtRlnJy_.js 1.4 KB

12345
  1. import{E as c}from"./index.DQ04k8aE.js";import{c as m}from"./api.BBzwq2yl.js";import{u,a as f,j as p,c as d,d as _,h,f as x}from"./echarts.DTyPNLGI.js";import{a as y,r as $,q as v,f as b,c as g,o as z,b as w,S as B,u as C}from"./vue.YrNK8sx4.js";import{_ as D}from"./_plugin-vue_export-helper.DlAUqK2U.js";import"./index.CzsJjcs4.js";const E={class:"chart-container"},S=y({__name:"UtilizationTrend",setup(U){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`
  2. 月份:${t[0].name}<br/>
  3. 利用率:${s}<br/>
  4. 提升幅度:${l}${n}
  5. `}},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",E,[e[0]||(e[0]=w("h3",null,"设备月度利用率变化趋势",-1)),B(C(c),{option:r.value,autoresize:""},null,8,["option"])]))}}),q=D(S,[["__scopeId","data-v-99bc6591"]]);export{q as default};