|
@@ -20,7 +20,7 @@
|
|
|
type="primary"
|
|
|
size="small"
|
|
|
class="distribution"
|
|
|
- @click="distribution"
|
|
|
+ @click="parseLrcFile"
|
|
|
>
|
|
|
分配lrc
|
|
|
</el-button>
|
|
@@ -237,23 +237,29 @@ export default {
|
|
|
loading.close();
|
|
|
this.curQue.lrc_arr = lrc_list;
|
|
|
this.distribution();
|
|
|
+ }).catch(() => {
|
|
|
+ loading.close();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- parseFile(file_id) {
|
|
|
+ parseLrcFile() {
|
|
|
+ let lrcList = this.curQue.lrc_list;
|
|
|
+ if (lrcList.length === 0) {
|
|
|
+ return this.$message.warning('请先上传lrc文件');
|
|
|
+ }
|
|
|
getContentFile("tool-ParseLRCFile", {
|
|
|
content_type: "FILE",
|
|
|
- file_id
|
|
|
+ file_id: this.curQue.lrc_list[0].file_id
|
|
|
}).then(({ lrc_list }) => {
|
|
|
this.curQue.lrc_arr = lrc_list;
|
|
|
+ this.distribution();
|
|
|
});
|
|
|
},
|
|
|
|
|
|
distribution() {
|
|
|
- let lrcList = this.curQue.lrc_list;
|
|
|
let lrcArr = this.curQue.lrc_arr;
|
|
|
- if (lrcList.length === 0 && lrcArr.length === 0) {
|
|
|
- return this.$message.warning("请先上传lrc文件");
|
|
|
+ if (lrcArr.length === 0) {
|
|
|
+ return this.$message.warning("没有标记可分配");
|
|
|
}
|
|
|
let curIndex = 0;
|
|
|
this.curQue.voiceMatrix.matrix.forEach(row => {
|
|
@@ -277,12 +283,13 @@ export default {
|
|
|
const articleImgRes = [];
|
|
|
articleImgList.forEach(({ response, name }) => {
|
|
|
if (response) {
|
|
|
+ let fileList = response.file_info_list[0];
|
|
|
articleImgRes.push({
|
|
|
name,
|
|
|
- media_duration: response.file_info_list[0].media_duration,
|
|
|
- temporary_url: response.file_info_list[0].file_url,
|
|
|
- url: "[FID##" + response.file_info_list[0].file_id + "##FID]",
|
|
|
- file_id: response.file_info_list[0].file_id
|
|
|
+ media_duration: fileList.media_duration,
|
|
|
+ temporary_url: fileList.file_url,
|
|
|
+ url: "[FID##" + fileList.file_id + "##FID]",
|
|
|
+ file_id: fileList.file_id
|
|
|
});
|
|
|
}
|
|
|
});
|
|
@@ -298,9 +305,9 @@ export default {
|
|
|
name,
|
|
|
duration: fileList.media_duration,
|
|
|
url: fileList.file_url,
|
|
|
- id: "[FID##" + fileList.file_id + "##FID]"
|
|
|
+ id: "[FID##" + fileList.file_id + "##FID]",
|
|
|
+ file_id: fileList.file_id
|
|
|
});
|
|
|
- this.parseFile(fileList.file_id);
|
|
|
}
|
|
|
});
|
|
|
this.curQue.lrc_list = lrc_list;
|