diff --git a/src/components/Course/auditCourse1.vue b/src/components/Course/auditCourse1.vue index a9cc71c9..541157d0 100644 --- a/src/components/Course/auditCourse1.vue +++ b/src/components/Course/auditCourse1.vue @@ -253,6 +253,7 @@ import apiCourseFile from '@/api/modules/courseFile.js'; import filecloud from '@/components/FileCloud/index.vue'; import { mapGetters, mapActions } from "vuex"; import chooseOrg from '@/components/System/chooseOrg.vue'; +import apiUserBasic from '../../api/boe/userbasic.js'; // import hyperLink from '@/components/Course/hyperLink.vue'; export default { name: "auditCourse1", @@ -586,7 +587,7 @@ export default { this.courseCoverurl = ""; this.courseInfo.coverImg = ""; }, - getDetail() { + getDetail(){ let $this = this; apiCoursePortal.detail(this.id,true).then(rs => { if (rs.status == 200) { @@ -594,23 +595,37 @@ export default { //加载所属机构名称 this.orgKid=''; if(this.courseInfo.orgId){ - apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ - if(rrs.status==200){ - this.orgName=rrs.result.name; - this.orgKid=rrs.result.kid; + apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rrs=>{ + if(rs.status==200){ + this.orgName=rrs.result.name; + //this.orgKid=rrs.result.kid; + //this.orgNamePath=rrs.result.namePath; } - }) + }); + // apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ + // if(rrs.status==200){ + // this.orgName=rrs.result.name; + // this.orgKid=rrs.result.kid; + // } + // }) }else{ //根据课程创建者获取机构id apiUser.getOrgSimpleByUserId(this.courseInfo.sysCreateAid).then(ors=>{ if(ors.status==200){ $this.courseInfo.orgId=ors.result.id; - apiOrg.getSimple(ors.result.id).then(rrs=>{ - if(rrs.status==200){ - $this.orgName=rrs.result.name; - $this.orgKid=rrs.result.kid; + apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{ + if(rs.status==200){ + $this.orgName=rrs.result.name; + //this.orgKid=rrs.result.kid; + //$this.orgNamePath=rrs.result.namePath; } - }) + }); + // apiOrg.getSimple(ors.result.id).then(rrs=>{ + // if(rrs.status==200){ + // $this.orgName=rrs.result.name; + // $this.orgKid=rrs.result.kid; + // } + // }) }else{ // } diff --git a/src/components/Course/auditCourse2.vue b/src/components/Course/auditCourse2.vue index caff77d9..6b65ee7e 100644 --- a/src/components/Course/auditCourse2.vue +++ b/src/components/Course/auditCourse2.vue @@ -292,6 +292,7 @@ import { mapGetters,mapActions} from 'vuex'; import hyperLink from '@/components/Course/hyperLink.vue'; import apiCourseFile from '../../api/modules/courseFile.js'; import filecloud from '@/components/FileCloud/index.vue'; +import apiUserBasic from '../../api/boe/userbasic.js'; export default { name:"auditCourse2", components: { @@ -634,23 +635,38 @@ export default { //加载所属机构名称 this.orgKid=''; if(this.courseInfo.orgId){ - apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ - if(rrs.status==200){ - this.orgName=rrs.result.name; - this.orgKid=rrs.result.kid; + apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rrs=>{ + if(rs.status==200){ + this.orgName=rrs.result.name; + //this.orgKid=rrs.result.kid; + //this.orgNamePath=rrs.result.namePath; } - }) + }); + // apiOrg.getSimple(this.courseInfo.orgId).then(rrs=>{ + // if(rrs.status==200){ + // this.orgName=rrs.result.name; + // this.orgKid=rrs.result.kid; + // } + // }) }else{ //根据课程创建者获取机构id apiUser.getOrgSimpleByUserId(this.courseInfo.sysCreateAid).then(ors=>{ if(ors.status==200){ $this.courseInfo.orgId=ors.result.id; - apiOrg.getSimple(ors.result.id).then(rrs=>{ - if(rrs.status==200){ - $this.orgName=rrs.result.name; - $this.orgKid=rrs.result.kid; + + apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{ + if(rs.status==200){ + $this.orgName=rrs.result.name; + //this.orgKid=rrs.result.kid; + //$this.orgNamePath=rrs.result.namePath; } - }) + }); + // apiOrg.getSimple(ors.result.id).then(rrs=>{ + // if(rrs.status==200){ + // $this.orgName=rrs.result.name; + // $this.orgKid=rrs.result.kid; + // } + // }) }else{ // } diff --git a/src/components/Course/courseForm.vue b/src/components/Course/courseForm.vue index c09fb7f6..9dee4cda 100644 --- a/src/components/Course/courseForm.vue +++ b/src/components/Course/courseForm.vue @@ -598,32 +598,32 @@ export default { }), loadUserGroup(){ let $this=this; - // apiUserGroup.findByName('').then(rs=>{ - // if(rs.status==200){ - // let crowdList=[]; - // rs.result.forEach(item=>{ - // crowdList.push({ - // id:item.key, - // name:item.value, - // disabled:false - // }) - // }) - // this.userGroupList=crowdList; - // } - // }); - apiUserBasic.getUserCrowds().then(rs=>{ - if(rs.status==200){ - let crowdList=[]; - rs.result.forEach(item=>{ - crowdList.push({ - id:item.kid, - name:item.audienceName, + apiUserGroup.findByName('').then(rs=>{ + if(rs.status==200){ + let crowdList=[]; + rs.result.forEach(item=>{ + crowdList.push({ + id:item.key, + name:item.value, disabled:false }) - }); - this.userGroupList=crowdList; - } - }) + }) + this.userGroupList=crowdList; + } + }); + // apiUserBasic.getUserCrowds().then(rs=>{ + // if(rs.status==200){ + // let crowdList=[]; + // rs.result.forEach(item=>{ + // crowdList.push({ + // id:item.kid, + // name:item.audienceName, + // disabled:false + // }) + // }); + // this.userGroupList=crowdList; + // } + // }) }, resOwnerName(code) { if (code == '') { @@ -839,6 +839,13 @@ export default { apiUser.getOrgSimpleByUserId(result.course.sysCreateAid).then(ors=>{ if(ors.status==200){ $this.courseInfo.orgId=ors.result.id; + // apiOrg.getSimple(ors.result.id).then(rrs=>{ + // if(rrs.status==200){ + // $this.orgName=rrs.result.name; + // $this.orgKid=rrs.result.kid; + // $this.orgNamePath=rrs.result.namePath; + // } + // }) apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{ if(rrs.status==200){ $this.orgName=rrs.result.name; @@ -1404,7 +1411,6 @@ export default { //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, diff --git a/src/components/Course/exam.vue b/src/components/Course/exam.vue index b5edbe38..72a779e3 100644 --- a/src/components/Course/exam.vue +++ b/src/components/Course/exam.vue @@ -278,6 +278,7 @@ export default { this.total=paper.items.length; this.paper =paper; //console.log(this.paper); + this.curItem=paper.items[this.curIndex]; this.startTime=new Date();//记录开始时间 this.timerValue=this.info.testDuration; @@ -335,12 +336,12 @@ export default { showClose:false, type: 'warning' }).then(() => { - this.submitTest() + this.submitTest(score); }).catch(()=>{ }) }else{ - this.submitTest() + this.submitTest(score); } }, countTest(){ //计算考试的分数 @@ -382,11 +383,20 @@ export default { noAnswers.push(idx+1); } let allRight = true; + //console.log('用户的答案',item.userAnswer); item.options.forEach(it =>{ - if(it.answer && item.userAnswer.indexOf(it.id)==-1) { - allRight=false; + //console.log('选项',it.answer,it.id,item.userAnswer.indexOf(it.id)); + if(it.answer){ //正确答案 + if(item.userAnswer.indexOf(it.id)==-1){ + allRight=false; + } + }else{ + if(item.userAnswer.indexOf(it.id)>-1){ + allRight=false; + } } }); + //console.log('是否回答正确',allRight) if(allRight){ scoreNum+=item.score; } @@ -404,14 +414,15 @@ export default { //console.log('本次得分='+this.lastScore); return this.lastScore; }, - submitTest(){ //提交处理 + submitTest(testScore){ //提交处理 //清空提示 if(this.timer){ window.clearInterval(this.timer); } let now=new Date(); - let testScore=this.countTest(); - + if(!testScore){ + testScore=this.countTest(); + } let postData={ studyId:this.studyId,// studyItemId:this.studyItemId,//前面已经给了 @@ -423,7 +434,7 @@ export default { arrange:this.info.arrange, passLine:this.info.passLine, randomMode:this.info.randomMode, - score:this.lastScore,//分数需要计算,在检查是否填写完整性时就可以计算出分数 + score:testScore, paperJson:JSON.stringify(this.paper),//原来是对象,这里要也要对象 //startTime:formatDate(this.startTime),//此时间需要格式化,格式化时间可以放在util中 //endTime:formatDate(now), @@ -445,6 +456,8 @@ export default { } }); this.testStart = false; + //获取最新的成绩 + this.loadStudyItemId(); this.$emit('submit',this.lastScore);//考试提交回调处理 } else { this.$message.error(res.message); diff --git a/src/components/System/chooseOrg.vue b/src/components/System/chooseOrg.vue index 2b553706..3d830b36 100644 --- a/src/components/System/chooseOrg.vue +++ b/src/components/System/chooseOrg.vue @@ -106,7 +106,7 @@ }else{ let $this=this; if(node.level === 1){ - // parentId = '-1'; + parentId = '-1'; apiUserBasic.findOrgsByKeyword('').then(rs=>{ let treeList=[]; rs.result.forEach(item=>{ @@ -122,6 +122,7 @@ }); }else{ parentId = node.data.id; + apiUserBasic.getOrgInfo(parentId).then(rs=>{ if(rs.status==200){ let treeList=[]; @@ -141,28 +142,6 @@ resolve([]); } }); - // apiUserBasic.findOrgTreeByOrgId(parentId).then(rs=>{ - // if(rs.status==200){ - // let treeList=[]; - // if(rs.result.length>0 && rs.result[0].treeChildList){ - // rs.result[0].treeChildList.forEach(item=>{ - // let node={ - // id:item.id, - // name:item.name, - // hrbpId:item.hrbpId, - // children:[] - // } - // if(item.treeChildList){ - // $this.readTreeNode(node,item.treeChildList); - // } - // treeList.push(node); - // }); - // } - // resolve(treeList); - // }else{ - // resolve([]); - // } - // }); } // usergroupApi.userOrgs(parentId).then(res =>{ // if (res.status == 200) { diff --git a/src/components/UcHeader/Index.vue b/src/components/UcHeader/Index.vue index 957b64de..2a5aad72 100644 --- a/src/components/UcHeader/Index.vue +++ b/src/components/UcHeader/Index.vue @@ -48,7 +48,7 @@