|
|
|
@ -168,6 +168,7 @@ export default { |
|
|
|
|
courseId: "", |
|
|
|
|
// projectId: "", |
|
|
|
|
assessmentId: "", |
|
|
|
|
classId:'', |
|
|
|
|
projectPermissions: 0, //项目权限(0、练习 1、考核 2、竞赛) |
|
|
|
|
isSubmit: false, |
|
|
|
|
entryTime: util.formatDate('yyyy-MM-dd hh:mm:ss'), |
|
|
|
@ -240,11 +241,22 @@ export default { |
|
|
|
|
let cid = this.getQueryVariable('cid') |
|
|
|
|
let systemId = this.getQueryVariable('systemId') |
|
|
|
|
let projectId = this.getQueryVariable('projectId') |
|
|
|
|
let assessmentId = this.getQueryVariable('assessmentId') |
|
|
|
|
let classId = this.getQueryVariable('classId') |
|
|
|
|
if (token != null){ |
|
|
|
|
sessionStorage.setItem('token', token) |
|
|
|
|
sessionStorage.setItem('cid', cid) |
|
|
|
|
sessionStorage.setItem('systemId', systemId) |
|
|
|
|
} |
|
|
|
|
if (projectId){ |
|
|
|
|
sessionStorage.setItem('projectId', projectId) |
|
|
|
|
sessionStorage.setItem('assessmentId', assessmentId) |
|
|
|
|
sessionStorage.setItem('classId', classId) |
|
|
|
|
this.assessmentId = assessmentId |
|
|
|
|
this.classId = classId |
|
|
|
|
}else{ |
|
|
|
|
this.assessmentId = '' |
|
|
|
|
this.classId = '' |
|
|
|
|
} |
|
|
|
|
let tokens = sessionStorage.getItem('token') |
|
|
|
|
if(tokens || token){ |
|
|
|
@ -277,11 +289,29 @@ export default { |
|
|
|
|
//获取项目列表 |
|
|
|
|
getData(){ |
|
|
|
|
let params = { |
|
|
|
|
systemId:sessionStorage.getItem('systemId'), |
|
|
|
|
"systemId":sessionStorage.getItem('systemId'), |
|
|
|
|
"cId":sessionStorage.getItem('cid'), |
|
|
|
|
"permissions":0, |
|
|
|
|
} |
|
|
|
|
getProjectBySystemId(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
//获取当前时间 |
|
|
|
|
this.getBeginTime() |
|
|
|
|
this.topicList = [] |
|
|
|
|
for (var i=0;i<data.data.projects.length;i++){ |
|
|
|
|
if (data.data.projects[i].projectId){ |
|
|
|
|
this.topicList.push(data.data.projects[i]) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if(this.topicList.length > 0){ |
|
|
|
|
this.gotuQueryVariable() |
|
|
|
|
} |
|
|
|
|
this.getQueryCaches() |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
getBeginTime(){ |
|
|
|
|
let dates = new Date().getTime(); |
|
|
|
|
let date = new Date(dates) |
|
|
|
|
let y = date.getFullYear(); |
|
|
|
@ -295,17 +325,10 @@ export default { |
|
|
|
|
m = m < 10 ? ('0' + m) : m; |
|
|
|
|
let s = date.getSeconds(); |
|
|
|
|
s = s < 10 ? ('0' + s) : s; |
|
|
|
|
let startTime = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; |
|
|
|
|
sessionStorage.setItem('startTime', startTime) |
|
|
|
|
this.topicList = data.data.projects; |
|
|
|
|
if(this.topicList.length > 0){ |
|
|
|
|
let projectId = this.getQueryVariable('projectId') |
|
|
|
|
if(projectId){ |
|
|
|
|
this.projectId = projectId |
|
|
|
|
}else{ |
|
|
|
|
this.projectId = this.topicList[0].projectId; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.startTime = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; |
|
|
|
|
sessionStorage.setItem('startTime', this.startTime) |
|
|
|
|
}, |
|
|
|
|
getQueryCaches(){ |
|
|
|
|
getQueryCache(params).then((data)=>{ |
|
|
|
|
if(data.data.status == 200){ |
|
|
|
|
this.$confirm('有项目未做完,是否回到未做完的项目?', '提示', { |
|
|
|
@ -330,21 +353,17 @@ export default { |
|
|
|
|
message: '已取消' |
|
|
|
|
}); |
|
|
|
|
}).catch(() => { |
|
|
|
|
|
|
|
|
|
}) |
|
|
|
|
let projectId = this.getQueryVariable('projectId') |
|
|
|
|
if(projectId){ |
|
|
|
|
this.projectId = projectId |
|
|
|
|
}else{ |
|
|
|
|
this.projectId = this.topicList[0].projectId; |
|
|
|
|
} |
|
|
|
|
sessionStorage.setItem('projectId', this.projectId) |
|
|
|
|
let params = { |
|
|
|
|
"projectId":this.projectId, |
|
|
|
|
} |
|
|
|
|
this.selectProjects(params) |
|
|
|
|
this.gotuQueryVariable() |
|
|
|
|
}); |
|
|
|
|
}else{ |
|
|
|
|
this.gotuQueryVariable() |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
this.gotuQueryVariable() |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
gotuQueryVariable(){ |
|
|
|
|
let projectId = this.getQueryVariable('projectId') |
|
|
|
|
if(projectId){ |
|
|
|
|
this.projectId = projectId |
|
|
|
@ -356,47 +375,24 @@ export default { |
|
|
|
|
"projectId":this.projectId, |
|
|
|
|
} |
|
|
|
|
this.selectProjects(params) |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
//获取当前时间 |
|
|
|
|
}, |
|
|
|
|
selectProjects(params){ |
|
|
|
|
getProjectDetail(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
this.globalTimer = ""; |
|
|
|
|
this.countVal = ""; |
|
|
|
|
this.day = "00"; |
|
|
|
|
this.seconds = "00"; |
|
|
|
|
this.minutes = "00"; |
|
|
|
|
this.hour = "00"; |
|
|
|
|
// this.getClearTime(); |
|
|
|
|
this.sss = 1 |
|
|
|
|
this.startCountFn(); |
|
|
|
|
} |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
selectProjects(params){ |
|
|
|
|
getProjectDetail(params).then((data)=>{ |
|
|
|
|
if(data.status == 200){ |
|
|
|
|
let projectId = this.getQueryVariable('projectId') |
|
|
|
|
if(projectId != null){ |
|
|
|
|
let dates = new Date().getTime(); |
|
|
|
|
let date = new Date(dates) |
|
|
|
|
let y = date.getFullYear(); |
|
|
|
|
let MM = date.getMonth() + 1; |
|
|
|
|
MM = MM < 10 ? ('0' + MM) : MM; |
|
|
|
|
let d = date.getDate(); |
|
|
|
|
d = d < 10 ? ('0' + d) : d; |
|
|
|
|
let h = date.getHours(); |
|
|
|
|
h = h < 10 ? ('0' + h) : h; |
|
|
|
|
let m = date.getMinutes(); |
|
|
|
|
m = m < 10 ? ('0' + m) : m; |
|
|
|
|
let s = date.getSeconds(); |
|
|
|
|
s = s < 10 ? ('0' + s) : s; |
|
|
|
|
let startTime = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; |
|
|
|
|
sessionStorage.setItem('startTime', startTime) |
|
|
|
|
//获取当前时间 |
|
|
|
|
this.getBeginTime() |
|
|
|
|
this.topicList = [data.data.projectManage]; |
|
|
|
|
this.projectId = +params.projectId |
|
|
|
|
console.log(this.projectId) |
|
|
|
|
console.log(this.topicList) |
|
|
|
|
this.projectName = data.data.projectManage.projectName |
|
|
|
|
this.projectManage = data.data.projectManage; |
|
|
|
|
this.requires = data.data.projectJudgmentVos; |
|
|
|
@ -430,34 +426,18 @@ export default { |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
}) |
|
|
|
|
//获取当前时间 |
|
|
|
|
let dates = new Date().getTime(); |
|
|
|
|
let date = new Date(dates) |
|
|
|
|
let y = date.getFullYear(); |
|
|
|
|
let MM = date.getMonth() + 1; |
|
|
|
|
MM = MM < 10 ? ('0' + MM) : MM; |
|
|
|
|
let d = date.getDate(); |
|
|
|
|
d = d < 10 ? ('0' + d) : d; |
|
|
|
|
let h = date.getHours(); |
|
|
|
|
h = h < 10 ? ('0' + h) : h; |
|
|
|
|
let m = date.getMinutes(); |
|
|
|
|
m = m < 10 ? ('0' + m) : m; |
|
|
|
|
let s = date.getSeconds(); |
|
|
|
|
s = s < 10 ? ('0' + s) : s; |
|
|
|
|
let startTime = y + '-' + MM + '-' + d + ' ' + h + ':' + m + ':' + s; |
|
|
|
|
sessionStorage.setItem('startTime', startTime) |
|
|
|
|
this.getBeginTime() |
|
|
|
|
this.globalTimer = ""; |
|
|
|
|
this.countVal = ""; |
|
|
|
|
this.day = "00"; |
|
|
|
|
this.seconds = "00"; |
|
|
|
|
this.minutes = "00"; |
|
|
|
|
this.hour = "00"; |
|
|
|
|
// this.getClearTime(); |
|
|
|
|
this.sss = 1 |
|
|
|
|
this.startCountFn(); |
|
|
|
|
}, |
|
|
|
|
//提交 |
|
|
|
|
Submit() { |
|
|
|
|
// if(!this.codeIds.length) return this.$message.error('请先完成实验') |
|
|
|
|
this.$confirm("此操作将视为结束考试, 是否继续?", "提示", { |
|
|
|
|
confirmButtonText: "确定", |
|
|
|
|
cancelButtonText: "取消", |
|
|
|
@ -475,6 +455,8 @@ export default { |
|
|
|
|
let systemId = sessionStorage.getItem('systemId') |
|
|
|
|
let cid = sessionStorage.getItem('cid') |
|
|
|
|
let params = { |
|
|
|
|
"assessmentId":this.assessmentId, |
|
|
|
|
"classId":this.classId, |
|
|
|
|
"curriculumId":+cid, |
|
|
|
|
"endTime": this.actEndTime, |
|
|
|
|
"lcId": lcld, |
|
|
|
@ -507,11 +489,6 @@ export default { |
|
|
|
|
} |
|
|
|
|
this.sss = 0; |
|
|
|
|
this.popContainer = true; |
|
|
|
|
// this.countVal = ""; |
|
|
|
|
// this.day = "00"; |
|
|
|
|
// this.seconds = "00"; |
|
|
|
|
// this.minutes = "00"; |
|
|
|
|
// this.hour = "00"; |
|
|
|
|
this.$message({ |
|
|
|
|
type: 'success', |
|
|
|
|
message: '提交成功' |
|
|
|
@ -522,7 +499,6 @@ export default { |
|
|
|
|
}).catch((error)=>{ |
|
|
|
|
this.loading = false |
|
|
|
|
}) |
|
|
|
|
// this.getClearTime(); |
|
|
|
|
}).catch(() => { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "info", |
|
|
|
@ -541,7 +517,6 @@ export default { |
|
|
|
|
}else{ |
|
|
|
|
this.counterFn(this.countVal++); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
}, 1000); |
|
|
|
|
this.isStart = true; |
|
|
|
|
} |
|
|
|
@ -590,13 +565,7 @@ export default { |
|
|
|
|
this.grade = '00' |
|
|
|
|
location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId |
|
|
|
|
// location.href = "http://192.168.31.254:8093/#/index/list?"+'token='+token+'&cid='+cid+'&systemId='+systemId |
|
|
|
|
|
|
|
|
|
// this.getClearTime() |
|
|
|
|
}, |
|
|
|
|
// 清除时间 |
|
|
|
|
// getClearTime() { |
|
|
|
|
// |
|
|
|
|
// }, |
|
|
|
|
checkVer() { |
|
|
|
|
let data = { |
|
|
|
|
userId: this.userId, |
|
|
|
@ -605,7 +574,6 @@ export default { |
|
|
|
|
this.$get(this.api.qualifications,data).then(res => { |
|
|
|
|
if(res.message == 'false'){ |
|
|
|
|
this.isSubmit = true; |
|
|
|
|
// newmain.$emit("isSubmit", this.isSubmit); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
@ -616,12 +584,6 @@ export default { |
|
|
|
|
toggleCase() { |
|
|
|
|
this.caseVisible = !this.caseVisible |
|
|
|
|
}, |
|
|
|
|
// getProjects(){ |
|
|
|
|
// let data = { |
|
|
|
|
// systemId: this.systemId, |
|
|
|
|
// schoolId: '' |
|
|
|
|
// } |
|
|
|
|
// }, |
|
|
|
|
collapse(){ |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
@ -632,13 +594,11 @@ export default { |
|
|
|
|
//获取cookie中指定key的value |
|
|
|
|
var allcookies = document.cookie; //索引长度,开始索引的位置 |
|
|
|
|
var cookie_pos = allcookies.indexOf(cookie_name); // 如果找到了索引,就代表cookie存在,否则不存在 |
|
|
|
|
|
|
|
|
|
if (cookie_pos != -1) { |
|
|
|
|
// 把cookie_pos放在值的开始,只要给值加1即可 |
|
|
|
|
//计算取cookie值得开始索引,加的1为“=” |
|
|
|
|
cookie_pos = cookie_pos + cookie_name.length + 1; //计算取cookie值得结束索引 |
|
|
|
|
var cookie_end = allcookies.indexOf(";", cookie_pos); |
|
|
|
|
|
|
|
|
|
if (cookie_end == -1) { |
|
|
|
|
cookie_end = allcookies.length; |
|
|
|
|
} //得到想要的cookie的值 |
|
|
|
|