Content-91f1db48.js 6.2 KB

1
  1. var C=(u,k,t)=>new Promise((g,I)=>{var w=o=>{try{m(t.next(o))}catch(d){I(d)}},S=o=>{try{m(t.throw(o))}catch(d){I(d)}},m=o=>o.done?g(o.value):Promise.resolve(o.value).then(w,S);m((t=t.apply(u,k)).next())});import{d as K,o as Q,f as p,c as U,w as V,x as W,Y as a,Z as i,_ as n,F as y,a8 as h,$ as b,a9 as M,a0 as x,l as Y,u as j,A as ee,a1 as te,a2 as se}from"./vue-8fccce23.js";import{l as r,av as le}from"./antd-ecb53b14.js";import{b3 as P,H as ae,ao as ie,_ as ne}from"./index.js";import{u as oe}from"./index-8cbf1e33.js";import{d as de}from"./schedulingExecApi-83226a1c.js";import ce from"./CardModal-7e9db8a1.js";import"./useWindowSizeFn-8ad2dbf2.js";import"./index-b614de6b.js";const re=u=>(te("data-v-f0687568"),u=u(),se(),u),ue={class:"detail"},me={class:"aside"},fe=re(()=>n("div",{class:"aside-item aside-item--tit"},"床位",-1)),ve=["title"],_e={class:"aside-item_robot"},pe={key:0,class:"iconfont icon-xt-dual-pump_default"},ye=["title"],he={class:"head-item_time-week"},be={class:"head-item_time-day"},ge={class:"head-item_sailings"},xe={key:0,class:"p-8"},ke={key:0,class:"flex items-center"},Ie=["onClick","onContextmenu"],Se=["title"],Ne=K({__name:"Content",props:{data:{type:Object,default:()=>{}},flag:{type:String,default:""},edit:{type:Boolean,default:!1},refresh:{type:String,default:""},bedId:{type:Array,default:()=>[]}},emits:["success"],setup(u,{emit:k}){const t=u;Q(()=>{E(),L(0,1)});const{createMessage:g,createConfirm:I}=ie(),[w,{openModal:S}]=oe(),m=p();console.log("🚀 ~ file: index.vue:181 ~ head:",m.value);const o=p();console.log("🚀 ~ file: index.vue:181 ~ bed:",o.value);const d=p();console.log("🚀 ~ file: index.vue:186 ~ cnt.value:",d.value);const D=p({}),A=p(null),F=p(null),{x:$}=P(A,{behavior:"smooth"}),{y:v}=P(document.body,{behavior:"smooth"}),{x:z}=P(F,{behavior:"smooth"}),B=U({get(){return v.value.toFixed(1)},set(e){v.value=parseFloat(e)}});function L(e,c){console.log("🚀 ~ file: index.vue:177 ~ scrollTo ~ x:",e),$.value=e>3?300:0,t.edit&&v.value>100&&(z.value=e>3?300:0),c!=null&&(v.value=(c-1)*54+(c-2)*10+(c>10?90:110))}V(()=>v.value,()=>{O()}),V(()=>t.refresh,()=>C(this,null,function*(){yield W(()=>{E()})}));function E(){d.value=[],m.value=t.data.head,o.value=t.data.bed,setTimeout(()=>{var e;console.log("props.data.cnt",t.data.cnt),d.value=((e=t.data)==null?void 0:e.cnt)&&t.data.cnt.map((c,N)=>(c.formatSailing=c.formatSailing.map((l,f)=>l.map((s,T)=>(s.date=s.time.replaceAll(/(.+)(\()(\d+\-\d+\-\d+)(\S)/gm,"$3"),s.old=r(s.date).isSame(r(),"day")?!1:!r(s.date).isAfter(r(),"day"),s.empty=!s.patientName,s.edit=!!t.bedId.length,s.error=!1,s.selected=!1,s.actived=!1,s.disabled=r(s.date).isSame(r(),"day")?!1:!r(s.date).isAfter(r(),"day"),s.x=N,s.y=f,s.z=T,s))),c)),console.log("🚀 ~ cnt.value=props.data.cnt.map ~ cnt.value:",d.value)},100)}const O=ae(()=>{t.edit&&v.value>100&&(z.value=$.value>100?107:0)},500);function X(e){if(e.disabled)return"body-list_item--disabled";if(e.empty&&e.selected&&e.edit)return"body-list_item--selected";if(e.empty&&e.actived&&e.edit)return"body-list_item--actived";if(!e.disabled&&e.empty&&e.edit)return"body-list_item--select";if(e.old)return"body-list_item--old";if(e.empty&&e.actived)return"body-list_item--actived";if(!e.name&&e.empty)return"body-list_item--empty"}function H(e){console.log("🚀 ~ file: index.vue:136 ~ data:",e),console.log("🚀 ~ handleDbPerson ~ !props.edit :",t.edit),!(!e.patientBasicId||!e.patientName)&&S(!0,{record:e,edit:!1})}function Z(e){if(console.log("🚀 ~ file: index.vue:336 ~ handlePerson ~ data:",e),!e.disabled&&!(!e.patientBasicId&&!t.edit)){if(L(e.y,null),e.patientBasicId&&t.bedId.length){I({iconType:"warning",title:`是否要清除当前患者: ${e.patientName}`,content:"清除后才能以进行新的排床",onOk:()=>C(this,null,function*(){console.log("确认"),yield de([e.sailingId]),k("success"),g.success("删除成功!")})});return}if(console.log("🚀 ~ handlePerson ~ isEdit.value:",t.edit),console.log("🚀 ~ handlePerson ~ isEdit.value:",e),t.bedId.length==1)d.value[e.x].formatSailing[e.y][e.z].selected=!0;else if(t.edit){g.error("手动模式请选择单个 排床人员");return}else{g.error("请点击鼠标右键进行查看详情");return}t.edit&&(e.patientBasicId=t.bedId[0]),setTimeout(()=>{S(!0,{record:e,edit:t.edit})},100)}}function R(){return C(this,null,function*(){yield E(),k("success",{})})}return(e,c)=>{var N;return a(),i("div",ue,[n("div",me,[fe,(a(!0),i(y,null,h(o.value,l=>(a(),i("div",{class:"mb-2 aside-item",key:l.bedId},[n("div",{class:"truncate aside-item_bed",title:l.bedName},b(l.bedName),9,ve),n("div",_e,[l.devicePumpType?(a(),i("i",pe)):M("",!0),n("span",{class:"truncate",title:l.deviceName},b(l.deviceName),9,ye)])]))),128))]),n("div",{class:"content",ref_key:"scrollEl",ref:A},[n("div",null,[n("div",{ref_key:"headEl",ref:F,class:x(["mb-2 content-head",Number(B.value)>100?"content-head--fixed":"",t.edit&&Number(B.value)>100?"content-head--edit":""])},[(a(!0),i(y,null,h(m.value,l=>(a(),i("div",{class:"head-item animate__animated animate__slideInLeft",key:l.monthDay||l.week},[n("div",{class:x(["head-item_time",l.current?"head-item_time--current":""])},[n("span",he,b(l.week),1),n("span",be,"("+b(l.monthDay)+")",1)],2),n("div",ge,[(a(!0),i(y,null,h(l.sailings,f=>(a(),i("div",{class:x(["head-item_sailings-item",D.value.sailings?"head-item_sailings-item--only":""]),key:f},b(f),3))),128))])]))),128))],2)]),n("div",{class:x(["content-body",Number(B.value)>100?"content-body--fixed":""])},[((N=d.value)==null?void 0:N.length)==0?(a(),i("div",xe,[Y(j(le))])):M("",!0),(a(!0),i(y,null,h(d.value,(l,f)=>{var s;return a(),i("div",{class:"flex mb-2",key:f},[l.bedId==((s=o.value[f])==null?void 0:s.bedId)?(a(),i("div",ke,[(a(!0),i(y,null,h(l.formatSailing,(T,q)=>(a(),i("div",{class:"body-list",key:q},[(a(!0),i(y,null,h(T,(_,G)=>(a(),i("div",{key:G,class:x(["animate__animated animate__slideInLeft","body-list_item",D.value.sailings&&_.status=="available"?"body-list_item--only":"",X(_)]),onClick:J=>Z(_),onContextmenu:ee(J=>H(_),["prevent","stop"])},[n("div",{class:"body-list_item-text",title:_.patientName},b(_.patientName),9,Se)],42,Ie))),128))]))),128))])):M("",!0)])}),128))],2)],512),Y(ce,{onRegister:j(w),onSuccess:R,onCancel:R},null,8,["onRegister"])])}}});const Fe=ne(Ne,[["__scopeId","data-v-f0687568"]]);export{Fe as default};