快乐的昕的电脑
2025-10-24 63b196231b45186ee968e8e75d0c039e4c8f7193
按上刀时间降序排序(越晚的越上面)
已修改1个文件
4 ■■■■ 文件已修改
components/mold.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
components/mold.vue
@@ -466,7 +466,7 @@
                        };
                    });
                    // 新增:按上刀时间升序排序(越早的越上面)
                    // 新增:按上刀时间降序排序(越晚的越上面)
                    mapped.sort((a, b) => {
                        // 时间格式如 "10-24 16:03",转为 Date 对象比较
                        const parse = s => {
@@ -475,7 +475,7 @@
                            const year = new Date().getFullYear();
                            return new Date(`${year}-${s.replace(/-/g, '-')}:00`).getTime();
                        };
                        return parse(a.upTime) - parse(b.upTime);
                        return parse(b.upTime) - parse(a.upTime); // 注意这里顺序反过来
                    });
                    this.toolRecords = mapped;