From f98551590c5b618e395eeebd59dc1b9715766835 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 28 Mar 2024 10:27:20 +0800 Subject: [PATCH] fix --- src/components/TestPanel.vue | 2 +- src/components/codemirror.vue | 12 ++++++++---- src/views/Home.vue | 2 ++ src/views/Report.vue | 1 + 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 98a0040..8dc9129 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -1240,7 +1240,7 @@ export default { responseCallback: function (frame) { const data = JSON.parse(frame.body) - console.log("接收信息:", data, typeof data); + console.log("接收信息:", data, typeof data, newmain, newmain.$emit); if (typeof data === 'object') { newmain.$emit('setPid', '') if (this.runCodeType) { diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index caca07e..80869de 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -325,7 +325,7 @@ import config from '@/config' import { saveAs } from 'file-saver' const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 export default { - props: ['judgmentId', 'code', 'finalCode', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl', 'answer'], + props: ['judgmentId', 'code', 'finalCode', 'codeId', 'projectId', 'systemId', 'retResult', 'modelIsShow', 'photoUrl', 'answer', 'curTab', 'index'], data () { return { token: Cookie.get('admin-token'), @@ -653,7 +653,8 @@ export default { bcId: this.judgmentId, cid: this.courseId, projectId: this.projectId, - type: 0 + type: 0, + sort: this.index }, { headers: { token: this.token @@ -698,6 +699,7 @@ export default { this.$emit('update:retResult', data.retResult) // 更新返回结果 }, runCodeCb2 (data) { + if (data.sort != this.index) return false // 正常返回结果 if (data) { const photo = data.photoUrl @@ -778,7 +780,8 @@ export default { bcId, cid, projectId, - type: 0 + type: 0, + sort: this.index }).then(res => { this.$emit('update:finalCode', code) }).catch(err => { @@ -802,7 +805,8 @@ export default { bcId, cid, projectId, - type: 0 + type: 0, + sort: this.index }).then(res => { this.$emit('update:finalCode', code) }).catch(res => { diff --git a/src/views/Home.vue b/src/views/Home.vue index 8c8e40f..da265d3 100644 --- a/src/views/Home.vue +++ b/src/views/Home.vue @@ -66,6 +66,8 @@ :answer.sync="item.answer" :retResult.sync="item.retResult" :photoUrl.sync="item.photoUrl" + :index="i" + :curTab.sync="curTab" :modelIsShow.sync="modelIsShow" @cache="leavePage">