From f3e795125d375279d88a2d96ccfaef5d5f13983c Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Thu, 26 Sep 2024 13:53:28 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/router/index.js | 8 +- src/views/match/manage/matchArch.vue | 2 +- src/views/match/manage/matchArchList.vue | 314 +++++++---------- src/views/match/manage/matchInfo.vue | 4 +- .../{theoryArchList.vue => otherArchList.vue} | 318 +++++++++++------- 5 files changed, 323 insertions(+), 323 deletions(-) rename src/views/match/manage/{theoryArchList.vue => otherArchList.vue} (55%) diff --git a/src/router/index.js b/src/router/index.js index a1d72d1..402c9e4 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -114,8 +114,8 @@ let router = new Router({ component: () => import('../views/match/manage/noticeDetail'), }, { - path: '/matchArchList', - component: () => import('../views/match/manage/matchArchList'), + path: '/otherArchList', + component: () => import('../views/match/manage/otherArchList'), }, { path: '/matchRank', @@ -126,8 +126,8 @@ let router = new Router({ component: () => import('../views/match/manage/trialReport'), }, { - path: '/theoryArchList', - component: () => import('../views/match/manage/theoryArchList'), + path: '/matchArchList', + component: () => import('../views/match/manage/matchArchList'), }, { path: '/theoryReport', diff --git a/src/views/match/manage/matchArch.vue b/src/views/match/manage/matchArch.vue index 66cc1c6..61b8245 100644 --- a/src/views/match/manage/matchArch.vue +++ b/src/views/match/manage/matchArch.vue @@ -101,7 +101,7 @@ export default { this.$store.commit('setInnerReferrer', this.$route.fullPath) const cur = this.form.competitionStage[i] const showFile = !!(cur.method === 2 && cur.competitionStageContentSetting && cur.competitionStageContentSetting.whetherToUploadFiles) - this.$router.push(`/${cur.method === 2 ? 'matchArchList' : 'theoryArchList'}?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`) + this.$router.push(`/${cur.method === 2 ? 'otherArchList' : 'matchArchList'}?id=${this.id}&stageId=${row.stageId}&method=${row.method}&competitionType=${row.competitionType}&showFile=${showFile}`) } } }; diff --git a/src/views/match/manage/matchArchList.vue b/src/views/match/manage/matchArchList.vue index 344bd01..eb0a392 100644 --- a/src/views/match/manage/matchArchList.vue +++ b/src/views/match/manage/matchArchList.vue @@ -17,8 +17,17 @@
实验平均分
-{{ avgScore }}
+平均分
+{{ (+statData.avgScore).toFixed(2) }}
+最高分
+{{ statData.maxScore }} +
+最低分
+{{ statData.minScore }}
确认要删除【${row.userName}】的成绩记录吗?
删除后成绩数据不可恢复,自动变为未提交
`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning', + closeOnClickModal: false, + dangerouslyUseHTMLString: true, }) - }, - handleDelete (row) { // 删除 - this.$confirm("确定要删除吗?", "提示", { - type: "warning" - }).then(() => { - this.$post(this.api.batchDeleteContestGrade, { - ids: [this.method == 2 ? row.scoreId : row.reportId], - competitionId: this.id, - stageId: this.stageId - }).then(res => { - util.successMsg("删除成功"); - this.getData(); - }).catch(res => { - }); - }).catch(() => { }); + + await this.$post(this.api.batchDeleteContestGrade, { + ids: [this.method == 2 ? row.scoreId : row.reportId], + competitionId: this.id, + stageId: this.stageId + }) + util.successMsg("删除成功") + this.getData() }, delAllData () { // 批量删除 const list = this.multipleSelection @@ -382,16 +318,8 @@ export default { handleSelectionChange1 (val) { // 多选 this.multipleSelection1 = val; }, - handleCurrentChange1 (val) { // 切换分页 - this.page1 = val; - this.getData(); - }, getChart () { // 初始化折线图 - const data = [] - const { statData } = this - for (let i = 1; i <= 10; i++) { - data.push(statData['num' + i]) - } + const { fractionalSegmentCounts: data } = this.statData let myChart = echarts.init(document.getElementById("chart")); myChart.setOption({ title: { text: "实验分数分布图" }, @@ -401,7 +329,7 @@ export default { type: "category", boundaryGap: false, interval: 10, - data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"] + data: data.map(e => e.range) }, yAxis: { name: "人数", @@ -409,7 +337,7 @@ export default { minInterval: 10 }, series: [{ - data, + data: data.map(e => e.count), type: "line", areaStyle: {}, color: ["#8191fd"] @@ -490,8 +418,10 @@ export default { }, // tab回调 tabChange (i) { + this.multipleSelection = [] + this.$refs.table.clearSelection() this.active = i - this.getData() + this.initData() }, // 预览附件 preview (item) { @@ -545,7 +475,9 @@ export default { .nums { display: flex; + flex-wrap: wrap; align-items: center; + width: 640px; margin-right: 20px; .item:nth-child(1) { @@ -556,6 +488,14 @@ export default { background-image: url('../../../assets/img/avg.png'); } + .item:nth-child(3) { + background-image: url('../../../assets/img/ach1.png'); + } + + .item:nth-child(4) { + background-image: url('../../../assets/img/ach2.png'); + } + .item { width: 300px; min-height: 145px; @@ -580,7 +520,7 @@ export default { } .chart { - flex: 1; + width: calc(100% - 660px); height: 300px; } } diff --git a/src/views/match/manage/matchInfo.vue b/src/views/match/manage/matchInfo.vue index ef2f3c7..f7dec3f 100644 --- a/src/views/match/manage/matchInfo.vue +++ b/src/views/match/manage/matchInfo.vue @@ -570,9 +570,9 @@ export default { }, // 查看成绩详情 show (row) { + this.curRow = row // 团队展示弹框,个人跳转实验报告 if (this.form.completeCompetitionSetup.competitionType) { // 团队比赛并且是队长,则展示团队成员成绩详情 - this.curRow = row this.memberVisible = true if (this.info.teamId) { this.getMembers() @@ -589,7 +589,7 @@ export default { }, // 跳转实验报告 toReport (row) { - this.$router.push(`/matchReport?reportId=${row.reportId}`) + this.$router.push(`/${this.curRow.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) }, back () { this.$router.push(this.$store.state.innerReferrer) diff --git a/src/views/match/manage/theoryArchList.vue b/src/views/match/manage/otherArchList.vue similarity index 55% rename from src/views/match/manage/theoryArchList.vue rename to src/views/match/manage/otherArchList.vue index 02e65c7..6b39ad0 100644 --- a/src/views/match/manage/theoryArchList.vue +++ b/src/views/match/manage/otherArchList.vue @@ -17,17 +17,8 @@平均分
-{{ (+statData.avgScore).toFixed(2) }}
-最高分
-{{ statData.maxScore }} -
-最低分
-{{ statData.minScore }}
+实验平均分
+{{ avgScore }}
确认要删除【${row.userName}】的成绩记录吗?
删除后成绩数据不可恢复,自动变为未提交
`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning', - closeOnClickModal: false, - dangerouslyUseHTMLString: true, - }) - - await this.$post(this.api.batchDeleteContestGrade, { - ids: [this.method == 2 ? row.scoreId : row.reportId], - competitionId: this.id, - stageId: this.stageId + // 导出(有勾选:就导勾选中的;没有勾选:就导全部) + exportData1 () { + this.exporting1 = true + let list = this.list1 + if (this.multipleSelection1.length) { + list = this.multipleSelection1 + } + Zip('批量导出', list, () => { + this.exporting1 = false }) - util.successMsg("删除成功") - this.getData() + }, + handleDelete (row) { // 删除 + this.$confirm("确定要删除吗?", "提示", { + type: "warning" + }).then(() => { + this.$post(this.api.batchDeleteContestGrade, { + ids: [this.method == 2 ? row.scoreId : row.reportId], + competitionId: this.id, + stageId: this.stageId + }).then(res => { + util.successMsg("删除成功"); + this.getData(); + }).catch(res => { + }); + }).catch(() => { }); }, delAllData () { // 批量删除 const list = this.multipleSelection @@ -305,7 +369,7 @@ export default { }, handleCurrentChange (val) { // 切换分页 this.$router.push({ - path: '/theoryArchList', + path: '/otherArchList', query: { ...this.$route.query, page: val @@ -318,8 +382,16 @@ export default { handleSelectionChange1 (val) { // 多选 this.multipleSelection1 = val; }, + handleCurrentChange1 (val) { // 切换分页 + this.page1 = val; + this.getData(); + }, getChart () { // 初始化折线图 - const { fractionalSegmentCounts: data } = this.statData + const data = [] + const { statData } = this + for (let i = 1; i <= 10; i++) { + data.push(statData['num' + i]) + } let myChart = echarts.init(document.getElementById("chart")); myChart.setOption({ title: { text: "实验分数分布图" }, @@ -329,7 +401,7 @@ export default { type: "category", boundaryGap: false, interval: 10, - data: data.map(e => e.range) + data: ["0-10", "10-20", "20-30", "30-40", "40-50", "50-60", "60-70", "70-80", "80-90", "90-100"] }, yAxis: { name: "人数", @@ -337,7 +409,7 @@ export default { minInterval: 10 }, series: [{ - data: data.map(e => e.count), + data, type: "line", areaStyle: {}, color: ["#8191fd"] @@ -418,10 +490,8 @@ export default { }, // tab回调 tabChange (i) { - this.multipleSelection = [] - this.$refs.table.clearSelection() this.active = i - this.initData() + this.getData() }, // 预览附件 preview (item) { @@ -475,9 +545,7 @@ export default { .nums { display: flex; - flex-wrap: wrap; align-items: center; - width: 640px; margin-right: 20px; .item:nth-child(1) { @@ -488,14 +556,6 @@ export default { background-image: url('../../../assets/img/avg.png'); } - .item:nth-child(3) { - background-image: url('../../../assets/img/ach1.png'); - } - - .item:nth-child(4) { - background-image: url('../../../assets/img/ach2.png'); - } - .item { width: 300px; min-height: 145px; @@ -520,7 +580,7 @@ export default { } .chart { - width: calc(100% - 660px); + flex: 1; height: 300px; } }