From 9811ac3bbd63079da7a65d34ec2855a4cc0d1ea7 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Mon, 11 Nov 2024 14:14:22 +0800 Subject: [PATCH] fix --- src/api/index.js | 2 + src/layouts/navbar/index.vue | 8 +- src/pages/account/redirect/index.vue | 2 + src/pages/achievement/info/course.vue | 20 ++- src/pages/achievement/info/project.vue | 93 ++++++++---- src/pages/achievement/list/project.vue | 4 +- src/pages/assessment/list/index.vue | 195 +++++++------------------ src/pages/review/list/index.vue | 6 +- src/pages/system/list/role.vue | 121 ++++----------- src/setting.js | 2 +- 10 files changed, 183 insertions(+), 270 deletions(-) diff --git a/src/api/index.js b/src/api/index.js index 34ac49d..1b0354d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -136,6 +136,8 @@ export default { exportProductAssessResults: `${host}occupationlab/occupationlab/achievement/exportProductAssessResults`, exportMultipleExperimentalReports: `${host}occupationlab/occupationlab/achievement/exportMultipleExperimentalReports`, batchExportReportsAsZip: `${host}occupationlab/occupationlab/achievement/batchExportReportsAsZip`, + exportExamPaperReports: `${host}exam/exam/paper/exportExamPaperReports`, + exportPracticePaperExperimentReport: `${host}exam/exam/paper/exportPracticePaperExperimentReport`, // 项目管理 getSystemIdBySchool: `occupationlab/occupationlab/projectManage/getSystemIdBySchool`, // 获取学校下拥有的系统 diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 19bb528..6eadcf4 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -107,7 +107,7 @@ export default { }, { icon: "el-icon-setting", - index: "/review/list", + index: "/review", title: "评阅平台" }, { @@ -133,13 +133,13 @@ export default { }, watch: { "$route" (to, from) { - let actives = this.actives; - for (let i in this.actives) { + let { actives } = this + for (let i in actives) { if (actives[i].includes(this.$route.name)) this.active = `/${i}/list`; } let arr = this.$route.path.split("/"); let name = `/${arr[1]}/list` - this.active = name; + this.active = name === '/review/list' ? '/review' : name } }, created () { diff --git a/src/pages/account/redirect/index.vue b/src/pages/account/redirect/index.vue index 830120d..3f19949 100644 --- a/src/pages/account/redirect/index.vue +++ b/src/pages/account/redirect/index.vue @@ -22,6 +22,8 @@ export default { "setCustomerName" ]), setLogin () { + localStorage.removeItem('review_token') + localStorage.removeItem('reviewPath') this.SET_FROM(true) Util.local.set(Setting.tokenKey, window.atob(decodeURI(this.token)), Setting.tokenExpires); this.getRole() diff --git a/src/pages/achievement/info/course.vue b/src/pages/achievement/info/course.vue index e64bd36..2562979 100644 --- a/src/pages/achievement/info/course.vue +++ b/src/pages/achievement/info/course.vue @@ -45,7 +45,7 @@
错误率最高: -
+
参加考试{{ permissions ? (max.numberOfParticipants || 0) : (max.quantityAfterWeightRemoval || 0) }}人 | {{ curTab == 1 ? `共${max.itemErrorCount || 0}人做错,` : '' }}错误率{{ max.errorRate || 0 @@ -54,7 +54,7 @@
错误率最低: -
+
参加考试{{ permissions ? (min.numberOfParticipants || 0) : (min.quantityAfterWeightRemoval || 0) }}人 | {{ curTab == 1 ? `共${min.itemErrorCount || 0}人做错,` : '' }}错误率{{ min.errorRate || 0 @@ -514,6 +514,14 @@ export default { errorChart () { const data = this.errorAnalysis const maxFontLength = data.length > 13 ? 6 : 10 + const xData = [] + const yData = [] + data.forEach(e => { + const el = document.createElement('div') + el.innerHTML = e.projectName + xData.push(el.innerText) + yData.push(e.errorRate) + }) const option = { tooltip: { trigger: 'axis', @@ -567,7 +575,7 @@ export default { }, rotate: data.length > 16 ? 45 : 0 }, - data: data.map(e => e.projectName) + data: xData }], yAxis: [ { @@ -614,7 +622,7 @@ export default { shadowColor: 'rgba(0, 0, 0, 0.1)', } }, - data: data.map(e => e.errorRate) + data: yData } ] } @@ -709,6 +717,10 @@ export default { width: 500px; margin-right: 100px; } + + .jud-html { + max-width: 410px; + } } } \ No newline at end of file diff --git a/src/pages/achievement/info/project.vue b/src/pages/achievement/info/project.vue index 9191a3c..77b3698 100644 --- a/src/pages/achievement/info/project.vue +++ b/src/pages/achievement/info/project.vue @@ -50,7 +50,7 @@
错误率最高: -
+
参加考试{{ peopleNum }}人 | {{ permissions ? `共${max.errorTotal || 0}人做错,` : '' }}错误率{{ max.errorRate }}% @@ -58,7 +58,7 @@
错误率最低: -
+
参加考试{{ peopleNum }}人 | {{ permissions ? `共${min.errorTotal || 0}人做错,` : '' }}错误率{{ min.errorRate }}% @@ -188,6 +188,7 @@ export default { id: this.$route.query.id || '', paperId: this.$route.query.paperId || '', mallId: this.$route.query.mallId, + cid: this.$route.query.cid || '', workNumber: this.$route.query.workNumber, keyword: "", searchTimer: null, @@ -339,30 +340,58 @@ export default { }, // 导出实验报告 async exportReport () { - this.exporting = true - // 选择了数据则导出选中的,否则不用给reportId,导出全部 - let list = this.multipleSelection - let reportIds = [] - if (list.length) { - list.map(e => { - e.reportId && reportIds.push(e.reportId) - }) - } + if (this.list.length) { + this.exporting = true + // 选择了数据则导出选中的,否则不用给reportId,导出全部 + let list = this.multipleSelection + let reportIds = [] + if (list.length) { + list.map(e => { + e.reportId && reportIds.push(e.reportId) + }) + } + + const per = this.permissions + let res + if (this.list[0].paperId) { + // 理论 + const data = { + ids: reportIds, + } + if (!reportIds.length) { + if (per) { + data.assessmentId = this.id + } else { + data.examPaperId = this.paperId + data.mallId = this.mallId + data.cid = this.cid + } + } + res = await axios.post(this.api[per ? 'exportExamPaperReports' : 'exportPracticePaperExperimentReport'], data, { + headers: { + token: this.token + }, + responseType: 'blob' + }) + } else { + // 实训 + const data = { + mallId: this.mallId, + reportIds + } + data[per ? 'assessmentId' : 'projectId'] = this.id || this.paperId + res = await axios.post(this.api.batchExportReportsAsZip, data, { + headers: { + token: this.token + }, + responseType: 'blob' + }) + } - const data = { - mallId: this.mallId, - reportIds + const name = res.headers['content-disposition'] + Util.downloadFileDirect(name ? decodeURI(name) : '成绩报告.zip', new Blob([res.data])) + this.exporting = false } - data[this.permissions ? 'assessmentId' : this.paperId ? 'paperId' : 'projectId'] = this.id || this.paperId - const res = await axios.post(this.api.batchExportReportsAsZip, data, { - headers: { - token: this.token - }, - responseType: 'blob' - }) - const name = res.headers['content-disposition'] - Util.downloadFileDirect(name ? decodeURI(name) : '成绩报告.zip', new Blob([res.data])) - this.exporting = false }, handleDelete (row) { // 删除 this.$confirm("确定要删除吗?", "提示", { @@ -489,6 +518,14 @@ export default { errorChart () { const data = this.errorAnalysis.scoringPointList const maxFontLength = data.length > 13 ? 6 : 10 + const xData = [] + const yData = [] + data.forEach(e => { + const el = document.createElement('div') + el.innerHTML = e.judgmentName + xData.push(el.innerText) + yData.push(e.errorRate) + }) const option = { tooltip: { trigger: 'axis', @@ -540,7 +577,7 @@ export default { }, // rotate: 45 }, - data: data.map(e => e.judgmentName) + data: xData }], yAxis: [ { @@ -587,7 +624,7 @@ export default { shadowColor: 'rgba(0, 0, 0, 0.1)', } }, - data: data.map(e => e.errorRate) + data: yData } ] } @@ -696,6 +733,10 @@ export default { width: 500px; margin-right: 100px; } + + .jud-html { + max-width: 410px; + } } } \ No newline at end of file diff --git a/src/pages/achievement/list/project.vue b/src/pages/achievement/list/project.vue index 654b037..66411ca 100644 --- a/src/pages/achievement/list/project.vue +++ b/src/pages/achievement/list/project.vue @@ -250,8 +250,10 @@ export default { }, // 进入实验记录 entry (row) { + const { mallId } = this.form + const cur = this.curs.find(e => e.mallId == mallId) || {} this.$store.commit('achievement/setReferrer', `${this.$route.path}?${qs.stringify(this.form)}&page=${this.page}`) - this.$router.push(`project?id=${row.assessmentId || row.projectId || ''}&paperId=${row.paperId || ''}&projectName=${row.projectName}&permissions=${this.form.permissions}&mallId=${this.form.mallId}&classId=${row.classId || ''}`) + this.$router.push(`project?id=${row.assessmentId || row.projectId || ''}&paperId=${row.paperId || ''}&cid=${cur.cid}&projectName=${row.projectName || ''}&permissions=${this.form.permissions}&mallId=${this.form.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 441bef7..48e71f6 100644 --- a/src/pages/assessment/list/index.vue +++ b/src/pages/assessment/list/index.vue @@ -1,62 +1,34 @@ - - + + - + - + - +
- +
- + 取 消 - 确 定 + 确 定
@@ -324,5 +266,4 @@ export default { } }; - \ No newline at end of file + \ No newline at end of file diff --git a/src/setting.js b/src/setting.js index d7a1dfb..775a6a6 100644 --- a/src/setting.js +++ b/src/setting.js @@ -97,7 +97,7 @@ const Setting = { // 相同路由,不同参数间进行切换,是否强力更新 sameRouteForceUpdate: false, // 是否使用动态路由(即角色权限,开启了的话就会取后端返回的权限树来显示头部导肮和页面按钮) - dynamicRoute: false, + dynamicRoute: true, // 文件上传 upload: { apiURL: uploadURL,