feat: 添加起始日期功能并更新相关组件与测试用例
- 在任务创建和编辑界面中新增起始日期字段,默认值为当天。 - 更新任务卡片展示逻辑,仅在起始日期不是当天时显示相关信息。 - 修改相关测试用例以覆盖起始日期的功能,包括批量创建和编辑任务的场景。 - 数据库模式版本更新至4,以支持起始日期字段的存储与迁移。
This commit is contained in:
@@ -24,6 +24,7 @@ const description = ref('')
|
||||
const status = ref<ColumnId>('todo')
|
||||
const priority = ref<Priority>(2)
|
||||
const dueDate = ref<string | null>(null)
|
||||
const startDate = ref<string | null>(null)
|
||||
const tags = ref<string[]>([])
|
||||
const titleError = ref<string | null>(null)
|
||||
|
||||
@@ -45,6 +46,7 @@ watch(
|
||||
status.value = task?.status ?? 'todo'
|
||||
priority.value = task?.priority ?? 2
|
||||
dueDate.value = task?.dueDate ?? null
|
||||
startDate.value = task?.startDate ?? null
|
||||
tags.value = task ? [...task.tags] : []
|
||||
titleError.value = null
|
||||
confirmingClose.value = false
|
||||
@@ -92,6 +94,7 @@ const dirty = computed(() => {
|
||||
status.value !== task.status ||
|
||||
priority.value !== task.priority ||
|
||||
dueDate.value !== task.dueDate ||
|
||||
startDate.value !== task.startDate ||
|
||||
!sameTags(tags.value, task.tags)
|
||||
)
|
||||
})
|
||||
@@ -126,6 +129,7 @@ function save(): void {
|
||||
status: status.value,
|
||||
priority: priority.value,
|
||||
dueDate: dueDate.value,
|
||||
startDate: startDate.value,
|
||||
tags: [...tags.value],
|
||||
})
|
||||
emit('close')
|
||||
@@ -239,6 +243,11 @@ function remove(): void {
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-zinc-400">起始日期</span>
|
||||
<DatePicker v-model="startDate" />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-1.5">
|
||||
<span class="text-sm font-medium text-slate-600 dark:text-zinc-400">截止日期</span>
|
||||
<DatePicker v-model="dueDate" />
|
||||
|
||||
Reference in New Issue
Block a user