跳转python,查询多系统项目

20240205
yujialong 2 years ago
parent 2336946c0b
commit 09c86a6394
  1. 72
      src/components/case/index.vue

@ -149,6 +149,7 @@
</template>
<script>
import Cookie from 'js-cookie'
import util from '@/libs/util'
import Setting from '@/setting'
//
@ -337,10 +338,10 @@ export default {
}
let tokens = sessionStorage.getItem('token')
if(tokens || token){
this.projectPermissions = this.projectId ? 1 : 0
this.projectPermissions = this.assessmentId ? 1 : 0
this.assessmentId && this.projectId && this.checkVer()
this.codeId && this.codeIds.push(this.codeId)
if (projectId !=null && projectId != '' && projectId !='null'){
if (assessmentId !=null && assessmentId != '' && assessmentId !='null'){
let params = {
"projectId":projectId,
}
@ -447,20 +448,6 @@ export default {
console.log('---this.topicList')
console.log(this.topicList)
if(this.topicList.length > 0){
// const projectIndex = JSON.parse(sessionStorage.getItem('projectIndex'))
// const projectId = sessionStorage.getItem('projectId')
// console.log('---projectId')
// console.log(projectId)
// if(!projectId) {
// this.selectProjects({
// projectId: this.topicList[0].projectId
// })
// // localStorage.setItem('projectId')
// }else {
// this.selectProjects({
// projectId: projectId
// })
// }
const storeProjectId = sessionStorage.getItem('storeProjectId')
if(storeProjectId) {
this.selectProjects({
@ -471,9 +458,6 @@ export default {
projectId: this.topicList[0].projectId
})
}
this.gotuQueryVariable()
//
}
@ -557,8 +541,6 @@ export default {
selectProjects(params){
getProjectDetail(params).then((data)=>{
if(data.status == 200){
this.globalTimer = "";
let stopTime = sessionStorage.getItem('timestamp')
let timestamp = +stopTime;
@ -566,8 +548,8 @@ export default {
this.sss = 1;
this.hintOpen = data.data.projectManage.hintOpen;
this.countDown(timestamp);
let projectId = this.getQueryVariable('projectId')
if(projectId != null && projectId != '' && projectId != 'null'){
let assessmentId = this.getQueryVariable('assessmentId')
if(assessmentId != null && assessmentId != '' && assessmentId != 'null'){
//
this.getBeginTime()
this.topicList = [data.data.projectManage];
@ -590,31 +572,10 @@ export default {
selectProject(){
this.lockIt = false
this.$router.push('/index/list')
//
// this.lockIt = false
// let token = sessionStorage.getItem('token')
// let cid = sessionStorage.getItem('cid')
// let systemId = sessionStorage.getItem('systemId')
// let projectId = sessionStorage.getItem('projectId')
// sessionStorage.clear()
// sessionStorage.setItem('token', token)
// sessionStorage.setItem('cid', cid)
// sessionStorage.setItem('systemId', systemId)
// sessionStorage.setItem('projectId', projectId)
// this.topicList[localProjectIndex].projectId
// localStorage.setItem('localProjectIndex', JSON.stringify(this.projectId))
this.$nextTick(() => {
this.clearStore()
})
// deleteCache().then((data)=>{
// }).catch(() => {
// })
let params = {
"projectId":this.projectId,
@ -627,16 +588,33 @@ export default {
sessionStorage.setItem('projectId', this.projectId)
getProjectDetail(params).then((data)=>{
if(data.status == 200){
const { systemId, projectId } = data.data.projectManage
// systemId=11 pythonpython
if (systemId === 11) {
this.popContainer = false;
this.hintOpen = data.data.projectManage.hintOpen;
let token = sessionStorage.getItem('token')
let cid = sessionStorage.getItem('cid')
let systemId = sessionStorage.getItem('systemId')
this.projectName = data.data.projectManage.projectName;
this.projectId = data.data.projectManage.projectId;
this.projectManage = data.data.projectManage;
this.requires = data.data.projectJudgmentVos;
this.$router.push('/index/list')
} else {
const { cid, curriculumName, token, systemId } = this.$route.query
Cookie.set('admin-assessmentId', '', -1)
Cookie.set('admin-startTime', '', -1)
Cookie.set('admin-stopTime', '', -1)
Cookie.set('admin-projectId', projectId)
Cookie.set('admin-token', token)
Cookie.set('admin-courseId', cid)
Cookie.set('admin-curriculumName', escape(curriculumName))
Cookie.set('admin-systemId', systemId)
// 8pythoncookiesystemId
location.href = process.env.NODE_ENV === 'development' ?
`http://${location.hostname}:8080/#/` :
location.href.includes('occupationlab.com') ?
'https://www.occupationlab.com/pyTrials' :
`${location.origin}/pyTrials`
}
}
}).catch((error)=>{
})

Loading…
Cancel
Save