@nywqs/scada-engine 1.1.30 → 2.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.
Files changed (153) hide show
  1. package/LICENSE +21 -21
  2. package/README.md +359 -193
  3. package/dist/index.d.ts +3 -0
  4. package/dist/scada-engine.css +1 -1
  5. package/dist/scada-engine.es.js +42794 -21383
  6. package/dist/scada-engine.umd.js +3751 -156
  7. package/dist/src/components/canvas/composables/index.d.ts +12 -0
  8. package/dist/src/components/canvas/composables/useAutoSave.d.ts +9 -0
  9. package/dist/src/components/canvas/composables/useCanvasScale.d.ts +12 -0
  10. package/dist/src/components/canvas/composables/useDataSource.d.ts +87 -0
  11. package/dist/src/components/canvas/composables/useFileOperations.d.ts +37 -0
  12. package/dist/src/components/canvas/composables/useGraphEvents.d.ts +22 -0
  13. package/dist/src/components/canvas/composables/useNodeOperations.d.ts +35 -0
  14. package/dist/src/components/canvas/config/graphConfig.d.ts +64 -0
  15. package/dist/src/components/canvas/config/pluginConfig.d.ts +5 -0
  16. package/dist/src/components/canvas/config/scadaEdgeShape.d.ts +14 -0
  17. package/dist/src/components/canvas/config/scadaEdgeView.d.ts +4 -0
  18. package/dist/src/components/canvas/types/canvas.d.ts +41 -0
  19. package/dist/src/components/configurators/BindingCard.d.ts +24 -0
  20. package/dist/src/components/configurators/ComponentPointSelector.d.ts +16 -0
  21. package/dist/src/components/{EventCard.d.ts → configurators/EventCard.d.ts} +13 -26
  22. package/dist/src/components/configurators/MappingConfigurator.d.ts +15 -0
  23. package/dist/src/components/dialogs/AttributeConfigDialog.d.ts +28 -0
  24. package/dist/src/components/dialogs/CustomCodeDialog.d.ts +20 -0
  25. package/dist/src/components/dialogs/DataSourceDialog.d.ts +16 -0
  26. package/dist/src/components/dialogs/ScadaModal.d.ts +37 -0
  27. package/dist/src/components/{WorkflowSelectorDialog.d.ts → dialogs/WorkflowSelectorDialog.d.ts} +3 -3
  28. package/dist/src/components/layout/Footer.d.ts +16 -0
  29. package/dist/src/components/layout/Header.d.ts +56 -0
  30. package/dist/src/components/panels/CanvasConfigPanel.d.ts +4 -0
  31. package/dist/src/components/panels/ComponentLibrary.d.ts +6 -0
  32. package/dist/src/components/panels/ContextMenu.d.ts +26 -0
  33. package/dist/src/components/panels/PropertyPanel.d.ts +22 -0
  34. package/dist/src/components/property-tabs/BasicPropertiesTab.d.ts +37 -0
  35. package/dist/src/components/property-tabs/DataPropertiesTab.d.ts +14 -0
  36. package/dist/src/components/property-tabs/EdgePropertiesTab.d.ts +16 -0
  37. package/dist/src/constants/animation.d.ts +5 -0
  38. package/dist/src/constants/index.d.ts +3 -0
  39. package/dist/src/constants/layout.d.ts +16 -0
  40. package/dist/src/constants/theme.d.ts +17 -0
  41. package/dist/src/index.d.ts +16 -15
  42. package/dist/src/main.d.ts +0 -1
  43. package/dist/src/scada-components/basic/circle.d.ts +0 -1
  44. package/dist/src/scada-components/basic/rect.d.ts +0 -1
  45. package/dist/src/scada-components/basic/text.d.ts +0 -1
  46. package/dist/src/scada-components/canvas/config.d.ts +0 -1
  47. package/dist/src/scada-components/canvas/manager.d.ts +0 -1
  48. package/dist/src/scada-components/iot/echarts-gauge/EChartsGauge.d.ts +7 -0
  49. package/dist/src/scada-components/iot/{echarts-gauge.d.ts → echarts-gauge/index.d.ts} +1 -2
  50. package/dist/src/scada-components/iot/echarts-line/EChartsLine.d.ts +7 -0
  51. package/dist/src/scada-components/iot/{echarts-line.d.ts → echarts-line/index.d.ts} +1 -2
  52. package/dist/src/scada-components/iot/index.d.ts +0 -5
  53. package/dist/src/scada-components/registry.d.ts +1 -2
  54. package/dist/src/scada-components/svg/core/index.d.ts +7 -0
  55. package/dist/src/scada-components/svg/core/loader.d.ts +71 -0
  56. package/dist/src/scada-components/svg/core/parser.d.ts +40 -0
  57. package/dist/src/scada-components/svg/core/types.d.ts +297 -0
  58. package/dist/src/scada-components/svg/helpers/demo.d.ts +20 -0
  59. package/dist/src/scada-components/svg/helpers/index.d.ts +5 -0
  60. package/dist/src/scada-components/svg/helpers/utils.d.ts +24 -0
  61. package/dist/src/scada-components/svg/index.d.ts +9 -0
  62. package/dist/src/scada-components/svg/rendering/SVGRenderer.d.ts +14 -0
  63. package/dist/src/scada-components/svg/rendering/animationTemplates.d.ts +81 -0
  64. package/dist/src/scada-components/svg/rendering/index.d.ts +6 -0
  65. package/dist/src/scada-components/types.d.ts +0 -1
  66. package/dist/src/types/context-menu.d.ts +13 -0
  67. package/dist/src/types/model3d.d.ts +106 -0
  68. package/dist/src/types/zone.d.ts +54 -0
  69. package/dist/src/utils/animation/index.d.ts +6 -0
  70. package/dist/src/utils/{canvasConfigWatcher.d.ts → canvas/config-watcher.d.ts} +19 -9
  71. package/dist/src/utils/{canvasDataHandler.d.ts → canvas/data-handler.d.ts} +0 -29
  72. package/dist/src/utils/{edgeOperations.d.ts → canvas/edge-operations.d.ts} +6 -3
  73. package/dist/src/utils/{graphOperations.d.ts → canvas/graph-operations.d.ts} +0 -1
  74. package/dist/src/utils/canvas/index.d.ts +10 -0
  75. package/dist/src/utils/{canvasLayerManager.d.ts → canvas/layer-manager.d.ts} +0 -1
  76. package/dist/src/utils/{nodeOperations.d.ts → canvas/node-operations.d.ts} +0 -1
  77. package/dist/src/utils/core/index.d.ts +8 -0
  78. package/dist/src/utils/{dataBindingService.d.ts → data/binding-service.d.ts} +1 -2
  79. package/dist/src/utils/data/index.d.ts +6 -0
  80. package/dist/src/utils/{contextMenuManager.d.ts → events/context-menu.d.ts} +1 -2
  81. package/dist/src/utils/{eventManager.d.ts → events/event-manager.d.ts} +1 -2
  82. package/dist/src/utils/events/index.d.ts +7 -0
  83. package/dist/src/utils/index.d.ts +30 -19
  84. package/dist/src/utils/integrations/draco-loader.d.ts +2 -0
  85. package/dist/src/utils/integrations/index.d.ts +6 -0
  86. package/dist/src/utils/performance/index.d.ts +6 -0
  87. package/dist/src/utils/{viewportCulling.d.ts → performance/viewport-culling.d.ts} +0 -1
  88. package/dist/src/views/Preview.d.ts +4 -0
  89. package/dist/src/views/workflow/WorkflowDialog.d.ts +10 -30
  90. package/dist/src/views/workflow/components/AddNodeMenu.d.ts +5 -14
  91. package/dist/src/views/workflow/components/ElementSelector.d.ts +5 -27
  92. package/dist/src/views/workflow/components/PropertyPanel.d.ts +8 -15
  93. package/dist/src/views/workflow/components/node-configs/ClearTimerConfig.d.ts +4 -14
  94. package/dist/src/views/workflow/components/node-configs/ConditionConfig.d.ts +4 -14
  95. package/dist/src/views/workflow/components/node-configs/CustomCodeConfig.d.ts +4 -14
  96. package/dist/src/views/workflow/components/node-configs/GetPropertyConfig.d.ts +4 -14
  97. package/dist/src/views/workflow/components/node-configs/HttpRequestConfig.d.ts +4 -14
  98. package/dist/src/views/workflow/components/node-configs/SetPropertyConfig.d.ts +4 -14
  99. package/dist/src/views/workflow/components/node-configs/TimerConfig.d.ts +4 -14
  100. package/dist/src/views/workflow/config/nodeConfigRegistry.d.ts +0 -1
  101. package/dist/src/views/workflow/services/canvasElementService.d.ts +0 -1
  102. package/package.json +86 -82
  103. package/dist/src/components/AttributeConfigDialog.d.ts +0 -39
  104. package/dist/src/components/BasicPropertiesTab.d.ts +0 -51
  105. package/dist/src/components/BindingCard.d.ts +0 -39
  106. package/dist/src/components/CanvasArea.d.ts +0 -4
  107. package/dist/src/components/ComponentLibrary.d.ts +0 -34
  108. package/dist/src/components/ComponentPointSelector.d.ts +0 -29
  109. package/dist/src/components/ContextMenu.d.ts +0 -63
  110. package/dist/src/components/CustomCodeDialog.d.ts +0 -30
  111. package/dist/src/components/DataPropertiesTab.d.ts +0 -24
  112. package/dist/src/components/DataSourceDialog.d.ts +0 -26
  113. package/dist/src/components/EdgePropertiesTab.d.ts +0 -22
  114. package/dist/src/components/Footer.d.ts +0 -41
  115. package/dist/src/components/Header.d.ts +0 -73
  116. package/dist/src/components/MappingConfigurator.d.ts +0 -27
  117. package/dist/src/components/PropertyPanel.d.ts +0 -45
  118. package/dist/src/scada-components/iot/AlarmLight3D.d.ts +0 -14
  119. package/dist/src/scada-components/iot/Conveyor3D.d.ts +0 -14
  120. package/dist/src/scada-components/iot/Cylinder3D.d.ts +0 -14
  121. package/dist/src/scada-components/iot/EChartsGauge.d.ts +0 -14
  122. package/dist/src/scada-components/iot/EChartsLine.d.ts +0 -14
  123. package/dist/src/scada-components/iot/Filter3D.d.ts +0 -14
  124. package/dist/src/scada-components/iot/HeatExchanger3D.d.ts +0 -14
  125. package/dist/src/scada-components/iot/Light3D.d.ts +0 -14
  126. package/dist/src/scada-components/iot/Motor3D.d.ts +0 -14
  127. package/dist/src/scada-components/iot/Pipe3D.d.ts +0 -14
  128. package/dist/src/scada-components/iot/Pump3D.d.ts +0 -14
  129. package/dist/src/scada-components/iot/Switch3D.d.ts +0 -14
  130. package/dist/src/scada-components/iot/Tank3D.d.ts +0 -14
  131. package/dist/src/scada-components/iot/Tee3D.d.ts +0 -14
  132. package/dist/src/scada-components/iot/TemperatureSensor3D.d.ts +0 -14
  133. package/dist/src/scada-components/iot/Valve3D.d.ts +0 -14
  134. package/dist/src/scada-components/iot/industrial-3d-extended.d.ts +0 -18
  135. package/dist/src/scada-components/iot/industrial-3d-fluid.d.ts +0 -18
  136. package/dist/src/scada-components/iot/industrial-3d.d.ts +0 -18
  137. package/dist/src/scada-components/iot/light.d.ts +0 -6
  138. package/dist/src/scada-components/iot/switch.d.ts +0 -6
  139. package/dist/src/views/workflow/WorkflowEditor.d.ts +0 -38
  140. package/dist/src/views/workflow/components/WorkflowToolbar.d.ts +0 -24
  141. /package/dist/src/{components/CanvasConfigPanel.d.ts → App.d.ts} +0 -0
  142. /package/dist/src/scada-components/iot/{echarts-gauge-presets.d.ts → echarts-gauge/presets.d.ts} +0 -0
  143. /package/dist/src/scada-components/iot/{echarts-line-presets.d.ts → echarts-line/presets.d.ts} +0 -0
  144. /package/dist/src/utils/{animationEngine.d.ts → animation/animation-engine.d.ts} +0 -0
  145. /package/dist/src/utils/{animationScheduler.d.ts → animation/animation-scheduler.d.ts} +0 -0
  146. /package/dist/src/utils/{commonUtils.d.ts → core/common.d.ts} +0 -0
  147. /package/dist/src/utils/{fileUtils.d.ts → core/file.d.ts} +0 -0
  148. /package/dist/src/utils/{messageUtils.d.ts → core/message.d.ts} +0 -0
  149. /package/dist/src/utils/{storageUtils.d.ts → core/storage.d.ts} +0 -0
  150. /package/dist/src/utils/{nodePropertyUtils.d.ts → data/node-property.d.ts} +0 -0
  151. /package/dist/src/utils/{eventUtils.d.ts → events/event-utils.d.ts} +0 -0
  152. /package/dist/src/utils/{authCrypto.d.ts → integrations/auth-crypto.d.ts} +0 -0
  153. /package/dist/src/utils/{workerManager.d.ts → performance/worker-manager.d.ts} +0 -0
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Copyright (c) 2025 leoncheng
3
+ *
4
+ * Composables 统一导出
5
+ */
6
+ export { useGraphSetup } from './useGraphSetup';
7
+ export { useCanvasScale } from './useCanvasScale';
8
+ export { useGraphEvents } from './useGraphEvents';
9
+ export { useNodeOperations } from './useNodeOperations';
10
+ export { useDataSource } from './useDataSource';
11
+ export { useFileOperations } from './useFileOperations';
12
+ export { useAutoSave } from './useAutoSave';
@@ -0,0 +1,9 @@
1
+ import { Graph } from '@antv/x6';
2
+ /**
3
+ * 自动保存 Hook
4
+ */
5
+ export declare const useAutoSave: () => {
6
+ setupAutoSave: (graph: Graph) => void;
7
+ setupConfigAutoSave: (graph: Graph) => void;
8
+ cleanup: () => void;
9
+ };
@@ -0,0 +1,12 @@
1
+ import { Ref } from 'vue';
2
+ import { Graph } from '@antv/x6';
3
+ /**
4
+ * 画布缩放和视图控制 Hook
5
+ */
6
+ export declare const useCanvasScale: (graph: Ref<Graph | null>, containerRef: Ref<HTMLElement | undefined>) => {
7
+ calculateFitScale: () => number;
8
+ updateContainerTransform: (forceRecalculate?: boolean) => void;
9
+ initializeScale: () => void;
10
+ setupScaleListener: () => void;
11
+ fixSVGSize: (width: number, height: number) => void;
12
+ };
@@ -0,0 +1,87 @@
1
+ import { DataSource } from '../../../services/dataSourceManager';
2
+ /**
3
+ * 数据源管理 Hook
4
+ */
5
+ export declare const useDataSource: (deviceData?: any) => {
6
+ dataSources: import('vue').Ref<{
7
+ id: string;
8
+ name: string;
9
+ type: "MQTT" | "WebSocket" | "HTTP" | "SSE";
10
+ enabled: boolean;
11
+ config: {
12
+ broker?: string | undefined;
13
+ topic?: string | undefined;
14
+ clientId?: string | undefined;
15
+ username?: string | undefined;
16
+ password?: string | undefined;
17
+ wsUrl?: string | undefined;
18
+ url?: string | undefined;
19
+ method?: string | undefined;
20
+ pollInterval?: number | undefined;
21
+ headers?: Record<string, string> | undefined;
22
+ sseUrl?: string | undefined;
23
+ eventType?: string | undefined;
24
+ dataPath?: string | undefined;
25
+ retryCount?: number | undefined;
26
+ customParser?: ((data: any) => any) | undefined;
27
+ };
28
+ status?: {
29
+ connected: boolean;
30
+ lastUpdate?: string | undefined;
31
+ error?: string | undefined;
32
+ } | undefined;
33
+ devices: {
34
+ id: string;
35
+ name: string;
36
+ points: {
37
+ id: string;
38
+ value: any;
39
+ quality?: string | undefined;
40
+ timestamp?: string | undefined;
41
+ }[];
42
+ }[];
43
+ }[], DataSource[] | {
44
+ id: string;
45
+ name: string;
46
+ type: "MQTT" | "WebSocket" | "HTTP" | "SSE";
47
+ enabled: boolean;
48
+ config: {
49
+ broker?: string | undefined;
50
+ topic?: string | undefined;
51
+ clientId?: string | undefined;
52
+ username?: string | undefined;
53
+ password?: string | undefined;
54
+ wsUrl?: string | undefined;
55
+ url?: string | undefined;
56
+ method?: string | undefined;
57
+ pollInterval?: number | undefined;
58
+ headers?: Record<string, string> | undefined;
59
+ sseUrl?: string | undefined;
60
+ eventType?: string | undefined;
61
+ dataPath?: string | undefined;
62
+ retryCount?: number | undefined;
63
+ customParser?: ((data: any) => any) | undefined;
64
+ };
65
+ status?: {
66
+ connected: boolean;
67
+ lastUpdate?: string | undefined;
68
+ error?: string | undefined;
69
+ } | undefined;
70
+ devices: {
71
+ id: string;
72
+ name: string;
73
+ points: {
74
+ id: string;
75
+ value: any;
76
+ quality?: string | undefined;
77
+ timestamp?: string | undefined;
78
+ }[];
79
+ }[];
80
+ }[]>;
81
+ showDataSourceDialog: import('vue').Ref<boolean, boolean>;
82
+ mergedDeviceData: import('vue').ComputedRef<any>;
83
+ handleDataSource: () => void;
84
+ handleAddDataSource: (config: Omit<DataSource, "id" | "devices" | "status">) => void;
85
+ handleSaveDataSource: (dataSource: DataSource) => void;
86
+ handleDeleteDataSource: (id: string) => void;
87
+ };
@@ -0,0 +1,37 @@
1
+ import { Ref } from 'vue';
2
+ import { Graph } from '@antv/x6';
3
+ import { ScadaCanvasProps } from '../types/canvas';
4
+ /**
5
+ * 文件操作 Hook
6
+ */
7
+ export declare const useFileOperations: (graphRef: Ref<Graph | null>, props: ScadaCanvasProps, emit: any) => {
8
+ fileInputRef: Ref<HTMLInputElement | null, HTMLInputElement | null>;
9
+ getCanvasData: () => {
10
+ version: string;
11
+ timestamp: string;
12
+ config: import('../../..').CanvasConfig;
13
+ cells: import('@antv/x6').CellProperties[];
14
+ nodes: {
15
+ id: string;
16
+ type: string;
17
+ position: import('@antv/x6').PointLike;
18
+ size: {
19
+ width: number;
20
+ height: number;
21
+ };
22
+ label: unknown;
23
+ data: any;
24
+ }[];
25
+ edges: {
26
+ id: string;
27
+ source: string;
28
+ target: string;
29
+ }[];
30
+ } | null;
31
+ handleSave: () => Promise<void>;
32
+ handleImport: () => void;
33
+ handleFileSelect: (event: Event) => void;
34
+ handleExport: (mode?: "png" | "svg" | "json") => Promise<void>;
35
+ handlePreview: () => void;
36
+ loadCanvasData: (data: any) => boolean;
37
+ };
@@ -0,0 +1,22 @@
1
+ import { Ref } from 'vue';
2
+ import { Graph } from '@antv/x6';
3
+ import { MenuItem } from '../../../types/context-menu';
4
+ interface ContextMenuState {
5
+ visible: boolean;
6
+ position: {
7
+ x: number;
8
+ y: number;
9
+ };
10
+ items: MenuItem[];
11
+ targetCell: any;
12
+ }
13
+ /**
14
+ * Graph 事件处理 Hook
15
+ */
16
+ export declare const useGraphEvents: (graphRef: Ref<Graph | null>, contextMenu?: Ref<ContextMenuState>) => {
17
+ setupKeyboardShortcuts: () => void;
18
+ setupContextMenu: () => void;
19
+ handleUndo: () => void;
20
+ handleRedo: () => void;
21
+ };
22
+ export {};
@@ -0,0 +1,35 @@
1
+ import { Ref } from 'vue';
2
+ import { Graph } from '@antv/x6';
3
+ /**
4
+ * 节点操作 Hook
5
+ */
6
+ export declare const useNodeOperations: (graphRef: Ref<Graph | null>) => {
7
+ selectedNode: Ref<any, any>;
8
+ selectedEdge: Ref<any, any>;
9
+ selectedNodesCount: Ref<number, number>;
10
+ setupSelectionEvents: () => void;
11
+ handleAddNode: (type: string) => Promise<void>;
12
+ handleUpdateNode: (data: any) => void;
13
+ handleDeleteNode: () => void;
14
+ selectNode: (nodeId: string) => boolean;
15
+ clearSelection: () => void;
16
+ getAllNodes: () => {
17
+ id: string;
18
+ type: string;
19
+ position: import('@antv/x6').PointLike;
20
+ size: {
21
+ width: number;
22
+ height: number;
23
+ };
24
+ label: unknown;
25
+ data: any;
26
+ }[];
27
+ getNodeById: (nodeId: string) => {
28
+ id: any;
29
+ type: any;
30
+ position: any;
31
+ size: any;
32
+ label: any;
33
+ data: any;
34
+ } | null;
35
+ };
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Copyright (c) 2025 leoncheng
3
+ *
4
+ * Graph 配置
5
+ */
6
+ /**
7
+ * 创建 Graph 配置
8
+ *
9
+ * 默认以当前容器尺寸初始化画布大小:
10
+ * - width / height 使用传入的 containerWidth / containerHeight
11
+ * - 后续如果需要自适应容器,可以在 Graph 实例上单独开启 autoResize
12
+ */
13
+ export declare const createGraphConfig: (containerWidth: number, containerHeight: number) => {
14
+ width: number;
15
+ height: number;
16
+ autoResize: boolean;
17
+ background: {
18
+ color: string;
19
+ image: string;
20
+ size: import('../../..').BackgroundSize;
21
+ repeat: import('../../..').BackgroundRepeat;
22
+ position: string;
23
+ } | {
24
+ color: string;
25
+ image?: undefined;
26
+ size?: undefined;
27
+ repeat?: undefined;
28
+ position?: undefined;
29
+ };
30
+ grid: boolean | {
31
+ size: number;
32
+ visible: boolean;
33
+ type: "dot" | "mesh";
34
+ args: {
35
+ color: string;
36
+ thickness: number;
37
+ };
38
+ };
39
+ connecting: {
40
+ router: string;
41
+ connector: {
42
+ name: string;
43
+ args: {
44
+ radius: number;
45
+ };
46
+ };
47
+ anchor: string;
48
+ connectionPoint: string;
49
+ allowMulti: boolean;
50
+ allowBlank: boolean;
51
+ allowNode: boolean;
52
+ allowEdge: boolean;
53
+ allowPort: boolean;
54
+ highlight: boolean;
55
+ snap: {
56
+ radius: number;
57
+ };
58
+ createEdge(): import('@antv/x6').Edge<import('@antv/x6').EdgeProperties>;
59
+ validateMagnet({ magnet }: any): boolean;
60
+ validateConnection({ sourceView, targetView, sourceMagnet, targetMagnet }: any): boolean;
61
+ };
62
+ panning: boolean;
63
+ mousewheel: boolean;
64
+ };
@@ -0,0 +1,5 @@
1
+ import { Graph } from '@antv/x6';
2
+ /**
3
+ * 配置所有 X6 插件
4
+ */
5
+ export declare const setupPlugins: (graph: Graph) => void;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Copyright (c) 2025 leoncheng
3
+ *
4
+ * SCADA 自定义边形状:支持普通线条与管道(双线)样式
5
+ *
6
+ * 说明:本项目使用 AntV X6(图编辑/流程图),不是 G6(图可视化)。
7
+ * 边的自定义方式为 Shape.Edge.define() + markup/attrs,与 G6 的 BaseEdge/getKeyPath 不同。
8
+ */
9
+ /**
10
+ * 注册 SCADA 边形状:在默认 edge 基础上增加 pipeOuter 路径,用于管道双线效果
11
+ * - 普通样式:pipeOuter 不显示(stroke: 'none')
12
+ * - 管道样式:pipeOuter 显示为外圈粗线,与内线间距至少 PIPE_GAP_MIN
13
+ */
14
+ export declare const registerScadaEdgeShape: () => void;
@@ -0,0 +1,4 @@
1
+ import { EdgeView } from '@antv/x6';
2
+ export declare class ScadaEdgeView extends EdgeView {
3
+ update(options?: Record<string, unknown>): this;
4
+ }
@@ -0,0 +1,41 @@
1
+ import { Graph, Dnd } from '@antv/x6';
2
+ /**
3
+ * 自定义 Footer 配置
4
+ */
5
+ export interface CustomFooterConfig {
6
+ copyright?: string;
7
+ license?: string;
8
+ contact?: string;
9
+ }
10
+ /**
11
+ * ScadaCanvas 组件属性
12
+ */
13
+ export interface ScadaCanvasProps {
14
+ authCode?: string;
15
+ customFooter?: CustomFooterConfig;
16
+ previewMode?: boolean;
17
+ onSave?: (() => void) | (() => Promise<void>);
18
+ deviceData?: any;
19
+ dataSource?: any;
20
+ }
21
+ /**
22
+ * 右键菜单状态
23
+ */
24
+ export interface ContextMenuState {
25
+ visible: boolean;
26
+ position: {
27
+ x: number;
28
+ y: number;
29
+ };
30
+ items: any[];
31
+ targetCell: any;
32
+ }
33
+ /**
34
+ * Graph 实例引用
35
+ */
36
+ export interface GraphRefs {
37
+ graphRef: any;
38
+ dndRef: any;
39
+ graph: Graph | null;
40
+ dnd: Dnd | null;
41
+ }
@@ -0,0 +1,24 @@
1
+ import { ComponentPoint } from '../../scada-components/types';
2
+ import { BindingConfig } from '../../types/binding';
3
+ interface NodeProperty {
4
+ key: string;
5
+ label: string;
6
+ type: string;
7
+ }
8
+ type __VLS_Props = {
9
+ binding: BindingConfig;
10
+ index: number;
11
+ isCollapsed: boolean;
12
+ nodeProperties: NodeProperty[];
13
+ componentPoints: ComponentPoint[];
14
+ };
15
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ "toggle-collapse": () => any;
17
+ remove: () => any;
18
+ "update-field": (field: string, event: Event) => any;
19
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
20
+ "onToggle-collapse"?: (() => any) | undefined;
21
+ onRemove?: (() => any) | undefined;
22
+ "onUpdate-field"?: ((field: string, event: Event) => any) | undefined;
23
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
24
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { ComponentPoint } from '../../scada-components/types';
2
+ type __VLS_Props = {
3
+ visible: boolean;
4
+ modelValue?: string;
5
+ componentPoints: ComponentPoint[];
6
+ };
7
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ "update:visible": (value: boolean) => any;
9
+ "update:modelValue": (value: string) => any;
10
+ confirm: (pointId: string, point: ComponentPoint) => any;
11
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
12
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
13
+ "onUpdate:modelValue"?: ((value: string) => any) | undefined;
14
+ onConfirm?: ((pointId: string, point: ComponentPoint) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -22,26 +22,22 @@ interface NodeProperty {
22
22
  label: string;
23
23
  type: string;
24
24
  }
25
- declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
25
+ type __VLS_Props = {
26
26
  event: EventConfig;
27
27
  index: number;
28
28
  isCollapsed: boolean;
29
29
  nodeProperties: NodeProperty[];
30
- }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
31
- "toggle-collapse": () => void;
32
- remove: () => void;
33
- "update-field": (field: string, event: Event) => void;
34
- "update-condition": (field: string, event: Event) => void;
35
- "update-params": (field: string, event: Event) => void;
36
- "open-attribute-config": () => void;
37
- "open-custom-code": () => void;
38
- "open-workflow-selector": () => void;
39
- }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
40
- event: EventConfig;
41
- index: number;
42
- isCollapsed: boolean;
43
- nodeProperties: NodeProperty[];
44
- }>>> & Readonly<{
30
+ };
31
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
32
+ "toggle-collapse": () => any;
33
+ remove: () => any;
34
+ "update-field": (field: string, event: Event) => any;
35
+ "update-condition": (field: string, event: Event) => any;
36
+ "update-params": (field: string, event: Event) => any;
37
+ "open-attribute-config": () => any;
38
+ "open-custom-code": () => any;
39
+ "open-workflow-selector": () => any;
40
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
45
41
  "onToggle-collapse"?: (() => any) | undefined;
46
42
  onRemove?: (() => any) | undefined;
47
43
  "onUpdate-field"?: ((field: string, event: Event) => any) | undefined;
@@ -50,14 +46,5 @@ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropT
50
46
  "onOpen-attribute-config"?: (() => any) | undefined;
51
47
  "onOpen-custom-code"?: (() => any) | undefined;
52
48
  "onOpen-workflow-selector"?: (() => any) | undefined;
53
- }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
49
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
54
50
  export default _default;
55
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
56
- type __VLS_TypePropsToRuntimeProps<T> = {
57
- [K in keyof T]-?: {} extends Pick<T, K> ? {
58
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
59
- } : {
60
- type: import('vue').PropType<T[K]>;
61
- required: true;
62
- };
63
- };
@@ -0,0 +1,15 @@
1
+ import { MappingConfig } from '../../types/binding';
2
+ type __VLS_Props = {
3
+ visible: boolean;
4
+ modelValue?: MappingConfig;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:visible": (value: boolean) => any;
8
+ "update:modelValue": (value: MappingConfig) => any;
9
+ confirm: (value: MappingConfig) => any;
10
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
11
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
12
+ "onUpdate:modelValue"?: ((value: MappingConfig) => any) | undefined;
13
+ onConfirm?: ((value: MappingConfig) => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
15
+ export default _default;
@@ -0,0 +1,28 @@
1
+ interface AttributeGroup {
2
+ target: string;
3
+ property: string;
4
+ value: string;
5
+ }
6
+ interface NodeProperty {
7
+ key: string;
8
+ label: string;
9
+ type: string;
10
+ }
11
+ type __VLS_Props = {
12
+ attributeGroups: AttributeGroup[];
13
+ nodeProperties: NodeProperty[];
14
+ };
15
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
16
+ save: () => any;
17
+ close: () => any;
18
+ "add-group": () => any;
19
+ "remove-group": (index: number) => any;
20
+ "update-group": (index: number, field: keyof AttributeGroup, value: string) => any;
21
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
22
+ onSave?: (() => any) | undefined;
23
+ onClose?: (() => any) | undefined;
24
+ "onAdd-group"?: (() => any) | undefined;
25
+ "onRemove-group"?: ((index: number) => any) | undefined;
26
+ "onUpdate-group"?: ((index: number, field: keyof AttributeGroup, value: string) => any) | undefined;
27
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
28
+ export default _default;
@@ -0,0 +1,20 @@
1
+ import { Node } from '@antv/x6';
2
+ type __VLS_Props = {
3
+ code: string;
4
+ selectedNode: Node | null;
5
+ };
6
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
7
+ previewContainer: import('vue').Ref<HTMLElement | null, HTMLElement | null>;
8
+ DEFAULT_CODE: string;
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ save: () => any;
11
+ close: () => any;
12
+ "update:code": (value: string) => any;
13
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
14
+ onSave?: (() => any) | undefined;
15
+ onClose?: (() => any) | undefined;
16
+ "onUpdate:code"?: ((value: string) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
18
+ previewContainer: HTMLDivElement;
19
+ }, any>;
20
+ export default _default;
@@ -0,0 +1,16 @@
1
+ import { DataSource } from '../../services/dataSourceManager';
2
+ interface Props {
3
+ dataSources: DataSource[];
4
+ }
5
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
6
+ save: (dataSource: DataSource) => any;
7
+ close: () => any;
8
+ delete: (id: string) => any;
9
+ add: (dataSource: Omit<DataSource, "id" | "status" | "devices">) => any;
10
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
11
+ onSave?: ((dataSource: DataSource) => any) | undefined;
12
+ onClose?: (() => any) | undefined;
13
+ onDelete?: ((id: string) => any) | undefined;
14
+ onAdd?: ((dataSource: Omit<DataSource, "id" | "status" | "devices">) => any) | undefined;
15
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,37 @@
1
+ interface Props {
2
+ show: boolean;
3
+ title?: string;
4
+ width?: number | string;
5
+ closable?: boolean;
6
+ maskClosable?: boolean;
7
+ }
8
+ declare function __VLS_template(): {
9
+ attrs: Partial<{}>;
10
+ slots: {
11
+ title?(_: {}): any;
12
+ default?(_: {}): any;
13
+ footer?(_: {}): any;
14
+ };
15
+ refs: {};
16
+ rootEl: any;
17
+ };
18
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ "update:show": (value: boolean) => any;
21
+ "after-enter": () => any;
22
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
23
+ "onUpdate:show"?: ((value: boolean) => any) | undefined;
24
+ "onAfter-enter"?: (() => any) | undefined;
25
+ }>, {
26
+ title: string;
27
+ width: number | string;
28
+ closable: boolean;
29
+ maskClosable: boolean;
30
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
31
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
32
+ export default _default;
33
+ type __VLS_WithTemplateSlots<T, S> = T & {
34
+ new (): {
35
+ $slots: S;
36
+ };
37
+ };
@@ -5,9 +5,9 @@ interface Workflow {
5
5
  createdAt: number;
6
6
  updatedAt?: number;
7
7
  }
8
- declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
- close: () => void;
10
- select: (workflow: Workflow) => void;
8
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
9
+ select: (workflow: Workflow) => any;
10
+ close: () => any;
11
11
  }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
12
12
  onSelect?: ((workflow: Workflow) => any) | undefined;
13
13
  onClose?: (() => any) | undefined;
@@ -0,0 +1,16 @@
1
+ interface CustomFooterConfig {
2
+ copyright?: string;
3
+ license?: string;
4
+ contact?: string;
5
+ }
6
+ interface Props {
7
+ authCode?: string;
8
+ publicKeyPem?: string;
9
+ customFooter?: CustomFooterConfig;
10
+ }
11
+ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
12
+ authCode: string;
13
+ publicKeyPem: string;
14
+ customFooter: CustomFooterConfig;
15
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
16
+ export default _default;
@@ -0,0 +1,56 @@
1
+ interface Props {
2
+ selectedNodesCount?: number;
3
+ }
4
+ declare function __VLS_template(): {
5
+ attrs: Partial<{}>;
6
+ slots: {
7
+ left?(_: {}): any;
8
+ };
9
+ refs: {};
10
+ rootEl: HTMLElement;
11
+ };
12
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
13
+ declare const __VLS_component: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
14
+ save: () => any;
15
+ import: () => any;
16
+ workflow: () => any;
17
+ preview: () => any;
18
+ export: (mode: "png" | "svg" | "json") => any;
19
+ dataSource: () => any;
20
+ undo: () => any;
21
+ redo: () => any;
22
+ alignLeft: () => any;
23
+ alignCenter: () => any;
24
+ alignRight: () => any;
25
+ alignTop: () => any;
26
+ alignMiddle: () => any;
27
+ alignBottom: () => any;
28
+ distributeHorizontal: () => any;
29
+ distributeVertical: () => any;
30
+ }, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
31
+ onSave?: (() => any) | undefined;
32
+ onImport?: (() => any) | undefined;
33
+ onWorkflow?: (() => any) | undefined;
34
+ onPreview?: (() => any) | undefined;
35
+ onExport?: ((mode: "png" | "svg" | "json") => any) | undefined;
36
+ onDataSource?: (() => any) | undefined;
37
+ onUndo?: (() => any) | undefined;
38
+ onRedo?: (() => any) | undefined;
39
+ onAlignLeft?: (() => any) | undefined;
40
+ onAlignCenter?: (() => any) | undefined;
41
+ onAlignRight?: (() => any) | undefined;
42
+ onAlignTop?: (() => any) | undefined;
43
+ onAlignMiddle?: (() => any) | undefined;
44
+ onAlignBottom?: (() => any) | undefined;
45
+ onDistributeHorizontal?: (() => any) | undefined;
46
+ onDistributeVertical?: (() => any) | undefined;
47
+ }>, {
48
+ selectedNodesCount: number;
49
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLElement>;
50
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
51
+ export default _default;
52
+ type __VLS_WithTemplateSlots<T, S> = T & {
53
+ new (): {
54
+ $slots: S;
55
+ };
56
+ };