diff --git a/src/api/index.js b/src/api/index.js index 251d7f5..4306c2f 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -16,7 +16,7 @@ export default { previewData: `data/data/preview`, lookupTableFile: `occupationlab/python/table/data/lookupTableFile`, downloadData:`${config.host}data/data/download`, - fileupload: `${config.host}occupationlab/oss/manage/fileupload`, + fileuploadOss: `${config.host}oss/manage/fileupload`, getDetailById: 'occupationlab/occupationlab/assessment/getDetailById', pageStuAssessment: 'occupationlab/occupationlab/assessment/pageStuAssessment', modelClassList: `nakadai/nakadai/model/reference/modelClassList`, @@ -32,4 +32,5 @@ export default { updateReport: `occupationlab/occupationlab/achievement/updateReport`, exportLabReport: `occupationlab/occupationlab/achievement/exportLabReport`, reportDetail: `occupationlab/occupationlab/achievement/reportDetail`, + getCompetition: `competition/competition/management/getCompetition`, } \ No newline at end of file diff --git a/src/assets/images/system/17/bg1.png b/src/assets/images/system/17/bg1.png new file mode 100644 index 0000000..15baff4 Binary files /dev/null and b/src/assets/images/system/17/bg1.png differ diff --git a/src/assets/images/system/17/btn.png b/src/assets/images/system/17/btn.png new file mode 100644 index 0000000..102a579 Binary files /dev/null and b/src/assets/images/system/17/btn.png differ diff --git a/src/assets/images/system/17/header.png b/src/assets/images/system/17/header.png new file mode 100644 index 0000000..c1150c7 Binary files /dev/null and b/src/assets/images/system/17/header.png differ diff --git a/src/assets/images/system/17/left.png b/src/assets/images/system/17/left.png new file mode 100644 index 0000000..06092c3 Binary files /dev/null and b/src/assets/images/system/17/left.png differ diff --git a/src/assets/images/system/17/right.png b/src/assets/images/system/17/right.png new file mode 100644 index 0000000..d4ab205 Binary files /dev/null and b/src/assets/images/system/17/right.png differ diff --git a/src/assets/images/system/17/yes.png b/src/assets/images/system/17/yes.png new file mode 100644 index 0000000..3985785 Binary files /dev/null and b/src/assets/images/system/17/yes.png differ diff --git a/src/components/TestPanel.vue b/src/components/TestPanel.vue index f455d1a..bc27f3e 100644 --- a/src/components/TestPanel.vue +++ b/src/components/TestPanel.vue @@ -19,9 +19,9 @@ style="flex: 1" > @@ -193,9 +193,9 @@ export default { this.competitionId ? 2 : 0 - if(this.assessmentId){ // 考核(考核才会从外面带进来assessmentId,练习是默认显示第一个项目) + if (this.assessmentId) { // 考核(考核才会从外面带进来assessmentId,练习是默认显示第一个项目,竞赛会带进来competitionId) this.getAssList() - }else{ // 练习 + } else { // 练习 // 获取项目列表 this.getList().then(() => { let cache = localStorage.getItem('codeCache') // 获取本地缓存 @@ -206,6 +206,12 @@ export default { this.getCache() } }).catch(res => {}) + if (this.competitionId) { + clearInterval(this.statusTimer) + this.statusTimer = setInterval(_ => { + this.getCompetitionStatus() + }, 1000) + } } }, methods: { @@ -278,8 +284,11 @@ export default { this.$emit('tell', projectId, systemId, this.points) const isPrac = this.projectPermissions == 0 // 是否是练习 this.text = isPrac ? '已用' : '剩余' - this.countVal = isPrac ? 0 : (new Date(this.endTime).getTime() - Date.now()) / 1000 // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接给0做计时 - this.startCount() + // 竞赛不需要 + if (!this.competitionId) { + this.countVal = isPrac ? 0 : (new Date(this.endTime).getTime() - Date.now()) / 1000 // 如果是考核,取考核的结束时间减去当前时间去做倒计时,练习则直接给0做计时 + this.startCount() + } resolve() }).catch(err => { reject() @@ -318,7 +327,7 @@ export default { }).catch(res => {}) // 查询考核状态定时器 this.statusTimer = setInterval(_ => { - this.getStatus() + this.getAssStatus() }, 1000) } }).catch(res => {}) @@ -425,8 +434,8 @@ export default { }) } }, - // 定时查询考核状态(只有考核才需要定时查,查到考核如果结束后,直接提交考核) - getStatus() { + // 定时查询考核状态(查到考核如果结束后,直接提交考核) + getAssStatus() { // 未提交才需要查询状态 this.isSubmit || this.$get(this.api.getDetailById, { id: this.assessmentId @@ -442,6 +451,28 @@ export default { } }).catch(res => {}) }, + // 定时查询竞赛状态(查到竞赛如果结束后,直接提交竞赛) + getCompetitionStatus() { + // 未提交才需要查询状态 + this.isSubmit || this.$post(`${this.api.getCompetition}?competitionId=${this.competitionId}`).then(({ 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() + // 如果已经结束 + if (now >= new Date(stage.endTime)) { + clearInterval(this.statusTimer) + this.$alert('竞赛时间已到,系统已自动交卷', '提示', { + confirmButtonText: '确定' + }) + this.submit() + } else { // 没结束,则显示倒计时(竞赛才需要通过定时调接口来显示倒计时,因为中台可以修改结束时间,所以需要时刻获取最新的结束时间) + this.counter((endTime - now) / 1000) + } + } + }).catch(res => {}) + }, // 项目选择回调 selectProject(){ this.isSelected = true @@ -514,7 +545,8 @@ export default { const timeSum = Math.ceil((date.getTime() - entryTime.getTime()) / 60000) // 计算实验用时(分钟),向上取整 const submitTime = util.formatDate('yyyy-MM-dd hh:mm:ss', date) const projectId = this.projectId - const projectName = this.projectList.find(e => e.projectId == projectId).projectName // 获取项目名称 + const pro = this.projectList.find(e => e.projectId == projectId) + const projectName = pro ? pro.projectName : '' // 获取项目名称 this.reloadCount() // 判分点参数 const attributesReqList = [] diff --git a/src/components/codemirror.vue b/src/components/codemirror.vue index e71db62..4abbb6f 100644 --- a/src/components/codemirror.vue +++ b/src/components/codemirror.vue @@ -674,7 +674,7 @@ export default { } /deep/.answer-wrap{ &.client { - // user-select: none; + user-select: none; } pre{ width: 100%; diff --git a/src/components/quill/index.vue b/src/components/quill/index.vue index b46b6d2..c096b55 100644 --- a/src/components/quill/index.vue +++ b/src/components/quill/index.vue @@ -4,12 +4,12 @@ - 点击上传 + 点击上传 @@ -52,9 +52,15 @@ export default { */ elseRead: { type: String, default: "false" - } + }, + // 当前富文本的索引。一个页面引入多个富文本的时候会无法获取到对应的实例,所以通过在父级存储实例的方式来保存 + index: { + type: Number, + default: 0 + }, }, data() { + const that = this return { headers: { token: Cookie.get('admin-token') @@ -72,7 +78,7 @@ export default { "image": function(value) { if (value) { // 调用iview图片上传 - document.querySelector(".editorUpload").click(); + document.querySelector("#editorUpload" + that.index).click(); } else { this.Quill.format("image", false); } diff --git a/src/config/index.js b/src/config/index.js index 110f416..041f532 100644 --- a/src/config/index.js +++ b/src/config/index.js @@ -10,7 +10,7 @@ let host = location.origin + '/' let bankPath = `${location.origin}/banksystem` // 银行系统 // 121.37.12.51 | 192.168.31.151 if (isDev) { - host = 'http://192.168.31.51:9000/' + // host = 'http://192.168.31.51:9000/' // host = 'http://192.168.31.116:9000/' host = 'http://121.37.12.51:9000/' // host = 'https://occupationlab.com/' diff --git a/src/main.js b/src/main.js index cc37465..006bba7 100644 --- a/src/main.js +++ b/src/main.js @@ -33,6 +33,8 @@ if (systemId.includes(',')) { import('@/styles/theme/theme13.scss') } else if (systemId == 16) { import('@/styles/theme/theme13.scss') + } else if (systemId == 17) { + import('@/styles/theme/theme10.scss') } } import api from './api'; diff --git a/src/styles/theme/theme4.scss b/src/styles/theme/theme4.scss index 119a922..385ee20 100644 --- a/src/styles/theme/theme4.scss +++ b/src/styles/theme/theme4.scss @@ -28,12 +28,9 @@ $--font-path: '~element-ui/lib/theme-chalk/fonts'; .submit { background: $--color-primary url(../../assets/images/system/4/btn.png) 0 0/100% 100% no-repeat !important; } -.el-table th { - background-color: $--color-primary !important; -} .el-table { th { - background-color: $--color-primary !important; + background-color: #000 !important; } .el-table__row--striped td { background-color: #d2f1f4 !important; diff --git a/src/views/Report.vue b/src/views/Report.vue index b63622b..6eaca00 100644 --- a/src/views/Report.vue +++ b/src/views/Report.vue @@ -131,7 +131,7 @@ 实验总结与体会 - +
@@ -215,6 +215,11 @@ export default { e.answer += `${i + 1}.${n.userAnswer}` }) }) + } else { // python系统显示图片(从userScores里取) + list.forEach(e => { + const item = this.userScores.find(n => n.judgmentId == e.judgmentId) + if (item && item.runThePictureList) e.runThePictureList = item.runThePictureList + }) } this.expData = list },