|
@@ -42,7 +42,9 @@
|
|
|
/>
|
|
|
<div v-else-if="data.other.audio_generation_method === 'auto'" class="auto-matically">
|
|
|
<AudioPlay :file-id="item.audio_file_id" theme-color="gray" v-if="item.audio_file_id" />
|
|
|
- <span class="auto-btn" @click="handleMatically(item)">自动生成</span>
|
|
|
+ <span class="auto-btn" @click="handleMatically(item)" v-loading="item.loading">{{
|
|
|
+ item.audio_file_id ? '已生成' : '自动生成'
|
|
|
+ }}</span>
|
|
|
</div>
|
|
|
<SoundRecord v-else :wav-blob.sync="item.audio_file_id" />
|
|
|
<SvgIcon icon-class="delete" class="delete pointer" @click="deleteOption(i, item.audio_file_id)" />
|
|
@@ -195,6 +197,7 @@ export default {
|
|
|
// 自动生成音频
|
|
|
handleMatically(item) {
|
|
|
if (item.content.trim()) {
|
|
|
+ this.$set(item, 'loading', true);
|
|
|
if (!this.matically_pinyin_obj[item.mark]) {
|
|
|
this.handleItemAnswer(item);
|
|
|
}
|
|
@@ -202,13 +205,18 @@ export default {
|
|
|
let data = {
|
|
|
pinyin: this.matically_pinyin_obj[item.mark],
|
|
|
};
|
|
|
- GetStaticResources(MethodName, data).then((res) => {
|
|
|
- if (res.status === 1) {
|
|
|
- this.data.file_id_list.splice(this.data.file_id_list.indexOf(item.file_id), 1);
|
|
|
- item.audio_file_id = res.file_id;
|
|
|
- this.data.file_id_list.push(res.file_id);
|
|
|
- }
|
|
|
- });
|
|
|
+ GetStaticResources(MethodName, data)
|
|
|
+ .then((res) => {
|
|
|
+ item.loading = false;
|
|
|
+ if (res.status === 1) {
|
|
|
+ this.data.file_id_list.splice(this.data.file_id_list.indexOf(item.file_id), 1);
|
|
|
+ item.audio_file_id = res.file_id;
|
|
|
+ this.data.file_id_list.push(res.file_id);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ item.loading = false;
|
|
|
+ });
|
|
|
}
|
|
|
},
|
|
|
handleReplaceTone(value, mark) {
|