fix:复选框上下文单选情况

This commit is contained in:
lvxiaojiao 2023-08-09 19:56:50 +08:00
parent caae2e9271
commit 3c8a4e5181

View File

@ -249,33 +249,44 @@ export class CheckboxesControlPlugin extends BasePlugin {
originalValue: node.schema?.value // 记录原始值,循环引用检测需要
};
if (node.schema?.extractValue) {
if (node.schema?.joinValues === false) {
dataSchema = {
type: 'array',
title: node.schema?.label || node.schema?.name
};
} else if (node.schema?.joinValues === false) {
dataSchema = {
type: 'array',
...dataSchema,
type: 'object',
title: node.schema?.label || node.schema?.name,
items: {
type: 'object',
title: '成员',
properties: {
label: {
type: 'string',
title: '文本'
},
value: {
type,
title: '值'
}
properties: {
label: {
type: 'string',
title: '文本'
},
value: {
type,
title: '值'
}
},
originalValue: dataSchema.originalValue
}
};
}
if (node.schema?.multiple) {
if (node.schema?.extractValue) {
dataSchema = {
type: 'array',
title: node.schema?.label || node.schema?.name
};
} else if (node.schema?.joinValues === false) {
dataSchema = {
type: 'array',
title: node.schema?.label || node.schema?.name,
items: {
type: 'object',
title: '成员',
properties: dataSchema.properties
},
originalValue: dataSchema.originalValue
};
}
}
return dataSchema;
}
}