提交测试,解决判断总权重100%的问题

This commit is contained in:
wulin 2021-03-02 16:05:02 +08:00
parent 55941f567a
commit 374fc0420c

View File

@ -395,7 +395,7 @@ export default {
weight += j.checkWeight weight += j.checkWeight
}) })
}) })
if (weight !== 1) { if (Math.round((weight * 100) * 1000) / 1000 !== 100) {
const noWeightArr = arr.filter(i => i.weight === null) const noWeightArr = arr.filter(i => i.weight === null)
let str = noWeightArr.map(i => i.name).join(',') let str = noWeightArr.map(i => i.name).join(',')
this.$message.error(str + '维度内的权重和必须为100%') this.$message.error(str + '维度内的权重和必须为100%')