From 56661815ec3e41ebf67ebbb8178d4c024b193ff0 Mon Sep 17 00:00:00 2001 From: JEECG <445654970@qq.com> Date: Mon, 24 Feb 2025 22:48:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90issues/7830=E3=80=91=E5=90=88=E8=AE=A1?= =?UTF-8?q?=E5=B0=8F=E6=95=B0=E8=AE=A1=E7=AE=97=E7=B2=BE=E5=BA=A6=20---?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jeecgboot-vue3/src/utils/common/compUtils.ts | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jeecgboot-vue3/src/utils/common/compUtils.ts b/jeecgboot-vue3/src/utils/common/compUtils.ts index 9a59edc5..f03b8078 100644 --- a/jeecgboot-vue3/src/utils/common/compUtils.ts +++ b/jeecgboot-vue3/src/utils/common/compUtils.ts @@ -6,6 +6,7 @@ import { reactive } from "vue"; import { getTenantId, getToken } from "/@/utils/auth"; import { useUserStoreWithOut } from "/@/store/modules/user"; import dayjs from 'dayjs'; +import Big from 'big.js'; import { Modal } from "ant-design-vue"; import { defHttp } from "@/utils/http/axios"; @@ -148,11 +149,16 @@ export function mapTableTotalSummary(tableData: Recordable[], fieldKeys: string[ // update-begin--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 const value = Number(next[key]); if (!Number.isNaN(value)) { - prev += value; + // update-begin--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 + prev = Big(prev).plus(value).toString(); + // update-end--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 } - // update-end--author:liaozhiyang---date:20240118---for:【QQYUN-7891】PR 合计工具方法,转换为Nuber类型再计算 + // update-end--author:liaozhiyang---date:20240118---for:【issues/7830】PR 合计工具方法,转换为Nuber类型再计算 return prev; }, 0); + // update-begin--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 + totals[key] = +totals[key]; + // update-end--author:liaozhiyang---date:20250224---for:【issues/7830】合计小数计算精度 }); return totals; }