From 28cb442105ac779c521f6045d541840a748c98e6 Mon Sep 17 00:00:00 2001
From: yujialong <479214531@qq.com>
Date: Tue, 30 Jan 2024 17:08:19 +0800
Subject: [PATCH] =?UTF-8?q?=E6=88=90=E7=BB=A9=E7=AD=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/pages/achievement/info/course.vue | 12 ++++----
src/pages/achievement/info/project.vue | 40 ++++++++++++++------------
src/pages/achievement/list/course.vue | 2 +-
src/pages/achievement/list/project.vue | 2 +-
src/pages/assessment/list/index.vue | 2 +-
src/pages/match/add/step2.vue | 39 ++++++++++++++++++-------
src/pages/product/show/index.vue | 2 +-
src/pages/station/list/index.vue | 2 +-
8 files changed, 62 insertions(+), 39 deletions(-)
diff --git a/src/pages/achievement/info/course.vue b/src/pages/achievement/info/course.vue
index 6e3c916..88cf2fc 100644
--- a/src/pages/achievement/info/course.vue
+++ b/src/pages/achievement/info/course.vue
@@ -301,7 +301,7 @@ export default {
accountId: this.$route.query.accountId,
id: +this.$route.query.id,
cid: +this.$route.query.cid,
- classId: +this.$route.query.classId,
+ classId: this.$route.query.classId ? +this.$route.query.classId : '',
classList: [],
keyword: "",
searchTimer: null,
@@ -339,8 +339,8 @@ export default {
}
},
mounted () {
+ this.classId = +this.$route.query.classId || ''
this.getClass()
- this.initData()
},
methods: {
// 成绩
@@ -388,8 +388,10 @@ export default {
},
// 获取班级下拉框数据
getClass () {
- this.$post(this.api.allClassesInOurSchool).then(res => {
- this.classList = res.data
+ this.$post(this.api.allClassesInOurSchool).then(({ data }) => {
+ if (data.length && !this.classId) this.classId = data[0].id
+ this.classList = data
+ this.initData()
}).catch(res => { })
},
// 班级切换回调
@@ -561,7 +563,7 @@ export default {
toReport (row) {
this.$store.commit('achievement/setRow', this.curRow)
// 考核跳实验报告,练习跳项目维度的成绩详情
- this.$router.push(this.curTab == 1 ? `show?reportId=${row.reportId}` : `project?id=${row.projectId}&projectName=${row.goodsName}&classId=${this.curRow.classId || ''}&workNumber=${row.workNumber || row.userName}&mallId=${this.id}`)
+ this.$router.push(this.curTab == 1 ? `show?reportId=${row.reportId}` : `project?id=${row.projectId}&projectName=${row.projectName}&classId=${this.curRow.classId || ''}&workNumber=${row.workNumber || row.userName}&mallId=${this.id}`)
},
getChart () { // 初始化折线图
const data = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
diff --git a/src/pages/achievement/info/project.vue b/src/pages/achievement/info/project.vue
index cd87fc7..c478c81 100644
--- a/src/pages/achievement/info/project.vue
+++ b/src/pages/achievement/info/project.vue
@@ -363,22 +363,26 @@ export default {
this.loadIns = Loading.service({
background: "rgba(255,255,255,.6)"
})
- // 考核和练习调不同接口
- const res = this.permissions ?
- await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}&mallId=${this.mallId}`) :
- await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`)
- this.listData = res.page.records
- this.total = res.page.total
- this.avgScore = (+res.avgScore).toFixed(2)
- this.examCount = res.examCount
- this.peopleNum = res.peopleNum
- this.maxScore = res.maxScore
- this.minScore = res.minScore
- this.errorAnalysis = res.errorAnalysis || {}
- this.max = res.highestErrorRate || {}
- this.min = res.minimumErrorRate || {}
- this.getChart()
- this.errorChart()
+ try {
+ // 考核和练习调不同接口
+ const res = this.permissions ?
+ await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}&mallId=${this.mallId}`) :
+ await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=${this.pageSize}&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`)
+ this.listData = res.page.records
+ this.total = res.page.total
+ this.avgScore = (+res.avgScore).toFixed(2)
+ this.examCount = res.examCount
+ this.peopleNum = res.peopleNum
+ this.maxScore = res.maxScore
+ this.minScore = res.minScore
+ this.errorAnalysis = res.errorAnalysis || {}
+ this.max = res.highestErrorRate || {}
+ this.min = res.minimumErrorRate || {}
+ this.getChart()
+ this.errorChart()
+ } catch (e) {
+ this.loadIns.close()
+ }
},
// 活跃度
async getActivity () {
@@ -429,8 +433,8 @@ export default {
if (!this.multipleSelection.length) {
// 考核和练习调不同接口
const res = this.permissions ?
- await this.$post(`${this.api.getAssessmentDetail}?pageNum=${this.page}&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}&mallId=${this.mallId}`) :
- await this.$post(`${this.api.getPracticeDetail}?pageNum=${this.page}&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`)
+ await this.$post(`${this.api.getAssessmentDetail}?pageNum=1&pageSize=10000&assessmentId=${this.id}&classId=${this.classId}&keyword=${this.keyword}&mallId=${this.mallId}`) :
+ await this.$post(`${this.api.getPracticeDetail}?pageNum=1&pageSize=10000&projectId=${this.id}&keyWord=${this.keyword}&classId=${this.classId}&mallId=${this.mallId}`)
list = res.page.records
}
diff --git a/src/pages/achievement/list/course.vue b/src/pages/achievement/list/course.vue
index 8317940..73b13bc 100644
--- a/src/pages/achievement/list/course.vue
+++ b/src/pages/achievement/list/course.vue
@@ -261,7 +261,7 @@ export default {
},
// 进入实验记录
entry (row) {
- this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}&classId=${row.classId}`)
+ this.$router.push(`course?id=${row.mallId}&curriculumName=${row.curriculumName}&cid=${row.cid}`)
},
handleCurrentChange (val) { // 切换页码
this.page = val
diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue
index ac386e9..6e3e6c2 100644
--- a/src/pages/achievement/list/project.vue
+++ b/src/pages/achievement/list/project.vue
@@ -359,7 +359,7 @@ export default {
},
// 进入实验记录
entry (row) {
- this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.mallId}&classId=${row.classId}`)
+ this.$router.push(`project?id=${row.assessmentId || row.projectId}&projectName=${row.projectName}&permissions=${row.permissions || 0}&mallId=${this.mallId}&classId=${row.classId || ''}`)
},
handleDelete (row) { // 删除
this.$confirm("该项目下的所有成绩报告将会删除,是否继续?", "提示", {
diff --git a/src/pages/assessment/list/index.vue b/src/pages/assessment/list/index.vue
index b92f74b..e13c940 100644
--- a/src/pages/assessment/list/index.vue
+++ b/src/pages/assessment/list/index.vue
@@ -456,7 +456,7 @@ export default {
this.$router.push(`add?id=${row.id}`);
},
show (row) {
- this.$router.push(`/achievement/project?id=${row.id}&projectName=${row.projectName}&permissions=1`)
+ this.$router.push(`/achievement/project?id=${row.id}&projectName=${row.projectName}&permissions=1&classId=${row.classId}`)
},
start (row) {
this.$post(`${this.api.enableAssessment}?id=${row.id}`).then(async res => {
diff --git a/src/pages/match/add/step2.vue b/src/pages/match/add/step2.vue
index 113a76d..48ea3dc 100644
--- a/src/pages/match/add/step2.vue
+++ b/src/pages/match/add/step2.vue
@@ -39,9 +39,11 @@
class="tips">
(团队赛是否限制队内每个成员只能参加一个阶段赛项?