Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设置了showExpand参数 会把index在expandField之前不应该显示出来的field也显示出来了 #481

Closed
lixindada opened this issue May 31, 2024 · 0 comments

Comments

@lixindada
Copy link

lixindada commented May 31, 2024

fix: 之前这块其实并没有过滤掉search.hidden等于true的字段,导致设置了showExpand参数 会把index在expandField之前不应该显示出来的field也显示出来了
修改
useCrudSchemas.ts if (schemaItem.search?.hidden === true) { continue }
// 过滤 Search 结构
const filterSearchSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
const searchSchema: FormSchema[] = []
const length = crudSchema.length

for (let i = 0; i < length; i++) {
const schemaItem = crudSchema[i]
if (schemaItem.search?.hidden === true) {
continue
}

// 判断是否隐藏
const searchSchemaItem = {
component: schemaItem?.search?.component || 'Input',
...schemaItem.search,
field: schemaItem.field,
label: schemaItem.search?.label || schemaItem.label
}

searchSchema.push(searchSchemaItem)

}
return searchSchema
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant