@nywqs/scada-engine 1.1.25 → 1.1.26
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 +1 -1
- package/dist/index.d.ts +3 -159
- package/dist/scada-engine.css +1 -1
- package/dist/scada-engine.es.js +22244 -10991
- package/dist/scada-engine.umd.js +34 -17
- package/dist/{components → src/components}/BindingCard.d.ts +4 -0
- package/dist/src/components/ComponentLibrary.d.ts +34 -0
- package/dist/src/components/ContextMenu.d.ts +63 -0
- package/dist/src/components/DataPropertiesTab.d.ts +26 -0
- package/dist/{components/PropertyPanel.d.ts → src/components/DataSourceDialog.d.ts} +10 -12
- package/dist/{components → src/components}/DevicePointSelector.d.ts +7 -3
- package/dist/{components → src/components}/Header.d.ts +2 -0
- package/dist/src/components/PropertyPanel.d.ts +45 -0
- package/dist/src/index.d.ts +158 -0
- package/dist/{scada-components → src/scada-components}/types.d.ts +1 -0
- package/dist/src/services/dataSourceManager.d.ts +121 -0
- package/dist/src/services/mqttService.d.ts +110 -0
- package/dist/src/utils/canvasConfigWatcher.d.ts +39 -0
- package/dist/src/utils/canvasDataHandler.d.ts +70 -0
- package/dist/src/utils/contextMenuManager.d.ts +27 -0
- package/dist/src/utils/dataBindingService.d.ts +42 -0
- package/dist/src/utils/edgeOperations.d.ts +57 -0
- package/dist/src/utils/eventManager.d.ts +62 -0
- package/dist/src/utils/graphOperations.d.ts +85 -0
- package/dist/src/utils/index.d.ts +18 -0
- package/dist/src/utils/nodeOperations.d.ts +77 -0
- package/dist/src/utils/storageUtils.d.ts +32 -0
- package/package.json +2 -1
- package/dist/components/ComponentLibrary.d.ts +0 -6
- package/dist/components/DataPropertiesTab.d.ts +0 -42
- package/dist/mock/deviceData.d.ts +0 -39
- package/dist/utils/index.d.ts +0 -10
- package/dist/utils/storageUtils.d.ts +0 -55
- package/dist/views/preview/PreviewView.d.ts +0 -3
- package/dist/{components → src/components}/AttributeConfigDialog.d.ts +0 -0
- package/dist/{components → src/components}/BasicPropertiesTab.d.ts +0 -0
- package/dist/{components → src/components}/CanvasArea.d.ts +0 -0
- package/dist/{components → src/components}/CanvasConfigPanel.d.ts +0 -0
- package/dist/{components → src/components}/CustomCodeDialog.d.ts +0 -0
- package/dist/{components → src/components}/EdgePropertiesTab.d.ts +0 -0
- package/dist/{components → src/components}/EventCard.d.ts +0 -0
- package/dist/{components → src/components}/Footer.d.ts +0 -0
- package/dist/{components → src/components}/MappingConfigurator.d.ts +0 -0
- package/dist/{components → src/components}/WorkflowSelectorDialog.d.ts +0 -0
- package/dist/{main.d.ts → src/main.d.ts} +0 -0
- package/dist/{scada-components → src/scada-components}/basic/circle.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/basic/index.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/basic/rect.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/basic/text.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/canvas/config.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/canvas/index.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/canvas/manager.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/canvas/types.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/index.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/AlarmLight3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Conveyor3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Cylinder3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/EChartsGauge.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/EChartsLine.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Filter3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/HeatExchanger3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Light3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Motor3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Pipe3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Pump3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Switch3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Tank3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Tee3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/TemperatureSensor3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/Valve3D.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/echarts-gauge-presets.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/echarts-gauge.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/echarts-line-presets.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/echarts-line.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/index.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/industrial-3d-extended.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/industrial-3d-fluid.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/industrial-3d.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/light.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/iot/switch.d.ts +0 -0
- package/dist/{scada-components → src/scada-components}/registry.d.ts +0 -0
- package/dist/{types → src/types}/binding.d.ts +0 -0
- package/dist/{types → src/types}/device.d.ts +0 -0
- package/dist/{types → src/types}/workflow.d.ts +0 -0
- package/dist/{utils → src/utils}/animationEngine.d.ts +0 -0
- package/dist/{utils → src/utils}/authCrypto.d.ts +0 -0
- package/dist/{utils → src/utils}/commonUtils.d.ts +0 -0
- package/dist/{utils → src/utils}/eventUtils.d.ts +0 -0
- package/dist/{utils → src/utils}/fileUtils.d.ts +0 -0
- package/dist/{utils → src/utils}/messageUtils.d.ts +0 -0
- package/dist/{utils → src/utils}/nodePropertyUtils.d.ts +0 -0
- package/dist/{views → src/views}/workflow/WorkflowDialog.d.ts +1 -1
- /package/dist/{views → src/views}/workflow/WorkflowEditor.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/AddNodeMenu.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/ElementSelector.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/PropertyPanel.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/WorkflowToolbar.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/ClearTimerConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/ConditionConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/CustomCodeConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/GetPropertyConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/HttpRequestConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/SetPropertyConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/components/node-configs/TimerConfig.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/config/nodeConfigRegistry.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/services/canvasElementService.d.ts +0 -0
- /package/dist/{views → src/views}/workflow/types/node.d.ts +0 -0
|
@@ -11,6 +11,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
11
11
|
isCollapsed: boolean;
|
|
12
12
|
nodeProperties: NodeProperty[];
|
|
13
13
|
deviceData?: any;
|
|
14
|
+
nodeDeviceId?: string;
|
|
15
|
+
nodeDeviceName?: string;
|
|
14
16
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
17
|
"toggle-collapse": () => void;
|
|
16
18
|
remove: () => void;
|
|
@@ -21,6 +23,8 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
|
|
|
21
23
|
isCollapsed: boolean;
|
|
22
24
|
nodeProperties: NodeProperty[];
|
|
23
25
|
deviceData?: any;
|
|
26
|
+
nodeDeviceId?: string;
|
|
27
|
+
nodeDeviceName?: string;
|
|
24
28
|
}>>> & Readonly<{
|
|
25
29
|
"onToggle-collapse"?: (() => any) | undefined;
|
|
26
30
|
onRemove?: (() => any) | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
isCollapsed?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
5
|
+
isCollapsed: boolean;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
addComponent: (type: string) => void;
|
|
8
|
+
"update:collapsed": (value: boolean) => void;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
|
+
isCollapsed: boolean;
|
|
11
|
+
}>>> & Readonly<{
|
|
12
|
+
onAddComponent?: ((type: string) => any) | undefined;
|
|
13
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
isCollapsed: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
export interface MenuItem {
|
|
2
|
+
key: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
icon?: string;
|
|
5
|
+
hotkey?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
divider?: boolean;
|
|
8
|
+
onClick?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface Props {
|
|
11
|
+
visible: boolean;
|
|
12
|
+
position: {
|
|
13
|
+
x: number;
|
|
14
|
+
y: number;
|
|
15
|
+
};
|
|
16
|
+
menuItems: MenuItem[];
|
|
17
|
+
}
|
|
18
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
19
|
+
visible: boolean;
|
|
20
|
+
position: () => {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
};
|
|
24
|
+
menuItems: () => never[];
|
|
25
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
26
|
+
"update:visible": (value: boolean) => void;
|
|
27
|
+
"menu-click": (key: string) => void;
|
|
28
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
29
|
+
visible: boolean;
|
|
30
|
+
position: () => {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
menuItems: () => never[];
|
|
35
|
+
}>>> & Readonly<{
|
|
36
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
37
|
+
"onMenu-click"?: ((key: string) => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
position: {
|
|
40
|
+
x: number;
|
|
41
|
+
y: number;
|
|
42
|
+
};
|
|
43
|
+
visible: boolean;
|
|
44
|
+
menuItems: MenuItem[];
|
|
45
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
46
|
+
export default _default;
|
|
47
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
48
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
49
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
50
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
51
|
+
} : {
|
|
52
|
+
type: import('vue').PropType<T[K]>;
|
|
53
|
+
required: true;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
type __VLS_WithDefaults<P, D> = {
|
|
57
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
58
|
+
default: D[K];
|
|
59
|
+
}> : P[K];
|
|
60
|
+
};
|
|
61
|
+
type __VLS_Prettify<T> = {
|
|
62
|
+
[K in keyof T]: T[K];
|
|
63
|
+
} & {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Node } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
selectedNode: Node;
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update-data-source": (config: {
|
|
8
|
+
dataSourceId: string;
|
|
9
|
+
deviceId: string;
|
|
10
|
+
}) => void;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
12
|
+
"onUpdate-data-source"?: ((config: {
|
|
13
|
+
dataSourceId: string;
|
|
14
|
+
deviceId: string;
|
|
15
|
+
}) => any) | undefined;
|
|
16
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
@@ -1,20 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataSource } from '../services/dataSourceManager';
|
|
2
2
|
|
|
3
3
|
interface Props {
|
|
4
|
-
|
|
5
|
-
selectedEdge: Edge | null;
|
|
6
|
-
deviceData?: any;
|
|
4
|
+
dataSources: DataSource[];
|
|
7
5
|
}
|
|
8
6
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
save: (dataSource: DataSource) => void;
|
|
8
|
+
delete: (id: string) => void;
|
|
9
|
+
add: (dataSource: Omit<DataSource, "id" | "status" | "devices">) => void;
|
|
10
|
+
close: () => void;
|
|
13
11
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
onSave?: ((dataSource: DataSource) => any) | undefined;
|
|
13
|
+
onDelete?: ((id: string) => any) | undefined;
|
|
14
|
+
onAdd?: ((dataSource: Omit<DataSource, "id" | "status" | "devices">) => any) | undefined;
|
|
15
|
+
onClose?: (() => any) | undefined;
|
|
18
16
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
19
17
|
export default _default;
|
|
20
18
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -1,21 +1,25 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DevicePoint } from '../types/device';
|
|
2
2
|
|
|
3
3
|
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
4
|
visible: boolean;
|
|
5
|
+
deviceId: string;
|
|
6
|
+
deviceName?: string;
|
|
5
7
|
modelValue?: string;
|
|
6
8
|
deviceData?: any;
|
|
7
9
|
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
8
10
|
"update:visible": (value: boolean) => void;
|
|
9
11
|
"update:modelValue": (value: string) => void;
|
|
10
|
-
confirm: (
|
|
12
|
+
confirm: (pointId: string, point: DevicePoint) => void;
|
|
11
13
|
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
12
14
|
visible: boolean;
|
|
15
|
+
deviceId: string;
|
|
16
|
+
deviceName?: string;
|
|
13
17
|
modelValue?: string;
|
|
14
18
|
deviceData?: any;
|
|
15
19
|
}>>> & Readonly<{
|
|
16
20
|
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
17
21
|
"onUpdate:modelValue"?: ((value: string) => any) | undefined;
|
|
18
|
-
onConfirm?: ((
|
|
22
|
+
onConfirm?: ((pointId: string, point: DevicePoint) => any) | undefined;
|
|
19
23
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
20
24
|
export default _default;
|
|
21
25
|
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
@@ -12,6 +12,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
12
12
|
workflow: () => void;
|
|
13
13
|
preview: () => void;
|
|
14
14
|
export: () => void;
|
|
15
|
+
dataSource: () => void;
|
|
15
16
|
zoomIn: () => void;
|
|
16
17
|
zoomOut: () => void;
|
|
17
18
|
clearAll: () => void;
|
|
@@ -31,6 +32,7 @@ declare const __VLS_component: import('vue').DefineComponent<import('vue').Extra
|
|
|
31
32
|
onWorkflow?: (() => any) | undefined;
|
|
32
33
|
onPreview?: (() => any) | undefined;
|
|
33
34
|
onExport?: (() => any) | undefined;
|
|
35
|
+
onDataSource?: (() => any) | undefined;
|
|
34
36
|
onZoomIn?: (() => any) | undefined;
|
|
35
37
|
onZoomOut?: (() => any) | undefined;
|
|
36
38
|
onClearAll?: (() => any) | undefined;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Node, Edge } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
selectedNode: Node | null;
|
|
5
|
+
selectedEdge: Edge | null;
|
|
6
|
+
deviceData?: any;
|
|
7
|
+
isCollapsed?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
|
+
isCollapsed: boolean;
|
|
11
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
"update:collapsed": (value: boolean) => void;
|
|
13
|
+
updateEdge: (data: any) => void;
|
|
14
|
+
deleteEdge: () => void;
|
|
15
|
+
updateNode: (data: any) => void;
|
|
16
|
+
deleteNode: () => void;
|
|
17
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
18
|
+
isCollapsed: boolean;
|
|
19
|
+
}>>> & Readonly<{
|
|
20
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
21
|
+
onUpdateEdge?: ((data: any) => any) | undefined;
|
|
22
|
+
onDeleteEdge?: (() => any) | undefined;
|
|
23
|
+
onUpdateNode?: ((data: any) => any) | undefined;
|
|
24
|
+
onDeleteNode?: (() => any) | undefined;
|
|
25
|
+
}>, {
|
|
26
|
+
isCollapsed: boolean;
|
|
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,158 @@
|
|
|
1
|
+
import { App } from 'vue';
|
|
2
|
+
import { Graph } from '@antv/x6';
|
|
3
|
+
import { default as ScadaCanvas } from './components/ScadaCanvas';
|
|
4
|
+
import { default as PropertyPanel } from './components/PropertyPanel';
|
|
5
|
+
import { default as Header } from './components/Header';
|
|
6
|
+
import { default as ComponentLibrary } from './components/ComponentLibrary';
|
|
7
|
+
import { default as CanvasConfigPanel } from './components/CanvasConfigPanel';
|
|
8
|
+
import { default as BindingCard } from './components/BindingCard';
|
|
9
|
+
import { default as EventCard } from './components/EventCard';
|
|
10
|
+
import { default as BasicPropertiesTab } from './components/BasicPropertiesTab';
|
|
11
|
+
import { default as AttributeConfigDialog } from './components/AttributeConfigDialog';
|
|
12
|
+
import { default as CustomCodeDialog } from './components/CustomCodeDialog';
|
|
13
|
+
|
|
14
|
+
export * from './scada-components';
|
|
15
|
+
export { componentRegistry } from './scada-components/registry';
|
|
16
|
+
export type { ComponentConfig, ComponentRegistry, ComponentCategory, ComponentMetadata, ComponentProp, ComponentData, NodeAttrs, PropType } from './scada-components/types';
|
|
17
|
+
export { canvasConfigManager } from './scada-components/canvas';
|
|
18
|
+
export type { CanvasConfig, CanvasConfigItem, CanvasSizePreset, BackgroundSize, BackgroundRepeat } from './scada-components/canvas';
|
|
19
|
+
export { showMessage, saveToLocal, loadFromLocal, removeFromLocal, STORAGE_KEYS, exportToJSON, randomPosition, formatTimestamp, getCurrentTimestamp, generateUniqueId, generateEventId, generateNodeId } from './utils';
|
|
20
|
+
export { animationEngine } from './utils/animationEngine';
|
|
21
|
+
export { registerNodeEvents } from './utils/eventUtils';
|
|
22
|
+
export type { Device, DevicePoint, DeviceList, PointValueUpdate } from './types/device';
|
|
23
|
+
export { DeviceStatus, DeviceType, PointDataType, PointAccessMode } from './types/device';
|
|
24
|
+
export interface EventConfig {
|
|
25
|
+
id?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
type: string;
|
|
28
|
+
conditionType?: string;
|
|
29
|
+
condition?: {
|
|
30
|
+
attribute?: string;
|
|
31
|
+
operator?: string;
|
|
32
|
+
value?: any;
|
|
33
|
+
};
|
|
34
|
+
action: string;
|
|
35
|
+
params?: Record<string, any>;
|
|
36
|
+
}
|
|
37
|
+
export interface BindingConfig {
|
|
38
|
+
id?: string;
|
|
39
|
+
type: string;
|
|
40
|
+
deviceId?: string;
|
|
41
|
+
dataPoint?: string;
|
|
42
|
+
attribute?: string;
|
|
43
|
+
eventId?: string;
|
|
44
|
+
transform?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* ScadaCanvas 组件暴露的 API 类型定义
|
|
48
|
+
*/
|
|
49
|
+
export interface ScadaCanvasExposed {
|
|
50
|
+
/** 保存画布数据到 localStorage */
|
|
51
|
+
save: () => void;
|
|
52
|
+
/** 触发文件选择,导入 JSON 数据 */
|
|
53
|
+
import: () => void;
|
|
54
|
+
/** 导出画布数据为 JSON 文件 */
|
|
55
|
+
export: () => void;
|
|
56
|
+
/** 跳转到预览页面 */
|
|
57
|
+
preview: () => void;
|
|
58
|
+
/** 打开流程编排弹窗 */
|
|
59
|
+
workflow: () => void;
|
|
60
|
+
/** 放大画布 */
|
|
61
|
+
zoomIn: () => void;
|
|
62
|
+
/** 缩小画布 */
|
|
63
|
+
zoomOut: () => void;
|
|
64
|
+
/** 清空画布所有元素 */
|
|
65
|
+
clearAll: () => void;
|
|
66
|
+
/** 添加节点 */
|
|
67
|
+
addNode: (type: string) => void;
|
|
68
|
+
/** 更新节点 */
|
|
69
|
+
updateNode: (data: any) => void;
|
|
70
|
+
/** 删除当前选中的节点 */
|
|
71
|
+
deleteNode: () => void;
|
|
72
|
+
/** 获取当前选中的节点 */
|
|
73
|
+
getSelectedNode: () => any;
|
|
74
|
+
/** 选中节点 */
|
|
75
|
+
selectNode: (nodeId: string) => boolean;
|
|
76
|
+
/** 取消选中 */
|
|
77
|
+
clearSelection: () => void;
|
|
78
|
+
/** 获取 X6 Graph 实例 */
|
|
79
|
+
getGraph: () => Graph | null;
|
|
80
|
+
/** 获取画布完整数据 */
|
|
81
|
+
getCanvasData: () => CanvasData | null;
|
|
82
|
+
/** 加载画布数据 */
|
|
83
|
+
loadCanvasData: (data: any) => boolean;
|
|
84
|
+
/** 获取所有节点 */
|
|
85
|
+
getAllNodes: () => NodeData[];
|
|
86
|
+
/** 根据ID获取节点 */
|
|
87
|
+
getNodeById: (nodeId: string) => NodeData | null;
|
|
88
|
+
/** 获取画布配置管理器 */
|
|
89
|
+
getConfigManager: () => any;
|
|
90
|
+
/** 更新画布配置 */
|
|
91
|
+
updateCanvasConfig: (config: any) => void;
|
|
92
|
+
/** 设置画布缩放 */
|
|
93
|
+
setZoom: (scale: number) => void;
|
|
94
|
+
/** 设置画布大小 */
|
|
95
|
+
setCanvasSize: (width: number, height: number) => void;
|
|
96
|
+
/** 设置背景颜色 */
|
|
97
|
+
setBackgroundColor: (color: string) => void;
|
|
98
|
+
/** 获取动画引擎 */
|
|
99
|
+
getAnimationEngine: () => any;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* 节点数据结构
|
|
103
|
+
*/
|
|
104
|
+
export interface NodeData {
|
|
105
|
+
id: string;
|
|
106
|
+
type: string;
|
|
107
|
+
position: {
|
|
108
|
+
x: number;
|
|
109
|
+
y: number;
|
|
110
|
+
};
|
|
111
|
+
size: {
|
|
112
|
+
width: number;
|
|
113
|
+
height: number;
|
|
114
|
+
};
|
|
115
|
+
label: string;
|
|
116
|
+
data: any;
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* 画布数据结构
|
|
120
|
+
*/
|
|
121
|
+
export interface CanvasData {
|
|
122
|
+
/** 版本号 */
|
|
123
|
+
version: string;
|
|
124
|
+
/** 时间戳 */
|
|
125
|
+
timestamp: string;
|
|
126
|
+
/** 画布配置 */
|
|
127
|
+
config: any;
|
|
128
|
+
/** X6 画布元素 */
|
|
129
|
+
cells: any[];
|
|
130
|
+
/** 节点数据 */
|
|
131
|
+
nodes: Array<{
|
|
132
|
+
id: string;
|
|
133
|
+
type: string;
|
|
134
|
+
position: {
|
|
135
|
+
x: number;
|
|
136
|
+
y: number;
|
|
137
|
+
};
|
|
138
|
+
size: {
|
|
139
|
+
width: number;
|
|
140
|
+
height: number;
|
|
141
|
+
};
|
|
142
|
+
label: string;
|
|
143
|
+
data: any;
|
|
144
|
+
}>;
|
|
145
|
+
/** 连线数据 */
|
|
146
|
+
edges: Array<{
|
|
147
|
+
id: string;
|
|
148
|
+
source: string;
|
|
149
|
+
target: string;
|
|
150
|
+
}>;
|
|
151
|
+
}
|
|
152
|
+
export { ScadaCanvas, PropertyPanel, Header, ComponentLibrary, CanvasConfigPanel, BindingCard, EventCard, BasicPropertiesTab, AttributeConfigDialog, CustomCodeDialog, };
|
|
153
|
+
export declare const install: (app: App) => void;
|
|
154
|
+
declare const _default: {
|
|
155
|
+
install: (app: App) => void;
|
|
156
|
+
version: string;
|
|
157
|
+
};
|
|
158
|
+
export default _default;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数据源管理服务
|
|
3
|
+
* 统一管理多个数据源连接(MQTT、WebSocket、HTTP等)
|
|
4
|
+
*/
|
|
5
|
+
export interface DataSource {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type: 'MQTT' | 'WebSocket' | 'HTTP' | 'SSE';
|
|
9
|
+
enabled: boolean;
|
|
10
|
+
config: {
|
|
11
|
+
broker?: string;
|
|
12
|
+
topic?: string;
|
|
13
|
+
clientId?: string;
|
|
14
|
+
username?: string;
|
|
15
|
+
password?: string;
|
|
16
|
+
wsUrl?: string;
|
|
17
|
+
url?: string;
|
|
18
|
+
method?: string;
|
|
19
|
+
pollInterval?: number;
|
|
20
|
+
headers?: Record<string, string>;
|
|
21
|
+
sseUrl?: string;
|
|
22
|
+
eventType?: string;
|
|
23
|
+
dataPath?: string;
|
|
24
|
+
retryCount?: number;
|
|
25
|
+
};
|
|
26
|
+
status?: {
|
|
27
|
+
connected: boolean;
|
|
28
|
+
lastUpdate?: string;
|
|
29
|
+
error?: string;
|
|
30
|
+
};
|
|
31
|
+
devices: Array<{
|
|
32
|
+
id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
points: Array<{
|
|
35
|
+
id: string;
|
|
36
|
+
value: any;
|
|
37
|
+
quality?: string;
|
|
38
|
+
timestamp?: string;
|
|
39
|
+
}>;
|
|
40
|
+
}>;
|
|
41
|
+
}
|
|
42
|
+
export declare class DataSourceManager {
|
|
43
|
+
private dataSources;
|
|
44
|
+
private connections;
|
|
45
|
+
private onDataCallbacks;
|
|
46
|
+
/**
|
|
47
|
+
* 添加数据源
|
|
48
|
+
*/
|
|
49
|
+
addDataSource(dataSource: DataSource): void;
|
|
50
|
+
/**
|
|
51
|
+
* 更新数据源
|
|
52
|
+
*/
|
|
53
|
+
updateDataSource(id: string, updates: Partial<DataSource>): void;
|
|
54
|
+
/**
|
|
55
|
+
* 删除数据源
|
|
56
|
+
*/
|
|
57
|
+
removeDataSource(id: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* 获取数据源
|
|
60
|
+
*/
|
|
61
|
+
getDataSource(id: string): DataSource | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* 获取所有数据源
|
|
64
|
+
*/
|
|
65
|
+
getAllDataSources(): DataSource[];
|
|
66
|
+
/**
|
|
67
|
+
* 获取所有设备(来自所有数据源)
|
|
68
|
+
*/
|
|
69
|
+
getAllDevices(): Array<{
|
|
70
|
+
dataSourceId: string;
|
|
71
|
+
dataSourceName: string;
|
|
72
|
+
device: any;
|
|
73
|
+
}>;
|
|
74
|
+
/**
|
|
75
|
+
* 连接数据源
|
|
76
|
+
*/
|
|
77
|
+
private connectDataSource;
|
|
78
|
+
/**
|
|
79
|
+
* 断开数据源连接
|
|
80
|
+
*/
|
|
81
|
+
private disconnectDataSource;
|
|
82
|
+
/**
|
|
83
|
+
* 重新连接数据源
|
|
84
|
+
*/
|
|
85
|
+
private reconnectDataSource;
|
|
86
|
+
/**
|
|
87
|
+
* 连接 MQTT
|
|
88
|
+
*/
|
|
89
|
+
private connectMqtt;
|
|
90
|
+
/**
|
|
91
|
+
* 连接 WebSocket
|
|
92
|
+
*/
|
|
93
|
+
private connectWebSocket;
|
|
94
|
+
/**
|
|
95
|
+
* 连接 HTTP
|
|
96
|
+
*/
|
|
97
|
+
private connectHttp;
|
|
98
|
+
/**
|
|
99
|
+
* 连接 SSE
|
|
100
|
+
*/
|
|
101
|
+
private connectSSE;
|
|
102
|
+
/**
|
|
103
|
+
* 处理接收到的设备数据
|
|
104
|
+
*/
|
|
105
|
+
private handleDeviceData;
|
|
106
|
+
/**
|
|
107
|
+
* 注册数据接收回调
|
|
108
|
+
*/
|
|
109
|
+
onData(callback: (dataSourceId: string, deviceData: any) => void): void;
|
|
110
|
+
/**
|
|
111
|
+
* 断开所有连接
|
|
112
|
+
*/
|
|
113
|
+
disconnectAll(): void;
|
|
114
|
+
/**
|
|
115
|
+
* 获取数据源状态
|
|
116
|
+
*/
|
|
117
|
+
getDataSourceStatus(id: string): {
|
|
118
|
+
connected: boolean;
|
|
119
|
+
} | null;
|
|
120
|
+
}
|
|
121
|
+
export declare const dataSourceManager: DataSourceManager;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MQTT 服务模块
|
|
3
|
+
* 负责 MQTT 连接管理和数据接收
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* MQTT 配置接口
|
|
7
|
+
*/
|
|
8
|
+
export interface MqttConfig {
|
|
9
|
+
/** 服务器地址 */
|
|
10
|
+
broker: string;
|
|
11
|
+
/** 客户端ID(可选,自动生成) */
|
|
12
|
+
clientId?: string;
|
|
13
|
+
/** 订阅主题 */
|
|
14
|
+
topic: string;
|
|
15
|
+
/** 用户名(可选) */
|
|
16
|
+
username?: string;
|
|
17
|
+
/** 密码(可选) */
|
|
18
|
+
password?: string;
|
|
19
|
+
/** 数据路径(用于解析嵌套数据,例如:value) */
|
|
20
|
+
dataPath?: string;
|
|
21
|
+
/** 启用状态 */
|
|
22
|
+
enabled?: boolean;
|
|
23
|
+
/** 错误重试次数 */
|
|
24
|
+
retryCount?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 设备点位数据接口
|
|
28
|
+
*/
|
|
29
|
+
export interface DevicePointData {
|
|
30
|
+
/** 点位 ID */
|
|
31
|
+
id: string;
|
|
32
|
+
/** 点位名称 */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** 点位编码 */
|
|
35
|
+
code?: string;
|
|
36
|
+
/** 数据类型 */
|
|
37
|
+
dataType?: 'boolean' | 'number' | 'string';
|
|
38
|
+
/** 访问权限 */
|
|
39
|
+
accessMode?: 'read' | 'write' | 'readWrite';
|
|
40
|
+
/** 点位值 */
|
|
41
|
+
value: any;
|
|
42
|
+
/** 数据质量 */
|
|
43
|
+
quality?: 'good' | 'bad' | 'uncertain';
|
|
44
|
+
/** 时间戳 */
|
|
45
|
+
timestamp?: string;
|
|
46
|
+
/** 单位 */
|
|
47
|
+
unit?: string;
|
|
48
|
+
/** 是否启用 */
|
|
49
|
+
enabled?: boolean;
|
|
50
|
+
/** 精度 */
|
|
51
|
+
precision?: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* 设备数据接口
|
|
55
|
+
*/
|
|
56
|
+
export interface DeviceData {
|
|
57
|
+
/** 设备ID */
|
|
58
|
+
id: string;
|
|
59
|
+
/** 设备名称 */
|
|
60
|
+
name?: string;
|
|
61
|
+
/** 点位数据 */
|
|
62
|
+
points: DevicePointData[];
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* MQTT 服务类
|
|
66
|
+
*/
|
|
67
|
+
export declare class MqttService {
|
|
68
|
+
private client;
|
|
69
|
+
private config;
|
|
70
|
+
private onDataCallback;
|
|
71
|
+
private onErrorCallback;
|
|
72
|
+
private isConnected;
|
|
73
|
+
/**
|
|
74
|
+
* 连接 MQTT 服务器
|
|
75
|
+
*/
|
|
76
|
+
connect(config: MqttConfig): Promise<void>;
|
|
77
|
+
/**
|
|
78
|
+
* 解析设备数据
|
|
79
|
+
* 支持多种数据格式
|
|
80
|
+
*/
|
|
81
|
+
private parseDeviceData;
|
|
82
|
+
/**
|
|
83
|
+
* 设置数据接收回调
|
|
84
|
+
*/
|
|
85
|
+
onData(callback: (data: DeviceData) => void): void;
|
|
86
|
+
/**
|
|
87
|
+
* 设置错误回调
|
|
88
|
+
*/
|
|
89
|
+
onError(callback: (error: Error) => void): void;
|
|
90
|
+
/**
|
|
91
|
+
* 发布消息
|
|
92
|
+
*/
|
|
93
|
+
publish(topic: string, message: string | object): void;
|
|
94
|
+
/**
|
|
95
|
+
* 断开连接
|
|
96
|
+
*/
|
|
97
|
+
disconnect(): void;
|
|
98
|
+
/**
|
|
99
|
+
* 获取连接状态
|
|
100
|
+
*/
|
|
101
|
+
getConnectionStatus(): boolean;
|
|
102
|
+
/**
|
|
103
|
+
* 获取当前配置
|
|
104
|
+
*/
|
|
105
|
+
getConfig(): MqttConfig | null;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* 创建 MQTT 服务实例
|
|
109
|
+
*/
|
|
110
|
+
export declare function createMqttService(): MqttService;
|