From 96a9b272e055aa7c8fce10977ed57ec94b74ca03 Mon Sep 17 00:00:00 2001 From: lvxiaojiao Date: Tue, 13 Jun 2023 16:36:08 +0800 Subject: [PATCH] =?UTF-8?q?fix:input-table=E6=9E=84=E5=BB=BAdataschema?= =?UTF-8?q?=E6=8A=A5=E9=94=99=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/plugin/Form/InputTable.tsx | 32 +++++++++++++------ 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/packages/amis-editor/src/plugin/Form/InputTable.tsx b/packages/amis-editor/src/plugin/Form/InputTable.tsx index f819950c9..8402e4499 100644 --- a/packages/amis-editor/src/plugin/Form/InputTable.tsx +++ b/packages/amis-editor/src/plugin/Form/InputTable.tsx @@ -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 + }; } }