@jnrs/lingshu-smart 2.2.34 → 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.
- package/AGENTS.md +34 -10
- package/README.md +8 -7
- package/dist/components/debug/DataLogPanel.vue.d.ts +44 -0
- package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +14 -11
- package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +8 -0
- package/dist/components/debug/ScriptRunner/script.d.ts +29 -1
- package/dist/components/debug/WsProxy/ConfigEditor.vue.d.ts +18 -0
- package/dist/components/debug/WsProxy/ConnPanel.vue.d.ts +33 -0
- package/dist/components/debug/WsProxy/index.vue.d.ts +36 -0
- package/dist/components/debug/WsProxy/proxy.d.ts +171 -0
- package/dist/components/editor/OptionCard/Equipment/models/Pallet.vue.d.ts +2 -0
- package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts +4 -0
- package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupLayers.vue.d.ts +2 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +14396 -11457
- package/dist/components/preview/index.vue.d.ts +296 -0
- package/dist/controller/AppController.d.ts +2 -0
- package/dist/index.js +94 -86
- package/dist/lingshu-smart/wsProxyConfig.json +525 -0
- package/dist/locales/index.js +2 -2
- package/dist/playground/ViewPageDemo.vue.d.ts +646 -0
- package/dist/stores/useAppStore.d.ts +888 -0
- package/dist/stores/useDataStore.d.ts +888 -0
- package/dist/stores/useDebugStore.d.ts +393 -2
- package/dist/types/components/config.types.d.ts +6 -0
- package/dist/types/components/operating.types.d.ts +1 -0
- package/dist/types/enums.d.ts +2 -1
- package/dist/types/guards.d.ts +7 -1
- package/dist/types/models/config.types.d.ts +25 -1
- package/dist/types/models/operating.types.d.ts +27 -1
- package/dist/ui/abstract/ModelAbs.d.ts +10 -0
- package/dist/ui/components/StationSlot.d.ts +5 -1
- package/dist/ui/components/StationSlotGroup.d.ts +5 -0
- package/dist/ui/models/CleaningMachine.d.ts +2 -0
- package/dist/ui/models/DoubleJointRobot.d.ts +2 -0
- package/dist/ui/models/LoadingStation.d.ts +2 -0
- package/dist/ui/models/MachineTool.d.ts +2 -0
- package/dist/ui/models/MarkingMachine.d.ts +2 -0
- package/dist/ui/models/Pallet.d.ts +16 -0
- package/dist/ui/models/ResourceStore.d.ts +2 -0
- package/dist/ui/models/Rgv.d.ts +2 -0
- package/dist/ui/models/ShuttleStation.d.ts +17 -4
- package/dist/ui/models/SingleJointRobot.d.ts +2 -0
- package/package.json +2 -2
- package/dist/components/debug/ScriptRunner/LogPanel.vue.d.ts +0 -19
- /package/dist/{json → lingshu-smart}/cases.json +0 -0
package/AGENTS.md
CHANGED
|
@@ -29,7 +29,7 @@ import type { ICase } from '@/types'
|
|
|
29
29
|
import LingshuSmartEditor from '@/components/editor/index.vue'
|
|
30
30
|
|
|
31
31
|
const loadCases = async (requestId?: string): Promise<ICase[]> => {
|
|
32
|
-
const res = await fetch(`/
|
|
32
|
+
const res = await fetch(`/lingshu-smart/cases.json?requestId=${requestId}`)
|
|
33
33
|
const data = await res.json()
|
|
34
34
|
return data.data
|
|
35
35
|
}
|
|
@@ -476,6 +476,7 @@ onMounted(() => {
|
|
|
476
476
|
type ILayerOperating =
|
|
477
477
|
| IMachineToolOperating
|
|
478
478
|
| ILoadingStationOperating
|
|
479
|
+
| IShuttleStationOperating
|
|
479
480
|
| IMarkingMachineOperating
|
|
480
481
|
| ICleaningMachineOperating
|
|
481
482
|
| ISingleJointRobotOperating
|
|
@@ -483,6 +484,7 @@ type ILayerOperating =
|
|
|
483
484
|
| IRGVOperating
|
|
484
485
|
| IRailOperating
|
|
485
486
|
| IResourceStoreOperating
|
|
487
|
+
| IPalletOperating
|
|
486
488
|
```
|
|
487
489
|
|
|
488
490
|
### 子类型一览
|
|
@@ -491,6 +493,7 @@ type ILayerOperating =
|
|
|
491
493
|
| ---------------------------- | -------------------- | ------------------------------------------------------------------ | -------------------------------------------------- | ------------------ |
|
|
492
494
|
| `IMachineToolOperating` | `MACHINE_TOOL` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(含旋转)、进度条、出入口、工位槽 | `MachineTool` |
|
|
493
495
|
| `ILoadingStationOperating` | `LOADING_STATION` | `light?`, `progress?`, `entrance?`, `stationRotatable?` | 状态灯(无旋转)、进度条、出入口、工位槽 | `LoadingStation` |
|
|
496
|
+
| `IShuttleStationOperating` | `SHUTTLE_STATION` | `light?`, `layerStatus?` | 状态灯、多工位层状态灯 | `ShuttleStation` |
|
|
494
497
|
| `IMarkingMachineOperating` | `MARKING_MACHINE` | `light?`, `progress?`, `entrance?`, `laserSiteNumberArray?` | 状态灯、进度条、出入口、工位槽、激光工位指示 | `MarkingMachine` |
|
|
495
498
|
| `ICleaningMachineOperating` | `CLEANING_MACHINE` | `light?`, `progress?`, `entrance?` | 状态灯、进度条、出入口、工位槽 | `CleaningMachine` |
|
|
496
499
|
| `ISingleJointRobotOperating` | `SINGLE_JOINT_ROBOT` | `light?`, `x?`, `y?`, `j1?`, `currentFixture?`, `resource?` | 双状态灯、轨道位移、关节旋转、夹具切换、双工位槽 | `SingleJointRobot` |
|
|
@@ -498,6 +501,7 @@ type ILayerOperating =
|
|
|
498
501
|
| `IRGVOperating` | `RGV` | `light?`, `x?`, `j1?`, `forkXY?`, `forkZ?`, `resource?` | 双状态灯、轨道位移、旋转、货叉 XY/Z、双工位槽 | `Rgv` |
|
|
499
502
|
| `IRailOperating` | `RAIL` | `x?`, `botId?` | 拖链动画(关联 botId 的设备移动时拖链跟随) | `Rail` |
|
|
500
503
|
| `IResourceStoreOperating` | `RESOURCE_STORE` | `light?`, `x?`, `resource?` | 状态灯、轨道位移、托盘/刀具工位槽 | `ResourceStore` |
|
|
504
|
+
| `IPalletOperating` | `PALLET` | `light?`, `x?`, `y?` | 状态灯、X/Y 位移 | `Pallet` |
|
|
501
505
|
|
|
502
506
|
### 子类型字段详情
|
|
503
507
|
|
|
@@ -521,6 +525,15 @@ type ILayerOperating =
|
|
|
521
525
|
| `stationRotatable` | `boolean` | 工位容器方向 |
|
|
522
526
|
| `resource` | `IResourceOperating` | 工位槽资源 |
|
|
523
527
|
|
|
528
|
+
#### IShuttleStationOperating
|
|
529
|
+
|
|
530
|
+
| 属性 | 类型 | 说明 |
|
|
531
|
+
| ------------- | ----------------------------------- | --------------------------------------------------------------- |
|
|
532
|
+
| `light` | `Omit<ILightOperating, 'rotating'>` | 状态灯(不支持旋转灯效) |
|
|
533
|
+
| `layerStatus` | `Record<number, number \| string>` | 各层工位组状态灯:键为层索引(1-based),值为状态码或颜色字符串 |
|
|
534
|
+
|
|
535
|
+
> `layerStatus` 在代理器中通过 `dictColorMap` 转换后值为颜色字符串;未转换时值为状态数字码。
|
|
536
|
+
|
|
524
537
|
#### IMarkingMachineOperating
|
|
525
538
|
|
|
526
539
|
| 属性 | 类型 | 说明 |
|
|
@@ -596,6 +609,14 @@ type ILayerOperating =
|
|
|
596
609
|
| `x` | `number` | 沿轨道位移(像素,随行托场景) |
|
|
597
610
|
| `resource` | `IResourceOperating` | 托盘/刀具工位槽增删 |
|
|
598
611
|
|
|
612
|
+
#### IPalletOperating
|
|
613
|
+
|
|
614
|
+
| 属性 | 类型 | 说明 |
|
|
615
|
+
| ------- | ----------------- | ----------------------- |
|
|
616
|
+
| `light` | `ILightOperating` | 状态灯 |
|
|
617
|
+
| `x` | `number` | 沿 X 轴移动位置(像素) |
|
|
618
|
+
| `y` | `number` | 沿 Y 轴移动位置(像素) |
|
|
619
|
+
|
|
599
620
|
### 子组件运转类型(IComponentOperating)
|
|
600
621
|
|
|
601
622
|
被 `ILayerOperating` 各字段引用的子组件操作类型,定义于 `src/types/components/operating.types.ts`:
|
|
@@ -699,15 +720,18 @@ type ILayerOperating =
|
|
|
699
720
|
|
|
700
721
|
### 架构
|
|
701
722
|
|
|
702
|
-
| 模块
|
|
703
|
-
|
|
|
704
|
-
| `utils/logger.ts`
|
|
705
|
-
| `utils/debug-flags.ts`
|
|
706
|
-
| `utils/performance-stats.ts`
|
|
707
|
-
| `stores/useDebugStore.ts`
|
|
708
|
-
| `composables/useDebugEasterEgg.ts`
|
|
709
|
-
| `components/debug/DebugPanel.vue`
|
|
710
|
-
| `
|
|
723
|
+
| 模块 | 职责 |
|
|
724
|
+
| ------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
725
|
+
| `utils/logger.ts` | 统一日志工具,支持 tag 着色、LogLevel 过滤、`operating` 追踪级别 |
|
|
726
|
+
| `utils/debug-flags.ts` | 模块级动画标志位,供 UI 组件直接导入控制循环动画 |
|
|
727
|
+
| `utils/performance-stats.ts` | 性能统计工具,记录运行时长和 WebSocket 数据接收量 |
|
|
728
|
+
| `stores/useDebugStore.ts` | 全局调试配置 Pinia store,localStorage 持久化 |
|
|
729
|
+
| `composables/useDebugEasterEgg.ts` | 调试触发检测:500ms 内 10 次点击打开面板 |
|
|
730
|
+
| `components/debug/DebugPanel.vue` | 调试配置对话框 UI |
|
|
731
|
+
| `components/debug/ScriptRunner/` | Socket 脚本模拟器:脚本步骤编排、断点调试、消息结构配置(code/msg、payload 字段名、type)、日志查看 |
|
|
732
|
+
| `components/debug/WsProxy/` | WebSocket 代理器:声明式字段映射将后端 socket 结构桥接为 operating,支持连接/断开/重连、日志、配置导出/导入、场景像素换算(percentToPixel 百分比/ runtimeToPixel 运行时坐标)、standalone 独立标签页模式 / remote 远程接收模式(BroadcastChannel 跨标签页流转数据) |
|
|
733
|
+
| `components/debug/WsProxy/WsProxyPage.vue` | `WsProxy` 独立路由页面组件:以独立 URL/标签页运行代理器配置,将 operating/raw/状态广播给预览页驱动图形运转 |
|
|
734
|
+
| `controller/AppController.ts` | 提供 `toggleShadows` / `toggleAnimations` / `setFps` 方法 |
|
|
711
735
|
|
|
712
736
|
### 日志系统
|
|
713
737
|
|
package/README.md
CHANGED
|
@@ -6,13 +6,14 @@
|
|
|
6
6
|
|
|
7
7
|
### 核心功能
|
|
8
8
|
|
|
9
|
-
| 功能
|
|
10
|
-
|
|
|
11
|
-
| 编辑器模式
|
|
12
|
-
| 运行看板
|
|
13
|
-
| 设备模型
|
|
14
|
-
| 设备运转
|
|
15
|
-
| 坐标转换
|
|
9
|
+
| 功能 | 说明 |
|
|
10
|
+
| ---------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
11
|
+
| 编辑器模式 | `LingshuSmartEditor` — 方案可视化编辑,支持拖拽布局、设备配置、图层管理、方案保存/预览 |
|
|
12
|
+
| 运行看板 | `LingshuSmartPreview` — 方案运行看板,支持 WebSocket 实时驱动设备动画、交互事件(点击/拖拽/右键菜单) |
|
|
13
|
+
| 设备模型 | 机床、机器人(单关节/双关节)、RGV、装载站、打标机、清洗机、轨道拖链、资源库、托盘等 |
|
|
14
|
+
| 设备运转 | 灯光、进度条、入口动画、工位槽资源增删、坐标/角度/货叉控制 |
|
|
15
|
+
| 坐标转换 | `transRuntimeToPixel` / `transPercentToPixel` — 物理坐标与像素坐标互转 |
|
|
16
|
+
| WebSocket 代理器 | `WsProxy` — 声明式字段映射将后端 socket 数据桥接为 operating 驱动设备动画;支持内置请求器/外接注入两种数据源、direct/proxy 请求模式、自动连接开关、按 type 分类代理配置及配置导出/导入 |
|
|
16
17
|
|
|
17
18
|
## 💻 技术栈
|
|
18
19
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ILayerOperating } from '../../types';
|
|
2
|
+
export interface LogEntry {
|
|
3
|
+
datetime: string;
|
|
4
|
+
type: string;
|
|
5
|
+
traceId: string;
|
|
6
|
+
payload: any;
|
|
7
|
+
}
|
|
8
|
+
export type LogDirection = 'send' | 'receive';
|
|
9
|
+
export interface WsProxyLogEntry {
|
|
10
|
+
datetime: string;
|
|
11
|
+
direction: LogDirection;
|
|
12
|
+
data: any;
|
|
13
|
+
}
|
|
14
|
+
export type RunLogEntry = ILayerOperating;
|
|
15
|
+
type __VLS_Props = {
|
|
16
|
+
logs: any[];
|
|
17
|
+
maxLogCount: number;
|
|
18
|
+
snapshot: boolean;
|
|
19
|
+
/** 边框左上角区域名称(如 模拟消息日志 / 消息日志 / 运行日志) */
|
|
20
|
+
title?: string;
|
|
21
|
+
/** 数据列表头名称 */
|
|
22
|
+
dataLabel?: string;
|
|
23
|
+
/** 数据单元格渲染函数 */
|
|
24
|
+
textFn?: (row: any) => string;
|
|
25
|
+
/** 是否展示方向/类型列(WsProxy 消息日志专用) */
|
|
26
|
+
showDirectionType?: boolean;
|
|
27
|
+
};
|
|
28
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
29
|
+
copy: () => any;
|
|
30
|
+
clear: () => any;
|
|
31
|
+
"update:maxLogCount": (value: number) => any;
|
|
32
|
+
"toggle-snapshot": () => any;
|
|
33
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
34
|
+
onCopy?: (() => any) | undefined;
|
|
35
|
+
onClear?: (() => any) | undefined;
|
|
36
|
+
"onUpdate:maxLogCount"?: ((value: number) => any) | undefined;
|
|
37
|
+
"onToggle-snapshot"?: (() => any) | undefined;
|
|
38
|
+
}>, {
|
|
39
|
+
title: string;
|
|
40
|
+
dataLabel: string;
|
|
41
|
+
textFn: (row: any) => string;
|
|
42
|
+
showDirectionType: boolean;
|
|
43
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
44
|
+
export default _default;
|
|
@@ -12,24 +12,27 @@ type __VLS_Props = {
|
|
|
12
12
|
deviceOptions: DeviceOption[];
|
|
13
13
|
resourceDeviceOptions: DeviceOption[];
|
|
14
14
|
statusDisplayColor: string;
|
|
15
|
-
selectedDeviceValue:
|
|
16
|
-
addDeviceValue:
|
|
17
|
-
removeDeviceValue:
|
|
15
|
+
selectedDeviceValue: DeviceOption | null;
|
|
16
|
+
addDeviceValue: DeviceOption | null;
|
|
17
|
+
removeDeviceValue: DeviceOption | null;
|
|
18
|
+
customData: string;
|
|
18
19
|
};
|
|
19
20
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
20
|
-
copy: (uid: string) => any;
|
|
21
21
|
delete: (uid: string) => any;
|
|
22
|
-
|
|
23
|
-
"update:
|
|
24
|
-
"update:
|
|
22
|
+
copy: (uid: string) => any;
|
|
23
|
+
"update:selectedDeviceValue": (value: DeviceOption | null) => any;
|
|
24
|
+
"update:addDeviceValue": (value: "" | DeviceOption) => any;
|
|
25
|
+
"update:removeDeviceValue": (value: "" | DeviceOption) => any;
|
|
26
|
+
"update:customData": (value: string) => any;
|
|
25
27
|
"move-up": (uid: string) => any;
|
|
26
28
|
"move-down": (uid: string) => any;
|
|
27
29
|
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
28
|
-
onCopy?: ((uid: string) => any) | undefined;
|
|
29
30
|
onDelete?: ((uid: string) => any) | undefined;
|
|
30
|
-
|
|
31
|
-
"onUpdate:
|
|
32
|
-
"onUpdate:
|
|
31
|
+
onCopy?: ((uid: string) => any) | undefined;
|
|
32
|
+
"onUpdate:selectedDeviceValue"?: ((value: DeviceOption | null) => any) | undefined;
|
|
33
|
+
"onUpdate:addDeviceValue"?: ((value: "" | DeviceOption) => any) | undefined;
|
|
34
|
+
"onUpdate:removeDeviceValue"?: ((value: "" | DeviceOption) => any) | undefined;
|
|
35
|
+
"onUpdate:customData"?: ((value: string) => any) | undefined;
|
|
33
36
|
"onMove-up"?: ((uid: string) => any) | undefined;
|
|
34
37
|
"onMove-down"?: ((uid: string) => any) | undefined;
|
|
35
38
|
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
import { ScriptStep, ScriptTemplate } from './script';
|
|
2
|
+
/** 设备/资源下拉选项 */
|
|
3
|
+
interface DeviceOption {
|
|
4
|
+
label: string;
|
|
5
|
+
value: string;
|
|
6
|
+
className: string;
|
|
7
|
+
nameplate: string;
|
|
8
|
+
}
|
|
2
9
|
type __VLS_Props = {
|
|
3
10
|
scriptSteps: ScriptStep[];
|
|
4
11
|
selectedStepUid: string;
|
|
@@ -13,6 +20,7 @@ type __VLS_Props = {
|
|
|
13
20
|
allChecked: boolean;
|
|
14
21
|
isIndeterminate: boolean;
|
|
15
22
|
scriptTemplates: ScriptTemplate[];
|
|
23
|
+
deviceOptions: DeviceOption[];
|
|
16
24
|
};
|
|
17
25
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
18
26
|
add: () => any;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @File : script.ts
|
|
3
|
-
* @Desc. :
|
|
3
|
+
* @Desc. : 脚本模拟器的设备字段配置与预设模板
|
|
4
4
|
*/
|
|
5
5
|
/** 字段配置 */
|
|
6
6
|
export interface ScriptFieldConfig {
|
|
@@ -24,6 +24,18 @@ export interface ScriptStep {
|
|
|
24
24
|
delay: number;
|
|
25
25
|
enabled: boolean;
|
|
26
26
|
params: Record<string, any>;
|
|
27
|
+
/** 返回码(0 操作成功 / 400 客户端参数错误 / 500 服务端处理异常) */
|
|
28
|
+
code: number;
|
|
29
|
+
/** 返回消息说明(可选 code 自动带入后可修改) */
|
|
30
|
+
msg: string;
|
|
31
|
+
/** 消息体字段名:'data' 或 'payload' */
|
|
32
|
+
payloadKey: 'data' | 'payload';
|
|
33
|
+
/** 顶层 type 值(可自由配置,默认 'update') */
|
|
34
|
+
msgType: string;
|
|
35
|
+
/** 自定义业务数据 JSON 文本(设备/资源选择「自定义」时启用,作为业务数据) */
|
|
36
|
+
customData?: string;
|
|
37
|
+
/** type 字段覆盖值:设置后业务数据中的 type 使用此值而非 deviceType */
|
|
38
|
+
typeOverride?: string;
|
|
27
39
|
}
|
|
28
40
|
/** 脚本模板 */
|
|
29
41
|
export interface ScriptTemplate {
|
|
@@ -36,6 +48,8 @@ export declare const deviceTypeOptions: {
|
|
|
36
48
|
label: string;
|
|
37
49
|
value: string;
|
|
38
50
|
}[];
|
|
51
|
+
/** 设备/资源下拉「自定义」选项的标识值(选中后编辑自定义业务数据 JSON) */
|
|
52
|
+
export declare const CUSTOM_DEVICE_TYPE = "__custom__";
|
|
39
53
|
/** 资源类型选项 */
|
|
40
54
|
export declare const resourceTypeOptions: {
|
|
41
55
|
label: string;
|
|
@@ -50,6 +64,20 @@ export interface CommonStatusOption {
|
|
|
50
64
|
export declare const commonDict: CommonStatusOption[];
|
|
51
65
|
/** 资源状态字典:资源增删专用,状态值/文本/颜色三要素 */
|
|
52
66
|
export declare const resourceDict: CommonStatusOption[];
|
|
67
|
+
/** 返回码字典:code / 说明,供「返回码」下拉与 msg 自动带入使用 */
|
|
68
|
+
export interface CodeOption {
|
|
69
|
+
label: string;
|
|
70
|
+
value: number;
|
|
71
|
+
}
|
|
72
|
+
export declare const codeDict: CodeOption[];
|
|
73
|
+
/** 默认消息体字段名 */
|
|
74
|
+
export declare const defaultPayloadKey: 'data' | 'payload';
|
|
75
|
+
/** 默认顶层 type 值 */
|
|
76
|
+
export declare const defaultMsgType = "update";
|
|
77
|
+
/** 默认返回码 */
|
|
78
|
+
export declare const defaultCode = 0;
|
|
79
|
+
/** 默认返回说明 */
|
|
80
|
+
export declare const defaultMsg = "\u64CD\u4F5C\u6210\u529F";
|
|
53
81
|
/** 可作为资源容器的设备类型 */
|
|
54
82
|
export declare const containerDeviceOptions: {
|
|
55
83
|
label: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { WsProxyConfig } from './proxy';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
config: WsProxyConfig;
|
|
4
|
+
/** 配置来源:localFile 本地文件 / store 持久化配置(含用户手动修改场景) */
|
|
5
|
+
configSource: 'localFile' | 'store';
|
|
6
|
+
/** 用户是否已手动修改配置(configSource 为 store 时区分「本地文件异常」与「已手动修改配置」) */
|
|
7
|
+
manualModified?: boolean;
|
|
8
|
+
/** 是否已配置 dictFn(用于「字典 Label / 字典 Color」选项右侧 tag 显示) */
|
|
9
|
+
hasDictFn?: boolean;
|
|
10
|
+
};
|
|
11
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
12
|
+
reset: (value: WsProxyConfig) => any;
|
|
13
|
+
"update:config": (value: WsProxyConfig) => any;
|
|
14
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
15
|
+
onReset?: ((value: WsProxyConfig) => any) | undefined;
|
|
16
|
+
"onUpdate:config"?: ((value: WsProxyConfig) => any) | undefined;
|
|
17
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { WsProxyRequestMode } from './proxy';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
url: string;
|
|
4
|
+
/** 请求模式:direct 直接请求 / proxy 代理请求 */
|
|
5
|
+
requestMode: WsProxyRequestMode;
|
|
6
|
+
/** 是否自动连接:组件挂载且 wsUrl 有效时自动建立 WebSocket 连接 */
|
|
7
|
+
autoConnect: boolean;
|
|
8
|
+
isConnected: boolean;
|
|
9
|
+
isConnecting: boolean;
|
|
10
|
+
stateInfo: string;
|
|
11
|
+
/** 心跳检测间隔(秒):0=关闭 */
|
|
12
|
+
heartbeatInterval: number;
|
|
13
|
+
};
|
|
14
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
15
|
+
disconnect: () => any;
|
|
16
|
+
send: (data: string) => any;
|
|
17
|
+
"update:url": (value: string) => any;
|
|
18
|
+
"update:requestMode": (value: WsProxyRequestMode) => any;
|
|
19
|
+
"update:autoConnect": (value: boolean) => any;
|
|
20
|
+
"update:heartbeatInterval": (value: number) => any;
|
|
21
|
+
connect: () => any;
|
|
22
|
+
reconnect: () => any;
|
|
23
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
24
|
+
onDisconnect?: (() => any) | undefined;
|
|
25
|
+
onSend?: ((data: string) => any) | undefined;
|
|
26
|
+
"onUpdate:url"?: ((value: string) => any) | undefined;
|
|
27
|
+
"onUpdate:requestMode"?: ((value: WsProxyRequestMode) => any) | undefined;
|
|
28
|
+
"onUpdate:autoConnect"?: ((value: boolean) => any) | undefined;
|
|
29
|
+
"onUpdate:heartbeatInterval"?: ((value: number) => any) | undefined;
|
|
30
|
+
onConnect?: (() => any) | undefined;
|
|
31
|
+
onReconnect?: (() => any) | undefined;
|
|
32
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
33
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ILayerOperating, IScene } from '../../../types';
|
|
2
|
+
import { WsProxyConfig, ProxyRule, DictFn } from './proxy';
|
|
3
|
+
type __VLS_Props = {
|
|
4
|
+
/** 是否自动应用注入的消息(父组件调用 expose 的 feedMessage 时) */
|
|
5
|
+
autoApply?: boolean;
|
|
6
|
+
/** 初始配置 */
|
|
7
|
+
config?: WsProxyConfig;
|
|
8
|
+
/** 场景信息:用于字段映射中 percentToPixel 换算(如 currentCase.scene) */
|
|
9
|
+
scene?: IScene | null;
|
|
10
|
+
/** 字典转换函数:用于「字典 Label / 字典 Color」特殊处理
|
|
11
|
+
* 入参 (name: string, value?: string|number, type: 'label'|'color'),返回 string 赋给画布字段 */
|
|
12
|
+
dictFn?: DictFn;
|
|
13
|
+
/** 认证 token:作为 WebSocket 子协议(subprotocol)附带在连接请求中(参考 useWebSocket 的 token 用法) */
|
|
14
|
+
token?: string;
|
|
15
|
+
};
|
|
16
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
17
|
+
open: () => void;
|
|
18
|
+
feedMessage: (rawMessage: any) => void;
|
|
19
|
+
setConfig: (cfg: WsProxyConfig) => void;
|
|
20
|
+
isConnected: import('vue').Ref<boolean, boolean>;
|
|
21
|
+
rules: import('vue').ComputedRef<ProxyRule[]>;
|
|
22
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
23
|
+
operating: (data: ILayerOperating) => any;
|
|
24
|
+
raw: (data: unknown) => any;
|
|
25
|
+
"status-change": (connected: boolean) => any;
|
|
26
|
+
}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
27
|
+
onOperating?: ((data: ILayerOperating) => any) | undefined;
|
|
28
|
+
onRaw?: ((data: unknown) => any) | undefined;
|
|
29
|
+
"onStatus-change"?: ((connected: boolean) => any) | undefined;
|
|
30
|
+
}>, {
|
|
31
|
+
scene: IScene | null;
|
|
32
|
+
config: WsProxyConfig;
|
|
33
|
+
autoApply: boolean;
|
|
34
|
+
token: string;
|
|
35
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
36
|
+
export default _default;
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { ILayerOperating, IScene } from '../../../types';
|
|
2
|
+
/** 条件判断项:当源值满足 operator + operand 条件时,将 value 赋给画布字段 */
|
|
3
|
+
export interface ConditionRule {
|
|
4
|
+
/** 比较运算符 */
|
|
5
|
+
operator: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'includes' | 'in';
|
|
6
|
+
/** 比较目标值('in' 运算符时为逗号分隔的列表,如 '1,2,3') */
|
|
7
|
+
operand: string;
|
|
8
|
+
/** 条件为 true 时赋给画布字段的值 */
|
|
9
|
+
value: string | number | boolean;
|
|
10
|
+
}
|
|
11
|
+
/** 字段映射项:将一个 operating 目标字段映射到 payload 源字段/常量/值映射 */
|
|
12
|
+
export interface FieldMapper {
|
|
13
|
+
/** operating 目标路径(支持点号嵌套,如 light.color) */
|
|
14
|
+
target: string;
|
|
15
|
+
/** payload 源字段路径(支持点号嵌套,如 displayColor) */
|
|
16
|
+
source?: string;
|
|
17
|
+
/** 常量值(与 source 互斥,优先级最高) */
|
|
18
|
+
constant?: boolean | number | string;
|
|
19
|
+
/** 值映射:把源字段的取值映射为指定值(键为源值字符串,如 { '1': true }) */
|
|
20
|
+
valueMap?: Record<string, boolean | number | string>;
|
|
21
|
+
/** 源字段为空或未命中 valueMap 时的兜底值 */
|
|
22
|
+
defaultValue?: boolean | number | string | Record<string, unknown>;
|
|
23
|
+
/** 是否启用该映射(默认 true) */
|
|
24
|
+
enabled?: boolean;
|
|
25
|
+
/** 特殊处理:'percentToPixel' 百分比转像素 / 'runtimeToPixel' 运行时坐标转像素 / 'dictLabel' 字典Label / 'dictColor' 字典Color / 'dictColorMap' 对象值批量字典Color / 'condition' 条件判断;为空表示不处理 */
|
|
26
|
+
transform?: 'percentToPixel' | 'runtimeToPixel' | 'dictLabel' | 'dictColor' | 'dictColorMap' | 'condition';
|
|
27
|
+
/** 换算维度(transform 为 percentToPixel / runtimeToPixel 时必填):'width' 横向 / 'height' 纵向 */
|
|
28
|
+
transformType?: 'width' | 'height';
|
|
29
|
+
/** 换算精度(transform 为 percentToPixel 时生效,默认 2) */
|
|
30
|
+
transformPrecision?: number;
|
|
31
|
+
/** 字典名称(transform 为 dictLabel / dictColor 时生效,传给 dictFn 的 name 入参) */
|
|
32
|
+
dictName?: string;
|
|
33
|
+
/** 条件判断列表(transform 为 'condition' 时生效,按顺序匹配首个为 true 的条件,赋其 value 给画布字段;无匹配时保持源值) */
|
|
34
|
+
conditions?: ConditionRule[];
|
|
35
|
+
}
|
|
36
|
+
/** 字典转换函数:将「源业务数据」字段值按字典名称转换为「画布字段」值
|
|
37
|
+
* @param name 特殊处理配置下的字典名称(dictName)
|
|
38
|
+
* @param value 源业务数据字段所对应的值
|
|
39
|
+
* @param type 'label' 字典Label / 'color' 字典Color
|
|
40
|
+
* @returns 转换后的字符串值,赋值给画布字段 */
|
|
41
|
+
export type DictFn = (name: string, value: string | number | undefined, type: 'label' | 'color') => string;
|
|
42
|
+
/** 资源操作字段配置:定义 payload 中各字段的来源路径 */
|
|
43
|
+
export interface ResourceFieldConfig {
|
|
44
|
+
/** 资源 className 的源字段路径(如 addType / removeType) */
|
|
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 两组字段来源 */
|
|
60
|
+
export interface ResourceFieldMap {
|
|
61
|
+
/** 新增资源字段映射(不需要新增时可不配置) */
|
|
62
|
+
add?: ResourceFieldConfig;
|
|
63
|
+
/** 移除资源字段映射(不需要移除时可不配置) */
|
|
64
|
+
remove?: ResourceFieldConfig;
|
|
65
|
+
}
|
|
66
|
+
/** 全局操作字段配置(operate: 'global' 时生效) */
|
|
67
|
+
export interface GlobalFieldConfig {
|
|
68
|
+
/** resourceIds 的源字段路径(从源消息中提取资源 ID 数组;为空时使用 payloadKey,如 'data') */
|
|
69
|
+
resourceIds: string;
|
|
70
|
+
}
|
|
71
|
+
/** 单条类型代理规则 */
|
|
72
|
+
export interface ProxyRule {
|
|
73
|
+
/** 源 type:后端消息头的 type 原始值(如 '7'),配置后优先用于匹配,匹配该规则的 operating */
|
|
74
|
+
sourceType?: string;
|
|
75
|
+
/** 前端 operating 的 className(EnumModel 值),同时作为类型列表的唯一标识 */
|
|
76
|
+
className: string;
|
|
77
|
+
/** 设备名称(画布模型类对应的 equipmentName,用于类型列表上行展示) */
|
|
78
|
+
equipmentName?: string;
|
|
79
|
+
/** 是否启用该规则 */
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
/** 操作模式:single 单条 operating;resource 资源增删(生成 add/remove 两条);global 全局操作(如批量移除) */
|
|
82
|
+
operate: 'single' | 'resource' | 'global';
|
|
83
|
+
/** 字段映射列表(operate: 'single' 时生效) */
|
|
84
|
+
mappings: FieldMapper[];
|
|
85
|
+
/** 资源增删字段映射(operate: 'resource' 时生效,未配置时使用内置默认字段名) */
|
|
86
|
+
resourceFields?: ResourceFieldMap;
|
|
87
|
+
/** 全局操作字段映射(operate: 'global' 时生效) */
|
|
88
|
+
globalFields?: GlobalFieldConfig;
|
|
89
|
+
}
|
|
90
|
+
/** 请求模式:direct 直接请求(完整 ws/wss 地址);proxy 代理请求(仅 path,通过 vite/nginx 代理转发) */
|
|
91
|
+
export type WsProxyRequestMode = 'direct' | 'proxy';
|
|
92
|
+
/** 数据源:builtin 内置模式(组件内置 WebSocket 请求器);external 外接模式(feedMessage 注入) */
|
|
93
|
+
export type WsProxyDataSource = 'builtin' | 'external';
|
|
94
|
+
/** WsProxy 代理配置(可导出为 JSON) */
|
|
95
|
+
export interface WsProxyConfig {
|
|
96
|
+
/** 配置文件相对路径(不含 .json,支持嵌套如 lingshu-smart/wsProxyConfig) */
|
|
97
|
+
name: string;
|
|
98
|
+
/** 配置版本 */
|
|
99
|
+
version: number;
|
|
100
|
+
/** 数据源:builtin 内置模式(组件内置 WebSocket 请求器);external 外接模式(feedMessage 注入);默认 builtin */
|
|
101
|
+
dataSource?: WsProxyDataSource;
|
|
102
|
+
/** 默认 WebSocket 地址(可选)
|
|
103
|
+
* direct 模式:完整 ws/wss 地址(如 ws://host:port/path)
|
|
104
|
+
* proxy 模式:仅路径(如 ws/monitor?page=ctsMonitor),运行时拼接当前页面协议+主机 */
|
|
105
|
+
wsUrl?: string;
|
|
106
|
+
/** 请求模式:direct 直接请求 / proxy 代理请求(仅填 path,通过 vite/nginx 代理);默认 direct */
|
|
107
|
+
requestMode?: WsProxyRequestMode;
|
|
108
|
+
/** 是否在组件挂载且 wsUrl 有效时自动连接 WebSocket(默认 true) */
|
|
109
|
+
autoConnect?: boolean;
|
|
110
|
+
/** 业务数据字段名:源消息下该字段的数据作为画布运行 payload(默认 data) */
|
|
111
|
+
payloadKey?: string;
|
|
112
|
+
/** 源类型字段名:从源消息中提取设备类型的字段路径(默认 type,可设为 data.type 等) */
|
|
113
|
+
sourceTypeField?: string;
|
|
114
|
+
/** 心跳检测间隔(秒):0=关闭;>0=开启,定期发送心跳消息检测连接活性 */
|
|
115
|
+
heartbeatInterval?: number;
|
|
116
|
+
/** 各消息类型的代理规则 */
|
|
117
|
+
rules: ProxyRule[];
|
|
118
|
+
}
|
|
119
|
+
/** 按点号路径从对象取值 */
|
|
120
|
+
export declare function getPath(obj: unknown, path: string): unknown;
|
|
121
|
+
/** 按点号路径在对象上设值(自动创建中间对象) */
|
|
122
|
+
export declare function setPath(obj: Record<string, unknown>, path: string, value: unknown): void;
|
|
123
|
+
/** 解析单个字段映射:常量 > 值映射 > 源字段 > 默认值
|
|
124
|
+
* @param dictFn 字典转换函数(可选,未传入时按默认规则:label 原样返回 value,color 返回 '#fff') */
|
|
125
|
+
export declare function resolveMapper(payload: Record<string, unknown>, mapper: FieldMapper, scene?: IScene | null, dictFn?: DictFn): unknown;
|
|
126
|
+
/** 根据单条规则构建 operating 对象(operate: 'single') */
|
|
127
|
+
export declare function buildOperating(payload: Record<string, unknown>, rule: ProxyRule, scene?: IScene | null, dictFn?: DictFn): ILayerOperating | null;
|
|
128
|
+
/** 根据 Resource 规则构建资源增删 operating 列表(operate: 'resource')
|
|
129
|
+
* 字段来源由 rule.resourceFields 配置,未配置时使用内置默认字段名 */
|
|
130
|
+
export declare function buildResourceOperating(payload: Record<string, unknown>, rule: ProxyRule): ILayerOperating[];
|
|
131
|
+
/** 根据全局操作规则构建 operating(operate: 'global')
|
|
132
|
+
* resourceIds 从源消息中按 globalFields.resourceIds 路径提取,为空时使用 payloadKey */
|
|
133
|
+
export declare function buildGlobalOperating(msg: Record<string, unknown>, rule: ProxyRule, payloadKey: string): ILayerOperating[];
|
|
134
|
+
/**
|
|
135
|
+
* 将原始 WebSocket 消息转换为 operating 列表
|
|
136
|
+
* 标准化数据(payload 为对象)走 @operating;非标准化数据(payload 为数组)返回空数组,由 @raw 事件透出供父组件处理。
|
|
137
|
+
* @param rawMessage 原始消息
|
|
138
|
+
* @param rules 规则列表
|
|
139
|
+
* @param scene 场景信息(用于 percentToPixel 换算)
|
|
140
|
+
* @param payloadKey 业务数据字段名:源消息下该字段的数据作为画布运行 payload(默认 data,回退到 payload)
|
|
141
|
+
* @param sourceTypeField 源类型字段名:从源消息中提取设备类型的字段路径(默认 type)
|
|
142
|
+
* @param dictFn 字典转换函数(可选,用于 dictLabel / dictColor 特殊处理)
|
|
143
|
+
* @returns operating 列表(可能为空数组;非标准数组数据返回空数组由 @raw 处理)
|
|
144
|
+
*/
|
|
145
|
+
export declare function applyProxy(rawMessage: unknown, rules: ProxyRule[], scene?: IScene | null, payloadKey?: string, sourceTypeField?: string, dictFn?: DictFn): ILayerOperating[];
|
|
146
|
+
/** 默认代理配置 */
|
|
147
|
+
export declare function createDefaultConfig(): WsProxyConfig;
|
|
148
|
+
/** 校验导入的配置结构是否合法 */
|
|
149
|
+
export declare function validateConfig(raw: unknown): WsProxyConfig | null;
|
|
150
|
+
/** 将配置序列化为 JSON 字符串 */
|
|
151
|
+
export declare function serializeConfig(config: WsProxyConfig): string;
|
|
152
|
+
/** 触发浏览器下载 JSON 配置文件(文件名:wsProxyConfig_ + 年月日时分秒) */
|
|
153
|
+
export declare function downloadConfig(config: WsProxyConfig): void;
|
|
154
|
+
/** 生成导出文件名:wsProxyConfig_yyyy_MM_dd_HH_mm_ss */
|
|
155
|
+
export declare function timestampName(): string;
|
|
156
|
+
/** 本地文件配置加载结果 */
|
|
157
|
+
export type LocalFileConfigResult = {
|
|
158
|
+
status: 'ok';
|
|
159
|
+
config: WsProxyConfig;
|
|
160
|
+
} | {
|
|
161
|
+
status: 'missing';
|
|
162
|
+
reason: string;
|
|
163
|
+
} | {
|
|
164
|
+
status: 'invalid';
|
|
165
|
+
reason: string;
|
|
166
|
+
} | {
|
|
167
|
+
status: 'unknown';
|
|
168
|
+
reason: string;
|
|
169
|
+
};
|
|
170
|
+
/** 从业务工程 public 目录读取配置文件(name 为相对路径,如 lingshu-smart/wsProxyConfig) */
|
|
171
|
+
export declare function loadLocalFileConfig(name: string): Promise<LocalFileConfigResult>;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupDialog.vue.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ interface Props {
|
|
|
5
5
|
resourceType: EnumResourceType;
|
|
6
6
|
flowOptions?: IFlowConfig;
|
|
7
7
|
stationSlots?: IStationSlotConfig[];
|
|
8
|
+
hideBounds?: boolean;
|
|
8
9
|
containerWidth?: number;
|
|
9
10
|
containerHeight?: number;
|
|
10
11
|
}
|
|
@@ -13,14 +14,17 @@ declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, imp
|
|
|
13
14
|
save: (data: {
|
|
14
15
|
flowOptions: IFlowConfig;
|
|
15
16
|
stationSlots: IStationSlotConfig[];
|
|
17
|
+
hideBounds: boolean;
|
|
16
18
|
}) => any;
|
|
17
19
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
18
20
|
"onUpdate:modelValue"?: ((value: boolean) => any) | undefined;
|
|
19
21
|
onSave?: ((data: {
|
|
20
22
|
flowOptions: IFlowConfig;
|
|
21
23
|
stationSlots: IStationSlotConfig[];
|
|
24
|
+
hideBounds: boolean;
|
|
22
25
|
}) => any) | undefined;
|
|
23
26
|
}>, {
|
|
27
|
+
hideBounds: boolean;
|
|
24
28
|
stationSlots: IStationSlotConfig[];
|
|
25
29
|
flowOptions: IFlowConfig;
|
|
26
30
|
containerWidth: number;
|
package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupLayers.vue.d.ts
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
export default _default;
|
|
@@ -2,4 +2,5 @@ import { default as LingshuSmartEditor } from './editor/index.vue';
|
|
|
2
2
|
import { default as LingshuSmartPreview } from './preview/index.vue';
|
|
3
3
|
import { default as PerformanceStats } from './debug/PerformanceStats.vue';
|
|
4
4
|
import { default as ScriptRunner } from './debug/ScriptRunner/index.vue';
|
|
5
|
-
|
|
5
|
+
import { default as WsProxy } from './debug/WsProxy/index.vue';
|
|
6
|
+
export { LingshuSmartEditor, LingshuSmartPreview, PerformanceStats, ScriptRunner, WsProxy };
|