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-0068546b.js";import{ah as b,R as F,ai as V,aj as P,aa as B,ak as m}from"./index-421a14fe.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-c90dd8b9.js";import{u as N,q as U}from"./useDetail-bc5bc756.js";import{u as k}from"./device-7f4f68cd.js";import{C as x}from"./Card-d71cd81e.js";import{S as W}from"./index-eff29412.js";import"./index-071ed9a7.js";import"./LeftOutlined-3e294183.js";import"./index-f96d75f8.js";import"./index-15629871.js";import"./index-979d22ee.js";import"./index-4e08099e.js";import"./Group-1d18c385.js";import"./createForOfIteratorHelper-0e399d34.js";import"./useFlexGapSupport-cba5400e.js";import"./index-9edae1f7.js";import"./index-9e831b2b.js";import"./TextArea-792f0a90.js";import"./scrollTo-c3ec85b6.js";import"./mockjs-890b569b.js";import"./useModal-dcba92a3.js";import"./gb28281-89f88f1c.js";import"./usePlay-2b1e397a.js";import"./index-3cf2650c.js";import"./index-cb18b0f7.js";import"./index-78834803.js";import"./jb4-28542242.js";import"./index-9c28ccbc.js";const K=E({name:"Device"}),It=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{It as default};