@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.
Files changed (107) hide show
  1. package/README.md +1 -1
  2. package/dist/index.d.ts +3 -159
  3. package/dist/scada-engine.css +1 -1
  4. package/dist/scada-engine.es.js +22244 -10991
  5. package/dist/scada-engine.umd.js +34 -17
  6. package/dist/{components → src/components}/BindingCard.d.ts +4 -0
  7. package/dist/src/components/ComponentLibrary.d.ts +34 -0
  8. package/dist/src/components/ContextMenu.d.ts +63 -0
  9. package/dist/src/components/DataPropertiesTab.d.ts +26 -0
  10. package/dist/{components/PropertyPanel.d.ts → src/components/DataSourceDialog.d.ts} +10 -12
  11. package/dist/{components → src/components}/DevicePointSelector.d.ts +7 -3
  12. package/dist/{components → src/components}/Header.d.ts +2 -0
  13. package/dist/src/components/PropertyPanel.d.ts +45 -0
  14. package/dist/src/index.d.ts +158 -0
  15. package/dist/{scada-components → src/scada-components}/types.d.ts +1 -0
  16. package/dist/src/services/dataSourceManager.d.ts +121 -0
  17. package/dist/src/services/mqttService.d.ts +110 -0
  18. package/dist/src/utils/canvasConfigWatcher.d.ts +39 -0
  19. package/dist/src/utils/canvasDataHandler.d.ts +70 -0
  20. package/dist/src/utils/contextMenuManager.d.ts +27 -0
  21. package/dist/src/utils/dataBindingService.d.ts +42 -0
  22. package/dist/src/utils/edgeOperations.d.ts +57 -0
  23. package/dist/src/utils/eventManager.d.ts +62 -0
  24. package/dist/src/utils/graphOperations.d.ts +85 -0
  25. package/dist/src/utils/index.d.ts +18 -0
  26. package/dist/src/utils/nodeOperations.d.ts +77 -0
  27. package/dist/src/utils/storageUtils.d.ts +32 -0
  28. package/package.json +2 -1
  29. package/dist/components/ComponentLibrary.d.ts +0 -6
  30. package/dist/components/DataPropertiesTab.d.ts +0 -42
  31. package/dist/mock/deviceData.d.ts +0 -39
  32. package/dist/utils/index.d.ts +0 -10
  33. package/dist/utils/storageUtils.d.ts +0 -55
  34. package/dist/views/preview/PreviewView.d.ts +0 -3
  35. package/dist/{components → src/components}/AttributeConfigDialog.d.ts +0 -0
  36. package/dist/{components → src/components}/BasicPropertiesTab.d.ts +0 -0
  37. package/dist/{components → src/components}/CanvasArea.d.ts +0 -0
  38. package/dist/{components → src/components}/CanvasConfigPanel.d.ts +0 -0
  39. package/dist/{components → src/components}/CustomCodeDialog.d.ts +0 -0
  40. package/dist/{components → src/components}/EdgePropertiesTab.d.ts +0 -0
  41. package/dist/{components → src/components}/EventCard.d.ts +0 -0
  42. package/dist/{components → src/components}/Footer.d.ts +0 -0
  43. package/dist/{components → src/components}/MappingConfigurator.d.ts +0 -0
  44. package/dist/{components → src/components}/WorkflowSelectorDialog.d.ts +0 -0
  45. package/dist/{main.d.ts → src/main.d.ts} +0 -0
  46. package/dist/{scada-components → src/scada-components}/basic/circle.d.ts +0 -0
  47. package/dist/{scada-components → src/scada-components}/basic/index.d.ts +0 -0
  48. package/dist/{scada-components → src/scada-components}/basic/rect.d.ts +0 -0
  49. package/dist/{scada-components → src/scada-components}/basic/text.d.ts +0 -0
  50. package/dist/{scada-components → src/scada-components}/canvas/config.d.ts +0 -0
  51. package/dist/{scada-components → src/scada-components}/canvas/index.d.ts +0 -0
  52. package/dist/{scada-components → src/scada-components}/canvas/manager.d.ts +0 -0
  53. package/dist/{scada-components → src/scada-components}/canvas/types.d.ts +0 -0
  54. package/dist/{scada-components → src/scada-components}/index.d.ts +0 -0
  55. package/dist/{scada-components → src/scada-components}/iot/AlarmLight3D.d.ts +0 -0
  56. package/dist/{scada-components → src/scada-components}/iot/Conveyor3D.d.ts +0 -0
  57. package/dist/{scada-components → src/scada-components}/iot/Cylinder3D.d.ts +0 -0
  58. package/dist/{scada-components → src/scada-components}/iot/EChartsGauge.d.ts +0 -0
  59. package/dist/{scada-components → src/scada-components}/iot/EChartsLine.d.ts +0 -0
  60. package/dist/{scada-components → src/scada-components}/iot/Filter3D.d.ts +0 -0
  61. package/dist/{scada-components → src/scada-components}/iot/HeatExchanger3D.d.ts +0 -0
  62. package/dist/{scada-components → src/scada-components}/iot/Light3D.d.ts +0 -0
  63. package/dist/{scada-components → src/scada-components}/iot/Motor3D.d.ts +0 -0
  64. package/dist/{scada-components → src/scada-components}/iot/Pipe3D.d.ts +0 -0
  65. package/dist/{scada-components → src/scada-components}/iot/Pump3D.d.ts +0 -0
  66. package/dist/{scada-components → src/scada-components}/iot/Switch3D.d.ts +0 -0
  67. package/dist/{scada-components → src/scada-components}/iot/Tank3D.d.ts +0 -0
  68. package/dist/{scada-components → src/scada-components}/iot/Tee3D.d.ts +0 -0
  69. package/dist/{scada-components → src/scada-components}/iot/TemperatureSensor3D.d.ts +0 -0
  70. package/dist/{scada-components → src/scada-components}/iot/Valve3D.d.ts +0 -0
  71. package/dist/{scada-components → src/scada-components}/iot/echarts-gauge-presets.d.ts +0 -0
  72. package/dist/{scada-components → src/scada-components}/iot/echarts-gauge.d.ts +0 -0
  73. package/dist/{scada-components → src/scada-components}/iot/echarts-line-presets.d.ts +0 -0
  74. package/dist/{scada-components → src/scada-components}/iot/echarts-line.d.ts +0 -0
  75. package/dist/{scada-components → src/scada-components}/iot/index.d.ts +0 -0
  76. package/dist/{scada-components → src/scada-components}/iot/industrial-3d-extended.d.ts +0 -0
  77. package/dist/{scada-components → src/scada-components}/iot/industrial-3d-fluid.d.ts +0 -0
  78. package/dist/{scada-components → src/scada-components}/iot/industrial-3d.d.ts +0 -0
  79. package/dist/{scada-components → src/scada-components}/iot/light.d.ts +0 -0
  80. package/dist/{scada-components → src/scada-components}/iot/switch.d.ts +0 -0
  81. package/dist/{scada-components → src/scada-components}/registry.d.ts +0 -0
  82. package/dist/{types → src/types}/binding.d.ts +0 -0
  83. package/dist/{types → src/types}/device.d.ts +0 -0
  84. package/dist/{types → src/types}/workflow.d.ts +0 -0
  85. package/dist/{utils → src/utils}/animationEngine.d.ts +0 -0
  86. package/dist/{utils → src/utils}/authCrypto.d.ts +0 -0
  87. package/dist/{utils → src/utils}/commonUtils.d.ts +0 -0
  88. package/dist/{utils → src/utils}/eventUtils.d.ts +0 -0
  89. package/dist/{utils → src/utils}/fileUtils.d.ts +0 -0
  90. package/dist/{utils → src/utils}/messageUtils.d.ts +0 -0
  91. package/dist/{utils → src/utils}/nodePropertyUtils.d.ts +0 -0
  92. package/dist/{views → src/views}/workflow/WorkflowDialog.d.ts +1 -1
  93. /package/dist/{views → src/views}/workflow/WorkflowEditor.d.ts +0 -0
  94. /package/dist/{views → src/views}/workflow/components/AddNodeMenu.d.ts +0 -0
  95. /package/dist/{views → src/views}/workflow/components/ElementSelector.d.ts +0 -0
  96. /package/dist/{views → src/views}/workflow/components/PropertyPanel.d.ts +0 -0
  97. /package/dist/{views → src/views}/workflow/components/WorkflowToolbar.d.ts +0 -0
  98. /package/dist/{views → src/views}/workflow/components/node-configs/ClearTimerConfig.d.ts +0 -0
  99. /package/dist/{views → src/views}/workflow/components/node-configs/ConditionConfig.d.ts +0 -0
  100. /package/dist/{views → src/views}/workflow/components/node-configs/CustomCodeConfig.d.ts +0 -0
  101. /package/dist/{views → src/views}/workflow/components/node-configs/GetPropertyConfig.d.ts +0 -0
  102. /package/dist/{views → src/views}/workflow/components/node-configs/HttpRequestConfig.d.ts +0 -0
  103. /package/dist/{views → src/views}/workflow/components/node-configs/SetPropertyConfig.d.ts +0 -0
  104. /package/dist/{views → src/views}/workflow/components/node-configs/TimerConfig.d.ts +0 -0
  105. /package/dist/{views → src/views}/workflow/config/nodeConfigRegistry.d.ts +0 -0
  106. /package/dist/{views → src/views}/workflow/services/canvasElementService.d.ts +0 -0
  107. /package/dist/{views → src/views}/workflow/types/node.d.ts +0 -0
@@ -0,0 +1,39 @@
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
+ /**
12
+ * 初始化配置监听器
13
+ */
14
+ initialize(graph: Graph, containerRef: Ref<any>, calculateFitScale: () => number): void;
15
+ /**
16
+ * 应用配置变化到 Graph
17
+ */
18
+ applyConfigChanges(): void;
19
+ /**
20
+ * 更新背景
21
+ */
22
+ private updateBackground;
23
+ /**
24
+ * 更新尺寸和缩放
25
+ */
26
+ private updateSizeAndScale;
27
+ /**
28
+ * 更新网格
29
+ */
30
+ private updateGrid;
31
+ /**
32
+ * 清理资源
33
+ */
34
+ destroy(): void;
35
+ }
36
+ /**
37
+ * 导出配置监听器单例
38
+ */
39
+ 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,27 @@
1
+ import { MenuItem } from '../components/ContextMenu';
2
+
3
+ /**
4
+ * 右键菜单管理器类
5
+ */
6
+ export declare class ContextMenuManager {
7
+ /**
8
+ * 生成节点右键菜单
9
+ */
10
+ getNodeMenuItems(): MenuItem[];
11
+ /**
12
+ * 生成连线右键菜单
13
+ */
14
+ getEdgeMenuItems(): MenuItem[];
15
+ /**
16
+ * 生成画布右键菜单
17
+ */
18
+ getCanvasMenuItems(): MenuItem[];
19
+ /**
20
+ * 根据目标类型获取菜单项
21
+ */
22
+ getMenuItems(target: 'node' | 'edge' | 'canvas'): MenuItem[];
23
+ }
24
+ /**
25
+ * 导出右键菜单管理器单例
26
+ */
27
+ export declare const contextMenuManager: ContextMenuManager;
@@ -0,0 +1,42 @@
1
+ import { Graph } from '@antv/x6';
2
+
3
+ /**
4
+ * 数据绑定服务类
5
+ */
6
+ export declare class DataBindingService {
7
+ private graph;
8
+ private dataCallbackRegistered;
9
+ /**
10
+ * 设置 Graph 实例
11
+ */
12
+ setGraph(graph: Graph | null): void;
13
+ /**
14
+ * 初始化数据绑定监听
15
+ */
16
+ initDataBinding(): void;
17
+ /**
18
+ * 同步数据到节点
19
+ */
20
+ private syncDataToNodes;
21
+ /**
22
+ * 根据设备数据更新节点
23
+ */
24
+ private updateNodeFromDeviceData;
25
+ /**
26
+ * 应用映射规则
27
+ */
28
+ private applyMapping;
29
+ /**
30
+ * 手动更新设备数据(用于外部传入的设备数据)
31
+ */
32
+ updateDeviceData(deviceData: any): void;
33
+ /**
34
+ * 获取节点的绑定配置
35
+ */
36
+ getNodeBindings(nodeId: string): any[];
37
+ /**
38
+ * 更新节点的绑定配置
39
+ */
40
+ updateNodeBindings(nodeId: string, bindings: any[]): boolean;
41
+ }
42
+ export declare const dataBindingService: DataBindingService;
@@ -0,0 +1,57 @@
1
+ import { Graph, Edge } from '@antv/x6';
2
+
3
+ /**
4
+ * 边动画配置
5
+ */
6
+ export interface EdgeAnimationConfig {
7
+ enabled: boolean;
8
+ duration?: number;
9
+ }
10
+ /**
11
+ * 边操作工具类
12
+ */
13
+ export declare class EdgeOperations {
14
+ private graph;
15
+ /**
16
+ * 设置 Graph 实例
17
+ */
18
+ setGraph(graph: Graph | null): void;
19
+ /**
20
+ * 应用边动画
21
+ */
22
+ applyEdgeAnimation(edge: Edge, animation: EdgeAnimationConfig): void;
23
+ /**
24
+ * 更新边属性
25
+ */
26
+ updateEdge(edge: Edge, updates: any): void;
27
+ /**
28
+ * 删除边
29
+ */
30
+ deleteEdge(edgeId: string): boolean;
31
+ /**
32
+ * 获取边
33
+ */
34
+ getEdgeById(edgeId: string): Edge | null;
35
+ /**
36
+ * 获取所有边
37
+ */
38
+ getAllEdges(): Array<{
39
+ id: string;
40
+ source: string;
41
+ target: string;
42
+ data: any;
43
+ }>;
44
+ /**
45
+ * 应用选中样式
46
+ */
47
+ applySelectedStyle(edge: Edge): void;
48
+ /**
49
+ * 恢复原始样式
50
+ */
51
+ restoreOriginalStyle(edge: Edge): void;
52
+ /**
53
+ * 恢复所有边的动画(用于加载画布数据后)
54
+ */
55
+ restoreAllEdgeAnimations(): void;
56
+ }
57
+ export declare const edgeOperations: EdgeOperations;
@@ -0,0 +1,62 @@
1
+ import { Graph } from '@antv/x6';
2
+ import { Ref } from 'vue';
3
+ import { MenuItem } from '../components/ContextMenu';
4
+
5
+ /**
6
+ * 事件管理器配置
7
+ */
8
+ export interface EventManagerConfig {
9
+ selectedNode: Ref<any>;
10
+ selectedEdge: Ref<any>;
11
+ selectedNodesCount: Ref<number>;
12
+ contextMenu: Ref<{
13
+ visible: boolean;
14
+ position: {
15
+ x: number;
16
+ y: number;
17
+ };
18
+ items: MenuItem[];
19
+ targetCell: any;
20
+ }>;
21
+ applyEdgeAnimation?: (edge: any, animation: any) => void;
22
+ }
23
+ /**
24
+ * Graph 事件管理器类
25
+ */
26
+ export declare class GraphEventManager {
27
+ private graph;
28
+ private config;
29
+ private keydownHandler;
30
+ /**
31
+ * 初始化事件管理器
32
+ */
33
+ initialize(graph: Graph, config: EventManagerConfig): void;
34
+ /**
35
+ * 注册选择相关事件
36
+ */
37
+ private registerSelectionEvents;
38
+ /**
39
+ * 注册点击相关事件
40
+ */
41
+ private registerClickEvents;
42
+ /**
43
+ * 注册变化监听事件
44
+ */
45
+ private registerChangeEvents;
46
+ /**
47
+ * 注册右键菜单事件
48
+ */
49
+ private registerContextMenuEvents;
50
+ /**
51
+ * 注册键盘事件
52
+ */
53
+ private registerKeyboardEvents;
54
+ /**
55
+ * 销毁事件管理器,清理所有监听器
56
+ */
57
+ destroy(): void;
58
+ }
59
+ /**
60
+ * 导出事件管理器单例
61
+ */
62
+ export declare const graphEventManager: GraphEventManager;
@@ -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,18 @@
1
+ /**
2
+ * 工具函数统一导出
3
+ * 便于其他模块使用
4
+ */
5
+ export * from './nodePropertyUtils';
6
+ export * from './eventUtils';
7
+ export * from './storageUtils';
8
+ export * from './fileUtils';
9
+ export * from './commonUtils';
10
+ export * from './messageUtils';
11
+ export * from './graphOperations';
12
+ export * from './nodeOperations';
13
+ export * from './edgeOperations';
14
+ export * from './canvasDataHandler';
15
+ export * from './dataBindingService';
16
+ export * from './eventManager';
17
+ export * from './contextMenuManager';
18
+ export * from './canvasConfigWatcher';
@@ -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
+ }): 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,32 @@
1
+ /**
2
+ * 存储工具函数
3
+ * 统一使用 localStorage 进行数据持久化
4
+ */
5
+ /**
6
+ * LocalStorage 键名常量
7
+ */
8
+ export declare const STORAGE_KEYS: {
9
+ readonly SCADA_EDITOR_DATA: "scada_editor_data";
10
+ };
11
+ /**
12
+ * 保存数据到 localStorage
13
+ * @param key 键名
14
+ * @param data 数据对象
15
+ * @returns 是否保存成功
16
+ */
17
+ export declare const saveToLocal: <T = any>(key: string, data: T) => boolean;
18
+ /**
19
+ * 从 localStorage 读取数据
20
+ * @param key 键名
21
+ * @returns 数据对象,失败返回 null
22
+ */
23
+ export declare const loadFromLocal: <T = any>(key: string) => T | null;
24
+ /**
25
+ * 从 localStorage 删除数据
26
+ * @param key 键名
27
+ */
28
+ export declare const removeFromLocal: (key: string) => void;
29
+ /**
30
+ * 清空 localStorage
31
+ */
32
+ export declare const clearLocal: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nywqs/scada-engine",
3
- "version": "1.1.25",
3
+ "version": "1.1.26",
4
4
  "description": "自研 SCADA 组态引擎 - 基于 AntV X6",
5
5
  "type": "module",
6
6
  "main": "./dist/scada-engine.umd.js",
@@ -38,6 +38,7 @@
38
38
  "@vicons/carbon": "^0.13.0",
39
39
  "@vueuse/core": "^10.0.0",
40
40
  "echarts": "^5.5.0",
41
+ "mqtt": "^5.14.1",
41
42
  "pinia": "^2.1.0",
42
43
  "vue": "^3.4.0"
43
44
  },
@@ -1,6 +0,0 @@
1
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
2
- addComponent: (type: string) => void;
3
- }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
4
- onAddComponent?: ((type: string) => any) | undefined;
5
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
6
- export default _default;
@@ -1,42 +0,0 @@
1
- import { Node } from '@antv/x6';
2
-
3
- interface DataSource {
4
- type: string;
5
- broker?: string;
6
- clientId?: string;
7
- topic?: string;
8
- username?: string;
9
- password?: string;
10
- wsUrl?: string;
11
- url?: string;
12
- method?: string;
13
- headers?: string;
14
- body?: string;
15
- pollInterval?: number;
16
- sseUrl?: string;
17
- eventType?: string;
18
- autoReconnect?: boolean;
19
- dataPath?: string;
20
- value?: string;
21
- valueType?: string;
22
- enabled?: boolean;
23
- retryCount?: number;
24
- }
25
- interface Props {
26
- selectedNode: Node;
27
- }
28
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
29
- "update-data-source": (source: DataSource) => void;
30
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
31
- "onUpdate-data-source"?: ((source: DataSource) => any) | undefined;
32
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
33
- export default _default;
34
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
35
- type __VLS_TypePropsToRuntimeProps<T> = {
36
- [K in keyof T]-?: {} extends Pick<T, K> ? {
37
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
38
- } : {
39
- type: import('vue').PropType<T[K]>;
40
- required: true;
41
- };
42
- };
@@ -1,39 +0,0 @@
1
- import { Device, DeviceList, PointDataType, PointAccessMode } from '../types/device';
2
-
3
- /**
4
- * 模拟设备数据
5
- */
6
- export declare const mockDevices: Device[];
7
- /**
8
- * 模拟设备列表
9
- */
10
- export declare const mockDeviceList: DeviceList;
11
- /**
12
- * 根据设备ID获取设备
13
- */
14
- export declare const getDeviceById: (deviceId: string) => Device | undefined;
15
- /**
16
- * 根据设备ID和点位ID获取点位
17
- */
18
- export declare const getPointById: (deviceId: string, pointId: string) => import('..').DevicePoint | undefined;
19
- /**
20
- * 获取所有点位(扁平化)
21
- */
22
- export declare const getAllPoints: () => {
23
- deviceId: string;
24
- deviceName: string;
25
- id: string;
26
- name: string;
27
- code: string;
28
- description?: string;
29
- dataType: PointDataType;
30
- accessMode: PointAccessMode;
31
- value?: any;
32
- unit?: string;
33
- minValue?: number;
34
- maxValue?: number;
35
- precision?: number;
36
- enabled?: boolean;
37
- updateTime?: string;
38
- quality?: "good" | "bad" | "uncertain";
39
- }[];
@@ -1,10 +0,0 @@
1
- /**
2
- * 工具函数统一导出
3
- * 便于其他模块使用
4
- */
5
- export * from './nodePropertyUtils';
6
- export * from './eventUtils';
7
- export * from './storageUtils';
8
- export * from './fileUtils';
9
- export * from './commonUtils';
10
- export * from './messageUtils';
@@ -1,55 +0,0 @@
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;
@@ -1,3 +0,0 @@
1
-
2
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
3
- export default _default;