新增: 任务创建关联灵感下拉(F-260619-01 补创建入口)
This commit is contained in:
@@ -149,6 +149,14 @@
|
||||
<option :value="3">{{ $t('tasks.modal.priorityLow') }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- F-260619-01:关联灵感(1对1 单向,可选)。空串=不关联,与后端/AI 工具层一致。 -->
|
||||
<div class="modal-field">
|
||||
<label>{{ $t('tasks.modal.idea') }}</label>
|
||||
<select v-model="newTaskIdeaId">
|
||||
<option value="">{{ $t('tasks.modal.ideaPlaceholder') }}</option>
|
||||
<option v-for="idea in store.ideas" :key="idea.id" :value="idea.id">{{ idea.title }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="modal-actions">
|
||||
<button class="btn btn-ghost" @click="showCreateModal = false">{{ $t('common.cancel') }}</button>
|
||||
<button class="btn btn-primary" @click="confirmCreate" :disabled="submitting || !newTaskTitle.trim()">{{ $t('common.confirm') }}</button>
|
||||
@@ -272,6 +280,8 @@ const newTaskTitle = ref('')
|
||||
const newTaskDesc = ref('')
|
||||
const newTaskBranch = ref('')
|
||||
const newTaskPriority = ref(2)
|
||||
// F-260619-01:关联灵感(空串=不关联,与后端 idea_id 空串处理一致)
|
||||
const newTaskIdeaId = ref('')
|
||||
const submitting = ref(false)
|
||||
|
||||
interface TaskGroup {
|
||||
@@ -355,6 +365,7 @@ function openCreateModal() {
|
||||
newTaskDesc.value = ''
|
||||
newTaskBranch.value = ''
|
||||
newTaskPriority.value = 2
|
||||
newTaskIdeaId.value = ''
|
||||
showCreateModal.value = true
|
||||
}
|
||||
|
||||
@@ -368,6 +379,8 @@ async function confirmCreate() {
|
||||
description: newTaskDesc.value.trim(),
|
||||
branch_name: newTaskBranch.value.trim() || undefined,
|
||||
priority: newTaskPriority.value,
|
||||
// F-260619-01:空串=不关联(对齐后端 idea_id 空串语义)
|
||||
idea_id: newTaskIdeaId.value.trim() || undefined,
|
||||
})
|
||||
if (!r) return
|
||||
showCreateModal.value = false
|
||||
@@ -434,6 +447,8 @@ onMounted(async () => {
|
||||
await Promise.all([
|
||||
store.loadProjects(),
|
||||
store.loadTasks(),
|
||||
// F-260619-01:加载灵感供新建任务模态关联下拉选择(幂等,已加载则 no-op)
|
||||
store.loadIdeas(),
|
||||
taskApi.count().then(n => totalTasks.value = n),
|
||||
])
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user