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,95 @@
|
|
|
1
|
+
import { CanvasConfig } from './types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 画布配置管理器
|
|
5
|
+
*/
|
|
6
|
+
declare class CanvasConfigManager {
|
|
7
|
+
private config;
|
|
8
|
+
constructor();
|
|
9
|
+
/**
|
|
10
|
+
* 获取完整配置
|
|
11
|
+
*/
|
|
12
|
+
getConfig(): CanvasConfig;
|
|
13
|
+
/**
|
|
14
|
+
* 更新配置
|
|
15
|
+
*/
|
|
16
|
+
updateConfig(updates: Partial<CanvasConfig>): void;
|
|
17
|
+
/**
|
|
18
|
+
* 通过路径更新配置值
|
|
19
|
+
*/
|
|
20
|
+
updateByPath(path: string, value: any): void;
|
|
21
|
+
/**
|
|
22
|
+
* 通过路径获取配置值
|
|
23
|
+
*/
|
|
24
|
+
getByPath(path: string): any;
|
|
25
|
+
/**
|
|
26
|
+
* 设置画布尺寸
|
|
27
|
+
*/
|
|
28
|
+
setSize(width: number, height: number, preset?: string): void;
|
|
29
|
+
/**
|
|
30
|
+
* 更新画布尺寸(别名)
|
|
31
|
+
*/
|
|
32
|
+
updateSize(size: {
|
|
33
|
+
width: number;
|
|
34
|
+
height: number;
|
|
35
|
+
}): void;
|
|
36
|
+
/**
|
|
37
|
+
* 设置缩放
|
|
38
|
+
*/
|
|
39
|
+
setZoom(scale: number): void;
|
|
40
|
+
/**
|
|
41
|
+
* 设置偏移
|
|
42
|
+
*/
|
|
43
|
+
setOffset(x: number, y: number): void;
|
|
44
|
+
/**
|
|
45
|
+
* 设置背景颜色
|
|
46
|
+
*/
|
|
47
|
+
setBackgroundColor(color: string): void;
|
|
48
|
+
/**
|
|
49
|
+
* 更新背景配置(别名)
|
|
50
|
+
*/
|
|
51
|
+
updateBackground(bg: {
|
|
52
|
+
color?: string;
|
|
53
|
+
image?: string;
|
|
54
|
+
size?: string;
|
|
55
|
+
repeat?: string;
|
|
56
|
+
}): void;
|
|
57
|
+
/**
|
|
58
|
+
* 设置背景图片
|
|
59
|
+
*/
|
|
60
|
+
setBackgroundImage(url: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* 切换网格显示
|
|
63
|
+
*/
|
|
64
|
+
toggleGrid(enabled?: boolean): void;
|
|
65
|
+
/**
|
|
66
|
+
* 设置网格大小
|
|
67
|
+
*/
|
|
68
|
+
setGridSize(size: number): void;
|
|
69
|
+
/**
|
|
70
|
+
* 切换对齐
|
|
71
|
+
*/
|
|
72
|
+
toggleSnap(enabled?: boolean): void;
|
|
73
|
+
/**
|
|
74
|
+
* 切换参考线
|
|
75
|
+
*/
|
|
76
|
+
toggleGuides(enabled?: boolean): void;
|
|
77
|
+
/**
|
|
78
|
+
* 切换吸附
|
|
79
|
+
*/
|
|
80
|
+
toggleMagnetism(enabled?: boolean): void;
|
|
81
|
+
/**
|
|
82
|
+
* 重置配置
|
|
83
|
+
*/
|
|
84
|
+
reset(): void;
|
|
85
|
+
/**
|
|
86
|
+
* 导出配置
|
|
87
|
+
*/
|
|
88
|
+
export(): string;
|
|
89
|
+
/**
|
|
90
|
+
* 导入配置
|
|
91
|
+
*/
|
|
92
|
+
import(configJson: string): void;
|
|
93
|
+
}
|
|
94
|
+
export declare const canvasConfigManager: CanvasConfigManager;
|
|
95
|
+
export {};
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 画布配置类型定义
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* 画布尺寸预设
|
|
6
|
+
*/
|
|
7
|
+
export type CanvasSizePreset = '1920*1080' | '1366*768' | '1280*720' | '800*600' | 'custom';
|
|
8
|
+
/**
|
|
9
|
+
* 背景尺寸模式
|
|
10
|
+
*/
|
|
11
|
+
export type BackgroundSize = 'origin' | 'contain' | 'cover' | 'stretch';
|
|
12
|
+
/**
|
|
13
|
+
* 图像重复模式
|
|
14
|
+
*/
|
|
15
|
+
export type BackgroundRepeat = 'repeat' | 'repeat-x' | 'repeat-y' | 'no-repeat';
|
|
16
|
+
/**
|
|
17
|
+
* 画布配置接口
|
|
18
|
+
*/
|
|
19
|
+
export interface CanvasConfig {
|
|
20
|
+
size: {
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
preset?: CanvasSizePreset;
|
|
24
|
+
};
|
|
25
|
+
zoom: {
|
|
26
|
+
scale: number;
|
|
27
|
+
min?: number;
|
|
28
|
+
max?: number;
|
|
29
|
+
};
|
|
30
|
+
offset: {
|
|
31
|
+
x: number;
|
|
32
|
+
y: number;
|
|
33
|
+
};
|
|
34
|
+
background: {
|
|
35
|
+
color?: string;
|
|
36
|
+
image?: string;
|
|
37
|
+
size?: BackgroundSize;
|
|
38
|
+
repeat?: BackgroundRepeat;
|
|
39
|
+
};
|
|
40
|
+
grid: {
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
size: number;
|
|
43
|
+
color?: string;
|
|
44
|
+
type?: 'dot' | 'mesh';
|
|
45
|
+
};
|
|
46
|
+
snap: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
threshold?: number;
|
|
49
|
+
};
|
|
50
|
+
guides: {
|
|
51
|
+
enabled: boolean;
|
|
52
|
+
color?: string;
|
|
53
|
+
};
|
|
54
|
+
magnetism: {
|
|
55
|
+
enabled: boolean;
|
|
56
|
+
threshold?: number;
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 画布配置项定义
|
|
61
|
+
*/
|
|
62
|
+
export interface CanvasConfigItem {
|
|
63
|
+
key: string;
|
|
64
|
+
label: string;
|
|
65
|
+
type: 'select' | 'number' | 'color' | 'boolean' | 'slider' | 'image';
|
|
66
|
+
category: 'basic' | 'transform' | 'background' | 'assist';
|
|
67
|
+
path: string;
|
|
68
|
+
defaultValue: any;
|
|
69
|
+
options?: Array<{
|
|
70
|
+
label: string;
|
|
71
|
+
value: any;
|
|
72
|
+
}>;
|
|
73
|
+
min?: number;
|
|
74
|
+
max?: number;
|
|
75
|
+
step?: number;
|
|
76
|
+
description?: string;
|
|
77
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
node?: any;
|
|
3
|
+
}
|
|
4
|
+
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>;
|
|
5
|
+
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: import('vue').PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ECharts 仪表盘预设样式配置
|
|
3
|
+
* 优化版本:减少拥挤感,增加留白和可读性
|
|
4
|
+
*/
|
|
5
|
+
export interface GaugePreset {
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
config: any;
|
|
9
|
+
}
|
|
10
|
+
export declare const gaugePresets: GaugePreset[];
|
|
11
|
+
/**
|
|
12
|
+
* 根据预设ID获取预设配置
|
|
13
|
+
*/
|
|
14
|
+
export declare function getPresetById(presetId: string): GaugePreset | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* 应用预设配置到节点数据
|
|
17
|
+
*/
|
|
18
|
+
export declare function applyPresetConfig(presetId: string): any;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
node?: any;
|
|
3
|
+
}
|
|
4
|
+
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>;
|
|
5
|
+
export default _default;
|
|
6
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
7
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
8
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
9
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
10
|
+
} : {
|
|
11
|
+
type: import('vue').PropType<T[K]>;
|
|
12
|
+
required: true;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ECharts 折线图预设样式配置
|
|
3
|
+
*/
|
|
4
|
+
export interface LinePreset {
|
|
5
|
+
id: string;
|
|
6
|
+
name: string;
|
|
7
|
+
config: any;
|
|
8
|
+
}
|
|
9
|
+
export declare const linePresets: LinePreset[];
|
|
10
|
+
/**
|
|
11
|
+
* 根据预设ID获取预设配置
|
|
12
|
+
*/
|
|
13
|
+
export declare function getLinePresetById(presetId: string): LinePreset | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SCADA 组件系统统一导出
|
|
3
|
+
*/
|
|
4
|
+
export { componentRegistry } from './registry';
|
|
5
|
+
export * from './canvas';
|
|
6
|
+
export type { ComponentConfig, ComponentRegistry, ComponentCategory, ComponentMetadata, ComponentProp, ComponentData, NodeAttrs, PropType } from './types';
|
|
7
|
+
export * as IoTComponents from './chart';
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import { ComponentRegistry, ComponentConfig, ComponentCategory } from './types';
|
|
2
|
+
|
|
3
|
+
type ComponentLoader = () => Promise<{
|
|
4
|
+
default: ComponentConfig;
|
|
5
|
+
}>;
|
|
6
|
+
/**
|
|
7
|
+
* 组件注册表
|
|
8
|
+
*/
|
|
9
|
+
declare class ComponentRegistryManager {
|
|
10
|
+
private registry;
|
|
11
|
+
private lazyRegistry;
|
|
12
|
+
private loadingPromises;
|
|
13
|
+
constructor();
|
|
14
|
+
/**
|
|
15
|
+
* 注册默认组件(立即加载)
|
|
16
|
+
*/
|
|
17
|
+
private registerDefaultComponents;
|
|
18
|
+
/**
|
|
19
|
+
* 注册懒加载组件(零配置 - 基于约定自动发现)
|
|
20
|
+
* 约定:所有 iot/industrial-* 目录下的 index.ts 文件自动注册为懒加载组件
|
|
21
|
+
* 策略:延迟加载 - 首次请求组件时才加载整个模块,并注册模块内的所有组件
|
|
22
|
+
*/
|
|
23
|
+
private registerLazyComponents;
|
|
24
|
+
/**
|
|
25
|
+
* 注册 Vue Shape 到 X6
|
|
26
|
+
*/
|
|
27
|
+
private registerVueShape;
|
|
28
|
+
/**
|
|
29
|
+
* 注册组件
|
|
30
|
+
*/
|
|
31
|
+
register(config: ComponentConfig): void;
|
|
32
|
+
/**
|
|
33
|
+
* 注册懒加载组件
|
|
34
|
+
*/
|
|
35
|
+
registerLazy(id: string, loader: ComponentLoader): void;
|
|
36
|
+
/**
|
|
37
|
+
* 批量注册组件
|
|
38
|
+
*/
|
|
39
|
+
registerBatch(configs: ComponentConfig[]): void;
|
|
40
|
+
/**
|
|
41
|
+
* 获取组件配置(支持懒加载)
|
|
42
|
+
*/
|
|
43
|
+
getComponent(id: string): Promise<ComponentConfig | undefined>;
|
|
44
|
+
/**
|
|
45
|
+
* 同步获取组件(仅已加载的)
|
|
46
|
+
*/
|
|
47
|
+
getComponentSync(id: string): ComponentConfig | undefined;
|
|
48
|
+
/**
|
|
49
|
+
* 加载懒加载组件
|
|
50
|
+
*/
|
|
51
|
+
private loadComponent;
|
|
52
|
+
/**
|
|
53
|
+
* 预加载组件
|
|
54
|
+
*/
|
|
55
|
+
preloadComponent(id: string): Promise<boolean>;
|
|
56
|
+
/**
|
|
57
|
+
* 批量预加载组件
|
|
58
|
+
*/
|
|
59
|
+
preloadComponents(ids: string[]): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* 预加载所有组件
|
|
62
|
+
* 包括模块级别的懒加载(以 __module__ 开头)
|
|
63
|
+
*/
|
|
64
|
+
preloadAllComponents(): Promise<void>;
|
|
65
|
+
/**
|
|
66
|
+
* 通过shape获取组件配置
|
|
67
|
+
*/
|
|
68
|
+
getComponentByShape(shape: string): ComponentConfig | undefined;
|
|
69
|
+
/**
|
|
70
|
+
* 获取所有组件(仅已加载)
|
|
71
|
+
*/
|
|
72
|
+
getAllComponents(): ComponentRegistry;
|
|
73
|
+
/**
|
|
74
|
+
* 获取所有组件ID(包括未加载)
|
|
75
|
+
*/
|
|
76
|
+
getAllComponentIds(): string[];
|
|
77
|
+
/**
|
|
78
|
+
* 按分类获取组件
|
|
79
|
+
*/
|
|
80
|
+
getComponentsByCategory(category: ComponentCategory): ComponentConfig[];
|
|
81
|
+
/**
|
|
82
|
+
* 获取组件列表
|
|
83
|
+
*/
|
|
84
|
+
getComponentList(): ComponentConfig[];
|
|
85
|
+
/**
|
|
86
|
+
* 检查组件是否存在
|
|
87
|
+
*/
|
|
88
|
+
hasComponent(id: string): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* 注销组件
|
|
91
|
+
*/
|
|
92
|
+
unregister(id: string): boolean;
|
|
93
|
+
/**
|
|
94
|
+
* 获取组件数量
|
|
95
|
+
*/
|
|
96
|
+
getCount(): number;
|
|
97
|
+
/**
|
|
98
|
+
* 获取已加载组件数量
|
|
99
|
+
*/
|
|
100
|
+
getLoadedCount(): number;
|
|
101
|
+
/**
|
|
102
|
+
* 获取懒加载统计
|
|
103
|
+
*/
|
|
104
|
+
getLazyLoadStats(): {
|
|
105
|
+
total: number;
|
|
106
|
+
loaded: number;
|
|
107
|
+
pending: number;
|
|
108
|
+
loadRate: string;
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* 清空注册表
|
|
112
|
+
*/
|
|
113
|
+
clear(): void;
|
|
114
|
+
}
|
|
115
|
+
export declare const componentRegistry: ComponentRegistryManager;
|
|
116
|
+
export type { ComponentConfig, ComponentRegistry, ComponentCategory };
|
|
117
|
+
export * from './types';
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { ComponentDataAdapter } from '../types/dataAdapter';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* 属性配置类型
|
|
5
|
+
*/
|
|
6
|
+
export type PropType = 'text' | 'number' | 'color' | 'boolean' | 'select' | 'slider';
|
|
7
|
+
/**
|
|
8
|
+
* 属性配置项
|
|
9
|
+
*/
|
|
10
|
+
export interface ComponentProp {
|
|
11
|
+
key: string;
|
|
12
|
+
label: string;
|
|
13
|
+
type: PropType;
|
|
14
|
+
path: string;
|
|
15
|
+
defaultValue?: any;
|
|
16
|
+
min?: number;
|
|
17
|
+
max?: number;
|
|
18
|
+
step?: number;
|
|
19
|
+
options?: Array<{
|
|
20
|
+
label: string;
|
|
21
|
+
value: any;
|
|
22
|
+
}>;
|
|
23
|
+
description?: string;
|
|
24
|
+
bindable?: boolean;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* 组件分类
|
|
28
|
+
*/
|
|
29
|
+
export type ComponentCategory = 'basic' | 'iot' | 'chart' | 'custom';
|
|
30
|
+
/**
|
|
31
|
+
* 组件元数据
|
|
32
|
+
*/
|
|
33
|
+
export interface ComponentMetadata {
|
|
34
|
+
id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
category: ComponentCategory;
|
|
37
|
+
icon: string;
|
|
38
|
+
description?: string;
|
|
39
|
+
version?: string;
|
|
40
|
+
author?: string;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* X6 节点属性
|
|
44
|
+
*/
|
|
45
|
+
export interface NodeAttrs {
|
|
46
|
+
body?: Record<string, any>;
|
|
47
|
+
label?: Record<string, any>;
|
|
48
|
+
[key: string]: any;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* 组件数据
|
|
52
|
+
*/
|
|
53
|
+
export interface ComponentData {
|
|
54
|
+
type: string;
|
|
55
|
+
deviceId?: string;
|
|
56
|
+
property?: string;
|
|
57
|
+
[key: string]: any;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* 组件点位定义(组件预定义的数据点)
|
|
61
|
+
*/
|
|
62
|
+
export interface ComponentPoint {
|
|
63
|
+
/** 点位ID(组件内部标识) */
|
|
64
|
+
id: string;
|
|
65
|
+
/** 点位名称 */
|
|
66
|
+
name: string;
|
|
67
|
+
/** 点位描述 */
|
|
68
|
+
description?: string;
|
|
69
|
+
/** 数据类型 */
|
|
70
|
+
dataType: 'boolean' | 'number' | 'string' | 'json';
|
|
71
|
+
/** 单位 */
|
|
72
|
+
unit?: string;
|
|
73
|
+
/** 默认值 */
|
|
74
|
+
defaultValue?: any;
|
|
75
|
+
/** 是否必需 */
|
|
76
|
+
required?: boolean;
|
|
77
|
+
/** 数值范围(仅number类型) */
|
|
78
|
+
range?: {
|
|
79
|
+
min?: number;
|
|
80
|
+
max?: number;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* 组件配置
|
|
85
|
+
*/
|
|
86
|
+
export interface ComponentConfig {
|
|
87
|
+
metadata: ComponentMetadata;
|
|
88
|
+
shape: string;
|
|
89
|
+
width: number;
|
|
90
|
+
height: number;
|
|
91
|
+
label: string;
|
|
92
|
+
attrs: NodeAttrs;
|
|
93
|
+
data?: ComponentData;
|
|
94
|
+
ports?: any;
|
|
95
|
+
props: ComponentProp[];
|
|
96
|
+
component?: any;
|
|
97
|
+
dataAdapter?: ComponentDataAdapter;
|
|
98
|
+
points?: ComponentPoint[];
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* 组件注册表
|
|
102
|
+
*/
|
|
103
|
+
export type ComponentRegistry = Record<string, ComponentConfig>;
|
|
104
|
+
/**
|
|
105
|
+
* 公共动画属性配置
|
|
106
|
+
* 可以在任何组件中复用
|
|
107
|
+
*/
|
|
108
|
+
export declare const COMMON_ANIMATION_PROPS: ComponentProp[];
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 动画执行引擎
|
|
3
|
+
* 负责处理组件的各种动画效果
|
|
4
|
+
*/
|
|
5
|
+
export type AnimationType = 'none' | 'blink' | 'scale' | 'rotate' | 'float' | 'pulse';
|
|
6
|
+
export interface AnimationConfig {
|
|
7
|
+
type: AnimationType;
|
|
8
|
+
duration: number;
|
|
9
|
+
loop: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 动画管理器
|
|
13
|
+
*/
|
|
14
|
+
declare class AnimationEngine {
|
|
15
|
+
animations: Map<string, any>;
|
|
16
|
+
/**
|
|
17
|
+
* 启动节点动画
|
|
18
|
+
* @param node X6 节点
|
|
19
|
+
* @param config 动画配置
|
|
20
|
+
*/
|
|
21
|
+
startAnimation(node: any, config: AnimationConfig): void;
|
|
22
|
+
/**
|
|
23
|
+
* 停止节点动画
|
|
24
|
+
* @param nodeId 节点ID
|
|
25
|
+
*/
|
|
26
|
+
stopAnimation(nodeId: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* 创建闪烁动画
|
|
29
|
+
*/
|
|
30
|
+
createBlinkAnimation(node: any, config: AnimationConfig): {
|
|
31
|
+
intervalId: NodeJS.Timeout;
|
|
32
|
+
stop: () => void;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* 创建缩放动画
|
|
36
|
+
*/
|
|
37
|
+
createScaleAnimation(node: any, config: AnimationConfig): {
|
|
38
|
+
intervalId: NodeJS.Timeout;
|
|
39
|
+
stop: () => void;
|
|
40
|
+
};
|
|
41
|
+
/**
|
|
42
|
+
* 创建旋转动画
|
|
43
|
+
*/
|
|
44
|
+
createRotateAnimation(node: any, config: AnimationConfig): {
|
|
45
|
+
intervalId: NodeJS.Timeout;
|
|
46
|
+
stop: () => void;
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* 创建浮动动画
|
|
50
|
+
*/
|
|
51
|
+
createFloatAnimation(node: any, config: AnimationConfig): {
|
|
52
|
+
intervalId: NodeJS.Timeout;
|
|
53
|
+
stop: () => void;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* 创建脉冲动画
|
|
57
|
+
*/
|
|
58
|
+
createPulseAnimation(node: any, config: AnimationConfig): {
|
|
59
|
+
intervalId: NodeJS.Timeout;
|
|
60
|
+
stop: () => void;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* 清除所有动画
|
|
64
|
+
*/
|
|
65
|
+
clearAll(): void;
|
|
66
|
+
}
|
|
67
|
+
export declare const animationEngine: AnimationEngine;
|
|
68
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 统一动画调度器
|
|
3
|
+
* 解决多个组件独立使用 requestAnimationFrame 导致的性能问题
|
|
4
|
+
*
|
|
5
|
+
* 优势:
|
|
6
|
+
* 1. 统一时间步进,避免动画不同步
|
|
7
|
+
* 2. 减少 RAF 调用次数,降低浏览器开销
|
|
8
|
+
* 3. 集中管理所有动画,便于调试和性能监控
|
|
9
|
+
* 4. 支持动画暂停/恢复/销毁
|
|
10
|
+
*/
|
|
11
|
+
export interface AnimationTask {
|
|
12
|
+
id: string;
|
|
13
|
+
callback: (deltaTime: number, currentTime: number) => void;
|
|
14
|
+
enabled: boolean;
|
|
15
|
+
lastTime: number;
|
|
16
|
+
}
|
|
17
|
+
declare class AnimationScheduler {
|
|
18
|
+
private tasks;
|
|
19
|
+
private rafId;
|
|
20
|
+
private isRunning;
|
|
21
|
+
private lastFrameTime;
|
|
22
|
+
private frameCount;
|
|
23
|
+
private fpsUpdateTime;
|
|
24
|
+
private currentFps;
|
|
25
|
+
/**
|
|
26
|
+
* 注册动画任务
|
|
27
|
+
* @param id 唯一标识符(通常使用组件 nodeId)
|
|
28
|
+
* @param callback 动画回调函数 (deltaTime: 距上次调用的毫秒数, currentTime: 当前时间戳)
|
|
29
|
+
*/
|
|
30
|
+
register(id: string, callback: (deltaTime: number, currentTime: number) => void): void;
|
|
31
|
+
/**
|
|
32
|
+
* 注销动画任务
|
|
33
|
+
* @param id 任务标识符
|
|
34
|
+
*/
|
|
35
|
+
unregister(id: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* 启用/禁用特定任务
|
|
38
|
+
* @param id 任务标识符
|
|
39
|
+
* @param enabled 是否启用
|
|
40
|
+
*/
|
|
41
|
+
setEnabled(id: string, enabled: boolean): void;
|
|
42
|
+
/**
|
|
43
|
+
* 启动调度器
|
|
44
|
+
*/
|
|
45
|
+
private start;
|
|
46
|
+
/**
|
|
47
|
+
* 停止调度器
|
|
48
|
+
*/
|
|
49
|
+
private stop;
|
|
50
|
+
/**
|
|
51
|
+
* 动画帧循环
|
|
52
|
+
*/
|
|
53
|
+
private tick;
|
|
54
|
+
/**
|
|
55
|
+
* 获取当前 FPS
|
|
56
|
+
*/
|
|
57
|
+
getFps(): number;
|
|
58
|
+
/**
|
|
59
|
+
* 获取活跃任务数量
|
|
60
|
+
*/
|
|
61
|
+
getActiveTaskCount(): number;
|
|
62
|
+
/**
|
|
63
|
+
* 暂停所有动画
|
|
64
|
+
*/
|
|
65
|
+
pauseAll(): void;
|
|
66
|
+
/**
|
|
67
|
+
* 恢复所有动画
|
|
68
|
+
*/
|
|
69
|
+
resumeAll(): void;
|
|
70
|
+
/**
|
|
71
|
+
* 清除所有任务并停止调度器
|
|
72
|
+
*/
|
|
73
|
+
destroy(): void;
|
|
74
|
+
/**
|
|
75
|
+
* 获取调度器状态(用于调试)
|
|
76
|
+
*/
|
|
77
|
+
getStatus(): {
|
|
78
|
+
isRunning: boolean;
|
|
79
|
+
taskCount: number;
|
|
80
|
+
activeTaskCount: number;
|
|
81
|
+
fps: number;
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export declare const animationScheduler: AnimationScheduler;
|
|
85
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
isCollapsed?: boolean;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
5
|
+
isCollapsed: boolean;
|
|
6
|
+
}>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
7
|
+
addComponent: (type: string) => void;
|
|
8
|
+
"update:collapsed": (value: boolean) => void;
|
|
9
|
+
}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
|
|
10
|
+
isCollapsed: boolean;
|
|
11
|
+
}>>> & Readonly<{
|
|
12
|
+
onAddComponent?: ((type: string) => any) | undefined;
|
|
13
|
+
"onUpdate:collapsed"?: ((value: boolean) => any) | undefined;
|
|
14
|
+
}>, {
|
|
15
|
+
isCollapsed: boolean;
|
|
16
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
|
|
19
|
+
type __VLS_TypePropsToRuntimeProps<T> = {
|
|
20
|
+
[K in keyof T]-?: {} extends Pick<T, K> ? {
|
|
21
|
+
type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
|
|
22
|
+
} : {
|
|
23
|
+
type: import('vue').PropType<T[K]>;
|
|
24
|
+
required: true;
|
|
25
|
+
};
|
|
26
|
+
};
|
|
27
|
+
type __VLS_WithDefaults<P, D> = {
|
|
28
|
+
[K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
|
|
29
|
+
default: D[K];
|
|
30
|
+
}> : P[K];
|
|
31
|
+
};
|
|
32
|
+
type __VLS_Prettify<T> = {
|
|
33
|
+
[K in keyof T]: T[K];
|
|
34
|
+
} & {};
|