refactor: external data source view collection createMainOnly (#4287)

This commit is contained in:
katherinehhh 2024-05-08 14:47:37 +08:00 committed by GitHub
parent 040d79747c
commit f1923d25cd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View File

@ -38,6 +38,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
'x-component': 'Select', 'x-component': 'Select',
'x-reactions': ['{{useAsyncDataSource(loadDBViews)}}'], 'x-reactions': ['{{useAsyncDataSource(loadDBViews)}}'],
'x-disabled': '{{ !createOnly }}', 'x-disabled': '{{ !createOnly }}',
'x-visible': '{{!createMainOnly}}',
}, },
name: { name: {
type: 'string', type: 'string',
@ -106,6 +107,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
'x-decorator': 'FormItem', 'x-decorator': 'FormItem',
'x-component': 'Checkbox', 'x-component': 'Checkbox',
default: false, default: false,
'x-visible': '{{!createMainOnly}}',
}, },
sources: { sources: {
type: 'array', type: 'array',
@ -117,6 +119,7 @@ export class ViewCollectionTemplate extends CollectionTemplate {
}, },
'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'], 'x-reactions': ['{{useAsyncDataSource(loadCollections)}}'],
'x-disabled': true, 'x-disabled': true,
'x-visible': '{{!createMainOnly}}',
}, },
fields: { fields: {
type: 'array', type: 'array',

View File

@ -211,6 +211,7 @@ const EditCollectionAction = (props) => {
createOnly: false, createOnly: false,
filterTargetKeyOptions, filterTargetKeyOptions,
isView: record.view, isView: record.view,
createMainOnly: true,
...scope, ...scope,
}} }}
/> />