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", "target": "targetField",
"condition": "{{ $self.value === 'association' }}" "condition": "{{ $self.value === 'association' }}"
}, },
{ // {
"type": "value:visible", // "type": "value:visible",
"target": "type", // "target": "type",
"condition": "{{ $self.value === 'collection' }}" // "condition": "{{ $self.value === 'collection' }}"
}, // },
], ],
}, },
{ {

View File

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

View File

@ -260,5 +260,22 @@ export const wysiwyg = {
}, },
}, },
linkages: { 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' }}`,
},
],
}, },
}; };