提交传运行结果等

ui
jialong.yu 3 years ago
parent 82126539d5
commit 85994d8519
  1. 17
      src/components/TestPanel.vue
  2. 3
      src/components/codemirror.vue
  3. 2
      src/config/index.js
  4. 5
      src/views/Home.vue

@ -137,6 +137,7 @@ import util from '@/util'
export default { export default {
data() { data() {
return { return {
systemId: util.getCookie('systemId'),
classId: util.getCookie('classId'), classId: util.getCookie('classId'),
className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '', className: util.getCookie('className') ? decodeURI(util.getCookie('className')) : '',
courseId: util.getCookie('courseId'), courseId: util.getCookie('courseId'),
@ -190,7 +191,7 @@ export default {
// //
getList(){ getList(){
let data = { let data = {
systemId: 1, systemId: this.systemId,
cId: this.courseId, // id cId: this.courseId, // id
permissions: this.projectPermissions // / permissions: this.projectPermissions // /
} }
@ -221,6 +222,7 @@ export default {
points.map(e => { points.map(e => {
e.code = '' // code e.code = '' // code
e.codeId = '' // codeIdcodeId e.codeId = '' // codeIdcodeId
e.answer = '' //
}) })
this.points = points this.points = points
this.taskList = points // this.taskList = points //
@ -267,7 +269,7 @@ export default {
const item = points.find(e => e.judgmentId === judgmentId) const item = points.find(e => e.judgmentId === judgmentId)
if (item) item.code = code if (item) item.code = code
this.$emit('tell', projectId, points) this.$emit('tell', projectId, points)
this.$emit('recoveryCode', points.findIndex(e => e.judgmentId === judgmentId) + '') this.$emit('recoveryCode', points.findIndex(e => e.judgmentId === judgmentId) + '') // tab
}).catch(res => {}) }).catch(res => {})
} else { } else {
const item = this.points.find(e => e.judgmentId === judgmentId) const item = this.points.find(e => e.judgmentId === judgmentId)
@ -290,9 +292,8 @@ export default {
this.isSubmit = false this.isSubmit = false
this.countVal = 0 this.countVal = 0
this.grade = '00' this.grade = '00'
// - this.$emit('recoveryCode') //
this.$emit('recoveryCode') newmain.$emit('isSubmit', this.isSubmit) //
newmain.$emit('isSubmit', this.isSubmit)
}, },
// //
reload() { reload() {
@ -330,11 +331,11 @@ export default {
// //
const attributesReqList = [] const attributesReqList = []
pointList.map(e => { pointList.map(e => {
e.codeId && attributesReqList.push({ attributesReqList.push({
codeId: e.codeId, codeId: e.codeId,
bcId: e.judgmentId, bcId: e.judgmentId,
score: e.score, isSubmit: e.codeId ? 1 : 0,
isSubmit: 0 answer: e.answer
}) })
}) })
const data = { const data = {

@ -233,6 +233,7 @@ export default {
}).catch(err => {}) }).catch(err => {})
}, },
//
runCode(isWhile) { // isWhiletruewhile runCode(isWhile) { // isWhiletruewhile
if (!this.isSubmit) { if (!this.isSubmit) {
let code = this.codeVal let code = this.codeVal
@ -298,9 +299,11 @@ export default {
const data = res.code const data = res.code
const photo = data.photoUrl const photo = data.photoUrl
const result = data.runResult const result = data.runResult
this.$emit('cache')
this.loadIns.close() this.loadIns.close()
this.picSrc = '' this.picSrc = ''
this.$emit('update:codeId', res.codeId) this.$emit('update:codeId', res.codeId)
this.$emit('update:answer', result)
if(photo){ if(photo){
this.isError = '' this.isError = ''
const text = result.replace(photo, '') const text = result.replace(photo, '')

@ -7,7 +7,7 @@ if(isHh) {
host = "http://10.196.131.73/"; host = "http://10.196.131.73/";
} else if(isBeta) { } else if(isBeta) {
host = "http://39.108.250.202:9000/"; host = "http://39.108.250.202:9000/";
// host = "http://192.168.31.151:9000/"; host = "http://192.168.31.151:9000/";
} else if(isPro) { } else if(isPro) {
host = "http://www.occupationlab.com/"; host = "http://www.occupationlab.com/";
} else { } else {

@ -28,6 +28,8 @@
:code.sync="item.code" :code.sync="item.code"
:workbench1="item.judgmentId" :workbench1="item.judgmentId"
:codeId.sync="item.codeId" :codeId.sync="item.codeId"
:answer.sync="item.answer"
@cache="leavePage"
></codemirror> ></codemirror>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
@ -66,6 +68,7 @@ export default {
}, },
mounted() { mounted() {
this.autoLogout() this.autoLogout()
//
window.onbeforeunload = () => { window.onbeforeunload = () => {
this.leavePage() this.leavePage()
} }
@ -74,7 +77,7 @@ export default {
// //
leavePage(){ leavePage(){
const list = this.workbench const list = this.workbench
if(!this.$refs.mainindex.isSubmit && !this.assessmentId && list.length && list.some(e => e.code)){ if(!this.$refs.mainindex.isSubmit && list.length && list.some(e => e.code)){
const cache = { const cache = {
projectId: this.projectId, projectId: this.projectId,
judgmentId: list[Number(this.curTab)].judgmentId judgmentId: list[Number(this.curTab)].judgmentId

Loading…
Cancel
Save