Archived
契约:launchOption 加 group/groupLabel(x-options.group 从字典表现读人读名)、 launchParam 加 linkGroup(x-link 结组);api-report 已随 --update 入库。 前端 launch-link.ts 纯函数管三条口径:锚摆全量、其余按锚的分组键收窄 (未标类型殿后一组,新增照走);锚粘着 —— 清空只解除收窄不换锚,人改得了主意。 服务端不据此立墙:combo 本就收候选之外的值,类型一致归 S1 收步判据 sub_eval_part_distinct_chip_type_id = 1(数得出来的门)。 W05 清单两格挂上 x-link: chip-type;文档同步。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LKMZDwMbyKzjw6Hembwvet
This commit is contained in:
@@ -174,7 +174,12 @@ export const LAUNCH_PARAM_TYPES = ['text', 'textarea', 'select', 'combo', 'list'
|
||||
export const launchParamTypeSchema = z.enum(LAUNCH_PARAM_TYPES);
|
||||
export type LaunchParamType = z.infer<typeof launchParamTypeSchema>;
|
||||
|
||||
export const launchOptionSchema = z.object({ value: z.string(), label: z.string() });
|
||||
/**
|
||||
* 一条候选。`group` 是**联动分组键**(2026-08-31 用户定):清单 `x-options.group` 指了哪一列,
|
||||
* 这颗候选就带上它在那一列的值(如料号的 `chip_type_id`);空串 = 那一列没值(「未标类型」)。
|
||||
* `groupLabel` 是这枚键的人读名(从字典表现读,如「DC-DC 降压稳压器」),读不到就没有 —— 界面退回摆键本身。
|
||||
*/
|
||||
export const launchOptionSchema = z.object({ value: z.string(), label: z.string(), group: z.string().optional(), groupLabel: z.string().optional() });
|
||||
export type LaunchOption = z.infer<typeof launchOptionSchema>;
|
||||
|
||||
export const launchParamSchema = z.object({
|
||||
@@ -188,6 +193,13 @@ export const launchParamSchema = z.object({
|
||||
/** select / combo 的候选;combo 提交候选之外的值也合法 */
|
||||
options: z.array(launchOptionSchema).optional(),
|
||||
default: z.union([z.string(), z.array(z.string())]).optional(),
|
||||
/**
|
||||
* 联动组名(清单 `x-link`)—— 同一组的几格按候选的 `group` 互相收窄:
|
||||
* 组内**第一个填上值的那格是锚**,锚自己永远摆全量候选,其余格只摆与锚同 `group` 的候选
|
||||
* (外加没有 `group` 的那些,单独一组殿后)+「新增」这条路;锚清空或改成新增即解除。
|
||||
* 服务端**不据此立墙** —— combo 本就收候选之外的值,类型一致性归活动自己的收步判据管。
|
||||
*/
|
||||
linkGroup: z.string().optional(),
|
||||
});
|
||||
export type LaunchParam = z.infer<typeof launchParamSchema>;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user