|
@@ -332,7 +332,7 @@
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
<el-button @click="cancel">取消</el-button>
|
|
|
- <el-button type="primary" @click="submitForm" :disabled="isUploading">
|
|
|
+ <el-button type="primary" @click="submitForm" :loading="add" :disabled="isUploading || add">
|
|
|
{{ isUploading ? '上传中...' : '保存' }}
|
|
|
</el-button>
|
|
|
</div>
|
|
@@ -406,6 +406,11 @@
|
|
|
{{ getTypeName(scope.row.typeId) }}
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column label="子分类" align="center" min-width="100">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ {{ getTypeName(scope.row.typeSubId) }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="关联项目" align="center" min-width="100">
|
|
|
<template slot-scope="scope">
|
|
|
<a
|
|
@@ -522,7 +527,7 @@
|
|
|
|
|
|
<div class="dialog-footer">
|
|
|
<el-button @click="cancelBatch">取 消</el-button>
|
|
|
- <el-button type="primary" @click="submitBatchAdd">保 存</el-button>
|
|
|
+ <el-button type="primary" :loading="add" :disabled="add || isUploading" @click="submitBatchAdd">保 存</el-button>
|
|
|
</div>
|
|
|
<!-- 批量上传视频弹窗 -->
|
|
|
<el-dialog
|
|
@@ -1094,9 +1099,10 @@ export default {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
if (this.add){
|
|
|
- this.$message.warning("文件上传中,请稍后再试")
|
|
|
+ this.$message.warning("请勿重复提交")
|
|
|
return
|
|
|
}
|
|
|
+ this.add = true
|
|
|
|
|
|
const params = Object.assign({}, this.form);
|
|
|
params.projectIds = this.form.projectIds.join(',');
|
|
@@ -1107,7 +1113,7 @@ export default {
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
} else {
|
|
|
addVideoResource(params).then(response => {
|
|
|
if (response.code === 200) {
|
|
@@ -1115,7 +1121,7 @@ export default {
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -1273,7 +1279,7 @@ export default {
|
|
|
this.uploadCancellationTokens.set(form.tempId, tokens);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
let line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
|
|
|
form.fileKey = data.urlPath.substring(1);
|
|
|
form.videoUrl = line_1;
|
|
@@ -1310,7 +1316,7 @@ export default {
|
|
|
this.uploadCancellationTokens.set(form.tempId, tokens);
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
form.line2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
|
|
|
|
|
|
// 更新线路2状态为成功
|
|
@@ -1355,7 +1361,7 @@ export default {
|
|
|
const file = options.file;
|
|
|
this.getMediaDuration(file);
|
|
|
this.currentUploadProgress = { total: 0, line1: 0, line2: 0, line1Status: 'pending', line2Status: 'pending' };
|
|
|
-
|
|
|
+
|
|
|
try {
|
|
|
await this.getFirstThumbnail(file, this.form);
|
|
|
const [line1Result, line2Result] = await Promise.allSettled([
|
|
@@ -1414,6 +1420,7 @@ export default {
|
|
|
/** 批量新增 */
|
|
|
handleBatchAdd() {
|
|
|
this.batchAddVisible = true;
|
|
|
+ this.add =false
|
|
|
this.videoList = []; // 清空之前的视频列表
|
|
|
},
|
|
|
/** 批量修改 */
|
|
@@ -1486,12 +1493,24 @@ export default {
|
|
|
},
|
|
|
/** 提交批量添加 */
|
|
|
submitBatchAdd() {
|
|
|
+ if (this.videoList.length === 0) {
|
|
|
+ this.$message.warning("请选择视频");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
// 检查是否所有选中的视频都已上传完成
|
|
|
const incompleteVideos = this.videoList.filter(item => (item.progress || 0) < 100);
|
|
|
if (incompleteVideos.length > 0) {
|
|
|
this.$message.warning('有未完成上传的视频,请先完成上传');
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ if (this.add){
|
|
|
+ this.$message.warning("请勿重复提交")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.add = true
|
|
|
+
|
|
|
// 调用批量添加API
|
|
|
const videoList = JSON.parse(JSON.stringify(this.videoList));
|
|
|
videoList.forEach(item => {
|
|
@@ -1503,7 +1522,7 @@ export default {
|
|
|
this.batchAddVisible = false;
|
|
|
this.getList();
|
|
|
}
|
|
|
- });
|
|
|
+ })
|
|
|
},
|
|
|
/** 获取分类名称 */
|
|
|
getTypeName(typeId) {
|
|
@@ -1564,7 +1583,7 @@ export default {
|
|
|
console.error('Error cancelling COS upload:', error);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Cancel OBS upload if exists
|
|
|
if (cancellationTokens.obs) {
|
|
|
try {
|
|
@@ -1574,7 +1593,7 @@ export default {
|
|
|
console.error('Error cancelling OBS upload:', error);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Remove cancellation tokens
|
|
|
this.uploadCancellationTokens.delete(row.tempId);
|
|
|
}
|
|
@@ -1716,6 +1735,7 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ this.isUploading = true;
|
|
|
this.isProcessingBatch = true;
|
|
|
|
|
|
while (this.uploadQueue.length > 0) {
|
|
@@ -1750,6 +1770,7 @@ export default {
|
|
|
}
|
|
|
|
|
|
this.isProcessingBatch = false;
|
|
|
+ this.isUploading = false;
|
|
|
this.$message.success('所有视频上传队列处理完成!');
|
|
|
},
|
|
|
|
|
@@ -2082,7 +2103,7 @@ export default {
|
|
|
console.error('Error cancelling COS upload:', error);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Cancel OBS upload if exists
|
|
|
if (cancellationTokens.obs) {
|
|
|
try {
|
|
@@ -2092,7 +2113,7 @@ export default {
|
|
|
console.error('Error cancelling OBS upload:', error);
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
// Remove cancellation tokens
|
|
|
this.uploadCancellationTokens.delete(row.tempId);
|
|
|
}
|
|
@@ -2176,7 +2197,7 @@ export default {
|
|
|
tokens.cos = uploadInfo.cancel;
|
|
|
this.uploadCancellationTokens.set(tempVideo.tempId, tokens);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
let line_1 = `${process.env.VUE_APP_VIDEO_LINE_1}${data.urlPath}`;
|
|
|
tempVideo.fileKey = data.urlPath.substring(1);
|
|
|
tempVideo.videoUrl = line_1;
|
|
@@ -2202,7 +2223,7 @@ export default {
|
|
|
tokens.obs = uploadInfo.cancel;
|
|
|
this.uploadCancellationTokens.set(tempVideo.tempId, tokens);
|
|
|
});
|
|
|
-
|
|
|
+
|
|
|
tempVideo.line2 = `${process.env.VUE_APP_VIDEO_LINE_2}/${data.urlPath}`;
|
|
|
return { success: true, url: tempVideo.line2 };
|
|
|
} catch (error) {
|