ソースを参照

容器高度计算

zhouna 5 年 前
コミット
03fd9eee58
4 ファイル変更28 行追加4 行削除
  1. 1 0
      src/css/index.less
  2. 14 2
      src/css/qcScore.less
  3. 2 2
      src/html/qcScore.html
  4. 11 0
      src/js/utils.js

+ 1 - 0
src/css/index.less

@@ -82,6 +82,7 @@
 .menu{
   width: @menuWt;
   height: 100%;
+  overflow-y: auto;
   .active{
     color: @activeColor;
     background: @activeBg;

+ 14 - 2
src/css/qcScore.less

@@ -14,6 +14,7 @@
   width: @menuWt;
   height: 100%;
   float: left;
+  overflow-y: auto;
   .active{
     color: @activeColor;
     background: @activeBg;
@@ -83,14 +84,19 @@
   }
   .operation{
     width:28%;
+    height: 100%;
     margin-right: 10px;
+    position: relative;
     .flaw-title{
+      position: absolute;
+      top:0;
+      width: 100%;
+      height: 44px;
       color: #333333;
       font-weight: bold;
-      height: 44px;
       line-height: 44px;
       border-bottom:1px #E2E5EF solid;
-      margin-bottom: 20px;
+      /*margin-bottom: 20px;*/
       span{
         font-size: 16px;
         margin-left: 20px;
@@ -108,6 +114,12 @@
         border:1px @activeColor solid;
       }
     }
+    .flaw-box{
+      margin-top: 45px;
+      padding-top: 20px;
+      height: 100%;
+      overflow-y: auto;
+    }
     .flaw-item{
       margin: 0 20px 10px 30px ;
       border-bottom:1px #E2E5EF solid;

+ 2 - 2
src/html/qcScore.html

@@ -30,7 +30,7 @@
     <script type="text/html" id="contentTmpl">
         <div class="content-item" code="${title}">
             <h2 class="title">${title}</h2>
-            <div class="container">
+            <div class="container content-ht">
                 {{each(i,val) info}}
                 {{each(k,text) val}}
                 <div class="cont">
@@ -65,7 +65,7 @@
                     <span>缺陷详情</span>
                     <a href="javascript:void(0);">+ 新增</a>
                 </div>
-                <div class="flaw-box"></div>
+                <div class="flaw-box content-ht"></div>
             </div>
         </div>
     </div>

+ 11 - 0
src/js/utils.js

@@ -128,9 +128,20 @@ const delCookie = function(name){
       document.cookie= name + "="+cval+";expires="+exp.toGMTString();
 };
 
+//弹窗关闭事件
 $(".modal .close").click(function(){
   $(".modal").hide();
 });
+//计算容器高度
+function setBoxHeight(){
+  const ht=window.innerHeight;
+  $(".main-part").height((ht-50)+'px');
+  $(".content-ht").height((ht-116)+"px");
+}
+setBoxHeight();
+$(window).resize(function(){
+  setBoxHeight();
+});
 
 module.exports = {
   pageMap,