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