Selaa lähdekoodia

图片预览细节优化

zq 3 kuukautta sitten
vanhempi
commit
2631e61c06

+ 9 - 3
src/views/book/courseware/preview/components/picture/PicturePreview.vue

@@ -11,7 +11,7 @@
                 class="view-list"
                 indicator-position="none"
                 :autoplay="false"
-                :style="{ height: elementHeight - 144 - 17 + 'px' }"
+                :style="{ height: elementHeight - 144 - 32 + 'px' }"
                 @change="handleChange"
               >
                 <el-carousel-item v-for="(file, i) in data.file_list" :key="i">
@@ -51,7 +51,7 @@
               :src="file.file_url"
               fit="contain"
               :preview-src-list="data.file_list.map((x) => x.file_url)"
-              :style="{ height: elementHeight <= 0 ? data.min_height + 'px' : elementHeight + 'px' }"
+              :style="{ height: elementHeight + 'px' }"
             />
           </div>
         </template>
@@ -96,7 +96,7 @@ export default {
         if (this.fileLen > 1) {
           this.isMore = true;
         }
-        if (this.fileLen > 0 && this.data.property.view_method === 'list') {
+        if ((this.fileLen > 0 && this.data.property.view_method === 'list') || this.fileLen === 1) {
           const ele = this.$refs.pictureAreaBox;
           const sn_position = this.data.property.sn_position;
           const viewMemo = this.isEnable(this.data.property.view_memo);
@@ -145,6 +145,7 @@ export default {
           this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
           this.elementHeight = ele.clientHeight;
         }
+
         this.fileLen = this.data.file_list.length;
         if (this.fileLen > 1) {
           this.isMore = true;
@@ -247,6 +248,11 @@ export default {
       align-items: center;
       justify-content: center;
       width: 100%;
+
+      .el-image {
+        min-height: 128px;
+        cursor: pointer;
+      }
     }
 
     .memo-area {