新增: 任务创建关联灵感下拉(F-260619-01 补创建入口)

This commit is contained in:
lxy
2026-08-01 12:47:12 +08:00
parent c34ad062e7
commit 438f9692f2
3 changed files with 21 additions and 0 deletions
+3
View File
@@ -53,6 +53,9 @@ export default {
desc: 'Description',
branch: 'Branch',
priority: 'Priority',
// F-260619-01: related idea (1:1, optional)
idea: 'Related Idea',
ideaPlaceholder: 'None (optional)',
titlePlaceholder: 'Enter task title...',
descPlaceholder: 'Brief description (optional)',
branchPlaceholder: 'feature/xxx (optional)',
+3
View File
@@ -53,6 +53,9 @@ export default {
desc: '描述',
branch: '分支',
priority: '优先级',
// F-260619-01:关联灵感(1对1 单向,可选)
idea: '关联灵感',
ideaPlaceholder: '不关联(可选)',
titlePlaceholder: '输入任务标题...',
descPlaceholder: '简要描述(可选)',
branchPlaceholder: 'feature/xxx(可选)',
+15
View File
@@ -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 {