From 0413ff184f2555dcf301dc056a413d7352f8d9fb Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Mon, 13 Jul 2020 16:37:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=8F=96config=E7=9A=84setFormat?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/apolloTable/component/Cell.tsx | 9 +++++++++ .../apolloTable/component/base/detail/input/index.less | 1 + .../apolloTable/component/base/detail/tag/index.tsx | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx index 09b4fc7..58c60b4 100644 --- a/components/apolloTable/component/Cell.tsx +++ b/components/apolloTable/component/Cell.tsx @@ -191,6 +191,15 @@ const Cell = (props: CellProps) => { let detailConfig; if (typeof renderDetailCell === 'function') { detailConfig = renderDetailCell({ cellData, rowData: record, columnConfig }); + const defaultConfig = config[String(columnType)]; + if (defaultConfig) { + if (defaultConfig.getFormatter && !detailConfig.getFormatter) { + detailConfig.getFormatter = defaultConfig.getFormatter; + } + if (defaultConfig.setFormatter && !detailConfig.setFormatter) { + detailConfig.setFormatter = defaultConfig.setFormatter; + } + } empty = false; } else { detailConfig = config[String(columnType)] || config['1']; diff --git a/components/apolloTable/component/base/detail/input/index.less b/components/apolloTable/component/base/detail/input/index.less index 0e181bf..67ea8fa 100644 --- a/components/apolloTable/component/base/detail/input/index.less +++ b/components/apolloTable/component/base/detail/input/index.less @@ -6,6 +6,7 @@ width: 100%; height: 100%; align-items: center; + overflow: hidden; .itemBgTxt { position: absolute; z-index: -1; diff --git a/components/apolloTable/component/base/detail/tag/index.tsx b/components/apolloTable/component/base/detail/tag/index.tsx index 7e0739c..7bc7294 100644 --- a/components/apolloTable/component/base/detail/tag/index.tsx +++ b/components/apolloTable/component/base/detail/tag/index.tsx @@ -29,7 +29,7 @@ export const Tags = (props: any) => { if (mode !== 'multiple') { // 单选 return ( -
+
{value[0].text}
-- 2.21.0