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"> (团队赛是否限制队内每个成员只能参加一个阶段赛项? + :label="1" + @change="teamLimitChange">是 + :label="0" + @change="teamLimitChange">否 ) @@ -80,13 +82,14 @@ * 团队参赛人数限制: 不限制 + :label="0" + @change="item.teamNumLimit = 0">不限制 自定义 人 + :disabled="item.teamNumLimitOpt === 0 || form.teamLimit === 1"> 人 (可限制本阶段单个团队的出战人数)
', score: '', - teamNumLimit: '', - teamNumLimitOpt: 0, + teamNumLimit: 1, + teamNumLimitOpt: 1, resultAnnouncementTime: '', resultsDetails: '', }, @@ -259,8 +262,8 @@ export default { scoreLimit: '', operator: '>', score: '', - teamNumLimit: '', - teamNumLimitOpt: 0, + teamNumLimit: 1, + teamNumLimitOpt: 1, resultAnnouncementTime: '', resultsDetails: '', }, @@ -275,8 +278,8 @@ export default { scoreLimit: '', operator: '>', score: '', - teamNumLimit: '', - teamNumLimitOpt: 0, + teamNumLimit: 1, + teamNumLimitOpt: 1, resultAnnouncementTime: '', resultsDetails: '', } @@ -368,6 +371,14 @@ export default { this.form.competitionStageList = stages.slice(0, val) } }, + teamLimitChange (e) { + if (e === 1) { + this.form.competitionStageList.forEach(e => { + e.teamNumLimitOpt = 1 + e.teamNumLimit = 1 + }) + } + }, // 提交 save (status, next = 0, releaseType, cb) { let { form } = this @@ -392,6 +403,8 @@ export default { } form.competitionStageList = stages.slice(0, 1) // 单项赛只需要存第一个阶段的数据 } else { // 非积分赛则全部字段校验 + let teamNumLimit = 0 + const { competitionType, minTeamSize, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 for (const i in stages) { const e = stages[i] if (rule !== 2 && !e.stageName) { @@ -399,7 +412,6 @@ export default { util.errorMsg('请输入阶段名称') break } - const { competitionType, maxTeamSize } = step1.completeCompetitionSetup // 0为个人赛,1为团队赛 // rule: 0为积分赛,1为淘汰赛,2为单项赛 // 积分赛 if (!rule) { @@ -447,8 +459,13 @@ export default { } e.resultAnnouncementTime = +e.resultAnnouncementTime } + if (e.teamNumLimit) teamNumLimit += e.teamNumLimit // 各阶段自定义的人数之和 } if (invalid) return + if (form.teamLimit) { + if (stages.length > minTeamSize) return util.errorMsg('阶段数不得大于团队人数下限') + if (teamNumLimit > minTeamSize) return util.errorMsg('各阶段自定义的参赛人数之和不得大于团队人数下限') + } if (form.resultCalculationMethod == 0 && !rule && pointWeight > 0 && pointWeight !== 100) return util.errorMsg('权重须等于100,请重新输入') } } else { // 保存草稿的情况下,只保存输入了阶段名称的阶段 diff --git a/src/pages/product/show/index.vue b/src/pages/product/show/index.vue index e52e897..4ad1f18 100644 --- a/src/pages/product/show/index.vue +++ b/src/pages/product/show/index.vue @@ -336,7 +336,7 @@ export default { toStation () { if (this.isCourse) { // 如果是课程,直接进入实验台 this.$post(`${this.api.addLearningRecord}?mallId=${this.id}`).then(res => { - this.$router.push('/station/preview?courseId=' + this.form.mall.associatedProduct + '&curriculumName=' + this.form.mall.productName + '&mallId=' + this.id) + this.$router.push('/station/preview?courseId=' + this.form.mall.associatedProduct + '&curriculumName=' + this.form.mall.productName + '&mallId=' + this.id + '&admin=1') }).catch(res => { }) } else if (this.withLink) { // 如果没有绑定产品,并且有设置关联链接,则弹框选择链接 this.linkVisible = true diff --git a/src/pages/station/list/index.vue b/src/pages/station/list/index.vue index 4f1db38..add214a 100644 --- a/src/pages/station/list/index.vue +++ b/src/pages/station/list/index.vue @@ -97,7 +97,7 @@ export default { }); }, goPreview (item) { - this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}&admin=1`); + this.$router.push(`/station/preview?courseId=${item.cid}&curriculumName=${item.goodsName}&mallId=${item.mallId || ''}`); }, // tab切换 tabChange (item) {