| components/mold.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
components/mold.vue
@@ -466,6 +466,18 @@ }; }); // 新增:按上刀时间升序排序(越早的越上面) mapped.sort((a, b) => { // 时间格式如 "10-24 16:03",转为 Date 对象比较 const parse = s => { if (!s) return 0; // 补年份,假设都是今年 const year = new Date().getFullYear(); return new Date(`${year}-${s.replace(/-/g, '-')}:00`).getTime(); }; return parse(a.upTime) - parse(b.upTime); }); this.toolRecords = mapped; const totalFromRes = Number( res.data?.total ?? res.data?.totalCount ?? res.total ?? res.totalCount ?? mapped.length