import{e as x,r as o,j as e,c as j}from"./index-B65hW-4A.js";import{B as g}from"./Back-f88g7OU_.js";import{u as h,t as f,f as v,r as _,v as N,E as y}from"./index-BPVOoUZg.js";import{E}from"./EquipmentStatus-CBAc_DkO.js";import{T}from"./Table-ChKJ4bIV.js";import"./index-DBwX3wFx.js";import{S as n}from"./space-QKzGVU9R.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};
