mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-15 05:46:43 +08:00
把third合并过来
This commit is contained in:
@@ -35,3 +35,6 @@ VUE_APP_PUBLIC_PATH='/pc'
|
|||||||
|
|
||||||
# 路由懒加载
|
# 路由懒加载
|
||||||
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
VUE_CLI_BABEL_TRANSPILE_MODULES = true
|
||||||
|
|
||||||
|
# scorm课件的播放url地址
|
||||||
|
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'
|
||||||
|
|||||||
@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc-release'
|
|||||||
|
|
||||||
# 登录地址
|
# 登录地址
|
||||||
VUE_APP_LOGIN_URL='https://u.boe.com/web-release/'
|
VUE_APP_LOGIN_URL='https://u.boe.com/web-release/'
|
||||||
|
|
||||||
|
# scorm课件的播放url地址
|
||||||
|
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'
|
||||||
|
|||||||
@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc'
|
|||||||
|
|
||||||
# 登录地址
|
# 登录地址
|
||||||
VUE_APP_LOGIN_URL='https://u.boe.com/web/'
|
VUE_APP_LOGIN_URL='https://u.boe.com/web/'
|
||||||
|
|
||||||
|
# scorm课件的播放url地址
|
||||||
|
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'
|
||||||
|
|||||||
@@ -32,3 +32,6 @@ VUE_APP_PUBLIC_PATH='/pc'
|
|||||||
|
|
||||||
# 登录地址
|
# 登录地址
|
||||||
VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/'
|
VUE_APP_LOGIN_URL='https://u-pre.boe.com/web/'
|
||||||
|
|
||||||
|
# scorm课件的播放url地址
|
||||||
|
VUE_APP_SCORM_URL = 'http://localhost:9083/scorm-player'
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ const formRequest=axios.create({
|
|||||||
Promise.reject(error)
|
Promise.reject(error)
|
||||||
});
|
});
|
||||||
formRequest.interceptors.response.use(res => {
|
formRequest.interceptors.response.use(res => {
|
||||||
console.log(res);
|
//console.log(res);
|
||||||
const code = res.data.status || 200;
|
const code = res.data.status || 200;
|
||||||
if(code===200){
|
if(code===200){
|
||||||
return res.data
|
return res.data
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ const update = function(data) {
|
|||||||
}
|
}
|
||||||
/* 编辑详情 */
|
/* 编辑详情 */
|
||||||
const detail = function(id) {
|
const detail = function(id) {
|
||||||
return ajax.get('/xboe/m/exam/paper/query?id=' + id);
|
return ajax.get('/xboe/m/exam/paper/query?id=' + id);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 试卷批量导入计算
|
/* 试卷批量导入计算
|
||||||
* num 数目
|
* num 数目
|
||||||
|
|||||||
10
src/api/modules/popup.js
Normal file
10
src/api/modules/popup.js
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
|
||||||
|
import ajax from '@/utils/xajax.js'
|
||||||
|
|
||||||
|
const userList=function (){
|
||||||
|
return ajax.get('/xboe/m/popup/user');
|
||||||
|
}
|
||||||
|
|
||||||
|
export default {
|
||||||
|
userList
|
||||||
|
}
|
||||||
@@ -9,6 +9,11 @@ const findByName = function(name) {
|
|||||||
return ajax.get('/xboe/teacher/name?name=' + name);
|
return ajax.get('/xboe/teacher/name?name=' + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
const updateTeacher=function(data){
|
||||||
|
return ajax.postJson('/xboe/teacher/update-teacher',data);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id得到教师的显示信息,只是几个基本的显示字段
|
* 根据id得到教师的显示信息,只是几个基本的显示字段
|
||||||
* @param {Object} id
|
* @param {Object} id
|
||||||
@@ -21,6 +26,7 @@ const detailTeacher=function (id){
|
|||||||
return ajax.get('/xboe/teacher/detail-teacher?id='+id);
|
return ajax.get('/xboe/teacher/detail-teacher?id='+id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 分页查询
|
* 分页查询
|
||||||
* @param {
|
* @param {
|
||||||
@@ -218,5 +224,6 @@ export default {
|
|||||||
end,
|
end,
|
||||||
exports,
|
exports,
|
||||||
syncUpdate,
|
syncUpdate,
|
||||||
detailTeacher
|
detailTeacher,
|
||||||
|
updateTeacher
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,6 +54,16 @@ const exports=function (query){
|
|||||||
return ajax.post('/xboe/m/exam/alone/answer/export',query,{responseType: 'blob'});
|
return ajax.post('/xboe/m/exam/alone/answer/export',query,{responseType: 'blob'});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param{
|
||||||
|
* id 考试id
|
||||||
|
* enabled true 上架 false 下架
|
||||||
|
* }
|
||||||
|
* */
|
||||||
|
const enabled=function(query){
|
||||||
|
return ajax.post('/xboe/m/exam/test/enabled',query);
|
||||||
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
detail,
|
detail,
|
||||||
update,
|
update,
|
||||||
@@ -61,5 +71,6 @@ export default {
|
|||||||
save,
|
save,
|
||||||
querylist,
|
querylist,
|
||||||
pulish,
|
pulish,
|
||||||
exports
|
exports,
|
||||||
|
enabled
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/api/system/whiteuser.js
Normal file
18
src/api/system/whiteuser.js
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import ajax from '@/utils/xajax.js'
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询白名单
|
||||||
|
* @param {
|
||||||
|
* env:'开发环境'
|
||||||
|
* } data
|
||||||
|
* @returns
|
||||||
|
*/
|
||||||
|
const getList =function(env) {
|
||||||
|
return ajax.post('/xboe/sys/whiteuser/codes',env);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export default{
|
||||||
|
getList
|
||||||
|
}
|
||||||
@@ -1,21 +1,23 @@
|
|||||||
<template>
|
<template>
|
||||||
<!--弹出窗口设置-->
|
<!--弹出窗口设置-->
|
||||||
<div>
|
<div>
|
||||||
<el-dialog :close-on-press-escape="false" :close-on-click-modal="false" class="medalbox" :visible.sync="showGonggao" :append-to-body="true" >
|
<div>
|
||||||
<div class="dlg-box" :style="`width:${config.width};height:${config.height}; background: url(${webBaseUrl}/images/gonggao/${config.bgImage}.png) no-repeat;`">
|
<el-dialog :close-on-press-escape="false" :close-on-click-modal="false" class="medalbox" :visible.sync="showGonggao" :append-to-body="true" >
|
||||||
<span class="dlg-close" @click="showGonggao = false"><i style="font-size: 28px;color: #999;" class="el-icon-close"></i></span>
|
<div class="dlg-box" :style="`width:${config.width};height:${config.height}; background: url(${webBaseUrl}/images/gonggao/${config.bgImage}.png) no-repeat;`">
|
||||||
<div style="text-align:left;">
|
<span class="dlg-close" @click="showGonggao = false"><i style="font-size: 28px;color: #999;" class="el-icon-close"></i></span>
|
||||||
<div class="dlg-title" v-html="config.title"></div>
|
<div style="text-align:left;">
|
||||||
<div class="dlg-content" v-html="config.content"></div>
|
<div class="dlg-title" v-html="config.title"></div>
|
||||||
</div>
|
<div class="dlg-content" v-html="config.content"></div>
|
||||||
<div v-if="config.btnText"><a :href="config.pcUrl" @click="showGonggao = false" target="_blank" :style="{'background-color':config.btnColor}" class="dlg-button">{{config.btnText}}</a> </div>
|
</div>
|
||||||
<div v-if="config.author" style="text-align: right;padding-top: 20px;"><span>{{config.author}}</span> </div>
|
<div v-if="config.btnText"><a :href="config.pcUrl" @click="showGonggao = false" target="_blank" :style="{'background-color':config.btnColor}" class="dlg-button">{{config.btnText}}</a> </div>
|
||||||
</div>
|
<div v-if="config.author" style="text-align: right;padding-top: 20px;"><span>{{config.author}}</span> </div>
|
||||||
</el-dialog>
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
import apiPopup from '@/api/modules/popup.js';
|
||||||
export default{
|
export default{
|
||||||
props:{
|
props:{
|
||||||
config: {
|
config: {
|
||||||
@@ -42,34 +44,67 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
showGonggao:false,
|
showGonggao:false,
|
||||||
|
popupList:[],//需要弹出的窗口
|
||||||
sessionKey:'alertpopup',
|
sessionKey:'alertpopup',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
let loadNum = localStorage.getItem(this.sessionKey);
|
//获取用户需要弱出的窗口信息,放在状态中
|
||||||
let hasFlag = sessionStorage.getItem(this.sessionKey);
|
let has = sessionStorage.getItem(this.sessionKey);
|
||||||
let $this=this;
|
if(!has){
|
||||||
if(!hasFlag){
|
apiPopup.userList().then(rs=>{
|
||||||
let times=0;
|
if(rs.status==200){
|
||||||
if(loadNum){
|
this.popupList=rs.result;
|
||||||
times=Number(loadNum);
|
if(rs.result.length>0){
|
||||||
}
|
sessionStorage.setItem(this.sessionKey,JSON.stringify(rs.result));
|
||||||
if(times<3){
|
this.countPopup();
|
||||||
let now=new Date();
|
}else{
|
||||||
let min=new Date(2022,10,9,0,0,0);
|
sessionStorage.setItem(this.sessionKey,'[]');
|
||||||
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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
});
|
||||||
|
}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.loginEd && newLogin && newLogin==1){
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<!--显示内容-->
|
<!--显示内容-->
|
||||||
<div v-else style="margin: 0px 10px;">
|
<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 style="display: flex;justify-content:space-between">
|
||||||
<div>
|
<div>
|
||||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
||||||
@@ -95,14 +95,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
<!--课件选择或上传的公用组件-->
|
<!--课件选择或上传的公用组件-->
|
||||||
<div v-show="content.contentRefId=='' && content.contentType>0 && content.contentType<41">
|
<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>
|
||||||
<div v-show="content.contentRefId=='' && content.contentType==50">
|
<div v-show="content.contentRefId=='' && content.contentType==50">
|
||||||
<choose-course-scorm ref="coursewarePanel" :resType="content.contentType" @choose="chooseFile"></choose-course-scorm>
|
<choose-course-file :orgId="course.orgId" :orgName="course.orgName" ref="coursewareScormPanel" :resType="content.contentType" @choose="chooseFile"></choose-course-file>
|
||||||
</div>
|
</div>
|
||||||
<!--图文-->
|
<!--图文-->
|
||||||
<div v-show="content.contentType==41">
|
<div v-show="content.contentType==41">
|
||||||
@@ -148,90 +151,16 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--考试-->
|
<!--考试-->
|
||||||
<div v-if="content.contentType==61">
|
<div v-if="content.contentType==61">
|
||||||
<div style="display: flex;justify-content:space-between">
|
<div style="display: flex;justify-content:space-between;padding-bottom: 10px;">
|
||||||
<div>
|
<div>
|
||||||
<el-input maxlength="50" @change="updateName" v-model="content.contentName" placeholder="内容的名称(限50字以内)"></el-input>
|
<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>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<simplePaper :data="examPaper" ></simplePaper>
|
<el-button type="danger" @click="toReChoose()" >重新选择</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<course-exam ref="comExam" :courseId="course.id" :contentId="content.id" @remove="deleteExam" @save="saveExam"></course-exam>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<!--作业-->
|
<!--作业-->
|
||||||
<div v-if="content.contentType==60">
|
<div v-if="content.contentType==60">
|
||||||
@@ -326,10 +255,8 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||||
import chooseCourseScorm from '@/components/Course/chooseCourseScorm.vue'
|
|
||||||
import courseHomework from '@/components/Course/courseHomework.vue'
|
import courseHomework from '@/components/Course/courseHomework.vue'
|
||||||
import courseExam from '@/components/Course/courseExam.vue'
|
import courseExam from '@/components/Course/courseExam.vue'
|
||||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
|
||||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||||
import fileUpload from '@/components/FileUpload/index.vue';
|
import fileUpload from '@/components/FileUpload/index.vue';
|
||||||
import apiCourse from '../../api/modules/course.js';
|
import apiCourse from '../../api/modules/course.js';
|
||||||
@@ -365,14 +292,15 @@
|
|||||||
default:1
|
default:1
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,simplePaper,fileUpload,pdfPreview,audioPlayer,videoPlayer,chooseCourseScorm},
|
components:{chooseCourseFile,WxEditor,courseHomework,courseExam,fileUpload,pdfPreview,audioPlayer,videoPlayer},
|
||||||
// inject: [ "informationDetails" ],
|
// inject: [ "informationDetails" ],
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
converStatus:4,
|
converStatus:4,
|
||||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||||
curPdfPath:'',
|
curPdfPath:'',
|
||||||
curCFile:{},//当前课件的内容
|
curCFile:{},//当前课件的内容
|
||||||
|
scormUrl:'',//scormUrl地址
|
||||||
comTypes:[
|
comTypes:[
|
||||||
//文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它
|
//文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它
|
||||||
//图文41,连接52,作业60,考试61,评估62
|
//图文41,连接52,作业60,考试61,评估62
|
||||||
@@ -400,29 +328,6 @@
|
|||||||
},
|
},
|
||||||
homework:{courseId: '', name:'', content:'', file:'', deadTime: '', submitMode: 3},
|
homework:{courseId: '', name:'', content:'', file:'', deadTime: '', submitMode: 3},
|
||||||
homeworkChange:{},
|
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:{
|
assess:{
|
||||||
countType:'权重配置',
|
countType:'权重配置',
|
||||||
countText:'(问题1)*80%+(问题2)*10%+(问题3)*10%',
|
countText:'(问题1)*80%+(问题2)*10%+(问题3)*10%',
|
||||||
@@ -438,7 +343,13 @@
|
|||||||
|
|
||||||
},
|
},
|
||||||
created() {
|
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:{
|
watch:{
|
||||||
reset(newVal){
|
reset(newVal){
|
||||||
@@ -452,6 +363,8 @@
|
|||||||
this.loadPdfFile();
|
this.loadPdfFile();
|
||||||
}else if(newVal.contentType==41){
|
}else if(newVal.contentType==41){
|
||||||
this.htmlContent=newVal.content;
|
this.htmlContent=newVal.content;
|
||||||
|
}else if(newVal.contentType==50){
|
||||||
|
this.loadScormFile();
|
||||||
}else if(newVal.contentType==52){
|
}else if(newVal.contentType==52){
|
||||||
//外部连接
|
//外部连接
|
||||||
if(newVal.content!=''){
|
if(newVal.content!=''){
|
||||||
@@ -466,8 +379,8 @@
|
|||||||
//作业
|
//作业
|
||||||
this.loadHomeworkInfo();
|
this.loadHomeworkInfo();
|
||||||
}else if(newVal.contentType==61){
|
}else if(newVal.contentType==61){
|
||||||
//考试
|
//考试,已经移到组件中
|
||||||
this.loadExamInfo();
|
//this.loadExamInfo();
|
||||||
}else if(newVal.contentType==62){
|
}else if(newVal.contentType==62){
|
||||||
//评估
|
//评估
|
||||||
this.loadAssessInfo();
|
this.loadAssessInfo();
|
||||||
@@ -491,15 +404,8 @@
|
|||||||
this.linkInfo.url='';
|
this.linkInfo.url='';
|
||||||
this.htmlContent='';
|
this.htmlContent='';
|
||||||
this.curPdfPath='';
|
this.curPdfPath='';
|
||||||
|
this.scormUrl='';
|
||||||
this.curCFile={};
|
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={
|
this.curriculumData={
|
||||||
url:'',
|
url:'',
|
||||||
isDrag:true,
|
isDrag:true,
|
||||||
@@ -524,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(){
|
loadHomeworkInfo(){
|
||||||
apiCourse.getHomework(this.content.id).then(res=>{
|
apiCourse.getHomework(this.content.id).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
@@ -536,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(){
|
loadAssessInfo(){
|
||||||
if(this.content.content!='' && this.content.content.length>10){
|
if(this.content.content!='' && this.content.content.length>10){
|
||||||
this.assess=JSON.parse(this.content.content);
|
this.assess=JSON.parse(this.content.content);
|
||||||
@@ -599,31 +510,7 @@
|
|||||||
if(this.content.contentType==60){
|
if(this.content.contentType==60){
|
||||||
jsonData.homework=this.homework;
|
jsonData.homework=this.homework;
|
||||||
}else if(this.content.contentType==61){
|
}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){
|
}else if(this.content.contentType==62){
|
||||||
this.content.content=JSON.stringify(this.assess);
|
this.content.content=JSON.stringify(this.assess);
|
||||||
@@ -638,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){
|
delData(id){
|
||||||
//需要调用外部方法完成
|
//需要调用外部方法完成
|
||||||
if(this.content.id==''){
|
if(this.content.id==''){
|
||||||
@@ -657,6 +585,7 @@
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
toReChoose(){
|
toReChoose(){
|
||||||
let $this=this;
|
let $this=this;
|
||||||
if(this.content.id.length>1){
|
if(this.content.id.length>1){
|
||||||
@@ -686,6 +615,7 @@
|
|||||||
//未初始化会调用失败,所以这里要等vue变化后再调用
|
//未初始化会调用失败,所以这里要等vue变化后再调用
|
||||||
this.$nextTick(function(){
|
this.$nextTick(function(){
|
||||||
this.$refs.coursewarePanel.findCourseFile();
|
this.$refs.coursewarePanel.findCourseFile();
|
||||||
|
this.$refs.coursewareScormPanel.findCourseFile();
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -697,7 +627,9 @@
|
|||||||
// this.content.content.url=cfile.filePath;
|
// this.content.content.url=cfile.filePath;
|
||||||
if(this.content.contentType==10 || this.content.contentType==20){
|
if(this.content.contentType==10 || this.content.contentType==20){
|
||||||
this.curriculumData.url = cfile.filePath;
|
this.curriculumData.url = cfile.filePath;
|
||||||
}else{
|
}else if(this.content.contentType==50){ //scorm课件内容
|
||||||
|
//this.chooseCourseScorm
|
||||||
|
} else{
|
||||||
if(cfile.previewFilePath){
|
if(cfile.previewFilePath){
|
||||||
this.content.content=cfile.previewFilePath;
|
this.content.content=cfile.previewFilePath;
|
||||||
}else{
|
}else{
|
||||||
@@ -713,7 +645,10 @@
|
|||||||
setTimeout(function(){
|
setTimeout(function(){
|
||||||
$this.loadPdfFile();
|
$this.loadPdfFile();
|
||||||
},2000);
|
},2000);
|
||||||
|
}else if(this.content.contentType==50){
|
||||||
|
setTimeout(function(){
|
||||||
|
$this.loadScormFile();
|
||||||
|
},2000);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,11 +44,18 @@
|
|||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
<el-tab-pane :label="'上传新'+curComType.name">
|
<el-tab-pane :label="'上传新'+curComType.name">
|
||||||
<div v-if="!courseFile.id">
|
<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">
|
<el-upload class="upload-demo" :headers="headers" :data="data" drag :action="uploadFileUrl" :on-success="handleUploadSuccess" :before-upload="handleBeforeUpload">
|
||||||
<i class="el-icon-upload"></i>
|
<i class="el-icon-upload"></i>
|
||||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||||
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
<div class="el-upload__tip" slot="tip">文件大小限制:{{curComType.maxSizeName}},支持的文件类型:{{curComType.fileTypes.join(',')}}</div>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div v-else style="text-align: center;">
|
<div v-else style="text-align: center;">
|
||||||
<div style="padding: 20px;">{{courseFile.fileName}} <span style="color: green;">上传成功</span></div>
|
<div style="padding: 20px;">{{courseFile.fileName}} <span style="color: green;">上传成功</span></div>
|
||||||
@@ -68,6 +75,14 @@
|
|||||||
type: String,
|
type: String,
|
||||||
default:'500'
|
default:'500'
|
||||||
},
|
},
|
||||||
|
orgId:{
|
||||||
|
type: String,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
|
orgName:{
|
||||||
|
type: String,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
resType:{
|
resType:{
|
||||||
type: Number,
|
type: Number,
|
||||||
default:0
|
default:0
|
||||||
@@ -86,11 +101,13 @@
|
|||||||
pageIndex:1,
|
pageIndex:1,
|
||||||
count:0,
|
count:0,
|
||||||
keyword: '',
|
keyword: '',
|
||||||
|
duration:1,
|
||||||
comTypes:[
|
comTypes:[
|
||||||
{id:'1',type:'video',name:'视频',img:'el-icon-video-camera',resType:10,maxSize:1024,maxSizeName:"1G",fileTypes:['mp4']},
|
{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:'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:'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:[]},
|
curComType:{id:'',type:'',name:'',maxSizeName:'',fileTypes:[]},
|
||||||
findState:1,
|
findState:1,
|
||||||
@@ -133,6 +150,11 @@
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if(this.resType==50){
|
||||||
|
this.data.dir='scorm';
|
||||||
|
}else{
|
||||||
|
this.data.dir='course';
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
},
|
},
|
||||||
// 上传失败
|
// 上传失败
|
||||||
@@ -150,6 +172,9 @@
|
|||||||
fileType:res.result.fileType,
|
fileType:res.result.fileType,
|
||||||
filePath:res.result.filePath,
|
filePath:res.result.filePath,
|
||||||
resType:this.resType,
|
resType:this.resType,
|
||||||
|
orgId:this.orgId,
|
||||||
|
orgName:this.orgName,
|
||||||
|
duration:this.duration,
|
||||||
remark:'课程中直接上传'
|
remark:'课程中直接上传'
|
||||||
}
|
}
|
||||||
apiCourseFile.saveUpload(courseWare).then(rs=>{
|
apiCourseFile.saveUpload(courseWare).then(rs=>{
|
||||||
|
|||||||
@@ -1,200 +1,366 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<div v-if="exam.show==1">
|
<div v-if="showTab==1">
|
||||||
<div style="padding: 10px; text-align: center;">
|
<div style="padding: 10px; text-align: center;margin-top: 20px;">
|
||||||
<el-button @click="changeExamShow(3)" type="primary" size="small">自定义考试</el-button>
|
<el-button @click="openCusExam()" type="primary" >自定义考试</el-button>
|
||||||
<el-button @click="changeExamShow(2)" type="primary" size="small">选择已有考试</el-button>
|
<el-button @click="openChoosePaper()" type="primary">选择已有考试</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="exam.show==2">
|
<div v-if="showTab==2">
|
||||||
<div style="display: flex;justify-content: flex-start;">
|
<div style="display: flex;justify-content: flex-start;">
|
||||||
<!--需求原型中没有按知识点选择
|
<div><el-input v-model="usePaper.keyword" maxlength="50" placeholder="名称"></el-input></div>
|
||||||
<div>
|
<div style="padding-left: 10px;"><el-button @click="findExamPapers()" type="primary" >查询</el-button></div>
|
||||||
<el-select v-model="exam.type" style="width: 140px;" clearable placeholder="选择知识点">
|
<div style="padding-left: 10px;"><el-button @click="changeExamShow(1)" type="danger" >返回</el-button></div>
|
||||||
</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>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="text-align: center;padding-top: 10px;">
|
<div style="text-align: center;padding-top: 10px; overflow-y: auto;">
|
||||||
<el-table style="100%" :data="exam.findhas.list" border stripe>
|
<el-table style="100%" height="480" :data="usePaper.list" border stripe>
|
||||||
<el-table-column label="考试名称" prop="author"><template>考试名称</template></el-table-column>
|
<el-table-column prop="testName" label="试卷"></el-table-column>
|
||||||
<el-table-column label="创建时间" prop="author">
|
<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">
|
<template slot-scope="scope">
|
||||||
2022-02-03
|
<el-button size="mini" @click="chooseExamPaper(scope.row)" type="primary" >选择</el-button>
|
||||||
</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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="exam.show==3">
|
<div v-if="showTab==3">
|
||||||
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border: 1px solid #e7e7e7;">
|
<div style="display: flex;justify-content: space-between;padding:5px 10px;line-height: 30px; border-bottom: 1px solid #e7e7e7;">
|
||||||
<div>自定义考试</div>
|
<div>{{examInfo.paperType==1? '自定义考试':'使用独立考试试卷'}} </div>
|
||||||
<div>
|
<div>
|
||||||
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
|
<el-checkbox v-model="onlyQuestion">只显示试题</el-checkbox>
|
||||||
<el-button style="margin-left: 10px;" @click="changeExamShow(1)" type="info" size="mini" >重新选择</el-button>
|
<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>
|
</div>
|
||||||
<div style="padding-top: 10px;overflow: auto;">
|
<div style="padding-top: 10px;overflow: auto;">
|
||||||
<div v-if="!exam.onlyQuestion">
|
<div v-if="!onlyQuestion">
|
||||||
<el-form size="mini" label-width="80px">
|
<el-form size="small" label-width="80px">
|
||||||
|
<!-- 课程内考虑不需要名辽
|
||||||
<el-form-item label="考试名称">
|
<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>
|
||||||
|
-->
|
||||||
<el-form-item label="考试时长">
|
<el-form-item label="考试时长">
|
||||||
<el-col :span="10">
|
<el-col :span="8">
|
||||||
<el-input v-model="exam.info.passScore" placeholder="20-120">
|
<el-input size="mini" v-model="examInfo.testDuration" placeholder="20-120">
|
||||||
<template slot="append">分钟</template>
|
<template slot="append">分钟</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="14">
|
<el-col :span="12">
|
||||||
<el-form-item label="及格线">
|
<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>
|
<template slot="append">%</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="显示">
|
<el-form-item label="评分方式">
|
||||||
<el-col :span="10">
|
<el-col :span="8">
|
||||||
<el-checkbox v-model="exam.info.showJieXi">允许查看解析</el-checkbox>
|
<el-radio-group v-model="examInfo.scoringType">
|
||||||
</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-radio :label="1">最高一次</el-radio>
|
<el-radio :label="1">最高一次</el-radio>
|
||||||
<el-radio :label="2">最后一次</el-radio>
|
<el-radio :label="2">最后一次</el-radio>
|
||||||
</el-radio-group>
|
</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-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
<el-form-item label="考试说明">
|
||||||
</div>
|
<el-input type="textarea" show-word-limit v-model="examInfo.info" placeholder="关于考试的说明(限255字以内)" maxlength="255"></el-input>
|
||||||
<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>
|
</el-form-item>
|
||||||
</el-form>
|
</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>
|
||||||
</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>
|
<div>
|
||||||
<img :src="`${webBaseUrl}/temp/exampaper.png`">
|
<img :src="`${webBaseUrl}/temp/exampaper.png`">
|
||||||
</div>
|
</div>
|
||||||
<span slot="footer" class="dialog-footer">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="exam.paperShow= false">关闭</el-button>
|
<el-button @click="paperShow= false">关闭</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<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{
|
export default{
|
||||||
|
components:{simplePaper},
|
||||||
|
props:{
|
||||||
|
courseId:{
|
||||||
|
type: String,
|
||||||
|
default:'',
|
||||||
|
},
|
||||||
|
contentId:{
|
||||||
|
type: String,
|
||||||
|
default:'',
|
||||||
|
}
|
||||||
|
},
|
||||||
data(){
|
data(){
|
||||||
return {
|
return {
|
||||||
exam:{
|
loading:false,
|
||||||
show:1,
|
examChange:{}, //用于保存,检查是否改变
|
||||||
paperShow:false,
|
showTab:0, //显示哪个
|
||||||
customerShow:false,
|
onlyQuestion:false, //只显示问题
|
||||||
has:false,
|
paperShow:false, //查看试卷
|
||||||
onlyQuestion:false,
|
examPaper:{items:[]}, //试题列表的对象
|
||||||
info:{
|
examInfo:{
|
||||||
name:'',
|
id:'',
|
||||||
limitTimes:1,
|
name:'',
|
||||||
passScore:60,
|
testDuration:30,
|
||||||
showJieXi:true,
|
testName:'',
|
||||||
showAnswer:false,
|
courseId:this.courseId,
|
||||||
randomType:1,
|
contentId:'',
|
||||||
qorder:[],
|
paperType:1,//默认是自定义
|
||||||
examTime:60,
|
paperId:'',
|
||||||
questions:[
|
arrange:0,
|
||||||
{body:'试题1',score:10},
|
qnum:0,
|
||||||
{body:'试题2',score:10}
|
times:1,
|
||||||
],
|
passScore:60,
|
||||||
|
showAnswer:false,
|
||||||
},
|
showAnalysis:false,
|
||||||
findhas:{
|
randomType:1,
|
||||||
list:[{},{}]
|
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:{
|
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){
|
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;
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -567,6 +567,7 @@ export default {
|
|||||||
this.orgName=orgInfo.name;
|
this.orgName=orgInfo.name;
|
||||||
this.orgKid=orgInfo.kid; //kid已不存在
|
this.orgKid=orgInfo.kid; //kid已不存在
|
||||||
this.courseInfo.orgId=orgInfo.id;
|
this.courseInfo.orgId=orgInfo.id;
|
||||||
|
this.courseInfo.orgName=orgInfo.name;
|
||||||
this.$refs.refChooseOrg.dlgShow = false;
|
this.$refs.refChooseOrg.dlgShow = false;
|
||||||
},
|
},
|
||||||
getTeacherList(res) {
|
getTeacherList(res) {
|
||||||
@@ -729,6 +730,7 @@ export default {
|
|||||||
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
this.orgName=rs.result.name;
|
this.orgName=rs.result.name;
|
||||||
|
this.courseInfo.orgName=rs.result.name;
|
||||||
//this.orgKid=rs.result.kid;
|
//this.orgKid=rs.result.kid;
|
||||||
this.orgNamePath=rs.result.namePath;
|
this.orgNamePath=rs.result.namePath;
|
||||||
}
|
}
|
||||||
@@ -849,6 +851,7 @@ export default {
|
|||||||
apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{
|
apiUserBasic.getOrgInfo(ors.result.id).then(rrs=>{
|
||||||
if(rrs.status==200){
|
if(rrs.status==200){
|
||||||
$this.orgName=rrs.result.name;
|
$this.orgName=rrs.result.name;
|
||||||
|
this.courseInfo.orgName=rrs.result.name;
|
||||||
//$this.orgKid=rrs.result.kid;
|
//$this.orgKid=rrs.result.kid;
|
||||||
$this.orgNamePath=rrs.result.namePath;
|
$this.orgNamePath=rrs.result.namePath;
|
||||||
}else{
|
}else{
|
||||||
@@ -875,6 +878,7 @@ export default {
|
|||||||
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
apiUserBasic.getOrgInfo(this.courseInfo.orgId).then(rs=>{
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
$this.orgName=rs.result.name;
|
$this.orgName=rs.result.name;
|
||||||
|
$this.courseInfo.orgName=rs.result.name;
|
||||||
//$this.orgKid=rs.result.kid;
|
//$this.orgKid=rs.result.kid;
|
||||||
$this.orgNamePath=rs.result.namePath;
|
$this.orgNamePath=rs.result.namePath;
|
||||||
}else{
|
}else{
|
||||||
|
|||||||
@@ -119,6 +119,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import apiStudy from '@/api/modules/courseStudy.js';
|
import apiStudy from '@/api/modules/courseStudy.js';
|
||||||
import apiCourse from '@/api/modules/course.js';
|
import apiCourse from '@/api/modules/course.js';
|
||||||
|
import apiExamPaper from '@/api/modules/paper.js';
|
||||||
import {formatDate,formatSeconds} from '@/utils/datetime.js';
|
import {formatDate,formatSeconds} from '@/utils/datetime.js';
|
||||||
import {testType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
import {testType,correctJudgment,numberToLetter} from '@/utils/tools.js';
|
||||||
export default {
|
export default {
|
||||||
@@ -168,7 +169,11 @@ export default {
|
|||||||
records:[] ,//考试记录
|
records:[] ,//考试记录
|
||||||
allowSubmit:true,//是否允许考试,尝试次数达到后不能再考试,暂时未使用
|
allowSubmit:true,//是否允许考试,尝试次数达到后不能再考试,暂时未使用
|
||||||
detailShow:false,
|
detailShow:false,
|
||||||
detailItems:[]
|
detailItems:[],
|
||||||
|
examPaper:{
|
||||||
|
json:{},//试题的json格式
|
||||||
|
items:[],//试题内容
|
||||||
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
@@ -217,8 +222,6 @@ export default {
|
|||||||
this.total=paper.items.length;
|
this.total=paper.items.length;
|
||||||
this.paper =paper;
|
this.paper =paper;
|
||||||
//console.log(this.paper);
|
//console.log(this.paper);
|
||||||
|
|
||||||
|
|
||||||
this.viewTest =paper.items;
|
this.viewTest =paper.items;
|
||||||
}
|
}
|
||||||
if(!this.showTest && this.showRecord){
|
if(!this.showTest && this.showRecord){
|
||||||
@@ -260,30 +263,78 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
//独立考试的试题转化为课内考试的试题
|
||||||
|
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,
|
||||||
|
options:[]
|
||||||
|
}
|
||||||
|
item.optionList.forEach(opt=>{
|
||||||
|
q.options.push({
|
||||||
|
id:opt.id,
|
||||||
|
content:opt.content,
|
||||||
|
answer:opt.isAnswer,
|
||||||
|
checked:false
|
||||||
|
})
|
||||||
|
});
|
||||||
|
if(q.type==102){
|
||||||
|
q.userAnswer=[];
|
||||||
|
}
|
||||||
|
qitems.push(q);
|
||||||
|
});
|
||||||
|
return qitems;
|
||||||
|
},
|
||||||
startTest(){
|
startTest(){
|
||||||
let paper= JSON.parse(this.info.paperContent);
|
if(this.info.paperType==2){
|
||||||
paper.items.forEach(item=>{
|
apiExamPaper.getPaperContent(this.info.paperId).then(rs=>{
|
||||||
//console.log(item);
|
if(rs.status=200){
|
||||||
if(item.type==101){
|
this.examPaper.json=JSON.parse(rs.result);
|
||||||
item.userAnswer='';
|
//console.log(this.examPaper.json,'this.examPaper.json');
|
||||||
}else if(item.type==102){
|
let qitems=this.convertToItems(this.examPaper.json);
|
||||||
item.userAnswer=[];
|
this.paper ={items:qitems};
|
||||||
}else{
|
this.total=qitems.length;
|
||||||
item.userAnswer=''
|
this.curItem=qitems[this.curIndex];
|
||||||
}
|
this.startTime=new Date();//记录开始时间
|
||||||
item.options.forEach(opt=>{
|
this.timerValue=this.info.testDuration;
|
||||||
opt.checked=false;
|
this.timer=setInterval(this.changeTimer,60000);
|
||||||
|
this.testStart=true;
|
||||||
|
}else{
|
||||||
|
this.$message.error('加载试卷内容失败,请与管理员联系,试卷是否已删除');
|
||||||
|
}
|
||||||
})
|
})
|
||||||
});
|
}else{
|
||||||
this.total=paper.items.length;
|
let paper= JSON.parse(this.info.paperContent);
|
||||||
this.paper =paper;
|
paper.items.forEach(item=>{
|
||||||
//console.log(this.paper);
|
//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.curItem=paper.items[this.curIndex];
|
||||||
this.startTime=new Date();//记录开始时间
|
this.startTime=new Date();//记录开始时间
|
||||||
this.timerValue=this.info.testDuration;
|
this.timerValue=this.info.testDuration;
|
||||||
this.timer=setInterval(this.changeTimer,60000);
|
this.timer=setInterval(this.changeTimer,60000);
|
||||||
this.testStart=true;
|
this.testStart=true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
chooseOption(opt){
|
chooseOption(opt){
|
||||||
if(this.curItem.type==101 || this.curItem.type==103){
|
if(this.curItem.type==101 || this.curItem.type==103){
|
||||||
|
|||||||
@@ -24,15 +24,26 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--内容区-->
|
<!--内容区-->
|
||||||
<div style="margin-top: 10px;">
|
<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 v-if="cware.content.contentRefId==''">
|
||||||
<div style="display: flex;justify-content: center;padding-top: 50px;">
|
<div style="padding-top: 0px;">
|
||||||
<div>
|
<!-- <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>
|
<choose-course-file :orgId="course.orgId" :orgName="course.orgName" ref="coursewarePanel" :resType="cware.content.contentType" @choose="chooseFile"></choose-course-file>
|
||||||
</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="margin-left: 10px;">
|
<div style="margin-left: 10px;">
|
||||||
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
|
<el-button type="primary" size="small" @click="toFindCWare()" >选择已有{{getType(cware.content.contentType)}}</el-button>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-else>
|
<div v-else>
|
||||||
@@ -116,6 +127,9 @@
|
|||||||
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||||
</div>
|
</div>
|
||||||
</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>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -263,8 +277,8 @@
|
|||||||
<el-tab-pane label="考试" name="exam">
|
<el-tab-pane label="考试" name="exam">
|
||||||
<div v-if="exam.show==1">
|
<div v-if="exam.show==1">
|
||||||
<div style="padding: 10px; text-align: center;">
|
<div style="padding: 10px; text-align: center;">
|
||||||
<el-button @click="changeExamShow(3)" type="primary" >自定义考试</el-button>
|
<el-button @click="openCusExam()" type="primary" >自定义考试</el-button>
|
||||||
<!-- <el-button @click="changeExamShow(2)" type="primary" size="small">选择已有考试</el-button> -->
|
<el-button @click="openChoosePaper()" type="primary">选择已有考试</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="exam.show==2">
|
<div v-if="exam.show==2">
|
||||||
@@ -275,37 +289,39 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</div>
|
||||||
-->
|
-->
|
||||||
<div><el-input maxlength="50" placeholder="名称"></el-input></div>
|
<div><el-input v-model="usePaper.keyword" maxlength="50" placeholder="名称"></el-input></div>
|
||||||
<div><el-input 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 type="primary" >搜索已有考试</el-button></div>
|
<div style="padding-left: 10px;"><el-button @click="changeExamShow(1)" type="danger" >返回</el-button></div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<div style="text-align: center;padding-top: 10px;">
|
<div style="text-align: center;padding-top: 10px; overflow-y: auto;">
|
||||||
<el-table style="100%" :data="hasCWare.list" border stripe>
|
<el-table style="100%" height="480" :data="usePaper.list" border stripe>
|
||||||
<el-table-column label="考试名称" prop="author"><template>考试名称</template></el-table-column>
|
<el-table-column prop="testName" label="考试名称"></el-table-column>
|
||||||
<el-table-column label="创建时间" prop="author">
|
<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">
|
<template slot-scope="scope">
|
||||||
2022-02-03
|
<el-button size="mini" @click="chooseExamPaper(scope.row)" type="primary" >选择</el-button>
|
||||||
</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>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</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>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="exam.show==3">
|
<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 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>
|
<div>
|
||||||
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
|
<el-checkbox v-model="exam.onlyQuestion">只显示试题</el-checkbox>
|
||||||
<el-button :loading="loading" style="margin-left: 10px;" @click="saveContent(3)" type="primary" > 保 存 </el-button>
|
<el-button :loading="loading" style="margin-left: 10px;" @click="saveContent(3)" type="primary" > 保 存 </el-button>
|
||||||
@@ -387,9 +403,12 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-if="exam.info.paperType==1">
|
||||||
<simplePaper :data="exam.paperJson"></simplePaper>
|
<simplePaper :data="exam.paperJson"></simplePaper>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="exam.info.paperType==2">
|
||||||
|
<div style="font-size: 20px;padding: 10px;" >试卷: {{usePaper.paperName}}</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="exam.show==9">
|
<div v-if="exam.show==9">
|
||||||
@@ -398,7 +417,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div style="padding-top: 10px;">
|
<div style="padding-top: 10px;">
|
||||||
<el-form size="small" label-width="80px">
|
<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="6">{{exam.info.passScore}}分钟</el-col>
|
||||||
<!-- <el-col :span="9">
|
<!-- <el-col :span="9">
|
||||||
<el-form-item label="尝试次数">{{exam.info.times}}</el-form-item>
|
<el-form-item label="尝试次数">{{exam.info.times}}</el-form-item>
|
||||||
@@ -520,17 +543,19 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
import chooseCourseFile from '@/components/Course/chooseCourseFile.vue'
|
||||||
import WxEditor from "@/components/Editor/indexCourse.vue";
|
import WxEditor from "@/components/Editor/indexCourse.vue";
|
||||||
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
import simplePaper from "@/components/Course/simpleTestPaper.vue";
|
||||||
import FileUpload from '@/components/FileUpload/index.vue';
|
import FileUpload from '@/components/FileUpload/index.vue';
|
||||||
import pdfPreview from "@/components/PdfPreview/index.vue";
|
import pdfPreview from "@/components/PdfPreview/index.vue";
|
||||||
import apiCourse from '../../api/modules/course.js';
|
import apiCourse from '../../api/modules/course.js';
|
||||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||||
|
import apiExamPaper from '../../api/modules/paper.js';
|
||||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||||
import {getType} from '../../utils/tools.js';
|
import {getType} from '../../utils/tools.js';
|
||||||
import { deepClone } from "../../utils";
|
import { deepClone } from "../../utils";
|
||||||
export default{
|
export default{
|
||||||
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer},
|
components:{WxEditor,simplePaper,FileUpload,pdfPreview,audioPlayer,chooseCourseFile},
|
||||||
props: {
|
props: {
|
||||||
contents:{
|
contents:{
|
||||||
type:Array,
|
type:Array,
|
||||||
@@ -565,6 +590,7 @@
|
|||||||
curCFile:{},//当前课件的内容
|
curCFile:{},//当前课件的内容
|
||||||
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
fileBaseUrl:this.$xpage.constants.fileBaseUrl,
|
||||||
imageShowUrl: '',
|
imageShowUrl: '',
|
||||||
|
scormUrl:'',//scorm课件对应的url地址
|
||||||
activeName: 'courseware',
|
activeName: 'courseware',
|
||||||
getType: getType,
|
getType: getType,
|
||||||
cwareTypes:[
|
cwareTypes:[
|
||||||
@@ -669,6 +695,16 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
usePaper:{ //使用考试试卷
|
||||||
|
pageIndex:1,
|
||||||
|
pageSize:10,
|
||||||
|
total:0,
|
||||||
|
list:[],
|
||||||
|
keyword:'',
|
||||||
|
paperId:'',//选择的试卷的id
|
||||||
|
paperName:'',//选择的试卷的名称
|
||||||
|
paperJson:{items:[]},
|
||||||
|
},
|
||||||
exam:{
|
exam:{
|
||||||
show:1,
|
show:1,
|
||||||
content:{id:'',contentType:61,sortIndex:3},
|
content:{id:'',contentType:61,sortIndex:3},
|
||||||
@@ -695,7 +731,6 @@
|
|||||||
paperId:'',//试卷的id,只有paperType为2的时间才会有值
|
paperId:'',//试卷的id,只有paperType为2的时间才会有值
|
||||||
info:'',//考试说明
|
info:'',//考试说明
|
||||||
paperContent:'',//试题的json字符串
|
paperContent:'',//试题的json字符串
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
assess:{
|
assess:{
|
||||||
@@ -717,6 +752,9 @@
|
|||||||
},
|
},
|
||||||
mounted(){
|
mounted(){
|
||||||
//this.init();
|
//this.init();
|
||||||
|
if(process.env.NODE_ENV=='development'){
|
||||||
|
this.fileBaseUrl=process.env.VUE_APP_FILE_BASE_URL;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch:{
|
watch:{
|
||||||
reset(newVal){
|
reset(newVal){
|
||||||
@@ -730,6 +768,7 @@
|
|||||||
methods:{
|
methods:{
|
||||||
init(){
|
init(){
|
||||||
this.activeName='courseware';
|
this.activeName='courseware';
|
||||||
|
this.scormUrl='';//scorm的路径
|
||||||
this.curCFile={},//当前课件的内容
|
this.curCFile={},//当前课件的内容
|
||||||
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
||||||
this.cware.show=1;
|
this.cware.show=1;
|
||||||
@@ -758,6 +797,12 @@
|
|||||||
if(con.contentType==40){
|
if(con.contentType==40){
|
||||||
//console.log('加载pdf文件内容');
|
//console.log('加载pdf文件内容');
|
||||||
$this.loadPdfFile();
|
$this.loadPdfFile();
|
||||||
|
}else if(con.contentType==50){
|
||||||
|
//console.log('加载pdf文件内容');
|
||||||
|
if(!this.scormUrl){
|
||||||
|
$this.loadScormFile();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
if(con.contentType==52){
|
if(con.contentType==52){
|
||||||
if(con.content.startsWith('\{')){
|
if(con.content.startsWith('\{')){
|
||||||
@@ -814,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(){
|
loadHomeworkInfo(){
|
||||||
apiCourse.getHomework(this.homework.content.id).then(res=>{
|
apiCourse.getHomework(this.homework.content.id).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
@@ -833,7 +894,18 @@
|
|||||||
apiCourse.getExam(this.exam.content.id).then(res=>{
|
apiCourse.getExam(this.exam.content.id).then(res=>{
|
||||||
if(res.status==200){
|
if(res.status==200){
|
||||||
this.exam.info=res.result;
|
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.exam.show=9;
|
||||||
this.examChange = deepClone(this.exam);
|
this.examChange = deepClone(this.exam);
|
||||||
}else if(res.status==404){
|
}else if(res.status==404){
|
||||||
@@ -919,6 +991,7 @@
|
|||||||
resetContent(index){
|
resetContent(index){
|
||||||
if(index==1){
|
if(index==1){
|
||||||
this.cware.content.id='';
|
this.cware.content.id='';
|
||||||
|
this.scormUrl='';
|
||||||
this.cware.content.contentRefId='';
|
this.cware.content.contentRefId='';
|
||||||
this.cware.content.contentName='';
|
this.cware.content.contentName='';
|
||||||
this.cware.content.content='';
|
this.cware.content.content='';
|
||||||
@@ -977,29 +1050,38 @@
|
|||||||
this.homeworkChange = deepClone(this.homework)
|
this.homeworkChange = deepClone(this.homework)
|
||||||
}else if(index==3){
|
}else if(index==3){
|
||||||
postData.content=this.exam.content;
|
postData.content=this.exam.content;
|
||||||
//检查是不是所有的试题都有了答案
|
//console.log(this.exam,'this.exam');
|
||||||
if(this.exam.paperJson.items.length==0){
|
if(this.exam.info.paperType==2){
|
||||||
this.$message.error("您还没有添加考试的试题");
|
if(!this.exam.info.paperId){
|
||||||
return;
|
this.$message.error("您还未选择任何试卷");
|
||||||
}
|
return;
|
||||||
let pass=true;
|
}
|
||||||
this.exam.paperJson.items.forEach(qitem=>{
|
}else{
|
||||||
if(qitem.options.length==0){
|
//检查是不是所有的试题都有了答案
|
||||||
pass=false;
|
if(this.exam.paperJson.items.length==0){
|
||||||
}else{
|
this.$message.error("您还没有添加考试的试题");
|
||||||
let hasAnswer=qitem.options.some(opt=>{
|
return;
|
||||||
return opt.answer;
|
}
|
||||||
});
|
let pass=true;
|
||||||
if(!hasAnswer){
|
this.exam.paperJson.items.forEach(qitem=>{
|
||||||
|
if(qitem.options.length==0){
|
||||||
pass=false;
|
pass=false;
|
||||||
|
}else{
|
||||||
|
let hasAnswer=qitem.options.some(opt=>{
|
||||||
|
return opt.answer;
|
||||||
|
});
|
||||||
|
if(!hasAnswer){
|
||||||
|
pass=false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
});
|
if(!pass){
|
||||||
if(!pass){
|
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
||||||
this.$message.error("试卷试题请填写完整,每个试题必须要有答案");
|
this.loading=false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
|
||||||
}
|
}
|
||||||
this.exam.info.paperContent=JSON.stringify(this.exam.paperJson);
|
|
||||||
postData.exam=this.exam.info;
|
postData.exam=this.exam.info;
|
||||||
this.examChange = deepClone(this.exam);
|
this.examChange = deepClone(this.exam);
|
||||||
}else if(index==4){
|
}else if(index==4){
|
||||||
@@ -1083,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() {
|
getCoursewareList() {
|
||||||
// name:查询的名称的关键字
|
// name:查询的名称的关键字
|
||||||
// self:true/false,默认是true,是否只查询自己上传的课件
|
// self:true/false,默认是true,是否只查询自己上传的课件
|
||||||
@@ -1168,15 +1280,75 @@
|
|||||||
changeHomeworkShow(idx){
|
changeHomeworkShow(idx){
|
||||||
this.homework.show=idx;
|
this.homework.show=idx;
|
||||||
},
|
},
|
||||||
changeExamShow(idx){
|
|
||||||
|
|
||||||
this.exam.show=idx;
|
|
||||||
},
|
|
||||||
assessmentHandle(){
|
assessmentHandle(){
|
||||||
this.assess.show=2;
|
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>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
|||||||
@@ -79,6 +79,10 @@ export default {
|
|||||||
type: Number,
|
type: Number,
|
||||||
default: 1024,
|
default: 1024,
|
||||||
},
|
},
|
||||||
|
scorm:{
|
||||||
|
type:String,
|
||||||
|
default:''
|
||||||
|
},
|
||||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||||
fileType: {
|
fileType: {
|
||||||
type: Array,
|
type: Array,
|
||||||
@@ -156,6 +160,13 @@ export default {
|
|||||||
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
//this.$message.error(`文件格式不正确, 请上传${this.fileType.join("/")}格式文件!`);
|
||||||
return false;
|
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) {
|
if (this.fileSize) {
|
||||||
@@ -166,6 +177,7 @@ export default {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.loading) {
|
if(this.loading) {
|
||||||
this.isLoading = true;
|
this.isLoading = true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,29 +2,28 @@
|
|||||||
<div class="interact-bar ranking-interactBar">
|
<div class="interact-bar ranking-interactBar">
|
||||||
<div>
|
<div>
|
||||||
<el-tooltip effect="light" content="评分" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
<el-tooltip effect="light" content="评分" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||||
<svg-icon style="margin-right: 0px;font-size: 22px;flex:1;" ></svg-icon>
|
<svg-icon style="margin-right: 0px;font-size: 18px;" icon-class="pingfen"></svg-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span class="interact-bar-value"> {{ data.score }} </span>
|
<span class="interact-bar-value"> {{ data.score }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<el-tooltip effect="light" content="学习人数" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
<el-tooltip effect="light" content="学习人数" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||||
<svg-icon style="margin-right: 0px;font-size: 22px;" icon-class="eyes"></svg-icon>
|
<svg-icon style="margin-right: 0px;font-size: 18px;" icon-class="xuexirenshu"></svg-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span class="interact-bar-value"> {{ data.studys }} </span>
|
<span class="interact-bar-value"> {{ data.studys }} </span>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="praises" @click="addPraise()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
<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">
|
<el-tooltip effect="light" content="点赞" placement="top" :visible-arrow="false" popper-class="text-tooltip">
|
||||||
<svg-icon style="margin-right: 0;font-size: 14px;" :icon-class="isPraise?'praised':'like'"></svg-icon>
|
<svg-icon style="margin-right: 0;font-size: 18px;" icon-class="dianzan"></svg-icon>
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span class="interact-bar-value"> {{ data.praises? data.praises:0}}</span>
|
<span class="interact-bar-value"> {{ data.praises? data.praises:0}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="favorites" @click="addFavorite()" :style="`min-width: ${nodeWidth};`" class="interact-bar-btn" :class="{cursor:!readonly}">
|
<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">
|
<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 style="font-size: 18px;margin-right: 0;" icon-class="xihuan"></svg-icon>
|
||||||
<svg-icon v-else style="margin-right: 0;" :style="{'font-size':size+'px'}" :icon-class="isFavorite?'collected':'collection'"></svg-icon>
|
|
||||||
</el-tooltip>
|
</el-tooltip>
|
||||||
<span v-if="!courseExclusive" class="interact-bar-value"> {{ data.favorites? data.favorites:0}}</span>
|
<span class="interact-bar-value"> {{ data.favorites? data.favorites:0}}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -181,7 +181,7 @@ export default {
|
|||||||
this.sex = this.userInfo.sex;
|
this.sex = this.userInfo.sex;
|
||||||
this.$store.dispatch('refrashMsg');
|
this.$store.dispatch('refrashMsg');
|
||||||
this.loadBoeData();
|
this.loadBoeData();
|
||||||
this.loadPopupConfig();
|
//this.loadPopupConfig();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
loadPopupConfig(){
|
loadPopupConfig(){
|
||||||
|
|||||||
@@ -256,7 +256,11 @@
|
|||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<el-menu-item index="/uc/study/path" v-show="isTest">
|
<el-menu-item index="/uc/study/path" v-show="isTest">
|
||||||
<!-- <i class="el-icon-menu"></i> -->
|
<!-- <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/project" v-show="isTest">
|
||||||
|
<!-- <i class="el-icon-menu"></i> -->
|
||||||
|
<span slot="title" class="textl">学习项目</span>
|
||||||
</el-menu-item>
|
</el-menu-item>
|
||||||
<!-- <el-menu-item index="/uc/study/history"> -->
|
<!-- <el-menu-item index="/uc/study/history"> -->
|
||||||
<!-- <i class="el-icon-menu"></i> -->
|
<!-- <i class="el-icon-menu"></i> -->
|
||||||
@@ -410,10 +414,14 @@ export default {
|
|||||||
this.getLastStudy();
|
this.getLastStudy();
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
console.log(this.userInfo.loginName,'this.userInfo.loginName')
|
console.log(this.userInfo.loginName,'this.userInfo.loginName');
|
||||||
if(testUser.isTest(this.userInfo.loginName)){
|
let flag=testUser.isTest(this.userInfo.loginName);
|
||||||
this.isTest=true;
|
console.log(flag,'this.isTest22');
|
||||||
}
|
this.isTest=flag;
|
||||||
|
// if(testUser.isTest(this.userInfo.loginName)){
|
||||||
|
// console.log(this.isTest,'this.isTest');
|
||||||
|
// this.isTest=true;
|
||||||
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
toCourseDetail(item){
|
toCourseDetail(item){
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ export const pages=[
|
|||||||
{title:'学习任务',path:'task',component:'study/TaskList',hidden:false},
|
{title:'学习任务',path:'task',component:'study/TaskList',hidden:false},
|
||||||
{title:'正在学习',path:'courses',component:'study/Courses',hidden:false},
|
{title:'正在学习',path:'courses',component:'study/Courses',hidden:false},
|
||||||
{title:'历史记录',path:'history',component:'study/FinishCourses',hidden:false},
|
{title:'历史记录',path:'history',component:'study/FinishCourses',hidden:false},
|
||||||
{title:'学习路径图',path:'path',component:'study/StudyPath',hidden:false}
|
{title:'学习路径图',path:'path',component:'study/StudyPath',hidden:false},
|
||||||
|
{title:'学习项目',path:'project',component:'study/StudyProject',hidden:false}
|
||||||
]},
|
]},
|
||||||
{title:'个人中心',path:'/uc',hidden:false,children:[
|
{title:'个人中心',path:'/uc',hidden:false,children:[
|
||||||
{title:'首页',path:'index',component:'StudyIndex',hidden:false}
|
{title:'首页',path:'index',component:'StudyIndex',hidden:false}
|
||||||
|
|||||||
1
src/icons/svg/Scoreicon.svg
Normal file
1
src/icons/svg/Scoreicon.svg
Normal file
@@ -0,0 +1 @@
|
|||||||
|
<svg t="1671028831851" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3466" width="200" height="200"><path d="M511 724.7c-79.5 0-154.3-31-210.5-87.2-56.2-56.2-87.2-131-87.2-210.5s31-154.3 87.2-210.5 131-87.2 210.5-87.2 154.3 31 210.5 87.2 87.2 131 87.2 210.5-31 154.3-87.2 210.5c-56.2 56.3-131 87.2-210.5 87.2z m0-545.4c-136.6 0-247.7 111.1-247.7 247.7S374.4 674.7 511 674.7 758.7 563.6 758.7 427 647.6 179.3 511 179.3z" p-id="3467" fill="#8a8a8a"></path><path d="M243 895.5l59.4-266 48.8 10.9L310.7 822l194.8-60.8 206.4 61.1L663 632.5l48.4-12.5 71 275.3-276.5-81.8zM512 268.8l46.9 94.9L663.7 379l-75.9 73.9 17.9 104.4L512 508l-93.7 49.3 17.9-104.4-75.9-73.9 104.8-15.3z" p-id="3468" fill="#8a8a8a"></path></svg>
|
||||||
|
After Width: | Height: | Size: 757 B |
17
src/icons/svg/dianzan.svg
Normal file
17
src/icons/svg/dianzan.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="28px" height="28px" viewBox="0 0 28 28" enable-background="new 0 0 28 28" xml:space="preserve"> <image id="image0" width="28" height="28" x="0" y="0"
|
||||||
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
|
||||||
|
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAwFBMVEUAAAC2vcW0vsWzvsS0
|
||||||
|
vcW1v8W229uzvcWzvcX///+0w8u1vsWzwMazvcW/v/+0vsS3wMWzvsW1v8a0vsW2wMe1w8m0vcW0
|
||||||
|
vsT///+0v8azvcW0vsW1vcW1wcb///+0vsS0vsTMzMyzvsW0vcW0wMSzvcW/v9+0vsS0vcazvcW0
|
||||||
|
vsW0vsSzvsWzvsW1vcWzwcizvcWzvsWzv8a0vsi0vcS0vsa0vsW3wsi0vsa0vsSzvcWzvsS0vsWz
|
||||||
|
vsazvcT///+3QmwLAAAAPnRSTlMAI8XzvmAHyq8DIolR7AR+OahI000mjOoBY/3LPi0CepgFufE9
|
||||||
|
9QjMVc3659ieYSXorG8zun3jLoGggOLceTaJ0IEAAAABYktHRAnx2aXsAAAAB3RJTUUH5gwVCA8V
|
||||||
|
SqixDwAAAKZJREFUKM990dcOwjAMhWGXUqCMslcZbdl77+H3fyxCGgmJOP6vLH13xwC/rISddFJA
|
||||||
|
l0ZRxiUti7IcifkYCx6FxRixRGFZYYXCqsIaYXVlaBHYUNbUqdX2FXa6sl5f7hKEYQQD/G/oAIzG
|
||||||
|
4pjAFPVm8WY0zmFhxiWgGVccrjnccLhlcAcM7jk8cHhk0HYZPAGDZ4EXE14F3gx4//7aezx19F/v
|
||||||
|
SNgHPuR7NzvxnYAAAAAldEVYdGRhdGU6Y3JlYXRlADIwMjItMTItMjFUMDg6MTU6MjErMDA6MDDQ
|
||||||
|
vVizAAAAJXRFWHRkYXRlOm1vZGlmeQAyMDIyLTEyLTIxVDA4OjE1OjIxKzAwOjAwoeDgDwAAAABJ
|
||||||
|
RU5ErkJggg==" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
17
src/icons/svg/pingfen.svg
Normal file
17
src/icons/svg/pingfen.svg
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="28px" height="28px" viewBox="0 0 28 28" enable-background="new 0 0 28 28" xml:space="preserve"> <image id="image0" width="28" height="28" x="0" y="0"
|
||||||
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAcCAMAAABF0y+mAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
|
||||||
|
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAvVBMVEUAAAC1v8SzvcW0vcW1
|
||||||
|
v8a3wMW0vsW0vcW0vsS2ws6zvcWzvsW1vsT///+0vcW2vcW0wMSzvsW2yMi2vcWzvsa0v8W1vsWz
|
||||||
|
vsWzvcW0vsWzv8ezvsW0vcW0vcW0vcW0w9K0vsS0vcXMzMy0vsW/v/+0vsS0vsS1v8azv8a4wsy1
|
||||||
|
v8qzwMa0vcWzvcW/v9+2vsezvsW2vsazvsW0vsa0vsW229uzvsW4vsq1vcW0vsS0vcS0vsX///+z
|
||||||
|
vcT///8kTae6AAAAPXRSTlMAaOXkZzn+qqkV+XZ1AdpCQagORl5ziZ6zy0Dy0vGnEcjJCrQEnIJr
|
||||||
|
bBkYUYzGCDvXP9iO+geNK3zq3WoCaxbP8gAAAAFiS0dEDfa0YfUAAAAHdElNRQfmDBUIDgLQYAWJ
|
||||||
|
AAAA2UlEQVQoz3XSWRuBQBQG4GMLyVJElLJU1iJkSfP//xbVVGPMfFfnnPfqm2cAiFSqtTpw0hAQ
|
||||||
|
EhocbKJvWmxriwmKbSZ2UBqJZd1ehr0uA/sIZ8BAOUeZOCrDkTqeaFNUZKpNxupoqADMdMSJPgAD
|
||||||
|
cWOAzsc5mHw0wVrwbGkBrNZsW6+SLrbDMsfGVd1/c8uH2NC2JV5pR+OewAONBwKPNB4J9Gj0SvNF
|
||||||
|
GkW/wNN/lVOBEr6cg+CCx/InXdP95oYAoXtLl/tvE++RLQ+P6vJ8Re84X+J39Hqm0wew+mf4tSaW
|
||||||
|
sgAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0xMi0yMVQwODoxNDowMiswMDowMEyyLm0AAAAldEVY
|
||||||
|
dGRhdGU6bW9kaWZ5ADIwMjItMTItMjFUMDg6MTQ6MDIrMDA6MDA975bRAAAAAElFTkSuQmCC" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.4 KiB |
22
src/icons/svg/xihuan.svg
Normal file
22
src/icons/svg/xihuan.svg
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="28px" height="30px" viewBox="0 0 28 30" enable-background="new 0 0 28 30" xml:space="preserve"> <image id="image0" width="28" height="30" x="0" y="0"
|
||||||
|
href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABwAAAAeCAMAAAAIG46tAAAABGdBTUEAALGPC/xhBQAAACBjSFJN
|
||||||
|
AAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAABR1BMVEUAAACqu8Szv8WyvMOz
|
||||||
|
vcOzvcSyvcSyusCzs7+zu8GyvsOzvcS0v8W0vcK2wMe1v8W0vsP///+A//+zwMW1v8ayvMX/AP+z
|
||||||
|
vMO1v8a1wMeyvcSzvMS0wMe2wMe0vcL/AACzvsS2v8a/v8y0vcOzvcW1vcW1v8W0vsW0vcWyvcSy
|
||||||
|
vMSzvcWzvcSyvsazvMW2vcSzusSvv8+zvcOvv7+zvcK3wciqqv+zvcS0w8OzvMSzvsSwucGzvcW2
|
||||||
|
v7+xsbyzvcO2tsKzvcW1vcS/v7+zvcS0vsTExMSzvMOzvcSxxMS5udGyvMSyvMSiubmqqqqzvcOy
|
||||||
|
vMO2tra2ttuzvcS0vcSqqtW/v7+1vsaqqqqyvcOyvMS3wci0vsWzvcS1v8a4wsm2wMi2wMe0vsa0
|
||||||
|
v8a4w8q5w8q5xMu5w8u4wsq3wcm3wsm2wcj////YxNOMAAAAW3RSTlMAHnzV9/G2WRRat9R7aeDT
|
||||||
|
ZgICZdNqAXL8/aOh/fxwAVr4FNbWYGCxsdTUysqcnUlKENEQZfoDmxG/vR3AHBe8FbOyEK6tDael
|
||||||
|
DQujnwsJnpkHB5OPBgT9A6moIGUMhAAAAAFiS0dEEeK1PboAAAAHdElNRQfmDBUIEBGAn3uIAAAB
|
||||||
|
HUlEQVQoz2NgoAgwMjGzsLKxc4DYHJxcrCzcPIwwOV6+6JjY2Lg4fgFBIWGRuLjY2JhoPlGwlJi4
|
||||||
|
RHQsGMRLSknLxEPY0bJy8kBJBcW4WCiIiQYZAQFxigoMDErK8bFYQbyKEoNqQiwOkKjGoJ6ESzJZ
|
||||||
|
g0EzBpdkjBaDNm5JHQbdOFyScXoM+rglDRgMjVKwy6UYGTMwmJhitTXG1AQYQmbmqdgkU83NQIFr
|
||||||
|
YZmGKZduZQGJFWsbDGtTbGxhcWZnn46mz94OEdsOjhkoYe7kgJwWnF1S4G6OyXA1Rk0pbu6ZUNmY
|
||||||
|
aA9P9HTk5R0Plo3J8vHFTGV+/tlA2ZjEgEBsaTAoODEmJjEkFHsKDQsJDw8Jw5V+IyKjIijLAUQB
|
||||||
|
AJ4fqMMCTZgrAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTEyLTIxVDA4OjE2OjE3KzAwOjAw1tXR
|
||||||
|
aQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0xMi0yMVQwODoxNjoxNyswMDowMKeIadUAAAAASUVO
|
||||||
|
RK5CYII=" />
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.8 KiB |
6
src/icons/svg/xuexirenshu.svg
Normal file
6
src/icons/svg/xuexirenshu.svg
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="28px" height="32px" style="shape-rendering:geometricPrecision; text-rendering:geometricPrecision; image-rendering:optimizeQuality; fill-rule:evenodd; clip-rule:evenodd" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||||
|
<g><path style="opacity:0.925" fill="#b7c1c7" d="M 9.5,-0.5 C 12.1667,-0.5 14.8333,-0.5 17.5,-0.5C 19.463,2.51798 19.963,5.85132 19,9.5C 10,14.1667 6.33333,11.5 8,1.5C 8.71719,0.955796 9.21719,0.28913 9.5,-0.5 Z"/></g>
|
||||||
|
<g><path style="opacity:0.958" fill="#b3bdc4" d="M 16.5,31.5 C 14.5,31.5 12.5,31.5 10.5,31.5C 2.86207,31.0163 0.0287378,27.0163 2,19.5C 4.60857,15.278 8.44191,13.278 13.5,13.5C 23.0321,13.5293 26.8654,18.196 25,27.5C 22.4362,29.6243 19.6029,30.9576 16.5,31.5 Z"/></g>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 906 B |
@@ -6,6 +6,7 @@ import 'nprogress/nprogress.css'
|
|||||||
import { getToken } from '@/utils/token'
|
import { getToken } from '@/utils/token'
|
||||||
import { routers } from "@/data/pages"
|
import { routers } from "@/data/pages"
|
||||||
import watermark from './utils/warterMark.js'
|
import watermark from './utils/warterMark.js'
|
||||||
|
import testUser from './utils/testUsers.js'
|
||||||
import xpage from '@/utils/xpage'
|
import xpage from '@/utils/xpage'
|
||||||
|
|
||||||
NProgress.configure({ showSpinner: false })
|
NProgress.configure({ showSpinner: false })
|
||||||
@@ -37,6 +38,8 @@ router.beforeEach((to, from, next) => {
|
|||||||
if (!store.getters.init) {
|
if (!store.getters.init) {
|
||||||
// 判断当前控制台是否已拉取完数据
|
// 判断当前控制台是否已拉取完数据
|
||||||
store.dispatch('InitData').then(res => {
|
store.dispatch('InitData').then(res => {
|
||||||
|
//加载白名单信息
|
||||||
|
testUser.init();
|
||||||
//加载信息资源归属,系统分类信息
|
//加载信息资源归属,系统分类信息
|
||||||
store.dispatch('resOwner/loadResOwners');
|
store.dispatch('resOwner/loadResOwners');
|
||||||
store.dispatch('sysType/loadSysTypes');
|
store.dispatch('sysType/loadSysTypes');
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
import apiWhiteuser from '@/api/system/whiteuser'
|
||||||
/**测试人员名单*/
|
/**测试人员名单*/
|
||||||
|
|
||||||
const userCodes=[
|
const userCodes=[
|
||||||
'12345601',
|
'12345601',
|
||||||
'12345603',
|
'12345603',
|
||||||
@@ -8,40 +8,41 @@ const userCodes=[
|
|||||||
'10181457'
|
'10181457'
|
||||||
]
|
]
|
||||||
|
|
||||||
const userCodesPro=[
|
const init=function(){
|
||||||
'00004409',
|
let data=sessionStorage.getItem('whiteuser-session');
|
||||||
'boeutest',
|
if(!data){
|
||||||
'10181457'
|
apiWhiteuser.getList({}).then(rs=>{
|
||||||
]
|
if(rs.status==200){
|
||||||
|
if(rs.result && rs.result.length>0){
|
||||||
|
data = JSON.stringify(rs.result);
|
||||||
|
sessionStorage.setItem('whiteuser-session',data);
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
console.log('获取白名单错误:'+rs.message);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**是否是测试人员*/
|
/**是否是测试人员*/
|
||||||
const isTest=function(code){
|
const isTest= function(code){
|
||||||
var testUser=false;
|
let data=sessionStorage.getItem('whiteuser-session');
|
||||||
var mode=process.env.NODE_ENV;
|
var flag=false;
|
||||||
|
if(data){
|
||||||
if(mode=='testing' || mode=='development'){
|
var codes=JSON.parse(data);
|
||||||
userCodes.some(item=>{
|
flag=codes.some(item=>{
|
||||||
if(item===code){
|
return (item==code);
|
||||||
testUser=true;
|
|
||||||
return true;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}else if(mode=='preview' || mode=='production' ){
|
|
||||||
userCodesPro.some(item=>{
|
|
||||||
if(item===code){
|
|
||||||
testUser=true;
|
|
||||||
return true;
|
|
||||||
}else{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
}else{
|
||||||
|
//如果没有,就使用程序中写死的
|
||||||
|
flag=userCodes.some(item=>{
|
||||||
|
return (item==code);
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
return flag;
|
||||||
return testUser;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
init,
|
||||||
isTest
|
isTest
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -146,7 +146,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
<!-- <div style="margin-top: 10px" v-if="isUpload"><el-button type="primary" size="mini" @click="isUploadHandle()">选择文件并上传</el-button></div> -->
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
<file-upload dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
<file-upload scorm="zip" dir="files" :beforeMsg="needOrg" :showList="true" :value="imageShowUrl" :limit="5" @success="handleUploadSuccess" @remove="handleRemoveSuccess"></file-upload>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style="margin-top: 10px">
|
<div style="margin-top: 10px">
|
||||||
@@ -160,7 +160,7 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="duration" label="时长(秒)" width="100">
|
<el-table-column prop="duration" label="时长(秒)" width="100">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-input type="number" size="small" v-model="scope.row.duration"></el-input>
|
<el-input type="number" size="small" v-model="scope.row.minute"></el-input>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="可见性" width="100">
|
<el-table-column label="可见性" width="100">
|
||||||
@@ -190,7 +190,7 @@
|
|||||||
</el-dialog>
|
</el-dialog>
|
||||||
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
|
<el-dialog title="预览课件" :close-on-click-modal="false" width="800px" :visible.sync="coursewareShow" custom-class="g-dialog">
|
||||||
<div>
|
<div>
|
||||||
<div class="courseware-title">{{ fileInfo.fileName }}</div>
|
<div class="courseware-title">{{ fileInfo.name }}</div>
|
||||||
<div class="courseware-icon">
|
<div class="courseware-icon">
|
||||||
<div v-if="fileInfo.resType == 10" style="position: relative;">
|
<div v-if="fileInfo.resType == 10" style="position: relative;">
|
||||||
<videoPlayer
|
<videoPlayer
|
||||||
@@ -231,12 +231,13 @@
|
|||||||
<el-cascader v-model="projectOwnership1" :options="resOwnerListMap" :props="defaultProps" @change="handleChange"></el-cascader>
|
<el-cascader v-model="projectOwnership1" :options="resOwnerListMap" :props="defaultProps" @change="handleChange"></el-cascader>
|
||||||
</el-form-item> -->
|
</el-form-item> -->
|
||||||
<!-- <el-form-item label="编号">{{}}</el-form-item> -->
|
<!-- <el-form-item label="编号">{{}}</el-form-item> -->
|
||||||
|
<el-form-item label="资源归属">{{ form.orgName }}</el-form-item>
|
||||||
<el-form-item label="文件名称">{{ form.fileName }}</el-form-item>
|
<el-form-item label="文件名称">{{ form.fileName }}</el-form-item>
|
||||||
<el-form-item label="课件名称"><el-input v-model="form.name" maxlength="50" show-word-limit></el-input></el-form-item>
|
<el-form-item label="课件名称"><el-input v-model="form.name" maxlength="50" show-word-limit></el-input></el-form-item>
|
||||||
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
|
<el-form-item label="课件类型">{{ getType(form.resType) }}</el-form-item>
|
||||||
<el-form-item label="时长(分)">
|
<el-form-item label="时长(分)">
|
||||||
<!-- <el-input v-model="form.duration"></el-input> -->
|
<!-- <el-input v-model="form.duration"></el-input> -->
|
||||||
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.duration"></el-input>
|
<el-input type="number" placeholder="请输入数字" :maxlength="32" show-word-limit v-model="form.minute"></el-input>
|
||||||
<!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> -->
|
<!-- <el-input-number max="" v-model="form.duration" controls-position="right"></el-input-number> -->
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="可见性">
|
<el-form-item label="可见性">
|
||||||
@@ -255,7 +256,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import coueseFile from '../../api/modules/courseFile';
|
import coueseFile from '@/api/modules/courseFile';
|
||||||
import FileUpload from '@/components/FileUpload/index.vue';
|
import FileUpload from '@/components/FileUpload/index.vue';
|
||||||
import { getType, deepCopy, toContentType } from '../../utils/tools.js';
|
import { getType, deepCopy, toContentType } from '../../utils/tools.js';
|
||||||
import pdfPreview from '@/components/PdfPreview/index.vue';
|
import pdfPreview from '@/components/PdfPreview/index.vue';
|
||||||
@@ -263,6 +264,7 @@ import { mapGetters, mapActions } from 'vuex';
|
|||||||
import videoPlayer from '@/components/VideoPlayer/index.vue';
|
import videoPlayer from '@/components/VideoPlayer/index.vue';
|
||||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||||
import chooseOrg from '@/components/System/chooseOrg.vue';
|
import chooseOrg from '@/components/System/chooseOrg.vue';
|
||||||
|
import apiUserBasic from '@/api/boe/userbasic.js';
|
||||||
export default {
|
export default {
|
||||||
components: { FileUpload, pdfPreview, videoPlayer, audioPlayer,chooseOrg},
|
components: { FileUpload, pdfPreview, videoPlayer, audioPlayer,chooseOrg},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -305,10 +307,8 @@ export default {
|
|||||||
{ value: 10, label: '视频' },
|
{ value: 10, label: '视频' },
|
||||||
{ value: 20, label: '音频' },
|
{ value: 20, label: '音频' },
|
||||||
{ value: 30, label: '图片' },
|
{ value: 30, label: '图片' },
|
||||||
{ value: 40, label: '文档' }
|
{ value: 40, label: '文档' },
|
||||||
// { value: 41, label: "图文" },
|
{ value: 50, label: "scrom" }
|
||||||
// { value: 50, label: "scrom包" },
|
|
||||||
// { value: 90, label: "其他" }
|
|
||||||
],
|
],
|
||||||
form: {
|
form: {
|
||||||
id:'',
|
id:'',
|
||||||
@@ -363,7 +363,8 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.upload.orgId==this.userInfo.departId;
|
this.upload.orgId=this.userInfo.departId;
|
||||||
|
//console.log(this.upload.orgId,'this.upload.orgId')
|
||||||
if(this.upload.orgId){
|
if(this.upload.orgId){
|
||||||
apiUserBasic.getOrgInfo(this.upload.orgId).then(rs=>{
|
apiUserBasic.getOrgInfo(this.upload.orgId).then(rs=>{
|
||||||
if(rs.status==200){
|
if(rs.status==200){
|
||||||
@@ -532,6 +533,11 @@ export default {
|
|||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
result.device1 = true;
|
result.device1 = true;
|
||||||
result.device2 = true;
|
result.device2 = true;
|
||||||
|
result.minute='';
|
||||||
|
if(result.duration){
|
||||||
|
result.minute=Math.round(result.duration/60); //四舍五入
|
||||||
|
}
|
||||||
|
|
||||||
this.fileList.push(result);
|
this.fileList.push(result);
|
||||||
} else {
|
} else {
|
||||||
this.$message.error(error);
|
this.$message.error(error);
|
||||||
@@ -554,6 +560,11 @@ export default {
|
|||||||
} else if (item.device2 === true) {
|
} else if (item.device2 === true) {
|
||||||
item.device = 2;
|
item.device = 2;
|
||||||
}
|
}
|
||||||
|
//转化为秒
|
||||||
|
if(item.minute){
|
||||||
|
result.duration=parseFloat(result.minute)*60;
|
||||||
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
coueseFile.batchUpdate(this.fileList).then(rs => {
|
coueseFile.batchUpdate(this.fileList).then(rs => {
|
||||||
@@ -575,6 +586,9 @@ export default {
|
|||||||
this.params.pageIndex = this.page.pageIndex;
|
this.params.pageIndex = this.page.pageIndex;
|
||||||
const { result, error, status } = await coueseFile.pageList(this.params, this.page);
|
const { result, error, status } = await coueseFile.pageList(this.params, this.page);
|
||||||
if (status === 200) {
|
if (status === 200) {
|
||||||
|
result.list.forEach(item=>{
|
||||||
|
item.minute=Math.round(item.duration/60);//转化为分钟
|
||||||
|
})
|
||||||
this.tableData = result.list;
|
this.tableData = result.list;
|
||||||
this.page.count = result.count;
|
this.page.count = result.count;
|
||||||
this.page.pageSize = result.pageSize;
|
this.page.pageSize = result.pageSize;
|
||||||
@@ -588,22 +602,34 @@ export default {
|
|||||||
editFile(row) {
|
editFile(row) {
|
||||||
coueseFile.detail(row.id).then(res=>{
|
coueseFile.detail(row.id).then(res=>{
|
||||||
if(res.status == 200) {
|
if(res.status == 200) {
|
||||||
this.form = res.result;
|
this.form = res.result;
|
||||||
if (res.result.resOwner3 == '') {
|
if(this.form.duration){
|
||||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
this.form.minute=Math.round(res.result.duration/60);//转化为分钟
|
||||||
} else {
|
}else{
|
||||||
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
this.form.minute=0;
|
||||||
}
|
|
||||||
if (res.result.device === 1) {
|
|
||||||
this.form.device1 = true;
|
|
||||||
} else if (res.result.device === 2) {
|
|
||||||
this.form.device2 = true;
|
|
||||||
} else if (res.result.device === 3) {
|
|
||||||
this.form.device1 = true;
|
|
||||||
this.form.device2 = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
})
|
if (res.result.resOwner3 == '') {
|
||||||
|
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2];
|
||||||
|
} else {
|
||||||
|
this.projectOwnership1 = [res.result.resOwner1, res.result.resOwner2, res.result.resOwner3];
|
||||||
|
}
|
||||||
|
if (res.result.device === 1) {
|
||||||
|
this.form.device1 = true;
|
||||||
|
} else if (res.result.device === 2) {
|
||||||
|
this.form.device2 = true;
|
||||||
|
} else if (res.result.device === 3) {
|
||||||
|
this.form.device1 = true;
|
||||||
|
this.form.device2 = true;
|
||||||
|
}
|
||||||
|
if(!res.result.orgName && res.result.orgId){
|
||||||
|
apiUserBasic.getOrgInfo(res.result.orgId).then(rs=>{
|
||||||
|
if(rs.status==200){
|
||||||
|
this.form.orgName=rs.result.name;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
this.editCoursewareShow = true;
|
this.editCoursewareShow = true;
|
||||||
},
|
},
|
||||||
handleSizeChange(val) {
|
handleSizeChange(val) {
|
||||||
@@ -685,11 +711,11 @@ export default {
|
|||||||
//scorm课件的内容,取第一个sco
|
//scorm课件的内容,取第一个sco
|
||||||
var scorm=JSON.parse(row.content);
|
var scorm=JSON.parse(row.content);
|
||||||
//console.log(scorm,'scorm')
|
//console.log(scorm,'scorm')
|
||||||
if(scorm.index){
|
if(scorm){
|
||||||
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
|
//这里需要提取的到配置文件中,实际中只需要传 rowId就可以了
|
||||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
this.scormUrl=process.env.VUE_APP_SCORM_URL+'?mode=preview&scormId='+row.id;//播放的首页
|
||||||
}else{
|
}else{
|
||||||
this.scormUrl='http://localhost:9083/scorm-player?scormId='+row.id;//播放的首页
|
this.$message({type: 'error',message: 'SCORM包解析失败'});
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
25
src/views/study/StudyProject.vue
Normal file
25
src/views/study/StudyProject.vue
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
<template>
|
||||||
|
<!--学习项目-->
|
||||||
|
<div class="box">
|
||||||
|
<iframe id="studyPathFrame" src="/fe-student/projectManage" style="width: 100%;height: 800px;" frameborder="0"></iframe>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default{
|
||||||
|
mounted() {
|
||||||
|
const oIframe = document.getElementById('studyPathFrame');
|
||||||
|
//const deviceWidth = document.documentElement.clientWidth;
|
||||||
|
const deviceHeight = document.documentElement.clientHeight;
|
||||||
|
//oIframe.style.width = (Number(deviceWidth)-220) + 'px'; //数字是页面布局宽度差值
|
||||||
|
//oIframe.style.height = (Number(deviceHeight)-300) + 'px'; //数字是页面布局高度差
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss">
|
||||||
|
.box{
|
||||||
|
// width: 100%;
|
||||||
|
height: 100%;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -85,6 +85,9 @@
|
|||||||
<div v-if="resType == 41">
|
<div v-if="resType == 41">
|
||||||
<div style="padding: 20px;" v-html="contentData.content"></div>
|
<div style="padding: 20px;" v-html="contentData.content"></div>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="resType == 50" style="min-height: 500px;">
|
||||||
|
<iframe v-if="scormUrl" :src="scormUrl" frameborder="0" scrolling="no" border="0px" style="width:100%;height:500px;border:0px;overflow:hidden;"></iframe>
|
||||||
|
</div>
|
||||||
<div v-if="resType == 52">
|
<div v-if="resType == 52">
|
||||||
<div v-if="contentData.content != ''">
|
<div v-if="contentData.content != ''">
|
||||||
<div class="hyper-link" v-if="conLink.openType == 2">
|
<div class="hyper-link" v-if="conLink.openType == 2">
|
||||||
@@ -317,6 +320,7 @@
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cutOrgNamePath,
|
cutOrgNamePath,
|
||||||
|
scormUrl:'',//当前播放的scormUrl
|
||||||
loading:false,
|
loading:false,
|
||||||
controlHeight:400,//左边控制区域的内容高度
|
controlHeight:400,//左边控制区域的内容高度
|
||||||
timer: '',
|
timer: '',
|
||||||
@@ -436,9 +440,8 @@
|
|||||||
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
this.$router.push({path:this.$xpage.getHomePath(tea.teacherId)})
|
||||||
},
|
},
|
||||||
noteChange(){
|
noteChange(){
|
||||||
//视频点定位,直接到播放的视频位置
|
//视频点定位,直接到播放的视频位置
|
||||||
this.timer = new Date().getTime()
|
this.timer = new Date().getTime()
|
||||||
|
|
||||||
},
|
},
|
||||||
//非音视频课学习时长的增加,每一分钟保存一次
|
//非音视频课学习时长的增加,每一分钟保存一次
|
||||||
appendStudyOtherTime() {
|
appendStudyOtherTime() {
|
||||||
@@ -592,7 +595,25 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
// }
|
// }
|
||||||
} else if (r.contentType == 52) {
|
}else if(r.contentType==50){ //scorm
|
||||||
|
this.scormUrl='';
|
||||||
|
apiCourseFile.detail(r.contentRefId).then(cfrs => {
|
||||||
|
if(cfrs.status==200){
|
||||||
|
this.curCFile = cfrs.result;
|
||||||
|
//this.scormUrl=cfrs
|
||||||
|
let pars='?mode=normal&r='+Math.random();
|
||||||
|
pars+='&scormId='+this.curCFile.id;
|
||||||
|
pars+='&courseId='+this.courseId;
|
||||||
|
pars+='&contentId='+r.id;
|
||||||
|
pars+='&studentId='+this.userInfo.aid;
|
||||||
|
pars+='&studentName='+encodeURIComponent(this.userInfo.name);
|
||||||
|
pars+='&lmsId='+this.studyId;
|
||||||
|
pars+='&scoId=';//不指定,scorm模块自动根据学习记录定位
|
||||||
|
this.scormUrl=process.env.VUE_APP_SCORM_URL+pars;//播放的首页
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
}else if (r.contentType == 52) {
|
||||||
this.isAppendTime = false;
|
this.isAppendTime = false;
|
||||||
if (r.content.startsWith('\{')) {
|
if (r.content.startsWith('\{')) {
|
||||||
this.conLink = JSON.parse(r.content);
|
this.conLink = JSON.parse(r.content);
|
||||||
@@ -617,6 +638,7 @@
|
|||||||
if (this.contentData.status < 2) {
|
if (this.contentData.status < 2) {
|
||||||
this.contentData.status = 2; //进行中
|
this.contentData.status = 2; //进行中
|
||||||
}
|
}
|
||||||
|
//以下是学习记录
|
||||||
if (this.contentData.contentType > 20) { //非视频类的
|
if (this.contentData.contentType > 20) { //非视频类的
|
||||||
//用户的学习时长,非音视频课程学习,单独的处理
|
//用户的学习时长,非音视频课程学习,单独的处理
|
||||||
this.isAppendTime = false;
|
this.isAppendTime = false;
|
||||||
@@ -625,9 +647,15 @@
|
|||||||
$this.appendStudyOtherTime();
|
$this.appendStudyOtherTime();
|
||||||
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
}, 1000*60*2); //非音视频课程学习,2分钟后记录,因为一次记录是60秒
|
||||||
//this.appendStudyTime();
|
//this.appendStudyTime();
|
||||||
this.handleTimeout = setTimeout(function() {
|
if (this.contentData.contentType != 50) {
|
||||||
$this.saveStudyInfo();
|
this.handleTimeout = setTimeout(function(){
|
||||||
}, 5000); //5秒后记录学习完成
|
$this.saveStudyInfo();
|
||||||
|
}, 5000); //5秒后记录学习完成
|
||||||
|
}else{
|
||||||
|
//scorm课件不记录完成情况,由播放回调记录完成情况
|
||||||
|
//当前先保存学习记录,未学习状态
|
||||||
|
this.saveScormStudy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1229,6 +1257,34 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
saveScormStudy() {
|
||||||
|
//只记录SCORM课件的学习
|
||||||
|
if (this.contentData.contentType != 50) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (this.contentData.status == 9) {
|
||||||
|
//已学习完的,不会再记录
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
let params = {
|
||||||
|
studyId: this.studyId, //学习id,
|
||||||
|
courseId: this.courseId, //课程id,
|
||||||
|
contentId: this.contentData.id, //内容id,
|
||||||
|
contentType: this.contentData.contentType,
|
||||||
|
contentName: this.contentData.contentName, //内容名称
|
||||||
|
progress: 0,
|
||||||
|
status: 1,
|
||||||
|
contentTotal: this.totalContent
|
||||||
|
};
|
||||||
|
apiStudy.studyContent(params).then(res => {
|
||||||
|
if (res.status == 200) {
|
||||||
|
this.contentData.status = 2; //进行中
|
||||||
|
this.contentData.studyItemId = res.result; //学习记录id
|
||||||
|
} else {
|
||||||
|
console.log('记录学习失败:' + res.message + ',' + res.error);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
saveStudyInfo() {
|
saveStudyInfo() {
|
||||||
//记录课件学习信息
|
//记录课件学习信息
|
||||||
if (this.contentData.contentType >= 60) {
|
if (this.contentData.contentType >= 60) {
|
||||||
|
|||||||
@@ -24,22 +24,21 @@
|
|||||||
<div v-if="Edittearch">
|
<div v-if="Edittearch">
|
||||||
<div class="tearchimg">
|
<div class="tearchimg">
|
||||||
<h3>教师职业照</h3>
|
<h3>教师职业照</h3>
|
||||||
<img :src="BaseUrl + teachtext.photo" alt="">
|
<img :src="fileBaseUrl + teachform.photo" alt="">
|
||||||
</div>
|
</div>
|
||||||
<div class="tearchexperi">
|
<div class="tearchexperi">
|
||||||
<h3>工作经历</h3>
|
<h3>工作经历</h3>
|
||||||
<span>{{ teachtext.workExperience }}</span>
|
<span>{{ teachform.workExperience }}</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="teachphoto" style="height:70px">
|
<div class="tearchexperi" style="height:70px">
|
||||||
<h3>擅长课程</h3>
|
<h3>擅长课程</h3>
|
||||||
<div class="teachexcel">
|
<span>{{ teachform.courses }}</span>
|
||||||
{{ teachtext.courses }}
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="teachphoto" style="height:70px">
|
<div class="teachphoto" style="height:70px">
|
||||||
<h3>专长</h3>
|
<h3>专长</h3>
|
||||||
<div class="teachexcel">
|
<div v-for="(item,idx) in workname" :key="idx" class="teachexcel">
|
||||||
{{ teachtext.expertise }}
|
{{ item }}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
@@ -80,21 +79,12 @@
|
|||||||
<div class="tearchexperi">
|
<div class="tearchexperi">
|
||||||
<h3 >教师专长</h3>
|
<h3 >教师专长</h3>
|
||||||
<div style="float:left;margin-top:10px;">
|
<div style="float:left;margin-top:10px;">
|
||||||
<!-- <el-cascader
|
|
||||||
placeholder="请选择,最多可选择五个"
|
<div>
|
||||||
:options="options"
|
<div class="interest" v-for="(sys,index) in sysTypeListtear" :key="sys.id">
|
||||||
:props="props"
|
|
||||||
clearable></el-cascader> -->
|
|
||||||
<!-- <div class="interest" v-show="!interestIsEdit">
|
|
||||||
<ul class="interest-ul">
|
|
||||||
<li class="interest-li" v-for="int in interestList" :key="int.id">{{int.name}}</li>
|
|
||||||
</ul>
|
|
||||||
</div> -->
|
|
||||||
<div >
|
|
||||||
<div class="interest" v-for="(sys,index) in sysTypeListMap" :key="sys.id">
|
|
||||||
<span class="interest-title">{{sys.name}}</span>
|
<span class="interest-title">{{sys.name}}</span>
|
||||||
<div style="width:100%">
|
<div style="width:100%">
|
||||||
<el-checkbox-group v-model="checkboxGroup" v-if="sys.children.length > 0">
|
<el-checkbox-group v-model="checkboxtearGroup" v-if="sys.children.length > 0">
|
||||||
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
<el-checkbox size="medium" border v-for="ch in sys.children" :label="ch.id" :key="ch.id">{{ch.name}}</el-checkbox>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</div>
|
</div>
|
||||||
@@ -106,7 +96,7 @@
|
|||||||
<div>
|
<div>
|
||||||
<div style="text-align: center;margin-top:56px">
|
<div style="text-align: center;margin-top:56px">
|
||||||
<el-button @click="Edittearch = true">取消</el-button>
|
<el-button @click="Edittearch = true">取消</el-button>
|
||||||
<el-button type="primary" @click="teacherUpdata">保存</el-button>
|
<el-button type="primary" @click="teacherUpdata()">保存</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -297,6 +287,8 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
return {
|
return {
|
||||||
|
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||||
|
sysTypeListtear:[],
|
||||||
teaechswich:false,
|
teaechswich:false,
|
||||||
props: { multiple: true },
|
props: { multiple: true },
|
||||||
options: [{
|
options: [{
|
||||||
@@ -357,11 +349,13 @@
|
|||||||
hideHome:false,// 是否隐藏个人主页
|
hideHome:false,// 是否隐藏个人主页
|
||||||
cities: cityOptions,
|
cities: cityOptions,
|
||||||
checkboxGroup: [],
|
checkboxGroup: [],
|
||||||
|
checkboxtearGroup: [],
|
||||||
radio: '1',
|
radio: '1',
|
||||||
form:{
|
form:{
|
||||||
account:{}
|
account:{}
|
||||||
},
|
},
|
||||||
teachform:{
|
teachform:{
|
||||||
|
id:'',
|
||||||
photo:'',
|
photo:'',
|
||||||
courses:'',//擅长课程
|
courses:'',//擅长课程
|
||||||
workExperience:'', //工作经历
|
workExperience:'', //工作经历
|
||||||
@@ -383,6 +377,8 @@
|
|||||||
sysTypeListMap:[],
|
sysTypeListMap:[],
|
||||||
interestList:[],//已有兴趣爱好列表
|
interestList:[],//已有兴趣爱好列表
|
||||||
interestIsEdit:false,
|
interestIsEdit:false,
|
||||||
|
childData:[],
|
||||||
|
workname:[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
@@ -415,10 +411,14 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
Edittearch(){
|
||||||
|
this.gettearch();
|
||||||
|
},
|
||||||
// 监听"编辑按钮"事件变化
|
// 监听"编辑按钮"事件变化
|
||||||
interestIsEdit(){
|
interestIsEdit(){
|
||||||
this.load();
|
this.load();
|
||||||
this.getInfo();
|
this.getInfo();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -430,21 +430,39 @@
|
|||||||
this.hideHome = !this.userInfo.showHome;
|
this.hideHome = !this.userInfo.showHome;
|
||||||
this.load();
|
this.load();
|
||||||
this.getInfo();
|
this.getInfo();
|
||||||
|
this.gettearch();
|
||||||
this.getSysTypeTree().then(rs => {
|
this.getSysTypeTree().then(rs => {
|
||||||
this.sysTypeListMap = rs;
|
this.sysTypeListMap = rs;
|
||||||
|
// console.log(rs);
|
||||||
|
this.sysTypeListtear = rs;
|
||||||
});
|
});
|
||||||
this.Teacherprofile();
|
this.Teacherprofile();
|
||||||
this.Teacherinfo();
|
this.Teacherinfo();
|
||||||
},
|
},
|
||||||
methods:{
|
methods:{
|
||||||
teacherUpdata(){
|
gettearch(){
|
||||||
apiTeach.update(this.teachform).then(res =>{
|
// console.log(this.checkboxtearGroup,'lmj');
|
||||||
console.log('编辑成功')
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
Teacherinfo(){
|
Teacherinfo(){
|
||||||
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
|
apiTeach.detailTeacher(this.userInfo.aid).then(res =>{
|
||||||
this.teachtext = res.result;
|
this.teachform.courses = res.result.courses;
|
||||||
|
this.teachform.workExperience = res.result.workExperience;
|
||||||
|
this.tearchUrl = this.fileBaseUrl + res.result.photo;
|
||||||
|
this.teachform.expertise = res.result.expertise.split( ',' );
|
||||||
|
this.sysTypeListtear.forEach(nm =>{
|
||||||
|
nm.children.forEach(lk =>{
|
||||||
|
this.childData.push(lk);
|
||||||
|
})
|
||||||
|
})
|
||||||
|
this.teachform.expertise.forEach(item =>{
|
||||||
|
this.childData.forEach(it =>{
|
||||||
|
if(item == it.id){
|
||||||
|
this.workname.push(it.name);
|
||||||
|
console.log(this.workname)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
Teacherprofile(){
|
Teacherprofile(){
|
||||||
@@ -516,6 +534,7 @@
|
|||||||
this.checkboxGroup.push(item.refId);
|
this.checkboxGroup.push(item.refId);
|
||||||
item.name = this.sysTypeName(item.refId)
|
item.name = this.sysTypeName(item.refId)
|
||||||
})
|
})
|
||||||
|
// console.log(res.result);
|
||||||
this.interestList = res.result;
|
this.interestList = res.result;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -525,6 +544,23 @@
|
|||||||
return this.sysTypeMap.get(code);
|
return this.sysTypeMap.get(code);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
teacherUpdata(){
|
||||||
|
if(this.checkboxtearGroup.length <3 && this.checkboxtearGroup.length>=1) {
|
||||||
|
this.$message.error('至少选择三个专长!')
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
console.log(this.checkboxtearGroup);
|
||||||
|
this.teachform.expertise = this.checkboxtearGroup.toString();
|
||||||
|
console.log(this.teachform.expertise);
|
||||||
|
this.teachform.id = this.userInfo.aid;
|
||||||
|
apiTeach.updateTeacher(this.teachform).then(res =>{
|
||||||
|
console.log('编辑成功')
|
||||||
|
})
|
||||||
|
this.Edittearch = true;
|
||||||
|
this.Teacherinfo();
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
// 更新用户与偏好数据
|
// 更新用户与偏好数据
|
||||||
saveHobby(){
|
saveHobby(){
|
||||||
let data = []
|
let data = []
|
||||||
@@ -677,6 +713,7 @@
|
|||||||
height: 40px;
|
height: 40px;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
h4{
|
h4{
|
||||||
|
cursor: pointer;
|
||||||
float: left;
|
float: left;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user