From 4d530af87532d4276514d8e4ea0bb4abf31b3ae9 Mon Sep 17 00:00:00 2001 From: jl-zhoujl2 Date: Thu, 20 Apr 2023 13:50:38 +0800 Subject: [PATCH] =?UTF-8?q?4.20=20=E4=BF=AE=E5=A4=8D=E8=AF=A6=E5=AE=A1?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E7=B4=AF=E5=8A=A0=E6=B5=AE=E7=82=B9=E6=95=B0?= =?UTF-8?q?=E7=B2=BE=E5=BA=A6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Bid/ReviewConfig/Config/components/commonFunc.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts b/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts index c11e36a..28e15e8 100644 --- a/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts +++ b/src/pages/Bid/ReviewConfig/Config/components/commonFunc.ts @@ -17,7 +17,9 @@ export const checkUnEmp = (val: any) => { //计算一个table的最高分 export const subCountScore = (subData: any) => { - return subData?.detailList?.reduce((preValue: any, item: any) => { return preValue + parseFloat(item.highScore) }, 0) + const mul = 10 ^ 5; + const sum = subData?.detailList?.reduce((preValue: any, item: any) => { return preValue + item.highScore * mul }, 0); + return Math.round(sum) / mul; } //单选取最大 @@ -33,16 +35,17 @@ export function chooseOne(data: any) { //多选加和 export function chooseMany(data: any) { let max = 0; + const mul = 10 ^ 5; if (data != undefined && data.length > 0) { max = data.reduce((preVal: any, item: any) => { if (item.standardDetailScore != '') { - return preVal + parseFloat(item.standardDetailScore) + return preVal + item.standardDetailScore * mul; } else { return preVal } }, 0) } - return max; + return Math.round(max) / mul; } //修改最大值 export function changeHighScore(method: any, list: any) {