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 = []; let xlinkages = [];
for (const [key, item] of views) { for (const [key, item] of views) {
const { linkages = {}, properties = {} } = _.cloneDeep(item); const { linkages = {}, properties = {} } = _.cloneDeep(item);
if (key === 'markdown') {
xlinkages.push({
"type": "value:visible",
"target": `x-${key}-props.*`,
"condition": `{{ $self.value === '${key}' }}`,
});
} else {
xlinkages.push({ xlinkages.push({
"type": "value:visible", "type": "value:visible",
"target": `x-${key}-props.*`, "target": `x-${key}-props.*`,
"condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`, "condition": `{{ $self.value === '${key}' && $form.values.dataSourceType === 'collection' }}`,
}); });
}
if (linkages.type) { if (linkages.type) {
xlinkages.push(...linkages.type); xlinkages.push(...linkages.type);
} }