openf12 V2.1.8
yujialong 12 months ago
parent 6afe1afaec
commit 82822d6c92
  1. 1
      src/api/index.js
  2. 69
      src/components/TestPanel.vue
  3. 3
      src/components/codemirror.vue
  4. 2
      src/components/upload/index.vue
  5. 2
      src/components/upload/upload.js
  6. 2
      src/config/index.js
  7. 1
      src/views/Home.vue

@ -1,5 +1,6 @@
import config from '@/config'
export default {
getCurrentTime : `competition/competition/management/getCurrentTime`,
getProjectDetail: 'occupationlab/occupationlab/projectManage/getProjectDetail',
submit: 'python/python/submit',
runPythonCode: 'python/python/runPythonCode',

@ -351,6 +351,7 @@ export default {
seconds: 0, //
minutes: 0, //
hour: 0, //
now: '',
projectList: [], //
pd: {},
experimentTarget: '', //
@ -404,6 +405,8 @@ export default {
mavonEditor
},
mounted () {
this.getNow().then(now => {
this.entryTime = now
// 210
this.projectPermissions = this.assessmentId ?
1 :
@ -432,6 +435,7 @@ export default {
this.getUserDetail()
// this.drag()
this.tableHeight = window.innerHeight - 360
})
},
methods: {
//
@ -515,8 +519,10 @@ export default {
this.text = isPrac ? '已用' : '剩余'
//
if (!this.competitionId) {
this.countVal = isPrac ? 0 : (new Date(this.endTime).getTime() - Date.now()) / 1000 // 0
this.getNow().then(now => {
this.countVal = isPrac ? 0 : (new Date(this.endTime) - now) / 1000 // 0
this.startCount()
})
}
resolve()
}).catch(err => {
@ -524,6 +530,13 @@ export default {
})
})
},
//
getNow () {
return new Promise(async (resolve, reject) => {
const res = await this.$get(this.api.getCurrentTime)
resolve(new Date(res.currentTime))
})
},
// loadingtrue
closeLoad () {
this.$parent.loadIns.close()
@ -603,6 +616,7 @@ export default {
const judgmentId = e.judgmentId
promiseList.push(new Promise((resolve, reject) => {
this.$post(this.api.getLastCache, {
competitionId: this.competitionId,
assessmentId: assessmentId ? Number(assessmentId) : '',
bcId: judgmentId,
projectId, // id
@ -656,6 +670,7 @@ export default {
//
points.map(e => {
e.code && this.$post(this.api.delCache, {
competitionId: this.competitionId,
assessmentId,
bcId: e.judgmentId,
projectId,
@ -685,20 +700,22 @@ export default {
//
getCompetitionStatus () {
//
this.isSubmit || this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`).then(({ competition }) => {
this.isSubmit || this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`).then(async ({ competition }) => {
const stages = competition.competitionStage
if (stages) {
const stage = stages.find(e => e.stageId == this.stageId)
const endTime = new Date(stage.endTime).getTime()
const now = Date.now()
const endTime = new Date(stage.endTime)
const res = await this.$get(this.api.getCurrentTime)
const now = new Date(res.currentTime)
//
if (now >= new Date(stage.endTime)) {
if (now >= endTime) {
this.$alert('竞赛时间已到,系统已自动交卷', '提示', {
confirmButtonText: '确定'
})
this.submit()
} else { //
this.countVal = (endTime - Date.now()) / 1000
this.countVal = (endTime - now) / 1000
this.startCount()
}
}
@ -747,7 +764,7 @@ export default {
}
},
//
reload () {
async reload () {
this.reloadCount()
this.grade = '00'
localStorage.removeItem('codeCache')
@ -764,6 +781,7 @@ export default {
this.$emit('recoveryCode')
this.startCount()
this.clearReport()
this.entryTime = await this.getNow()
},
//
ready () {
@ -831,7 +849,9 @@ export default {
}).then(({ codeId }) => {
this.$parent.workbench[0].codeId = codeId
this.submit()
}).catch(err => { })
}).catch(err => {
this.submiting = false
})
} else {
this.submit()
}
@ -841,12 +861,12 @@ export default {
})
},
//
submit () {
async submit () {
if (this.isSubmit) return false
const pointList = this.$parent.workbench
const date = new Date()
const date = await this.getNow()
const entryTime = this.entryTime
const timeSum = Math.ceil((date.getTime() - entryTime.getTime()) / 60000) //
const timeSum = Math.ceil((date - entryTime) / 60000) //
const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date)
const projectId = this.projectId
const pro = this.projectList.find(e => e.projectId == projectId)
@ -909,12 +929,16 @@ export default {
this.editReport(reportId)
this.submiting = false
//
// this.competitionId && this.resultsDetails == 0 && this.$alert(`${this.resultAnnouncementTime != 0 ? '' + this.resultAnnouncementTime + '' : ''}`, '', {
// confirmButtonText: '',
// callback: action => {
// this.$parent.back()
// }
// })
if (this.competitionId) {
this.$alert(`提交成功!${this.resultsDetails == 0 && this.resultAnnouncementTime != 0 ? '成绩将在' + this.resultAnnouncementTime + '小时后发布,请去参赛信息模块查看' : ''}`, '提示', {
confirmButtonText: '确定',
callback: action => {
this.$parent.back()
}
})
} else {
this.$message.success('提交成功!')
}
}).catch(err => {
this.submiting = false
})
@ -1188,7 +1212,11 @@ export default {
}
}
/deep/.ql-editor {
font-family: 'Microsoft Yahei';
font-size: 13px;
.ql-syntax {
font-family: 'Microsoft Yahei';
}
}
/deep/.el-collapse-item__wrap {
border-bottom: none;
@ -1395,11 +1423,18 @@ export default {
/deep/.v-note-wrapper {
min-height: 0;
height: auto;
font-family: 'Microsoft Yahei';
.v-note-panel .v-note-show {
font-family: 'Microsoft Yahei';
overflow: visible;
.v-show-content {
font-family: 'Microsoft Yahei';
overflow: visible;
}
pre,
code {
font-family: 'Microsoft Yahei';
}
}
}
</style>

@ -628,6 +628,9 @@ export default {
.text-wrapper {
white-space: pre-wrap;
}
/deep/.CodeMirror-code {
font-family: 'Microsoft Yahei';
}
/deep/.answer {
.el-tab-pane {
padding: 0 10px;

@ -102,7 +102,7 @@ export default {
this.uploading = true
this.showFiles = false
// oss
const { name } = await this.client.multipartUpload(file.name, file, {
const { name } = await this.client.multipartUpload(Date.now() + '.' + Util.getFileExt(file.name), file, {
progress: this.handleProgress
});

@ -17,7 +17,7 @@ export default {
return new Promise(async (resolve, reject) => {
try {
// 上传到阿里云oss
const res = await client.multipartUpload(file.name, file);
const res = await client.multipartUpload(Date.now() + '.' + Util.getFileExt(file.name), file);
resolve({
format: Util.getFileExt(file.name),
name: file.name,

@ -66,5 +66,5 @@ export default {
/**
* @description 长时间未操作自动退出登录时间
*/
autoLogoutTime: 1000 * 60 * 60
autoLogoutTime: 1000 * 60 * 60 * 3
}

@ -148,6 +148,7 @@ export default {
list.map(e => {
if (e.code) {
let data = {
competitionId: this.competitionId,
assessmentId: this.assessmentId,
code: e.code,
bcId: e.judgmentId,

Loading…
Cancel
Save