diff --git a/src/utils/common/compUtils.ts b/src/utils/common/compUtils.ts index 1d41585f9d84d67b874c7cda5738718348313adc..edb3ed1f17d53fd52473b7484425921fbd4a2fe7 100644 --- a/src/utils/common/compUtils.ts +++ b/src/utils/common/compUtils.ts @@ -143,7 +143,10 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[ let totals: any = { _row: '合计', _index: '合计' }; fieldKeys.forEach((key) => { totals[key] = tableData.reduce((prev, next) => { - prev += next[key]; + const value = Number(next[key]); + if (!isNaN(value)) { + prev += value; + } return prev; }, 0); }); @@ -502,7 +505,7 @@ export function tenantSaasMessage(title){ let tenantId = getTenantId(); if(!tenantId){ Modal.confirm({ - title:title, + title: title, content: '此菜单需要在多租户模式下使用,否则数据会出现混乱', okText: '确认', okType: 'danger', @@ -510,4 +513,4 @@ export function tenantSaasMessage(title){ cancelButtonProps: { style: { display: 'none' } }, }) } -} \ No newline at end of file +}