diff --git a/src/api/index.js b/src/api/index.js index fad0dd1..e811164 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -32,6 +32,7 @@ export default { saveLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/save', updateLearningProgress: 'nakadai/nakadai/curriculum/learning/progressprogress/update', maximumPracticeScoreList: 'occupationlab/occupationlab/achievement/maximumPracticeScoreList', + getSandTableLastCache: `product/product/bank/operation/getSandTableLastCache`, // 课程笔记 addNote: `nakadai/curriculumNotes/addNote`, curriculumNoteList: `nakadai/curriculumNotes/curriculumNoteList`, @@ -105,6 +106,7 @@ export default { getAssessmentDetail: `occupationlab/occupationlab/achievement/getAssessmentDetail`, // 管理端考核成绩详情 getPracticeDetail: `occupationlab/occupationlab/achievement/getPracticeDetail`, // 管理端练习成绩详情 myClass: `occupationlab/occupationlab/achievement/myClass`, // 教师端:我的班级 + allClassesInOurSchool: `occupationlab/occupationlab/achievement/allClassesInOurSchool`, deleteReportById: `occupationlab/occupationlab/achievement/deleteReportById`, // 批量删除成绩管理中的项目/批量删除成绩管理中的考核 reportDetail: `occupationlab/occupationlab/achievement/reportDetail`, // 查看实验报告 schoolCourseByAchievement: `nakadai/nakadai/curriculum/schoolCourseByAchievement`, // 获取学校购买订单后的课程 diff --git a/src/pages/achievement/info/course.vue b/src/pages/achievement/info/course.vue index c965981..3cb7193 100644 --- a/src/pages/achievement/info/course.vue +++ b/src/pages/achievement/info/course.vue @@ -3,7 +3,7 @@
-
@@ -57,11 +57,11 @@
错误率最高:{{ max.projectName }} - 参加考试{{ max.numberOfParticipants || 0 }}人 | {{ curTab == 1 ? `共${max.itemErrorCount || 0}人做错,` : '' }}错误率{{ max.errorRate || 0 }}% + 参加考试{{ permissions ? peopleNum || 0 : max.quantityAfterWeightRemoval }}人 | {{ curTab == 1 ? `共${max.itemErrorCount || 0}人做错,` : '' }}错误率{{ max.errorRate || 0 }}%
错误率最低:{{ min.projectName }} - 参加考试{{ min.numberOfParticipants || 0 }}人 | {{ curTab == 1 ? `共${min.itemErrorCount || 0}人做错,` : '' }}错误率{{ min.errorRate || 0 }}% + 参加考试{{ permissions ? peopleNum || 0 : min.quantityAfterWeightRemoval }}人 | {{ curTab == 1 ? `共${min.itemErrorCount || 0}人做错,` : '' }}错误率{{ min.errorRate || 0 }}%
diff --git a/src/pages/achievement/info/project.vue b/src/pages/achievement/info/project.vue index 7f4f47b..ca9f7fc 100644 --- a/src/pages/achievement/info/project.vue +++ b/src/pages/achievement/info/project.vue @@ -2,7 +2,7 @@
返回 > + @click="back">返回 > {{ experimentalName }}
@@ -351,9 +351,14 @@ export default { methods: { // 获取班级下拉框数据 async getClass () { - let { list } = this.permissions ? - await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) : - await this.$post(this.api.myClass) + let list + if (this.permissions) { + const res = await this.$post(`${this.api.spliceClass}?assessmentId=${this.id}`) + list = res.list + } else { + const res = await this.$post(this.api.allClassesInOurSchool) + list = res.data + } // 去掉无指定范围 const i = list.findIndex(e => e.id == 1) i !== -1 && list.splice(i, 1) @@ -664,7 +669,10 @@ export default { ] } echarts.init(document.querySelector(`#chart1`)).setOption(option) - } + }, + back () { + location.href = this.$store.state.achievement.referrer + }, } }; diff --git a/src/pages/achievement/list/course.vue b/src/pages/achievement/list/course.vue index ccf3fd8..4c384af 100644 --- a/src/pages/achievement/list/course.vue +++ b/src/pages/achievement/list/course.vue @@ -262,6 +262,7 @@ export default { }, // 进入实验记录 entry (row) { + this.$store.commit('achievement/setReferrer', location.href) this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}`) }, handleCurrentChange (val) { // 切换页码 diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue index bd4db5f..6744c95 100644 --- a/src/pages/achievement/list/project.vue +++ b/src/pages/achievement/list/project.vue @@ -38,6 +38,7 @@
  • { - this.loading = false this.projects = projects }).catch(res => { }) }, // 进入实验 - entry () { - // 查询上次做的项目 - this.$get(this.api.getTheMostRecentlyRunProject, { - cid: this.courseId - }).then(({ data }) => { - // 返回了data则提示是否继续,否则,显示选择项目的弹框 - if (data && data.length) { - this.$confirm('是否要继续上次的实验?', '提示', { - confirmButtonText: '是', - cancelButtonText: '否', - type: 'success' - }).then(() => { - this.toPython(data[0].projectId) - }).catch(() => { - this.queryProject() - }) - } else { - this.queryProject() - } - }).catch(res => { - this.queryProject() + entryProject (projectId) { + this.$confirm('是否要继续上次的实验?', '提示', { + confirmButtonText: '是', + cancelButtonText: '否', + type: 'success' + }).then(() => { + this.curProject = projectId + this.toSub() + }).catch(() => { + this.showProjectDia() }) }, + // 进入实验 + entry () { + // 查询上次做的项目(python跟沙盘接口不一样) + if (this.systemIds.split(',').includes('19')) { // 沙盘 + this.$post(`${this.api.getSandTableLastCache}?cid=${this.courseId}`).then(res => { + // 返回了data则提示是否继续,否则,显示选择项目的弹框 + if (res.getLastCache) { + this.entryProject(+res.getLastCache) + } else { + this.showProjectDia() + } + }).catch(res => { + this.showProjectDia() + }) + } else { // python + this.$get(this.api.getTheMostRecentlyRunProject, { + cid: this.courseId + }).then(({ data }) => { + // 返回了data则提示是否继续,否则,显示选择项目的弹框 + if (data && data.length) { + this.entryProject(data[0].projectId) + } else { + this.showProjectDia() + } + }).catch(res => { + this.showProjectDia() + }) + } + }, // 进入python系统 toPython (projectId) { const id = this.systemIds @@ -979,8 +999,6 @@ export default { toSub () { const { systemId } = this.projects.find(e => e.projectId == this.curProject) let token = util.local.get(Setting.tokenKey); - let roleId = this.roleId == 4 ? 0 : 1; - let userName = window.btoa(encodeURIComponent(this.userName)); if (systemId == 11) { // 银行系统 sessionStorage.removeItem('projectId') diff --git a/src/store/modules/achievement.js b/src/store/modules/achievement.js index b05694b..b0c309d 100644 --- a/src/store/modules/achievement.js +++ b/src/store/modules/achievement.js @@ -5,11 +5,15 @@ export default { namespaced: true, state: { row: null, + referrer: '', }, mutations: { setRow: (state, row) => { state.row = row }, + setReferrer: (state, val) => { + state.referrer = val + }, }, actions: {