dsy преди 1 месец
родител
ревизия
c4b69ba32a

+ 2 - 4
src/views/book/courseware/create/components/base/common/SelectResource.vue

@@ -50,8 +50,8 @@
           <el-image style="height: 90px" :src="require('@/assets/h5-games.png')" fit="contain" />
         </template>
         <template v-else-if="type_index === 4">
-          <el-image style="height: 90px" :src="require('@/assets/3d-model.png')" fit="contain"
-        /></template>
+          <el-image style="height: 90px" :src="require('@/assets/3d-model.png')" fit="contain" />
+        </template>
         <template v-else-if="type_index === 5">
           <el-image style="height: 90px" :src="require('@/assets/txt.png')" fit="contain" />
         </template>
@@ -100,7 +100,6 @@
 
 <script>
 import PaginationPage from '@/components/PaginationPage.vue';
-import AudioLine from '@/views/personal_workbench/project/components/AudioLine.vue';
 
 import { PageQueryProjectResourceList } from '@/api/list';
 import { H5StartupFile } from '@/api/app';
@@ -112,7 +111,6 @@ export default {
   name: 'SelectResource',
   components: {
     PaginationPage,
-    AudioLine,
   },
   props: {
     visible: {

+ 1 - 1
src/views/book/courseware/create/components/question/fill/Fill.vue

@@ -119,7 +119,7 @@ export default {
         if (!val) return;
         this.data.word_list = val
           .split(/[\n\r]+/)
-          .map((item) => item.split(' ').filter((s) => s))
+          .map((item) => item.split(/\s+/).filter((s) => s))
           .flat()
           .map((content) => {
             return {

+ 43 - 33
src/views/book/courseware/data/dialogueArticle.js

@@ -5,11 +5,11 @@ import {
   arrangeTypeList,
   switchOption,
   isEnable,
-  pinyinPositionList
+  pinyinPositionList,
 } from '@/views/book/courseware/data/common';
 import { getRandomNumber } from '@/utils';
 
-export { arrangeTypeList, switchOption, isEnable,pinyinPositionList };
+export { arrangeTypeList, switchOption, isEnable, pinyinPositionList };
 
 export const roleDefaultColorList = ['#306EFF', '#3ABD38', '#FC8E3D', '#FC493D', '#BF3DFC']; // 角色默认颜色
 
@@ -79,7 +79,7 @@ export const roleTypeList = [
 export const multilingualList = [
   { value: 'para', label: '句/段落' },
   { value: 'all', label: '整篇' },
-]
+];
 
 export function getArticleProperty() {
   return {
@@ -97,7 +97,7 @@ export function getArticleProperty() {
 
     role_img_type: 'word',
     role_list: [getRole(0), getRole(1)],
-    
+
     multilingual_position: multilingualList[0].value,
   };
 }
@@ -111,7 +111,7 @@ export function getRole(index, name = '') {
   return {
     name: name || `角色${index + 1}`,
     mark: getRandomNumber(),
-    color: roleDefaultColorList[index%5],
+    color: roleDefaultColorList[index % 5],
     simpleHead: '',
     img_list: [],
     fullName: '',
@@ -155,22 +155,27 @@ export function getArticleData() {
         file_id: '',
       },
       wordTime: [], // 字幕时间节点
-      taskId:'',
+      taskId: '',
       file_id_list: [], // 文件 id
       col_width: [
         {
-          value:100  // 生词
-        },{
-          value:110  // 拼音
-        },{
-          value:50  // 词性
-        },{
-          value:180  // 释义
-        },{
-          value:180  // 搭配
-        },{
-          value:200  // 例句
-        }
+          value: 100, // 生词
+        },
+        {
+          value: 110, // 拼音
+        },
+        {
+          value: 50, // 词性
+        },
+        {
+          value: 180, // 释义
+        },
+        {
+          value: 180, // 搭配
+        },
+        {
+          value: 200, // 例句
+        },
       ], // 列宽
     }, // 生词列表
     other_word_list: {
@@ -199,30 +204,35 @@ export function getArticleData() {
         file_id: '',
       },
       wordTime: [], // 字幕时间节点
-      taskId:'',
+      taskId: '',
       file_id_list: [], // 文件 id
       col_width: [
         {
-          value:125  // 生词
-        },{
-          value:125  // 拼音
-        },{
-          value:125  // 词性
-        },{
-          value:125  // 释义
-        },{
-          value:150  // 搭配
-        },{
-          value:300  // 例句
-        }
+          value: 125, // 生词
+        },
+        {
+          value: 125, // 拼音
+        },
+        {
+          value: 125, // 词性
+        },
+        {
+          value: 125, // 释义
+        },
+        {
+          value: 150, // 搭配
+        },
+        {
+          value: 300, // 例句
+        },
       ], // 列宽
     },
     notes_list: {
       title_con: '',
       option: [],
-      property:{}
+      property: {},
     },
-    sentence_list_mp: [], //句子+分词数组
+    sentence_list_mp: [], // 句子+分词数组
     pinyin_type: 'pinyin', // 拼音类型
     multilingual: [], // 多语言
   };

+ 9 - 2
src/views/book/courseware/preview/components/fill/FillPreview.vue

@@ -270,10 +270,17 @@ export default {
       const isRow = this.data.property.arrange_type === arrangeTypeList[0].value;
       const isFront = this.data.property.audio_position === audioPositionList[0].value;
       const isEnableVoice = this.data.property.is_enable_voice_answer === 'true';
+      const isHasAudio = this.data.audio_file_id.length > 0;
       let _list = [
         { name: 'audio', value: '24px' },
         { name: 'fill', value: '1fr' },
       ];
+
+      if (!isHasAudio) {
+        _list[0].value = '0px';
+      }
+      console.log(_list);
+
       if (!isFront) {
         _list = _list.reverse();
       }
@@ -292,8 +299,8 @@ export default {
 
       let style = {
         'grid-auto-flow': isRow ? 'column' : 'row',
-        'column-gap': isRow ? '16px' : undefined,
-        'row-gap': isRow ? undefined : '8px',
+        'column-gap': isRow && isHasAudio ? '16px' : undefined,
+        'row-gap': isRow && !isHasAudio ? undefined : '8px',
         'grid-template-areas': gridArea,
         'grid-template-rows': gridTemplateRows,
         'grid-template-columns': gridTemplateColumns,