From 5fe8c76efabdd92661fc9489e0165172d423cf0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=B7=E9=BE=99?= Date: Tue, 26 Aug 2025 02:56:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=A8=A1=E6=9D=BF=E7=94=9F?= =?UTF-8?q?=E6=88=90=E6=95=85=E4=BA=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Interaction/templateStoryService.ts | 2 +- app/service/domain/Entities.ts | 2 + components/ChatInputBox/ChatInputBox.tsx | 39 ++++++++++++------- 3 files changed, 27 insertions(+), 16 deletions(-) diff --git a/app/service/Interaction/templateStoryService.ts b/app/service/Interaction/templateStoryService.ts index b7fa795..8357268 100644 --- a/app/service/Interaction/templateStoryService.ts +++ b/app/service/Interaction/templateStoryService.ts @@ -192,7 +192,7 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => { ...selectedTemplate, fillable_content: selectedTemplate.fillable_content.map((field) => field.field_name === fieldName - ? { ...field, field_value: fieldValue } + ? { ...field, value: fieldValue } : field ), }; diff --git a/app/service/domain/Entities.ts b/app/service/domain/Entities.ts index 9c17320..98d492a 100644 --- a/app/service/domain/Entities.ts +++ b/app/service/domain/Entities.ts @@ -168,6 +168,8 @@ export interface StoryTemplateEntity { field_type: string; /** 字段值 */ field_value?: string; + /** 前端展示,无关后端的字段值 */ + value?: string; /** 字段描述 */ field_description?: string; /** 字段元数据 */ diff --git a/components/ChatInputBox/ChatInputBox.tsx b/components/ChatInputBox/ChatInputBox.tsx index 40b7cd1..a69ace9 100644 --- a/components/ChatInputBox/ChatInputBox.tsx +++ b/components/ChatInputBox/ChatInputBox.tsx @@ -18,7 +18,15 @@ import { Sparkles, Settings, } from "lucide-react"; -import { Dropdown, Modal, Tooltip, Upload, Popconfirm, Image } from "antd"; +import { + Dropdown, + Modal, + Tooltip, + Upload, + Popconfirm, + Image, + Popover, +} from "antd"; import { UploadOutlined } from "@ant-design/icons"; import { StoryTemplateEntity } from "@/app/service/domain/Entities"; import { useImageStoryServiceHook } from "@/app/service/Interaction/ImageStoryService"; @@ -229,30 +237,31 @@ const RenderTemplateStoryMode = ({
updateFillableContentField( field.field_name, e.target.value ) } - placeholder={`${field.field_description}`} + placeholder={`${field.field_value}`} className="w-[30rem] px-3 py-2 pr-16 bg-white/0 border border-white/10 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500/30 transition-all duration-200 text-sm" />
{/* AI生成按钮 */} - handleFieldBlur( - field.field_name, - field.field_value || "" - ) - } - icon={} - width="w-8" - height="h-8" - /> + isCreating={false} + handleCreateVideo={() => + handleFieldBlur( + field.field_name, + field.value || "" + ) + } + + icon={} + width="w-8" + height="h-8" + />
} @@ -260,7 +269,7 @@ const RenderTemplateStoryMode = ({ classNames={{ root: "max-w-none", }} - trigger="hover" + trigger="focus" styles={{ root: { zIndex: 1000 } }} > {/* 图片 */}