From 07b0659296bc26bf87b284e7e7259ea5cfa7cd77 Mon Sep 17 00:00:00 2001
From: du <13220750630.163.com>
Date: 星期四, 17 四月 2025 15:11:07 +0800
Subject: [PATCH] 我的视频

---
 easegen-front/src/views/myCourse/index.vue |   40 +++++++++++++++++++++++++++++++++++-----
 1 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/easegen-front/src/views/myCourse/index.vue b/easegen-front/src/views/myCourse/index.vue
index f203bcb..d532bb9 100644
--- a/easegen-front/src/views/myCourse/index.vue
+++ b/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 {
@@ -1244,4 +1271,7 @@
   font-size: 14px;
   background: #f5f7fa;
 }
+.video-container1{
+  height: 490px !important;
+}
 </style>

--
Gitblit v1.9.3