forked from 77media/video-flow
优化模板生成故事
This commit is contained in:
parent
61b7003622
commit
5fe8c76efa
@ -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
|
||||
),
|
||||
};
|
||||
|
||||
@ -168,6 +168,8 @@ export interface StoryTemplateEntity {
|
||||
field_type: string;
|
||||
/** 字段值 */
|
||||
field_value?: string;
|
||||
/** 前端展示,无关后端的字段值 */
|
||||
value?: string;
|
||||
/** 字段描述 */
|
||||
field_description?: string;
|
||||
/** 字段元数据 */
|
||||
|
||||
@ -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 = ({
|
||||
<div className="relative">
|
||||
<input
|
||||
type="text"
|
||||
value={field.field_value || ""}
|
||||
value={field.value || ""}
|
||||
onChange={(e) =>
|
||||
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"
|
||||
/>
|
||||
<div className="absolute right-2 top-1/2 -translate-y-1/2">
|
||||
{/* AI生成按钮 */}
|
||||
<ActionButton
|
||||
isCreating={false}
|
||||
handleCreateVideo={() =>
|
||||
handleFieldBlur(
|
||||
field.field_name,
|
||||
field.field_value || ""
|
||||
)
|
||||
}
|
||||
icon={<Sparkles className="w-4 h-4" />}
|
||||
width="w-8"
|
||||
height="h-8"
|
||||
/>
|
||||
isCreating={false}
|
||||
handleCreateVideo={() =>
|
||||
handleFieldBlur(
|
||||
field.field_name,
|
||||
field.value || ""
|
||||
)
|
||||
}
|
||||
|
||||
icon={<Sparkles className="w-4 h-4" />}
|
||||
width="w-8"
|
||||
height="h-8"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@ -260,7 +269,7 @@ const RenderTemplateStoryMode = ({
|
||||
classNames={{
|
||||
root: "max-w-none",
|
||||
}}
|
||||
trigger="hover"
|
||||
trigger="focus"
|
||||
styles={{ root: { zIndex: 1000 } }}
|
||||
>
|
||||
{/* 图片 */}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user