shenrongliang
2025-04-17 8e41f2cf9a29faa2f214235e5137f8fe27542de7
Merge remote-tracking branch 'origin/master'
已修改1个文件
46 ■■■■ 文件已修改
easegen-front/src/views/myCourse/index.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
easegen-front/src/views/myCourse/index.vue
@@ -39,7 +39,7 @@
          <el-link type="primary" @click="goDetail(scope.row.courseId)">{{ scope.row.courseName }}</el-link>
        </template>
      </el-table-column>
      <el-table-column :label="t('myCourse.status')" align="center" prop="status" width="120">
      <el-table-column :label="t('myCourse.status')" align="center" prop="status" width="140">
        <template #default="scope">
          <dict-tag v-if="scope.row.status==2 && scope.row.subtitlesAddStatus!=null" :type="DICT_TYPE.video_zi" :value="scope.row.subtitlesAddStatus" />
          <dict-tag v-else :type="DICT_TYPE.VIDEO_STATUS" :value="scope.row.status" />
@@ -119,15 +119,19 @@
              >
                片头片尾
              </el-button>
            </template>
            <template  v-if="scope.row.status !=1">
              <el-button
                type="danger"
                link
                @click="handleDelete(scope.row.id)"
                v-if="scope.row.status == 2 || scope.row.status==3 || scope.row.status==4"
              >
                {{ t('action.del') }}
              </el-button>
            </template>
          </el-button-group>
        </template>
      </el-table-column>
@@ -151,6 +155,7 @@
    title="字幕查看修改"
    width="70%"
    class="subtitle-dialog"
    @close="pauseAllVideos('subtitle')"
  >
    <el-tabs v-model="activeSubtitleTab">
      <el-tab-pane label="字幕设置" name="setting">
@@ -242,8 +247,9 @@
          <el-col :span="24">
            <div class="preview-section">
              <h4>字幕视频</h4>
              <div class="video-container">
              <div class="video-container video-container1">
                <video
                  ref="subtitleVideo"
                  v-if="subtitleForm.videoUrl"
                  :src="subtitleForm.videoUrl"
                  controls
@@ -272,6 +278,7 @@
    v-model="headerFooterDialogVisible"
    title="片头片尾设置"
    width="70%"
    @close="pauseAllVideos('headerFooter')"
  >
    <el-tabs v-model="activeTab">
      <el-tab-pane label="设置片头片尾" name="setting">
@@ -300,7 +307,7 @@
              <el-form-item label="片头视频">
                <div class="video-container">
                  <video
                    v-if="formData1.value?.titles"
                    v-if="formData1.value.titles"
                    :src="formData1.value.titles"
                    controls
                    class="preview-video"
@@ -314,7 +321,7 @@
              <el-form-item label="片尾视频">
                <div class="video-container">
                  <video
                    v-if="formData1.value?.trailer"
                    v-if="formData1.value.trailer"
                    :src="formData1.value.trailer"
                    controls
                    class="preview-video"
@@ -347,6 +354,7 @@
              <h4>视频</h4>
              <div class="video-container">
                <video
                  ref="mainVideo"
                  v-if="formData1.value?.videoUrl || formData1.value?.previewUrl"
                  :src="formData1.value?.videoUrl || formData1.value?.previewUrl"
                  controls
@@ -370,6 +378,7 @@
              <h4>片头片尾视频</h4>
              <div class="video-container">
                <video
                  ref="compositeVideo"
                  v-if="formData1.value?.compositeVideo"
                  :src="formData1.value.compositeVideo"
                  controls
@@ -434,6 +443,10 @@
const message = useMessage()
const { t } = useI18n()
const polling = ref(false)
// 添加视频ref
const subtitleVideo = ref<HTMLVideoElement | null>(null)
const mainVideo = ref<HTMLVideoElement | null>(null)
const compositeVideo = ref<HTMLVideoElement | null>(null)
let pollingTimer: number | null = null
//合成片头片尾视频
const dialogVisible = ref(false)
@@ -441,6 +454,7 @@
  isvideo: 2,
  id: null as number | null
})
// 视频列表相关数据
const loading = ref(true)
const total = ref(0)
@@ -526,7 +540,20 @@
    videoRef.value.open(row.previewUrl, row.subtitlesVttUrl)
  }
}
const pauseAllVideos = (dialogType: 'subtitle' | 'headerFooter') => {
  if (dialogType === 'subtitle' && subtitleVideo.value) {
    subtitleVideo.value.pause()
  }
  if (dialogType === 'headerFooter') {
    if (mainVideo.value) {
      mainVideo.value.pause()
    }
    if (compositeVideo.value) {
      compositeVideo.value.pause()
    }
  }
}
// 删除视频
const handleDelete = async (id: number) => {
  try {
@@ -1024,8 +1051,10 @@
      }
      const res = await pptTemplateApi.createVideoMeger(obj)
      if (res) {
        message.success('视频合成任务已提交,请稍后查看')
        getList()
        message.success('合成成功')
        const details = await pptTemplateApi.myCourseDetail(headerFooterForm.id!)
        formData1.value = details
        activeTab.value='preview'
      }
    } else if (formData1.isvideo == '1') {
      obj = {
@@ -1244,4 +1273,7 @@
  font-size: 14px;
  background: #f5f7fa;
}
.video-container1{
  height: 490px !important;
}
</style>