Explorar o código

feat: 表达式检查

zhangweicheng %!s(int64=4) %!d(string=hai) anos
pai
achega
a805f119b0
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      web/building_saas/main/js/views/quantity_edit_view.js

+ 2 - 0
web/building_saas/main/js/views/quantity_edit_view.js

@@ -143,6 +143,7 @@ let quantityEditObj = {
 
     },
     checkingAndUpdate(quantityEXP,node){
+        debugger
         let me = this;
        /* if(quantityEXP === node.data.quantityEXP){ //没有变化,不做任何操作
             projectObj.mainController.refreshTreeNode([node]);
@@ -197,6 +198,7 @@ let quantityEditObj = {
                 let exp = new Expression('');
                 exp.Expression(evalString);
                 value = Number(exp.Evaluate());
+                if(isNaN(value)) throw new Error("输入的表达式有误");
             }
             return value;
         }catch (error){