From f29ed318e24b4ca15ffc826f856ba2a23344ada4 Mon Sep 17 00:00:00 2001 From: e <2432808546@qq.com> Date: Fri, 10 Dec 2021 17:25:10 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=9F=9F=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.js | 4 +- src/components/case/index.vue | 192 ++++++++++++-------------- src/layouts/header/index.vue | 8 +- src/pages/lobbyManager/list/index.vue | 10 +- 4 files changed, 98 insertions(+), 116 deletions(-) diff --git a/src/api/api.js b/src/api/api.js index 60da40a..290e485 100644 --- a/src/api/api.js +++ b/src/api/api.js @@ -2,8 +2,8 @@ import axios from 'axios'; import router from '../router'; // 创建axios实例 const service = axios.create({ - // baseURL: "http://www.huorantech.cn:9000",//线上 - baseURL: "http://39.108.250.202:9000/", // 中台测试服 + baseURL: "http://www.huorantech.cn:9000",//线上 + // baseURL: "http://39.108.250.202:9000/", // 中台测试服 // baseURL: "http://192.168.31.137:9000/", // 赓 // baseURL: "http://192.168.31.151:9000/", // 榕 // baseURL: "http://192.168.31.125:9000/", // 坤 diff --git a/src/components/case/index.vue b/src/components/case/index.vue index 787dec2..f86af18 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -5,7 +5,7 @@

实训项目

- +
- + 重新开始 提交 @@ -80,7 +81,7 @@ > - + @@ -187,62 +188,32 @@ export default { } }, created() { - const test = this.getQueryVariable('test') - if(test) { - // 获取老师新加的项目 - setInterval(() => { - let params = { - "systemId":sessionStorage.getItem('systemId'), - "cId":sessionStorage.getItem('cid'), - "permissions":0, - } - getProjectBySystemId(params).then((data)=>{ - if(data.status == 200){ - if(this.topicList.length !== data.data.projects.length) { - this.topicList = data.data.projects - if(!this.topicList.some(item => item.projectId===this.projectId)) { - this.selectProjects({projectId: this.topicList[0].projectId}) - } - } - } - }).catch((error)=>{ - }) - }, 10000) - }else { - if(process.env.NODE_ENV === "development") { - this.intervalJudge = setInterval(() => { - const data = { - id: parseInt(sessionStorage.getItem('assessmentId')), - token: parseInt(sessionStorage.getItem('token')) - } - checkTest(data).then(data => { - const { data: { data: { status } } } = data - if(status !== 1) { - this.popContainer = true - clearInterval(this.intervalJudge) - this.sureSubmit(false) - }else { - } - }) - }, 4000) + let assessmentId = this.getQueryVariable('assessmentId') + sessionStorage.setItem('assessmentId',assessmentId) + this.assessmentId = assessmentId + if(assessmentId == '' || assessmentId == null || assessmentId == 'null') { + }else { this.intervalJudge = setInterval(() => { - const data = { - id: parseInt(sessionStorage.getItem('assessmentId')), - token: parseInt(sessionStorage.getItem('token')) - } - checkTest(data).then(data => { - const { data: { data: { status } } } = data - if(status !== 1) { - this.popContainer = true - clearInterval(this.intervalJudge) - // 提交 - this.sureSubmit(false) - }else { + const data = { + id: parseInt(sessionStorage.getItem('assessmentId')), } - }) + checkTest(data).then(data => { + const { data: { data: { status } } } = data + if(status !== 1) { + this.popContainer = true + clearInterval(this.intervalJudge) + this.$confirm('考试已结束,已自动为您提交。', '提示', { + confirmButtonText: '确定', + type: 'info', + center: true + }) + // 提交 + this.sureSubmit(false) + }else { + } + }) }, 4000) - } } }, watch: { @@ -318,23 +289,24 @@ export default { sessionStorage.setItem('classId', classId) this.assessmentId = assessmentId this.classId = classId + console.log() } let tokens = sessionStorage.getItem('token') - if(this.getQueryVariable('test')) { - let params = { - "systemId":sessionStorage.getItem('systemId'), - "cId":sessionStorage.getItem('cid'), - "permissions":0, - } - getProjectBySystemId(params).then((data)=>{ - if(data.status == 200){ - //获取当前时间 - this.topicList = data.data.projects - this.selectProjects({projectId: this.topicList[0].projectId}) - } - }).catch((error)=>{ - }) - }else { + // if(this.getQueryVariable('projectId')) { + // let params = { + // "systemId":sessionStorage.getItem('systemId'), + // "cId":sessionStorage.getItem('cid'), + // "permissions":0, + // } + // getProjectBySystemId(params).then((data)=>{ + // if(data.status == 200){ + // //获取当前时间 + // this.topicList = data.data.projects + // this.selectProjects({projectId: this.topicList[0].projectId}) + // } + // }).catch((error)=>{ + // }) + // }else { if(tokens || token){ this.projectPermissions = this.projectId ? 1 : 0 this.assessmentId && this.projectId && this.checkVer() @@ -348,7 +320,7 @@ export default { this.getData() } } - } + // } }, methods: { getQueryVariable(name) { @@ -469,16 +441,18 @@ export default { this.hintOpen = data.data.projectManage.hintOpen; this.countDown(timestamp); let projectId = this.getQueryVariable('projectId') - if(projectId != null){ + if(projectId != null && projectId != '' && projectId != 'null'){ //获取当前时间 this.getBeginTime() - // this.topicList = [data.data.projectManage]; + this.topicList = [data.data.projectManage]; this.projectId = +params.projectId this.projectName = data.data.projectManage.projectName + this.projectId = data.data.projectManage.projectId; this.projectManage = data.data.projectManage; this.requires = data.data.projectJudgmentVos; }else{ this.projectName = data.data.projectManage.projectName + this.projectId = data.data.projectManage.projectId; this.projectManage = data.data.projectManage; this.requires = data.data.projectJudgmentVos; } @@ -504,18 +478,15 @@ export default { let cid = sessionStorage.getItem('cid') let systemId = sessionStorage.getItem('systemId') this.projectName = data.data.projectManage.projectName; + this.projectId = data.data.projectManage.projectId; + console.log() this.projectManage = data.data.projectManage; this.requires = data.data.projectJudgmentVos; //线上 - + location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId //测试服 // location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId //本地 - if(process.env.NODE_ENV === "development") { - location.href = "http://192.168.31.254:8093/#/index/list?"+'token='+token+'&cid='+cid+'&systemId='+systemId - }else { - location.href = 'http://www.huorantech.cn/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 } }).catch((error)=>{ @@ -532,23 +503,35 @@ export default { this.startCountFn(); }, //提交 - Submit(judge=true) { - this.$confirm("此操作将视为结束考试, 是否继续?", "提示", { - confirmButtonText: "确定", - cancelButtonText: "取消", - type: "warning", - center: true - }).then(() => { - this.sureSubmit() - }).catch(() => { - this.$message({ - type: "info", - message: "已取消提交" + Submit() { + this.$confirm('此操作将视为结束考试, 是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + console.log('=====') + this.sureSubmit(true) + }).catch(() => { + this.$message({ + type: "info", + message: "已取消提交" + }); }); - }); - + // this.$confirm("此操作将视为结束考试, 是否继续?", "提示", { + // confirmButtonText: '确定', + // cancelButtonText: '取消', + // type: "warning", + // center: true + // }).then(() => { + // this.sureSubmit(true) + // }).catch(() => { + // this.$message({ + // type: "info", + // message: "已取消提交" + // }); + // }); }, - sureSubmit(judge=true){ + sureSubmit(judge){ this.actEndTime = new Date().getTime(); let ruleReqs = sessionStorage.getItem('ruleReqs') let startTime = sessionStorage.getItem('startTime') @@ -573,6 +556,7 @@ export default { "submitTime": this.actEndTime, "systemId": systemId, } + console.log(params) this.loading = true; submit(params).then((data)=>{ if(data.status == 200){ @@ -587,7 +571,7 @@ export default { for (var i=0;i 9 ? m : `0${m}`}`; this.seconds = `${s > 9 ? s : `0${s}`}`; } else { - this.$alert('考核结束,已自动交卷', '提示', { + this.$confirm('考试已结束,已自动为您提交。', '提示', { confirmButtonText: '确定', - callback: action => { - - } - }); + type: 'info', + center: true + }) this.sss = 0 - this.sureSubmit() + this.sureSubmit(true) this.day = '00'; this.hour = '00'; this.minutes = '00'; @@ -713,9 +695,9 @@ export default { this.hour = "00"; this.grade = '00' //线上 - // location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId + location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId //测试服 - location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId + // 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 }, diff --git a/src/layouts/header/index.vue b/src/layouts/header/index.vue index 4d7f84e..2f3c9eb 100644 --- a/src/layouts/header/index.vue +++ b/src/layouts/header/index.vue @@ -35,12 +35,12 @@ export default { exit(){ let assessmentId = sessionStorage.getItem('assessmentId') if (assessmentId != 'null' && assessmentId != null && assessmentId != ''){ - window.location = 'http://39.108.250.202/student/#/ass/list' - // window.location = 'http://www.occupationlab.com/#/station/list' + // window.location = 'http://39.108.250.202/student/#/ass/list' + window.location = 'http://www.occupationlab.com/#/ass/list' }else{ let cid = sessionStorage.getItem('cid') - window.location = 'http://39.108.250.202/student/#/station/preview?courseId='+cid+'&curriculumName=银行项目' - // window.location = 'http://www.occupationlab.com/#/station/preview?courseId='+cid+'&curriculumName=银行项目' + // window.location = 'http://39.108.250.202/student/#/station/preview?courseId='+cid+'&curriculumName=银行项目' + window.location = 'http://www.occupationlab.com/#/station/preview?courseId='+cid+'&curriculumName=银行项目' } }, }, diff --git a/src/pages/lobbyManager/list/index.vue b/src/pages/lobbyManager/list/index.vue index ff16114..9c15b91 100644 --- a/src/pages/lobbyManager/list/index.vue +++ b/src/pages/lobbyManager/list/index.vue @@ -180,17 +180,17 @@ export default { let classId = sessionStorage.getItem('classId') if (projectId){ //线上 - // location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId+'&projectId='+projectId+'&assessmentId='+assessmentId+'&classId='+classId + location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId+'&projectId='+projectId+'&assessmentId='+assessmentId+'&classId='+classId //测试服 - location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId+'&projectId='+projectId+'&assessmentId='+assessmentId+'&classId='+classId + // location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId+'&projectId='+projectId+'&assessmentId='+assessmentId+'&classId='+classId //本地 // location.href = "http://192.168.31.254:8093/#/index/list?"+'token='+token+'&cid='+cid+'&systemId='+systemId+'&projectId='+projectId+'&assessmentId='+assessmentId+'&classId='+classId }else{ //线上 - // location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId + location.href = 'http://www.huorantech.cn/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId //测试服 - location.href = 'http://39.108.250.202/banksystem/#/index/list?'+'token='+token+'&cid='+cid+'&systemId='+systemId - //本地 + // 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 } },