refactor(selector): simplify presets with data-driven groups

This commit is contained in:
2026-02-24 20:28:03 +08:00
parent 5e665966db
commit f8eb2f6563
4 changed files with 118 additions and 92 deletions

View File

@@ -86,6 +86,8 @@ const filteredItems = (group: GroupConfig) => {
if (group.name !== 'ALL') {
if (group.filter) {
items = items.filter(group.filter)
} else if (!props.config.groupField) {
items = []
} else {
items = items.filter(item =>
item[props.config.groupField]?.toLowerCase() === group.name.toLowerCase()