Browse Source

汉字题录入

natasha 1 năm trước cách đây
mục cha
commit
2618c8b12a

+ 5 - 0
src/views/exercise_questions/create/components/common/UploadAudio.vue

@@ -1,6 +1,7 @@
 <template>
   <div class="upload-wrapper">
     <el-upload
+      v-if="showUpload"
       ref="upload"
       :limit="1"
       action="no"
@@ -35,6 +36,10 @@ export default {
       type: Number,
       default: null,
     },
+    showUpload: {
+      type: Boolean,
+      default: true,
+    },
   },
   data() {
     return {

+ 64 - 2
src/views/exercise_questions/create/components/exercises/ChineseQuestion.vue

@@ -34,6 +34,7 @@
               :key="item.audio_file_id || i"
               :file-id="item.audio_file_id"
               :item-index="i"
+              :show-upload="!item.audio_file_id"
               @upload="uploads"
               @deleteFile="deleteFiles"
             />
@@ -49,7 +50,7 @@
               @deleteWav="deleteWav"
               @updateWav="updateWav"
             />
-            <el-input v-model="item.definition" placeholder="输入释义" />
+            <el-input v-if="data.property.learn_type !== 'learn'" v-model="item.definition" placeholder="输入释义" />
             <SvgIcon icon-class="delete" class="delete pointer" @click="deleteOption(i, item.audio_file_id)" />
           </li>
         </ul>
@@ -195,4 +196,65 @@ export default {
 };
 </script>
 
-<style lang="scss" scoped></style>
+<style lang="scss" scoped>
+.content {
+  display: flex;
+  flex-direction: column;
+
+  .content-item {
+    .upload-wrapper {
+      margin-top: 0;
+    }
+
+    :deep .file-name {
+      width: 205px;
+      overflow: hidden;
+      text-overflow: ellipsis;
+      white-space: nowrap;
+    }
+
+    .auto-matically {
+      display: flex;
+      align-items: center;
+      width: 233px;
+      padding: 5px 12px;
+      background-color: $fill-color;
+      border-radius: 2px;
+
+      .audio-wrapper {
+        margin-right: 12px;
+
+        :deep .audio-play {
+          width: 16px;
+          height: 16px;
+          color: #000;
+          background-color: initial;
+        }
+
+        :deep .audio-play.not-url {
+          color: #a1a1a1;
+        }
+
+        :deep .voice-play {
+          width: 16px;
+          height: 16px;
+        }
+      }
+
+      .auto-btn {
+        font-size: 14px;
+        font-weight: 400;
+        line-height: 22px;
+        color: #1d2129;
+        cursor: pointer;
+      }
+    }
+
+    .delete {
+      flex-shrink: 0;
+      width: 16px;
+      height: 16px;
+    }
+  }
+}
+</style>

+ 2 - 1
src/views/exercise_questions/create/components/exercises/ChooseToneQuestion.vue

@@ -36,6 +36,7 @@
               :key="item.audio_file_id || i"
               :file-id="item.audio_file_id"
               :item-index="i"
+              :show-upload="!item.audio_file_id"
               @upload="uploads"
               @deleteFile="deleteFiles"
             />
@@ -257,7 +258,7 @@ export default {
     }
 
     :deep .file-name {
-      width: 140px;
+      width: 205px;
       overflow: hidden;
       text-overflow: ellipsis;
       white-space: nowrap;

+ 2 - 1
src/views/exercise_questions/create/components/exercises/RepeatQuestion.vue

@@ -38,6 +38,7 @@
               :key="item.audio_file_id || i"
               :file-id="item.audio_file_id"
               :item-index="i"
+              :show-upload="!item.audio_file_id"
               @upload="uploads"
               @deleteFile="deleteFiles"
             />
@@ -169,7 +170,7 @@ export default {
   }
 
   :deep .file-name {
-    width: 140px;
+    width: 205px;
     overflow: hidden;
     text-overflow: ellipsis;
     white-space: nowrap;

+ 3 - 1
src/views/exercise_questions/data/chinese.js

@@ -1,4 +1,4 @@
-import { optionTypeList, stemTypeList, scoreTypeList, questionNumberTypeList } from './common';
+import { stemTypeList, scoreTypeList, questionNumberTypeList } from './common';
 import { getRandomNumber } from '@/utils/index';
 
 export function getOption(content = '') {
@@ -8,6 +8,8 @@ export function getOption(content = '') {
     audio_file_id: '',
     pinyin: '',
     definition: '',
+    audio_wav: '',
+    audio_wav_time: 0,
   };
 }
 // 汉字类型列表