feat: 回收站、批量编辑、合并导入与标签治理

- 数据:Task 增加 deletedAt,schema v2→v3;删除改为软删除,保留 30 天后自动清理
- 回收站:支持恢复、永久删除、二次确认清空;导航栏入口带数量角标
- 批量编辑:多选后统一移动列、改优先级、标签增删、设置截止日、归档
- 合并导入:按 id 匹配、updatedAt 新者胜;覆盖/合并二选一,执行前自动快照
- 标签治理:全局重命名、合并、删除;回收站任务不参与改写
- 看板语义读取统一改用 activeTasks,避免已删除任务泄漏到统计、今日与标签下拉
- UI:回收站图标与备份统一尺寸;批量编辑条统一控件高度并分组
- 测试:705 个单测通过,补充迁移、回收站、批量编辑、合并与标签用例
This commit is contained in:
chenshoulin
2026-10-19 18:32:42 +08:00
parent 43e813b93a
commit 65e98199ba
39 changed files with 2734 additions and 143 deletions
+8 -6
View File
@@ -37,15 +37,15 @@ const TONES = {
} as const
const store = useTaskStore()
const { tasks } = storeToRefs(store)
const { activeTasks } = storeToRefs(store)
const todayLabel = computed(() => {
const now = dayjs()
return `${now.format('YYYY年M月D日')} ${WEEKDAYS[now.day()]}`
})
const buckets = computed(() => buildTodayBuckets(tasks.value))
const stats = computed(() => computeStats(tasks.value))
const buckets = computed(() => buildTodayBuckets(activeTasks.value))
const stats = computed(() => computeStats(activeTasks.value))
const todayCount = computed(() => countTodayTasks(buckets.value))
/**
@@ -97,10 +97,12 @@ const sections = computed(() =>
)
const editingId = ref<string | null>(null)
const editingTask = computed(() => store.tasks.find((task) => task.id === editingId.value) ?? null)
const editingTask = computed(
() => store.activeTasks.find((task) => task.id === editingId.value) ?? null,
)
function toggleTask(id: string): void {
const task = store.tasks.find((item) => item.id === id)
const task = store.activeTasks.find((item) => item.id === id)
if (!task) return
store.updateTask(id, { status: task.status === 'done' ? 'todo' : 'done' })
}
@@ -108,7 +110,7 @@ function toggleTask(id: string): void {
/** 今日视图没有列概念,左右方向键不适用;上下仍可调 order */
function handleKeyMove(payload: { id: string; direction: MoveDirection }): void {
if (payload.direction === 'left' || payload.direction === 'right') return
const task = store.tasks.find((item) => item.id === payload.id)
const task = store.activeTasks.find((item) => item.id === payload.id)
if (!task) return
const column = store.byColumn[task.status]
const currentIndex = column.findIndex((item) => item.id === payload.id)