Merge branch '20230420-详审配置评分项设置小数后左上角最高分显示错误' into 'release_20230512'

5.11 详审配置评分项设置小数后左上角最高分显示错误

See merge request eshop/fe_service_ebtp_frontend!238
This commit is contained in:
jl-zhoujl2
2023-05-11 02:10:02 +00:00

View File

@ -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) {