kailong321200875 / vue-element-plus-admin

A backend management system based on vue3, typescript, element-plus, and vite
https://element-plus-admin.cn/
MIT License
2.81k stars 682 forks source link

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

Closed lixindada closed 4 months ago

lixindada commented 5 months ago

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 }