fix(data): 覆盖式导入与快照恢复前自动备份

- importJson / restoreSnapshot 覆盖前先写一份当前数据快照,误操作可回退
- 导入校验增加 id 唯一性检查,宽容读取路径保留首条
- 快照索引对同一时间点的重复写入去重
- 落盘失败时翻转 persistent,恢复后自动撤除告警
- 备份面板提示导入前数据已自动备份
This commit is contained in:
chenshoulin
2026-10-19 17:20:20 +08:00
parent 12c5346f75
commit ede4bfe88f
8 changed files with 214 additions and 14 deletions
+1
View File
@@ -118,6 +118,7 @@ describe('BackupPanel 导入', () => {
expect(store.tasks.map((task) => task.title).sort()).toEqual(['新任务一', '新任务二'])
expect(wrapper.text()).toContain('已从 backup.json 导入 2 个任务')
expect(wrapper.text()).toContain('导入前的数据已自动备份')
})
it('取消确认后数据保持不变', async () => {