소스 검색

描述空

FinalYu 10 달 전
부모
커밋
a7f9b31121
1개의 변경된 파일18개의 추가작업 그리고 7개의 파일을 삭제
  1. 18 7
      nasc-ui/src/views/matter/index/index.vue

+ 18 - 7
nasc-ui/src/views/matter/index/index.vue

@@ -84,12 +84,17 @@
                   <div class="material-line" :style="lineHeight"></div>
                   <div class="material-content" style="width: 69%; padding: 10px;">
                     <div v-show="showMaterialInfo">
-                      <label>材料描述</label>
-                      <div v-html="currMaterialInfo.memo" style="margin-left: 10px;"></div>
+                      <template v-if="!currMaterialInfo.memo && (!currMaterialInfo.imgList || currMaterialInfo.imgList.length == 0)">
+                        <div style="margin: 10px; color: #aea6a3">暂无数据</div>
+                      </template>
+                      <template v-if="currMaterialInfo.memo">
+                        <label>材料描述</label>
+                        <div v-html="currMaterialInfo.memo" style="margin: 10px;"></div>
+                      </template>
                       <div v-for="(url, i) in currMaterialInfo.imgList">
                         <label>示例图{{ i + 1 }}</label>
                         <div class="demo-image__lazy" style="margin: 10px;">
-                          <el-image :src="url" lazy :preview-src-list="currMaterialInfo.imgList"></el-image>
+                          <el-image :src="url" lazy :preview-src-list="currMaterialInfo.imgList" @load="loadImgSuccess"></el-image>
                         </div>
                       </div>
                     </div>
@@ -402,10 +407,16 @@
         } else {
           this.currMaterialInfo = {}
         }
-        setTimeout(() => {
-          let height = document.getElementsByClassName('material-content')[0].clientHeight
-          _this.lineHeight = 'height: ' + height + 'px;'
-        }, 1000)
+        let count = 0;
+        let checkContentHeight = setInterval(function() {
+          _this.loadImgSuccess()
+          count ++
+          if (count > 10) clearInterval(checkContentHeight)
+        }, 100)
+      },
+      loadImgSuccess() {
+        let height = document.getElementsByClassName('material-content')[0].clientHeight
+        this.lineHeight = 'height: ' + height + 'px;'
       },
       /** 查询远程桌面列表 */
       getVncDesktopList() {