From 2ee3daedf6c40f3a13322e5bfee80e51fc3730e1 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 23 Jul 2025 17:10:19 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=81-=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/course.js | 15 +++++++++------ src/components/Course/courseForm.vue | 12 ++++++++++++ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/src/api/modules/course.js b/src/api/modules/course.js index 3f4e503b..df60caa4 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -1,7 +1,7 @@ /** * 课程的操作,课程的添加,修改,列表查询,课程的审核发布等操作。 * 针对于管理员,教师的功能 - * + * **/ import ajax from '@/utils/xajax.js' @@ -170,7 +170,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 request.get(`/xboe/m/course/manage/getDictIds?pid=${pid}&type=${type}`); +} /** * 更新内容的名称 * @param {Object} data @@ -274,7 +276,7 @@ const countWaitAudit = function() { } /** - * [已用courseAudit中的hrbpAuditList替换] + * [已用courseAudit中的hrbpAuditList替换] * 当前用户需要审核的课程列表 * @param {Object} query 同pageList */ @@ -283,9 +285,9 @@ const auditList = function(query) { } -/** - * 【已移到courseAudit中】 - * 教师需要审核的课程列表 +/** + * 【已移到courseAudit中】 + * 教师需要审核的课程列表 */ const teacherAuditList = function(query) { return ajax.post('/xboe/m/course/audit/teacher-course', query); @@ -446,6 +448,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 121e32c0..24e910e8 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -571,6 +571,7 @@ export default { } }, mounted() { + this.getDictIds(); let extendFlag=this.$route.query.f; //是否是管理端过来的 this.extendRefId=this.$route.query.refId; this.extendRefType=this.$route.query.refType; @@ -917,6 +918,17 @@ export default { this.courseCoverurl = ''; this.courseInfo.coverImg = ''; }, + //获取字典信息 + getDictIds() { + console.log("--- 获取字典信息 1 = ",this.dicts) + const { result, status } = apiCourse.getDictIds(637,1); + console.log("--- 获取字典信息 2 result= ",result) + if (status === 200) { + console.log("--- 获取字典信息 3 = ",this.dicts) + this.dicts = result.dicts; + console.log("--- 获取字典信息 4 = ",this.dicts) + } + }, //获取课程信息 async getDetail(id) { this.curCourseId = id; From 3485435c9ebc008107801c017d27d166813233d5 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 23 Jul 2025 17:24:51 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=81-=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/modules/course.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api/modules/course.js b/src/api/modules/course.js index df60caa4..00db854c 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -171,7 +171,7 @@ const detail = function(id) { return ajax.get('/xboe/m/course/manage/detail?id=' + id); } const getDictIds = function(pid,type) { - return request.get(`/xboe/m/course/manage/getDictIds?pid=${pid}&type=${type}`); + return ajax.get(`/xboe/m/course/manage/getDictIds?pid=${pid}&type=${type}`); } /** * 更新内容的名称 From 5276813ebac120538649f0c304bb9547a8630389 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 23 Jul 2025 17:28:36 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=81-=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 24e910e8..32713ab4 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -919,14 +919,18 @@ export default { this.courseInfo.coverImg = ''; }, //获取字典信息 - getDictIds() { - console.log("--- 获取字典信息 1 = ",this.dicts) - const { result, status } = apiCourse.getDictIds(637,1); - console.log("--- 获取字典信息 2 result= ",result) - if (status === 200) { - console.log("--- 获取字典信息 3 = ",this.dicts) - this.dicts = result.dicts; - console.log("--- 获取字典信息 4 = ",this.dicts) + 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); } }, //获取课程信息 From 58fc6264fe479fc70786ae9481fc422e06347c8b Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 23 Jul 2025 17:45:30 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=81-=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 32713ab4..868ed244 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -602,6 +602,7 @@ export default { this.isPermission = false; return; } + console.log("--- this.dicts = ",this.dicts) this.isPermission = this.dicts.includes(orgId); /*if(this.isPermission && !this.courseInfo && !this.courseInfo.device){ this.courseInfo.device = 4; From 0864704c4cdc4a6131b2ae968ef12f1c372d84d4 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Wed, 23 Jul 2025 17:53:43 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E4=BB=85=E5=86=85=E7=BD=91=E5=8F=AF?= =?UTF-8?q?=E8=A7=81-=E7=AE=A1=E7=90=86=E5=91=98=E7=AB=AF=20=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Course/courseForm.vue | 9 --------- 1 file changed, 9 deletions(-) diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 868ed244..eef5a11f 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -604,15 +604,6 @@ export default { } console.log("--- this.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) }, // 关键字的更改