From 891e5d3e022c751cbc10a2bf45d1df7fe2a4b570 Mon Sep 17 00:00:00 2001 From: zhangwenshuai Date: Tue, 22 Dec 2020 16:46:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=88=86=E7=BB=84=E6=97=B6?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/apolloTable/component/Cell.less | 8 ++++---- components/apolloTable/component/Cell.tsx | 20 +++++++++++--------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/components/apolloTable/component/Cell.less b/components/apolloTable/component/Cell.less index 2437257..7efd0c2 100644 --- a/components/apolloTable/component/Cell.less +++ b/components/apolloTable/component/Cell.less @@ -125,11 +125,11 @@ } .editCell { position: absolute; - z-index: 1; width: 100%; - height: 100%; - top: 0; - left: 0; + height: 40px; + z-index: 10; + //top: 0; + //left: 0; } .menuPop { width: 110px; diff --git a/components/apolloTable/component/Cell.tsx b/components/apolloTable/component/Cell.tsx index 3f6ef7b..0d4bb9c 100644 --- a/components/apolloTable/component/Cell.tsx +++ b/components/apolloTable/component/Cell.tsx @@ -236,8 +236,6 @@ const Cell = (props: CellProps) => { }; const transferColumn = transferAttr(columnType, newProps); - const style: any = {}; - const { dynamicCellConfigDTO } = columnData || {}; // 不可编辑状态(无编辑权限、列只读、行锁定、单元格只读) const disabled = @@ -284,7 +282,6 @@ const Cell = (props: CellProps) => { } } }} - style={style} >
{empty ? ( @@ -313,13 +310,13 @@ const Cell = (props: CellProps) => { trigger="contextMenu" placement="rightTop" content={ -
+
{contentMenu.map((item: any, i: number) => { return (
{item.label} @@ -352,8 +349,12 @@ const Cell = (props: CellProps) => { const newProps = { ...(transferColumn || {}), }; + const width = + columnIndex === 0 && position !== 'right' && record.groupLevel + ? `${cellStyle.width - record.groupLevel * 16 - 50}px` + : cellStyle.width; return ( -
+
{ rowId={record.id} cellRenderProps={cellRenderProps} style={{ - minHeight: cellStyle.height, + minHeight: 40, //cellStyle.height, borderRadius: 0, }} maxPopHeight={maxPopHeight} @@ -396,6 +397,8 @@ const Cell = (props: CellProps) => { ); }; const groupLevel = getGroupLevel(record.classList); + const paddingLeft = + columnIndex === 0 && position !== 'right' && record.groupLevel ? `${record.groupLevel * 16}px` : 0; return (
{ )} style={{ ...cellStyle, - paddingLeft: - columnIndex === 0 && position !== 'right' && record.groupLevel ? `${record.groupLevel * 16}px` : 0, + paddingLeft, paddingTop: `${groupLevel * 40}px`, }} onMouseEnter={onMouseEnter} -- 2.21.0