Index-3f82c4b3.js 5.9 KB

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