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 }}

@@ -26,9 +35,9 @@ -
- {{ - item }} +
@@ -36,102 +45,56 @@
-
- 上传成绩 - 批量删除 - {{ exporting ? '正在导出' : '批量导出' - }} -
-
- {{ exporting1 ? '正在导出' : '批量导出' - }} -
+ {{ exporting ? '正在导出' : '批量导出' + }} +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + - -
{ - e.loading = false - e.fileType = '其他' - if (util.isVideo(e.fileFormat)) { - e.fileType = '视频' - } else if (util.isAudio(e.fileFormat)) { - e.fileType = '音频' - } else if (util.isImg(e.fileFormat)) { - e.fileType = '图片' - } else if (util.isDoc(e.fileFormat)) { - e.fileType = '文档' - } else if (util.isCompress(e.fileFormat)) { - e.fileType = '压缩包' - } else if (e.fileType === 'pdf') { - e.fileType = 'pdf' - } - }) - this.list1 = data.records - this.total1 = data.total - this.loading = false - } else { // 成绩列表 - const { data, page } = await this.$post(this.api.stageGradeManagementList, { - pageNum: this.page, - pageSize: this.pageSize, - competitionId: this.id, - keyWord: this.keyword, - stageId: this.stageId, - isNakadai: 1 - }) - this.loading = false - this.total = page.total - this.list = page.records - this.statData = data - this.avgScore = (+data.avgScore).toFixed(2) - this.method != 2 && this.getChart() - } + const { data, page } = await this.$post(this.api.stageGradeManagementList, { + pageNum: this.page, + pageSize: this.pageSize, + competitionId: this.id, + keyWord: this.keyword, + stageId: this.stageId, + isNakadai: 1, + participatingState: this.active, + }) + this.loading = false + this.total = page.total + this.list = page.records + this.statData = data + this.getChart() }, initData () { this.page = 1 @@ -284,7 +228,7 @@ export default { }, // 查看成绩报告 show (row) { - this.$router.push(`/trialReport?reportId=${row.reportId}`) + this.$router.push(`/${this.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) }, // 导出(有勾选:就导勾选中的;没有勾选:就导全部) async exportData () { @@ -305,6 +249,7 @@ export default { competitionId: this.id, isNakadai: 1, stageId: this.stageId, + participatingState: this.active, }, { headers: this.headers, responseType: 'blob' @@ -314,31 +259,22 @@ export default { } } }, - // 导出(有勾选:就导勾选中的;没有勾选:就导全部) - exportData1 () { - this.exporting1 = true - let list = this.list1 - if (this.multipleSelection1.length) { - list = this.multipleSelection1 - } - Zip('批量导出', list, () => { - this.exporting1 = false + async handleDelete (row) { // 删除 + await this.$confirm(`

确认要删除【${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 }}

@@ -35,9 +26,9 @@ -
- {{ item.name }} +
@@ -45,56 +36,102 @@
- {{ exporting ? '正在导出' : '批量导出' - }} -
- - - - - - - - - - - - - - - - - - - - - - - - - - - + +
{ this.$router.push({ - path: '/theoryArchList', + path: '/otherArchList', query: { ...this.$route.query, keyword: val @@ -207,20 +232,51 @@ export default { methods: { async getData () { this.loading = true - const { data, page } = await this.$post(this.api.stageGradeManagementList, { - pageNum: this.page, - pageSize: this.pageSize, - competitionId: this.id, - keyWord: this.keyword, - stageId: this.stageId, - isNakadai: 1, - participatingState: this.active, - }) - this.loading = false - this.total = page.total - this.list = page.records - this.statData = data - this.getChart() + // 文件列表 + if (this.active) { + const { data } = await this.$post(this.api.cCompetitionStageFileList, { + pageNum: this.page1, + pageSize: this.pageSize, + competitionId: this.id, + stageId: this.stageId, + keyWord: this.keyword, + }) + data.records.forEach(e => { + e.loading = false + e.fileType = '其他' + if (util.isVideo(e.fileFormat)) { + e.fileType = '视频' + } else if (util.isAudio(e.fileFormat)) { + e.fileType = '音频' + } else if (util.isImg(e.fileFormat)) { + e.fileType = '图片' + } else if (util.isDoc(e.fileFormat)) { + e.fileType = '文档' + } else if (util.isCompress(e.fileFormat)) { + e.fileType = '压缩包' + } else if (e.fileType === 'pdf') { + e.fileType = 'pdf' + } + }) + this.list1 = data.records + this.total1 = data.total + this.loading = false + } else { // 成绩列表 + const { data, page } = await this.$post(this.api.stageGradeManagementList, { + pageNum: this.page, + pageSize: this.pageSize, + competitionId: this.id, + keyWord: this.keyword, + stageId: this.stageId, + isNakadai: 1 + }) + this.loading = false + this.total = page.total + this.list = page.records + this.statData = data + this.avgScore = (+data.avgScore).toFixed(2) + this.method != 2 && this.getChart() + } }, initData () { this.page = 1 @@ -228,7 +284,7 @@ export default { }, // 查看成绩报告 show (row) { - this.$router.push(`/${this.method === 1 ? 'theoryReport' : 'trialReport'}?reportId=${row.reportId}`) + this.$router.push(`/trialReport?reportId=${row.reportId}`) }, // 导出(有勾选:就导勾选中的;没有勾选:就导全部) async exportData () { @@ -249,7 +305,6 @@ export default { competitionId: this.id, isNakadai: 1, stageId: this.stageId, - participatingState: this.active, }, { headers: this.headers, responseType: 'blob' @@ -259,22 +314,31 @@ export default { } } }, - async handleDelete (row) { // 删除 - await this.$confirm(`

确认要删除【${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; } }