@jnrs/lingshu-smart 2.2.4 → 2.2.6

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 +3 -3
  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,23 @@
1
+ import { Flow } from 'leafer';
2
+ import { IResourceOperating, IStationSlotGroupConfig } from '../../types';
3
+ import { ComponentAbs } from '../abstract/ComponentAbs';
4
+ /**
5
+ * 工位槽位组容器
6
+ * @param config - 工位槽位组配置
7
+ * @param rotation - 可选的旋转角度,应用于所有子槽位
8
+ * @returns StationSlotGroup 实例,包含 Flow 容器和操作方法
9
+ */
10
+ export declare class StationSlotGroup extends ComponentAbs<IStationSlotGroupConfig> {
11
+ private parentRotation?;
12
+ private stationSlotInstances;
13
+ constructor(options: IStationSlotGroupConfig, parentRotation?: number);
14
+ get autoSize(): {
15
+ width: number;
16
+ height: number;
17
+ };
18
+ protected createUi(): Flow;
19
+ /**
20
+ * 操作方法:处理资源新增/移除
21
+ */
22
+ operating(val: IResourceOperating): void;
23
+ }
@@ -0,0 +1,12 @@
1
+ import { Box } from 'leafer';
2
+ export interface IGlassConfig {
3
+ x?: number;
4
+ y?: number;
5
+ width: number;
6
+ height: number;
7
+ cornerRadius?: number;
8
+ }
9
+ /**
10
+ * 创建具有磨砂玻璃效果的 Box 容器
11
+ */
12
+ export declare function createGlass(config: IGlassConfig): Box;
@@ -0,0 +1,3 @@
1
+ import { ILayer } from '../../types';
2
+ import { ModelAbs } from '../abstract/ModelAbs';
3
+ export declare function createModel(config: ILayer): ModelAbs;
@@ -0,0 +1,9 @@
1
+ import { Canvas, IShadowEffect } from 'leafer';
2
+ export interface IShadow {
3
+ width: number;
4
+ height: number;
5
+ cornerRadius?: number;
6
+ shadow?: IShadowEffect | IShadowEffect[];
7
+ innerShadow?: IShadowEffect | IShadowEffect[];
8
+ }
9
+ export declare function createShadow(options: IShadow): Canvas;
@@ -0,0 +1,20 @@
1
+ import { Text } from 'leafer';
2
+ export interface CreateTextOptions {
3
+ name?: string;
4
+ width: number;
5
+ height: number;
6
+ className?: string;
7
+ fill?: string;
8
+ fontSize?: number;
9
+ fontWeight?: string;
10
+ hittable?: boolean;
11
+ }
12
+ /**
13
+ * 创建自适应文本(支持动态字号、换行、省略号)
14
+ */
15
+ export declare function createText(options: CreateTextOptions): Text<{
16
+ text: string;
17
+ width: number;
18
+ height: number;
19
+ visible: number;
20
+ }>;
@@ -1,12 +1,17 @@
1
- import { IMachineTool } from '../../types/model';
1
+ import { IMachineToolConfig, IMachineToolOperating } from '../../types';
2
2
  import { Box } from 'leafer';
3
- import { BaseModel } from './BaseModel';
4
- export declare class MachineTool extends BaseModel<IMachineTool> {
5
- private get width();
6
- private get height();
7
- private get siteCount();
8
- private get LightSize();
3
+ import { ModelAbs } from '../abstract/ModelAbs';
4
+ /**
5
+ * 机床
6
+ */
7
+ export declare class MachineTool extends ModelAbs<IMachineToolConfig> {
8
+ private light;
9
+ private progress;
10
+ private entrance;
11
+ private stationSlotGroup;
12
+ constructor(options: IMachineToolConfig);
13
+ private get width_02();
9
14
  private get width_08();
10
- private get autoFixRotation();
11
15
  protected createUi(): Box;
16
+ protected operating(data: IMachineToolOperating): void;
12
17
  }
@@ -0,0 +1,9 @@
1
+ import { UI } from 'leafer';
2
+ import { IInteractiveState, IEventState } from '../../types';
3
+ /**
4
+ * 根据交互属性设置鼠标样式和 hover 效果
5
+ * @param target UI 目标对象
6
+ * @param data 交互属性数据
7
+ * @param type 效果类型,默认为 'shadow',可选 'border'
8
+ */
9
+ export declare function setCursor(target: UI, data: IInteractiveState & IEventState, type?: 'shadow' | 'border'): void;
@@ -1,4 +1,10 @@
1
- import { ILayer } from '../types';
1
+ /**
2
+ * @Author : TanRui
3
+ * @WeChat : Tan578853789
4
+ * @File : index.ts
5
+ * @Date : 2025/04/29
6
+ * @Desc. : 工具类
7
+ */
2
8
  /**
3
9
  * 数字生成器
4
10
  * @param {*} start 起始值
@@ -18,22 +24,12 @@ export declare function numberLoopGenerator(start: number, end: number, shouldLo
18
24
  */
19
25
  export declare const linearIncrease: (x: number | undefined, y: number | undefined, n: number | undefined, rate: number | undefined, callback: (val: number | string) => void) => false | Promise<unknown>;
20
26
  /**
21
- * 将单个图层对象的指定字段从百分比转换为像素
22
- * @param data 图层对象 (非数组)
23
- * @param cvsWidth 画布宽度
24
- * @param cvsHeight 画布高度
25
- * @param keys 需要转换的字段名列表,默认为 ['x', 'y']
26
- * @returns 转换后的新图层对象
27
- */
28
- export declare const usePercent2Px: (data: ILayer, cvsWidth?: number, cvsHeight?: number, keys?: string[]) => ILayer;
29
- export declare const transX: (percent?: number, w?: number) => number;
30
- export declare const transY: (percent?: number, h?: number) => number;
31
- /**
32
- * 百分比值 & px值相互转换
33
- * @param val 目标值
34
- * @param size 容器
35
- * @param getPercent 是否获取百分比
36
- * @returns
27
+ * 根据百分比数字转换为像素,或者根据像素转换为百分比
28
+ * @param {number} val - 百分比数字(范围 0 ~ 1),或者像素数字
29
+ * @param {number} size - 尺寸,用于计算百分比
30
+ * @param {number} [precision=3] - 保留的小数位数,默认为 3
31
+ * @param {boolean} [getPercent=false] - 是否返回百分比,默认为 false
32
+ * @returns {number} 转换后的像素值
37
33
  */
38
- export declare function trans(val?: number, size?: number, getPercent?: boolean): number;
34
+ export declare function transPercentAndPixel(val?: number, size?: number, precision?: number, getPercent?: boolean): number;
39
35
  export declare function transFraction(val?: number, size?: number): number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/lingshu-smart",
3
- "version": "2.2.4",
3
+ "version": "2.2.6",
4
4
  "description": "LingShu Smart 2D Digital Twin System.",
5
5
  "keywords": [
6
6
  "jnrs",
@@ -45,13 +45,13 @@
45
45
  "pinia-plugin-persistedstate": "^4.7.1",
46
46
  "vue": "^3.5.22",
47
47
  "vue-i18n": "^9.14.5",
48
- "@jnrs/shared": "1.1.13"
48
+ "@jnrs/shared": "1.1.18"
49
49
  },
50
50
  "devDependencies": {
51
51
  "@types/lodash-es": "^4.17.12",
52
52
  "@vitejs/plugin-vue": "^6.0.1",
53
53
  "rimraf": "^6.0.1",
54
- "typescript": "^5.9.3",
54
+ "typescript": "^6.0.2",
55
55
  "vite": "^7.1.7",
56
56
  "vite-plugin-css-injected-by-js": "^3.5.2",
57
57
  "vite-plugin-dts": "^4.5.4",
@@ -1,187 +0,0 @@
1
- declare const _default: [
2
- {
3
- "title": "搬运设备",
4
- "tag": "Mobile",
5
- "children": [
6
- {
7
- "className": "SingleBot",
8
- "equipmentName": "单爪机器人",
9
- "nameplate": "单爪机器人",
10
- "tags": ["Mobile", "Bot"],
11
- "currentFixture": "pallet",
12
- "linkRailId": "",
13
- "linkTrailerId": ""
14
- },
15
- {
16
- "id": 96228,
17
- "equipmentName": "双爪机器人",
18
- "nameplate": "双爪机器人",
19
- "type": ""
20
- },
21
- {
22
- "id": 96229,
23
- "equipmentName": "RGV",
24
- "nameplate": "RGV",
25
- "type": ""
26
- }
27
- ]
28
- },
29
- {
30
- "title": "机床",
31
- "tag": "MachineTool",
32
- "children": [
33
- {
34
- "className": "MachineTool",
35
- "equipmentName": "机床",
36
- "nameplate": "机床",
37
- "tags": ["MachineTool"],
38
- "width": 220,
39
- "height": 240,
40
- "siteCount": 2
41
- }
42
- ]
43
- },
44
- {
45
- "title": "清洗机",
46
- "tag": "CleaningMachine",
47
- "children": [
48
- {
49
- "id": 96231,
50
- "equipmentName": "清洗机",
51
- "nameplate": "清洗机",
52
- "type": "CleaningMachine",
53
- "palletSiteCount": 2,
54
- "x": 0.8,
55
- "y": 0.8
56
- }
57
- ]
58
- },
59
- {
60
- "title": "装载站",
61
- "tag": "LoadingStation",
62
- "children": [
63
- {
64
- "id": 96232,
65
- "equipmentName": "装载站",
66
- "nameplate": "装载站",
67
- "type": "LoadingStation",
68
- "x": 0.6,
69
- "y": 0.8
70
- }
71
- ]
72
- },
73
- {
74
- "title": "库",
75
- "tag": "Store",
76
- "children": [
77
- {
78
- "id": 96233,
79
- "equipmentName": "托盘库",
80
- "nameplate": "托盘",
81
- "tags": ["Store"],
82
- "type": "PalletStore",
83
- "x": 0.5,
84
- "y": 0.2,
85
- "count": 6,
86
- "oneDirectionMaxNumber": 3,
87
- "siteFlowType": "x",
88
- "size": 50,
89
- "zIndex": 1,
90
- "siteTextMap": ""
91
- },
92
- {
93
- "id": 962331,
94
- "equipmentName": "刀具库",
95
- "nameplate": "刀位",
96
- "tags": ["Store"],
97
- "type": "CutterStore",
98
- "x": 0.5,
99
- "y": 0.2,
100
- "count": 6,
101
- "oneDirectionMaxNumber": 3,
102
- "siteFlowType": "x",
103
- "size": 50,
104
- "zIndex": 1,
105
- "siteTextMap": ""
106
- },
107
- {
108
- "id": 96233110,
109
- "equipmentName": "缓存码头",
110
- "nameplate": "",
111
- "type": "DockStore",
112
- "x": 0.5,
113
- "y": 0.2,
114
- "activeStore": "PalletStore",
115
- "palletStoreData": {
116
- "equipmentName": "托盘库",
117
- "nameplate": "托盘",
118
- "tags": ["Store"],
119
- "type": "PalletStore",
120
- "count": 6,
121
- "oneDirectionMaxNumber": 3,
122
- "siteFlowType": "x",
123
- "size": 50
124
- },
125
- "cutterStoreData": {
126
- "equipmentName": "刀具库",
127
- "nameplate": "刀位",
128
- "tags": ["Store"],
129
- "type": "CutterStore",
130
- "count": 6,
131
- "oneDirectionMaxNumber": 3,
132
- "siteFlowType": "x",
133
- "size": 50
134
- },
135
- "zIndex": 1
136
- }
137
- ]
138
- },
139
- {
140
- "title": "其他",
141
- "tag": "Other",
142
- "children": [
143
- {
144
- "id": 96234,
145
- "equipmentName": "地轨",
146
- "nameplate": "地轨",
147
- "type": "Rail",
148
- "linkEquipIdArray": [],
149
- "x": 0.5,
150
- "y": 0.5,
151
- "width": 0.95,
152
- "chainDirection": "left"
153
- },
154
- {
155
- "id": 96226001,
156
- "equipmentName": "随行拖",
157
- "nameplate": "随行拖",
158
- "type": "Trailer",
159
- "x": 0.5,
160
- "y": 0.5,
161
- "offset": 55,
162
- "zIndex": 1,
163
- "linkEquipId": "",
164
- "siteFlowType": "x",
165
- "direction": "right",
166
- "palletSite": {
167
- "count": 2,
168
- "oneDirectionMaxNumber": 4,
169
- "siteFlowType": "x",
170
- "siteFlowWrap": true,
171
- "size": 30,
172
- "siteTextMap": ""
173
- },
174
- "cutterSite": {
175
- "count": 2,
176
- "oneDirectionMaxNumber": 4,
177
- "siteFlowType": "x",
178
- "siteFlowWrap": true,
179
- "size": 20
180
- }
181
- }
182
- ]
183
- }
184
- ]
185
- ;
186
-
187
- export default _default;
@@ -1,70 +0,0 @@
1
- {
2
- "code": 0,
3
- "msg": "操作成功",
4
- "data": [
5
- {
6
- "id": "c6ec0fcb-4863-4c1a-a6ab-04eb26a909b2",
7
- "isActive": true,
8
- "title": "测试方案20260202",
9
- "layers": [
10
- {
11
- "selected": false,
12
- "visible": true,
13
- "editable": true,
14
- "clickable": true,
15
- "draggable": true,
16
- "zIndex": 1,
17
- "rotation": 0,
18
- "scale": 2,
19
- "className": "MachineTool",
20
- "equipmentName": "机床",
21
- "nameplate": "机床1",
22
- "tags": ["MachineTool"],
23
- "width": 220,
24
- "height": 240,
25
- "siteCount": 2,
26
- "id": "ff67fd1e-0f4f-4cd2-8c00-5feb901b9fdd",
27
- "x": 0.5,
28
- "y": 0.5
29
- },
30
- {
31
- "selected": false,
32
- "visible": true,
33
- "editable": true,
34
- "clickable": true,
35
- "draggable": true,
36
- "zIndex": 2,
37
- "rotation": 0,
38
- "scale": 1,
39
- "className": "MachineTool",
40
- "equipmentName": "机床",
41
- "nameplate": "机床2",
42
- "tags": ["MachineTool"],
43
- "width": 220,
44
- "height": 240,
45
- "siteCount": 2,
46
- "id": "76754134-af16-468e-90bc-12ebe0169d45",
47
- "x": 1,
48
- "y": 1
49
- }
50
- ],
51
- "scene": {
52
- "width": 1920,
53
- "height": 1080,
54
- "zoomType": "fit",
55
- "fill": {
56
- "type": "radial",
57
- "color": "#000",
58
- "opacity": 1,
59
- "stops": [
60
- { "offset": 0, "color": "rgb(131, 186, 205)" },
61
- { "offset": 1, "color": "rgb(0, 152, 102)" }
62
- ],
63
- "from": "center",
64
- "to": "right"
65
- },
66
- "texture": ""
67
- }
68
- }
69
- ]
70
- }
@@ -1,8 +0,0 @@
1
- /**
2
- * 工位和资源的类型
3
- */
4
- export type StationResourceType = 'pallet' | 'tool';
5
- /**
6
- * 步骤操作类型
7
- */
8
- export type StepType = 'UNDO' | 'REDO';
@@ -1,9 +0,0 @@
1
- import { IBaseModel } from './index';
2
- export interface IMachineTool extends IBaseModel {
3
- siteCount?: number;
4
- }
5
- export interface IfaceBot extends IBaseModel {
6
- currentFixture: 'pallet' | 'cutter';
7
- linkRailId?: string;
8
- linkTrailerId?: string;
9
- }
@@ -1,32 +0,0 @@
1
- import { IBaseModel } from '../../types';
2
- import { UI, PointerEvent } from 'leafer';
3
- export interface IEventHandler {
4
- /**
5
- * 快速点击事件(左键单击)
6
- */
7
- onTap?: (config: IBaseModel, e: PointerEvent) => void;
8
- /**
9
- * 右键 tap 事件(右键单击)
10
- */
11
- onMenuTap?: (config: IBaseModel, e: PointerEvent) => void;
12
- /**
13
- * 拖动事件
14
- */
15
- onDragEnd?: (config: IBaseModel, e: PointerEvent) => void;
16
- }
17
- export declare abstract class BaseModel<T extends IBaseModel = IBaseModel> {
18
- private _config;
19
- ui: UI;
20
- private eventHandler;
21
- constructor(config: T);
22
- get config(): T;
23
- get isClickable(): boolean;
24
- get isDraggable(): boolean;
25
- get width_05(): number;
26
- protected abstract createUi(): UI;
27
- destroyUI(): void;
28
- setEventHandler(handler: IEventHandler): void;
29
- private tapCallback;
30
- private menuTapCallback;
31
- private dragCallback;
32
- }
@@ -1,5 +0,0 @@
1
- import { IBaseModel } from '../../types';
2
- import { BaseModel } from './BaseModel';
3
- export declare class ModelsFactory {
4
- static create(config: IBaseModel): BaseModel;
5
- }
@@ -1,12 +0,0 @@
1
- import { Box } from 'leafer';
2
- interface IGlassConfig {
3
- width?: number;
4
- height?: number;
5
- cornerRadius?: number;
6
- }
7
- export declare class Glass {
8
- readonly ui: Box;
9
- config: Required<IGlassConfig>;
10
- constructor(options?: IGlassConfig);
11
- }
12
- export {};