scada-engine 1.0.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/LICENSE +21 -0
- package/README.md +193 -0
- package/dist/draco/gltf/draco_decoder.js +33 -0
- package/dist/draco/gltf/draco_decoder.wasm +0 -0
- package/dist/draco/gltf/draco_encoder.js +33 -0
- package/dist/draco/gltf/draco_wasm_wrapper.js +116 -0
- package/dist/index.d.ts +3 -0
- package/dist/scada-engine.css +1 -0
- package/dist/scada-engine.es.js +22936 -0
- package/dist/scada-engine.umd.js +1356 -0
- package/dist/src/features/canvas/components/CanvasArea.d.ts +4 -0
- package/dist/src/features/canvas/components/CanvasConfigPanel.d.ts +2 -0
- package/dist/src/features/canvas/index.d.ts +9 -0
- package/dist/src/features/canvas/managers/configWatcher.d.ts +49 -0
- package/dist/src/features/canvas/managers/dataHandler.d.ts +70 -0
- package/dist/src/features/canvas/managers/layerManager.d.ts +88 -0
- package/dist/src/features/canvas/operations/edgeOperations.d.ts +52 -0
- package/dist/src/features/canvas/operations/graphOperations.d.ts +85 -0
- package/dist/src/features/canvas/operations/nodeOperations.d.ts +77 -0
- package/dist/src/features/data-source/components/DataSourceDialog.d.ts +26 -0
- package/dist/src/features/data-source/components/MappingConfigurator.d.ts +27 -0
- package/dist/src/features/data-source/index.d.ts +14 -0
- package/dist/src/features/data-source/services/dataBindingService.d.ts +86 -0
- package/dist/src/features/data-source/services/dataParser.d.ts +110 -0
- package/dist/src/features/data-source/services/dataSourceManager.d.ts +127 -0
- package/dist/src/features/data-source/services/httpService.d.ts +73 -0
- package/dist/src/features/data-source/services/mqttService.d.ts +110 -0
- package/dist/src/features/data-source/services/sseService.d.ts +75 -0
- package/dist/src/features/data-source/services/websocketService.d.ts +67 -0
- package/dist/src/features/data-source/types/dataAdapter.d.ts +184 -0
- package/dist/src/features/data-source/types/device.d.ts +131 -0
- package/dist/src/features/preview/Preview.d.ts +2 -0
- package/dist/src/features/preview/components/NodeTooltip.d.ts +62 -0
- package/dist/src/features/preview/index.d.ts +1 -0
- package/dist/src/features/property-panel/PropertyPanel.d.ts +45 -0
- package/dist/src/features/property-panel/cards/BindingCard.d.ts +39 -0
- package/dist/src/features/property-panel/cards/EventCard.d.ts +63 -0
- package/dist/src/features/property-panel/index.d.ts +6 -0
- package/dist/src/features/property-panel/tabs/BasicPropertiesTab.d.ts +51 -0
- package/dist/src/features/property-panel/tabs/DataPropertiesTab.d.ts +24 -0
- package/dist/src/features/property-panel/tabs/EdgePropertiesTab.d.ts +22 -0
- package/dist/src/features/workflow/WorkflowDialog.d.ts +37 -0
- package/dist/src/features/workflow/WorkflowEditor.d.ts +38 -0
- package/dist/src/features/workflow/components/AddNodeMenu.d.ts +32 -0
- package/dist/src/features/workflow/components/ElementSelector.d.ts +37 -0
- package/dist/src/features/workflow/components/PropertyPanel.d.ts +27 -0
- package/dist/src/features/workflow/components/WorkflowToolbar.d.ts +24 -0
- package/dist/src/features/workflow/components/node-configs/ClearTimerConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/ConditionConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/CustomCodeConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/GetPropertyConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/HttpRequestConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/SetPropertyConfig.d.ts +20 -0
- package/dist/src/features/workflow/components/node-configs/TimerConfig.d.ts +20 -0
- package/dist/src/features/workflow/config/nodeConfigRegistry.d.ts +5 -0
- package/dist/src/features/workflow/index.d.ts +6 -0
- package/dist/src/features/workflow/services/canvasElementService.d.ts +31 -0
- package/dist/src/features/workflow/types/element.d.ts +16 -0
- package/dist/src/features/workflow/types/node.d.ts +70 -0
- package/dist/src/index.d.ts +161 -0
- package/dist/src/main.d.ts +1 -0
- package/dist/src/scada-components/canvas/config.d.ts +17 -0
- package/dist/src/scada-components/canvas/index.d.ts +6 -0
- package/dist/src/scada-components/canvas/manager.d.ts +95 -0
- package/dist/src/scada-components/canvas/types.d.ts +77 -0
- package/dist/src/scada-components/chart/echarts-gauge/EChartsGauge.d.ts +14 -0
- package/dist/src/scada-components/chart/echarts-gauge/index.d.ts +6 -0
- package/dist/src/scada-components/chart/echarts-gauge/presets.d.ts +18 -0
- package/dist/src/scada-components/chart/echarts-line/EChartsLine.d.ts +14 -0
- package/dist/src/scada-components/chart/echarts-line/index.d.ts +6 -0
- package/dist/src/scada-components/chart/echarts-line/presets.d.ts +13 -0
- package/dist/src/scada-components/chart/index.d.ts +5 -0
- package/dist/src/scada-components/index.d.ts +7 -0
- package/dist/src/scada-components/registry.d.ts +117 -0
- package/dist/src/scada-components/types.d.ts +108 -0
- package/dist/src/shared/animation/animationEngine.d.ts +68 -0
- package/dist/src/shared/animation/animationScheduler.d.ts +85 -0
- package/dist/src/shared/animation/index.d.ts +2 -0
- package/dist/src/shared/components/ComponentLibrary.d.ts +34 -0
- package/dist/src/shared/components/ContextMenu.d.ts +63 -0
- package/dist/src/shared/components/Footer.d.ts +41 -0
- package/dist/src/shared/components/Header.d.ts +73 -0
- package/dist/src/shared/components/dialogs/AttributeConfigDialog.d.ts +39 -0
- package/dist/src/shared/components/dialogs/CustomCodeDialog.d.ts +30 -0
- package/dist/src/shared/components/dialogs/WorkflowSelectorDialog.d.ts +15 -0
- package/dist/src/shared/components/index.d.ts +8 -0
- package/dist/src/shared/components/selectors/ComponentPointSelector.d.ts +29 -0
- package/dist/src/shared/managers/contextMenuManager.d.ts +27 -0
- package/dist/src/shared/managers/eventManager.d.ts +62 -0
- package/dist/src/shared/managers/index.d.ts +3 -0
- package/dist/src/shared/managers/workerManager.d.ts +57 -0
- package/dist/src/shared/types/binding.d.ts +75 -0
- package/dist/src/shared/types/index.d.ts +2 -0
- package/dist/src/shared/types/workflow.d.ts +195 -0
- package/dist/src/shared/utils/commonUtils.d.ts +83 -0
- package/dist/src/shared/utils/edgeAnimationUtils.d.ts +16 -0
- package/dist/src/shared/utils/eventUtils.d.ts +43 -0
- package/dist/src/shared/utils/fileUtils.d.ts +43 -0
- package/dist/src/shared/utils/index.d.ts +7 -0
- package/dist/src/shared/utils/messageUtils.d.ts +56 -0
- package/dist/src/shared/utils/nodePropertyUtils.d.ts +33 -0
- package/dist/src/shared/utils/storageUtils.d.ts +32 -0
- package/dist/src/svg/core/index.d.ts +7 -0
- package/dist/src/svg/core/loader.d.ts +71 -0
- package/dist/src/svg/core/parser.d.ts +41 -0
- package/dist/src/svg/core/types.d.ts +297 -0
- package/dist/src/svg/helpers/demo.d.ts +20 -0
- package/dist/src/svg/helpers/index.d.ts +5 -0
- package/dist/src/svg/helpers/utils.d.ts +25 -0
- package/dist/src/svg/index.d.ts +9 -0
- package/dist/src/svg/rendering/SVGRenderer.d.ts +22 -0
- package/dist/src/svg/rendering/animationTemplates.d.ts +82 -0
- package/dist/src/svg/rendering/index.d.ts +6 -0
- package/dist/src/utils/authCrypto.d.ts +16 -0
- package/dist/src/utils/dracoLoader.d.ts +3 -0
- package/dist/src/utils/index.d.ts +29 -0
- package/dist/src/utils/viewportCulling.d.ts +63 -0
- package/dist/src/workers/dataProcessor.worker.d.ts +21 -0
- package/dist/utils-Ncgt7Dqu.js +1057 -0
- package/package.json +85 -0
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {
|
|
2
|
+
containerRef: import('vue').Ref<HTMLElement | undefined, HTMLElement | undefined>;
|
|
3
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
4
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { default as ScadaCanvas } from './components/ScadaCanvas';
|
|
2
|
+
export { default as CanvasArea } from './components/CanvasArea';
|
|
3
|
+
export { default as CanvasConfigPanel } from './components/CanvasConfigPanel';
|
|
4
|
+
export * from './managers/configWatcher';
|
|
5
|
+
export * from './managers/dataHandler';
|
|
6
|
+
export * from './managers/layerManager';
|
|
7
|
+
export * from './operations/nodeOperations';
|
|
8
|
+
export * from './operations/edgeOperations';
|
|
9
|
+
export * from './operations/graphOperations';
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
import { Ref } from 'vue';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 画布配置监听器类
|
|
6
|
+
*/
|
|
7
|
+
export declare class CanvasConfigWatcher {
|
|
8
|
+
private graph;
|
|
9
|
+
private containerRef;
|
|
10
|
+
private calculateFitScale;
|
|
11
|
+
private updateContainerSizeFn;
|
|
12
|
+
private snaplinePlugin;
|
|
13
|
+
/**
|
|
14
|
+
* 初始化配置监听器
|
|
15
|
+
*/
|
|
16
|
+
initialize(graph: Graph, containerRef: Ref<any>, calculateFitScale: () => number, updateContainerSizeFn?: () => void): void;
|
|
17
|
+
/**
|
|
18
|
+
* 初始化Snapline插件
|
|
19
|
+
*/
|
|
20
|
+
private initializeSnapline;
|
|
21
|
+
/**
|
|
22
|
+
* 应用配置变化到 Graph
|
|
23
|
+
*/
|
|
24
|
+
applyConfigChanges(): void;
|
|
25
|
+
/**
|
|
26
|
+
* 更新背景
|
|
27
|
+
*/
|
|
28
|
+
private updateBackground;
|
|
29
|
+
/**
|
|
30
|
+
* 更新尺寸和缩放
|
|
31
|
+
*/
|
|
32
|
+
private updateSizeAndScale;
|
|
33
|
+
/**
|
|
34
|
+
* 更新网格
|
|
35
|
+
*/
|
|
36
|
+
private updateGrid;
|
|
37
|
+
/**
|
|
38
|
+
* 更新参考线
|
|
39
|
+
*/
|
|
40
|
+
private updateGuides;
|
|
41
|
+
/**
|
|
42
|
+
* 清理资源
|
|
43
|
+
*/
|
|
44
|
+
destroy(): void;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* 导出配置监听器单例
|
|
48
|
+
*/
|
|
49
|
+
export declare const canvasConfigWatcher: CanvasConfigWatcher;
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 画布数据接口
|
|
5
|
+
*/
|
|
6
|
+
export interface CanvasData {
|
|
7
|
+
version?: string;
|
|
8
|
+
timestamp?: string;
|
|
9
|
+
config?: any;
|
|
10
|
+
cells: any[];
|
|
11
|
+
nodes?: any[];
|
|
12
|
+
edges?: any[];
|
|
13
|
+
dataSources?: any[];
|
|
14
|
+
workflows?: any[];
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* 画布数据处理类
|
|
18
|
+
*/
|
|
19
|
+
export declare class CanvasDataHandler {
|
|
20
|
+
private graph;
|
|
21
|
+
/**
|
|
22
|
+
* 设置 Graph 实例
|
|
23
|
+
*/
|
|
24
|
+
setGraph(graph: Graph | null): void;
|
|
25
|
+
/**
|
|
26
|
+
* 保存画布数据到 localStorage
|
|
27
|
+
*/
|
|
28
|
+
saveToLocal(): boolean;
|
|
29
|
+
/**
|
|
30
|
+
* 从 localStorage 加载画布数据
|
|
31
|
+
*/
|
|
32
|
+
loadFromLocal(onEdgeAnimationRestore?: (edge: any) => void): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* 清理单元格数据(修复损坏的数据)
|
|
35
|
+
*/
|
|
36
|
+
private cleanCellsData;
|
|
37
|
+
/**
|
|
38
|
+
* 导出完整的画布数据(包含配置、节点、边、数据源等)
|
|
39
|
+
*/
|
|
40
|
+
exportData(): CanvasData | null;
|
|
41
|
+
/**
|
|
42
|
+
* 收集所有被引用的流程
|
|
43
|
+
*/
|
|
44
|
+
private collectReferencedWorkflows;
|
|
45
|
+
/**
|
|
46
|
+
* 导入画布数据
|
|
47
|
+
*/
|
|
48
|
+
importData(importData: CanvasData, onEdgeAnimationRestore?: (edge: any) => void): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* 导入数据源配置
|
|
51
|
+
*/
|
|
52
|
+
private importDataSources;
|
|
53
|
+
/**
|
|
54
|
+
* 导入流程数据
|
|
55
|
+
*/
|
|
56
|
+
private importWorkflows;
|
|
57
|
+
/**
|
|
58
|
+
* 导出为 JSON 文件
|
|
59
|
+
*/
|
|
60
|
+
exportToFile(filename?: string): string | null;
|
|
61
|
+
/**
|
|
62
|
+
* 清除画布数据缓存
|
|
63
|
+
*/
|
|
64
|
+
clearCache(): void;
|
|
65
|
+
/**
|
|
66
|
+
* 获取画布完整数据(不包含workflows)
|
|
67
|
+
*/
|
|
68
|
+
getCanvasData(): CanvasData | null;
|
|
69
|
+
}
|
|
70
|
+
export declare const canvasDataHandler: CanvasDataHandler;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
export declare enum CanvasLayer {
|
|
4
|
+
BACKGROUND = "background",
|
|
5
|
+
STATIC = "static",
|
|
6
|
+
ANIMATION = "animation",
|
|
7
|
+
INTERACTION = "interaction",
|
|
8
|
+
HIGHLIGHT = "highlight"
|
|
9
|
+
}
|
|
10
|
+
export declare class CanvasLayerManager {
|
|
11
|
+
private graph;
|
|
12
|
+
private layers;
|
|
13
|
+
private layerConfig;
|
|
14
|
+
private containerElement;
|
|
15
|
+
private dirtyLayers;
|
|
16
|
+
private renderScheduled;
|
|
17
|
+
private staticNodes;
|
|
18
|
+
private animationNodes;
|
|
19
|
+
/**
|
|
20
|
+
* 初始化分层系统
|
|
21
|
+
*/
|
|
22
|
+
init(graph: Graph, container: HTMLElement): void;
|
|
23
|
+
/**
|
|
24
|
+
* 创建图层 Canvas
|
|
25
|
+
*/
|
|
26
|
+
private createLayer;
|
|
27
|
+
/**
|
|
28
|
+
* 附加事件监听器
|
|
29
|
+
*/
|
|
30
|
+
private attachEventListeners;
|
|
31
|
+
/**
|
|
32
|
+
* 标记图层为脏(需要重绘)
|
|
33
|
+
*/
|
|
34
|
+
markDirty(layer: CanvasLayer): void;
|
|
35
|
+
/**
|
|
36
|
+
* 调度渲染
|
|
37
|
+
*/
|
|
38
|
+
private scheduleRender;
|
|
39
|
+
/**
|
|
40
|
+
* 渲染所有脏图层
|
|
41
|
+
*/
|
|
42
|
+
private render;
|
|
43
|
+
/**
|
|
44
|
+
* 渲染单个图层
|
|
45
|
+
*/
|
|
46
|
+
private renderLayer;
|
|
47
|
+
/**
|
|
48
|
+
* 渲染背景层
|
|
49
|
+
*/
|
|
50
|
+
private renderBackground;
|
|
51
|
+
/**
|
|
52
|
+
* 渲染静态层
|
|
53
|
+
*/
|
|
54
|
+
private renderStatic;
|
|
55
|
+
/**
|
|
56
|
+
* 渲染动画层
|
|
57
|
+
*/
|
|
58
|
+
private renderAnimation;
|
|
59
|
+
/**
|
|
60
|
+
* 渲染交互层
|
|
61
|
+
*/
|
|
62
|
+
private renderInteraction;
|
|
63
|
+
/**
|
|
64
|
+
* 渲染高亮层
|
|
65
|
+
*/
|
|
66
|
+
private renderHighlight;
|
|
67
|
+
/**
|
|
68
|
+
* 标记节点为动画节点
|
|
69
|
+
*/
|
|
70
|
+
markAsAnimation(nodeId: string): void;
|
|
71
|
+
/**
|
|
72
|
+
* 标记节点为静态节点
|
|
73
|
+
*/
|
|
74
|
+
markAsStatic(nodeId: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* 获取性能统计
|
|
77
|
+
*/
|
|
78
|
+
getStats(): {
|
|
79
|
+
staticNodes: number;
|
|
80
|
+
animationNodes: number;
|
|
81
|
+
dirtyLayers: number;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* 销毁分层系统
|
|
85
|
+
*/
|
|
86
|
+
destroy(): void;
|
|
87
|
+
}
|
|
88
|
+
export declare const canvasLayerManager: CanvasLayerManager;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Graph, Edge } from '@antv/x6';
|
|
2
|
+
import { EdgeAnimationConfig } from '../../../shared/utils/edgeAnimationUtils';
|
|
3
|
+
|
|
4
|
+
export type { EdgeAnimationConfig };
|
|
5
|
+
/**
|
|
6
|
+
* 边操作工具类
|
|
7
|
+
*/
|
|
8
|
+
export declare class EdgeOperations {
|
|
9
|
+
private graph;
|
|
10
|
+
/**
|
|
11
|
+
* 设置 Graph 实例
|
|
12
|
+
*/
|
|
13
|
+
setGraph(graph: Graph | null): void;
|
|
14
|
+
/**
|
|
15
|
+
* 应用边动画(委托给公共工具函数)
|
|
16
|
+
*/
|
|
17
|
+
applyEdgeAnimation(edge: Edge, animation: EdgeAnimationConfig): void;
|
|
18
|
+
/**
|
|
19
|
+
* 更新边属性
|
|
20
|
+
*/
|
|
21
|
+
updateEdge(edge: Edge, updates: any): void;
|
|
22
|
+
/**
|
|
23
|
+
* 删除边
|
|
24
|
+
*/
|
|
25
|
+
deleteEdge(edgeId: string): boolean;
|
|
26
|
+
/**
|
|
27
|
+
* 获取边
|
|
28
|
+
*/
|
|
29
|
+
getEdgeById(edgeId: string): Edge | null;
|
|
30
|
+
/**
|
|
31
|
+
* 获取所有边
|
|
32
|
+
*/
|
|
33
|
+
getAllEdges(): Array<{
|
|
34
|
+
id: string;
|
|
35
|
+
source: string;
|
|
36
|
+
target: string;
|
|
37
|
+
data: any;
|
|
38
|
+
}>;
|
|
39
|
+
/**
|
|
40
|
+
* 应用选中样式
|
|
41
|
+
*/
|
|
42
|
+
applySelectedStyle(edge: Edge): void;
|
|
43
|
+
/**
|
|
44
|
+
* 恢复原始样式
|
|
45
|
+
*/
|
|
46
|
+
restoreOriginalStyle(edge: Edge): void;
|
|
47
|
+
/**
|
|
48
|
+
* 恢复所有边的动画(用于加载画布数据后)
|
|
49
|
+
*/
|
|
50
|
+
restoreAllEdgeAnimations(): void;
|
|
51
|
+
}
|
|
52
|
+
export declare const edgeOperations: EdgeOperations;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 画布操作工具类
|
|
5
|
+
*/
|
|
6
|
+
export declare class GraphOperations {
|
|
7
|
+
private graph;
|
|
8
|
+
/**
|
|
9
|
+
* 设置 Graph 实例
|
|
10
|
+
*/
|
|
11
|
+
setGraph(graph: Graph | null): void;
|
|
12
|
+
/**
|
|
13
|
+
* 获取 Graph 实例
|
|
14
|
+
*/
|
|
15
|
+
getGraph(): Graph | null;
|
|
16
|
+
/**
|
|
17
|
+
* 放大画布
|
|
18
|
+
*/
|
|
19
|
+
zoomIn(): void;
|
|
20
|
+
/**
|
|
21
|
+
* 缩小画布
|
|
22
|
+
*/
|
|
23
|
+
zoomOut(): void;
|
|
24
|
+
/**
|
|
25
|
+
* 设置缩放比例
|
|
26
|
+
*/
|
|
27
|
+
setZoom(scale: number): void;
|
|
28
|
+
/**
|
|
29
|
+
* 清空画布
|
|
30
|
+
*/
|
|
31
|
+
clearAll(onConfirm?: () => void): void;
|
|
32
|
+
/**
|
|
33
|
+
* 获取选中的节点列表
|
|
34
|
+
*/
|
|
35
|
+
private getSelectedNodes;
|
|
36
|
+
/**
|
|
37
|
+
* 验证选中节点数量
|
|
38
|
+
*/
|
|
39
|
+
private validateSelection;
|
|
40
|
+
/**
|
|
41
|
+
* 左对齐
|
|
42
|
+
*/
|
|
43
|
+
alignLeft(): void;
|
|
44
|
+
/**
|
|
45
|
+
* 水平居中对齐
|
|
46
|
+
*/
|
|
47
|
+
alignCenter(): void;
|
|
48
|
+
/**
|
|
49
|
+
* 右对齐
|
|
50
|
+
*/
|
|
51
|
+
alignRight(): void;
|
|
52
|
+
/**
|
|
53
|
+
* 顶部对齐
|
|
54
|
+
*/
|
|
55
|
+
alignTop(): void;
|
|
56
|
+
/**
|
|
57
|
+
* 垂直居中对齐
|
|
58
|
+
*/
|
|
59
|
+
alignMiddle(): void;
|
|
60
|
+
/**
|
|
61
|
+
* 底部对齐
|
|
62
|
+
*/
|
|
63
|
+
alignBottom(): void;
|
|
64
|
+
/**
|
|
65
|
+
* 横向分布
|
|
66
|
+
*/
|
|
67
|
+
distributeHorizontal(): void;
|
|
68
|
+
/**
|
|
69
|
+
* 纵向分布
|
|
70
|
+
*/
|
|
71
|
+
distributeVertical(): void;
|
|
72
|
+
/**
|
|
73
|
+
* 全选节点
|
|
74
|
+
*/
|
|
75
|
+
selectAll(): void;
|
|
76
|
+
/**
|
|
77
|
+
* 清除选择
|
|
78
|
+
*/
|
|
79
|
+
clearSelection(): void;
|
|
80
|
+
/**
|
|
81
|
+
* 计算适合的缩放比例
|
|
82
|
+
*/
|
|
83
|
+
calculateFitScale(containerWidth: number, containerHeight: number): number;
|
|
84
|
+
}
|
|
85
|
+
export declare const graphOperations: GraphOperations;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Graph, Node } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 节点操作工具类
|
|
5
|
+
*/
|
|
6
|
+
export declare class NodeOperations {
|
|
7
|
+
private graph;
|
|
8
|
+
private componentCounters;
|
|
9
|
+
/**
|
|
10
|
+
* 设置 Graph 实例
|
|
11
|
+
*/
|
|
12
|
+
setGraph(graph: Graph | null): void;
|
|
13
|
+
/**
|
|
14
|
+
* 生成组件默认名称
|
|
15
|
+
*/
|
|
16
|
+
generateComponentName(componentType: string, componentName: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* 添加节点
|
|
19
|
+
*/
|
|
20
|
+
addNode(type: string, position?: {
|
|
21
|
+
x: number;
|
|
22
|
+
y: number;
|
|
23
|
+
}): Promise<Node | null>;
|
|
24
|
+
/**
|
|
25
|
+
* 更新节点属性
|
|
26
|
+
*/
|
|
27
|
+
updateNode(node: Node, updates: any): void;
|
|
28
|
+
/**
|
|
29
|
+
* 删除节点
|
|
30
|
+
*/
|
|
31
|
+
deleteNode(nodeId: string): boolean;
|
|
32
|
+
/**
|
|
33
|
+
* 选中节点
|
|
34
|
+
*/
|
|
35
|
+
selectNode(nodeId: string): boolean;
|
|
36
|
+
/**
|
|
37
|
+
* 获取节点
|
|
38
|
+
*/
|
|
39
|
+
getNodeById(nodeId: string): Node | null;
|
|
40
|
+
/**
|
|
41
|
+
* 获取所有节点
|
|
42
|
+
*/
|
|
43
|
+
getAllNodes(): Array<{
|
|
44
|
+
id: string;
|
|
45
|
+
type: string;
|
|
46
|
+
position: {
|
|
47
|
+
x: number;
|
|
48
|
+
y: number;
|
|
49
|
+
};
|
|
50
|
+
size: {
|
|
51
|
+
width: number;
|
|
52
|
+
height: number;
|
|
53
|
+
};
|
|
54
|
+
label: string;
|
|
55
|
+
data: any;
|
|
56
|
+
}>;
|
|
57
|
+
/**
|
|
58
|
+
* 复制节点
|
|
59
|
+
*/
|
|
60
|
+
cloneNode(node: Node, offset?: {
|
|
61
|
+
x: number;
|
|
62
|
+
y: number;
|
|
63
|
+
}): Node | null;
|
|
64
|
+
/**
|
|
65
|
+
* 批量删除节点
|
|
66
|
+
*/
|
|
67
|
+
deleteNodes(nodeIds: string[]): number;
|
|
68
|
+
/**
|
|
69
|
+
* 节点置于顶层
|
|
70
|
+
*/
|
|
71
|
+
bringToFront(nodeId: string): void;
|
|
72
|
+
/**
|
|
73
|
+
* 节点置于底层
|
|
74
|
+
*/
|
|
75
|
+
sendToBack(nodeId: string): void;
|
|
76
|
+
}
|
|
77
|
+
export declare const nodeOperations: NodeOperations;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { DataSource } from '../services/dataSourceManager';
|
|
2
|
+
|
|
3
|
+
interface Props {
|
|
4
|
+
dataSources: DataSource[];
|
|
5
|
+
}
|
|
6
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
save: (dataSource: DataSource) => void;
|
|
8
|
+
delete: (id: string) => void;
|
|
9
|
+
add: (dataSource: Omit<DataSource, "id" | "status" | "devices">) => void;
|
|
10
|
+
close: () => void;
|
|
11
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
|
|
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;
|
|
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
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MappingConfig } from '../../../shared/types/binding';
|
|
2
|
+
|
|
3
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
4
|
+
visible: boolean;
|
|
5
|
+
modelValue?: MappingConfig;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
"update:visible": (value: boolean) => void;
|
|
8
|
+
"update:modelValue": (value: MappingConfig) => void;
|
|
9
|
+
confirm: (value: MappingConfig) => void;
|
|
10
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
|
|
11
|
+
visible: boolean;
|
|
12
|
+
modelValue?: MappingConfig;
|
|
13
|
+
}>>> & Readonly<{
|
|
14
|
+
"onUpdate:visible"?: ((value: boolean) => any) | undefined;
|
|
15
|
+
"onUpdate:modelValue"?: ((value: MappingConfig) => any) | undefined;
|
|
16
|
+
onConfirm?: ((value: MappingConfig) => 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,14 @@
|
|
|
1
|
+
export { default as DataSourceDialog } from './components/DataSourceDialog';
|
|
2
|
+
export { default as DevicePointSelector } from './components/DevicePointSelector';
|
|
3
|
+
export { default as MappingConfigurator } from './components/MappingConfigurator';
|
|
4
|
+
export * from './services/dataSourceManager';
|
|
5
|
+
export { DataParser, ParserPresets, defaultParser } from './services/dataParser';
|
|
6
|
+
export type { DeviceData as ParsedDeviceData } from './services/dataParser';
|
|
7
|
+
export * from './services/httpService';
|
|
8
|
+
export { MqttService } from './services/mqttService';
|
|
9
|
+
export type { MqttConfig, DevicePointData, DeviceData as MqttDeviceData } from './services/mqttService';
|
|
10
|
+
export * from './services/sseService';
|
|
11
|
+
export * from './services/websocketService';
|
|
12
|
+
export * from './services/dataBindingService';
|
|
13
|
+
export * from './types/dataAdapter';
|
|
14
|
+
export * from './types/device';
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
import { BindingConfig } from '../../../shared/types';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* 数据绑定服务类
|
|
6
|
+
*/
|
|
7
|
+
export declare class DataBindingService {
|
|
8
|
+
private graph;
|
|
9
|
+
private dataCallbackRegistered;
|
|
10
|
+
private updateQueue;
|
|
11
|
+
private flushTimer;
|
|
12
|
+
private readonly FLUSH_DELAY;
|
|
13
|
+
/**
|
|
14
|
+
* 设置 Graph 实例
|
|
15
|
+
*/
|
|
16
|
+
setGraph(graph: Graph | null): void;
|
|
17
|
+
/**
|
|
18
|
+
* 初始化数据绑定监听
|
|
19
|
+
*/
|
|
20
|
+
private initDataBinding;
|
|
21
|
+
/**
|
|
22
|
+
* 处理数据源更新
|
|
23
|
+
*/
|
|
24
|
+
private handleDataUpdate;
|
|
25
|
+
/**
|
|
26
|
+
* 更新单个节点的数据
|
|
27
|
+
*/
|
|
28
|
+
private updateNodeData;
|
|
29
|
+
/**
|
|
30
|
+
* 将更新添加到队列
|
|
31
|
+
*/
|
|
32
|
+
private queueUpdates;
|
|
33
|
+
/**
|
|
34
|
+
* 调度批量刷新
|
|
35
|
+
*/
|
|
36
|
+
private scheduleFlush;
|
|
37
|
+
/**
|
|
38
|
+
* 执行批量更新
|
|
39
|
+
*/
|
|
40
|
+
private flush;
|
|
41
|
+
/**
|
|
42
|
+
* 从原始数据中提取点位值
|
|
43
|
+
*
|
|
44
|
+
* @param rawData 原始数据(后端返回的JSON)
|
|
45
|
+
* @param pointId 点位ID(如 "liquid_level")
|
|
46
|
+
* @returns 点位值
|
|
47
|
+
*/
|
|
48
|
+
private extractPointValue;
|
|
49
|
+
/**
|
|
50
|
+
* 应用值映射转换
|
|
51
|
+
*
|
|
52
|
+
* @param value 原始值
|
|
53
|
+
* @param mapping 映射配置
|
|
54
|
+
* @returns 转换后的值
|
|
55
|
+
*/
|
|
56
|
+
private applyValueMapping;
|
|
57
|
+
/**
|
|
58
|
+
* 布尔映射
|
|
59
|
+
*/
|
|
60
|
+
private applyBooleanMapping;
|
|
61
|
+
/**
|
|
62
|
+
* 范围映射
|
|
63
|
+
*/
|
|
64
|
+
private applyRangeMapping;
|
|
65
|
+
/**
|
|
66
|
+
* 枚举映射
|
|
67
|
+
*/
|
|
68
|
+
private applyEnumMapping;
|
|
69
|
+
/**
|
|
70
|
+
* 应用更新到节点
|
|
71
|
+
*/
|
|
72
|
+
private applyUpdatesToNode;
|
|
73
|
+
/**
|
|
74
|
+
* 获取节点的绑定配置
|
|
75
|
+
*/
|
|
76
|
+
getNodeBindings(nodeId: string): BindingConfig[];
|
|
77
|
+
/**
|
|
78
|
+
* 更新节点的绑定配置
|
|
79
|
+
*/
|
|
80
|
+
updateNodeBindings(nodeId: string, bindings: BindingConfig[]): boolean;
|
|
81
|
+
/**
|
|
82
|
+
* 清理资源
|
|
83
|
+
*/
|
|
84
|
+
destroy(): void;
|
|
85
|
+
}
|
|
86
|
+
export declare const dataBindingService: DataBindingService;
|