瀏覽代碼

1、分组显示 2、预览不显示项目封面 3、语音矩阵样式调整

dsy 1 天之前
父節點
當前提交
3170c460ac

+ 20 - 2
src/components/CommonPreview.vue

@@ -13,10 +13,28 @@
           <span class="link" @click="createCoursewarePreviewURL()">生成课件预览链接</span>
         </template>
         <div class="group">
-          <el-checkbox v-model="isShowGroup">显示分组</el-checkbox>
-          <el-checkbox v-model="groupShowAll">分组显示全部</el-checkbox>
           <el-checkbox v-model="isJudgeCorrect">判断对错</el-checkbox>
         </div>
+        <div v-if="isShowGroup">
+          <span class="link" @click="isShowGroup = false">取消显示分组</span>
+          <span
+            class="link"
+            @click="
+              groupShowAll = false;
+              isShowGroup = false;
+            "
+            >完成选择</span
+          >
+        </div>
+        <span
+          v-else
+          class="link"
+          @click="
+            isShowGroup = true;
+            groupShowAll = true;
+          "
+          >显示分组</span
+        >
         <span class="link">
           <el-checkbox v-model="chinese" true-label="zh-Hant" false-label="zh-Hans">繁体</el-checkbox>
         </span>

+ 0 - 7
src/components/PinyinText.vue

@@ -300,13 +300,6 @@ export default {
       immediate: true,
       deep: true,
     },
-    richTextList: {
-      handler(val) {
-        console.log('richTextList', JSON.stringify(val));
-      },
-      immediate: true,
-      deep: true,
-    },
   },
 
   methods: {

+ 0 - 24
src/views/book/courseware/preview/CoursewarePreview.vue

@@ -507,30 +507,6 @@ export default {
         background: back,
       } = this.background || {};
 
-      const hasNoRows = !Array.isArray(this.data?.row_list) || this.data.row_list.length === 0; // 判断是否没有行
-      const projectCover = this.project?.cover_image_file_url || '';
-
-      // 优先在空行时使用背景图或项目封面
-      if (hasNoRows) {
-        const backgroundImage = hasNoRows ? bcImgUrl || projectCover : bcImgUrl;
-
-        // 保护性读取位置/大小值,避免 undefined 导致字符串 "undefined%"
-        const widthPct = typeof pos.width === 'undefined' ? '' : pos.width;
-        const heightPct = typeof pos.height === 'undefined' ? '' : pos.height;
-        const leftPct = typeof pos.left === 'undefined' ? '' : pos.left;
-        const topPct = typeof pos.top === 'undefined' ? '' : pos.top;
-
-        const hasBcImg = Boolean(bcImgUrl);
-        const backgroundSize = hasBcImg ? `${widthPct}% ${heightPct}%` : hasNoRows ? 'contain' : '';
-        const backgroundPosition = hasBcImg ? `${leftPct}% ${topPct}%` : hasNoRows ? 'center' : '';
-
-        return {
-          backgroundImage: backgroundImage ? `url(${backgroundImage})` : '',
-          backgroundSize,
-          backgroundPosition,
-        };
-      }
-
       let canvasStyle = {
         backgroundSize: bcImgUrl ? `${pos.width}% ${pos.height}%` : '',
         backgroundPosition: bcImgUrl ? `${pos.left}% ${pos.top}%` : '',

+ 17 - 1
src/views/book/courseware/preview/components/voice_matrix/VoiceMatrixPreview.vue

@@ -192,7 +192,6 @@
           @handleWav="handleWav"
         />
         <AudioCompare
-          :style="{ flex: 1 }"
           :theme-color="themeColor"
           :wavblob="wavblob"
           type="full"
@@ -893,6 +892,23 @@ $border-color: #e6e6e6;
       :deep .record {
         max-width: 280px;
       }
+
+      :deep .compara-content {
+        margin-left: 8px;
+      }
+
+      :deep .compare-box,
+      :deep .compare-disable {
+        width: 20px;
+        height: 20px;
+      }
+
+      :deep .play-icon-big,
+      :deep .content-voices {
+        width: 20px;
+        height: 20px;
+        margin-top: 2px;
+      }
     }
   }
 }

+ 3 - 3
src/views/book/courseware/preview/components/voice_matrix/components/AudioCompareMatrix.vue

@@ -34,11 +34,11 @@
     <template v-else>
       <img
         :src="
-          type == 'full'
+          type === 'full'
             ? require('@/assets/voice_matrix/compare-disable-24.png')
             : require('@/assets/voice_matrix/compare-disable.png')
         "
-        :class="['compare-disable', type == 'full' ? 'compare-disable-big' : '']"
+        :class="['compare-disable', type === 'full' ? 'compare-disable-big' : '']"
       />
     </template>
   </div>
@@ -73,7 +73,7 @@ export default {
     };
   },
   watch: {
-    matrixSelectLrc(newVal) {
+    matrixSelectLrc() {
       if (this.unWatch) {
         this.unWatch();
         this.unWatch = null;