|
@@ -335,7 +335,13 @@
|
|
|
</div>
|
|
|
|
|
|
<el-button icon="el-icon-plus" style="margin: 24px 0" @click="addElement">增加一个</el-button>
|
|
|
- <SelectUpload label="生词音频" type="audio" width="500px" @uploadSuccess="uploadAudioSuccess" />
|
|
|
+ <SelectUpload
|
|
|
+ label="生词音频"
|
|
|
+ type="audio"
|
|
|
+ width="500px"
|
|
|
+ @uploadSuccess="uploadAudioSuccess"
|
|
|
+ :style="{ marginBottom: data.audio_data.url.length === 0 ? '5px' : '' }"
|
|
|
+ />
|
|
|
<div v-if="data.audio_data.url.length > 0" class="upload-file">
|
|
|
<div class="file-name">
|
|
|
<span>
|
|
@@ -345,7 +351,7 @@
|
|
|
</div>
|
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile('audio')" />
|
|
|
</div>
|
|
|
- <SelectUpload label="lrc 文件" :limit="1" type="lrc" width="500px" @uploadSuccess="uploadLrcSuccess" />
|
|
|
+ <SelectUpload label="音频字幕(lrc)文件" :limit="1" type="lrc" width="500px" @uploadSuccess="uploadLrcSuccess" />
|
|
|
<div v-if="data.lrc_data.url.length > 0" class="upload-file">
|
|
|
<div class="file-name">
|
|
|
<span>
|
|
@@ -369,9 +375,16 @@
|
|
|
</div>
|
|
|
<div class="adult-book-input-item">
|
|
|
<span class="adult-book-lable"></span>
|
|
|
+ <el-button size="small" type="primary" @click="openCheckSubtitles">校对字幕</el-button>
|
|
|
<el-button type="primary" size="small" class="distribution" @click="parseLrcFile"> 分配时间 </el-button>
|
|
|
<el-button @click="handleMultilingual">多语言</el-button>
|
|
|
</div>
|
|
|
+ <CheckSubtitles
|
|
|
+ :visible.sync="visible"
|
|
|
+ :audio-id="data.audio_data.file_id"
|
|
|
+ :option-list="subtitleList"
|
|
|
+ @saveSubtitles="saveSubtitles"
|
|
|
+ />
|
|
|
<MultilingualFill
|
|
|
:visible.sync="multilingualVisible"
|
|
|
:text="multilingualText"
|
|
@@ -387,6 +400,7 @@ import ModuleMixin from '../../common/ModuleMixin';
|
|
|
import SoundRecord from '@/views/book/courseware/create/components/question/fill/components/SoundRecord.vue';
|
|
|
import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
|
|
|
import UploadPicture from './components/UploadPicture.vue';
|
|
|
+import CheckSubtitles from '@/views/book/courseware/create/components/question/voice_matrix/CheckSubtitles.vue';
|
|
|
|
|
|
import { getNewWordData, getOption } from '@/views/book/courseware/data/newWord';
|
|
|
import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
|
|
@@ -401,6 +415,7 @@ export default {
|
|
|
SoundRecord,
|
|
|
UploadAudio,
|
|
|
UploadPicture,
|
|
|
+ CheckSubtitles,
|
|
|
},
|
|
|
mixins: [ModuleMixin],
|
|
|
data() {
|
|
@@ -410,6 +425,8 @@ export default {
|
|
|
isWordTime: false,
|
|
|
loading: false,
|
|
|
multilingualText: '',
|
|
|
+ visible: false,
|
|
|
+ subtitleList: [],
|
|
|
};
|
|
|
},
|
|
|
watch: {
|
|
@@ -424,9 +441,9 @@ export default {
|
|
|
*/
|
|
|
parseLrcFile() {
|
|
|
if (this.data.lrc_data.file_id.length === 0) {
|
|
|
- return this.$message.warning('请先上传lrc文件');
|
|
|
+ return this.$message.warning('请先上传音频字幕(lrc)文件');
|
|
|
}
|
|
|
- const loading = this.$loading({ text: '解析lrc文件中' });
|
|
|
+ const loading = this.$loading({ text: '解析音频字幕(lrc)文件中' });
|
|
|
GetStaticResources('tool-ParseLRCFile', {
|
|
|
content_type: 'FILE',
|
|
|
file_id: this.data.lrc_data.file_id,
|
|
@@ -726,6 +743,41 @@ export default {
|
|
|
});
|
|
|
this.multilingualVisible = true;
|
|
|
},
|
|
|
+ /**
|
|
|
+ * 打开校对字幕
|
|
|
+ */
|
|
|
+ openCheckSubtitles() {
|
|
|
+ if (this.data.audio_data.url.length === 0) {
|
|
|
+ return this.$message.warning('请先上传音频文件');
|
|
|
+ }
|
|
|
+ this.subtitleList = [];
|
|
|
+ this.data.new_word_list.forEach((item, index) => {
|
|
|
+ let obj = {
|
|
|
+ content: item.new_word,
|
|
|
+ lrc_data: {
|
|
|
+ begin_time: this.data.lrc_arr[index] ? this.data.lrc_arr[index].bg : 0,
|
|
|
+ end_time: this.data.lrc_arr[index] ? this.data.lrc_arr[index].ed : 0,
|
|
|
+ },
|
|
|
+ };
|
|
|
+ this.subtitleList.push(obj);
|
|
|
+ });
|
|
|
+ this.visible = true;
|
|
|
+ },
|
|
|
+ /**
|
|
|
+ * 保存字幕
|
|
|
+ * @param {Array} dataList
|
|
|
+ */
|
|
|
+ saveSubtitles(dataList) {
|
|
|
+ let lrc_list_res = [];
|
|
|
+ dataList.forEach((item) => {
|
|
|
+ let obj = {
|
|
|
+ bg: item.lrc_data.begin_time,
|
|
|
+ ed: item.lrc_data.end_time,
|
|
|
+ };
|
|
|
+ lrc_list_res.push(obj);
|
|
|
+ });
|
|
|
+ this.data.lrc_arr = lrc_list_res;
|
|
|
+ },
|
|
|
},
|
|
|
};
|
|
|
</script>
|