Add workflow execution process

This commit is contained in:
yoan
2024-11-18 19:40:24 +08:00
parent bde2147dd3
commit 775b12aec1
23 changed files with 741 additions and 21 deletions

View File

@@ -8,7 +8,8 @@ import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "
import { Input } from "../ui/input";
import { Button } from "../ui/button";
import { useTranslation } from "react-i18next";
import { memo, useState } from "react";
import { memo, useEffect, useState } from "react";
import { Textarea } from "../ui/textarea";
type WorkflowNameEditDialogProps = {
trigger: React.ReactNode;
@@ -30,6 +31,10 @@ const WorkflowNameBaseInfoDialog = ({ trigger }: WorkflowNameEditDialogProps) =>
resolver: zodResolver(formSchema),
});
useEffect(() => {
form.reset({ name: workflow.name, description: workflow.description });
}, [workflow]);
const { t } = useTranslation();
const [open, setOpen] = useState(false);
@@ -71,6 +76,7 @@ const WorkflowNameBaseInfoDialog = ({ trigger }: WorkflowNameEditDialogProps) =>
<Input
placeholder="请输入流程名称"
{...field}
value={field.value}
defaultValue={workflow.name}
onChange={(e) => {
form.setValue("name", e.target.value);
@@ -90,9 +96,10 @@ const WorkflowNameBaseInfoDialog = ({ trigger }: WorkflowNameEditDialogProps) =>
<FormItem>
<FormLabel></FormLabel>
<FormControl>
<Input
<Textarea
placeholder="请输入流程说明"
{...field}
value={field.value}
defaultValue={workflow.description}
onChange={(e) => {
form.setValue("description", e.target.value);