From a76ae4096873ce77c5d3dbb676d5042fbcc38da4 Mon Sep 17 00:00:00 2001 From: Katherine Date: Wed, 23 Apr 2025 22:06:16 +0800 Subject: [PATCH] fix: display issue with linkage rules in multi-level association data (#6755) --- .../src/schema-component/antd/linkageFilter/useValues.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts b/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts index 54b87eb91d..2f365fbadb 100644 --- a/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts +++ b/packages/core/client/src/schema-component/antd/linkageFilter/useValues.ts @@ -36,16 +36,15 @@ const findOption = (str, options) => { const [firstKey, ...subKeys] = match[1].split('.'); // 拆分层级 const keys = [`$${firstKey}`, ...subKeys]; // 第一层保留 `$`,后续不带 `$` - let currentOptions = options; let option = null; for (const key of keys) { - option = currentOptions.find((opt) => opt.value === key); + option = currentOptions.find((opt) => opt.value === key || opt.name === key); if (!option) return null; // 进入下一层 children 查找 if (Array.isArray(option.children) || option.isLeaf === false) { - currentOptions = option.children; + currentOptions = option.children || option.field.children; } else { return option; // 没有 children 直接返回 }