From 7e1735afe489d57d451087ba8cab0c8f28c732cd Mon Sep 17 00:00:00 2001 From: xgq <503881523@qq.com> Date: Sat, 20 Apr 2024 14:52:58 +0000 Subject: [PATCH] =?UTF-8?q?update=20Resources/CellTypes/Table.ts.=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8DEL=E8=A1=A8=E6=A0=BC=EF=BC=8C=E5=88=97?= =?UTF-8?q?=E6=A0=BC=E5=BC=8F=E5=8C=96=E5=90=8E=E5=BC=80=E5=90=AF=E5=90=88?= =?UTF-8?q?=E8=AE=A1=E8=A1=8C=E4=B8=8D=E8=A1=8C=E5=B0=B1=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xgq <503881523@qq.com> --- Resources/CellTypes/Table.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Resources/CellTypes/Table.ts b/Resources/CellTypes/Table.ts index ebd244e..0f9ca4b 100644 --- a/Resources/CellTypes/Table.ts +++ b/Resources/CellTypes/Table.ts @@ -1,4 +1,4 @@ -/// +/// namespace ElementCellTypes { interface ITableCellTypeParam { ElTableName: string; @@ -287,9 +287,9 @@ height="100%" } else { const values: any[] = data.map(x => x[column.property]); const columnSetting = this.columns.find(x => x.label === column.label); - if (self.isEmpty(columnSetting?.formatStr) && values.every(x => typeof x === "number" || self.isEmpty(x))) { - const total = values.reduce((x, y) => self.isEmpty(y) ? x : x + y, 0); - summary[index] = (isNaN(total) || total === 0) ? null : total; + if (values.every(x => !isNaN(Number(x)) || self.isEmpty(x))) { + const total = values.reduce((x, y) => self.isEmpty(y) ? x : x + Number(y), 0); + summary[index] = (isNaN(total) || total === 0) ? null : Forguncy.FormatHelper.format(columnSetting?.formatStr, total).text; } } }); -- Gitee