mirror of
https://codeup.aliyun.com/67762337eccfc218f6110e0e/vue/learning-system-portal.git
synced 2025-12-11 03:46:44 +08:00
先提交一下
This commit is contained in:
@@ -14,7 +14,7 @@ VUE_APP_BOE_WEB_URL = 'https://u.boe.com'
|
||||
VUE_APP_BOE_MOBILE_URL = 'http://192.168.0.10:8082/mobile'
|
||||
|
||||
# File路径的基础url
|
||||
VUE_APP_FILE_BASE_URL = 'http://localhost:9090/cdn/upload'
|
||||
VUE_APP_FILE_BASE_URL = 'http://192.168.0.10:9090/cdn/upload'
|
||||
|
||||
# 登录地址
|
||||
VUE_APP_LOGIN_URL='/pc/login'
|
||||
|
||||
30349
package-lock.json
generated
Normal file
30349
package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load Diff
@@ -162,7 +162,14 @@
|
||||
</audio> -->
|
||||
</div>
|
||||
<div v-if="coursewareInfo.content.contentType == 40">
|
||||
<pdfPreview :filePath="fileBaseUrl+contentData.content"></pdfPreview>
|
||||
<div style="padding: 10px;color: #767676;text-align: center;line-height: 40px; " v-if="converStatus < 2">
|
||||
<div>文档文件转化中,还未转化完成,</div>
|
||||
<div >上传时间:{{curCFile.sysCreateTime}}</div>
|
||||
</div>
|
||||
<div style="padding: 10px;color: #767676;color: #ff0000;text-align: center;" v-if="converStatus == 3">
|
||||
文件转化失败,请重新上传(不要上传加密的文件)或联系管理员
|
||||
</div>
|
||||
<pdfPreview :filePath="fileBaseUrl+coursewareInfo.content.content"></pdfPreview>
|
||||
</div>
|
||||
<div v-if="coursewareInfo.content.contentType == 41">
|
||||
<div class="picture-text" v-html="coursewareInfo.content.content"></div>
|
||||
@@ -229,6 +236,7 @@ import WxEditor from "@/components/Editor/index.vue";
|
||||
import apiTag from "../../api/modules/tag.js";
|
||||
import videoPlayer from "@/components/VideoPlayer/index.vue";
|
||||
import audioPlayer from "@/components/AudioPlayer/index.vue";
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
import { mapGetters, mapActions } from "vuex";
|
||||
// import hyperLink from '@/components/Course/hyperLink.vue';
|
||||
export default {
|
||||
@@ -271,6 +279,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
converStatus:4,
|
||||
courseType: courseType,
|
||||
isEdit: true,
|
||||
homeworkInfo: {},
|
||||
@@ -278,6 +287,7 @@ export default {
|
||||
assessInfo: {},
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
btnLoading: false,
|
||||
curCFile:{},//课件内容
|
||||
coursewareInfo: {
|
||||
content: {},
|
||||
finish: false,
|
||||
@@ -577,13 +587,26 @@ export default {
|
||||
$this.coursewareInfo.content.contentType == 20
|
||||
) {
|
||||
if (con.content.startsWith("{")) {
|
||||
this.curriculumData = JSON.parse(con.content);
|
||||
$this.curriculumData = JSON.parse(con.content);
|
||||
} else {
|
||||
this.curriculumData.url = con.content;
|
||||
$this.curriculumData.url = con.content;
|
||||
}
|
||||
}
|
||||
if ($this.coursewareInfo.content.contentType == 40) {
|
||||
let url = this.fileBaseUrl + r.content;
|
||||
if($this.coursewareInfo.content.contentType == 40) {
|
||||
//console.log(con.content,'con.content');
|
||||
if(con.content != '' && con.content.indexOf('.pdf') > -1) {
|
||||
$this.coursewareInfo.content.content = con.content;
|
||||
}else {
|
||||
apiCourseFile.detail(con.contentRefId).then(cfrs => {
|
||||
if (cfrs.status == 200) {
|
||||
$this.curCFile=cfrs.result;
|
||||
$this.converStatus = cfrs.result.converStatus;
|
||||
$this.coursewareInfo.content.content = cfrs.result.previewFilePath;
|
||||
} else {
|
||||
$this.$message.error('加载pdf课件文件失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
} else if (con.sortIndex == 2) {
|
||||
$this.homeworkInfo = con;
|
||||
|
||||
@@ -175,7 +175,14 @@
|
||||
</audio> -->
|
||||
</div>
|
||||
<div v-if="contentData.contentType == 40">
|
||||
<pdfPreview :filePath="fileBaseUrl+contentData.content"></pdfPreview>
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus < 2">
|
||||
<div>文档文件转化中,还未转化完成,</div>
|
||||
<div>上传时间:{{curCFile.sysCreateTime}}</div>
|
||||
</div>
|
||||
<div style="padding: 10px;color: #767676;color: #ff0000;" v-if="converStatus == 3">
|
||||
文件转化失败,请重新上传(不要上传加密的文件)或联系管理员
|
||||
</div>
|
||||
<pdfPreview v-if="contentData.content" :filePath="fileBaseUrl+contentData.content"></pdfPreview>
|
||||
</div>
|
||||
<div v-if="contentData.contentType == 41">
|
||||
<div class="picture-text" v-html="contentData.content"></div>
|
||||
@@ -269,6 +276,7 @@ import videoPlayer from '@/components/VideoPlayer/index.vue';
|
||||
import audioPlayer from '@/components/AudioPlayer/index.vue';
|
||||
import { mapGetters,mapActions} from 'vuex';
|
||||
import hyperLink from '@/components/Course/hyperLink.vue';
|
||||
import apiCourseFile from '../../api/modules/courseFile.js';
|
||||
export default {
|
||||
name:"auditCourse2",
|
||||
components: {
|
||||
@@ -307,6 +315,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
converStatus:4,
|
||||
curriculumData:{
|
||||
url:'',
|
||||
isDrag:false,
|
||||
@@ -316,6 +325,7 @@ export default {
|
||||
isEdit: true,
|
||||
fileBaseUrl: process.env.VUE_APP_FILE_BASE_URL,
|
||||
contentData: {},
|
||||
curCFile:{},//课件内容
|
||||
getType: getType,
|
||||
btnLoading: false,
|
||||
teacherName: [],
|
||||
@@ -638,6 +648,23 @@ export default {
|
||||
}else{
|
||||
this.curriculumData.url = r.content
|
||||
}
|
||||
} else if(r.contentType == 40) {
|
||||
this.contentData.content="";
|
||||
if (r.content != '' && r.content.indexOf('.pdf') > -1) {
|
||||
this.contentData.content = cfrs.result.previewFilePath;
|
||||
}else{
|
||||
apiCourseFile.detail(r.contentRefId).then(cfrs => {
|
||||
if (cfrs.status == 200) {
|
||||
this.curCFile=cfrs.result;
|
||||
this.converStatus = cfrs.result.converStatus;
|
||||
this.contentData.content = cfrs.result.previewFilePath;
|
||||
//console.log(r.content);
|
||||
}else {
|
||||
this.contentData.content="";
|
||||
this.$message.error('加载pdf课件文件失败');
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
this.type = 0;
|
||||
},
|
||||
|
||||
@@ -85,7 +85,14 @@
|
||||
<div v-if="content.contentType==30">
|
||||
<el-image :src="fileBaseUrl+content.content" fit="fill"></el-image>
|
||||
</div>
|
||||
<div v-if="content.contentType==40">
|
||||
<div v-if="content.contentType==40" style="text-align: center;">
|
||||
<div style="padding: 10px;color: #767676; " v-if="converStatus < 2">
|
||||
<div>文档文件转化中,还未转化完成,</div>
|
||||
<div>上传时间:{{curCFile.sysCreateTime}}</div>
|
||||
</div>
|
||||
<div style="padding: 10px;color: #767676;color: #ff0000;" v-if="converStatus == 3">
|
||||
<div>文件转化失败,请重新上传(不要上传加密的文件),请联系管理员</div>
|
||||
</div>
|
||||
<pdfPreview v-if="content.contentType==40 && curPdfPath!=''" :filePath="fileBaseUrl+curPdfPath"></pdfPreview>
|
||||
</div>
|
||||
</div>
|
||||
@@ -353,8 +360,10 @@
|
||||
// inject: [ "informationDetails" ],
|
||||
data(){
|
||||
return {
|
||||
converStatus:4,
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
curPdfPath:'',
|
||||
curCFile:{},//当前课件的内容
|
||||
comTypes:[
|
||||
//文件类型,10视频,20音频,30图片, 40 文档,41表图文,50表scrom包,90表其它
|
||||
//图文41,连接52,作业60,考试61,评估62
|
||||
@@ -469,6 +478,7 @@
|
||||
this.linkInfo.url='';
|
||||
this.htmlContent='';
|
||||
this.curPdfPath='';
|
||||
this.curCFile={};
|
||||
this.exam.contentId='';
|
||||
this.exam.paperContent='';
|
||||
this.exam.info='';
|
||||
@@ -488,20 +498,15 @@
|
||||
},
|
||||
loadPdfFile(){
|
||||
//检查当前是否是pdf,如果是pdf那么就不需要再查询一次了
|
||||
|
||||
let fname=this.content.content;
|
||||
|
||||
if(fname && fname.indexOf('.pdf')>-1){
|
||||
this.curPdfPath=this.content.content;
|
||||
}else{
|
||||
apiCourseFile.detail(this.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
if(rs.result.previewFilePath){
|
||||
this.curCFile=rs.result;
|
||||
this.converStatus = rs.result.converStatus;
|
||||
this.curPdfPath=rs.result.previewFilePath;
|
||||
}else{
|
||||
this.curPdfPath=rs.result.filePath;
|
||||
}
|
||||
//console.log(this.curPdfPath,'this.curPdfPath');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
</el-upload>
|
||||
</div>
|
||||
<div v-else style="text-align: center;">
|
||||
<div style="padding: 20px;">{{courseFile.fileName}}</div>
|
||||
<div style="padding: 20px;">{{courseFile.fileName}} <span style="color: green;">上传成功</span></div>
|
||||
<div><el-button @click="chooseCourseFile(courseFile)" type="primary" size="mini">确定</el-button></div>
|
||||
</div>
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
<div v-else>
|
||||
|
||||
<div style="text-align: center;">
|
||||
|
||||
<!--展示内容区域-->
|
||||
<!--视频-->
|
||||
<div v-if="cware.content.contentType==10">
|
||||
@@ -101,15 +100,21 @@
|
||||
<el-image :src="fileBaseUrl+cware.content.content" fit="fill"></el-image>
|
||||
</div>
|
||||
<div v-if="cware.content.contentType==40">
|
||||
<div style="text-align: center;padding-top: 20px;" v-if="courseFileShow">
|
||||
<div style="padding: 20px;">{{cware.content.contentName}}</div>
|
||||
<el-button @click="loadPdfFile();" type="primary">保存</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div style="padding: 10px;color: #767676; ">如果pdf无法显示,请稍后再试,文档转化是异步处理,有可能是文档还未转化完成 </div>
|
||||
<pdfPreview v-if="cware.content.contentType == 40" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||
</div>
|
||||
|
||||
<div style="text-align: center;padding-top: 20px;" v-if="courseFileShow">
|
||||
<div style="padding: 20px;line-height: 40px;">
|
||||
{{cware.content.contentName}} <span style="color: green;">上传成功</span>
|
||||
<br/> 系统正对文件进行转化,您可以继续操作</div>
|
||||
<el-button @click="loadPdfFile();" type="primary">确定</el-button>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div style="padding: 10px;color: #767676;line-height:40px; " v-if="converStatus < 2">
|
||||
<div>文档文件转化中,还未转化完成,</div> <div >上传时间:{{curCFile.sysCreateTime}}</div>
|
||||
</div>
|
||||
<div style="padding: 10px;color: #767676;color: #ff0000; " v-if="converStatus == 3">
|
||||
<div>文件转化失败,请重新上传(不要上传加密的文件),请联系管理员</div>
|
||||
</div>
|
||||
<pdfPreview v-if="cware.content.contentType == 40 && cware.content.pdfPath!=''" :filePath="fileBaseUrl+cware.content.pdfPath"></pdfPreview>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -553,8 +558,10 @@
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
converStatus:4,
|
||||
courseFileShow:false,
|
||||
curContent:{id:'',contentType:0,contenRefId:''},
|
||||
curCFile:{},//当前课件的内容
|
||||
fileBaseUrl:process.env.VUE_APP_FILE_BASE_URL,
|
||||
imageShowUrl: '',
|
||||
activeName: 'courseware',
|
||||
@@ -655,50 +662,13 @@
|
||||
},
|
||||
course(newVal,oldVal){
|
||||
//
|
||||
if(this.contents.length>0){
|
||||
let $this=this;
|
||||
this.contents.forEach(con=>{
|
||||
if(con.sortIndex==1){
|
||||
$this.cware.content=con;
|
||||
$this.cware.show=2;
|
||||
//对于pdf文件的问题处理
|
||||
if(con.contentType==40 && con.content.indexOf('.pdf')==-1){
|
||||
$this.loadPdfFile();
|
||||
}
|
||||
if(con.contentType==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
$this.cware.linkInfo=JSON.parse(con.content);
|
||||
}else{
|
||||
$this.cware.linkInfo.url=con.content;
|
||||
}
|
||||
}
|
||||
if(con.contentType==10 || con.contentType==20){
|
||||
if(con.content.startsWith('\{')){
|
||||
$this.cware.curriculumData=JSON.parse(con.content);
|
||||
}else{
|
||||
$this.cware.curriculumData.url=con.content;
|
||||
}
|
||||
}
|
||||
}else if(con.sortIndex==2){
|
||||
$this.homework.content=con;
|
||||
//查询作业信息,并显示
|
||||
$this.loadHomeworkInfo();
|
||||
}else if(con.sortIndex==3){
|
||||
$this.exam.content=con;
|
||||
//查询考试信息并显示
|
||||
$this.loadExamInfo();
|
||||
}else if(con.sortIndex==4){
|
||||
$this.assess.content=con;
|
||||
//转化文本为json内容
|
||||
$this.loadAssessInfo();
|
||||
}
|
||||
})
|
||||
}
|
||||
this.changeContents();
|
||||
}
|
||||
},
|
||||
methods:{
|
||||
init(){
|
||||
this.activeName='courseware';
|
||||
this.curCFile={},//当前课件的内容
|
||||
this.cware.content={id:'',contentType:0,sortIndex:1,contentRefId:'',pdfPath:''};
|
||||
this.cware.show=1;
|
||||
this.homework.content={id:'',contentType:60,sortIndex:2};
|
||||
@@ -714,6 +684,49 @@
|
||||
this.assess.show=1;
|
||||
this.hasCWare.keyword='';
|
||||
this.hasCWare.list=[];
|
||||
this.changeContents();
|
||||
},
|
||||
changeContents(){
|
||||
if(this.contents.length>0){
|
||||
let $this=this;
|
||||
this.contents.forEach(con=>{
|
||||
if(con.sortIndex==1){
|
||||
$this.cware.content=con;
|
||||
$this.cware.show=2;
|
||||
//对于pdf文件的问题处理
|
||||
if(con.contentType==40){
|
||||
//console.log('加载pdf文件内容');
|
||||
$this.loadPdfFile();
|
||||
}
|
||||
if(con.contentType==52){
|
||||
if(con.content.startsWith('\{')){
|
||||
$this.cware.linkInfo=JSON.parse(con.content);
|
||||
}else{
|
||||
$this.cware.linkInfo.url=con.content;
|
||||
}
|
||||
}
|
||||
if(con.contentType==10 || con.contentType==20){
|
||||
if(con.content.startsWith('\{')){
|
||||
$this.cware.curriculumData=JSON.parse(con.content);
|
||||
}else{
|
||||
$this.cware.curriculumData.url=con.content;
|
||||
}
|
||||
}
|
||||
}else if(con.sortIndex==2){
|
||||
$this.homework.content=con;
|
||||
//查询作业信息,并显示
|
||||
$this.loadHomeworkInfo();
|
||||
}else if(con.sortIndex==3){
|
||||
$this.exam.content=con;
|
||||
//查询考试信息并显示
|
||||
$this.loadExamInfo();
|
||||
}else if(con.sortIndex==4){
|
||||
$this.assess.content=con;
|
||||
//转化文本为json内容
|
||||
$this.loadAssessInfo();
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
loadPdfFile(){
|
||||
//检查当前是否是pdf,如果是pdf那么就不需要再查询一次了
|
||||
@@ -724,8 +737,11 @@
|
||||
}else{
|
||||
apiCourseFile.detail(this.cware.content.contentRefId).then(rs=>{
|
||||
if(rs.status==200){
|
||||
this.curCFile=rs.result;
|
||||
this.converStatus = rs.result.converStatus;
|
||||
this.courseFileShow = false;
|
||||
this.cware.content.pdfPath=rs.result.previewFilePath;
|
||||
this.$forceUpdate();
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -944,10 +960,6 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
// 调用pdf详情接口
|
||||
getPPtDetail(){
|
||||
this.loadPdfFile();
|
||||
},
|
||||
deleteContent(index){
|
||||
let $this=this;
|
||||
let postData={
|
||||
@@ -1032,7 +1044,7 @@
|
||||
}else if(ctype==30){
|
||||
return ["jpg","png","gif"]
|
||||
}else if(ctype==40){
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx"]
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx","pdf"]
|
||||
}else{
|
||||
return ["doc", "xls", "ppt","docx", "xlsx", "pptx","jpg","png","gif","mp3","mp4"]
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
<el-input v-show="!hideSearch" placeholder="请输入关键词搜索" style="width: 260px;" @keyup.enter.native="searchJump()" clearable maxlength="20" v-model="keyword" class="input-with-select">
|
||||
<el-select v-if="current == 'index'" v-model="findType" style="width: 75px;" slot="prepend" placeholder="请选择">
|
||||
<el-option label="课程" value="1"></el-option>
|
||||
<el-option label="案例" value="2"></el-option>
|
||||
<!-- <el-option label="案例" value="2"></el-option> -->
|
||||
<el-option label="文章" value="3"></el-option>
|
||||
<el-option label="问答" value="4"></el-option>
|
||||
<!-- <el-option label="专区" value="5"></el-option> -->
|
||||
|
||||
@@ -74,7 +74,7 @@ export function toContentType(fileType) {
|
||||
// }
|
||||
export function courseType(type) {
|
||||
const maps = {
|
||||
10: '微课',
|
||||
10: '录播课',
|
||||
21: '在线课(直播)',
|
||||
20: '录播课',
|
||||
30: '线下课',
|
||||
|
||||
@@ -366,21 +366,37 @@ export default {
|
||||
let course = {
|
||||
pageSize: num,
|
||||
device:1,
|
||||
orderField: orderType == 1 ? 'id' : 'studys',
|
||||
orderField: orderType == 1 ? '' : 'studys',
|
||||
orderAsc: false,
|
||||
topOrder:true,
|
||||
pageIndex: pageIndex
|
||||
};
|
||||
let isTopList = [];
|
||||
let data = [];
|
||||
apiCoursePortal.pageList(course).then(res => {
|
||||
|
||||
if (res.status == 200 && res.result.list.length > 0) {
|
||||
|
||||
let courseIds = [];
|
||||
res.result.list.forEach(item => {
|
||||
item.authorInfo = { aid: '', name: '', orgInfo: '', avatar: '', code: '' ,sex:null};
|
||||
courseIds.push(item.id);
|
||||
console.log(item.isTop)
|
||||
if(item.isTop) {
|
||||
isTopList.push(item);
|
||||
console.log(isTopList)
|
||||
|
||||
}else{
|
||||
data.push(item);
|
||||
// console.log(data)
|
||||
}
|
||||
});
|
||||
this.loadCouserTeacher(res.result.list, courseIds);
|
||||
this.courseList.list = res.result.list;
|
||||
this.courseList.list.push(...isTopList,...data);
|
||||
this.couname = res.result.list.name;
|
||||
|
||||
|
||||
|
||||
if (res.result.count - pageIndex * num < 8) {
|
||||
this.pageIndex = 0;
|
||||
}
|
||||
@@ -389,8 +405,10 @@ export default {
|
||||
} else {
|
||||
console.log('加载课程信息失败:' + res.error);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
// apiCourse.list({orderType,num,device:1}).then(res => {
|
||||
// if(res.status==200){
|
||||
// if(res.result.length>0){
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<el-option label="未发布" :value="false"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div style="width:376px">
|
||||
<div style="width:390px">
|
||||
<el-button type="primary" @click="searchData()" icon="el-icon-search" >搜索</el-button>
|
||||
<el-button icon="el-icon-refresh-right" type="primary" style="margin-left:5px" @click="reset">重置</el-button>
|
||||
</div>
|
||||
@@ -402,12 +402,15 @@ export default {
|
||||
},
|
||||
// 置顶
|
||||
setTop(row) {
|
||||
let params = {
|
||||
let params = {
|
||||
ids: row.id,//课程id,多个使用逗号分隔,
|
||||
title:row.name,//课程的名称,
|
||||
top:!row.isTop,// top 是否置顶}
|
||||
}
|
||||
this.$confirm('此操作将置顶此课程, 是否继续?', '提示', {
|
||||
console.log(row.isTop);
|
||||
if(row.isTop == false){
|
||||
// console.log('fa')
|
||||
this.$confirm('此操作将置顶此课程, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
@@ -426,9 +429,38 @@ export default {
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '已取消删除'
|
||||
message: '置顶失败'
|
||||
});
|
||||
});
|
||||
}else if(row.isTop == true){
|
||||
this.$confirm('此操作将取消置顶此课程, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
apiCourse.setTop(params).then(res=>{
|
||||
if(res.status === 200 && res.result === true) {
|
||||
this.$message.success('取消成功!')
|
||||
this.searchData();
|
||||
} else {
|
||||
this.$message({
|
||||
type: 'error',
|
||||
message: res.message
|
||||
});
|
||||
}
|
||||
})
|
||||
}).catch(() => {
|
||||
this.$message({
|
||||
type: 'info',
|
||||
message: '取消置顶失败'
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
},
|
||||
// 复制
|
||||
|
||||
@@ -331,12 +331,16 @@ export default {
|
||||
getAnswerDetail(id) { //获取答卷的详细信息
|
||||
apiTestPaper.getAnswerDetail(id).then(res=>{
|
||||
if(res.status === 200) {
|
||||
let answerJson = JSON.parse(res.result.answerJson);
|
||||
let paperJson = JSON.parse(res.result.paperJson);
|
||||
let answerJson = [];
|
||||
answerJson=JSON.parse(res.result.answerJson);
|
||||
let paperJson = [];
|
||||
paperJson=JSON.parse(res.result.paperJson);
|
||||
let answer = [];
|
||||
let data = [];
|
||||
for(let key in answerJson){
|
||||
answer.push(key);
|
||||
paperJson.forEach((item,index) => {
|
||||
item.result=true;
|
||||
if(item.id == key) {
|
||||
if(item.type==1){
|
||||
item.userAnswer='';
|
||||
@@ -345,9 +349,8 @@ export default {
|
||||
}else{
|
||||
item.userAnswer=''
|
||||
}
|
||||
item.correctOptIdxs=[];
|
||||
item.userOptIdxs=[];
|
||||
|
||||
item.correctOptIdxs=[];
|
||||
item.userOptIdxs=[];
|
||||
if(item.type==1){
|
||||
item.userAnswer=answerJson[key];
|
||||
}else if(item.type==2){
|
||||
@@ -355,12 +358,12 @@ export default {
|
||||
}else{
|
||||
item.userAnswer=answerJson[key]
|
||||
}
|
||||
data.push(item);
|
||||
// item.userAnswer.push(answerJson[key]);
|
||||
}
|
||||
item.result=true;
|
||||
});
|
||||
}
|
||||
this.paperDetailData = paperJson;
|
||||
this.paperDetailData = data;
|
||||
this.paperDetailData.forEach((item,index)=>{
|
||||
if(item.type ==3) {
|
||||
item.correctOptIdxs.push(item.answer);
|
||||
@@ -521,7 +524,6 @@ export default {
|
||||
total+=item.defaultScore;
|
||||
}
|
||||
}
|
||||
//console.log(item,"judge item");
|
||||
});
|
||||
}
|
||||
if(this.single.length > 0){
|
||||
@@ -531,7 +533,6 @@ export default {
|
||||
total+=item.defaultScore;
|
||||
}
|
||||
})
|
||||
//console.log(item,"single item");
|
||||
});
|
||||
}
|
||||
if(this.multiple.length > 0){
|
||||
@@ -552,7 +553,6 @@ export default {
|
||||
}
|
||||
let str1=item.userAnswer.join();
|
||||
let str2=tempAnswer.join();
|
||||
//console.log(str1,str2,'aaa');
|
||||
if(str1==str2){
|
||||
total+=item.defaultScore;
|
||||
}
|
||||
@@ -570,11 +570,9 @@ export default {
|
||||
//设置已答题内容
|
||||
this.paperQuestion.forEach((qitem,index) => {
|
||||
let avalue=answerJson[qitem.id];
|
||||
//console.log(avalue,'avalue')
|
||||
if(avalue){
|
||||
if(qitem.type==1){ //单选
|
||||
qitem.userAnswer=avalue;
|
||||
//console.log(qitem,avalue,'单选qitem')
|
||||
}else if(qitem.type==2){ //多选
|
||||
qitem.userAnswer=avalue.split(',');
|
||||
}else if(qitem.type==3){ //判断
|
||||
@@ -582,7 +580,6 @@ export default {
|
||||
}
|
||||
}
|
||||
});
|
||||
//console.log(this.paperQuestion,'this.paperQuestion')
|
||||
this.arrangeQuestion();
|
||||
this.splitQuestionType();
|
||||
//进入考试阶段
|
||||
@@ -684,7 +681,6 @@ export default {
|
||||
if(this.updateAnswerTimeer!=null){
|
||||
window.clearInterval(this.updateAnswerTimeer)
|
||||
}
|
||||
//console.log("启动自动保存");
|
||||
let that = this;
|
||||
this.updateAnswerTimeer =window.setInterval(function(){
|
||||
that.updateAnswer();
|
||||
@@ -704,7 +700,6 @@ export default {
|
||||
judgeUserAnswer = item.userAnswer + "";
|
||||
}
|
||||
answer[item.id] = judgeUserAnswer;
|
||||
// console.log(answer[item.id],'1111')
|
||||
});
|
||||
}
|
||||
if(this.single.length > 0){
|
||||
@@ -729,7 +724,6 @@ export default {
|
||||
},
|
||||
//自动保存提交答案
|
||||
updateAnswer:function(){
|
||||
//console.log("自动保存答案");
|
||||
if(!this.aloneExamAnswerId){
|
||||
this.saveUserTest();
|
||||
return;
|
||||
@@ -750,7 +744,6 @@ export default {
|
||||
// 人工提交
|
||||
manualSubmit(){
|
||||
// let tempScore=this.countScore();
|
||||
// console.log(tempScore,"最后得分");
|
||||
let that = this;
|
||||
this.$confirm('您确定要提交试卷吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
|
||||
@@ -450,6 +450,8 @@ export default {
|
||||
this.paper.data = [];
|
||||
this.resOwner = [];
|
||||
this.formTab = 'info';
|
||||
this.totalScore=0;
|
||||
this.paperLength=0;
|
||||
this.question.list =[];
|
||||
this.question.checkQuest = [];
|
||||
},
|
||||
|
||||
@@ -113,7 +113,7 @@ module.exports = {
|
||||
proxy: {
|
||||
'/systemapi': {
|
||||
// 目标代理服务器地址
|
||||
target: 'http://127.0.0.1:9090',
|
||||
target: 'http://192.168.0.10:9090',
|
||||
changeOrigin: true,
|
||||
logLevel:'debug',
|
||||
secure: false,
|
||||
|
||||
Reference in New Issue
Block a user