Merge pull request #7156 from hsm-lv/fix-inputtable

fix:input-table构建dataschema报错问题
This commit is contained in:
hsm-lv 2023-06-13 16:40:56 +08:00 committed by GitHub
commit 463c53d855
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1039,16 +1039,28 @@ export class TableControlPlugin extends BasePlugin {
const columns: EditorNodeType = node.children.find(
item => item.isRegion && item.region === 'columns'
);
for (let current of columns?.children) {
const schema = current.schema;
if (schema.name) {
itemsSchema.properties[schema.name] = current.info?.plugin
?.buildDataSchemas
? await current.info.plugin.buildDataSchemas(current, region)
: {
type: 'string',
title: schema.label || schema.name
};
// todo以下的处理无效需要cell实现才能深层细化
// for (let current of columns?.children) {
// const schema = current.schema;
// if (schema.name) {
// itemsSchema.properties[schema.name] = current.info?.plugin
// ?.buildDataSchemas
// ? await current.info.plugin.buildDataSchemas(current, region)
// : {
// type: 'string',
// title: schema.label || schema.name
// };
// }
// }
// 一期先简单处理上面todo实现之后这里可以废弃
for (let current of node.schema?.columns) {
if (current.name) {
itemsSchema.properties[current.name] = {
type: 'string',
title: current.label || current.name
};
}
}