fix: view form linkages
This commit is contained in:
parent
25c1aa8825
commit
0900296ea3
@ -36,6 +36,19 @@ export default {
|
|||||||
labelField: 'title',
|
labelField: 'title',
|
||||||
valueField: 'id',
|
valueField: 'id',
|
||||||
},
|
},
|
||||||
|
"x-linkages": [
|
||||||
|
{
|
||||||
|
"type": "value:schema",
|
||||||
|
"target": "field",
|
||||||
|
"schema": {
|
||||||
|
"x-component-props": {
|
||||||
|
"filter": {
|
||||||
|
"collection_name": "{{ $self.value && $self.value.collection_name }}"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -50,11 +50,13 @@ export default {
|
|||||||
"target": "targetField",
|
"target": "targetField",
|
||||||
"condition": "{{ $self.value === 'association' }}"
|
"condition": "{{ $self.value === 'association' }}"
|
||||||
},
|
},
|
||||||
// {
|
...['form', 'descriptions', 'table', 'kanban', 'calendar'].map(type => {
|
||||||
// "type": "value:visible",
|
return {
|
||||||
// "target": "type",
|
"type": "value:visible",
|
||||||
// "condition": "{{ $self.value === 'collection' }}"
|
"target": `x-${type}-props.*`,
|
||||||
// },
|
"condition": `{{ $form.values.type === '${type}' && $self.value === 'collection' }}`
|
||||||
|
}
|
||||||
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
@ -38,7 +38,7 @@ export function getViewTypeLinkages() {
|
|||||||
xlinkages.push({
|
xlinkages.push({
|
||||||
"type": "value:visible",
|
"type": "value:visible",
|
||||||
"target": `x-${key}-props.*`,
|
"target": `x-${key}-props.*`,
|
||||||
"condition": `{{ $self.value === '${key}' }}`,
|
"condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`,
|
||||||
});
|
});
|
||||||
if (linkages.type) {
|
if (linkages.type) {
|
||||||
xlinkages.push(...linkages.type);
|
xlinkages.push(...linkages.type);
|
||||||
@ -55,7 +55,7 @@ export function getTypeFieldOptions() {
|
|||||||
title: '视图类型',
|
title: '视图类型',
|
||||||
required: true,
|
required: true,
|
||||||
dataSource: getOptions(),
|
dataSource: getOptions(),
|
||||||
createOnly: true,
|
createOnly: false,
|
||||||
component: {
|
component: {
|
||||||
type: 'select',
|
type: 'select',
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user