yujialong 1 month ago
parent 8d95350531
commit 77f2e9eeb8
  1. 22
      src/components/TestPanel.vue
  2. 9
      src/config/index.js
  3. 1
      src/views/Report.vue

@ -35,7 +35,7 @@
v-if="$parent.language === 'vscode' && !isSubmit && !competitionId">填写实验报告</el-button> v-if="$parent.language === 'vscode' && !isSubmit && !competitionId">填写实验报告</el-button>
<el-button @click="toReport" v-if="isSubmit && !competitionId">查看实验报告</el-button> <el-button @click="toReport" v-if="isSubmit && !competitionId">查看实验报告</el-button>
<el-button class="reload" @click="reloadConfirm" v-show="projectPermissions == 0">重新开始</el-button> <el-button class="reload" @click="reloadConfirm" v-show="projectPermissions == 0">重新开始</el-button>
<el-button type="primary" class="submit btn" @click="confirmSubmit" <el-button type="primary" class="submit btn" :loading="submiting" @click="confirmSubmit"
:disabled="isSubmit || !projectList.length">提交</el-button> :disabled="isSubmit || !projectList.length">提交</el-button>
</div> </div>
</el-header> </el-header>
@ -296,11 +296,13 @@ export default {
reportVisible: false, reportVisible: false,
tableHeight: 0, tableHeight: 0,
dragIds: ['panelHeader', 'aside', 'main', 'infoContainer'], dragIds: ['panelHeader', 'aside', 'main', 'infoContainer'],
confirmSubmiting: false,
submiting: false, submiting: false,
client: '', client: '',
accountId: '', accountId: '',
runCodeType: '', runCodeType: '',
finishVscodeItem: 0, finishVscodeItem: 0,
vscodeRunCodeNum: 0,
clientTopic: '', clientTopic: '',
}; };
}, },
@ -749,7 +751,7 @@ export default {
this.$parent.workbench[i].codeId = data.codeId this.$parent.workbench[i].codeId = data.codeId
this.$parent.workbench[i].retResult = 1 this.$parent.workbench[i].retResult = 1
this.finishVscodeItem++ this.finishVscodeItem++
this.finishVscodeItem === this.$parent.workbench.length && this.submit() this.finishVscodeItem === this.vscodeRunCodeNum && this.submit()
}, },
emptyRunCode (data) { emptyRunCode (data) {
this.$parent.workbench[0].codeId = data.codeId this.$parent.workbench[0].codeId = data.codeId
@ -757,8 +759,8 @@ export default {
}, },
// //
confirmSubmit () { confirmSubmit () {
if (this.submiting) return false if (this.confirmSubmiting) return false
this.submiting = true this.confirmSubmiting = true
const isVscode = this.$parent.language === 'vscode' // vscode const isVscode = this.$parent.language === 'vscode' // vscode
const { taskList } = this const { taskList } = this
const pointList = this.$parent.workbench const pointList = this.$parent.workbench
@ -771,6 +773,7 @@ export default {
} else { } else {
if (!taskList.find(e => e.code || e.codeResult)) msg = '实验报告未填写,实验成绩为零,是否确认提交?' if (!taskList.find(e => e.code || e.codeResult)) msg = '实验报告未填写,实验成绩为零,是否确认提交?'
} }
this.vscodeRunCodeNum = 0
this.finishVscodeItem = 0 this.finishVscodeItem = 0
this.$confirm(msg, '提示', { this.$confirm(msg, '提示', {
confirmButtonText: '确定', confirmButtonText: '确定',
@ -783,6 +786,7 @@ export default {
if (isVscode) { if (isVscode) {
taskList.map(async (e, i) => { taskList.map(async (e, i) => {
if (e.code || e.codeResult) { if (e.code || e.codeResult) {
this.vscodeRunCodeNum++
this.runCodeType = 'vscodeRunCode' this.runCodeType = 'vscodeRunCode'
await this.$post(this.api.runPythonCode, { await this.$post(this.api.runPythonCode, {
assessmentId: this.assessmentId, assessmentId: this.assessmentId,
@ -795,6 +799,7 @@ export default {
type: 'vscode', type: 'vscode',
sort: i sort: i
}) })
this.$parent.workbench[i].finalCode = e.code
this.$parent.workbench[i].answer = e.codeResult this.$parent.workbench[i].answer = e.codeResult
} }
}) })
@ -811,19 +816,20 @@ export default {
projectId: this.projectId, projectId: this.projectId,
type: this.$parent.language type: this.$parent.language
}).then(res => { }).catch(err => { }).then(res => { }).catch(err => {
this.submiting = false this.confirmSubmiting = false
}) })
} else { } else {
this.submit() this.submit()
} }
} }
}).catch(() => { }).catch(() => {
this.submiting = false this.confirmSubmiting = false
}) })
}, },
// //
async submit () { async submit () {
if (this.isSubmit) return false if (this.isSubmit || this.submiting) return false
this.submiting = true
const pointList = this.$parent.workbench const pointList = this.$parent.workbench
const date = await this.getNow() const date = await this.getNow()
const { entryTime } = this const { entryTime } = this
@ -889,7 +895,7 @@ export default {
this.reportId = reportId this.reportId = reportId
this.$store.commit('setReportId', reportId) this.$store.commit('setReportId', reportId)
this.$store.commit('setTaskList', taskList) this.$store.commit('setTaskList', taskList)
this.editReport(reportId) this.confirmSubmiting = false
this.submiting = false this.submiting = false
// //
if (this.competitionId) { if (this.competitionId) {

@ -6,16 +6,17 @@ const isTest = url.includes('121.37.12.51') //测试服
const isHh = url.includes('10.196.131.73') //是否是河海版本 const isHh = url.includes('10.196.131.73') //是否是河海版本
const isPro = url.includes('occupationlab.com') //是否职站生产 const isPro = url.includes('occupationlab.com') //是否职站生产
const isZxy = url.includes('izhixinyun.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 = location.origin + '/'
// let host = `https://izhixinyun.com/` // let host = `https://izhixinyun.com/`
let bankPath = `${location.origin}/banksystem` // 银行系统 let bankPath = `${location.origin}/banksystem` // 银行系统
// 121.37.12.51 | 192.168.31.151 // 121.37.12.51 | 192.168.31.151
if (isDev) { if (isDev) {
host = 'http://192.168.31.217:9000/' // host = 'http://192.168.31.51:9000/'
// host = 'http://121.37.12.217:9000/' host = 'http://121.37.12.51/'
// host = 'https://occupationlab.com/' // host = 'https://izhixinyun.com/'
bankPath = `http://${location.hostname}:8093` bankPath = `http://${location.hostname}:8093`
} else if (isPro) { } else if (isPro) {
host = 'https://occupationlab.com/' host = 'https://occupationlab.com/'

@ -209,7 +209,6 @@ export default {
}).then(res => { }).catch(err => { }) }).then(res => { }).catch(err => { })
} else { } else {
data = JSON.parse(data) data = JSON.parse(data)
this.userScores = data
this.handleList(data) this.handleList(data)
} }
}).catch(res => { }) }).catch(res => { })

Loading…
Cancel
Save