Browse Source

特征及内容排版规则

zhongzewei 6 years ago
parent
commit
03f0f7900a

+ 1 - 1
web/building_saas/js/global.js

@@ -31,7 +31,7 @@ function autoFlashHeight(){
     $(".share-list").height($(window).height()-headerHeight-toolsbarHeight-40);
     $(".form-view").height($(window).height()-headerHeight-ftoolsbarHeight);
     $(".form-list").height($(window).height()-headerHeight-50 );
-
+    typeof(adaptiveTzjnrWidth)== 'function' ?adaptiveTzjnrWidth():''
 };
 
 

+ 11 - 7
web/building_saas/main/html/main.html

@@ -168,9 +168,9 @@
                                       <div class="main-data-bottom ovf-hidden" style="display: none" id="comments">
                                           <textarea class="form-control" rows="8" readonly=""></textarea>
                                       </div>
-                                      <div id="tzjnrCon" class="container-fluid main-data-bottom" style="background: #F1F1F1">
+                                      <div id="tzjnrCon" class="container-fluid main-data-bottom" style="background: #F1F1F1; overflow: hidden">
                                           <div class="row" style="overflow: hidden">
-                                              <div class="col-4 p-0">
+                                              <div class="p-0" id="jobDiv" style="position:relative">
                                                   <div class="main-data-bottom ovf-hidden" id="jobSpread">
                                                   </div>
                                                   <!--工具栏-->
@@ -182,7 +182,7 @@
                                                       <a href="javascript:void(0);" id="jobUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
                                                   </div>
                                               </div>
-                                              <div class="col-4 p-0">
+                                              <div class="p-0" id="itemDiv" style="position:relative">
                                                   <div class="main-data-bottom ovf-hidden"  id="itemSpread">
                                                   </div>
                                                   <!--工具栏-->
@@ -194,15 +194,19 @@
                                                       <a href="javascript:void(0);" id="itemUp" class="btn btn-sm disabled" data-toggle="tooltip" data-placement="bottom" title="" data-original-title="上移"><i class="fa fa-arrow-up" aria-hidden="true"></i></a>
                                                   </div>
                                               </div>
-                                              <!-- <div class="col-auto p-0">
+                                               <div class="p-0" id="openTypeSetting" >
                                                    <div class="tn-nav d-flex align-items-start flex-column" data-toggle="tooltip" data-placement="left" title="" data-original-title="打开排版规则">
                                                        <span class="mt-3 ml-2 text-primary">排版规则</span>
                                                        <i class="fa fa-arrow-left mt-auto mb-3 text-primary ml-2"></i>
                                                    </div>
-                                               </div>-->
-                                              <div class="col-4 p-0">
+                                               </div>
+                                              <div class="p-0">
                                                   <div class="main-data-bottom" id="add-rule" style="display: none;">
                                                       <div class="container-fluid my-2">
+                                                          <div class="mb-1 row" style="text-align: center">
+                                                              <label class="col-5 px-0 col-form-label text-right">排版规则</label>
+                                                              <a id="closeTypeSetting" data-toggle="tooltip" data-placement="top" data-original-title="关闭排版规则" class="col-7 px-0 col-form-label" href="javascript:void(0);"><i class="fa fa-arrow-right"></i></a>
+                                                          </div>
                                                           <p style="text-align: center">
                                                               <% if (projectData.property.lockBills == true) { %>
                                                               <button class="btn btn-primary btn-sm disabled" type="button" id="use-to-current">应用到选中清单</button>
@@ -737,7 +741,7 @@
                     </div>
                 </div>
                 <div class="modal-footer">
-                    <a href="javascript:void(0);" class="btn btn-primary" id="property_default" data-dismiss="modal">恢复默认系统设置</a>
+                    <a href="javascript:void(0);" class="btn btn-primary" id="property_default" data-dismiss="modal" style="margin-right: 485px">恢复默认系统设置</a>
                     <a href="javascript:void(0);" class="btn btn-primary" id="property_ok" data-dismiss="modal">确定</a>
                     <button type="button" class="btn btn-secondary" data-dismiss="modal">取消</button>
                 </div>

+ 1 - 0
web/building_saas/main/js/main.js

@@ -97,6 +97,7 @@ function slideResize(eles, limit, type, callback) {
 
     // 鼠标点下时
     resizeElement.mousedown(function(e) {
+        mouseMoveCount = 0;
         drag = true;
         startP = type === 'height' ? e.clientY : e.clientX;
         // 获取左(上)部分的宽度(高度)

+ 7 - 6
web/building_saas/main/js/views/character_content_view.js

@@ -28,7 +28,7 @@ let contentOprObj = {
     },
     setRateWith: function (workBookWidth) {
         let me = this;
-        let otherWidthRate = me.setting.header[1]['headerWidth'] / workBookWidth;
+        let otherWidthRate = scMathUtil.roundTo(me.setting.header[1]['headerWidth'] / workBookWidth, -3);
         let contentWidthRate = 1 - otherWidthRate;
         me.setting.header[0]['rateWidth'] = contentWidthRate;
     },
@@ -1475,13 +1475,14 @@ let pageCCOprObj = {
     },
     resizeWidth: function () {
         let workBookWidth = pageCCOprObj.getWorkBookWidth();
-        contentOprObj.setRateWith(workBookWidth);
-        sheetCommonObj.setColumnWidthByRate(workBookWidth, contentOprObj.workBook, contentOprObj.setting.header);
-        characterOprObj.setRateWith(workBookWidth);
-        sheetCommonObj.setColumnWidthByRate(workBookWidth, characterOprObj.workBook, characterOprObj.setting.header);
+        contentOprObj.setRateWith($('#jobDiv').width() - 40);
+        sheetCommonObj.setColumnWidthByRate($('#jobDiv').width() - 40, contentOprObj.workBook, contentOprObj.setting.header);
+        characterOprObj.setRateWith($('#itemDiv').width() - 40);
+        sheetCommonObj.setColumnWidthByRate($('#itemDiv').width() - 40, characterOprObj.workBook, characterOprObj.setting.header);
     }
 }
 
+/*
 $(window).resize(function () {
     pageCCOprObj.resizeWidth();
-});
+});*/

+ 7 - 14
web/building_saas/main/js/views/main_tree_col.js

@@ -481,10 +481,13 @@ let colSettingObj = {
                 switchTznrHtml(false);
             }
         }
-        projectObj.project.pushNow('editColSetting', projectObj.project.projSetting.moduleName, {
-            projectID: projectObj.project.ID(),
-            main_tree_col: projectObj.project.projSetting.main_tree_col
-        });
+        //别人分享过来的项目,打开时,“显示特征”按钮应有效,不影响数据的修改
+        if(!projectReadOnly){
+            projectObj.project.pushNow('editColSetting', projectObj.project.projSetting.moduleName, {
+                projectID: projectObj.project.ID(),
+                main_tree_col: projectObj.project.projSetting.main_tree_col
+            });
+        }
     },
     setVisible: function (field, visible) {
         let mainTreeCols = projectObj.project.projSetting.main_tree_col.cols;
@@ -530,26 +533,16 @@ let colSettingObj = {
 };
 
 function switchTznrHtml(show) {
-    if(projectReadOnly){
-        return;
-    }
     if(show){
-        /*$('#switchTznr').attr('data-original-title', '显示特征');
-        $('#switchTznr').find('i').removeClass('fa-eye-slash');
-        $('#switchTznr').find('i').addClass('fa-eye');*/
         $('#switchTznr').html('<i class="fa fa-eye" aria-hidden="true"></i> 显示特征');
     }
     else {
-       /* $('#switchTznr').attr('data-original-title', '隐藏特征');
-        $('#switchTznr').find('i').removeClass('fa-eye');
-        $('#switchTznr').find('i').addClass('fa-eye-slash');*/
         $('#switchTznr').html('<i class="fa fa-eye-slash" aria-hidden="true"></i> 隐藏特征');
     }
 }
 
 $('#switchTznr').click(function () {
     let me = colSettingObj;
-    //let cur = $(this).attr('data-original-title');
     let cur = $(this).text();
     if(cur.includes('显示特征')){
         switchTznrHtml(false);

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

@@ -2777,7 +2777,7 @@ function disableTools(){
     $('#upMove').addClass('disabled');
     $('#downMove').addClass('disabled');
     $('#ZLFB_btn').addClass('disabled');
-    $('#switchTznr').addClass('disabled');
+    //$('#switchTznr').addClass('disabled');
     $('#uploadLj').addClass('disabled');
     $('#uploadGld').addClass('disabled');
     $('a[name="lockBills"]').addClass('disabled');
@@ -2790,6 +2790,8 @@ function disableTools(){
     //呈现选项
     $('#display-setting').find('input').prop('disabled', 'disabled');
     $('#recColSetting').remove();
+    //项目属性恢复默认系统设置
+    $('#property_default').addClass('disabled');
     //项目属性确定
     $('#property_ok').addClass('disabled');
     //特征及内容

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

@@ -12,6 +12,7 @@ sideResizeEles.farElement = $('.main-side');
 sideResizeEles.farSpread = $('.main-side');
 sideResizeEles.nav = null;
 slideResize(sideResizeEles, {min: 250, max: $('#zaojiashu').width()-260}, 'width', function(){
+    adaptiveTzjnrWidth();
     pageCCOprObj.resizeWidth();
     projectObj.refreshMainSpread();
     refreshSubSpread();
@@ -103,6 +104,7 @@ var sideToolsObj = {
             sideResizeEles.farElement.css('width', '0%');
             tabPanel.hide();
         }
+        adaptiveTzjnrWidth();
         autoFlashHeight();
         pageCCOprObj.resizeWidth();
         billsGuidance.refreshWorkBook();

+ 37 - 10
web/building_saas/main/js/views/sub_view.js

@@ -118,13 +118,35 @@ $("#linkZMHS").click(function(){        // 子目换算
 
     gljOprObj.activeTab='#linkZMHS';
 });
-
-tabZMHS
+//特征及内容各模块宽度自适应
+function adaptiveTzjnrWidth() {
+    if(gljOprObj.activeTab !== '#linkTZJNR'){
+        return;
+    }
+    //排版规则工具条宽度
+    const typeSettingWidth = 30;
+    let tzjnrWidth = $('#tzjnrCon').width() + 30;
+    //let tzjnrWidth = $(window).width() - $('.main-nav').width() - $('.main-side').width();
+    if($('#add-rule').is(':visible')){
+        $('#jobDiv').css('width', tzjnrWidth / 3);
+        $('#itemDiv').css('width', tzjnrWidth / 3);
+        $('#add-rule').css('width', tzjnrWidth / 3);
+    } else{
+        $('#jobDiv').css('width', tzjnrWidth / 2);
+        $('#itemDiv').css('width', tzjnrWidth / 2 - typeSettingWidth);
+        $('#openTypeSetting').css('width', typeSettingWidth);
+    }
+    pageCCOprObj.resizeWidth();
+    refreshSubSpread();
+}
 //特征及内容
 $("#linkTZJNR").click(function () {
+    gljOprObj.activeTab='#linkTZJNR';
     $("#subItems").children().hide();
     $("#tzjnrCon").show();
-    $("#add-rule").show();
+    adaptiveTzjnrWidth();
+    pageCCOprObj.resizeWidth();
+    //$("#add-rule").show();
     $("#add-rule p").not(":first").css('margin-bottom', 4);
     pageCCOprObj.active = true;
     refreshSubSpread();
@@ -134,13 +156,18 @@ $("#linkTZJNR").click(function () {
     }
     pageCCOprObj.mainActiveCell = projectObj.mainSpread.getActiveSheet().getSelections()[0];
     pageCCOprObj.setCacheAndShow(selectedNode);
-   /* if(selectedNode && selectedNode.sourceType === projectObj.project.Bills.getSourceType()){
-        pageCCOprObj.setCacheAndShow(selectedNode);
-    }
-    else{
-        pageCCOprObj.clearData();
-    }*/
-    gljOprObj.activeTab='#linkTZJNR';
+});
+//打开排版规则
+$('#openTypeSetting').click(function () {
+    $('#add-rule').show();
+    $(this).hide();
+    adaptiveTzjnrWidth();
+});
+//关闭排版规则
+$('#closeTypeSetting').click(function () {
+    $('#add-rule').hide();
+    $('#openTypeSetting').show();
+    adaptiveTzjnrWidth();
 });
 
 //应用到选中清单、应用到所有,添加位置列如果隐藏了,则重新显示

+ 3 - 0
web/building_saas/pm/js/pm_newMain.js

@@ -292,6 +292,9 @@ const projTreeObj = {
                         $('#share').modal('show');
                         $('#allowCopy').prop('checked', false);
                         $('#allowCopyHint').hide();
+                        setTimeout(function () {
+                            $('#sharePhone').focus();
+                        }, 200);
                     }
                 },
                 "spr3": '--------',

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

@@ -58,11 +58,11 @@
                     <a class="dropdown-item" href="#">关于</a>
                 </div>
             </li>
-            <li class="nav-item">
+          <!--  <li class="nav-item">
                 <a class="nav-link <% if (unreadCount > 0) { %>new-msg<% } %>" id="notify-info" data-toggle="modal" data-target="#msg" href="javacript:void(0);">
                     <i class="fa fa-envelope-o" aria-hidden="true"></i>&nbsp;<span id="unread-num"><%= unreadCount %></span>
                 </a>
-            </li>
+            </li>-->
         </ul>
     </div>
 </nav>