diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 55a3b70..c74c5ef 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -35,7 +35,7 @@ v-if="$parent.language === 'vscode' && !isSubmit && !competitionId">填写实验报告 查看实验报告 重新开始 - 提交 @@ -296,11 +296,13 @@ export default { reportVisible: false, tableHeight: 0, dragIds: ['panelHeader', 'aside', 'main', 'infoContainer'], + confirmSubmiting: false, submiting: false, client: '', accountId: '', runCodeType: '', finishVscodeItem: 0, + vscodeRunCodeNum: 0, clientTopic: '', }; }, @@ -749,7 +751,7 @@ export default { this.$parent.workbench[i].codeId = data.codeId this.$parent.workbench[i].retResult = 1 this.finishVscodeItem++ - this.finishVscodeItem === this.$parent.workbench.length && this.submit() + this.finishVscodeItem === this.vscodeRunCodeNum && this.submit() }, emptyRunCode (data) { this.$parent.workbench[0].codeId = data.codeId @@ -757,8 +759,8 @@ export default { }, // 提交询问 confirmSubmit () { - if (this.submiting) return false - this.submiting = true + if (this.confirmSubmiting) return false + this.confirmSubmiting = true const isVscode = this.$parent.language === 'vscode' // 是否选择了vscode const { taskList } = this const pointList = this.$parent.workbench @@ -771,6 +773,7 @@ export default { } else { if (!taskList.find(e => e.code || e.codeResult)) msg = '实验报告未填写,实验成绩为零,是否确认提交?' } + this.vscodeRunCodeNum = 0 this.finishVscodeItem = 0 this.$confirm(msg, '提示', { confirmButtonText: '确定', @@ -783,6 +786,7 @@ export default { if (isVscode) { taskList.map(async (e, i) => { if (e.code || e.codeResult) { + this.vscodeRunCodeNum++ this.runCodeType = 'vscodeRunCode' await this.$post(this.api.runPythonCode, { assessmentId: this.assessmentId, @@ -795,6 +799,7 @@ export default { type: 'vscode', sort: i }) + this.$parent.workbench[i].finalCode = e.code this.$parent.workbench[i].answer = e.codeResult } }) @@ -811,19 +816,20 @@ export default { projectId: this.projectId, type: this.$parent.language }).then(res => { }).catch(err => { - this.submiting = false + this.confirmSubmiting = false }) } else { this.submit() } } }).catch(() => { - this.submiting = false + this.confirmSubmiting = false }) }, // 提交 async submit () { - if (this.isSubmit) return false + if (this.isSubmit || this.submiting) return false + this.submiting = true const pointList = this.$parent.workbench const date = await this.getNow() const { entryTime } = this @@ -889,7 +895,7 @@ export default { this.reportId = reportId this.$store.commit('setReportId', reportId) this.$store.commit('setTaskList', taskList) - this.editReport(reportId) + this.confirmSubmiting = false this.submiting = false // 如果是竞赛,并且勾选了公布成绩详情的选项,则弹框提示 if (this.competitionId) { diff --git a/src/config/index.js b/src/config/index.js index b17bcdb..cfb6e24 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -6,16 +6,17 @@ const isTest = url.includes('121.37.12.51') //测试服 const isHh = url.includes('10.196.131.73') //是否是河海版本 const isPro = url.includes('occupationlab.com') //是否职站生产 const isZxy = url.includes('izhixinyun.com') //是否智信云 -let vscodeUrl = 'https://vscode.izhixinyun.com' +let vscodeUrl = 'http://172.16.40.56:8088/' + let host = location.origin + '/' // let host = `https://izhixinyun.com/` let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { - host = 'http://192.168.31.217:9000/' - // host = 'http://121.37.12.217:9000/' - // host = 'https://occupationlab.com/' + // host = 'http://192.168.31.51:9000/' + host = 'http://121.37.12.51/' + // host = 'https://izhixinyun.com/' bankPath = `http://${location.hostname}:8093` } else if (isPro) { host = 'https://occupationlab.com/' diff --git a/src/views/Report.vue b/src/views/Report.vue index 73de3c2..409b055 100644 --- a/src/views/Report.vue +++ b/src/views/Report.vue @@ -209,7 +209,6 @@ export default { }).then(res => { }).catch(err => { }) } else { data = JSON.parse(data) - this.userScores = data this.handleList(data) } }).catch(res => { })