From 09132cf87b4acb5c285c6c4a03f6607610fce3f7 Mon Sep 17 00:00:00 2001 From: lys <971387674@qq.com> Date: Tue, 14 Oct 2025 17:25:59 +0800 Subject: [PATCH] =?UTF-8?q?feature/=E6=A0=B8=E7=AE=97=E8=A1=A8=E6=A0=BC?= =?UTF-8?q?=E5=8F=8C=E5=87=BB=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/calcTable/index.tsx | 94 ++++++++++++++++++----------------- 1 file changed, 49 insertions(+), 45 deletions(-) diff --git a/src/pages/calcTable/index.tsx b/src/pages/calcTable/index.tsx index b0cd6aa..b4931b4 100644 --- a/src/pages/calcTable/index.tsx +++ b/src/pages/calcTable/index.tsx @@ -97,49 +97,8 @@ const Index: FunctionComponent = (props) => { setSelectedRowKeys([...selectedRowKeys, ...rowKeys]); setTableScrollHeight(tableScrollHeight); setMzgOptPermission(mzgOptPermission); - setColumns([ - ...convertColumns(_.map(columns, (o) => ({ ...o, i18n: i18nRes }))), - { - title: i18nRes["操作"], - dataIndex: "operate", - fixed: "right", - width: optWidth || 120, - render: (__, record) => ( - - - {optWidth && ( - <> - - - - )} - {record?.lockTime && {record?.lockTime}} - - ) - } - ]); + setColumns(_.map(columns, (o) => ({ ...o, i18n: i18nRes }))); + setEditCell({}); } }; const convertColumns: any = (cols: any[]) => { @@ -353,6 +312,51 @@ const Index: FunctionComponent = (props) => { ); } }; + const cols = useMemo(() => { + return [ + ...convertColumns(columns), + { + title: i18n["操作"], + dataIndex: "operate", + fixed: "right", + width: optWidth || 120, + render: (__: any, record: any) => ( + + + {optWidth && ( + <> + + + + )} + {record?.lockTime && {record?.lockTime}} + + ) + } + ]; + }, [columns, editCell, i18n]); const components = { body: { row: EditableRow, @@ -373,7 +377,7 @@ const Index: FunctionComponent = (props) => { x: 1200, y: `calc(100vh - ${tableScrollHeight || (!showTotalCell ? 165 : 200)}px)` }} - columns={(!isDetailTable || showSee) && !mzgOptPermission ? columns : _.filter(columns, (o) => o.dataIndex !== "operate")} + columns={(!isDetailTable || showSee) && !mzgOptPermission ? cols : _.filter(cols, (o) => o.dataIndex !== "operate")} footer={() => (!isDetailTable ? : null)} pagination={ !_.isNil(pageInfo) @@ -392,7 +396,7 @@ const Index: FunctionComponent = (props) => { {i18n["总计"]} - + )