Browse Source

添加无缺陷详情状态

zhangxc 5 years ago
parent
commit
b905d53550
3 changed files with 25 additions and 4 deletions
  1. 10 0
      src/css/index.less
  2. BIN
      src/images/empty.png
  3. 15 4
      src/index.js

+ 10 - 0
src/css/index.less

@@ -72,4 +72,14 @@
   width: 30px;
   text-align: left;
   color: #FF4D4F;
+}
+.empty{
+  text-align: center;
+  margin-top: 100px;
+}
+.emptyTxt{
+  margin-top: 15px;
+    font-size: 12px;
+    text-indent: 10px;
+    color: #aaa;
 }

BIN
src/images/empty.png


+ 15 - 4
src/index.js

@@ -2,11 +2,12 @@ require('./css/index.less');
 const $ = require("jquery");
 const {post,getUrlArgObject } = require('./js/util.js');
 const {api} = require('./js/api.js');
-const iconWarn = require("./images/icon_warn.png")
+const iconWarn = require("./images/icon_warn.png");
+const emptyImg = require("./images/empty.png");
 
-let behospitalCode = getUrlArgObject("behospitalCode") ||'10003464_9'
-let hospitalId = getUrlArgObject("hospitalId") ||'3'
-let modeId = getUrlArgObject("modeId") || 1
+let behospitalCode = getUrlArgObject("behospitalCode") ||''
+let hospitalId = getUrlArgObject("hospitalId") ||''
+let modeId = getUrlArgObject("modeId") || ''
 function setListHei(){
     $(".flawList").css({
         height:$(window).height()-90+'px'
@@ -14,6 +15,8 @@ function setListHei(){
 }
 setListHei()
 
+
+$('.flawList').html(str)
 function getFLawList(){
     post(api.analyzeRun,{behospitalCode:behospitalCode,hospitalId:hospitalId, modeId:modeId}).then(function(res){
       if(res.data.code==='0'){
@@ -41,6 +44,14 @@ function renderFlawList(flawList){
         str += flawItem
         
     }
+    if(flawList.length === 0){
+        str = `
+            <div class="empty">
+                <img class="emptyImg" src="${emptyImg}" />
+                <div class="emptyTxt">暂无缺陷~</div>
+            </div>
+        `
+    }
     $('.flawList').html(str)
     $('.flawNum').html(flawList.length)
 }