Преглед изворни кода

计量台账,清单、计量单元,复制粘贴后,表达式更新问题

MaiXinRong пре 4 година
родитељ
комит
9b3619e1a1
1 измењених фајлова са 13 додато и 2 уклоњено
  1. 13 2
      app/public/js/stage.js

+ 13 - 2
app/public/js/stage.js

@@ -972,7 +972,6 @@ $(document).ready(() => {
                                 } else if (colSetting.field === 'contract_tp') {
                                     if (!node.is_tp) continue;
                                 }
-                                
                                 if (node.children && node.children.length > 0) {
                                     continue;
                                 }
@@ -1090,8 +1089,12 @@ $(document).ready(() => {
                         } else {
                             if (col.type === 'Number') {
                                 const num = _.toNumber(text);
+                                data[col.field] = num;
+                                const exprInfo = getExprInfo(col.field);
+                                if (exprInfo) {
+                                    data[exprInfo.expr] = '';
+                                }
                                 if (_.isFinite(num)) {
-                                    data[col.field] = num;
                                     filter = false;
                                 } else {
                                     try {
@@ -1724,6 +1727,10 @@ $(document).ready(() => {
                                 const num = _.toNumber(newValue);
                                 if (num) {
                                     newData[colSetting.field] = num;
+                                    const exprInfo = getExprInfo(colSetting.field);
+                                    if (exprInfo) {
+                                        newData[exprInfo.expr] = '';
+                                    }
                                 } else {
                                     try {
                                         newData[colSetting.field] = math.evaluate(transExpr(newValue));
@@ -1759,6 +1766,10 @@ $(document).ready(() => {
                                     const num = _.toNumber(newValue);
                                     if (num) {
                                         newData[colSetting.field] = num;
+                                        const exprInfo = getExprInfo(colSetting.field);
+                                        if (exprInfo) {
+                                            newData[exprInfo.expr] = '';
+                                        }
                                     } else {
                                         try {
                                             newData[colSetting.field] = math.evaluate(transExpr(newValue));