diff --git a/packages/plugin-pages/src/collections/views_fields_v2.ts b/packages/plugin-pages/src/collections/views_fields_v2.ts index f66f4568c..17bc37afa 100644 --- a/packages/plugin-pages/src/collections/views_fields_v2.ts +++ b/packages/plugin-pages/src/collections/views_fields_v2.ts @@ -36,6 +36,19 @@ export default { labelField: 'title', valueField: 'id', }, + "x-linkages": [ + { + "type": "value:schema", + "target": "field", + "schema": { + "x-component-props": { + "filter": { + "collection_name": "{{ $self.value && $self.value.collection_name }}" + } + } + } + } + ] }, }, { diff --git a/packages/plugin-pages/src/collections/views_v2.ts b/packages/plugin-pages/src/collections/views_v2.ts index 7b4ae3591..f4d32104f 100644 --- a/packages/plugin-pages/src/collections/views_v2.ts +++ b/packages/plugin-pages/src/collections/views_v2.ts @@ -50,11 +50,13 @@ export default { "target": "targetField", "condition": "{{ $self.value === 'association' }}" }, - // { - // "type": "value:visible", - // "target": "type", - // "condition": "{{ $self.value === 'collection' }}" - // }, + ...['form', 'descriptions', 'table', 'kanban', 'calendar'].map(type => { + return { + "type": "value:visible", + "target": `x-${type}-props.*`, + "condition": `{{ $form.values.type === '${type}' && $self.value === 'collection' }}` + } + }), ], }, { diff --git a/packages/plugin-pages/src/views/index.ts b/packages/plugin-pages/src/views/index.ts index a442d434a..74c002a9b 100644 --- a/packages/plugin-pages/src/views/index.ts +++ b/packages/plugin-pages/src/views/index.ts @@ -38,7 +38,7 @@ export function getViewTypeLinkages() { xlinkages.push({ "type": "value:visible", "target": `x-${key}-props.*`, - "condition": `{{ $self.value === '${key}' }}`, + "condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`, }); if (linkages.type) { xlinkages.push(...linkages.type); @@ -55,7 +55,7 @@ export function getTypeFieldOptions() { title: '视图类型', required: true, dataSource: getOptions(), - createOnly: true, + createOnly: false, component: { type: 'select', },