|
|
|
|
@@ -112,6 +112,17 @@
|
|
|
|
|
<input v-model="newIdeaTitle" :placeholder="$t('ideas.titlePlaceholder')" @keyup.enter="confirmCapture" />
|
|
|
|
|
<label style="font-size:12px;color:var(--df-text-secondary);margin-bottom:4px;display:block">{{ $t('ideas.fieldDesc') }}</label>
|
|
|
|
|
<textarea v-model="newIdeaDesc" :placeholder="$t('ideas.descPlaceholder')" rows="3" style="resize:vertical"></textarea>
|
|
|
|
|
<label style="font-size:12px;color:var(--df-text-secondary);margin-bottom:4px;display:block">{{ $t('ideas.fieldTags') }}</label>
|
|
|
|
|
<input v-model="newIdeaTags" :placeholder="$t('ideas.tagsPlaceholder')" />
|
|
|
|
|
<label style="font-size:12px;color:var(--df-text-secondary);margin-bottom:4px;display:block">{{ $t('ideas.fieldPriority') }}</label>
|
|
|
|
|
<select v-model.number="newIdeaPriority" class="modal-select">
|
|
|
|
|
<option :value="0">{{ $t('ideas.priorityCritical') }} (P0)</option>
|
|
|
|
|
<option :value="1">{{ $t('ideas.priorityHigh') }} (P1)</option>
|
|
|
|
|
<option :value="2">{{ $t('ideas.priorityMedium') }} (P2)</option>
|
|
|
|
|
<option :value="3">{{ $t('ideas.priorityLow') }} (P3)</option>
|
|
|
|
|
</select>
|
|
|
|
|
<label style="font-size:12px;color:var(--df-text-secondary);margin-bottom:4px;display:block">{{ $t('ideas.fieldSource') }}</label>
|
|
|
|
|
<input v-model="newIdeaSource" :placeholder="$t('ideas.sourcePlaceholder')" />
|
|
|
|
|
<div class="modal-actions">
|
|
|
|
|
<button class="btn-cancel" @click="showCaptureModal = false">{{ $t('common.cancel') }}</button>
|
|
|
|
|
<button class="btn-confirm" :disabled="creating" @click="confirmCapture">
|
|
|
|
|
@@ -164,6 +175,9 @@ const pageSize = ref(0)
|
|
|
|
|
const showCaptureModal = ref(false)
|
|
|
|
|
const newIdeaTitle = ref('')
|
|
|
|
|
const newIdeaDesc = ref('')
|
|
|
|
|
const newIdeaTags = ref('') // 逗号分隔输入(对标 KnowledgeDetail.vue tagsInput)
|
|
|
|
|
const newIdeaPriority = ref(2) // 默认 medium,对标 CreateIdeaInput 0-3
|
|
|
|
|
const newIdeaSource = ref('')
|
|
|
|
|
|
|
|
|
|
// ── 异步按钮禁用态(防双击重复提交,对齐 ProviderPanel.vue saving ref) ──
|
|
|
|
|
const creating = ref(false)
|
|
|
|
|
@@ -274,6 +288,9 @@ function scoreClass(score: number | null) {
|
|
|
|
|
function openCaptureModal() {
|
|
|
|
|
newIdeaTitle.value = ''
|
|
|
|
|
newIdeaDesc.value = ''
|
|
|
|
|
newIdeaTags.value = ''
|
|
|
|
|
newIdeaPriority.value = 2
|
|
|
|
|
newIdeaSource.value = ''
|
|
|
|
|
showCaptureModal.value = true
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -281,9 +298,14 @@ async function confirmCapture() {
|
|
|
|
|
if (!newIdeaTitle.value.trim() || creating.value) return
|
|
|
|
|
creating.value = true
|
|
|
|
|
try {
|
|
|
|
|
// tags 逗号分隔 → JSON 字符串(对标 KnowledgeDetail.vue saveEdit split+trim+filter 模式)
|
|
|
|
|
const tags = newIdeaTags.value.split(',').map(t => t.trim()).filter(Boolean)
|
|
|
|
|
await store.createIdea({
|
|
|
|
|
title: newIdeaTitle.value.trim(),
|
|
|
|
|
description: newIdeaDesc.value.trim() || undefined,
|
|
|
|
|
priority: newIdeaPriority.value,
|
|
|
|
|
tags: JSON.stringify(tags),
|
|
|
|
|
source: newIdeaSource.value.trim() || undefined,
|
|
|
|
|
})
|
|
|
|
|
showCaptureModal.value = false
|
|
|
|
|
} finally {
|
|
|
|
|
@@ -566,6 +588,7 @@ watch(() => route.params.id, (id) => {
|
|
|
|
|
.modal-box { background: var(--df-bg-card); border: 0.5px solid var(--df-border); border-radius: var(--df-radius-lg); padding: 24px; min-width: 360px; max-width: 90vw; }
|
|
|
|
|
.modal-box h3 { color: var(--df-text); margin-bottom: var(--df-gap-head); }
|
|
|
|
|
.modal-box input, .modal-box textarea { width: 100%; padding: 8px 12px; border: 0.5px solid var(--df-border); border-radius: var(--df-radius-sm); background: var(--df-bg); color: var(--df-text); font-size: 13px; margin-bottom: 12px; box-sizing: border-box; font-family: inherit; }
|
|
|
|
|
.modal-box .modal-select { width: 100%; padding: 8px 12px; border: 0.5px solid var(--df-border); border-radius: var(--df-radius-sm); background: var(--df-bg); color: var(--df-text); font-size: 13px; margin-bottom: 12px; box-sizing: border-box; font-family: inherit; }
|
|
|
|
|
.modal-box .modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
|
|
|
.modal-box .btn-cancel { padding: 6px 16px; border: 0.5px solid var(--df-border); border-radius: var(--df-radius-sm); background: transparent; color: var(--df-text-secondary); cursor: pointer; }
|
|
|
|
|
.modal-box .btn-confirm { padding: 6px 16px; border: none; border-radius: var(--df-radius-sm); background: var(--df-accent); color: #fff; cursor: pointer; }
|
|
|
|
|
|