Index-9beaa1b3.js 12 KB

1
  1. import{d as G,r,u as H,j as c,b as g,c as s,f as i,e,J as Z,s as j,h as ee,v as te,t as a,y as W,F as E,w as oe,o as le,B as se,k as A,x as ne,C as q}from"./index-ddf66cb5.js";import{B as ie}from"./index-58f6bbe0.js";import{P as ae}from"./index-4290e6be.js";import{S as de}from"./index-14ec4a94.js";import{C as re}from"./index-e270b3af.js";import{B as K}from"./index-f37a4c38.js";import{F as X}from"./index-a7cc295e.js";import{p as D}from"./index-f5e64579.js";import{C as pe}from"./CusNavigation-52f261c8.js";import{t as ce}from"./index-9c8b4e4e.js";import{T as ue}from"./index-5dd3016f.js";import{Q as ve}from"./Index-1db8dda2.js";import{I as Y}from"./index-e9453d64.js";import{P as me}from"./index-c1d3cef3.js";import{s as fe}from"./function-call-0875a39e.js";import"./index-856231c7.js";import"./use-scope-id-7611483c.js";import"./on-popup-reopen-8ab517b6.js";import"./use-route-0a2b7081.js";import"./axios-1779699b.js";import"./vue-qrcode-reader-1a1b35e0.js";import"./mount-component-8daea98e.js";const ye={style:{padding:"16px"}},ge={style:{"background-color":"#eee","border-radius":"2.5rem",margin:"0px 5px"}},xe={style:{"margin-top":"16px",display:"flex"}},_e={style:{"flex-grow":"1"}},he={style:{"flex-grow":"1"}},we={style:{position:"fixed",width:"100vw",height:"100vh",top:"0",left:"0","z-index":"999999","background-color":"#ccc"}},be={style:{display:"flex","justify-content":"space-between",padding:"0px 16px","margin-top":"10px"}},ke={style:{"font-weight":"bold"}},ze={key:0},$e={key:1,style:{color:"#888"}},Ce={style:{"margin-top":"10px",padding:"0px 10px"}},je={style:{"background-color":"#eee",padding:"10px 6px","border-radius":"10px"}},Se={style:{display:"flex","justify-content":"space-between"}},Ne={style:{"font-weight":"bold"}},Pe={style:{display:"flex","justify-content":"space-between","font-size":"0.9rem",color:"#888","margin-top":"5px"}},Ve={style:{"font-weight":"bold"}},Be={style:{"margin-top":"10px",padding:"0px 10px"}},Ie={style:{"background-color":"#eee",padding:"10px 6px","border-radius":"10px"}},Re={style:{display:"flex","align-items":"center","line-height":"0"}},Te={style:{"font-weight":"bold"}},Fe={style:{"margin-left":"5px"}},Oe={style:{display:"flex","justify-content":"space-between","font-size":"0.9rem",color:"#888","margin-top":"5px"}},De={style:{"font-weight":"bold"}},Ee={style:{padding:"0px 16px","margin-top":"30px"}},Je={style:{display:"flex"}},Le={style:{width:"0px","flex-grow":"1",display:"flex"}},Qe={style:{width:"0px","flex-grow":"1"}},Ue={style:{width:"0px","flex-grow":"1",display:"flex"}},Me={style:{width:"0px","flex-grow":"1"}},We={style:{display:"flex","margin-top":"50px"}},Ae={style:{width:"0px","flex-grow":"1",display:"flex","justify-content":"center"}},qe={key:1,style:{display:"flex",color:"#888"}},Ge={style:{width:"0px","flex-grow":"1",display:"flex","justify-content":"center"}},He=G({__name:"Pump",props:{device:{type:Object,default:void 0}},setup(d){const z=r(""),x=r(!1),B=r(),$=p=>{console.log(p),x.value=!1,z.value=p[0]},F=()=>{x.value=!1},h=r(!1),w=()=>{x.value=!0,B.value.open()},O=()=>{},v=H(),b=p=>{console.log(p),v.push("/device/location/"+p)},k=p=>{console.log(p),v.push("/device/log/"+p)},S=r(!1),C=()=>{h.value=!0,S.value=!1},I=()=>{h.value=!0,S.value=!0};return(p,o)=>{var u,_,N,R,T,n,J,L,Q,U,M;const m=Y,l=X,t=K,f=me,y=ue;return c(),g(E,null,[s(f,{show:h.value,"onUpdate:show":o[2]||(o[2]=P=>h.value=P),position:"top","close-on-click-overlay":!0},{default:i(()=>[e("div",ye,[e("div",ge,[s(l,{style:{padding:"6px 16px",height:"44px","line-height":"25px","align-items":"center"},modelValue:z.value,"onUpdate:modelValue":o[0]||(o[0]=P=>z.value=P),size:"normal",clearable:""},Z({_:2},[S.value?{name:"right-icon",fn:i(()=>[e("div",null,[s(m,{name:"scan",size:"1.5rem",onClick:w})])]),key:"0"}:void 0]),1032,["modelValue"])]),e("div",xe,[e("div",_e,[s(t,{type:"warning",size:"normal",round:"",block:"",onClick:o[1]||(o[1]=()=>{h.value=!1})},{default:i(()=>o[5]||(o[5]=[j("取消")])),_:1})]),o[7]||(o[7]=e("div",{style:{width:"10px"}},null,-1)),e("div",he,[s(t,{type:"primary",size:"normal",round:"",block:"",onClick:O},{default:i(()=>o[6]||(o[6]=[j("确定")])),_:1})])])])]),_:1},8,["show"]),ee(e("div",we,[s(ve,{ref_key:"scanQR",ref:B,onSuccess:$,onClose:F},null,512)],512),[[te,x.value]]),e("div",null,[e("div",be,[e("div",ke,[o[8]||(o[8]=e("span",null,"设备别名:",-1)),(u=d.device)!=null&&u.data.name?(c(),g("span",ze,a((_=d.device)==null?void 0:_.data.name.value),1)):(c(),g("span",$e,"未命名"))]),e("div",null,[s(m,{name:"edit",color:"green",onClick:C})])]),e("div",Ce,[e("div",je,[e("div",Se,[e("div",Ne,[o[9]||(o[9]=e("span",null,"住院号:",-1)),e("span",null,a((N=d.device)==null?void 0:N.data.patientCode.value),1)]),e("div",null,[s(m,{name:"edit",color:"green",onClick:I})])]),e("div",Pe,[e("div",Ve,[e("span",null,a((R=d.device)==null?void 0:R.username),1)]),e("div",null,[e("span",null,a((T=d.device)==null?void 0:T.modifytime),1)])])])]),e("div",Be,[e("div",Ie,[e("div",Re,[e("div",Te,[e("span",null,a((n=d.device)==null?void 0:n.mac),1)]),e("div",Fe,[s(y,{round:"",size:"medium",type:"success"},{default:i(()=>o[10]||(o[10]=[j("在线")])),_:1})])]),e("div",Oe,[e("div",De,[e("span",null,a((J=d.device)==null?void 0:J.productName),1)]),e("div",null,[e("span",null,a((L=d.device)==null?void 0:L.createtime),1)])])])]),e("div",Ee,[e("div",Je,[e("div",Le,[o[12]||(o[12]=e("div",{style:{width:"0px","flex-grow":"1"}},[e("span",null,"总量")],-1)),e("div",Qe,[e("span",null,a((Q=d.device)==null?void 0:Q.data.totalDose.value),1),o[11]||(o[11]=e("span",null,"ml",-1))])]),e("div",Ue,[o[14]||(o[14]=e("div",{style:{width:"0px","flex-grow":"1"}},[e("span",null,"已输入量")],-1)),e("div",Me,[e("span",null,a((U=d.device)==null?void 0:U.data.finishDose.value),1),o[13]||(o[13]=e("span",null,"ml",-1))])])])]),e("div",We,[e("div",Ae,[(M=d.device)!=null&&M.data.lat?(c(),g("div",{key:0,style:{display:"flex",color:"#000"},onClick:o[3]||(o[3]=W(P=>{var V;return b((V=d.device)==null?void 0:V.mac)},["stop"]))},[e("div",null,[s(m,{name:"static/images/icon-location2.png",size:"1.5rem"})]),o[15]||(o[15]=e("div",{style:{"margin-left":"3px"}},"位置",-1))])):(c(),g("div",qe,[e("div",null,[s(m,{name:"static/images/icon-location2.png",size:"1.5rem"})]),o[16]||(o[16]=e("div",{style:{"margin-left":"3px"}},"位置",-1))]))]),e("div",Ge,[e("div",{style:{display:"flex",color:"#000"},onClick:o[4]||(o[4]=W(P=>{var V;return k((V=d.device)==null?void 0:V.mac)},["stop"]))},[e("div",null,[s(m,{name:"static/images/icon-log.png",size:"1.5rem"})]),o[17]||(o[17]=e("div",{style:{"margin-left":"3px"}},"日志",-1))])])])])],64)}}}),Ke={style:{display:"flex","flex-direction":"column",height:"100vh"}},Xe={style:{padding:"16px"}},Ye={style:{"background-color":"#eee","border-radius":"2.5rem",margin:"0px 5px"}},Ze={style:{"margin-top":"16px",display:"flex"}},et={style:{"flex-grow":"1"}},tt={style:{"flex-grow":"1"}},ot={style:{padding:"16px"}},lt={style:{"margin-top":"10px"}},st={class:"container",style:{"overflow-y":"auto","flex-grow":"1","background-color":"#F7F8FA"}},nt={style:{"text-align":"left"}},it={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},at={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},dt={style:{display:"flex","justify-content":"space-between"}},rt={style:{"font-weight":"bold","font-size":"0.9rem",height:"31px"}},pt={style:{"text-align":"left"}},ct={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},ut={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},vt={key:0,style:{"margin-left":"5px"}},mt={style:{"font-size":"0.9rem"}},ft={style:{display:"flex","justify-content":"space-between"}},yt={style:{"font-weight":"bold","font-size":"0.9rem"}},gt={style:{display:"flex",color:"#000"}},xt={key:0},_t={key:1,style:{"text-align":"center",padding:"20px",color:"#ccc"}},Qt=G({__name:"Index",setup(d){const z=r(!1),x=r(!0),B=()=>{x.value=!x.value,z.value=!x.value,$.value.closePlusPopup()},$=r(),F=()=>{console.log("jjj"),I(),$.value.closeSearchPopup()},h=()=>{$.value.closeSearchPopup()},w=r(!1),O=()=>{console.log("onrefresh..."),console.log(w.value),p(),w.value=!1},v=r(),b=r(),k=r([]),S=l=>{var f;const t=(f=b.value)==null?void 0:f.model;for(let y=0;y<t.length;y++){const u=t[y];if(l==u.title)return u}},C=r(""),I=function(){var t;k.value=[];const l=(t=v.value)==null?void 0:t.data;for(const f in l){const y=S(f);if(Object.prototype.hasOwnProperty.call(l,f)&&y){const u=l[f],_={name:y.name,value:u.value,date:ce(u.time),model:y};C.value?JSON.stringify(_).includes(C.value)&&k.value.push(_):k.value.push(_)}}},p=async()=>{await D({url:"/device/search",data:{size:200,page:1,sort:"createtime",order:"desc",keyWord:m.value}}).then(l=>l.data[0].data?(v.value=l.data[0],v.value.data=JSON.parse(l.data[0].data),console.log(v.value),Promise.resolve(v.value)):(v.value={data:[]},Promise.reject("ok"))).then(l=>(console.log(l.productId),b.value?(console.log("else..........."),Promise.reject("ok")):(b.value={id:"",name:l.productName,model:[]},D({url:"/model/search",data:{size:200,page:1,sort:"code",order:"asc",productId:l.productId}})))).then(l=>(console.log(l),l.data.forEach(t=>{t.define=JSON.parse(t.define),b.value.model.push(t)}),D({url:"/model/searchCommon",data:{size:200,page:1,sort:"code",order:"asc"}}))).then(l=>{console.log(l),l.data.forEach(t=>{t.define=JSON.parse(t.define),b.value.model.push(t)})}).catch(l=>{l!="ok"&&(console.log(l),fe(l))}),I()},o=H(),m=r("");return oe(()=>o.currentRoute.value.params,(l,t)=>{console.log("路由参数发生了变化",l,t),l.deviceId&&(m.value=l.deviceId,p())}),le(()=>{m.value=o.currentRoute.value.params.deviceId,p()}),(l,t)=>{const f=Y,y=X,u=K,_=re,N=de,R=ae,T=ie;return c(),g("div",Ke,[s(se(pe),{ref_key:"cusNavigation",ref:$,gobackabled:"",title:"设备详情",searchabled:z.value,plusabled:""},{search:i(()=>[e("div",Xe,[e("div",Ye,[s(y,{style:{padding:"6px 16px",height:"44px","line-height":"25px","align-items":"center"},modelValue:C.value,"onUpdate:modelValue":t[0]||(t[0]=n=>C.value=n),size:"normal",clearable:""},{"right-icon":i(()=>[e("div",null,[s(f,{name:"scan",size:"1.5rem"})])]),_:1},8,["modelValue"])]),e("div",Ze,[e("div",et,[s(u,{type:"primary",size:"normal",round:"",block:"",onClick:F},{default:i(()=>t[2]||(t[2]=[j("搜索")])),_:1})]),t[4]||(t[4]=e("div",{style:{width:"10px"}},null,-1)),e("div",tt,[s(u,{type:"warning",size:"normal",round:"",block:"",onClick:h},{default:i(()=>t[3]||(t[3]=[j("取消")])),_:1})])])])]),plus:i(()=>[e("div",ot,[e("div",lt,[s(u,{type:"primary",size:"normal",round:"",block:"",onClick:B},{default:i(()=>t[5]||(t[5]=[j("切换布局")])),_:1})])])]),_:1},8,["searchabled"]),e("div",st,[s(R,{style:{"min-height":"100%"},modelValue:w.value,"onUpdate:modelValue":t[1]||(t[1]=n=>w.value=n),onRefresh:O},{default:i(()=>[x.value?(c(),A(He,{key:0,device:v.value},null,8,["device"])):(c(),g(E,{key:1},[s(N,{style:{"background-color":"#fff","margin-bottom":"10px"}},{default:i(()=>[s(_,{clickable:""},{default:i(()=>{var n;return[e("div",nt,[e("div",it,[e("div",at,[e("span",null,a(m.value),1)]),t[6]||(t[6]=e("div",{style:{"font-size":"0.9rem"}},"设备编号",-1))]),e("div",dt,[e("div",rt,[e("span",null,a((n=v.value)==null?void 0:n.modifytime),1)])])])]}),_:1})]),_:1}),(c(!0),g(E,null,ne(k.value,n=>(c(),A(N,{style:{"background-color":"#fff","margin-bottom":"10px"}},{default:i(()=>[s(_,{clickable:""},{default:i(()=>[e("div",pt,[e("div",ct,[e("div",ut,[e("span",null,a(n.value),1),n.model.type=="enum"?(c(),g("span",vt,[t[7]||(t[7]=e("span",null,"(",-1)),e("span",null,a(n.model.define.range[n.value]),1),t[8]||(t[8]=e("span",null,")",-1))])):q("",!0)]),e("div",mt,a(n.name),1)]),e("div",ft,[e("div",yt,[e("span",null,a(n.date),1)]),e("div",gt,[e("div",null,[s(f,{name:"static/images/icon-check.png",size:"1.5rem"})]),t[9]||(t[9]=e("div",{style:{"margin-left":"3px","font-size":"1rem"}},"查看数据",-1))])])])]),_:2},1024)]),_:2},1024))),256)),e("div",null,[w.value?(c(),g("div",xt)):k.value.length==0?(c(),g("div",_t,t[10]||(t[10]=[e("span",null,"暂无数据",-1)]))):q("",!0)])],64))]),_:1},8,["modelValue"]),s(T,{target:".container",right:"5vw",bottom:"80px"})])])}}});export{Qt as default};