Initial commit

This commit is contained in:
libertyspy
2026-02-08 20:27:40 +08:00
parent e12c3c0302
commit b544391b5c
7 changed files with 56 additions and 58 deletions

View File

@@ -8,7 +8,6 @@
*/
import type { NullableString } from '@/types';
import type { NodeSetting } from '@/views/decision/types';
export interface DraggableElement {
id: number | null,
@@ -24,6 +23,16 @@ export interface DraggableElement {
export type ElementStatus = 'default' | 'success' | 'failed' | 'running' | string | null
export interface ElementParameter {
id: number,
templateId: number,
paramKey: NullableString,
dataType: NullableString,
defaultValue: NullableString,
description: NullableString,
templateType: NullableString,
}
export interface ElementPosition {
x: number;
y: number;
@@ -38,6 +47,7 @@ export interface ElementVariable {
}
export interface BaseElement {
id: number;
key: string;
name: string;
type: string;
@@ -56,38 +66,35 @@ export interface TaskNodeRect {
y?: number;
}
export interface TaskNodeElement extends BaseElement {
export interface GraphTaskElement extends BaseElement {
template: number;
inputs: any;
outputs: any;
variables: ElementVariable[];
parameters: Record<any, any>;
parameters: ElementParameter[];
children?: TaskNodeElement[],
children?: GraphTaskElement[],
[key: string]: unknown;
}
export interface SettingTaskNodeElement extends TaskNodeElement {
settings: NodeSetting[];
}
export interface ModelElement extends BaseElement {
edges: EdgeNodeElement[];
edges: GraphEdgeElement[];
}
export interface EdgeNodeElement {
export interface GraphEdgeElement {
id: number;
key: NullableString;
source: NullableString;
sourceName: NullableString;
target: NullableString;
targetName: NullableString;
attrs: Record<any, any>;
router: Record<any, any>;
connector: any;
[key: string]: unknown;
}
export interface NodeGraph {
edges: EdgeNodeElement[];
nodes: TaskNodeElement[];
edges: GraphEdgeElement[];
nodes: GraphTaskElement[];
}