Index-c5db820c.js 8.4 KB

1
  1. import{d as X,r as a,B as Y,o as Z,s as ee,t as oe,b as r,c as n,f as c,h as te,v as se,e,x as v,F as M,u as ne,j as l,C as h,z as le,k as C,D as A,A as ie}from"./index-16aedc47.js";import{B as ae}from"./index-2c804440.js";import{P as ce}from"./index-4573f484.js";import{S as de}from"./index-2dad9477.js";import{C as re}from"./index-188028a1.js";import{T as pe}from"./index-05a06ecb.js";import{B as ue}from"./index-8a614103.js";import{F as _e}from"./index-a4e4d9e7.js";import{p as me}from"./index-45b71b48.js";import{Q as ve}from"./Index-cb2d80ea.js";import{P as fe}from"./index-0810be85.js";import{L as ge}from"./index-2b121e0e.js";import{s as he}from"./function-call-d61169bc.js";import{I as ye}from"./index-3075fd64.js";import"./use-scope-id-c38e64b2.js";import"./on-popup-reopen-b90101a6.js";import"./use-route-64216f9c.js";import"./constant-7967f80c.js";import"./axios-9cbf0d09.js";import"./vue-qrcode-reader-40aaedb2.js";import"./mount-component-060eea4b.js";const xe={style:{padding:"16px"}},ke={style:{"background-color":"#eee","border-radius":"2.5rem",margin:"0px 5px"}},we={style:{"margin-top":"16px",display:"flex"}},be={style:{"flex-grow":"1"}},ze=e("div",{style:{width:"10px"}},null,-1),Ce={style:{"flex-grow":"1"}},Se={style:{padding:"16px"}},Te={style:{position:"absolute",width:"100vw",height:"100vh",top:"0",left:"0","z-index":"99999","background-color":"#ccc"}},Be={style:{display:"flex","flex-direction":"column",height:"100vh"}},Le={style:{padding:"10px 16px 10px 16px",border:"1px solid #f0f0f0"}},Ne={style:{display:"flex","justify-content":"space-between","align-items":"center"}},Re={style:{display:"flex","align-items":"flex-end"}},Ve=e("div",{style:{"font-size":"20px","font-weight":"bold"}},[e("span",null,"设备")],-1),je={style:{"font-size":"0.9rem","margin-left":"5px"}},De=e("div",{style:{"background-color":"#eee","border-radius":"2.5rem",width:"0px","flex-grow":"1",margin:"0px 5px"}},null,-1),Me=e("div",{style:{width:"50px",height:"100%","background-color":"red",display:"flex","justify-content":"center","align-items":"center"}},[e("div",null,[e("div",{style:{color:"#fff","font-weight":"bold"}},[e("span",null,"删除")])])],-1),Ae={style:{"text-align":"left"}},Fe={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},Pe={style:{"font-weight":"bold",color:"#000"}},Qe=e("span",null,"住院号:",-1),Ue={style:{"font-size":"0.9rem"}},$e={key:0},We={key:1},Ee={style:{display:"flex","align-items":"flex-end"}},Ie={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},Je={style:{"margin-left":"5px","margin-bottom":"2px"}},Oe={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},qe={style:{"font-size":"0.9rem","margin-left":"0px"}},Ge={style:{"font-size":"0.9rem","margin-left":"0px"}},He={style:{display:"flex","justify-content":"space-between"}},Ke=["onClick"],Xe=e("div",{style:{"margin-left":"3px"}},"位置",-1),Ye={key:1},Ze=e("div",null,null,-1),eo=["onClick"],oo=e("div",{style:{"margin-left":"3px"}},"传输日志",-1),to={style:{display:"flex",color:"#000"}},so=e("div",{style:{"margin-left":"3px"}},"编辑",-1),no={key:0},lo={key:1,style:{"text-align":"center",padding:"10px 20px 20px 20px",color:"#ccc"}},io=e("span",null,"暂无数据",-1),ao=[io],co={key:2,style:{"text-align":"center",padding:"10px 20px 20px 20px"}},ro={key:3,style:{"text-align":"center",padding:"10px 20px 20px 20px",color:"#ccc"}},po=e("span",null,"没有更多了",-1),uo=[po],_o={key:4,style:{"text-align":"center",padding:"10px 20px 20px 20px"}},mo=e("div",{style:{height:"60px"}},null,-1),Fo=X({__name:"Index",setup(vo){const f=a(!1),y=a(!1),x=a(!1),F=()=>{L(),f.value=!1},w=a(1),S=t=>{w.value=t,y.value=!1,x.value=!0,T.value.open()},T=a(),P=t=>{console.log(t),x.value=!1,w.value==1?k.value=t[0]:w.value==2&&(console.log(t),he(t[0]))},Q=()=>{x.value=!1},B=ne(),U=t=>{console.log(t),B.push("/device/location/"+t)},$=t=>{console.log(t),B.push("/device/log/"+t)},k=a(""),d=Y({total:0,pageNum:1,pageSize:10,pages:0}),_=a([]),u=a(!1),m=a(!1),W=a(!1),b=()=>{console.log("onload....."),me({url:"/device/search",data:{size:d.pageSize,page:d.pageNum,sort:"createtime",order:"desc",keyWord:k.value,mac:""}}).then(t=>{if(console.log(t),m.value=!1,u.value=!1,t.code==0){const o=t.data,i=t.total,g=Math.ceil(i/d.pageSize);console.log(g),console.log(o),d.pageNum==1&&_.value.splice(0,_.value.length);for(let p=0;p<o.length;p++)o[p].data=JSON.parse(o[p].data);_.value.push(...o),d.pages=g,d.total=i,console.log(_.value,g)}},t=>{console.log(t),m.value=!1,u.value=!1}).catch(t=>{console.log(t),m.value=!1,u.value=!1})},L=()=>{console.log("onrefresh..."),console.log(u.value),d.pageNum=1,W.value=!1,m.value=!0,b()},E=t=>{const o=Date.parse(t);return(new Date().getTime()-o)/1e3};Z(()=>{console.log("onMounted"),b()});const z=a(null),N=a(0);ee(()=>{console.log("onActived..."),ie(()=>{z.value.scrollTop=N.value})}),oe((t,o,i)=>{console.log(t,o),console.log("onBeforeRouteLeave..."),N.value=z.value.scrollTop,i()});const I=()=>{console.log("clickLoading"),d.pageNum++,m.value=!0,b()};return(t,o)=>{const i=ye,g=_e,p=ue,R=fe,V=pe,J=re,O=de,q=ge,G=ce,H=ae;return l(),r(M,null,[n(R,{show:f.value,"onUpdate:show":o[3]||(o[3]=s=>f.value=s),position:"top","close-on-click-overlay":!0},{default:c(()=>[e("div",xe,[e("div",ke,[n(g,{style:{padding:"6px 16px",height:"44px","line-height":"25px","align-items":"center"},modelValue:k.value,"onUpdate:modelValue":o[1]||(o[1]=s=>k.value=s),size:"normal",clearable:""},{"right-icon":c(()=>[e("div",null,[n(i,{name:"scan",size:"1.5rem",onClick:o[0]||(o[0]=s=>S(1))})])]),_:1},8,["modelValue"])]),e("div",we,[e("div",be,[n(p,{type:"warning",size:"normal",round:"",block:"",onClick:o[2]||(o[2]=()=>{f.value=!1})},{default:c(()=>[h("取消")]),_:1})]),ze,e("div",Ce,[n(p,{type:"primary",size:"normal",round:"",block:"",onClick:F},{default:c(()=>[h("搜索")]),_:1})])])])]),_:1},8,["show"]),n(R,{show:y.value,"onUpdate:show":o[5]||(o[5]=s=>y.value=s),position:"top"},{default:c(()=>[e("div",Se,[e("div",null,[n(p,{type:"primary",size:"normal",icon:"scan",round:"",block:"",onClick:o[4]||(o[4]=s=>S(2))},{default:c(()=>[h("扫码添加设备")]),_:1})])])]),_:1},8,["show"]),te(e("div",Te,[n(ve,{ref_key:"scanQR",ref:T,onSuccess:P,onClose:Q},null,512)],512),[[se,x.value]]),e("div",Be,[e("div",Le,[e("div",Ne,[e("div",Re,[Ve,e("div",je,[e("span",null,"共"+v(d.total)+"台",1)])]),De,e("div",{style:{"line-height":"0px"},onClick:o[6]||(o[6]=()=>{f.value=!0})},[n(i,{name:"static/images/icon-search-black.png",size:"2rem"})]),e("div",{style:{"line-height":"0px","margin-left":"10px"},onClick:o[7]||(o[7]=()=>{y.value=!0})},[n(i,{name:"static/images/icon-more.png",size:"1.5rem"})])])]),e("div",{ref_key:"scrollRef",ref:z,class:"container",style:{"overflow-y":"auto","flex-grow":"1"}},[n(G,{style:{"min-height":"100%"},modelValue:u.value,"onUpdate:modelValue":o[8]||(o[8]=s=>u.value=s),onRefresh:L},{default:c(()=>[(l(!0),r(M,null,le(_.value,s=>(l(),C(O,{style:{"background-color":"#fff","margin-bottom":"10px"}},{right:c(()=>[Me]),default:c(()=>[n(J,{clickable:!0,to:"/device/detail/"+s.mac},{default:c(()=>{var j,D;return[e("div",Ae,[e("div",Fe,[e("div",Pe,[Qe,e("span",null,v((j=s.data)==null?void 0:j.patientCode.value),1)]),e("div",Ue,[s.username?(l(),r("span",$e,v(s.username),1)):(l(),r("span",We,"未绑定"))])]),e("div",Ee,[e("div",Ie,[e("span",null,v(s.mac),1)]),e("div",Je,[E(s.modifytime)<1200?(l(),C(V,{key:0,round:"",size:"medium",type:"success"},{default:c(()=>[h("在线")]),_:1})):(l(),C(V,{key:1,round:"",size:"medium",type:"danger"},{default:c(()=>[h("离线")]),_:1}))])]),e("div",Oe,[e("div",qe,[e("span",null,v(s.productName),1)]),e("div",Ge,[e("span",null,v(s.modifytime),1)])]),e("div",He,[(D=s.data)!=null&&D.lat?(l(),r("div",{key:0,style:{display:"flex",color:"#000"},onClick:A(K=>U(s.mac),["stop"])},[e("div",null,[n(i,{name:"static/images/icon-location2.png",size:"1.5rem"})]),Xe],8,Ke)):(l(),r("div",Ye,"暂无定位")),Ze,e("div",{style:{display:"flex",color:"#000"},onClick:A(K=>$(s.mac),["stop"])},[e("div",null,[n(i,{name:"static/images/icon-log.png",size:"1.5rem"})]),oo],8,eo),e("div",to,[e("div",null,[n(i,{name:"static/images/icon-edit.png",size:"1.5rem"})]),so])])])]}),_:2},1032,["to"])]),_:2},1024))),256)),e("div",null,[u.value?(l(),r("div",no)):_.value.length==0?(l(),r("div",lo,ao)):m.value?(l(),r("div",co,[n(q,{type:"spinner",color:"#1989fa"})])):d.pages<=d.pageNum?(l(),r("div",ro,uo)):(l(),r("div",_o,[e("span",{onClick:I},"点击加载")]))]),mo]),_:1},8,["modelValue"]),n(H,{target:".container",right:"5vw",bottom:"80px"})],512)])],64)}}});export{Fo as default};