Browse Source

feat: 特征及内容窗口,新增一个窗口实时显示“项目特征”的排版结果

TASK #3595
vian 4 years ago
parent
commit
589a5da1cc

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

@@ -400,10 +400,10 @@
                         <textarea style="font-size: 14px" class="form-control" rows="8" readonly=""></textarea>
                       </div>
                       <div id="tzjnrCon" class="container-fluid main-data-bottom"
-                        style="background: #F1F1F1; overflow: hidden">
+                        style="float: left; width: 66%; background: #F1F1F1; overflow: hidden">
                         <div class="row" style="overflow: hidden">
                           <div class="p-0" id="contentDiv" style="width: 90%; float: left">
-                            <div id="jobDiv" style="width: 33%; height: 100%;float: left">
+                            <div id="jobDiv" style="width: 39%; height: 100%;float: left">
                               <div class="main-data-bottom ovf-hidden" id="jobSpread"
                                 style="width: 99%; float: left; position: relative">
                                 <!--工具栏-->
@@ -427,7 +427,7 @@
                               </div>
                               <div class="resize-x" id="TZJNRResize"></div>
                             </div>
-                            <div id="itemDiv" style="width: 67%; height: 100%; float: left;">
+                            <div id="itemDiv" style="width: 61%; height: 100%; float: left;">
                               <div class="main-data-bottom ovf-hidden" id="itemSpread" style="position: relative;">
                                 <!--工具栏-->
                                 <div class="bottom-tznrTools btn-group position-absolute">

+ 5 - 5
web/building_saas/main/js/controllers/material_controller.js

@@ -215,22 +215,22 @@ let MaterialController = {
         sheetCommonObj.showData(this.sheet, this.setting,this.datas);
         this.sheet.setRowCount(this.datas.length);
     },
-    showItemCharacterText:function (node,eleID = 'itemCharacterText') {
+    showItemCharacterText:function (node, selector = '#itemCharacterText') {
         let text="";
         let selected = node?node:projectObj.project.mainTree.selected;
         let parent = selected.parent;
-        if(eleID != 'itemCharacterText'){//如果是清单精灵里显示的,parent就是本身
+        if(selector != '#itemCharacterText'){//如果是清单精灵里显示的,parent就是本身
             parent = selected
             $("#xmtz_billID").val(selected.data.ID);
         }
         if(selected&&parent) text = parent.data.itemCharacterText;
         
-        if(eleID != 'itemCharacterText'){
-          $("#"+eleID).val(text);
+        if(selector != '#itemCharacterText'){
+          $(selector).val(text);
         }else{
           text = parent.data.itemCharacterText?parent.data.itemCharacterText.replace(/\n/g,"<br>"):"";
           text = text.replace(/\s/g,"&nbsp;");
-          $("#"+eleID).html(text);
+          $(selector).html(text);
         }  
       
 

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

@@ -1297,6 +1297,7 @@ let pageCCOprObj = {
                     });
                 }
             }
+            MaterialController.showItemCharacterText(null, "#tzCharacterText");
         });
 
     },

+ 18 - 4
web/building_saas/main/js/views/sub_view.js

@@ -142,11 +142,24 @@ let subObj = {
         let tabID = "";
         if($('#qdzy').is(':visible')) tabID = "qdzy";
         if($('#qdjl').is(':visible')) tabID = "qdjl";
+        if($('#tzjnrCon').is(':visible')) tabID = "tznr";
         if(tabID == "") return;
         //总宽度
         let totalWidth = $('#subItems').width();
         //人材机和项目特征文本比例
         const openWidth = 30;//打开项目特征工具条
+        if (tabID === 'tznr') {
+            if (this.showQDSubTab) {
+                $('#tzjnrCon').css('width', '66%');
+                $('#xmtzTextDiv').css('width', '34%');
+                $('#tzSubDiv').css('width', 'calc(100% - 38px)');
+            } else {
+                const tznrWidthRate = (totalWidth - openWidth) / totalWidth;
+                $('#xmtzTextDiv').css('width', '');
+                $('#tzjnrCon').css('width', `${tznrWidthRate * 100}%`);
+            }
+            return;
+        }
         const tab_tem = (305+openWidth+10)/totalWidth;//tab显示框默认宽度:305(表格宽度) + 30(工具条宽度)+10(resize div 宽度)
         //默认比例
         let textPercent = tab_tem * 100 + '%',//'15%',
@@ -185,8 +198,7 @@ let subObj = {
         return jl_sideResizeEles;
     },
     initQDSubTab:function () {
-   
-      if(!($('#linkQDJL').hasClass('active') || $('#linkQDZY').hasClass('active')))   return;
+      if(!($('#linkQDJL').hasClass('active') || $('#linkQDZY').hasClass('active') || $('#linkTZJNR').hasClass('active')))   return;
       if(this.showQDSubTab == true){
           $("#tzSubDiv").show();
           $("#tzrgResize").show();
@@ -194,7 +206,7 @@ let subObj = {
           $("#tzSubDiv").hide();
           $("#tzrgResize").hide();
       }
-      this.initTZItemWidth();
+        this.initTZItemWidth();
     },
     showGljSubTabData:function () {
         this.initGljSubTab();
@@ -209,7 +221,7 @@ let subObj = {
     },
     showQDSubTabData:function () {
         this.initQDSubTab();
-        MaterialController.showItemCharacterText(null,"tzCharacterText");
+        MaterialController.showItemCharacterText(null,"#tzCharacterText");
         if (gljOprObj.activeTab !== gljOprObj.preActiveTab) {   //提供焦点变换性能 2019年4月12日
             refreshSubSpread();
         }
@@ -404,6 +416,8 @@ $("#linkTZJNR").click(function () {
     gljOprObj.activeTab='#linkTZJNR';
     $("#subItems").children().hide();
     $("#tzjnrCon").show();
+    $("#xmtzTextDiv").show();
+    subObj.showQDSubTabData();
     $("#add-rule p").not(":first").css('margin-bottom', 4);
     pageCCOprObj.active = true;
     adaptiveTzjnrWidth();