import{e as x,r as o,j as e,c as j}from"./index-CH80_4na.js";import{B as g}from"./Back-CQK3vPih.js";import{u as h,t as f,f as v,r as _,v as N,E as y}from"./index-CaEwkKsN.js";import{E}from"./EquipmentStatus-DfUM3-7P.js";import{T}from"./Table-C2n5xZE4.js";import"./index-Dr_Kh9no.js";import{S as n}from"./space-D_Kbkeg5.js";const b="_page_1bqeo_1",k="_logs_1bqeo_12",l={page:b,logs:k};function q(){const{T:r}=x(),a=h(),[c,m]=o.useMemo(()=>{const t=Math.round(Date.now()/1e3);return[t-14*86400,t]},[]),{value:d,loading:p}=f(a,c,m),u=o.useMemo(()=>[{key:"id",title:"编号",align:"center",width:120,render:(t,{id:s})=>s},{key:"user",title:"使用者",align:"center",width:120,render:(t,{user:s})=>s==null?void 0:s.name},{key:"timeRange",title:"使用时段",render:(t,{startTime:s,endTime:i})=>e.jsxs(n,{children:[s&&v(N(s),"YYYY/MM/DD HH:mm"),e.jsx("span",{children:"-"}),i?_(i,{from:s}):r("现在")]})},{key:"charge",title:"相关收费",align:"right",render:(t,{charge:s})=>e.jsx(n,{children:s==null?void 0:s.toFixed(2)})},{key:"samples",title:"样品",align:"right",render:(t,{samples:s})=>e.jsx(n,{children:s||0})}],[r]);return e.jsxs("div",{className:l.logs,children:[e.jsxs("div",{className:"top-bar",children:[e.jsx("div",{className:"title",children:a==null?void 0:a.name}),e.jsx(E,{})]}),e.jsxs("div",{className:"content",children:[e.jsx("div",{className:"table-description",children:r("本页仅列出最近两周内的上机记录, 完整记录请至网页端查看")}),e.jsx("div",{className:"table-wrap",children:e.jsx(T,{loading:p,columns:u,dataSource:d})})]})]})}function B(){const{equipmentId:r}=j();return r?e.jsxs(e.Fragment,{children:[e.jsx(g,{}),e.jsxs("div",{className:l.page,children:[e.jsx("div",{className:"page-title",children:"上机记录"}),e.jsx(y,{equipmentId:r,children:e.jsx(q,{})})]})]}):null}export{B as default};
