Commit f5818d25 authored by chenshouchao's avatar chenshouchao

feat: 任务配置数据结构完成

parent 23a11fc2
...@@ -6,10 +6,11 @@ import WorkFlow from "./WorkFlow"; ...@@ -6,10 +6,11 @@ import WorkFlow from "./WorkFlow";
import ButtonComponent from "@/components/mui/Button"; import ButtonComponent from "@/components/mui/Button";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew"; import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton"; import IconButton from "@mui/material/IconButton";
import { ITemplateConfig } from "./interface";
const ProjectSubmitWork = () => { const ProjectSubmitWork = () => {
const [templateConfigInfo, setTemplateConfigInfo] = const [templateConfigInfo, setTemplateConfigInfo] =
useState(templateConfigJson); useState<ITemplateConfig>(templateConfigJson);
return ( return (
<div className={styles.swBox}> <div className={styles.swBox}>
......
...@@ -8,10 +8,10 @@ export interface ITemplateConfig { ...@@ -8,10 +8,10 @@ export interface ITemplateConfig {
tags: Array<string>; tags: Array<string>;
source: string; source: string;
productId: string; productId: string;
tasks: Array<ITask>; tasks?: Array<ITaskFlow | ITaskBatch>;
} }
export interface ITask { export interface ITaskFlow {
id: string; id: string;
title: string; title: string;
description: string; description: string;
...@@ -19,16 +19,31 @@ export interface ITask { ...@@ -19,16 +19,31 @@ export interface ITask {
x: number; x: number;
y: number; y: number;
}; };
type: "batch" | "flow"; type: "flow" | string;
parentNode: string;
parameters: Array<IParameter>;
edges: Array<IEdge>;
}
export interface ITaskBatch {
id: string;
title: string;
description: string;
position: {
x: number;
y: number;
};
type: "batch" | string;
parameters: Array<IParameter>; parameters: Array<IParameter>;
edges: Array<IEdge>; edges: Array<IEdge>;
} }
export interface IParameter { export interface IParameter {
hidden: boolean; hidden: boolean;
id?: string;
name: string; name: string;
required: boolean; required: boolean;
domType: IDomType; domType: IDomType | string;
dataType: string; dataType: string;
value: string; value: string;
description: string; description: string;
...@@ -47,9 +62,10 @@ export enum IDomType { ...@@ -47,9 +62,10 @@ export enum IDomType {
Checkbox = "checkbox", Checkbox = "checkbox",
} }
export interface IValidator { type IValidator = any;
// 待定 // export interface IValidator {
} // // 待定
// }
export interface IChoice { export interface IChoice {
key: string; key: string;
...@@ -59,7 +75,8 @@ export interface IChoice { ...@@ -59,7 +75,8 @@ export interface IChoice {
export interface IEdge { export interface IEdge {
id: string; id: string;
source: string; source: string;
sourceHandleid: string; sourceHandle: string;
target: string; target: string;
targetHandle: string; targetHandle: string;
lable: string;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment