import{e as x,r as o,j as e,c as j}from"./index-CqA6gR2S.js";import{B as g}from"./Back-DqqFM7zR.js";import{u as h,t as f,f as v,r as _,v as N,E as y}from"./index-D--7QZ50.js";import{E}from"./EquipmentStatus-Dc9l4IYg.js";import{T}from"./Table-rq-QOfKw.js";import"./index-B_OQWaA6.js";import{S as n}from"./space-TOaHzrjG.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};
