| | |
| | | <!-- {{ formatDuration(scope.row.duration) }}--> |
| | | <!-- </template>--> |
| | | <!-- </el-table-column>--> |
| | | <el-table-column label="排队个数" align="center" prop="pos" /> |
| | | <el-table-column label="排队个数" align="center" prop="pos" > |
| | | <template #default="scope"> |
| | | <span v-if="scope.row.pos==0">视频正在合成...</span> |
| | | <span v-else>{{ scope.row.pos }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="进度" align="center" prop="progressVideo"> |
| | | <template #default="scope"> |
| | | {{ calculateProgress(scope.row.progressVideo) }}% |
| | | <span v-if="scope.row.status==2">100%</span> |
| | | <span v-else>{{ calculateProgress(scope.row.progressVideo) }}%</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | |
| | | subtitleDialogVisible.value = true |
| | | subtitleForm.videoId = videoId |
| | | const videoDetail = await pptTemplateApi.myCourseDetail(videoId) |
| | | console.log('视频详情:', videoDetail) |
| | | |
| | | |
| | | // 立即获取视频详情检查字幕状态 |
| | | subtitleForm.subtitlesAddStatus=videoDetail.subtitlesAddStatus |
| | | if (videoDetail.subtitlesAddStatus === 2) { |
| | | subtitleForm.videoUrl = videoDetail.videoUrl || '' |
| | | generating.value=false |
| | | polling.value=false |
| | | |
| | | }else if (videoDetail.subtitlesAddStatus === 1) { |
| | | generating.value=true |
| | | polling.value=true |
| | | } |
| | | if (videoDetail.subtitlesStatus === 2) { // 2 表示字幕已生成 |
| | | if (videoDetail.subtitlesUrl) { |
| | | subtitleForm.subtitlesUrl = videoDetail.subtitlesUrl |
| | | subtitleForm.courseName=videoDetail.courseName |
| | | generating.value=false |
| | | polling.value=false |
| | | try { |
| | | // 尝试从URL获取字幕内容 |
| | | const response = await fetch(videoDetail.subtitlesUrl) |
| | |
| | | // 直接使用字幕内容 |
| | | subtitleForm.content = videoDetail.subtitlesContent |
| | | } |
| | | } else { |
| | | } else if (videoDetail.subtitlesStatus === 3) { |
| | | // 字幕未生成或生成失败,清空内容 |
| | | subtitleForm.content = '' |
| | | }else if (videoDetail.subtitlesStatus === 1) { |
| | | generating.value=true |
| | | polling.value=true |
| | | } |
| | | } catch (error) { |
| | | console.error('获取视频详情失败:', error) |
| | | message.error('获取视频详情失败,请重试') |
| | | subtitleDialogVisible.value = false |
| | | } |
| | | console.log('视频详情:', generating) |
| | | } |
| | | |
| | | // 重置字幕表单 |