Index-248734c3.js 4.8 KB

1
  1. import{I as B}from"./index-c2909177.js";import{P as C,B as T}from"./index-46efa2bb.js";import{L as V}from"./index-29e84163.js";import{S as j}from"./index-8665d1db.js";import{C as D}from"./index-b2f82041.js";import{p as I,T as M}from"./index-5b9c5591.js";import{d as F,l as P,r as m,o as R,b as o,e as d,f as e,c as i,h as _,F as q,k as A,n as u,t as g,q as h}from"./index-e4df6086.js";import"./use-route-01d6b0b1.js";import"./axios-12198959.js";import"./interceptor-9a671ee0.js";const E={style:{display:"flex","flex-direction":"column",height:"100vh"}},U={style:{padding:"10px 16px 10px 16px"}},W={style:{display:"flex","justify-content":"space-between","align-items":"center"}},G=e("div",{style:{"font-size":"20px","font-weight":"bold"}},[e("span",null,"设备")],-1),H={style:{"line-height":"0px"}},J={class:"container",style:{"overflow-y":"auto",flex:"1"}},K=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),O={style:{"text-align":"left"}},Q={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},X={style:{color:"#000","font-size":"0.9rem"}},Y={style:{"font-size":"0.9rem"}},Z={style:{display:"flex","align-items":"flex-end"}},$={style:{color:"#000","font-weight":"bold","font-size":"1.1rem"}},ee={style:{"margin-left":"5px","margin-bottom":"2px"}},te={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},oe={style:{"font-size":"0.9rem","margin-left":"0px"}},se={style:{"font-size":"0.9rem","margin-left":"0px"}},ne={style:{display:"flex","justify-content":"space-between"}},le={style:{display:"flex",color:"#000"}},ie=e("div",{style:{"margin-left":"3px"}},"位置",-1),ae={style:{display:"flex",color:"#000"}},ce=e("div",{style:{"margin-left":"3px"}},"日志",-1),de={style:{display:"flex",color:"#000"}},re=e("div",{style:{"margin-left":"3px"}},"编辑",-1),pe={key:0},_e={key:1,style:{"text-align":"center",padding:"20px",color:"#ccc"}},ge=e("span",null,"暂无数据",-1),me=[ge],fe={key:2,style:{"text-align":"center",padding:"20px"}},ue={key:3,style:{"text-align":"center",padding:"20px",color:"#ccc"}},ve=e("span",null,"没有更多了",-1),he=[ve],ye={key:4,style:{"text-align":"center",padding:"20px"}},xe=e("div",{style:{height:"60px"}},null,-1),je=F({__name:"Index",setup(ke){const s=P({pageNum:1,pageSize:10,pages:0}),r=m([]),a=m(!1),p=m(!1),y=m(!1),f=()=>{console.log("onload....."),I({url:"/device/search",data:{size:s.pageSize,page:s.pageNum,sort:"createtime",order:"desc",keyWord:"",mac:""}}).then(t=>{if(console.log(t),p.value=!1,a.value=!1,t.code==0){const c=t.data,n=Math.ceil(t.total/s.pageSize);console.log(n),console.log(c),s.pageNum==1&&r.value.splice(0,r.value.length),r.value.push(...c),s.pages=n,console.log(r.value,n)}},t=>{console.log(t),p.value=!1,a.value=!1}).catch(t=>{console.log(t),p.value=!1,a.value=!1})},x=()=>{console.log("onrefresh..."),console.log(a.value),s.pageNum=1,y.value=!1,p.value=!0,f()},k=t=>{const c=Date.parse(t);return(new Date().getTime()-c)/1e3};R(()=>{console.log("onMounted"),f()});const b=()=>{console.log("clickLoading"),s.pageNum++,p.value=!0,f()};return(t,c)=>{const n=B,v=M,w=D,z=j,N=V,L=C,S=T;return o(),d("div",E,[e("div",U,[e("div",W,[G,e("div",H,[i(n,{name:"static/images/icon-search-black.png",size:"1.7rem"})])])]),e("div",J,[i(L,{style:{"min-height":"100%"},modelValue:a.value,"onUpdate:modelValue":c[0]||(c[0]=l=>a.value=l),onRefresh:x},{default:_(()=>[(o(!0),d(q,null,A(r.value,l=>(o(),u(z,{style:{"background-color":"#fff","margin-bottom":"10px"}},{right:_(()=>[K]),default:_(()=>[i(w,{clickable:""},{default:_(()=>[e("div",O,[e("div",Q,[e("div",X,[e("span",null,g(l.username),1)]),e("div",Y,g(l.productName),1)]),e("div",Z,[e("div",$,[e("span",null,g(l.mac),1)]),e("div",ee,[k(l.modifytime)<1200?(o(),u(v,{key:0,round:"",size:"medium",type:"success"},{default:_(()=>[h("在线")]),_:1})):(o(),u(v,{key:1,round:"",size:"medium",type:"danger"},{default:_(()=>[h("离线")]),_:1}))])]),e("div",te,[e("div",oe,[e("span",null,g(l.createtime),1)]),e("div",se,[e("span",null,g(l.modifytime),1)])]),e("div",ne,[e("div",le,[e("div",null,[i(n,{name:"static/images/icon-location2.png",size:"1.5rem"})]),ie]),e("div",ae,[e("div",null,[i(n,{name:"static/images/icon-log.png",size:"1.5rem"})]),ce]),e("div",de,[e("div",null,[i(n,{name:"static/images/icon-edit.png",size:"1.5rem"})]),re])])])]),_:2},1024)]),_:2},1024))),256)),e("div",null,[a.value?(o(),d("div",pe)):r.value.length==0?(o(),d("div",_e,me)):p.value?(o(),d("div",fe,[i(N,{type:"spinner",color:"#1989fa"})])):s.pages<=s.pageNum?(o(),d("div",ue,he)):(o(),d("div",ye,[e("span",{onClick:b},"点击加载")]))]),xe]),_:1},8,["modelValue"]),i(S,{target:".container",right:"5vw",bottom:"80px"})])])}}});export{je as default};