| 1 |
- import{I as $}from"./index-f8f67ba0.js";/* empty css */import{P as E,B as I}from"./index-77cbbc02.js";/* empty css */import{S as J}from"./index-d85d298a.js";import{C as O}from"./index-04186645.js";import{T as q}from"./index-5e8d6463.js";import{F as G}from"./index-ca5d4042.js";import{d as H,r as d,B as K,o as Q,s as X,t as Y,b as s,e as a,f as e,x as g,c as i,h as _,F as L,u as Z,z as ee,k as x,C as k,D as N,A as oe}from"./index-b63c6ed2.js";import{p as te}from"./index-b05dcc4b.js";import{P as se}from"./function-call-6876fcd3.js";import{L as ne}from"./index-5062ddcf.js";import"./use-expose-fbc3766e.js";import"./on-popup-reopen-965edd2a.js";import"./constant-eba5e2d8.js";import"./axios-04d59af7.js";const le={style:{display:"flex","flex-direction":"column",height:"100vh"}},ae={style:{padding:"10px 16px 10px 16px"}},ie={style:{display:"flex","justify-content":"space-between","align-items":"center"}},ce={style:{display:"flex","align-items":"flex-end"}},de=e("div",{style:{"font-size":"20px","font-weight":"bold"}},[e("span",null,"设备")],-1),re={style:{"font-size":"0.9rem","margin-left":"5px"}},pe={style:{"background-color":"#eee","border-radius":"2.5rem",width:"0px","flex-grow":"1",margin:"0px 5px"}},_e=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),ue={style:{"text-align":"left"}},me={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},ge={style:{"font-size":"0.9rem"}},fe={key:0,style:{color:"#000"}},ve={key:1},he={style:{"font-size":"0.9rem"}},ye={style:{display:"flex","align-items":"flex-end"}},xe={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},ke={style:{"margin-left":"5px","margin-bottom":"2px"}},we={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},be={style:{"font-size":"0.9rem","margin-left":"0px"}},ze={style:{"font-size":"0.9rem","margin-left":"0px"}},Ce={style:{display:"flex","justify-content":"space-between"}},Le=["onClick"],Ne=e("div",{style:{"margin-left":"3px"}},"位置",-1),Te={key:1},Be=e("div",null,null,-1),Ve=["onClick"],Se=e("div",{style:{"margin-left":"3px"}},"传输日志",-1),Re={key:0},je={key:1,style:{"text-align":"center",padding:"20px",color:"#ccc"}},De=e("span",null,"暂无数据",-1),Me=[De],Ae={key:2,style:{"text-align":"center",padding:"20px"}},Fe={key:3,style:{"text-align":"center",padding:"20px",color:"#ccc"}},Pe=e("span",null,"没有更多了",-1),Ue=[Pe],We={key:4,style:{"text-align":"center",padding:"20px"}},$e=e("div",{style:{height:"60px"}},null,-1),lo=H({__name:"Index",setup(Ee){const f=d(!1),T=()=>{f.value=!0},w=Z(),B=o=>{console.log(o),w.push("/device/location/"+o)},V=o=>{console.log(o),w.push("/device/log/"+o)},v=d(""),l=K({total:0,pageNum:1,pageSize:10,pages:0}),u=d([]),r=d(!1),m=d(!1),S=d(!1),h=()=>{console.log("onload....."),te({url:"/device/search",data:{size:l.pageSize,page:l.pageNum,sort:"createtime",order:"desc",keyWord:v.value,mac:""}}).then(o=>{if(console.log(o),m.value=!1,r.value=!1,o.code==0){const n=o.data,p=o.total,c=Math.ceil(p/l.pageSize);console.log(c),console.log(n),l.pageNum==1&&u.value.splice(0,u.value.length),u.value.push(...n),l.pages=c,l.total=p,console.log(u.value,c)}},o=>{console.log(o),m.value=!1,r.value=!1}).catch(o=>{console.log(o),m.value=!1,r.value=!1})},b=()=>{console.log("onrefresh..."),console.log(r.value),l.pageNum=1,S.value=!1,m.value=!0,h()},R=o=>{const n=Date.parse(o);return(new Date().getTime()-n)/1e3};Q(()=>{console.log("onMounted"),h()});const y=d(null),z=d(0);X(()=>{console.log("onActived..."),oe(()=>{y.value.scrollTop=z.value})}),Y((o,n,p)=>{console.log(o,n),console.log("onBeforeRouteLeave..."),z.value=y.value.scrollTop,p()});const j=()=>{console.log("clickLoading"),l.pageNum++,m.value=!0,h()};return(o,n)=>{const p=G,c=$,C=q,D=O,M=J,A=ne,F=E,P=I,U=se;return s(),a(L,null,[e("div",le,[e("div",ae,[e("div",ie,[e("div",ce,[de,e("div",re,[e("span",null,"共"+g(l.total)+"台",1)])]),e("div",pe,[i(p,{style:{padding:"6px 16px"},modelValue:v.value,"onUpdate:modelValue":n[0]||(n[0]=t=>v.value=t),size:"normal",clearable:""},null,8,["modelValue"])]),e("div",{style:{"line-height":"0px"},onClick:b},[i(c,{name:"static/images/icon-search-black.png",size:"2rem"})]),e("div",{style:{"line-height":"0px"},onClick:T},[i(c,{name:"plus",size:"1.5rem"})])])]),e("div",{ref_key:"scrollRef",ref:y,class:"container",style:{"overflow-y":"auto","flex-grow":"1"}},[i(F,{style:{"min-height":"100%"},modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=t=>r.value=t),onRefresh:b},{default:_(()=>[(s(!0),a(L,null,ee(u.value,t=>(s(),x(M,{style:{"background-color":"#fff","margin-bottom":"10px"}},{right:_(()=>[_e]),default:_(()=>[i(D,{clickable:"",to:"/device/detail/"+t.mac},{default:_(()=>[e("div",ue,[e("div",me,[e("div",ge,[t.username?(s(),a("span",fe,g(t.username),1)):(s(),a("span",ve,"未知用户"))]),e("div",he,g(t.productName),1)]),e("div",ye,[e("div",xe,[e("span",null,g(t.mac),1)]),e("div",ke,[R(t.modifytime)<1200?(s(),x(C,{key:0,round:"",size:"medium",type:"success"},{default:_(()=>[k("在线")]),_:1})):(s(),x(C,{key:1,round:"",size:"medium",type:"danger"},{default:_(()=>[k("离线")]),_:1}))])]),e("div",we,[e("div",be,[e("span",null,g(t.createtime),1)]),e("div",ze,[e("span",null,g(t.modifytime),1)])]),e("div",Ce,[JSON.parse(t.data).lat?(s(),a("div",{key:0,style:{display:"flex",color:"#000"},onClick:N(W=>B(t.mac),["stop"])},[e("div",null,[i(c,{name:"static/images/icon-location2.png",size:"1.5rem"})]),Ne],8,Le)):(s(),a("div",Te,"暂无定位")),Be,e("div",{style:{display:"flex",color:"#000"},onClick:N(W=>V(t.mac),["stop"])},[e("div",null,[i(c,{name:"static/images/icon-log.png",size:"1.5rem"})]),Se],8,Ve)])])]),_:2},1032,["to"])]),_:2},1024))),256)),e("div",null,[r.value?(s(),a("div",Re)):u.value.length==0?(s(),a("div",je,Me)):m.value?(s(),a("div",Ae,[i(A,{type:"spinner",color:"#1989fa"})])):l.pages<=l.pageNum?(s(),a("div",Fe,Ue)):(s(),a("div",We,[e("span",{onClick:j},"点击加载")]))]),$e]),_:1},8,["modelValue"]),i(P,{target:".container",right:"5vw",bottom:"80px"})],512)]),i(U,{show:f.value,"onUpdate:show":n[2]||(n[2]=t=>f.value=t),position:"bottom",style:{height:"30%"}},{default:_(()=>[k(" 内容 ")]),_:1},8,["show"])],64)}}});export{lo as default};
|