调整目标是判断权重修改

This commit is contained in:
wulin 2021-03-02 17:00:10 +08:00
parent 374fc0420c
commit 9ff7f9024c

View File

@ -408,7 +408,7 @@ export default {
result += item.checkWeight
return result
}, 0).toFixed(5)
if (i.weight !== Number(res)) {
if (Math.round((res * 100) * 1000) / 1000 !== 100) {
this.$message.error(i.name + '维度内的权重和必须为100%')
_boolean = false
}
@ -416,6 +416,7 @@ export default {
if (!_boolean) {
return
}
i.weight = res
}
let res1 = await apiSaveDetail(this.obj)