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,297 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG 组件类型定义
|
|
3
|
+
* 支持外部数据驱动的内部局部动画
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 动画模板类型(预设的业务语义动画)
|
|
7
|
+
*/
|
|
8
|
+
export declare enum AnimationTemplateType {
|
|
9
|
+
/** 开度 → 旋转 (0~1 → 0~90°) */
|
|
10
|
+
OPENING_ROTATE = "opening-rotate",
|
|
11
|
+
/** 液位 → 高度 (0~100 → 填充高度) */
|
|
12
|
+
LEVEL_HEIGHT = "level-height",
|
|
13
|
+
/** 状态 → 颜色 (枚举/布尔 → 颜色映射) */
|
|
14
|
+
STATUS_COLOR = "status-color",
|
|
15
|
+
/** 数值 → 位置 (0~1 → 滑块位移) */
|
|
16
|
+
VALUE_POSITION = "value-position",
|
|
17
|
+
/** 速度 → 流动 (0~100 → stroke-dashoffset 动画速度) */
|
|
18
|
+
SPEED_FLOW = "speed-flow",
|
|
19
|
+
/** 透明度映射 (0~1 → opacity) */
|
|
20
|
+
VALUE_OPACITY = "value-opacity",
|
|
21
|
+
/** 字符串 → 文本内容 (直接显示) */
|
|
22
|
+
VALUE_TEXT = "value-text",
|
|
23
|
+
/** 自定义 (用户完全自定义) */
|
|
24
|
+
CUSTOM = "custom"
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 内部 SVG 部件定义
|
|
28
|
+
*/
|
|
29
|
+
export interface SVGPart {
|
|
30
|
+
/** 部件 ID(对应 SVG 中的 id 属性) */
|
|
31
|
+
id: string;
|
|
32
|
+
/** 部件名称(可读) */
|
|
33
|
+
name?: string;
|
|
34
|
+
/** SVG 元素类型 */
|
|
35
|
+
elementType?: 'g' | 'rect' | 'circle' | 'path' | 'polygon' | 'text' | 'line';
|
|
36
|
+
/** 部件描述 */
|
|
37
|
+
description?: string;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 内部动画配置
|
|
41
|
+
*/
|
|
42
|
+
export interface InternalAnimationConfig {
|
|
43
|
+
/** 动画 ID */
|
|
44
|
+
id: string;
|
|
45
|
+
/** 目标 SVG 部件 ID */
|
|
46
|
+
partId: string;
|
|
47
|
+
/** 驱动字段(node.data 中的字段名) */
|
|
48
|
+
driverProperty: string;
|
|
49
|
+
/** 动画模板类型 */
|
|
50
|
+
templateType: AnimationTemplateType;
|
|
51
|
+
/** 模板参数(根据不同模板有不同结构) */
|
|
52
|
+
templateParams?: AnimationTemplateParams;
|
|
53
|
+
/** 是否启用 */
|
|
54
|
+
enabled?: boolean;
|
|
55
|
+
/** 过渡时长(ms) */
|
|
56
|
+
transitionDuration?: number;
|
|
57
|
+
/** 缓动函数 */
|
|
58
|
+
easing?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out';
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* 动画模板参数(联合类型)
|
|
62
|
+
*/
|
|
63
|
+
export type AnimationTemplateParams = OpeningRotateParams | LevelHeightParams | StatusColorParams | ValuePositionParams | SpeedFlowParams | ValueOpacityParams | ValueTextParams | CustomParams;
|
|
64
|
+
/**
|
|
65
|
+
* 开度 → 旋转 参数
|
|
66
|
+
*/
|
|
67
|
+
export interface OpeningRotateParams {
|
|
68
|
+
type: AnimationTemplateType.OPENING_ROTATE;
|
|
69
|
+
/** 输入范围 */
|
|
70
|
+
inputRange: {
|
|
71
|
+
min: number;
|
|
72
|
+
max: number;
|
|
73
|
+
};
|
|
74
|
+
/** 输出角度范围(度) */
|
|
75
|
+
outputRange: {
|
|
76
|
+
min: number;
|
|
77
|
+
max: number;
|
|
78
|
+
};
|
|
79
|
+
/** 旋转中心 */
|
|
80
|
+
origin?: 'center' | 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* 液位 → 高度 参数
|
|
84
|
+
*/
|
|
85
|
+
export interface LevelHeightParams {
|
|
86
|
+
type: AnimationTemplateType.LEVEL_HEIGHT;
|
|
87
|
+
/** 输入范围 */
|
|
88
|
+
inputRange: {
|
|
89
|
+
min: number;
|
|
90
|
+
max: number;
|
|
91
|
+
};
|
|
92
|
+
/** 填充方向 */
|
|
93
|
+
direction?: 'bottom-up' | 'top-down' | 'left-right' | 'right-left';
|
|
94
|
+
/** 容器高度/宽度(默认使用元素自身尺寸) */
|
|
95
|
+
containerSize?: number;
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* 状态 → 颜色 参数
|
|
99
|
+
*/
|
|
100
|
+
export interface StatusColorParams {
|
|
101
|
+
type: AnimationTemplateType.STATUS_COLOR;
|
|
102
|
+
/** 颜色映射表 */
|
|
103
|
+
colorMap: Record<string | number, string>;
|
|
104
|
+
/** 默认颜色 */
|
|
105
|
+
defaultColor?: string;
|
|
106
|
+
/** 应用到的属性 */
|
|
107
|
+
applyTo?: 'fill' | 'stroke' | 'both';
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* 数值 → 位置 参数
|
|
111
|
+
*/
|
|
112
|
+
export interface ValuePositionParams {
|
|
113
|
+
type: AnimationTemplateType.VALUE_POSITION;
|
|
114
|
+
/** 输入范围 */
|
|
115
|
+
inputRange: {
|
|
116
|
+
min: number;
|
|
117
|
+
max: number;
|
|
118
|
+
};
|
|
119
|
+
/** 移动方向和距离 */
|
|
120
|
+
movement: {
|
|
121
|
+
axis: 'x' | 'y';
|
|
122
|
+
distance: number;
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 速度 → 流动 参数
|
|
127
|
+
*/
|
|
128
|
+
export interface SpeedFlowParams {
|
|
129
|
+
type: AnimationTemplateType.SPEED_FLOW;
|
|
130
|
+
/** 输入范围 */
|
|
131
|
+
inputRange: {
|
|
132
|
+
min: number;
|
|
133
|
+
max: number;
|
|
134
|
+
};
|
|
135
|
+
/** 流动速度范围(px/s) */
|
|
136
|
+
speedRange: {
|
|
137
|
+
min: number;
|
|
138
|
+
max: number;
|
|
139
|
+
};
|
|
140
|
+
/** 虚线图案长度 */
|
|
141
|
+
dashLength?: number;
|
|
142
|
+
}
|
|
143
|
+
/**
|
|
144
|
+
* 透明度 参数
|
|
145
|
+
*/
|
|
146
|
+
export interface ValueOpacityParams {
|
|
147
|
+
type: AnimationTemplateType.VALUE_OPACITY;
|
|
148
|
+
/** 输入范围 */
|
|
149
|
+
inputRange: {
|
|
150
|
+
min: number;
|
|
151
|
+
max: number;
|
|
152
|
+
};
|
|
153
|
+
/** 输出透明度范围 */
|
|
154
|
+
outputRange: {
|
|
155
|
+
min: number;
|
|
156
|
+
max: number;
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* 字符串 → 文本内容 参数
|
|
161
|
+
*/
|
|
162
|
+
export interface ValueTextParams {
|
|
163
|
+
type: AnimationTemplateType.VALUE_TEXT;
|
|
164
|
+
/** 默认文本(空值时显示) */
|
|
165
|
+
defaultText?: string;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* 自定义参数
|
|
169
|
+
*/
|
|
170
|
+
export interface CustomParams {
|
|
171
|
+
type: AnimationTemplateType.CUSTOM;
|
|
172
|
+
/** 自定义映射函数(序列化的函数体) */
|
|
173
|
+
mappingFunction?: string;
|
|
174
|
+
/** 其他自定义配置 */
|
|
175
|
+
[key: string]: any;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* SVG 组件元数据(扩展标准 ComponentMetadata)
|
|
179
|
+
*/
|
|
180
|
+
export interface SVGComponentMetadata {
|
|
181
|
+
/** 组件 ID */
|
|
182
|
+
id: string;
|
|
183
|
+
/** 组件名称 */
|
|
184
|
+
name: string;
|
|
185
|
+
/** 组件分类 */
|
|
186
|
+
category: 'basic' | 'iot' | 'chart' | 'custom';
|
|
187
|
+
/** 图标 */
|
|
188
|
+
icon: string;
|
|
189
|
+
/** 描述 */
|
|
190
|
+
description?: string;
|
|
191
|
+
/** 版本 */
|
|
192
|
+
version?: string;
|
|
193
|
+
/** 作者 */
|
|
194
|
+
author?: string;
|
|
195
|
+
/** SVG 来源信息 */
|
|
196
|
+
svgSource?: {
|
|
197
|
+
/** 原始文件名 */
|
|
198
|
+
fileName?: string;
|
|
199
|
+
/** 上传时间 */
|
|
200
|
+
uploadTime?: string;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
/**
|
|
204
|
+
* SVG 组件配置(完整)
|
|
205
|
+
*/
|
|
206
|
+
export interface SVGComponentConfig {
|
|
207
|
+
/** 元数据 */
|
|
208
|
+
metadata: SVGComponentMetadata;
|
|
209
|
+
/** 组件尺寸 */
|
|
210
|
+
size: {
|
|
211
|
+
width: number;
|
|
212
|
+
height: number;
|
|
213
|
+
};
|
|
214
|
+
/** SVG 内容(清理后的 SVG 字符串,去除 metadata 标签) */
|
|
215
|
+
svgContent: string;
|
|
216
|
+
/** 内部部件列表(自动提取 part-* 的元素) */
|
|
217
|
+
parts: SVGPart[];
|
|
218
|
+
/** 内部动画配置(可由组态工程师配置) */
|
|
219
|
+
internalAnimations?: InternalAnimationConfig[];
|
|
220
|
+
/** 默认数据(包含默认驱动字段) */
|
|
221
|
+
defaultData?: Record<string, any>;
|
|
222
|
+
/** 预设绑定(官方组件可提供) */
|
|
223
|
+
presetBindings?: Array<{
|
|
224
|
+
partId: string;
|
|
225
|
+
/** 驱动字段英文名(用于 data.xxx 字段) */
|
|
226
|
+
suggestedDriverProperty: string;
|
|
227
|
+
suggestedTemplate: AnimationTemplateType;
|
|
228
|
+
suggestedParams?: AnimationTemplateParams;
|
|
229
|
+
/** 可选:属性中文名称,用于属性面板显示 */
|
|
230
|
+
label?: string;
|
|
231
|
+
/** 可选:字段值类型,用于属性编辑器渲染 */
|
|
232
|
+
valueType?: 'number' | 'boolean' | 'string' | 'color';
|
|
233
|
+
/** 如果是布尔型,可配置备选值列表(如 0/1, open/closed 等) */
|
|
234
|
+
booleanOptions?: Array<{
|
|
235
|
+
value: string | number | boolean;
|
|
236
|
+
label: string;
|
|
237
|
+
}>;
|
|
238
|
+
}>;
|
|
239
|
+
/** 接线柱配置(从 SVG 文件的 metadata 中读取) */
|
|
240
|
+
ports?: Array<{
|
|
241
|
+
id: string;
|
|
242
|
+
group: 'top' | 'bottom' | 'left' | 'right';
|
|
243
|
+
args?: {
|
|
244
|
+
x?: number | string;
|
|
245
|
+
y?: number | string;
|
|
246
|
+
};
|
|
247
|
+
}>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* SVG 文件元数据格式(在 SVG 的 <metadata> 中)
|
|
251
|
+
*/
|
|
252
|
+
export interface SVGFileMetadata {
|
|
253
|
+
/** 组件元数据 */
|
|
254
|
+
component: {
|
|
255
|
+
id: string;
|
|
256
|
+
name: string;
|
|
257
|
+
category?: string;
|
|
258
|
+
icon?: string;
|
|
259
|
+
description?: string;
|
|
260
|
+
version?: string;
|
|
261
|
+
author?: string;
|
|
262
|
+
};
|
|
263
|
+
/** 默认尺寸 */
|
|
264
|
+
size?: {
|
|
265
|
+
width: number;
|
|
266
|
+
height: number;
|
|
267
|
+
};
|
|
268
|
+
/** 预设绑定(可选,官方组件提供) */
|
|
269
|
+
presetBindings?: Array<{
|
|
270
|
+
partId: string;
|
|
271
|
+
/** 驱动字段英文名(用于 data.xxx 字段) */
|
|
272
|
+
suggestedDriverProperty: string;
|
|
273
|
+
suggestedTemplate: AnimationTemplateType;
|
|
274
|
+
suggestedParams?: any;
|
|
275
|
+
/** 可选:属性中文名称,用于属性面板显示 */
|
|
276
|
+
label?: string;
|
|
277
|
+
/** 可选:字段值类型,用于属性编辑器渲染 */
|
|
278
|
+
valueType?: 'number' | 'boolean' | 'string' | 'color';
|
|
279
|
+
/** 如果是布尔型,可配置备选值列表(如 0/1, open/closed 等) */
|
|
280
|
+
booleanOptions?: Array<{
|
|
281
|
+
value: string | number | boolean;
|
|
282
|
+
label: string;
|
|
283
|
+
}>;
|
|
284
|
+
}>;
|
|
285
|
+
/** 接线柱配置(可选) */
|
|
286
|
+
ports?: Array<{
|
|
287
|
+
/** 接线柱 ID */
|
|
288
|
+
id: string;
|
|
289
|
+
/** 位置组 */
|
|
290
|
+
group: 'top' | 'bottom' | 'left' | 'right';
|
|
291
|
+
/** 自定义位置(可选,覆盖 group 的默认位置) */
|
|
292
|
+
args?: {
|
|
293
|
+
x?: number | string;
|
|
294
|
+
y?: number | string;
|
|
295
|
+
};
|
|
296
|
+
}>;
|
|
297
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG 组件系统演示和测试
|
|
3
|
+
* 在浏览器控制台运行以下代码进行测试
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* 演示1:加载示例 SVG 组件
|
|
7
|
+
*/
|
|
8
|
+
export declare function demo1_loadExamples(): Promise<void>;
|
|
9
|
+
/**
|
|
10
|
+
* 演示2:从字符串加载自定义 SVG
|
|
11
|
+
*/
|
|
12
|
+
export declare function demo2_loadCustomSvg(): void;
|
|
13
|
+
/**
|
|
14
|
+
* 演示3:配置内部动画
|
|
15
|
+
*/
|
|
16
|
+
export declare function demo3_configureAnimation(nodeId: string): void;
|
|
17
|
+
/**
|
|
18
|
+
* 演示4:模拟数据驱动动画
|
|
19
|
+
*/
|
|
20
|
+
export declare function demo4_simulateDataDrive(): void;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { AnimationTemplateType } from '../core/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 从目录批量加载示例 SVG 组件
|
|
5
|
+
*/
|
|
6
|
+
export declare function loadExampleSvgComponents(): Promise<void>;
|
|
7
|
+
/**
|
|
8
|
+
* 获取动画模板的友好名称
|
|
9
|
+
*/
|
|
10
|
+
export declare function getAnimationTemplateName(templateType: AnimationTemplateType): string;
|
|
11
|
+
/**
|
|
12
|
+
* 获取动画模板的描述
|
|
13
|
+
*/
|
|
14
|
+
export declare function getAnimationTemplateDescription(templateType: AnimationTemplateType): string;
|
|
15
|
+
/**
|
|
16
|
+
* 创建默认的动画模板参数
|
|
17
|
+
*/
|
|
18
|
+
export declare function createDefaultTemplateParams(templateType: AnimationTemplateType): any;
|
|
19
|
+
/**
|
|
20
|
+
* 验证内部动画配置
|
|
21
|
+
*/
|
|
22
|
+
export declare function validateInternalAnimation(config: any): {
|
|
23
|
+
valid: boolean;
|
|
24
|
+
errors: string[];
|
|
25
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SVG 组件系统统一导出
|
|
3
|
+
*/
|
|
4
|
+
export * from './core/types';
|
|
5
|
+
export { SVGParser } from './core/parser';
|
|
6
|
+
export { svgLoader, SVGLoader } from './core/loader';
|
|
7
|
+
export { animationTemplateEngine, AnimationTemplateEngine } from './rendering/animationTemplates';
|
|
8
|
+
export { default as SVGRenderer } from './rendering/SVGRenderer';
|
|
9
|
+
export { loadExampleSvgComponents, getAnimationTemplateName, getAnimationTemplateDescription, createDefaultTemplateParams, validateInternalAnimation } from './helpers/utils';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SVGComponentConfig } from '../core/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Props
|
|
5
|
+
*/
|
|
6
|
+
interface Props {
|
|
7
|
+
/** X6 节点对象 */
|
|
8
|
+
node?: any;
|
|
9
|
+
/** SVG 组件配置(从解析器来) */
|
|
10
|
+
config?: SVGComponentConfig;
|
|
11
|
+
}
|
|
12
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
15
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
16
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
17
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
18
|
+
} : {
|
|
19
|
+
type: import('vue').PropType<T[K]>;
|
|
20
|
+
required: true;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import { AnimationTemplateType, AnimationTemplateParams } from '../core/types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 动画模板引擎类
|
|
5
|
+
*/
|
|
6
|
+
export declare class AnimationTemplateEngine {
|
|
7
|
+
private states;
|
|
8
|
+
/**
|
|
9
|
+
* 应用动画模板
|
|
10
|
+
* @param element SVG 元素
|
|
11
|
+
* @param templateType 模板类型
|
|
12
|
+
* @param params 模板参数
|
|
13
|
+
* @param driverValue 驱动值(来自 node.data)
|
|
14
|
+
* @param options 动画选项
|
|
15
|
+
*/
|
|
16
|
+
applyTemplate(element: SVGGraphicsElement, templateType: AnimationTemplateType, params: AnimationTemplateParams, driverValue: any, options?: {
|
|
17
|
+
transitionDuration?: number;
|
|
18
|
+
easing?: string;
|
|
19
|
+
stateKey?: string;
|
|
20
|
+
}): void;
|
|
21
|
+
/**
|
|
22
|
+
* 开度 → 旋转
|
|
23
|
+
*/
|
|
24
|
+
private applyOpeningRotate;
|
|
25
|
+
/**
|
|
26
|
+
* 液位 → 高度
|
|
27
|
+
*/
|
|
28
|
+
private applyLevelHeight;
|
|
29
|
+
/**
|
|
30
|
+
* 对矩形应用液位
|
|
31
|
+
*/
|
|
32
|
+
private applyLevelToRect;
|
|
33
|
+
/**
|
|
34
|
+
* 对路径应用液位(使用 clip-path)
|
|
35
|
+
*/
|
|
36
|
+
private applyLevelToPath;
|
|
37
|
+
/**
|
|
38
|
+
* 使用 clip-path 应用液位
|
|
39
|
+
*/
|
|
40
|
+
private applyLevelWithClipPath;
|
|
41
|
+
/**
|
|
42
|
+
* 状态 → 颜色
|
|
43
|
+
*/
|
|
44
|
+
private applyStatusColor;
|
|
45
|
+
/**
|
|
46
|
+
* 数值 → 位置
|
|
47
|
+
*/
|
|
48
|
+
private applyValuePosition;
|
|
49
|
+
/**
|
|
50
|
+
* 速度 → 流动
|
|
51
|
+
*/
|
|
52
|
+
private applySpeedFlow;
|
|
53
|
+
/**
|
|
54
|
+
* 透明度映射
|
|
55
|
+
*/
|
|
56
|
+
private applyValueOpacity;
|
|
57
|
+
/**
|
|
58
|
+
* 字符串 → 文本内容
|
|
59
|
+
*/
|
|
60
|
+
private applyValueText;
|
|
61
|
+
/**
|
|
62
|
+
* 值映射(线性插值)
|
|
63
|
+
*/
|
|
64
|
+
private mapRange;
|
|
65
|
+
/**
|
|
66
|
+
* 获取变换原点
|
|
67
|
+
*/
|
|
68
|
+
private getTransformOrigin;
|
|
69
|
+
/**
|
|
70
|
+
* 确保流动动画的 CSS 已定义
|
|
71
|
+
*/
|
|
72
|
+
private ensureFlowAnimation;
|
|
73
|
+
/**
|
|
74
|
+
* 清理状态
|
|
75
|
+
*/
|
|
76
|
+
clearState(stateKey: string): void;
|
|
77
|
+
/**
|
|
78
|
+
* 清理所有状态
|
|
79
|
+
*/
|
|
80
|
+
clearAllStates(): void;
|
|
81
|
+
}
|
|
82
|
+
export declare const animationTemplateEngine: AnimationTemplateEngine;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCADA引擎授权加密解密工具
|
|
3
|
+
* 基于 AES-256-CBC + OpenSSL 格式
|
|
4
|
+
* 兼容 Node.js authkey_tool.js
|
|
5
|
+
*/
|
|
6
|
+
export declare function validateSignedLicense(token: string, publicKeyPem: string): Promise<boolean>;
|
|
7
|
+
export declare function getSignedAuthInfo(token: string, publicKeyPem: string): Promise<{
|
|
8
|
+
company: any;
|
|
9
|
+
expiryDate: any;
|
|
10
|
+
isValid: boolean;
|
|
11
|
+
} | null>;
|
|
12
|
+
declare const _default: {
|
|
13
|
+
validateSignedLicense: typeof validateSignedLicense;
|
|
14
|
+
getSignedAuthInfo: typeof getSignedAuthInfo;
|
|
15
|
+
};
|
|
16
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 工具函数统一导出
|
|
3
|
+
* 便于其他模块使用
|
|
4
|
+
*
|
|
5
|
+
* 注意:许多工具已移动到新的模块结构
|
|
6
|
+
* - 共享工具 -> shared/utils/
|
|
7
|
+
* - 共享管理器 -> shared/managers/
|
|
8
|
+
* - 动画系统 -> shared/animation/
|
|
9
|
+
* - Canvas操作 -> features/canvas/
|
|
10
|
+
*/
|
|
11
|
+
export * from '../shared/utils/nodePropertyUtils';
|
|
12
|
+
export * from '../shared/utils/eventUtils';
|
|
13
|
+
export * from '../shared/utils/storageUtils';
|
|
14
|
+
export * from '../shared/utils/fileUtils';
|
|
15
|
+
export * from '../shared/utils/commonUtils';
|
|
16
|
+
export * from '../shared/utils/messageUtils';
|
|
17
|
+
export * from '../shared/managers/eventManager';
|
|
18
|
+
export * from '../shared/managers/contextMenuManager';
|
|
19
|
+
export * from '../shared/managers/workerManager';
|
|
20
|
+
export * from '../shared/animation/animationScheduler';
|
|
21
|
+
export * from '../features/canvas/operations/graphOperations';
|
|
22
|
+
export * from '../features/canvas/operations/nodeOperations';
|
|
23
|
+
export * from '../features/canvas/operations/edgeOperations';
|
|
24
|
+
export * from '../features/canvas/managers/configWatcher';
|
|
25
|
+
export * from '../features/canvas/managers/layerManager';
|
|
26
|
+
export * from '../features/data-source/services/dataBindingService';
|
|
27
|
+
export * from './viewportCulling';
|
|
28
|
+
export * from './dracoLoader';
|
|
29
|
+
export * from './authCrypto';
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Graph } from '@antv/x6';
|
|
2
|
+
|
|
3
|
+
interface ViewportConfig {
|
|
4
|
+
enabled: boolean;
|
|
5
|
+
padding: number;
|
|
6
|
+
updateThrottle: number;
|
|
7
|
+
}
|
|
8
|
+
declare class ViewportCullingService {
|
|
9
|
+
private graph;
|
|
10
|
+
private config;
|
|
11
|
+
private updateTimer;
|
|
12
|
+
private isUpdating;
|
|
13
|
+
private nodeVisibilityCache;
|
|
14
|
+
private stats;
|
|
15
|
+
/**
|
|
16
|
+
* 初始化服务
|
|
17
|
+
*/
|
|
18
|
+
init(graph: Graph, config?: Partial<ViewportConfig>): void;
|
|
19
|
+
/**
|
|
20
|
+
* 调度更新(节流)
|
|
21
|
+
*/
|
|
22
|
+
private scheduleUpdate;
|
|
23
|
+
/**
|
|
24
|
+
* 更新节点可见性
|
|
25
|
+
*/
|
|
26
|
+
private updateVisibility;
|
|
27
|
+
/**
|
|
28
|
+
* 获取视口矩形区域
|
|
29
|
+
*/
|
|
30
|
+
private getViewportRect;
|
|
31
|
+
/**
|
|
32
|
+
* 判断节点是否在视口内
|
|
33
|
+
*/
|
|
34
|
+
private isNodeInViewport;
|
|
35
|
+
/**
|
|
36
|
+
* 强制更新所有节点可见性
|
|
37
|
+
*/
|
|
38
|
+
forceUpdate(): void;
|
|
39
|
+
/**
|
|
40
|
+
* 启用/禁用视口裁剪
|
|
41
|
+
*/
|
|
42
|
+
setEnabled(enabled: boolean): void;
|
|
43
|
+
/**
|
|
44
|
+
* 显示所有节点
|
|
45
|
+
*/
|
|
46
|
+
private showAllNodes;
|
|
47
|
+
/**
|
|
48
|
+
* 获取性能统计
|
|
49
|
+
*/
|
|
50
|
+
getStats(): {
|
|
51
|
+
totalNodes: number;
|
|
52
|
+
visibleNodes: number;
|
|
53
|
+
culledNodes: number;
|
|
54
|
+
cullRate: string;
|
|
55
|
+
lastUpdateTime: number;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* 销毁服务
|
|
59
|
+
*/
|
|
60
|
+
destroy(): void;
|
|
61
|
+
}
|
|
62
|
+
export declare const viewportCulling: ViewportCullingService;
|
|
63
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 数据处理 Worker
|
|
3
|
+
* 在后台线程处理复杂数据转换,避免阻塞主线程
|
|
4
|
+
*/
|
|
5
|
+
export declare enum WorkerMessageType {
|
|
6
|
+
PARSE_DEVICE_DATA = "PARSE_DEVICE_DATA",
|
|
7
|
+
TRANSFORM_BINDING_DATA = "TRANSFORM_BINDING_DATA",
|
|
8
|
+
BATCH_CALCULATE = "BATCH_CALCULATE",
|
|
9
|
+
ERROR = "ERROR"
|
|
10
|
+
}
|
|
11
|
+
export interface WorkerMessage {
|
|
12
|
+
id: string;
|
|
13
|
+
type: WorkerMessageType;
|
|
14
|
+
payload: any;
|
|
15
|
+
}
|
|
16
|
+
export interface WorkerResponse {
|
|
17
|
+
id: string;
|
|
18
|
+
type: WorkerMessageType;
|
|
19
|
+
result?: any;
|
|
20
|
+
error?: string;
|
|
21
|
+
}
|