Selaa lähdekoodia

修复科学计算bug

laiguoran 2 vuotta sitten
vanhempi
commit
bdcab0effe
1 muutettua tiedostoa jossa 1 lisäystä ja 1 poistoa
  1. 1 1
      app/public/js/material_exponent.js

+ 1 - 1
app/public/js/material_exponent.js

@@ -191,7 +191,7 @@ $(document).ready(() => {
                         validText = ZhCalc.round(num, 3);
                         num = ZhCalc.round(num, 3);
                     }
-                    const total_weight = ZhCalc.add(ZhCalc.sub(_.sumBy(materialExponentData, 'weight_num'), parseFloat(orgValue)), num);
+                    const total_weight = ZhCalc.add(ZhCalc.sub(ZhCalc.sum(_.map(materialExponentData, 'weight_num')), parseFloat(orgValue)), num);
                     if (total_weight > 1) {
                         toastr.error('加权系数总和不能大于1');
                         SpreadJsObj.reLoadRowData(info.sheet, info.row);