Explorar el Código

Merge branch 'test' into byll

luolei hace 5 años
padre
commit
2ae7df3e5f

+ 56 - 0
src/css/index.less

@@ -165,4 +165,60 @@
       color: #FF4D4F;
     }
   }
+}
+.moduleMsgBox{
+  .moduleMsgContent{
+    position: fixed;
+    left: 50%;
+    top: 50%;
+    width: 400px;
+    height:208px;
+    margin: -104px 0 0 -200px;
+    background: #fff;
+    border-radius:4px;
+  }
+  .moduleMsgTitle{
+    position: relative;
+    height: 40px;
+    padding: 0 0 0 20px;
+    line-height: 40px;
+    border-bottom: 1px solid #E2E5EF;
+    font-size: 14px;
+    color: #1E1E1E;
+  }
+  .iconClose{
+    width: 40px;
+    position: absolute;
+    right: 0;
+  }
+  .moduleMsgInfo{
+    text-align: center;
+    position: relative;
+    top: 30px;
+  }
+  .moduleMsgBtn{
+    position: relative;
+    text-align: center;
+    top: 81px;
+  }
+  .saveModuleEdit{
+    display: inline-block;
+    color: #fff;
+    width:80px;
+    height:36px;
+    line-height: 36px;
+    text-align: center;
+    background:rgba(90,142,238,1);
+    border-radius:4px;
+    cursor: pointer;
+  }
+}
+.mask {
+  position: fixed;
+  width: 100%;
+  height: 100%;
+  background: #000;
+  opacity: 0.5;
+  left: 0;
+  top: 0;
 }

+ 63 - 9
src/css/itemManager.less

@@ -1,5 +1,5 @@
 ul,li{
-    list-style: none;
+    padding:0;margin:0;list-style:none
 }
 h2{
     padding: 11px 20px;
@@ -7,11 +7,13 @@ h2{
     font-weight: 600;
     border-bottom: 1px solid #E2E5EF;
 }
+.main-body{
+    margin: 20px 40px;
+}
 table{
-    width: 1080px;
+    width: 100%;
     border:1px solid #E2E5EF;
     border-collapse: collapse;
-    margin: 40px 0 0 20px;
     thead{
         background: #EFF0F9;
        
@@ -28,38 +30,90 @@ table{
     }
     
 }
+.filterBox{
+    margin: 0 0 20px 0;
+}
 .filterItem{
     position: relative;
     display: inline-block;
     margin-right: 20px;
+    height: 40px;
+    line-height: 40px;
 }
 .filterDropList{
     position: absolute;
     right: 0;
+    height: 200px;
+    overflow-y: auto;
     background: #fff;
     display: none;
+    border: 1px solid #e4e7ed;
+    box-shadow: 0 2px 12px 0 #e4e7ed;
+    li{
+        padding: 0 10px;
+    }
+}
+.rejectList, .usedList{
+    height: 120px;
+    li{
+        padding: 0 10px;
+    }
+    li:hover{
+        background-color: #EEF4FF;
+        cursor: pointer;
+    }
 }
-.selectModuleType{
+.selectModuleType,.moduleItemInp,.selectUsed, .selectReject{
     display: inline-block;
-    width: 160px;
+    width:160px;
+    padding: 0 10px;
+    height:40px;
+    border-radius:4px;
+    border: 1px solid #E2E5EF;
+    box-sizing: border-box;
+    cursor: pointer;
+}
+.moduleItemInp{
+    cursor: default;
+    outline: none;
 }
 .moduleTypeList{
      width: 160px;
-    
 }
 .selectUsed, .selectReject{
-    display: inline-block;
     width: 120px;
 }
+.modeTypeItem:hover{
+    background-color: #EEF4FF;
+    cursor: pointer;
+}
 .rejectList, .usedList {
     width: 120px;
 }
+.filter{
+    display: inline-block;
+    width:60px;
+    height:36px;
+    background:#5A8EEE;
+    border-radius:4px;
+    color: #fff;
+    text-align: center;
+    line-height: 36px;
+}
+.editItem{
+   color: #5A8EEE
+}
 
-
+.ellipsis{
+    overflow: hidden;
+    text-overflow:ellipsis;
+    white-space: nowrap;
+}
 
 
 .pagination{
-    margin: 0 0 0 30px;
+    margin: 35px 0 0 0;
+    text-align: right;
 }
 .activePage{
     color: #5A8EEE;

+ 42 - 5
src/css/moduleManager.less

@@ -1,14 +1,27 @@
+.container{
+    width: 100%;
+}
 h2{
-    padding: 11px 20px;
+    padding: 11px 10px;
     font-size: 16px;
     font-weight: 600;
     border-bottom: 1px solid #E2E5EF;
 }
+.main-body{
+    margin: 20px 40px;
+}
+.totalSumBox{
+    margin: 0 0 20px 0;
+    text-align: right;
+    .totalSum{
+        color: red;
+    }
+}
 table{
-    width: 1080px;
+    width: 100%;
     border:1px solid #E2E5EF;
     border-collapse: collapse;/*关键代码*/
-    margin: 40px 0 0 20px;
+  
     thead{
         background: #EFF0F9;
        
@@ -25,6 +38,30 @@ table{
     }
     
 }
-#dialog-message{
-    display: none;
+.moduleScore, .totalSum{
+    text-align: center;
+    input{
+        text-align: center  ;
+    }
+}
+.saveModuleBox{
+    margin: 20px 0 0 0;
+}
+.saveModule{
+    display: inline-block;
+    float: right;
+    background: #5A8EEE;
+    color:#fff;
+    padding: 9px 16px;
+    border-radius: 5px;
+    cursor: pointer;
+}
+.mask {
+    position: fixed;
+    width: 100%;
+    height: 100%;
+    background: #000;
+    opacity: 0.5;
+    left: 0;
+    top: 0;
 }

+ 53 - 48
src/html/itemManager.html

@@ -5,61 +5,66 @@
     <meta charset="UTF-8">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
-    <title>条目数据维护</title>
+    <title></title>
     
 </head>
 
 <body>
     <div class="container">
-        条目维护维护
-        <div class="filterBox">
-            <span class="filterItem typeFilter">
-                <span>类别名称:</span>
-                <span class="selectModuleType">全部</span>
-                <ul class="moduleTypeList filterDropList"></ul>
-            </span>
-            <span class="filterItem">
-                <span>条目名称:</span>
-                <span class="">
-                    <input class="moduleItemInp" type="text" placeholder="请输入质控条目名称">
+        <h2>条目数据维护</h2>
+        <div class="main-body">
+            <div class="filterBox">
+                <span class="filterItem typeFilter">
+                    <span>类别名称:</span>
+                    <span class="selectModuleType">全部</span>
+                    <ul class="moduleTypeList filterDropList"></ul>
                 </span>
-            </span>
-            <span class="filterItem">
-                <span>单项否决:</span>
-                <span class="selectReject">全部</span>
-                <ul class="rejectList filterDropList">
-                    <Li  class="rejectItem" data-name="全部" data-id="">全部</Li>
-                    <li  class="rejectItem" data-name="是" data-id=1>是</li>
-                    <li  class="rejectItem" data-name="否" data-id=0>否</li>
-                </ul>
-            </span>
-            <span class="filterItem">
-                <span>是否启用:</span>
-                <span class="selectUsed">全部</span>
-                <ul class="usedList filterDropList">
-                    <Li class="usedItem" data-name="全部" data-id="">全部</Li>
-                    <li class="usedItem" data-name="是" data-id=1>是</li>
-                    <li class="usedItem" data-name="否" data-id=0>否</li>
-                </ul>
-            </span>
-            <span class="filter">查询</span>
+                <span class="filterItem">
+                    <span>条目名称:</span>
+                    <span class="">
+                        <input class="moduleItemInp" type="text" placeholder="请输入质控条目名称">
+                    </span>
+                </span>
+                <span class="filterItem">
+                    <span>单项否决:</span>
+                    <span class="selectReject">全部</span>
+                    <ul class="rejectList filterDropList">
+                        <Li  class="rejectItem" data-name="全部" data-id="">全部</Li>
+                        <li  class="rejectItem" data-name="是" data-id=1>是</li>
+                        <li  class="rejectItem" data-name="否" data-id=0>否</li>
+                    </ul>
+                </span>
+                <span class="filterItem">
+                    <span>是否启用:</span>
+                    <span class="selectUsed">全部</span>
+                    <ul class="usedList filterDropList">
+                        <Li class="usedItem" data-name="全部" data-id="">全部</Li>
+                        <li class="usedItem" data-name="是" data-id=1>是</li>
+                        <li class="usedItem" data-name="否" data-id=0>否</li>
+                    </ul>
+                </span>
+                <span class="filter">查询</span>
+            </div>
+            <table>
+                <thead>
+                    <th class="moduleName">序号</th>
+                    <th class="moduleType">模块类别</th>
+                    <th class="moduleItemName">质控条目名称</th>
+                    <th class="moduleTipsMsg">提示信息</th>
+                    <th class="moduleScore">分值</th>
+                    <th class="moduleReject">单项否决等级</th>
+                    <th class="moduleUsed">启用</th>
+                    <th class="moduleOpera">操作</th>
+                </thead>
+                <tbody>
+    
+                </tbody>
+            </table>
+            <div class="pagination"></div>
         </div>
-        <table>
-            <thead>
-                <th class="moduleName">序号</th>
-                <th class="moduleType">模块类别</th>
-                <th class="moduleItemName">质控条目名称</th>
-                <th class="moduleTipsMsg">提示信息</th>
-                <th class="moduleScore">分值</th>
-                <th class="moduleReject">单项否决等级</th>
-                <th class="moduleUsed">启用</th>
-                <th class="moduleOpera">操作</th>
-            </thead>
-            <tbody>
-
-            </tbody>
-        </table>
-        <div class="pagination"></div>
+        
+        
+        
     </div>
 </body>
 

+ 23 - 15
src/html/moduleManager.html

@@ -12,23 +12,31 @@
 <body>
     <div class="container">
        <h2>模块数据维护</h2>
-        <table>
-            <thead>
-                <th class="moduleNumber">序号</th>
-                <th class="moduleName">模块名称</th>
-                <th class="moduleScore">分数</th>
-            </thead>
-            <tbody>
+       <div class="main-body">
+           <p class="totalSumBox">当前分数合计:<span class="totalSum"></span></p>
+            <table>
+                <thead>
+                    <th class="moduleNumber">序号</th>
+                    <th class="moduleName">模块名称</th>
+                    <th class="moduleScore">分数</th>
+                </thead>
+                <tbody>
 
-            </tbody>
-        </table>
-        <div class="saveModule">保存</div>
-        <div id="dialog-message" title="下载完成">
-            <p>
-              总分不是100分,是否继续
-            </p>
-          </div>
+                </tbody>
+            </table>
+            <div class="saveModuleBox">
+                <span class="saveModule">保存</span>
+            </div>
+            
+       </div>
     </div>
+    <!-- <div class="msgBox">
+        <div class="mask"></div>
+        <p>总分不是100分,是否继续</p>
+        <div>
+            <span>保存</span>
+        </div>
+    </div> -->
 </body>
 
 </html>

+ 1 - 1
src/html/qcScore.html

@@ -102,4 +102,4 @@
         </div>
     </div>
 </body>
-</html>
+</html>

+ 20 - 11
src/js/itemManager.js

@@ -3,7 +3,8 @@ require("../css/itemManager.less");
 require('./../resource/jquery-ui/jquery-ui.min.js');
 const {api} = require('./api.js')
 const {post} = require('./utils.js')
-
+const switchIconOpen = require("./../images/icon4.png")
+const switchIconClose = require("./../images/icon5.png")
 let casesId="", name="", isReject ="", isUsed =""
 
 //获取表格数据
@@ -21,7 +22,11 @@ function getTabData(activePage){
             const totalPage = res.data.data.pages
             const totalNum = res.data.data.total
             renderTab(data,activePage)
-            renderPagination(totalPage,activePage,totalNum)
+            if(totalPage > 1){
+                renderPagination(totalPage,activePage,totalNum)
+            } else{
+                $('.pagination').html("")
+            }
 
         }else{}
     }).catch((e) =>{
@@ -84,8 +89,8 @@ function renderTab(data,activePage){
                 <td>${item.name}</td>
                 <td>${item.msg}</td>
                 <td>${item.score}</td>
-                <td>${item.isReject}</td>
-                <td>${item.isUsed}</td>
+                <td>${item.isReject == '1' ? `<img src=${switchIconOpen} />`:`<img src=${switchIconClose} />`}</td>
+                <td>${item.isUsed == '1' ? `<img src=${switchIconOpen} />`:`<img src=${switchIconClose} />`}</td>
                 <td class="editItem">修改</td>
             </tr>
         `
@@ -107,11 +112,15 @@ function editItem(item,activePage){
     $('.pop-box').remove()
     $('.container').append('<div class="pop-box"></div>')
     const str = `
-        <div><span>提示信息:</span> <input class="itemTipMsg" value=${itemCpoy.msg} /></div>
-        <div><span>分值:</span> <input class="itemScore"  type="number" value=${itemCpoy.score} /></div>
-        <div><span>单项否决</span><span class="itemReject">${itemCpoy.isReject}</span></div>
-        <div><span>启用</span><span class="itemUsed">${itemCpoy.isUsed}</span></div>
-        <div class="confirmEdit">确定</div>
+        <div class="itemMsgBox">
+            <div class="mask"></div>
+            <div><span>提示信息:</span> <input class="itemTipMsg" value=${itemCpoy.msg} /></div>
+            <div><span>分值:</span> <input class="itemScore"  type="number" value=${itemCpoy.score} /></div>
+            <div><span>单项否决</span><span class="itemReject">${itemCpoy.isReject}</span></div>
+            <div><span>启用</span><span class="itemUsed">${itemCpoy.isUsed}</span></div>
+            <div class="confirmEdit">确定</div>
+        </div>
+       
     `
     $('.pop-box').html(str)
     $(".itemTipMsg").on("input", function(e){
@@ -175,9 +184,9 @@ function getmoduleTypeList(){
 
 
 function renderModuleTypeList(moduleTypeList){
-    let str = `<li class="modeTypeItem" data-id=" " data-name="全部">全部</li>`
+    let str = `<li class="modeTypeItem " data-id=" " data-name="全部">全部</li>`
     for(let i = 0; i < moduleTypeList.length; i++){
-        str += `<li class="modeTypeItem" data-id=${moduleTypeList[i].id} data-name=${moduleTypeList[i].name}> ${moduleTypeList[i].name}</li>`
+        str += `<li class="modeTypeItem ellipsis" title=${moduleTypeList[i].name} data-id=${moduleTypeList[i].id} data-name=${moduleTypeList[i].name}> ${moduleTypeList[i].name}</li>`
     }
     $('.moduleTypeList').html(str)
     bindModuleTypeSelect()

+ 28 - 17
src/js/moduleManager.js

@@ -4,6 +4,7 @@ require('./../resource/layui/layui.js');
 require('./../resource/jquery-ui/jquery-ui.min.js');
 require('./../resource/jquery-ui/jquery-ui.min.css');
 require('./../resource/layui/css/layui.css');
+
 // const  layui = require('layui-src');
 const {api} = require('./api.js')
 const {post} = require('./utils.js')
@@ -58,17 +59,18 @@ function renderTab(){
         str += `
         <tr>
             <td class="moduleNumber">${i+1}</td>
-            <td>${data[i].name}</td>
-            <td> <input type="number"  data-index=${i} value=${data[i].score} /></td>
+            <td class="moduleName">${data[i].name}</td>
+            <td class="moduleScore"> <input type="number"  data-index=${i} value=${data[i].score} /></td>
         </tr>
         `
     }
-    str += `
-    <tr>
-        <td>总分</td>
-        <td class="totalSum"></td>
-    </tr>
-    `
+    // str += `
+    // <tr>
+    //     <td class="moduleNumber"></td>
+    //     <td class="moduleName">总分</td>
+    //     <td class="totalSum"></td>
+    // </tr>
+    // `
     $('table tbody').html(str)
     bindInput()
     getTotalSum()
@@ -94,20 +96,29 @@ function bindInput(){
         getTotalSum(data)
     })
 }
+let msgBox =`<div class="moduleMsgBox">
+        <div class="mask"></div>
+        <div class="moduleMsgContent">
+            <p class="moduleMsgTitle">提示 <img class="iconClose" src=${require('./../images/icon_close_default.png')} alt="关闭" /></p>
+            <p class="moduleMsgInfo">总分不是100分,是否继续</p>
+            <div class="moduleMsgBtn">
+                <span class="saveModuleEdit">保存</span>
+            </div>
+        </div>
+    </div>`
 
 $('.saveModule').on("click", function(){
     console.log('data', data)
     const sum =  $('.totalSum').html()
     if(sum != 100){
-        $( "#dialog-message" ).dialog({
-            modal: true,
-            buttons: {
-              "确定": function() {
-                $( this ).dialog( "close" );
-                saveModify()
-              }
-            }
-        });
+        $("#mainBox", parent.document).append(msgBox)
+        $("#mainBox .moduleMsgBox .iconClose", parent.document).on("click", function(e){
+            $("#mainBox .moduleMsgBox", parent.document).remove()
+        })
+        $("#mainBox .moduleMsgBox .saveModuleEdit", parent.document).on("click", function(e){
+            saveModify()
+            $("#mainBox .moduleMsgBox", parent.document).remove()
+        })
     }else{
         saveModify()
     }