Commit e17ec73967aa4fd63d93ee0f026998345a5e3649

Authored by 梁保满
1 parent 079cb4cf

随堂问,即时测导出爆表修改

src/api/apis/apis.js
... ... @@ -1606,15 +1606,6 @@ export default {
1606 1606 },
1607 1607  
1608 1608  
1609   - /** v1.5 */
1610   - // 教师/个人版查询答题卡列表的分享数量
1611   - paperShareCount(data) {
1612   - return service({
1613   - url: setUpUrls.paperShareCount,
1614   - method: "POST",
1615   - data
1616   - });
1617   - },
1618 1609 // 教师/个人版导入备题组卷Word文档
1619 1610 paperWordUpload(data) {
1620 1611 return service({
... ...
src/api/urls/apis.js
... ... @@ -420,8 +420,6 @@ export default {
420 420  
421 421  
422 422 /** v1.5 */
423   - // 教师/个人版查询答题卡列表的分享数量
424   - paperShareCount: "/api_html/common/paper/paperShareCount",
425 423 // 教师/个人版导入备题组卷Word文档
426 424 paperWordUpload: "/api_html/common/paper/upload",
427 425 // 删除随堂问报表
... ...
src/components/exportDia.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <el-dialog :close-on-click-modal="false" :visible.sync="diaShow" width="360px">
  4 + <div v-show="exportType == 1">
  5 + <div class="down-item">
  6 + <p class="tit">是否将学生表现折线图一起导出</p>
  7 + <el-radio-group v-model="downType" @change="changeDownType">
  8 + <el-radio :label="1">不导出</el-radio>
  9 + <el-radio :label="2">导出</el-radio>
  10 + </el-radio-group>
  11 + </div>
  12 + <div class="down-item" v-show="downType == 2">
  13 + <p class="tit">选择要导出的学生</p>
  14 + <el-radio-group v-model="exportType">
  15 + <el-radio :label="1">导出全部</el-radio>
  16 + <el-radio :label="2">导出制定学生</el-radio>
  17 + </el-radio-group>
  18 + </div>
  19 + </div>
  20 + <ul v-show="exportType == 2">
  21 + <p class="export-tit">选择学生</p>
  22 + <el-table :data="exportStudent" @selection-change="handleSelectionChange" :max-height="300">
  23 + <el-table-column type="selection"></el-table-column>
  24 + <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
  25 + <el-table-column prop="classRank" label="班名" align="center"></el-table-column>
  26 + <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{
  27 + scoped.row.correctRate }}%</template></el-table-column>
  28 + </el-table>
  29 + </ul>
  30 + <div class="dialog-footer" slot="footer">
  31 + <el-button v-show="downType == 2" size="small" type="primary" round @click="exportData(10)">导出前十</el-button>
  32 + <el-button size="small" type="primary" round @click="exportData(0)">确 定</el-button>
  33 + <el-button size="small" type="danger" round @click="cancel">取 消</el-button>
  34 + </div>
  35 + </el-dialog>
  36 + </div>
  37 +</template>
  38 +<script>
  39 +export default {
  40 + name: "exportDia",
  41 + props: {
  42 + diaShow: Boolean,
  43 + exportStudent: Array
  44 + },
  45 + data() {
  46 + return {
  47 + downType: 1,
  48 + exportType: 1,
  49 + multipleSelection: [],
  50 + }
  51 + },
  52 + watch: {
  53 + diaShow: function (nVal) {
  54 + if (nVal) {
  55 + this.downType = 1
  56 + }
  57 + }
  58 + },
  59 + methods: {
  60 + changeDownType() {
  61 + this.exportType = 1
  62 + },
  63 + handleSelectionChange(val) {
  64 + this.multipleSelection = val
  65 + },
  66 + exportData(length) {
  67 + let studentIds = []
  68 + if (length) {
  69 + studentIds = this.exportStudent.slice(0, 10).map(item => {
  70 + return item.studentId
  71 + })
  72 + } else {
  73 + studentIds = this.multipleSelection.map(item => {
  74 + return item.studentId
  75 + })
  76 + }
  77 + this.$emit('exportData', { studentIds: studentIds })
  78 + },
  79 + cancel() {
  80 + if (this.exportType == 2) {
  81 + this.exportType = 1
  82 + } else {
  83 + this.$emit('cancel')
  84 + }
  85 + }
  86 + }
  87 +}
  88 +</script>
0 89 \ No newline at end of file
... ...
src/main.js
... ... @@ -28,7 +28,7 @@ Vue.use(permission)
28 28 NProgress.inc(0.2)
29 29 NProgress.configure({ easing: "ease", speed: 500, showSpinner: false })
30 30  
31   -import "@/mock/index.js"
  31 +// import "@/mock/index.js"
32 32  
33 33 Array.prototype.remove = function (val) {
34 34 var index = this.indexOf(val);
... ...
src/mock/index.js
1 1 import Mock from "mockjs"
2 2 Mock.mock(
3   - "/api_html/common/paper/paperShareCount", {
  3 + "/api_html/teaching/paperList", {
4 4 info: "success",
5 5 status: 0,
6 6 data: {
7   - myCount: 24,
8   - grade: 30
  7 + myCount: 5,
  8 + gradeCount: 8,
  9 + archivedTotal: 6,
  10 + total: 30,
  11 + list: [
  12 + {
  13 + "sectionName": "小学",
  14 + "gradeName": "三年级",
  15 + "id": 107,
  16 + "tenantId": 9,
  17 + "regionId": 0,
  18 + "schoolId": 34,
  19 + "classId": 696,
  20 + "thirdId": "",
  21 + "section": 1,
  22 + "grade": 3,
  23 + "subjectName": "语文",
  24 + "title": "X102_语文_课时 4",
  25 + "startTime": "2023-04-18 17:43:50",
  26 + "endTime": "2023-04-18 17:47:06",
  27 + "calculateStatus": 1,
  28 + "duration": 196,
  29 + "status": 0,
  30 + "consumingDuration": 3140,
  31 + "classPersonNum": 11,
  32 + "answeredNum": 1,
  33 + "unansweredNum": 20,
  34 + "questionNum": 1,
  35 + "answerNum": 1,
  36 + "totalAnswersNum": 1,
  37 + "totalCorrectAnswersNum": 1,
  38 + "participationRate": 9.09,
  39 + "classCorrectRate": 9.09,
  40 + "answerCorrectRate": 100,
  41 + "levelConfig": "{\"failed\":0.6,\"pass\":0.8,\"good\":0.9}",
  42 + "passedNum": 1,
  43 + "passedRate": 9.09,
  44 + "excellenNum": 1,
  45 + "excellenRate": 9.09,
  46 + "goodNum": 0,
  47 + "goodRate": 0,
  48 + "passNum": 0,
  49 + "passRate": 0,
  50 + "failedNum": 0,
  51 + "failedRate": 0,
  52 + "latestCalculateTime": "2023-04-19 14:08:35",
  53 + "createdTime": "2023-04-19 14:08:35",
  54 + "modifiedTime": "2023-04-19 14:08:35",
  55 + "deleteFlag": 0
  56 + },
  57 + {
  58 + "sectionName": "小学",
  59 + "gradeName": "二年级",
  60 + "id": 106,
  61 + "tenantId": 9,
  62 + "regionId": 0,
  63 + "schoolId": 34,
  64 + "classId": 696,
  65 + "thirdId": "",
  66 + "section": 1,
  67 + "grade": 2,
  68 + "subjectName": "语文",
  69 + "title": "X102_语文_课时 2",
  70 + "startTime": "2023-04-18 15:58:27",
  71 + "endTime": "2023-04-18 16:01:28",
  72 + "calculateStatus": 1,
  73 + "duration": 182,
  74 + "status": 0,
  75 + "consumingDuration": 2640,
  76 + "classPersonNum": 11,
  77 + "answeredNum": 1,
  78 + "unansweredNum": 18,
  79 + "questionNum": 1,
  80 + "answerNum": 1,
  81 + "totalAnswersNum": 1,
  82 + "totalCorrectAnswersNum": 1,
  83 + "participationRate": 9.09,
  84 + "classCorrectRate": 9.09,
  85 + "answerCorrectRate": 100,
  86 + "levelConfig": "{\"failed\":0.6,\"pass\":0.8,\"good\":0.9}",
  87 + "passedNum": 1,
  88 + "passedRate": 9.09,
  89 + "excellenNum": 1,
  90 + "excellenRate": 9.09,
  91 + "goodNum": 0,
  92 + "goodRate": 0,
  93 + "passNum": 0,
  94 + "passRate": 0,
  95 + "failedNum": 0,
  96 + "failedRate": 0,
  97 + "latestCalculateTime": "2023-04-18 16:01:29",
  98 + "createdTime": "2023-04-18 16:01:28",
  99 + "modifiedTime": "2023-04-18 16:01:29",
  100 + "deleteFlag": 0
  101 + },
  102 + {
  103 + "sectionName": "小学",
  104 + "gradeName": "二年级",
  105 + "id": 105,
  106 + "tenantId": 9,
  107 + "regionId": 0,
  108 + "schoolId": 34,
  109 + "classId": 696,
  110 + "thirdId": "",
  111 + "section": 1,
  112 + "grade": 2,
  113 + "subjectName": "语文",
  114 + "title": "X102_语文_课时 1",
  115 + "startTime": "2023-04-18 15:16:11",
  116 + "endTime": "2023-04-18 15:21:37",
  117 + "calculateStatus": 1,
  118 + "duration": 326,
  119 + "status": 0,
  120 + "consumingDuration": 76880,
  121 + "classPersonNum": 11,
  122 + "answeredNum": 3,
  123 + "unansweredNum": 16,
  124 + "questionNum": 1,
  125 + "answerNum": 1,
  126 + "totalAnswersNum": 3,
  127 + "totalCorrectAnswersNum": 2,
  128 + "participationRate": 27.27,
  129 + "classCorrectRate": 18.18,
  130 + "answerCorrectRate": 66.67,
  131 + "levelConfig": "{\"failed\":0.6,\"pass\":0.8,\"good\":0.9}",
  132 + "passedNum": 2,
  133 + "passedRate": 18.18,
  134 + "excellenNum": 2,
  135 + "excellenRate": 18.18,
  136 + "goodNum": 0,
  137 + "goodRate": 0,
  138 + "passNum": 0,
  139 + "passRate": 0,
  140 + "failedNum": 1,
  141 + "failedRate": 9.09,
  142 + "latestCalculateTime": "2023-04-18 15:58:23",
  143 + "createdTime": "2023-04-18 15:58:23",
  144 + "modifiedTime": "2023-04-18 15:58:23",
  145 + "deleteFlag": 0
  146 + },
  147 + {
  148 + "sectionName": "小学",
  149 + "gradeName": "二年级",
  150 + "id": 103,
  151 + "tenantId": 9,
  152 + "regionId": 0,
  153 + "schoolId": 34,
  154 + "classId": 696,
  155 + "thirdId": "",
  156 + "section": 1,
  157 + "grade": 2,
  158 + "subjectName": "语文",
  159 + "title": "X102_语文_课时 1",
  160 + "startTime": "2023-04-18 14:20:16",
  161 + "endTime": "2023-04-18 14:57:09",
  162 + "calculateStatus": 1,
  163 + "duration": 2213,
  164 + "status": 0,
  165 + "consumingDuration": 229820,
  166 + "classPersonNum": 9,
  167 + "answeredNum": 1,
  168 + "unansweredNum": 16,
  169 + "questionNum": 4,
  170 + "answerNum": 4,
  171 + "totalAnswersNum": 4,
  172 + "totalCorrectAnswersNum": 4,
  173 + "participationRate": 11.11,
  174 + "classCorrectRate": 11.11,
  175 + "answerCorrectRate": 100,
  176 + "levelConfig": "{\"failed\":0.6,\"pass\":0.8,\"good\":0.9}",
  177 + "passedNum": 1,
  178 + "passedRate": 11.11,
  179 + "excellenNum": 1,
  180 + "excellenRate": 11.11,
  181 + "goodNum": 0,
  182 + "goodRate": 0,
  183 + "passNum": 0,
  184 + "passRate": 0,
  185 + "failedNum": 0,
  186 + "failedRate": 0,
  187 + "latestCalculateTime": "2023-04-18 15:02:33",
  188 + "createdTime": "2023-04-18 15:02:32",
  189 + "modifiedTime": "2023-04-18 15:02:33",
  190 + "deleteFlag": 0
  191 + },
  192 + {
  193 + "sectionName": "小学",
  194 + "gradeName": "一年级",
  195 + "id": 102,
  196 + "tenantId": 9,
  197 + "regionId": 0,
  198 + "schoolId": 34,
  199 + "classId": 696,
  200 + "thirdId": "",
  201 + "section": 1,
  202 + "grade": 1,
  203 + "subjectName": "语文",
  204 + "title": "X102_语文_课时 1",
  205 + "startTime": "2023-04-18 11:09:20",
  206 + "endTime": "2023-04-18 13:59:30",
  207 + "calculateStatus": 1,
  208 + "duration": 10210,
  209 + "status": 0,
  210 + "consumingDuration": 12380,
  211 + "classPersonNum": 9,
  212 + "answeredNum": 1,
  213 + "unansweredNum": 16,
  214 + "questionNum": 2,
  215 + "answerNum": 2,
  216 + "totalAnswersNum": 2,
  217 + "totalCorrectAnswersNum": 1,
  218 + "participationRate": 11.11,
  219 + "classCorrectRate": 5.56,
  220 + "answerCorrectRate": 50,
  221 + "levelConfig": "{\"failed\":0.6,\"pass\":0.8,\"good\":0.9}",
  222 + "passedNum": 0,
  223 + "passedRate": 0,
  224 + "excellenNum": 0,
  225 + "excellenRate": 0,
  226 + "goodNum": 0,
  227 + "goodRate": 0,
  228 + "passNum": 0,
  229 + "passRate": 0,
  230 + "failedNum": 1,
  231 + "failedRate": 11.11,
  232 + "latestCalculateTime": "2023-04-18 13:59:36",
  233 + "createdTime": "2023-04-18 13:59:35",
  234 + "modifiedTime": "2023-04-18 13:59:36",
  235 + "deleteFlag": 0
  236 + }
  237 + ]
9 238 }
10 239 }
11 240 )
... ... @@ -682,8 +911,8 @@ Mock.mock(
682 911 "participationCount": '5',
683 912 "classRank": '1',
684 913 "score": '100',
685   - "participationRate":'88',
686   - "correctRate":'90',
  914 + "participationRate": '88',
  915 + "correctRate": '90',
687 916 },
688 917 {
689 918 "subjectName": "英语",
... ... @@ -691,8 +920,8 @@ Mock.mock(
691 920 "participationCount": '5',
692 921 "classRank": '2',
693 922 "score": '100',
694   - "participationRate":'70',
695   - "correctRate":'76',
  923 + "participationRate": '70',
  924 + "correctRate": '76',
696 925 },
697 926 {
698 927 "subjectName": "语文",
... ... @@ -700,8 +929,8 @@ Mock.mock(
700 929 "participationCount": '5',
701 930 "classRank": '2',
702 931 "score": '100',
703   - "participationRate":'99',
704   - "correctRate":'100',
  932 + "participationRate": '99',
  933 + "correctRate": '100',
705 934 },
706 935 ]
707 936 }],
... ...
src/views/basic/ask/analysis.vue
... ... @@ -35,39 +35,7 @@
35 35 icon="el-icon-printer">打印</el-button>
36 36 </p>
37 37 </div>
38   - <el-dialog :close-on-click-modal="false" :visible.sync="diaDown" width="360px">
39   - <div v-show="exportType == 1">
40   - <div class="down-item">
41   - <p class="tit">是否将学生表现折线图一起导出</p>
42   - <el-radio-group v-model="downType" @change="changeDownType">
43   - <el-radio :label="1">不导出</el-radio>
44   - <el-radio :label="2">导出</el-radio>
45   - </el-radio-group>
46   - </div>
47   - <div class="down-item" v-show="downType == 2">
48   - <p class="tit">选择要导出的学生</p>
49   - <el-radio-group v-model="exportType">
50   - <el-radio :label="1">导出全部</el-radio>
51   - <el-radio :label="2">导出制定学生</el-radio>
52   - </el-radio-group>
53   - </div>
54   - </div>
55   - <ul v-show="exportType == 2">
56   - <p class="export-tit">选择学生</p>
57   - <el-table :data="exportStudent" @selection-change="handleSelectionChange" :max-height="300">
58   - <el-table-column type="selection"></el-table-column>
59   - <el-table-column prop="studentName" label="姓名" align="center"></el-table-column>
60   - <el-table-column prop="classRank" label="班名" align="center"></el-table-column>
61   - <el-table-column prop="correctRate" label="总正确率" align="center"><template slot-scope="scoped">{{
62   - scoped.row.correctRate }}%</template></el-table-column>
63   - </el-table>
64   - </ul>
65   - <div class="dialog-footer" slot="footer">
66   - <el-button v-show="downType == 2" size="small" type="primary" round @click="exportData(10)">导出前十</el-button>
67   - <el-button size="small" type="primary" round @click="exportData(0)">确 定</el-button>
68   - <el-button size="small" type="danger" round @click="cancel">取 消</el-button>
69   - </div>
70   - </el-dialog>
  38 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
71 39 </div>
72 40 </div>
73 41 </template>
... ... @@ -96,11 +64,9 @@ export default {
96 64 size: 20,
97 65 total: 0,
98 66 status: 0,
99   - diaDown: false,
100   - downType: 1,
101   - exportType: 1,
  67 + //导出相关
  68 + diaShow: false,
102 69 exportStudent: [],
103   - multipleSelection: [],
104 70 };
105 71 },
106 72 created() {
... ... @@ -216,7 +182,7 @@ export default {
216 182 }
217 183 }
218 184 if (this.types == 1) {
219   - query.type = this.type
  185 + query.type = this.type - 1
220 186 }
221 187 this.loading = true;
222 188 let { data, info, status } = await queryData({
... ... @@ -265,7 +231,7 @@ export default {
265 231  
266 232 let query = {};
267 233 if (this.types == 1) {
268   - query.type = this.type
  234 + query.type = this.type - 1
269 235 }
270 236 this.loading = true;
271 237 let { data, info, status } = await queryData({
... ... @@ -282,38 +248,17 @@ export default {
282 248 }
283 249 },
284 250  
285   -
  251 + //导出
286 252 openDown() {
287   - this.diaDown = true;
288   - this.downType = 1
  253 + this.diaShow = true;
289 254 },
290 255 cancel() {
291   - if (this.exportType == 2) {
292   - this.exportType = 1
293   - } else {
294   - this.diaDown = false;
295   - }
  256 + this.diaShow = false;
296 257 },
297   - changeDownType() {
298   - this.exportType = 1
299   - },
300   - handleSelectionChange(val) {
301   - this.multipleSelection = val
302   - },
303   - //导出
304   - async exportData(length) {
  258 + async exportData(arr) {
305 259 if (this.exportLoading == true) return;
306 260 this.exportLoading = true;
307   - let studentIds = []
308   - if (length) {
309   - studentIds = this.exportStudent.slice(0, 10).map(item => {
310   - return item.studentId
311   - })
312   - } else {
313   - studentIds = this.multipleSelection.map(item => {
314   - return item.studentId
315   - })
316   - }
  261 + let studentIds = arr
317 262 let query = {};
318 263 if (studentIds.length == this.exportStudent.length) {
319 264 query.studentIds = []
... ...
src/views/basic/ask/components/answerQustion.vue
... ... @@ -147,22 +147,24 @@ export default {
147 147 },
148 148 methods: {
149 149 setDuration(times) {
150   - let m = parseInt(times / 1000 / 60);
151   - let s = parseInt((times / 1000) % 60);
152   - let ms = times;
153   - let aTime;
154   - if (times == 0) {
155   - aTime = `0`;
156   - } else {
157   - if (m == 0 && s == 0) {
158   - aTime = `${ms}毫秒`;
159   - } else if (m == 0 && s != 0) {
160   - aTime = `${s}秒`;
161   - } else if (m != 0 && s != 0) {
162   - aTime = `${m}分${s}秒`;
  150 + if (times) {
  151 + let m = parseInt(times / 1000 / 60);
  152 + let s = parseInt((times / 1000) % 60);
  153 + let ms = times;
  154 + let aTime;
  155 + if (times == 0) {
  156 + aTime = `0`;
  157 + } else {
  158 + if (m == 0 && s == 0) {
  159 + aTime = `${ms}毫秒`;
  160 + } else if (m == 0 && s != 0) {
  161 + aTime = `${s}秒`;
  162 + } else if (m != 0 && s != 0) {
  163 + aTime = `${m}分${s}秒`;
  164 + }
163 165 }
  166 + return aTime;
164 167 }
165   - return aTime;
166 168 },
167 169 }
168 170 };
... ...
src/views/basic/ask/components/interact.vue
... ... @@ -39,26 +39,25 @@ export default {
39 39 resultData: function () {
40 40 let resultData = []
41 41 if (this.tableData.length) {
42   - if (this.types == "3") {
43   - let subjectName = [];
44   - resultData = data?.list.map((item) => {
45   - let params = {};
46   - item.dataList.map((items, index) => {
47   - if (!subjectName.includes(items.subjectName)) {
48   - subjectName.push(items.subjectName);
49   - }
50   - params["interactionsNum" + items.subjectName] =
51   - items.interactionsNum;
52   - params["interactionsCorrectNum" + items.subjectName] =
53   - items.interactionsCorrectNum;
54   - });
55   - return {
56   - ...item,
57   - ...params,
58   - };
  42 +
  43 + let subjectName = [];
  44 + resultData = this.tableData?.map((item) => {
  45 + let params = {};
  46 + item.dataList?.map((items, index) => {
  47 + if (!subjectName.includes(items.subjectName)) {
  48 + subjectName.push(items.subjectName);
  49 + }
  50 + params["interactionsNum" + items.subjectName] =
  51 + items.interactionsNum;
  52 + params["interactionsCorrectNum" + items.subjectName] =
  53 + items.interactionsCorrectNum;
59 54 });
60   - this.phaseInter = [...subjectName];
61   - }
  55 + return {
  56 + ...item,
  57 + ...params,
  58 + };
  59 + });
  60 + this.phaseInter = [...subjectName];
62 61 } else {
63 62 resultData = []
64 63 this.optionsList = []
... ...
src/views/basic/ask/list.vue
... ... @@ -13,14 +13,14 @@
13 13 </back-box>
14 14 <div v-show="!isDetail" class="table-box">
15 15 <div class="table-cont" v-loading="loading">
16   - <p class="btn-box">
  16 + <p class="btn-box" v-if="tableData.length">
17 17 <el-button type="primary" round @click="linkToDetail2">查看汇总报表</el-button>
18 18 </p>
19 19 <div>
20 20 <el-table :data="tableData" border :show-header="total > 0" style="width: 100%"
21 21 @selection-change="handleSelectionChange">
22 22 <el-table-column type="selection" width="40"></el-table-column>
23   - <el-table-column prop="subject" label="科目" align="center" width="80"></el-table-column>
  23 + <el-table-column prop="subjectName" label="科目" align="center" width="80"></el-table-column>
24 24 <el-table-column prop="title" label="课时名称" align="center"></el-table-column>
25 25 <el-table-column prop="participationRate" label="总参与度" align="center"> <template slot-scope="scoped">{{
26 26 scoped.row.participationRate }}%</template></el-table-column>
... ... @@ -142,6 +142,9 @@ export default {
142 142 },
143 143 //去详情
144 144 linkToDetail2() {
  145 + if (this.multipleSelection.length == 0) {
  146 + this.$message.warning("未选择课时,请选择~")
  147 + return }
145 148 let subjectArr = []
146 149 const ids = this.multipleSelection.map(item => {
147 150 subjectArr.push(item.subject)
... ...
src/views/basic/test/analysis.vue
... ... @@ -2,7 +2,7 @@
2 2 <div ref="main" class="page-container">
3 3 <back-box>
4 4 <template slot="title">
5   - <span>{{ type == 1 ? '单卷测练报表' : type == 2 ? subject + "汇总报表" : type == 3 ? "多科汇总报表" :
  5 + <span>{{ type == 1 ? '单卷测练报表' : type == 2 ? subjectName + "汇总报表" : type == 3 ? "多科汇总报表" :
6 6 `多班_${subjectName}_${title}_测练成绩对比分析` }}</span>
7 7 </template>
8 8 </back-box>
... ... @@ -44,8 +44,8 @@ export default {
44 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   - this.subjectName = this.$route.query.subjectName || ""
48 47 this.title = this.$route.query.title || ""
  48 + this.subjectName = this.$route.query.subjectName || ""
49 49 },
50 50 methods: {
51 51  
... ...
src/views/basic/test/components/multipleSubTest.vue
... ... @@ -29,7 +29,7 @@
29 29 </el-table>
30 30 </div>
31 31 <div class="down">
32   - <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  32 + <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
33 33 <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
34 34 icon="el-icon-printer">打印</el-button>
35 35 </div>
... ... @@ -38,6 +38,7 @@
38 38 <RadarChart id="radarChart" :params="chartData" />
39 39 </div>
40 40 </el-dialog>
  41 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
41 42 </div>
42 43 </template>
43 44 <script>
... ... @@ -46,7 +47,7 @@ import RadarChart from &quot;@/components/charts/radarChart&quot;
46 47 import { downloadFile, tablePrint } from "@/utils";
47 48 export default {
48 49 components: {
49   - RadarChart
  50 + RadarChart,
50 51 },
51 52 props: {
52 53 role: "",
... ... @@ -76,6 +77,10 @@ export default {
76 77 },
77 78 chartDia: false,
78 79 chartTitle: "",
  80 +
  81 + //导出相关
  82 + diaShow: false,
  83 + exportStudent: []
79 84 }
80 85 },
81 86 computed: {
... ... @@ -140,6 +145,7 @@ export default {
140 145 this.chartData.indicator.push({ name: item, max: 100 })
141 146 }
142 147 })
  148 + // 为了美观
143 149 if (this.chartData.indicator.length < 3) {
144 150 let num = this.chartData.indicator.length
145 151 for (let i = 0; i < 6; i++) {
... ... @@ -191,16 +197,31 @@ export default {
191 197 };
192 198 });
193 199 this.answerList = [...subjectName];
  200 + this.exportStudent = [...this.tableData]
194 201 } else {
195 202 this.$message.error(info);
196 203 }
197 204 },
198 205 //导出
199   - async exportData() {
  206 + openDown() {
  207 + this.diaShow = true;
  208 + },
  209 + cancel() {
  210 + this.diaShow = false;
  211 + },
  212 + async exportData(arr) {
200 213 if (this.exportLoading == true) return;
201 214 this.exportLoading = true;
  215 + let studentIds = arr
  216 + let query = {};
  217 + if (studentIds.length == this.exportStudent.length) {
  218 + query.studentIds = []
  219 + } else if (studentIds.length > 0) {
  220 + query.studentIds = studentIds
  221 + }
202 222 const data = await this.$request.exportExamReport({
203 223 examId: this.ids,
  224 + ...query
204 225 });
205 226 this.exportLoading = false;
206 227 if (data) {
... ...
src/views/basic/test/components/multipleTest.vue
... ... @@ -22,7 +22,7 @@
22 22 </el-table>
23 23 </div>
24 24 <div class="down">
25   - <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  25 + <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
26 26 <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
27 27 icon="el-icon-printer">打印</el-button>
28 28 </div>
... ... @@ -31,6 +31,7 @@
31 31 <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" />
32 32 </div>
33 33 </el-dialog>
  34 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
34 35 </div>
35 36 <!-- 单科多卷 -->
36 37 </template>
... ... @@ -56,6 +57,10 @@ export default {
56 57 studentName: "",
57 58 xAxis: [],
58 59 chartData: [],
  60 +
  61 + //导出相关
  62 + diaShow: false,
  63 + exportStudent: []
59 64 }
60 65 },
61 66 computed: {
... ... @@ -180,14 +185,29 @@ export default {
180 185 };
181 186 });
182 187 this.answerList = dataList;
  188 +
  189 + this.exportStudent = [...this.tableData]
183 190 } else {
184 191 this.$message.error(info);
185 192 }
186 193 },
187 194 //导出
188   - async exportData() {
  195 + openDown() {
  196 + this.diaShow = true;
  197 + },
  198 + cancel() {
  199 + this.diaShow = false;
  200 + },
  201 + async exportData(arr) {
189 202 if (this.exportLoading == true) return;
190 203 this.exportLoading = true;
  204 + let studentIds = arr
  205 + let query = {};
  206 + if (studentIds.length == this.exportStudent.length) {
  207 + query.studentIds = []
  208 + } else if (studentIds.length > 0) {
  209 + query.studentIds = studentIds
  210 + }
191 211 const exportPhaseExamReport = this.role == "ROLE_PERSONAL"
192 212 ? this.$request.pExportPhaseExamReport
193 213 : this.$request.exportPhaseExamReport;
... ...
src/views/basic/test/components/test.vue
... ... @@ -200,7 +200,7 @@
200 200 </div>
201 201 <div class="down">
202 202 <div>
203   - <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  203 + <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
204 204 <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
205 205 icon="el-icon-printer">打印</el-button>
206 206 </div>
... ... @@ -239,6 +239,7 @@
239 239 <el-button @click="diaMinScore = false">取 消</el-button>
240 240 </div>
241 241 </el-dialog>
  242 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData" />
242 243 </div>
243 244 </div>
244 245 </template>
... ... @@ -247,7 +248,7 @@ import ScoreSet from &quot;./scoreSet.vue&quot;
247 248 import { downloadFile, tablePrint } from "@/utils";
248 249 export default {
249 250 components: {
250   - ScoreSet
  251 + ScoreSet,
251 252 },
252 253 props: {
253 254 role: "",
... ... @@ -310,9 +311,9 @@ export default {
310 311 //答题录分
311 312 diaScoreSet: false,
312 313  
313   - exportType: 1,
314   - exportStudent: [],
315   - multipleSelection: [],
  314 + //导出相关
  315 + diaShow: false,
  316 + exportStudent: []
316 317 };
317 318 },
318 319 created() {
... ... @@ -492,6 +493,7 @@ export default {
492 493 this.questionList = optionsList.sort((a, b) => {
493 494 return a.id - b.id;
494 495 });
  496 + this.exportStudent = [...this.tableData2]
495 497 } else {
496 498 this.$message.error(info);
497 499 }
... ... @@ -512,7 +514,7 @@ export default {
512 514 this.loading = false;
513 515 if (status === 0) {
514 516 let optionsList = [{}, {}, {}, {}, {}];
515   - let tableData = data?.list.map((item) => {
  517 + let tableData = data?.list?.map((item) => {
516 518 let params = {};
517 519 const detail = JSON.parse(item.detail);
518 520 let lastOPtion = detail?.find((item) => {
... ... @@ -553,7 +555,7 @@ export default {
553 555 ...params,
554 556 };
555 557 });
556   - this.tableData = tableData.sort((a, b) => {
  558 + this.tableData = tableData?.sort((a, b) => {
557 559 return a.questionIndex - b.questionIndex;
558 560 });
559 561 this.optionsList = [...optionsList];
... ... @@ -563,20 +565,18 @@ export default {
563 565 this.$message.error(info);
564 566 }
565 567 },
  568 +
566 569 //导出
567   - async exportData() {
  570 + openDown() {
  571 + this.diaShow = true;
  572 + },
  573 + cancel() {
  574 + this.diaShow = false;
  575 + },
  576 + async exportData(arr) {
568 577 if (this.exportLoading == true) return;
569 578 this.exportLoading = true;
570   - let studentIds = []
571   - if (length) {
572   - studentIds = this.exportStudent.slice(0, 10).map(item => {
573   - return item.studentId
574   - })
575   - } else {
576   - studentIds = this.multipleSelection.map(item => {
577   - return item.studentId
578   - })
579   - }
  579 + let studentIds = arr
580 580 let query = {};
581 581 if (studentIds.length == this.exportStudent.length) {
582 582 query.studentIds = []
... ... @@ -592,7 +592,7 @@ export default {
592 592 ...query
593 593 });
594 594 this.exportLoading = false;
595   - if (data) {
  595 + if (!data.status) {
596 596 let blob = new Blob([data], {
597 597 type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
598 598 });
... ... @@ -603,7 +603,7 @@ export default {
603 603 blob
604 604 );
605 605 } else {
606   - this.$message.error("下载失败");
  606 + this.$message.error(data.info);
607 607 }
608 608 },
609 609 },
... ...
src/views/basic/test/list.vue
... ... @@ -175,7 +175,7 @@ export default {
175 175 title: obj.title,
176 176 score: obj.examPaperScore || 0,
177 177 type: 1,
178   - subject: obj.subjectName
  178 + subjectName: obj.subjectName
179 179 },
180 180 });
181 181 },
... ...
src/views/examinationPaper/edit.vue
... ... @@ -395,7 +395,6 @@ export default {
395 395 this.type = this.$route.query.type || 1;
396 396 this.form.title = this.$route.query.title || "";
397 397 this._QueryDetail();
398   - this._GradeList()
399 398 },
400 399 methods: {
401 400 // v1.5
... ...
src/views/examinationPaper/index.vue
... ... @@ -201,7 +201,6 @@ export default {
201 201 }
202 202 await this._QuerySubjectList();
203 203 this._QueryData();
204   - this._QueryTotal();
205 204 },
206 205 methods: {
207 206 refreshStic() {
... ... @@ -267,7 +266,7 @@ export default {
267 266 },
268 267 changPaperType(type) {
269 268 this.query.type = type
270   - this.changShare(1)
  269 + this.changShare(0)
271 270 },
272 271 changePage(page) {
273 272 this.page = page;
... ... @@ -311,14 +310,12 @@ export default {
311 310 async getData(bool) {
312 311 this.page = 1;
313 312 this._QueryData(bool);
314   - this._QueryTotal();
315 313 },
316 314 //切换班级
317 315 async changClazz() {
318 316 this.page = 1;
319 317 await this._QuerySubjectList();
320 318 this._QueryData(false);
321   - this._QueryTotal();
322 319 },
323 320 //切换类型
324 321 async changShare(share) {
... ... @@ -423,6 +420,8 @@ export default {
423 420 });
424 421 this.loading = false;
425 422 if (status === 0) {
  423 + this.totalCount.my = data?.myCount || 0;
  424 + this.totalCount.share = data?.gradeCount || 0;
426 425 this.archivedTotal = data.archivedTotal;
427 426 this.total = data.total;
428 427 this.tableData = (data.list && [...data.list]) || [];
... ... @@ -430,24 +429,6 @@ export default {
430 429 this.$message.error(info);
431 430 }
432 431 },
433   - async _QueryTotal() {
434   - //获取答题卡列表
435   - let query = { ...this.query };
436   - for (let key in query) {
437   - if (!query[key]) {
438   - delete query[key]
439   - }
440   - }
441   - const { data, status, info } = await this.$request.paperShareCount({
442   - ...query,
443   - });
444   - if (status === 0) {
445   - this.totalCount.my = data?.myCount || 0;
446   - this.totalCount.share = data?.grade || 0;
447   - } else {
448   - this.$message.error(info);
449   - }
450   - },
451 432  
452 433  
453 434 //v1.5
... ...