Index-99254eac.js 5.7 KB

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