@jnrs/lingshu-smart 2.2.4 → 2.2.5

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 (58) hide show
  1. package/README.md +4 -4
  2. package/dist/assets/data/editor_default.d.ts +9 -0
  3. package/dist/assets/data/editor_preset.d.ts +2 -0
  4. package/dist/components/editor/ControlBar/{CaseMangerButton.vue.d.ts → CaseManger.vue.d.ts} +3 -6
  5. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +26 -26
  6. package/dist/components/editor/ControlBar/MainButton.vue.d.ts +3 -6
  7. package/dist/components/editor/ControlBar/StepRecordVisualizer.vue.d.ts +3 -2
  8. package/dist/components/editor/OptionCard/Equipment/Interaction.vue.d.ts +2 -0
  9. package/dist/components/editor/OptionCard/Equipment/StationSlotGroup.vue.d.ts +2 -0
  10. package/dist/components/editor/index.vue.d.ts +5 -5
  11. package/dist/components/index.d.ts +2 -1
  12. package/dist/components/index.js +9852 -8884
  13. package/dist/components/preview/index.vue.d.ts +37 -0
  14. package/dist/composables/useStepRecord.d.ts +17 -3
  15. package/dist/constants/options.d.ts +2 -2
  16. package/dist/{core/ViewContainer.d.ts → controller/AppController.d.ts} +10 -6
  17. package/dist/{core/EditorManager.d.ts → controller/EditorController.d.ts} +8 -7
  18. package/dist/index.d.ts +1 -1
  19. package/dist/json/cases.json +219 -0
  20. package/dist/playground/ViewPageDemo.vue.d.ts +28 -0
  21. package/dist/stores/index.d.ts +3 -1
  22. package/dist/stores/useAppStore.d.ts +20 -0
  23. package/dist/stores/useDataStore.d.ts +29 -0
  24. package/dist/stores/useEditorStore.d.ts +15 -14295
  25. package/dist/types/app.types.d.ts +57 -0
  26. package/dist/types/base.types.d.ts +38 -0
  27. package/dist/types/components/config.types.d.ts +68 -0
  28. package/dist/types/components/operating.types.d.ts +40 -0
  29. package/dist/types/enums.d.ts +34 -0
  30. package/dist/types/guards.d.ts +2 -0
  31. package/dist/types/index.d.ts +15 -84
  32. package/dist/types/models/config.types.d.ts +45 -0
  33. package/dist/types/models/operating.types.d.ts +34 -0
  34. package/dist/ui/abstract/ComponentAbs.d.ts +18 -0
  35. package/dist/ui/abstract/ModelAbs.d.ts +24 -0
  36. package/dist/ui/components/Entrance.d.ts +50 -0
  37. package/dist/ui/components/Light.d.ts +6 -21
  38. package/dist/ui/components/Progress.d.ts +6 -22
  39. package/dist/ui/components/Resource.d.ts +6 -24
  40. package/dist/ui/components/StationSlot.d.ts +25 -31
  41. package/dist/ui/components/StationSlotGroup.d.ts +23 -0
  42. package/dist/ui/factories/createGlass.d.ts +12 -0
  43. package/dist/ui/factories/createModel.d.ts +3 -0
  44. package/dist/ui/factories/createShadow.d.ts +9 -0
  45. package/dist/ui/factories/createText.d.ts +20 -0
  46. package/dist/ui/models/MachineTool.d.ts +13 -8
  47. package/dist/ui/utils/attr.d.ts +9 -0
  48. package/dist/utils/index.d.ts +14 -18
  49. package/package.json +2 -2
  50. package/dist/assets/json/menu.json.d.ts +0 -187
  51. package/dist/json/case.json +0 -70
  52. package/dist/types/components.d.ts +0 -8
  53. package/dist/types/model.d.ts +0 -9
  54. package/dist/ui/models/BaseModel.d.ts +0 -32
  55. package/dist/ui/models/ModelsFactory.d.ts +0 -5
  56. package/dist/ui/shapes/Glass.d.ts +0 -12
  57. /package/dist/{playground/ViewPage.vue.d.ts → components/editor/OptionCard/Equipment/DataSets.vue.d.ts} +0 -0
  58. /package/dist/playground/{EditPage.vue.d.ts → EditPageDemo.vue.d.ts} +0 -0
@@ -0,0 +1,37 @@
1
+ import { ICase, ILayer, ILayerOperating, InteractiveUi } from '../../types';
2
+ export interface PreviewActions {
3
+ /**
4
+ * 加载案例列表
5
+ * @returns Promise<ICase[]>
6
+ */
7
+ loadCases?: (id?: string) => Promise<ICase[]>;
8
+ /**
9
+ * 点击事件
10
+ * @returns 设备信息
11
+ */
12
+ onTap?: (layer: ILayer, data: InteractiveUi) => void;
13
+ /**
14
+ * 右键点击事件
15
+ * @returns 设备信息
16
+ */
17
+ onMenuTap?: (layer: ILayer, data: InteractiveUi) => void;
18
+ /**
19
+ * 拖拽结束事件
20
+ * @returns 设备信息
21
+ */
22
+ onDragEnd?: (layer: ILayer, data: InteractiveUi) => void;
23
+ }
24
+ type __VLS_Props = {
25
+ actions?: PreviewActions;
26
+ /**
27
+ * 案例 uuid
28
+ */
29
+ caseUuid?: string;
30
+ };
31
+ declare const _default: import('vue').DefineComponent<__VLS_Props, {
32
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
33
+ operating: (data: ILayerOperating) => void;
34
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
35
+ actions: PreviewActions;
36
+ }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
37
+ export default _default;
@@ -1,11 +1,25 @@
1
- import { StepType } from '../types';
1
+ import { EnumStepType } from '../types';
2
+ interface OperationRecordItem {
3
+ hash: string;
4
+ data: string;
5
+ }
2
6
  export declare function useStepRecord(): {
3
7
  MAX_OPERATION_RECORD_LENGTH: number;
4
- operationRecord: import('vue').Ref<string[], string[]>;
8
+ operationRecord: import('vue').Ref<{
9
+ hash: string;
10
+ data: string;
11
+ }[], OperationRecordItem[] | {
12
+ hash: string;
13
+ data: string;
14
+ }[]>;
5
15
  currentOperationRecordIndex: import('vue').Ref<number, number>;
6
16
  operationRecordStatus: import('vue').ComputedRef<{
7
17
  canUndo: boolean;
8
18
  canRedo: boolean;
19
+ totalSteps: number;
20
+ currentIndex: number;
9
21
  }>;
10
- handleOperationRecordChange: (type: StepType) => void;
22
+ handleOperationRecordChange: (type: EnumStepType) => void;
23
+ jumpToStep: (index: number) => void;
11
24
  };
25
+ export {};
@@ -1,4 +1,4 @@
1
- import { ICase, ILayer } from '../types';
1
+ import { ICase, IModel } from '../types';
2
2
  /**
3
3
  * 新方案默认值
4
4
  */
@@ -6,4 +6,4 @@ export declare const CASE_INIT: ICase;
6
6
  /**
7
7
  * 新图层默认值
8
8
  */
9
- export declare const LAYER_INIT: ILayer;
9
+ export declare const DEFAULT_LAYER: IModel;
@@ -1,9 +1,12 @@
1
- import { IScene, IBaseModel, IContainer } from '../types';
1
+ import { IScene, ILayer, IContainer, ILayerOperating } from '../types';
2
2
  import { App } from 'leafer';
3
- export declare class ViewContainer {
3
+ export declare class AppController {
4
4
  app: App;
5
5
  private treeBoxUI;
6
- private models;
6
+ private modelsMap;
7
+ private businessMap;
8
+ private appEditable;
9
+ private actions;
7
10
  constructor(options?: IContainer);
8
11
  start(): void;
9
12
  destroy(): void;
@@ -13,7 +16,8 @@ export declare class ViewContainer {
13
16
  findOne(condition: string): import('leafer').IUI | undefined;
14
17
  removeOne(condition: string): void;
15
18
  clearAll(): void;
16
- addModel(modelConfig: IBaseModel): void;
17
- removeModelById(id: string): void;
18
- rerenderModel(modelConfig: IBaseModel): void;
19
+ removeModelById(uuid: string): void;
20
+ addModel(modelConfig: ILayer): void;
21
+ rerenderModel(modelConfig: ILayer): void;
22
+ operating(data: ILayerOperating): void;
19
23
  }
@@ -1,7 +1,7 @@
1
- import { IBaseModel } from '../types';
2
- import { ViewContainer } from './ViewContainer';
1
+ import { ILayer } from '../types';
2
+ import { AppController } from './AppController';
3
3
  interface EditorOptions {
4
- container: ViewContainer;
4
+ container: AppController;
5
5
  zoomMin?: number;
6
6
  zoomMax?: number;
7
7
  onSelected?: (data: any[]) => void;
@@ -10,15 +10,15 @@ interface EditorOptions {
10
10
  onMove?: (percentX: number, percentY: number) => void;
11
11
  }
12
12
  /**
13
- * EditorManager 类负责管理图形编辑功能,包括设备的选择、旋转和缩放等操作。它通过监听编辑器的事件来更新当前选中的设备,并提供方法来设置缩放范围、标尺和点阵等功能。
14
- * @param {string} options.container - ViewContainer 对象
13
+ * EditorController 类负责管理图形编辑功能,包括设备的选择、旋转和缩放等操作。它通过监听编辑器的事件来更新当前选中的设备,并提供方法来设置缩放范围、标尺和点阵等功能。
14
+ * @param {string} options.container - AppController 对象
15
15
  * @param {number} options.zoomMin - 最小缩放比例,默认为 0.1
16
16
  * @param {number} options.zoomMax - 最大缩放比例,默认为 10
17
17
  * @param {Function} options.onSelected - 设备选中事件的回调函数
18
18
  * @param {Function} options.onRotate - 设备旋转事件的回调函数,参数为旋转角度
19
19
  * @param {Function} options.onScale - 设备缩放事件的回调函数,参数为缩放比例
20
20
  */
21
- export declare class EditorManager {
21
+ export declare class EditorController {
22
22
  private container;
23
23
  private editor;
24
24
  private onSelected?;
@@ -27,7 +27,8 @@ export declare class EditorManager {
27
27
  private onMove?;
28
28
  constructor(options: EditorOptions);
29
29
  selectEquipment(condition?: string): void;
30
- rerenderModel(modelConfig: IBaseModel): void;
30
+ rerenderModel(modelConfig: ILayer): void;
31
31
  private addEvent;
32
+ destroy(): void;
32
33
  }
33
34
  export {};
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- export type * from './types';
1
+ export type * from './types/app.types';
@@ -0,0 +1,219 @@
1
+ {
2
+ "code": 0,
3
+ "msg": "操作成功",
4
+ "data": [
5
+ {
6
+ "uuid": "c6ec0fcb-4863-4c1a-a6ab-04eb26a909b2",
7
+ "isActive": true,
8
+ "title": "测试方案20260202",
9
+ "layers": [
10
+ {
11
+ "rawData": {
12
+ "id": "4c56e8b0-1a2b-11ec-8c3d-0242ac130003"
13
+ },
14
+ "uuid": "37aaa8d2-426f-4555-9b3e-b3e04b856ce0",
15
+ "equipmentName": "机床",
16
+ "width": 220,
17
+ "height": 240,
18
+ "x": 0.5,
19
+ "y": 0.5,
20
+ "percentX": 960,
21
+ "percentY": 540,
22
+ "rotation": 0,
23
+ "scale": 2,
24
+ "zIndex": 1,
25
+ "visible": true,
26
+ "clickable": true,
27
+ "menuClickable": true,
28
+ "draggable": false,
29
+ "editable": true,
30
+ "selected": false,
31
+ "hittable": true,
32
+ "hitSelf": true,
33
+ "className": "MachineTool",
34
+ "nameplate": "机床1",
35
+ "tags": ["机床"],
36
+ "stationSlotGroup": {
37
+ "width": 220,
38
+ "height": 70,
39
+ "flowOptions": {
40
+ "oneDirectionMaxQuantity": 2,
41
+ "gap": 5,
42
+ "flow": "x",
43
+ "flowWrap": false
44
+ },
45
+ "stationSlots": [
46
+ {
47
+ "name": "1",
48
+ "index": 1,
49
+ "resourceType": "Pallet",
50
+ "width": 50,
51
+ "height": 50,
52
+ "x": 0,
53
+ "y": 0,
54
+ "rotation": 0,
55
+ "disabled": false,
56
+ "hittable": true
57
+ },
58
+ {
59
+ "index": 2,
60
+ "resourceType": "Pallet",
61
+ "name": "2",
62
+ "x": 0,
63
+ "y": 0,
64
+ "width": 50,
65
+ "height": 50,
66
+ "rotation": 0,
67
+ "hittable": true,
68
+ "disabled": false
69
+ }
70
+ ]
71
+ }
72
+ },
73
+ {
74
+ "rawData": {
75
+ "id": "e8503ae8-e977-442b-9c9e-1c8b7e6594e3"
76
+ },
77
+ "uuid": "e8503ae8-e977-442b-9c9e-1c8b7e6594e3",
78
+ "equipmentName": "机床",
79
+ "width": 220,
80
+ "height": 240,
81
+ "x": 1,
82
+ "y": 1,
83
+ "percentX": 1920,
84
+ "percentY": 1080,
85
+ "rotation": 0,
86
+ "scale": 1,
87
+ "zIndex": 1,
88
+ "visible": true,
89
+ "clickable": true,
90
+ "menuClickable": true,
91
+ "draggable": false,
92
+ "editable": true,
93
+ "selected": false,
94
+ "hittable": true,
95
+ "hitSelf": true,
96
+ "className": "MachineTool",
97
+ "nameplate": "机床2",
98
+ "tags": ["机床"],
99
+ "stationSlotGroup": {
100
+ "width": 220,
101
+ "height": 70,
102
+ "flowOptions": {
103
+ "flow": "x",
104
+ "flowWrap": false,
105
+ "oneDirectionMaxQuantity": 2,
106
+ "gap": 5
107
+ },
108
+ "stationSlots": [
109
+ {
110
+ "name": "1",
111
+ "index": 1,
112
+ "resourceType": "Pallet",
113
+ "width": 50,
114
+ "height": 50,
115
+ "x": 0,
116
+ "y": 0,
117
+ "rotation": 0,
118
+ "disabled": false,
119
+ "hittable": true
120
+ }
121
+ ]
122
+ }
123
+ },
124
+ {
125
+ "rawData": {
126
+ "id": "ae320cd1-69c5-465f-a0a6-6d80bf255c9b"
127
+ },
128
+ "uuid": "ae320cd1-69c5-465f-a0a6-6d80bf255c9b",
129
+ "equipmentName": "机床",
130
+ "width": 220,
131
+ "height": 240,
132
+ "x": 0,
133
+ "y": 0,
134
+ "percentX": 0,
135
+ "percentY": 0,
136
+ "rotation": 0,
137
+ "scale": 1,
138
+ "zIndex": 1,
139
+ "visible": true,
140
+ "clickable": true,
141
+ "menuClickable": true,
142
+ "draggable": false,
143
+ "editable": true,
144
+ "selected": false,
145
+ "hittable": true,
146
+ "hitSelf": true,
147
+ "className": "MachineTool",
148
+ "nameplate": "机床3",
149
+ "tags": ["机床"],
150
+ "stationSlotGroup": {
151
+ "width": 220,
152
+ "height": 70,
153
+ "flowOptions": {
154
+ "flow": "x",
155
+ "flowWrap": false,
156
+ "oneDirectionMaxQuantity": 2,
157
+ "gap": 5
158
+ },
159
+ "stationSlots": [
160
+ {
161
+ "name": "1",
162
+ "index": 1,
163
+ "resourceType": "Pallet",
164
+ "width": 50,
165
+ "height": 50,
166
+ "x": 0,
167
+ "y": 0,
168
+ "rotation": 0,
169
+ "disabled": false,
170
+ "hittable": true
171
+ }
172
+ ]
173
+ }
174
+ }
175
+ ],
176
+ "scene": {
177
+ "width": 1920,
178
+ "height": 1080,
179
+ "zoomType": "fit",
180
+ "fill": {
181
+ "type": "radial",
182
+ "color": "#000",
183
+ "opacity": 1,
184
+ "stops": [
185
+ {
186
+ "offset": 0,
187
+ "color": "rgb(131, 186, 205)"
188
+ },
189
+ {
190
+ "offset": 1,
191
+ "color": "rgb(0, 152, 102)"
192
+ }
193
+ ],
194
+ "from": "center",
195
+ "to": "right"
196
+ },
197
+ "texture": ""
198
+ }
199
+ },
200
+ {
201
+ "uuid": "d672d006-0407-4dd8-96e0-711dba76d5a5",
202
+ "title": "方案d672d006",
203
+ "isActive": false,
204
+ "layers": [],
205
+ "scene": {
206
+ "width": 1920,
207
+ "height": 1080,
208
+ "zoomType": "fit",
209
+ "fill": {
210
+ "type": "solid",
211
+ "color": "#000",
212
+ "opacity": 1,
213
+ "stops": []
214
+ },
215
+ "texture": ""
216
+ }
217
+ }
218
+ ]
219
+ }
@@ -0,0 +1,28 @@
1
+ import { ICase, ILayerOperating } from '../types';
2
+ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
3
+ lingshuSmartPreviewRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
4
+ actions?: import('../components/preview/index.vue').PreviewActions;
5
+ caseUuid?: string;
6
+ }> & Readonly<{}>, {
7
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
8
+ operating: (data: ILayerOperating) => void;
9
+ }, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {
10
+ actions: import('../components/preview/index.vue').PreviewActions;
11
+ }, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, HTMLDivElement, import('vue').ComponentProvideOptions, {
12
+ P: {};
13
+ B: {};
14
+ D: {};
15
+ C: {};
16
+ M: {};
17
+ Defaults: {};
18
+ }, Readonly<{
19
+ actions?: import('../components/preview/index.vue').PreviewActions;
20
+ caseUuid?: string;
21
+ }> & Readonly<{}>, {
22
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
23
+ operating: (data: ILayerOperating) => void;
24
+ }, {}, {}, {}, {
25
+ actions: import('../components/preview/index.vue').PreviewActions;
26
+ }> | null;
27
+ }, HTMLDivElement>;
28
+ export default _default;
@@ -1 +1,3 @@
1
- export * from './useEditorStore';
1
+ export { useDataStore } from './useDataStore';
2
+ export { useEditorStore } from './useEditorStore';
3
+ export { useAppStore } from './useAppStore';
@@ -0,0 +1,20 @@
1
+ import { ICase, IContainer, ILayerOperating } from '../types';
2
+ export declare const useAppStore: import('pinia').StoreDefinition<"@jnrs/lingshu-smart/app", Pick<{
3
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
4
+ initContainer: (options: IContainer, caseUuid: string) => void;
5
+ resizeContainer: () => void;
6
+ destroyContainer: () => void;
7
+ operating: (data: ILayerOperating) => void;
8
+ }, "currentCase">, Pick<{
9
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
10
+ initContainer: (options: IContainer, caseUuid: string) => void;
11
+ resizeContainer: () => void;
12
+ destroyContainer: () => void;
13
+ operating: (data: ILayerOperating) => void;
14
+ }, never>, Pick<{
15
+ currentCase: import('vue').Ref<ICase | null | undefined, ICase | null | undefined>;
16
+ initContainer: (options: IContainer, caseUuid: string) => void;
17
+ resizeContainer: () => void;
18
+ destroyContainer: () => void;
19
+ operating: (data: ILayerOperating) => void;
20
+ }, "initContainer" | "resizeContainer" | "destroyContainer" | "operating">>;
@@ -0,0 +1,29 @@
1
+ import { ICase } from '../types';
2
+ export declare const useDataStore: import('pinia').StoreDefinition<"@jnrs/lingshu-smart/data", Pick<{
3
+ casesLoading: import('vue').Ref<boolean, boolean>;
4
+ equipmentsMenu: import('../types').IEquipmentsMenu[];
5
+ cases: import('vue').Ref<ICase[] | undefined, ICase[] | undefined>;
6
+ updateCases: (data?: ICase[]) => void;
7
+ selectCase: (uuid: string) => void;
8
+ addCase: (data?: ICase) => void;
9
+ removeCase: (uuid: string) => void;
10
+ clearCases: () => void;
11
+ }, "cases" | "casesLoading" | "equipmentsMenu">, Pick<{
12
+ casesLoading: import('vue').Ref<boolean, boolean>;
13
+ equipmentsMenu: import('../types').IEquipmentsMenu[];
14
+ cases: import('vue').Ref<ICase[] | undefined, ICase[] | undefined>;
15
+ updateCases: (data?: ICase[]) => void;
16
+ selectCase: (uuid: string) => void;
17
+ addCase: (data?: ICase) => void;
18
+ removeCase: (uuid: string) => void;
19
+ clearCases: () => void;
20
+ }, never>, Pick<{
21
+ casesLoading: import('vue').Ref<boolean, boolean>;
22
+ equipmentsMenu: import('../types').IEquipmentsMenu[];
23
+ cases: import('vue').Ref<ICase[] | undefined, ICase[] | undefined>;
24
+ updateCases: (data?: ICase[]) => void;
25
+ selectCase: (uuid: string) => void;
26
+ addCase: (data?: ICase) => void;
27
+ removeCase: (uuid: string) => void;
28
+ clearCases: () => void;
29
+ }, "updateCases" | "selectCase" | "addCase" | "removeCase" | "clearCases">>;