diff --git a/src/api/modules/courseAiVideo.js b/src/api/modules/courseAiVideo.js new file mode 100644 index 00000000..a13d23dc --- /dev/null +++ b/src/api/modules/courseAiVideo.js @@ -0,0 +1,141 @@ +import ajax from '@/utils/xajax.js' +const BASE_URL = process.env.NODE_ENV=='development'?'/aiVideo':''; + +/** + * AI摘要-摘要课程详情 + * @param {Object} data + * { + courseId: "COURSE_001"//课程id + } + */ +const getCourse = function(data) { + return ajax.postJson(BASE_URL+'/aiVideo/getCourse', data); +} + +/** + * AI摘要-摘要详情 + * @param {Object} data + * { + courseId: "COURSE_001"//课程id + } + */ +const selectVideoSummary = function(data) { + return ajax.postJson(BASE_URL+'/videoSummary/selectVideoSummary', data); +} + +/** + * AI摘要-更新摘要详情 + * @param {Object} data + * { + courseId:课程的id + summaryContent: 摘要内容 + } + */ +const updateVideoSummary = function(data) { + return ajax.postJson(BASE_URL+'/videoSummary/updateVideoSummary', data); +} + +/** + * AI摘要-根据视频id查询详情 + * @param {Object} id 视频id + */ +const selectById = function(id) { + return ajax.postJson(BASE_URL+'/videoSummary/selectById/'+id); +} + +/** + * AI摘要-下载课程摘要文本 + * @param {Object} courseId 课程 的id + */ +const downloadSummaryTxt = function(courseId) { + let requestParam ={ + url: BASE_URL+'/videoSummary/downloadSummaryTxt?courseId='+courseId, + timeout: 0, // 下载不设置超时 + responseType: 'blob', // 表明返回服务器返回的数据类型 + } + return ajax.get(requestParam); +} + +/** + * AI摘要-重新生成课程摘要 + * { + courseId: "COURSE_001"//课程id + } + */ +const retrySummaryTxt = function(data) { + return ajax.postJson(BASE_URL+'/videoSummary/retrySummaryTxt',data); +} + +/** + * AI翻译-获取视频语种下拉框 + * @param {Object} videoId 视频的id + */ +const getTextDropdown = function(videoId) { + return ajax.postJson(BASE_URL+'/subtitle/getTextDropdown',{videoId}); +} + +/** + * AI翻译-获取视频指定语种字幕 + * @param {object} data + { + "videoId": "VIDEO_111", + "language": "zh-CN" + } + */ +const getTextDetail = function(data) { + return ajax.postJson(BASE_URL+'/subtitle/getTextDetail',data); +} + +/** + * AI翻译-更新字幕 + * @param {Object} data + * { + "videoId": "VIDEO_001", + "language": "zh-CN", + "vttContent": "dddd" + } + */ +const updateText = function(data) { + return ajax.postJson(BASE_URL+'/subtitle/updateText',data); +} + + +/** + * AI翻译-下载字幕 + * @param {Object} params +{ + videoId: 视频的id, + language: 语种 +} + */ +const downloadText = function(studyId,contentId) { + return ajax.get(BASE_URL+'/subtitle/downloadText', params); +} + +/** + * AI翻译-同步跟更新字幕 + * @param {Object} data +{ + "videoId": "VIDEO_010", + "language": "zh-CN" +} + * @returns + */ +const regenerate = function(data) { + return ajax.postJson(BASE_URL+'/subtitle/regenerate',data); +} + + +export default { + selectVideoSummary, + updateVideoSummary, + selectById, + retrySummaryTxt, + updateText, + downloadText, + getTextDetail, + regenerate, + getTextDropdown, + downloadSummaryTxt, + getCourse, +} diff --git a/src/views/course/ManageList.vue b/src/views/course/ManageList.vue index f6f86a0e..f457ddc2 100644 --- a/src/views/course/ManageList.vue +++ b/src/views/course/ManageList.vue @@ -463,7 +463,7 @@ {{ aiSetting.aiAbstract === 1 ? '下架' : '上架' }} - 编辑 + 编辑 @@ -490,7 +490,7 @@ {{ aiSetting.aiTranslate === 1 ? '下架' : '上架' }} - 编辑 + 编辑 @@ -657,6 +657,7 @@ export default { aiAbstractTip: '一键提炼课程视频核心要点,助力学员课前高效掌握重点,快速筛选学习资源', // 提示信息 aiDraftTip: '分段展示视频内容并精准同步时间轴,实现视频进度与文稿双向定位,学习内容触手可及', //提示信息 aiTranslateTip: '智能转换视频字幕与语音为多语种,支持全球学员按需切换语言,打破学习边界', // 提示信息 + isV2: true, }; }, mounted() { @@ -1297,7 +1298,23 @@ export default { console.log('index', index, this.aiPermission); } }) - } + }, + toAiAbstract() { + this.$router.push({ + path: '/iframe/course/aiAbstract', + query: { + id: this.aiSetting.id + } + }) + }, + toAiTranslate() { + this.$router.push({ + path: '/iframe/course/aiTranslate', + query: { + id: this.aiSetting.id + } + }) + }, } }; diff --git a/src/views/course/aiSet/aiAbstract.vue b/src/views/course/aiSet/aiAbstract.vue index 2efd2c32..8cfbb532 100644 --- a/src/views/course/aiSet/aiAbstract.vue +++ b/src/views/course/aiSet/aiAbstract.vue @@ -1,27 +1,32 @@