fix: 修复表格与搜索框字段不能不一致的问题

This commit is contained in:
SOWhat 2023-03-28 10:11:39 +08:00
parent cbf0d16547
commit 5c1cd298de
1 changed files with 3 additions and 1 deletions

View File

@ -23,6 +23,8 @@ type CrudSearchParams = {
dictName?: string dictName?: string
// 接口 // 接口
api?: () => Promise<any> api?: () => Promise<any>
// 搜索字段
field?: string
} & Omit<FormSchema, 'field'> } & Omit<FormSchema, 'field'>
type CrudTableParams = { type CrudTableParams = {
@ -101,7 +103,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F
component: schemaItem.search.component || 'Input', component: schemaItem.search.component || 'Input',
componentProps: {}, componentProps: {},
...schemaItem.search, ...schemaItem.search,
field: schemaItem.field, field: schemaItem?.search?.field || schemaItem.field,
label: schemaItem.search?.label || schemaItem.label label: schemaItem.search?.label || schemaItem.label
} }