This commit is contained in:
2026-03-11 01:19:42 +08:00
parent 4317053270
commit dd57aa0ce5
2 changed files with 15 additions and 14 deletions

View File

@@ -61,6 +61,7 @@ async function generateBatchPrompt() {
videoCount: props.textCount,
ctrl,
onMessage: (fullText: string) => {
console.log('[BatchAnalyzeModal] onMessage - fullText length:', fullText?.length)
batchPrompt.value = fullText
},
onError: (error: Error) => {
@@ -68,9 +69,11 @@ async function generateBatchPrompt() {
message.error('AI生成失败请稍后重试')
},
onComplete: (fullText: string) => {
console.log('[BatchAnalyzeModal] onComplete - fullText length:', fullText?.length)
if (fullText && fullText !== batchPrompt.value) {
batchPrompt.value = fullText
}
console.log('[BatchAnalyzeModal] onComplete - batchPrompt.value length:', batchPrompt.value?.length)
message.success(`批量分析完成:已基于 ${props.textCount} 个视频的文案生成综合提示词`)
}
})
@@ -79,7 +82,7 @@ async function generateBatchPrompt() {
message.error('AI生成失败请稍后重试')
} finally {
batchPromptGenerating.value = false
hasGenerated.value = false
// 注意:不要重置 hasGenerated保持生成状态直到弹窗关闭
}
}
@@ -92,9 +95,15 @@ function handleCopy() {
}
function handleSave() {
console.log('[BatchAnalyzeModal] handleSave - batchPrompt:', batchPrompt.value)
emit('save', batchPrompt.value)
}
function toggleEditMode() {
console.log('[BatchAnalyzeModal] toggleEditMode - batchPrompt:', batchPrompt.value, 'current mode:', batchPromptEditMode.value)
batchPromptEditMode.value = !batchPromptEditMode.value
}
function handleUse() {
emit('use', batchPrompt.value)
}
@@ -102,7 +111,7 @@ function handleUse() {
<template>
<a-modal
:open="visible"
:open="props.visible"
title="综合分析结果"
:width="800"
:maskClosable="false"
@@ -130,7 +139,7 @@ function handleUse() {
<template #footer>
<div class="footer-actions">
<div class="left-actions">
<a-button type="text" @click="batchPromptEditMode = !batchPromptEditMode">
<a-button type="text" @click="toggleEditMode">
{{ batchPromptEditMode ? '取消编辑' : '编辑' }}
</a-button>
<a-button type="text" @click="handleCopy">复制</a-button>
@@ -144,13 +153,6 @@ function handleUse() {
</div>
<div class="right-actions">
<a-button @click="handleClose">取消</a-button>
<a-button
type="primary"
:disabled="batchPromptGenerating || !batchPrompt.trim()"
@click="handleUse"
>
去创作
</a-button>
</div>
</div>
</template>

View File

@@ -125,10 +125,9 @@ function handleCancel() {
:maxlength="20" />
</a-form-item>
<a-form-item label="提示词内容">
<a-textarea
v-model:value="savePromptForm.content"
:rows="8"
:readonly="true"
<a-textarea
v-model:value="savePromptForm.content"
:rows="8"
placeholder="提示词内容" />
</a-form-item>
</a-form>