|
@@ -205,7 +205,6 @@
|
|
|
<SelectUpload
|
|
<SelectUpload
|
|
|
label="生词音频"
|
|
label="生词音频"
|
|
|
type="audio"
|
|
type="audio"
|
|
|
- width="500px"
|
|
|
|
|
:style="{ marginBottom: data.audio_data.url.length === 0 ? '5px' : '' }"
|
|
:style="{ marginBottom: data.audio_data.url.length === 0 ? '5px' : '' }"
|
|
|
@uploadSuccess="uploadAudioSuccess"
|
|
@uploadSuccess="uploadAudioSuccess"
|
|
|
/>
|
|
/>
|
|
@@ -219,8 +218,9 @@
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile('audio')" />
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile('audio')" />
|
|
|
|
|
+ <ResourcesOperate :data="data.audio_data"></ResourcesOperate>
|
|
|
</div>
|
|
</div>
|
|
|
- <SelectUpload label="音频字幕(lrc)文件" :limit="1" type="lrc" width="500px" @uploadSuccess="uploadLrcSuccess" />
|
|
|
|
|
|
|
+ <SelectUpload label="音频字幕(lrc)文件" :limit="1" type="lrc" @uploadSuccess="uploadLrcSuccess" />
|
|
|
<div v-if="data.lrc_data.url.length > 0" class="upload-file">
|
|
<div v-if="data.lrc_data.url.length > 0" class="upload-file">
|
|
|
<div class="file-name">
|
|
<div class="file-name">
|
|
|
<span>
|
|
<span>
|
|
@@ -229,6 +229,7 @@
|
|
|
</span>
|
|
</span>
|
|
|
</div>
|
|
</div>
|
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile('lrc')" />
|
|
<SvgIcon icon-class="delete-black" size="12" @click="removeFile('lrc')" />
|
|
|
|
|
+ <ResourcesOperate :data="data.lrc_data"></ResourcesOperate>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="lrc-box" style="margin: 5px 0">
|
|
<div class="lrc-box" style="margin: 5px 0">
|
|
|
<div v-if="data.lrc_arr && data.lrc_arr.length > 0" class="lrc-box">
|
|
<div v-if="data.lrc_arr && data.lrc_arr.length > 0" class="lrc-box">
|
|
@@ -314,6 +315,8 @@ import SoundRecord from '@/views/book/courseware/create/components/question/fill
|
|
|
import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
|
|
import UploadAudio from '@/views/book/courseware/create/components/question/fill/components/UploadAudio.vue';
|
|
|
import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
|
|
import SelectUpload from '@/views/book/courseware/create/components/common/SelectUpload.vue';
|
|
|
import UploadPicture from '../new_word/components/UploadPicture.vue';
|
|
import UploadPicture from '../new_word/components/UploadPicture.vue';
|
|
|
|
|
+import ResourcesOperate from '../../common/ResourcesOperate.vue';
|
|
|
|
|
+
|
|
|
import { getWordTime, prepareTranscribe, fileToBase64Text, getWordTimes } from '@/api/article';
|
|
import { getWordTime, prepareTranscribe, fileToBase64Text, getWordTimes } from '@/api/article';
|
|
|
import { GetStaticResources, TextToAudioFile, GetTextToAudioConfParamList } from '@/api/app';
|
|
import { GetStaticResources, TextToAudioFile, GetTextToAudioConfParamList } from '@/api/app';
|
|
|
import { PinyinBuild_OldFormat } from '@/api/book';
|
|
import { PinyinBuild_OldFormat } from '@/api/book';
|
|
@@ -338,6 +341,7 @@ export default {
|
|
|
RichText,
|
|
RichText,
|
|
|
UploadPicture,
|
|
UploadPicture,
|
|
|
CheckSubtitles,
|
|
CheckSubtitles,
|
|
|
|
|
+ ResourcesOperate,
|
|
|
},
|
|
},
|
|
|
props: ['dataNewWord', 'unifiedAttrib'],
|
|
props: ['dataNewWord', 'unifiedAttrib'],
|
|
|
mixins: [ModuleMixin],
|
|
mixins: [ModuleMixin],
|
|
@@ -473,25 +477,33 @@ export default {
|
|
|
* @param {'audio' | 'lrc'} type
|
|
* @param {'audio' | 'lrc'} type
|
|
|
*/
|
|
*/
|
|
|
removeFile(type) {
|
|
removeFile(type) {
|
|
|
- if (type === 'audio') {
|
|
|
|
|
- this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.audio_data.file_id);
|
|
|
|
|
- this.data.audio_data = {
|
|
|
|
|
- name: '',
|
|
|
|
|
- media_duration: 0,
|
|
|
|
|
- temporary_url: '',
|
|
|
|
|
- url: '',
|
|
|
|
|
- file_id: '',
|
|
|
|
|
- };
|
|
|
|
|
- } else if (type === 'lrc') {
|
|
|
|
|
- this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.lrc_data.file_id);
|
|
|
|
|
- this.data.lrc_data = {
|
|
|
|
|
- name: '',
|
|
|
|
|
- url: '',
|
|
|
|
|
- id: '',
|
|
|
|
|
- file_id: '',
|
|
|
|
|
- };
|
|
|
|
|
- }
|
|
|
|
|
- this.data.lrc_arr = [];
|
|
|
|
|
|
|
+ this.$confirm('是否删除当前文件?', '提示', {
|
|
|
|
|
+ confirmButtonText: '确定',
|
|
|
|
|
+ cancelButtonText: '取消',
|
|
|
|
|
+ type: 'warning',
|
|
|
|
|
+ })
|
|
|
|
|
+ .then(() => {
|
|
|
|
|
+ if (type === 'audio') {
|
|
|
|
|
+ this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.audio_data.file_id);
|
|
|
|
|
+ this.data.audio_data = {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ media_duration: 0,
|
|
|
|
|
+ temporary_url: '',
|
|
|
|
|
+ url: '',
|
|
|
|
|
+ file_id: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ } else if (type === 'lrc') {
|
|
|
|
|
+ this.data.file_id_list = this.data.file_id_list.filter((item) => item !== this.data.lrc_data.file_id);
|
|
|
|
|
+ this.data.lrc_data = {
|
|
|
|
|
+ name: '',
|
|
|
|
|
+ url: '',
|
|
|
|
|
+ id: '',
|
|
|
|
|
+ file_id: '',
|
|
|
|
|
+ };
|
|
|
|
|
+ }
|
|
|
|
|
+ this.data.lrc_arr = [];
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(() => {});
|
|
|
},
|
|
},
|
|
|
uploads(file_id, index) {
|
|
uploads(file_id, index) {
|
|
|
this.data.new_word_list[index].mp3_list = file_id;
|
|
this.data.new_word_list[index].mp3_list = file_id;
|