fix: view form linkages

This commit is contained in:
chenos 2021-03-28 21:01:22 +08:00
parent 25c1aa8825
commit 0900296ea3
3 changed files with 22 additions and 7 deletions

View File

@ -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 }}"
}
}
}
}
]
},
},
{

View File

@ -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' }}`
}
}),
],
},
{

View File

@ -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',
},