var w=(B,e,r)=>new Promise((p,c)=>{var h=o=>{try{m(r.next(o))}catch(f){c(f)}},_=o=>{try{m(r.throw(o))}catch(f){c(f)}},m=o=>o.done?p(o.value):Promise.resolve(o.value).then(h,_);m((r=r.apply(B,e)).next())});import{B as T}from"./TableImg.0cd3291c.js";import"./BasicForm.d58d202f.js";import{u as j}from"./useTable.578ae310.js";import{q as L,l as N}from"./busDeviceHistoryApi.2da144fb.js";import"./index.3d21a375.js";import{j as V,a as q,r as I,dP as P,p as z,aa as O,O as Q,a8 as M,o as v,Q as y,x as s,f as g,n as b,z as x,y as D,w as E,af as S,h as F}from"./index.ae52ebae.js";import{j as U}from"./Export2Excel.6e63a5d1.js";import"./index.e3129508.js";import"./eagerComputed.94e91cab.js";import"./css.bcd121de.js";import"./index.adbf62a5.js";import"./index.52c33256.js";import"./index.0321d0be.js";import"./Checkbox.919eb32a.js";import"./index.beed4ab5.js";import"./scrollTo.d4c332b7.js";import"./useForm.e55162bc.js";import"./index.11cb8430.js";import"./index.c4be8493.js";import"./index.ddcc0e35.js";import"./useSize.9b10dc05.js";import"./onMountedOrActivated.c176aad3.js";import"./useWindowSizeFn.d176b3a5.js";import"./useContentViewHeight.2a59a8a3.js";import"./ArrowLeftOutlined.0f7d1b9e.js";import"./index.a995b471.js";import"./index.14e14872.js";import"./index.4040b11d.js";import"./index.0c29338b.js";import"./index.0fe57a5b.js";import"./_baseIteratee.432be787.js";import"./get.0b1c6ac7.js";import"./DeleteOutlined.707204c0.js";import"./index.87b4cc3a.js";import"./useRefs.fe3bdf15.js";import"./Form.1cc72784.js";import"./Col.605699c9.js";import"./useFlexGapSupport.3240d255.js";import"./index.3ccc18ac.js";import"./FullscreenOutlined.b9fd5be6.js";import"./index.c1d6a1f9.js";import"./sortable.esm.c20789c1.js";import"./RedoOutlined.80b8c01a.js";import"./index.5d87e81e.js";import"./index.95f887db.js";import"./index.9e0f8a6b.js";/* empty css */import"./index.37fc506d.js";import"./index.5c0d538f.js";import"./uniqBy.7b5fdd96.js";import"./index.3eedf359.js";import"./index.3b88ad02.js";import"./useContextMenu.6088df26.js";import"./index.5e5e8ba1.js";const C=[{title:"\u6570\u636E\u7C7B\u578B",dataIndex:"alarm",width:150,slots:{customRender:"alarm"},fixed:!0},{title:"\u63A5\u6536\u65F6\u95F4",dataIndex:"uploadTime",fixed:!0,width:160},{title:"\u63D0\u9192",dataIndex:"warns",slots:{customRender:"warns"}},{title:"\u5269\u4F59\u91CF",dataIndex:"remainDose",width:100},{title:"\u5DF2\u8F93\u5165\u91CF",dataIndex:"inputDose",width:100},{title:"\u7535\u6C60\u7535\u91CF",dataIndex:"electricQuantity",width:100},{title:"\u9996\u6B21\u91CF",dataIndex:"firstDose",width:100},{title:"\u6301\u7EED\u91CF",dataIndex:"continueDose",width:100},{title:"\u8FFD\u52A0\u91CF",dataIndex:"appendDose",width:100},{title:"\u6781\u9650\u91CF",dataIndex:"maxDose",width:100},{title:"\u81EA\u63A7\u9501\u65F6",dataIndex:"selfControlLockTime",width:100},{title:"\u6709\u6548\u6B21\u6570",dataIndex:"pcaValidCount",width:100},{title:"\u65E0\u6548\u6B21\u6570",dataIndex:"pcaInvalidCount",width:100},{title:"\u603B\u6309\u6B21\u6570",dataIndex:"pcaTotalCount",width:100},{title:"\u6570\u636E\u7F16\u53F7",dataIndex:"dataNumber",width:100},{title:"SNR",dataIndex:"snr",width:80},{title:"RSSI",dataIndex:"rssi",width:80},{title:"RSRQ",dataIndex:"rsrq",width:80},{title:"RSRP",dataIndex:"rsrp",width:80},{title:"\u8FD0\u884C\u538B\u529B",dataIndex:"block1",width:80},{title:"\u975E\u8FD0\u884C\u538B\u529B",dataIndex:"block2",width:100},{title:"\u963B\u585E\u72B6\u6001",dataIndex:"blockStatus",width:100,slots:{customRender:"blockStatus"}}];const H=q({__name:"index",props:{data:{type:Object,default:()=>{}},infusion:{type:Object,default:()=>{}}},setup(B){const e=B;e.infusion[0].value.value;const r=I([]),p=I([]),c=I(null),h=I(0),{isFullscreen:_}=P(c),[m,{reload:o,setColumns:f}]=j({api:L,rowKey:"id",columns:C,showIndexColumn:!0,bordered:!0,indexColumnProps:{fixed:!0},maxHeight:150,pagination:!1,beforeFetch:k,afterFetch:R,showTableSetting:!0,tableSetting:{fullScreen:!0,redo:!0,setting:!1}});function k(t){return w(this,null,function*(){return t={page:{size:1e3,current:1,searchCount:!1},clinicId:e.data.clinicId,deviceId:e.data.deviceId,infusionId:e.data.history?e.data.infusionId:null},t})}function R(t){return p.value=t,t}z(()=>w(this,null,function*(){let t=e.infusion[0].value.value,n=[];if(t===1&&(n=C),t===2&&(n=C.concat([{title:"\u52A0\u6863\u5468\u671F",dataIndex:"flowUpCycle"},{title:"\u51CF\u6863\u5468\u671F",dataIndex:"flowDownCycle"},{title:"\u8BA1\u6B21",dataIndex:"flowCount"},{title:"\u4E0A\u9650",dataIndex:"flowUpLimit"},{title:"\u4E0B\u9650",dataIndex:"flowDownLimit"},{title:"\u81EA\u8C03\u6BD4\u4F8B",dataIndex:"flowAdjustRate"}])),t===3&&(n=C.concat([{title:"\u8109\u51B2\u91CF",dataIndex:"pulseDose"},{title:"\u8109\u51B2\u9996\u6B21\u9501\u65F6",dataIndex:"pulseFirstLockTime"},{title:"\u8109\u51B2\u9501\u65F6",dataIndex:"pulseLockTime"}])),r.value=n,f(n),e.data.history){let a=yield N(e.data.infusionId);h.value=a}})),O(e.data,t=>w(this,null,function*(){yield o()}));function A(){let t={};r.value.forEach(a=>t[a.dataIndex]=a.title);let n=p.value.map(a=>{var i,l;let d={};for(let u in t)u==="alarm"?d[u]=((i=a[u])==null?void 0:i.text)+"-"+((l=a.runState)==null?void 0:l.text):d[u]=a[u];return d});U({header:t,data:n,filename:"\u6570\u636E\u4F20\u8F93\u660E\u7EC6.xlsx"})}return(t,n)=>{const a=Q("a-button"),d=M("auth");return v(),y(F(T),{onRegister:F(m),ref_key:"wrapRef",ref:c,class:b([F(_)?"table--fullscreen":""])},{alarm:s(({record:i})=>{var l,u;return[g("span",{class:b([i.alarm.value?"color-yellow":""])},x(((l=i.alarm)==null?void 0:l.text)+"-")+" "+x((u=i.runState)==null?void 0:u.text),3)]}),blockStatus:s(({record:i})=>{var l,u;return[g("span",{class:b([(l=i.blockStatus)!=null&&l.value?"":"color-yellow"])},x((u=i.blockStatus)==null?void 0:u.text),3)]}),warns:s(({record:i})=>[D(x(i.warns),1)]),toolbar:s(()=>[e.data.history?E((v(),y(a,{key:0,type:"primary",preIcon:"ant-design:api-outlined",disabled:""},{default:s(()=>[D(" \u4E22\u5305\u7387: "+x(h.value)+"% ",1)]),_:1})),[[d,["bus:infusion:query"]]]):S("",!0),F(p).length?E((v(),y(a,{key:1,type:"primary",onClick:A,preIcon:"ant-design:download-outlined"},{default:s(()=>[D(" \u5BFC\u51FA\u8868\u683C ")]),_:1})),[[d,["bus:clinic:edit"]]]):S("",!0)]),_:1},8,["onRegister","class"])}}});var Xt=V(H,[["__scopeId","data-v-2a4c0afd"]]);export{Xt as default};