feat(ui): new WorkflowElements using antd

This commit is contained in:
Fu Diwei
2025-01-03 20:29:34 +08:00
parent c6a8f923e4
commit 8a16893082
43 changed files with 805 additions and 810 deletions

View File

@@ -15,7 +15,7 @@ import { useWorkflowStore } from "@/stores/workflow";
import { usePanel } from "../PanelProvider";
export type NotifyNodeFormProps = {
data: WorkflowNode;
node: WorkflowNode;
};
const initFormModel = () => {
@@ -25,7 +25,7 @@ const initFormModel = () => {
};
};
const NotifyNodeForm = ({ data }: NotifyNodeFormProps) => {
const NotifyNodeForm = ({ node }: NotifyNodeFormProps) => {
const { t } = useTranslation();
const {
@@ -57,11 +57,11 @@ const NotifyNodeForm = ({ data }: NotifyNodeFormProps) => {
formPending,
formProps,
} = useAntdForm<z.infer<typeof formSchema>>({
initialValues: data?.config ?? initFormModel(),
initialValues: node?.config ?? initFormModel(),
onSubmit: async (values) => {
await formInst.validateFields();
await updateNode(
produce(data, (draft) => {
produce(node, (draft) => {
draft.config = { ...values };
draft.validated = true;
})