Przeglądaj źródła

1.修复拖动调整行高的bug
2.修复公共header的显示bug

olym 7 lat temu
rodzic
commit
1c655a4339

+ 6 - 4
web/building_saas/main/js/main.js

@@ -7,7 +7,7 @@ $(function () {
     loadSize("main", function() {
         refreshSubSpread();
     });
-
+    $("#header-menu").removeAttr('style');
     projectInfoObj.showProjectInfo();
     projectObj.checkMainSpread();
     projectObj.loadProjectData();
@@ -79,12 +79,12 @@ function slideResize(rootElement, callback) {
             // 判断拖动范围不能超出
             topChangeHeight = topContentHeight + moveHeight;
             topChangeHeight = topChangeHeight < 170 ? 170 : topChangeHeight;
-            topChangeHeight = topChangeHeight > 700 ? 700 : topChangeHeight;
+            topChangeHeight = topChangeHeight > 700 ? 709 : topChangeHeight;
             topContentEle.children(".main-data-top").height(topChangeHeight);
 
             bottomChangeHeight = bottomContentHeight - moveHeight;
             bottomChangeHeight = bottomChangeHeight < 170 ? 170 : bottomChangeHeight;
-            bottomChangeHeight = bottomChangeHeight > 700 ? 700 : bottomChangeHeight;
+            bottomChangeHeight = bottomChangeHeight > 700 ? 709 : bottomChangeHeight;
             bottomContentEle.children().find(".main-data-bottom").height(bottomChangeHeight - navHeight);
         }
     });
@@ -96,6 +96,8 @@ function slideResize(rootElement, callback) {
             drag = false;
             // 存入本地缓存
             const id = rootElement.attr('id');
+            topChangeHeight = topChangeHeight >= 700 ? 709 : topChangeHeight;
+            bottomChangeHeight = bottomChangeHeight >= 700 ? 709 : bottomChangeHeight;
             setLocalCache('topHeight:' + id, topChangeHeight);
             setLocalCache('bottomHeight:' + id, bottomChangeHeight);
         }
@@ -123,6 +125,6 @@ function loadSize(tag, callback) {
     bottomHeight = parseFloat(bottomHeight);
     $("#"+ tag +" .main-data-top").height(topHeight);
     $("#"+ tag +" .main-data-bottom").height(bottomHeight - navHeight);
-    $("#"+ tag +" .bottom-content").height(bottomHeight);
+    // $("#"+ tag +" .bottom-content").height(bottomHeight);
     callback();
 }

+ 2 - 1
web/building_saas/main/js/models/project.js

@@ -142,7 +142,8 @@ var PROJECT = {
                     newNode.source = br[i];
                     newNode.sourceType = that.Ration.getSourceType();
                     newNode.data = br[i];
-                    if(projectInfoObj.projectInfo.property.displaySetting.disPlayMainMateria==true){
+                    if(projectInfoObj.projectInfo.property.displaySetting !== undefined &&
+                        projectInfoObj.projectInfo.property.displaySetting.disPlayMainMateria==true){
                         loadRationGLJNode(newNode);
                     }
                 }

+ 2 - 1
web/building_saas/main/js/views/project_view.js

@@ -389,7 +389,8 @@ var projectObj = {
                 that.project.projSetting.mainGridSetting = JSON.parse(str);
                 that.project.projSetting.mainGridSetting.frozenCols = 4;
                 TREE_SHEET_HELPER.initSetting($('#billsSpread')[0], that.project.projSetting.mainGridSetting);
-                const autoHeight = that.project.property.displaySetting.autoHeight;
+                const autoHeight = that.project.property.displaySetting !== undefined ?
+                    that.project.property.displaySetting.autoHeight : false;
                 that.project.projSetting.mainGridSetting.cols.forEach(function (col) {
                     // for test.  后端没有绑定,暂时写死用于测试。
 /*                    if (col.data.field == '' && col.head.titleNames[0] == "取费专业") {

+ 12 - 0
web/building_saas/main/js/views/sub_view.js

@@ -115,7 +115,11 @@ $("#linkTZJNR").click(function () {
 });
 
 // 应用到选中清单
+let isSaving = false;
 $("#use-to-current").click(function() {
+    if (isSaving) {
+        return false;
+    }
     // 添加位置
     const position = $("#add-position").val();
     // 添加内容
@@ -134,8 +138,16 @@ $("#use-to-current").click(function() {
         position,
         displayFormat,
     };
+    isSaving = true;
+    const self = $(this);
+    self.attr('disabled', 'disabled');
     let selectedNode = projectObj.mainController.tree.selected;
     pageCCOprObj.setCharacterBySetting(selectedNode, setting);
+    // 防止连续点击1秒后才能再次发起请求
+    setTimeout(function() {
+        isSaving = false;
+        self.removeAttr('disabled');
+    }, 1000);
 });
 // 添加位置选择
 $("#add-position").change(function() {

+ 0 - 3
web/building_saas/pm/html/project-management.html

@@ -26,9 +26,6 @@
         #summary-engineering,#summary-project{
             display: none;
         }
-        #header-menu{
-            display: none;
-        }
     </style>
 </head>
 

+ 1 - 1
web/common/html/header.html

@@ -1,6 +1,6 @@
 <nav class="navbar navbar-expand-lg p-0 d-flex">
     <a class="header-logo px-2" href="/pm" style="text-decoration: none;">纵横云造价</a>
-    <ul class="nav navbar-nav px-1" id="header-menu">
+    <ul class="nav navbar-nav px-1" id="header-menu" style="display: none;">
         <li class="nav-item">
             <a class="nav-link" href="#" aria-expanded="false" data-toggle="modal" data-target="#poj-set"><i class="fa fa-cube"></i> 项目属性</a>
         </li>