diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 88865fe..cdfebb1 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -119,7 +119,7 @@ :subfield="false" :editable="false" :toolbarsFlag="false" - :boxShadowStyle="none" /> + boxShadowStyle="none" /> @@ -142,6 +142,12 @@ width="1200px" :close-on-click-modal="false" custom-class="code-dia"> + + +
{ @@ -587,7 +599,7 @@ export default { const result = data.runResult if (result.includes('File ')) { this.runResult = result - this.errLine = parseInt(result.substring(result.indexOf('line') + 4, result.length)) + this.errLine = this.getErrLine(result) this.isError = data.retResult } else if (result.includes('validing:')) { this.isError = 1 @@ -608,6 +620,10 @@ export default { }).catch(err => { }) }, + // 获取第几行代码有错误 + getErrLine (result) { + return parseInt(result.substring(result.indexOf('line') + 4, result.length)) || 1 + }, // 运行代码 runCode (isWhile) { // isWhile为true表示代码里有while循环,右边的运行结果需要拼接展示,而不是直接覆盖 if (!this.isSubmit) { @@ -652,7 +668,7 @@ export default { } else { this.runResult = result } - this.errLine = parseInt(result.substring(result.indexOf('line') + 4, result.length)) + this.errLine = this.getErrLine(result) this.isError = data.retResult } else if (result.includes('validing:')) { this.isError = 1 @@ -709,7 +725,7 @@ export default { const text = result.replace(photo, '') // 结果里包含了图片路径,所以要把图片路径给去掉 this.runResult = text this.picSrcList = photo.split(',') - this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length)) + this.errLine = this.getErrLine(result) } else if (imgList instanceof Array && imgList.length && typeof firtImg === 'string' && (firtImg.includes('.jpg') || firtImg.includes('.png') || firtImg.includes('img'))) { /** * 这段是为要下载图片的项目案例写的,后端会返回图片名称的数组,前端负责循环这个数组,然后下载下来 @@ -722,7 +738,7 @@ export default { } else { this.isError = data.retResult this.runResult = result - this.errLine = parseInt(result.substring(result.indexOf("line") + 4, result.length)) + this.errLine = this.getErrLine(result) } } else if (res.data && res.data.current) { // 进入运行队列 @@ -763,7 +779,7 @@ export default { this.$get(this.api.queryBcJudgmentByBcId, { bcId: this.judgmentId }).then(res => { - this.answer = res.experimentCode + this.correctAnswer = res.experimentCode }).catch(err => { }) }, // 中间拖拽 @@ -1104,6 +1120,12 @@ export default { .el-dialog__body { padding: 0 20px; } + .info { + position: absolute; + top: 18px; + left: 100px; + color: #88aef5; + } .code-tab { .el-tabs__item.is-active { color: #333 !important; diff --git a/src/config/index.js b/src/config/index.js index 8b5c3c5..f8d56c7 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -14,7 +14,7 @@ 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.51:9000/' + // host = 'http://121.37.12.51:9000/' // host = 'https://occupationlab.com/' bankPath = `http://${location.hostname}:8093` } else if (isPro) {