@nywqs/scada-engine 1.1.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 (67) hide show
  1. package/README.md +455 -0
  2. package/dist/components/AttributeConfigDialog.d.ts +39 -0
  3. package/dist/components/BasicPropertiesTab.d.ts +51 -0
  4. package/dist/components/BindingCard.d.ts +36 -0
  5. package/dist/components/CanvasArea.d.ts +4 -0
  6. package/dist/components/CanvasConfigPanel.d.ts +2 -0
  7. package/dist/components/ComponentLibrary.d.ts +6 -0
  8. package/dist/components/CustomCodeDialog.d.ts +30 -0
  9. package/dist/components/DataPropertiesTab.d.ts +42 -0
  10. package/dist/components/DevicePointSelector.d.ts +27 -0
  11. package/dist/components/EdgePropertiesTab.d.ts +22 -0
  12. package/dist/components/EventCard.d.ts +63 -0
  13. package/dist/components/Footer.d.ts +37 -0
  14. package/dist/components/Header.d.ts +71 -0
  15. package/dist/components/MappingConfigurator.d.ts +27 -0
  16. package/dist/components/PropertyPanel.d.ts +27 -0
  17. package/dist/components/WorkflowSelectorDialog.d.ts +15 -0
  18. package/dist/index.d.ts +157 -0
  19. package/dist/main.d.ts +1 -0
  20. package/dist/mock/deviceData.d.ts +39 -0
  21. package/dist/scada-components/basic/circle.d.ts +6 -0
  22. package/dist/scada-components/basic/index.d.ts +6 -0
  23. package/dist/scada-components/basic/rect.d.ts +6 -0
  24. package/dist/scada-components/basic/text.d.ts +6 -0
  25. package/dist/scada-components/canvas/config.d.ts +17 -0
  26. package/dist/scada-components/canvas/index.d.ts +6 -0
  27. package/dist/scada-components/canvas/manager.d.ts +95 -0
  28. package/dist/scada-components/canvas/types.d.ts +77 -0
  29. package/dist/scada-components/index.d.ts +8 -0
  30. package/dist/scada-components/iot/gauge.d.ts +6 -0
  31. package/dist/scada-components/iot/index.d.ts +6 -0
  32. package/dist/scada-components/iot/light.d.ts +6 -0
  33. package/dist/scada-components/iot/switch.d.ts +6 -0
  34. package/dist/scada-components/registry.d.ts +56 -0
  35. package/dist/scada-components/types.d.ts +82 -0
  36. package/dist/scada-engine.css +1 -0
  37. package/dist/scada-engine.es.js +12390 -0
  38. package/dist/scada-engine.umd.js +53 -0
  39. package/dist/types/binding.d.ts +75 -0
  40. package/dist/types/device.d.ts +131 -0
  41. package/dist/types/workflow.d.ts +195 -0
  42. package/dist/utils/animationEngine.d.ts +68 -0
  43. package/dist/utils/authCrypto.d.ts +45 -0
  44. package/dist/utils/commonUtils.d.ts +83 -0
  45. package/dist/utils/eventUtils.d.ts +43 -0
  46. package/dist/utils/fileUtils.d.ts +43 -0
  47. package/dist/utils/index.d.ts +10 -0
  48. package/dist/utils/messageUtils.d.ts +56 -0
  49. package/dist/utils/nodePropertyUtils.d.ts +33 -0
  50. package/dist/utils/storageUtils.d.ts +55 -0
  51. package/dist/views/workflow/WorkflowDialog.d.ts +37 -0
  52. package/dist/views/workflow/WorkflowEditor.d.ts +38 -0
  53. package/dist/views/workflow/components/AddNodeMenu.d.ts +32 -0
  54. package/dist/views/workflow/components/ElementSelector.d.ts +45 -0
  55. package/dist/views/workflow/components/PropertyPanel.d.ts +27 -0
  56. package/dist/views/workflow/components/WorkflowToolbar.d.ts +24 -0
  57. package/dist/views/workflow/components/node-configs/ClearTimerConfig.d.ts +20 -0
  58. package/dist/views/workflow/components/node-configs/ConditionConfig.d.ts +20 -0
  59. package/dist/views/workflow/components/node-configs/CustomCodeConfig.d.ts +20 -0
  60. package/dist/views/workflow/components/node-configs/GetPropertyConfig.d.ts +20 -0
  61. package/dist/views/workflow/components/node-configs/HttpRequestConfig.d.ts +20 -0
  62. package/dist/views/workflow/components/node-configs/SetPropertyConfig.d.ts +20 -0
  63. package/dist/views/workflow/components/node-configs/TimerConfig.d.ts +20 -0
  64. package/dist/views/workflow/config/nodeConfigRegistry.d.ts +5 -0
  65. package/dist/views/workflow/services/canvasElementService.d.ts +31 -0
  66. package/dist/views/workflow/types/node.d.ts +70 -0
  67. package/package.json +77 -0
@@ -0,0 +1,22 @@
1
+ import { Edge } from '@antv/x6';
2
+
3
+ interface Props {
4
+ selectedEdge: Edge | null;
5
+ }
6
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ updateEdge: (updates: any) => void;
8
+ deleteEdge: () => void;
9
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
10
+ onUpdateEdge?: ((updates: any) => any) | undefined;
11
+ onDeleteEdge?: (() => any) | undefined;
12
+ }>, {}, {}, {}, {}, 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,63 @@
1
+ interface EventConfig {
2
+ name?: string;
3
+ type: string;
4
+ conditionType: string;
5
+ triggerRule?: string;
6
+ condition?: {
7
+ attribute?: string;
8
+ operator?: string;
9
+ value?: string;
10
+ [key: string]: any;
11
+ };
12
+ action: string;
13
+ params?: {
14
+ processId?: string;
15
+ processName?: string;
16
+ processParams?: string;
17
+ [key: string]: any;
18
+ };
19
+ }
20
+ interface NodeProperty {
21
+ key: string;
22
+ label: string;
23
+ type: string;
24
+ }
25
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
26
+ event: EventConfig;
27
+ index: number;
28
+ isCollapsed: boolean;
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<{
45
+ "onToggle-collapse"?: (() => any) | undefined;
46
+ onRemove?: (() => any) | undefined;
47
+ "onUpdate-field"?: ((field: string, event: Event) => any) | undefined;
48
+ "onUpdate-condition"?: ((field: string, event: Event) => any) | undefined;
49
+ "onUpdate-params"?: ((field: string, event: Event) => any) | undefined;
50
+ "onOpen-attribute-config"?: (() => any) | undefined;
51
+ "onOpen-custom-code"?: (() => any) | undefined;
52
+ "onOpen-workflow-selector"?: (() => any) | undefined;
53
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
54
+ 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,37 @@
1
+ interface CustomFooterConfig {
2
+ copyright?: string;
3
+ license?: string;
4
+ contact?: string;
5
+ }
6
+ interface Props {
7
+ authCode?: string;
8
+ customFooter?: CustomFooterConfig;
9
+ }
10
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
11
+ authCode: string;
12
+ customFooter: undefined;
13
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
14
+ authCode: string;
15
+ customFooter: undefined;
16
+ }>>> & Readonly<{}>, {
17
+ authCode: string;
18
+ customFooter: CustomFooterConfig;
19
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
20
+ export default _default;
21
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
22
+ type __VLS_TypePropsToRuntimeProps<T> = {
23
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
24
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
25
+ } : {
26
+ type: import('vue').PropType<T[K]>;
27
+ required: true;
28
+ };
29
+ };
30
+ type __VLS_WithDefaults<P, D> = {
31
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
32
+ default: D[K];
33
+ }> : P[K];
34
+ };
35
+ type __VLS_Prettify<T> = {
36
+ [K in keyof T]: T[K];
37
+ } & {};
@@ -0,0 +1,71 @@
1
+ interface Props {
2
+ selectedNodesCount?: number;
3
+ }
4
+ declare function __VLS_template(): {
5
+ left?(_: {}): any;
6
+ };
7
+ declare const __VLS_component: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
8
+ selectedNodesCount: number;
9
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
10
+ save: () => void;
11
+ import: () => void;
12
+ workflow: () => void;
13
+ preview: () => void;
14
+ export: () => void;
15
+ zoomIn: () => void;
16
+ zoomOut: () => void;
17
+ clearAll: () => void;
18
+ alignLeft: () => void;
19
+ alignCenter: () => void;
20
+ alignRight: () => void;
21
+ alignTop: () => void;
22
+ alignMiddle: () => void;
23
+ alignBottom: () => void;
24
+ distributeHorizontal: () => void;
25
+ distributeVertical: () => void;
26
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
27
+ selectedNodesCount: number;
28
+ }>>> & Readonly<{
29
+ onSave?: (() => any) | undefined;
30
+ onImport?: (() => any) | undefined;
31
+ onWorkflow?: (() => any) | undefined;
32
+ onPreview?: (() => any) | undefined;
33
+ onExport?: (() => any) | undefined;
34
+ onZoomIn?: (() => any) | undefined;
35
+ onZoomOut?: (() => any) | undefined;
36
+ onClearAll?: (() => any) | undefined;
37
+ onAlignLeft?: (() => any) | undefined;
38
+ onAlignCenter?: (() => any) | undefined;
39
+ onAlignRight?: (() => any) | undefined;
40
+ onAlignTop?: (() => any) | undefined;
41
+ onAlignMiddle?: (() => any) | undefined;
42
+ onAlignBottom?: (() => any) | undefined;
43
+ onDistributeHorizontal?: (() => any) | undefined;
44
+ onDistributeVertical?: (() => any) | undefined;
45
+ }>, {
46
+ selectedNodesCount: number;
47
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
48
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, ReturnType<typeof __VLS_template>>;
49
+ export default _default;
50
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
51
+ type __VLS_TypePropsToRuntimeProps<T> = {
52
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
53
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
54
+ } : {
55
+ type: import('vue').PropType<T[K]>;
56
+ required: true;
57
+ };
58
+ };
59
+ type __VLS_WithDefaults<P, D> = {
60
+ [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
61
+ default: D[K];
62
+ }> : P[K];
63
+ };
64
+ type __VLS_Prettify<T> = {
65
+ [K in keyof T]: T[K];
66
+ } & {};
67
+ type __VLS_WithTemplateSlots<T, S> = T & {
68
+ new (): {
69
+ $slots: S;
70
+ };
71
+ };
@@ -0,0 +1,27 @@
1
+ import { MappingConfig } from '../types/binding';
2
+
3
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
4
+ visible: boolean;
5
+ modelValue?: MappingConfig;
6
+ }>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
7
+ "update:visible": (value: boolean) => void;
8
+ "update:modelValue": (value: MappingConfig) => void;
9
+ confirm: (value: MappingConfig) => void;
10
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<{
11
+ visible: boolean;
12
+ modelValue?: MappingConfig;
13
+ }>>> & Readonly<{
14
+ "onUpdate:visible"?: ((value: boolean) => any) | undefined;
15
+ "onUpdate:modelValue"?: ((value: MappingConfig) => any) | undefined;
16
+ onConfirm?: ((value: MappingConfig) => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
+ export default _default;
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToRuntimeProps<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
@@ -0,0 +1,27 @@
1
+ import { Node, Edge } from '@antv/x6';
2
+
3
+ interface Props {
4
+ selectedNode: Node | null;
5
+ selectedEdge: Edge | null;
6
+ }
7
+ declare const _default: import('vue').DefineComponent<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
8
+ updateEdge: (data: any) => void;
9
+ deleteEdge: () => void;
10
+ updateNode: (data: any) => void;
11
+ deleteNode: () => void;
12
+ }, string, import('vue').PublicProps, Readonly<import('vue').ExtractPropTypes<__VLS_TypePropsToRuntimeProps<Props>>> & Readonly<{
13
+ onUpdateEdge?: ((data: any) => any) | undefined;
14
+ onDeleteEdge?: (() => any) | undefined;
15
+ onUpdateNode?: ((data: any) => any) | undefined;
16
+ onDeleteNode?: (() => any) | undefined;
17
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
18
+ export default _default;
19
+ type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
20
+ type __VLS_TypePropsToRuntimeProps<T> = {
21
+ [K in keyof T]-?: {} extends Pick<T, K> ? {
22
+ type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
23
+ } : {
24
+ type: import('vue').PropType<T[K]>;
25
+ required: true;
26
+ };
27
+ };
@@ -0,0 +1,15 @@
1
+ interface Workflow {
2
+ id: string;
3
+ name: string;
4
+ data: any;
5
+ createdAt: number;
6
+ updatedAt?: number;
7
+ }
8
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
9
+ close: () => void;
10
+ select: (workflow: Workflow) => void;
11
+ }, string, import('vue').PublicProps, Readonly<{}> & Readonly<{
12
+ onSelect?: ((workflow: Workflow) => any) | undefined;
13
+ onClose?: (() => any) | undefined;
14
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
15
+ export default _default;
@@ -0,0 +1,157 @@
1
+ import { App } from 'vue';
2
+ import { Graph } from '@antv/x6';
3
+ import { default as ScadaCanvas } from './components/ScadaCanvas';
4
+ import { default as PropertyPanel } from './components/PropertyPanel';
5
+ import { default as Header } from './components/Header';
6
+ import { default as ComponentLibrary } from './components/ComponentLibrary';
7
+ import { default as CanvasConfigPanel } from './components/CanvasConfigPanel';
8
+ import { default as BindingCard } from './components/BindingCard';
9
+ import { default as EventCard } from './components/EventCard';
10
+ import { default as BasicPropertiesTab } from './components/BasicPropertiesTab';
11
+ import { default as AttributeConfigDialog } from './components/AttributeConfigDialog';
12
+ import { default as CustomCodeDialog } from './components/CustomCodeDialog';
13
+
14
+ export * from './scada-components';
15
+ export { componentRegistry } from './scada-components/registry';
16
+ export type { ComponentConfig, ComponentRegistry, ComponentCategory, ComponentMetadata, ComponentProp, ComponentData, NodeAttrs, PropType } from './scada-components/types';
17
+ export { canvasConfigManager } from './scada-components/canvas';
18
+ export type { CanvasConfig, CanvasConfigItem, CanvasSizePreset, BackgroundSize, BackgroundRepeat } from './scada-components/canvas';
19
+ export { showMessage, saveToSession, loadFromSession, removeFromSession, saveToLocal, loadFromLocal, removeFromLocal, STORAGE_KEYS, exportToJSON, randomPosition, formatTimestamp, getCurrentTimestamp, generateUniqueId, generateEventId, generateNodeId } from './utils';
20
+ export { animationEngine } from './utils/animationEngine';
21
+ export interface EventConfig {
22
+ id?: string;
23
+ name?: string;
24
+ type: string;
25
+ conditionType?: string;
26
+ condition?: {
27
+ attribute?: string;
28
+ operator?: string;
29
+ value?: any;
30
+ };
31
+ action: string;
32
+ params?: Record<string, any>;
33
+ }
34
+ export interface BindingConfig {
35
+ id?: string;
36
+ type: string;
37
+ deviceId?: string;
38
+ dataPoint?: string;
39
+ attribute?: string;
40
+ eventId?: string;
41
+ transform?: string;
42
+ }
43
+ /**
44
+ * ScadaCanvas 组件暴露的 API 类型定义
45
+ */
46
+ export interface ScadaCanvasExposed {
47
+ /** 保存画布数据到 sessionStorage */
48
+ save: () => void;
49
+ /** 触发文件选择,导入 JSON 数据 */
50
+ import: () => void;
51
+ /** 导出画布数据为 JSON 文件 */
52
+ export: () => void;
53
+ /** 跳转到预览页面 */
54
+ preview: () => void;
55
+ /** 打开流程编排弹窗 */
56
+ workflow: () => void;
57
+ /** 放大画布 */
58
+ zoomIn: () => void;
59
+ /** 缩小画布 */
60
+ zoomOut: () => void;
61
+ /** 适应画布视图 */
62
+ fitView: () => void;
63
+ /** 清空画布所有元素 */
64
+ clearAll: () => void;
65
+ /** 添加节点 */
66
+ addNode: (type: string) => void;
67
+ /** 更新节点 */
68
+ updateNode: (data: any) => void;
69
+ /** 删除当前选中的节点 */
70
+ deleteNode: () => void;
71
+ /** 获取当前选中的节点 */
72
+ getSelectedNode: () => any;
73
+ /** 选中节点 */
74
+ selectNode: (nodeId: string) => boolean;
75
+ /** 取消选中 */
76
+ clearSelection: () => void;
77
+ /** 获取 X6 Graph 实例 */
78
+ getGraph: () => Graph | null;
79
+ /** 获取画布完整数据 */
80
+ getCanvasData: () => CanvasData | null;
81
+ /** 加载画布数据 */
82
+ loadCanvasData: (data: any) => boolean;
83
+ /** 获取所有节点 */
84
+ getAllNodes: () => NodeData[];
85
+ /** 根据ID获取节点 */
86
+ getNodeById: (nodeId: string) => NodeData | null;
87
+ /** 获取画布配置管理器 */
88
+ getConfigManager: () => any;
89
+ /** 更新画布配置 */
90
+ updateCanvasConfig: (config: any) => void;
91
+ /** 设置画布缩放 */
92
+ setZoom: (scale: number) => void;
93
+ /** 设置画布大小 */
94
+ setCanvasSize: (width: number, height: number) => void;
95
+ /** 设置背景颜色 */
96
+ setBackgroundColor: (color: string) => void;
97
+ /** 获取动画引擎 */
98
+ getAnimationEngine: () => any;
99
+ }
100
+ /**
101
+ * 节点数据结构
102
+ */
103
+ export interface NodeData {
104
+ id: string;
105
+ type: string;
106
+ position: {
107
+ x: number;
108
+ y: number;
109
+ };
110
+ size: {
111
+ width: number;
112
+ height: number;
113
+ };
114
+ label: string;
115
+ data: any;
116
+ }
117
+ /**
118
+ * 画布数据结构
119
+ */
120
+ export interface CanvasData {
121
+ /** 版本号 */
122
+ version: string;
123
+ /** 时间戳 */
124
+ timestamp: string;
125
+ /** 画布配置 */
126
+ config: any;
127
+ /** X6 画布元素 */
128
+ cells: any[];
129
+ /** 节点数据 */
130
+ nodes: Array<{
131
+ id: string;
132
+ type: string;
133
+ position: {
134
+ x: number;
135
+ y: number;
136
+ };
137
+ size: {
138
+ width: number;
139
+ height: number;
140
+ };
141
+ label: string;
142
+ data: any;
143
+ }>;
144
+ /** 连线数据 */
145
+ edges: Array<{
146
+ id: string;
147
+ source: string;
148
+ target: string;
149
+ }>;
150
+ }
151
+ export { ScadaCanvas, PropertyPanel, Header, ComponentLibrary, CanvasConfigPanel, BindingCard, EventCard, BasicPropertiesTab, AttributeConfigDialog, CustomCodeDialog, };
152
+ export declare const install: (app: App) => void;
153
+ declare const _default: {
154
+ install: (app: App) => void;
155
+ version: string;
156
+ };
157
+ export default _default;
package/dist/main.d.ts ADDED
@@ -0,0 +1 @@
1
+
@@ -0,0 +1,39 @@
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('../types/device').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
+ }[];
@@ -0,0 +1,6 @@
1
+ import { ComponentConfig } from '../types';
2
+
3
+ /**
4
+ * 圆形组件配置
5
+ */
6
+ export declare const CircleComponent: ComponentConfig;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 基础组件导出
3
+ */
4
+ export { RectComponent } from './rect';
5
+ export { CircleComponent } from './circle';
6
+ export { TextComponent } from './text';
@@ -0,0 +1,6 @@
1
+ import { ComponentConfig } from '../types';
2
+
3
+ /**
4
+ * 矩形组件配置
5
+ */
6
+ export declare const RectComponent: ComponentConfig;
@@ -0,0 +1,6 @@
1
+ import { ComponentConfig } from '../types';
2
+
3
+ /**
4
+ * 文本组件配置
5
+ */
6
+ export declare const TextComponent: ComponentConfig;
@@ -0,0 +1,17 @@
1
+ import { CanvasConfig, CanvasConfigItem } from './types';
2
+
3
+ /**
4
+ * 默认画布配置
5
+ */
6
+ export declare const defaultCanvasConfig: CanvasConfig;
7
+ /**
8
+ * 画布配置项定义
9
+ */
10
+ export declare const canvasConfigItems: CanvasConfigItem[];
11
+ /**
12
+ * 尺寸预设映射
13
+ */
14
+ export declare const sizePresetMap: Record<string, {
15
+ width: number;
16
+ height: number;
17
+ }>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * 画布配置系统统一导出
3
+ */
4
+ export type { CanvasConfig, CanvasConfigItem, CanvasSizePreset, BackgroundSize, BackgroundRepeat } from './types';
5
+ export { defaultCanvasConfig, canvasConfigItems, sizePresetMap } from './config';
6
+ export { canvasConfigManager } from './manager';
@@ -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 {};