@jnrs/lingshu-smart 2.2.35 → 2.2.36

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 (30) hide show
  1. package/AGENTS.md +33 -12
  2. package/README.md +8 -8
  3. package/dist/components/debug/DebugPanel.vue.d.ts +1 -60
  4. package/dist/components/debug/WsProxy/ConnPanel.vue.d.ts +13 -4
  5. package/dist/components/debug/WsProxy/index.vue.d.ts +3 -6
  6. package/dist/components/debug/WsProxy/proxy.d.ts +16 -4
  7. package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +87 -87
  8. package/dist/components/editor/OptionCard/Equipment/models/Pallet.vue.d.ts +2 -0
  9. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts +4 -0
  10. package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupLayers.vue.d.ts +2 -0
  11. package/dist/components/index.d.ts +1 -2
  12. package/dist/components/index.js +13337 -13018
  13. package/dist/components/preview/index.vue.d.ts +296 -0
  14. package/dist/index.js +94 -86
  15. package/dist/lingshu-smart/wsProxyConfig.json +30 -0
  16. package/dist/locales/index.js +2 -2
  17. package/dist/playground/ViewPageDemo.vue.d.ts +596 -8
  18. package/dist/stores/useAppStore.d.ts +888 -0
  19. package/dist/stores/useDataStore.d.ts +888 -0
  20. package/dist/stores/useDebugStore.d.ts +30 -12
  21. package/dist/types/components/config.types.d.ts +5 -0
  22. package/dist/types/enums.d.ts +2 -1
  23. package/dist/types/guards.d.ts +7 -1
  24. package/dist/types/models/config.types.d.ts +25 -1
  25. package/dist/types/models/operating.types.d.ts +14 -1
  26. package/dist/ui/models/Pallet.d.ts +16 -0
  27. package/dist/ui/models/ShuttleStation.d.ts +17 -4
  28. package/package.json +1 -1
  29. package/dist/components/debug/WsProxy/WsProxyPage.vue.d.ts +0 -14
  30. package/dist/components/debug/WsProxy/broadcast.d.ts +0 -31
@@ -45,7 +45,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
45
45
  wsProxyConfig: import('vue').Ref<{
46
46
  name: string;
47
47
  version: number;
48
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
48
49
  wsUrl?: string | undefined;
50
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
51
+ autoConnect?: boolean | undefined;
49
52
  payloadKey?: string | undefined;
50
53
  sourceTypeField?: string | undefined;
51
54
  heartbeatInterval?: number | undefined;
@@ -60,9 +63,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
60
63
  source?: string | undefined;
61
64
  constant?: boolean | number | string | undefined;
62
65
  valueMap?: Record<string, boolean | number | string> | undefined;
63
- defaultValue?: boolean | number | string | undefined;
66
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
64
67
  enabled?: boolean | undefined;
65
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
68
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
66
69
  transformType?: "width" | "height" | undefined;
67
70
  transformPrecision?: number | undefined;
68
71
  dictName?: string | undefined;
@@ -99,7 +102,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
99
102
  }, WsProxyConfig | {
100
103
  name: string;
101
104
  version: number;
105
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
102
106
  wsUrl?: string | undefined;
107
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
108
+ autoConnect?: boolean | undefined;
103
109
  payloadKey?: string | undefined;
104
110
  sourceTypeField?: string | undefined;
105
111
  heartbeatInterval?: number | undefined;
@@ -114,9 +120,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
114
120
  source?: string | undefined;
115
121
  constant?: boolean | number | string | undefined;
116
122
  valueMap?: Record<string, boolean | number | string> | undefined;
117
- defaultValue?: boolean | number | string | undefined;
123
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
118
124
  enabled?: boolean | undefined;
119
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
125
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
120
126
  transformType?: "width" | "height" | undefined;
121
127
  transformPrecision?: number | undefined;
122
128
  dictName?: string | undefined;
@@ -204,7 +210,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
204
210
  wsProxyConfig: import('vue').Ref<{
205
211
  name: string;
206
212
  version: number;
213
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
207
214
  wsUrl?: string | undefined;
215
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
216
+ autoConnect?: boolean | undefined;
208
217
  payloadKey?: string | undefined;
209
218
  sourceTypeField?: string | undefined;
210
219
  heartbeatInterval?: number | undefined;
@@ -219,9 +228,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
219
228
  source?: string | undefined;
220
229
  constant?: boolean | number | string | undefined;
221
230
  valueMap?: Record<string, boolean | number | string> | undefined;
222
- defaultValue?: boolean | number | string | undefined;
231
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
223
232
  enabled?: boolean | undefined;
224
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
233
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
225
234
  transformType?: "width" | "height" | undefined;
226
235
  transformPrecision?: number | undefined;
227
236
  dictName?: string | undefined;
@@ -258,7 +267,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
258
267
  }, WsProxyConfig | {
259
268
  name: string;
260
269
  version: number;
270
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
261
271
  wsUrl?: string | undefined;
272
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
273
+ autoConnect?: boolean | undefined;
262
274
  payloadKey?: string | undefined;
263
275
  sourceTypeField?: string | undefined;
264
276
  heartbeatInterval?: number | undefined;
@@ -273,9 +285,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
273
285
  source?: string | undefined;
274
286
  constant?: boolean | number | string | undefined;
275
287
  valueMap?: Record<string, boolean | number | string> | undefined;
276
- defaultValue?: boolean | number | string | undefined;
288
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
277
289
  enabled?: boolean | undefined;
278
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
290
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
279
291
  transformType?: "width" | "height" | undefined;
280
292
  transformPrecision?: number | undefined;
281
293
  dictName?: string | undefined;
@@ -363,7 +375,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
363
375
  wsProxyConfig: import('vue').Ref<{
364
376
  name: string;
365
377
  version: number;
378
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
366
379
  wsUrl?: string | undefined;
380
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
381
+ autoConnect?: boolean | undefined;
367
382
  payloadKey?: string | undefined;
368
383
  sourceTypeField?: string | undefined;
369
384
  heartbeatInterval?: number | undefined;
@@ -378,9 +393,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
378
393
  source?: string | undefined;
379
394
  constant?: boolean | number | string | undefined;
380
395
  valueMap?: Record<string, boolean | number | string> | undefined;
381
- defaultValue?: boolean | number | string | undefined;
396
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
382
397
  enabled?: boolean | undefined;
383
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
398
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
384
399
  transformType?: "width" | "height" | undefined;
385
400
  transformPrecision?: number | undefined;
386
401
  dictName?: string | undefined;
@@ -417,7 +432,10 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
417
432
  }, WsProxyConfig | {
418
433
  name: string;
419
434
  version: number;
435
+ dataSource?: import('../components/debug/WsProxy/proxy').WsProxyDataSource | undefined;
420
436
  wsUrl?: string | undefined;
437
+ requestMode?: import('../components/debug/WsProxy/proxy').WsProxyRequestMode | undefined;
438
+ autoConnect?: boolean | undefined;
421
439
  payloadKey?: string | undefined;
422
440
  sourceTypeField?: string | undefined;
423
441
  heartbeatInterval?: number | undefined;
@@ -432,9 +450,9 @@ export declare const useDebugStore: import('pinia').StoreDefinition<"@jnrs/lings
432
450
  source?: string | undefined;
433
451
  constant?: boolean | number | string | undefined;
434
452
  valueMap?: Record<string, boolean | number | string> | undefined;
435
- defaultValue?: boolean | number | string | undefined;
453
+ defaultValue?: (boolean | number | string | Record<string, unknown>) | undefined;
436
454
  enabled?: boolean | undefined;
437
- transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "condition" | undefined;
455
+ transform?: "percentToPixel" | "runtimeToPixel" | "dictLabel" | "dictColor" | "dictColorMap" | "condition" | undefined;
438
456
  transformType?: "width" | "height" | undefined;
439
457
  transformPrecision?: number | undefined;
440
458
  dictName?: string | undefined;
@@ -15,6 +15,10 @@ export interface IStationSlotConfig extends IBaseConfig, IInteractiveState {
15
15
  origin?: IOriginAround;
16
16
  around?: IOriginAround;
17
17
  hideBounds?: boolean;
18
+ background?: string;
19
+ stroke?: string;
20
+ strokeWidth?: number;
21
+ textColor?: string;
18
22
  }
19
23
  /**
20
24
  * 布局选项
@@ -38,6 +42,7 @@ export interface IStationSlotGroupConfig extends Omit<IBaseConfig, 'width' | 'he
38
42
  around?: IOriginAround;
39
43
  stationSlots: IStationSlotConfig[];
40
44
  flowOptions: IFlowConfig;
45
+ hideBounds?: boolean;
41
46
  }
42
47
  /**
43
48
  * 资源
@@ -20,7 +20,8 @@ export declare enum EnumModel {
20
20
  LOADING_STATION = "LoadingStation",
21
21
  SHUTTLE_STATION = "ShuttleStation",
22
22
  RAIL = "Rail",
23
- RESOURCE_STORE = "ResourceStore"
23
+ RESOURCE_STORE = "ResourceStore",
24
+ PALLET = "Pallet"
24
25
  }
25
26
  export declare enum EnumComponent {
26
27
  STATION_SLOT = "StationSlot",
@@ -1,4 +1,4 @@
1
- import { ILayer } from './index';
1
+ import { ILayer, EnumModel } from './index';
2
2
  export declare function isMachineTool(layer: ILayer | null): layer is import('./index').IMachineToolConfig;
3
3
  export declare function hasStationSlotGroup(layer: ILayer | null): layer is Extract<ILayer, {
4
4
  stationSlotGroup?: any;
@@ -7,6 +7,12 @@ export declare function isStationSlotGroupBoth(layer: ILayer | null): layer is E
7
7
  stationSlotGroupPallet?: any;
8
8
  stationSlotGroupTool?: any;
9
9
  }>;
10
+ export declare function hasStationSlotLayers(layer: ILayer | null): layer is Extract<ILayer, {
11
+ stationSlotGroups?: any[];
12
+ }>;
10
13
  export declare function hasFixtureChange(layer: ILayer | null): layer is import('./index').ISingleJointRobotConfig | import('./index').IDoubleJointRobotConfig;
11
14
  export declare function isRail(layer: ILayer | null): layer is import('./index').IRailConfig;
12
15
  export declare function isShuttleStation(layer: ILayer | null): layer is import('./index').IShuttleStationConfig;
16
+ export declare function isPallet(layer: ILayer | null): layer is Extract<ILayer, {
17
+ className: EnumModel.PALLET;
18
+ }>;
@@ -43,11 +43,26 @@ export interface ILoadingStationConfig extends IModel {
43
43
  stationContainerDirection?: 'horizontal' | 'vertical';
44
44
  stationSlotGroup?: IStationSlotGroupConfig;
45
45
  }
46
+ /**
47
+ * 接驳站工位层配置
48
+ */
49
+ export interface IShuttleStationLayerConfig {
50
+ /** 层索引(从 1 开始) */
51
+ index: number;
52
+ /** 工位组配置(托盘或刀具) */
53
+ stationSlotGroup: IStationSlotGroupConfig;
54
+ /** 层状态灯颜色(默认 '#666' 灰色,运行时由 layerStatus 驱动) */
55
+ lightColor?: string;
56
+ /** 是否显示层状态灯(默认 true) */
57
+ lightEnabled?: boolean;
58
+ }
46
59
  /**
47
60
  * 接驳站
48
61
  */
49
62
  export interface IShuttleStationConfig extends IModel {
50
63
  className: EnumModel.SHUTTLE_STATION;
64
+ /** 多工位层配置数组(一层=一个工位组,可托盘或刀具) */
65
+ stationSlotGroups?: IShuttleStationLayerConfig[];
51
66
  }
52
67
  /**
53
68
  * 打标机
@@ -114,7 +129,16 @@ export interface IResourceStoreConfig extends IModel {
114
129
  stationSlotGroupPallet?: IStationSlotGroupConfig;
115
130
  stationSlotGroupTool?: IStationSlotGroupConfig;
116
131
  }
132
+ /**
133
+ * 托盘(独立设备)
134
+ * 参考 ResourceStore:带铭牌、状态灯;主体背景色可配置(默认 #3C3C3C)
135
+ */
136
+ export interface IPalletConfig extends IModel {
137
+ className: EnumModel.PALLET;
138
+ /** 主体背景色(默认 '#3C3C3C') */
139
+ backgroundColor?: string;
140
+ }
117
141
  /**
118
142
  * 设备层联合类型
119
143
  */
120
- export type ILayer = IMachineToolConfig | ILoadingStationConfig | IShuttleStationConfig | IMarkingMachineConfig | ICleaningMachineConfig | ISingleJointRobotConfig | IDoubleJointRobotConfig | IRGVConfig | IRailConfig | IResourceStoreConfig;
144
+ export type ILayer = IMachineToolConfig | ILoadingStationConfig | IShuttleStationConfig | IMarkingMachineConfig | ICleaningMachineConfig | ISingleJointRobotConfig | IDoubleJointRobotConfig | IRGVConfig | IRailConfig | IResourceStoreConfig | IPalletConfig;
@@ -49,6 +49,10 @@ export interface ILoadingStationOperating extends IModelOperating {
49
49
  export interface IShuttleStationOperating extends IModelOperating {
50
50
  className: EnumModel.SHUTTLE_STATION;
51
51
  light?: Omit<ILightOperating, 'rotating'>;
52
+ /** 各层工位组运行状态,键为层索引(1-based),值为状态码或颜色字符串
53
+ * 代理器 dictColorMap 转换后值为颜色字符串;未转换时值为状态数字码
54
+ */
55
+ layerStatus?: Record<number, number | string>;
52
56
  }
53
57
  /**
54
58
  * 打标机站点状态
@@ -127,7 +131,16 @@ export interface IResourceStoreOperating extends IModelOperating {
127
131
  x?: number;
128
132
  resource?: IResourceOperating;
129
133
  }
134
+ /**
135
+ * 托盘运转状态
136
+ */
137
+ export interface IPalletOperating extends IModelOperating {
138
+ className: EnumModel.PALLET;
139
+ light?: ILightOperating;
140
+ x?: number;
141
+ y?: number;
142
+ }
130
143
  /**
131
144
  * 设备层运转状态的联合类型
132
145
  */
133
- export type ILayerOperating = IMachineToolOperating | ILoadingStationOperating | IShuttleStationOperating | IMarkingMachineOperating | ICleaningMachineOperating | ISingleJointRobotOperating | IDoubleJointRobotOperating | IRGVOperating | IRailOperating | IResourceStoreOperating | IGlobalResourceOperating;
146
+ export type ILayerOperating = IMachineToolOperating | ILoadingStationOperating | IShuttleStationOperating | IMarkingMachineOperating | ICleaningMachineOperating | ISingleJointRobotOperating | IDoubleJointRobotOperating | IRGVOperating | IRailOperating | IResourceStoreOperating | IPalletOperating | IGlobalResourceOperating;
@@ -0,0 +1,16 @@
1
+ import { IPalletConfig, IPalletOperating } from '../../types';
2
+ import { Box } from 'leafer';
3
+ import { ModelAbs } from '../abstract/ModelAbs';
4
+ /**
5
+ * 托盘(独立设备)
6
+ * 参考 ResourceStore:带铭牌、状态灯;
7
+ * 主体样式参考 ShuttleStation 的 layerContainer(内嵌纹理、溢出隐藏),支持修改背景色。
8
+ */
9
+ export declare class Pallet extends ModelAbs<IPalletConfig> {
10
+ private static readonly CORNER_RADIUS;
11
+ private light;
12
+ protected createUi(): Box;
13
+ private moveX;
14
+ private moveY;
15
+ protected operating(data: IPalletOperating): void;
16
+ }
@@ -3,19 +3,32 @@ import { Box } from 'leafer';
3
3
  import { ModelAbs } from '../abstract/ModelAbs';
4
4
  /**
5
5
  * 接驳站(ShuttleStation)
6
- * 整体为 U 型结构,通过单个 Path 元素一体化绘制,内部透明;
7
- * U 型下方底部区域较宽大,用于放置铭牌与长条状态灯;
8
- * 该模型仅支持 light 运转状态
6
+ * 整体为 U 型结构,支持多层工位组配置(每层 = 一个工位组容器);
7
+ * 每层独立拥有状态灯,通过 layerStatus 字典数据驱动颜色;
8
+ * 主体底部有 #EA9734 底座 + 两端半露轮子。
9
9
  */
10
10
  export declare class ShuttleStation extends ModelAbs<IShuttleStationConfig> {
11
11
  private static readonly WALL_THICKNESS;
12
12
  private static readonly BASE_HEIGHT;
13
- private static readonly BOTTOM_RADIUS;
14
13
  private static readonly LIGHT_Y_OFFSET;
15
14
  private static readonly NAME_PLATE_Y_OFFSET;
15
+ private static readonly LAYER_GAP;
16
+ private static readonly BASE_THICKNESS;
17
+ private static readonly BASE_EXTEND;
18
+ private static readonly WHEEL_SIZE;
19
+ private static readonly WHEEL_INSET;
20
+ private static readonly WHEEL_COVER_RATIO;
16
21
  private light;
22
+ private layerLights;
23
+ private layerGroups;
24
+ private lastLayerStatus;
17
25
  private buildUPath;
18
26
  private buildOutlinePath;
27
+ private buildLayers;
28
+ private buildBaseAndWheels;
19
29
  protected createUi(): Box;
20
30
  protected operating(data: IShuttleStationOperating): void;
31
+ private applyLayerStatus;
32
+ private resolveStatusColor;
33
+ private statusToColor;
21
34
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/lingshu-smart",
3
- "version": "2.2.35",
3
+ "version": "2.2.36",
4
4
  "description": "LingShu Smart 2D Digital Twin System.",
5
5
  "keywords": [
6
6
  "jnrs",
@@ -1,14 +0,0 @@
1
- import { IScene } from '../../../types';
2
- import { DictFn } from './proxy';
3
- type __VLS_Props = {
4
- /** 场景信息:用于字段映射中像素换算(如 currentCase.scene) */
5
- scene?: IScene | null;
6
- /** 字典转换函数:用于「字典 Label / 字典 Color」特殊处理
7
- * 入参 (name, value, type),返回 string 赋给画布字段 */
8
- dictFn?: DictFn;
9
- };
10
- declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
11
- scene: IScene | null;
12
- dictFn: DictFn;
13
- }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
14
- export default _default;
@@ -1,31 +0,0 @@
1
- /**
2
- * @File : broadcast.ts
3
- * @Desc. : WsProxy 跨标签页数据流转(BroadcastChannel)
4
- * 独立标签页运行代理器(standalone)时,将转换后的 operating / raw / 状态
5
- * 通过 BroadcastChannel 广播给同源的其他标签页(如数字孪生预览页),
6
- * 实现「独立 tab 配置代理 → 预览页驱动图形运转」的数据流转。
7
- */
8
- /** 广播频道名:同源多个标签页共享 */
9
- export declare const PROXY_CHANNEL = "jnrs-wsproxy-v1";
10
- /** 广播消息类型 */
11
- export type ProxyBroadcastMsg = {
12
- type: 'operating';
13
- data: unknown;
14
- } | {
15
- type: 'raw';
16
- data: unknown;
17
- } | {
18
- type: 'status';
19
- connected: boolean;
20
- };
21
- /**
22
- * 创建广播通道
23
- * @returns BroadcastChannel 实例(浏览器不支持时返回 null)
24
- */
25
- export declare function createProxyChannel(): BroadcastChannel | null;
26
- /** 向广播通道发送消息(standalone 代理器广播用) */
27
- export declare function broadcastProxy(channel: BroadcastChannel | null, msg: ProxyBroadcastMsg): void;
28
- /** 订阅广播通道消息(预览页接收用),返回取消订阅函数 */
29
- export declare function subscribeProxy(channel: BroadcastChannel | null, handler: (msg: ProxyBroadcastMsg) => void): () => void;
30
- /** 关闭广播通道 */
31
- export declare function closeProxyChannel(channel: BroadcastChannel | null): void;