Merge branch '20230420-详审配置评分项设置小数后左上角最高分显示错误' into 'release_20230512'
5.11 详审配置评分项设置小数后左上角最高分显示错误 See merge request eshop/fe_service_ebtp_frontend!238
This commit is contained in:
@ -17,7 +17,9 @@ export const checkUnEmp = (val: any) => {
|
|||||||
|
|
||||||
//计算一个table的最高分
|
//计算一个table的最高分
|
||||||
export const subCountScore = (subData: any) => {
|
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) {
|
export function chooseMany(data: any) {
|
||||||
let max = 0;
|
let max = 0;
|
||||||
|
const mul = 10 ^ 5;
|
||||||
if (data != undefined && data.length > 0) {
|
if (data != undefined && data.length > 0) {
|
||||||
max = data.reduce((preVal: any, item: any) => {
|
max = data.reduce((preVal: any, item: any) => {
|
||||||
if (item.standardDetailScore != '') {
|
if (item.standardDetailScore != '') {
|
||||||
return preVal + parseFloat(item.standardDetailScore)
|
return preVal + item.standardDetailScore * mul;
|
||||||
} else {
|
} else {
|
||||||
return preVal
|
return preVal
|
||||||
}
|
}
|
||||||
}, 0)
|
}, 0)
|
||||||
}
|
}
|
||||||
return max;
|
return Math.round(max) / mul;
|
||||||
}
|
}
|
||||||
//修改最大值
|
//修改最大值
|
||||||
export function changeHighScore(method: any, list: any) {
|
export function changeHighScore(method: any, list: any) {
|
||||||
|
Reference in New Issue
Block a user