Selaa lähdekoodia

1.取消超高降效时,需要清空超高选项
2.计取超高降效只控制显示,不控制隐藏超高列

vian 5 vuotta sitten
vanhempi
commit
fadee2f6e4
1 muutettua tiedostoa jossa 24 lisäystä ja 3 poistoa
  1. 24 3
      web/building_saas/main/js/models/overHeight.js

+ 24 - 3
web/building_saas/main/js/models/overHeight.js

@@ -217,9 +217,12 @@ const OVER_HEIGHT = (() => {
     }
 
     // 超高降效列的控制,右键计取触发
-    function switchVisible() {
+    function switchVisible(visible) {
         const curVisible = colSettingObj.getVisible('overHeight');
-        colSettingObj.setVisible('overHeight', !curVisible);
+        if (curVisible === visible) {
+            return;
+        }
+        colSettingObj.setVisible('overHeight', visible);
         colSettingObj.updateColSetting(true);
     }
 
@@ -812,6 +815,7 @@ const OVER_HEIGHT = (() => {
         // 取消计取费用,只删除超高子目
         if (isCancelCalc) {
             postData.deleteData = getDeleteData();
+            postData.updateData = getUpdateData();
             return postData;
         }
         // 没有新的选项行为,获取当前项目的选项行为
@@ -1016,8 +1020,25 @@ const OVER_HEIGHT = (() => {
         TREE_SHEET_HELPER.massOperationSheet(sheet, func);
     }
 
+    // 请空所有清单和定额的超高文本
+    function clearOverHeightText() {
+        const sheet = projectObj.mainController.sheet;
+        const func = () => {
+            const nodes = projectObj.project.mainTree.items;
+            const overHeightCol = getOverHeightCol();
+            nodes.forEach((node, index) => {
+                if (node.data.overHeight) {
+                    sheet.setText(index, overHeightCol, '');
+                }
+            });
+        };
+        TREE_SHEET_HELPER.massOperationSheet(sheet, func);
+    }
+
     // 取消超高降效,删除所有超高子目
     function cancelCalc() {
+        switchVisible(false);
+        clearOverHeightText();
         handleConfirmed(true);
     }
 
@@ -1094,7 +1115,7 @@ const OVER_HEIGHT = (() => {
             return;
         }
         // 存在不同,重算
-       await handleConfirmed();
+        await handleConfirmed();
     }
 
     // 事件监听