| 1 |
- import{I as M}from"./index-1428e3a1.js";import{P,B as U}from"./index-cdca7cd6.js";/* empty css */import{S as W}from"./index-19e41f01.js";import{C as $}from"./index-e68bfa0f.js";import{T as E}from"./index-955cabe1.js";import{F as I}from"./index-25c64c3a.js";import{d as J,r as p,B as O,o as q,s as G,t as H,b as s,e as a,f as e,x as m,c as i,h as g,u as K,F as Q,z as X,k as y,C as z,D as C,A as Y}from"./index-234c814f.js";import{p as Z}from"./index-28191382.js";/* empty css */import{L as ee}from"./index-43f66c3b.js";import"./function-call-215ccdbc.js";import"./use-expose-e42a8a37.js";import"./constant-eba5e2d8.js";import"./on-popup-reopen-29631c54.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"}},he={style:{display:"flex","justify-content":"space-between","margin-bottom":"5px"}},ye={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"}},De=e("span",null,"没有更多了",-1),Ae=[De],Fe={key:4,style:{"text-align":"center",padding:"20px"}},Me=e("div",{style:{height:"60px"}},null,-1),oo=J({__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=O({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};q(()=>{console.log("onMounted"),v()});const h=p(null),b=p(0);G(()=>{console.log("onActived..."),Y(()=>{h.value.scrollTop=b.value})}),H((o,l,d)=>{console.log(o,l),console.log("onBeforeRouteLeave..."),b.value=h.value.scrollTop,d()});const V=()=>{console.log("clickLoading"),n.pageNum++,u.value=!0,v()};return(o,l)=>{const d=I,r=M,w=E,S=$,R=W,j=ee,D=P,A=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:h,class:"container",style:{"overflow-y":"auto","flex-grow":"1"}},[i(D,{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(),y(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(),y(w,{key:0,round:"",size:"medium",type:"success"},{default:g(()=>[z("在线")]),_:1})):(s(),y(w,{key:1,round:"",size:"medium",type:"danger"},{default:g(()=>[z("离线")]),_:1}))])]),e("div",he,[e("div",ye,[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,Ae)):(s(),a("div",Fe,[e("span",{onClick:V},"点击加载")]))]),Me]),_:1},8,["modelValue"]),i(A,{target:".container",right:"5vw",bottom:"80px"})],512)])}}});export{oo as default};
|