解决冲突

This commit is contained in:
daihh
2022-12-11 21:27:06 +08:00
11 changed files with 156 additions and 95 deletions

View File

@@ -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{
//
}

View File

@@ -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{
//
}

View File

@@ -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,

View File

@@ -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);

View File

@@ -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) {

View File

@@ -48,7 +48,7 @@
<div style="margin-top:10px">
<router-link to="/study/index"><span :class="{identity:true,active:curIdentity==1}" @click="setCurIdentity(1)">学员</span></router-link>
<router-link to="/teacher/index"><span v-if="identity == 2 || identity == 5" :class="{identity:true,active:curIdentity==2}" @click="setCurIdentity(2)">教师</span></router-link>
<router-link :to="isTest? '/manage/learningpath':'/manager/index'"><span v-if="identity == 3 || identity == 5" :class="{identity:true,active:curIdentity==3}" @click="setCurIdentity(3)">管理员</span></router-link>
<span v-if="identity == 3 || identity == 5" :class="{identity:true,active:curIdentity==3}" @click="setCurIdentity(3)">管理员</span>
</div>
</div>
</div>
@@ -78,7 +78,9 @@
</div>
<div class="learning-info">
<div @click="jumrank" style="cursor: pointer;" class="ranking-link"> BOE 排行榜 >></div>
</div>
</div>
@@ -129,12 +131,12 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
this.loadUserStat();
this.$bus.$on('u-Currency',(num)=>{
this.statData.uvalue = num;
});
if(userTest.isTest(this.userInfo.code)){
this.isTest=true;
this.statData.uvalue = num;
})
//console.log(this.userInfo.loginName,'this.userInfo.loginName')
if(testUser.isTest(this.userInfo.loginName)){
this.isTest=true;
}
},
methods:{
loadUserStat(){//获取经验值和等级
@@ -160,6 +162,13 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
setCurIdentity(iden){
this.$store.dispatch('SetCurIdentity',iden);
if(this.isTest){
//this.$router.push('/manage/learningpath');
location.href=process.env.BASE_URL+'manage/learningpath';
}else{
this.$router.push('/manager/index');
}
},
jumrank(){
this.$router.push('/user/ranking');

View File

@@ -99,12 +99,12 @@
<span><a href="/resource/index.html" target="_blank" style="color:#303133;">旧版管理员界面</a></span>
</template>
</el-menu-item>
<el-menu-item v-show="curIdentity == 3">
<!-- <el-menu-item v-show="curIdentity == 3">
<template slot="title">
<svg-icon icon-class="administrator" style="font-size:17px"></svg-icon>
<span><a href="/manage/learningpath" target="_blank" style="color:#303133;">新版管理员界面</a></span>
</template>
</el-menu-item>
</el-menu-item> -->
<el-menu-item v-show="curIdentity == 3">
<template slot="title">
<svg-icon icon-class="management" style="font-size:16px"></svg-icon>

View File

@@ -4,17 +4,35 @@ const userCodes=[
'00004409'
]
const userCodesPro=[
'00004409'
]
/**是否是测试人员*/
const isTest=function(code){
var testUser=false;
userCodes.some(item=>{
if(item===code){
testUer=true;
return true;
}else{
return false;
}
})
var mode=process.env.NODE_ENV;
if(mode=='testing'){
userCodes.some(item=>{
if(item===code){
testUser=true;
return true;
}else{
return false;
}
})
}else if(mode=='preview' || mode=='production' ){
userCodesPro.some(item=>{
if(item===code){
testUser=true;
return true;
}else{
return false;
}
})
}
return testUser;
}

View File

@@ -267,7 +267,8 @@ export default {
data() {
return {
resOwnerListMap: [],
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
//fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
fileBaseUrl:this.$xpage.constants.fileBaseUrl, //获成动态获取的处理
getType: getType,
loading: false,
defaultProps: {

View File

@@ -82,7 +82,10 @@
<div class="title">{{item.section.name}}</div>
<div class="subnode" v-for="(it,itIdx) in item.contents" :key="it.id">
<div class="sub-title">
<div class="tip"><span class="tip-type">{{getType(it.contentType)}}</span>{{it.contentName}}</div>
<div class="tip">
<span class="tip-type">{{getType(it.contentType)}}</span>
<a :href="'studyindex?id='+it.courseId+'&contentId='+it.id"> {{it.contentName}}</a>
</div>
</div>
</div>
</div>

View File

@@ -392,6 +392,7 @@
mounted() {
this.$watermark.set(this.userInfo.name + this.userInfo.loginName);
this.courseId = this.$route.query.id;
this.initContentId = this.$route.query.contentId;
this.loadData();
//console.log(this.$xpage.constants.fileBaseUrl,'this.$xpage.constants.fileBaseUrl');
},