@nywqs/scada-engine 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +455 -0
- package/dist/components/AttributeConfigDialog.d.ts +39 -0
- package/dist/components/BasicPropertiesTab.d.ts +51 -0
- package/dist/components/BindingCard.d.ts +36 -0
- package/dist/components/CanvasArea.d.ts +4 -0
- package/dist/components/CanvasConfigPanel.d.ts +2 -0
- package/dist/components/ComponentLibrary.d.ts +6 -0
- package/dist/components/CustomCodeDialog.d.ts +30 -0
- package/dist/components/DataPropertiesTab.d.ts +42 -0
- package/dist/components/DevicePointSelector.d.ts +27 -0
- package/dist/components/EdgePropertiesTab.d.ts +22 -0
- package/dist/components/EventCard.d.ts +63 -0
- package/dist/components/Footer.d.ts +37 -0
- package/dist/components/Header.d.ts +71 -0
- package/dist/components/MappingConfigurator.d.ts +27 -0
- package/dist/components/PropertyPanel.d.ts +27 -0
- package/dist/components/WorkflowSelectorDialog.d.ts +15 -0
- package/dist/index.d.ts +157 -0
- package/dist/main.d.ts +1 -0
- package/dist/mock/deviceData.d.ts +39 -0
- package/dist/scada-components/basic/circle.d.ts +6 -0
- package/dist/scada-components/basic/index.d.ts +6 -0
- package/dist/scada-components/basic/rect.d.ts +6 -0
- package/dist/scada-components/basic/text.d.ts +6 -0
- package/dist/scada-components/canvas/config.d.ts +17 -0
- package/dist/scada-components/canvas/index.d.ts +6 -0
- package/dist/scada-components/canvas/manager.d.ts +95 -0
- package/dist/scada-components/canvas/types.d.ts +77 -0
- package/dist/scada-components/index.d.ts +8 -0
- package/dist/scada-components/iot/gauge.d.ts +6 -0
- package/dist/scada-components/iot/index.d.ts +6 -0
- package/dist/scada-components/iot/light.d.ts +6 -0
- package/dist/scada-components/iot/switch.d.ts +6 -0
- package/dist/scada-components/registry.d.ts +56 -0
- package/dist/scada-components/types.d.ts +82 -0
- package/dist/scada-engine.css +1 -0
- package/dist/scada-engine.es.js +12390 -0
- package/dist/scada-engine.umd.js +53 -0
- package/dist/types/binding.d.ts +75 -0
- package/dist/types/device.d.ts +131 -0
- package/dist/types/workflow.d.ts +195 -0
- package/dist/utils/animationEngine.d.ts +68 -0
- package/dist/utils/authCrypto.d.ts +45 -0
- package/dist/utils/commonUtils.d.ts +83 -0
- package/dist/utils/eventUtils.d.ts +43 -0
- package/dist/utils/fileUtils.d.ts +43 -0
- package/dist/utils/index.d.ts +10 -0
- package/dist/utils/messageUtils.d.ts +56 -0
- package/dist/utils/nodePropertyUtils.d.ts +33 -0
- package/dist/utils/storageUtils.d.ts +55 -0
- package/dist/views/workflow/WorkflowDialog.d.ts +37 -0
- package/dist/views/workflow/WorkflowEditor.d.ts +38 -0
- package/dist/views/workflow/components/AddNodeMenu.d.ts +32 -0
- package/dist/views/workflow/components/ElementSelector.d.ts +45 -0
- package/dist/views/workflow/components/PropertyPanel.d.ts +27 -0
- package/dist/views/workflow/components/WorkflowToolbar.d.ts +24 -0
- package/dist/views/workflow/components/node-configs/ClearTimerConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/ConditionConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/CustomCodeConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/GetPropertyConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/HttpRequestConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/SetPropertyConfig.d.ts +20 -0
- package/dist/views/workflow/components/node-configs/TimerConfig.d.ts +20 -0
- package/dist/views/workflow/config/nodeConfigRegistry.d.ts +5 -0
- package/dist/views/workflow/services/canvasElementService.d.ts +31 -0
- package/dist/views/workflow/types/node.d.ts +70 -0
- package/package.json +77 -0
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 消息提示工具函数
|
|
3
|
+
* 统一管理消息提示、确认对话框等
|
|
4
|
+
*/
|
|
5
|
+
export type MessageType = 'success' | 'error' | 'warning' | 'info';
|
|
6
|
+
/**
|
|
7
|
+
* 显示提示消息
|
|
8
|
+
* @param message 消息内容
|
|
9
|
+
* @param type 消息类型
|
|
10
|
+
* @param duration 显示时长(毫秒),默认3000
|
|
11
|
+
*/
|
|
12
|
+
export declare const showMessage: (message: string, type?: MessageType, duration?: number) => void;
|
|
13
|
+
/**
|
|
14
|
+
* 显示成功消息
|
|
15
|
+
* @param message 消息内容
|
|
16
|
+
* @param duration 显示时长(毫秒)
|
|
17
|
+
*/
|
|
18
|
+
export declare const showSuccess: (message: string, duration?: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* 显示错误消息
|
|
21
|
+
* @param message 消息内容
|
|
22
|
+
* @param duration 显示时长(毫秒)
|
|
23
|
+
*/
|
|
24
|
+
export declare const showError: (message: string, duration?: number) => void;
|
|
25
|
+
/**
|
|
26
|
+
* 显示警告消息
|
|
27
|
+
* @param message 消息内容
|
|
28
|
+
* @param duration 显示时长(毫秒)
|
|
29
|
+
*/
|
|
30
|
+
export declare const showWarning: (message: string, duration?: number) => void;
|
|
31
|
+
/**
|
|
32
|
+
* 显示信息消息
|
|
33
|
+
* @param message 消息内容
|
|
34
|
+
* @param duration 显示时长(毫秒)
|
|
35
|
+
*/
|
|
36
|
+
export declare const showInfo: (message: string, duration?: number) => void;
|
|
37
|
+
/**
|
|
38
|
+
* 显示确认对话框
|
|
39
|
+
* @param message 提示消息
|
|
40
|
+
* @param title 对话框标题
|
|
41
|
+
* @returns Promise<boolean> 用户确认返回true,取消返回false
|
|
42
|
+
*/
|
|
43
|
+
export declare const showConfirm: (message: string, title?: string) => Promise<boolean>;
|
|
44
|
+
/**
|
|
45
|
+
* 显示输入对话框
|
|
46
|
+
* @param message 提示消息
|
|
47
|
+
* @param defaultValue 默认值
|
|
48
|
+
* @returns Promise<string | null> 用户输入的值,取消返回null
|
|
49
|
+
*/
|
|
50
|
+
export declare const showPrompt: (message: string, defaultValue?: string) => Promise<string | null>;
|
|
51
|
+
/**
|
|
52
|
+
* 显示加载提示
|
|
53
|
+
* @param message 加载消息
|
|
54
|
+
* @returns 返回关闭函数
|
|
55
|
+
*/
|
|
56
|
+
export declare const showLoading: (message?: string) => (() => void);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 节点属性操作工具函数
|
|
3
|
+
* 用于处理节点属性的获取、设置等操作
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 获取嵌套对象的值
|
|
7
|
+
* @param obj 对象
|
|
8
|
+
* @param path 路径,使用.分隔,如 'a.b.c'
|
|
9
|
+
* @returns 属性值
|
|
10
|
+
*/
|
|
11
|
+
export declare const getNestedValue: (obj: any, path: string) => any;
|
|
12
|
+
/**
|
|
13
|
+
* 设置嵌套对象的值
|
|
14
|
+
* @param obj 对象
|
|
15
|
+
* @param path 路径,使用.分隔,如 'a.b.c'
|
|
16
|
+
* @param value 要设置的值
|
|
17
|
+
*/
|
|
18
|
+
export declare const setNestedValue: (obj: any, path: string, value: any) => void;
|
|
19
|
+
/**
|
|
20
|
+
* 根据 props 配置获取节点属性值
|
|
21
|
+
* @param node X6 节点
|
|
22
|
+
* @param propertyKey 属性键(在 props 中定义的 key)
|
|
23
|
+
* @returns 属性值
|
|
24
|
+
*/
|
|
25
|
+
export declare const getNodePropertyValue: (node: any, propertyKey: string) => any;
|
|
26
|
+
/**
|
|
27
|
+
* 根据 props 配置设置节点属性值
|
|
28
|
+
* @param node X6 节点
|
|
29
|
+
* @param propertyKey 属性键(在 props 中定义的 key)
|
|
30
|
+
* @param value 要设置的值
|
|
31
|
+
* @returns 是否设置成功
|
|
32
|
+
*/
|
|
33
|
+
export declare const setNodePropertyValue: (node: any, propertyKey: string, value: any) => boolean;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 存储工具函数
|
|
3
|
+
* 统一管理 sessionStorage 和 localStorage 操作
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* SessionStorage 键名常量
|
|
7
|
+
*/
|
|
8
|
+
export declare const STORAGE_KEYS: {
|
|
9
|
+
readonly SCADA_EDITOR_DATA: "scada_editor_data";
|
|
10
|
+
readonly SCADA_PREVIEW_DATA: "scada_preview_data";
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* 保存数据到 sessionStorage
|
|
14
|
+
* @param key 键名
|
|
15
|
+
* @param data 数据对象
|
|
16
|
+
* @returns 是否保存成功
|
|
17
|
+
*/
|
|
18
|
+
export declare const saveToSession: <T = any>(key: string, data: T) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* 从 sessionStorage 读取数据
|
|
21
|
+
* @param key 键名
|
|
22
|
+
* @returns 数据对象,失败返回 null
|
|
23
|
+
*/
|
|
24
|
+
export declare const loadFromSession: <T = any>(key: string) => T | null;
|
|
25
|
+
/**
|
|
26
|
+
* 从 sessionStorage 删除数据
|
|
27
|
+
* @param key 键名
|
|
28
|
+
*/
|
|
29
|
+
export declare const removeFromSession: (key: string) => void;
|
|
30
|
+
/**
|
|
31
|
+
* 清空 sessionStorage
|
|
32
|
+
*/
|
|
33
|
+
export declare const clearSession: () => void;
|
|
34
|
+
/**
|
|
35
|
+
* 保存数据到 localStorage
|
|
36
|
+
* @param key 键名
|
|
37
|
+
* @param data 数据对象
|
|
38
|
+
* @returns 是否保存成功
|
|
39
|
+
*/
|
|
40
|
+
export declare const saveToLocal: <T = any>(key: string, data: T) => boolean;
|
|
41
|
+
/**
|
|
42
|
+
* 从 localStorage 读取数据
|
|
43
|
+
* @param key 键名
|
|
44
|
+
* @returns 数据对象,失败返回 null
|
|
45
|
+
*/
|
|
46
|
+
export declare const loadFromLocal: <T = any>(key: string) => T | null;
|
|
47
|
+
/**
|
|
48
|
+
* 从 localStorage 删除数据
|
|
49
|
+
* @param key 键名
|
|
50
|
+
*/
|
|
51
|
+
export declare const removeFromLocal: (key: string) => void;
|
|
52
|
+
/**
|
|
53
|
+
* 清空 localStorage
|
|
54
|
+
*/
|
|
55
|
+
export declare const clearLocal: () => void;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
visible: boolean;
|
|
5
|
+
scadaGraph?: Graph | null;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
8
|
+
scadaGraph: null;
|
|
9
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
10
|
+
"update:visible": (value: boolean) => void;
|
|
11
|
+
close: () => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
13
|
+
scadaGraph: null;
|
|
14
|
+
}>>> & Readonly<{
|
|
15
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
scadaGraph: Graph | null;
|
|
19
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
20
|
+
export default _default;
|
|
21
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
22
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
23
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
24
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
25
|
+
} : {
|
|
26
|
+
type: import('vue').PropType<T[K]>;
|
|
27
|
+
required: true;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
type __VLS_WithDefaults<P, D> = {
|
|
31
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
32
|
+
default: D[K];
|
|
33
|
+
}> : P[K];
|
|
34
|
+
};
|
|
35
|
+
type __VLS_Prettify<T> = {
|
|
36
|
+
[K in keyof T]: T[K];
|
|
37
|
+
} & {};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Graph as X6Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
scadaGraph?: X6Graph | null;
|
|
5
|
+
showClose?: boolean;
|
|
6
|
+
}
|
|
7
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
8
|
+
scadaGraph: null;
|
|
9
|
+
showClose: boolean;
|
|
10
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
11
|
+
close: () => void;
|
|
12
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
13
|
+
scadaGraph: null;
|
|
14
|
+
showClose: boolean;
|
|
15
|
+
}>>> & Readonly<{
|
|
16
|
+
onClose?: (() => any) | undefined;
|
|
17
|
+
}>, {
|
|
18
|
+
showClose: boolean;
|
|
19
|
+
scadaGraph: X6Graph | null;
|
|
20
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
21
|
+
export default _default;
|
|
22
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
23
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
24
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
25
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
26
|
+
} : {
|
|
27
|
+
type: import('vue').PropType<T[K]>;
|
|
28
|
+
required: true;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
type __VLS_WithDefaults<P, D> = {
|
|
32
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
33
|
+
default: D[K];
|
|
34
|
+
}> : P[K];
|
|
35
|
+
};
|
|
36
|
+
type __VLS_Prettify<T> = {
|
|
37
|
+
[K in keyof T]: T[K];
|
|
38
|
+
} & {};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
interface NodeType {
|
|
2
|
+
type: string;
|
|
3
|
+
name: string;
|
|
4
|
+
icon: string;
|
|
5
|
+
description: string;
|
|
6
|
+
color: string;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
visible: boolean;
|
|
10
|
+
position: {
|
|
11
|
+
x: number;
|
|
12
|
+
y: number;
|
|
13
|
+
};
|
|
14
|
+
nodeTypes: NodeType[];
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
17
|
+
close: () => void;
|
|
18
|
+
select: (nodeType: NodeType) => void;
|
|
19
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
20
|
+
onSelect?: ((nodeType: NodeType) => any) | undefined;
|
|
21
|
+
onClose?: (() => any) | undefined;
|
|
22
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
23
|
+
export default _default;
|
|
24
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
25
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
26
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
27
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
28
|
+
} : {
|
|
29
|
+
type: import('vue').PropType<T[K]>;
|
|
30
|
+
required: true;
|
|
31
|
+
};
|
|
32
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export interface ElementInfo {
|
|
2
|
+
id: string;
|
|
3
|
+
name: string;
|
|
4
|
+
type: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
properties: Array<{
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
interface Props {
|
|
12
|
+
visible: boolean;
|
|
13
|
+
elements?: ElementInfo[];
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
16
|
+
elements: () => never[];
|
|
17
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
|
+
close: () => void;
|
|
19
|
+
select: (element: ElementInfo) => void;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
21
|
+
elements: () => never[];
|
|
22
|
+
}>>> & Readonly<{
|
|
23
|
+
onSelect?: ((element: ElementInfo) => any) | undefined;
|
|
24
|
+
onClose?: (() => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
elements: ElementInfo[];
|
|
27
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
30
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
31
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
32
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
33
|
+
} : {
|
|
34
|
+
type: import('vue').PropType<T[K]>;
|
|
35
|
+
required: true;
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
type __VLS_WithDefaults<P, D> = {
|
|
39
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
40
|
+
default: D[K];
|
|
41
|
+
}> : P[K];
|
|
42
|
+
};
|
|
43
|
+
type __VLS_Prettify<T> = {
|
|
44
|
+
[K in keyof T]: T[K];
|
|
45
|
+
} & {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { NodeConfig } from '../types/node';
|
|
2
|
+
|
|
3
|
+
interface SelectedCell {
|
|
4
|
+
label: string;
|
|
5
|
+
nodeType: string;
|
|
6
|
+
cell: any;
|
|
7
|
+
}
|
|
8
|
+
interface Props {
|
|
9
|
+
selectedCell: SelectedCell | null;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
"update:label": (value: string) => void;
|
|
13
|
+
"update:config": (value: Partial<NodeConfig>) => void;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
15
|
+
"onUpdate:label"?: ((value: string) => any) | undefined;
|
|
16
|
+
"onUpdate:config"?: ((value: Partial<NodeConfig>) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
18
|
+
export default _default;
|
|
19
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
20
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
21
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
22
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
23
|
+
} : {
|
|
24
|
+
type: import('vue').PropType<T[K]>;
|
|
25
|
+
required: true;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
showClose?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
5
|
+
clear: () => void;
|
|
6
|
+
validate: () => void;
|
|
7
|
+
save: () => void;
|
|
8
|
+
close: () => void;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
10
|
+
onSave?: (() => any) | undefined;
|
|
11
|
+
onClear?: (() => any) | undefined;
|
|
12
|
+
onClose?: (() => any) | undefined;
|
|
13
|
+
onValidate?: (() => any) | undefined;
|
|
14
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
15
|
+
export default _default;
|
|
16
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
17
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
18
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
19
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
20
|
+
} : {
|
|
21
|
+
type: import('vue').PropType<T[K]>;
|
|
22
|
+
required: true;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ClearTimerNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<ClearTimerNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<ClearTimerNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<ClearTimerNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ConditionNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<ConditionNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<ConditionNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<ConditionNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { CustomCodeNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<CustomCodeNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<CustomCodeNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<CustomCodeNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { GetPropertyNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<GetPropertyNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<GetPropertyNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<GetPropertyNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { HttpRequestNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<HttpRequestNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<HttpRequestNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<HttpRequestNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { SetPropertyNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<SetPropertyNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<SetPropertyNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<SetPropertyNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { TimerNodeConfig } from '../../types/node';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
modelValue: Partial<TimerNodeConfig>;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:modelValue": (value: Partial<TimerNodeConfig>) => void;
|
|
8
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
9
|
+
"onUpdate:modelValue"?: ((value: Partial<TimerNodeConfig>) => any) | undefined;
|
|
10
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
11
|
+
export default _default;
|
|
12
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
13
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
14
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
15
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
16
|
+
} : {
|
|
17
|
+
type: import('vue').PropType<T[K]>;
|
|
18
|
+
required: true;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
import { ElementInfo } from '../components/ElementSelector';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 画布图元服务类
|
|
6
|
+
*/
|
|
7
|
+
declare class CanvasElementService {
|
|
8
|
+
private graph;
|
|
9
|
+
/**
|
|
10
|
+
* 设置画布实例
|
|
11
|
+
*/
|
|
12
|
+
setGraph(graph: Graph | null): void;
|
|
13
|
+
/**
|
|
14
|
+
* 获取画布所有图元
|
|
15
|
+
*/
|
|
16
|
+
getElements(): ElementInfo[];
|
|
17
|
+
/**
|
|
18
|
+
* 获取图元的可配置属性列表(仅返回组件 props 中定义的属性)
|
|
19
|
+
*/
|
|
20
|
+
private getElementProperties;
|
|
21
|
+
/**
|
|
22
|
+
* 根据ID获取图元
|
|
23
|
+
*/
|
|
24
|
+
getElementById(id: string): ElementInfo | null;
|
|
25
|
+
/**
|
|
26
|
+
* 搜索图元
|
|
27
|
+
*/
|
|
28
|
+
searchElements(keyword: string): ElementInfo[];
|
|
29
|
+
}
|
|
30
|
+
export declare const canvasElementService: CanvasElementService;
|
|
31
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
export declare enum NodeTypeEnum {
|
|
2
|
+
START = "start",
|
|
3
|
+
END = "end",
|
|
4
|
+
GET_PROPERTY = "getProperty",
|
|
5
|
+
SET_PROPERTY = "setProperty",
|
|
6
|
+
CONDITION = "condition",
|
|
7
|
+
HTTP_REQUEST = "httpRequest",
|
|
8
|
+
CUSTOM_CODE = "customCode",
|
|
9
|
+
TIMER = "timer",
|
|
10
|
+
CLEAR_TIMER = "clearTimer"
|
|
11
|
+
}
|
|
12
|
+
export interface NodeType {
|
|
13
|
+
type: string;
|
|
14
|
+
name: string;
|
|
15
|
+
icon: string;
|
|
16
|
+
description: string;
|
|
17
|
+
color: string;
|
|
18
|
+
}
|
|
19
|
+
export interface BaseNodeConfig {
|
|
20
|
+
id: string;
|
|
21
|
+
name: string;
|
|
22
|
+
type: NodeTypeEnum;
|
|
23
|
+
}
|
|
24
|
+
export interface GetPropertyNodeConfig extends BaseNodeConfig {
|
|
25
|
+
type: NodeTypeEnum.GET_PROPERTY;
|
|
26
|
+
elementId: string;
|
|
27
|
+
propertyName: string;
|
|
28
|
+
outputVariable: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SetPropertyNodeConfig extends BaseNodeConfig {
|
|
31
|
+
type: NodeTypeEnum.SET_PROPERTY;
|
|
32
|
+
elementId: string;
|
|
33
|
+
propertyName: string;
|
|
34
|
+
value: string | number;
|
|
35
|
+
}
|
|
36
|
+
export interface ConditionBranch {
|
|
37
|
+
id: string;
|
|
38
|
+
label: string;
|
|
39
|
+
operator?: 'eq' | 'ne' | 'gt' | 'gte' | 'lt' | 'lte' | 'contains' | 'notContains';
|
|
40
|
+
value?: string | number | boolean;
|
|
41
|
+
isDefault?: boolean;
|
|
42
|
+
}
|
|
43
|
+
export interface ConditionNodeConfig extends BaseNodeConfig {
|
|
44
|
+
type: NodeTypeEnum.CONDITION;
|
|
45
|
+
sourceNodeId: string;
|
|
46
|
+
dataType: 'boolean' | 'number' | 'string' | 'any';
|
|
47
|
+
branches: ConditionBranch[];
|
|
48
|
+
}
|
|
49
|
+
export interface HttpRequestNodeConfig extends BaseNodeConfig {
|
|
50
|
+
type: NodeTypeEnum.HTTP_REQUEST;
|
|
51
|
+
url: string;
|
|
52
|
+
method: 'GET' | 'POST' | 'PUT' | 'DELETE';
|
|
53
|
+
headers: Record<string, string>;
|
|
54
|
+
body?: string;
|
|
55
|
+
outputVariable: string;
|
|
56
|
+
}
|
|
57
|
+
export interface CustomCodeNodeConfig extends BaseNodeConfig {
|
|
58
|
+
type: NodeTypeEnum.CUSTOM_CODE;
|
|
59
|
+
code: string;
|
|
60
|
+
}
|
|
61
|
+
export interface TimerNodeConfig extends BaseNodeConfig {
|
|
62
|
+
type: NodeTypeEnum.TIMER;
|
|
63
|
+
interval: number;
|
|
64
|
+
unit: 'ms' | 's' | 'm' | 'h';
|
|
65
|
+
}
|
|
66
|
+
export interface ClearTimerNodeConfig extends BaseNodeConfig {
|
|
67
|
+
type: NodeTypeEnum.CLEAR_TIMER;
|
|
68
|
+
timerId: string;
|
|
69
|
+
}
|
|
70
|
+
export type NodeConfig = GetPropertyNodeConfig | SetPropertyNodeConfig | ConditionNodeConfig | HttpRequestNodeConfig | CustomCodeNodeConfig | TimerNodeConfig | ClearTimerNodeConfig;
|