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