fix: view form type field linkages

This commit is contained in:
chenos 2021-03-17 17:14:38 +08:00
parent e56d9b8573
commit 2e4bf25923
3 changed files with 23 additions and 17 deletions

View File

@ -60,11 +60,11 @@ export default {
"target": "targetField",
"condition": "{{ $self.value === 'association' }}"
},
{
"type": "value:visible",
"target": "type",
"condition": "{{ $self.value === 'collection' }}"
},
// {
// "type": "value:visible",
// "target": "type",
// "condition": "{{ $self.value === 'collection' }}"
// },
],
},
{

View File

@ -40,20 +40,9 @@ export function getViewTypeLinkages() {
"condition": `{{ $self.value === '${key}' }}`,
});
if (linkages.type) {
xlinkages = xlinkages.concat(linkages.type.map(linkage => {
if (properties[linkage.target]) {
linkage.condition = `{{ $self.value === '${key}' }}`;
linkage.target = `x-${key}-props.${linkage.target}`;
}
return linkage;
}));
xlinkages.push(...linkages.type);
}
}
// xlinkages.push({
// type: "value:visible",
// target: 'collection',
// condition: `{{ $self.value !== 'wysiwyg' }}`,
// });
return xlinkages;
}

View File

@ -260,5 +260,22 @@ export const wysiwyg = {
},
},
linkages: {
type: [
{
type: "value:visible",
target: 'collection',
condition: `{{ $self.value && $self.value !== 'wysiwyg' }}`,
},
{
type: "value:visible",
target: 'dataSourceType',
condition: `{{ $self.value && $self.value !== 'wysiwyg' }}`,
},
{
type: "value:visible",
target: 'targetField',
condition: `{{ $self.value && $self.value !== 'wysiwyg' }}`,
},
],
},
};