UPDATE: VERSION-20260315
This commit is contained in:
105
modeler/src/views/decision/graph/element.ts
Normal file
105
modeler/src/views/decision/graph/element.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* This file is part of the kernelstudio package.
|
||||
*
|
||||
* (c) 2014-2026 zlin <admin@kernelstudio.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE file
|
||||
* that was distributed with this source code.
|
||||
*/
|
||||
|
||||
|
||||
import type { NullableString } from '@/types';
|
||||
|
||||
export interface GraphPosition {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
|
||||
export interface GraphRect {
|
||||
width?: number;
|
||||
height?: number;
|
||||
x?: number;
|
||||
y?: number;
|
||||
}
|
||||
|
||||
export interface GraphDraggableElement {
|
||||
id: number | null,
|
||||
key?: NullableString,
|
||||
name: NullableString,
|
||||
description: NullableString,
|
||||
category: NullableString,
|
||||
draggable: boolean,
|
||||
parent?: GraphDraggableElement,
|
||||
children: GraphDraggableElement[]
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface GraphBaseElement {
|
||||
id: number;
|
||||
key: NullableString;
|
||||
name: NullableString;
|
||||
description: NullableString;
|
||||
type: NullableString;
|
||||
width: number;
|
||||
height: number;
|
||||
position: GraphPosition;
|
||||
category: NullableString;
|
||||
element?: GraphDraggableElement;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
|
||||
export interface ElementParameter {
|
||||
id: number,
|
||||
templateId: number,
|
||||
paramKey: NullableString,
|
||||
dataType: NullableString,
|
||||
defaultValue: NullableString,
|
||||
description: NullableString,
|
||||
templateType: NullableString,
|
||||
}
|
||||
|
||||
|
||||
export interface ElementVariable {
|
||||
key: NullableString;
|
||||
name: NullableString;
|
||||
value: NullableString;
|
||||
defaults: NullableString;
|
||||
unit: NullableString;
|
||||
}
|
||||
|
||||
export interface GraphTaskElement extends GraphBaseElement {
|
||||
template: number;
|
||||
templateType: NullableString,
|
||||
inputs: any;
|
||||
outputs: any;
|
||||
order: number;
|
||||
variables: ElementVariable[];
|
||||
parameters: ElementParameter[];
|
||||
children?: GraphTaskElement[],
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface ModelElement extends GraphBaseElement {
|
||||
edges: GraphEdgeElement[];
|
||||
}
|
||||
|
||||
export interface GraphEdgeElement {
|
||||
id: number;
|
||||
key: NullableString;
|
||||
source: NullableString;
|
||||
target: NullableString;
|
||||
attrs: Record<any, any>;
|
||||
router: Record<any, any>;
|
||||
connector: any;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
export interface GraphContainer {
|
||||
edges: GraphEdgeElement[];
|
||||
nodes: GraphTaskElement[];
|
||||
}
|
||||
Reference in New Issue
Block a user