@jnrs/lingshu-smart 2.2.46 → 3.0.0
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 +281 -348
- package/dist/components/debug/DataLogPanel.vue.d.ts +29 -3
- package/dist/components/debug/PerformanceStats.vue.d.ts +1 -1
- package/dist/components/debug/ScriptRunner/ConfigPanel.vue.d.ts +1 -2
- package/dist/components/debug/ScriptRunner/StepsPanel.vue.d.ts +4 -2
- package/dist/components/debug/ScriptRunner/index.vue.d.ts +11 -0
- package/dist/components/debug/ScriptRunner/script.d.ts +140 -41
- package/dist/components/debug/ScriptRunner/scriptFile.d.ts +92 -0
- package/dist/components/debug/WsProxy/index.vue.d.ts +10 -8
- package/dist/components/debug/WsProxy/proxy.d.ts +114 -53
- package/dist/components/editor/ControlBar/CaseManger.vue.d.ts +18 -2
- package/dist/components/editor/ControlBar/CaseTitleEdit.vue.d.ts +2 -2
- package/dist/components/editor/ControlBar/PersistDialog.vue.d.ts +9 -0
- package/dist/components/index.js +8419 -6045
- package/dist/components/preview/index.vue.d.ts +6852 -4876
- package/dist/controller/AppController.d.ts +75 -4
- package/dist/controller/SocketDispatcher.d.ts +59 -0
- package/dist/fullscreen-BA3oea8O.js +53 -0
- package/dist/index-C6Liz-8o.js +1238 -0
- package/dist/index.js +36 -27
- package/dist/lingshu-smart/cases.json +5890 -14828
- package/dist/lingshu-smart/mockSocket.json +263 -0
- package/dist/lingshu-smart/wsProxyConfig.json +343 -720
- package/dist/playground/ViewPageDemo.vue.d.ts +14412 -10438
- package/dist/stores/index.js +1 -1
- package/dist/stores/useAppStore.d.ts +20570 -14641
- package/dist/stores/useDataStore.d.ts +21139 -14587
- package/dist/stores/useDebugStore.d.ts +14 -2
- package/dist/stores/useEditorStore.d.ts +3 -3
- package/dist/types/app.types.d.ts +1 -1
- package/dist/types/components/config.types.d.ts +16 -0
- package/dist/types/components/operating.types.d.ts +28 -19
- package/dist/types/enums.d.ts +22 -2
- package/dist/types/guards.d.ts +4 -1
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/config.types.d.ts +41 -9
- package/dist/types/models/operating.types.d.ts +64 -74
- package/dist/types/socket.types.d.ts +275 -0
- package/dist/ui/abstract/ModelAbs.d.ts +42 -2
- package/dist/ui/components/Resource.d.ts +0 -1
- package/dist/ui/components/StationSlot.d.ts +8 -2
- package/dist/ui/components/StationSlotGroup.d.ts +28 -3
- package/dist/ui/models/DoubleJointRobot.d.ts +16 -4
- package/dist/ui/models/MachineTool.d.ts +6 -2
- package/dist/ui/models/MaterialTrack.d.ts +14 -2
- package/dist/ui/models/Pallet.d.ts +29 -9
- package/dist/ui/models/Rail.d.ts +9 -2
- package/dist/ui/models/ResourceOperationWindow.d.ts +2 -1
- package/dist/ui/models/ResourceStore.d.ts +7 -5
- package/dist/ui/models/Rgv.d.ts +6 -6
- package/dist/ui/models/ShuttleStation.d.ts +14 -4
- package/dist/ui/models/SingleJointRobot.d.ts +14 -4
- package/dist/ui/utils/resolveStationSlotLayers.d.ts +20 -0
- package/dist/ui/utils/resolveTypeStyle.d.ts +13 -0
- package/dist/useAppStore-DASwAOBy.js +7223 -0
- package/dist/utils/fullscreen.d.ts +9 -0
- package/dist/utils/index.d.ts +1 -0
- package/dist/vite.d.ts +15 -0
- package/dist/vite.js +39 -0
- package/package.json +6 -2
- package/dist/components/editor/OptionCard/Equipment/stationSlot/StationSlotGroupBoth.vue.d.ts +0 -2
- package/dist/guards-aLOXCeCF.js +0 -35
- package/dist/index-Dsgrnpn0.js +0 -1186
- package/dist/useAppStore-CVyLAMtL.js +0 -6125
- /package/dist/components/editor/OptionCard/Equipment/{stationSlot/StationSlotGroup.vue.d.ts → models/ResourceStore.vue.d.ts} +0 -0
|
@@ -1,18 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
/** 条件判断项:当源值满足 operator + operand
|
|
1
|
+
import { IScene, SocketMessage } from '../../../types';
|
|
2
|
+
/** 条件判断项:当源值满足 operator + operand 条件时,将处理结果赋给画布字段 */
|
|
3
3
|
export interface ConditionRule {
|
|
4
|
+
/** 条件判断时使用的源字段路径(点号嵌套,如 data.type);缺省时与 mapper.source 一致 */
|
|
5
|
+
source?: string;
|
|
4
6
|
/** 比较运算符 */
|
|
5
7
|
operator: 'eq' | 'ne' | 'gt' | 'lt' | 'gte' | 'lte' | 'includes' | 'in';
|
|
6
8
|
/** 比较目标值('in' 运算符时为逗号分隔的列表,如 '1,2,3') */
|
|
7
9
|
operand: string;
|
|
8
|
-
/**
|
|
9
|
-
|
|
10
|
+
/** 特殊处理类型:undefined/'constant' 固定值 / dictLabel 字典 Label / dictColor 字典 Color / operation 运算处理 */
|
|
11
|
+
transform?: 'constant' | 'dictLabel' | 'dictColor' | 'operation';
|
|
12
|
+
/** 固定值(transform 为 undefined / 'constant' 时生效,条件为 true 时直接赋给画布字段) */
|
|
13
|
+
value?: string | number | boolean;
|
|
14
|
+
/** 字典名称(transform 为 dictLabel / dictColor 时生效) */
|
|
15
|
+
dictName?: string;
|
|
16
|
+
/** 运算处理类型(transform 为 operation 时生效) */
|
|
17
|
+
operateFn?: 'negate' | 'not' | 'toBoolean' | 'concat';
|
|
18
|
+
/** 拼接运算表达式(transform 为 operation 且 operateFn 为 concat 时生效) */
|
|
19
|
+
expression?: string;
|
|
10
20
|
}
|
|
11
|
-
/**
|
|
21
|
+
/** 字段映射项:将一个协议 payload 目标字段映射到源消息字段/常量/值映射 */
|
|
12
22
|
export interface FieldMapper {
|
|
13
|
-
/**
|
|
23
|
+
/** 协议 payload 目标路径(支持点号嵌套,如 light.color / position.x / to.device_id) */
|
|
14
24
|
target: string;
|
|
15
|
-
/**
|
|
25
|
+
/** 源消息字段路径(支持点号嵌套,如 displayColor) */
|
|
16
26
|
source?: string;
|
|
17
27
|
/** 常量值(与 source 互斥,优先级最高;「固定值」特殊处理时由输入框写入,直接赋给画布字段) */
|
|
18
28
|
constant?: boolean | number | string;
|
|
@@ -45,38 +55,49 @@ export interface FieldMapper {
|
|
|
45
55
|
* @param type 'label' 字典Label / 'color' 字典Color
|
|
46
56
|
* @returns 转换后的字符串值,赋值给画布字段 */
|
|
47
57
|
export type DictFn = (name: string, value: string | number | undefined, type: 'label' | 'color') => string;
|
|
48
|
-
/**
|
|
49
|
-
* 目标路径支持点号嵌套,
|
|
50
|
-
* (如
|
|
58
|
+
/** 资源增删字段映射:按源 operation 分组配置动态字段映射
|
|
59
|
+
* 目标路径支持点号嵌套,to.* / from.* 为目标/源设备匹配字段,其余为资源对象字段
|
|
60
|
+
* (如 resource_id / resource_type),未配置的组运行时回退内置默认映射 */
|
|
51
61
|
export interface ResourceFieldMap {
|
|
52
62
|
/** 新增资源字段映射列表(无需新增时可不配置或为空数组) */
|
|
53
63
|
add?: FieldMapper[];
|
|
64
|
+
/** 批量进场字段映射列表(对 resources[] 逐项生效,字段结构与 add 一致) */
|
|
65
|
+
batch_add?: FieldMapper[];
|
|
66
|
+
/** 资源流转字段映射列表(transfer:源工位解绑 → 目标工位绑定,实体保活) */
|
|
67
|
+
transfer?: FieldMapper[];
|
|
54
68
|
/** 移除资源字段映射列表(无需移除时可不配置或为空数组) */
|
|
55
69
|
remove?: FieldMapper[];
|
|
70
|
+
/** 批量离场字段映射列表(batch_remove:resource_ids / resource_type,见 socket-operating-api-backend.md 8.5) */
|
|
71
|
+
batch_remove?: FieldMapper[];
|
|
56
72
|
}
|
|
57
|
-
/**
|
|
58
|
-
export interface
|
|
59
|
-
/**
|
|
60
|
-
|
|
73
|
+
/** Resource 规则专属源字段配置(operate: 'resource' 时生效) */
|
|
74
|
+
export interface ResourceFieldConfig {
|
|
75
|
+
/** 源 operation 字段路径(相对完整源消息,如 data.operation);配置后按源 operation 值分发到对应映射组,
|
|
76
|
+
* 标准信封消息固定按 payload.operation 分发,不受此项影响 */
|
|
77
|
+
operationField?: string;
|
|
78
|
+
/** batch_add 资源项数组的源字段路径(相对完整源消息,如 data.resources);为空时回退 payloadKey */
|
|
79
|
+
batchAddItems?: string;
|
|
61
80
|
}
|
|
62
81
|
/** 单条类型代理规则 */
|
|
63
82
|
export interface ProxyRule {
|
|
64
|
-
/**
|
|
83
|
+
/** 信封类型:源消息 sourceTypeField 路径上的原始值(标准信封源即 envelope.type,如 'device_command'),用于匹配该规则 */
|
|
65
84
|
sourceType?: string;
|
|
85
|
+
/** 设备类型(snake_case device_type):透传匹配时与 payload.device_type 比对;非标准构建时覆盖由 className 推导的 device_type;为空时由 className 推导 */
|
|
86
|
+
deviceType?: string;
|
|
66
87
|
/** 前端 operating 的 className(EnumModel 值),同时作为类型列表的唯一标识 */
|
|
67
88
|
className: string;
|
|
68
89
|
/** 设备名称(画布模型类对应的 equipmentName,用于类型列表上行展示) */
|
|
69
90
|
equipmentName?: string;
|
|
70
91
|
/** 是否启用该规则 */
|
|
71
92
|
enabled: boolean;
|
|
72
|
-
/** 操作模式:single
|
|
73
|
-
operate: 'single' | 'resource' | '
|
|
74
|
-
/** 字段映射列表(operate: 'single' 时生效) */
|
|
93
|
+
/** 操作模式:single 设备驱动(生成 device_command);resource 资源操作(按源 operation 生成 resource_command add/batch_add/transfer/remove/batch_remove);resetAll 全部复位(生成 scene_reset,画布所有模型重建);statusPush 全局运行状态推送(映射产物**不进画布**,经 runtime-status 事件交给页面全局状态信息 bar 消费) */
|
|
94
|
+
operate: 'single' | 'resource' | 'resetAll' | 'statusPush';
|
|
95
|
+
/** 字段映射列表(operate: 'single' / 'statusPush' 时生效) */
|
|
75
96
|
mappings: FieldMapper[];
|
|
76
|
-
/**
|
|
97
|
+
/** 资源操作字段映射(operate: 'resource' 时生效,未配置的组使用内置默认字段映射) */
|
|
77
98
|
resourceMappings?: ResourceFieldMap;
|
|
78
|
-
/**
|
|
79
|
-
|
|
99
|
+
/** Resource 规则专属源字段配置(operate: 'resource' 时生效) */
|
|
100
|
+
resourceFields?: ResourceFieldConfig;
|
|
80
101
|
/** 手动新增标记:「+ 新增」手动添加的规则不随方案设备类型自动移除 */
|
|
81
102
|
custom?: boolean;
|
|
82
103
|
}
|
|
@@ -102,23 +123,25 @@ export interface WsProxyConfig {
|
|
|
102
123
|
requestMode?: WsProxyRequestMode;
|
|
103
124
|
/** 是否在组件挂载且 wsUrl 有效时自动连接 WebSocket(默认 true) */
|
|
104
125
|
autoConnect?: boolean;
|
|
105
|
-
/**
|
|
126
|
+
/** 业务数据字段名:源消息下该字段的数据作为协议 payload 来源(默认 data) */
|
|
106
127
|
payloadKey?: string;
|
|
107
|
-
/**
|
|
128
|
+
/** 源类型字段名:从源消息中提取消息类型的字段路径(默认 type,可设为 data.device_type 等) */
|
|
108
129
|
sourceTypeField?: string;
|
|
109
|
-
/** 心跳检测间隔(秒):0=关闭;>0
|
|
130
|
+
/** 心跳检测间隔(秒):0=关闭;>0=开启,定期发送 { type: 'ping' } 检测连接活性(默认 30,见文档基础约定) */
|
|
110
131
|
heartbeatInterval?: number;
|
|
111
|
-
/**
|
|
112
|
-
|
|
132
|
+
/** 断线后是否自动重连(指数退避:初始 1s,每次翻倍,上限 30s,见文档基础约定;默认 true) */
|
|
133
|
+
autoReconnect?: boolean;
|
|
134
|
+
/** 模型映射表:源业务数据值 → 设备类型 device_type(如 { '1': 'machine_tool' })
|
|
135
|
+
* 供字段映射的「模型映射表」特殊处理引用;映射值为旧 PascalCase 模型名时自动转换为 snake_case device_type */
|
|
113
136
|
modelMap?: Record<string, string>;
|
|
114
137
|
/** 各消息类型的代理规则 */
|
|
115
138
|
rules: ProxyRule[];
|
|
116
139
|
}
|
|
117
140
|
/** 绑定到某一方案的代理器配置:在 WsProxyConfig 基础上增加方案绑定标识 */
|
|
118
141
|
export interface WsProxyCaseConfig extends WsProxyConfig {
|
|
119
|
-
/** 绑定的方案
|
|
142
|
+
/** 绑定的方案 id(currentCase.id),用于按方案自动匹配 */
|
|
120
143
|
caseId: string;
|
|
121
|
-
/** 方案名称(currentCase.title),用于方案切换下拉左侧展示;可缺省,缺省时回退
|
|
144
|
+
/** 方案名称(currentCase.title),用于方案切换下拉左侧展示;可缺省,缺省时回退 id */
|
|
122
145
|
caseName?: string;
|
|
123
146
|
}
|
|
124
147
|
/** 默认本地配置文件完整路径(public 起始,含 .json,用于定位/加载/导出的固定 fileUrl) */
|
|
@@ -134,45 +157,82 @@ export declare function setPath(obj: Record<string, unknown>, path: string, valu
|
|
|
134
157
|
* @param dictFn 字典转换函数(可选,未传入时按默认规则:label 原样返回 value,color 返回 '#fff')
|
|
135
158
|
* @param modelMap 模型映射表(可选,transform 为 'modelMap' 时引用,将源值转换为画布模型 className) */
|
|
136
159
|
export declare function resolveMapper(payload: Record<string, unknown>, mapper: FieldMapper, scene?: IScene | null, dictFn?: DictFn, modelMap?: Record<string, string>): unknown;
|
|
137
|
-
/**
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*
|
|
145
|
-
|
|
160
|
+
/** 信封生成选项(场景 ID 来自 WsProxyConfig) */
|
|
161
|
+
interface EnvelopeOptions {
|
|
162
|
+
caseId?: string;
|
|
163
|
+
}
|
|
164
|
+
/**
|
|
165
|
+
* 根据单条规则构建 device_command 协议消息(operate: 'single')
|
|
166
|
+
* device_type 由规则 className 推导(MODEL_TO_DEVICE_TYPE),其余 payload 字段由映射产出
|
|
167
|
+
* @returns payload 缺少 device_id 时返回 null(无法路由到具体设备)
|
|
168
|
+
*/
|
|
169
|
+
export declare function buildSocketMessage(payload: Record<string, unknown>, rule: ProxyRule, envelopeOptions?: EnvelopeOptions, scene?: IScene | null, dictFn?: DictFn, modelMap?: Record<string, string>): SocketMessage<Record<string, unknown>> | null;
|
|
170
|
+
/**
|
|
171
|
+
* 根据 Resource 规则构建 resource_command 协议消息列表(operate: 'resource')
|
|
172
|
+
* 配置了 resourceFields.operationField 时按源 operation 分发(add / batch_add / transfer / remove / batch_remove 各自走对应映射组);
|
|
173
|
+
* 未配置时保持旧语义:对每条命中消息同时产出 add(operation: 'add',需 resource_id + to.device_id)
|
|
174
|
+
* 与 remove(operation: 'remove',需 resource_id)两条消息
|
|
175
|
+
* to.device_type / from.device_type 支持源字段映射(modelMap 转换)或由映射值直接给出 snake_case device_type
|
|
176
|
+
*/
|
|
177
|
+
export declare function buildResourceSocketMessages(msg: Record<string, unknown>, payload: Record<string, unknown> | unknown[], rule: ProxyRule, payloadKey: string, envelopeOptions?: EnvelopeOptions, scene?: IScene | null, dictFn?: DictFn, modelMap?: Record<string, string>): SocketMessage<Record<string, unknown>>[];
|
|
178
|
+
/** 代理解析产物 */
|
|
179
|
+
export interface ProxyResult {
|
|
180
|
+
/** 标准信封协议消息(由调用方经 feedSocketMessage 驱动画布) */
|
|
181
|
+
messages: SocketMessage<Record<string, unknown>>[];
|
|
182
|
+
/** 全局运行状态推送(operate:'statusPush')的映射产物:不进入画布,供页面全局状态信息 bar 消费;未命中规则时为 null */
|
|
183
|
+
runtimeStatus: Record<string, unknown> | null;
|
|
184
|
+
}
|
|
146
185
|
/**
|
|
147
|
-
* 将原始 WebSocket
|
|
148
|
-
*
|
|
186
|
+
* 将原始 WebSocket 消息转换为标准信封协议消息列表(envelope + payload,见 socket-operating-api.md)
|
|
187
|
+
* 1. 源消息本身就是标准信封消息(envelope + payload)→ 保持 envelope 原样,payload 按匹配规则做全量映射加工:
|
|
188
|
+
* device_command 按 payload.device_type 匹配规则(enrichPassthroughDevice)、
|
|
189
|
+
* resource_command 按 payload.operation 分发对应映射组(enrichPassthroughResource,transfer 也会注入 resource_color);
|
|
190
|
+
* runtime_status_push 若命中 operate:'statusPush' 规则则**转为 runtimeStatus 产物(不进画布)**;
|
|
191
|
+
* 未命中规则的类型(device_init / alarm_push 等)原样直通;
|
|
192
|
+
* 2. 按 sourceTypeField 提取消息类型匹配规则,经字段映射生成 device_command / resource_command / scene_reset;
|
|
193
|
+
* statusPush 规则产出 runtimeStatus(不进画布)。
|
|
194
|
+
* 非标准化数据(payload 为数组)返回空 messages,由 @raw 事件透出供父组件处理。
|
|
149
195
|
* @param rawMessage 原始消息
|
|
150
196
|
* @param rules 规则列表
|
|
151
|
-
* @param
|
|
152
|
-
* @param
|
|
153
|
-
* @param
|
|
197
|
+
* @param envelopeOptions 信封选项(caseId)
|
|
198
|
+
* @param scene 场景信息(用于 percentToPixel / runtimeToPixel 换算特殊处理)
|
|
199
|
+
* @param payloadKey 业务数据字段名:源消息下该字段的数据作为协议 payload 来源(默认 data,回退到 payload)
|
|
200
|
+
* @param sourceTypeField 源类型字段名:从源消息中提取消息类型的字段路径(默认 type)
|
|
154
201
|
* @param dictFn 字典转换函数(可选,用于 dictLabel / dictColor 特殊处理)
|
|
155
|
-
* @param modelMap 模型映射表(可选,用于 modelMap 特殊处理:源业务数据值 →
|
|
156
|
-
* @returns
|
|
202
|
+
* @param modelMap 模型映射表(可选,用于 modelMap 特殊处理:源业务数据值 → 设备类型 device_type)
|
|
203
|
+
* @returns 代理解析产物(messages 可能为空数组;非标准数组数据返回空数组由 @raw 处理)
|
|
157
204
|
*/
|
|
158
|
-
export declare function applyProxy(rawMessage: unknown, rules: ProxyRule[], scene?: IScene | null, payloadKey?: string, sourceTypeField?: string, dictFn?: DictFn, modelMap?: Record<string, string>):
|
|
159
|
-
/** 资源新增字段默认映射(target
|
|
205
|
+
export declare function applyProxy(rawMessage: unknown, rules: ProxyRule[], envelopeOptions?: EnvelopeOptions, scene?: IScene | null, payloadKey?: string, sourceTypeField?: string, dictFn?: DictFn, modelMap?: Record<string, string>): ProxyResult;
|
|
206
|
+
/** 资源新增字段默认映射(target 为 resource_command add 协议 payload 路径,源字段名取自业务 Resource 消息的标准字段)
|
|
207
|
+
* 颜色:**不做预设**——显式下发 resource_color 时透传使用;如需由 resource_state 映射,请使用方在代理器自行配置
|
|
208
|
+
* (特殊处理「字典 Color」,或「固定值」直接写死颜色) */
|
|
160
209
|
export declare const DEFAULT_RESOURCE_ADD_MAPPERS: FieldMapper[];
|
|
161
|
-
/**
|
|
210
|
+
/** 资源移除字段默认映射(target 为 resource_command remove 协议 payload 路径,按 resource_id 全局查找) */
|
|
162
211
|
export declare const DEFAULT_RESOURCE_REMOVE_MAPPERS: FieldMapper[];
|
|
212
|
+
/** 资源流转字段默认映射(target 为 resource_command transfer 协议 payload 路径;
|
|
213
|
+
* from 缺省时画布按 resource_id 全局查找源工位;颜色语义同 add——不做预设,按需在代理器自行配置) */
|
|
214
|
+
export declare const DEFAULT_RESOURCE_TRANSFER_MAPPERS: FieldMapper[];
|
|
215
|
+
/** 批量进场字段默认映射(target 为 batch_add resources[] 内单项的字段路径,结构与 add 一致,复用 add 默认映射) */
|
|
216
|
+
export declare const DEFAULT_RESOURCE_BATCH_ADD_MAPPERS: FieldMapper[];
|
|
217
|
+
/** 批量离场字段默认映射(target 为 batch_remove 协议 payload 路径,见 socket-operating-api-backend.md 8.5:
|
|
218
|
+
* resource_ids 必填(资源 ID 列表)、resource_type 可选(匹配资源类型,不填就是所有类型) */
|
|
219
|
+
export declare const DEFAULT_RESOURCE_BATCH_REMOVE_MAPPERS: FieldMapper[];
|
|
163
220
|
/** 默认代理配置(含全部已知设备类型) */
|
|
164
221
|
export declare function createDefaultConfig(): WsProxyConfig;
|
|
165
222
|
/** 返回某设备类型的默认代理规则;未知类型返回 null(供「画布模型类」按 currentCase 缺型兜底) */
|
|
166
223
|
export declare function getDefaultDeviceRule(className: string): ProxyRule | null;
|
|
167
224
|
/**
|
|
168
225
|
* 为指定方案构建代理配置:仅包含该方案当前存在的设备类型(deviceClassNames)的默认映射,
|
|
169
|
-
* 外加始终保留的 Resource /
|
|
170
|
-
* @param caseId 绑定的方案
|
|
226
|
+
* 外加始终保留的 Resource / ResetAll 操作规则。供「画布模型类」按 currentCase 动态生成使用。
|
|
227
|
+
* @param caseId 绑定的方案 id
|
|
171
228
|
* @param deviceClassNames 方案中实际存在的设备类型 className 列表(去重后)
|
|
172
229
|
*/
|
|
173
230
|
export declare function createDefaultConfigForCase(caseId: string, deviceClassNames: string[]): WsProxyCaseConfig;
|
|
174
|
-
/**
|
|
175
|
-
*
|
|
231
|
+
/**
|
|
232
|
+
* 配置规范化(加载/导入时调用):旧版 target 路径迁移 + BatchRemove 并入 Resource + 补齐 RuntimeStatus 规则。
|
|
233
|
+
* 不做结构合法性校验(校验走 validateConfig)。
|
|
234
|
+
*/
|
|
235
|
+
export declare function migrateConfig(cfg: WsProxyConfig): WsProxyConfig;
|
|
176
236
|
export declare function validateConfig(raw: unknown): WsProxyConfig | null;
|
|
177
237
|
/** 校验代理器配置数组是否合法 */
|
|
178
238
|
export declare function validateCaseConfigArray(raw: unknown): WsProxyCaseConfig[] | null;
|
|
@@ -206,6 +266,7 @@ export type LocalFileConfigResult = {
|
|
|
206
266
|
reason: string;
|
|
207
267
|
};
|
|
208
268
|
/** 从业务工程 public 目录读取配置文件(fileUrl 为完整路径,如 public/lingshu-smart/wsProxyConfig.json)
|
|
209
|
-
* 支持数组格式(每套配置绑定一个方案 caseId);非数组为旧版单配置(无
|
|
210
|
-
* 传入 caseId 且为数组格式时,必须匹配到该
|
|
269
|
+
* 支持数组格式(每套配置绑定一个方案 caseId);非数组为旧版单配置(无 id 匹配概念,直接返回)。
|
|
270
|
+
* 传入 caseId 且为数组格式时,必须匹配到该 id 才算加载成功,否则返回 invalid(未匹配到 id)。 */
|
|
211
271
|
export declare function loadLocalFileConfig(fileUrl: string, caseId?: string): Promise<LocalFileConfigResult>;
|
|
272
|
+
export {};
|
|
@@ -2,10 +2,10 @@ import { ICase } from '../../../types';
|
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
/**
|
|
4
4
|
* 加载方案列表
|
|
5
|
-
* @param
|
|
5
|
+
* @param id
|
|
6
6
|
* @returns Promise<ICase[]>
|
|
7
7
|
*/
|
|
8
|
-
loadCases?: (
|
|
8
|
+
loadCases?: (id?: string) => Promise<ICase[]>;
|
|
9
9
|
/**
|
|
10
10
|
* 保存方案列表
|
|
11
11
|
*/
|
|
@@ -24,5 +24,21 @@ declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {
|
|
|
24
24
|
}, Readonly<{}> & Readonly<{}>, {
|
|
25
25
|
showVisible: () => void;
|
|
26
26
|
}, {}, {}, {}, {}> | null;
|
|
27
|
+
persistDialogRef: import('vue').CreateComponentPublicInstanceWithMixins<Readonly<{
|
|
28
|
+
saveCases?: (cases?: ICase[]) => void;
|
|
29
|
+
}> & Readonly<{}>, {
|
|
30
|
+
showVisible: () => void;
|
|
31
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, import('vue').PublicProps, {}, false, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {}, any, import('vue').ComponentProvideOptions, {
|
|
32
|
+
P: {};
|
|
33
|
+
B: {};
|
|
34
|
+
D: {};
|
|
35
|
+
C: {};
|
|
36
|
+
M: {};
|
|
37
|
+
Defaults: {};
|
|
38
|
+
}, Readonly<{
|
|
39
|
+
saveCases?: (cases?: ICase[]) => void;
|
|
40
|
+
}> & Readonly<{}>, {
|
|
41
|
+
showVisible: () => void;
|
|
42
|
+
}, {}, {}, {}, {}> | null;
|
|
27
43
|
}, any>;
|
|
28
44
|
export default _default;
|
|
@@ -61,7 +61,7 @@ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
61
61
|
$root: import('vue').ComponentPublicInstance | null;
|
|
62
62
|
$parent: import('vue').ComponentPublicInstance | null;
|
|
63
63
|
$host: Element | null;
|
|
64
|
-
$emit: ((event: "blur", evt: FocusEvent) => void) & ((event: "
|
|
64
|
+
$emit: ((event: "blur", evt: FocusEvent) => void) & ((event: "change", value: string, evt?: Event | undefined) => void) & ((event: "compositionend", evt: CompositionEvent) => void) & ((event: "compositionstart", evt: CompositionEvent) => void) & ((event: "compositionupdate", evt: CompositionEvent) => void) & ((event: "focus", evt: FocusEvent) => void) & ((event: "input", value: string) => void) & ((event: "keydown", evt: Event | KeyboardEvent) => void) & ((event: "mouseenter", evt: MouseEvent) => void) & ((event: "mouseleave", evt: MouseEvent) => void) & ((event: "clear", evt: MouseEvent | undefined) => void) & ((event: "update:modelValue", value: string) => void);
|
|
65
65
|
$el: any;
|
|
66
66
|
$options: import('vue').ComponentOptionsBase<Readonly<import('element-plus').InputProps> & Readonly<{
|
|
67
67
|
onClear?: ((evt: MouseEvent | undefined) => any) | undefined;
|
|
@@ -159,7 +159,7 @@ declare const _default: import('vue').DefineComponent<{}, {}, {}, {}, {}, import
|
|
|
159
159
|
onCompositionstart?: ((evt: CompositionEvent) => any) | undefined;
|
|
160
160
|
onCompositionupdate?: ((evt: CompositionEvent) => any) | undefined;
|
|
161
161
|
onCompositionend?: ((evt: CompositionEvent) => any) | undefined;
|
|
162
|
-
}>, "disabled" | "blur" | "
|
|
162
|
+
}>, "disabled" | "blur" | "focus" | "input" | "select" | "type" | "textarea" | "clear" | "modelValue" | "autocomplete" | "clearIcon" | "validateEvent" | "tabindex" | "inputStyle" | "ref" | "modelModifiers" | "autosize" | "wordLimitPosition" | "rows" | "textareaStyle" | "isComposing" | "passwordVisible" | "resizeTextarea"> & import('vue').ShallowUnwrapRef<{
|
|
163
163
|
input: import('vue').ShallowRef<HTMLInputElement | undefined, HTMLInputElement | undefined>;
|
|
164
164
|
textarea: import('vue').ShallowRef<HTMLTextAreaElement | undefined, HTMLTextAreaElement | undefined>;
|
|
165
165
|
ref: import('vue').ComputedRef<HTMLInputElement | HTMLTextAreaElement | undefined>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ICase } from '../../../types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
/** 业务侧保存回调(编辑器 actions.saveCases),未配置时「数据库存储」不可用 */
|
|
4
|
+
saveCases?: (cases?: ICase[]) => void;
|
|
5
|
+
};
|
|
6
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {
|
|
7
|
+
showVisible: () => void;
|
|
8
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
9
|
+
export default _default;
|