From 4b4c0943d8710912fe575b1ed73128c2ab5933f7 Mon Sep 17 00:00:00 2001 From: sunli_tydic Date: Fri, 21 Nov 2025 14:30:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=94=B9=E5=8A=A8=E6=A0=87?= =?UTF-8?q?=E8=AF=86=20=20ai=E6=92=AD=E6=94=BE=E5=99=A8=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 44 ++- src/components/VideoPlayer/index.vue | 22 +- src/store/getters.js | 1 + src/store/index.js | 2 +- src/store/modules/video.js | 2 +- src/views/course/ManageList.vue | 452 ++++++++++++++------------- src/views/portal/course/Index.vue | 5 +- src/views/study/coursenew.vue | 12 +- 8 files changed, 313 insertions(+), 227 deletions(-) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 60c2fa4c..4542e815 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -158,6 +158,45 @@ placeholder="请尽量填写课程简介,用于列表中显示,可以让用户更容易了解课程信息"> + +
+
+
+ + + + AI处理状态: +
+ +
+
+ + + 是否需要生成AI摘要: + + + + + + + 是否需要生成AI文稿: + + + + + + + + + 请选择该课程所支持的语种: + + + + + +
+
+
@@ -329,6 +368,7 @@ placeholder="请尽量填写课程简介,用于列表中显示,可以让用户更容易了解课程信息"> +
@@ -338,7 +378,7 @@ AI处理状态:
- +
@@ -581,6 +621,7 @@ export default { this.getSceneData(); }, computed: { + // ai播放器相关 ...mapGetters(['resOwnerMap', 'sysTypeMap','userInfo','identity', 'selectAllLang']), catalogTree() { let treeList = []; @@ -990,6 +1031,7 @@ export default { this.dicts = result.dicts; //课程的老师信息 console.log("--- 编辑查看 this.isPermission = ",this.isPermission) console.log("--- 编辑查看 this.dicts = ",this.dicts) + // ai播放器相关 // 如果ai设置为空则给默认值 - 会看成新增状态 if(this.courseInfo.aiSet === null || this.courseInfo.aiSet === '' || this.courseInfo.aiSet === undefined){ this.courseInfo.isAddAI = 1; //暂时是否是新增 diff --git a/src/components/VideoPlayer/index.vue b/src/components/VideoPlayer/index.vue index bb6dc28f..33216033 100644 --- a/src/components/VideoPlayer/index.vue +++ b/src/components/VideoPlayer/index.vue @@ -119,6 +119,7 @@
{{ currentTimeFormat }} / {{ fullTimeFormat }}
+
@@ -329,14 +330,17 @@ export default { fullTimeFormat: "00:00:00", // 视频总长度的文字 barrageTimelineStart: 0, // 弹幕时间轴的起始时间点(手动调整进度条触发更新) isInit:false, // 是否初始化过 + // ai播放器相关 isSubtitle: true, // 是否开启字幕 currentLangLabel:'', // 当前字幕语言 }; }, + // ai播放器相关 computed: { ...mapGetters(['selectableLang','currentLang']) }, created() { + // ai播放器相关 this.SET_currentLang(''); }, mounted() { @@ -350,7 +354,7 @@ export default { } setInterval(() => { - // console.log('当前状态:',this.currentProgress,this.isDrag,this.videoDom.currentTime , this.videoDom.duration) + console.log('当前状态:',this.currentProgress,this.isDrag,this.videoDom.currentTime , this.videoDom.duration) // 视频播放时本地记录视频实时播放时长,视频设置了禁止拖动时执行 if(!this.isDrag){ var time = localStorage.getItem('videoProgressData') @@ -397,7 +401,7 @@ export default { } // 根据视频的readyState判断下一帧是否已加载,并控制loading的显示 this.isShowLoading = this.videoDom.readyState < 3; - // console.log("当前缓存:"+this.videoDom.readyState) + console.log("当前缓存:"+this.videoDom.readyState) if (this.videoDom.readyState < 3){ console.log("详细信息",this.videoDom) console.log("卡了",this.videoDom.readyState) @@ -444,6 +448,7 @@ export default { // }); }, methods: { + // ai播放器相关 ...mapMutations({ SET_currentLang: 'video/SET_currentLang', SET_currentTime: 'video/SET_currentTime', @@ -661,6 +666,7 @@ export default { }, onAudioTimeUpdate() { const currentTime = this.$refs.video.currentTime; + // ai播放器相关 this.SET_currentTime(currentTime) this.$emit('onTimeUpdate', currentTime); }, @@ -680,7 +686,7 @@ export default { } } }, - /** + /** ai播放器相关 * 切换字幕 */ toggleSubtitle(value) { @@ -688,13 +694,13 @@ export default { if (!value) { // 关闭字幕 this.videoDom.textTracks[this.videoDom.textTracks.length - 1].mode = 'hidden'; - } else { + } else { // 打开字幕 this.videoDom.textTracks[this.videoDom.textTracks.length - 1].mode = 'showing'; } } }, - /** + /** ai播放器相关 * 切换字幕语言 */ changeLang(item) { @@ -721,17 +727,17 @@ export default { trackEl.label = item.label; trackEl.src = item.srcUrl; trackEl.default = true; // 确保字幕默认启用 - + // 使用箭头函数保持this上下文 trackEl.addEventListener('load', () => { console.log('字幕加载成功!'); // console.log('#########Track cues:', trackEl.track.cues); }); - + trackEl.addEventListener('error', () => { console.error('字幕加载失败!'); }); - + // 确保视频已加载到可添加轨道的状态 if (this.videoDom.readyState >= 1) { this.videoDom.appendChild(trackEl); diff --git a/src/store/getters.js b/src/store/getters.js index 2cad1d9d..38aac938 100644 --- a/src/store/getters.js +++ b/src/store/getters.js @@ -28,6 +28,7 @@ const getters = { studyTaskCount:state => state.user.studyTaskCount, praisesUnicom:state =>state.pdf.praisesUnicom, favoritesUnicom:state =>state.pdf.favoritesUnicom, + // ai播放器相关 selectAllLang:state => state.video.selectAllLang, selectableLang:state => state.video.selectableLang, currentLang:state => state.video.currentLang, diff --git a/src/store/index.js b/src/store/index.js index faccd58e..a44d8dba 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -12,7 +12,7 @@ import resOwner from './modules/resOwner' import majorType from './modules/majorType' import orgDomain from './modules/orgDomain' import pdf from './modules/pdf' -import video from './modules/video' +import video from './modules/video' // ai播放器相关 Vue.use(Vuex) diff --git a/src/store/modules/video.js b/src/store/modules/video.js index ad53723e..e91c2388 100644 --- a/src/store/modules/video.js +++ b/src/store/modules/video.js @@ -1,4 +1,4 @@ - +// ai播放器相关 const state = { selectAllLang: [ { diff --git a/src/views/course/ManageList.vue b/src/views/course/ManageList.vue index 64ce0679..962144c8 100644 --- a/src/views/course/ManageList.vue +++ b/src/views/course/ManageList.vue @@ -60,19 +60,21 @@
搜索 - 重置 + 重置
- - - 新建课程 - 设置语种 - 开启AI处理 - + + + + 新建课程 + 设置语种 + 开启AI处理 +
+ @@ -139,6 +141,7 @@