Skip to content

Commit e23ef11

Browse files
committed
fix:修复node 节点列表label 精准搜索问题
1 parent 1404ba5 commit e23ef11

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

ui/src/utils/component.tsx

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,21 @@ export const getColumnSearchProps = ({
7676
<SearchOutlined style={{ color: filtered ? '#1677ff' : undefined }} />
7777
),
7878
onFilter: (value, record) => {
79-
const safeValue = value ? value.split(symbol)[0] : '';
80-
const realValue = trim(safeValue.toLowerCase());
79+
const allvalue1 = trim(
80+
(value ? value.split(symbol)[0] : '')?.toLowerCase(),
81+
);
82+
const allvalue2 = trim(
83+
(value ? value.split(symbol)[1] : '')?.toLowerCase(),
84+
);
8185

8286
return arraySearch
8387
? record[dataIndex] &&
84-
record[dataIndex].some(
88+
record[dataIndex]?.some(
8589
(item) =>
86-
(item.key && item.key.toLowerCase().includes(realValue)) ||
87-
(item.value && item.value.toLowerCase().includes(realValue)),
90+
item.key &&
91+
item.key.toLowerCase().includes(allvalue1) &&
92+
item.value &&
93+
item.value.toLowerCase().includes(allvalue2),
8894
)
8995
: record[dataIndex] &&
9096
record[dataIndex]

0 commit comments

Comments
 (0)