Commit 7812e986196aed320204e84d5487c29b5b061fbf
1 parent
22095aba
班主任查看报表添加额外信息
Showing
28 changed files
with
114 additions
and
46 deletions
src/api/axios.js
| ... | ... | @@ -24,6 +24,13 @@ service.interceptors.request.use( |
| 24 | 24 | const source = axios.CancelToken.source(); |
| 25 | 25 | store.commit("setTokenSources", [source.token, source.cancel]); |
| 26 | 26 | config.cancelToken = source.token; |
| 27 | + const role = store.getters.info.showRole || store.getters.info.permissions[0].role; | |
| 28 | + if (role == "ROLE_BANZHUREN") { | |
| 29 | + const classes = store.getters.classes | |
| 30 | + config.manager = 1 | |
| 31 | + config.classes = classes | |
| 32 | + } | |
| 33 | + console.log(config) | |
| 27 | 34 | return config; |
| 28 | 35 | }, |
| 29 | 36 | (error) => { | ... | ... |
src/components/charts/lineChart.vue
src/components/exportDia.vue
| ... | ... | @@ -25,10 +25,13 @@ |
| 25 | 25 | <el-table-column prop="studentName" label="姓名" align="center"></el-table-column> |
| 26 | 26 | <el-table-column label="班名" align="center"> |
| 27 | 27 | <template slot-scope="scoped">{{ |
| 28 | - scoped.row.classRank || scoped.row.rank }}</template> | |
| 28 | + scoped.row.classRank || scoped.row.rank || scoped.row.examList[0].classRank }}</template> | |
| 29 | 29 | </el-table-column> |
| 30 | - <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{ | |
| 31 | - scoped.row.correctRate|| scoped.row.scoringRate }}%</template></el-table-column> | |
| 30 | + <el-table-column prop="correctRate" :label="this.lastLabel" align="center"><template slot-scope="scoped"> | |
| 31 | + <span v-if="scoped.row.correctRate || scoped.row.scoringRate">{{ | |
| 32 | + scoped.row.correctRate || scoped.row.scoringRate }}%</span> | |
| 33 | + <span v-else>{{ scoped.row.examList[0].score }}</span> | |
| 34 | + </template></el-table-column> | |
| 32 | 35 | </el-table> |
| 33 | 36 | </ul> |
| 34 | 37 | <div class="dialog-footer" slot="footer"> |
| ... | ... | @@ -44,7 +47,11 @@ export default { |
| 44 | 47 | name: "exportDia", |
| 45 | 48 | props: { |
| 46 | 49 | diaShow: Boolean, |
| 47 | - exportStudent: Array | |
| 50 | + exportStudent: Array, | |
| 51 | + lastLabel: { | |
| 52 | + type: String, | |
| 53 | + default: '总正确率' | |
| 54 | + } | |
| 48 | 55 | }, |
| 49 | 56 | data() { |
| 50 | 57 | return { | ... | ... |
src/store/index.js
| ... | ... | @@ -25,6 +25,7 @@ const store = new Vuex.Store({ |
| 25 | 25 | ? JSON.parse(localStorage.getItem("addRouters")) |
| 26 | 26 | : [], //动态路由 |
| 27 | 27 | tokenSources: new Map(), //正在请求接口(切换取消请求) |
| 28 | + classes: localStorage.getItem("classes") || "", //班主任选择班级查询报表(用于教学班学生筛选) | |
| 28 | 29 | }, |
| 29 | 30 | mutations: { |
| 30 | 31 | setToken(state, token) { |
| ... | ... | @@ -71,6 +72,10 @@ const store = new Vuex.Store({ |
| 71 | 72 | delTokenSources(state, data) { |
| 72 | 73 | state.tokenSources.delete(data); |
| 73 | 74 | }, |
| 75 | + setClasses(state, data) { | |
| 76 | + state.classes = data; | |
| 77 | + localStorage.setItem("classes", data); | |
| 78 | + } | |
| 74 | 79 | }, |
| 75 | 80 | actions: { |
| 76 | 81 | Login({ state, commit }, params) { |
| ... | ... | @@ -192,9 +197,10 @@ const store = new Vuex.Store({ |
| 192 | 197 | getters: { |
| 193 | 198 | addRouters: (state) => state.addRouters, |
| 194 | 199 | token: (state) => state.token, |
| 195 | - code: (state) => state.csCode, | |
| 200 | + csCode: (state) => state.csCode, | |
| 196 | 201 | info: (state) => state.info, |
| 197 | 202 | routers: (state) => state.routers, |
| 203 | + classes: (state) => state.classes, | |
| 198 | 204 | logoShow: (state) => state.layoutStore.logoShow, |
| 199 | 205 | isCollapse: (state) => state.layoutStore.isCollapse, |
| 200 | 206 | uniquerouter: (state) => state.layoutStore.uniquerouter, | ... | ... |
src/views/admin/device/index.vue
src/views/basic/ask/archiving.vue
| ... | ... | @@ -494,7 +494,7 @@ export default { |
| 494 | 494 | }; |
| 495 | 495 | }, |
| 496 | 496 | async created() { |
| 497 | - this.code = localStorage.getItem("csCode") || ""; | |
| 497 | + this.code = this.$store.getters.csCode; | |
| 498 | 498 | this.role = |
| 499 | 499 | this.$store.getters.info.showRole || |
| 500 | 500 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/ask/index.vue
| ... | ... | @@ -77,7 +77,7 @@ export default { |
| 77 | 77 | }; |
| 78 | 78 | }, |
| 79 | 79 | async created() { |
| 80 | - this.code = localStorage.getItem("csCode") || ""; | |
| 80 | + this.code = this.$store.getters.csCode; | |
| 81 | 81 | this.role = |
| 82 | 82 | this.$store.getters.info.showRole || |
| 83 | 83 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/ask/list.vue
| ... | ... | @@ -93,9 +93,7 @@ export default { |
| 93 | 93 | } |
| 94 | 94 | }, |
| 95 | 95 | async created() { |
| 96 | - this.code = localStorage.getItem("csCode") || ""; | |
| 97 | - const queryData = this.$route.query.params | |
| 98 | - queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' | |
| 96 | + this.code = this.$store.getters.csCode; | |
| 99 | 97 | this.init() |
| 100 | 98 | }, |
| 101 | 99 | watch: { |
| ... | ... | @@ -109,12 +107,15 @@ export default { |
| 109 | 107 | methods: { |
| 110 | 108 | //初始化 |
| 111 | 109 | init() { |
| 110 | + const queryData = this.$route.query.params | |
| 111 | + queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' | |
| 112 | 112 | this.role = |
| 113 | 113 | this.$store.getters.info.showRole || |
| 114 | 114 | this.$store.getters.info.permissions[0].role; |
| 115 | 115 | if (this.role != "ROLE_PERSONAL") { |
| 116 | 116 | this._QueryGdClass() |
| 117 | 117 | }; |
| 118 | + this.$store.commit('setClasses', this.query.classId) | |
| 118 | 119 | this.page = 1 |
| 119 | 120 | this.total = 0 |
| 120 | 121 | this.tableData = [] | ... | ... |
src/views/basic/device/index.vue
| ... | ... | @@ -387,7 +387,7 @@ export default { |
| 387 | 387 | }; |
| 388 | 388 | }, |
| 389 | 389 | created() { |
| 390 | - this.code = localStorage.getItem("csCode") || ""; | |
| 390 | + this.code = this.$store.getters.csCode; | |
| 391 | 391 | this.role = |
| 392 | 392 | this.$store.getters.info.showRole || |
| 393 | 393 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/setUp/account.vue
| ... | ... | @@ -435,7 +435,7 @@ export default { |
| 435 | 435 | }; |
| 436 | 436 | }, |
| 437 | 437 | created() { |
| 438 | - this.code = localStorage.getItem("csCode") || ""; | |
| 438 | + this.code = this.$store.getters.csCode; | |
| 439 | 439 | this.role = |
| 440 | 440 | this.$store.getters.info.showRole || |
| 441 | 441 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/setUp/clazz.vue
src/views/basic/setUp/school.vue
src/views/basic/setUp/student.vue
| ... | ... | @@ -289,7 +289,7 @@ export default { |
| 289 | 289 | }, |
| 290 | 290 | }, |
| 291 | 291 | async created() { |
| 292 | - this.code = localStorage.getItem("csCode") || ""; | |
| 292 | + this.code = this.$store.getters.csCode; | |
| 293 | 293 | this.role = |
| 294 | 294 | this.$store.getters.info.showRole || |
| 295 | 295 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/setUp/teacher.vue
src/views/basic/test/analysis.vue
| ... | ... | @@ -41,7 +41,7 @@ export default { |
| 41 | 41 | this.$store.getters.info.showRole || |
| 42 | 42 | this.$store.getters.info.permissions[0].role; |
| 43 | 43 | this.id = this.$route.query.id || ""; |
| 44 | - this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || ""; | |
| 44 | + this.ids = this.$route.query.ids && this.$route.query.ids.split(",") || []; | |
| 45 | 45 | this.type = this.$route.query.type |
| 46 | 46 | this.classId = this.$route.query.classId || ""; |
| 47 | 47 | this.title = this.$route.query.title || "" | ... | ... |
src/views/basic/test/components/contrast.vue
src/views/basic/test/components/multipleSubTest.vue
| ... | ... | @@ -52,8 +52,8 @@ export default { |
| 52 | 52 | props: { |
| 53 | 53 | role: "", |
| 54 | 54 | ids: Array, |
| 55 | - classIds: Array, | |
| 56 | - subjectNames: Array, | |
| 55 | + classId: String, | |
| 56 | + subjectName: String, | |
| 57 | 57 | }, |
| 58 | 58 | data() { |
| 59 | 59 | return { |
| ... | ... | @@ -135,13 +135,34 @@ export default { |
| 135 | 135 | }, |
| 136 | 136 | //查看雷达图 |
| 137 | 137 | openChart(obj) { |
| 138 | + | |
| 138 | 139 | this.chartTitle = obj.studentName + '-多科-多课时作答表现图' |
| 139 | - let subjectList = obj.dataList.map(item => item.subjectName) | |
| 140 | + let max = 0; | |
| 141 | + let subjectList = obj.dataList.map(item => { | |
| 142 | + let score = Number(item.highestScore || item.score) | |
| 143 | + max = score > max ? score : max | |
| 144 | + return item.subjectName | |
| 145 | + }) | |
| 146 | + max += 10 | |
| 147 | + max = max > 150 ? 150 : max | |
| 148 | + this.chartData = { | |
| 149 | + indicator: [ | |
| 150 | + { | |
| 151 | + name: '', max: max, | |
| 152 | + axisLabel: { | |
| 153 | + show: true, | |
| 154 | + showMaxLabel: true, | |
| 155 | + }, | |
| 156 | + }, | |
| 157 | + ], | |
| 158 | + seriesData: [] | |
| 159 | + } | |
| 140 | 160 | subjectList.map((item, index) => { |
| 141 | 161 | if (index < 1) { |
| 142 | 162 | this.chartData.indicator[index].name = item |
| 163 | + this.chartData.indicator[index].max = max | |
| 143 | 164 | } else { |
| 144 | - this.chartData.indicator.push({ name: item, max: 100 }) | |
| 165 | + this.chartData.indicator.push({ name: item, max: max }) | |
| 145 | 166 | } |
| 146 | 167 | }) |
| 147 | 168 | // 为了美观 |
| ... | ... | @@ -149,7 +170,7 @@ export default { |
| 149 | 170 | let num = this.chartData.indicator.length |
| 150 | 171 | for (let i = 0; i < 6; i++) { |
| 151 | 172 | if (i >= num) { |
| 152 | - this.chartData.indicator.push({ name: "", max: 100 }) | |
| 173 | + this.chartData.indicator.push({ name: "", max: max }) | |
| 153 | 174 | } |
| 154 | 175 | } |
| 155 | 176 | } |
| ... | ... | @@ -174,7 +195,7 @@ export default { |
| 174 | 195 | async phaseExamReport() { |
| 175 | 196 | this.loading = true; |
| 176 | 197 | const { data, status, info } = await this.$request.cTPhaseExamReport({ |
| 177 | - classIds: this.classId.split(','), | |
| 198 | + classId: this.classId, | |
| 178 | 199 | examIds: this.ids, |
| 179 | 200 | subjectNames: this.subjectList, |
| 180 | 201 | }); | ... | ... |
src/views/basic/test/components/multipleTest.vue
| ... | ... | @@ -31,7 +31,7 @@ |
| 31 | 31 | <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" /> |
| 32 | 32 | </div> |
| 33 | 33 | </el-dialog> |
| 34 | - <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" /> | |
| 34 | + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" lastLabel="总分"/> | |
| 35 | 35 | </div> |
| 36 | 36 | <!-- 单科多卷 --> |
| 37 | 37 | </template> | ... | ... |
src/views/basic/test/components/scoreSet.vue
src/views/basic/test/components/test.vue
src/views/basic/test/index.vue
| ... | ... | @@ -87,7 +87,7 @@ export default { |
| 87 | 87 | }; |
| 88 | 88 | }, |
| 89 | 89 | async created() { |
| 90 | - this.code = localStorage.getItem("csCode") || ""; | |
| 90 | + this.code = this.$store.getters.csCode; | |
| 91 | 91 | this.role = |
| 92 | 92 | this.$store.getters.info.showRole || |
| 93 | 93 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/basic/test/list.vue
| ... | ... | @@ -62,13 +62,11 @@ |
| 62 | 62 | <el-table-column prop="subjectName" label="科目" align="center"></el-table-column> |
| 63 | 63 | <el-table-column prop="classList" label="班级" align="center"> |
| 64 | 64 | <template slot-scope="scoped"> |
| 65 | - <span v-for="(item, index) in scoped.row.classList">{{ | |
| 66 | - `${index == 0 ? '' : '/'}` + item.className | |
| 67 | - }}</span> | |
| 65 | + <span v-for="(item, index) in scoped.row.classNames">{{ `${index == 0 ? '' : '/'}` + item }}</span> | |
| 68 | 66 | </template> |
| 69 | 67 | </el-table-column> |
| 70 | 68 | <el-table-column prop="title" label="试卷名称" align="center"></el-table-column> |
| 71 | - <el-table-column prop="score" label="卷面分" align="center"></el-table-column> | |
| 69 | + <el-table-column prop="examPaperScore" label="卷面分" align="center"></el-table-column> | |
| 72 | 70 | <el-table-column label="操作" align="center"> |
| 73 | 71 | <template slot-scope="scoped"> |
| 74 | 72 | <el-button type="primary" circle size="mini" icon="el-icon-arrow-right" |
| ... | ... | @@ -126,8 +124,7 @@ export default { |
| 126 | 124 | } |
| 127 | 125 | }, |
| 128 | 126 | async created() { |
| 129 | - this.code = localStorage.getItem("csCode") || ""; | |
| 130 | - | |
| 127 | + this.code = this.$store.getters.csCode; | |
| 131 | 128 | this.init() |
| 132 | 129 | }, |
| 133 | 130 | mounted() { |
| ... | ... | @@ -147,6 +144,7 @@ export default { |
| 147 | 144 | const queryData = this.$route.query.params |
| 148 | 145 | queryData ? this.query = { ...this.query, ...JSON.parse(queryData) } : '' |
| 149 | 146 | console.log(this.query) |
| 147 | + this.$store.commit('setClasses', this.query.classId.join(',')) | |
| 150 | 148 | if (this.query.classId.length > 1) { |
| 151 | 149 | this.isMultipleClass = true |
| 152 | 150 | } |
| ... | ... | @@ -225,11 +223,12 @@ export default { |
| 225 | 223 | }, |
| 226 | 224 | // 多班对比 |
| 227 | 225 | linkContrast(obj) { |
| 226 | + console.log(obj) | |
| 228 | 227 | this.$router.push({ |
| 229 | 228 | path: "/testAnalysis", |
| 230 | 229 | query: { |
| 231 | - ids: obj.ids, | |
| 232 | - classId: obj.classList.map(item => item.classId).join(), | |
| 230 | + ids: obj.ids.join(','), | |
| 231 | + classId: obj.classIds.join(','), | |
| 233 | 232 | subjectName: obj.subjectName, |
| 234 | 233 | title: obj.title, |
| 235 | 234 | type: 4 |
| ... | ... | @@ -284,7 +283,7 @@ export default { |
| 284 | 283 | for (let key in this.query) { |
| 285 | 284 | if (this.query[key] != "") { |
| 286 | 285 | if (key == 'classId') { |
| 287 | - if (query.classId?.length == 1) { | |
| 286 | + if (this.query.classId?.length == 1) { | |
| 288 | 287 | query.classId = this.query[key][0] |
| 289 | 288 | } else { |
| 290 | 289 | query.classIds = [...this.query[key]] |
| ... | ... | @@ -303,8 +302,35 @@ export default { |
| 303 | 302 | }); |
| 304 | 303 | this.loading = false; |
| 305 | 304 | if (status === 0) { |
| 306 | - this.tableData = (data?.list && [...data?.list]) || []; | |
| 307 | - this.total = data?.count || 0; | |
| 305 | + if (this.query.classId.length > 1) { | |
| 306 | + //多班级 | |
| 307 | + let tableObj = {}; | |
| 308 | + data?.list?.map((item) => { | |
| 309 | + if (tableObj[item.examPaperId]) { | |
| 310 | + tableObj[item.examPaperId].ids.push(item.id) | |
| 311 | + tableObj[item.examPaperId].classIds.push(item.classId) | |
| 312 | + tableObj[item.examPaperId].classNames.push(item.className) | |
| 313 | + } else { | |
| 314 | + tableObj[item.examPaperId] = { | |
| 315 | + ids: [item.id], | |
| 316 | + examPaperId: item.examPaperId, | |
| 317 | + classIds: [item.classId], | |
| 318 | + classNames: [item.className], | |
| 319 | + title: item.title, | |
| 320 | + examPaperScore: item.examPaperScore, | |
| 321 | + subjectName: item.subjectName | |
| 322 | + } | |
| 323 | + } | |
| 324 | + }); | |
| 325 | + Object.keys(tableObj).map(keys => { | |
| 326 | + if (tableObj[keys].classIds.length > 1) { | |
| 327 | + this.tableData.push(tableObj[keys]) | |
| 328 | + } | |
| 329 | + }) | |
| 330 | + } else { | |
| 331 | + this.tableData = (data?.list && [...data?.list]) || []; | |
| 332 | + this.total = data?.count || 0; | |
| 333 | + } | |
| 308 | 334 | } else { |
| 309 | 335 | this.$message.error(info); |
| 310 | 336 | } | ... | ... |
src/views/examinationPaper/archiving.vue
| ... | ... | @@ -142,7 +142,7 @@ export default { |
| 142 | 142 | }; |
| 143 | 143 | }, |
| 144 | 144 | async created() { |
| 145 | - this.code = localStorage.getItem("csCode") || ""; | |
| 145 | + this.code = this.$store.getters.csCode; | |
| 146 | 146 | this.role = |
| 147 | 147 | this.$store.getters.info.showRole || |
| 148 | 148 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/examinationPaper/index.vue
| ... | ... | @@ -190,7 +190,7 @@ export default { |
| 190 | 190 | }; |
| 191 | 191 | }, |
| 192 | 192 | async created() { |
| 193 | - this.code = localStorage.getItem("csCode") || ""; | |
| 193 | + this.code = this.$store.getters.csCode; | |
| 194 | 194 | this.role = |
| 195 | 195 | this.$store.getters.info.showRole || |
| 196 | 196 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/index/mainIndex.vue
src/views/layout/aside/aside.vue
src/views/layout/header/header.vue
| ... | ... | @@ -194,7 +194,7 @@ export default { |
| 194 | 194 | }; |
| 195 | 195 | }, |
| 196 | 196 | created() { |
| 197 | - this.code = localStorage.getItem("csCode") || ""; | |
| 197 | + this.code = this.$store.getters.csCode; | |
| 198 | 198 | this.role = |
| 199 | 199 | this.$store.getters.info.showRole || |
| 200 | 200 | this.$store.getters.info.permissions[0].role; | ... | ... |
src/views/login/index.vue
| ... | ... | @@ -115,7 +115,7 @@ export default { |
| 115 | 115 | }, |
| 116 | 116 | created() { |
| 117 | 117 | this.url = this.$route.query?.url || ""; |
| 118 | - this.code = getURLParams("code") || localStorage.getItem("csCode") || ""; | |
| 118 | + this.code = getURLParams("code") || this.$store.getters.csCode; | |
| 119 | 119 | this.dockkey = getURLParams("dockkey") || ""; |
| 120 | 120 | if (this.code || this.dockkey) { |
| 121 | 121 | this.loading = true; | ... | ... |