zhangweicheng 6 years ago
parent
commit
ed35a26ad4

+ 1 - 1
web/building_saas/css/custom.css

@@ -254,7 +254,7 @@ legend.legend{
     color: black;
 }
 .ration_glj_spread{
-    width: 70%;
+    width: 83%;
     float: left;
 }
 

+ 3 - 2
web/building_saas/main/html/main.html

@@ -182,9 +182,9 @@
                               <div class="tab-content" id="tabCon">
                                   <div class="tab-pane active" id="subItems" role="tabpanel">
                                       <div class="main-data-bottom ovf-hidden" id="subSpread" style="display: none" tabindex="0"></div>
-                                      <div class="main-data-bottom ovf-hidden" id="rgResize" style="width: 0.2%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1"></div>
+                                      <div class="main-data-bottom ovf-hidden" id="rgResize" style="width: 0.2%; height: 100%; resize:horizontal; cursor: w-resize; float: left; background: #F1F1F1;display: none"></div>
                                       <div class="item_spread main-data-bottom ovf-hidden " id="replaceM" style="display: none" >
-                                          <div class="p-0" id="openItemText" style="height:100%;white-space:normal;">
+                                          <div class="p-0" id="openItemText" style="height:100%;white-space:normal;width: 40px">
                                               <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>
@@ -215,6 +215,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="p-0" id="TZJNRResize" style="position:relative; width: 0.2%; resize:horizontal; cursor: w-resize; background: #F1F1F1"></div>
                                               <div class="p-0" id="itemDiv" style="position:relative">
                                                   <div class="main-data-bottom ovf-hidden"  id="itemSpread">
                                                   </div>

+ 7 - 4
web/building_saas/main/js/controllers/material_controller.js

@@ -221,28 +221,31 @@ let MaterialController = {
             $('#subSpread').css('width','');
             return;
         }
-        $("#replaceM").removeClass("ovf-hidden");
         $('#replaceM').css('margin-top',0);
         this.toggleItemInit();
         $("#replaceText").html(text);
     },
     toggleItemInit:function () {
         if(this.showItemText == true){
+            $("#replaceM").removeClass("ovf-hidden");
             $("#openItemText").hide();
             $("#replaceText").show();
             $("#closeItemText").show();
             $("#rgResize").show();
-            let swidth =  this.subSpreadDivWidth == ""? $("#bottom_div").width()*0.7:this.subSpreadDivWidth;
+            let swidth =  this.subSpreadDivWidth == ""? $("#bottom_div").width()*0.83:this.subSpreadDivWidth;
             swidth = parseFloat(swidth);
             $('#subSpread').css('width',swidth);
             $('#replaceM').css('width',$("#bottom_div").width()-$("#rgResize").width()-swidth);
         }else {
+            $("#replaceM").addClass("ovf-hidden");
             $("#openItemText").show();
             $("#replaceText").hide();
             $("#closeItemText").hide();
             $("#rgResize").hide();
-            $('#subSpread').css('width',$("#bottom_div").width()-40);
-            $('#replaceM').css('width',35);
+            $('#replaceM').css('width',30);
+            $('#subSpread').css('width',$("#bottom_div").width()-30);
+
+
         }
     },
     getItems:function(characterText){

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

@@ -126,12 +126,17 @@ function slideResize(eles, limit, type, callback) {
             fEleChangeSize = fEleSize - moveSize;
             fEleChangeSize = fEleChangeSize < limit.min ? limit.min : fEleChangeSize;
             fEleChangeSize = fEleChangeSize > limit.max ? limit.max + 9 : fEleChangeSize;
-
+            let rePercent = {};
             if(type === 'width'){
-                let rePercent = getResizeWidthPercent(nEleChangeSize, fEleChangeSize);
-                console.log(rePercent);
-                eles.nearElement.css(type, rePercent.nearPercent);
-                eles.farElement.css(type, rePercent.farPercent);
+                 rePercent = getResizeWidthPercent(nEleChangeSize, fEleChangeSize);
+                if(limit.no_proportion === true){//如果只需要记算百分比,但不按页分比设置(还有其它兄弟div和情况)
+                    eles.nearElement.css(type, nEleChangeSize);
+                    eles.farElement.css(type, fEleChangeSize);
+                }else {
+                    eles.nearElement.css(type, rePercent.nearPercent);
+                    eles.farElement.css(type, rePercent.farPercent);
+                }
+
             }
             else{
                 eles.nearSpread[type](nEleChangeSize);
@@ -141,7 +146,7 @@ function slideResize(eles, limit, type, callback) {
             //实时刷新页面
             mouseMoveCount+=Math.abs(moveSize);//取移动的决对值
             if(mouseMoveCount >=5){//当累计移动超过5个像素时,才刷新,减少刷新次数
-                if(callback) callback();
+                if(callback) callback(rePercent);
                 mouseMoveCount = 0;
             }
         }

+ 2 - 2
web/building_saas/main/js/views/glj_col.js

@@ -6,7 +6,7 @@ let gljCol = {
         header: [
             {headerName: "编码", headerWidth: 130, dataCode: "code", dataType: "String", formatter: "@"},
             {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String",cellType:'tipsCell'},
-            {headerName: "规格型号", headerWidth: 160, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
+            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", dataType: "String", hAlign: "left",cellType:'tipsCell'},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", dataType: "String", hAlign: "center"},
             {headerName: "市场价", headerWidth: 65, dataCode: "marketPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"
             {headerName: "调整价", headerWidth: 65, dataCode: "adjustPrice", dataType: "Number", hAlign: "right"},//, decimalField: "glj.unitPrice"1
@@ -35,7 +35,7 @@ let gljCol = {
         header: [
             {headerName: "编码", headerWidth: 80, dataCode: "code", dataType: "String"},
             {headerName: "名称", headerWidth: 160, dataCode: "name", dataType: "String",cellType:'tipsCell'},
-            {headerName: "规格型号", headerWidth: 160, dataCode: "specs", hAlign: "left", dataType: "String",cellType:'tipsCell'},
+            {headerName: "规格型号", headerWidth: 120, dataCode: "specs", hAlign: "left", dataType: "String",cellType:'tipsCell'},
             {headerName: "单位", headerWidth: 45, dataCode: "unit", hAlign: "center", dataType: "String"},
             {headerName: "类型", headerWidth: 45, dataCode: "short_name", hAlign: "center", dataType: "String"},
             {headerName: "市场价", headerWidth: 70, dataCode: "marketPrice", hAlign: "right", dataType: "Number",validator:"number"},//,decimalField:"glj.unitPrice"

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

@@ -977,7 +977,6 @@ var projectObj = {
                 if(!projectReadOnly){
                     that.loadMainSpreadContextMenu();
                 }
-                that.loadFocusLocation();
                 socketObject.connect();//连接socket服务器
                 let endTime = +new Date();
                 console.log(`其它时间——${endTime - endShowTime}`);
@@ -985,6 +984,7 @@ var projectObj = {
                 console.log(`时间——${endTime - startTime}`);
                 that.project.projectMarkChecking();//是否需要重新进行造价计算
                 autoFlashHeight();
+                that.loadFocusLocation();
                 projectObj.refreshMainSpread();
                 //定位到会话中的选项
                 let mainTabFocus = sessionStorage.getItem('mainTab') ? sessionStorage.getItem('mainTab') : '#tab_zaojiashu';

+ 36 - 5
web/building_saas/main/js/views/sub_view.js

@@ -9,6 +9,7 @@
 
 let subSpread = null;
 let subObj = {
+    TZJNRrePercent:null,
     initSubSpread:function () {
         contentOprObj.buildSheet($("#jobSpread")[0]);
         //sheetCommonObj.bindEscKey(contentOprObj.workBook, [{sheet: contentOprObj.workBook.getSheet(0), editStarting: contentOprObj.onEditStart, editEnded: contentOprObj.onEditEnded}]);
@@ -158,19 +159,35 @@ function adaptiveTzjnrWidth() {
     if(gljOprObj.activeTab !== '#linkTZJNR'){
         return;
     }
+    let job_proportion = 0.25;
+    let item_proportion = 0.75;
+    if(subObj.TZJNRrePercent){
+        job_proportion = parseFloat(subObj.TZJNRrePercent.nearPercent)/100;
+        item_proportion = 1- job_proportion;
+    }
+
     //排版规则工具条宽度
     const typeSettingWidth = 30;
-    let tzjnrWidth = $('#tzjnrCon').width() + 30;
+    let tzjnrWidth = $('#tabCon').width();
+    console.log("set jobDiv");
+    console.log(subObj.TZJNRrePercent);
     //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);
+    //2018-11-23 zhang 需求两个表格默认占比为25%:75%  还要可拖动
+    let extWidth = $('#add-rule').is(':visible')? tzjnrWidth / 3:typeSettingWidth;
+    let totalWidth = tzjnrWidth - extWidth - $('#TZJNRResize').width();
+    $('#jobDiv').css('width', totalWidth*job_proportion);
+    $('#itemDiv').css('width', totalWidth*item_proportion);
+    $('#add-rule').is(':visible')?$('#add-rule').css('width', extWidth): $('#openTypeSetting').css('width', extWidth);
+  /*  if($('#add-rule').is(':visible')){
+        let totalWidth = tzjnrWidth - tzjnrWidth / 3;
+        $('#jobDiv').css('width', totalWidth*0.25);
+        $('#itemDiv').css('width', totalWidth*0.75);
         $('#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();
 }
@@ -581,3 +598,17 @@ $('#linkGCLMX').on('shown.bs.tab', function () {
 $('#linkAZZJF').on('shown.bs.tab', function () {
     gljOprObj.showDataIfRationSelect(projectObj.project.mainTree.selected, '111111');
 });
+
+let TZJNR_sideResizeEles = {};
+TZJNR_sideResizeEles.id = 'linkTZJNR';
+TZJNR_sideResizeEles.resize = $('#TZJNRResize');
+TZJNR_sideResizeEles.nearElement = $('#jobDiv');
+TZJNR_sideResizeEles.nearSpread = $('#jobSpread');
+TZJNR_sideResizeEles.farElement = $('#itemDiv');
+TZJNR_sideResizeEles.farSpread = $('#itemSpread');
+TZJNR_sideResizeEles.nav = null;
+slideResize(TZJNR_sideResizeEles, {min: 100, max: $('#tabCon').width() - 30,no_proportion:true}, 'width', function(rePercent){
+    if(rePercent) subObj.TZJNRrePercent = rePercent;
+    adaptiveTzjnrWidth();
+    refreshSubSpread();
+});