fix: view type linkages

This commit is contained in:
chenos 2021-03-29 13:06:14 +08:00
parent 09f2d5d2f2
commit 797a5ef9e8

View File

@ -35,11 +35,19 @@ export function getViewTypeLinkages() {
let xlinkages = [];
for (const [key, item] of views) {
const { linkages = {}, properties = {} } = _.cloneDeep(item);
xlinkages.push({
"type": "value:visible",
"target": `x-${key}-props.*`,
"condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`,
});
if (key === 'markdown') {
xlinkages.push({
"type": "value:visible",
"target": `x-${key}-props.*`,
"condition": `{{ $self.value === '${key}' }}`,
});
} else {
xlinkages.push({
"type": "value:visible",
"target": `x-${key}-props.*`,
"condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`,
});
}
if (linkages.type) {
xlinkages.push(...linkages.type);
}