refactor: nanoid &uuid autoFill (#3955)

This commit is contained in:
katherinehhh 2024-04-07 13:55:21 +08:00 committed by GitHub
parent dfcf7671d3
commit e81cfcbe98
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View File

@ -85,6 +85,7 @@ export const autoFill = {
'x-content': '{{t("Automatically generate default values")}}', 'x-content': '{{t("Automatically generate default values")}}',
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Checkbox', 'x-component': 'Checkbox',
default: true,
}; };
export const relationshipType: ISchema = { export const relationshipType: ISchema = {

View File

@ -87,7 +87,10 @@ const getSchema = ({
return useRequest( return useRequest(
() => () =>
Promise.resolve({ Promise.resolve({
data: cloneDeep(omit(schema.default, ['uiSchema.rawTitle'])), data: {
...cloneDeep(omit(schema.default, ['uiSchema.rawTitle'])),
autoFill: schema.default?.autoFill !== false,
},
}), }),
options, options,
); );