index-2cdbad24.js 4.4 KB

1
  1. import{d as E,g as O,f as t,E as r,e as A,U as D,V as M,a0 as n,u as i,F as R}from"./vue-18ee037d.js";import{u as v}from"./formily-a077fcb9.js";import{ah as b,R as F,ai as V,aj as P,aa as B,ak as m}from"./index-122302b9.js";import{u as H}from"./index-9374feb1.js";import"./dayjs-4778c158.js";import{_ as G}from"./scroll-tip.vue_vue_type_script_setup_true_lang-302683f3.js";import{u as N,q as U}from"./useDetail-83a3c860.js";import{u as k}from"./device-88d35103.js";import{C as x}from"./Card-58451e7c.js";import{S as W}from"./index-7af791cb.js";import"./index-41409ae5.js";import"./LeftOutlined-492d0e43.js";import"./index-bd60fcbe.js";import"./index-60ff9924.js";import"./index-92754d13.js";import"./index-c13eac51.js";import"./Group-ea2dcc3a.js";import"./createForOfIteratorHelper-502f0d2b.js";import"./useFlexGapSupport-791d0eca.js";import"./index-d1fbd179.js";import"./index-ac918f8f.js";import"./TextArea-1376d3ad.js";import"./scrollTo-854a9ced.js";import"./mockjs-890b569b.js";import"./useModal-3ca524ee.js";import"./gb28281-53c246af.js";import"./usePlay-843f5ae8.js";import"./index-7e9674b9.js";import"./index-868fc3c0.js";import"./index-cc7f4b20.js";import"./jb4-60518ffa.js";import"./index-8c1b53c2.js";import"./index-977bc6d2.js";const K=E({name:"Device"}),Ct=E({...K,setup(q){var _;const g=(_=O())==null?void 0:_.appContext;b.renderer.add("moreFields",{renderExpand(e,a){const{row:o}=a;return t("p",{class:"flex flex-col p-10px m-0"},[t("span",null,[t("b",null,[r("型号(Model):  ")]),o.Model]),t("span",null,[t("b",null,[r("纬度(Latitude):  ")]),o.Latitude]),t("span",null,[t("b",null,[r("经度(Longitude):  ")]),o.Longitude]),t("span",null,[t("b",null,[r("GpsTime:  ")]),o.GpsTime]),t("span",null,[t("b",null,[r("Owner:  ")]),o.Owner])])}});const s=k(),u=A(()=>s.deviceList),{httpRefreshTime:h}=F({VITE_PORT:"3000",VITE_GLOB_APP_TITLE:"SagooMedia",VITE_GLOB_APP_SHORT_NAME:"SagooMedia",VITE_M7S_SERVER:"/media",VITE_USE_MOCK:"true",VITE_PUBLIC_PATH:"/plugin/media",VITE_DROP_CONSOLE:"true",VITE_BUILD_COMPRESS:"none",VITE_BUILD_COMPRESS_DELETE_ORIGIN_FILE:"false",VITE_GLOB_HTTP_REFRESH_TIME:"5000",VITE_USE_IMAGEMIN:"true",VITE_LEGACY:"false",BASE_URL:"/plugin/media",MODE:"production",DEV:!1,PROD:!0,SSR:!1}),{pause:l,resume:p}=V(c,h),y=e=>{const a=String(e.target.value).trim().toLowerCase();if(a){const o=["ID","Name"],I=u.value.filter(C=>o.some(L=>String(C[L]).toLowerCase().indexOf(a)>-1));d(I),l()}else d(u.value),p()},{FormilyForm:S}=v({schema:U(y)}),T={toggleRowExpand:({expanded:e})=>{e?l():p()}},f=H(),d=e=>{f.tableRef.reloadData(e)};async function c(){await s.fetchDeviceList(),d(s.deviceList)}c();const w={maxHeight:"100%",rowConfig:{keyField:"ID",useKey:!0},columnConfig:{useKey:!0},columns:[{title:"...",width:"30px",type:"expand",contentRender:{name:"moreFields"},fixed:"left"},{field:"ID",title:"设备编号",showOverflow:"tooltip",width:"200px",fixed:"left",type:"html"},{field:"Name",title:"设备名称",showOverflow:"tooltip",width:"120px",type:"html"},{field:"NetAddr",title:"网络地址",showOverflow:"tooltip",width:"180px"},{field:"Channels",title:"通道数",width:"70px",formatter:({cellValue:e})=>(e==null?void 0:e.length)||0},{field:"Status",title:"状态",minWidth:"120px"},{field:"Manufacturer",title:"厂商",width:"120px"},{field:"LastKeepaliveAt",title:"最后保活时间",minWidth:"180px",formatter:({cellValue:e})=>m.toDateString(new Date(e),"yyyy-MM-dd HH:ss:mm")},{field:"RegisterTime",title:"注册时间",minWidth:"180px",formatter:({cellValue:e})=>m.toDateString(new Date(e),"yyyy-MM-dd HH:ss:mm")},{field:"UpdateTime",title:"更新时间",minWidth:"180px",formatter:({cellValue:e})=>m.toDateString(new Date(e),"yyyy-MM-dd HH:ss:mm")},{field:"operate",title:"操作",width:"120px",fixed:"right",align:"center",slots:{default:"operate"}}],data:[]};return(e,a)=>(D(),M(R,null,[t(i(x),{bordered:!1,bodyStyle:{padding:"26px 10px 0 10px",marginBottom:"8px"}},{default:n(()=>[t(i(S))]),_:1}),t(i(x),{bordered:!1,bodyStyle:{padding:"10px",height:"calc(100% - 50px)"},style:{height:"calc(100% - 100px)"}},{default:n(()=>[t(i(G),{windowWidth:1716}),t(i(P),{uid:i(f).uid,gridOptions:i(w),gridEvent:i(T)},{operate:n(({row:o})=>[t(i(W),null,{default:n(()=>[t(i(B),{size:"small",type:"link",onClick:()=>i(N)({row:o,appContext:i(g),pause:i(l),resume:i(p)})},{default:n(()=>[r(" 通道详情 ")]),_:2},1032,["onClick"])]),_:2},1024)]),_:1},8,["uid","gridOptions","gridEvent"])]),_:1},8,["bodyStyle"])],64))}});export{Ct as default};