From e489a635aff71b5b85fdfadf3e382a88d45e5d7d Mon Sep 17 00:00:00 2001 From: zhangzhanwei Date: Tue, 16 Sep 2025 14:22:47 +0800 Subject: [PATCH] fix: Prompt generate MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --bug=1061828 --user=张展玮 【提示词生成】- AI对话节点中,生成的提示词点击替换不管用 https://www.tapd.cn/62980211/s/1773916 --- .../locales/lang/en-US/views/application.ts | 6 + .../locales/lang/zh-CN/views/application.ts | 6 + .../locales/lang/zh-Hant/views/application.ts | 6 + .../component/GeneratePromptDialog.vue | 177 +++++++++++++++--- ui/src/workflow/nodes/ai-chat-node/index.vue | 3 +- 5 files changed, 170 insertions(+), 28 deletions(-) diff --git a/ui/src/locales/lang/en-US/views/application.ts b/ui/src/locales/lang/en-US/views/application.ts index d910e47c0..d69f4fe6b 100644 --- a/ui/src/locales/lang/en-US/views/application.ts +++ b/ui/src/locales/lang/en-US/views/application.ts @@ -135,6 +135,12 @@ export default { label: 'Generate', generatePrompt: 'Generate Prompt', placeholder: 'Please enter the prompt topic', + title: 'The prompt is displayed here', + remake: 'Regenerate', + stop: 'Stop Generating', + continue: 'Continue Generating', + replace: 'Replace', + exit: 'Are you sure you want to exit and discard the AI-generated content?', }, dialog: { addKnowledge: 'Add Related Knowledge', diff --git a/ui/src/locales/lang/zh-CN/views/application.ts b/ui/src/locales/lang/zh-CN/views/application.ts index f61686ff4..9d6bb1ab8 100644 --- a/ui/src/locales/lang/zh-CN/views/application.ts +++ b/ui/src/locales/lang/zh-CN/views/application.ts @@ -127,6 +127,12 @@ export default { label: '生成', generatePrompt: '生成提示词', placeholder: '请输入提示词主题', + title: '提示词显示在这里', + remake: '重新生成', + stop: '停止生成', + continue: '继续生成', + replace: '替换', + exit: '确认退出并舍弃 AI 生成的内容吗?', }, dialog: { addKnowledge: '添加关联知识库', diff --git a/ui/src/locales/lang/zh-Hant/views/application.ts b/ui/src/locales/lang/zh-Hant/views/application.ts index 2cf5a8751..ef0634068 100644 --- a/ui/src/locales/lang/zh-Hant/views/application.ts +++ b/ui/src/locales/lang/zh-Hant/views/application.ts @@ -126,6 +126,12 @@ export default { label: '生成', generatePrompt: '生成提示詞', placeholder: '請輸入提示詞主題', + title: '提示詞顯示在這裡', + remake: '重新生成', + stop: '停止生成', + continue: '繼續生成', + replace: '替換', + exit: '確認退出並捨棄 AI 生成的內容嗎?', }, dialog: { addKnowledge: '新增關聯知識庫', diff --git a/ui/src/views/application/component/GeneratePromptDialog.vue b/ui/src/views/application/component/GeneratePromptDialog.vue index 9db22bab6..7f535de6e 100644 --- a/ui/src/views/application/component/GeneratePromptDialog.vue +++ b/ui/src/views/application/component/GeneratePromptDialog.vue @@ -5,8 +5,9 @@ v-model="dialogVisible" style="width: 600px" append-to-body - :close-on-click-modal="false" - :close-on-press-escape="false" + :close-on-click-modal="true" + :close-on-press-escape="true" + :before-close="handleDialogClose" >
@@ -28,13 +29,13 @@

- 提示词显示在这里 + {{ $t('views.application.generateDialog.title') }}

-
- 替换 +
+ {{ $t('views.application.generateDialog.replace') }} - 重新生成 + {{ $t('views.application.generateDialog.remake') }}
@@ -42,13 +43,18 @@
-
- +
+ - 停止生成 + {{ $t('views.application.generateDialog.stop') }} + +
+
+ + + {{ $t('views.application.generateDialog.continue') }}
-
- - + +
@@ -82,8 +88,10 @@