dsy 3 месяцев назад
Родитель
Сommit
54640ec139

+ 12 - 3
src/views/book/courseware/create/components/base/picture/Picture.vue

@@ -38,14 +38,23 @@ export default {
       iconClass: 'picture',
     };
   },
+  watch: {
+    'data.file_list': {
+      handler(fileList) {
+        if (fileList.length === 1) {
+          this.data.min_height = '144';
+        } else if (fileList.length > 1) {
+          this.data.min_height = '336';
+        }
+      },
+      immediate: true,
+    },
+  },
   methods: {
     updateFileList({ file_list, file_id_list, file_info_list }) {
       this.data.file_list = file_list;
       this.data.file_id_list = file_id_list;
       this.data.file_info_list = file_info_list;
-      if (file_list.length === 1) {
-        this.data.min_height = '144';
-      }
       this.handlerMindMap();
     },
     // 思维导图

+ 1 - 1
src/views/book/courseware/data/picture.js

@@ -24,7 +24,7 @@ export function getPictureData() {
     single_size: 2, // 单位MB
     total_size: 40, // 单位MB
     min_width: '144', // 大于等于最小缩略图宽度
-    min_height: '306', // 大于等于2倍缩略图宽度加间隙高度
+    min_height: '336', // 大于等于2倍缩略图宽度加间隙高度
     property: getPictureProperty(),
     file_info_list: [],
     file_id_list: [], // 文件 id['20032-121212', '20032-121216']

+ 1 - 6
src/views/book/courseware/preview/components/fill/FillPreview.vue

@@ -21,12 +21,7 @@
               </template>
 
               <template v-else-if="data.property.fill_type === fillTypeList[1].value">
-                <el-popover
-                  :key="j"
-                  placement="top"
-                  trigger="click"
-                  content="这是一段内容,这是一段内容,这是一段内容,这是一段内容。"
-                >
+                <el-popover :key="j" placement="top" trigger="click" content="">
                   <el-input
                     v-model="li.content"
                     :disabled="true"

+ 5 - 6
src/views/book/courseware/preview/components/picture/PicturePreview.vue

@@ -103,7 +103,7 @@ export default {
           // 序号在左和右补齐序号高度,去掉padding(8*2)
           if (sn_position.includes('left') || sn_position.includes('right')) {
             this.elementWidth = viewMemo ? (ele.clientWidth - 16) * 0.8 : ele.clientWidth - 16;
-            this.elementHeight = ele.clientHeight + 30;
+            this.elementHeight = ele.clientHeight;
           } else {
             this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
             this.elementHeight = ele.clientHeight;
@@ -140,7 +140,7 @@ export default {
         // 序号在左和右补齐序号高度,去掉padding(8*2)
         if (sn_position.includes('left') || sn_position.includes('right')) {
           this.elementWidth = viewMemo ? (ele.clientWidth - 16) * 0.8 : ele.clientWidth - 16;
-          this.elementHeight = ele.clientHeight + 30;
+          this.elementHeight = ele.clientHeight;
         } else {
           this.elementWidth = viewMemo ? ele.clientWidth * 0.8 : ele.clientWidth;
           this.elementHeight = ele.clientHeight;
@@ -166,11 +166,10 @@ export default {
               w = viewMemo ? entry.contentRect.width * 0.8 : entry.contentRect.width;
               h = entry.contentRect.height - 30;
             }
-            // eslint-disable-next-line no-negated-condition
-            if (this.elementWidth !== w) {
-              this.elementWidth = w;
-            } else {
+            if (this.elementWidth === w) {
               this.elementHeight = h;
+            } else {
+              this.elementWidth = w;
             }
           });
         }