Skip to content

Commit

Permalink
perf: useCrudSchemas cutom label
Browse files Browse the repository at this point in the history
  • Loading branch information
kailong321200875 committed Jul 1, 2022
1 parent 9a3b617 commit 7864d83
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/hooks/web/useCrudSchemas.ts
Expand Up @@ -95,7 +95,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F
componentProps: {},
...schemaItem.search,
field: schemaItem.field,
label: schemaItem.label
label: schemaItem.search?.label || schemaItem.label
}

if (searchSchemaItem.dictName) {
Expand All @@ -111,7 +111,7 @@ const filterSearchSchema = (crudSchema: CrudSchema[], allSchemas: AllSchemas): F
})
if (index !== -1) {
allSchemas.searchSchema[index]!.componentProps!.options = filterOptions(
res.data,
res,
searchSchemaItem.componentProps.optionsAlias?.labelField
)
}
Expand Down Expand Up @@ -168,7 +168,7 @@ const filterFormSchema = (crudSchema: CrudSchema[]): FormSchema[] => {
component: (schemaItem.form && schemaItem.form.component) || 'Input',
...schemaItem.form,
field: schemaItem.field,
label: schemaItem.label
label: schemaItem.form?.label || schemaItem.label
}

// 删除不必要的字段
Expand All @@ -191,7 +191,7 @@ const filterDescriptionsSchema = (crudSchema: CrudSchema[]): DescriptionsSchema[
const descriptionsSchemaItem = {
...schemaItem.detail,
field: schemaItem.field,
label: schemaItem.label
label: schemaItem.detail?.label || schemaItem.label
}

// 删除不必要的字段
Expand Down

0 comments on commit 7864d83

Please sign in to comment.