快乐的昕的电脑
2025-10-24 663ec86cda7d68c7809860fa258bcb8790bde248
调试
已修改1个文件
12 ■■■■■ 文件已修改
components/mold.vue 12 ●●●●● 补丁 | 查看 | 原始文档 | 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