mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-17 23:06:45 +08:00
添加改动标识 ai播放器相关
This commit is contained in:
@@ -60,19 +60,21 @@
|
||||
</div>
|
||||
<div style="width:390px">
|
||||
<el-button type="primary" @click="searchData(true)" icon="el-icon-search" >搜索</el-button>
|
||||
<el-button icon="el-icon-refresh-right" type="primary" style="margin-left:5px" @click="reset">重置</el-button>
|
||||
<el-button icon="el-icon-refresh-right" type="primary" style="margin-left:5px" @click="reset">重置</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<el-row :gutter="20" style="margin-top:10px">
|
||||
<el-col :span="24">
|
||||
<!-- <el-button icon="el-icon-folder" type="primary" size="small">导出</el-button> -->
|
||||
<el-button class="Create-coures" type="primary" @click="addNewCourse()" icon="el-icon-plus">新建课程</el-button>
|
||||
<el-button type="primary" @click="setLanguage()" icon="el-icon-connection" :disabled="selectedCourses.length === 0">设置语种</el-button>
|
||||
<el-button type="primary" @click="enableAI()" icon="el-icon-switch-button" :disabled="selectedCourses.length === 0">开启AI处理</el-button>
|
||||
</el-col >
|
||||
<!-- ai播放器相关 -->
|
||||
<el-col :span="24">
|
||||
<!-- <el-button icon="el-icon-folder" type="primary" size="small">导出</el-button> -->
|
||||
<el-button class="Create-coures" type="primary" @click="addNewCourse()" icon="el-icon-plus">新建课程</el-button>
|
||||
<el-button type="primary" @click="setLanguage()" icon="el-icon-connection" :disabled="selectedCourses.length === 0">设置语种</el-button>
|
||||
<el-button type="primary" @click="enableAI()" icon="el-icon-switch-button" :disabled="selectedCourses.length === 0">开启AI处理</el-button>
|
||||
</el-col >
|
||||
</el-row>
|
||||
</div>
|
||||
<div style="margin-right:30px;">
|
||||
<!-- ai播放器相关 -->
|
||||
<el-table style="margin:10px 32px 10px 22px;" :data="pageData" border stripe @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55"></el-table-column>
|
||||
<el-table-column label="序号" type="index" width="50"></el-table-column>
|
||||
@@ -139,6 +141,7 @@
|
||||
<el-table-column label="操作" width="180px" fixed="right">
|
||||
<template slot-scope="scope" class="btn-gl">
|
||||
<!-- 20240621 修改scope.row.isPermission = fasle 时不展示操作按钮-->
|
||||
<!-- ai播放器相关 -->
|
||||
<el-button v-if="scope.row.isPermission && scope.row.status != 2" type="text" size="mini" @click="setAI(scope.row)">AI设置</el-button>
|
||||
<el-button type="text" size="mini" v-if="scope.row.isPermission && scope.row.status == 5 && !scope.row.published" @click="releaseData(scope.row)">发布</el-button>
|
||||
<el-button v-if="scope.row.isPermission && pageManage && scope.row.published" @click="showStudent(scope.row)" type="text" size="mini">学员</el-button>
|
||||
@@ -291,7 +294,8 @@
|
||||
<div>
|
||||
<course-form ref="courseForm" @submitSuccess="searchData" @close="searchData"></course-form>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- ai播放器相关 -->
|
||||
<!-- 设置语种弹框 -->
|
||||
<el-dialog
|
||||
title="AI翻译"
|
||||
@@ -316,14 +320,14 @@
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="color: #ff4d4f; font-size: 12px;">
|
||||
注:仅支持对已开启AI处理的课程进行批量语种设置;所选的课程中已超过X个未开启AI处理的课程,以上配置仅对X个已开启AI处理的课程生效。
|
||||
注:仅支持对已开启AI处理的课程进行批量语种设置;所选的课程中有{{languageSetting.aiSetNoNum}}个未开启AI处理的课程,以上配置仅对{{languageSetting.aiSetNum}}个已开启AI处理的课程生效。
|
||||
</div>
|
||||
<template #footer>
|
||||
<el-button @click="languageSetting.dlgShow = false">取消</el-button>
|
||||
<el-button type="primary" @click="confirmLanguageSetting">确认</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- 开启AI处理弹框 -->
|
||||
<el-dialog
|
||||
title="开启AI处理"
|
||||
@@ -333,11 +337,12 @@
|
||||
<div class="ai-process-dialog">
|
||||
<!-- AI处理状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">
|
||||
<span class="form-label">
|
||||
<el-tooltip class="item" effect="dark" content="是否将课程进行AI处理" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
AI处理状态:</span>
|
||||
AI处理状态:
|
||||
</span>
|
||||
<span class="status-text">
|
||||
{{ aiProcessSetting.aiSet === 1 ? '已开启' : '已关闭' }}
|
||||
</span>
|
||||
@@ -347,8 +352,8 @@
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
|
||||
<div v-show="aiProcessSetting.aiSet === 1">
|
||||
<!-- 是否生成AI摘要 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">是否需要生成AI摘要:</span>
|
||||
@@ -357,7 +362,7 @@
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 是否生成AI文稿 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">是否需要生成AI文稿:</span>
|
||||
@@ -366,7 +371,7 @@
|
||||
<el-radio :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 课程支持语种选择 -->
|
||||
<div class="form-item" style="flex-flow: column;align-items: baseline;">
|
||||
<span class="form-label">请选择该课程所支持语种:</span>
|
||||
@@ -385,10 +390,10 @@
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 提示信息 -->
|
||||
<div class="tips">
|
||||
<span>注:已跳过x个已开启AI处理的课程,仅更新剩余x个</span>
|
||||
<span>注:已跳过{{aiProcessSetting.aiSetNum}}个已开启AI处理的课程,仅更新剩余{{aiProcessSetting.aiSetNoNum}}个</span>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
@@ -396,7 +401,7 @@
|
||||
<el-button type="primary" @click="confirmAiProcess">确认</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
<!-- AI设置弹框 -->
|
||||
<el-dialog
|
||||
title="AI设置"
|
||||
@@ -404,7 +409,7 @@
|
||||
width="500px"
|
||||
>
|
||||
<div class="ai-setting-dialog">
|
||||
|
||||
|
||||
<!-- AI功能状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">
|
||||
@@ -422,67 +427,67 @@
|
||||
:inactive-value="0"
|
||||
></el-switch>
|
||||
</div>
|
||||
|
||||
<!-- AI摘要状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI摘要状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiAbstract === 1}">
|
||||
{{ aiSetting.aiAbstract === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiAbstract = 0">
|
||||
{{ aiSetting.aiAbstract === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
<el-button type="text" >编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AI文稿状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI文稿状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiDraft === 1}">
|
||||
{{ aiSetting.aiDraft === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiDraft = 0">
|
||||
{{ aiSetting.aiDraft === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- AI翻译状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI翻译状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiTranslate === 1}">
|
||||
{{ aiSetting.aiTranslate === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiTranslate = 0">
|
||||
{{ aiSetting.aiTranslate === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
<el-button type="text" >编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 支持语种 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">支持语种:</span>
|
||||
<div class="languages-list">
|
||||
<div class="language-tag">
|
||||
中文
|
||||
<span class="status-badge">已下架</span>
|
||||
<div v-show="aiSetting.aiSet === 1">
|
||||
<!-- AI摘要状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI摘要状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiAbstract === 1}">
|
||||
{{ aiSetting.aiAbstract === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiAbstract = 0">
|
||||
{{ aiSetting.aiAbstract === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
<el-button type="text" >编辑</el-button>
|
||||
</div>
|
||||
<div class="language-tag">
|
||||
英语
|
||||
<span class="status-badge">生成中</span>
|
||||
</div>
|
||||
|
||||
<!-- AI文稿状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI文稿状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiDraft === 1}">
|
||||
{{ aiSetting.aiDraft === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiDraft = 0">
|
||||
{{ aiSetting.aiDraft === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
</div>
|
||||
<div class="language-tag">
|
||||
越南语
|
||||
<span class="status-badge status-badge--active">已上架</span>
|
||||
</div>
|
||||
|
||||
<!-- AI翻译状态 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">AI翻译状态:</span>
|
||||
<span class="status-badge" :class="{'status-badge--active': aiSetting.aiTranslate === 1}">
|
||||
{{ aiSetting.aiTranslate === 1 ? '已上架' : '已下架' }}
|
||||
</span>
|
||||
<div class="action-buttons">
|
||||
<el-button type="text" @click="aiSetting.aiTranslate = 0">
|
||||
{{ aiSetting.aiTranslate === 0 ? '上架' : '下架' }}
|
||||
</el-button>
|
||||
<el-button type="text" >编辑</el-button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 支持语种 -->
|
||||
<div class="form-item">
|
||||
<span class="form-label">支持语种:</span>
|
||||
<div class="languages-list">
|
||||
<div class="language-tag">
|
||||
中文
|
||||
<span class="status-badge">已下架</span>
|
||||
</div>
|
||||
<div class="language-tag">
|
||||
英语
|
||||
<span class="status-badge">生成中</span>
|
||||
</div>
|
||||
<div class="language-tag">
|
||||
越南语
|
||||
<span class="status-badge status-badge--active">已上架</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="aiSetting.dlgShow = false">取消</el-button>
|
||||
@@ -509,6 +514,7 @@ import apiUserbasic from "@/api/boe/userbasic.js"
|
||||
export default {
|
||||
name: 'manageCourse',
|
||||
components: {courseForm, manager, auditCourse1, auditCourse2,adminPage},
|
||||
// ai播放器相关
|
||||
computed: {
|
||||
...mapGetters(['resOwnerMap','sysTypeMap','userInfo', 'selectAllLang']),
|
||||
},
|
||||
@@ -594,27 +600,28 @@ export default {
|
||||
},
|
||||
extendRefId:'',
|
||||
extendRefType:'',
|
||||
// ai播放器相关
|
||||
selectedCourses: [], //已选课程
|
||||
languageSetting: {
|
||||
dlgShow: false,
|
||||
languageCode: ['zh-CN', 'en-US'] // 默认选中的语种
|
||||
},
|
||||
aiProcessSetting: {
|
||||
dlgShow: false,
|
||||
aiSet: 1,
|
||||
aiAbstract: 1,
|
||||
aiDraft: 1,
|
||||
languageCode: ['zh-CN', 'en-US'] // 默认选中的语种
|
||||
},
|
||||
aiSetting: {
|
||||
dlgShow: false,
|
||||
courseId: '',
|
||||
aiSet: 1,
|
||||
aiAbstract: 1, // 1:上架 0:下架
|
||||
aiDraft: 1, // 1:上架 0:下架
|
||||
aiTranslate: 1, // 1:上架 0:下架
|
||||
languageCode: ['zh-CN', 'en-US', 'vi-VN'] // 支持的语种
|
||||
}
|
||||
languageSetting: { // 设置语种弹框
|
||||
dlgShow: false,
|
||||
languageCode: ['zh-CN', 'en-US'] // 默认选中的语种
|
||||
},
|
||||
aiProcessSetting: { // 开启AI处理弹框
|
||||
dlgShow: false,
|
||||
aiSet: 1,
|
||||
aiAbstract: 1,
|
||||
aiDraft: 1,
|
||||
languageCode: ['zh-CN', 'en-US'] // 默认选中的语种
|
||||
},
|
||||
aiSetting: { // AI设置弹框
|
||||
dlgShow: false,
|
||||
courseId: '',
|
||||
aiSet: 1,
|
||||
aiAbstract: 1, // 1:上架 0:下架
|
||||
aiDraft: 1, // 1:上架 0:下架
|
||||
aiTranslate: 1, // 1:上架 0:下架
|
||||
languageCode: ['zh-CN', 'en-US', 'vi-VN'] // 支持的语种
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -661,9 +668,6 @@ export default {
|
||||
//出现学员管理
|
||||
window.parent.openSelectStu(row);
|
||||
},
|
||||
handleSelectionChange(val){
|
||||
this.selectedCourses = val;
|
||||
},
|
||||
handleChoose(row){ //选择课程
|
||||
window.parent.selectCourse(row);
|
||||
},
|
||||
@@ -675,32 +679,7 @@ export default {
|
||||
inputOn() {
|
||||
this.$forceUpdate();
|
||||
},
|
||||
// AI设置
|
||||
setAI(row) {
|
||||
this.aiSetting.courseId = row.id;
|
||||
// 这里可以添加获取当前课程AI设置的逻辑
|
||||
this.aiSetting.dlgShow = true;
|
||||
},
|
||||
|
||||
// 确认AI设置
|
||||
confirmAISetting() {
|
||||
const { courseId, aiSet, aiAbstract, aiDraft, aiTranslate } = this.aiSetting;
|
||||
|
||||
// 这里可以添加保存AI设置的API调用
|
||||
console.log('保存AI设置', {
|
||||
courseId,
|
||||
aiSet,
|
||||
aiAbstract,
|
||||
aiDraft,
|
||||
aiTranslate
|
||||
});
|
||||
|
||||
// 模拟成功保存
|
||||
this.$message.success('AI设置保存成功');
|
||||
this.aiSetting.dlgShow = false;
|
||||
// 可以选择是否刷新列表数据
|
||||
},
|
||||
|
||||
|
||||
// 置顶
|
||||
setTop(row) {
|
||||
let params = {
|
||||
@@ -1089,92 +1068,6 @@ export default {
|
||||
// }
|
||||
// this.$message({ message: msg, type: 'success', offset: 50 });
|
||||
// },
|
||||
setLanguage() {
|
||||
if (this.selectedCourses.length > 0) {
|
||||
this.languageSetting.dlgShow = true;
|
||||
}
|
||||
},
|
||||
enableAI() {
|
||||
// 开启AI处理按钮点击事件
|
||||
if (this.selectedCourses.length > 0) {
|
||||
this.aiProcessSetting.dlgShow = true;
|
||||
}
|
||||
},
|
||||
|
||||
async confirmLanguageSetting() {
|
||||
try {
|
||||
// 收集选中的课程ID
|
||||
const courseIds = this.selectedCourses.map(course => course.id).join(',');
|
||||
// 获取选择的语种
|
||||
const languages = this.languageSetting.selectedLanguages.join(',');
|
||||
|
||||
// 这里可以根据实际需求调用API进行语种设置
|
||||
console.log('批量设置课程语种', { courseIds, languages });
|
||||
|
||||
// 显示成功提示
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: `已成功为${this.selectedCourses.length}个课程设置语种`,
|
||||
offset: 50
|
||||
});
|
||||
|
||||
// 关闭弹框
|
||||
this.languageSetting.dlgShow = false;
|
||||
|
||||
// 刷新数据(如果需要)
|
||||
// this.searchData();
|
||||
} catch (error) {
|
||||
console.error('设置语种失败', error);
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '设置语种失败,请稍后重试',
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
},
|
||||
async confirmAiProcess() {
|
||||
try {
|
||||
// 收集选中的课程ID
|
||||
const courseIds = this.selectedCourses.map(course => course.id).join(',');
|
||||
// 获取AI处理配置
|
||||
const { aiSet, aiAbstract, aiDraft, selectedLanguages } = this.aiProcessSetting;
|
||||
|
||||
// 这里可以根据实际需求调用API进行AI处理设置
|
||||
console.log('批量开启AI处理', {
|
||||
courseIds,
|
||||
aiSet,
|
||||
aiAbstract,
|
||||
aiDraft,
|
||||
languages: selectedLanguages.join(',')
|
||||
});
|
||||
|
||||
// 模拟计算跳过和更新的课程数量
|
||||
const totalCourses = this.selectedCourses.length;
|
||||
const skippedCount = Math.floor(totalCourses * 0.2); // 假设20%的课程已开启AI处理
|
||||
const updatedCount = totalCourses - skippedCount;
|
||||
|
||||
// 显示成功提示
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: `已跳过${skippedCount}个已开启AI处理的课程,成功为${updatedCount}个课程更新AI处理设置`,
|
||||
offset: 50
|
||||
});
|
||||
|
||||
// 关闭弹框
|
||||
this.aiProcessSetting.dlgShow = false;
|
||||
|
||||
// 刷新数据
|
||||
this.searchData();
|
||||
} catch (error) {
|
||||
console.error('开启AI处理失败', error);
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '开启AI处理失败,请稍后重试',
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
delItem(row) {
|
||||
this.$confirm('您确定要删除所选课程吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -1223,6 +1116,143 @@ export default {
|
||||
saveNewCatalogZhang() {
|
||||
this.catalogs.addNewZhang = false;
|
||||
},
|
||||
|
||||
|
||||
// ai播放器相关
|
||||
handleSelectionChange(val){
|
||||
this.selectedCourses = val;
|
||||
console.log(val);
|
||||
},
|
||||
// 获取选中课程的AI信息
|
||||
getAIInfoByList(list = []) {
|
||||
let selectNum = 0; // 选中的课程数量
|
||||
let aiSetNum = 0; // 已设置AI的课程数量
|
||||
let aiSetNoNum = 0; // 未设置AI的课程数量
|
||||
list.forEach(item => {
|
||||
if(item.aiSet === 1){
|
||||
aiSetNum++;
|
||||
}else{
|
||||
aiSetNoNum++;
|
||||
}
|
||||
});
|
||||
return {
|
||||
selectNum,
|
||||
aiSetNum,
|
||||
aiSetNoNum
|
||||
}
|
||||
},
|
||||
// AI设置
|
||||
setAI(row) {
|
||||
this.aiSetting.courseId = row.id;
|
||||
// 这里可以添加获取当前课程AI设置的逻辑
|
||||
this.aiSetting.dlgShow = true;
|
||||
},
|
||||
|
||||
// 确认AI设置
|
||||
confirmAISetting() {
|
||||
const { courseId, aiSet, aiAbstract, aiDraft, aiTranslate } = this.aiSetting;
|
||||
|
||||
// 这里可以添加保存AI设置的API调用
|
||||
console.log('保存AI设置', {
|
||||
courseId,
|
||||
aiSet,
|
||||
aiAbstract,
|
||||
aiDraft,
|
||||
aiTranslate
|
||||
});
|
||||
|
||||
// 模拟成功保存
|
||||
this.$message.success('AI设置保存成功');
|
||||
this.aiSetting.dlgShow = false;
|
||||
// 可以选择是否刷新列表数据
|
||||
},
|
||||
setLanguage() {
|
||||
if (this.selectedCourses.length > 0) {
|
||||
this.languageSetting = {...this.languageSetting, ...this.getAIInfoByList(this.selectedCourses)}
|
||||
this.languageSetting.dlgShow = true;
|
||||
}
|
||||
},
|
||||
enableAI() {
|
||||
// 开启AI处理按钮点击事件
|
||||
if (this.selectedCourses.length > 0) {
|
||||
this.aiProcessSetting = {...this.aiProcessSetting, ...this.getAIInfoByList(this.selectedCourses)}
|
||||
this.aiProcessSetting.dlgShow = true;
|
||||
}
|
||||
},
|
||||
|
||||
async confirmLanguageSetting() {
|
||||
try {
|
||||
// 收集选中的课程ID
|
||||
const courseIds = this.selectedCourses.map(course => course.id).join(',');
|
||||
// 获取选择的语种
|
||||
const languages = this.languageSetting.selectedLanguages.join(',');
|
||||
|
||||
// 这里可以根据实际需求调用API进行语种设置
|
||||
console.log('批量设置课程语种', { courseIds, languages });
|
||||
|
||||
// 显示成功提示
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: `已成功为${this.selectedCourses.length}个课程设置语种`,
|
||||
offset: 50
|
||||
});
|
||||
|
||||
// 关闭弹框
|
||||
this.languageSetting.dlgShow = false;
|
||||
|
||||
// 刷新数据(如果需要)
|
||||
// this.searchData();
|
||||
} catch (error) {
|
||||
console.error('设置语种失败', error);
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '设置语种失败,请稍后重试',
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
},
|
||||
async confirmAiProcess() {
|
||||
try {
|
||||
// 收集选中的课程ID
|
||||
const courseIds = this.selectedCourses.map(course => course.id).join(',');
|
||||
// 获取AI处理配置
|
||||
const { aiSet, aiAbstract, aiDraft, selectedLanguages } = this.aiProcessSetting;
|
||||
|
||||
// 这里可以根据实际需求调用API进行AI处理设置
|
||||
console.log('批量开启AI处理', {
|
||||
courseIds,
|
||||
aiSet,
|
||||
aiAbstract,
|
||||
aiDraft,
|
||||
languages: selectedLanguages.join(',')
|
||||
});
|
||||
|
||||
// 模拟计算跳过和更新的课程数量
|
||||
const totalCourses = this.selectedCourses.length;
|
||||
const skippedCount = Math.floor(totalCourses * 0.2); // 假设20%的课程已开启AI处理
|
||||
const updatedCount = totalCourses - skippedCount;
|
||||
|
||||
// 显示成功提示
|
||||
this.$message({
|
||||
type: 'success',
|
||||
message: `已跳过${skippedCount}个已开启AI处理的课程,成功为${updatedCount}个课程更新AI处理设置`,
|
||||
offset: 50
|
||||
});
|
||||
|
||||
// 关闭弹框
|
||||
this.aiProcessSetting.dlgShow = false;
|
||||
|
||||
// 刷新数据
|
||||
this.searchData();
|
||||
} catch (error) {
|
||||
console.error('开启AI处理失败', error);
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: '开启AI处理失败,请稍后重试',
|
||||
offset: 50
|
||||
});
|
||||
}
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user