Commit f5818d25 authored by chenshouchao's avatar chenshouchao

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

parent 23a11fc2
......@@ -6,10 +6,11 @@ import WorkFlow from "./WorkFlow";
import ButtonComponent from "@/components/mui/Button";
import ArrowBackIosNewIcon from "@mui/icons-material/ArrowBackIosNew";
import IconButton from "@mui/material/IconButton";
import { ITemplateConfig } from "./interface";
const ProjectSubmitWork = () => {
const [templateConfigInfo, setTemplateConfigInfo] =
useState(templateConfigJson);
useState<ITemplateConfig>(templateConfigJson);
return (
<div className={styles.swBox}>
......
......@@ -8,10 +8,10 @@ export interface ITemplateConfig {
tags: Array<string>;
source: string;
productId: string;
tasks: Array<ITask>;
tasks?: Array<ITaskFlow | ITaskBatch>;
}
export interface ITask {
export interface ITaskFlow {
id: string;
title: string;
description: string;
......@@ -19,16 +19,31 @@ export interface ITask {
x: 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>;
edges: Array<IEdge>;
}
export interface IParameter {
hidden: boolean;
id?: string;
name: string;
required: boolean;
domType: IDomType;
domType: IDomType | string;
dataType: string;
value: string;
description: string;
......@@ -47,9 +62,10 @@ export enum IDomType {
Checkbox = "checkbox",
}
export interface IValidator {
// 待定
}
type IValidator = any;
// export interface IValidator {
// // 待定
// }
export interface IChoice {
key: string;
......@@ -59,7 +75,8 @@ export interface IChoice {
export interface IEdge {
id: string;
source: string;
sourceHandleid: string;
sourceHandle: string;
target: 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