var I=(F,w,r)=>new Promise((_,f)=>{var D=a=>{try{u(r.next(a))}catch(p){f(p)}},o=a=>{try{u(r.throw(a))}catch(p){f(p)}},u=a=>a.done?_(a.value):Promise.resolve(a.value).then(D,o);u((r=r.apply(F,w)).next())});import{j as R,a as b,dv as k,r as C,o as v,Q as S,x as s,i as h,h as n,y as M,z as m,e as B,f as x,n as T,R as N}from"./index.ae52ebae.js";import{P as q}from"./index.87b4cc3a.js";import{B as V}from"./TableImg.0cd3291c.js";import{T as j}from"./BasicForm.d58d202f.js";import{u as H}from"./useTable.578ae310.js";import{u as P,a as Q,B as U}from"./index.3ccc18ac.js";import{f as c}from"./busClinicApi.3d8324ac.js";import{M as z}from"./index.6ba04408.js";import"./useRefs.fe3bdf15.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"./Form.1cc72784.js";import"./Col.605699c9.js";import"./useFlexGapSupport.3240d255.js";import"./index.c1d6a1f9.js";import"./sortable.esm.c20789c1.js";import"./RedoOutlined.80b8c01a.js";import"./FullscreenOutlined.b9fd5be6.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";import"./useECharts.514ffc33.js";const L=[{title:"\u7ED3\u675F",dataIndex:"finished",fixed:!0,width:60,slots:{customRender:"finished"}},{title:"\u6CF5\u53F7",dataIndex:"deviceId",fixed:!0,width:150},{title:"\u4F4F\u9662\u53F7",dataIndex:"patientCode",fixed:!0,width:100,slots:{customRender:"patientCode"}},{title:"\u5206\u7C7B\u53F7",dataIndex:"classification",fixed:!0},{title:"\u75C5\u533A",dataIndex:"ward"},{title:"\u5E8A\u53F7",dataIndex:"bedNo",width:80},{title:"\u8BBE\u5907",dataIndex:"type",slots:{customRender:"type"},width:80},{title:"\u6709\u6548/\u65E0\u6548",dataIndex:"pca",width:100,slots:{customRender:"pca"}},{title:"\u6301\u7EED\u91CF",dataIndex:"continueDose",slots:{customRender:"continueDose"},width:80},{title:"\u72B6\u6001",dataIndex:"runState",slots:{customRender:"runState"},width:100},{title:"\u62A5\u8B66",dataIndex:"alarm",slots:{customRender:"alarm"},width:100},{title:"\u63D0\u9192",dataIndex:"warns",slots:{customRender:"warns"}},{title:"\u8F93\u6DB2\u8FDB\u5EA6",dataIndex:"progress",slots:{customRender:"progress"},width:120},{title:"\u5F00\u59CB\u65F6\u95F4",dataIndex:"startTime",width:160,fixed:"right",sorter:!0},{title:"\u6700\u540E\u4E0A\u4F20\u65F6\u95F4",dataIndex:"lastUploadTime",width:160,fixed:"right",sorter:!0},{title:"\u603B\u91CF",dataIndex:"totalDose",width:80},{title:"\u7535\u91CF",dataIndex:"electricQuantity"},{title:"\u9996\u6B21\u91CF",dataIndex:"firstDose"},{title:"\u5DF2\u8F93\u5165\u91CF",dataIndex:"inputDose"},{title:"\u6781\u9650\u91CF",dataIndex:"maxDose"},{title:"\u81EA\u8C03\u6BD4\u4F8B",dataIndex:"flowAdjustRate",defaultHidden:!0},{title:"\u81EA\u63A7\u6B21\u6570",dataIndex:"selfControlCount",defaultHidden:!0},{title:"\u81EA\u63A7\u9501\u65F6",dataIndex:"selfControlLockTime",defaultHidden:!0},{title:"\u64A4\u6CF5\u4EBA",dataIndex:"undoBy"},{title:"\u89C1\u8BC1\u4EBA",dataIndex:"witnesses"},{title:"\u9500\u6BC1\u4EBA",dataIndex:"destroyer"}];const $={key:0},O={key:1,class:"color-green"},W=["onClick"],G={class:"table-item__label"},J=b({__name:"infusionCount",setup(F){const w=k(),[r,{openModal:_}]=P(),f=C("\u8F93\u6CE8\u4FE1\u606F"),D=C(),o=C(),u=C([]),[a]=Q(t=>I(this,null,function*(){o.value=t.clinicId,u.value=[],D.value=t.evalData.total;for(let e of t.evalData.records)u.value.push({type:e.type.text,deviceId:e.deviceId,patientCode:e.patientCode,patientId:e.patientId,totalDose:e.totalDose,finished:e.finished,firstDose:e.firstDose,continueDose:e.continueDose,classification:e.classification,ward:e.ward,bedNo:e.bedNo,pcaValidCount:e.pcaValidCount,pcaInvalidCount:e.pcaInvalidCount,clinicId:e.clinicId,runState:e.runState,alarm:e.alarm,warns:e.warns,inputDose:e.inputDose,lastUploadTime:e.lastUploadTime,electricQuantity:e.electricQuantity,maxDose:e.maxDose,flowAdjustRate:e.flowAdjustRate,selfControlCount:e.selfControlCount,selfControlLockTime:e.selfControlLockTime,undoBy:e.undoBy,witnesses:e.witnesses,destroyer:e.destroyer,startTime:e.startTime})})),[p,{setTableData:l}]=H({columns:L,maxHeight:500,showIndexColumn:!0,sortFn:g,indexColumnProps:{fixed:!0},actionColumn:{auth:["bus:pump:edit","bus:pump:remove"],title:"\u64CD\u4F5C",width:60,dataIndex:"action",slots:{customRender:"action"}}});function g(t){return I(this,null,function*(){if(t.field==="startTime")if(t.order==="ascend"){let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}],orders:[{field:"start_time",direction:"ASC"}]});l(e.records)}else if(t.order==="descend"){let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}],orders:[{field:"start_time",direction:"DESC"}]});l(e.records)}else{let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}]});l(e.records)}if(t.field==="lastUploadTime")if(t.order==="ascend"){let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}],orders:[{field:"last_upload_time",direction:"ASC"}]});l(e.records)}else if(t.order==="descend"){let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}],orders:[{field:"last_upload_time",direction:"DESC"}]});l(e.records)}else{let e=yield c({type:"and",wheres:[{column:"clinic_id",value:o.value,termType:"eq"}]});l(e.records)}})}function E(t){_(!0,{record:t})}function A(t){w.push({path:"/infusion/infusionDetail",query:{monitorType:1,history:1,patientCode:t.patientCode,patientId:t.patientId,clinicId:t.clinicId,infusionId:t.id}})}return(t,e)=>(v(),S(n(U),N(t.$attrs,{onRegister:n(a),title:f.value,width:"90%",height:760,showCancelBtn:!1,showOkBtn:!1,useWrapper:!1}),{default:s(()=>[h(n(V),{onRegister:n(p),"data-source":u.value},{pca:s(({record:i})=>[M(m(i.pcaValidCount)+"/"+m(i.pcaInvalidCount),1)]),finished:s(({record:i})=>[i.finished?(v(),B("span",$," \u5DF2\u7ED3\u675F ")):(v(),B("span",O," \u672A\u7ED3\u675F "))]),continueDose:s(({record:i})=>[x("div",{onClick:d=>E(i),class:"pointer table-item"},[x("div",G,m(i.continueDose)+" ml/h ",1)],8,W)]),runState:s(({record:i})=>{var d;return[x("span",{class:T([((d=i.runState)==null?void 0:d.value)==5?"color-yellow":""])},m(i.runState.text),3)]}),alarm:s(({record:i})=>{var d,y;return[x("span",{class:T([(d=i.alarm)!=null&&d.value?"color-yellow":""])},m((y=i.alarm)==null?void 0:y.text),3)]}),progress:s(({record:i})=>[h(n(q),{percent:Number((i.inputDose/i.totalDose*100).toFixed(2)),size:"small",status:"active",strokeColor:Number((i.inputDose/i.totalDose*100).toFixed(2))>99?"#f8af4e":"#6cd761"},null,8,["percent","strokeColor"])]),action:s(({record:i})=>[h(n(j),{actions:[{auth:["bus:pump:edit"],tooltip:"\u8BE6\u60C5",label:"\u8BE6\u60C5",onClick:A.bind(null,i)}]},null,8,["actions"])]),_:1},8,["onRegister","data-source"]),h(n(z),{onRegister:n(r)},null,8,["onRegister"])]),_:1},16,["onRegister","title"]))}});var Xe=R(J,[["__scopeId","data-v-46f70ba9"]]);export{Xe as default};