diff --git a/src/api/modules/course.js b/src/api/modules/course.js index 3f4e503b..c122be4f 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -1,9 +1,10 @@ /** * 课程的操作,课程的添加,修改,列表查询,课程的审核发布等操作。 * 针对于管理员,教师的功能 - * + * **/ import ajax from '@/utils/xajax.js' +import request from "../unionAjax"; /** * 保存课程基本信息,新增和更新都是此方式 @@ -170,6 +171,9 @@ const updateContentOrders = function(cid,items) { const detail = function(id) { return ajax.get('/xboe/m/course/manage/detail?id=' + id); } +const getDictIds = function(pid,type) { + return ajax.get(`/xboe/m/course/manage/getDictIds?pid=${pid}&type=${type}`); +} /** * 更新内容的名称 @@ -274,7 +278,7 @@ const countWaitAudit = function() { } /** - * [已用courseAudit中的hrbpAuditList替换] + * [已用courseAudit中的hrbpAuditList替换] * 当前用户需要审核的课程列表 * @param {Object} query 同pageList */ @@ -283,9 +287,9 @@ const auditList = function(query) { } -/** - * 【已移到courseAudit中】 - * 教师需要审核的课程列表 +/** + * 【已移到courseAudit中】 + * 教师需要审核的课程列表 */ const teacherAuditList = function(query) { return ajax.post('/xboe/m/course/audit/teacher-course', query); @@ -446,6 +450,7 @@ export default { findUpdateLogs, getUpdateLog, detail, + getDictIds, saveContent, pageList, setEnabled, diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 6a0f7cfe..a51d8b45 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -575,6 +575,7 @@ export default { } }, mounted() { + this.getDictIds(); let extendFlag=this.$route.query.f; //是否是管理端过来的 this.extendRefId=this.$route.query.refId; this.extendRefType=this.$route.query.refType; @@ -605,16 +606,8 @@ export default { this.isPermission = false; return; } + console.log("--- dicts = ",this.dicts) this.isPermission = this.dicts.includes(orgId); - /*if(this.isPermission && !this.courseInfo && !this.courseInfo.device){ - this.courseInfo.device = 4; - }else{ - if(!this.courseInfo && !this.courseInfo.device){ - return; - }else{ - this.courseInfo.device = 3; - } - }*/ console.log("--- 监听结束 this.isPermission = ",this.isPermission) }, // 关键字的更改 @@ -921,6 +914,20 @@ export default { this.courseCoverurl = ''; this.courseInfo.coverImg = ''; }, + //获取字典信息 + async getDictIds() { + console.log("--- 获取字典信息 1 = ", this.dicts); + try { + const response = await apiCourse.getDictIds(637, 1); // 确保返回 Promise + console.log("--- 获取字典信息 2 result= ", response); + if (response.status === 200) { + this.dicts = response.result.dicts; // 正确提取 dicts + console.log("--- 获取字典信息 3 = ", this.dicts); + } + } catch (error) { + console.error("获取字典信息失败:", error); + } + }, //获取课程信息 async getDetail(id) { this.curCourseId = id;