|
|
@@ -984,10 +984,12 @@ export default {
|
|
|
},
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
- this.$refs.videoUpload.clearFiles()
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
+ this.resetForm("form");
|
|
|
+ this.batchUpdateVisible = false;
|
|
|
this.changeCateType(this.queryParams.typeId)
|
|
|
+ this.$refs.videoUpload.clearFiles()
|
|
|
},
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
@@ -1429,8 +1431,7 @@ export default {
|
|
|
this.$message.warning("请至少选择一条数据");
|
|
|
return;
|
|
|
}
|
|
|
- this.batchUpdateForm.typeId = null;
|
|
|
- this.batchUpdateForm.typeSubId = null;
|
|
|
+ this.resetForm("form");
|
|
|
this.batchUpdateForm.ids = this.ids; // 将选中的ID传递给批量修改表单
|
|
|
this.batchUpdateVisible = true;
|
|
|
},
|
|
|
@@ -2063,108 +2064,6 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- /** 删除视频 */
|
|
|
- handleDeleteVideo(row) {
|
|
|
- if (row.uploadStatus === 'uploading') {
|
|
|
- this.$confirm('该视频正在上传中,确认要取消上传并删除吗?', '取消上传', {
|
|
|
- confirmButtonText: '确定取消',
|
|
|
- cancelButtonText: '继续上传',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- // Cancel the upload and remove from list
|
|
|
- this.cancelVideoUpload(row);
|
|
|
- }).catch(() => {
|
|
|
- // User chose to continue uploading
|
|
|
- this.$message.info('继续上传该视频');
|
|
|
- });
|
|
|
- } else {
|
|
|
- // Original confirmation for non-uploading videos
|
|
|
- this.$confirm('确认要从列表中删除该视频吗?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- this.removeVideoFromList(row);
|
|
|
- }).catch(() => {
|
|
|
- // 取消删除
|
|
|
- });
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- cancelVideoUpload(row) {
|
|
|
- const cancellationTokens = this.uploadCancellationTokens.get(row.tempId);
|
|
|
- if (cancellationTokens) {
|
|
|
- // Cancel COS upload if exists
|
|
|
- if (cancellationTokens.cos) {
|
|
|
- try {
|
|
|
- cancellationTokens.cos();
|
|
|
- console.log('COS upload cancelled for video:', row.tempId);
|
|
|
- } catch (error) {
|
|
|
- console.error('Error cancelling COS upload:', error);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // Cancel OBS upload if exists
|
|
|
- if (cancellationTokens.obs) {
|
|
|
- try {
|
|
|
- cancellationTokens.obs();
|
|
|
- console.log('OBS upload cancelled for video:', row.tempId);
|
|
|
- } catch (error) {
|
|
|
- console.error('Error cancelling OBS upload:', error);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- // Remove cancellation tokens
|
|
|
- this.uploadCancellationTokens.delete(row.tempId);
|
|
|
- }
|
|
|
-
|
|
|
- const videoIndex = this.videoList.findIndex(item => item.tempId === row.tempId);
|
|
|
- if (videoIndex !== -1) {
|
|
|
- this.videoList[videoIndex].uploadStatus = 'cancelled';
|
|
|
- this.videoList.splice(videoIndex, 1);
|
|
|
- }
|
|
|
-
|
|
|
- const queueIndex = this.uploadQueue.findIndex(item => item.tempId === row.tempId);
|
|
|
- if (queueIndex !== -1) {
|
|
|
- this.uploadQueue.splice(queueIndex, 1);
|
|
|
- this.updateQueuePositions();
|
|
|
- }
|
|
|
-
|
|
|
- this.$message.success('已取消视频上传并从列表中移除');
|
|
|
- },
|
|
|
-
|
|
|
- removeVideoFromList(row) {
|
|
|
- const videoIndex = this.videoList.findIndex(item => item.tempId === row.tempId);
|
|
|
- if (videoIndex !== -1) {
|
|
|
- this.videoList.splice(videoIndex, 1);
|
|
|
- }
|
|
|
-
|
|
|
- // Remove from upload queue if it's still queued
|
|
|
- const queueIndex = this.uploadQueue.findIndex(item => item.tempId === row.tempId);
|
|
|
- if (queueIndex !== -1) {
|
|
|
- this.uploadQueue.splice(queueIndex, 1);
|
|
|
- this.updateQueuePositions();
|
|
|
- this.$message.success('已从上传队列中移除该视频');
|
|
|
- } else {
|
|
|
- this.$message.success('已从列表中移除该视频');
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- getUploadStatusText(status, queuePosition) {
|
|
|
- switch (status) {
|
|
|
- case 'success':
|
|
|
- return '上传成功';
|
|
|
- case 'failed':
|
|
|
- return '上传失败';
|
|
|
- case 'uploading':
|
|
|
- return '上传中';
|
|
|
- case 'queued':
|
|
|
- return `队列中 (第${queuePosition}位)`;
|
|
|
- default:
|
|
|
- return '待上传';
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
getQueueStatusColor(status) {
|
|
|
switch (status) {
|
|
|
case 'success':
|