diff --git a/public/images/medal/xz20230101.png b/public/images/medal/xz20230101.png new file mode 100644 index 00000000..a6a49d89 Binary files /dev/null and b/public/images/medal/xz20230101.png differ diff --git a/src/api/boe/courseRecord.js b/src/api/boe/courseRecord.js index 33dda498..696904b6 100644 --- a/src/api/boe/courseRecord.js +++ b/src/api/boe/courseRecord.js @@ -9,7 +9,7 @@ const baseURL = process.env.VUE_APP_BOE_BASE_API; /** * 导出授课记录 * - * @param {Object} kid + * @param {Object} data */ const courseRecordExport = function(data) { return axios.request({ @@ -20,14 +20,42 @@ const courseRecordExport = function(data) { headers:{'Content-Type':'application/json;charset=utf-8'}, responseType: 'blob' }) - - // return ajax.postJson('/b1/system/teacher/teacher-course-export',data); } +/** + * 导出课程下的学员信息 + * + */ +const exportStudentOfCourse = function(userId,courseId) { + return axios.request({ + baseURL, + url: '/b1/system/teacher/teacher-course-student-export?userId='+userId+'&courseId='+courseId, + method: 'post', + headers:{'Content-Type':'application/json;charset=utf-8'}, + responseType: 'blob' + }) +} + +/** + * 导出教师下的所有授课记录下的学员信息 + * + */ +const exportStudentOfTearcher = function(userId) { + return axios.request({ + baseURL, + url: '/b1/system/teacher/teacher-course-student-export?userId='+userId, + method: 'post', + headers:{'Content-Type':'application/json;charset=utf-8'}, + responseType: 'blob' + }) +} + + + /** * 授课记录列表 * - * @param {Object} kid + * @param {Object} data */ const courseRecordList = function(data) { return ajax.postJson('/b1/system/teacher/teacher-course-list',data); @@ -37,6 +65,8 @@ const courseRecordList = function(data) { export default { courseRecordExport, - courseRecordList + courseRecordList, + exportStudentOfCourse, + exportStudentOfTearcher } diff --git a/src/api/modules/course.js b/src/api/modules/course.js index d3bfee07..8403a614 100644 --- a/src/api/modules/course.js +++ b/src/api/modules/course.js @@ -274,6 +274,7 @@ const countWaitAudit = function() { } /** + * [已用courseAudit中的hrbpAuditList替换] * 当前用户需要审核的课程列表 * @param {Object} query 同pageList */ @@ -282,7 +283,10 @@ const auditList = function(query) { } -/**教师需要审核的课程列表*/ +/** + * 【已移到courseAudit中】 + * 教师需要审核的课程列表 + */ const teacherAuditList = function(query) { return ajax.post('/xboe/m/course/audit/teacher-course', query); } @@ -305,15 +309,6 @@ const getAuditInfo = function(data) { return ajax.post('/xboe/m/course/audit/infos', data); } -/** - * 获取审核日志,此功能是为了管理员查看课程的审核日志。 - * 为后续查看增加的接口 - * @param {courseId:'课程ID',teacherId:'可以不填写,系统会查询当前人'} data - */ -const getAuditLogs = function(data) { - return ajax.post('/xboe/m/course/audit/logs', data); -} - /** * 管理员的课程审核处理 @@ -339,7 +334,7 @@ const auditCourseRecords = function(data) { } /** - * 管理员的课程发布 + * 管理员的课程发布,当前已经不再使用了 * @param {Object} query {ids:课程id,多个使用逗号分隔,title:课程的名称, Boolean pass 是否发布} */ const publish = function(data) { @@ -382,7 +377,7 @@ const detailFew=function(id){ } /* -直接审核 +直接审核,教师提交审核 */ const sumbits=function(data){ return ajax.post('/xboe/m/course/manage/sumbits',data); @@ -463,7 +458,6 @@ export default { teacherAuditList, auditAppoint, getAuditInfo, - getAuditLogs, audit, auditPageRecords, auditCourseRecords, diff --git a/src/api/modules/courseAudit.js b/src/api/modules/courseAudit.js new file mode 100644 index 00000000..483e8d87 --- /dev/null +++ b/src/api/modules/courseAudit.js @@ -0,0 +1,124 @@ +/** + * 课程审核的操作,因为是后续添加,有些处理还在course.js中 + * 针对于管理员,教师的功能 + * + **/ +import ajax from '@/utils/xajax.js' + +/**计算待审核课程*/ +const countWaitAudit = function() { + return ajax.get('/xboe/m/course/manage/wait-audit-num'); +} + +/** + * HRBP要审核的课程列表 + * @param {Object} query 同pageList + */ +const hrbpAuditList = function(query) { + return ajax.post('/xboe/m/course/manage/audit-pagelist', query); +} + +/**HRBP已审核的列表*/ +const hrbpHasAuditList = function(query) { + return ajax.post('/xboe/m/course/manage/audit-pagelist', query); +} + +/** + * hrbp审核提交 + * @param {Object} data + * {String auditId,String courseId,String title,Boolean open, Boolean pass,String remark} + */ +const hrbpAuditSubmit=function(data) { + return ajax.post('/xboe/m/course/audit/hrbp-submit-audit', data); +} + +/** + * 指定审核人,转审核人 + * 点击“转审” 弹出教师查询窗口,查询教师,填写备注,提交,调用此接口 + * @param {Object} data + * {courseId:课程id,teacherId:指定的审核人教师的id,teacherName:教师名称,remark:备注} + */ +const hrbpAuditAppoint = function(data) { + return ajax.post('/xboe/m/course/audit/appoint', data); +} + +/**教师需要审核的课程列表*/ +const teacherAuditList = function(query) { + return ajax.post('/xboe/m/course/audit/teacher-course', query); +} + +/** + * @param {Object} data + * String auditId,Boolean pass,String remark + */ +const teacherAuditSubmit = function(data) { + return ajax.post('/xboe/m/course/audit/teacher-submit-audit', data); +} + +/** + * 最后的审核(公开课审核)查询列表 +* @param {Object} data +* CourseHRBPAuditDto +*/ +const lastAuditList = function(data) { + return ajax.post('/xboe/m/course/audit/last-audit-list', data); +} + +/** + * 最后的审核(公开课审核)提交审核 + * @param {Object} data + * String auditId,String courseId,Boolean pass,String remark + */ +const lastAuditSubmit = function(data) { + return ajax.post('/xboe/m/course/audit/last-audit-submit', data); +} + +/** + * 提交并发布,对于默认管理员调用此方法 + * @param {Object} data + * CourseFullDto + */ +const submitAndPublish = function(data) { + return ajax.postJson('/xboe/m/course/audit/submit-publish', data); +} + +/** + * 获取审核信息,上面教师点击审核课程时,用于查询,上面“转审”时,用户填写的备注信息 + * @param {courseId:'课程id',teacherId:'可以不填写,系统会查询当前人'} data + */ +const getAuditInfo = function(auditId) { + return ajax.post('/xboe/m/course/audit/hrbp-detail', {auditId}); +} + +/** + * 审核记录列表,分页查询 + */ +const auditPageRecords = function(data) { + return ajax.post('/xboe/m/course/audit/page-records', data); +} + +/** + * 审核记录列表,要卖课程id,查询出审核列记录信息 + * { courseId:必须} + */ +const auditCourseRecords = function(data) { + return ajax.post('/xboe/m/course/audit/course-records', data); +} + +export default { + countWaitAudit, + hrbpAuditList, + hrbpAuditSubmit, + hrbpAuditAppoint, + teacherAuditList, + teacherAuditSubmit, + lastAuditList, + lastAuditSubmit, + submitAndPublish, + getAuditInfo, + auditPageRecords, + auditCourseRecords + + + +} diff --git a/src/components/Course/chooseCourseFile.vue b/src/components/Course/chooseCourseFile.vue index 43ee698b..5e3db2e1 100644 --- a/src/components/Course/chooseCourseFile.vue +++ b/src/components/Course/chooseCourseFile.vue @@ -184,6 +184,8 @@ // this.cware.content.contentRefId=rs.result.id; // this.cware.content.contentName=result.displayName; // this.cware.content.content=result.filePath; + }else{ + this.$message.error(rs.message); } }); }else{ diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index 519b3713..7876e15d 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -397,6 +397,7 @@ import apiTag from '../../api/modules/tag.js'; import apiHRBP from '../../api/boe/HRBP.js'; import apiUserBasic from '../../api/boe/userbasic.js'; import apiCourse from '../../api/modules/course.js'; +import apiCourseAudit from '../../api/modules/courseAudit.js'; import apiOrg from '../../api/system/organiza.js'; import apiUser from '../../api/system/user.js'; import WxEditor from '@/components/Editor/index.vue'; @@ -1300,7 +1301,6 @@ export default { return true; }, submitCourse() { - if(this.biaoke.dlgShow && !this.unsavedContent()){ this.$message.error('您有未保存的内容,请先保存'); return; @@ -1420,60 +1420,64 @@ export default { }; this.btnLoading = true; let $this = this; - //console.log(this.courseInfo.orgId,'this.courseInfo.orgId') - //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 - apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ - if(rs.status==200 && rs.result){ - postData.auditUser={ - email:rs.result.email, - code:rs.result.userNo, - name:rs.result.name, - aid:rs.result.id, - orgId:rs.result.orgId - } - postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; - - // apiHRBP.getHRBP(this.orgKid).then(rs=>{ - // if(rs.status==200 && rs.result.length>0){ - // let hrbpUser=rs.result[0]; - // postData.auditUser={ - // email:hrbpUser.email, - // code:hrbpUser.user_no, - // name:hrbpUser.real_name, - // kid:hrbpUser.user_id, - // orgId:hrbpUser.orgnization_id - // } - // postData.course.orgName=hrbpUser.orgnization_name_path+'/'+$this.orgName; - - apiCourse.submitCourse(postData).then(res => { - //this.btnLoading=false; + //2023-1-5 对于默认管理员,不需要提交hrbp。直接提交并发布 + let adminType=this.userInfo.adminType; + if(adminType==1){ //默认管理员,直接审核通过 + apiCourseAudit.submitAndPublish(postData).then(res=>{ setTimeout(function() { $this.btnLoading = false; }, 1000); if (res.status === 200) { //提交成功,直接关闭当前窗口 this.$message.success('提交成功!!!'); - this.biaoke.dlgShow = false; - this.weike.dlgShow = false; - //提交成功回调处理 - this.$emit('submitSuccess'); } else { this.$message.error(res.message); - this.biaoke.dlgShow = false; - this.weike.dlgShow = false; - this.$emit('submitSuccess'); } + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + this.$emit('submitSuccess'); }); - }else{ - $this.btnLoading = false; - this.$message.error('获取审核HRBP失败:'+rs.message); - } - }).catch(err=>{ - //this.$message.error('获取审核HRBP失败:'+err); - this.$message.error('获取审核HRBP失败,请检查资源归属下是否有HRBP审核人员'); - $this.btnLoading = false; - }) - + }else{ + //先获取HRBP审核 人员信息,姓名,机构路径,工号,用于邮件中的信息 + apiUserBasic.getOrgHrbpInfo(this.courseInfo.orgId).then(rs=>{ + if(rs.status==200 && rs.result){ + postData.auditUser={ + email:rs.result.email, + code:rs.result.userNo, + name:rs.result.name, + aid:rs.result.id, + orgId:rs.result.orgId + } + postData.course.orgName=rs.result.orgNamePath+'/'+rs.result.orgName; + apiCourse.submitCourse(postData).then(res => { + //this.btnLoading=false; + setTimeout(function() { + $this.btnLoading = false; + }, 1000); + if (res.status === 200) { + //提交成功,直接关闭当前窗口 + this.$message.success('提交成功!!!'); + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + //提交成功回调处理 + this.$emit('submitSuccess'); + } else { + this.$message.error(res.message); + this.biaoke.dlgShow = false; + this.weike.dlgShow = false; + this.$emit('submitSuccess'); + } + }); + }else{ + $this.btnLoading = false; + this.$message.error('获取审核HRBP失败:'+rs.message); + } + }).catch(err=>{ + //this.$message.error('获取审核HRBP失败:'+err); + this.$message.error('获取审核HRBP失败,请检查资源归属下是否有HRBP审核人员'); + $this.btnLoading = false; + }) + } }, // 教师列标,远程查询 async remoteFindTeacher(query) { diff --git a/src/components/Course/courseImage.vue b/src/components/Course/courseImage.vue index fc63b158..54a0abf4 100644 --- a/src/components/Course/courseImage.vue +++ b/src/components/Course/courseImage.vue @@ -11,9 +11,8 @@ -
-

-

+
+

@@ -39,6 +38,10 @@ export default { type: String, default: "100%", }, + text:{ + type: Boolean, + default:true, + }, width: { type: String, default: "100%", diff --git a/src/components/Exam/EditPaper.vue b/src/components/Exam/EditPaper.vue index 023c20d9..f3ce3d07 100644 --- a/src/components/Exam/EditPaper.vue +++ b/src/components/Exam/EditPaper.vue @@ -240,6 +240,56 @@ }) }, save(){ + + let qidMap=new Map(); + let hasItem=null; + let allScore=true; + let allAnswer=true; + this.qitems.some(qitem=>{ + //console.log(qitem,'qitem'); + if(qitem.type==3){ + if(!qitem.answer){ + allAnswer=false; + return true; + } + }else{ + var optHasAnswer=qitem.optionList.some(opt=>{ + return opt.isAnswer; + }) + if(!optHasAnswer){ + allAnswer=false; + return true; + } + } + if(!qitem.defaultScore || qitem.defaultScore=='0'){ + allScore=false; + return true; + } + if(qidMap.has(qitem.id)){ + hasItem=qitem; + return true; + }else{ + qidMap.set(qitem.id,qitem.id); + return false; + } + }); + + if(!allAnswer){ + this.$message.error('还有试题未设置答案,请设置完整再保存'); + return; + } + + if(!allScore){ + this.$message.error('有试题未设置分数'); + return; + } + + if(hasItem!=null){ + console.log(hasItem); + this.$message.error('选择的试题重复:'+hasItem.title) + return + } + this.loading=true; this.paper.paperContent=JSON.stringify(this.qitems); apiPaper.update(this.paper).then((res)=>{ diff --git a/src/components/HomePage/courseList.vue b/src/components/HomePage/courseList.vue index 5c958ba3..bbbfc4b3 100644 --- a/src/components/HomePage/courseList.vue +++ b/src/components/HomePage/courseList.vue @@ -66,7 +66,7 @@ }, components: { courseImage, - }, + }, props:{ list:{ type:Array, diff --git a/src/components/PortalHeader.vue b/src/components/PortalHeader.vue index f0b687da..59a6bd31 100644 --- a/src/components/PortalHeader.vue +++ b/src/components/PortalHeader.vue @@ -156,7 +156,7 @@ export default { components:{popup,yearMedal}, computed: { - ...mapGetters(['userInfo', 'userMsg','identity','studyTaskCount']), + ...mapGetters(['userInfo','curIdentity', 'userMsg','identity','studyTaskCount']), avatarText(){ return userAvatarText(this.userInfo.name); diff --git a/src/components/Study/manager.vue b/src/components/Study/manager.vue index 0239e7a9..71e99cf8 100644 --- a/src/components/Study/manager.vue +++ b/src/components/Study/manager.vue @@ -180,19 +180,19 @@ {{scope.row.chapterName}}{{scope.row.chapterName? '--': ''}}{{scope.row.contentName}} - + - + --> + diff --git a/src/components/UserCenter/menu.vue b/src/components/UserCenter/menu.vue index 6a3aea0d..0caa4d09 100644 --- a/src/components/UserCenter/menu.vue +++ b/src/components/UserCenter/menu.vue @@ -27,9 +27,10 @@ 待审核的课程 - + 公开课审核 - --> +