From da2f00496a12d0e55964967bcc77278427773933 Mon Sep 17 00:00:00 2001 From: "luoJunYong.123" Date: Wed, 8 Dec 2021 11:34:22 +0800 Subject: [PATCH] youhua --- src/components/case/index.vue | 79 +++++++++++++++++++++++++++++++---- 1 file changed, 72 insertions(+), 7 deletions(-) diff --git a/src/components/case/index.vue b/src/components/case/index.vue index 75d58cb..cc65b80 100644 --- a/src/components/case/index.vue +++ b/src/components/case/index.vue @@ -191,14 +191,76 @@ export default { sessionStorage.setItem('assessmentId', assessmentId) sessionStorage.setItem('token', token) if(process.env.NODE_ENV === "development") { + this.intervalJudge = setInterval(() => { + const data = { + id: parseInt(sessionStorage.getItem('assessmentId')), + token: parseInt(sessionStorage.getItem('token')) + } + // 获取教师端最新项目 + let params = { + "systemId":sessionStorage.getItem('systemId'), + "cId":sessionStorage.getItem('cid'), + "permissions":0, + } + getProjectBySystemId(params).then((data)=>{ + if(data.status == 200){ + //获取当前时间 + if(data.data.projects.length !== this.topicList.length) { + this.topicList = data.data.projects + this.selectProjects({ + projectId: this.topicList[0].projectId + }) + + if(this.topicList.length > 0){ + this.gotuQueryVariable() + } + this.getQueryCaches() + } + } + }).catch((error)=>{ + }) + + checkTest(data).then(data => { + const { data: { data: { status } } } = data + if(status !== 1) { + this.popContainer = true + clearInterval(this.intervalJudge) + this.$message({ + showClose: true, + message: '考核已结束', + type: 'success' + }); + }else { + } + }) + }, 4000) }else { this.intervalJudge = setInterval(() => { const data = { id: parseInt(sessionStorage.getItem('assessmentId')), token: parseInt(sessionStorage.getItem('token')) } - this.getData() + // 获取教师端最新项目 + let params = { + "systemId":sessionStorage.getItem('systemId'), + "cId":sessionStorage.getItem('cid'), + "permissions":0, + } + getProjectBySystemId(params).then((data)=>{ + if(data.status == 200){ + //获取当前时间 + this.getBeginTime() + if(data.data.projects.length !== this.topicList.length) { + this.topicList = data.data.projects + + this.gotuQueryVariable() + } + } + }).catch((error)=>{ + }) + + checkTest(data).then(data => { const { data: { data: { status } } } = data if(status !== 1) { @@ -324,20 +386,23 @@ export default { "permissions":0, } getProjectBySystemId(params).then((data)=>{ - console.log('---topicList') - console.log(data) if(data.status == 200){ - console.log(data.data.projects) //获取当前时间 this.getBeginTime() this.topicList = [] + for (var i=0;i 0){ + this.selectProjects({ + projectId: this.topicList[0].projectId + }) this.gotuQueryVariable() + // 加的 } this.getQueryCaches() } @@ -423,7 +488,7 @@ export default { if(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.projectManage = data.data.projectManage; @@ -460,9 +525,9 @@ export default { //线上 // 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 + location.href = "http://192.168.31.254:8093/#/index/list?"+'token='+token+'&cid='+cid+'&systemId='+systemId } }).catch((error)=>{ })