refactor(ui): useAntdForm

This commit is contained in:
Fu Diwei
2024-12-25 14:51:32 +08:00
parent c9024c5611
commit 4d0f7c2e02
43 changed files with 779 additions and 677 deletions

View File

@@ -57,9 +57,9 @@ const WorkflowDetail = () => {
return elements;
}, [workflow]);
const handleBaseInfoFormFinish = async (fields: Pick<WorkflowModel, "name" | "description">) => {
const handleBaseInfoFormFinish = async (values: Pick<WorkflowModel, "name" | "description">) => {
try {
await setBaseInfo(fields.name!, fields.description!);
await setBaseInfo(values.name!, values.description!);
} catch (err) {
console.error(err);
notificationApi.error({ message: t("common.text.request_error"), description: getErrMsg(err) });
@@ -93,6 +93,7 @@ const WorkflowDetail = () => {
});
};
// TODO: 发布更改 撤销更改 立即执行
// const handleWorkflowSaveClick = () => {
// if (!allNodesValidated(workflow.draft as WorkflowNode)) {
// messageApi.warning(t("workflow.detail.action.save.failed.uncompleted"));
@@ -192,7 +193,7 @@ const WorkflowBaseInfoModalForm = memo(
}: {
model: Pick<WorkflowModel, "name" | "description">;
trigger?: React.ReactElement;
onFinish?: (fields: Pick<WorkflowModel, "name" | "description">) => Promise<void | boolean>;
onFinish?: (values: Pick<WorkflowModel, "name" | "description">) => Promise<void | boolean>;
}) => {
const { t } = useTranslation();