import{b as _}from"./index-33689e3e.js";import{Q as Y}from"./index-68b47d07.js";import{d as D,y as O,ap as m,a as T,f as I,e as i,b as n,J as s,t as l,h as o,K as y,aq as b,ar as v,as as M}from"./index-3ac32eb9.js";const H={name:"BasicInfo"},x=D({...H,props:{currentIotId:{type:String},firstOnlineTime:{type:String,default:""},lastOnlineTime:{type:String,default:""}},setup(f){const c=f,p=y({currentDevice:{},productTypeOption:[]}),{currentDevice:r,productTypeOption:g}=b(p);async function d(){await Y({currentPage:1,pageSize:999,projectId:localStorage.getItem("currentProjectId")}).then(({data:e})=>{p.productTypeOption=e.list.map((a,t,u)=>({label:a.productName,value:a.productId}))})}return O(async()=>{await d(),c.currentIotId&&_(c.currentIotId).then(({data:e})=>{if(e){for(const a of p.productTypeOption)a.value===e.productId&&(e.productId=a.label);e.createdAt=m(e.createdAt).format("YYYY-MM-DD HH:mm:ss"),e.updatedAt=m(e.updatedAt).format("YYYY-MM-DD HH:mm:ss"),c.firstOnlineTime?e.firstOnlineTime=m(c.firstOnlineTime).format("YYYY-MM-DD HH:mm:ss"):e.firstOnlineTime=e.firstOnlineTime?m(e.firstOnlineTime).format("YYYY-MM-DD HH:mm:ss"):"--",c.lastOnlineTime?e.lastOnlineTime=m(c.lastOnlineTime).format("YYYY-MM-DD HH:mm:ss"):e.lastOnlineTime=e.lastOnlineTime?m(e.lastOnlineTime).format("YYYY-MM-DD HH:mm:ss"):"--",e.deviceDesc=e.deviceDesc?e.deviceDesc:"--",p.currentDevice=e}})}),(e,a)=>{const t=v,u=M;return T(),I("div",null,[i(u,{title:"",direction:"vertical",column:4,border:""},{default:n(()=>[i(t,{label:"设备名称"},{default:n(()=>[s(l(o(r).deviceName),1)]),_:1}),i(t,{label:"固件版本"},{default:n(()=>[s(l(o(r).deviceVersion),1)]),_:1}),i(t,{label:"父设备Id"},{default:n(()=>[s(l(o(r).parentIotId),1)]),_:1}),i(t,{label:"所属产品"},{default:n(()=>[s(l(o(r).productId),1)]),_:1}),i(t,{label:"设备创建时间"},{default:n(()=>[s(l(o(r).createdAt),1)]),_:1}),i(t,{label:"设备更新时间"},{default:n(()=>[s(l(o(r).updatedAt),1)]),_:1}),i(t,{label:"设备激活时间"},{default:n(()=>[s(l(o(r).firstOnlineTime),1)]),_:1}),i(t,{label:"最近上线时间"},{default:n(()=>[s(l(o(r).lastOnlineTime),1)]),_:1}),i(t,{label:"设备描述",span:4},{default:n(()=>[s(l(o(r).deviceDesc),1)]),_:1})]),_:1})])}}});export{x as _};
