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