From 7751ee4a4b059c042a195cb42273c2856e18b396 Mon Sep 17 00:00:00 2001 From: "jialong.yu" Date: Tue, 18 Jan 2022 17:52:36 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9B=E5=85=A5=E9=A1=B5=E9=9D=A2=E5=88=A4?= =?UTF-8?q?=E6=96=AD=E5=BD=93=E5=89=8D=E7=94=A8=E6=88=B7=E7=9A=84classId?= =?UTF-8?q?=E5=92=8C=E8=80=83=E6=A0=B8=E7=9A=84classId=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E7=9B=B8=E5=90=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TestPanel.vue | 23 +++++++++++------------ src/config/index.js | 3 ++- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index 9780f27..2475c54 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -253,18 +253,17 @@ export default { const list = res.list const assessmentId = this.assessmentId let done = false - list.map(e => { - // 匹配到该考核,并且已经提交过(有reportId则说明有实验记录) - if (e.assessmentId == assessmentId && e.reportId) { - done = true - this.isSubmit = true - newmain.$emit('isSubmit', this.isSubmit) - this.$message.error('你已经提交过该考核!') - setTimeout(_ => { - history.back() // 直接返回上一页面 - }, 1500) - } - }) + const classId = this.classId + // 匹配到该考核,并且已经提交过(有reportId则说明有实验记录),并且classId跟当前用户的classId相同,就提示提交了考核然后返回上一页 + if (list.find(e => e.assessmentId == assessmentId && e.reportId && e.classId == classId)) { + done = true + this.isSubmit = true + newmain.$emit('isSubmit', this.isSubmit) + this.$message.error('你已经提交过该考核!') + setTimeout(_ => { + history.back() // 直接返回上一页面 + }, 1500) + } // 如果该考核没有提交过,则取获取项目列表进行考核 if (!done) { this.getList().then(() => { diff --git a/src/config/index.js b/src/config/index.js index c5fb68b..a8a0921 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -3,7 +3,8 @@ import util from '@/util' const isHh = location.host.includes('10.196.131.73') //是否是河海版本 const isBeta = process.env.NODE_ENV === 'development' || location.host.includes('39.108.250.202') //是否是职站测试 -const host = location.origin + ':9000/' +let host = location.origin + ':9000/' +if (process.env.NODE_ENV === 'development') host = "http://192.168.31.151:9000/" /** * python8个系统的id和名称 * id即systemId,从cookie里取