@jnrs/lingshu-smart 2.2.36 → 2.2.38
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/AGENTS.md +8 -6
- package/README.md +2 -2
- package/dist/assets/data/editor_preset_menu.d.ts +8 -0
- package/dist/components/debug/WsProxy/MappingGrid.vue.d.ts +32 -0
- package/dist/components/debug/WsProxy/proxy.d.ts +16 -26
- package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts +4 -0
- package/dist/components/index.js +4377 -30278
- package/dist/components/preview/index.vue.d.ts +208 -0
- package/dist/composables/useCaseLoading.d.ts +10 -0
- package/dist/index-YxSpi9Af.js +131 -0
- package/dist/index.js +41 -153
- package/dist/lingshu-smart/wsProxyConfig.json +17 -17
- package/dist/playground/ViewPageDemo.vue.d.ts +416 -0
- package/dist/stores/index.js +7 -0
- package/dist/stores/useAppStore.d.ts +660 -36
- package/dist/stores/useDataStore.d.ts +660 -36
- package/dist/stores/useDebugStore.d.ts +198 -102
- package/dist/types/models/config.types.d.ts +4 -0
- package/dist/types/models/operating.types.d.ts +1 -0
- package/dist/ui/models/Pallet.d.ts +10 -1
- package/dist/useAppStore-CIFewItb.js +26105 -0
- package/package.json +6 -2
package/AGENTS.md
CHANGED
|
@@ -501,7 +501,7 @@ type ILayerOperating =
|
|
|
501
501
|
| `IRGVOperating` | `RGV` | `light?`, `x?`, `j1?`, `forkXY?`, `forkZ?`, `resource?` | 双状态灯、轨道位移、旋转、货叉 XY/Z、双工位槽 | `Rgv` |
|
|
502
502
|
| `IRailOperating` | `RAIL` | `x?`, `botId?` | 拖链动画(关联 botId 的设备移动时拖链跟随) | `Rail` |
|
|
503
503
|
| `IResourceStoreOperating` | `RESOURCE_STORE` | `light?`, `x?`, `resource?` | 状态灯、轨道位移、托盘/刀具工位槽 | `ResourceStore` |
|
|
504
|
-
| `IPalletOperating` | `PALLET` | `light?`, `x?`, `y?`
|
|
504
|
+
| `IPalletOperating` | `PALLET` | `light?`, `x?`, `y?`, `resource?` | 状态灯、X/Y 位移、托盘/刀具工位槽 | `Pallet` |
|
|
505
505
|
|
|
506
506
|
### 子类型字段详情
|
|
507
507
|
|
|
@@ -611,11 +611,12 @@ type ILayerOperating =
|
|
|
611
611
|
|
|
612
612
|
#### IPalletOperating
|
|
613
613
|
|
|
614
|
-
| 属性
|
|
615
|
-
|
|
|
616
|
-
| `light`
|
|
617
|
-
| `x`
|
|
618
|
-
| `y`
|
|
614
|
+
| 属性 | 类型 | 说明 |
|
|
615
|
+
| ---------- | -------------------- | ----------------------- |
|
|
616
|
+
| `light` | `ILightOperating` | 状态灯 |
|
|
617
|
+
| `x` | `number` | 沿 X 轴移动位置(像素) |
|
|
618
|
+
| `y` | `number` | 沿 Y 轴移动位置(像素) |
|
|
619
|
+
| `resource` | `IResourceOperating` | 托盘/刀具工位槽资源增删 |
|
|
619
620
|
|
|
620
621
|
### 子组件运转类型(IComponentOperating)
|
|
621
622
|
|
|
@@ -636,6 +637,7 @@ type ILayerOperating =
|
|
|
636
637
|
| -------------------------------- | ------------------------------ |
|
|
637
638
|
| `@jnrs/lingshu-smart` | 主模块,包含类型定义和工具函数 |
|
|
638
639
|
| `@jnrs/lingshu-smart/components` | Vue 组件库(编辑器、预览器) |
|
|
640
|
+
| `@jnrs/lingshu-smart/stores` | Pinia stores(data/editor/app/debug) |
|
|
639
641
|
| `@jnrs/lingshu-smart/locales` | 国际化配置 |
|
|
640
642
|
|
|
641
643
|
---
|
package/README.md
CHANGED
|
@@ -136,7 +136,7 @@ ws.onmessage = (event) => {
|
|
|
136
136
|
通过 `useDebugStore` 的 `setLocale` 方法切换语言,切换后库内所有组件文本实时更新:
|
|
137
137
|
|
|
138
138
|
```typescript
|
|
139
|
-
import { useDebugStore } from '@jnrs/lingshu-smart/stores
|
|
139
|
+
import { useDebugStore } from '@jnrs/lingshu-smart/stores'
|
|
140
140
|
|
|
141
141
|
const debugStore = useDebugStore()
|
|
142
142
|
|
|
@@ -180,7 +180,7 @@ i18n.global.mergeLocaleMessage('ja', {
|
|
|
180
180
|
```typescript
|
|
181
181
|
// 方案1:监听宿主语言变化,同步到库
|
|
182
182
|
import { watch } from 'vue'
|
|
183
|
-
import { useDebugStore } from '@jnrs/lingshu-smart/stores
|
|
183
|
+
import { useDebugStore } from '@jnrs/lingshu-smart/stores'
|
|
184
184
|
|
|
185
185
|
const debugStore = useDebugStore()
|
|
186
186
|
watch(
|
|
@@ -1,2 +1,10 @@
|
|
|
1
1
|
import { IEquipmentsMenu } from '../../types';
|
|
2
2
|
export declare const EQUIPMENTS_MENU: IEquipmentsMenu[];
|
|
3
|
+
/**
|
|
4
|
+
* 获取设备模型的默认宽高
|
|
5
|
+
* 用于布局面板的"重置"按钮,以及部件配置中"无部件时模型高度不低于默认值"的联动计算
|
|
6
|
+
*/
|
|
7
|
+
export declare function getModelDefaultSize(className?: string): {
|
|
8
|
+
width: number;
|
|
9
|
+
height: number;
|
|
10
|
+
} | undefined;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { FieldMapper } from './proxy';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 字段映射列表 */
|
|
4
|
+
mappers: FieldMapper[];
|
|
5
|
+
/** 画布字段是否可编辑(false=只读,true=可修改) */
|
|
6
|
+
targetFieldEditable?: boolean;
|
|
7
|
+
/** 是否已配置 dictFn(用于「字典 Label / 字典 Color」选项右侧 tag 显示) */
|
|
8
|
+
hasDictFn?: boolean;
|
|
9
|
+
/** 是否显示底部「画布字段修改 + 添加映射」栏(默认 true) */
|
|
10
|
+
showFooter?: boolean;
|
|
11
|
+
/** 底部栏是否包含「画布字段修改」开关(默认 true;Resource 区域在组外统一控制时传 false) */
|
|
12
|
+
showToggle?: boolean;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
add: () => any;
|
|
16
|
+
remove: (idx: number) => any;
|
|
17
|
+
update: () => any;
|
|
18
|
+
"update:targetFieldEditable": (value: boolean) => any;
|
|
19
|
+
"open-condition": (mapper: FieldMapper) => any;
|
|
20
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
21
|
+
onAdd?: (() => any) | undefined;
|
|
22
|
+
onRemove?: ((idx: number) => any) | undefined;
|
|
23
|
+
onUpdate?: (() => any) | undefined;
|
|
24
|
+
"onUpdate:targetFieldEditable"?: ((value: boolean) => any) | undefined;
|
|
25
|
+
"onOpen-condition"?: ((mapper: FieldMapper) => any) | undefined;
|
|
26
|
+
}>, {
|
|
27
|
+
targetFieldEditable: boolean;
|
|
28
|
+
hasDictFn: boolean;
|
|
29
|
+
showFooter: boolean;
|
|
30
|
+
showToggle: boolean;
|
|
31
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
32
|
+
export default _default;
|
|
@@ -39,29 +39,14 @@ export interface FieldMapper {
|
|
|
39
39
|
* @param type 'label' 字典Label / 'color' 字典Color
|
|
40
40
|
* @returns 转换后的字符串值,赋值给画布字段 */
|
|
41
41
|
export type DictFn = (name: string, value: string | number | undefined, type: 'label' | 'color') => string;
|
|
42
|
-
/**
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className: string;
|
|
46
|
-
/** 资源 ID 的源字段路径(如 addId / removeId) */
|
|
47
|
-
id: string;
|
|
48
|
-
/** 资源类型的源字段路径(如 resourceType) */
|
|
49
|
-
resourceType: string;
|
|
50
|
-
/** 资源 ID 的源字段路径(用于全局查找匹配,如 resourceId) */
|
|
51
|
-
resourceId?: string;
|
|
52
|
-
/** 工位索引的源字段路径(如 addSiteNumber / removeSiteNumber) */
|
|
53
|
-
index: string;
|
|
54
|
-
/** 资源名称的源字段路径(仅 add 需要,如 name) */
|
|
55
|
-
name?: string;
|
|
56
|
-
/** 资源颜色的源字段路径(仅 add 需要,如 displayColor) */
|
|
57
|
-
color?: string;
|
|
58
|
-
}
|
|
59
|
-
/** 资源增删字段映射:分别配置 add / remove 两组字段来源 */
|
|
42
|
+
/** 资源增删字段映射:分别配置 add / remove 两组动态字段映射
|
|
43
|
+
* 目标路径支持点号嵌套,className / id 为目标设备匹配字段,resource.* 为资源对象字段
|
|
44
|
+
* (如 resource.resourceType / resource.index),未配置时使用内置默认映射 */
|
|
60
45
|
export interface ResourceFieldMap {
|
|
61
|
-
/**
|
|
62
|
-
add?:
|
|
63
|
-
/**
|
|
64
|
-
remove?:
|
|
46
|
+
/** 新增资源字段映射列表(无需新增时可不配置或为空数组) */
|
|
47
|
+
add?: FieldMapper[];
|
|
48
|
+
/** 移除资源字段映射列表(无需移除时可不配置或为空数组) */
|
|
49
|
+
remove?: FieldMapper[];
|
|
65
50
|
}
|
|
66
51
|
/** 全局操作字段配置(operate: 'global' 时生效) */
|
|
67
52
|
export interface GlobalFieldConfig {
|
|
@@ -82,8 +67,8 @@ export interface ProxyRule {
|
|
|
82
67
|
operate: 'single' | 'resource' | 'global';
|
|
83
68
|
/** 字段映射列表(operate: 'single' 时生效) */
|
|
84
69
|
mappings: FieldMapper[];
|
|
85
|
-
/** 资源增删字段映射(operate: 'resource'
|
|
86
|
-
|
|
70
|
+
/** 资源增删字段映射(operate: 'resource' 时生效,未配置时使用内置默认字段映射) */
|
|
71
|
+
resourceMappings?: ResourceFieldMap;
|
|
87
72
|
/** 全局操作字段映射(operate: 'global' 时生效) */
|
|
88
73
|
globalFields?: GlobalFieldConfig;
|
|
89
74
|
}
|
|
@@ -126,8 +111,9 @@ export declare function resolveMapper(payload: Record<string, unknown>, mapper:
|
|
|
126
111
|
/** 根据单条规则构建 operating 对象(operate: 'single') */
|
|
127
112
|
export declare function buildOperating(payload: Record<string, unknown>, rule: ProxyRule, scene?: IScene | null, dictFn?: DictFn): ILayerOperating | null;
|
|
128
113
|
/** 根据 Resource 规则构建资源增删 operating 列表(operate: 'resource')
|
|
129
|
-
* 字段来源由 rule.
|
|
130
|
-
|
|
114
|
+
* 字段来源由 rule.resourceMappings.add / remove 动态映射配置,未配置时使用内置默认映射。
|
|
115
|
+
* target 支持点号嵌套:className / id 为目标设备匹配字段,resource.* 为资源对象字段。 */
|
|
116
|
+
export declare function buildResourceOperating(payload: Record<string, unknown>, rule: ProxyRule, scene?: IScene | null, dictFn?: DictFn): ILayerOperating[];
|
|
131
117
|
/** 根据全局操作规则构建 operating(operate: 'global')
|
|
132
118
|
* resourceIds 从源消息中按 globalFields.resourceIds 路径提取,为空时使用 payloadKey */
|
|
133
119
|
export declare function buildGlobalOperating(msg: Record<string, unknown>, rule: ProxyRule, payloadKey: string): ILayerOperating[];
|
|
@@ -143,6 +129,10 @@ export declare function buildGlobalOperating(msg: Record<string, unknown>, rule:
|
|
|
143
129
|
* @returns operating 列表(可能为空数组;非标准数组数据返回空数组由 @raw 处理)
|
|
144
130
|
*/
|
|
145
131
|
export declare function applyProxy(rawMessage: unknown, rules: ProxyRule[], scene?: IScene | null, payloadKey?: string, sourceTypeField?: string, dictFn?: DictFn): ILayerOperating[];
|
|
132
|
+
/** 资源新增字段默认映射(target 取自 IModelOperating + IResourceOperating,源字段名取自 ViewPageDemo.vue 中 Resource 操作的标准 payload 字段) */
|
|
133
|
+
export declare const DEFAULT_RESOURCE_ADD_MAPPERS: FieldMapper[];
|
|
134
|
+
/** 资源移除字段默认映射 */
|
|
135
|
+
export declare const DEFAULT_RESOURCE_REMOVE_MAPPERS: FieldMapper[];
|
|
146
136
|
/** 默认代理配置 */
|
|
147
137
|
export declare function createDefaultConfig(): WsProxyConfig;
|
|
148
138
|
/** 校验导入的配置结构是否合法 */
|
package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts
CHANGED
|
@@ -6,6 +6,7 @@ interface Props {
|
|
|
6
6
|
flowOptions?: IFlowConfig;
|
|
7
7
|
stationSlots?: IStationSlotConfig[];
|
|
8
8
|
hideBounds?: boolean;
|
|
9
|
+
visible?: boolean | 0;
|
|
9
10
|
containerWidth?: number;
|
|
10
11
|
containerHeight?: number;
|
|
11
12
|
}
|
|
@@ -15,6 +16,7 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
15
16
|
flowOptions: IFlowConfig;
|
|
16
17
|
stationSlots: IStationSlotConfig[];
|
|
17
18
|
hideBounds: boolean;
|
|
19
|
+
visible: boolean | 0;
|
|
18
20
|
}) => any;
|
|
19
21
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
20
22
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
@@ -22,11 +24,13 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
22
24
|
flowOptions: IFlowConfig;
|
|
23
25
|
stationSlots: IStationSlotConfig[];
|
|
24
26
|
hideBounds: boolean;
|
|
27
|
+
visible: boolean | 0;
|
|
25
28
|
}) => any) | undefined;
|
|
26
29
|
}>, {
|
|
27
30
|
hideBounds: boolean;
|
|
28
31
|
stationSlots: IStationSlotConfig[];
|
|
29
32
|
flowOptions: IFlowConfig;
|
|
33
|
+
visible: boolean | 0;
|
|
30
34
|
containerWidth: number;
|
|
31
35
|
containerHeight: number;
|
|
32
36
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|