mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 22:06:43 +08:00
Merge branch 'master' of codeup.aliyun.com:6265f483e4166464dc2f9c14/boeu/portal
This commit is contained in:
@@ -1,38 +1,110 @@
|
||||
<template>
|
||||
<!--弹出窗口设置-->
|
||||
<div>
|
||||
<el-dialog :close-on-press-escape="false" :close-on-click-modal="false" class="medalbox" top="10vh" :visible.sync="showGonggao" :append-to-body="true" >
|
||||
<div style="text-align: center;position: relative;">
|
||||
<el-image :src="`${webBaseUrl}/images/gonggao/dlg202212.png`"></el-image>
|
||||
<div>
|
||||
<span class="dlg-close" @click="showGonggao = false"><i style="font-size: 28px;color: #ffff;" class="el-icon-close"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<div v-for="pop in popupList" :key="pop.id">wwww
|
||||
<el-dialog :close-on-press-escape="false" :close-on-click-modal="false" class="medalbox" :visible.sync="pop.show" :append-to-body="true" >
|
||||
<div style="text-align: center;position: relative;">
|
||||
<!-- <span style="float: right;" @click="pop.show = false"><i style="font-size: 28px;color: #000000;" class="el-icon-close"></i></span> -->
|
||||
<el-image :src="baseUrl+pop.bgImage"></el-image>
|
||||
<div>
|
||||
<span v-if="pop.closeable" class="dlg-close" @click="pop.show = false"><i style="font-size: 28px;color: #999;" class="el-icon-close"></i></span>
|
||||
</div>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import apiPopup from '@/api/modules/popup.js';
|
||||
export default{
|
||||
props:{
|
||||
|
||||
page: {
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
showGonggao:false,
|
||||
sessionKey:'alertpopup1',
|
||||
showGonggao:true,
|
||||
baseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
popupList:[],//需要弹出的窗口
|
||||
sessionKey:'alertpopup',
|
||||
localTimesKey:'popuptimes'
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
let hasFlag = localStorage.getItem(this.sessionKey);
|
||||
if(!hasFlag){
|
||||
let now=new Date();
|
||||
let max=new Date(2022,12,28,0,0,0);
|
||||
if(now.getTime()<max.getTime()){
|
||||
this.showGonggao=true;
|
||||
localStorage.setItem(this.sessionKey,'1');
|
||||
}
|
||||
}
|
||||
//获取用户需要弱出的窗口信息,放在状态中
|
||||
let has = sessionStorage.getItem(this.sessionKey);
|
||||
//has=false;
|
||||
if(!has){
|
||||
apiPopup.findByNoDevice(2).then(rs=>{
|
||||
if(rs.status==200){
|
||||
rs.result.forEach(item=>{
|
||||
item.show=true;
|
||||
})
|
||||
this.popupList=rs.result;
|
||||
if(rs.result.length>0){
|
||||
sessionStorage.setItem(this.sessionKey,"1");
|
||||
this.countPopup();
|
||||
}else{
|
||||
sessionStorage.removeItem(this.sessionKey);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}else{
|
||||
//this.popupList=JSON.parse(has);
|
||||
//this.countPopup();
|
||||
}
|
||||
|
||||
|
||||
// let loadNum = localStorage.getItem(this.sessionKey);
|
||||
// let hasFlag = sessionStorage.getItem(this.sessionKey);
|
||||
// let $this=this;
|
||||
// if(!hasFlag){
|
||||
// let times=0;
|
||||
// if(loadNum){
|
||||
// times=Number(loadNum);
|
||||
// }
|
||||
// if(times<3){
|
||||
// let now=new Date();
|
||||
// let min=new Date(2022,10,9,0,0,0);
|
||||
// let max=new Date(2022,11,1,0,0,0);
|
||||
// //console.log(now,min,max);
|
||||
// //console.log(now.getTime(),min.getTime(),max.getTime());
|
||||
// if(now.getTime()>min.getTime() && now.getTime()<max.getTime()){
|
||||
// //console.log('open')
|
||||
// this.showGonggao=true;
|
||||
// times++;
|
||||
// localStorage.setItem(this.sessionKey,times);
|
||||
// sessionStorage.setItem(this.sessionKey,1);
|
||||
// }
|
||||
// }
|
||||
|
||||
// }
|
||||
},
|
||||
methods:{
|
||||
countPopup(){
|
||||
//let newLogin = localStorage.getItem(this.$xpage.constants.newLoginKey);
|
||||
this.popupList.forEach(item=>{
|
||||
//次数检查
|
||||
if(item.times>0){
|
||||
var localKey=this.localTimesKey+item.id;
|
||||
var curLocal=localStorage.getItem(localKey);
|
||||
if(curLocal){
|
||||
let times=parseInt(curLocal);
|
||||
if(item.times< times){
|
||||
item.show=false;
|
||||
}else{
|
||||
localStorage.setItem(localKey,curLocal+1);
|
||||
}
|
||||
}else{
|
||||
localStorage.setItem(localKey,1);
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -67,9 +139,11 @@
|
||||
|
||||
}
|
||||
.dlg-close{
|
||||
padding: 20px 10px 10px 10px;
|
||||
//float: right;
|
||||
//margin-top: -90px;
|
||||
border: 1px solid #cccccc;
|
||||
border-radius: 50%;
|
||||
padding: 20px 10px 10px 10px;
|
||||
cursor: pointer;
|
||||
}
|
||||
.medalbox {
|
||||
|
||||
@@ -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{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -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{
|
||||
//
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
<!--显示内容-->
|
||||
<div v-else style="margin: 0px 10px;">
|
||||
<!--视频-->
|
||||
<div v-show="content.contentType>0 && content.contentType<41">
|
||||
<div v-show="content.contentType>0 && content.contentType<51">
|
||||
<div style="display: flex;justify-content:space-between">
|
||||
<div>
|
||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
||||
@@ -95,11 +95,17 @@
|
||||
</div>
|
||||
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
||||
</div>
|
||||
<div v-if="content.contentType==50" style="text-align: center;">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" border="0px" style="width:100%;height:400px;border:0px"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--课件选择或上传的公用组件-->
|
||||
<div v-show="content.contentRefId=='' && content.contentType>0 && content.contentType<41">
|
||||
<choose-course-file ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
<choose-course-file :orgId="course.orgId" :orgName="course.orgName" ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
</div>
|
||||
<div v-show="content.contentRefId=='' && content.contentType==50">
|
||||
<choose-course-file :orgId="course.orgId" :orgName="course.orgName" ref="coursewareScormPanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
</div>
|
||||
<!--图文-->
|
||||
<div v-show="content.contentType==41">
|
||||
@@ -145,90 +151,16 @@
|
||||
</div>
|
||||
<!--考试-->
|
||||
<div v-if="content.contentType==61">
|
||||
<div style="display: flex;justify-content:space-between">
|
||||
<div>
|
||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<el-checkbox style="margin-right: 10px;" v-model="onlyQuestion">只显示试题</el-checkbox>
|
||||
<el-button type="primary" @click="saveData()" >保存</el-button>
|
||||
<el-button type="danger" @click="toReChoose()" >重新选择</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top: 10px;overflow: auto;">
|
||||
<div v-if="!onlyQuestion">
|
||||
<el-form size="small" label-width="80px">
|
||||
<el-form-item label="考试时长">
|
||||
<el-col :span="6">
|
||||
<el-input v-model="exam.testDuration" placeholder="20-120">
|
||||
<template slot="append">分钟</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<!-- <el-col :span="9">
|
||||
<el-form-item label="尝试次数">
|
||||
<el-input-number v-model="exam.times" :min="0" :max="10" label="0表不限制"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-col> -->
|
||||
<el-col :span="9">
|
||||
<el-form-item label="及格线">
|
||||
<el-input placeholder="20-120" v-model="exam.passLine">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="显示">
|
||||
<el-col :span="10"><el-checkbox v-model="exam.showAnalysis">允许查看解析</el-checkbox> </el-col>
|
||||
<el-col :span="14"><el-checkbox v-model="exam.showAnswer">允许查看答案</el-checkbox></el-col>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="模式"> -->
|
||||
<!-- <el-col :span="10"><el-checkbox v-model="exam.randomMode">随机生成试题</el-checkbox></el-col> -->
|
||||
<!-- <el-col :span="14"> -->
|
||||
<!-- <el-form-item label="数量">
|
||||
<el-input-number v-model="exam.qnum" :min="1" :max="10" label="数量"></el-input-number>
|
||||
</el-form-item> -->
|
||||
<!-- </el-col> -->
|
||||
<!-- </el-form-item> -->
|
||||
<!-- <el-form-item label="试题排列">
|
||||
<el-col :span="10">
|
||||
<el-select v-model="exam.arrange">
|
||||
<el-option :value="0" label="按顺序"></el-option>
|
||||
<el-option :value="1" label="只题目乱序"></el-option>
|
||||
<el-option :value="2" label="只选项乱序"></el-option>
|
||||
<el-option :value="3" label="题目选项全乱序"></el-option>
|
||||
</el-select>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item label="评分方式">
|
||||
<el-radio-group v-model="exam.scoringType">
|
||||
<el-radio :label="1">最高一次</el-radio>
|
||||
<el-radio :label="2">最后一次</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="评分方式">
|
||||
<el-col :span="8">
|
||||
<el-radio-group v-model="exam.scoringType">
|
||||
<el-radio :label="1">最高一次</el-radio>
|
||||
<el-radio :label="2">最后一次</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="15">
|
||||
<el-form-item label="百分制">
|
||||
<el-checkbox v-model="exam.percentScore">按百分制显示成绩(实际成绩*100/实际总分)</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="考试说明">
|
||||
<el-input type="textarea" show-word-limit v-model="exam.info" placeholder="关于考试的说明(限255字以内)" maxlength="255"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="display: flex;justify-content:space-between;padding-bottom: 10px;">
|
||||
<div>
|
||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
||||
</div>
|
||||
<div>
|
||||
<simplePaper :data="examPaper" ></simplePaper>
|
||||
</div>
|
||||
<el-button type="danger" @click="toReChoose()" >重新选择</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<course-exam ref="comExam" :courseId="course.id" :contentId="content.id" @remove="deleteExam" @save="saveExam"></course-exam>
|
||||
|
||||
</div>
|
||||
<!--作业-->
|
||||
<div v-if="content.contentType==60">
|
||||
@@ -325,7 +257,6 @@
|
||||
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||
import courseHomework from '@/components/Course/courseHomework.vue'
|
||||
import courseExam from '@/components/Course/courseExam.vue'
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||
import fileUpload from '@/components/FileUpload/index.vue';
|
||||
import apiCourse from '../../api/modules/course.js';
|
||||
@@ -361,14 +292,15 @@
|
||||
default:1
|
||||
}
|
||||
},
|
||||
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer},
|
||||
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,fileUpload,pdfPreview,audioPlayer,videoPlayer},
|
||||
// inject: [ "informationDetails" ],
|
||||
data(){
|
||||
return {
|
||||
converStatus:4,
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||
curPdfPath:'',
|
||||
curCFile:{},//当前课件的内容
|
||||
scormUrl:'',//scormUrl地址
|
||||
comTypes:[
|
||||
//文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它
|
||||
//图文41,连接52,作业60,考试61,评估62
|
||||
@@ -379,7 +311,8 @@
|
||||
{id:'5',type:'link',name:'外部连接',img:'el-icon-link',resType:52},
|
||||
{id:'6',type:'exam',name:'考试',img:'el-icon-document-checked',resType:61},
|
||||
{id:'7',type:'homework',name:'作业',img:'el-icon-reading',resType:60},
|
||||
{id:'8',type:'assess',name:'评估',img:'el-icon-user',resType:62}
|
||||
{id:'8',type:'assess',name:'评估',img:'el-icon-user',resType:62},
|
||||
{id:'10',type:'scorm',name:'SCORM',img:'el-icon-suitcase',resType: 50},
|
||||
],
|
||||
htmlContent:'',
|
||||
linkInfo:{
|
||||
@@ -395,29 +328,6 @@
|
||||
},
|
||||
homework:{courseId: '', name:'', content:'', file:'', deadTime: '', submitMode: 3},
|
||||
homeworkChange:{},
|
||||
exam:{
|
||||
courseId:'',
|
||||
contentId:'',
|
||||
testName:this.course.name,
|
||||
testDuration:30,
|
||||
showAnalysis:false,
|
||||
showAnswer:false,
|
||||
times:1,
|
||||
qnum:0,//试题数量,只是模式是随机生成试题时才会有
|
||||
arrange:0,
|
||||
scoringType:1,
|
||||
passLine:60,
|
||||
randomMode:false,
|
||||
percentScore:true,//默认是百分制
|
||||
paperType:1,//自定义试卷
|
||||
paperId:'',//试卷的id,只有paperType为2的时间才会有值
|
||||
info:'',//考试说明
|
||||
paperContent:'',//试题的json字符串
|
||||
},
|
||||
examChange:{},
|
||||
onlyQuestion:true,
|
||||
examPaperChange:{},
|
||||
examPaper:{items:[]},
|
||||
assess:{
|
||||
countType:'权重配置',
|
||||
countText:'(问题1)*80%+(问题2)*10%+(问题3)*10%',
|
||||
@@ -433,7 +343,13 @@
|
||||
|
||||
},
|
||||
created() {
|
||||
//console.log(this.ctype, this.course,'ctype');
|
||||
//console.log(process.env, 'process.env');
|
||||
},
|
||||
mounted(){
|
||||
//this.init();
|
||||
if(process.env.NODE_ENV=='development'){
|
||||
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
reset(newVal){
|
||||
@@ -447,6 +363,8 @@
|
||||
this.loadPdfFile();
|
||||
}else if(newVal.contentType==41){
|
||||
this.htmlContent=newVal.content;
|
||||
}else if(newVal.contentType==50){
|
||||
this.loadScormFile();
|
||||
}else if(newVal.contentType==52){
|
||||
//外部连接
|
||||
if(newVal.content!=''){
|
||||
@@ -461,8 +379,8 @@
|
||||
//作业
|
||||
this.loadHomeworkInfo();
|
||||
}else if(newVal.contentType==61){
|
||||
//考试
|
||||
this.loadExamInfo();
|
||||
//考试,已经移到组件中
|
||||
//this.loadExamInfo();
|
||||
}else if(newVal.contentType==62){
|
||||
//评估
|
||||
this.loadAssessInfo();
|
||||
@@ -486,15 +404,8 @@
|
||||
this.linkInfo.url='';
|
||||
this.htmlContent='';
|
||||
this.curPdfPath='';
|
||||
this.scormUrl='';
|
||||
this.curCFile={};
|
||||
this.exam.contentId='';
|
||||
this.exam.paperContent='';
|
||||
this.exam.info='';
|
||||
this.exam.id='';//一定要重置id
|
||||
this.exam.qnum='';
|
||||
this.exam.paperId='';
|
||||
this.exam.passLine=60;
|
||||
this.examPaper={items:[]};
|
||||
this.curriculumData={
|
||||
url:'',
|
||||
isDrag:true,
|
||||
@@ -519,6 +430,25 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
loadScormFile(){
|
||||
//对于scorm课件内容,需要再查一下
|
||||
this.scormUrl='';
|
||||
apiCourseFile.detail(this.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.curCFile=rs.result;
|
||||
//this.curPdfPath=rs.result.previewFilePath;
|
||||
this.content.content='scorm';
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?r=1&mode=preview&scormId='+this.curCFile.id;//播放的首页
|
||||
console.log(this.scormUrl,'this.scormUrl')
|
||||
}
|
||||
});
|
||||
// let fname=this.content.content;
|
||||
// if(fname && fname.indexOf('.pdf')>-1){
|
||||
// this.curPdfPath=this.content.content;
|
||||
// }else{
|
||||
|
||||
// }
|
||||
},
|
||||
loadHomeworkInfo(){
|
||||
apiCourse.getHomework(this.content.id).then(res=>{
|
||||
if(res.status==200){
|
||||
@@ -531,20 +461,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
loadExamInfo(){
|
||||
apiCourse.getExam(this.content.id).then(res=>{
|
||||
if(res.status==200){
|
||||
this.exam=res.result;
|
||||
this.examPaper=JSON.parse(res.result.paperContent);
|
||||
this.examChange = deepClone(res.result);
|
||||
this.examPaperChange = deepClone(JSON.parse(res.result.paperContent));
|
||||
}else if(res.status==404){
|
||||
//没有找到作业信息
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
},
|
||||
loadAssessInfo(){
|
||||
if(this.content.content!='' && this.content.content.length>10){
|
||||
this.assess=JSON.parse(this.content.content);
|
||||
@@ -594,31 +510,7 @@
|
||||
if(this.content.contentType==60){
|
||||
jsonData.homework=this.homework;
|
||||
}else if(this.content.contentType==61){
|
||||
//检查内容的完整性
|
||||
if(this.examPaper.items.length==0){
|
||||
this.$message.error("您还没有添加考试的试题");
|
||||
return;
|
||||
}
|
||||
let pass=true;
|
||||
this.examPaper.items.forEach(qitem=>{
|
||||
if(qitem.options.length==0){
|
||||
pass=false;
|
||||
}else{
|
||||
let hasAnswer=qitem.options.some(opt=>{
|
||||
return opt.answer;
|
||||
});
|
||||
if(!hasAnswer){
|
||||
pass=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(!pass){
|
||||
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
||||
return;
|
||||
}
|
||||
|
||||
this.exam.paperContent=JSON.stringify(this.examPaper);
|
||||
jsonData.exam=this.exam;
|
||||
//考试保存已经独立出去,不在这里处理了
|
||||
|
||||
}else if(this.content.contentType==62){
|
||||
this.content.content=JSON.stringify(this.assess);
|
||||
@@ -633,6 +525,47 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
saveExam(examInfo){
|
||||
console.log('保存考试配置');
|
||||
//这里只是61考试
|
||||
this.content.courseId=this.course.id;
|
||||
this.content.sortIndex=this.addOrder;
|
||||
let jsonData={
|
||||
content:this.content,
|
||||
exam:examInfo
|
||||
}
|
||||
apiCourse.saveContent(jsonData).then(rs=>{
|
||||
if(rs.status === 200) {
|
||||
this.$message.success('保存成功!');
|
||||
this.$refs.comExam.reloadExam();
|
||||
// this.content=rs.result.content;
|
||||
this.$emit('save',rs.result.content);
|
||||
}else{
|
||||
this.$message.error(rs.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
deleteExam(examInfo){
|
||||
if(this.content.id==''){
|
||||
this.content.contentType=0;
|
||||
this.content.content='';
|
||||
return;
|
||||
}
|
||||
let params={
|
||||
id:this.content.id,
|
||||
ctype:this.content.contentType,
|
||||
erasable:this.course.erasable
|
||||
}
|
||||
apiCourse.delContent(params).then(rs=>{
|
||||
if(rs.status === 200) {
|
||||
this.$message.success('删除成功!');
|
||||
this.$emit('remove');
|
||||
this.$refs.comExam.reloadExam();
|
||||
}else{
|
||||
this.$message.error(rs.message)
|
||||
}
|
||||
})
|
||||
},
|
||||
delData(id){
|
||||
//需要调用外部方法完成
|
||||
if(this.content.id==''){
|
||||
@@ -652,6 +585,7 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
toReChoose(){
|
||||
let $this=this;
|
||||
if(this.content.id.length>1){
|
||||
@@ -681,6 +615,7 @@
|
||||
//未初始化会调用失败,所以这里要等vue变化后再调用
|
||||
this.$nextTick(function(){
|
||||
this.$refs.coursewarePanel.findCourseFile();
|
||||
this.$refs.coursewareScormPanel.findCourseFile();
|
||||
})
|
||||
|
||||
}
|
||||
@@ -692,7 +627,9 @@
|
||||
// this.content.content.url=cfile.filePath;
|
||||
if(this.content.contentType==10 || this.content.contentType==20){
|
||||
this.curriculumData.url = cfile.filePath;
|
||||
}else{
|
||||
}else if(this.content.contentType==50){ //scorm课件内容
|
||||
//this.chooseCourseScorm
|
||||
} else{
|
||||
if(cfile.previewFilePath){
|
||||
this.content.content=cfile.previewFilePath;
|
||||
}else{
|
||||
@@ -708,7 +645,10 @@
|
||||
setTimeout(function(){
|
||||
$this.loadPdfFile();
|
||||
},2000);
|
||||
|
||||
}else if(this.content.contentType==50){
|
||||
setTimeout(function(){
|
||||
$this.loadScormFile();
|
||||
},2000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,11 +44,18 @@
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'上传新'+curComType.name">
|
||||
<div v-if="!courseFile.id">
|
||||
<div v-if="resType>20" style="padding-bottom: 10px;">
|
||||
<span style="font-weight: 700;">内容时长(分):</span>
|
||||
<span>
|
||||
<el-input-number v-model="duration" size="mini" :min="1" :max="100"></el-input-number>
|
||||
</span>
|
||||
</div>
|
||||
<el-upload class="upload-demo" :headers="headers" :data="data" drag :action="uploadFileUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
||||
</el-upload>
|
||||
|
||||
</div>
|
||||
<div v-else style="text-align: center;">
|
||||
<div style="padding: 20px;">{{courseFile.fileName}} <span style="color: green;">上传成功</span></div>
|
||||
@@ -68,6 +75,14 @@
|
||||
type: String,
|
||||
default:'500'
|
||||
},
|
||||
orgId:{
|
||||
type: String,
|
||||
default:''
|
||||
},
|
||||
orgName:{
|
||||
type: String,
|
||||
default:''
|
||||
},
|
||||
resType:{
|
||||
type: Number,
|
||||
default:0
|
||||
@@ -86,11 +101,13 @@
|
||||
pageIndex:1,
|
||||
count:0,
|
||||
keyword: '',
|
||||
duration:1,
|
||||
comTypes:[
|
||||
{id:'1',type:'video',name:'视频',img:'el-icon-video-camera',resType:10,maxSize:1024,maxSizeName:"1G",fileTypes:['mp4']},
|
||||
{id:'2',type:'sound',name:'音频',img:'el-icon-service',resType:20,maxSize:1024,maxSizeName:"1G",fileTypes:['mp3']},
|
||||
{id:'3',type:'image',name:'图片',img:'el-icon-picture-outline',resType:30,maxSize:10,maxSizeName:"10M",fileTypes:["png","jpg","gif","bmp"]},
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType:40,maxSize:1024,maxSizeName:"1G",fileTypes:["doc", "xls", "ppt","docx", "xlsx", "pptx","txt","pdf"]}
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType:40,maxSize:1024,maxSizeName:"1G",fileTypes:["doc", "xls", "ppt","docx", "xlsx", "pptx","txt","pdf"]},
|
||||
{id:'5',type:'scorm',name:'SCORM课件',img:'el-icon-suitcase',resType:50,maxSize:1024,maxSizeName:"1G",fileTypes:["zip"]}
|
||||
],
|
||||
curComType:{id:'',type:'',name:'',maxSizeName:'',fileTypes:[]},
|
||||
findState:1,
|
||||
@@ -133,6 +150,11 @@
|
||||
return false;
|
||||
}
|
||||
}
|
||||
if(this.resType==50){
|
||||
this.data.dir='scorm';
|
||||
}else{
|
||||
this.data.dir='course';
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 上传失败
|
||||
@@ -150,6 +172,9 @@
|
||||
fileType:res.result.fileType,
|
||||
filePath:res.result.filePath,
|
||||
resType:this.resType,
|
||||
orgId:this.orgId,
|
||||
orgName:this.orgName,
|
||||
duration:this.duration,
|
||||
remark:'课程中直接上传'
|
||||
}
|
||||
apiCourseFile.saveUpload(courseWare).then(rs=>{
|
||||
|
||||
224
src/components/Course/chooseCourseScorm.vue
Normal file
224
src/components/Course/chooseCourseScorm.vue
Normal file
@@ -0,0 +1,224 @@
|
||||
<template>
|
||||
<!--选择SCORM课件-->
|
||||
<div style="min-height: 500px;">
|
||||
<div style="padding: 5px 5px 10px 5px;display: flex;justify-content: space-between;">
|
||||
<!-- <div>
|
||||
<el-button @click="save" type="primary" size="small">确定</el-button>
|
||||
</div> -->
|
||||
</div>
|
||||
<el-tabs type="border-card" style="min-height: 400px;">
|
||||
<el-tab-pane :label="'选择已有'+curComType.name" >
|
||||
<div style="display: flex;justify-content: flex-start;">
|
||||
<div>
|
||||
<el-input maxlength="50" v-model="keyword" placeholder="名称" size="small"></el-input>
|
||||
</div>
|
||||
<!-- <div><el-input maxlength="50" v-model="params.author" placeholder="上传人" size="small"></el-input></div> -->
|
||||
<div style="padding-left: 10px;">
|
||||
<el-button @click="findCourseFile()" type="primary" >搜索</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="findState==2" style="padding-top: 10px;">
|
||||
<el-table style="100%" :data="fileList" border stripe>
|
||||
<el-table-column label="类型" width="60" prop="author"><template slot-scope="scope">{{curComType.name}}</template></el-table-column>
|
||||
<el-table-column label="名称" prop="name"></el-table-column>
|
||||
<el-table-column label="创建" prop="sysCreateBy" width="100"></el-table-column>
|
||||
<el-table-column label="创建时间" prop="sysCreateTime" width="160"></el-table-column>
|
||||
<el-table-column label="选择" width="70" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="chooseCourseFile(scope.row)" type="primary">选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<div style="text-align: center">
|
||||
<el-pagination
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
:current-page="pageIndex"
|
||||
:page-sizes="[5, 10,20,50,100]"
|
||||
:page-size="pageSize"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="count">
|
||||
</el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane :label="'上传新'+curComType.name">
|
||||
<div v-if="!courseFile.id">
|
||||
<el-upload class="upload-demo" :headers="headers" :data="data" drag :action="uploadFileUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
||||
</el-upload>
|
||||
</div>
|
||||
<div v-else style="text-align: center;">
|
||||
<div style="padding: 20px;">{{courseFile.fileName}} <span style="color: green;">上传成功</span></div>
|
||||
<div><el-button @click="chooseCourseFile(courseFile)" type="primary" size="mini">确定</el-button></div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/token";
|
||||
import apiCourseFile from '../../api/modules/courseFile';
|
||||
export default{
|
||||
props: {
|
||||
minHeight:{
|
||||
type: String,
|
||||
default:'500'
|
||||
},
|
||||
resType:{
|
||||
type: Number,
|
||||
default:0
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
uploadFileUrl: process.env.VUE_APP_BASE_API + "/xboe/sys/xuploader/file/upload", // 上传的图片服务器地址
|
||||
data:{
|
||||
dir:'course'
|
||||
},
|
||||
headers: {
|
||||
'XBOE-Access-Token': getToken(),
|
||||
},
|
||||
pageSize:10,
|
||||
pageIndex:1,
|
||||
count:0,
|
||||
keyword: '',
|
||||
comTypes:[
|
||||
{id:'1',type:'video',name:'视频',img:'el-icon-video-camera',resType:10,maxSize:1024,maxSizeName:"1G",fileTypes:['mp4']},
|
||||
{id:'2',type:'sound',name:'音频',img:'el-icon-service',resType:20,maxSize:1024,maxSizeName:"1G",fileTypes:['mp3']},
|
||||
{id:'3',type:'image',name:'图片',img:'el-icon-picture-outline',resType:30,maxSize:10,maxSizeName:"10M",fileTypes:["png","jpg","gif","bmp"]},
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType:40,maxSize:1024,maxSizeName:"1G",fileTypes:["doc", "xls", "ppt","docx", "xlsx", "pptx","txt","pdf"]}
|
||||
],
|
||||
curComType:{id:'',type:'',name:'',maxSizeName:'',fileTypes:[]},
|
||||
findState:1,
|
||||
courseFile:{},
|
||||
fileList:[],
|
||||
radioId:'',
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.courseFile={};
|
||||
let $this=this;
|
||||
this.comTypes.some(ct=>{
|
||||
if(ct.resType==$this.resType){
|
||||
$this.curComType=ct;
|
||||
//this.findCourseFile();
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
handleBeforeUpload(file) {
|
||||
if(file.name.lastIndexOf(".") ==-1) {
|
||||
this.$message({message:`文件格式不正确!`,type:'error',offset:100})
|
||||
return false;
|
||||
}
|
||||
let fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
||||
fileExtension=fileExtension.toLowerCase();
|
||||
// 校检文件类型
|
||||
if(this.curComType.fileTypes.indexOf(fileExtension) == -1){
|
||||
this.$message({message:`文件格式不正确, 请上传正确格式的${this.curComType.name}文件!`,type:'error',offset:100})
|
||||
return false;
|
||||
}
|
||||
// 校检文件大小
|
||||
if(this.curComType.maxSize) {
|
||||
const isLt = file.size / 1024 / 1024 < this.curComType.maxSize;
|
||||
if (!isLt) {
|
||||
this.$message({message:`上传文件大小不能超过 ${this.curComType.maxSizeName} !`,type:'error',offset:100})
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError(err) {
|
||||
this.$message({message:"上传失败, 请重试",type:'error',offset:100});
|
||||
},
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
//console.log(res);
|
||||
if(res.status == 200) {
|
||||
//上传到课件库
|
||||
//console.log(res.result);
|
||||
let courseWare={
|
||||
fileName:res.result.displayName,
|
||||
fileType:res.result.fileType,
|
||||
filePath:res.result.filePath,
|
||||
resType:this.resType,
|
||||
remark:'课程中直接上传'
|
||||
}
|
||||
apiCourseFile.saveUpload(courseWare).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.courseFile=rs.result;
|
||||
this.$message({message:"上传成功",type:'success',offset:100});
|
||||
// this.cware.content.contentRefId=rs.result.id;
|
||||
// this.cware.content.contentName=result.displayName;
|
||||
// this.cware.content.content=result.filePath;
|
||||
}
|
||||
});
|
||||
}else{
|
||||
this.$message({message:"上传失败:"+res.message,type:'error',offset:100});
|
||||
}
|
||||
|
||||
//this.$emit("success", res);
|
||||
},
|
||||
// 删除文件
|
||||
handleDelete(index) {
|
||||
this.fileList.splice(index, 1);
|
||||
//注意删除处理
|
||||
//this.$emit("remove", '');
|
||||
},
|
||||
// 获取文件名称
|
||||
getFileName(name) {
|
||||
if (name.lastIndexOf("/") > -1) {
|
||||
return name.slice(name.lastIndexOf("/") + 1).toLowerCase();
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
},
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val;
|
||||
this.pageIndex = 1;
|
||||
this.findCourseFile();
|
||||
},
|
||||
handleCurrentChange(val) {
|
||||
this.pageIndex = val;
|
||||
this.findCourseFile();
|
||||
},
|
||||
findCourseFile(){
|
||||
this.findState=2;
|
||||
let data = {
|
||||
name: this.keyword,
|
||||
resOwner1: '',//this.params.resOwner1, //资源归属一级的id
|
||||
resOwner2: '',//this.params.resOwner2, // 资源归属二级的id
|
||||
resOwner3: '',//this.params.resOwner3, // 资源归属三级的id
|
||||
resType: this.resType, //this.params.type,
|
||||
pageSize: this.pageSize,
|
||||
pageIndex: this.pageIndex,
|
||||
self:true,//只是查询自己的
|
||||
}
|
||||
apiCourseFile.pageList(data).then(rs=>{
|
||||
if(rs.status === 200) {
|
||||
this.fileList = rs.result.list;
|
||||
this.count = rs.result.count;
|
||||
}else{
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
})
|
||||
|
||||
},
|
||||
chooseCourseFile(ccfile){
|
||||
this.$emit('choose', ccfile);
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
||||
@@ -1,200 +1,366 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="exam.show==1">
|
||||
<div style="padding: 10px; text-align: center;">
|
||||
<el-button @click="changeExamShow(3)" type="primary" size="small">自定义考试</el-button>
|
||||
<el-button @click="changeExamShow(2)" type="primary" size="small">选择已有考试</el-button>
|
||||
<div v-if="showTab==1">
|
||||
<div style="padding: 10px; text-align: center;margin-top: 20px;">
|
||||
<el-button @click="openCusExam()" type="primary" >自定义考试</el-button>
|
||||
<el-button @click="openChoosePaper()" type="primary">选择已有考试</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==2">
|
||||
<div v-if="showTab==2">
|
||||
<div style="display: flex;justify-content: flex-start;">
|
||||
<!--需求原型中没有按知识点选择
|
||||
<div>
|
||||
<el-select v-model="exam.type" style="width: 140px;" clearable placeholder="选择知识点">
|
||||
</el-select>
|
||||
</div>
|
||||
-->
|
||||
<div><el-input maxlength="50" placeholder="名称"></el-input></div>
|
||||
<div><el-input maxlength="50" placeholder="创建人"></el-input></div>
|
||||
<div style="padding-left: 10px;"><el-button type="primary" size="small">搜索已有考试</el-button></div>
|
||||
<div><el-input v-model="usePaper.keyword" maxlength="50" placeholder="名称"></el-input></div>
|
||||
<div style="padding-left: 10px;"><el-button @click="findExamPapers()" type="primary" >查询</el-button></div>
|
||||
<div style="padding-left: 10px;"><el-button @click="changeExamShow(1)" type="danger" >返回</el-button></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<el-table style="100%" :data="exam.findhas.list" border stripe>
|
||||
<el-table-column label="考试名称" prop="author"><template>考试名称</template></el-table-column>
|
||||
<el-table-column label="创建时间" prop="author">
|
||||
<div style="text-align: center;padding-top: 10px; overflow-y: auto;">
|
||||
<el-table style="100%" height="480" :data="usePaper.list" border stripe>
|
||||
<el-table-column prop="testName" label="试卷"></el-table-column>
|
||||
<el-table-column prop="sysCreateTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="sysCreateBy" label="创建人" width="80px" ></el-table-column>
|
||||
<el-table-column label="选择" width="60px">
|
||||
<template slot-scope="scope">
|
||||
2022-02-03
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="content">
|
||||
<template>
|
||||
XXX
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="changeExamShow(9)" type="primary" size="mini">选择</el-button>
|
||||
<el-button size="mini" @click="chooseExamPaper(scope.row)" type="primary" >选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页功能-->
|
||||
<div v-if="usePaper.total >10" style="text-align: center; margin-top:10px">
|
||||
<el-pagination background
|
||||
@current-change="changePaperPage"
|
||||
:current-page="usePaper.pageIndex"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="usePaper.pageSize"
|
||||
layout="total,pager"
|
||||
:total="usePaper.total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==3">
|
||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border: 1px solid #e7e7e7;">
|
||||
<div>自定义考试</div>
|
||||
<div v-if="showTab==3">
|
||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border-bottom: 1px solid #e7e7e7;">
|
||||
<div>{{examInfo.paperType==1? '自定义考试':'使用独立考试试卷'}} </div>
|
||||
<div>
|
||||
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
|
||||
<el-button style="margin-left: 10px;" @click="changeExamShow(1)" type="info" size="mini" >重新选择</el-button>
|
||||
<el-checkbox v-model="onlyQuestion">只显示试题</el-checkbox>
|
||||
<el-button :loading="loading" style="margin-left: 10px;" @click="saveExam()" type="primary" > 保 存 </el-button>
|
||||
<el-button style="margin-left: 10px;" @click="deleteExam()" type="danger" > 删 除 </el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top: 10px;overflow: auto;">
|
||||
<div v-if="!exam.onlyQuestion">
|
||||
<el-form size="mini" label-width="80px">
|
||||
<div v-if="!onlyQuestion">
|
||||
<el-form size="small" label-width="80px">
|
||||
<!-- 课程内考虑不需要名辽
|
||||
<el-form-item label="考试名称">
|
||||
<el-input v-model="exam.info.name" placeholder="请输入名称"></el-input>
|
||||
<el-input v-model="examInfo.testName" placeholder="请输入名称"></el-input>
|
||||
</el-form-item>
|
||||
-->
|
||||
<el-form-item label="考试时长">
|
||||
<el-col :span="10">
|
||||
<el-input v-model="exam.info.passScore" placeholder="20-120">
|
||||
<el-col :span="8">
|
||||
<el-input size="mini" v-model="examInfo.testDuration" placeholder="20-120">
|
||||
<template slot="append">分钟</template>
|
||||
</el-input>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="及格线">
|
||||
<el-input placeholder="20-100">
|
||||
<el-input size="mini" placeholder="20-100" :maxlength="3" v-model="examInfo.passLine">
|
||||
<template slot="append">%</template>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="显示">
|
||||
<el-col :span="10">
|
||||
<el-checkbox v-model="exam.info.showJieXi">允许查看解析</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-checkbox v-model="exam.info.showAnswer">允许查看答案</el-checkbox>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="试题试卷">
|
||||
<el-col :span="10">
|
||||
<el-checkbox v-model="exam.info.randomType">随机试题</el-checkbox>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-checkbox-group v-model="exam.info.qorder">
|
||||
<el-checkbox :label="1">题目乱序</el-checkbox>
|
||||
<el-checkbox :label="2">选项乱序</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="尝试次数">
|
||||
<el-col :span="10">
|
||||
<el-input placeholder="0代表不限制"></el-input>
|
||||
</el-col>
|
||||
<el-col :span="14">
|
||||
<el-form-item label="评分方式">
|
||||
<el-radio-group v-model="exam.info.randomType">
|
||||
<el-form-item label="评分方式">
|
||||
<el-col :span="8">
|
||||
<el-radio-group v-model="examInfo.scoringType">
|
||||
<el-radio :label="1">最高一次</el-radio>
|
||||
<el-radio :label="2">最后一次</el-radio>
|
||||
</el-radio-group>
|
||||
</el-col>
|
||||
<el-col :span="16">
|
||||
<el-form-item label="百分制">
|
||||
<el-checkbox v-model="examInfo.percentScore">实际成绩*100/实际总分</el-checkbox>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div style="padding: 10px;text-align: center;">
|
||||
<el-button type="primary">导入</el-button>
|
||||
<el-button type="primary">添加</el-button>
|
||||
<el-button @click="changeExamShow(9)" type="primary">提交</el-button>
|
||||
</div>
|
||||
<div>
|
||||
<el-table :data="exam.info.questions" style="100%" border stripe>
|
||||
<el-table-column label="题干" prop="body">
|
||||
<template>试题11</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="设置得分" prop="score" width="80px">
|
||||
<template slot-scope="scope">10</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button icon="el-icon-edit" type="text" size="mini"></el-button>
|
||||
<el-button icon="el-icon-close" type="text" size="mini"></el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==9">
|
||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border: 1px solid #e7e7e7;">
|
||||
<div>考试信息</div><div><el-button @click="changeExamShow(1)" type="info" size="mini" >重新设置考试</el-button> </div>
|
||||
</div>
|
||||
<div style="padding-top: 10px;">
|
||||
<el-form size="mini" label-width="80px">
|
||||
<el-form-item label="考试名称">XXXXXXXXXXXXXXX</el-form-item>
|
||||
<el-form-item label="考试时长">60分钟</el-form-item>
|
||||
<el-form-item label="显示解析">允许查看</el-form-item>
|
||||
<el-form-item label="显示答案">不允许查看</el-form-item>
|
||||
<el-form-item label="随机模式">是</el-form-item>
|
||||
<el-form-item label="尝试次数">不限制</el-form-item>
|
||||
<el-form-item label="试题排列">题目乱序</el-form-item>
|
||||
<el-form-item label="评分方式">最高一次</el-form-item>
|
||||
<el-form-item label="及格线">60%</el-form-item>
|
||||
<el-form-item label="">
|
||||
<el-button type="primary">编辑试卷</el-button>
|
||||
<el-button @click="exam.paperShow=true" type="primary">预览试卷</el-button>
|
||||
<el-form-item label="考试说明">
|
||||
<el-input type="textarea" show-word-limit v-model="examInfo.info" placeholder="关于考试的说明(限255字以内)" maxlength="255"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div style="color: #ff0000;">只限于自定义考试,才会有编辑试卷</div>
|
||||
</div>
|
||||
<div v-if="examInfo.paperType==1">
|
||||
<simplePaper :data="examPaper"></simplePaper>
|
||||
</div>
|
||||
<div v-if="examInfo.paperType==2">
|
||||
<div style="font-size: 20px;padding: 10px;" >试卷: {{usePaper.paperName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="查看试卷" append-to-body :visible.sync="exam.paperShow" width="800px" custom-class="g-dialog">
|
||||
<div v-if="showTab==9">
|
||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border: 1px solid #e7e7e7;">
|
||||
<div>考试信息</div><div> </div>
|
||||
</div>
|
||||
<div style="padding-top: 10px;">
|
||||
<el-form size="small" label-width="80px">
|
||||
<el-form-item label="试卷类型">
|
||||
{{examInfo.paperType==1? '自定义试卷':'使用考试试卷: '+usePaper.paperName}}
|
||||
</el-form-item>
|
||||
<el-form-item label="考试时长">
|
||||
<el-col :span="6">{{examInfo.passScore}}分钟</el-col>
|
||||
<el-col :span="9">
|
||||
<el-form-item label="及格线">{{examInfo.passLine}}%</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="评分方式">
|
||||
<el-col :span="6">
|
||||
<span v-if="examInfo.scoringType==1">最高一次</span>
|
||||
<span v-if="examInfo.scoringType==2">最后一次</span>
|
||||
</el-col>
|
||||
<el-col :span="10">
|
||||
<el-form-item label="考试成绩">
|
||||
<span v-if="examInfo.percentScore">按百分制显示</span>
|
||||
<span v-else>按实际得分显示</span>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-form-item>
|
||||
<el-form-item label="考试说明">{{examInfo.info}}</el-form-item>
|
||||
|
||||
<el-form-item label="">
|
||||
<el-button type="primary" @click="changeExamShow(3)"> 修 改 </el-button>
|
||||
<el-button type="danger" @click="deleteExam(3)"> 删 除 </el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="查看试卷" append-to-body :visible.sync="paperShow" width="800px" custom-class="g-dialog">
|
||||
<div>
|
||||
<img :src="`${webBaseUrl}/temp/exampaper.png`">
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="exam.paperShow= false">关闭</el-button>
|
||||
<el-button @click="paperShow= false">关闭</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
import apiCourse from '../../api/modules/course.js';
|
||||
import apiExamPaper from '../../api/modules/paper.js';
|
||||
import { deepClone } from "../../utils";
|
||||
export default{
|
||||
components:{simplePaper},
|
||||
props:{
|
||||
courseId:{
|
||||
type: String,
|
||||
default:'',
|
||||
},
|
||||
contentId:{
|
||||
type: String,
|
||||
default:'',
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
exam:{
|
||||
show:1,
|
||||
paperShow:false,
|
||||
customerShow:false,
|
||||
has:false,
|
||||
onlyQuestion:false,
|
||||
info:{
|
||||
name:'',
|
||||
limitTimes:1,
|
||||
passScore:60,
|
||||
showJieXi:true,
|
||||
showAnswer:false,
|
||||
randomType:1,
|
||||
qorder:[],
|
||||
examTime:60,
|
||||
questions:[
|
||||
{body:'试题1',score:10},
|
||||
{body:'试题2',score:10}
|
||||
],
|
||||
|
||||
},
|
||||
findhas:{
|
||||
list:[{},{}]
|
||||
}
|
||||
loading:false,
|
||||
examChange:{}, //用于保存,检查是否改变
|
||||
showTab:0, //显示哪个
|
||||
onlyQuestion:false, //只显示问题
|
||||
paperShow:false, //查看试卷
|
||||
examPaper:{items:[]}, //试题列表的对象
|
||||
examInfo:{
|
||||
id:'',
|
||||
name:'',
|
||||
testDuration:30,
|
||||
testName:'',
|
||||
courseId:this.courseId,
|
||||
contentId:'',
|
||||
paperType:1,//默认是自定义
|
||||
paperId:'',
|
||||
arrange:0,
|
||||
qnum:0,
|
||||
times:1,
|
||||
passScore:60,
|
||||
showAnswer:false,
|
||||
showAnalysis:false,
|
||||
randomType:1,
|
||||
scoringType:1,
|
||||
passLine:60,
|
||||
randomMode:false,
|
||||
percentScore:true,//默认是百分制
|
||||
paperContent:'',
|
||||
info:''
|
||||
},
|
||||
usePaper:{ //使用考试试卷
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
total:0,
|
||||
list:[],
|
||||
keyword:'',
|
||||
paperId:'',//选择的试卷的id
|
||||
paperName:'',//选择的试卷的名称
|
||||
paperJson:{items:[]},
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(this.contentId){
|
||||
this.reloadExam();
|
||||
}else{
|
||||
this.showTab=1;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
contentId(newVal,oldVal){
|
||||
if(newVal!=oldVal){
|
||||
this.reloadExam();
|
||||
}
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
reloadExam(){
|
||||
console.log('contentId='+this.contentId);
|
||||
this.examPaper={items:[]};
|
||||
this.examInfo.id='';
|
||||
this.examInfo.paperType=1;
|
||||
this.examInfo.paperId='';
|
||||
this.examInfo.paperContent="{}";
|
||||
if(this.contentId){
|
||||
apiCourse.getExam(this.contentId).then(res=>{
|
||||
if(res.status==200){
|
||||
this.examInfo=res.result;
|
||||
if(res.result.paperType==1){
|
||||
this.examInfo.paperContent=res.result.paperContent;
|
||||
this.examPaper=JSON.parse(res.result.paperContent);
|
||||
}else{
|
||||
apiExamPaper.detail(this.examInfo.paperId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.paperId=rs.result.id;
|
||||
this.usePaper.paperName=rs.result.testName;
|
||||
this.usePaper.counts=rs.result.counts;
|
||||
//this.usePaper.paperJson= rs.result.paperContent;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.showTab=9;
|
||||
//this.examChange = deepClone(this.exam);
|
||||
}else if(res.status==404){
|
||||
|
||||
}else{
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
this.showTab=1;//选择状态
|
||||
}
|
||||
},
|
||||
saveExam(){//保存
|
||||
//检查是否完整
|
||||
if(this.examInfo.paperType==1){
|
||||
if(this.examPaper.items.length==0){
|
||||
this.$message.error("您还没有添加考试的试题");
|
||||
return;
|
||||
}
|
||||
let pass=true;
|
||||
this.examPaper.items.forEach(qitem=>{
|
||||
if(qitem.options.length==0){
|
||||
pass=false;
|
||||
}else{
|
||||
let hasAnswer=qitem.options.some(opt=>{
|
||||
return opt.answer;
|
||||
});
|
||||
if(!hasAnswer){
|
||||
pass=false;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(!pass){
|
||||
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
||||
return;
|
||||
}
|
||||
this.examInfo.paperContent=JSON.stringify(this.examPaper);
|
||||
}else{
|
||||
if(this.examInfo.paperId==''){
|
||||
this.$message.error("您还未选择任何试卷,请先选择试卷");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
this.$emit("save",this.examInfo);
|
||||
},
|
||||
deleteExam(){ //删除
|
||||
this.$confirm('您确认要删除此考试内容吗?', '删除提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.$emit("remove",this.examInfo);
|
||||
}).catch(() => {
|
||||
|
||||
});
|
||||
|
||||
},
|
||||
changeExamShow(idx){
|
||||
this.exam.show=idx;
|
||||
this.showTab=idx;
|
||||
},
|
||||
openCusExam(){ //自定义考试
|
||||
this.showTab=3;
|
||||
this.examInfo.paperType=1;
|
||||
this.examInfo.paperId='';
|
||||
this.usePaper.pageIndex=1;
|
||||
this.usePaper.keyword="";
|
||||
},
|
||||
openChoosePaper(){
|
||||
this.showTab=2;
|
||||
this.examInfo.paperType=2; //选择试卷
|
||||
this.examInfo.paperId='';
|
||||
},
|
||||
findExamPapers(){ //查询已有的考试试卷
|
||||
this.usePaper.pageIndex=1;
|
||||
this.loadExamPapers();
|
||||
},
|
||||
loadExamPapers(){
|
||||
let pars={
|
||||
pageIndex:this.usePaper.pageIndex,
|
||||
pageSize:this.usePaper.pageSize,
|
||||
keyword:this.usePaper.keyword
|
||||
}
|
||||
apiExamPaper.querylist(pars).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.list=rs.result.list;
|
||||
this.usePaper.total=rs.result.count;
|
||||
}else{
|
||||
this.$message.error('查询可用试卷失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
changePaperPage(pindex){
|
||||
this.usePaper.pageIndex=pindex;
|
||||
this.loadExamPapers();
|
||||
},
|
||||
chooseExamPaper(epaper){ //选择试卷后
|
||||
if(epaper.counts==0){
|
||||
this.$message.error('此试卷无试题内容,请重新选择');
|
||||
return;
|
||||
}
|
||||
this.examInfo.paperType=2;// 选择已有试卷
|
||||
this.examInfo.paperId=epaper.id;// 选择已有试卷
|
||||
this.usePaper.paperId=epaper.id;
|
||||
this.usePaper.paperName=epaper.testName;
|
||||
//this.usePaper.paperJson= epaper.paperContent;
|
||||
this.loadExamPaper();
|
||||
this.changeExamShow(3);
|
||||
},
|
||||
loadExamPaper(){
|
||||
if(this.examInfo.paperType!=2){
|
||||
return;
|
||||
}
|
||||
apiExamPaper.detail(this.examInfo.paperId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.paperId=rs.result.id;
|
||||
this.usePaper.paperName=rs.result.testName;
|
||||
this.usePaper.counts=rs.result.counts;
|
||||
//this.usePaper.paperJson= rs.result.paperContent;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -259,7 +259,7 @@
|
||||
<el-input maxlength="50" v-model="courseInfo.forUsers" show-word-limit placeholder="目标人群(限50字以内)"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="受众"><!--:disabled="item.disabled"-->
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple placeholder="请选择">
|
||||
<el-select value-key="id" style="width: 100%;" v-model="courseCrowds" filterable multiple :clearable="false" @remove-tag="removeCrowd" placeholder="请选择">
|
||||
<el-option v-for="item in userGroupList" :key="item.id" :label="item.name" :value="item"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
@@ -567,6 +567,7 @@ export default {
|
||||
this.orgName=orgInfo.name;
|
||||
this.orgKid=orgInfo.kid; //kid已不存在
|
||||
this.courseInfo.orgId=orgInfo.id;
|
||||
this.courseInfo.orgName=orgInfo.name;
|
||||
this.$refs.refChooseOrg.dlgShow = false;
|
||||
},
|
||||
getTeacherList(res) {
|
||||
@@ -729,6 +730,7 @@ export default {
|
||||
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.orgName=rs.result.name;
|
||||
this.courseInfo.orgName=rs.result.name;
|
||||
//this.orgKid=rs.result.kid;
|
||||
this.orgNamePath=rs.result.namePath;
|
||||
}
|
||||
@@ -849,6 +851,7 @@ export default {
|
||||
apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{
|
||||
if(rrs.status==200){
|
||||
$this.orgName=rrs.result.name;
|
||||
this.courseInfo.orgName=rrs.result.name;
|
||||
//$this.orgKid=rrs.result.kid;
|
||||
$this.orgNamePath=rrs.result.namePath;
|
||||
}else{
|
||||
@@ -875,6 +878,7 @@ export default {
|
||||
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
$this.orgName=rs.result.name;
|
||||
$this.courseInfo.orgName=rs.result.name;
|
||||
//$this.orgKid=rs.result.kid;
|
||||
$this.orgNamePath=rs.result.namePath;
|
||||
}else{
|
||||
|
||||
@@ -56,13 +56,17 @@
|
||||
<div style="font-size: 20px;"><span style="font-size: 40upx;" :class="{'redText':timerValue<5}">{{timerValue}}</span> 分钟</div>
|
||||
</div>
|
||||
<div class="qitem">
|
||||
<div class="qitem-info">【{{getTypeName(curItem.type)}}】{{curItem.content}}</div>
|
||||
<div class="qitem-info">
|
||||
<div>【{{getTypeName(curItem.type)}}】{{curItem.content}} </div>
|
||||
<div class="qimg" v-if="curItem.images"><img class="qimg-fit" :src="imageBaseUrl+curItem.images"/></div>
|
||||
</div>
|
||||
<div v-for="(opt,optIdx) in curItem.options" :key="optIdx">
|
||||
<div class="qitem-opts">
|
||||
<div class="qitem-opt" :class="{check:opt.checked}" @click="chooseOption(opt)">
|
||||
{{toLetter(optIdx+1)}}.{{opt.content}}
|
||||
<i class="el-icon-check" v-if="opt.checked" name="checkbox-mark" color="#00aa00"></i>
|
||||
</div>
|
||||
<div class="qimg" v-if="opt.images"><img class="qimg-fit" :src="imageBaseUrl+opt.images"/></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -80,16 +84,22 @@
|
||||
<div style="text-align: left;" class="upaper">
|
||||
<!--答卷信息-->
|
||||
<div v-for="(ditem,didx) in detailItems" :key="didx" class="upaper-item">
|
||||
<div class="upaper-item-q">{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.content}}</div>
|
||||
<div class="upaper-item-q">
|
||||
<div>{{didx +1}}.【{{getTypeName(ditem.type)}}】{{ditem.content}}</div>
|
||||
<div class="qimg" v-if="ditem.images"><img class="qimg-fit" :src="imageBaseUrl+ditem.images"/></div>
|
||||
</div>
|
||||
<div class="upaper-item-opts" style="padding-left: 20px;">
|
||||
<div v-for="(opt,optIdx) in ditem.options" :key="optIdx" class="upaper-item-opt" :class="{'upaper-item-opt-user':ditem.userOptIdxs.indexOf(optIdx)>-1}">
|
||||
<div>
|
||||
<div>{{toLetter(optIdx+1)}}, {{opt.content}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<span v-if="ditem.userOptIdxs.indexOf(optIdx)>-1 && ditem.correctOptIdxs.indexOf(optIdx)>-1" style="color: #00aa00;font-size: 25px; ">√</span>
|
||||
<span v-if="ditem.userOptIdxs.indexOf(optIdx)>-1 && ditem.correctOptIdxs.indexOf(optIdx)==-1" style="color: #ff0000;font-size: 25px; ">×</span>
|
||||
<div v-for="(opt,optIdx) in ditem.options" :key="optIdx">
|
||||
<div class="upaper-item-opt" :class="{'upaper-item-opt-user':ditem.userOptIdxs.indexOf(optIdx)>-1}">
|
||||
<div>
|
||||
<div>{{toLetter(optIdx+1)}}, {{opt.content}}</div>
|
||||
</div>
|
||||
<div>
|
||||
<span v-if="ditem.userOptIdxs.indexOf(optIdx)>-1 && ditem.correctOptIdxs.indexOf(optIdx)>-1" style="color: #00aa00;font-size: 25px; ">√</span>
|
||||
<span v-if="ditem.userOptIdxs.indexOf(optIdx)>-1 && ditem.correctOptIdxs.indexOf(optIdx)==-1" style="color: #ff0000;font-size: 25px; ">×</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="qimg" v-if="opt.images"><img class="qimg-fit" :src="imageBaseUrl+opt.images"/></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="upaper-item-answer" style="display: flex;">
|
||||
@@ -119,6 +129,7 @@
|
||||
<script>
|
||||
import apiStudy from '@/api/modules/courseStudy.js';
|
||||
import apiCourse from '@/api/modules/course.js';
|
||||
import apiExamPaper from '@/api/modules/paper.js';
|
||||
import {formatDate,formatSeconds} from '@/utils/datetime.js';
|
||||
import {testType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
||||
export default {
|
||||
@@ -146,6 +157,7 @@ export default {
|
||||
data() {
|
||||
return {
|
||||
viewTest:[],
|
||||
imageBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
correctJudgment:correctJudgment,
|
||||
toLetter:numberToLetter,
|
||||
formatSeconds:formatSeconds,
|
||||
@@ -168,7 +180,11 @@ export default {
|
||||
records:[] ,//考试记录
|
||||
allowSubmit:true,//是否允许考试,尝试次数达到后不能再考试,暂时未使用
|
||||
detailShow:false,
|
||||
detailItems:[]
|
||||
detailItems:[],
|
||||
examPaper:{
|
||||
json:{},//试题的json格式
|
||||
items:[],//试题内容
|
||||
}
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
@@ -217,8 +233,6 @@ export default {
|
||||
this.total=paper.items.length;
|
||||
this.paper =paper;
|
||||
//console.log(this.paper);
|
||||
|
||||
|
||||
this.viewTest =paper.items;
|
||||
}
|
||||
if(!this.showTest && this.showRecord){
|
||||
@@ -260,30 +274,99 @@ export default {
|
||||
})
|
||||
}
|
||||
},
|
||||
startTest(){
|
||||
let paper= JSON.parse(this.info.paperContent);
|
||||
paper.items.forEach(item=>{
|
||||
//console.log(item);
|
||||
if(item.type==101){
|
||||
item.userAnswer='';
|
||||
}else if(item.type==102){
|
||||
item.userAnswer=[];
|
||||
}else{
|
||||
item.userAnswer=''
|
||||
}
|
||||
item.options.forEach(opt=>{
|
||||
opt.checked=false;
|
||||
})
|
||||
});
|
||||
this.total=paper.items.length;
|
||||
this.paper =paper;
|
||||
//console.log(this.paper);
|
||||
//独立考试的试题转化为课内考试的试题
|
||||
convertToItems(questions){
|
||||
let qitems=[];
|
||||
questions.forEach(item=>{
|
||||
let q={
|
||||
id:item.id,
|
||||
type:item.type==1? 101:item.type==2? 102:103,
|
||||
score:item.defaultScore,
|
||||
checked:false,
|
||||
userAnswer:'',
|
||||
optShow:true,
|
||||
content:item.title,
|
||||
images:item.images,
|
||||
options:[]
|
||||
}
|
||||
if(item.type==3){
|
||||
q.options.push({
|
||||
id:item.id+'1',
|
||||
images:'',
|
||||
content:"正确",
|
||||
answer:item.answer=='true'? true:false,
|
||||
checked:false
|
||||
});
|
||||
q.options.push({
|
||||
id:item.id+'2',
|
||||
images:'',
|
||||
content:"错误",
|
||||
answer:item.answer=='true'? false:true,
|
||||
checked:false
|
||||
})
|
||||
}else{
|
||||
item.optionList.forEach(opt=>{
|
||||
q.options.push({
|
||||
id:opt.id,
|
||||
images:opt.images,
|
||||
content:opt.content,
|
||||
answer:opt.isAnswer,
|
||||
checked:false
|
||||
})
|
||||
});
|
||||
}
|
||||
|
||||
this.curItem=paper.items[this.curIndex];
|
||||
this.startTime=new Date();//记录开始时间
|
||||
this.timerValue=this.info.testDuration;
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
if(q.type==102){
|
||||
q.userAnswer=[];
|
||||
}
|
||||
qitems.push(q);
|
||||
});
|
||||
console.log(qitems,'qitems')
|
||||
return qitems;
|
||||
},
|
||||
startTest(){
|
||||
if(this.info.paperType==2){
|
||||
apiExamPaper.getPaperContent(this.info.paperId).then(rs=>{
|
||||
if(rs.status=200){
|
||||
this.examPaper.json=JSON.parse(rs.result);
|
||||
//console.log(this.examPaper.json,'this.examPaper.json');
|
||||
let qitems=this.convertToItems(this.examPaper.json);
|
||||
this.paper ={items:qitems};
|
||||
this.total=qitems.length;
|
||||
this.curItem=qitems[this.curIndex];
|
||||
this.startTime=new Date();//记录开始时间
|
||||
this.timerValue=this.info.testDuration;
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
}else{
|
||||
this.$message.error('加载试卷内容失败,请与管理员联系,试卷是否已删除');
|
||||
}
|
||||
})
|
||||
}else{
|
||||
let paper= JSON.parse(this.info.paperContent);
|
||||
paper.items.forEach(item=>{
|
||||
//console.log(item);
|
||||
if(item.type==101){
|
||||
item.userAnswer='';
|
||||
}else if(item.type==102){
|
||||
item.userAnswer=[];
|
||||
}else{
|
||||
item.userAnswer=''
|
||||
}
|
||||
item.options.forEach(opt=>{
|
||||
opt.checked=false;
|
||||
})
|
||||
});
|
||||
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;
|
||||
this.timer=setInterval(this.changeTimer,60000);
|
||||
this.testStart=true;
|
||||
}
|
||||
},
|
||||
chooseOption(opt){
|
||||
if(this.curItem.type==101 || this.curItem.type==103){
|
||||
@@ -328,7 +411,7 @@ export default {
|
||||
present(){ //提交前处理
|
||||
let $this=this;
|
||||
let score=this.countTest();
|
||||
|
||||
console.log('score='+score);
|
||||
if(this.noAnswers.length>0){
|
||||
this.$confirm('还有未答试题,您确定要提交吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
@@ -349,6 +432,7 @@ export default {
|
||||
let totalScore=0;
|
||||
this.paper.items.forEach(item => {
|
||||
item.score=parseInt(item.score);
|
||||
//console.log(item.score,'item.score');
|
||||
totalScore+=item.score;//加到总分中
|
||||
if(item.type != 102){
|
||||
item.userAnswer='';
|
||||
@@ -366,6 +450,7 @@ export default {
|
||||
});
|
||||
}
|
||||
});
|
||||
//console.log(totalScore,'totalScore');
|
||||
let scoreNum = 0;//用户得分
|
||||
let noAnswers=[];//是否都已答
|
||||
this.paper.items.forEach((item,idx) => {
|
||||
@@ -456,6 +541,8 @@ export default {
|
||||
}
|
||||
});
|
||||
this.testStart = false;
|
||||
//获取最新的成绩
|
||||
this.loadStudyItemId();
|
||||
this.$emit('submit',this.lastScore);//考试提交回调处理
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
@@ -570,4 +657,14 @@ export default {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
.qimg{
|
||||
padding-left: 30px;
|
||||
width:100%;
|
||||
text-align: left;
|
||||
.qimg-fit{
|
||||
width:100%;
|
||||
|
||||
object-fit:scale-down
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -24,15 +24,26 @@
|
||||
</div>
|
||||
<!--内容区-->
|
||||
<div style="margin-top: 10px;">
|
||||
<div v-if="cware.content.contentType<41 && !cware.findShow">
|
||||
<div v-if="cware.content.contentType<51 && !cware.findShow">
|
||||
<div v-if="cware.content.contentRefId==''">
|
||||
<div style="display: flex;justify-content: center;padding-top: 50px;">
|
||||
<div>
|
||||
<file-upload :fileType="getFileTypes(cware.content.contentType)" dir="course" :isShowTip="false" :showList="true" size="small" :text="'上传新'+getType(cware.content.contentType)" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||
</div>
|
||||
<div style="padding-top: 0px;">
|
||||
<!-- <div> -->
|
||||
<choose-course-file :orgId="course.orgId" :orgName="course.orgName" ref="coursewarePanel" :resType="cware.content.contentType" @choose="chooseFile"></choose-course-file>
|
||||
|
||||
<!-- <file-upload
|
||||
:fileType="getFileTypes(cware.content.contentType)"
|
||||
dir="course"
|
||||
:isShowTip="false"
|
||||
:showList="true"
|
||||
size="small"
|
||||
:text="'上传新'+getType(cware.content.contentType)"
|
||||
@success="handleUploadSuccess"
|
||||
@remove="handleRemoveSuccess">
|
||||
</file-upload> -->
|
||||
<!-- </div>
|
||||
<div style="margin-left: 10px;">
|
||||
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
@@ -116,6 +127,9 @@
|
||||
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="cware.content.contentType==50" style="text-align: center;">
|
||||
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" border="0px" style="width:100%;height:400px;border:0px"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -263,8 +277,8 @@
|
||||
<el-tab-pane label="考试" name="exam">
|
||||
<div v-if="exam.show==1">
|
||||
<div style="padding: 10px; text-align: center;">
|
||||
<el-button @click="changeExamShow(3)" type="primary" >自定义考试</el-button>
|
||||
<!-- <el-button @click="changeExamShow(2)" type="primary" size="small">选择已有考试</el-button> -->
|
||||
<el-button @click="openCusExam()" type="primary" >自定义考试</el-button>
|
||||
<el-button @click="openChoosePaper()" type="primary">选择已有考试</el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==2">
|
||||
@@ -275,37 +289,39 @@
|
||||
</el-select>
|
||||
</div>
|
||||
-->
|
||||
<div><el-input maxlength="50" placeholder="名称"></el-input></div>
|
||||
<div><el-input maxlength="50" placeholder="创建人"></el-input></div>
|
||||
<div style="padding-left: 10px;"><el-button type="primary" >搜索已有考试</el-button></div>
|
||||
<div><el-input v-model="usePaper.keyword" maxlength="50" placeholder="名称"></el-input></div>
|
||||
<div style="padding-left: 10px;"><el-button @click="findExamPapers()" type="primary" >查询</el-button></div>
|
||||
<div style="padding-left: 10px;"><el-button @click="changeExamShow(1)" type="danger" >返回</el-button></div>
|
||||
</div>
|
||||
<div>
|
||||
<div style="text-align: center;padding-top: 10px;">
|
||||
<el-table style="100%" :data="hasCWare.list" border stripe>
|
||||
<el-table-column label="考试名称" prop="author"><template>考试名称</template></el-table-column>
|
||||
<el-table-column label="创建时间" prop="author">
|
||||
<div style="text-align: center;padding-top: 10px; overflow-y: auto;">
|
||||
<el-table style="100%" height="480" :data="usePaper.list" border stripe>
|
||||
<el-table-column prop="testName" label="考试名称"></el-table-column>
|
||||
<el-table-column prop="sysCreateTime" label="创建时间"></el-table-column>
|
||||
<el-table-column prop="sysCreateBy" label="创建人" width="80px" ></el-table-column>
|
||||
<el-table-column label="选择" width="60px">
|
||||
<template slot-scope="scope">
|
||||
2022-02-03
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建人" prop="content">
|
||||
<template>
|
||||
XXX
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="选择" width="80px">
|
||||
<template slot-scope="scope">
|
||||
<el-button @click="changeExamShow(9)" type="primary" >选择</el-button>
|
||||
<el-button size="mini" @click="chooseExamPaper(scope.row)" type="primary" >选择</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<!--分页功能-->
|
||||
<div v-if="usePaper.total >10" style="text-align: center; margin-top:10px">
|
||||
<el-pagination background
|
||||
@current-change="changePaperPage"
|
||||
:current-page="usePaper.pageIndex"
|
||||
:page-sizes="[10, 20, 30, 40]"
|
||||
:page-size="usePaper.pageSize"
|
||||
layout="total,pager"
|
||||
:total="usePaper.total"
|
||||
></el-pagination>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==3">
|
||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border-bottom: 1px solid #e7e7e7;">
|
||||
<div>自定义考试</div>
|
||||
<div>{{exam.paperType==1? '自定义考试':'使用独立考试试卷'}} </div>
|
||||
<div>
|
||||
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
|
||||
<el-button :loading="loading" style="margin-left: 10px;" @click="saveContent(3)" type="primary" > 保 存 </el-button>
|
||||
@@ -387,9 +403,12 @@
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
<div>
|
||||
<div v-if="exam.info.paperType==1">
|
||||
<simplePaper :data="exam.paperJson"></simplePaper>
|
||||
</div>
|
||||
<div v-if="exam.info.paperType==2">
|
||||
<div style="font-size: 20px;padding: 10px;" >试卷: {{usePaper.paperName}}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="exam.show==9">
|
||||
@@ -398,7 +417,11 @@
|
||||
</div>
|
||||
<div style="padding-top: 10px;">
|
||||
<el-form size="small" label-width="80px">
|
||||
<el-form-item label="考试时长">
|
||||
<el-form-item label="试卷类型">
|
||||
{{exam.info.paperType==1? '自定义试卷':'使用考试试卷: '+usePaper.paperName}}
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="考试时长">
|
||||
<el-col :span="6">{{exam.info.passScore}}分钟</el-col>
|
||||
<!-- <el-col :span="9">
|
||||
<el-form-item label="尝试次数">{{exam.info.times}}</el-form-item>
|
||||
@@ -497,7 +520,6 @@
|
||||
<el-button type="primary" v-if="!assess.content.id || assess.content.id==''" @click="saveContent(4)">保 存</el-button>
|
||||
<el-button type="danger" @click="deleteContent(4)">删 除</el-button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
@@ -521,17 +543,19 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||
import FileUpload from '@/components/FileUpload/index.vue';
|
||||
import pdfPreview from "@/components/PdfPreview/index.vue";
|
||||
import apiCourse from '../../api/modules/course.js';
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
import apiExamPaper from '../../api/modules/paper.js';
|
||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||
import {getType} from '../../utils/tools.js';
|
||||
import { deepClone } from "../../utils";
|
||||
export default{
|
||||
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer},
|
||||
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer,chooseCourseFile},
|
||||
props: {
|
||||
contents:{
|
||||
type:Array,
|
||||
@@ -566,6 +590,7 @@
|
||||
curCFile:{},//当前课件的内容
|
||||
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||
imageShowUrl: '',
|
||||
scormUrl:'',//scorm课件对应的url地址
|
||||
activeName: 'courseware',
|
||||
getType: getType,
|
||||
cwareTypes:[
|
||||
@@ -575,7 +600,7 @@
|
||||
{id:'2',type:'sound',name:'音频',img:'el-icon-service',resType: 20},
|
||||
{id:'3',type:'html',name:'图文',img:'el-icon-document-copy',resType: 41},
|
||||
{id:'4',type:'doc',name:'文档',img:'el-icon-document',resType: 40},
|
||||
// {id:'5',type:'scorm',name:'SCORM(Q2)',img:'el-icon-suitcase',resType: 50},
|
||||
{id:'5',type:'scorm',name:'SCORM',img:'el-icon-suitcase',resType: 50},
|
||||
{id:'6',type:'link',name:'外部连接',img:'el-icon-link', resType: 52}
|
||||
],
|
||||
cwareChange:{
|
||||
@@ -648,7 +673,7 @@
|
||||
paperJson:{items:[]},
|
||||
paperShow:false,
|
||||
customerShow:false,
|
||||
onlyQuestion:true,
|
||||
onlyQuestion:false,
|
||||
info:{
|
||||
courseId:'',
|
||||
contentId:'',
|
||||
@@ -670,13 +695,23 @@
|
||||
|
||||
}
|
||||
},
|
||||
usePaper:{ //使用考试试卷
|
||||
pageIndex:1,
|
||||
pageSize:10,
|
||||
total:0,
|
||||
list:[],
|
||||
keyword:'',
|
||||
paperId:'',//选择的试卷的id
|
||||
paperName:'',//选择的试卷的名称
|
||||
paperJson:{items:[]},
|
||||
},
|
||||
exam:{
|
||||
show:1,
|
||||
content:{id:'',contentType:61,sortIndex:3},
|
||||
paperJson:{items:[]},
|
||||
paperShow:false,
|
||||
customerShow:false,
|
||||
onlyQuestion:true,
|
||||
onlyQuestion:false,
|
||||
info:{
|
||||
courseId:'',
|
||||
contentId:'',
|
||||
@@ -696,7 +731,6 @@
|
||||
paperId:'',//试卷的id,只有paperType为2的时间才会有值
|
||||
info:'',//考试说明
|
||||
paperContent:'',//试题的json字符串
|
||||
|
||||
}
|
||||
},
|
||||
assess:{
|
||||
@@ -718,6 +752,9 @@
|
||||
},
|
||||
mounted(){
|
||||
//this.init();
|
||||
if(process.env.NODE_ENV=='development'){
|
||||
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
reset(newVal){
|
||||
@@ -731,6 +768,7 @@
|
||||
methods:{
|
||||
init(){
|
||||
this.activeName='courseware';
|
||||
this.scormUrl='';//scorm的路径
|
||||
this.curCFile={},//当前课件的内容
|
||||
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
||||
this.cware.show=1;
|
||||
@@ -759,6 +797,12 @@
|
||||
if(con.contentType==40){
|
||||
//console.log('加载pdf文件内容');
|
||||
$this.loadPdfFile();
|
||||
}else if(con.contentType==50){
|
||||
//console.log('加载pdf文件内容');
|
||||
if(!this.scormUrl){
|
||||
$this.loadScormFile();
|
||||
}
|
||||
|
||||
}
|
||||
if(con.contentType==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
@@ -815,6 +859,22 @@
|
||||
});
|
||||
}
|
||||
},
|
||||
loadScormFile(){
|
||||
//对于scorm课件内容,需要再查一下
|
||||
//this.scormUrl='';
|
||||
if(this.scormUrl){
|
||||
return;
|
||||
}
|
||||
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.curCFile=rs.result;
|
||||
//this.curPdfPath=rs.result.previewFilePath;
|
||||
this.cware.content.content='scorm';
|
||||
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?r=1&mode=preview&scormId='+this.curCFile.id;//播放的首页
|
||||
//console.log(this.scormUrl,'this.scormUrl')
|
||||
}
|
||||
});
|
||||
},
|
||||
loadHomeworkInfo(){
|
||||
apiCourse.getHomework(this.homework.content.id).then(res=>{
|
||||
if(res.status==200){
|
||||
@@ -834,7 +894,18 @@
|
||||
apiCourse.getExam(this.exam.content.id).then(res=>{
|
||||
if(res.status==200){
|
||||
this.exam.info=res.result;
|
||||
this.exam.paperJson=JSON.parse(res.result.paperContent);
|
||||
if(res.result.paperType==1){
|
||||
this.exam.paperJson=JSON.parse(res.result.paperContent);
|
||||
}else{
|
||||
apiExamPaper.detail(this.exam.info.paperId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.paperId=rs.result.id;
|
||||
this.usePaper.paperName=rs.result.testName;
|
||||
this.usePaper.counts=rs.result.counts;
|
||||
//this.usePaper.paperJson= rs.result.paperContent;
|
||||
}
|
||||
})
|
||||
}
|
||||
this.exam.show=9;
|
||||
this.examChange = deepClone(this.exam);
|
||||
}else if(res.status==404){
|
||||
@@ -920,6 +991,7 @@
|
||||
resetContent(index){
|
||||
if(index==1){
|
||||
this.cware.content.id='';
|
||||
this.scormUrl='';
|
||||
this.cware.content.contentRefId='';
|
||||
this.cware.content.contentName='';
|
||||
this.cware.content.content='';
|
||||
@@ -978,29 +1050,38 @@
|
||||
this.homeworkChange = deepClone(this.homework)
|
||||
}else if(index==3){
|
||||
postData.content=this.exam.content;
|
||||
//检查是不是所有的试题都有了答案
|
||||
if(this.exam.paperJson.items.length==0){
|
||||
this.$message.error("您还没有添加考试的试题");
|
||||
return;
|
||||
}
|
||||
let pass=true;
|
||||
this.exam.paperJson.items.forEach(qitem=>{
|
||||
if(qitem.options.length==0){
|
||||
pass=false;
|
||||
}else{
|
||||
let hasAnswer=qitem.options.some(opt=>{
|
||||
return opt.answer;
|
||||
});
|
||||
if(!hasAnswer){
|
||||
//console.log(this.exam,'this.exam');
|
||||
if(this.exam.info.paperType==2){
|
||||
if(!this.exam.info.paperId){
|
||||
this.$message.error("您还未选择任何试卷");
|
||||
return;
|
||||
}
|
||||
}else{
|
||||
//检查是不是所有的试题都有了答案
|
||||
if(this.exam.paperJson.items.length==0){
|
||||
this.$message.error("您还没有添加考试的试题");
|
||||
return;
|
||||
}
|
||||
let pass=true;
|
||||
this.exam.paperJson.items.forEach(qitem=>{
|
||||
if(qitem.options.length==0){
|
||||
pass=false;
|
||||
}else{
|
||||
let hasAnswer=qitem.options.some(opt=>{
|
||||
return opt.answer;
|
||||
});
|
||||
if(!hasAnswer){
|
||||
pass=false;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
if(!pass){
|
||||
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
||||
return;
|
||||
});
|
||||
if(!pass){
|
||||
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
||||
this.loading=false;
|
||||
return;
|
||||
}
|
||||
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
|
||||
}
|
||||
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
|
||||
postData.exam=this.exam.info;
|
||||
this.examChange = deepClone(this.exam);
|
||||
}else if(index==4){
|
||||
@@ -1084,6 +1165,36 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
chooseFile(cfile){
|
||||
this.cware.content.contentRefId=cfile.id;
|
||||
//如果是非pdf文档 ,这里需要使用cfile.id再去获取
|
||||
this.cware.content.contentName=cfile.name;
|
||||
if(this.cware.content.resType === 10 || this.cware.content.resType ==20) {
|
||||
this.cware.curriculumData.url = cfile.filePath;
|
||||
}else if(this.cware.content.resType === 50){
|
||||
|
||||
}else{
|
||||
if(cfile.previewFilePath){
|
||||
this.cware.curriculumData.url = cfile.previewFilePath;
|
||||
}else{
|
||||
this.cware.curriculumData.url = cfile.filePath;
|
||||
}
|
||||
}
|
||||
|
||||
this.cware.content.duration=cfile.duration;//时长
|
||||
this.saveContent(1);
|
||||
|
||||
let $this=this;
|
||||
if(this.cware.content.contentType==40){
|
||||
setTimeout(function(){
|
||||
$this.loadPdfFile();
|
||||
},1000);
|
||||
}else if(this.cware.content.contentType==50){
|
||||
setTimeout(function(){
|
||||
$this.loadScormFile();
|
||||
},500);
|
||||
}
|
||||
},
|
||||
getCoursewareList() {
|
||||
// name:查询的名称的关键字
|
||||
// self:true/false,默认是true,是否只查询自己上传的课件
|
||||
@@ -1169,15 +1280,75 @@
|
||||
changeHomeworkShow(idx){
|
||||
this.homework.show=idx;
|
||||
},
|
||||
changeExamShow(idx){
|
||||
|
||||
this.exam.show=idx;
|
||||
},
|
||||
assessmentHandle(){
|
||||
this.assess.show=2;
|
||||
},
|
||||
changeExamShow(idx){
|
||||
this.exam.show=idx;
|
||||
},
|
||||
openCusExam(){ //自定义考试
|
||||
this.exam.show=3;
|
||||
this.exam.info.paperType=1;
|
||||
this.exam.info.paperId='';
|
||||
this.usePaper.pageIndex=1;
|
||||
this.usePaper.keyword="";
|
||||
},
|
||||
openChoosePaper(){
|
||||
this.exam.show=2;
|
||||
this.exam.info.paperType=2; //选择试卷
|
||||
this.exam.info.paperId='';
|
||||
},
|
||||
findExamPapers(){ //查询已有的考试试卷
|
||||
this.usePaper.pageIndex=1;
|
||||
this.loadExamPapers();
|
||||
},
|
||||
loadExamPapers(){
|
||||
let pars={
|
||||
pageIndex:this.usePaper.pageIndex,
|
||||
pageSize:this.usePaper.pageSize,
|
||||
keyword:this.usePaper.keyword
|
||||
}
|
||||
apiExamPaper.querylist(pars).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.list=rs.result.list;
|
||||
this.usePaper.total=rs.result.count;
|
||||
}else{
|
||||
this.$message.error('查询可用试卷失败');
|
||||
}
|
||||
})
|
||||
},
|
||||
changePaperPage(pindex){
|
||||
this.usePaper.pageIndex=pindex;
|
||||
this.loadExamPapers();
|
||||
},
|
||||
chooseExamPaper(epaper){ //选择试卷后
|
||||
if(epaper.counts==0){
|
||||
this.$message.error('此试卷无试题内容,请重新选择');
|
||||
return;
|
||||
}
|
||||
this.exam.info.paperType=2;// 选择已有试卷
|
||||
this.exam.info.paperId=epaper.id;// 选择已有试卷
|
||||
this.usePaper.paperId=epaper.id;
|
||||
this.usePaper.paperName=epaper.testName;
|
||||
//this.usePaper.paperJson= epaper.paperContent;
|
||||
this.loadExamPaper();
|
||||
this.changeExamShow(3);
|
||||
},
|
||||
loadExamPaper(){
|
||||
if(this.exam.info.paperType!=2){
|
||||
return;
|
||||
}
|
||||
apiExamPaper.detail(this.exam.info.paperId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.usePaper.paperId=rs.result.id;
|
||||
this.usePaper.paperName=rs.result.testName;
|
||||
this.usePaper.counts=rs.result.counts;
|
||||
//this.usePaper.paperJson= rs.result.paperContent;
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
333
src/components/Exam/EditPaper.vue
Normal file
333
src/components/Exam/EditPaper.vue
Normal file
@@ -0,0 +1,333 @@
|
||||
<template>
|
||||
<!--编辑试卷-->
|
||||
<div >
|
||||
<el-dialog title="修改试卷" :visible.sync="editShow" width="800px" >
|
||||
<!--试卷的标题,可以编辑-->
|
||||
<div class="paper-title">
|
||||
<div>{{title}}</div>
|
||||
</div>
|
||||
<!--查询项-->
|
||||
<!-- <div>
|
||||
<el-form :inline="true" size="mini">
|
||||
<el-form-item>
|
||||
<el-select clearable v-model="qpaper.qtype" placeholder="请选择题型" class="search-width-120">
|
||||
<el-option label="单选题" :value="1"></el-option>
|
||||
<el-option label="多选题" :value="2"></el-option>
|
||||
<el-option label="判断题" :value="3"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item><el-input class="search-width-120" v-model="qpaper.keyword" clearable placeholder="题干"></el-input></el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="selectQuery()">搜索</el-button>
|
||||
<el-button type="primary" @click="resetQuery()">重置</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item></el-form-item>
|
||||
</el-form>
|
||||
</div> -->
|
||||
<div style="display: flex;justify-content: space-between;line-height:30px;">
|
||||
<div>
|
||||
<el-checkbox v-model="optionShow">显示选项</el-checkbox>
|
||||
</div>
|
||||
<div>
|
||||
双击题干或选项编辑
|
||||
</div>
|
||||
<div style="text-align: right;font-size: 14px;">
|
||||
本卷共
|
||||
<span class="bigred">{{paperLength}}</span>
|
||||
题, 总分
|
||||
<span class="bigred">{{totalScore}}</span>
|
||||
分
|
||||
</div>
|
||||
</div>
|
||||
<!--试卷内容-->
|
||||
<div class="paper-box">
|
||||
<div v-if="qitems.length>0" v-for="(item,idx) in qitems" :key="idx">
|
||||
<div v-if="item.type < 900">
|
||||
<div style="display: flex;justify-content: space-between;background-color: #dcf1ff;padding: 5px;">
|
||||
<div>
|
||||
<!-- <span style="padding-right: 5px;" v-if="paperQEdit"><el-checkbox v-model="item.checked" @change="checkedChange"></el-checkbox></span> -->
|
||||
<span v-if="item.type == 1">单选题</span>
|
||||
<span v-if="item.type == 2">多选题</span>
|
||||
<span v-if="item.type == 3">判断题</span>
|
||||
<span style="padding-left: 5px;">难度[{{item.difficulty == 1? '简单' : item.difficulty == 2? '中等': '困难'}}]</span>
|
||||
<!-- <span style="padding-left: 5px;">知识点[{{item.analysis}}]</span> -->
|
||||
</div>
|
||||
<div>
|
||||
<el-input @input="changeInput($event)" v-model="item.defaultScore" style="width: 120px;" size="mini" placeholder="分数" @blur="paperCalculation()">
|
||||
<template slot="append">分</template>
|
||||
</el-input>
|
||||
<el-button v-if="paperQEdit" icon="el-icon-delete" @click="checkDelete(idx)" size="mini"></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding: 15px;">
|
||||
<div style="font-weight: 700px;padding-bottom: 10px;cursor: pointer;" @dblclick="showCellEdit(idx,-1)">
|
||||
<div> {{ item.title }}</div>
|
||||
<div v-if="item.images" class="qimg"><img class="qimg-fit" :src="imageBaseUrl + item.images" alt=""> </div>
|
||||
</div>
|
||||
<div v-if="optionShow">
|
||||
<div v-if="item.type == 3">
|
||||
<div class="opt" @click="setJudgeAnswer(item,'true')" :class="{optanswer:item.answer=='true'}"><span class="optanswer-span">{{item.answer=='true'? '√':''}} </span> 1. 正确 </div>
|
||||
<div class="opt" @click="setJudgeAnswer(item,'false')" :class="{optanswer:item.answer=='false'}"><span class="optanswer-span">{{item.answer=='false'? '√':''}} </span> 2. 错误 </div>
|
||||
</div>
|
||||
<div v-else v-for="(opt, optIdx) in item.optionList" :key="optIdx" class="opt" @click="setOptAnswer(item,opt)" @dblclick="showCellEdit(idx,optIdx)">
|
||||
<div :class="{optanswer:opt.isAnswer}"><span class="optanswer-span">{{opt.isAnswer? '√':''}} </span> {{ optIdx + 1 }}, {{ opt.content }}</div>
|
||||
<div v-if="opt.images" class="qimg"><img class="qimg-fit" :src="imageBaseUrl + opt.images" alt=""> </div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-if="item.type > 900">
|
||||
<div style="height: 25px;">
|
||||
<span style="float: right;margin-top: -5px;cursor: pointer;" class="el-icon-delete" @click="checkDelete(idx)"></span>
|
||||
<div style="border-bottom: 2px dotted #000000;margin-right: 50px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button :loading="loading" type="primary" @click="save()"> 保 存 </el-button>
|
||||
<el-button @click="cancel()"> 取消 </el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
<el-dialog :title="cellData.title" :visible.sync="cellData.show" width="500px">
|
||||
<div>
|
||||
<div><el-input type="textarea" rows="2" v-model="cellData.text"></el-input> </div>
|
||||
<div style="height: 160px;padding-top: 10px;">
|
||||
<imgupload :value="cellData.img" @success="cellImageSuccss" @remove="cellImageRemove"></imgupload>
|
||||
</div>
|
||||
</div>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button :loading="loading" type="primary" @click="cellConfirm()"> 确定 </el-button>
|
||||
<el-button @click="cellCancel()"> 取消 </el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import apiPaper from '@/api/modules/paper.js';
|
||||
import imgupload from '@/components/ImageUpload/single.vue';
|
||||
import apiExamTask from '@/api/modules/examTask.js';
|
||||
import examQuestionApi from "@/api/modules/question";
|
||||
import {numberToLetter, deepCopy} from '../../utils/tools.js';
|
||||
export default {
|
||||
name: 'comEditPaper',
|
||||
components:{imgupload},
|
||||
props:{
|
||||
id:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
editShow:false,
|
||||
loading:false,
|
||||
paperId:'',
|
||||
imageBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
title:'',
|
||||
optionShow:true,
|
||||
qpaper:{qtype:'',keyword:''},
|
||||
paperLength:0,
|
||||
totalScore:0,
|
||||
qitems:[],
|
||||
tempItems:[],
|
||||
paper: {
|
||||
id:'',
|
||||
testName: '',
|
||||
remark: '',
|
||||
difficulty: ''
|
||||
},
|
||||
paperQEdit:false,
|
||||
cellData:{
|
||||
show:false,
|
||||
title:'修改题干',
|
||||
item:null,
|
||||
optIndex:-1,
|
||||
text:'',
|
||||
img:''
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
if(this.id){
|
||||
this.paperId=this.id;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
loadTestPaper(){
|
||||
if(this.paperId){
|
||||
this.editShow=true;
|
||||
this.loading=true;
|
||||
apiPaper.detail(this.paperId).then(res=>{
|
||||
if(res.status === 200) {
|
||||
this.paper=res.result;
|
||||
//转化试题
|
||||
this.qitems=JSON.parse(res.result.paperContent);
|
||||
//console.log(this.qitems,this.qitems)
|
||||
this.tempItems=this.qitems;
|
||||
this.paperCalculation();
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
this.loading=false;
|
||||
})
|
||||
}
|
||||
},
|
||||
show(paperId){
|
||||
this.paperId=paperId;
|
||||
this.editShow=true;
|
||||
this.loadTestPaper();
|
||||
},
|
||||
selectQuery(){
|
||||
this.qitems=this.tempItems;
|
||||
if(this.qpaper.qtype == '' && this.qpaper.keyword == '') {
|
||||
this.$forceUpdate();
|
||||
return
|
||||
}
|
||||
// let data = deepCopy(this.paperData);
|
||||
if(this.qpaper.qtype) {
|
||||
this.qitems=this.qitems.filter(item=>{
|
||||
if(item.type === this.qpaper.qtype){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.qpaper.keyword) {
|
||||
this.qitems = this.qitems.filter(item => {
|
||||
return item.title.toLowerCase().indexOf(this.qpaper.keyword.toLowerCase()) > -1;
|
||||
});
|
||||
}
|
||||
//this.paper.data = data;
|
||||
this.$forceUpdate();
|
||||
},
|
||||
resetQuery(){
|
||||
this.qpaper.qtype='';
|
||||
this.qpaper.keyword='';
|
||||
this.qitems=this.tempItems;
|
||||
},
|
||||
checkedChange(){
|
||||
this.$forceUpdate();
|
||||
},
|
||||
changeInput(e){
|
||||
this.$forceUpdate();
|
||||
},
|
||||
setJudgeAnswer(item,flag){
|
||||
item.answer=flag;
|
||||
},
|
||||
setOptAnswer(item,opt){
|
||||
if(item.type!=2){//单选的情况,先清空
|
||||
item.optionList.forEach(op=>{
|
||||
op.isAnswer=false;
|
||||
})
|
||||
}
|
||||
if(opt.isAnswer){
|
||||
opt.isAnswer=false;
|
||||
}else{
|
||||
opt.isAnswer=true;
|
||||
}
|
||||
},
|
||||
paperCalculation() {
|
||||
this.totalScore=0;
|
||||
this.paperLength=0;
|
||||
this.qitems.forEach(item=>{
|
||||
if(item.type < 900) {
|
||||
this.paperLength++;
|
||||
this.totalScore += Number(item.defaultScore);
|
||||
}
|
||||
})
|
||||
},
|
||||
save(){
|
||||
this.loading=true;
|
||||
this.paper.paperContent=JSON.stringify(this.qitems);
|
||||
apiPaper.update(this.paper).then((res)=>{
|
||||
if(res.status === 200) {
|
||||
this.$message.success('保存成功!')
|
||||
this.editShow=false;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
this.loading=false;
|
||||
})
|
||||
},
|
||||
cancel(){
|
||||
this.editShow=false;
|
||||
},
|
||||
showCellEdit(itemIdx,optIdx){
|
||||
this.cellData.item=this.qitems[itemIdx];
|
||||
this.cellData.optIndex=optIdx;
|
||||
this.cellData.img='';
|
||||
if(optIdx==-1){
|
||||
this.cellData.text=this.cellData.item.title;
|
||||
this.cellData.img=this.cellData.item.images;
|
||||
this.cellData.title="修改题干";
|
||||
}else{
|
||||
this.cellData.text=this.cellData.item.optionList[this.cellData.optIndex].content;
|
||||
this.cellData.img=this.cellData.item.optionList[this.cellData.optIndex].images;
|
||||
this.cellData.title="修改选项";
|
||||
}
|
||||
//console.log(this.cellData,'this.cellData');
|
||||
this.cellData.show=true;
|
||||
},
|
||||
cellConfirm(){
|
||||
if(this.cellData.optIndex==-1){
|
||||
this.cellData.item.title=this.cellData.text;
|
||||
this.cellData.item.images=this.cellData.img;
|
||||
}else{
|
||||
this.cellData.item.optionList[this.cellData.optIndex].content=this.cellData.text;
|
||||
this.cellData.item.optionList[this.cellData.optIndex].images=this.cellData.img;
|
||||
}
|
||||
this.cellData.show=false;
|
||||
},
|
||||
cellCancel(){
|
||||
this.cellData.show=false;
|
||||
},
|
||||
cellImageSuccss(res){
|
||||
//console.log(res,'res');
|
||||
this.cellData.img=res.result.filePath;
|
||||
},
|
||||
cellImageRemove(){
|
||||
this.cellData.img='';
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
.paper-title{
|
||||
text-align: center;
|
||||
font-size: 18px;
|
||||
}
|
||||
.paper-box{
|
||||
max-height: 500px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
.bigred {
|
||||
color: red;
|
||||
font-size: 20px;
|
||||
}
|
||||
.opt{
|
||||
padding-top:10px;cursor: pointer;
|
||||
}
|
||||
.optanswer{
|
||||
color: green;
|
||||
background-color: #fffaf7;
|
||||
}
|
||||
.optanswer-span{
|
||||
color: green;
|
||||
display: inline-block;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
.qimg{
|
||||
padding-left: 30px;
|
||||
max-width: 200px;
|
||||
.qimg-fit{
|
||||
width:100%;
|
||||
object-fit:scale-down
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -46,6 +46,10 @@ export default {
|
||||
props: {
|
||||
// 值
|
||||
value: [String, Object, Array],
|
||||
beforeMsg:{
|
||||
type: String,
|
||||
default:''
|
||||
},
|
||||
showList: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
@@ -75,10 +79,14 @@ export default {
|
||||
type: Number,
|
||||
default: 1024,
|
||||
},
|
||||
scorm:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3"],
|
||||
default: () => ["doc", "xls", "ppt","docx", "xlsx", "pptx","png","txt", "pdf","jpg","gif","bmp","mp4","mp3","zip"],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
@@ -131,6 +139,10 @@ export default {
|
||||
methods: {
|
||||
// 上传前校检格式和大小
|
||||
handleBeforeUpload(file) {
|
||||
if(this.beforeMsg){
|
||||
this.$message({message:this.beforeMsg,type:'error',offset:100})
|
||||
return false;
|
||||
}
|
||||
// 校检文件类型
|
||||
if (this.fileType) {
|
||||
let fileExtension = "";
|
||||
@@ -148,6 +160,13 @@ export default {
|
||||
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
||||
return false;
|
||||
}
|
||||
|
||||
//console.log(this.scorm,fileExtension,'upload');
|
||||
if(this.scorm && this.scorm==fileExtension){
|
||||
this.data.dir="scorm";
|
||||
}
|
||||
//console.log(this.data,'this.data');
|
||||
|
||||
}
|
||||
// 校检文件大小
|
||||
if (this.fileSize) {
|
||||
@@ -158,6 +177,7 @@ export default {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if(this.loading) {
|
||||
this.isLoading = true;
|
||||
}
|
||||
@@ -200,7 +220,7 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
|
||||
|
||||
this.fileList = this.list;
|
||||
},
|
||||
};
|
||||
@@ -215,14 +235,14 @@ export default {
|
||||
line-height: 2;
|
||||
margin-bottom: 10px;
|
||||
position: relative;
|
||||
|
||||
|
||||
}
|
||||
.upload-file-list .ele-upload-list__item-content {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
color: inherit;
|
||||
|
||||
|
||||
}
|
||||
.ele-upload-list__item-content-action .el-link {
|
||||
margin-right: 10px;
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<!-- <div style="float:right"> -->
|
||||
<router-link v-if="pageId == userInfo.aid" to="/user/Setting"><span class="content-one-info pointer" style="line-height: 30px;">个人设置</span></router-link>
|
||||
<span v-if="pageId == userInfo.aid" style="margin-left:10px;line-height: 30px;" class="content-one-info" ><router-link to="/uc/study/courses" class="pointer" style="color:#0060FF;">个人中心</router-link></span>
|
||||
<span @click="dialogVisible = true" v-if="teaechswich" style="margin-left:10px;line-height: 30px;" class="content-one-info">教师简介</span>
|
||||
<span class="content-one-info" v-if="pageId != userInfo.aid && !isFollowHas" @click="toFollow()">关注TA</span>
|
||||
<span class="Followed" @click="cancelFollow()" v-if="isFollowHas">已关注</span>
|
||||
<el-button type="text" round class="btn-user" > <router-link :to="'/home/'+pageId+'/leaving'">{{pageId == userInfo.aid ? '留言板':'去留言'}}<i class="el-icon-arrow-right"></i> </router-link> </el-button>
|
||||
@@ -65,7 +66,7 @@
|
||||
<div class="learning-border" ></div>
|
||||
<div class="learning-info" style="margin-left:22px">
|
||||
<div class="learning-qus">{{pageId == userInfo.aid? '我的U币(累计)':'TA的U币(累计)'}}</div>
|
||||
<div class="learning-an"><span>{{statData.uvalue}}</span></div>
|
||||
<div class="learning-an"><span>{{statData.uvalue < 0 ? 0 : statData.uvalue}}</span></div>
|
||||
</div>
|
||||
<!--
|
||||
<div class="learning-info" v-if="userInfo.aid == pageId">
|
||||
@@ -74,25 +75,58 @@
|
||||
-->
|
||||
</div>
|
||||
</div>
|
||||
<el-dialog title="教师信息" :visible.sync="dialogVisible" width="42%" class="teardiabox">
|
||||
<div class="teachphoto">
|
||||
<h6>教师职业照</h6>
|
||||
<img :src="tearchUrl" alt="">
|
||||
</div>
|
||||
<div class="teachphoto">
|
||||
<h6>教师经历</h6>
|
||||
{{ teachtext.workExperience }}
|
||||
</div>
|
||||
<div class="teachphoto" style="height:70px">
|
||||
<h6>擅长课程</h6>
|
||||
<div>
|
||||
{{ teachtext.courses }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="teachphoto" style="height:70px">
|
||||
<h6>专长</h6>
|
||||
<div v-for="(item,idx) in workname" :key="idx" class="teachexcel">
|
||||
{{ item }}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
import { mapGetters } from 'vuex'
|
||||
import { mapGetters,mapActions } from 'vuex'
|
||||
import apiTeach from '@/api/modules/teacher.js';
|
||||
import apiStart from '@/api/phase2/stat.js';
|
||||
import apiFollow from "@/api/phase2/userfollow.js"
|
||||
import apiUser from "@/api/system/user.js";
|
||||
import apiBoeTeahcer from "@/api/boe/teacher.js"
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
...mapGetters(['curIdentity','identity','userInfo']),
|
||||
...mapGetters(['curIdentity','identity','sysTypeMap','userInfo']),
|
||||
avatarText(){
|
||||
return userAvatarText(this.userInfo.name);
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
workname:[],
|
||||
childData:[],
|
||||
sysTypeListtear:[],
|
||||
teachtext:{},
|
||||
dialogVisible: false,
|
||||
teaechswich:false,
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
statData:{
|
||||
evalue: 0,//经验值
|
||||
@@ -103,6 +137,7 @@
|
||||
totalStudyDays:0, //累计学习天数
|
||||
uvalue:0 //U币数量
|
||||
},
|
||||
tearchUrl:'',
|
||||
orgInfo:'',
|
||||
sex:'',
|
||||
pageId:'',
|
||||
@@ -119,7 +154,6 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
this.pageId = this.$xpage.getHomeId(this.$route);
|
||||
this.sex = this.userInfo.sex;
|
||||
// 判断路由是进入的学员默认页面就重置setCurIdentity
|
||||
@@ -127,14 +161,70 @@
|
||||
this.setCurIdentity(1);
|
||||
}
|
||||
this.orgInfo=cutFullName(this.userInfo.departFullName,1);
|
||||
|
||||
this.getSysTypeTree().then(rs => {
|
||||
this.sysTypeListtear = rs;
|
||||
});
|
||||
this.loadUserStat();
|
||||
if(this.pageId !== this.userInfo.aid) {
|
||||
this.followHas();
|
||||
}
|
||||
|
||||
this.Teacherprofile();
|
||||
this.Teacherinfo();
|
||||
},
|
||||
|
||||
methods:{
|
||||
...mapActions({
|
||||
getResOwnerTree: 'resOwner/getResOwnerTree',
|
||||
loadResOwners: 'resOwner/loadResOwners',
|
||||
getSysTypeTree: 'sysType/getSysTypeTree',
|
||||
loadSysTypes: 'sysType/loadSysTypes'
|
||||
}),
|
||||
Teacherinfo(){
|
||||
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
|
||||
this.teachtext.workExperience = res.result.workExperience;
|
||||
this.teachtext.courses = res.result.courses;
|
||||
this.tearchUrl = this.fileBaseUrl + res.result.photo;
|
||||
|
||||
apiBoeTeahcer.simpleInfo(this.userInfo.sysId).then(sinfo=>{
|
||||
if(sinfo.status=='200'){
|
||||
if(sinfo.result.courses){
|
||||
this.teachtext.courses = sinfo.result.courses;
|
||||
}
|
||||
if(sinfo.result.work){
|
||||
this.teachtext.workExperience = sinfo.result.work;
|
||||
}
|
||||
if(sinfo.result.photo){
|
||||
this.teachtext.photo = sinfo.result.photo;
|
||||
this.tearchUrl = this.fileBaseUrl + sinfo.result.photo;
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
this.teachtext.expertise = res.result.expertise.split( ',' );
|
||||
//console.log(this.teachtext);
|
||||
this.sysTypeListtear.forEach(nm =>{
|
||||
nm.children.forEach(lk =>{
|
||||
this.childData.push(lk);
|
||||
})
|
||||
});
|
||||
this.teachtext.expertise.forEach(item =>{
|
||||
this.childData.forEach(it =>{
|
||||
if(item == it.id){
|
||||
console.log(item)
|
||||
this.workname.push(it.name);
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
Teacherprofile(){
|
||||
apiTeach.has(this.userInfo.aid).then(res =>{
|
||||
this.teaechswich = res.result.isTeacher;
|
||||
})
|
||||
},
|
||||
cancelFollow() {
|
||||
apiFollow.remove(this.pageId).then(res=>{
|
||||
if(res.status == 200) {
|
||||
@@ -200,6 +290,52 @@
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
::v-deep .el-dialog__body{
|
||||
padding: 30px 50px !important;
|
||||
}
|
||||
.teardiabox{
|
||||
padding: 20px 30px;
|
||||
}
|
||||
.teachexcel{
|
||||
padding: 5px 10px;
|
||||
margin-right: 10px;
|
||||
border: 1px solid #588afc;
|
||||
border-radius: 20px;
|
||||
color: #588afc;
|
||||
float: left;
|
||||
}
|
||||
.teachphoto{
|
||||
margin-top: 20px;
|
||||
h6{
|
||||
margin: 0;
|
||||
font-size: 18px;
|
||||
color: #000;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
img{
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
}
|
||||
.teachbox{
|
||||
span{
|
||||
line-height: 60px;
|
||||
margin-left: 10px;
|
||||
font-size: 24px;
|
||||
font-weight: 500;
|
||||
color: #000;
|
||||
}
|
||||
}
|
||||
.tearch-img{
|
||||
float: left;
|
||||
width: 80px;
|
||||
height: 80px;
|
||||
img{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-radius: 50%;
|
||||
}
|
||||
}
|
||||
.level{
|
||||
float: left;
|
||||
width: 57px;
|
||||
|
||||
188
src/components/ImageUpload/single.vue
Normal file
188
src/components/ImageUpload/single.vue
Normal file
@@ -0,0 +1,188 @@
|
||||
<template>
|
||||
<div class="component-upload-image">
|
||||
<el-upload
|
||||
:action="uploadImgUrl"
|
||||
list-type="picture-card"
|
||||
:on-success="handleUploadSuccess"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:on-error="handleUploadError"
|
||||
name="file"
|
||||
:data="data"
|
||||
:show-file-list="false"
|
||||
:headers="headers"
|
||||
style="display: inline-block; vertical-align: top;">
|
||||
<div v-if="!imageUrl">
|
||||
<div class="image-slot">
|
||||
<i class="el-icon-plus" />
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="image">
|
||||
<el-image :src="imageUrl" :style="`width:148px;height:148px;`" fit="fill"/>
|
||||
<div class="mask">
|
||||
<div class="actions">
|
||||
<span title="预览" @click.stop="dialogVisible = true">
|
||||
<i class="el-icon-zoom-in" />
|
||||
</span>
|
||||
<span title="移除" @click.stop="removeImage">
|
||||
<i class="el-icon-delete" />
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-upload>
|
||||
<el-dialog :visible.sync="dialogVisible" title="预览" width="800" append-to-body>
|
||||
<img :src="imageUrl" style="display: block; max-width: 100%; margin: 0 auto;">
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/token";
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/xboe/sys/xuploader/file/upload", // 上传的图片服务器地址
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
imageUrl:'',
|
||||
headers: {
|
||||
'XBOE-Access-Token': getToken(),
|
||||
},
|
||||
data:{
|
||||
dir:this.dir
|
||||
}
|
||||
};
|
||||
},
|
||||
props: {
|
||||
text:{
|
||||
type:String,
|
||||
default:'上传图片'
|
||||
},
|
||||
dir:{
|
||||
type:String,
|
||||
default:''
|
||||
},
|
||||
value: {
|
||||
type: String,
|
||||
default: "",
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
if(this.value){
|
||||
if(this.value.startsWith('http')){
|
||||
this.imageUrl=this.value;
|
||||
}else{
|
||||
this.imageUrl=this.fileBaseUrl+this.value;
|
||||
}
|
||||
}else{
|
||||
this.imageUrl='';
|
||||
}
|
||||
//console.log(this.imageUrl,'this.imageUrl');
|
||||
},
|
||||
watch:{
|
||||
value(newVal,oldVal){
|
||||
//console.log(newVal,'newVal');
|
||||
if(newVal){
|
||||
if(newVal.startsWith('http')){
|
||||
this.imageUrl=newVal;
|
||||
}else{
|
||||
this.imageUrl=this.fileBaseUrl+newVal;
|
||||
}
|
||||
}else{
|
||||
this.imageUrl='';
|
||||
}
|
||||
//console.log(this.imageUrl,'this.imageUrl');
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
methods: {
|
||||
removeImage() {
|
||||
this.imageUrl="";
|
||||
this.$emit("remove",this.value);
|
||||
},
|
||||
handleUploadSuccess(res) {
|
||||
this.imageUrl=res.result.httpPath;
|
||||
this.$emit("success", res);
|
||||
this.loading.close();
|
||||
},
|
||||
handleBeforeUpload() {
|
||||
this.loading = this.$loading({
|
||||
lock: true,
|
||||
text: "上传中",
|
||||
background: "rgba(0, 0, 0, 0.7)",
|
||||
});
|
||||
},
|
||||
handleUploadError() {
|
||||
this.$message({
|
||||
type: "error",
|
||||
message: "上传失败",
|
||||
});
|
||||
this.loading.close();
|
||||
},
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.image-uploader .el-upload {
|
||||
border: 1px dashed #d9d9d9;
|
||||
border-radius: 6px;
|
||||
cursor: pointer;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
}
|
||||
.image-uploader .el-upload--picture-card{
|
||||
width: 200px;
|
||||
background-color: #fbfdff;
|
||||
border: 1px dashed #c0ccda;
|
||||
border-radius: 6px;
|
||||
box-sizing: border-box;
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
cursor: pointer;
|
||||
line-height: 146px;
|
||||
vertical-align: top;
|
||||
}
|
||||
.image-uploader .el-upload:hover {
|
||||
border-color: #409EFF;
|
||||
}
|
||||
.image-uploader-icon {
|
||||
font-size: 28px;
|
||||
color: #8c939d;
|
||||
text-align: center;
|
||||
margin-top: 50px;
|
||||
display: block;
|
||||
}
|
||||
.icon-text{
|
||||
font-size: 14px;
|
||||
display: block;
|
||||
height: 30px;
|
||||
line-height: 35px;
|
||||
}
|
||||
.avatar {
|
||||
width: 250px;
|
||||
height: 178px;
|
||||
display: block;
|
||||
}
|
||||
.image-slot{
|
||||
width: 148px;
|
||||
height: 148px;
|
||||
line-height: 148px;
|
||||
}
|
||||
.image {
|
||||
position: relative;
|
||||
.mask {
|
||||
opacity: 0;
|
||||
position: absolute;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
height: 148px;
|
||||
line-height: 148px;
|
||||
background-color: rgba(0, 0, 0, 0.5);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
&:hover .mask {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
709
src/components/Portal/course/couresinteract.vue
Normal file
709
src/components/Portal/course/couresinteract.vue
Normal file
@@ -0,0 +1,709 @@
|
||||
<template>
|
||||
<div class="interact-bar ranking-interactBar">
|
||||
<div>
|
||||
<el-tooltip effect="light" content="评分" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon style="margin-right: 0px;font-size: 18px;" icon-class="pingfen"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span class="interact-bar-value"> {{ toScore(data.score) }}分 </span>
|
||||
</div>
|
||||
<div>
|
||||
<el-tooltip effect="light" content="学习人数" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon style="margin-right: 0px;font-size: 18px;" icon-class="xuexirenshu"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span class="interact-bar-value"> {{ data.studys }} </span>
|
||||
</div>
|
||||
<div :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
||||
<el-tooltip effect="light" content="点赞" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon style="margin-right: 0;font-size: 18px;" icon-class="dianzan"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span class="interact-bar-value"> {{ data.praises>0? data.praises:0}}</span>
|
||||
</div>
|
||||
|
||||
<div :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
||||
<el-tooltip effect="light" content="收藏" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon style="font-size: 18px;margin-right: 0;" icon-class="xihuan"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span class="interact-bar-value"> {{ data.favorites>0? data.favorites:0}}</span>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { toScore } from '@/utils/tools.js';
|
||||
import apiPraises from '@/api/modules/praises.js'
|
||||
import apiShares from '@/api/modules/shares.js'
|
||||
import apiFavorites from '@/api/modules/favorites.js'
|
||||
import apiUser from '@/api/system/user.js'
|
||||
import apiMessage from '@/api/system/message.js'
|
||||
import { mapGetters } from 'vuex';
|
||||
import { formatUserNumber } from '@/utils/tools.js';
|
||||
export default {
|
||||
props: {
|
||||
data:{
|
||||
type:Object,
|
||||
default(){
|
||||
return{
|
||||
id:'',
|
||||
answers:0,
|
||||
favorites:0,
|
||||
comments:0,
|
||||
shares:0,
|
||||
praises:0,
|
||||
views:0,
|
||||
}
|
||||
}
|
||||
},
|
||||
size:{
|
||||
type:Number,
|
||||
default:14
|
||||
},
|
||||
nodeWidth:{
|
||||
type:String,
|
||||
default:'40px'
|
||||
},
|
||||
readonly:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
align:{
|
||||
type:String,
|
||||
default:'right'
|
||||
},
|
||||
answers:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
clickAnswer:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
comments:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
favorites:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
courseExclusive:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
shares:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
couseViews:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
praises:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
views:{
|
||||
type:Boolean,
|
||||
default:true
|
||||
},
|
||||
type:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
theme:{
|
||||
type:Number,
|
||||
default:1
|
||||
},
|
||||
unicom:{
|
||||
type:Boolean,
|
||||
default:false
|
||||
},
|
||||
pageType:{
|
||||
type:Number,
|
||||
default:0
|
||||
},
|
||||
pageParams:{
|
||||
type:String,
|
||||
default:''
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
toScore,
|
||||
formatNum:formatUserNumber,
|
||||
msgPageType:0,
|
||||
loading:false,
|
||||
isPraise:false,
|
||||
isFavorite:false,
|
||||
shareShow:false,
|
||||
shareUsers:[],
|
||||
shareInfo:{
|
||||
name:'',
|
||||
load:false,
|
||||
list:[]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed:{
|
||||
...mapGetters(['userInfo','praisesUnicom','favoritesUnicom']),
|
||||
|
||||
showAlign(){
|
||||
if(this.align=='left'){
|
||||
return 'flex-start';
|
||||
}else if(this.align=='right'){
|
||||
return 'flex-end';
|
||||
}
|
||||
}
|
||||
},
|
||||
watch:{
|
||||
praisesUnicom(newVal){
|
||||
this.isPraise = newVal;
|
||||
},
|
||||
favoritesUnicom(newVal){
|
||||
this.isFavorite = newVal;
|
||||
},
|
||||
data(newVal,oldVal){
|
||||
if(newVal && newVal.id!=''){
|
||||
this.checkHas();
|
||||
}
|
||||
}
|
||||
},
|
||||
created(){
|
||||
},
|
||||
mounted() {
|
||||
if(this.data && this.data.id && !this.readonly){
|
||||
this.checkHas();
|
||||
}
|
||||
|
||||
if(this.pageType==0){
|
||||
this.msgPageType=this.type;
|
||||
}else{
|
||||
this.msgPageType=this.pageType;
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
methods:{
|
||||
addAnswers() {
|
||||
this.$emit('addAnswers');
|
||||
},
|
||||
messageSave(refId,title,sendName,acceptName,acceptId,typeText){
|
||||
// let typeText
|
||||
// if(type=='share'){
|
||||
// typeText='分享给我'
|
||||
// }
|
||||
// if(type=='favorite'){
|
||||
// typeText='收藏了我发布的'
|
||||
// }
|
||||
// if(type=='praise'){
|
||||
// typeText='点赞了我的'
|
||||
// }
|
||||
let content;
|
||||
let conType;
|
||||
if(this.type==1){
|
||||
content='课程';
|
||||
conType = this.data.type;
|
||||
}
|
||||
if(this.type==2){
|
||||
content='文章'
|
||||
}
|
||||
if(this.type==3){
|
||||
content='案例'
|
||||
}
|
||||
if(this.type==4){
|
||||
content='提问'
|
||||
}
|
||||
if(this.type==5){
|
||||
content='回答';
|
||||
}
|
||||
if(this.type==6){
|
||||
content='课程笔记'
|
||||
}
|
||||
if(this.type==60){
|
||||
content='课程笔记评论'
|
||||
}
|
||||
// 点赞type
|
||||
if(this.type==10){
|
||||
content='课程评论'
|
||||
}
|
||||
if(this.type==20){
|
||||
content='文章评论'
|
||||
}
|
||||
if(this.type==30){
|
||||
content='案例评论'
|
||||
}
|
||||
// 评论点赞通知没有关联id,评论通知暂时关闭
|
||||
// 设置了主信息的关联,再把这个判断去掉
|
||||
if(this.type==60 || this.type==10 || this.type==20 || this.type==30 || this.type == 6) {
|
||||
//return;
|
||||
}
|
||||
|
||||
if(title){
|
||||
content=sendName+typeText+content+'-'+title
|
||||
}else{
|
||||
content=sendName+typeText+content
|
||||
}
|
||||
let msgPageParams=this.pageParams;
|
||||
if(!msgPageParams){
|
||||
msgPageParams=this.data.id;
|
||||
}
|
||||
let message={
|
||||
content,
|
||||
refId,
|
||||
refType:this.type,
|
||||
source:1,
|
||||
pageType:this.msgPageType,
|
||||
pageParams:msgPageParams,
|
||||
pageUrl:location.href,
|
||||
sendAid:this.userInfo.aid,
|
||||
sendName,
|
||||
acceptName,
|
||||
acceptId,
|
||||
title:'系统消息',
|
||||
sendType:1,
|
||||
conType,
|
||||
}
|
||||
apiMessage.save(message).then(res=>{
|
||||
if(res.status!=200){ console.log('发送消息失败') }
|
||||
})
|
||||
},
|
||||
checkHas(){
|
||||
if(this.type>0 && !this.readonly && this.data.id){
|
||||
if(this.favorites){
|
||||
apiFavorites.has(this.type,this.data.id).then(rs=>{
|
||||
if(rs.status==200 && rs.result){
|
||||
this.isFavorite=true;
|
||||
}else{
|
||||
this.isFavorite=false;
|
||||
}
|
||||
})
|
||||
}
|
||||
if(this.praises){
|
||||
apiPraises.has(this.type,this.data.id).then(rs=>{
|
||||
if(rs.status==200 && rs.result){
|
||||
this.isPraise=true;
|
||||
}else{
|
||||
this.isPraise=false;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
},
|
||||
addShare(){
|
||||
if(this.readonly){
|
||||
return
|
||||
}
|
||||
this.shareShow=true;
|
||||
},
|
||||
addPraise(){
|
||||
if(this.type==0){
|
||||
console.log('未设置type值,1表课程,2表文章,3表案例,4表问答,6笔记')
|
||||
return;
|
||||
}
|
||||
//需要判断是否已点赞,已点赞的不再加
|
||||
if(!this.readonly){
|
||||
let postData={
|
||||
objType:this.type,
|
||||
objId:this.data.id,
|
||||
title:'',
|
||||
|
||||
}
|
||||
if(this.type==1){
|
||||
postData.title=this.data.name;
|
||||
}else if(this.type == 5){
|
||||
postData.title=this.data.content;
|
||||
} else {
|
||||
postData.title=this.data.title;
|
||||
}
|
||||
if(this.loading) {
|
||||
return;
|
||||
}
|
||||
this.loading=true;
|
||||
if(this.isPraise) {// 已经点赞,取消点赞
|
||||
apiPraises.remove(this.type,this.data.id).then(res=>{
|
||||
this.loading = false;
|
||||
if(res.status==200){
|
||||
if(res.result){
|
||||
this.data.praises--;
|
||||
}
|
||||
this.isPraise=false;
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomPraises",false)
|
||||
}
|
||||
//自己给自己点赞不算
|
||||
let authorId=this.data.sysCreateAid;
|
||||
if(this.type==3){ //案例取作者id
|
||||
authorId=this.data.authorId;
|
||||
}else if(this.type==1){ //课程取老师的id
|
||||
// 目前页面上没有点赞的地方,课程有多个老师,也要给每个老师加吗?
|
||||
//console.log(this.data,'点赞中课程的传的数据')
|
||||
}
|
||||
if(this.userInfo.aid!=authorId){
|
||||
let event = {
|
||||
key: "CancelPraise",//
|
||||
title: "取消点赞",//事件的标题
|
||||
parameters:"author:"+authorId,//用户自定义参数 name:value,name:value
|
||||
content: "取消点赞"+postData.title,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
}
|
||||
this.$message({message:'取消点赞',type:'success'})
|
||||
}else{
|
||||
console.log('取消失败:'+res.message);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
apiPraises.save(postData).then(res=>{
|
||||
this.loading = false;
|
||||
if(res.status==200){
|
||||
if(res.result){
|
||||
this.data.praises++;
|
||||
}
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomPraises",true)
|
||||
}
|
||||
//console.log('点选了我的 pageType='+this.msgPageType+','+this.pageParams)
|
||||
//if(this.type!=1&&this.type!=5){
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'点赞了我的');
|
||||
//}
|
||||
// if(this.type==5){
|
||||
// this.messageSave(this.data.id,this.data.content,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'评论了我的');
|
||||
// }
|
||||
this.isPraise=true;
|
||||
this.$message({message:'点赞成功',type:'success'})
|
||||
let contentText = '';
|
||||
if(this.type==1){
|
||||
contentText='课程';
|
||||
// conType = this.data.type;
|
||||
}
|
||||
if(this.type==2){
|
||||
contentText='文章'
|
||||
}
|
||||
if(this.type==3){
|
||||
contentText='案例'
|
||||
}
|
||||
if(this.type==4){
|
||||
contentText='提问'
|
||||
}
|
||||
if(this.type==5){
|
||||
contentText='回答'
|
||||
}
|
||||
if(this.type==6){
|
||||
contentText='课程笔记'
|
||||
}
|
||||
if(this.type==60){
|
||||
contentText='课程笔记评论'
|
||||
}
|
||||
// 点赞type
|
||||
if(this.type==10){
|
||||
contentText='课程评论'
|
||||
}
|
||||
if(this.type==20){
|
||||
contentText='文章评论'
|
||||
}
|
||||
if(this.type==30){
|
||||
contentText='案例评论'
|
||||
}
|
||||
if(this.userInfo.aid!=this.data.sysCreateAid){
|
||||
let event = {
|
||||
key: "Praise",//后台的事件key 发布文章且审核通过
|
||||
title: "点赞",//事件的标题
|
||||
parameters:"author:"+this.data.sysCreateAid,//用户自定义参数 name:value,name:value
|
||||
content: "点赞了"+contentText,//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
}
|
||||
}else{
|
||||
console.log('点赞失败:'+res.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
addFavorite(){
|
||||
|
||||
if(this.readonly){
|
||||
return
|
||||
}
|
||||
if(this.type==0){
|
||||
console.log('未设置type值,1表课程,2表文章,3表案例,4表问答')
|
||||
return;
|
||||
}
|
||||
//需要判断是否已点赞,已点赞的不再加
|
||||
let postData={
|
||||
objType:this.type,
|
||||
objId:this.data.id,
|
||||
title:'',
|
||||
}
|
||||
if(this.loading) {
|
||||
return;
|
||||
}
|
||||
this.loading=true;
|
||||
if(this.type==1){
|
||||
postData.title=this.data.name;
|
||||
}else if(this.type==60){
|
||||
postData.title=this.data.content;
|
||||
} else if(this.type==5){
|
||||
postData.title='收藏回答';
|
||||
} else {
|
||||
postData.title=this.data.title;
|
||||
}
|
||||
if(this.isFavorite) {// 已经收藏,再次点击取消收藏
|
||||
apiFavorites.remove(this.type,this.data.id).then(res=>{
|
||||
this.loading=false;
|
||||
if(res.status==200){
|
||||
this.isFavorite=false;
|
||||
if(res.result){
|
||||
this.data.favorites--;
|
||||
}
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomFavorites",false)
|
||||
}
|
||||
this.$message({message:'已取消收藏',type:'success'});
|
||||
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功,false代表已存在
|
||||
}else{
|
||||
console.log('取消收藏失败:'+res.message);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
apiFavorites.save(postData).then(res=>{
|
||||
this.loading=false;
|
||||
if(res.status==200){
|
||||
this.isFavorite=true;
|
||||
if(res.result){
|
||||
this.data.favorites++;
|
||||
}
|
||||
if(this.unicom) {
|
||||
this.$store.dispatch("unicomFavorites",true)
|
||||
}
|
||||
//if(this.type===2||this.type===4){
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,this.data.sysCreateBy,this.data.sysCreateAid,'收藏了我发布的');
|
||||
//}
|
||||
this.$message({message:'已加入收藏',type:'success'});
|
||||
//this.$emit('addFavorite',res.result);//添加收藏,如果是true代表添加成功,false代表已存在
|
||||
}else{
|
||||
console.log('加入收藏失败:'+res.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
//
|
||||
|
||||
},
|
||||
jumpRouter(){
|
||||
//此跳转不行
|
||||
if(this.type==2){
|
||||
this.$router.push({path:'/article/detail?id='+this.data.id})
|
||||
}
|
||||
if(this.type==3){
|
||||
this.$router.push({path:'/case/detail?id='+this.data.id})
|
||||
}
|
||||
if(this.type==1){
|
||||
this.$router.push({path:'/course/detail?id='+this.data.id})
|
||||
}
|
||||
if(this.type==4){
|
||||
this.$router.push({path:'/qa/answer?id='+this.data.id})
|
||||
}
|
||||
},
|
||||
keyupEnter(){
|
||||
this.findUser();
|
||||
return false;
|
||||
},
|
||||
findUser(){
|
||||
this.shareInfo.load=false;
|
||||
this.shareInfo.list=[];
|
||||
this.shareUsers=[];
|
||||
var name=this.shareInfo.name;
|
||||
var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
||||
if(regPos.test(name)){
|
||||
//console.log("数字");
|
||||
apiUser.getByLoginName(name).then(rs=>{
|
||||
if(rs.status==200){
|
||||
//因为根据工号查询,只会是一个人,所有会有null情况,而json会返回空字符串
|
||||
if(rs.result!=''){
|
||||
this.shareInfo.list.push(rs.result);
|
||||
}else{
|
||||
this.$message.error("查无此用户")
|
||||
}
|
||||
this.shareInfo.load=true;
|
||||
}else{
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
})
|
||||
}else{
|
||||
// console.log("非数字");
|
||||
apiUser.findByName(name).then(rs=>{
|
||||
if(rs.status==200){
|
||||
if(rs.result.length==0){
|
||||
return this.$message.error(rs.message);
|
||||
}
|
||||
this.shareInfo.list=rs.result;
|
||||
this.shareInfo.load=true;
|
||||
}else{
|
||||
this.$message.error(rs.message);
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
submitShare(){
|
||||
if(this.shareUsers.length==0){
|
||||
this.$message.error('请选择分享人');
|
||||
return;
|
||||
}
|
||||
let conType;
|
||||
if(this.type == 1) {
|
||||
conType = this.data.type;
|
||||
}
|
||||
|
||||
let postData={
|
||||
objType:this.type,
|
||||
objId:this.data.id,
|
||||
content:this.data.title,
|
||||
isRead:false,
|
||||
toAid:'',
|
||||
toAname:'',
|
||||
conType: conType,
|
||||
}
|
||||
let $this=this;
|
||||
this.shareUsers.forEach(u=>{
|
||||
var curUser=null;
|
||||
$this.shareInfo.list.some(item=>{
|
||||
if(item.aid==u){
|
||||
curUser=item;
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
});
|
||||
if(curUser!=null){
|
||||
postData.toAid=curUser.aid;
|
||||
postData.toAname=curUser.name;
|
||||
if(this.userInfo.aid==postData.toAid){
|
||||
return this.$message.warning("不能分享给自己")
|
||||
}
|
||||
apiShares.save(postData).then(rs=>{
|
||||
$this.shareShow=false;
|
||||
if(rs.status!=200){
|
||||
this.$message.error("分享失败")
|
||||
}else{
|
||||
if(rs.result){
|
||||
$this.data.shares++;
|
||||
this.$message.success("分享成功")
|
||||
//if(this.type!=3){
|
||||
if(this.type==1){
|
||||
this.messageSave(this.data.id,this.data.name,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
|
||||
}else{
|
||||
this.messageSave(this.data.id,this.data.title,this.userInfo.name,curUser.name,curUser.aid,'分享给我的');
|
||||
}
|
||||
//}
|
||||
let event = {
|
||||
key: "Share",//分享
|
||||
title: "分享",//分享
|
||||
parameters:"author:"+this.data.sysCreateAid,//内容的作者
|
||||
content: '分享',//事件的内容
|
||||
objId: this.data.id,//关联的id
|
||||
objType: this.type,//关联的类型
|
||||
objInfo: this.data.title,
|
||||
aid: this.userInfo.aid, //当前登录人的id
|
||||
aname: this.userInfo.name,//当前人的姓名
|
||||
status: 1 //状态,直接写1
|
||||
}
|
||||
this.$store.dispatch("userTrigger", event);
|
||||
}else{
|
||||
this.$message.warning("您已分享给对方,分享失败")
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.ranking-interactBar{
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
div{
|
||||
span{
|
||||
color: #999;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
// .eyes-view{
|
||||
// color: #000;
|
||||
// position: fixed;
|
||||
// line-height: 40px;
|
||||
// }
|
||||
::v-deep .g-dialog .el-dialog__header{
|
||||
text-align: left !important;
|
||||
}
|
||||
::v-deep .g-dialog .el-dialog__body{
|
||||
text-align: left !important;
|
||||
}
|
||||
|
||||
.interact-bar{
|
||||
// height: 30px;
|
||||
.interact-bar-btns {
|
||||
// line-height: 30px;
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
.interact-bar-btn {
|
||||
margin: 0 0 0 15px;
|
||||
}
|
||||
.interact-bar-value{
|
||||
// color:#6E7B84; ui图给的颜色,但是效果于ui图效果不一样,也没有透明度,所以找一个相近的和谐的颜色
|
||||
color:#999;
|
||||
}
|
||||
}
|
||||
}
|
||||
.cursor{
|
||||
cursor: pointer;
|
||||
}
|
||||
.bottom-btn{
|
||||
padding: 10px 50px;
|
||||
text-align: center;
|
||||
.btn{
|
||||
width: 104px;
|
||||
height: 42px;
|
||||
color: #fff;
|
||||
img{
|
||||
width: 16px;
|
||||
height: 15px;
|
||||
vertical-align: bottom;
|
||||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
.fen-xiang{
|
||||
background: #2ab28b;
|
||||
|
||||
}
|
||||
.dian-zan{
|
||||
background: #f56262;
|
||||
|
||||
}
|
||||
.shou-cang{
|
||||
background: #ff8e00;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -38,7 +38,7 @@
|
||||
<div v-if="favorites" @click="addFavorite()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
||||
<el-tooltip effect="light" content="收藏" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||
<svg-icon v-if="courseExclusive" style="font-size: 32px;margin-right: 0;" :icon-class="isFavorite?'collectedCourse':'collectionCourse'"></svg-icon>
|
||||
<svg-icon v-else style="margin-right: 0;" :style="{'font-size':size+'px'}" :icon-class="isFavorite?'collected':'collection'"></svg-icon>
|
||||
<svg-icon v-else style="margin-right: 0;" :style="{'font-size':(size+2)+'px'}" :icon-class="isFavorite?'scactive2':'xihuan'"></svg-icon>
|
||||
</el-tooltip>
|
||||
<span v-if="!courseExclusive" class="interact-bar-value"> {{ data.favorites? data.favorites:0}}</span>
|
||||
</div>
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
<el-select v-model="feedback.type" placeholder="请选择意见类型">
|
||||
<el-option label="关于内容" value="关于内容"></el-option>
|
||||
<el-option label="关于平台操作" value="关于平台操作"></el-option>
|
||||
<el-option label="其他" value="其他"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="描述" prop="content">
|
||||
|
||||
@@ -181,8 +181,10 @@ export default {
|
||||
this.sex = this.userInfo.sex;
|
||||
this.$store.dispatch('refrashMsg');
|
||||
this.loadBoeData();
|
||||
//this.loadPopupConfig();
|
||||
},
|
||||
methods: {
|
||||
|
||||
setCurIdentity(iden){
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
},
|
||||
|
||||
9
src/components/Scorm/preview.vue
Normal file
9
src/components/Scorm/preview.vue
Normal file
@@ -0,0 +1,9 @@
|
||||
<template>
|
||||
<!--scorm的预览-->
|
||||
</template>
|
||||
|
||||
<script>
|
||||
</script>
|
||||
|
||||
<style>
|
||||
</style>
|
||||
@@ -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="/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>
|
||||
@@ -74,13 +74,13 @@
|
||||
<div class="learning-border" ></div>
|
||||
<div class="learning-info">
|
||||
<div class="learning-qus">我的U币(累计)</div>
|
||||
<div class="learning-an"><span>{{statData.uvalue}}</span></div>
|
||||
<div class="learning-an"><span>{{statData.uvalue < 0 ? 0 : statData.uvalue}}</span></div>
|
||||
</div>
|
||||
|
||||
<div class="learning-info">
|
||||
|
||||
|
||||
<div @click="jumrank" style="cursor: pointer;" class="ranking-link"> BOE 排行榜 >></div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -92,6 +92,7 @@
|
||||
import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
import { mapGetters } from 'vuex'
|
||||
import apiStart from '@/api/phase2/stat.js'
|
||||
import testUser from '@/utils/testUsers.js'
|
||||
export default {
|
||||
name: 'UcHeader',
|
||||
computed:{
|
||||
@@ -103,6 +104,7 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
data(){
|
||||
return {
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
isTest:false,
|
||||
statData:{
|
||||
evalue: 0,//经验值
|
||||
level: "LV1",//级别
|
||||
@@ -130,8 +132,11 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
this.loadUserStat();
|
||||
this.$bus.$on('u-Currency',(num)=>{
|
||||
this.statData.uvalue = num;
|
||||
})
|
||||
|
||||
})
|
||||
//console.log(this.userInfo.loginName,'this.userInfo.loginName')
|
||||
if(testUser.isTest(this.userInfo.loginName)){
|
||||
this.isTest=true;
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
loadUserStat(){//获取经验值和等级
|
||||
@@ -157,6 +162,13 @@ import {userAvatarText,cutFullName} from "@/utils/tools.js";
|
||||
|
||||
setCurIdentity(iden){
|
||||
this.$store.dispatch('SetCurIdentity',iden);
|
||||
this.$router.push('/manager/index');
|
||||
// if(this.isTest){
|
||||
// //this.$router.push('/manage/learningpath');
|
||||
// location.href='/manage/learningpath';
|
||||
// }else{
|
||||
// this.$router.push('/manager/index');
|
||||
// }
|
||||
},
|
||||
jumrank(){
|
||||
this.$router.push('/user/ranking');
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
:default-active="activeMenu"
|
||||
router
|
||||
active-text-color="#3379FB"
|
||||
:default-openeds="['manageTodo','manageFinish','teacherTodo','teacherFinish','myqa','notice','mystudy', 'course', 'exam', 'u001', 'u002', 'u003', 'u004']"
|
||||
:default-openeds="['manageTodo','manageFinish','teacherTodo','teacherFinish','myqa','notice','mystudy', 'course', 'exam', 'u001', 'u002', 'u003', 'u004','mylecnotes','mycaseRecord']"
|
||||
class="el-menu-vertical"
|
||||
@open="handleOpen"
|
||||
@close="handleClose"
|
||||
@@ -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 && isTest">
|
||||
<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>
|
||||
<span><a :href="managerPath+'/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>
|
||||
@@ -176,6 +176,14 @@
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<span slot="title" class="textl">我开发的课程</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/need/mylecnotes">
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<span slot="title" class="textl">我的授课记录</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/need/mycaseRecord">
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<span slot="title" class="textl">我的案例记录</span>
|
||||
</el-menu-item>
|
||||
<!--
|
||||
<el-menu-item index="u0032">
|
||||
<i class="el-icon-menu"></i>
|
||||
@@ -244,9 +252,16 @@
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/exam/mytask">
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<!-- <span slot="title" class="textl">自主学习</span> -->
|
||||
<span slot="title" class="textl">我的考试</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/uc/study/path" v-show="isTest">
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<span slot="title" class="textl">学习路径图</span>
|
||||
</el-menu-item>
|
||||
<el-menu-item index="/uc/study/project" v-show="isTest">
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<span slot="title" class="textl">学习项目</span>
|
||||
</el-menu-item>
|
||||
<!-- <el-menu-item index="/uc/study/history"> -->
|
||||
<!-- <i class="el-icon-menu"></i> -->
|
||||
<!-- <span slot="title" class="textl">历史记录</span>
|
||||
@@ -364,13 +379,14 @@ import { mapGetters } from 'vuex';
|
||||
import apiCourse from '../../api/modules/course.js';
|
||||
import apicourseStudy from "../../api/modules/courseStudy.js"
|
||||
import courseImage from "@/components/Course/courseImage.vue"
|
||||
import testUser from '@/utils/testUsers.js'
|
||||
export default {
|
||||
name: 'UcMenu',
|
||||
components: {
|
||||
courseImage,
|
||||
},
|
||||
computed: {
|
||||
...mapGetters(['curIdentity', 'messagesBeReviewed', 'studyTaskCount']),
|
||||
...mapGetters(['curIdentity', 'messagesBeReviewed', 'studyTaskCount','userInfo']),
|
||||
activeMenu() {
|
||||
const route = this.$route;
|
||||
const { meta, path } = route;
|
||||
@@ -385,6 +401,8 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
isTest:false,
|
||||
managerPath:process.env.VUE_APP_MANAGER_PATH,
|
||||
badge: 0,
|
||||
isCollapse: false,
|
||||
lastStudy:{},
|
||||
@@ -396,6 +414,16 @@ export default {
|
||||
this.$store.dispatch('refrashStudyTaskCount');
|
||||
this.getLastStudy();
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.userInfo.loginName,'this.userInfo.loginName');
|
||||
let flag=testUser.isTest(this.userInfo.loginName);
|
||||
console.log(flag,'this.isTest22');
|
||||
this.isTest=flag;
|
||||
// if(testUser.isTest(this.userInfo.loginName)){
|
||||
// console.log(this.isTest,'this.isTest');
|
||||
// this.isTest=true;
|
||||
// }
|
||||
},
|
||||
methods: {
|
||||
toCourseDetail(item){
|
||||
if(isNaN(item.courseType)){
|
||||
|
||||
Reference in New Issue
Block a user