var v=(n,o,s)=>new Promise((l,r)=>{var d=t=>{try{u(s.next(t))}catch(i){r(i)}},c=t=>{try{u(s.throw(t))}catch(i){r(i)}},u=t=>t.done?l(t.value):Promise.resolve(t.value).then(d,c);u((s=s.apply(n,o)).next())});import{u as B}from"./useECharts.514ffc33.js";import{c as D}from"./busClinicApi.3d8324ac.js";import{a as C,bR as F,r as e,l as g,p as E,o as A,e as S,ag as w}from"./index.ae52ebae.js";const P=C({__name:"index",props:{width:{type:String,default:"100%"},height:{type:String,default:"400px"},data:{type:Object,default:()=>{}}},setup(n){const o=n,{hasPermission:s}=F(),l=e(null),{setOptions:r}=B(l),d=e([]),c=e([]),u=e([]),t=e([]),i=e([]),h=e([]),p=e(),f=g();return E(()=>v(this,null,function*(){const a=yield D({validCount:!0,inValidCount:!0,inputDose:!0,clinicId:o.data.clinicId,deviceId:o.data.deviceId,infusionId:o.data.history?o.data.infusionId:null});u.value=a.inputDose||[],d.value=a.inValidCount||[],c.value=a.validCount||[],t.value=a.uploadTimes||[],i.value=a.block1||[],h.value=a.block2||[],p.value=u.value.length>10?80:0;const m=f.getUserInfo.isSys||0,b=s("bus:clinic:charts");let y=[{name:"\u81EA\u63A7\u6709\u6548\u6B21\u6570",type:"line",symbolSize:10,symbol:"circle",label:{show:!0,position:"top"},data:c.value||[]},{name:"\u81EA\u63A7\u65E0\u6548\u6B21\u6570",type:"line",symbol:"triangle",symbolSize:10,label:{show:!0,position:"top"},data:d.value||[]},{name:"\u5DF2\u8F93\u5165\u91CF",type:"line",symbol:"rect",symbolSize:10,label:{show:!0,position:"top"},data:u.value||[]}];(m||b)&&(y.push({name:"\u8FD0\u884C\u538B\u529B",type:"line",symbol:"diamond",symbolSize:10,label:{show:!0,position:"top"},data:i.value||[0]}),y.push({name:"\u975E\u8FD0\u884C\u538B\u529B",type:"line",label:{show:!0,position:"top"},symbol:"noDiamond",data:h.value||[]})),r({tooltip:{trigger:"axis"},title:{text:"\u8F93\u6CE8\u8FC7\u7A0B\u6298\u7EBF\u56FE"},legend:{data:m||b?["\u81EA\u63A7\u6709\u6548\u6B21\u6570","\u81EA\u63A7\u65E0\u6548\u6B21\u6570","\u5DF2\u8F93\u5165\u91CF","\u8FD0\u884C\u538B\u529B","\u975E\u8FD0\u884C\u538B\u529B"]:["\u81EA\u63A7\u6709\u6548\u6B21\u6570","\u81EA\u63A7\u65E0\u6548\u6B21\u6570","\u5DF2\u8F93\u5165\u91CF"],left:"right"},grid:{left:"8%",right:"8%",bottom:"10%",containLabel:!0},xAxis:{type:"category",boundaryGap:!1,data:t.value},yAxis:{type:"value"},dataZoom:[{type:"inside",start:p.value,end:100},{start:p.value,end:100}],series:y})})),(a,m)=>(A(),S("div",{ref_key:"chartRef",ref:l,style:w({height:n.height,width:n.width})},null,4))}});export{P as default};