Commit f45b3c05fc78fe2dd3349d44a55f48fd0ec510ce

Authored by LH_PC
1 parent bd6ad607

云平台新UI界面

Showing 84 changed files with 9216 additions and 3685 deletions
.vs/Ezquiz_Platform/FileContentIndex/55df62fa-5432-4cfd-bb10-cbdb5e263ba4.vsidx 0 → 100644
No preview for this file type
.vs/Ezquiz_Platform/FileContentIndex/read.lock 0 → 100644
.vs/ProjectSettings.json 0 → 100644
  1 +{
  2 + "CurrentProjectSetting": null
  3 +}
0 4 \ No newline at end of file
... ...
.vs/slnx.sqlite 0 → 100644
No preview for this file type
package.json
... ... @@ -16,14 +16,14 @@
16 16 "js-cookie": "^2.2.0",
17 17 "jsencrypt": "^3.2.0",
18 18 "lodash": "^4.17.21",
  19 + "mockjs": "1.1.0",
19 20 "nprogress": "^0.2.0",
20 21 "script-ext-html-webpack-plugin": "^2.1.5",
21 22 "vue": "^2.6.11",
22 23 "vue-i18n": "^8.4.0",
23 24 "vue-router": "^3.5.1",
24 25 "vuedraggable": "^2.24.3",
25   - "vuex": "^3.6.2",
26   - "mockjs": "1.1.0"
  26 + "vuex": "^3.6.2"
27 27 },
28 28 "devDependencies": {
29 29 "@vue/cli-plugin-babel": "~4.5.0",
... ... @@ -46,4 +46,4 @@
46 46 "sass-loader": "^7.1.0",
47 47 "vue-template-compiler": "^2.5.2"
48 48 }
49   -}
50 49 \ No newline at end of file
  50 +}
... ...
src/App.vue
1 1 <template>
2   - <div id="app">
3   - <transition name="fade" mode="out-in">
4   - <router-view></router-view>
5   - </transition>
6   - </div>
  2 + <div id="app" ref="app">
  3 + <transition name="fade" mode="out-in">
  4 + <router-view></router-view>
  5 + </transition>
  6 + </div>
7 7 </template>
8 8  
9 9 <script>
  10 +import _ from "lodash";
10 11 export default {
11   - name: "app"
  12 + name: "app",
  13 + mounted() {
  14 +
  15 + },
  16 + created() {
  17 + this.$nextTick(() => {
  18 + const $app = this.$refs.app;
  19 + // 设置 屏幕 百分比 尺寸 适配
  20 + const standardScale = "100%" / "100%";
  21 + var minHeight = 1080;
  22 + window.addEventListener(
  23 + "resize",
  24 + _.debounce(function () {
  25 + const docHeight = document.body.clientHeight;
  26 + const docWidth = document.body.clientWidth;
  27 +
  28 + if (docWidth < 1700) {
  29 + const currentScale = docHeight / docWidth;
  30 + let [scale, translate] = [0, 0];
  31 + if (currentScale < standardScale) {
  32 + // 以高度计算
  33 + scale = docHeight / 1080;
  34 + const shouleWidth = 1920 * scale;
  35 +
  36 + const offsetWidth = docWidth - shouleWidth;
  37 + translate =
  38 + offsetWidth > 0 ? `translate(${offsetWidth / 2}px, 0)` : "";
  39 + } else {
  40 + // 以宽度计算
  41 + scale = docWidth / 1920;
  42 + const shouleHeight = 1080 * scale;
  43 + const offsetHeight = docHeight - shouleHeight;
  44 + translate =
  45 + offsetHeight > 0 ? `translate(0, ${offsetHeight / 2}px)` : "";
  46 + }
  47 +
  48 + if (docHeight <= 600) {
  49 + $app.style.cssText = `
  50 + transform: scale(${scale}) ${translate};
  51 + transform-origin: top left;
  52 + min-width: 1920px;
  53 + min-height:500px;
  54 + `;
  55 + }
  56 + if (docHeight <= 700) {
  57 + $app.style.cssText = `
  58 + transform: scale(${scale}) ${translate};
  59 + transform-origin: top left;
  60 + min-width: 1920px;
  61 + min-height:900px;
  62 + `;
  63 + }
  64 + else if (docHeight <= 750) {
  65 + $app.style.cssText = `
  66 + transform: scale(${scale}) ${translate};
  67 + transform-origin: top left;
  68 + min-width: 1920px;
  69 + min-height:920px;
  70 + `;
  71 + }
  72 + else {
  73 + $app.style.cssText = `
  74 + transform: scale(${scale}) ${translate};
  75 + transform-origin: top left;
  76 + min-width: 1920px;
  77 + min-height:1080px;
  78 + `;
  79 + }
  80 +
  81 + } else {
  82 + $app.style.cssText = '';
  83 + }
  84 +
  85 + }),
  86 + 300
  87 + );
  88 +
  89 + if (document.createEvent) {
  90 + var event = document.createEvent("HTMLEvents");
  91 + event.initEvent("resize", true, true);
  92 + window.dispatchEvent(event);
  93 + } else if (document.createEventObject) {
  94 + window.fireEvent("onresize");
  95 + }
  96 + });
  97 + }
12 98 }
13 99  
14 100 </script>
... ... @@ -17,7 +103,7 @@ export default {
17 103 body {
18 104 margin: 0px;
19 105 padding: 0px;
20   - font-family: Microsoft YaHei, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, SimSun, sans-serif;
  106 + font-family: Microsoft YaHei, Helvetica Neue, Helvetica, PingFang SC, Hiragino Sans GB, SimSun, sans-serif;
21 107 font-size: 14px;
22 108 -webkit-font-smoothing: antialiased;
23 109 }
... ... @@ -28,9 +114,11 @@ body {
28 114 bottom: 0px;
29 115 width: 100%;
30 116 }
31   -a{
32   - color: #56a9ff;
  117 +
  118 +a {
  119 + color: #56a9ff;
33 120 }
  121 +
34 122 .fade-enter-active,
35 123 .fade-leave-active {
36 124 transition: all .2s ease;
... ... @@ -40,8 +128,9 @@ a{
40 128 .fade-leave-active {
41 129 opacity: 0;
42 130 }
  131 +
43 132 #nprogress .bar {
44   - height: 3px !important;
45   - background: #56a9ff !important; //自定义颜色
  133 + height: 3px !important;
  134 + background: #56a9ff !important; //自定义颜色
46 135 }
47 136 </style>
... ...
src/api/apis/apis.js
... ... @@ -8,6 +8,13 @@ const defaltService = (url, data) =&gt; {
8 8 data,
9 9 });
10 10 }
  11 +const defaltGetService = (url, data) => {
  12 + return service({
  13 + url: url,
  14 + method: "Get",
  15 + data,
  16 + });
  17 +}
11 18 const downService = (url, data) => {
12 19 return service({
13 20 url: url,
... ... @@ -17,6 +24,63 @@ const downService = (url, data) =&gt; {
17 24 });
18 25 }
19 26 export default {
  27 + // 年级组长-成绩测验单
  28 + gTestExamReport(data) {
  29 + return defaltService(setUpUrls.gtestExamReport, data)
  30 + },
  31 + // 年级组长-试题分析
  32 + gPaperExamReport(data) {
  33 + return defaltService(setUpUrls.gpaperExamReport, data)
  34 + },
  35 + // 年级组长-学生成绩排行
  36 + gStudentExamReport(data) {
  37 + return defaltService(setUpUrls.gstudentExamReport, data)
  38 + },
  39 + // 年级组长-班级情况对比
  40 + gClassdiffExamReport(data) {
  41 + return defaltService(setUpUrls.gclassdiffExamReport, data)
  42 + },
  43 + // 年级组长-查询即时测数据
  44 + gExamListReport(data) {
  45 + return defaltService(setUpUrls.gListExamReport, data)
  46 + },
  47 + // 年级组长-查询管理的班级
  48 + gClass(data) {
  49 + return defaltGetService(setUpUrls.gClassList, data)
  50 + },
  51 + // 年级组长-导出阶段问答报表-多科
  52 + gExportPhaseAnswerReport(data) {
  53 + return defaltService(setUpUrls.gExportPhaseAnswerReport, data)
  54 + },
  55 + // 年级组长-导出阶段测练
  56 + gExportPhaseExamReport(data) {
  57 + return downService(setUpUrls.gExportPhaseExamReport, data)
  58 + },
  59 + // 年级组长-导出阶段问答
  60 + gExportPhaseInteractiveReport(data) {
  61 + return downService(setUpUrls.gExportPhaseInteractiveReport, data)
  62 + },
  63 +
  64 + // 年级组长-首页统计数据
  65 + gIndex(data) {
  66 + return defaltService(setUpUrls.gIndex, data)
  67 + },
  68 + // 年级组长-查询阶段问答-多科
  69 + gPhaseAnswerReport(data) {
  70 + return defaltService(setUpUrls.gPhaseAnswerReport, data)
  71 + },
  72 + // 年级组长-查询阶段测练-多科
  73 + gPhaseExamReport(data) {
  74 + return defaltService(setUpUrls.gPhaseExamReport, data)
  75 + },
  76 + // 年级组长-查询阶段互动-多科
  77 + gPhaseInteractiveReport(data) {
  78 + return defaltService(setUpUrls.gPhaseInteractiveReport, data)
  79 + },
  80 + // 年级组长-查询年级授课科目
  81 + gSubjectList(data) {
  82 + return defaltService(setUpUrls.gSubjectList + data, null)
  83 + },
20 84 // 教师首页数据
21 85 teacherIndex(data) {
22 86 return defaltService(setUpUrls.teacherIndex, data)
... ... @@ -37,8 +101,10 @@ export default {
37 101 personalIndex(data) {
38 102 return defaltService(setUpUrls.personalIndex, data)
39 103 },
40   -
41   -
  104 + //班主任-查询管理的班级
  105 + cTTestExamReport(data) {
  106 + return defaltService(setUpUrls.cTTestExamReport, data)
  107 + },
42 108 //班主任-查询管理的班级
43 109 cTClassList(data) {
44 110 return defaltService(setUpUrls.cTClassList, data)
... ... @@ -71,15 +137,41 @@ export default {
71 137 cTExportPhaseExamReport(data) {
72 138 return downService(setUpUrls.cTExportPhaseExamReport, data)
73 139 },
74   -
  140 + //任课老师-查询管理的班级
  141 + tTestExamReport(data) {
  142 + return defaltService(setUpUrls.tTestExamReport, data)
  143 + },
75 144 //任课老师-查询管理的班级
76 145 tClassList(data) {
77 146 return defaltService(setUpUrls.tClassList, data)
78 147 },
  148 + //任课老师-查询管理的班级
  149 + tClassFromGrade(data) {
  150 + return defaltGetService(setUpUrls.tClassFromGrade + "?classId=" + data)
  151 + },
  152 + tPaperDetail(data) {
  153 + return defaltService(setUpUrls.tPaperDetail, data)
  154 + },
79 155 //任课老师-查询管理班级授课科目
80 156 tSubjectList(data) {
81 157 return defaltService(setUpUrls.tSubjectList, data)
82 158 },
  159 + // 年级组长-试题分析
  160 + tPaperExamReport(data) {
  161 + return defaltService(setUpUrls.tpaperExamReport, data)
  162 + },
  163 + // 年级组长-学生成绩排行
  164 + tStudentExamReport(data) {
  165 + return defaltService(setUpUrls.tstudentExamReport, data)
  166 + },
  167 + // 年级组长-班级情况对比
  168 + tClassdiffExamReport(data) {
  169 + return defaltService(setUpUrls.tclassdiffExamReport, data)
  170 + },
  171 + //任课老师-查询管理班级授课科目
  172 + tListExamReport(data) {
  173 + return defaltService(setUpUrls.tListExamReport, data)
  174 + },
83 175 //任课老师-分页查询课时报表列表
84 176 periodReportList(data) {
85 177 return defaltService(setUpUrls.periodReportList, data)
... ... @@ -194,8 +286,8 @@ export default {
194 286 return defaltService(setUpUrls.tStudentList, data)
195 287 },
196 288 //任课老师-学生测练统计
197   - tStudentExamReport(data) {
198   - return defaltService(setUpUrls.tStudentExamReport, data)
  289 + tgStudentExamReport(data) {
  290 + return defaltService(setUpUrls.tstudentExamReport2, data)
199 291 },
200 292  
201 293 // 查询角色列表
... ...
src/api/urls/apis.js
1 1  
2 2 export default {
  3 + // 年级组长-查询报表列表
  4 + gListExamReport: "/api_html/grade/manager/listExamReport",
  5 + // 年级组长-查询管理的班级
  6 + gClassList: "/api_html/grade/manager/classList",
  7 + // 年级组长-导出阶段问答报表-多科
  8 + gExportPhaseAnswerReport: "/api_html/grade/manager/exportPhaseAnswerReport",
  9 + // 年级组长-导出阶段测练
  10 + gExportPhaseExamReport: "/api_html/grade/manager/exportPhaseExamReport",
  11 + // 年级组长-导出阶段问答
  12 + gExportPhaseInteractiveReport: "/api_html/grade/manager/exportPhaseInteractiveReport",
  13 + // 年级组长-成绩测验单
  14 + gtestExamReport: "/api_html/grade/manager/testExamReport",
  15 + // 年级组长-试题分析
  16 + gpaperExamReport: "/api_html/grade/manager/paperExamReport",
  17 + // 年级组长-学生成绩排行
  18 + gstudentExamReport: "/api_html/grade/manager/studentExamReport",
  19 + // 年级组长-班级情况对比
  20 + gclassdiffExamReport: "/api_html/grade/manager/classdiffExamReport",
  21 + // 年级组长-首页统计数据
  22 + gIndex: "/api_html/grade/manager/index",
  23 + // 年级组长-查询阶段问答-多科
  24 + gPhaseAnswerReport: "/api_html/grade/manager/phaseAnswerReport",
  25 + // 年级组长-查询阶段测练-多科
  26 + gPhaseExamReport: "/api_html/grade/manager/phaseExamReport",
  27 + // 年级组长-查询阶段互动-多科
  28 + gPhaseInteractiveReport: "/api_html/grade/manager/phaseInteractiveReport",
  29 + // 年级组长-查询年级授课科目
  30 + gSubjectList: "/api_html/grade/manager/subjectList",
3 31 // 授课老师首页数据
4 32 teacherIndex: "/api_html/teaching/index",
5 33 // 学校管理员首页数据
... ... @@ -24,11 +52,24 @@ export default {
24 52 cTExportPhaseInteractiveReport: "/api_html/class/manager/exportPhaseInteractiveReport",
25 53 //班主任- 导出阶段测练报表
26 54 cTExportPhaseExamReport: "/api_html/class/manager/exportPhaseExamReport",
  55 + //班主任- 测验成绩单
  56 + cTTestExamReport: "/api_html/class/manager/phaseExamReport",
27 57  
28 58 //任课老师-查询管理班级
29 59 tClassList: "/api_html/teaching/classList",
  60 + tpaperExamReport: "/api_html/teaching/paperExamReport",
  61 + // 任课老师-学生成绩排行
  62 + tstudentExamReport2: "/api_html/teaching/studentExamReport2",
  63 + // 任课老师-班级情况对比
  64 + tclassdiffExamReport: "/api_html/teaching/classdiffExamReport",
  65 + tClassFromGrade: "/api_html/teaching/grade/classList",
  66 + //任课老师-测验成绩单
  67 + tTestExamReport: "/api_html/teaching/testExamReport",
  68 + //任课老师-查询答题卡详情
  69 + tPaperDetail: "/api_html/teaching/paperDetail",
30 70 //任课老师-查询管理班级授课科目
31 71 tSubjectList: "/api_html/teaching/subjectList",
  72 + tListExamReport: "/api_html/teaching/listExamReport",
32 73 //任课老师-分页查询课时报表列表
33 74 periodReportList: "/api_html/teaching/periodReportList",
34 75 //任课老师-查询阶段问答报表
... ...
src/assets/css/index.scss
  1 +.default-date-radio-group {
  2 + height: 100%;
  3 + line-height: 1;
  4 +
  5 + .el-radio-button__inner {
  6 + display: inline-block;
  7 + border: none;
  8 + height: 100%;
  9 + line-height: 10px;
  10 + font-size: 14px;
  11 + border: none !important;
  12 + box-shadow: none !important;
  13 + padding: 0px !important;
  14 + margin-right: 15px;
  15 + }
  16 +
  17 + :first-child {
  18 + margin-left: 12px;
  19 + }
  20 +
  21 + .el-radio-button__orig-radio:checked+.el-radio-button__inner {
  22 + background: transparent !important;
  23 + color: #6b7ef5 !important;
  24 + font-weight: bold;
  25 + border: none !important;
  26 + box-shadow: none !important;
  27 + }
  28 +}
  29 +
  30 +.green-el-button {
  31 + background-color: rgba(65, 204, 149, 1);
  32 + color: white;
  33 + border-color: rgba(65, 204, 149, 1);
  34 +
  35 + :focus,:hover {
  36 + background-color: rgba(65, 204, 149, 1);
  37 + color: white;
  38 + border-color: rgba(65, 204, 149, 1);
  39 + }
  40 +
  41 +}
  42 +
1 43 .answer-header {
2 44 padding: 16px 40px 12px 20px;
3 45 display: flex;
... ... @@ -199,6 +241,7 @@ ul {
199 241  
200 242 .screenshot-box {
201 243 width: 600px;
  244 +
202 245 .screenshot {
203 246 width: 100%;
204 247 box-shadow: none;
... ... @@ -245,4 +288,125 @@ ul {
245 288 width: 148px !important;
246 289 }
247 290 }
  291 +}
  292 +
  293 +// 默认标题
  294 +.default-title {
  295 + height: 36px;
  296 + font-weight: bold;
  297 + font-size: 24px;
  298 + color: #131523;
  299 + line-height: 36px;
  300 + text-align: left;
  301 + font-style: normal;
  302 + text-transform: none;
  303 +}
  304 +
  305 +// 默认实体
  306 +.default-body {
  307 + font-size: 14px;
  308 + font-weight: 400;
  309 + color: #303133;
  310 + background-color: #F5F6FA;
  311 +
  312 + .default-filter,
  313 + .el-main {
  314 + background: #FFFFFF;
  315 + box-shadow: 0px 1px 4px 0px rgba(21, 34, 50, 0.08);
  316 + }
  317 +
  318 + .detailBack {
  319 + height: auto !important;
  320 + border: none !important;
  321 + }
  322 +
  323 + .el-header {
  324 + padding: 20px !important;
  325 + }
  326 +
  327 + .el-main {
  328 + margin: 0px 20px !important;
  329 + padding: 0px !important;
  330 +
  331 + .default-table {
  332 + th {
  333 + font-weight: 400;
  334 + font-size: 14px;
  335 + color: #5A607F;
  336 + text-align: left;
  337 + font-style: normal;
  338 + text-transform: none;
  339 + border:1px solid #ebeef5;
  340 + }
  341 +
  342 + tr,td {
  343 + height: 40px; border:1px solid #ebeef5;
  344 + }
  345 + }
  346 +
  347 + .default-tabs {
  348 + .el-tabs__item {
  349 + border: none !important;
  350 + }
  351 +
  352 + .el-tabs__header {
  353 + background: #F5F7FA !important;
  354 + }
  355 +
  356 + .el-tabs__item.is-active {
  357 + background: white !important;
  358 + color: #667FFD !important;
  359 + }
  360 + }
  361 + }
  362 +
  363 + .el-footer-pagination {
  364 + height: 40px !important;
  365 + background: #FFFFFF;
  366 + margin: 0px 20px !important;
  367 +
  368 + .el-footer-pagination-box,
  369 + .el-pagination {
  370 + line-height: 30px;
  371 + float: right;
  372 + vertical-align: middle;
  373 + height: 30px;
  374 + }
  375 + }
  376 +
  377 + .default-filter {
  378 + margin: 14px 20px !important;
  379 + padding: 14px 20px !important;
  380 +
  381 + * {
  382 + height: 32px;
  383 + line-height: 32px;
  384 + }
  385 +
  386 + .filter-input,
  387 + .filter-select {
  388 + width: 13%;
  389 + margin-right: 10px;
  390 + }
  391 +
  392 + .filter-datePicker {
  393 + width: 25%;
  394 + margin-right: 10px;
  395 +
  396 + input {
  397 + // border: 1px solid #DCDFE6;
  398 + height: 31px;
  399 + }
  400 + }
  401 +
  402 + .el-button {
  403 + width: auto;
  404 + line-height: 0px;
  405 + padding: 0px 15px !important;
  406 + }
  407 +
  408 + .el-button--primary {
  409 + background-color: rgb(107, 126, 245);
  410 + }
  411 + }
248 412 }
249 413 \ No newline at end of file
... ...
src/assets/desktop.ini 0 → 100644
  1 +[ViewState]
  2 +Mode=
  3 +Vid=
  4 +FolderType=Generic
... ...
src/assets/images/aside/ask-default.png 0 → 100644

2.79 KB

src/assets/images/aside/paper-default.png 0 → 100644

2.49 KB

src/assets/images/aside/paper-selected.png 0 → 100644

2.5 KB

src/assets/images/aside/shouye-default.png 0 → 100644

2.98 KB

src/assets/images/aside/shouye-selected.png 0 → 100644

3.14 KB

src/assets/images/aside/suitangwen-baobiao-default.png 0 → 100644

1.83 KB

src/assets/images/aside/suitangwen-baobiao-selected.png 0 → 100644

1.84 KB

src/assets/images/aside/test-default.png 0 → 100644

2.81 KB

src/assets/images/rili.png 0 → 100644

1.58 KB

src/assets/images/shuaxin.png 0 → 100644

3.29 KB

src/assets/images/shuben.png 0 → 100644

2.02 KB

src/assets/images/tishu.png 0 → 100644

1.63 KB

src/assets/nav/askPreparationQuestions.png 0 → 100644

7.45 KB

src/assets/nav/testComposingPaper.png 0 → 100644

7.45 KB

src/components/exportDia.vue
... ... @@ -3,7 +3,7 @@
3 3 <el-dialog
4 4 :close-on-click-modal="false"
5 5 :visible.sync="diaShow"
6   - width="360px"
  6 + width="360px" :append-to-body="true"
7 7 :show-close="false"
8 8 >
9 9 <i class="el-icon-close" @click="closeDia"></i>
... ...
src/components/setAnswer.vue
... ... @@ -3,7 +3,7 @@
3 3 class="el-dialog-wrapper"
4 4 v-show="diaVisible"
5 5 width="400"
6   - center
  6 + center :append-to-body="true"
7 7 @click.self="cancel"
8 8 >
9 9 <div class="el-dialog-content">
... ... @@ -80,9 +80,9 @@
80 80 </div>
81 81 </div>
82 82 <el-dialog :close-on-click-modal="false"
83   - title="批量设置答案"
  83 + title="批量设置答案"
84 84 :visible.sync="diaSetAns"
85   - width="400"
  85 + width="400" :append-to-body="true"
86 86 :modal-append-to-body="false"
87 87 >
88 88 <div class="qs-options set-questions">
... ...
src/router/index.js
... ... @@ -67,6 +67,17 @@ const SetUpClazz = () =&gt; import(&quot;@/views/basic/setUp/clazz&quot;)
67 67 const Archived = () => import("@/views/basic/setUp/archived")
68 68 const DeviceError = () => import("@/views/basic/device/error")
69 69  
  70 +// v1.5 年级组长
  71 +const gradeAnalysis = () => import("@/views/basic/askTestQuestion/gradeAnalysis")
  72 +const gradeDetail = () => import("@/views/basic/askTestQuestion/gradeAnalysisDetail")
  73 +
  74 +const askTestQuestion = () => import("@/views/basic/askTestQuestion/index")
  75 +const askTestDetail = () => import("@/views/basic/askTestQuestion/view")
  76 +const askTestUpdate = () => import("@/views/basic/askTestQuestion/update")
  77 +const askTestReport = () => import("@/views/basic/askTestQuestion/report")
  78 +const askTestReportDetail = () => import("@/views/basic/askTestQuestion/detail")
  79 +const askTestReportRecycle = () => import("@/views/basic/askTestQuestion/recycle")
  80 +
70 81 /**
71 82 * 重写路由的push方法
72 83 */
... ... @@ -91,7 +102,9 @@ let defaultRouter = [
91 102 },
92 103 {
93 104 path: "/index",
94   - iconCls: "fa fa-home", // 图标样式class
  105 + iconImage: require("@/assets/images/aside/shouye-default.png"),
  106 + selectedIconImage: require("@/assets/images/aside/shouye-selected.png"),
  107 + // iconCls: "fa fa-home", // 图标样式class
95 108 name: "应用首页",
96 109 component: Layout,
97 110 alone: true,
... ... @@ -108,7 +121,7 @@ let defaultRouter = [
108 121 {
109 122 path: "/deviceError",
110 123 iconCls: "fa fa-home", // 图标样式class
111   - name: "异常设备信息",
  124 + name: "异常设备信息菜单",
112 125 component: Layout,
113 126 hidden: true,
114 127 children: [
... ... @@ -123,7 +136,7 @@ let defaultRouter = [
123 136 {
124 137 path: "/userInfo",
125 138 iconCls: "fa fa-user", // 图标样式class
126   - name: "个人信息",
  139 + name: "个人信息菜单",
127 140 component: Layout,
128 141 hidden: true,
129 142 children: [
... ... @@ -151,7 +164,8 @@ let addrouters = [
151 164 iconCls: "fa fa-file-text", // 图标样式class
152 165 name: "备题组卷",
153 166 component: Layout,
154   - alone: true,
  167 + alone: false,
  168 + hidden: true,
155 169 children: [
156 170 {
157 171 path: "/examinationPaper",
... ... @@ -204,96 +218,163 @@ let addrouters = [
204 218 ]
205 219 },
206 220 {
207   - path: "/ask",
208   - iconCls: "fa fa-bar-chart", // 图标样式class
209   - name: "随堂问报表",
  221 + path: "/testGrade",
  222 + iconImage: require("@/assets/images/aside/test-default.png"),
  223 + name: "即时测",
210 224 component: Layout,
211   - alone: true,
212 225 children: [
213 226 {
214   - path: "/ask",
215   - iconCls: "fa fa-bar-chart", // 图标样式class
216   - name: "随堂问报表",
217   - component: Ask,
  227 + path: "/testGradeReport",
  228 + iconImage: require("@/assets/images/aside/suitangwen-baobiao-default.png"),
  229 + selectedIconImage: require("@/assets/images/aside/suitangwen-baobiao-selected.png"),
  230 + name: '即时测报表',
  231 + demoRoles: ["ROLE_NIANJI"],
  232 + component: gradeAnalysis,
218 233 children: []
219   -
220   - },
221   - {
222   - path: "/askList",
223   - iconCls: "fa fa-bar-chart", // 图标样式class
224   - name: "随堂问报表",
225   - component: AskList,
226   - children: [
227   - {
228   - path: "/askAnalysis",
229   - iconCls: "", // 图标样式class
230   - name: "随堂问报表分析",
231   - component: AskAnalysis,
232   - parent: "askList",
233   - children: []
234   - },
235   -
236   - ],
237   - },
238   - {
239   - path: "/askArchiving",
240   - iconCls: "", // 图标样式class
241   - name: "随堂问已归档报表分析",
242   - component: AskArchiving,
243   - parent: "ask",
  234 + }, {
  235 + path: "/testGradeReportDetail",
  236 + iconCls: "",
  237 + name: "testGradeReportDetail",
  238 + demoRoles: ["ROLE_NIANJI"],
  239 + component: gradeDetail,
244 240 hidden: true,
245   - meta: {
246   - keepAlive: true,
247   - },
248 241 children: []
249   -
250 242 }
251 243 ]
252 244 },
253 245 {
254   - path: "/test",
255   - iconCls: "fa fa-pie-chart", // 图标样式class
256   - name: "即时测报表",
  246 + path: "/askTeacher",
  247 + iconImage: require("@/assets/images/aside/ask-default.png"),
  248 + name: "随堂问",
257 249 component: Layout,
258   - alone: true,
259   - children: [
260   - {
261   - path: "/test",
262   - iconCls: "fa fa-pie-chart", // 图标样式class
263   - name: "",
264   - component: Test,
265   - children: []
266   - },
267   - {
268   - path: "/testList",
269   - name: "",
270   - component: TestList,
271   -
272   - children: [
273   - {
274   - path: "/testAnalysis",
275   - iconCls: "", // 图标样式class
276   - name: "即时测报表分析",
277   - component: TestAnalysis,
278   - parent: "test",
279   - children: []
280   - },
281   - ]
282   - },
283   - {
284   - path: "/testArchiving",
285   - iconCls: "", // 图标样式class
286   - name: "即时测已归档报表分析",
287   - component: TestArchiving,
288   - parent: "test",
289   - hidden: true,
290   - meta: {
291   - keepAlive: true,
292   - },
293   - children: []
294   - }
295   -
296   - ]
  250 + children: [{
  251 + path: "/askPreparationQuestions",
  252 + iconImage: require("@/assets/images/aside/paper-default.png"),
  253 + selectedIconImage: require("@/assets/images/aside/paper-selected.png"),
  254 + name: '备题',
  255 + demoRoles: ["ROLE_JIAOSHI"],
  256 + component: askTestQuestion,
  257 + children: []
  258 + }, {
  259 + path: "/askReport",
  260 + iconImage: require("@/assets/images/aside/suitangwen-baobiao-default.png"),
  261 + selectedIconImage: require("@/assets/images/aside/suitangwen-baobiao-selected.png"),
  262 + name: '报表',
  263 + demoRoles: ["ROLE_JIAOSHI", "ROLE_BANZHUREN"],
  264 + component: askTestReport,
  265 + children: []
  266 + }, {
  267 + path: "/askPreparationQuestionsDetail",
  268 + iconCls: "",
  269 + name: "askPreparationQuestionsDetail",
  270 + demoRoles: ["ROLE_JIAOSHI"],
  271 + component: askTestDetail,
  272 + hidden: true,
  273 + children: []
  274 + }, {
  275 + path: "/askPreparationQuestionsUpdate",
  276 + iconCls: "",
  277 + name: "askPreparationQuestionsUpdate",
  278 + demoRoles: ["ROLE_JIAOSHI"],
  279 + component: askTestUpdate,
  280 + hidden: true,
  281 + children: []
  282 + }, {
  283 + path: "/askReportDetail",
  284 + iconCls: "",
  285 + name: "askReportDetail",
  286 + demoRoles: ["ROLE_JIAOSHI"],
  287 + component: askTestReportDetail,
  288 + hidden: true,
  289 + children: []
  290 + }, {
  291 + path: "/askPreparationQuestionsRecycle",
  292 + iconCls: "",
  293 + name: "askPreparationQuestionsRecycle",
  294 + demoRoles: ["ROLE_JIAOSHI"],
  295 + component: askTestReportRecycle,
  296 + hidden: true,
  297 + children: []
  298 + }, {
  299 + path: "/askPreparationQuestionsAdd",
  300 + iconCls: "",
  301 + name: "askPreparationQuestionsAdd",
  302 + demoRoles: ["ROLE_JIAOSHI"],
  303 + component: ExaminationPaperAddQs,
  304 + hidden: true,
  305 + children: []
  306 + }]
  307 + },
  308 + {
  309 + path: "/testTeacher",
  310 + iconImage: require("@/assets/images/aside/test-default.png"),
  311 + name: "即时测",
  312 + component: Layout,
  313 + children: [{
  314 + path: "/testPaper",
  315 + iconImage: require("@/assets/images/aside/paper-default.png"),
  316 + selectedIconImage: require("@/assets/images/aside/paper-selected.png"),
  317 + name: '组卷',
  318 + demoRoles: ["ROLE_JIAOSHI"],
  319 + component: askTestQuestion,
  320 + children: []
  321 + }, {
  322 + path: "/testReport",
  323 + iconImage: require("@/assets/images/aside/suitangwen-baobiao-default.png"),
  324 + selectedIconImage: require("@/assets/images/aside/suitangwen-baobiao-selected.png"),
  325 + name: '报表',
  326 + demoRoles: ["ROLE_JIAOSHI", "ROLE_BANZHUREN"],
  327 + component: askTestReport,
  328 + children: []
  329 + }, {
  330 + path: "/testPaperQuestionsDetail",
  331 + iconCls: "",
  332 + name: "testPaperQuestionsDetail",
  333 + demoRoles: ["ROLE_JIAOSHI"],
  334 + component: askTestDetail,
  335 + hidden: true,
  336 + children: []
  337 + }, {
  338 + path: "/testPaperQuestionsUpdate",
  339 + iconCls: "",
  340 + name: "testPaperQuestionsUpdate",
  341 + demoRoles: ["ROLE_JIAOSHI"],
  342 + component: askTestUpdate,
  343 + hidden: true,
  344 + children: []
  345 + }, {
  346 + path: "/testReportDetail",
  347 + iconCls: "",
  348 + name: "testReportDetail",
  349 + demoRoles: ["ROLE_JIAOSHI"],
  350 + component: askTestReportDetail,
  351 + hidden: true,
  352 + children: []
  353 + }, {
  354 + path: "/testReportRecycle",
  355 + iconCls: "",
  356 + name: "testReportRecycle",
  357 + demoRoles: ["ROLE_JIAOSHI"],
  358 + component: askTestReportRecycle,
  359 + hidden: true,
  360 + children: []
  361 + }, {
  362 + path: "/testPaperRecycle",
  363 + iconCls: "",
  364 + name: "testPaperRecycle",
  365 + demoRoles: ["ROLE_JIAOSHI"],
  366 + component: askTestReportRecycle,
  367 + hidden: true,
  368 + children: []
  369 + }, {
  370 + path: "/testPaperAdd",
  371 + iconCls: "",
  372 + name: "testPaperAdd",
  373 + demoRoles: ["ROLE_JIAOSHI"],
  374 + component: ExaminationPaperAdd,
  375 + hidden: true,
  376 + children: []
  377 + }]
297 378 },
298 379 {
299 380 path: "/setUpConglomerate",
... ... @@ -327,6 +408,7 @@ let addrouters = [
327 408 },
328 409 ]
329 410 },
  411 +
330 412 {
331 413 path: "/",
332 414 iconCls: "fa fa-cog",
... ... @@ -506,6 +588,7 @@ let addrouters = [
506 588 // ]
507 589 // },
508 590 ]
  591 +
509 592 //长水版路由表
510 593 let csAddrouters = [
511 594 {
... ... @@ -574,7 +657,6 @@ let csAddrouters = [
574 657 keepAlive: true,
575 658 },
576 659 children: []
577   -
578 660 },
579 661 {
580 662 path: "/askAnalysis",
... ... @@ -1046,7 +1128,7 @@ const addroutersPersonal = [
1046 1128 keepAlive: true,
1047 1129 },
1048 1130 children: []
1049   -
  1131 +
1050 1132 }
1051 1133 ]
1052 1134 },
... ...
src/store/index.js
... ... @@ -41,6 +41,7 @@ const store = new Vuex.Store({
41 41 localStorage.setItem("info", JSON.stringify(data));
42 42 },
43 43 setRouters: (state, routers) => {
  44 + console.log('current', state);
44 45 let addrouterList = []
45 46 if (state.info.showRole == 'ROLE_PERSONAL') {
46 47 addrouterList = [...addroutersPersonal]
... ... @@ -52,13 +53,22 @@ const store = new Vuex.Store({
52 53 } else {
53 54 addrouterList = [...addrouters]
54 55 }
55   -
56 56 }
  57 +
57 58 let aRouters = addrouterList.filter((item) => {
  59 +
58 60 let path = item.children[0]?.path.replace("/", "");
59   - return routers?.includes(path);
60   - });
  61 + if (routers?.includes(path) == true) return item;
  62 + else if (item.demoRoles?.includes(state.info.showRole) == true) return item;
61 63  
  64 + if (item.children) {
  65 + item.children = item.children.filter((itemFilter) => {
  66 + return itemFilter.demoRoles?.includes(state.info.showRole) == true
  67 + });
  68 + if (item.children.length >= 1) return item;
  69 + }
  70 + return null;
  71 + });
62 72 state.addRouters = aRouters; // 保存动态路由用来addRouter
63 73 state.routers = defaultRouter.concat(aRouters); // 所有有权限的路由表,用来生成菜单列表
64 74 localStorage.setItem("addRouters", JSON.stringify(routers));
... ... @@ -91,6 +101,7 @@ const store = new Vuex.Store({
91 101 .then((res) => {
92 102 let response = res;
93 103 if (response.status == 0) {
  104 + console.log(response)
94 105 const userInfo = { ...response.data };
95 106 if (userInfo.permissions && userInfo.permissions.length) {
96 107 userInfo.showRoleName = response.data.permissions[0]?.roleName;
... ...
src/store/modules/layout/index.js
... ... @@ -17,7 +17,7 @@ export default {
17 17 path: "/index"
18 18 }]
19 19 },
20   - addTab(state, arg) {
  20 + addTab(state, arg) {
21 21 state.isActive = arg.path
22 22 if (state.tabnavBox[0] && state.tabnavBox[0].title !== "home") {
23 23 state.tabnavBox.unshift({
... ...
src/utils/global.js
1 1 import rules from "./rules"
2 2 import request from "@/api"
  3 +import { Loading } from 'element-ui';
3 4  
4 5 export default {
5   - install (Vue, options) {
  6 + install(Vue, options) {
6 7 Vue.prototype.$request = request
7 8 Vue.prototype.$rules = rules
  9 + Vue.prototype.$loading = {
  10 + loading: null,
  11 + open() {
  12 + this.loading = Loading.service({
  13 + lock: true,
  14 + text: '加载中',
  15 + spinner: 'el-icon-loading',
  16 + background: 'rgba(0, 0, 0, 0.7)',
  17 + fullscreen: true
  18 + });
  19 + },
  20 + close() {
  21 + if (this.loading) {
  22 + this.loading.close();
  23 + this.loading = null;
  24 + }
  25 + }
  26 + }
8 27 }
9 28 }
... ...
src/utils/index.js
... ... @@ -21,6 +21,62 @@ export function encryptLoginPassword(data) {
21 21 }
22 22  
23 23 /**
  24 + * 设置本周,本月,本季度
  25 + * @param index: 规则值
  26 + * @returns startDay=开始时间,endDay=结束时间
  27 + */
  28 +export function setDateRules(type) {
  29 + var that = {};
  30 + let aYear = new Date().getFullYear();
  31 + let aMonth = new Date().getMonth() + 1;
  32 +
  33 + that.day = "";
  34 + that.startDay = "";
  35 + that.endDay = "";
  36 +
  37 + switch (type) {
  38 + case "onDay":
  39 + that.day = formatDate(new Date(), "yyyy-MM-dd");
  40 + that.startDay = that.day;
  41 + that.endDay = that.day;
  42 + break;
  43 + case "onWeek":
  44 + let day = new Date().getDay();
  45 + if (day == 0) {
  46 + //中国式星期天是一周的最后一天
  47 + day = 7;
  48 + }
  49 + day--;
  50 + let aTime = new Date().getTime() - 24 * 60 * 60 * 1000 * day;
  51 + that.startDay = formatDate(new Date(aTime), "yyyy-MM-dd");
  52 + that.endDay = formatDate(new Date(), "yyyy-MM-dd");
  53 + break;
  54 + case "onMonth":
  55 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  56 + that.startDay = `${aYear}-${aMonth}-01`;
  57 + that.endDay = formatDate(new Date(), "yyyy-MM-dd");
  58 + break;
  59 + case "onQuarter":
  60 + if (aMonth > 0 && aMonth < 4) {
  61 + aMonth = "1";
  62 + } else if (aMonth > 3 && aMonth < 7) {
  63 + aMonth = "4";
  64 + } else if (aMonth > 6 && aMonth < 10) {
  65 + aMonth = "7";
  66 + } else {
  67 + aMonth = "10";
  68 + }
  69 +
  70 + aMonth = aMonth < 10 ? "0" + aMonth : aMonth;
  71 + that.startDay = `${aYear}-${aMonth}-01`;
  72 + that.endDay = formatDate(new Date(), "yyyy-MM-dd");
  73 + break;
  74 + }
  75 +
  76 + return that;
  77 +}
  78 +
  79 +/**
24 80 * 对称加密
25 81 * @param secret:加密公钥
26 82 * @param data: 待加密数据
... ... @@ -808,6 +864,17 @@ export function tablePrint(id, title, type = null) {
808 864 .hui-s.s3{width: 120px;}
809 865 .info { display: flex;flex-wrap: wrap;border-left: 1px solid #ccc;border-top: 1px solid #ccc;margin-bottom: 12px;}
810 866 .info-item {width: 25%;height: 50px;box-sizing: border-box;flex-shrink: 0;background: #f8f8f8;border-right: 1px solid #ccc;border-bottom: 1px solid #ccc;line-height: 50px;text-align: center;}
  867 + .row-line { width: calc(20% - 2px);
  868 + border: 1px solid #ebeef5;
  869 + background: #f5f7fa;
  870 + display: inline-block;
  871 + height: 40px;
  872 + line-height: 40px;
  873 +
  874 + .line-subfix {
  875 + margin-left: 10px;
  876 + }}
  877 +
811 878 .el-table__header,.el-table__body{width:100%!important;}
812 879 #print-table{max-width:1400px;margin: 0 auto;width: 100%;}
813 880 .hide{max-width:1400px;margin: 0 auto;width: 100%;border-left: 1px solid #ccc;border-spacing:0;box-sizing:border-box}
... ...
src/views/admin/account/index.vue
... ... @@ -161,7 +161,9 @@
161 161 </el-pagination>
162 162 </div>
163 163 </div>
164   - <el-dialog :close-on-click-modal="false" title="修改账号信息" :visible.sync="diaCount" width="400">
  164 + <el-dialog :close-on-click-modal="false" title="修改账号信息"
  165 + :append-to-body="true"
  166 + :visible.sync="diaCount" width="400">
165 167 <el-form
166 168 class="form-box"
167 169 :model="formCount"
... ... @@ -223,7 +225,8 @@
223 225 <el-button @click="diaCount = false">取 消</el-button>
224 226 </div>
225 227 </el-dialog>
226   - <el-dialog :close-on-click-modal="false" title="添加账号" :visible.sync="diaAdd" width="400">
  228 + <el-dialog :close-on-click-modal="false" title="添加账号" :append-to-body="true"
  229 + :visible.sync="diaAdd" width="400">
227 230 <el-form
228 231 class="form-box"
229 232 :model="formAddCount"
... ...
src/views/admin/clientVersion/index.vue
... ... @@ -77,7 +77,7 @@
77 77 </div>
78 78 </div>
79 79 <el-dialog :close-on-click-modal="false"
80   - title="添加账号"
  80 + title="添加账号" :append-to-body="true"
81 81 :visible.sync="diaAdd"
82 82 v-if="diaAdd"
83 83 width="400"
... ...
src/views/basic/ask/analysis.vue
... ... @@ -6,21 +6,15 @@
6 6 types == 1
7 7 ? "单课分析"
8 8 : types == 2
9   - ? `${className}-${subjectNames[0]}汇总分析`
10   - : `${className}-多科汇总分析`
  9 + ? `${className}-${subjectNames[0]}汇总分析`
  10 + : `${className}-多科汇总分析`
11 11 }}</span>
12 12 </template>
13 13 </back-box>
14 14 <div class="page-content">
15 15 <div class="tab-box">
16   - <span
17   - class="tab-item"
18   - v-for="(item, index) in tabList"
19   - :key="index"
20   - :class="type == item.value ? 'active' : ''"
21   - @click="setType(item.value)"
22   - >{{ item.name }}</span
23   - >
  16 + <span class="tab-item" v-for="(item, index) in tabList" :key="index" :class="type == item.value ? 'active' : ''"
  17 + @click="setType(item.value)">{{ item.name }}</span>
24 18 </div>
25 19 <div v-loading="loading">
26 20 <div id="print-content">
... ... @@ -29,66 +23,27 @@
29 23 <!-- 学生答题情况 -->
30 24 <Example v-if="type == 1" :types="types" :tableData="tableData" />
31 25 <!-- 学生问答 -->
32   - <AnswerQustion
33   - v-if="type == 2"
34   - :types="types"
35   - :tableData="tableData"
36   - :subjectNames="subjectNames"
37   - />
  26 + <AnswerQustion v-if="type == 2" :types="types" :tableData="tableData" :subjectNames="subjectNames" />
38 27 <!-- 学生互动表现 -->
39 28 <Interact v-if="type == 3" :types="types" :tableData="tableData" />
40 29 <!-- 签到明细 -->
41 30 <Report v-if="type == 4" :tableData="tableData" />
42 31 </div>
43 32 <div class="pagination-box" v-show="type == 1">
44   - <el-pagination
45   - small=""
46   - layout="total,prev, pager, next"
47   - :hide-on-single-page="true"
48   - :total="total"
49   - @current-change="changePage"
50   - :current-page="page"
51   - :page-size="size"
52   - >
  33 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  34 + @current-change="changePage" :current-page="page" :page-size="size">
53 35 </el-pagination>
54 36 </div>
55 37 <p class="down">
56   - <el-button
57   - v-if="types == 1"
58   - @click="exportData"
59   - type="primary"
60   - plain
61   - round
62   - icon="fa fa-cloud-download"
63   - >导出报表</el-button
64   - >
65   - <el-button
66   - v-else
67   - @click="openDown"
68   - type="primary"
69   - plain
70   - round
71   - icon="fa fa-cloud-download"
72   - >导出报表</el-button
73   - >
74   - <el-button
75   - v-if="!this.$store.getters.code"
76   - @click="print"
77   - type="primary"
78   - plain
79   - round
80   - icon="el-icon-printer"
81   - >打印</el-button
82   - >
  38 + <el-button v-if="types == 1" @click="exportData" type="primary" plain round
  39 + icon="fa fa-cloud-download">导出报表</el-button>
  40 + <el-button v-else @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  41 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  42 + icon="el-icon-printer">打印</el-button>
83 43 </p>
84 44 </div>
85   - <ExportDia
86   - :exportStudent="exportStudent"
87   - :diaShow="diaShow"
88   - @cancel="cancel"
89   - @exportData="exportData"
90   - :type="types == 3 ? '雷达图' : '折线图'"
91   - />
  45 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData"
  46 + :type="types == 3 ? '雷达图' : '折线图'" />
92 47 </div>
93 48 </div>
94 49 </template>
... ... @@ -241,8 +196,8 @@ export default {
241 196 this.type == 1
242 197 ? this.$request.pPeriodQuestionReport
243 198 : this.type == 2
244   - ? this.$request.phaseAnswerReport
245   - : this.$request.phaseInteractiveReport;
  199 + ? this.$request.phaseAnswerReport
  200 + : this.$request.phaseInteractiveReport;
246 201 } else if (this.types == 3) {
247 202 queryData =
248 203 this.type == 2
... ... @@ -262,8 +217,8 @@ export default {
262 217 this.type == 1
263 218 ? this.$request.periodQuestionReport
264 219 : this.type == 2
265   - ? this.$request.phaseAnswerReport
266   - : this.$request.phaseInteractiveReport;
  220 + ? this.$request.phaseAnswerReport
  221 + : this.$request.phaseInteractiveReport;
267 222 } else if (this.types == 3) {
268 223 queryData =
269 224 this.type == 2
... ... @@ -370,8 +325,8 @@ export default {
370 325 this.types == 1
371 326 ? "随堂问-单课时报表.xlsx"
372 327 : this.types == 2
373   - ? `随堂问-${this.className}-${this.subjectNames[0]}汇总分析报表.xlsx`
374   - : `随堂问-${this.className}-多科汇总分析报表.xlsx`;
  328 + ? `随堂问-${this.className}-${this.subjectNames[0]}汇总分析报表.xlsx`
  329 + : `随堂问-${this.className}-多科汇总分析报表.xlsx`;
375 330 downloadFile(this.status ? "随堂问-已归档单课时报表.xlsx" : name, blob);
376 331 } else {
377 332 this.$message.error("下载失败");
... ...
src/views/basic/ask/archiving.vue
... ... @@ -7,82 +7,33 @@
7 7 </back-box>
8 8 <div class="answer-header">
9 9 <div class="sel-box">
10   - <el-select
11   - class="sel"
12   - v-model="query.classId"
13   - placeholder="选择班级"
14   - @change="changeclass"
15   - >
16   - <el-option
17   - v-for="item in classList"
18   - :key="item.value"
19   - :label="item.label"
20   - :value="item.value"
21   - >
  10 + <el-select class="sel" v-model="query.classId" placeholder="选择班级" @change="changeclass">
  11 + <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value">
22 12 </el-option>
23 13 </el-select>
24   - <el-select
25   - v-if="role == 'ROLE_BANZHUREN' || role == 'ROLE_PERSONAL'"
26   - class="sel"
27   - multiple
28   - v-model="query.subjectNames"
29   - placeholder="选择科目"
30   - @change="changeSub"
31   - >
32   - <el-option
33   - v-for="item in subjectList"
34   - :key="item.value"
35   - :label="item.label"
36   - :value="item.value"
37   - >
  14 + <el-select v-if="role == 'ROLE_BANZHUREN' || role == 'ROLE_PERSONAL'" class="sel" multiple
  15 + v-model="query.subjectNames" placeholder="选择科目" @change="changeSub">
  16 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">
38 17 </el-option>
39 18 </el-select>
40   - <el-select
41   - v-else
42   - class="sel"
43   - v-model="query.subjectNames"
44   - placeholder="选择科目"
45   - >
46   - <el-option
47   - v-for="item in subjectList"
48   - :key="item.value"
49   - :label="item.label"
50   - :value="item.value"
51   - >
  19 + <el-select v-else class="sel" v-model="query.subjectNames" placeholder="选择科目">
  20 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">
52 21 </el-option>
53 22 </el-select>
54 23 <div class="d1">
55   - <el-date-picker
56   - v-model="query.startDay"
57   - type="date"
58   - @change="handleChangeTimeStart"
59   - placeholder="选择日期时间"
60   - value-format="yyyy-MM-dd"
61   - >
  24 + <el-date-picker v-model="query.startDay" type="date" @change="handleChangeTimeStart" placeholder="选择日期时间"
  25 + value-format="yyyy-MM-dd">
62 26 </el-date-picker>
63 27 ~
64   - <el-date-picker
65   - v-model="query.endDay"
66   - type="date"
67   - placeholder="选择日期时间"
68   - @change="handleChangeTimeEnd"
69   - value-format="yyyy-MM-dd"
70   - >
  28 + <el-date-picker v-model="query.endDay" type="date" placeholder="选择日期时间" @change="handleChangeTimeEnd"
  29 + value-format="yyyy-MM-dd">
71 30 </el-date-picker>
72 31 </div>
73 32 <p class="p1">
74   - <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
75   - >今天</span
76   - >
77   - <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
78   - >本周</span
79   - >
80   - <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
81   - >本月</span
82   - >
83   - <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']"
84   - >本季度</span
85   - >
  33 + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']">今天</span>
  34 + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']">本周</span>
  35 + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']">本月</span>
  36 + <span @click="setDate(4)" :class="[date == 4 ? 'active' : '', 's1']">本季度</span>
86 37 </p>
87 38 <el-button type="primary" round @click="_QueryData()">筛选</el-button>
88 39 </div>
... ... @@ -105,352 +56,103 @@
105 56 <div class="table-cont" v-loading="loading">
106 57 <div id="print-content">
107 58 <div v-show="tabIndex == 1">
108   - <el-table
109   - :data="tableData"
110   - border
111   - style="width: 100%"
112   - @sort-change="sortChange"
113   - >
114   - <el-table-column
115   - prop="title"
116   - label="课时"
117   - align="center"
118   - ></el-table-column>
119   - <el-table-column
120   - prop="questionNum"
121   - label="题目总数"
122   - align="center"
123   - width="100"
124   - ></el-table-column>
125   - <el-table-column
126   - prop="startTime"
127   - label="上课时间"
128   - align="center"
129   - ></el-table-column>
130   - <el-table-column
131   - prop="participationRate"
132   - label="参与度"
133   - sortable="custom"
134   - align="center"
135   - >
136   - <template slot-scope="scoped"
137   - >{{ scoped.row.participationRate }}%</template
138   - ></el-table-column
139   - >
140   - <el-table-column
141   - prop="answerCorrectRate"
142   - label="已答总正确率"
143   - sortable="custom"
144   - align="center"
145   - >
146   - <template slot-scope="scoped"
147   - >{{ scoped.row.answerCorrectRate }}%</template
148   - >
  59 + <el-table :data="tableData" border style="width: 100%" @sort-change="sortChange">
  60 + <el-table-column prop="title" label="课时" align="center"></el-table-column>
  61 + <el-table-column prop="questionNum" label="题目总数" align="center" width="100"></el-table-column>
  62 + <el-table-column prop="startTime" label="上课时间" align="center"></el-table-column>
  63 + <el-table-column prop="participationRate" label="参与度" sortable="custom" align="center">
  64 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template></el-table-column>
  65 + <el-table-column prop="answerCorrectRate" label="已答总正确率" sortable="custom" align="center">
  66 + <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
149 67 </el-table-column>
150   - <el-table-column
151   - prop="classCorrectRate"
152   - label="班级总正确率"
153   - sortable="custom"
154   - align="center"
155   - ><template slot-scope="scoped"
156   - >{{ scoped.row.classCorrectRate }}%</template
157   - ></el-table-column
158   - >
  68 + <el-table-column prop="classCorrectRate" label="班级总正确率" sortable="custom" align="center"><template
  69 + slot-scope="scoped">{{ scoped.row.classCorrectRate }}%</template></el-table-column>
159 70 <el-table-column label="操作" align="center">
160 71 <template slot-scope="scoped">
161 72 <el-tooltip effect="dark" content="详情" placement="top">
162   - <el-button
163   - type="primary"
164   - circle
165   - size="mini"
166   - icon="fa fa-arrow-right"
167   - @click="linkTo(scoped.row)"
168   - ></el-button>
  73 + <el-button type="primary" circle size="mini" icon="fa fa-arrow-right"
  74 + @click="linkTo(scoped.row)"></el-button>
169 75 </el-tooltip>
170 76 </template>
171 77 </el-table-column>
172 78 </el-table>
173 79 </div>
174 80 <div v-show="tabIndex == 2">
175   - <el-table
176   - id="print-content2"
177   - v-if="role == 'ROLE_JIAOSHI'"
178   - :max-height="tableMaxHeight"
179   - :data="tableData"
180   - border
181   - style="width: 100%"
182   - >
183   - <el-table-column
184   - prop="studentCode"
185   - label="学号"
186   - fixed
187   - align="center"
188   - ></el-table-column>
189   - <el-table-column
190   - prop="studentName"
191   - label="姓名"
192   - fixed
193   - align="center"
194   - width="100"
195   - ></el-table-column>
196   - <el-table-column
197   - prop="answerTimes"
198   - label="累计答题次数"
199   - sortable
200   - align="center"
201   - ></el-table-column>
202   - <el-table-column
203   - prop="correctAnswerTimes"
204   - label="累计答对次数"
205   - sortable
206   - align="center"
207   - ></el-table-column>
208   - <el-table-column
209   - prop="participationRate"
210   - label="总参与度"
211   - sortable
212   - align="center"
213   - >
214   - <template slot-scope="scoped"
215   - >{{ scoped.row.participationRate }}%</template
216   - ></el-table-column
217   - >
218   - <el-table-column
219   - prop="correctRate"
220   - label="总正确率"
221   - sortable
222   - align="center"
223   - >
224   - <template slot-scope="scoped"
225   - >{{ scoped.row.correctRate }}%</template
226   - ></el-table-column
227   - >
228   - <el-table-column
229   - prop="answerCorrectRate"
230   - label="已答总正确率"
231   - sortable
232   - align="center"
233   - >
234   - <template slot-scope="scoped"
235   - >{{ scoped.row.answerCorrectRate }}%</template
236   - >
  81 + <el-table id="print-content2" v-if="role == 'ROLE_JIAOSHI'" :max-height="tableMaxHeight" :data="tableData"
  82 + border style="width: 100%">
  83 + <el-table-column prop="studentCode" label="学号" fixed align="center"></el-table-column>
  84 + <el-table-column prop="studentName" label="姓名" fixed align="center" width="100"></el-table-column>
  85 + <el-table-column prop="answerTimes" label="累计答题次数" sortable align="center"></el-table-column>
  86 + <el-table-column prop="correctAnswerTimes" label="累计答对次数" sortable align="center"></el-table-column>
  87 + <el-table-column prop="participationRate" label="总参与度" sortable align="center">
  88 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template></el-table-column>
  89 + <el-table-column prop="correctRate" label="总正确率" sortable align="center">
  90 + <template slot-scope="scoped">{{ scoped.row.correctRate }}%</template></el-table-column>
  91 + <el-table-column prop="answerCorrectRate" label="已答总正确率" sortable align="center">
  92 + <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
237 93 </el-table-column>
238   - <el-table-column
239   - prop="classRank"
240   - label="总正确率班排名"
241   - sortable
242   - align="center"
243   - ></el-table-column>
  94 + <el-table-column prop="classRank" label="总正确率班排名" sortable align="center"></el-table-column>
244 95 </el-table>
245   - <el-table
246   - id="print-content2"
247   - :max-height="tableMaxHeight"
248   - v-else
249   - :data="tableData"
250   - border
251   - style="width: 100%"
252   - >
253   - <el-table-column
254   - prop="studentCode"
255   - label="学号"
256   - align="center"
257   - fixed
258   - ></el-table-column>
259   - <el-table-column
260   - prop="studentName"
261   - label="姓名"
262   - align="center"
263   - fixed
264   - width="100"
265   - ></el-table-column>
266   - <el-table-column
267   - v-for="(item, index) in phaseOption"
268   - :key="index"
269   - :label="item"
270   - align="center"
271   - >
272   - <el-table-column
273   - align="center"
274   - :label="index == 0 ? '总课时数' : '课时数'"
275   - :prop="'periodCount' + item"
276   - >
  96 + <el-table id="print-content2" :max-height="tableMaxHeight" v-else :data="tableData" border
  97 + style="width: 100%">
  98 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
  99 + <el-table-column prop="studentName" label="姓名" align="center" fixed width="100"></el-table-column>
  100 + <el-table-column v-for="(item, index) in phaseOption" :key="index" :label="item" align="center">
  101 + <el-table-column align="center" :label="index == 0 ? '总课时数' : '课时数'" :prop="'periodCount' + item">
277 102 </el-table-column>
278   - <el-table-column
279   - align="center"
280   - :label="index == 0 ? '总出题数' : '出题数'"
281   - :prop="'questionNum' + item"
282   - >
  103 + <el-table-column align="center" :label="index == 0 ? '总出题数' : '出题数'" :prop="'questionNum' + item">
283 104 </el-table-column>
284   - <el-table-column
285   - align="center"
286   - :label="index == 0 ? '总参与度' : '参与度'"
287   - :prop="'participationRate' + item"
288   - ><template slot-scope="scoped"
289   - >{{ scoped.row["participationRate" + item] }}%</template
290   - >
  105 + <el-table-column align="center" :label="index == 0 ? '总参与度' : '参与度'"
  106 + :prop="'participationRate' + item"><template slot-scope="scoped">
  107 + {{ scoped.row["participationRate" + item] }}%
  108 + </template>
291 109 </el-table-column>
292   - <el-table-column
293   - align="center"
294   - :label="index == 0 ? '总正确率' : '正确率'"
295   - :prop="'correctRate' + item"
296   - ><template slot-scope="scoped"
297   - >{{ scoped.row["correctRate" + item] }}%</template
298   - >
  110 + <el-table-column align="center" :label="index == 0 ? '总正确率' : '正确率'"
  111 + :prop="'correctRate' + item"><template slot-scope="scoped">{{ scoped.row["correctRate" + item]
  112 + }}%</template>
299 113 </el-table-column>
300 114 </el-table-column>
301 115 </el-table>
302 116 </div>
303 117 <div v-show="tabIndex == 3">
304   - <el-table
305   - id="print-content3"
306   - v-if="role == 'ROLE_JIAOSHI'"
307   - :max-height="tableMaxHeight"
308   - :data="tableData"
309   - border
310   - style="width: 100%"
311   - >
312   - <el-table-column
313   - prop="studentCode"
314   - label="学号"
315   - fixed
316   - align="center"
317   - ></el-table-column>
318   - <el-table-column
319   - prop="studentName"
320   - label="姓名"
321   - fixed
322   - align="center"
323   - width="100"
324   - ></el-table-column>
325   - <el-table-column
326   - prop="rushAnswerTimes"
327   - label="抢答成功次数"
328   - sortable
329   - align="center"
330   - ></el-table-column>
331   - <el-table-column
332   - prop="rushAnswerCorrectTimes"
333   - label="抢答答对次数"
334   - sortable
335   - align="center"
336   - ></el-table-column>
337   - <el-table-column
338   - prop="checkAnswerTimes"
339   - label="抽答次数"
340   - sortable
341   - align="center"
342   - ></el-table-column>
343   - <el-table-column
344   - prop="checkAnswerCorrectTimes"
345   - label="抽答答对次数"
346   - sortable
347   - align="center"
348   - ></el-table-column>
349   - <el-table-column
350   - prop="interactionsNum"
351   - label="参与得分"
352   - sortable
353   - align="center"
354   - ></el-table-column>
355   - <el-table-column
356   - prop="interactionsCorrectNum"
357   - label="对错得分"
358   - sortable
359   - align="center"
360   - ></el-table-column>
  118 + <el-table id="print-content3" v-if="role == 'ROLE_JIAOSHI'" :max-height="tableMaxHeight" :data="tableData"
  119 + border style="width: 100%">
  120 + <el-table-column prop="studentCode" label="学号" fixed align="center"></el-table-column>
  121 + <el-table-column prop="studentName" label="姓名" fixed align="center" width="100"></el-table-column>
  122 + <el-table-column prop="rushAnswerTimes" label="抢答成功次数" sortable align="center"></el-table-column>
  123 + <el-table-column prop="rushAnswerCorrectTimes" label="抢答答对次数" sortable align="center"></el-table-column>
  124 + <el-table-column prop="checkAnswerTimes" label="抽答次数" sortable align="center"></el-table-column>
  125 + <el-table-column prop="checkAnswerCorrectTimes" label="抽答答对次数" sortable align="center"></el-table-column>
  126 + <el-table-column prop="interactionsNum" label="参与得分" sortable align="center"></el-table-column>
  127 + <el-table-column prop="interactionsCorrectNum" label="对错得分" sortable align="center"></el-table-column>
361 128 </el-table>
362   - <el-table
363   - id="print-content3"
364   - v-else
365   - :max-height="tableMaxHeight"
366   - :data="tableData"
367   - border
368   - style="width: 100%"
369   - >
370   - <el-table-column
371   - prop="studentCode"
372   - label="学号"
373   - align="center"
374   - ></el-table-column>
375   - <el-table-column
376   - prop="studentName"
377   - label="姓名"
378   - align="center"
379   - width="100"
380   - ></el-table-column>
381   - <el-table-column
382   - v-for="(item, index) in phaseInter"
383   - :key="index"
384   - :label="item"
385   - align="center"
386   - >
387   - <el-table-column
388   - align="center"
389   - v-if="index == 0"
390   - label="参与分"
391   - sortable
392   - :prop="'interactionsNum' + item"
393   - >
  129 + <el-table id="print-content3" v-else :max-height="tableMaxHeight" :data="tableData" border
  130 + style="width: 100%">
  131 + <el-table-column prop="studentCode" label="学号" align="center"></el-table-column>
  132 + <el-table-column prop="studentName" label="姓名" align="center" width="100"></el-table-column>
  133 + <el-table-column v-for="(item, index) in phaseInter" :key="index" :label="item" align="center">
  134 + <el-table-column align="center" v-if="index == 0" label="参与分" sortable :prop="'interactionsNum' + item">
394 135 </el-table-column>
395   - <el-table-column
396   - v-else
397   - align="center"
398   - label="互动数"
399   - :prop="'interactionsNum' + item"
400   - >
  136 + <el-table-column v-else align="center" label="互动数" :prop="'interactionsNum' + item">
401 137 </el-table-column>
402   - <el-table-column
403   - v-if="index == 0"
404   - align="center"
405   - label="对错分"
406   - sortable
407   - :prop="'interactionsCorrectNum' + item"
408   - >
  138 + <el-table-column v-if="index == 0" align="center" label="对错分" sortable
  139 + :prop="'interactionsCorrectNum' + item">
409 140 </el-table-column>
410   - <el-table-column
411   - v-else
412   - align="center"
413   - label="参与数"
414   - :prop="'interactionsCorrectNum' + item"
415   - >
  141 + <el-table-column v-else align="center" label="参与数" :prop="'interactionsCorrectNum' + item">
416 142 </el-table-column>
417 143 </el-table-column>
418 144 </el-table>
419 145 </div>
420 146 </div>
421 147 <div class="pagination-box" v-show="tabIndex == 1">
422   - <el-pagination
423   - small=""
424   - layout="total,prev, pager, next"
425   - :hide-on-single-page="true"
426   - :total="total"
427   - @current-change="changePage"
428   - :current-page="page"
429   - :page-size="size"
430   - >
  148 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  149 + @current-change="changePage" :current-page="page" :page-size="size">
431 150 </el-pagination>
432 151 </div>
433   - <p
434   - class="down"
435   - v-if="(tabIndex == 3 || tabIndex == 2) && tableData.length"
436   - >
437   - <el-button
438   - @click="exportData"
439   - type="primary"
440   - plain
441   - round
442   - icon="fa fa-cloud-download"
443   - >导出报表</el-button
444   - >
445   - <el-button
446   - v-if="!this.$store.getters.code"
447   - @click="print"
448   - type="primary"
449   - plain
450   - round
451   - icon="el-icon-printer"
452   - >打印</el-button
453   - >
  152 + <p class="down" v-if="(tabIndex == 3 || tabIndex == 2) && tableData.length">
  153 + <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  154 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  155 + icon="el-icon-printer">打印</el-button>
454 156 </p>
455 157 </div>
456 158 </div>
... ... @@ -642,8 +344,8 @@ export default {
642 344 obj.prop == "participationRate"
643 345 ? 1
644 346 : obj.prop == "answerCorrectRate"
645   - ? 2
646   - : 3;
  347 + ? 2
  348 + : 3;
647 349 this.custom.orderType = obj.order == "ascending" ? 0 : 1;
648 350 this.page = 1;
649 351 this._QueryData();
... ... @@ -984,6 +686,7 @@ div::-webkit-scrollbar {
984 686 width: 3px;
985 687 height: 10px;
986 688 }
  689 +
987 690 div::-webkit-scrollbar-thumb {
988 691 border-radius: 10px;
989 692 background-color: #ccc;
... ... @@ -993,17 +696,21 @@ div::-webkit-scrollbar-thumb {
993 696 .main {
994 697 height: 100%;
995 698 }
  699 +
996 700 .table-box {
997 701 margin: 0 20px;
998 702 padding: 16px;
999 703 background: #f8f8f8;
1000 704 border-radius: 5px;
  705 +
1001 706 .table-cont {
1002 707 min-height: 300px;
1003 708 }
  709 +
1004 710 :deep(.fa-arrow-right) {
1005 711 padding-left: 2px;
1006 712 }
  713 +
1007 714 :deep(.fa-file-text) {
1008 715 padding-left: 2px;
1009 716 }
... ... @@ -1015,14 +722,17 @@ div::-webkit-scrollbar-thumb {
1015 722 font-size: 16px;
1016 723 margin-left: 10px;
1017 724 }
  725 +
1018 726 .dia-btn {
1019 727 border-radius: 20px;
1020 728 margin: 0 20px;
1021 729 padding: 10px 20px;
1022 730 }
  731 +
1023 732 .dia-tips {
1024 733 padding-bottom: 10px;
1025 734 }
  735 +
1026 736 .dia-question-box {
1027 737 padding: 16px 16px 1px;
1028 738 background: #f8f8f8;
... ... @@ -1034,32 +744,39 @@ div::-webkit-scrollbar-thumb {
1034 744 cursor: pointer;
1035 745 }
1036 746 }
  747 +
1037 748 .set-questions {
1038 749 display: flex;
1039 750 margin-bottom: 12px;
1040 751 width: 100%;
  752 +
1041 753 .qs-num {
1042 754 flex-shrink: 0;
1043 755 margin-right: 10px;
1044 756 }
  757 +
1045 758 .qs-options {
1046 759 flex: 1;
  760 +
1047 761 .ipt {
1048 762 margin-bottom: 5px;
1049 763 }
1050 764 }
  765 +
1051 766 .delButton {
1052 767 border-color: #ff6868;
1053 768 background: #ff6868 url("../../../assets/images/arrow.png") no-repeat center;
1054 769 background-size: 19px;
1055 770 color: transparent;
1056 771 }
  772 +
1057 773 .ac {
1058 774 border-color: #ff6868;
1059 775 background: #ff6868;
1060 776 color: #fff;
1061 777 }
1062 778 }
  779 +
1063 780 .down {
1064 781 padding-top: 16px;
1065 782 }
... ...
src/views/basic/ask/components/answerQustion.vue
... ... @@ -241,7 +241,7 @@
241 241 </template>
242 242 </el-table>
243 243 <el-dialog
244   - class="chart-dia"
  244 + class="chart-dia" :append-to-body="true"
245 245 :visible.sync="chartDia"
246 246 :title="chartTitle"
247 247 width="800"
... ...
src/views/basic/ask/index.vue
... ... @@ -8,18 +8,8 @@
8 8 <div class="select-box">
9 9 <div class="sel-item">
10 10 <span class="sel-label">班级:</span>
11   - <el-select
12   - class="sel"
13   - v-model="query.classId"
14   - placeholder="选择班级"
15   - @change="changeclass"
16   - >
17   - <el-option
18   - v-for="item in classList"
19   - :key="item.value"
20   - :label="item.label"
21   - :value="item.value"
22   - >
  11 + <el-select class="sel" v-model="query.classId" placeholder="选择班级" @change="changeclass">
  12 + <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value">
23 13 </el-option>
24 14 </el-select>
25 15 </div>
... ... @@ -27,24 +17,12 @@
27 17 <span class="sel-label">科目:</span>
28 18 <div class="sel-d">
29 19 <p class="p-all">
30   - <el-checkbox
31   - :indeterminate="isIndeterminate"
32   - v-model="allSubject"
33   - @change="handleCheckAllChange"
34   - >全选</el-checkbox
35   - >
  20 + <el-checkbox :indeterminate="isIndeterminate" v-model="allSubject"
  21 + @change="handleCheckAllChange">全选</el-checkbox>
36 22 </p>
37 23 <p class="sel-p">
38   - <el-checkbox-group
39   - v-model="query.subjectNames"
40   - @change="handleChecked"
41   - >
42   - <el-checkbox
43   - v-for="item in subjectList"
44   - :label="item"
45   - :key="item"
46   - >{{ item }}</el-checkbox
47   - >
  24 + <el-checkbox-group v-model="query.subjectNames" @change="handleChecked">
  25 + <el-checkbox v-for="item in subjectList" :label="item" :key="item">{{ item }}</el-checkbox>
48 26 </el-checkbox-group>
49 27 </p>
50 28 </div>
... ... @@ -54,12 +32,7 @@
54 32 <div class="sel-d">
55 33 <p class="sel-p">
56 34 <el-radio-group v-model="query.subjectNames">
57   - <el-radio
58   - v-for="item in subjectList"
59   - :label="item"
60   - :key="item"
61   - >{{ item }}</el-radio
62   - >
  35 + <el-radio v-for="item in subjectList" :label="item" :key="item">{{ item }}</el-radio>
63 36 </el-radio-group>
64 37 </p>
65 38 </div>
... ... @@ -67,34 +40,18 @@
67 40 <div class="sel-item">
68 41 <span class="sel-label">日期:</span>
69 42 <div class="d1">
70   - <el-date-picker
71   - v-model="query.startDay"
72   - type="date"
73   - @change="handleChangeTimeStart"
74   - placeholder="选择日期时间"
75   - value-format="yyyy-MM-dd"
76   - >
  43 + <el-date-picker v-model="query.startDay" type="date" @change="handleChangeTimeStart" placeholder="选择日期时间"
  44 + value-format="yyyy-MM-dd">
77 45 </el-date-picker>
78 46 ~
79   - <el-date-picker
80   - v-model="query.endDay"
81   - type="date"
82   - placeholder="选择日期时间"
83   - @change="handleChangeTimeEnd"
84   - value-format="yyyy-MM-dd"
85   - >
  47 + <el-date-picker v-model="query.endDay" type="date" placeholder="选择日期时间" @change="handleChangeTimeEnd"
  48 + value-format="yyyy-MM-dd">
86 49 </el-date-picker>
87 50 </div>
88 51 <p class="p1">
89   - <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']"
90   - >本周</span
91   - >
92   - <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']"
93   - >本月</span
94   - >
95   - <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']"
96   - >本季度</span
97   - >
  52 + <span @click="setDate(1)" :class="[date == 1 ? 'active' : '', 's1']">本周</span>
  53 + <span @click="setDate(2)" :class="[date == 2 ? 'active' : '', 's1']">本月</span>
  54 + <span @click="setDate(3)" :class="[date == 3 ? 'active' : '', 's1']">本季度</span>
98 55 </p>
99 56 </div>
100 57 </div>
... ... @@ -230,8 +187,8 @@ export default {
230 187 this.role == "ROLE_BANZHUREN"
231 188 ? this.$request.cTClassList
232 189 : this.role == "ROLE_PERSONAL"
233   - ? this.$request.pClassList
234   - : this.$request.tClassList;
  190 + ? this.$request.pClassList
  191 + : this.$request.tClassList;
235 192 const { data, status, info } = await fetchClassList();
236 193 if (status === 0) {
237 194 this.classList = data.list.map((item) => {
... ... @@ -250,8 +207,8 @@ export default {
250 207 this.role == "ROLE_BANZHUREN"
251 208 ? this.$request.cTSubjectList
252 209 : this.role == "ROLE_PERSONAL"
253   - ? this.$request.pSubjectList
254   - : this.$request.tSubjectList;
  210 + ? this.$request.pSubjectList
  211 + : this.$request.tSubjectList;
255 212  
256 213 const { data, status, info } = await fetchSubjectList({
257 214 classId: this.query.classId,
... ...
src/views/basic/ask/list.vue
... ... @@ -5,20 +5,9 @@
5 5 <span>随堂问-数据报表</span>
6 6 </template>
7 7 <template slot="btns">
8   - <el-tooltip
9   - v-if="this.role != 'ROLE_PERSONAL' && !code && gdClass"
10   - effect="dark"
11   - content="已归档试卷"
12   - placement="bottom"
13   - >
14   - <el-button
15   - type="primary"
16   - icon="fa fa-archive"
17   - size="mini"
18   - plain
19   - circle
20   - @click="toArchiving"
21   - ></el-button>
  8 + <el-tooltip v-if="this.role != 'ROLE_PERSONAL' && !code && gdClass" effect="dark" content="已归档试卷"
  9 + placement="bottom">
  10 + <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button>
22 11 </el-tooltip>
23 12 </template>
24 13 </back-box>
... ... @@ -26,17 +15,10 @@
26 15 <div class="table-cont" v-loading="loading">
27 16 <p class="btn-box" v-if="tableData.length">
28 17 <el-button type="primary" round @click="linkToAsk">筛选</el-button>
29   - <el-button type="primary" round @click="linkToDetail2"
30   - >查看汇总报表</el-button
31   - >
  18 + <el-button type="primary" round @click="linkToDetail2">查看汇总报表</el-button>
32 19 </p>
33 20 <div>
34   - <el-table
35   - :data="tableData"
36   - border
37   - :show-header="total > 0"
38   - style="width: 100%"
39   - >
  21 + <el-table :data="tableData" border :show-header="total > 0" style="width: 100%">
40 22 <el-table-column align="center" width="48">
41 23 <template slot-scope="scope">
42 24 <!-- <el-checkbox
... ... @@ -45,114 +27,44 @@
45 27 :disabled="checkboxDisabled(scope.row)"
46 28 ><span></span
47 29 ></el-checkbox> -->
48   - <el-checkbox v-model="multipleSelection" :label="scope.row.id"
49   - ><span></span
50   - ></el-checkbox>
  30 + <el-checkbox v-model="multipleSelection" :label="scope.row.id"><span></span></el-checkbox>
51 31 </template>
52 32 </el-table-column>
53   - <el-table-column
54   - prop="subjectName"
55   - label="科目"
56   - align="center"
57   - width="80"
58   - ></el-table-column>
59   - <el-table-column
60   - prop="title"
61   - label="课时名称"
62   - align="center"
63   - ></el-table-column>
64   - <el-table-column
65   - prop="participationRate"
66   - label="总参与度"
67   - align="center"
68   - >
69   - <template slot-scope="scoped"
70   - >{{ scoped.row.participationRate }}%</template
71   - ></el-table-column
72   - >
73   - <el-table-column
74   - prop="answerCorrectRate"
75   - label="已答总正确率"
76   - align="center"
77   - ><template slot-scope="scoped"
78   - >{{ scoped.row.answerCorrectRate }}%</template
79   - >
  33 + <el-table-column prop="subjectName" label="科目" align="center" width="80"></el-table-column>
  34 + <el-table-column prop="title" label="课时名称" align="center"></el-table-column>
  35 + <el-table-column prop="participationRate" label="总参与度" align="center">
  36 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template></el-table-column>
  37 + <el-table-column prop="answerCorrectRate" label="已答总正确率" align="center"><template slot-scope="scoped">{{
  38 + scoped.row.answerCorrectRate }}%</template>
80 39 </el-table-column>
81   - <el-table-column
82   - prop="classCorrectRate"
83   - label="班级总正确率"
84   - align="center"
85   - ><template slot-scope="scoped"
86   - >{{ scoped.row.classCorrectRate }}%</template
87   - ></el-table-column
88   - >
89   - <el-table-column
90   - prop="questionNum"
91   - label="题目总数"
92   - align="center"
93   - ></el-table-column>
94   - <el-table-column
95   - prop="startTime"
96   - label="上课时间"
97   - align="center"
98   - ></el-table-column>
  40 + <el-table-column prop="classCorrectRate" label="班级总正确率" align="center"><template slot-scope="scoped">{{
  41 + scoped.row.classCorrectRate }}%</template></el-table-column>
  42 + <el-table-column prop="questionNum" label="题目总数" align="center"></el-table-column>
  43 + <el-table-column prop="startTime" label="上课时间" align="center"></el-table-column>
99 44 <el-table-column label="操作" align="center" width="100">
100 45 <template slot-scope="scoped">
101 46 <template v-if="scoped.row.answerNum == 0">
102   - <el-tooltip
103   - v-if="role != 'ROLE_BANZHUREN'"
104   - effect="dark"
105   - content="设置答案"
106   - placement="top"
107   - >
108   - <el-button
109   - type="primary"
110   - circle
111   - size="mini"
112   - icon="fa fa-file-text"
113   - @click="edit(scoped.row)"
114   - ></el-button>
  47 + <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="设置答案" placement="top">
  48 + <el-button type="primary" circle size="mini" icon="fa fa-file-text"
  49 + @click="edit(scoped.row)"></el-button>
115 50 </el-tooltip>
116 51 <template v-else>未设置答案</template>
117 52 </template>
118 53 <el-tooltip v-else effect="dark" content="详情" placement="top">
119   - <el-button
120   - type="primary"
121   - circle
122   - size="mini"
123   - icon="fa fa-arrow-right"
124   - @click="linkToDetail(scoped.row, 1)"
125   - ></el-button>
  54 + <el-button type="primary" circle size="mini" icon="fa fa-arrow-right"
  55 + @click="linkToDetail(scoped.row, 1)"></el-button>
126 56 </el-tooltip>
127   - <el-popconfirm
128   - v-if="role != 'ROLE_BANZHUREN'"
129   - title="确定删除吗?"
130   - @confirm="remove(scoped.row)"
131   - >
132   - <el-button
133   - class="remove-test"
134   - slot="reference"
135   - type="danger"
136   - circle
137   - size="mini"
138   - icon="el-icon-delete"
139   - :loading="scoped.row.loading"
140   - ></el-button>
  57 + <el-popconfirm v-if="role != 'ROLE_BANZHUREN'" title="确定删除吗?" @confirm="remove(scoped.row)">
  58 + <el-button class="remove-test" slot="reference" type="danger" circle size="mini" icon="el-icon-delete"
  59 + :loading="scoped.row.loading"></el-button>
141 60 </el-popconfirm>
142 61 </template>
143 62 </el-table-column>
144 63 </el-table>
145 64 </div>
146 65 <div class="pagination-box">
147   - <el-pagination
148   - small=""
149   - layout="total,prev, pager, next"
150   - :hide-on-single-page="true"
151   - :total="total"
152   - @current-change="changePage"
153   - :current-page="page"
154   - :page-size="size"
155   - >
  66 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  67 + @current-change="changePage" :current-page="page" :page-size="size">
156 68 </el-pagination>
157 69 </div>
158 70 </div>
... ... @@ -315,8 +227,8 @@ export default {
315 227 this.multipleSelection.length == 1
316 228 ? 1
317 229 : subjectArr.length == 1
318   - ? 2
319   - : 3,
  230 + ? 2
  231 + : 3,
320 232 subjectNames: subjectArr.join(","),
321 233 params: this.$route.query.params,
322 234 // classId: classId,
... ... @@ -407,8 +319,8 @@ export default {
407 319 this.role == "ROLE_BANZHUREN"
408 320 ? this.$request.cTExportPhaseInteractiveReport
409 321 : this.role == "ROLE_PERSONAL"
410   - ? this.$request.pExportPhaseReport
411   - : this.$request.exportPhaseInteractiveReport;
  322 + ? this.$request.pExportPhaseReport
  323 + : this.$request.exportPhaseInteractiveReport;
412 324 const data = await exportData({ ...query });
413 325 this.exportLoading = false;
414 326 if (data) {
... ... @@ -438,9 +350,11 @@ div::-webkit-scrollbar-thumb {
438 350 .main {
439 351 height: 100%;
440 352 }
  353 +
441 354 .remove-test {
442 355 margin-left: 10px;
443 356 }
  357 +
444 358 .table-box {
445 359 padding: 16px;
446 360 border-radius: 5px;
... ... @@ -466,4 +380,4 @@ div::-webkit-scrollbar-thumb {
466 380 top: 4px;
467 381 z-index: 10;
468 382 }
469   -</style>
470 383 \ No newline at end of file
  384 +</style>
... ...
src/views/basic/askTestQuestion/components/askBzrMulti.vue 0 → 100644
  1 +<template>
  2 + <div style="margin-right: 20px;width: 100%">
  3 + <el-row class="row-type">
  4 + <label>阶段报表类型</label>
  5 + <el-select class="opration-select" v-model="currentType">
  6 + <el-option v-for="(item, index) in types" :lable="item" :key="index" :value="item" />
  7 + </el-select>
  8 + <div style="float: right;">
  9 + <el-button type="primary" @click="_import" class="opration-btn" icon="el-icon-upload2">导出报表</el-button>
  10 + <el-button type="primary" @click="_print" class="opration-btn" icon="el-icon-printer">打印报表</el-button>
  11 + </div>
  12 + </el-row>
  13 + <div id="print-content">
  14 + <div v-if="currentType == '学生多科作答表现'">
  15 + <el-row class="row-table">
  16 + <el-table class="default-table" :data="answersList">
  17 + <el-table-column prop="studentCode" label="学号"></el-table-column>
  18 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  19 + <el-table-column v-for="(item, index) in answersSubjects" :key="index" :label="item">
  20 + <el-table-column :label="index == 0 ? '总课时数' : '课时数'" :prop="'periodCount' + item">
  21 + <template slot-scope="scoped">{{
  22 + scoped.row["periodCount" + item] ||
  23 + Number(scoped.row["periodCount" + item]) === 0
  24 + ? scoped.row["periodCount" + item]
  25 + : "-"
  26 + }}</template>
  27 + </el-table-column>
  28 + <el-table-column :label="index == 0 ? '总出题数' : '出题数'" :prop="'questionNum' + item">
  29 + <template slot-scope="scoped">{{
  30 + scoped.row["questionNum" + item] ||
  31 + Number(scoped.row["questionNum" + item]) === 0
  32 + ? scoped.row["questionNum" + item]
  33 + : "-"
  34 + }}</template>
  35 + </el-table-column>
  36 + <el-table-column :label="index == 0 ? '总参与度' : '参与度'"
  37 + :prop="'participationRate' + item"><template slot-scope="scoped">{{
  38 + scoped.row["participationRate" + item] ||
  39 + Number(scoped.row["participationRate" + item]) === 0
  40 + ? scoped.row["participationRate" + item] + "%"
  41 + : "-"
  42 + }}</template>
  43 + </el-table-column>
  44 + <el-table-column :label="index == 0 ? '总正确率' : '正确率'"
  45 + :prop="'answerCorrectRate' + item"><template slot-scope="scoped">{{
  46 + scoped.row["answerCorrectRate" + item] ||
  47 + Number(scoped.row["answerCorrectRate" + item]) === 0
  48 + ? scoped.row["answerCorrectRate" + item] + "%"
  49 + : "-"
  50 + }}</template>
  51 + </el-table-column>
  52 + </el-table-column>
  53 + <el-table-column label="查看雷达图">
  54 + <template slot-scope="scoped">
  55 + <el-button type="text" @click="openRandarChart(scoped.row)">查看</el-button>
  56 + </template>
  57 + </el-table-column>
  58 + </el-table>
  59 + </el-row>
  60 + </div>
  61 + <div v-if="currentType == '学生多科互动表现'">
  62 + <el-row class="row-table">
  63 + <el-table class="default-table" :data="interactionList">
  64 + <el-table-column prop="studentCode" label="学号"></el-table-column>
  65 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  66 + <el-table-column v-for="(item, index) in interactionOptions" :key="index" :label="item">
  67 + <el-table-column v-if="index == 0" label="参与分" :prop="'interactionsNum' + item">
  68 + <template slot-scope="scoped">{{
  69 + scoped.row["interactionsNum" + item] ||
  70 + Number(scoped.row["interactionsNum" + item]) === 0
  71 + ? scoped.row["interactionsNum" + item]
  72 + : "-"
  73 + }}</template>
  74 + </el-table-column>
  75 + <el-table-column v-else label="互动数" :prop="'interactionsNum' + item">
  76 + <template slot-scope="scoped">{{
  77 + scoped.row["interactionsNum" + item] ||
  78 + Number(scoped.row["interactionsNum" + item]) === 0
  79 + ? scoped.row["interactionsNum" + item]
  80 + : "-"
  81 + }}</template>
  82 + </el-table-column>
  83 + <el-table-column v-if="index == 0" label="对错分" :prop="'interactionsCorrectNum' + item">
  84 + <template slot-scope="scoped">{{
  85 + scoped.row["interactionsCorrectNum" + item] ||
  86 + Number(scoped.row["interactionsCorrectNum" + item]) === 0
  87 + ? scoped.row["interactionsCorrectNum" + item]
  88 + : "-"
  89 + }}</template>
  90 + </el-table-column>
  91 + <el-table-column v-else label="参与数" :prop="'interactionsCorrectNum' + item">
  92 + <template slot-scope="scoped">{{
  93 + scoped.row["interactionsCorrectNum" + item] ||
  94 + Number(scoped.row["interactionsCorrectNum" + item]) === 0
  95 + ? scoped.row["interactionsCorrectNum" + item]
  96 + : "-"
  97 + }}</template>
  98 + </el-table-column>
  99 + </el-table-column>
  100 + </el-table>
  101 + </el-row>
  102 + </div>
  103 + </div>
  104 +
  105 + <el-dialog :append-to-body="true" class="chart-dia" @close="radarChart.visible=false" :visible="radarChart.visible"
  106 + :title="radarChart.title" width="800" >
  107 + <div class="chart-box">
  108 + <RadarChart id="askRadarChart" :params="radarChart" :tooltipFormatter="true" />
  109 + </div>
  110 + </el-dialog>
  111 + </div>
  112 +</template>
  113 +<script>
  114 +import { formatDate } from "utils";
  115 +import { downloadFile, tablePrint } from "@/utils";
  116 +import RadarChart from "@/components/charts/radarChart";
  117 +export default {
  118 + name: "askbzrMutli",
  119 + components: {
  120 + RadarChart
  121 + },
  122 + props: {
  123 + askReportIds: Array,
  124 + queryParams: Object
  125 + },
  126 +
  127 + watch: {
  128 + currentType: {
  129 + handler: async function (val) {
  130 + await this._changeType();
  131 + },
  132 + deep: false,
  133 + },
  134 + $props: {
  135 + handler: async function (val) {
  136 + await this._changeType();
  137 + },
  138 + deep: false,
  139 + }
  140 + },
  141 + data() {
  142 + return {
  143 + types: ["学生多科作答表现", "学生多科互动表现"],
  144 + currentType: "学生多科作答表现",
  145 + answersList: [],
  146 + answersOptions: [],
  147 + answersSubjects: [],
  148 + interactionList: [],
  149 + interactionOptions: [],
  150 + interactionSubjects: [],
  151 + radarChart: {
  152 + title: "",
  153 + indicator: [
  154 + {
  155 + name: "",
  156 + max: 100,
  157 + axisLabel: {
  158 + show: true,
  159 + showMaxLabel: true,
  160 + formatter: "{value}%",
  161 + },
  162 + },
  163 + ],
  164 + seriesData: []
  165 + },
  166 + //题干数据对象
  167 + stem: {
  168 + visible: false,
  169 + src: null
  170 + }
  171 + };
  172 + },
  173 + async created() {
  174 + await this._changeType();
  175 + },
  176 + methods: {
  177 + _import() { },
  178 + _print() {
  179 +
  180 + tablePrint("print-content", this.currentType);
  181 + },
  182 + async refresh() {
  183 + await this._changeType();
  184 + },
  185 + async _changeType() {
  186 + switch (this.currentType) {
  187 + case "学生多科作答表现": { await this._multipleSubjectAnswers(); }; break;
  188 + case "学生多科互动表现": { await this._multiDisciplinaryInteraction(); }; break;
  189 + }
  190 + },
  191 + setSubPro(type) {
  192 + let tit;
  193 + switch (type) {
  194 + case 2:
  195 + tit = "单选题";
  196 + break;
  197 + case 3:
  198 + tit = "多选题";
  199 + break;
  200 + case 4:
  201 + tit = "判断题";
  202 + break;
  203 + case 5:
  204 + tit = "主观题";
  205 + break;
  206 + default:
  207 + tit = "其他";
  208 + }
  209 + return tit;
  210 + },
  211 + setDuration(times) {
  212 + let m = parseInt(times / 1000 / 60);
  213 + let s = parseInt((times / 1000) % 60);
  214 + let ms = times;
  215 + let aTime;
  216 + if (times == 0) {
  217 + aTime = `0`;
  218 + } else {
  219 + if (m == 0 && s == 0) {
  220 + aTime = `${ms}毫秒`;
  221 + } else if (m == 0 && s != 0) {
  222 + aTime = `${s}秒`;
  223 + } else if (m != 0 && s != 0) {
  224 + aTime = `${m}分${s}秒`;
  225 + }
  226 + }
  227 + return aTime;
  228 + },
  229 + async _multipleSubjectAnswers() {
  230 +
  231 + const answersRequest =
  232 + this.role == "ROLE_PERSONAL"
  233 + ? this.$request.pPhaseAnswerReport
  234 + : this.$request.cTPhaseAnswerReport;
  235 +
  236 + let query = {
  237 + periodIds: this.$props.askReportIds,
  238 + classIds: [this.$props.queryParams.class],
  239 + subjectNames: [this.$props.queryParams.subjectNames],
  240 + };
  241 +
  242 +
  243 + let answersResponse = await answersRequest({
  244 + ...query
  245 + });
  246 +
  247 +
  248 + if (answersResponse.status != 0) {
  249 + this.$message.error(answersResponse.info);
  250 + return;
  251 + }
  252 +
  253 + let optionsList = [];
  254 +
  255 + let subjectName = [];
  256 +
  257 + this.answersList = answersResponse.data.list?.map((item) => {
  258 +
  259 + let params = {};
  260 +
  261 + item.dataList.map((items, index) => {
  262 + if (!subjectName.includes(items.subjectName)) {
  263 + subjectName.push(items.subjectName);
  264 + }
  265 + params["answerCorrectRate" + items.subjectName] =
  266 + items.answerCorrectRate;
  267 + params["correctRate" + items.subjectName] = items.correctRate;
  268 + params["participationRate" + items.subjectName] =
  269 + items.participationRate;
  270 + params["periodCount" + items.subjectName] = items.periodCount;
  271 + params["questionNum" + items.subjectName] = items.questionNum;
  272 + });
  273 +
  274 + return {
  275 + ...item,
  276 + ...params,
  277 + };
  278 + });
  279 +
  280 + this.answersSubjects = [...subjectName];
  281 +
  282 + this.answersOptions = [...optionsList];
  283 +
  284 + console.log(this.answersList)
  285 + },
  286 + async _multiDisciplinaryInteraction() {
  287 +
  288 + this.studentPerformance = [];
  289 +
  290 + if (!this.$props.askReportIds || this.$props.askReportIds.length < 1) return;
  291 +
  292 + const interactionRequest =
  293 + this.role == "ROLE_PERSONAL"
  294 + ? this.$request.pPhaseInteractiveReport
  295 + : this.$request.cTPhaseInteractiveReport;
  296 +
  297 + let query = {
  298 + periodIds: this.$props.askReportIds,
  299 + classIds: [this.$props.queryParams.class],
  300 + };
  301 +
  302 + let interactionReponse = await interactionRequest({
  303 + ...query
  304 + });
  305 +
  306 + if (interactionReponse.status != 0) {
  307 + this.$message.error(interactionReponse.info);
  308 + return;
  309 + }
  310 +
  311 + let subjectName = [];
  312 +
  313 + this.interactionList = interactionReponse.data?.list?.map((item) => {
  314 + let params = {};
  315 + item.dataList?.map((items, index) => {
  316 + if (!subjectName.includes(items.subjectName)) {
  317 + subjectName.push(items.subjectName);
  318 + }
  319 + params["interactionsNum" + items.subjectName] =
  320 + items.interactionsNum;
  321 + params["interactionsCorrectNum" + items.subjectName] =
  322 + items.interactionsCorrectNum;
  323 + });
  324 + return {
  325 + ...item,
  326 + ...params,
  327 + };
  328 + });
  329 +
  330 + this.interactionOptions = [...subjectName];
  331 + console.log(this.interactionOptions)
  332 + },
  333 + openRandarChart(obj) {
  334 + this.radarChart = {
  335 + indicator: [
  336 + {
  337 + name: "",
  338 + max: 100,
  339 + axisLabel: {
  340 + show: true,
  341 + showMaxLabel: true,
  342 + formatter: "{value}%",
  343 + },
  344 + },
  345 + ],
  346 + seriesData: [],
  347 + };
  348 + this.radarChart.title = obj.studentName + "-多科-多课时作答表现图";
  349 + let dataList = obj.dataList.slice(1, obj.dataList.length);
  350 + let subjectList = dataList.map((item) => item.subjectName);
  351 + subjectList.map((item, index) => {
  352 + if (index < 1) {
  353 + this.radarChart.indicator[index].name = item;
  354 + } else {
  355 + this.radarChart.indicator.push({ name: item, max: 100 });
  356 + }
  357 + });
  358 + // 为了美观
  359 + if (this.radarChart.indicator.length < 3) {
  360 + let num = this.radarChart.indicator.length;
  361 + for (let i = 0; i < 6; i++) {
  362 + if (i >= num) {
  363 + this.radarChart.indicator.push({ name: "", max: 100 });
  364 + }
  365 + }
  366 + }
  367 + let participationRate = dataList.map((item) => item.participationRate);
  368 + let correctRate = dataList.map((item) => item.correctRate);
  369 + this.radarChart.seriesData = [
  370 + {
  371 + value: participationRate,
  372 + name: "参与度",
  373 + },
  374 + {
  375 + value: correctRate,
  376 + name: "正确率",
  377 + },
  378 + ];
  379 +
  380 + this.radarChart.visible = true;
  381 + }
  382 + }
  383 +};
  384 +</script>
  385 +<style scoped lang="scss">
  386 +.chart-dia {
  387 + .chart-box {
  388 + width: 100%;
  389 + height: 300px;
  390 + }
  391 +
  392 + :deep(.el-dialog__body) {
  393 + padding: 0 0 20px 0;
  394 + }
  395 +}
  396 +
  397 +.opration-btn {
  398 + margin-right: 10px;
  399 +}
  400 +
  401 +.opration-select {
  402 + margin-left: 10px;
  403 +}
  404 +
  405 +.row-line {
  406 + width: calc(20% - 2px);
  407 + border: 1px solid #ebeef5;
  408 + background: #f5f7fa;
  409 + display: inline-block;
  410 + height: 40px;
  411 + line-height: 40px;
  412 +
  413 + .line-subfix {
  414 + margin-left: 10px;
  415 +
  416 + }
  417 +}
  418 +
  419 +.row-table {
  420 + margin-top: 20px;
  421 +}
  422 +</style>
... ...
src/views/basic/askTestQuestion/components/askListReport.vue 0 → 100644
  1 +<template>
  2 + <div>
  3 + <el-table class="default-table" :data="$props.datas" border>
  4 + <el-table-column prop="subjectName" label="科目" width="180" />
  5 + <el-table-column prop="title" label="课时名称" />
  6 + <el-table-column prop="participationRate" label="总参与度" width="180" />
  7 + <el-table-column prop="answerCorrectRate" label="已答正确率" width="180" />
  8 + <el-table-column prop="classCorrectRate" label="班级正确率" width="180" />
  9 + <el-table-column prop="questionNum" label="题目总数" width="180" />
  10 + <el-table-column prop="startTime" label="上课时间" width="180" />
  11 + <el-table-column label="操作" width="200">
  12 + <template slot-scope="scoped">
  13 + <template v-if="scoped.row.answerNum == 0">
  14 + <el-button v-if="role != 'ROLE_BANZHUREN'" type="text"
  15 + @click="_edit(scoped.row)">设置答案</el-button>
  16 + <template v-else>未设置答案</template>
  17 + </template>
  18 + <el-button type="text" @click="_linkToDetail(scoped.row)">查看</el-button>
  19 + <el-popconfirm v-if="role != 'ROLE_BANZHUREN'" title="确定删除吗?" @confirm="_remove(scoped.row)">
  20 + <el-button class="remove-test" slot="reference" type="text" style="color:red;margin-left:10px"
  21 + :loading="scoped.row.loading">删除</el-button>
  22 + </el-popconfirm>
  23 + </template>
  24 + </el-table-column>
  25 + </el-table>
  26 + </div>
  27 +</template>
  28 +<script>
  29 +export default {
  30 + name: "askReportList",
  31 + props: {
  32 + datas: Array,
  33 + },
  34 + created() {
  35 + this.role =
  36 + this.$store.getters.info.showRole ||
  37 + this.$store.getters.info.permissions[0].role;
  38 + },
  39 + methods: {
  40 + async _remove(dataRow) {
  41 + const { data, status, info } = await this.$request.deletePaperReport({
  42 + id: dataRow.id,
  43 + });
  44 + if (status != 0) {
  45 + this.$message.error(info);
  46 + }
  47 + this.$emit("resfer");
  48 + },
  49 + _linkToDetail(dataRow) {
  50 + this.$router.push({
  51 + path: "/askReportDetail",
  52 + query: {
  53 + dataType: 1,
  54 + classIds: dataRow.classId,
  55 + id: dataRow.id,
  56 + title: dataRow.title
  57 + },
  58 + });
  59 + },
  60 + _edit(item) {
  61 + this.$router.push({
  62 + path: "/examinationPaperEdit",
  63 + query: {
  64 + paperId: item.id,
  65 + title: item.title,
  66 + type: 3,
  67 + },
  68 + });
  69 + },
  70 + },
  71 + data() {
  72 + return {
  73 + role: ""
  74 + };
  75 + },
  76 +};
  77 +</script>
  78 +<style scoped></style>
... ...
src/views/basic/askTestQuestion/components/askSummaryReport.vue 0 → 100644
  1 +<template>
  2 + <div style="margin-right: 20px;width: 100%">
  3 + <el-row class="row-type">
  4 + <label>阶段报表类型</label>
  5 + <el-select class="opration-select" v-model="currentType">
  6 + <el-option v-for="(item, index) in types" :lable="item" :key="index" :value="item" />
  7 + </el-select>
  8 + <div style="float: right;">
  9 + <el-button type="primary" @click="_export" icon="el-icon-upload2" class="opration-btn">导出报表</el-button>
  10 + <el-button type="primary" @click="_print" icon="el-icon-printer" class="opration-btn">打印报表</el-button>
  11 + </div>
  12 + </el-row>
  13 + <div id="print-content">
  14 + <div v-if="currentType == '题目作答表现汇总'">
  15 + <el-row class="row-subfix" style="margin-top:10px">
  16 + <div class="row-line">
  17 + <span class="line-subfix">班级:</span>
  18 + <span class="line-value">{{ detail.className }}</span>
  19 + </div>
  20 + <div class="row-line">
  21 + <span class="line-subfix">科目:</span>
  22 + <span class="line-value">{{ detail.subjectName }}</span>
  23 + </div>
  24 + <div class="row-line">
  25 + <span class="line-subfix">课时数:</span>
  26 + <span class="line-value">{{ $props.askReportIds.length }}</span>
  27 + </div>
  28 + <div class="row-line">
  29 + <span class="line-subfix">上课时间:</span>
  30 + <span class="line-value">{{ detail.startTime }}</span>
  31 + </div>
  32 + <div class="row-line">
  33 + <span class="line-subfix">下课时间:</span>
  34 + <span class="line-value">{{ detail.endTime }}</span>
  35 + </div>
  36 + </el-row>
  37 + <el-row class="row-subfix">
  38 + <div class="row-line">
  39 + <span class="line-subfix">班级人数:</span>
  40 + <span class="line-value">{{ detail.classPersonNum }}</span>
  41 + </div>
  42 + <div class="row-line">
  43 + <span class="line-subfix">签到人数:</span>
  44 + <span class="line-value">{{ detail.checkInCount }}</span>
  45 + </div>
  46 + <div class="row-line">
  47 + <span class="line-subfix">题目总数:</span>
  48 + <span class="line-value">{{ detail.questionNum }}</span>
  49 + </div>
  50 + <div class="row-line">
  51 + <span class="line-subfix">答题总数:</span>
  52 + <span class="line-value">{{ detail.totalAnswersNum }}</span>
  53 + </div>
  54 + <div class="row-line">
  55 + <span class="line-subfix">课时时长:</span>
  56 + <span class="line-value">{{ setDuration(detail.duration) }}</span>
  57 + </div>
  58 + </el-row>
  59 + <el-row class="row-subfix">
  60 + <div class="row-line">
  61 + <span class="line-subfix">答对总数:</span>
  62 + <span class="line-value">{{ detail.totalCorrectAnswersNum }}</span>
  63 + </div>
  64 + <div class="row-line">
  65 + <span class="line-subfix">总参与度:</span>
  66 + <span class="line-value">{{ detail.participationRate }}</span>
  67 + </div>
  68 + <div class="row-line">
  69 + <span class="line-subfix">班级正确率:</span>
  70 + <span class="line-value">{{ detail.classCorrectRate }}</span>
  71 + </div>
  72 + <div class="row-line">
  73 + <span class="line-subfix">已达正确率:</span>
  74 + <span class="line-value">{{ detail.answerCorrectRate }}</span>
  75 + </div>
  76 + <div class="row-line">
  77 + <span class="line-subfix">反馈时长:</span>
  78 + <span class="line-value">{{ setDuration(detail.consumingDuration) }}</span>
  79 + </div>
  80 + </el-row>
  81 + <el-row class="row-table">
  82 + <el-table class="default-table" :data="singleSubjectSummary" border>
  83 + <el-table-column prop="title" label="课时-题号" />
  84 + <el-table-column label="题干" width="120">
  85 + <template slot-scope="scoped">
  86 + <el-button type="text" @click="openStem(scoped.row)">查看</el-button>
  87 + </template>
  88 + </el-table-column>
  89 + <el-table-column prop="questionType" label="题型" width="100">
  90 + <template slot-scope="scoped">{{ setSubPro(scoped.row.questionType) }}</template>
  91 + </el-table-column>
  92 + <el-table-column prop="answeredNum" label="答题人数" width="100" />
  93 + <el-table-column prop="correctAnswerNum" label="答对人数" width="100" />
  94 + <el-table-column prop="participationRate" label="班级参与度(单题)" width="150">
  95 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template>
  96 + </el-table-column>
  97 + <el-table-column prop="classCorrectRate" label="班级正确率(单题)" width="150">
  98 + <template slot-scope="scoped">{{ scoped.row.classCorrectRate }}%</template>
  99 + </el-table-column>
  100 +
  101 + <el-table-column prop="answerCorrectRate" label="已答正确率(单题)" width="150">
  102 + <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
  103 + </el-table-column>
  104 +
  105 + <el-table-column prop="knowledge" label="知识点(单题)" width="150" />
  106 + <el-table-column prop="correctAnswer" label="正确答案(单题)" width="150">
  107 + <template slot-scope="scoped">
  108 + {{
  109 + scoped.row.correctAnswer == 1 ? "✓" :
  110 + scoped.row.correctAnswer == 2 ? "✗" :
  111 + scoped.row.correctAnswer
  112 + }}
  113 + </template>
  114 + </el-table-column>
  115 + <el-table-column prop="fallible" label="干扰选项(单题)" width="150">
  116 + <template slot-scope="scoped">
  117 + {{
  118 + scoped.row.fallible == 1 ? "✓" :
  119 + scoped.row.fallible == 2 ? "✗" :
  120 + scoped.row.fallible
  121 + }}
  122 + </template>
  123 + </el-table-column>
  124 + </el-table>
  125 + </el-row>
  126 + </div>
  127 + <div v-if="currentType == '学生单科表现作答汇总表'">
  128 + <el-row class="row-subfix" style="margin-top:10px">
  129 + <div class="row-line">
  130 + <span class="line-subfix">班级:</span>
  131 + <span class="line-value">{{ detail.className }}</span>
  132 + </div>
  133 + <div class="row-line">
  134 + <span class="line-subfix">科目:</span>
  135 + <span class="line-value">{{ detail.subjectName }}</span>
  136 + </div>
  137 + <div class="row-line">
  138 + <span class="line-subfix">开始时间:</span>
  139 + <span class="line-value">{{ $props.queryParams.dateRange[0] }}</span>
  140 + </div>
  141 + <div class="row-line">
  142 + <span class="line-subfix">截止时间:</span>
  143 + <span class="line-value">{{ $props.queryParams.dateRange[1] }}</span>
  144 + </div>
  145 + <div class="row-line">
  146 + <span class="line-subfix">下课时间:</span>
  147 + <span class="line-value">{{ detail.endTime }}</span>
  148 + </div>
  149 + </el-row>
  150 + <el-row class="row-subfix">
  151 + <div class="row-line">
  152 + <span class="line-subfix">课时数:</span>
  153 + <span class="line-value">{{ $props.askReportIds.length }}</span>
  154 + </div>
  155 + <div class="row-line">
  156 + <span class="line-subfix">总出题数:</span>
  157 + <span class="line-value">{{ detail.questionNum }}</span>
  158 + </div>
  159 + <div class="row-line">
  160 + <span class="line-subfix">查询时间:</span>
  161 + <span class="line-value">{{ detail.selectDate }}</span>
  162 + </div>
  163 + <div class="row-line">
  164 + <span class="line-subfix">查询老师:</span>
  165 + <span class="line-value">{{ detail.answerCorrectRate }}</span>
  166 + </div>
  167 + <div class="row-line">
  168 + <span class="line-subfix">课时时长:</span>
  169 + <span class="line-value">{{ setDuration(detail.consumingDuration) }}</span>
  170 + </div>
  171 + </el-row>
  172 + <el-row class="row-table">
  173 + <el-table class="default-table" :data="studentPerformance">
  174 + <el-table-column prop="studentCode" label="学号" />
  175 + <el-table-column prop="studentName" label="姓名" width="160" />
  176 + <el-table-column prop="answerTimes" label="累计答题次数" width="160" />
  177 + <el-table-column prop="correctAnswerTimes" label="累计答对次数" width="160" />
  178 + <el-table-column prop="participationRate" label="总参与度" width="160">
  179 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template>
  180 + </el-table-column>
  181 + <el-table-column prop="participationRateRank" label="总参与度排名" width="160" />
  182 + <el-table-column prop="correctRate" label="总正确率" width="120">
  183 + <template slot-scope="scoped">{{ scoped.row.correctRate }}%</template>
  184 + </el-table-column>
  185 + <el-table-column prop="correctRateRank" label="总正确率排名" width="120" />
  186 + <el-table-column prop="answerCorrectRate" label="已答正确率" width="120">
  187 + <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
  188 + </el-table-column>
  189 + <el-table-column prop="correctAnswerNum" label="查看折线图" width="120">
  190 + <template slot-scope="scoped">
  191 + <el-button type="text" text @click="openLineChart(scoped.row)">查看</el-button>
  192 + </template>
  193 + </el-table-column>
  194 + </el-table>
  195 + </el-row>
  196 + </div>
  197 + <div v-if="currentType == '学生单科互动表现排名表'">
  198 + <el-row class="row-table">
  199 + <el-table class="default-table" :data="studentInteractive">
  200 + <el-table-column prop="studentCode" label="学号" />
  201 + <el-table-column prop="studentName" label="姓名" width="160" />
  202 + <el-table-column prop="interactionsNum" label="参与得分" width="210" />
  203 + <el-table-column prop="interactionsCorrectNum" label="对错得分" width="210" />
  204 + <el-table-column prop="rushAnswerTimes" label="抢答成功次数" width="210" />
  205 + <el-table-column prop="rushAnswerCorrectTimes" label="抢答答对次数" width="210" />
  206 + <el-table-column prop="checkAnswerTimes" label="被抽打次数" width="210" />
  207 + <el-table-column prop="checkAnswerCorrectTimes" label="抽打答对次数" width="210" />
  208 + </el-table>
  209 + </el-row>
  210 + </div>
  211 + </div>
  212 + <el-dialog :append-to-body="true" class="chart-dia" :visible.sync="lineChart.visible" :title="lineChart.title" width="800"
  213 + >
  214 + <div class="chart-box">
  215 + <LineChart id="askLineChart" :params="lineChart.data" :xAxis="lineChart.xAxis"
  216 + :tooltipFormatter="true" />
  217 + </div>
  218 + </el-dialog>
  219 + <el-dialog :append-to-body="true" class="stem" :visible.sync="stem.visible" :title="'题干'" width="800" >
  220 + <iframe v-if="stem && stem.src" :src="stem.src" style="width: 100%;min-height: 400px;" />
  221 + </el-dialog>
  222 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="_exportData"
  223 + :type="'折线图'" />
  224 + </div>
  225 +</template>
  226 +<script>
  227 +import { formatDate } from "utils";
  228 +import { downloadFile, tablePrint } from "@/utils";
  229 +import LineChart from "@/components/charts/lineChart";
  230 +export default {
  231 + name: "askSummaryReport",
  232 + components: {
  233 + LineChart
  234 + },
  235 + props: {
  236 + askReportIds: Array,
  237 + queryParams: Object
  238 + },
  239 +
  240 + watch: {
  241 + currentType: {
  242 + handler: async function (val) {
  243 + await this._changeType();
  244 + },
  245 + deep: false,
  246 + },
  247 + $props: {
  248 + handler: async function (val) {
  249 + await this._changeType();
  250 + },
  251 + deep: false,
  252 + }
  253 + },
  254 + data() {
  255 + return {
  256 + types: ["题目作答表现汇总", "学生单科表现作答汇总表", "学生单科互动表现排名表"],
  257 + currentType: "题目作答表现汇总",
  258 + detail: {},
  259 + page: 1,
  260 + exportStudent: [],
  261 + diaShow: false,
  262 + size: 10,
  263 + total: 0,
  264 + studentPerformance: [],
  265 + singleSubjectSummary: [],
  266 + studentInteractive: [],
  267 + //折线图数据对象
  268 + lineChart: {
  269 + data: [],
  270 + xAxis: [],
  271 + title: "",
  272 + visible: false
  273 + },
  274 + //题干数据对象
  275 + stem: {
  276 + visible: false,
  277 + src: null
  278 + }
  279 + };
  280 + },
  281 + async created() {
  282 + await this._changeType();
  283 + await this._detail();
  284 + },
  285 + methods: {
  286 + _export() {
  287 + this.diaShow = true;
  288 + },
  289 + _print() {
  290 + let title = this.detail.title || this.subjectNames.join();
  291 +
  292 + tablePrint("print-content", title + "_" + this.currentType);
  293 + },
  294 + cancel() {
  295 + this.diaShow = false;
  296 + },
  297 + async _exportData(arr) {
  298 +
  299 + let studentIds = arr;
  300 +
  301 + let query = {};
  302 +
  303 + if (studentIds != null) {
  304 + if (studentIds.length > 0) {
  305 + query.studentIds = studentIds;
  306 + } else {
  307 + query.studentIds = [];
  308 + }
  309 + }
  310 +
  311 + let exportPeriodReport = "";
  312 +
  313 + query.periodIds = this.$props.askReportIds;
  314 +
  315 + query.classIds = [this.$props.queryParams.class];
  316 +
  317 + exportPeriodReport =
  318 + this.role == "ROLE_PERSONAL"
  319 + ? this.$request.pExportPhaseAnswerReport
  320 + : this.$request.exportPhaseAnswerReport;
  321 +
  322 + const data = await exportPeriodReport({
  323 + ...query,
  324 + });
  325 +
  326 + if (data) {
  327 + this.cancel();
  328 + let blob = new Blob([data], {
  329 + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  330 + });
  331 + let name = `随堂问-${this.detail.className}-${this.detail.subjectName}汇总分析报表.xlsx`
  332 + downloadFile(this.status ? "随堂问-已归档单课时报表.xlsx" : name, blob);
  333 + } else {
  334 + this.$message.error("下载失败");
  335 + }
  336 + },
  337 + async refresh() {
  338 + await this._changeType();
  339 + await this._detail();
  340 + },
  341 + async _changeType() {
  342 + switch (this.currentType) {
  343 + case "题目作答表现汇总": { await this._singleSubjectSummary(); }; break;
  344 + case "学生单科表现作答汇总表": { await this._studentPerformance(); }; break;
  345 + case "学生单科互动表现排名表": { await this._studentInteractive(); }; break;
  346 + }
  347 + },
  348 + setSubPro(type) {
  349 + let tit;
  350 + switch (type) {
  351 + case 2:
  352 + tit = "单选题";
  353 + break;
  354 + case 3:
  355 + tit = "多选题";
  356 + break;
  357 + case 4:
  358 + tit = "判断题";
  359 + break;
  360 + case 5:
  361 + tit = "主观题";
  362 + break;
  363 + default:
  364 + tit = "其他";
  365 + }
  366 + return tit;
  367 + },
  368 + setDuration(times) {
  369 + let m = parseInt(times / 1000 / 60);
  370 + let s = parseInt((times / 1000) % 60);
  371 + let ms = times;
  372 + let aTime;
  373 + if (times == 0) {
  374 + aTime = `0`;
  375 + } else {
  376 + if (m == 0 && s == 0) {
  377 + aTime = `${ms}毫秒`;
  378 + } else if (m == 0 && s != 0) {
  379 + aTime = `${s}秒`;
  380 + } else if (m != 0 && s != 0) {
  381 + aTime = `${m}分${s}秒`;
  382 + }
  383 + }
  384 + return aTime;
  385 + },
  386 + async _detail() {
  387 +
  388 + this.detail = {};
  389 +
  390 + if (!this.$props.askReportIds || this.$props.askReportIds.length < 1) return;
  391 +
  392 + const periodDetail =
  393 + this.role == "ROLE_PERSONAL"
  394 + ? this.$request.pPeriodDetail :
  395 + this.role == "ROLE_BANZHUREN" ?
  396 + this.$request.periodDetail
  397 + : this.$request.periodDetail;
  398 +
  399 + let detailReponse = await periodDetail({
  400 + periodIds: this.$props.askReportIds
  401 + });
  402 +
  403 + if (detailReponse.status != 0) {
  404 + this.$message.error(detailReponse.info);
  405 + return;
  406 + }
  407 + this.detail = detailReponse.data;
  408 + this.detail.selectDate = formatDate(new Date(), "yyyy-MM-dd");
  409 + },
  410 + async _singleSubjectSummary() {
  411 +
  412 + this.singleSubjectSummary = [];
  413 +
  414 + if (!this.$props.askReportIds || this.$props.askReportIds.length < 1) return;
  415 +
  416 + const periodList =
  417 + this.role == "ROLE_PERSONAL"
  418 + ? this.$request.pPeriodQuestionReport
  419 + : this.$request.periodQuestionReport;
  420 +
  421 + let query = {
  422 + periodIds: this.$props.askReportIds,
  423 + classIds: [this.$props.queryParams.class],
  424 + };
  425 +
  426 + let periodListReponse = await periodList({
  427 + ...query
  428 + });
  429 +
  430 + if (periodListReponse.status != 0) {
  431 + this.$message.error(periodListReponse.info);
  432 + return;
  433 + }
  434 +
  435 + this.singleSubjectSummary = periodListReponse.data.list;
  436 +
  437 + this.total = periodListReponse.data.count;
  438 + },
  439 + async _studentPerformance() {
  440 +
  441 + this.studentPerformance = [];
  442 +
  443 + if (!this.$props.askReportIds || this.$props.askReportIds.length < 1) return;
  444 +
  445 + const phaseAnswerList =
  446 + this.role == "ROLE_PERSONAL"
  447 + ? this.$request.pPhaseAnswerReport
  448 + : this.$request.phaseAnswerReport;
  449 +
  450 + let query = {
  451 + periodIds: this.$props.askReportIds,
  452 + classIds: [this.$props.queryParams.class],
  453 + };
  454 +
  455 + let phaseAnswerReponse = await phaseAnswerList({
  456 + ...query
  457 + });
  458 +
  459 + if (phaseAnswerReponse.status != 0) {
  460 + this.$message.error(phaseAnswerReponse.info);
  461 + return;
  462 + }
  463 +
  464 + this.studentPerformance = phaseAnswerReponse.data.list;
  465 +
  466 + this.total = phaseAnswerReponse.data.count;
  467 + },
  468 + async _studentInteractive() {
  469 +
  470 + this.studentInteractive = [];
  471 +
  472 + if (!this.$props.askReportIds || this.$props.askReportIds.length < 1) return;
  473 +
  474 + const interactiveList =
  475 + this.role == "ROLE_PERSONAL"
  476 + ? this.$request.phaseInteractiveReport
  477 + : this.$request.phaseInteractiveReport;
  478 +
  479 + let query = {
  480 + periodIds: this.$props.askReportIds,
  481 + classIds: [this.$props.queryParams.class],
  482 + };
  483 +
  484 + let interactiveListReponse = await interactiveList({
  485 + ...query
  486 + });
  487 +
  488 + if (interactiveListReponse.status != 0) {
  489 + this.$message.error(interactiveListReponse.info);
  490 + return;
  491 + }
  492 +
  493 + this.studentInteractive = interactiveListReponse.data.list;
  494 +
  495 + this.total = interactiveListReponse.data.count;
  496 + },
  497 + openLineChart(chartRow) {
  498 + this.lineChart.title = `${chartRow.studentName}-${this.currentType}`;
  499 + this.lineChart.visible = true;
  500 + let participationRate = [];
  501 + let correctRate = [];
  502 + let answerCorrectRate = [];
  503 + this.lineChart.xAxis = chartRow.dataList.map((item) => {
  504 + participationRate.push(item.participationRate);
  505 + correctRate.push(item.correctRate);
  506 + answerCorrectRate.push(item.answerCorrectRate);
  507 + return item.name;
  508 + });
  509 + this.lineChart.data = [
  510 + {
  511 + name: "参与度",
  512 + value: participationRate,
  513 + },
  514 + {
  515 + name: "正确率",
  516 + value: correctRate,
  517 + },
  518 + {
  519 + name: "已答正确率",
  520 + value: answerCorrectRate,
  521 + },
  522 + ];
  523 + console.log(this.lineChart)
  524 + },
  525 + openStem(stemRow) {
  526 + this.stem.src = stemRow.screenshot ?? "";
  527 + this.stem.visible = true;
  528 + },
  529 + openExport() {
  530 +
  531 + }
  532 + }
  533 +};
  534 +</script>
  535 +<style scoped lang="scss">
  536 +.chart-dia {
  537 + .chart-box {
  538 + width: 100%;
  539 + height: 300px;
  540 + }
  541 +
  542 + :deep(.el-dialog__body) {
  543 + padding: 0 0 20px 0;
  544 + }
  545 +}
  546 +
  547 +.opration-btn {
  548 + margin-right: 10px;
  549 +}
  550 +
  551 +.opration-select {
  552 + margin-left: 10px;
  553 +}
  554 +
  555 +.row-line {
  556 + width: calc(20% - 2px);
  557 + border: 1px solid #ebeef5;
  558 + background: #f5f7fa;
  559 + display: inline-block;
  560 + height: 40px;
  561 + line-height: 40px;
  562 +
  563 + .line-subfix {
  564 + margin-left: 10px;
  565 +
  566 + }
  567 +}
  568 +
  569 +.row-table {
  570 + margin-top: 20px;
  571 +}
  572 +</style>
... ...
src/views/basic/askTestQuestion/components/testBzrMulti.vue 0 → 100644
  1 +<template>
  2 + <div style="margin-right: 20px;width: 100%">
  3 + <div v-if="status == 'select'">
  4 + <el-row class="row-type">
  5 +
  6 + <div style="float: right;">
  7 + <el-button type="primary" :disabled="multipleSelection.length < 1" class="opration-btn"
  8 + @click="handlerTotal">查看汇总报表</el-button>
  9 + </div>
  10 + </el-row>
  11 + <el-row class="row-table">
  12 + <el-table class="default-table" :data="$props.list">
  13 + <el-table-column width="48">
  14 + <template slot="header">
  15 + <el-checkbox v-model="checkedAll" @change="_checkAll"></el-checkbox>
  16 + </template>
  17 + <template slot-scope="scope">
  18 + <el-checkbox v-model="multipleSelection" :label="scope.row.id"
  19 + :disabled="_checkboxDisabled(scope.row)"><span></span></el-checkbox>
  20 + </template>
  21 + </el-table-column>
  22 + <el-table-column prop="subjectName" label="科目"></el-table-column>
  23 + <el-table-column prop="className" label="班级"></el-table-column>
  24 + <el-table-column prop="title" label="试卷名称"></el-table-column>
  25 + <el-table-column prop="examPaperScore" label="卷面分"></el-table-column>
  26 + <el-table-column label="测验人数/班级人数">
  27 + <template slot-scope="scoped">
  28 + {{ `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` }}
  29 + </template>
  30 + </el-table-column>
  31 + <el-table-column prop="examStartTime" label="测验时长"></el-table-column>
  32 + </el-table>
  33 + </el-row>
  34 + </div>
  35 + <div v-if="status == 'selected'">
  36 + <el-container style="height: 100%;width: 100%;">
  37 + <el-main id="print-content">
  38 + <el-row class="row-type">
  39 + <div style="float: right;">
  40 + <el-button type="primary" @click="_import" class="opration-btn"
  41 + icon="el-icon-upload2">导出报表</el-button>
  42 + <el-button type="primary" @click="_print" class="opration-btn"
  43 + icon="el-icon-printer">打印报表</el-button>
  44 + </div>
  45 + </el-row>
  46 + <el-row class="row-table">
  47 + <el-table :maxHeight="660" :data="selectedList" style="width: 100%" class="default-table">
  48 + <el-table-column prop="studentCode" label="学号" fixed></el-table-column>
  49 +
  50 + <el-table-column prop="studentName" label="姓名" fixed>
  51 + <template slot-scope="scoped"><span class="click-b" @click="toPortrait(scoped.row)">
  52 + {{ scoped.row.studentName }}
  53 + </span></template>
  54 + </el-table-column>
  55 + <el-table-column v-for="(item, index) in answerList" :key="index" :label="item">
  56 + <el-table-column :prop="'examCount' + item" label="测练数"
  57 + :class-name="index % 2 == 0 ? 'bg' : ''">
  58 + <template slot-scope="scoped">{{
  59 + scoped.row["examCount" + item] ||
  60 + Number(scoped.row["examCount" + item]) === 0
  61 + ? scoped.row["examCount" + item]
  62 + : "-"
  63 + }}</template>
  64 + </el-table-column>
  65 + <el-table-column :prop="'participationCount' + item" label="参与数"
  66 + :class-name="index % 2 == 0 ? 'bg' : ''">
  67 + <template slot-scope="scoped">{{
  68 + scoped.row["participationCount" + item] ||
  69 + Number(scoped.row["participationCount" + item]) === 0
  70 + ? scoped.row["participationCount" + item]
  71 + : "-"
  72 + }}</template>
  73 + </el-table-column>
  74 + <el-table-column :prop="'score' + item" label="总分"
  75 + :class-name="index % 2 == 0 ? 'bg' : ''">
  76 + <template slot-scope="scoped">{{
  77 + scoped.row["score" + item] ||
  78 + Number(scoped.row["score" + item]) === 0
  79 + ? scoped.row["score" + item]
  80 + : "-"
  81 + }}</template>
  82 + </el-table-column>
  83 + <el-table-column :prop="'classRank' + item" label="班名"
  84 + :class-name="index % 2 == 0 ? 'bg' : ''">
  85 + <template slot-scope="scoped">{{
  86 + scoped.row["classRank" + item] ||
  87 + Number(scoped.row["classRank" + item]) === 0
  88 + ? scoped.row["classRank" + item]
  89 + : "-"
  90 + }}</template>
  91 + </el-table-column>
  92 + </el-table-column>
  93 + <el-table-column label="查看雷达图">
  94 + <template slot-scope="scoped">
  95 + <el-button type="text" @click="openRandarChart(scoped.row)">查看</el-button>
  96 + </template>
  97 + </el-table-column>
  98 + </el-table>
  99 + </el-row>
  100 + </el-main>
  101 + <el-footer>
  102 + <div style="float: right;margin-top: 10px;">
  103 + <el-button @click="_backa">返回</el-button>
  104 + </div>
  105 + </el-footer>
  106 + </el-container>
  107 +
  108 + </div>
  109 + <el-dialog class="chart-dia" :visible.sync="radarChart.visible" :title="radarChart.title" width="800"
  110 + :append-to-body="true">
  111 + <div class="chart-box">
  112 + <RadarChart id="askRadarChart" :params="radarChart" :tooltipFormatter="true" />
  113 + </div>
  114 + </el-dialog>
  115 + </div>
  116 +</template>
  117 +<script>
  118 +import { formatDate } from "utils";
  119 +import { downloadFile, tablePrint } from "@/utils";
  120 +import RadarChart from "@/components/charts/radarChart";
  121 +export default {
  122 + name: "askbzrMutli",
  123 + components: {
  124 + RadarChart
  125 + },
  126 + props: {
  127 + askReportIds: Array,
  128 + queryParams: Object,
  129 + list: Array
  130 + },
  131 +
  132 + watch: {
  133 + currentType: {
  134 + handler: async function (val) {
  135 +
  136 + },
  137 + deep: false,
  138 + },
  139 + $props: {
  140 + handler: async function (val) {
  141 +
  142 + },
  143 + deep: false,
  144 + }
  145 + },
  146 + data() {
  147 + return {
  148 + selectedList: [],
  149 + status: "select",
  150 + checkedAll: 0,
  151 + answerList: [],
  152 + multipleSelection: [],
  153 + multipleSelectionObj: {},
  154 + radarChart: {
  155 + title: "",
  156 + indicator: [
  157 + {
  158 + name: "",
  159 + max: 100,
  160 + axisLabel: {
  161 + show: true,
  162 + showMaxLabel: true,
  163 + formatter: "{value}%",
  164 + },
  165 + },
  166 + ],
  167 + seriesData: []
  168 + },
  169 + //题干数据对象
  170 + stem: {
  171 + visible: false,
  172 + src: null
  173 + }
  174 + };
  175 + },
  176 + async created() {
  177 + },
  178 + methods: {
  179 + _print() {
  180 +
  181 +
  182 + tablePrint("print-content", this.currentType);
  183 + },
  184 + _checkAll() { },
  185 + _checkboxDisabled(obj) {
  186 + if (obj.examStartTime) {
  187 + return false;
  188 + } else {
  189 + return true;
  190 + }
  191 + },
  192 + async refresh() {
  193 +
  194 + },
  195 + async handlerTotal() {
  196 + if (this.multipleSelection.length == 0) {
  197 + this.$message.warning("请选择试卷!");
  198 + return;
  199 + }
  200 + this.status = 'selected'
  201 + await this._loadData();
  202 + },
  203 + setSubPro(type) {
  204 +
  205 + let tit;
  206 + switch (type) {
  207 + case 2:
  208 + tit = "单选题";
  209 + break;
  210 + case 3:
  211 + tit = "多选题";
  212 + break;
  213 + case 4:
  214 + tit = "判断题";
  215 + break;
  216 + case 5:
  217 + tit = "主观题";
  218 + break;
  219 + default:
  220 + tit = "其他";
  221 + }
  222 + return tit;
  223 + },
  224 + setDuration(times) {
  225 + let m = parseInt(times / 1000 / 60);
  226 + let s = parseInt((times / 1000) % 60);
  227 + let ms = times;
  228 + let aTime;
  229 + if (times == 0) {
  230 + aTime = `0`;
  231 + } else {
  232 + if (m == 0 && s == 0) {
  233 + aTime = `${ms}毫秒`;
  234 + } else if (m == 0 && s != 0) {
  235 + aTime = `${s}秒`;
  236 + } else if (m != 0 && s != 0) {
  237 + aTime = `${m}分${s}秒`;
  238 + }
  239 + }
  240 + return aTime;
  241 + },
  242 + _backa() {
  243 + this.status = 'select'
  244 + this.answerList = [];
  245 + this.exportStudent = [];
  246 + },
  247 + openRandarChart(obj) {
  248 + this.radarChart = {
  249 + indicator: [
  250 + {
  251 + name: "",
  252 + max: 100,
  253 + axisLabel: {
  254 + show: true,
  255 + showMaxLabel: true,
  256 + formatter: "{value}%",
  257 + },
  258 + },
  259 + ],
  260 + seriesData: [],
  261 + };
  262 + this.radarChart.title = obj.studentName + "-多科-多课时作答表现图";
  263 + let dataList = obj.dataList.slice(1, obj.dataList.length);
  264 + let subjectList = dataList.map((item) => item.subjectName);
  265 + subjectList.map((item, index) => {
  266 + if (index < 1) {
  267 + this.radarChart.indicator[index].name = item;
  268 + } else {
  269 + this.radarChart.indicator.push({ name: item, max: 100 });
  270 + }
  271 + });
  272 + // 为了美观
  273 + if (this.radarChart.indicator.length < 3) {
  274 + let num = this.radarChart.indicator.length;
  275 + for (let i = 0; i < 6; i++) {
  276 + if (i >= num) {
  277 + this.radarChart.indicator.push({ name: "", max: 100 });
  278 + }
  279 + }
  280 + }
  281 + let participationRate = dataList.map((item) => item.participationRate);
  282 + let correctRate = dataList.map((item) => item.correctRate);
  283 + this.radarChart.seriesData = [
  284 + {
  285 + value: participationRate,
  286 + name: "参与度",
  287 + },
  288 + {
  289 + value: correctRate,
  290 + name: "正确率",
  291 + },
  292 + ];
  293 +
  294 + this.radarChart.visible = true;
  295 + },
  296 + async _loadData() {
  297 + var classIds = [];
  298 + var subjects = [];
  299 + var ids = [];
  300 +
  301 + this.$props.list?.map((item) => {
  302 + if (this.multipleSelection.includes(item.id)) {
  303 + subjects.push(item.subjectName);
  304 + classIds.push(item.classId);
  305 + }
  306 + });
  307 +
  308 + ids = [...this.multipleSelection];
  309 +
  310 + const { data, status, info } = await this.$request.cTPhaseExamReport({
  311 + classIds: classIds,
  312 + examIds: ids,
  313 + subjectNames: subjects
  314 + });
  315 +
  316 + if (status != 0) {
  317 + this.$message.error(info);
  318 + return;
  319 + }
  320 +
  321 + let subjectName = [];
  322 +
  323 + this.selectedList = data?.list.map((item) => {
  324 + let params = {};
  325 + item.dataList.map((items, index) => {
  326 + if (!subjectName.includes(items.subjectName)) {
  327 + subjectName.push(items.subjectName);
  328 + }
  329 + params["examCount" + items.subjectName] = items.examCount;
  330 + params["participationCount" + items.subjectName] =
  331 + items.participationCount;
  332 + params["score" + items.subjectName] = items.score;
  333 + params["classRank" + items.subjectName] = items.classRank;
  334 + });
  335 + return {
  336 + ...item,
  337 + ...params,
  338 + };
  339 + });
  340 +
  341 + this.answerList = [...subjectName];
  342 +
  343 + this.exportStudent = [...this.selectedList];
  344 + }
  345 +
  346 + }
  347 +};
  348 +</script>
  349 +<style scoped lang="scss">
  350 +.chart-dia {
  351 + .chart-box {
  352 + width: 100%;
  353 + height: 300px;
  354 + }
  355 +
  356 + :deep(.el-dialog__body) {
  357 + padding: 0 0 20px 0;
  358 + }
  359 +}
  360 +
  361 +.opration-btn {
  362 + margin-right: 10px;
  363 +}
  364 +
  365 +.opration-select {
  366 + margin-left: 10px;
  367 +}
  368 +
  369 +.row-line {
  370 + width: calc(20% - 2px);
  371 + border: 1px solid #ebeef5;
  372 + background: #f5f7fa;
  373 + display: inline-block;
  374 + height: 40px;
  375 + line-height: 40px;
  376 +
  377 + .line-subfix {
  378 + margin-left: 10px;
  379 +
  380 + }
  381 +}
  382 +
  383 +.row-table {
  384 + margin-top: 20px;
  385 +}
  386 +</style>
... ...
src/views/basic/askTestQuestion/components/testListReport.vue 0 → 100644
  1 +<template>
  2 + <div ref="main">
  3 + <el-table class="default-table" :data="tableData">
  4 + <el-table-column prop="subjectName" label="科目" width="180" />
  5 + <el-table-column prop="className" label="班级" width="180" />
  6 + <el-table-column prop="title" label="报表名称" />
  7 + <el-table-column prop="examPaperScore" label="卷面分" width="180" />
  8 + <el-table-column prop="classCorrectRate" label="测验人数/班级人数" width="180">
  9 + <template slot-scope="scoped">{{ `${scoped.row.answeredNum}/${scoped.row.classPersonNum}` }}</template>
  10 + </el-table-column>
  11 + <el-table-column prop="questionNum" label="测验时长" width="180" />
  12 + <el-table-column prop="createdTime" label="测验开始时间" width="180" />
  13 + <el-table-column label="操作" width="240">
  14 + <template slot-scope="scoped">
  15 + <el-tooltip v-if="scoped.row.answerNum != 0 ||
  16 + (scoped.row.recordStatus != 0 &&
  17 + scoped.row.subjectiveScore == scoped.row.examPaperScore)
  18 + " effect="dark" content="详情" style="margin-right: 10px;" placement="top">
  19 + <el-button type="text" @click="_linkToDetail(scoped.row)">查看</el-button>
  20 + </el-tooltip>
  21 + <el-popconfirm style="margin-right: 10px;" title="确定删除这张答题卡吗?" @confirm="_removeReport(scoped.row)">
  22 + <el-button style="color:red; " slot="reference" class="delete" type="text">
  23 + 删除
  24 + </el-button>
  25 + </el-popconfirm>
  26 + <template v-if="scoped.row.answerNum == 0 &&
  27 + scoped.row.subjectiveScore != scoped.row.examPaperScore
  28 + ">
  29 + <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="设置答案" placement="top">
  30 + <el-button type="text" icon="fa fa-file-text" @click="edit(scoped.row)"></el-button>
  31 + </el-tooltip>
  32 + <template v-else>未设置答案</template>
  33 + </template>
  34 + <template v-if="role != 'ROLE_BANZHUREN' && scoped.row.examPaperId != 0">
  35 + <template>
  36 + <el-popover placement="bottom" ref="popoverRef">
  37 + <div style="display: flex" v-loading="scoped.row.showSelect == 0 ||
  38 + scoped.row.showSelect == 1
  39 + ? false
  40 + : true
  41 + ">
  42 + <el-button v-if="scoped.row.showSelect == 0" size="mini"
  43 + @click="openScoreSet(scoped.row, 1)">录入总得分</el-button>
  44 + <el-button type="primary" size="mini"
  45 + @click="openScoreSet(scoped.row, 2)">录入小题分</el-button>
  46 + </div>
  47 + <el-button slot="reference" type="text"
  48 + @click="queryStatus(scoped.row)">录入分数</el-button>
  49 + </el-popover>
  50 + </template>
  51 + </template>
  52 + </template>
  53 + </el-table-column>
  54 + </el-table>
  55 + <ScoreSet v-show="diaScoreSet" :diaScoreSet="diaScoreSet" :role="role" :id="examId" :title="examTitlt"
  56 + :examScore="examScore" :showAllSetScore="showAllSetScore" :showSetScore="showSetScore"
  57 + @closeScoreSet="closeScoreSet" @SuccessScoreSet="SuccessScoreSet" />
  58 + </div>
  59 +</template>
  60 +<script>
  61 +import ScoreSet from "../../test/components/scoreSet.vue";
  62 +export default {
  63 + name: "testListReport",
  64 + props: {
  65 + datas: Array,
  66 + },
  67 + components: {
  68 + ScoreSet
  69 + },
  70 + watch: {
  71 + '$props.datas'(value) {
  72 + if (this.role == "ROLE_BANZHUREN") {
  73 + this.isMultipleClass = false;
  74 + this.tableData =
  75 + value?.map((item) => {
  76 + item.showSelect = false;
  77 + return item;
  78 + }) || [];
  79 + } else {
  80 + this.isMultipleClass = false;
  81 + this.tableData =
  82 + value?.map((item) => {
  83 + item.showSelect = false;
  84 + return item;
  85 + }) || [];
  86 + }
  87 + },
  88 + },
  89 + created() {
  90 + this.role =
  91 + this.$store.getters.info.showRole ||
  92 + this.$store.getters.info.permissions[0].role;
  93 + },
  94 + methods: {
  95 + _linkToDetail(dataRow) {
  96 + this.$router.push({
  97 + path: "/testReportDetail",
  98 + query: {
  99 + dataType: 2,
  100 + classIds: dataRow.classId,
  101 + id: dataRow.id,
  102 + title: dataRow.title
  103 + },
  104 + });
  105 + },
  106 + openScoreSet(obj, type) {
  107 + this.$refs.main.click();
  108 + this.showAllSetScore = type == 1 ? true : false;
  109 + this.showSetScore = type == 2 ? true : false;
  110 + this.examId = String(obj.id);
  111 + this.examTitlt = obj.title;
  112 + this.examScore = obj.examPaperScore;
  113 + this.diaScoreSet = true;
  114 + },
  115 + async _removeReport(obj, index) {
  116 + this.tableData[index].loading = true;
  117 + const { data, status, info } = await this.$request.deleteReport({
  118 + id: obj.id,
  119 + });
  120 + if (status === 0) {
  121 + this.$message.success("删除成功!");
  122 + this._QueryData();
  123 + } else {
  124 + this.$message.error(info);
  125 + }
  126 + },
  127 + async queryStatus(obj) {
  128 + const { data, status, info } = await this.$request.getScoreType({
  129 + examId: obj.id,
  130 + });
  131 + if (status === 0) {
  132 + // if (data == 1) {
  133 + // this.openScoreSet(obj, 2);
  134 + // }
  135 + obj.showSelect = data;
  136 + } else {
  137 + this.$message.error(info);
  138 + }
  139 + },
  140 + //关闭设置分数
  141 + closeScoreSet() {
  142 + this.diaScoreSet = false;
  143 + },
  144 + //修改分数成功
  145 + SuccessScoreSet() {
  146 + this._QueryData();
  147 + this.closeScoreSet();
  148 + },
  149 + //修改答案
  150 + edit(item) {
  151 + this.$router.push({
  152 + path: "/examinationPaperEdit",
  153 + query: {
  154 + paperId: item.id,
  155 + title: item.title,
  156 + type: 2, //搜索题目详情类型
  157 + examType: item.examPaperId == 0 ? 1 : 2,
  158 + },
  159 + });
  160 + },
  161 + },
  162 + data() {
  163 + return {
  164 + tableData: [],
  165 + isMultipleClass: false,
  166 + diaScoreSet: false,
  167 + examId: "", //当前操作试卷
  168 + examTitlt: "", //当前操作试卷名称
  169 + examScore: 0, //当前操作试卷卷面总分
  170 + showAllSetScore: false, //当前操作试卷可录总分分状态
  171 + showSetScore: false, //当前操作试卷可录小题分状态
  172 + role: "",
  173 + };
  174 + },
  175 +};
  176 +</script>
  177 +<style scoped></style>
... ...
src/views/basic/askTestQuestion/components/testMultiClassReport.vue 0 → 100644
  1 +<template>
  2 + <div style="margin-right: 20px;width: 100%">
  3 + <el-row class="row-type">
  4 + <label>阶段报表类型</label>
  5 + <el-select class="opration-select" v-model="currentType" style="margin-left: 10px;">
  6 + <el-option v-for="(item, index) in types" :lable="item" :key="index" :value="item" />
  7 + </el-select>
  8 + </el-row>
  9 + <el-row class="row-type" style="margin-top: 10px;">
  10 + <el-table v-if="$props.params" class="default-table" :data="listReport">
  11 + <el-table-column prop="subjectName" label="科目" width="180" />
  12 + <el-table-column prop="paperName" label="试卷名称" width="240" />
  13 + <el-table-column prop="classCorrectRate" label="已考班级">
  14 + <template slot-scope="scoped">
  15 + <el-checkbox-group v-model="scoped.row.checkedClassList">
  16 + <el-checkbox v-for="(item, index) in scoped.row.classInfos" :label="item.classId">
  17 + {{ item.className }}
  18 + </el-checkbox>
  19 + </el-checkbox-group>
  20 + </template>
  21 + </el-table-column>
  22 + <el-table-column prop="score" label="卷面分" width="180" />
  23 + <el-table-column label="操作" width="240">
  24 + <template slot-scope="scoped">
  25 + <el-button type="text" @click="_linkToDetail(scoped.row)">查看</el-button>
  26 + </template>
  27 + </el-table-column>
  28 + </el-table>
  29 + </el-row>
  30 + </div>
  31 +</template>
  32 +<script>
  33 +export default {
  34 + name: "testMultiClassReport",
  35 + props: {
  36 + params: null
  37 + },
  38 + async created() {
  39 + this.role =
  40 + this.$store.getters.info.showRole ||
  41 + this.$store.getters.info.permissions[0].role;
  42 +
  43 + await this._loadDatas();
  44 + },
  45 + watch: {
  46 + async 'currentType'(value) {
  47 + await this._loadDatas();
  48 + }
  49 + },
  50 + methods: {
  51 + _linkToDetail(dataRow) {
  52 +
  53 + console.log(dataRow)
  54 + this.$router.push({
  55 + path: "/testReportDetail",
  56 + query: {
  57 + dataType: 3,
  58 + classIds: dataRow.checkedClassList.join(","),
  59 + id: dataRow.paperId,
  60 + title: dataRow.paperName,
  61 + subjectName: dataRow.subjectName,
  62 + },
  63 + });
  64 + },
  65 + async _loadDatas() {
  66 +
  67 + var dataRequestParams = {
  68 + classIds: this.$props.params.class ? [this.$props.params.class] :
  69 + this.$props.params.classIds ? [...this.$props.params.classIds] : null,
  70 + diffType: this.currentType == "任课班级对比" ? "0" : "1",
  71 + end: this.$props.params.dataRange ? this.$props.params.dataRange[1] : null,
  72 + start: this.$props.params.dataRange ? this.$props.params.dataRange[0] : null,
  73 + subjects: this.$props.params.subject ? [this.$props.params.subject] :
  74 + this.$props.params.subjects ? [...this.$props.params.subjects] : null
  75 + };
  76 +
  77 + var dataRequest = this.$request.tListExamReport;
  78 +
  79 +
  80 + var dataResponse = await dataRequest({ ...dataRequestParams });
  81 +
  82 + if (dataResponse.status != 0) {
  83 + this.$message.error(response.info);
  84 + return;
  85 + }
  86 +
  87 + this.listReport = dataResponse.data.map(item => {
  88 + item.checkedClassList = item.classInfos.map(item => item.classId);
  89 + return item;
  90 + })
  91 + },
  92 + },
  93 + data() {
  94 + return {
  95 + listReport: [],
  96 + role: "",
  97 + types: ["任课班级对比", "年级对比"],
  98 + currentType: "任课班级对比",
  99 + };
  100 + },
  101 +};
  102 +</script>
  103 +<style scoped></style>
... ...
src/views/basic/askTestQuestion/components/testSummaryReport.vue 0 → 100644
  1 +<template>
  2 + <div style="margin-right: 20px;width: 100%">
  3 + <el-row class="row-type">
  4 + <div style="float: right;">
  5 + <el-button type="primary" @click="_export" icon="el-icon-upload2" class="opration-btn">导出报表</el-button>
  6 + <el-button type="primary" @click="_print" icon="el-icon-printer" class="opration-btn">打印报表</el-button>
  7 + </div>
  8 + </el-row>
  9 + <div id="print-content">
  10 + <el-row class="row-table">
  11 + <el-table border class="default-table" :data="stageReport" style="width: 100%">
  12 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
  13 + <el-table-column prop="studentName" label="姓名" fixed align="center">
  14 + <template slot-scope="scoped">
  15 + {{ scoped.row.studentName }}
  16 + </template></el-table-column>
  17 + <el-table-column v-if="answerList" align="center" v-for="(item, index) in answerList" :key="index"
  18 + :label="item.title">
  19 + <el-table-column :prop="'score' + index" :label="index == 0 ? '总分' : '总分'" align="center"
  20 + :class-name="index % 2 == 0 ? 'bg' : ''">
  21 + <template slot-scope="scoped">
  22 + {{
  23 + scoped.row["score" + index] ||
  24 + Number(scoped.row["score" + index]) === 0
  25 + ? scoped.row["score" + index]
  26 + : "-"
  27 + }}
  28 + </template>
  29 + </el-table-column>
  30 + <el-table-column :prop="'classRank' + index" label="排名" align="center"
  31 + :class-name="index % 2 == 0 ? 'bg' : ''">
  32 + <template slot-scope="scoped">{{
  33 + scoped.row["classRank" + index] ||
  34 + Number(scoped.row["classRank" + index]) === 0
  35 + ? scoped.row["classRank" + index]
  36 + : "-"
  37 + }}</template>
  38 + </el-table-column>
  39 + </el-table-column>
  40 + <el-table-column label="查看折线图" align="center">
  41 + <template slot-scope="scoped">
  42 + <el-button type="text" @click="_openLineChart(scoped.row)">查看</el-button>
  43 + </template>
  44 + </el-table-column>
  45 + </el-table>
  46 + </el-row>
  47 + </div>
  48 + <!-- 折线图 -->
  49 + <el-dialog class="chart-dia" :visible.sync="lineChart.visible" :title="lineChart.title" width="800"
  50 + :append-to-body="true">
  51 + <div class="chart-box">
  52 + <LineChart id="askLineChart" :params="lineChart.data" :xAxis="lineChart.xAxis"
  53 + :tooltipFormatter="true" />
  54 + </div>
  55 + </el-dialog>
  56 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData"
  57 + :type="'折线图'" />
  58 + </div>
  59 +</template>
  60 +<script>
  61 +import { formatDate } from "utils";
  62 +import { downloadFile, tablePrint } from "@/utils";
  63 +import LineChart from "@/components/charts/lineChart";
  64 +export default {
  65 + name: "testSummaryReport",
  66 + components: {
  67 + LineChart
  68 + },
  69 + props: {
  70 + testReportIds: Array,
  71 + queryParams: Object
  72 + },
  73 + async created() {
  74 + await this._phaseExamReport();
  75 + // await this._changeType();
  76 + },
  77 + watch: {
  78 + $props: {
  79 + handler: async function (val) {
  80 + await this._phaseExamReport();
  81 + },
  82 + deep: false,
  83 + }
  84 + },
  85 + data() {
  86 + return {
  87 + page: 1,
  88 + size: 10,
  89 + total: 0,
  90 + diaShow: false,
  91 + stageReport: [],
  92 + exportStudent: [],
  93 + answerList: null,
  94 + //折线图数据对象
  95 + lineChart: {
  96 + data: [],
  97 + xAxis: [],
  98 + title: "",
  99 + visible: false
  100 + },
  101 + };
  102 + },
  103 + methods: {
  104 + async _export() {
  105 + this.diaShow = true;
  106 + },
  107 + cancel() {
  108 + this.diaShow = false;
  109 + },
  110 + async _phaseExamReport() {
  111 + const phaseExamReport =
  112 + this.role == "ROLE_PERSONAL"
  113 + ? this.$request.pPhaseExamReport
  114 + : this.$request.phaseExamReport;
  115 +
  116 + let query = {
  117 + examIds: this.$props.testReportIds,
  118 + classIds: [this.$props.queryParams.class],
  119 + subjectName: [this.$props.queryParams.subject]
  120 + };
  121 +
  122 + const { data, status, info } = await phaseExamReport({
  123 + ...query
  124 + });
  125 +
  126 + if (status != 0) {
  127 + this.$message.error(info);
  128 + return;
  129 + }
  130 +
  131 + this.total = data.count;
  132 + let dataIdsList = [],
  133 + dataList = [];
  134 + data?.list.map((item) => {
  135 + item.examList.map((items) => {
  136 + if (!dataIdsList.includes(items.title)) {
  137 + dataIdsList.push(items.title);
  138 + dataList.push(items);
  139 + }
  140 + });
  141 + });
  142 + this.stageReport = data?.list.map((item) => {
  143 + let params = {};
  144 + dataIdsList.map((ids, index) => {
  145 + params["score" + index] = "--";
  146 + params["classRank" + index] = "--";
  147 + item.examList.map((items) => {
  148 + if (items.title == ids) {
  149 + params["score" + index] = Number(items.score);
  150 + params["classRank" + index] = items.classRank;
  151 + }
  152 + });
  153 + });
  154 + return {
  155 + ...item,
  156 + ...params,
  157 + };
  158 + });
  159 +
  160 + this.answerList = dataList;
  161 +
  162 + this.exportStudent = [...this.stageReport];
  163 + },
  164 + async exportData(arr) {
  165 + let studentIds = arr;
  166 + let query = {};
  167 + if (studentIds != null) {
  168 + if (studentIds.length > 0) {
  169 + query.studentIds = studentIds;
  170 + } else {
  171 + query.studentIds = [];
  172 + }
  173 + }
  174 +
  175 + const exportPhaseExamReport =
  176 + this.role == "ROLE_PERSONAL"
  177 + ? this.$request.pExportPhaseExamReport
  178 + : this.$request.exportPhaseExamReport;
  179 +
  180 + const data = await exportPhaseExamReport({
  181 + examIds: this.$props.testReportIds,
  182 + classIds: [this.$props.queryParams.class],
  183 + subjectName: [this.$props.queryParams.subject],
  184 + ...query
  185 + });
  186 +
  187 + if (data) {
  188 + this.cancel();
  189 +
  190 + let blob = new Blob([data], {
  191 + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  192 + });
  193 +
  194 + let name = `即时测-单科多卷报表.xlsx`;
  195 +
  196 + downloadFile(this.status ? "即时测-已归档单课时报表.xlsx" : name, blob);
  197 + } else {
  198 + this.$message.error("下载失败");
  199 + }
  200 + },
  201 + _print() {
  202 + tablePrint("print-content", "即时测-已归档单课时报表");
  203 + },
  204 + _titleClick() { },
  205 + _openLineChart(chartRow) {
  206 + this.lineChart.title = `${chartRow.studentName}-${chartRow.subjectName}-多课时作答表现图`;
  207 + this.lineChart.visible = true;
  208 + let score = [];
  209 + let classRank = [];
  210 + let avgScore = [];
  211 + const examList = chartRow.examList.slice(1, chartRow.examList.length);
  212 + this.lineChart.xAxis = examList.map((item) => {
  213 + score.push(item.score);
  214 + classRank.push(item.classRank);
  215 + avgScore.push(item.avgScore);
  216 + return item.title;
  217 + });
  218 + this.lineChart.data = [
  219 + {
  220 + name: "班级排名",
  221 + value: classRank,
  222 + },
  223 + {
  224 + name: "班平均分",
  225 + value: avgScore,
  226 + },
  227 + {
  228 + name: "个人成绩",
  229 + value: score,
  230 + },
  231 + ];
  232 + },
  233 + }
  234 +};
  235 +</script>
  236 +<style scoped lang="scss">
  237 +.opration-btn {
  238 + margin-right: 10px;
  239 +}
  240 +
  241 +.opration-select {
  242 + margin-left: 10px;
  243 +}
  244 +
  245 +.row-line {
  246 + width: calc(20% - 2px);
  247 + border: 1px solid #ebeef5;
  248 + background: #f5f7fa;
  249 + display: inline-block;
  250 + height: 40px;
  251 + line-height: 40px;
  252 +
  253 + .line-subfix {
  254 + margin-left: 10px;
  255 +
  256 + }
  257 +}
  258 +
  259 +.row-table {
  260 + margin-top: 20px;
  261 +}
  262 +
  263 +.chart-dia {
  264 + .chart-box {
  265 + width: 100%;
  266 + height: 300px;
  267 + }
  268 +
  269 + :deep(.el-dialog__body) {
  270 + padding: 0 0 20px 0;
  271 + }
  272 +}
  273 +</style>
... ...
src/views/basic/askTestQuestion/detail.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <back-box class="detailBack">
  5 + <template slot="title">
  6 + <span class="default-title">
  7 + {{ title }}
  8 + </span>
  9 + </template>
  10 + </back-box>
  11 + </el-header>
  12 + <div class="default-filter">
  13 + <el-row class="row-type">
  14 + <label>阶段报表类型</label>
  15 + <el-select @change="_changeType" v-if="dataType && currentType" class="opration-select"
  16 + v-model="currentType">
  17 + <el-option v-for="(item, index) in types" :lable="item.name" :key="index" :value="item.name" />
  18 + </el-select>
  19 + <div style="float: right;">
  20 + <el-button type="primary" @click="_export" class="opration-btn"
  21 + icon="el-icon-upload2">导出报表</el-button>
  22 + <el-button type="primary" @click="_print" class="opration-btn"
  23 + icon="el-icon-printer">打印报表</el-button>
  24 + </div>
  25 + </el-row>
  26 + </div>
  27 + <el-main>
  28 + <div style=" padding: 20px;" id="print-content">
  29 + <div v-if="dataType == '1' && currentType == '试题分析'">
  30 + <el-row class="row-subfix">
  31 + <div class="row-line">
  32 + <span class="line-subfix">班级:</span>
  33 + <span class="line-value">{{ detail.className }}</span>
  34 + </div>
  35 + <div class="row-line">
  36 + <span class="line-subfix">科目:</span>
  37 + <span class="line-value">{{ detail.subjectName }}</span>
  38 + </div>
  39 + <div class="row-line">
  40 + <span class="line-subfix">课时数:</span>
  41 + <span class="line-value">{{ ids.length }}</span>
  42 + </div>
  43 + <div class="row-line">
  44 + <span class="line-subfix">上课时间:</span>
  45 + <span class="line-value">{{ detail.startTime }}</span>
  46 + </div>
  47 + <div class="row-line">
  48 + <span class="line-subfix">下课时间:</span>
  49 + <span class="line-value">{{ detail.endTime }}</span>
  50 + </div>
  51 + </el-row>
  52 + <el-row class="row-subfix">
  53 + <div class="row-line">
  54 + <span class="line-subfix">班级人数:</span>
  55 + <span class="line-value">{{ detail.classPersonNum }}</span>
  56 + </div>
  57 + <div class="row-line">
  58 + <span class="line-subfix">签到人数:</span>
  59 + <span class="line-value">{{ detail.checkInCount }}</span>
  60 + </div>
  61 + <div class="row-line">
  62 + <span class="line-subfix">题目总数:</span>
  63 + <span class="line-value">{{ detail.questionNum }}</span>
  64 + </div>
  65 + <div class="row-line">
  66 + <span class="line-subfix">答题总数:</span>
  67 + <span class="line-value">{{ detail.totalAnswersNum }}</span>
  68 + </div>
  69 + <div class="row-line">
  70 + <span class="line-subfix">课时时长:</span>
  71 + <span class="line-value">{{ setDuration(detail.duration) }}</span>
  72 + </div>
  73 + </el-row>
  74 + <el-row class="row-subfix">
  75 + <div class="row-line">
  76 + <span class="line-subfix">答对总数:</span>
  77 + <span class="line-value">{{ detail.totalCorrectAnswersNum }}</span>
  78 + </div>
  79 + <div class="row-line">
  80 + <span class="line-subfix">总参与度:</span>
  81 + <span class="line-value">{{ detail.participationRate }}</span>
  82 + </div>
  83 + <div class="row-line">
  84 + <span class="line-subfix">班级正确率:</span>
  85 + <span class="line-value">{{ detail.classCorrectRate }}</span>
  86 + </div>
  87 + <div class="row-line">
  88 + <span class="line-subfix">已达正确率:</span>
  89 + <span class="line-value">{{ detail.answerCorrectRate }}</span>
  90 + </div>
  91 + <div class="row-line">
  92 + <span class="line-subfix">反馈时长:</span>
  93 + <span class="line-value">{{ setDuration(detail.consumingDuration) }}</span>
  94 + </div>
  95 + </el-row>
  96 + <el-row class="row-table">
  97 + <el-table class="default-table" :data="askItemAnalysis">
  98 + <el-table-column prop="title" label="课时-题号" />
  99 + <el-table-column label="题干" width="120">
  100 + <template slot-scope="scoped">
  101 + <el-button type="text" size="mini" @click="openStem(scoped.row)">查看</el-button>
  102 + </template>
  103 + </el-table-column>
  104 + <el-table-column prop="questionType" label="题型" width="100">
  105 + <template slot-scope="scoped">{{ setSubPro(scoped.row.questionType) }}</template>
  106 + </el-table-column>
  107 + <el-table-column prop="answeredNum" label="答题人数" width="100" />
  108 + <el-table-column prop="correctAnswerNum" label="答对人数" width="100" />
  109 + <el-table-column prop="participationRate" label="班级参与度(单题)" width="150">
  110 + <template slot-scope="scoped">{{ scoped.row.participationRate }}%</template>
  111 + </el-table-column>
  112 + <el-table-column prop="classCorrectRate" label="班级正确率(单题)" width="150">
  113 + <template slot-scope="scoped">{{ scoped.row.classCorrectRate }}%</template>
  114 + </el-table-column>
  115 +
  116 + <el-table-column prop="answerCorrectRate" label="已答正确率(单题)" width="150">
  117 + <template slot-scope="scoped">{{ scoped.row.answerCorrectRate }}%</template>
  118 + </el-table-column>
  119 +
  120 + <el-table-column prop="knowledge" label="知识点(单题)" width="150" />
  121 + <el-table-column prop="correctAnswer" label="正确答案(单题)" width="150">
  122 + <template slot-scope="scoped">
  123 + {{
  124 + scoped.row.correctAnswer == 1 ? "✓" :
  125 + scoped.row.correctAnswer == 2 ? "✗" :
  126 + scoped.row.correctAnswer
  127 + }}
  128 + </template>
  129 + </el-table-column>
  130 + <el-table-column prop="fallible" label="干扰选项(单题)" width="150">
  131 + <template slot-scope="scoped">
  132 + {{
  133 + scoped.row.fallible == 1 ? "✓" :
  134 + scoped.row.fallible == 2 ? "✗" :
  135 + scoped.row.fallible
  136 + }}
  137 + </template>
  138 + </el-table-column>
  139 + </el-table>
  140 + </el-row>
  141 + </div>
  142 + <div v-if="dataType == '1' && currentType == '学生作答表现'">
  143 + <el-row class="row-table" style="margin-top:0px;">
  144 + <el-table class="default-table" :data="askPeriodQuestionItems">
  145 + <el-table-column prop="answerTimes" label="答题次数"></el-table-column>
  146 + <el-table-column prop="consumingDuration" label="答题耗时"><template slot-scope="scoped">{{
  147 + setDuration(scoped.row.consumingDuration)
  148 + }}
  149 + </template></el-table-column>
  150 + <el-table-column prop="correctAnswerTimes" label="答对次数">
  151 + <template slot-scope="scoped">{{
  152 + scoped.row.correctAnswerTimes ||
  153 + Number(scoped.row.correctAnswerTimes) === 0
  154 + ? scoped.row.correctAnswerTimes
  155 + : "-"
  156 + }}</template>
  157 + </el-table-column>
  158 + <el-table-column prop="participationRate" label="参与度"><template slot-scope="scoped">{{
  159 + scoped.row.participationRate ||
  160 + Number(scoped.row.participationRate) === 0
  161 + ? scoped.row.participationRate + "%"
  162 + : "-"
  163 + }}</template></el-table-column>
  164 + <el-table-column prop="correctRate" label="正确率"><template slot-scope="scoped">{{
  165 + scoped.row.correctRate || Number(scoped.row.correctRate) === 0
  166 + ? scoped.row.correctRate + "%"
  167 + : "-"
  168 + }}</template></el-table-column>
  169 + <el-table-column prop="answerCorrectRate" label="已答正确率"><template slot-scope="scoped">{{
  170 + scoped.row.answerCorrectRate ||
  171 + Number(scoped.row.answerCorrectRate) === 0
  172 + ? scoped.row.answerCorrectRate + "%"
  173 + : "-"
  174 + }}</template></el-table-column>
  175 + <el-table-column v-for="(item, index) in askPeriodQuestionItemOptions" :key="index"
  176 + :label="'Q' + (index + 1)"><template slot-scope="scoped">
  177 + <span :class="scoped.row['isRight' + index] ? '' : 'red'">{{
  178 + scoped.row["answer" + index] || "-"
  179 + }}</span>
  180 + </template>
  181 + </el-table-column>
  182 + </el-table>
  183 + </el-row>
  184 + </div>
  185 + <div v-if="dataType == '1' && currentType == '学生互动表现'">
  186 + <el-row class="row-table" style="margin-top:0px;">
  187 + <el-table class="default-table" :data="askInteractives">
  188 + <el-table-column prop="studentCode" label="学号"></el-table-column>
  189 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  190 + <el-table-column prop="interactionsNum" label="参与得分"></el-table-column>
  191 + <el-table-column prop="interactionsCorrectNum" label="对错得分"></el-table-column>
  192 + <el-table-column prop="rushAnswerTimes" label="抢答成功次数"></el-table-column>
  193 + <el-table-column prop="rushAnswerCorrectTimes" label="抢答答对次数"></el-table-column>
  194 + <el-table-column prop="checkAnswerTimes" label="被抽答次数"></el-table-column>
  195 + <el-table-column prop="checkAnswerCorrectTimes" label="被抽答答对次数"></el-table-column>
  196 + </el-table>
  197 + </el-row>
  198 + </div>
  199 + <div v-if="dataType == '1' && currentType == '学生签到表现'">
  200 + <el-row class="row-subfix">
  201 + <div class="row-line">
  202 + <span class="line-subfix">应到人数:</span>
  203 + <span class="line-value">{{ detail.classPersonNum }}</span>
  204 + </div>
  205 + <div class="row-line">
  206 + <span class="line-subfix">实到人数:</span>
  207 + <span class="line-value">{{ detail.checkInCount }}</span>
  208 + </div>
  209 + <div class="row-line">
  210 + <span class="line-subfix">迟到人数:</span>
  211 + <span class="line-value">{{ detail.classPersonNum - detail.checkInCount }}</span>
  212 + </div>
  213 + <div class="row-line">
  214 + <span class="line-subfix">未到人数:</span>
  215 + <span class="line-value">{{ detail.classPersonNum - detail.checkInCount }}</span>
  216 + </div>
  217 + </el-row>
  218 + <el-row class="row-table" style="margin-top:20px;">
  219 + <el-table class="default-table" :data="askCheckinStatus">
  220 + <el-table-column prop="studentCode" label="学号"></el-table-column>
  221 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  222 + <el-table-column prop="checkInTime" label="签到时间"></el-table-column>
  223 + <el-table-column prop="makeUpTime" label="补签时间"></el-table-column>
  224 + <el-table-column prop="rushAnswerTimes" label="是否迟到"></el-table-column>
  225 + </el-table>
  226 + </el-row>
  227 + </div>
  228 + <div v-if="dataType == '2' && currentType == '测验成绩单'">
  229 + <el-row class="row-subfix" :key="index" v-for="(item, index) in titleInfo">
  230 + <div class="row-line">
  231 + <span class="line-subfix">班级:</span>
  232 + <span class="line-value">{{ item.className }}</span>
  233 + </div>
  234 + <div class="row-line">
  235 + <span class="line-subfix">试卷名称:</span>
  236 + <span class="line-value">{{ item.paperName }}</span>
  237 + </div>
  238 + <div class="row-line">
  239 + <span class="line-subfix">测验时间:</span>
  240 + <span class="line-value">{{ item.testTime }}</span>
  241 + </div>
  242 + </el-row>
  243 + <el-row class="row-subfix">
  244 + <el-table class="default-table" style="margin-top: 10px" :data="titleInfo">
  245 + <el-table-column prop="testCount" label="测验人数" width="120" />
  246 + <el-table-column prop="avg" label="平均分" width="120" />
  247 + <el-table-column prop="hight" label="最高分" width="120" />
  248 + <el-table-column prop="low" label="最低分" width="120" />
  249 + <el-table-column prop="title" label="缺考名单">
  250 + <template slot-scope="scoped">
  251 + {{ scoped.row.miss.join("/") }}
  252 + </template>
  253 + </el-table-column>
  254 + </el-table>
  255 + </el-row>
  256 + <el-row class="row-subfix">
  257 + <el-table class="default-table" style="margin-top: 10px" :data="studentList">
  258 + <el-table-column :width="item.label == '学号' ? 120 : 0" :prop="item.prop" :label="item.label"
  259 + :key="index" v-for="(item, index) in studentHeader" />
  260 + </el-table>
  261 + </el-row>
  262 + <el-row class="row-subfix">
  263 + <el-table class="default-table" style="margin-top: 10px" :data="questionList">
  264 + <el-table-column :width="item.label == '题号&答案' ? 80 : 0" :prop="item.prop"
  265 + :label="item.label" :key="index" v-for="(item, index) in questionHeaders" />
  266 + </el-table>
  267 + </el-row>
  268 + <el-row class="row-subfix" v-if="questionOtherList && questionOtherList.length >= 1">
  269 + <el-table class="default-table" style="margin-top: 10px" :data="questionOtherList">
  270 + <el-table-column :prop="item.prop" :label="item.label" :key="index"
  271 + v-for="(item, index) in questionOtherHeaders" />
  272 + </el-table>
  273 + </el-row>
  274 + <el-row class="row-subfix">
  275 + <el-table class="default-table" style="margin-top: 10px" :data="questionTotal">
  276 + <el-table-column prop="quesion" label="题号" width="120" />
  277 + <el-table-column prop="anwser" label="答案" width="120" />
  278 + <el-table-column prop="student" label="答错学生">
  279 + <template slot-scope="scoped">
  280 + <span>总计 <span style="color:red;">
  281 + {{ scoped.row.details.filter(item => !item.isRight).length }}</span> 人
  282 + </span>
  283 + <span style="margin: 10px 0;"
  284 + v-for="(item, index) in scoped.row.details.filter(item => !item.isRight)">
  285 + 选{{ item.option }}:{{ item.students.join("/") }}
  286 + </span>
  287 + <span></span>
  288 + </template>
  289 + </el-table-column>
  290 + </el-table>
  291 + </el-row>
  292 + </div>
  293 + <div v-if="dataType == '2' && currentType == '试题分析'">
  294 + <el-table class="default-table" :data="testQuestions">
  295 + <el-table-column prop="questionIndex" label="题号" width="60"></el-table-column>
  296 + <el-table-column prop="questionType" label="题型" width="100">
  297 + <template slot-scope="scope">
  298 + {{ setSubPro(scope.row.questionType) }}
  299 + </template>
  300 + </el-table-column>
  301 + <el-table-column prop="score" width="100" label="知识点"></el-table-column>
  302 + <el-table-column prop="score" width="100" label="满分值"></el-table-column>
  303 + <el-table-column width="110" prop="highestScore" label="班最高分"></el-table-column>
  304 + <el-table-column width="110" prop="lowestScore" label="班最低分"></el-table-column>
  305 + <el-table-column width="110" prop="avgScore" label="班平均分"></el-table-column>
  306 + <el-table-column prop="classScoringRate" width="120" label="班级得分率"><template
  307 + slot-scope="scoped">{{ scoped.row.classScoringRate
  308 + }}%</template></el-table-column>
  309 + <el-table-column prop="correctAnswer" label="答案"><template slot-scope="scoped">{{
  310 + scoped.row.correctAnswer == 1
  311 + ? "✓"
  312 + : scoped.row.correctAnswer == 2
  313 + ? "✗"
  314 + : scoped.row.correctAnswer
  315 + }}</template>
  316 + </el-table-column>
  317 + <el-table-column v-for="(item, index) in testQuestionOptions" :key="index" :label="item.title"
  318 + :prop="'count' + index" width="120"><template slot-scope="scope">
  319 + <p class="persent">
  320 + {{
  321 + scope.row.questionType == "5"
  322 + ? ""
  323 + : scope.row["option" + index]
  324 + ? `${scope.row["option" + index]}(${scope.row["persent" + index]
  325 + })`
  326 + : ""
  327 + }}
  328 + </p>
  329 + </template>
  330 + </el-table-column>
  331 + </el-table>
  332 + </div>
  333 + <div v-if="dataType == '2' && currentType == '成绩排名'">
  334 + <el-table class="default-table" :data="testStudents">
  335 + <el-table-column prop="studentCode" label="学号" width="120"></el-table-column>
  336 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  337 + <el-table-column prop="examScore" label="总分"></el-table-column>
  338 + <el-table-column prop="scoringRate" label="得分率">
  339 + <template slot-scope="scope">
  340 + {{ scope.row.scoringRate }}%
  341 + </template>
  342 + </el-table-column>
  343 + <el-table-column prop="classRank" label="班名"></el-table-column>
  344 + <el-table-column label="客观题">
  345 + <el-table-column prop="objectiveExamScore" label="总分"></el-table-column>
  346 + <el-table-column prop="objectiveScoringRate" label="得分率">
  347 + <template slot-scope="scope">
  348 + {{ scope.row.objectiveScoringRate }}%
  349 + </template>
  350 + </el-table-column>
  351 + </el-table-column>
  352 + <el-table-column label="主观题">
  353 + <el-table-column prop="subjectiveExamScore" label="总分"></el-table-column>
  354 + <el-table-column prop="subjectiveScoringRate" label="得分率">
  355 + <template slot-scope="scope">
  356 + {{ scope.row.subjectiveScoringRate }}%
  357 + </template>
  358 + </el-table-column>
  359 + </el-table-column>
  360 + </el-table>
  361 + </div>
  362 + <div v-if="dataType == '2' && currentType == '小题分报表'">
  363 + <el-table class="default-table" :data="testStudents">
  364 + <el-table-column prop="studentCode" label="学号" width="120"></el-table-column>
  365 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  366 + <el-table-column prop="examScore" label="总分"></el-table-column>
  367 + <el-table-column label="分数组成">
  368 + <el-table-column prop="objectiveExamScore" label="客观题分"></el-table-column>
  369 + <el-table-column prop="subjectiveExamScore" label="主观题分"></el-table-column>
  370 + </el-table-column>
  371 + <el-table-column v-for="(item, index) in testStudentOptions" :key="index" :label="'Q' + item.id"
  372 + :prop="'score' + item.id">
  373 + </el-table-column>
  374 + </el-table>
  375 + </div>
  376 + <div v-if="dataType == '2' && currentType == '作答明细'">
  377 + <el-table class="default-table" :data="testStudents">
  378 + <el-table-column prop="studentCode" width="120" label="学号"></el-table-column>
  379 + <el-table-column prop="studentName" label="姓名"></el-table-column>
  380 + <el-table-column prop="className" label="班级"></el-table-column>
  381 + <el-table-column prop="examScore" label="总分"></el-table-column>
  382 + <el-table-column v-for="(item, index) in testStudentOptions" :key="index"
  383 + :label="'Q' + item.id">
  384 + <template slot-scope="scope">
  385 + <span v-if="testStudents[index]?.questionType == 5">*</span>
  386 + <span v-else-if="scope.row['answer' + item.id]"
  387 + :class="scope.row['isRight' + item.id] ? '' : 'error'">
  388 + {{ scope.row["answer" + item.id] }}
  389 + </span>
  390 + <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'">-</span>
  391 + </template>
  392 + </el-table-column>
  393 + </el-table>
  394 + </div>
  395 + <div v-if="dataType == '3' && currentType == '班级对比情况表'">
  396 + <el-table class="default-table" :data="classdiffExamReport">
  397 + <el-table-column prop="index" label="序号" width="120" />
  398 + <el-table-column prop="className" label="班级" width="120" />
  399 + <el-table-column label="测验人数/班级人数">
  400 + <template slot-scope="scoped">
  401 + {{ scoped.row.testCount }} / {{ scoped.row.classCount }}
  402 + </template>
  403 + </el-table-column>
  404 + <el-table-column prop="title" label="参与度" width="120">
  405 + <template slot-scope="scoped">
  406 + {{ scoped.row.testCount / scoped.row.classCount }}
  407 + </template>
  408 + </el-table-column>
  409 + <el-table-column prop="avg" label="班平均分" width="120" />
  410 + <el-table-column prop="hight" label="班最高分" width="120" />
  411 + <el-table-column prop="low" label="班最低分" width="120" />
  412 + <el-table-column prop="front20" label="前20名均分" width="120" />
  413 + <el-table-column prop="last20" label="后20名均分" width="120" />
  414 + <el-table-column prop="excellenRate" label="优秀数(率)" width="120">
  415 + <template slot-scope="scoped">
  416 + {{ scoped.row.excellenRate }}%
  417 + </template>
  418 + </el-table-column>
  419 + <el-table-column prop="goodRate" label="良好数(率)" width="120">
  420 + <template slot-scope="scoped">
  421 + {{ scoped.row.goodRate }}%
  422 + </template>
  423 + </el-table-column>
  424 + <el-table-column prop="passRate" label="合格数(率)" width="120">
  425 + <template slot-scope="scoped">
  426 + {{ scoped.row.passRate }}%
  427 + </template>
  428 + </el-table-column>
  429 + <el-table-column prop="failedRate" label="不合格数(率)" width="120">
  430 + <template slot-scope="scoped">
  431 + {{ scoped.row.passRate }}%
  432 + </template>
  433 + </el-table-column>
  434 + </el-table>
  435 + </div>
  436 + <div v-if="dataType == '3' && currentType == '试题分析'">
  437 + <el-table class="default-table" :data="testPaperExamReport">
  438 + <el-table-column prop="questionIndex" label="题号" width="120" />
  439 + <el-table-column prop="questionType" label="题型" width="100">
  440 + <template slot-scope="scope">
  441 + {{ setSubPro(scope.row.questionType) }}
  442 + </template>
  443 + </el-table-column>
  444 + <el-table-column prop="score" label="知识点" />
  445 + <el-table-column prop="score" label="满分值" width="120" />
  446 + <el-table-column prop="avgScore" label="年级平均分" width="120" />
  447 + <el-table-column prop="gradeScoringRate" label="年级得分率" width="120" />
  448 + <el-table-column prop="correctAnswer" label="答案" width="120" />
  449 + <el-table-column v-for="(item, index) in testPaperExamReportOptions" :key="index"
  450 + :label="item.title" :prop="'count' + index" width="120">
  451 + <template slot-scope="scope">
  452 + <p class="persent">
  453 + {{
  454 + scope.row.questionType == "5"
  455 + ? ""
  456 + : scope.row["option" + index]
  457 + ? `${scope.row["option" + index]}(${scope.row["persent" + index] ?? "0"
  458 + })`
  459 + : ""
  460 + }}
  461 + </p>
  462 + </template>
  463 + </el-table-column>
  464 + </el-table>
  465 + </div>
  466 + <div v-if="dataType == '3' && currentType == '学生成绩排名榜'">
  467 + <el-table class="default-table" :data="testStudentExamReport">
  468 + <el-table-column prop="gradeRank" label="年级排行" />
  469 + <el-table-column prop="code" label="学号" />
  470 + <el-table-column prop="name" label="姓名" />
  471 + <el-table-column prop="className" label="班级" />
  472 + <el-table-column prop="exam" label="分数" />
  473 + <el-table-column prop="title" label="成绩等级" />
  474 + </el-table>
  475 + </div>
  476 + </div>
  477 + </el-main>
  478 + <el-dialog class="stem" :visible.sync="stem.visible" :title="'题干'" width="800" :append-to-body="true">
  479 + <iframe v-if="stem&&stem.src" :src="stem.src" style="width: 100%;min-height: 400px;" />
  480 + </el-dialog>
  481 + </el-container>
  482 +</template>
  483 +<script>
  484 +import { formatDate, downloadFile, tablePrint } from "utils";
  485 +export default {
  486 + name: "reportDetail",
  487 + async created() {
  488 + this.role =
  489 +
  490 + this.$store.getters.info.showRole ||
  491 +
  492 + this.$store.getters.info.permissions[0].role;
  493 +
  494 + this.dataType = this.$route.query.dataType || "";
  495 +
  496 + this.classIds = (this.$route.query.classIds || "").split(',');
  497 +
  498 + this.subjects = (this.$route.query.subjects || "").split(',');
  499 +
  500 + this.ids = [this.$route.query.id];
  501 +
  502 + this.title = this.$route.query.title;
  503 +
  504 + this.types = this.types.filter(fl => { return fl.dataType == this.dataType });
  505 +
  506 + this.currentType = this.types[0]?.name ?? ""
  507 +
  508 + await this._changeType();
  509 + },
  510 + data() {
  511 + return {
  512 + titleInfo: [],
  513 + studentList: [],
  514 + studentHeader: [],
  515 + studentMapping: [
  516 + {
  517 + key: "code",
  518 + label: "学号",
  519 + },
  520 + {
  521 + key: "name",
  522 + label: "姓名",
  523 + },
  524 + {
  525 + key: "gradeRank",
  526 + label: "排名",
  527 + },
  528 + {
  529 + key: "exam",
  530 + label: "总分",
  531 + },
  532 + {
  533 + key: "objective",
  534 + label: "客观分",
  535 + },
  536 + {
  537 + key: "subjective",
  538 + label: "主观分",
  539 + },
  540 + ],
  541 + questionList: [],
  542 + questionHeaders: [],
  543 + questionOtherList: [],
  544 + questionOtherHeaders: [],
  545 + questionTotal: [],
  546 + dataType: null,
  547 + classIds: [],
  548 + subjects: [],
  549 + ids: [],
  550 + // 试题分析对象
  551 + askItemAnalysis: [],
  552 + // 作答情况对象
  553 + askPeriodQuestionItems: [],
  554 + // 作答情况选项对象
  555 + askPeriodQuestionItemOptions: [],
  556 + // 学生互动问答对象
  557 + askInteractives: [],
  558 + // 学生签到情况
  559 + askCheckinStatus: [],
  560 + // 报表详情
  561 + testReport: {
  562 + subjectiveScore: 0,
  563 + subjectiveHighestScore: "",
  564 + subjectiveLowestScore: "",
  565 + subjectiveAvgScore: "",
  566 + subjectiveClassScoringRate: "",
  567 + objectiveScore: "",
  568 + objectiveHighestScore: "",
  569 + objectiveLowestScore: "",
  570 + objectiveAvgScore: "",
  571 + objectiveClassScoringRate: "",
  572 + examPaperScore: "",
  573 + highestScore: "",
  574 + lowestScore: "",
  575 + avgScore: "",
  576 + classScoringRate: "",
  577 + },
  578 + // 报表学生详情
  579 + testStudents: [],
  580 + // 报表学生选项
  581 + testStudentOptions: [],
  582 + // 报表题目详情
  583 + testQuestions: [],
  584 + // 报表题目选项
  585 + testQuestionOptions: [],
  586 + setSubPro(type) {
  587 + let tit;
  588 + switch (type) {
  589 + case 2:
  590 + tit = "单选题";
  591 + break;
  592 + case 3:
  593 + tit = "多选题";
  594 + break;
  595 + case 4:
  596 + tit = "判断题";
  597 + break;
  598 + case 5:
  599 + tit = "主观题";
  600 + break;
  601 + default:
  602 + tit = "其他";
  603 + }
  604 + return tit;
  605 + },
  606 + setDuration(times) {
  607 + let m = parseInt(times / 1000 / 60);
  608 + let s = parseInt((times / 1000) % 60);
  609 + let ms = times;
  610 + let aTime;
  611 + if (times == 0) {
  612 + aTime = `0`;
  613 + } else {
  614 + if (m == 0 && s == 0) {
  615 + aTime = `${ms}毫秒`;
  616 + } else if (m == 0 && s != 0) {
  617 + aTime = `${s}秒`;
  618 + } else if (m != 0 && s != 0) {
  619 + aTime = `${m}分${s}秒`;
  620 + }
  621 + }
  622 + return aTime;
  623 + },
  624 + title: "",
  625 + types: [{
  626 + dataType: "3",
  627 + name: "班级对比情况表"
  628 + }, {
  629 + dataType: "3",
  630 + name: "试题分析"
  631 + }, {
  632 + dataType: "3",
  633 + name: "学生成绩排名榜"
  634 + }, {
  635 + dataType: "2",
  636 + name: "测验成绩单"
  637 + }, {
  638 + dataType: "2",
  639 + name: "试题分析"
  640 + }, {
  641 + dataType: "2",
  642 + name: "成绩排名"
  643 + }, {
  644 + dataType: "2",
  645 + name: "小题分报表"
  646 + }, {
  647 + dataType: "2",
  648 + name: "作答明细"
  649 + }, {
  650 + dataType: "1",
  651 + name: "试题分析"
  652 + }, {
  653 + dataType: "1",
  654 + name: "学生作答表现"
  655 + }, {
  656 + dataType: "1",
  657 + name: "学生互动表现"
  658 + }, {
  659 + dataType: "1",
  660 + name: "学生签到表现"
  661 + }],
  662 + detail: {},
  663 + currentType: null,
  664 + classdiffExamReport: [],
  665 + testPaperExamReport: [],
  666 + testStudentExamReport: [],
  667 + testPaperExamReportOptions: [],
  668 + //题干数据对象
  669 + stem: {
  670 + visible: false,
  671 + src: null
  672 + }
  673 + }
  674 + },
  675 + methods: {
  676 + async _export() {
  677 + if (this.dataType == "1") {
  678 +
  679 + let exportPeriodReport = "";
  680 +
  681 + var query = {};
  682 + query.periodId = this.ids[0];
  683 +
  684 + exportPeriodReport =
  685 + this.role == "ROLE_PERSONAL"
  686 + ? this.$request.pExportPeriodReport
  687 + : this.$request.exportPeriodReport;
  688 +
  689 + const data = await exportPeriodReport({
  690 + ...query,
  691 + });
  692 +
  693 + if (data) {
  694 + let blob = new Blob([data], {
  695 + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  696 + });
  697 + let name = `随堂问-单课时报表.xlsx`
  698 + downloadFile(this.status ? "随堂问-已归档单课时报表.xlsx" : name, blob);
  699 + } else {
  700 + this.$message.error("下载失败");
  701 + }
  702 + }
  703 + else if (this.dataType == "2") {
  704 +
  705 + const exportExamReport =
  706 + this.role == "ROLE_PERSONAL"
  707 + ? this.$request.pExportExamReport
  708 + : this.$request.exportExamReport;
  709 +
  710 + const data = await exportExamReport({
  711 + examId: this.ids[0]
  712 + });
  713 +
  714 + this.exportLoading = false;
  715 +
  716 + if (!data.status) {
  717 + let blob = new Blob([data], {
  718 + type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",
  719 + });
  720 + downloadFile(
  721 + this.status
  722 + ? "即时测-已归档单卷测练报表.xlsx"
  723 + : "即时测-单卷测练报表.xlsx",
  724 + blob
  725 + );
  726 + } else {
  727 + this.$message.error(data.info);
  728 + }
  729 + }
  730 +
  731 + },
  732 + _print() {
  733 + tablePrint("print-content", this.title + "_" + this.currentType);
  734 + },
  735 + async _changeType() {
  736 + if (this.dataType == "1") {
  737 + if (this.currentType == "试题分析") {
  738 + await this._loadAskItemAnalysis();
  739 + }
  740 + else if (this.currentType == "学生作答表现") {
  741 + await this._loadAskAnwserItems();
  742 + }
  743 + else if (this.currentType == "学生互动表现") {
  744 + await this._loadAskInteractives();
  745 + }
  746 + else if (this.currentType == "学生签到表现") {
  747 + await this._loadAskCheckinStatus();
  748 + }
  749 + }
  750 + else if (this.dataType == "2") {
  751 + if (this.currentType == "测验成绩单") {
  752 + await this._testExamReport();
  753 + }
  754 + else if (this.currentType == "试题分析") {
  755 + await this._loadTestQuestionReport();
  756 + }
  757 + else if (this.currentType == "成绩排名") {
  758 + await this._loadTestStudentReport();
  759 + }
  760 + else if (this.currentType == "小题分报表") {
  761 + await this._loadTestStudentReport();
  762 + }
  763 + else if (this.currentType == "作答明细") {
  764 + await this._loadTestStudentReport();
  765 + }
  766 + }
  767 + else if (this.dataType == "3") {
  768 +
  769 + if (this.currentType == "班级对比情况表") {
  770 + await this._classdiffExamReport();
  771 + }
  772 + else if (this.currentType == "试题分析") {
  773 + await this._testPaperExamReport();
  774 + }
  775 + else if (this.currentType == "学生成绩排名榜") {
  776 + await this._testStudentExamReport();
  777 + }
  778 + }
  779 + },
  780 + async _testPaperExamReport() {
  781 + const request = this.$request.tPaperExamReport;
  782 +
  783 + let response = await request({
  784 + paperId: this.ids[0],
  785 + classIds: this.classIds,
  786 + });
  787 +
  788 + if (response.status != 0) {
  789 + this.$message.error(response.info);
  790 + return;
  791 + }
  792 +
  793 + let optionsList = [{}, {}, {}, {}, {}];
  794 +
  795 + let tableData = response.data?.map((item) => {
  796 + let params = {};
  797 +
  798 + const detail = item?.details ?? [];
  799 +
  800 + let lastOPtion = detail?.find((item) => {
  801 + return item.option == "未答";
  802 + });
  803 + let defaultArr = detail?.filter((item) => {
  804 + return item.option != "未答";
  805 + });
  806 + optionsList.map((items, index) => {
  807 + if (index != 4) {
  808 + params["count" + index] =
  809 + defaultArr[index]?.option != "未答"
  810 + ? defaultArr[index]?.count
  811 + : "";
  812 + params["persent" + index] =
  813 + defaultArr[index]?.option != "未答"
  814 + ? defaultArr[index]?.persent
  815 + : "";
  816 + params["option" + index] =
  817 + defaultArr[index]?.option != "未答"
  818 + ? defaultArr[index]?.option == 1
  819 + ? "✓"
  820 + : defaultArr[index]?.option == 2
  821 + ? "✗"
  822 + : defaultArr[index]?.option
  823 + : "";
  824 + items["title"] = "选项" + (index + 1);
  825 + } else {
  826 + items["title"] = "未答";
  827 + params["count" + index] = lastOPtion?.count ?? "";
  828 + params["persent" + index] = lastOPtion?.persent ?? "";
  829 + params["option" + index] = "?";
  830 + }
  831 + });
  832 +
  833 + return {
  834 + ...item,
  835 + ...params,
  836 + };
  837 + });
  838 +
  839 + this.testPaperExamReport = tableData?.sort((a, b) => {
  840 + return a.questionIndex - b.questionIndex;
  841 + });
  842 +
  843 + this.testPaperExamReportOptions = [...optionsList];
  844 +
  845 + },
  846 + async _testStudentExamReport() {
  847 + const request = this.$request.tgStudentExamReport;
  848 +
  849 + let response = await request({
  850 + paperId: this.ids[0],
  851 + classIds: this.classIds,
  852 + });
  853 +
  854 + if (response.status != 0) {
  855 + this.$message.error(response.info);
  856 + return;
  857 + }
  858 +
  859 + this.testStudentExamReport = response.data;
  860 + },
  861 + async _classdiffExamReport() {
  862 +
  863 + const classDiffRequest = this.$request.tClassdiffExamReport;
  864 +
  865 + let classDiffResponse = await classDiffRequest({
  866 + paperId: this.ids[0],
  867 + classIds: this.classIds,
  868 + });
  869 +
  870 + if (classDiffResponse.status != 0) {
  871 + this.$message.error(classDiffResponse.info);
  872 + return;
  873 + }
  874 + var index = 0;
  875 +
  876 + this.classdiffExamReport = classDiffResponse.data.map((item) => {
  877 + item.index = index + 1;
  878 + index += 1;
  879 + return item;
  880 + });
  881 + },
  882 + openStem(stemRow) {
  883 + this.stem.src = stemRow.screenshot ?? "";
  884 + this.stem.visible = true;
  885 + },
  886 + async _testExamReport() {
  887 +
  888 + this.questionTotal = [];
  889 +
  890 + const request = this.$request.tTestExamReport;
  891 +
  892 + let response = await request({
  893 + paperId: this.ids[0],
  894 + classIds: this.classIds,
  895 + });
  896 +
  897 + if (response.status != 0) {
  898 + this.$message.error(response.info);
  899 + return;
  900 + }
  901 +
  902 + this.titleInfo = response.data.titleInfos;
  903 +
  904 + var studentHeaders = [];
  905 +
  906 + var studentResults = [];
  907 +
  908 + for (var iheader = 0; iheader < 3; iheader++) {
  909 + for (
  910 + var imapping = 0;
  911 + imapping < this.studentMapping.length;
  912 + imapping++
  913 + ) {
  914 + studentHeaders.push({
  915 + prop: this.studentMapping[imapping].key + "_" + iheader,
  916 + label: this.studentMapping[imapping].label,
  917 + key: this.studentMapping[imapping].key,
  918 + });
  919 + }
  920 + }
  921 +
  922 + this.studentHeader = [...studentHeaders];
  923 +
  924 + for (var isp = 0; isp < response.data.gradeExamStudentReports.length; isp++) {
  925 +
  926 + var item = {};
  927 +
  928 + for (
  929 + var iamapping = 0;
  930 + iamapping < studentHeaders.length;
  931 + iamapping++
  932 + ) {
  933 + var currentData = response.data.gradeExamStudentReports[isp];
  934 +
  935 + if (!currentData) continue;
  936 +
  937 + var currentHeader = studentHeaders[iamapping];
  938 +
  939 + item[currentHeader.prop] = currentData[currentHeader.key];
  940 +
  941 + if (
  942 + iamapping >= this.studentMapping.length - 1 &&
  943 + iamapping % this.studentMapping.length == 0
  944 + ) {
  945 + isp += 1;
  946 + }
  947 + }
  948 +
  949 + studentResults.push(item);
  950 + }
  951 +
  952 + this.studentList = [...studentResults];
  953 +
  954 + var otherDatas = [];
  955 +
  956 + var questionHeaders = [];
  957 +
  958 + var questionResults = [];
  959 +
  960 + var questionOtherHeaders = [];
  961 +
  962 + var questionOtherResults = [];
  963 +
  964 + var defaultQuestion = 6;
  965 +
  966 + var defaultCount = 3;
  967 +
  968 + var defaultQuestionCount = 4;
  969 +
  970 + var maxQuestionCount = 4;
  971 +
  972 + var optionSt = 1;
  973 +
  974 + for (var qheader = 0; qheader < defaultQuestion * defaultCount; qheader++) {
  975 + if (qheader == 0 || qheader % 6 == 0) {
  976 + questionHeaders.push({
  977 + prop: "column_" + qheader,
  978 + label: "题号&答案",
  979 + });
  980 + continue;
  981 + } else if (qheader == 1 || (qheader - 1) % 6 == 0) {
  982 + questionHeaders.push({
  983 + prop: "column_" + qheader,
  984 + label: "得分率",
  985 + });
  986 + optionSt = 1;
  987 + continue;
  988 + } else {
  989 + questionHeaders.push({
  990 + prop: "column_" + qheader,
  991 + label: "选项" + optionSt,
  992 + });
  993 + optionSt += 1;
  994 + }
  995 + }
  996 +
  997 + var noPassIndex = 0;
  998 +
  999 + this.questionHeaders = questionHeaders;
  1000 +
  1001 + var itema = null;
  1002 +
  1003 + response.data.questionInfos = [...response.data.questionInfos]
  1004 +
  1005 + for (var qIndex = 0; qIndex < response.data.questionInfos.length; qIndex++) {
  1006 +
  1007 + var currentData = response.data.questionInfos[qIndex];
  1008 +
  1009 + var filterDetail = currentData.details.filter(fl => fl.option != '未答');
  1010 +
  1011 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  1012 +
  1013 + this.questionTotal.push({
  1014 + quesion: "Q" + (qIndex + 1),
  1015 + anwser: correctAnswerValue ?? "-----",
  1016 + details: currentData.details
  1017 + })
  1018 +
  1019 + if (filterDetail.length > defaultQuestionCount || filterDetail.length > maxQuestionCount) {
  1020 + currentData.index = qIndex;
  1021 + otherDatas.push(currentData);
  1022 + if (filterDetail.length > maxQuestionCount) {
  1023 + maxQuestionCount = filterDetail.length;
  1024 + }
  1025 + continue;
  1026 + }
  1027 + else {
  1028 + if (noPassIndex > defaultCount) {
  1029 + questionResults.push(itema)
  1030 + itema = null;
  1031 + noPassIndex = 0;
  1032 + }
  1033 + var stPass = noPassIndex * defaultQuestion;
  1034 + if (!itema) itema = {}
  1035 +
  1036 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  1037 +
  1038 + itema["column_" + (stPass)] = (qIndex + 1) + "" + correctAnswerValue;
  1039 + itema["column_" + (stPass + 1)] = (currentData.gradeScoringRate * 100) + "%";
  1040 +
  1041 + var value = "------";
  1042 +
  1043 + for (var iOption = 0; iOption < defaultQuestion - 2; iOption++) {
  1044 + var currentOption = filterDetail[iOption];
  1045 + if (currentOption) {
  1046 + var optionValue = currentOption.option == "1" ? "✓" : currentOption.option == 2 ? "✗" : currentOption.option;
  1047 +
  1048 + itema["column_" + (stPass + iOption + 2)] = optionValue + "(" + (currentOption.persent ?? "0%") + ")";
  1049 + }
  1050 + else {
  1051 + itema["column_" + (stPass + iOption + 2)] = value
  1052 + }
  1053 + }
  1054 +
  1055 + noPassIndex += 1
  1056 + }
  1057 +
  1058 + if (qIndex >= response.data.questionInfos.length - 1 && noPassIndex != 0) {
  1059 + questionResults.push(itema)
  1060 + itema = null;
  1061 + }
  1062 + }
  1063 +
  1064 + optionSt = 1;
  1065 +
  1066 + maxQuestionCount += 2;
  1067 +
  1068 + this.questionList = [...questionResults]
  1069 +
  1070 + var otherCount = parseInt(defaultQuestion * defaultCount / maxQuestionCount);
  1071 +
  1072 + itema = null;
  1073 +
  1074 + for (var qOHeader = 0; qOHeader < maxQuestionCount * otherCount; qOHeader++) {
  1075 + if (qOHeader == 0 || qOHeader % (maxQuestionCount) == 0) {
  1076 + questionOtherHeaders.push({
  1077 + prop: "column_" + qOHeader,
  1078 + label: "题号&答案",
  1079 + });
  1080 + continue;
  1081 + } else if (qOHeader == 1 || (qOHeader - 1) % (maxQuestionCount) == 0) {
  1082 + questionOtherHeaders.push({
  1083 + prop: "column_" + qOHeader,
  1084 + label: "得分率",
  1085 + });
  1086 + optionSt = 1;
  1087 + continue;
  1088 + } else {
  1089 + questionOtherHeaders.push({
  1090 + prop: "column_" + qOHeader,
  1091 + label: "选项" + optionSt,
  1092 + });
  1093 + optionSt += 1;
  1094 + }
  1095 + }
  1096 +
  1097 + this.questionOtherHeaders = questionOtherHeaders;
  1098 +
  1099 + noPassIndex = 0;
  1100 +
  1101 + for (var qOIndex = 0; qOIndex < otherDatas.length; qOIndex++) {
  1102 +
  1103 + var currentData = otherDatas[qOIndex];
  1104 +
  1105 + var filterDetail = currentData.details.filter(fl => fl.option != '未答');
  1106 +
  1107 + if (noPassIndex >= otherCount) {
  1108 + questionOtherResults.push(itema)
  1109 + itema = null;
  1110 + noPassIndex = 0;
  1111 + }
  1112 +
  1113 + var stPass = noPassIndex * maxQuestionCount;
  1114 +
  1115 + if (!itema) itema = {}
  1116 +
  1117 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  1118 +
  1119 + itema["column_" + (stPass)] = (Number(currentData.index) + 1) + "" + correctAnswerValue;
  1120 +
  1121 + itema["column_" + (stPass + 1)] = (currentData.gradeScoringRate * 100) + "%";
  1122 +
  1123 + var value = "------";
  1124 +
  1125 + for (var iOption = 0; iOption < maxQuestionCount - 2; iOption++) {
  1126 +
  1127 + var currentOption = filterDetail[iOption];
  1128 +
  1129 + if (currentOption) {
  1130 +
  1131 + var optionValue = currentOption.option == "1" ? "✓" : currentOption.option == 2 ? "✗" : currentOption.option;
  1132 +
  1133 + itema["column_" + (stPass + iOption + 2)] = optionValue + "(" + (currentOption.persent ?? "0%") + ")";
  1134 + }
  1135 + else {
  1136 + itema["column_" + (stPass + iOption + 2)] = value
  1137 + }
  1138 + }
  1139 +
  1140 + noPassIndex += 1
  1141 +
  1142 + if (qOIndex >= otherDatas.length - 1 && noPassIndex != 0) {
  1143 +
  1144 + questionOtherResults.push(itema)
  1145 + itema = null;
  1146 + }
  1147 + }
  1148 +
  1149 + this.questionOtherList = [...questionOtherResults]
  1150 +
  1151 + },
  1152 + async _loadAskInteractives() {
  1153 + const request =
  1154 + this.role == "ROLE_PERSONAL"
  1155 + ? this.$request.pPhaseInteractiveReport
  1156 + : this.$request.phaseInteractiveReport;
  1157 +
  1158 + let response = await request({
  1159 + periodIds: this.ids,
  1160 + classIds: this.classIds
  1161 + });
  1162 +
  1163 + if (response.status != 0) {
  1164 + this.$message.error(response.info);
  1165 + return;
  1166 + }
  1167 +
  1168 + this.askInteractives = response.data.list;
  1169 + },
  1170 + async _loadAskItemAnalysis() {
  1171 + const request =
  1172 + this.role == "ROLE_PERSONAL"
  1173 + ? this.$request.pPeriodDetail
  1174 + : this.$request.periodDetail;
  1175 +
  1176 + let response = await request({
  1177 + periodIds: this.ids
  1178 + });
  1179 +
  1180 + if (response.status != 0) {
  1181 + this.$message.error(response.info);
  1182 + return;
  1183 + }
  1184 +
  1185 + this.detail = response.data;
  1186 +
  1187 + this.detail.selectDate = formatDate(new Date(), "yyyy-MM-dd");
  1188 +
  1189 + const listRequest =
  1190 + this.role == "ROLE_PERSONAL"
  1191 + ? this.$request.pPeriodQuestionReport
  1192 + : this.$request.periodQuestionReport;
  1193 +
  1194 +
  1195 + let listResponse = await listRequest({
  1196 + periodIds: this.ids,
  1197 + classIds: this.classIds
  1198 + });
  1199 +
  1200 + if (listResponse.status != 0) {
  1201 + this.$message.error(listResponse.info);
  1202 + return;
  1203 + }
  1204 +
  1205 + this.askItemAnalysis = listResponse.data.list;
  1206 +
  1207 + },
  1208 + async _loadAskAnwserItems() {
  1209 + const request =
  1210 + this.role == "ROLE_PERSONAL"
  1211 + ? this.$request.pPeriodStudentReport
  1212 + : this.$request.periodStudentReport;
  1213 +
  1214 + let response = await request({
  1215 + periodId: this.ids[0],
  1216 + classId: this.classIds[0]
  1217 + });
  1218 +
  1219 + if (response.status != 0) {
  1220 + this.$message.error(response.info);
  1221 + return;
  1222 + }
  1223 +
  1224 + this.askPeriodQuestionItems = response.data.list.map((item) => {
  1225 + let params = {};
  1226 + const detail = item.detail ? JSON.parse(item.detail) : [];
  1227 + if (detail.length > this.askPeriodQuestionItemOptions.length) {
  1228 + this.askPeriodQuestionItemOptions = [...detail];
  1229 + }
  1230 + detail.map((items, index) => {
  1231 + params["isRight" + index] = items.isRight;
  1232 + params["answer" + index] =
  1233 + items.answer == 1
  1234 + ? "✓"
  1235 + : items.answer == 2
  1236 + ? "✗"
  1237 + : items.answer;
  1238 + });
  1239 + return {
  1240 + ...item,
  1241 + ...params
  1242 + };
  1243 + });
  1244 + },
  1245 + async _loadAskCheckinStatus() {
  1246 +
  1247 + const detailRequest =
  1248 + this.role == "ROLE_PERSONAL"
  1249 + ? this.$request.pPeriodDetail
  1250 + : this.$request.periodDetail;
  1251 +
  1252 + let detailResponse = await detailRequest({
  1253 + periodIds: this.ids
  1254 + });
  1255 +
  1256 + if (detailResponse.status != 0) {
  1257 + this.$message.error(response.info);
  1258 + return;
  1259 + }
  1260 +
  1261 + this.detail = detailResponse.data;
  1262 +
  1263 + const request =
  1264 + this.role == "ROLE_PERSONAL"
  1265 + ? this.$request.pPeriodStudentReport
  1266 + : this.$request.periodStudentReport;
  1267 +
  1268 + let response = await request({
  1269 + periodId: this.ids[0],
  1270 + classId: this.classIds[0],
  1271 + type: 3
  1272 + });
  1273 +
  1274 + if (response.status != 0) {
  1275 + this.$message.error(response.info);
  1276 + return;
  1277 + }
  1278 +
  1279 + this.askCheckinStatus = response.data.list;
  1280 +
  1281 + console.log(detailResponse, response)
  1282 +
  1283 + },
  1284 + async _loadTestDetail() {
  1285 + //详情
  1286 + const examDetail =
  1287 + this.role == "ROLE_PERSONAL"
  1288 + ? this.$request.pExamDetail
  1289 + : this.$request.examDetail;
  1290 +
  1291 + let { data, info, status } = await examDetail({
  1292 + examId: this.ids[0],
  1293 + });
  1294 +
  1295 + if (status != 0) {
  1296 + this.$message.error(info);
  1297 + return;
  1298 + }
  1299 +
  1300 + this.testReport = { ...data?.examReport };
  1301 + },
  1302 + async _loadTestStudentReport() {
  1303 +
  1304 + const examStudentReport =
  1305 + this.role == "ROLE_PERSONAL"
  1306 + ? this.$request.pExamStudentReport
  1307 + : this.$request.examStudentReport;
  1308 +
  1309 + let { data, info, status } = await examStudentReport({
  1310 + examId: this.ids[0],
  1311 + });
  1312 +
  1313 + if (status != 0) {
  1314 + this.$message.error(info);
  1315 + return;
  1316 + }
  1317 +
  1318 + let optionsList = [];
  1319 +
  1320 + this.testStudents = data?.list.map((item) => {
  1321 + let params = {};
  1322 + const detail = JSON.parse(item.detail);
  1323 + if (detail.length) {
  1324 + this.showSelect = false;
  1325 + }
  1326 + if (detail.length > optionsList.length) {
  1327 + optionsList = [...detail];
  1328 + }
  1329 + detail.map((items, index) => {
  1330 + params["que" + items.id] = items.id;
  1331 + params["score" + items.id] = String(items.score).includes(".")
  1332 + ? Number(items.score)
  1333 + : items.score;
  1334 + params["answer" + items.id] =
  1335 + items.answer == 1 ? "✓" : items.answer == 2 ? "✗" : items.answer;
  1336 + params["isRight" + items.id] = items.isRight;
  1337 + params["questionType" + items.id] = items.questionType;
  1338 + });
  1339 + return {
  1340 + ...item,
  1341 + ...params,
  1342 + };
  1343 + });
  1344 +
  1345 + this.testStudentOptions = optionsList.sort((a, b) => {
  1346 + return a.id - b.id;
  1347 + });
  1348 + },
  1349 + async _loadTestQuestionReport() {
  1350 + //试题分析
  1351 + this.loading = true;
  1352 + const examQuestionReport =
  1353 + this.role == "ROLE_PERSONAL"
  1354 + ? this.$request.pExamQuestionReport
  1355 + : this.$request.examQuestionReport;
  1356 +
  1357 + let { data, info, status } = await examQuestionReport({
  1358 + examId: this.ids[0],
  1359 + page: 1,
  1360 + size: 9999,
  1361 + });
  1362 +
  1363 + if (status != 0) {
  1364 + this.$message.error(info);
  1365 + return;
  1366 + }
  1367 +
  1368 + let optionsList = [{}, {}, {}, {}, {}];
  1369 +
  1370 + let tableData = data?.list?.map((item) => {
  1371 + let params = {};
  1372 + const detail = JSON.parse(item.detail);
  1373 + let lastOPtion = detail?.find((item) => {
  1374 + return item.option == "未答";
  1375 + });
  1376 + let defaultArr = detail?.filter((item) => {
  1377 + return item.option != "未答";
  1378 + });
  1379 +
  1380 + optionsList.map((items, index) => {
  1381 + if (index != 4) {
  1382 + params["count" + index] =
  1383 + defaultArr[index]?.option != "未答"
  1384 + ? defaultArr[index]?.count
  1385 + : "";
  1386 + params["persent" + index] =
  1387 + defaultArr[index]?.option != "未答"
  1388 + ? defaultArr[index]?.persent
  1389 + : "";
  1390 + params["option" + index] =
  1391 + defaultArr[index]?.option != "未答"
  1392 + ? defaultArr[index]?.option == 1
  1393 + ? "✓"
  1394 + : defaultArr[index]?.option == 2
  1395 + ? "✗"
  1396 + : defaultArr[index]?.option
  1397 + : "";
  1398 + items["title"] = "选项" + (index + 1);
  1399 + } else {
  1400 + items["title"] = "未答";
  1401 + params["count" + index] = lastOPtion.count;
  1402 + params["persent" + index] = lastOPtion.persent;
  1403 + params["option" + index] = "?";
  1404 + }
  1405 + });
  1406 + return {
  1407 + ...item,
  1408 + ...params,
  1409 + };
  1410 + });
  1411 +
  1412 + this.testQuestions = tableData?.sort((a, b) => {
  1413 + return a.questionIndex - b.questionIndex;
  1414 + });
  1415 +
  1416 + this.testQuestionOptions = [...optionsList];
  1417 + }
  1418 + }
  1419 +}
  1420 +</script>
  1421 +<style lang="scss">
  1422 +.opration-select {
  1423 + margin-left: 10px !important;
  1424 +}
  1425 +
  1426 +.row-line {
  1427 + overflow: hidden;
  1428 + width: calc(20% - 2px);
  1429 + border: 1px solid #ebeef5;
  1430 + background: #f5f7fa;
  1431 + display: inline-block;
  1432 + height: 40px;
  1433 + line-height: 40px;
  1434 +
  1435 + .line-subfix {
  1436 + margin-left: 10px;
  1437 +
  1438 + }
  1439 +}
  1440 +
  1441 +.row-table {
  1442 + margin-top: 20px;
  1443 +}
  1444 +
  1445 +.red {
  1446 + color: #f30;
  1447 +}
  1448 +</style>
0 1449 \ No newline at end of file
... ...
src/views/basic/askTestQuestion/gradeAnalysis.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <div class="default-title">即时测报表</div>
  5 + </el-header>
  6 + <div class="default-filter">
  7 + <el-input v-model="query.paper" placeholder="搜索试卷" suffix-icon="el-icon-search" class="filter-input"
  8 + type="number" clearable />
  9 + <el-select v-model="query.grade" class="filter-select" placeholder="选择年级">
  10 + <el-option v-for="item in classList" :key="item.grade" :label="item.gradeName" :value="item.grade" />
  11 + </el-select>
  12 + <el-select v-model="query.subject" placeholder="选择科目" class="filter-select">
  13 + <el-option v-for="item in subjectList" :key="item.subjectName" :label="item.subjectName"
  14 + :value="item.subjectName" />
  15 + </el-select>
  16 + <el-date-picker value-format="yyyy-MM-dd" class="filter-datePicker" v-model="query.dateRange"
  17 + type="daterange" range-separator="-">
  18 + </el-date-picker>
  19 + <el-button type="primary" @click="_serach">
  20 + 筛选
  21 + </el-button>
  22 + </div>
  23 + <el-main>
  24 + <div class="default-main">
  25 + <el-table :data="examList" class="default-table">
  26 + <el-table-column prop="subjectName" label="科目" width="200" />
  27 + <el-table-column prop="paperName" label="试卷名称" />
  28 + <el-table-column label="已考班级">
  29 + <template slot-scope="scope">
  30 + {{ scope.row?.classInfos?.map(item => item.className)?.join("/") }}
  31 + </template>
  32 + </el-table-column>
  33 + <el-table-column prop="score" label="卷面分" width="200" />
  34 + <el-table-column width="100" label="操作">
  35 + <template slot-scope="scope">
  36 + <el-button @click="_linkToDetail(scope.row)" type="text" size="small">查看</el-button>
  37 + </template>
  38 + </el-table-column>
  39 + </el-table>
  40 + </div>
  41 + </el-main>
  42 + </el-container>
  43 +</template>
  44 +<script>
  45 +export default {
  46 + data() {
  47 + return {
  48 + classList: [],
  49 + subjectList: [],
  50 + examList: [],
  51 + query: {
  52 + examName: "",
  53 + paper: null,
  54 + grade: null,
  55 + subject: null,
  56 + dateRange: [
  57 + "2021-03-01", "2025-05-01"
  58 + ]
  59 + },
  60 + }
  61 + },
  62 + async created() {
  63 + await this._loadQueryDatas();
  64 + await this._serach();
  65 + },
  66 + methods: {
  67 + async _serach() {
  68 + const examResponse = await this.$request.gExamListReport({
  69 + end: this.query.dateRange ? this.query.dateRange[1] : null,
  70 + examName: this.query.examName,
  71 + start: this.query.dateRange ? this.query.dateRange[0] : null,
  72 + grade: this.query.grade,
  73 + subjects: [this.query.subject],
  74 + })
  75 + if (examResponse.status != 0) {
  76 + this.$message.error(examResponse.info);
  77 + return;
  78 + }
  79 +
  80 + this.examList = examResponse.data;
  81 +
  82 + },
  83 + async _loadQueryDatas() {
  84 + this.$loading.open();
  85 + this.$loading.close();
  86 + const classReponse = await this.$request.gClass();
  87 + if (classReponse.status != 0) {
  88 + this.$loading.close();
  89 + this.$message.error(classReponse.info);
  90 + return;
  91 + }
  92 + this.classList = classReponse.data.list;
  93 + this.query.grade = this.classList[0]?.grade;
  94 + const subjectReponse = await this.$request.gSubjectList("?grade=" + this.query.grade + "&classType=0&status=0")
  95 + if (subjectReponse.status != 0) {
  96 + this.$loading.close();
  97 + this.$message.error(subjectReponse.info);
  98 + return;
  99 + }
  100 + this.subjectList = subjectReponse.data;
  101 + this.query.subject = this.subjectList[0]?.subjectName;
  102 + this.$loading.close();
  103 + },
  104 + _linkToDetail(currentRow) {
  105 +
  106 + if (!currentRow || !currentRow?.classInfos) {
  107 + this.$message.error('选择对象考试班级为空,请刷新列表');
  108 + return;
  109 + }
  110 +
  111 + var classListStr = JSON.stringify(currentRow.classInfos);
  112 +
  113 + var paperId = currentRow.paperId;
  114 +
  115 + var title = currentRow.paperName;
  116 +
  117 + let routerItem = {
  118 + path: "/testGradeReportDetail",
  119 + query: { classListStr: classListStr, paperId: paperId, title: title },
  120 + };
  121 +
  122 + this.$router.push(routerItem);
  123 + }
  124 + }
  125 +}
  126 +</script>
  127 +<style></style>
0 128 \ No newline at end of file
... ...
src/views/basic/askTestQuestion/gradeAnalysisDetail.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <back-box class="detailBack">
  5 + <template slot="title">
  6 + <span class="default-title">
  7 + {{ title }}
  8 + </span>
  9 + </template>
  10 + </back-box>
  11 + </el-header>
  12 + <div class="default-filter">
  13 + 已考班级:
  14 + <el-checkbox-group style="display: inline-block" v-model="checkedClassInfos" @change="_handleCheckedClassChange">
  15 + <el-checkbox class="_el-checkbox" v-model="checkAll" @change="_handleCheckAllChange">全选</el-checkbox>
  16 + <el-checkbox class="_el-checkbox" v-for="classItem in classInfos" :key="classItem.classId"
  17 + :label="classItem.className">
  18 + {{ classItem.className }}
  19 + </el-checkbox>
  20 + </el-checkbox-group>
  21 + </div>
  22 + <el-main>
  23 + <div style="position: relative">
  24 + <el-tabs v-model="tabType" v-loading="queryLoading" type="card" class="default-tabs">
  25 + <el-tab-pane :name="'成绩测验单'" :label="`成绩测验单`" style="padding: 0 20px">
  26 + <div style="height: calc(100% - 80px);">
  27 + <el-row class="row-subfix">
  28 + <div style="float: right;margin-bottom: 20px;">
  29 + <el-button type="primary" class="opration-btn" icon="el-icon-upload2">导出报表</el-button>
  30 + <el-button type="primary" class="opration-btn" icon="el-icon-printer">打印报表</el-button>
  31 + </div>
  32 + </el-row>
  33 + <el-row class="row-subfix" :key="index" v-for="(item, index) in titleInfo">
  34 + <div class="row-line">
  35 + <span class="line-subfix">班级:</span>
  36 + <span class="line-value">{{ item.className }}</span>
  37 + </div>
  38 + <div class="row-line">
  39 + <span class="line-subfix">试卷名称:</span>
  40 + <span class="line-value">{{ item.paperName }}</span>
  41 + </div>
  42 + <div class="row-line">
  43 + <span class="line-subfix">测验时间:</span>
  44 + <span class="line-value">{{ item.testTime }}</span>
  45 + </div>
  46 + </el-row>
  47 + <el-row class="row-subfix">
  48 + <el-table class="default-table" style="margin-top: 10px" :data="titleInfo">
  49 + <el-table-column prop="testCount" label="测验人数" width="120" />
  50 + <el-table-column prop="avg" label="平均分" width="120" />
  51 + <el-table-column prop="hight" label="最高分" width="120" />
  52 + <el-table-column prop="low" label="最低分" width="120" />
  53 + <el-table-column prop="title" label="缺考名单">
  54 + <template slot-scope="scoped">
  55 + {{ scoped.row.miss.join("/") }}
  56 + </template>
  57 + </el-table-column>
  58 + </el-table>
  59 + </el-row>
  60 + <el-row class="row-subfix">
  61 + <el-table class="default-table" style="margin-top: 10px" :data="studentList">
  62 + <el-table-column :width="item.label == '学号' ? 120 : 0" :prop="item.prop" :label="item.label"
  63 + :key="index" v-for="(item, index) in studentHeader" />
  64 + </el-table>
  65 + </el-row>
  66 + <el-row class="row-subfix">
  67 + <el-table class="default-table" style="margin-top: 10px" :data="questionList">
  68 + <el-table-column :width="item.label == '题号&答案' ? 80 : 0" :prop="item.prop" :label="item.label"
  69 + :key="index" v-for="(item, index) in questionHeaders" />
  70 + </el-table>
  71 + </el-row>
  72 + <el-row class="row-subfix" v-if="questionOtherList && questionOtherList.length >= 1">
  73 + <el-table class="default-table" style="margin-top: 10px" :data="questionOtherList">
  74 + <el-table-column :prop="item.prop" :label="item.label" :key="index"
  75 + v-for="(item, index) in questionOtherHeaders" />
  76 + </el-table>
  77 + </el-row>
  78 + <el-row class="row-subfix">
  79 + <el-table class="default-table" style="margin-top: 10px" :data="questionTotal">
  80 + <el-table-column prop="quesion" label="题号" width="120" />
  81 + <el-table-column prop="anwser" label="答案" width="120" />
  82 + <el-table-column prop="student" label="答错学生">
  83 + <template slot-scope="scoped">
  84 + <span>总计 <span style="color:red;">
  85 + {{ scoped.row.details.filter(item => !item.isRight).length }}</span> 人
  86 + </span>
  87 + <span style="margin: 10px 0;"
  88 + v-for="(item, index) in scoped.row.details.filter(item => !item.isRight)">
  89 + 选{{ item.option }}:{{ item.students.join("/") }}
  90 + </span>
  91 + <span></span>
  92 + </template>
  93 + </el-table-column>
  94 + </el-table>
  95 + </el-row>
  96 + </div>
  97 + <div style="height: 80px;">
  98 + <el-pagination background layout="prev, pager, next" :total="testTranscriptCount">
  99 + </el-pagination>
  100 + </div>
  101 + </el-tab-pane>
  102 + <el-tab-pane :name="'班级对比情况'" :label="`班级对比情况`" style="padding: 0 20px">
  103 + <div style="float: right;margin-bottom: 20px;">
  104 + <el-button type="primary" class="opration-btn" icon="el-icon-upload2">导出报表</el-button>
  105 + <el-button type="primary" class="opration-btn" icon="el-icon-printer">打印报表</el-button>
  106 + </div>
  107 + <el-table class="default-table" :data="classdiffExamReport">
  108 + <el-table-column prop="index" label="序号" width="120" />
  109 + <el-table-column prop="className" label="班级" width="120" />
  110 + <el-table-column label="测验人数/班级人数">
  111 + <template slot-scope="scoped">
  112 + {{ scoped.row.testCount }} / {{ scoped.row.classCount }}
  113 + </template>
  114 + </el-table-column>
  115 + <el-table-column prop="title" label="参与度" width="120">
  116 + <template slot-scope="scoped">
  117 + {{ scoped.row.testCount / scoped.row.classCount }}
  118 + </template>
  119 + </el-table-column>
  120 + <el-table-column prop="avg" label="班平均分" width="120" />
  121 + <el-table-column prop="hight" label="班最高分" width="120" />
  122 + <el-table-column prop="low" label="班最低分" width="120" />
  123 + <el-table-column prop="front20" label="前20名均分" width="120" />
  124 + <el-table-column prop="last20" label="后20名均分" width="120" />
  125 + <el-table-column prop="excellenRate" label="优秀数(率)" width="120">
  126 + <template slot-scope="scoped">
  127 + {{ scoped.row.excellenRate }}%
  128 + </template>
  129 + </el-table-column>
  130 + <el-table-column prop="goodRate" label="良好数(率)" width="120">
  131 + <template slot-scope="scoped">
  132 + {{ scoped.row.goodRate }}%
  133 + </template>
  134 + </el-table-column>
  135 + <el-table-column prop="passRate" label="合格数(率)" width="120">
  136 + <template slot-scope="scoped">
  137 + {{ scoped.row.passRate }}%
  138 + </template>
  139 + </el-table-column>
  140 + <el-table-column prop="failedRate" label="不合格数(率)" width="120">
  141 + <template slot-scope="scoped">
  142 + {{ scoped.row.passRate }}%
  143 + </template>
  144 + </el-table-column>
  145 + </el-table>
  146 + </el-tab-pane>
  147 + <el-tab-pane :name="'试题分析表'" :label="`试题分析表`" style="padding: 0 20px">
  148 + <div style="float: right;margin-bottom: 20px;">
  149 + <el-button type="primary" class="opration-btn" icon="el-icon-upload2">导出报表</el-button>
  150 + <el-button type="primary" class="opration-btn" icon="el-icon-printer">打印报表</el-button>
  151 + </div>
  152 + <el-table class="default-table" :data="testPaperExamReport">
  153 + <el-table-column prop="questionIndex" label="题号" width="120" />
  154 + <el-table-column prop="questionType" label="题型" width="100">
  155 + <template slot-scope="scope">
  156 + {{ setSubPro(scope.row.questionType) }}
  157 + </template>
  158 + </el-table-column>
  159 + <el-table-column prop="score" label="知识点" />
  160 + <el-table-column prop="score" label="满分值" width="120" />
  161 + <el-table-column prop="avgScore" label="年级平均分" width="120" />
  162 + <el-table-column prop="gradeScoringRate" label="年级得分率" width="120" />
  163 + <el-table-column prop="correctAnswer" label="答案" width="120" />
  164 + <el-table-column v-for="(item, index) in testPaperExamReportOptions" :key="index" :label="item.title"
  165 + :prop="'count' + index" width="120">
  166 + <template slot-scope="scope">
  167 + <p class="persent">
  168 + {{
  169 + scope.row.questionType == "5"
  170 + ? ""
  171 + : scope.row["option" + index]
  172 + ? `${scope.row["option" + index]}(${scope.row["persent" + index] ?? "0"
  173 + })`
  174 + : ""
  175 + }}
  176 + </p>
  177 + </template>
  178 + </el-table-column>
  179 + </el-table>
  180 + </el-tab-pane>
  181 + <el-tab-pane :name="'学生成绩排行'" :label="`学生成绩排行`" style="padding: 0 20px">
  182 + <div style="float: right;margin-bottom: 20px;">
  183 + <el-button type="primary" class="opration-btn" icon="el-icon-upload2">导出报表</el-button>
  184 + <el-button type="primary" class="opration-btn" icon="el-icon-printer">打印报表</el-button>
  185 + </div>
  186 + <el-table class="default-table" style="margin-top: 10px" :data="testStudentExamReport">
  187 + <el-table-column prop="gradeRank" label="年级排行" />
  188 + <el-table-column prop="code" label="学号" />
  189 + <el-table-column prop="name" label="姓名" />
  190 + <el-table-column prop="className" label="班级" />
  191 + <el-table-column prop="exam" label="分数" />
  192 + <el-table-column prop="title" label="成绩等级" />
  193 + </el-table>
  194 + </el-tab-pane>
  195 + </el-tabs>
  196 + </div>
  197 + </el-main>
  198 + </el-container>
  199 +</template>
  200 +
  201 +<script>
  202 +export default {
  203 + data() {
  204 + return {
  205 + checkAll: true,
  206 + isIndeterminate: true,
  207 + title: "",
  208 + paperId: null,
  209 + classInfos: [],
  210 + checkedClassInfos: [],
  211 + queryLoading: false,
  212 + tabType: "0",
  213 + testTranscriptCount: 0,
  214 + titleInfo: [],
  215 + studentList: [],
  216 + studentHeader: [],
  217 + studentMapping: [
  218 + {
  219 + key: "code",
  220 + label: "学号",
  221 + },
  222 + {
  223 + key: "name",
  224 + label: "姓名",
  225 + },
  226 + {
  227 + key: "gradeRank",
  228 + label: "排名",
  229 + },
  230 + {
  231 + key: "exam",
  232 + label: "总分",
  233 + },
  234 + {
  235 + key: "objective",
  236 + label: "客观分",
  237 + },
  238 + {
  239 + key: "subjective",
  240 + label: "主观分",
  241 + },
  242 + ],
  243 + questionList: [],
  244 + questionHeaders: [],
  245 + questionOtherList: [],
  246 + questionOtherHeaders: [],
  247 + questionTotal: [],
  248 + testPaperExamReport: [],
  249 + testPaperExamReportOptions: [],
  250 + testStudentExamReport: [],
  251 + classdiffExamReport: [],
  252 + };
  253 + },
  254 + watch: {
  255 + async tabType(value) {
  256 + console.log(value);
  257 + this.checkedClassInfos = this.classInfos;
  258 + switch (value) {
  259 + case "成绩测验单":
  260 + await this._testExamReport();
  261 + break;
  262 + case "班级对比情况":
  263 + await this._classdiffExamReport();
  264 + break;
  265 + case "试题分析表":
  266 + await this._testPaperExamReport();
  267 + break;
  268 + case "学生成绩排行":
  269 + await this._testStudentExamReport();
  270 + break;
  271 + }
  272 + },
  273 + },
  274 + async created() {
  275 + this.title = this.$route.query.title || "";
  276 +
  277 + this.paperId = this.$route.query.paperId;
  278 +
  279 + this.classInfos = JSON.parse(this.$route.query.classListStr);
  280 +
  281 + this.checkedClassInfos = this.classInfos;
  282 +
  283 + this.tabType = "成绩测验单";
  284 + },
  285 + methods: {
  286 + _handleCheckAllChange(val) {
  287 + // this.checkedClassInfos = val ? this.classInfos : [];
  288 + // this.isIndeterminate = false;
  289 + },
  290 + _handleCheckedClassChange(value) {
  291 + // let checkedCount = value.length;
  292 + // this.checkAll = checkedCount === this.cities.length;
  293 + // this.isIndeterminate = checkedCount > 0 && checkedCount < this.cities.length;
  294 + },
  295 + _detailQ(id) { },
  296 + setSubPro(type) {
  297 + let tit;
  298 + switch (type) {
  299 + case 2:
  300 + tit = "单选题";
  301 + break;
  302 + case 3:
  303 + tit = "多选题";
  304 + break;
  305 + case 4:
  306 + tit = "判断题";
  307 + break;
  308 + case 5:
  309 + tit = "主观题";
  310 + break;
  311 + default:
  312 + tit = "其他";
  313 + }
  314 + return tit;
  315 + },
  316 + async _testExamReport() {
  317 +
  318 + this.questionTotal = [];
  319 +
  320 + const request = this.$request.gTestExamReport;
  321 +
  322 + let response = await request({
  323 + paperId: this.paperId,
  324 + classIds: this.checkedClassInfos.map((item) => item.classId),
  325 + });
  326 +
  327 + if (response.status != 0) {
  328 + this.$message.error(response.info);
  329 + return;
  330 + }
  331 +
  332 + this.titleInfo = response.data.titleInfos;
  333 + console.log(this.titleInfo)
  334 + var studentHeaders = [];
  335 +
  336 + var studentResults = [];
  337 +
  338 + for (var iheader = 0; iheader < 3; iheader++) {
  339 + for (
  340 + var imapping = 0;
  341 + imapping < this.studentMapping.length;
  342 + imapping++
  343 + ) {
  344 + studentHeaders.push({
  345 + prop: this.studentMapping[imapping].key + "_" + iheader,
  346 + label: this.studentMapping[imapping].label,
  347 + key: this.studentMapping[imapping].key,
  348 + });
  349 + }
  350 + }
  351 +
  352 + this.studentHeader = [...studentHeaders];
  353 +
  354 + for (var isp = 0; isp < response.data.gradeExamStudentReports.length; isp++) {
  355 +
  356 + var item = {};
  357 +
  358 + for (
  359 + var iamapping = 0;
  360 + iamapping < studentHeaders.length;
  361 + iamapping++
  362 + ) {
  363 + var currentData = response.data.gradeExamStudentReports[isp];
  364 +
  365 + if (!currentData) continue;
  366 +
  367 + var currentHeader = studentHeaders[iamapping];
  368 +
  369 + item[currentHeader.prop] = currentData[currentHeader.key];
  370 +
  371 + if (
  372 + iamapping >= this.studentMapping.length - 1 &&
  373 + iamapping % this.studentMapping.length == 0
  374 + ) {
  375 + isp += 1;
  376 + }
  377 + }
  378 +
  379 + studentResults.push(item);
  380 + }
  381 +
  382 + this.studentList = [...studentResults];
  383 +
  384 + var otherDatas = [];
  385 +
  386 + var questionHeaders = [];
  387 +
  388 + var questionResults = [];
  389 +
  390 + var questionOtherHeaders = [];
  391 +
  392 + var questionOtherResults = [];
  393 +
  394 + var defaultQuestion = 6;
  395 +
  396 + var defaultCount = 3;
  397 +
  398 + var defaultQuestionCount = 4;
  399 +
  400 + var maxQuestionCount = 4;
  401 +
  402 + var optionSt = 1;
  403 +
  404 + for (var qheader = 0; qheader < defaultQuestion * defaultCount; qheader++) {
  405 + if (qheader == 0 || qheader % 6 == 0) {
  406 + questionHeaders.push({
  407 + prop: "column_" + qheader,
  408 + label: "题号&答案",
  409 + });
  410 + continue;
  411 + } else if (qheader == 1 || (qheader - 1) % 6 == 0) {
  412 + questionHeaders.push({
  413 + prop: "column_" + qheader,
  414 + label: "得分率",
  415 + });
  416 + optionSt = 1;
  417 + continue;
  418 + } else {
  419 + questionHeaders.push({
  420 + prop: "column_" + qheader,
  421 + label: "选项" + optionSt,
  422 + });
  423 + optionSt += 1;
  424 + }
  425 + }
  426 +
  427 + var noPassIndex = 0;
  428 +
  429 + this.questionHeaders = questionHeaders;
  430 +
  431 + var itema = null;
  432 +
  433 + response.data.questionInfos = [...response.data.questionInfos]
  434 +
  435 + for (var qIndex = 0; qIndex < response.data.questionInfos.length; qIndex++) {
  436 +
  437 + var currentData = response.data.questionInfos[qIndex];
  438 +
  439 + var filterDetail = currentData.details.filter(fl => fl.option != '未答');
  440 +
  441 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  442 +
  443 + this.questionTotal.push({
  444 + quesion: "Q" + (qIndex + 1),
  445 + anwser: correctAnswerValue ?? "-----",
  446 + details: currentData.details
  447 + })
  448 +
  449 + if (filterDetail.length > defaultQuestionCount || filterDetail.length > maxQuestionCount) {
  450 + currentData.index = qIndex;
  451 + otherDatas.push(currentData);
  452 + if (filterDetail.length > maxQuestionCount) {
  453 + maxQuestionCount = filterDetail.length;
  454 + }
  455 + continue;
  456 + }
  457 + else {
  458 + if (noPassIndex > defaultCount) {
  459 + questionResults.push(itema)
  460 + itema = null;
  461 + noPassIndex = 0;
  462 + }
  463 + var stPass = noPassIndex * defaultQuestion;
  464 + if (!itema) itema = {}
  465 +
  466 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  467 +
  468 + itema["column_" + (stPass)] = (qIndex + 1) + "" + correctAnswerValue;
  469 + itema["column_" + (stPass + 1)] = (currentData.gradeScoringRate * 100) + "%";
  470 +
  471 + var value = "------";
  472 +
  473 + for (var iOption = 0; iOption < defaultQuestion - 2; iOption++) {
  474 + var currentOption = filterDetail[iOption];
  475 + if (currentOption) {
  476 + var optionValue = currentOption.option == "1" ? "✓" : currentOption.option == 2 ? "✗" : currentOption.option;
  477 +
  478 + itema["column_" + (stPass + iOption + 2)] = optionValue + "(" + (currentOption.persent ?? "0%") + ")";
  479 + }
  480 + else {
  481 + itema["column_" + (stPass + iOption + 2)] = value
  482 + }
  483 + }
  484 +
  485 + noPassIndex += 1
  486 + }
  487 +
  488 + if (qIndex >= response.data.questionInfos.length - 1 && noPassIndex != 0) {
  489 + questionResults.push(itema)
  490 + itema = null;
  491 + }
  492 + }
  493 +
  494 + optionSt = 1;
  495 +
  496 + maxQuestionCount += 2;
  497 +
  498 + this.questionList = [...questionResults]
  499 +
  500 + var otherCount = parseInt(defaultQuestion * defaultCount / maxQuestionCount);
  501 +
  502 + itema = null;
  503 +
  504 + for (var qOHeader = 0; qOHeader < maxQuestionCount * otherCount; qOHeader++) {
  505 + if (qOHeader == 0 || qOHeader % (maxQuestionCount) == 0) {
  506 + questionOtherHeaders.push({
  507 + prop: "column_" + qOHeader,
  508 + label: "题号&答案",
  509 + });
  510 + continue;
  511 + } else if (qOHeader == 1 || (qOHeader - 1) % (maxQuestionCount) == 0) {
  512 + questionOtherHeaders.push({
  513 + prop: "column_" + qOHeader,
  514 + label: "得分率",
  515 + });
  516 + optionSt = 1;
  517 + continue;
  518 + } else {
  519 + questionOtherHeaders.push({
  520 + prop: "column_" + qOHeader,
  521 + label: "选项" + optionSt,
  522 + });
  523 + optionSt += 1;
  524 + }
  525 + }
  526 +
  527 + this.questionOtherHeaders = questionOtherHeaders;
  528 +
  529 + noPassIndex = 0;
  530 +
  531 + for (var qOIndex = 0; qOIndex < otherDatas.length; qOIndex++) {
  532 +
  533 + var currentData = otherDatas[qOIndex];
  534 +
  535 + var filterDetail = currentData.details.filter(fl => fl.option != '未答');
  536 +
  537 + if (noPassIndex >= otherCount) {
  538 + questionOtherResults.push(itema)
  539 + itema = null;
  540 + noPassIndex = 0;
  541 + }
  542 +
  543 + var stPass = noPassIndex * maxQuestionCount;
  544 +
  545 + if (!itema) itema = {}
  546 +
  547 + var correctAnswerValue = currentData.correctAnswer == "1" ? "✓" : currentData.correctAnswer == 2 ? "✗" : currentData.correctAnswer;
  548 +
  549 + itema["column_" + (stPass)] = (Number(currentData.index) + 1) + "" + correctAnswerValue;
  550 +
  551 + itema["column_" + (stPass + 1)] = (currentData.gradeScoringRate * 100) + "%";
  552 +
  553 + var value = "------";
  554 +
  555 + for (var iOption = 0; iOption < maxQuestionCount - 2; iOption++) {
  556 +
  557 + var currentOption = filterDetail[iOption];
  558 +
  559 + if (currentOption) {
  560 +
  561 + var optionValue = currentOption.option == "1" ? "✓" : currentOption.option == 2 ? "✗" : currentOption.option;
  562 +
  563 + itema["column_" + (stPass + iOption + 2)] = optionValue + "(" + (currentOption.persent ?? "0%") + ")";
  564 + }
  565 + else {
  566 + itema["column_" + (stPass + iOption + 2)] = value
  567 + }
  568 + }
  569 +
  570 + noPassIndex += 1
  571 +
  572 + if (qOIndex >= otherDatas.length - 1 && noPassIndex != 0) {
  573 +
  574 + questionOtherResults.push(itema)
  575 + itema = null;
  576 + }
  577 + }
  578 +
  579 + this.questionOtherList = [...questionOtherResults]
  580 +
  581 + },
  582 + async _testPaperExamReport() {
  583 + const request = this.$request.gPaperExamReport;
  584 +
  585 + let response = await request({
  586 + paperId: this.paperId,
  587 + classIds: this.checkedClassInfos.map((item) => item.classId),
  588 + });
  589 +
  590 + if (response.status != 0) {
  591 + this.$message.error(response.info);
  592 + return;
  593 + }
  594 +
  595 + let optionsList = [{}, {}, {}, {}, {}];
  596 +
  597 + let tableData = response.data?.map((item) => {
  598 + let params = {};
  599 + const detail = item.details;
  600 + let lastOPtion = detail?.find((item) => {
  601 + return item.option == "未答";
  602 + });
  603 + let defaultArr = detail?.filter((item) => {
  604 + return item.option != "未答";
  605 + });
  606 + optionsList.map((items, index) => {
  607 + if (index != 4) {
  608 + params["count" + index] =
  609 + defaultArr[index]?.option != "未答"
  610 + ? defaultArr[index]?.count
  611 + : "";
  612 + params["persent" + index] =
  613 + defaultArr[index]?.option != "未答"
  614 + ? defaultArr[index]?.persent
  615 + : "";
  616 + params["option" + index] =
  617 + defaultArr[index]?.option != "未答"
  618 + ? defaultArr[index]?.option == 1
  619 + ? "✓"
  620 + : defaultArr[index]?.option == 2
  621 + ? "✗"
  622 + : defaultArr[index]?.option
  623 + : "";
  624 + items["title"] = "选项" + (index + 1);
  625 + } else {
  626 + items["title"] = "未答";
  627 + params["count" + index] = lastOPtion.count;
  628 + params["persent" + index] = lastOPtion.persent;
  629 + params["option" + index] = "?";
  630 + }
  631 + });
  632 +
  633 + return {
  634 + ...item,
  635 + ...params,
  636 + };
  637 + });
  638 +
  639 + this.testPaperExamReport = tableData?.sort((a, b) => {
  640 + return a.questionIndex - b.questionIndex;
  641 + });
  642 +
  643 + this.testPaperExamReportOptions = [...optionsList];
  644 +
  645 + },
  646 + async _testStudentExamReport() {
  647 + const request = this.$request.gStudentExamReport;
  648 +
  649 + let response = await request({
  650 + paperId: this.paperId,
  651 + classIds: this.checkedClassInfos.map((item) => item.classId),
  652 + });
  653 +
  654 + if (response.status != 0) {
  655 + this.$message.error(response.info);
  656 + return;
  657 + }
  658 +
  659 + this.testStudentExamReport = response.data;
  660 + },
  661 + async _classdiffExamReport() {
  662 + const request = this.$request.gClassdiffExamReport;
  663 +
  664 + let response = await request({
  665 + paperId: this.paperId,
  666 + classIds: this.checkedClassInfos.map((item) => item.classId),
  667 + });
  668 +
  669 + if (response.status != 0) {
  670 + this.$message.error(response.info);
  671 + return;
  672 + }
  673 + var index = 0;
  674 +
  675 + this.classdiffExamReport = response.data.map((item) => {
  676 + item.index = index + 1;
  677 + index += 1;
  678 + return item;
  679 + });
  680 + },
  681 + _delete() { },
  682 + },
  683 +};
  684 +</script>
  685 +<style lang="scss">
  686 +._el-checkbox {
  687 + * {
  688 + height: 15px !important;
  689 + line-height: 15px !important;
  690 + }
  691 +}
  692 +
  693 +.default-filter {
  694 + padding: 10px !important;
  695 +}
  696 +
  697 +.row-line {
  698 + width: calc(33% - 2px);
  699 + border: 1px solid #ebeef5;
  700 + background: #f5f7fa;
  701 + display: inline-block;
  702 + height: 40px;
  703 + line-height: 40px;
  704 +
  705 + .line-subfix {
  706 + margin-left: 10px;
  707 + }
  708 +}
  709 +</style>
... ...
src/views/basic/askTestQuestion/index.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <div class="default-title" style="float: left;">
  5 + {{ dataType == "1" ? '随堂问备题' : '即时测组卷' }}
  6 + </div>
  7 + <el-dropdown v-if="this.dataType == '2'" :hide-on-click="true" style="float: right;margin-right: 50px;">
  8 + <el-button :size="'small'" :icon="'el-icon-plus'" class="green-el-button">添加试卷</el-button>
  9 + <el-dropdown-menu slot="dropdown">
  10 + <el-dropdown-item @click.native="import(1)">导入试卷</el-dropdown-item>
  11 + <el-dropdown-item @click.native="createAnwseredCard()">创建答题卡</el-dropdown-item>
  12 + </el-dropdown-menu>
  13 + </el-dropdown>
  14 + <el-button style="float: right;margin-right: 50px;" :size="'small'" :icon="'el-icon-plus'"
  15 + class="green-el-button" @click.native="import(2)" v-if="this.dataType == '1'">添加课件</el-button>
  16 + </el-header>
  17 + <div class="default-filter">
  18 + <el-input v-model="query.paper" :placeholder="dataType == '1' ? '搜索课件' : '搜索试卷'"
  19 + suffix-icon="el-icon-search" class="filter-input" type="number" clearable />
  20 + <el-select @change="_changeClass" v-model="query.class" class="filter-select" placeholder="选择班级">
  21 + <el-option v-for="item in classList" :key="item.classId" :label="item.className"
  22 + :value="item.classId" />
  23 + </el-select>
  24 + <el-select v-model="query.subject" placeholder="选择科目" class="filter-select">
  25 + <el-option v-for=" item in subjectList " :key="item" :label="item" :value="item" />
  26 + </el-select>
  27 + <el-select v-if="dataType == '2'" v-model="query.tagId" placeholder="选择测验类型" class="filter-select">
  28 + <el-option v-for="item in typeList" :key="item.label" :label="item.label" :value="item.value" />
  29 + </el-select>
  30 + <el-date-picker value-format="yyyy-MM-dd" class="filter-datePicker" v-model="query.dateRange"
  31 + type="daterange" range-separator="-">
  32 + </el-date-picker>
  33 + <el-button type="primary" @click="_serach">
  34 + 筛选
  35 + </el-button>
  36 + <el-radio-group v-model="dateStatus" class="default-date-radio-group">
  37 + <el-radio-button label="onDay">当天</el-radio-button>
  38 + <el-radio-button label="onWeek">本周</el-radio-button>
  39 + <el-radio-button label="onMonth">本月</el-radio-button>
  40 + </el-radio-group>
  41 + </div>
  42 + <el-main>
  43 + <div style='position: relative;'>
  44 + <el-tabs v-model="tabType" v-loading="queryLoading" type="card" class="default-tabs">
  45 + <el-tab-pane :name="'0'" :label="`自编课件(${createdCount})`">
  46 + <el-row>
  47 + <el-col :key="index" v-for="( item, index ) in defaultList " :span="12">
  48 + <div class="card-content">
  49 + <el-row>
  50 + <el-col :span="6" class="left">
  51 + <div class="left-icon">
  52 + <div class="icon">
  53 + <img src="../../../assets/images/shuben.png" />
  54 + </div>
  55 + <div class="text">
  56 + {{ item.id }}
  57 + </div>
  58 + </div>
  59 + </el-col>
  60 + <el-col :span="18" class="content">
  61 + <div class="title-text">
  62 + {{ item.title }}
  63 + <el-dropdown class="dropdown-button" :hide-on-click="false">
  64 + <el-button>操作</el-button>
  65 + <el-dropdown-menu slot="dropdown">
  66 + <el-dropdown-item
  67 + @click.native="_detailQ(item.id)">查看</el-dropdown-item>
  68 + <el-dropdown-item
  69 + @click.native="_updateQ(item)">修改</el-dropdown-item>
  70 + <el-dropdown-item
  71 + @click.native="_copy(item)">复制</el-dropdown-item>
  72 + <el-dropdown-item>
  73 + <el-popconfirm style="color:gray !important;"
  74 + @confirm="_deleteDetermineQ(item.id)"
  75 + title="这是一段内容确定删除吗?">
  76 + <el-button style="color:#606266 !important;"
  77 + @click.native="_delete(item.id)" type="text"
  78 + slot="reference">删除</el-button>
  79 + </el-popconfirm>
  80 + </el-dropdown-item>
  81 + </el-dropdown-menu>
  82 + </el-dropdown>
  83 + </div>
  84 + <div class="descption-tag-text" v-if="role != 'ROLE_PERSONAL'">
  85 + <template>
  86 + 授课端同步:
  87 + <span class="descption-tag"
  88 + v-for="( clazzChild, indexs ) in item.classList "
  89 + :key="clazzChild.classId"
  90 + :class="clazzChild.keepStatus == 1 ? 'active' : ''">
  91 + {{ clazzChild.className }}
  92 + <i v-if="clazzChild.keepStatus == 1"
  93 + class="el-icon-success"></i>
  94 + </span>
  95 + <el-tooltip effect="dark" content="刷新同步状态">
  96 + <img @click="_loadQueryDatas" height="18px" width="18px"
  97 + src="../../../assets/images/shuaxin.png" />
  98 + </el-tooltip>
  99 + </template>
  100 + </div>
  101 + <div class="descption-text">
  102 + <span class="descption-text-block">
  103 + <div class="pic">
  104 + <img src="../../../assets/images/tishu.png" />
  105 + </div>
  106 + <div class="text"> 总题数:</div>
  107 + <div class="value">{{ item.questionNum }}</div>
  108 + <div class="pic" v-if="dataType == 2" style="margin-left: 44px;">
  109 + <img src="../../../assets/images/tishu.png" />
  110 + </div>
  111 + <div class="text" v-if="dataType == 2"> 预计时长:</div>
  112 + <div class="value" v-if="dataType == 2">{{ item.examsDuration }}
  113 + 分钟
  114 + </div>
  115 + <div class="pic" style="margin-left: 44px;">
  116 + <img src="../../../assets/images/tishu.png" />
  117 + </div>
  118 + <div class="text"> 创建人:</div>
  119 + <div class="value">{{ item.realName }}</div>
  120 + </span>
  121 + </div>
  122 + <div class="descption-text">
  123 + <span class="descption-text-block">
  124 + <div class="pic"><img src="../../../assets/images/rili.png"></img>
  125 + </div>
  126 + <div class="text"> 更新时间:</div>
  127 + <div class="value">{{ item.modifiedTime }}</div>
  128 + <span class="sharing-descption"
  129 + v-if="item.sharingType == 1">已分享到非任课班级</span>
  130 + </span>
  131 + </div>
  132 + </el-col>
  133 + </el-row>
  134 + </div>
  135 + </el-col>
  136 + </el-row>
  137 + </el-tab-pane>
  138 + <el-tab-pane :name="'1'" :label="`共享课件(${sharedCount})`">
  139 + <el-row>
  140 + <el-col :key="index" v-for="( item, index ) in sharedList " :span="12">
  141 + <div class="card-content">
  142 + <el-row>
  143 + <el-col :span="6" class="left">
  144 + <div class="left-icon">
  145 + <div class="icon">
  146 + <img src="../../../assets/images/shuben.png" />
  147 + </div>
  148 + <div class="text">
  149 + {{ item.id }}
  150 + </div>
  151 + </div>
  152 + </el-col>
  153 + <el-col :span="15" class="content">
  154 + <div class="title-text">
  155 + {{ item.title }}
  156 + </div>
  157 + <div class="descption-tag-text" v-if="role != 'ROLE_PERSONAL'">
  158 + <template>
  159 + 授课端同步:
  160 + <span class="descption-tag"
  161 + v-for="( clazzChild, indexs ) in item.classList "
  162 + :key="clazzChild.classId"
  163 + :class="clazzChild.keepStatus == 1 ? 'active' : ''">
  164 + {{ clazzChild.className }}
  165 + <i v-if="clazzChild.keepStatus == 1"
  166 + class="el-icon-success"></i>
  167 + </span>
  168 + <el-tooltip effect="dark" content="刷新同步状态">
  169 + <img @click="_loadQueryDatas" height="18px" width="18px"
  170 + src="../../../assets/images/shuaxin.png" />
  171 + </el-tooltip>
  172 + </template>
  173 + </div>
  174 + <div class="descption-text">
  175 + <span class="descption-text-block">
  176 + <div class="pic"><img src="../../../assets/images/tishu.png"></img>
  177 + </div>
  178 + <div class="text"> 总题数:</div>
  179 + <div class="value">{{ item.questionNum }}</div>
  180 +
  181 + <div class="pic" style="margin-left: 44px;"><img
  182 + src="../../../assets/images/tishu.png"></img>
  183 + </div>
  184 + <div class="text"> 创建人:</div>
  185 + <div class="value">{{ item.realName }}</div>
  186 + </span>
  187 + </div>
  188 + <div class="descption-text">
  189 + <span class="descption-text-block">
  190 + <div class="pic"><img src="../../../assets/images/rili.png"></img>
  191 + </div>
  192 + <div class="text"> 更新时间:</div>
  193 + <div class="value">{{ item.createdTime }}</div>
  194 + </span>
  195 + </div>
  196 + </el-col>
  197 + <el-col :span="3" class="right">
  198 + <el-dropdown :hide-on-click="true">
  199 + <el-button>操作</el-button>
  200 + <el-dropdown-menu slot="dropdown">
  201 + <el-dropdown-item>查看</el-dropdown-item>
  202 + <el-dropdown-item>删除</el-dropdown-item>
  203 + </el-dropdown-menu>
  204 + </el-dropdown>
  205 + </el-col>
  206 + </el-row>
  207 + </div>
  208 + </el-col>
  209 + </el-row>
  210 + </el-tab-pane>
  211 + <div slot="tab-bar">
  212 + <el-button type="primary" icon="el-icon-plus">新增</el-button>
  213 + </div>
  214 + </el-tabs>
  215 + <el-button size='mini' v-if="role == 'ROLE_PERSONAL' || role == 'ROLE_JIAOSHI'" @click="recycle"
  216 + style='position: absolute;right:40px;top:5px;'>查看回收站</el-button>
  217 + </div>
  218 + </el-main>
  219 + <el-footer class="el-footer-pagination">
  220 + <el-pagination @current-change="pageSizeChange" background layout="prev, pager, next"
  221 + :size="listPage.size" :current-page="listPage.page"
  222 + :total="listPage.total">
  223 + </el-pagination>
  224 + </el-footer>
  225 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="上传word文档" :visible.sync="diaUp" width="600px">
  226 + <upload :url="url" :params="{ type: importType }" @upSuccess="upSuccess" fileName="下载">
  227 + <div class="down-box p0" slot="down">
  228 + <p class="down-head" v-if="importType == 1">
  229 + <span>第一步:</span>
  230 + <el-link type="primary" @click="downExcel">下载模板,</el-link>
  231 + <span>或者导出菁优网试卷/组卷网(学科网)试卷;
  232 + 为保证第三方试卷导入成功,请注意参考导出示例:</span>
  233 + <span class="img-box">
  234 + <el-image class="img" :src="examplePic" :preview-src-list="examplePicList">
  235 + </el-image>
  236 + 菁优网示例 </span>/
  237 + <span class="img-box">
  238 + <el-image class="img" :src="examplePic2" :preview-src-list="examplePicList2">
  239 + </el-image>
  240 + 组卷网(学科网)示例。
  241 + </span>
  242 + </p>
  243 + <p class="down-head" v-if="importType == 2">
  244 + <span>第一步:导出菁优网试卷/组卷网(学科网)试卷;为保证第三方试卷导入成功,请注意参考导出示例:</span>
  245 + <span class="img-box">
  246 + <el-image class="img" :src="examplePic" :preview-src-list="examplePicList">
  247 + </el-image>
  248 + 菁优网示例
  249 + </span>
  250 + /
  251 + <span class="img-box">
  252 + <el-image class="img" :src="examplePic2" :preview-src-list="examplePicList2">
  253 + </el-image>
  254 + 组卷网(学科网)示例。
  255 + </span>
  256 + </p>
  257 + <p>第二步:上传完成编辑好的试卷。</p>
  258 + </div>
  259 + </upload>
  260 + <div class="dialog-footer" slot="footer">
  261 + <el-button @click="diaUp = false">取 消</el-button>
  262 + </div>
  263 + </el-dialog>
  264 + </el-container>
  265 +
  266 +</template>
  267 +
  268 +<script>
  269 +import { setDateRules } from "@/utils";
  270 +import example from "@/assets/images/example.jpg";
  271 +import example2 from "@/assets/images/example2.png";
  272 +
  273 +
  274 +export default {
  275 + data() {
  276 + return {
  277 + diaUp: false,
  278 + examplePic: example,
  279 + examplePic2: example2,
  280 + examplePicList: [example],
  281 + examplePicList2: [example2],
  282 + role: "",
  283 + classList: [],
  284 + subjectList: [],
  285 + defaultList: [],
  286 + typeList: [],
  287 + sharedList: [],
  288 + dataType: "1",
  289 + importType: 0,
  290 + tabType: "0",
  291 + dateStatus: "-1",
  292 + url: "/api_html/common/paper/upload", //上传文档地址
  293 + listPage: {
  294 + page: 1,
  295 + size: 8,
  296 + total: 0,
  297 + },
  298 + query: {
  299 + title: "",
  300 + class: null,
  301 + subject: null,
  302 + dateRange: [
  303 + "2022-03-01", "2023-05-01"
  304 + ],
  305 + tagId: null
  306 + },
  307 + queryLoading: false,
  308 + createdCount: 0,
  309 + sharedCount: 0
  310 + };
  311 + },
  312 + watch: {
  313 + '$route'() {
  314 + this.dataType = location.href.endsWith("askPreparationQuestions") ? "1" : "2";
  315 + this._serach();
  316 + },
  317 + 'tabType'() {
  318 + this.listPage.page = 1;
  319 + this._serach();
  320 + },
  321 + 'dateStatus'(val) {
  322 + var dateRange = setDateRules(val);
  323 + this.query.dateRange = [dateRange.startDay, dateRange.endDay];
  324 + }
  325 + },
  326 + created() {
  327 + this.dataType = location.href.endsWith("askPreparationQuestions") ? "1" : "2";
  328 + this.code = this.$store.getters.csCode;
  329 + this.role =
  330 + this.$store.getters.info.showRole ||
  331 + this.$store.getters.info.permissions[0].role;
  332 + this._loadQueryDatas();
  333 + },
  334 + methods: {
  335 + async pageSizeChange(value){
  336 + this.listPage.page = value;
  337 + await this._serach();
  338 + },
  339 + recycle() {
  340 + let routerItem = {
  341 + path: "/askPreparationQuestionsRecycle"
  342 + };
  343 + if (this.dataType == '2') {
  344 + routerItem.path = "/testPaperRecycle";
  345 + }
  346 + this.$router.push(routerItem);
  347 + },
  348 + createAnwseredCard() {
  349 + let routerItem = {
  350 + path: "/testPaperAdd",
  351 + query: {
  352 + listType: 2,
  353 + listShare: 0,
  354 + subjectName: this.query.subject,
  355 + },
  356 + };
  357 + this.$router.push(routerItem);
  358 + },
  359 + import(type) {
  360 + this.importType = type;
  361 + this.diaUp = true;
  362 + },
  363 + //v1.5
  364 + upSuccess(res) {
  365 + if (res.status == 0) {
  366 + //导入成功
  367 + this.$message.closeAll();
  368 + this.$message({
  369 + showClose: true,
  370 + message: `${res.info}`,
  371 + type: "success",
  372 + duration: 2000,
  373 + });
  374 + this.diaUp = false;
  375 + let params = JSON.stringify(res.data);
  376 + if (this.query.type == 2) {
  377 + this.toAdd({ params, isUpload: 1 });
  378 + } else {
  379 + this.toAddQs({ params });
  380 + }
  381 + }
  382 + },
  383 + async _changeClass() {
  384 + await this._loadSubjectData();
  385 + },
  386 + async _loadSubjectData() {
  387 + const fetchSubject =
  388 + this.role == "ROLE_BANZHUREN" ? this.$request.cTSubjectList :
  389 + this.role == "ROLE_PERSONAL" ? this.$request.pSubjectList : this.$request.tSubjectList;
  390 +
  391 + const { data, status, info } = await fetchSubject({
  392 + classId: this.query.class,
  393 + });
  394 +
  395 + if (status != 0) {
  396 + this.$message.error(info);
  397 + return;
  398 + }
  399 + this.subjectList = data?.subjectNames ?? [];
  400 + this.query.subject = data?.subjectNames[0] ?? "";
  401 + },
  402 + async _loadTypes() {
  403 + let fetchTypeNames =
  404 + this.role == "ROLE_PERSONAL"
  405 + ? this.$request.pPaperTagList
  406 + : this.$request.fetchTypeNames;
  407 +
  408 + const { data, status, info } = await fetchTypeNames({
  409 + classId: this.query.class,
  410 + type: 0,
  411 + });
  412 + if (status != 0) {
  413 + this.$message.error(info);
  414 + return;
  415 + }
  416 + this.typeList =
  417 + data.list.map((item) => {
  418 + return {
  419 + value: item.tagId,
  420 + label: item.tag,
  421 + };
  422 + }) || [];
  423 + this.typeList.unshift({
  424 + value: "",
  425 + label: "请选择标签",
  426 + });
  427 + this.query.tagId = "";
  428 + },
  429 + async _loadClassData() {
  430 + const fetchClassList =
  431 + this.role == "ROLE_BANZHUREN" ? this.$request.cTClassList :
  432 + this.role == "ROLE_PERSONAL" ? this.$request.pClassList : this.$request.tClassList;
  433 +
  434 + const { data, status, info } = await fetchClassList();
  435 +
  436 + if (status != 0) {
  437 + this.$message.error(info);
  438 + return;
  439 + }
  440 +
  441 + this.classList = data?.list ?? [];
  442 +
  443 + this.query.class = this.classList[0]?.classId
  444 + },
  445 + async _loadQueryDatas() {
  446 + this.$loading.open();
  447 + await this._loadClassData();
  448 + await this._loadSubjectData();
  449 + if (this.dataType == "2") await this._loadTypes();
  450 + this.$loading.close();
  451 + await this._serach();
  452 + },
  453 + async _serach() {
  454 + this.queryLoading = true;
  455 + let fetchPaperList =
  456 + this.role == "ROLE_PERSONAL"
  457 + ? this.$request.pPaperList
  458 + : this.$request.fetchPaperList;
  459 +
  460 + var queryParams = {
  461 + classId: "",
  462 + subjectName: "",
  463 + tagId: "",
  464 + title: "",
  465 + type: this.dataType, //试卷类型
  466 + share: this.tabType, //分享类型
  467 + };
  468 +
  469 + queryParams.classId = this.query.class;
  470 + queryParams.subjectName = this.query.subject;
  471 + queryParams.tagId = this.query.tagId;
  472 + queryParams.title = this.query.paper;
  473 + // queryParams.start = this.query.dateRange[0];
  474 + // queryParams.end = this.query.dateRange[1];
  475 +
  476 + const { data, status, info } = await fetchPaperList({
  477 + ...queryParams,
  478 + status: 1,
  479 + page: this.listPage.page,
  480 + size: this.listPage.size
  481 + });
  482 +
  483 + if (status != 0) {
  484 + this.$message.error(info);
  485 + return;
  486 + }
  487 + this.queryLoading = false;
  488 + this.createdCount = data?.myCount || 0;
  489 + this.sharedCount = data?.gradeCount || 0;
  490 + this.listPage.total = data.total;
  491 +
  492 + if (this.tabType == "0") {
  493 + this.defaultList = [];
  494 + if (data?.list) this.defaultList = [...data?.list];
  495 + }
  496 + else if (this.tabType == "1") {
  497 + this.sharedList = [];
  498 + if (data?.list) this.sharedList = [...data?.list];
  499 + }
  500 + },
  501 + _detailQ(id) {
  502 + let routerItem = {
  503 + path: "/askPreparationQuestionsDetail",
  504 + query: { id: id },
  505 + };
  506 + if (this.dataType == '2') {
  507 + routerItem.path = "/testPaperQuestionsDetail";
  508 + }
  509 + this.$router.push(routerItem);
  510 + },
  511 + _copy(currentRow) {
  512 + let routerItem = {
  513 + path: "/askPreparationQuestionsAdd",
  514 + query: {
  515 + type: 2,
  516 + paperId: currentRow.id,
  517 + listType: 1,
  518 + listShare: 0,
  519 + subjectName: this.query.subjectName,
  520 + },
  521 + };
  522 +
  523 + if (this.dataType == '2') {
  524 + routerItem.path = "/testPaperAdd";
  525 + }
  526 +
  527 + this.$router.push(routerItem);
  528 + },
  529 + _delete() {
  530 +
  531 + },
  532 + _updateQ(item) {
  533 + console.log(item)
  534 + var currentClass = this.classList.find(item => item.classId == this.query.class);
  535 +
  536 + let routerItem = {
  537 + path: "/askPreparationQuestionsUpdate",
  538 + query: {
  539 + paperId: item.id, paperType: 1,
  540 + classId: currentClass.classId,
  541 + gradeName: currentClass.gradeName
  542 + },
  543 + };
  544 +
  545 + if (this.dataType == '2') {
  546 + routerItem.path = "/testPaperQuestionsUpdate";
  547 + }
  548 +
  549 + this.$router.push(routerItem);
  550 + },
  551 + async _deleteDetermineQ(id) {
  552 + let modifyPaper =
  553 + this.role == "ROLE_PERSONAL"
  554 + ? this.$request.pModifyPaper
  555 + : this.$request.modifyPaper;
  556 + const { data, status, info } = await modifyPaper({
  557 + paperId: id,
  558 + status: 2,
  559 + });
  560 + if (status != 0) {
  561 + this.$message.error(info);
  562 + }
  563 + this.page = 1;
  564 + this._serach();
  565 + }
  566 + },
  567 +};
  568 +</script>
  569 +<style lang="scss">
  570 +.down-box {
  571 + padding-left: 20px;
  572 +
  573 + .down-head {
  574 + display: block;
  575 +
  576 + span,
  577 + a {
  578 + vertical-align: middle;
  579 + }
  580 + }
  581 +}
  582 +
  583 +.header-button {
  584 + float: right;
  585 + margin-right: 50px;
  586 + background: rgba(65, 204, 149, 1);
  587 + color: white;
  588 +
  589 + :hover {
  590 + background: rgba(65, 204, 149, 1);
  591 + color: white;
  592 + }
  593 +}
  594 +
  595 +.el-tabs__content {
  596 + padding-left: 20px !important;
  597 + padding-right: 0px !important;
  598 + padding-top: 20px !important;
  599 +}
  600 +
  601 +.el-tabs__header {
  602 + margin: 0px !important;
  603 +}
  604 +
  605 +.card-content {
  606 + .descption-tag {
  607 + display: inline-block;
  608 + background: rgba(102, 127, 253, 0.1);
  609 + border-radius: 4px 4px 4px 4px;
  610 + color: #667FFD;
  611 + line-height: 32px;
  612 + padding: 0 10px;
  613 + height: 32px;
  614 + margin-right: 10px;
  615 + }
  616 +
  617 + margin-bottom: 10px;
  618 + height: 180px;
  619 + border: 1px solid #E6E9F4;
  620 + border-radius: 10px 10px 10px 10px;
  621 + box-shadow: 0px 4px 14px 0px rgba(0, 0, 0, 0.08);
  622 + margin-right: 20px;
  623 + background: #FFFFFF;
  624 +
  625 + .content {
  626 + margin-top: 15px !important;
  627 + padding-left: 10px !important;
  628 + font-size: 14px;
  629 + font-weight: 400;
  630 +
  631 + .descption-tag-text {
  632 + margin-bottom: 20px;
  633 + display: flex;
  634 + justify-content: flex-start;
  635 + align-items: center;
  636 + }
  637 +
  638 + .descption-text {
  639 + height: 30px;
  640 + margin-top: 10px;
  641 +
  642 + .descption-text-block {
  643 + margin-right: 10px;
  644 + display: flex;
  645 + justify-content: flex-start;
  646 +
  647 + .sharing-descption {
  648 + flex: 1;
  649 + color: gray;
  650 + opacity: 0.8;
  651 + text-align: right
  652 + }
  653 +
  654 + img {
  655 + height: 20px;
  656 + width: 20px;
  657 + margin-right: 5px;
  658 + }
  659 + }
  660 + }
  661 +
  662 + .title-text {
  663 + font-weight: bold;
  664 + font-size: 20px;
  665 + color: #303133;
  666 + line-height: 28px;
  667 + height: 28px;
  668 + text-transform: none;
  669 + padding-bottom: 10px !important;
  670 +
  671 + .dropdown-button {
  672 + .el-button {
  673 + background-color: #667FFD !important;
  674 + color: white;
  675 + }
  676 +
  677 + float: right;
  678 + margin-right: 20px;
  679 +
  680 + }
  681 + }
  682 + }
  683 +
  684 + .left {
  685 + height: 180px;
  686 + background-color: #41CC95;
  687 + vertical-align: middle;
  688 + border-radius: 10px 0px 0px 10px;
  689 +
  690 + .left-icon {
  691 + margin-top: 26px;
  692 + height: 70px;
  693 +
  694 + .icon {
  695 + height: 100px;
  696 + width: 100px;
  697 + background: rgba(255, 255, 255, 0.1);
  698 + border-radius: 61px 61px 61px 61px;
  699 + margin: auto;
  700 + text-align: center;
  701 +
  702 + img {
  703 + margin-top: 24px;
  704 + height: 52px;
  705 + width: 52px;
  706 + }
  707 + }
  708 +
  709 + .text {
  710 + width: 100%;
  711 + text-align: center;
  712 + margin-top: 5px;
  713 + font-size: 20px;
  714 + color: #FFFFFF;
  715 + }
  716 + }
  717 + }
  718 +
  719 + .right {
  720 + .el-button {
  721 + background-color: #667FFD;
  722 + line-height: 16px;
  723 + color: #FFFFFF;
  724 + margin-top: 15px;
  725 + padding: 10px 20px !important;
  726 + }
  727 + }
  728 +
  729 +}
  730 +
  731 +.el-popconfirm__action {
  732 + margin-top: 10px;
  733 +}
  734 +</style>
0 735 \ No newline at end of file
... ...
src/views/basic/askTestQuestion/recycle.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <back-box class="detailBack">
  5 + <template slot="title">
  6 + <span class="default-title">
  7 + 查看回收站
  8 + </span>
  9 + </template>
  10 + </back-box>
  11 + </el-header>
  12 + <div class="default-filter">
  13 + <el-input v-model="query.paper" :placeholder="dataType == '1' ? '搜索课件' : '搜索试卷'"
  14 + suffix-icon="el-icon-search" class="filter-input" type="number" clearable />
  15 + <el-select @change="_changeClass" v-model="query.class" class="filter-select" placeholder="选择班级">
  16 + <el-option v-for="item in classList" :key="item.classId" :label="item.className"
  17 + :value="item.classId" />
  18 + </el-select>
  19 + <el-select v-model="query.subject" placeholder="选择科目" class="filter-select">
  20 + <el-option v-for=" item in subjectList " :key="item" :label="item" :value="item" />
  21 + </el-select>
  22 + <el-select v-if="dataType == '2'" v-model="query.tagId" placeholder="选择测验类型" class="filter-select">
  23 + <el-option v-for="item in typeList" :key="item.label" :label="item.label" :value="item.value" />
  24 + </el-select>
  25 + <el-date-picker value-format="yyyy-MM-dd" class="filter-datePicker" v-model="query.dateRange"
  26 + type="daterange" range-separator="-">
  27 + </el-date-picker>
  28 + <el-button type="primary" @click="_serach">
  29 + 筛选
  30 + </el-button>
  31 + </div>
  32 + <el-main>
  33 + <div style='position: relative;'>
  34 + <el-tabs v-model="tabType" v-loading="queryLoading" type="card" class="default-tabs">
  35 + <el-tab-pane :name="'0'" :label="`自编课件(${createdCount})`">
  36 + <el-table class="default-table" :data="defaultList">
  37 + <el-table-column prop="id" label="试卷ID" width="100"></el-table-column>
  38 + <el-table-column prop="title" label="试卷名称"></el-table-column>
  39 + <el-table-column prop="tag" label="测验类型" width="200"></el-table-column>
  40 + <el-table-column prop="questionNum" label="总题数" width="200"></el-table-column>
  41 + <el-table-column prop="realName" label="创建人" width="200"></el-table-column>
  42 + <el-table-column prop="createdTime" label="创建时间"></el-table-column>
  43 + <el-table-column prop="modifiedTime" label="删除时间"></el-table-column>
  44 + <el-table-column prop="createdTime" label="操作">
  45 + <template slot-scope="scoped">
  46 + <el-button class="edit" type="text" @click="modify(scoped.row)">
  47 + 恢复
  48 + </el-button>
  49 + <el-popconfirm title="确定删除这张答题卡吗?" @confirm="remove(scoped.row)">
  50 + <el-button style="color:red;margin-left: 10px;" slot="reference" class="delete"
  51 + type="text">
  52 + 删除
  53 + </el-button>
  54 + </el-popconfirm>
  55 + </template>
  56 + </el-table-column>
  57 + </el-table>
  58 + </el-tab-pane>
  59 + <el-tab-pane :name="'1'" :label="`共享课件(${sharedCount})`">
  60 + <el-table class="default-table" :data="sharedList">
  61 + <el-table-column prop="id" label="试卷ID" width="100"></el-table-column>
  62 + <el-table-column prop="title" label="试卷名称"></el-table-column>
  63 + <el-table-column prop="tag" label="测验类型" width="200"></el-table-column>
  64 + <el-table-column prop="questionNum" label="总题数" width="200"></el-table-column>
  65 + <el-table-column prop="realName" label="创建人" width="200"></el-table-column>
  66 + <el-table-column prop="createdTime" label="创建时间"></el-table-column>
  67 + <el-table-column prop="modifiedTime" label="删除时间"></el-table-column>
  68 + <el-table-column prop="createdTime" label="操作">
  69 + <template>
  70 + <el-button class="edit" type="text" size="mini" @click="modify(item)">
  71 + 恢复
  72 + </el-button>
  73 + <el-popconfirm title="确定删除这张答题卡吗?" @confirm="remove(item)">
  74 + <el-button style="color:red;margin-left: 10px;" slot="reference" class="delete"
  75 + type="text" size="mini">
  76 + 删除
  77 + </el-button>
  78 + </el-popconfirm>
  79 + </template>
  80 + </el-table-column>
  81 + </el-table>
  82 + </el-tab-pane>
  83 + <div slot="tab-bar">
  84 + <el-button type="primary" icon="el-icon-plus">新增</el-button>
  85 + </div>
  86 + </el-tabs>
  87 +
  88 + </div>
  89 + </el-main>
  90 + <el-footer class="el-footer-pagination">
  91 + <div class="el-footer-pagination-box">
  92 + <el-pagination background layout="prev, pager, next" :total="listPage.total">
  93 + </el-pagination>
  94 + </div>
  95 + </el-footer>
  96 + </el-container>
  97 +</template>
  98 +<script>
  99 +export default {
  100 + data() {
  101 + return {
  102 + dataType: "1",
  103 + importType: 0,
  104 + tabType: "0",
  105 + classList: [],
  106 + subjectList: [],
  107 + defaultList: [],
  108 + typeList: [],
  109 + sharedList: [],
  110 + query: {
  111 + type: 1,
  112 + classId: "",
  113 + subjectName: "",
  114 + tagId: "",
  115 + title: "",
  116 + },
  117 + listPage: {
  118 + page: 1,
  119 + size: 20,
  120 + total: 0,
  121 + },
  122 + query: {
  123 + title: "",
  124 + class: null,
  125 + subject: null,
  126 + dateRange: [
  127 + "2022-03-01", "2023-05-01"
  128 + ],
  129 + tagId: null
  130 + },
  131 + queryLoading: false,
  132 + createdCount: 0,
  133 + sharedCount: 0
  134 + }
  135 + },
  136 + async created() {
  137 + this.dataType = location.href.endsWith("askPreparationQuestionsRecycle") ? "1" : "2";
  138 + this.role =
  139 + this.$store.getters.info.showRole ||
  140 + this.$store.getters.info.permissions[0].role;
  141 +
  142 + await this._loadQueryDatas();
  143 + await this._serach();
  144 +
  145 + },
  146 + methods: {
  147 + async modify(obj) {
  148 + //恢复答题卡
  149 + let modifyPaper =
  150 + this.role == "ROLE_PERSONAL"
  151 + ? this.$request.pModifyPaper
  152 + : this.$request.modifyPaper;
  153 + const { data, status, info } = await modifyPaper({
  154 + paperId: obj.id,
  155 + status: 1,
  156 + });
  157 + if (status == 0) {
  158 + let type = this.query.title ? 1 : 0;
  159 + this._serach(type);
  160 + } else {
  161 + this.$message.error(info);
  162 + }
  163 + },
  164 + async remove(obj) {
  165 + //删除答题卡
  166 + let delPaper =
  167 + this.role == "ROLE_PERSONAL"
  168 + ? this.$request.pDelPaper
  169 + : this.$request.delPaper;
  170 + const { data, status, info } = await delPaper({
  171 + paperId: obj.id,
  172 + });
  173 + if (status == 0) {
  174 + let type = this.query.title ? 1 : 0;
  175 + this._serach(type);
  176 + } else {
  177 + this.$message.error(info);
  178 + }
  179 + },
  180 + async _changeClass() {
  181 + await this._loadSubjectData();
  182 + },
  183 + async _loadSubjectData() {
  184 + const fetchSubject =
  185 + this.role == "ROLE_BANZHUREN" ? this.$request.cTSubjectList :
  186 + this.role == "ROLE_PERSONAL" ? this.$request.pSubjectList : this.$request.tSubjectList;
  187 +
  188 + const { data, status, info } = await fetchSubject({
  189 + classId: this.query.class,
  190 + });
  191 +
  192 + if (status != 0) {
  193 + this.$message.error(info);
  194 + return;
  195 + }
  196 + this.subjectList = data?.subjectNames ?? [];
  197 + this.query.subject = data?.subjectNames[0] ?? "";
  198 + },
  199 + async _loadTypes() {
  200 + let fetchTypeNames =
  201 + this.role == "ROLE_PERSONAL"
  202 + ? this.$request.pPaperTagList
  203 + : this.$request.fetchTypeNames;
  204 +
  205 + const { data, status, info } = await fetchTypeNames({
  206 + classId: this.query.class,
  207 + type: 0,
  208 + });
  209 + if (status != 0) {
  210 + this.$message.error(info);
  211 + return;
  212 + }
  213 + this.typeList =
  214 + data.list.map((item) => {
  215 + return {
  216 + value: item.tagId,
  217 + label: item.tag,
  218 + };
  219 + }) || [];
  220 + this.typeList.unshift({
  221 + value: "",
  222 + label: "请选择标签",
  223 + });
  224 + this.query.tagId = "";
  225 + },
  226 + async _loadClassData() {
  227 + const fetchClassList =
  228 + this.role == "ROLE_BANZHUREN" ? this.$request.cTClassList :
  229 + this.role == "ROLE_PERSONAL" ? this.$request.pClassList : this.$request.tClassList;
  230 +
  231 + const { data, status, info } = await fetchClassList();
  232 +
  233 + if (status != 0) {
  234 + this.$message.error(info);
  235 + return;
  236 + }
  237 +
  238 + this.classList = data?.list ?? [];
  239 +
  240 + this.query.class = this.classList[0]?.classId
  241 + },
  242 + async _loadQueryDatas() {
  243 + this.$loading.open();
  244 + await this._loadClassData();
  245 + await this._loadSubjectData();
  246 + if (this.dataType == "2") await this._loadTypes();
  247 + this.$loading.close();
  248 + await this._serach();
  249 + },
  250 + async _serach() {
  251 + this.queryLoading = true;
  252 +
  253 + let fetchPaperList =
  254 + this.role == "ROLE_PERSONAL"
  255 + ? this.$request.pPaperList
  256 + : this.$request.fetchPaperList;
  257 +
  258 + var queryParams = {
  259 + classId: "",
  260 + subjectName: "",
  261 + tagId: "",
  262 + title: "",
  263 + type: this.dataType, //试卷类型
  264 + share: this.tabType, //分享类型
  265 + };
  266 +
  267 + queryParams.classId = this.query.class;
  268 + queryParams.subjectName = this.query.subject;
  269 + queryParams.tagId = this.query.tagId;
  270 + queryParams.title = this.query.paper;
  271 + // queryParams.start = this.query.dateRange[0];
  272 + // queryParams.end = this.query.dateRange[1];
  273 +
  274 + const { data, status, info } = await fetchPaperList({
  275 + ...queryParams,
  276 + status: 2,
  277 + page: this.listPage.page,
  278 + size: this.listPage.size
  279 + });
  280 +
  281 + if (status != 0) {
  282 + this.$message.error(info);
  283 + return;
  284 + }
  285 + this.queryLoading = false;
  286 + this.createdCount = data?.myCount || 0;
  287 + this.sharedCount = data?.gradeCount || 0;
  288 + this.listPage.total = data.total;
  289 + if (this.tabType == "0") {
  290 + this.defaultList = [];
  291 + if (data?.list) this.defaultList = [...data?.list];
  292 + }
  293 + else if (this.tabType == "1") {
  294 + this.sharedList = [];
  295 + if (data?.list) this.sharedList = [...data?.list];
  296 + }
  297 + },
  298 + }
  299 +}
  300 +</script>
  301 +<style>
  302 +.el-tabs__content {
  303 + padding-left: 20px !important;
  304 + padding-right: 20px !important;
  305 + padding-top: 20px !important;
  306 +}
  307 +</style>
0 308 \ No newline at end of file
... ...
src/views/basic/askTestQuestion/report.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <div class="default-title">{{ dataType == "1" ? '随堂问报表' : '即时测报表' }}</div>
  5 + </el-header>
  6 + <div class="default-filter">
  7 + <el-input v-model="query.paper" placeholder="报表名称" suffix-icon="el-icon-search" class="filter-input" type="number"
  8 + clearable />
  9 + <el-select @change="_changeClass" v-model="query.class" class="filter-select" placeholder="选择班级">
  10 + <el-option v-for="item in classList " :key="item.classId" :label="item.className" :value="item.classId" />
  11 + </el-select>
  12 + <el-select v-model="query.subject" v-if="role == 'ROLE_JIAOSHI'" placeholder="选择科目" class="filter-select">
  13 + <el-option v-for=" item in subjectList" :key="item" :label="item" :value="item" />
  14 + </el-select>
  15 + <el-select v-model="query.subjects" collapse-tags v-if="role == 'ROLE_BANZHUREN'" multiple placeholder="选择科目"
  16 + class="filter-select">
  17 + <el-option v-for="item in subjectList" :key="item" :label="item" :value="item">
  18 + <!-- <el-checkbox :checked="checkedSubject.indexOf(item) >= 0" @click="subjectCheck(item)">{{ item }}</el-checkbox> -->
  19 + </el-option>
  20 + </el-select>
  21 + <el-date-picker class="filter-datePicker" v-model="query.dateRange" type="daterange" range-separator="-"
  22 + value-format="yyyy-MM-dd">
  23 + </el-date-picker>
  24 + <el-button type="primary" @click="_serach"> 筛选 </el-button>
  25 + </div>
  26 + <el-main>
  27 + <div style="position: relative">
  28 + <el-tabs v-model="tabType" v-loading="queryLoading" type="card" class="default-tabs" :key="tabIndexs">
  29 + <el-tab-pane v-if="dataType == 1 && role == 'ROLE_JIAOSHI'" :name="'0'" :label="`阶段报表`">
  30 + <askSummaryReport ref="askSummaryReport" v-if="apiDatas.askReportIds" :askReportIds="apiDatas.askReportIds"
  31 + :queryParams="query" />
  32 + </el-tab-pane>
  33 + <el-tab-pane v-if="dataType == 1 && role == 'ROLE_JIAOSHI'" :name="'1'" :label="`单课时报表`">
  34 + <askListReport v-if="apiDatas.askReportList" :datas="apiDatas.askReportList" />
  35 + </el-tab-pane>
  36 + <el-tab-pane v-if="dataType == 1 && role == 'ROLE_BANZHUREN'" :name="'0'" :label="`多科表现`"
  37 + :queryParams="query">
  38 + <askBzrMulti v-if="apiDatas.askReportIds" :askReportIds="apiDatas.askReportIds" :queryParams="query" />
  39 + <!-- <askSummaryReport v-else-if="query.status == 'single'" :testReportIds="apiDatas.testReportIds"
  40 + :queryParams="query" /> -->
  41 + </el-tab-pane>
  42 + <el-tab-pane v-if="dataType == 2 && role == 'ROLE_JIAOSHI'" :name="'0'" :label="`阶段报表`">
  43 + <testSummaryReport v-if="apiDatas.testReportIds" :testReportIds="apiDatas.testReportIds"
  44 + :queryParams="query" />
  45 + </el-tab-pane>
  46 + <el-tab-pane v-if="dataType == 2 && role == 'ROLE_JIAOSHI'" :name="'1'" :label="`单卷报表`">
  47 + <testListReport :datas="apiDatas.testReportList" />
  48 + </el-tab-pane>
  49 + <el-tab-pane v-if="dataType == 2 && role == 'ROLE_JIAOSHI'" :name="'2'" :label="`多班对比报表`">
  50 + <testMultiClassReport :params="query" />
  51 + </el-tab-pane>
  52 + <el-tab-pane v-if="dataType == 2 && role == 'ROLE_BANZHUREN'" :name="'0'" :label="`多科表现`">
  53 + <testBzrMulti v-if="apiDatas.testReportIds" :list="apiDatas.testReportList"
  54 + :testReportIds="apiDatas.testReportIds" :queryParams="query" />
  55 +
  56 + <!-- <testSummaryReport v-else-if="apiDatas.testReportIds" :testReportIds="apiDatas.testReportIds"
  57 + :queryParams="query" /> -->
  58 + </el-tab-pane>
  59 + <div slot="tab-bar">
  60 + <el-button type="primary" icon="el-icon-plus">新增</el-button>
  61 + </div>
  62 + </el-tabs>
  63 + <el-button size='mini' v-if="role == 'ROLE_PERSONAL' || role == 'ROLE_JIAOSHI'" @click="_recycle"
  64 + style='position: absolute;right:40px;top:5px;'>查看回收站</el-button>
  65 +
  66 + </div>
  67 + </el-main>
  68 + </el-container>
  69 +</template>
  70 +
  71 +<script>
  72 +export default {
  73 + name: "repo",
  74 + components: {
  75 + askSummaryReport: () => import("./components/askSummaryReport.vue"),
  76 + askListReport: () => import("./components/askListReport.vue"),
  77 + testMultiClassReport: () => import("./components/testMultiClassReport.vue"),
  78 + testListReport: () => import("./components/testListReport.vue"),
  79 + testSummaryReport: () => import("./components/testSummaryReport.vue"),
  80 + testBzrMulti: () => import("./components/testBzrMulti.vue"),
  81 + askBzrMulti: () => import("./components/askBzrMulti.vue"),
  82 + },
  83 + data() {
  84 + return {
  85 + role: "",
  86 + classList: [],
  87 + subjectList: [],
  88 + tabIndexs: 0,
  89 + dataType: "1",
  90 + tabType: null,
  91 + checkedSubject: [],
  92 + listPage: {
  93 + page: 1,
  94 + size: 20,
  95 + total: 0,
  96 + },
  97 + query: {
  98 + status: "multi",
  99 + title: "",
  100 + class: null,
  101 + subject: null,
  102 + subjects: [],
  103 + dateRange: ["2022-03-01", "2026-05-01"],
  104 + classIds: null,
  105 + subjectName: null,
  106 + },
  107 + apiDatas: {
  108 + askReportIds: null,
  109 + askReportList: null,
  110 + testReportIds: null,
  111 + testReportList: null,
  112 + },
  113 + queryLoading: false,
  114 + };
  115 + },
  116 + watch: {
  117 + '$route'() {
  118 + this.dataType = location.href.endsWith("askReport") ? "1" : "2";
  119 + this._loadQueryDatas();
  120 + },
  121 + 'dataType'() {
  122 + if (this.dataType == "1") {
  123 + this.tabType = "0"
  124 + }
  125 + else if (this.dataType == "2") {
  126 + this.tabType = "0"
  127 + }
  128 + },
  129 + async 'query.subjects'(value) {
  130 + console.log(value)
  131 + if (this.role == "ROLE_BANZHUREN") {
  132 + if (value.length == 1 && value[0] != '全部科目') {
  133 + this.query.status = 'single';
  134 + await this._serach();
  135 + }
  136 + else {
  137 +
  138 + }
  139 + }
  140 +
  141 + }
  142 + },
  143 + async created() {
  144 + this.dataType = location.href.endsWith("askReport") ? "1" : "2";
  145 + this.code = this.$store.getters.csCode;
  146 + this.role =
  147 + this.$store.getters.info.showRole ||
  148 + this.$store.getters.info.permissions[0].role;
  149 + await this._loadQueryDatas();
  150 + },
  151 + methods: {
  152 + async _changeClass() {
  153 + await this._loadSubjectData();
  154 + },
  155 + async _loadSubjectData() {
  156 + const fetchSubject =
  157 + this.role == "ROLE_BANZHUREN"
  158 + ? this.$request.cTSubjectList
  159 + : this.role == "ROLE_PERSONAL"
  160 + ? this.$request.pSubjectList
  161 + : this.$request.tSubjectList;
  162 +
  163 + const { data, status, info } = await fetchSubject({
  164 + classId: this.query.class,
  165 + });
  166 +
  167 + if (status != 0) {
  168 + this.$message.error(info);
  169 + return;
  170 + }
  171 + this.subjectList = data?.subjectNames ?? [];
  172 + if (this.role == "ROLE_BANZHUREN") {
  173 + this.subjectList.unshift("全部科目");
  174 + }
  175 + this.query.subject = data?.subjectNames[0] ?? "";
  176 + this.checkedSubject = [...this.subjectList];
  177 + this.query.subjects = this.checkedSubject;
  178 + },
  179 + async _loadClassData() {
  180 + const fetchClassList =
  181 + this.role == "ROLE_BANZHUREN"
  182 + ? this.$request.cTClassList
  183 + : this.role == "ROLE_PERSONAL"
  184 + ? this.$request.pClassList
  185 + : this.$request.tClassList;
  186 +
  187 + const { data, status, info } = await fetchClassList();
  188 +
  189 + if (status != 0) {
  190 + this.$message.error(info);
  191 + return;
  192 + }
  193 + this.classList = data?.list ?? [];
  194 + this.query.class = this.classList[0]?.classId;
  195 + },
  196 + async _loadQueryDatas() {
  197 + // this.$loading.open();
  198 + await this._loadClassData();
  199 + await this._loadSubjectData();
  200 + // this.$loading.close();
  201 + await this._serach();
  202 + },
  203 + _recycle() { },
  204 + async _serach() {
  205 +
  206 + this.queryLoading = true;
  207 + var queryParams = {
  208 + classId: "",
  209 + classIds: [],
  210 + startDay: "",
  211 + endDay: "",
  212 + subjectNames: [],
  213 + };
  214 +
  215 + queryParams.classId = this.query.class;
  216 + queryParams.classIds = [this.query.class];
  217 + if (this.query.subjects) {
  218 + queryParams.subjectNames = this.query.subjects;
  219 + }
  220 + else {
  221 + queryParams.subjectNames = [this.query.subject];
  222 + }
  223 +
  224 + queryParams.startDay = this.query.dateRange
  225 + ? this.query.dateRange[0]
  226 + : "";
  227 + queryParams.endDay = this.query.dateRange ? this.query.dateRange[1] : "";
  228 +
  229 + if (this.dataType == "1") {
  230 + this.apiDatas.askReportList = [];
  231 + this.apiDatas.askReportIds = [];
  232 + let fetchReportList =
  233 + this.role == "ROLE_PERSONAL"
  234 + ? this.$request.pExamReportList
  235 + : this.$request.periodReportList;
  236 +
  237 + const askReportResponse = await fetchReportList({
  238 + ...queryParams,
  239 + page: this.page,
  240 + size: 9999,
  241 + });
  242 + if (askReportResponse.status != 0) {
  243 + this.$message.error(askReportResponse.info);
  244 + return;
  245 + }
  246 + this.apiDatas.askReportList = [...askReportResponse?.data?.list ?? []];
  247 + this.apiDatas.askReportIds = [... this.apiDatas?.askReportList?.map((item) => item.id) ?? []];
  248 +
  249 + if (this.$refs["askSummaryReport"]) {
  250 + this.$refs["askSummaryReport"].refresh();
  251 + }
  252 +
  253 + } else if (this.dataType == "2") {
  254 + this.apiDatas.testReportList = [];
  255 + this.apiDatas.testReportIds = [];
  256 + let fetchReportList =
  257 + this.role == "ROLE_PERSONAL"
  258 + ? this.$request.pExamReportList
  259 + : this.$request.examReportList;
  260 + const testReportResponse = await fetchReportList({
  261 + ...queryParams,
  262 + page: this.page,
  263 + size: 9999,
  264 + });
  265 + if (testReportResponse.status != 0) {
  266 + this.$message.error(testReportResponse.info);
  267 + return;
  268 + }
  269 + this.apiDatas.testReportList = [...testReportResponse?.data?.list ?? []];
  270 + this.apiDatas.testReportIds = [...this.apiDatas.testReportList?.map((item) => item.id) ?? []];
  271 + }
  272 + this.tabIndexs += 1;
  273 + this.queryLoading = false;
  274 +
  275 + },
  276 + _detailQ(id) {
  277 + let routerItem = {
  278 + path: "/askPreparationQuestionsDetail",
  279 + query: { id: id },
  280 + };
  281 + this.$router.push(routerItem);
  282 + },
  283 + _delete() { },
  284 + _updateQ(id) {
  285 + let routerItem = {
  286 + path: "/askPreparationQuestionsUpdate",
  287 + query: { paperId: id, paperType: 1 },
  288 + };
  289 + this.$router.push(routerItem);
  290 + },
  291 + async _deleteDetermineQ(id) {
  292 + let modifyPaper =
  293 + this.role == "ROLE_PERSONAL"
  294 + ? this.$request.pModifyPaper
  295 + : this.$request.modifyPaper;
  296 + const { data, status, info } = await modifyPaper({
  297 + paperId: id,
  298 + status: 2,
  299 + });
  300 + if (status != 0) {
  301 + this.$message.error(info);
  302 + }
  303 + this.page = 1;
  304 + this._serach();
  305 + }
  306 + },
  307 +};
  308 +</script>
  309 +<style lang="scss">
  310 +.el-tabs__content {
  311 + padding-left: 20px !important;
  312 + padding-right: 0px !important;
  313 + padding-top: 20px !important;
  314 +}
  315 +
  316 +.el-tabs__header {
  317 + margin: 0px !important;
  318 +}
  319 +
  320 +.card-content {
  321 + .descption-tag {
  322 + display: inline-block;
  323 + background: rgba(102, 127, 253, 0.1);
  324 + border-radius: 4px 4px 4px 4px;
  325 + color: #667ffd;
  326 + line-height: 32px;
  327 + padding: 0 10px;
  328 + height: 32px;
  329 + margin-right: 10px;
  330 + }
  331 +
  332 + margin-bottom: 10px;
  333 + height: 180px;
  334 + border: 1px solid #e6e9f4;
  335 + border-radius: 10px 10px 10px 10px;
  336 + box-shadow: 0px 4px 14px 0px rgba(0, 0, 0, 0.08);
  337 + margin-right: 20px;
  338 + background: #ffffff;
  339 +
  340 + .content {
  341 + margin-top: 15px !important;
  342 + padding-left: 10px !important;
  343 + font-size: 14px;
  344 + font-weight: 400;
  345 +
  346 + .descption-tag-text {
  347 + margin-bottom: 20px;
  348 + display: flex;
  349 + justify-content: flex-start;
  350 + align-items: center;
  351 + }
  352 +
  353 + .descption-text {
  354 + height: 30px;
  355 + margin-top: 10px;
  356 +
  357 + .descption-text-block {
  358 + margin-right: 10px;
  359 + display: flex;
  360 + justify-content: flex-start;
  361 +
  362 + .sharing-descption {
  363 + flex: 1;
  364 + color: gray;
  365 + opacity: 0.5;
  366 + text-align: right;
  367 + }
  368 +
  369 + img {
  370 + height: 20px;
  371 + width: 20px;
  372 + margin-right: 5px;
  373 + }
  374 + }
  375 + }
  376 +
  377 + .title-text {
  378 + font-weight: bold;
  379 + font-size: 20px;
  380 + color: #303133;
  381 + line-height: 28px;
  382 + height: 28px;
  383 + text-transform: none;
  384 + padding-bottom: 10px !important;
  385 +
  386 + .dropdown-button {
  387 + .el-button {
  388 + background-color: #667ffd !important;
  389 + color: white;
  390 + }
  391 +
  392 + float: right;
  393 + margin-right: 20px;
  394 + }
  395 + }
  396 + }
  397 +
  398 + .left {
  399 + height: 180px;
  400 + background-color: #41cc95;
  401 + vertical-align: middle;
  402 + border-radius: 10px 0px 0px 10px;
  403 +
  404 + .left-icon {
  405 + margin-top: 26px;
  406 + height: 70px;
  407 +
  408 + .icon {
  409 + height: 100px;
  410 + width: 100px;
  411 + background: rgba(255, 255, 255, 0.1);
  412 + border-radius: 61px 61px 61px 61px;
  413 + margin: auto;
  414 + text-align: center;
  415 +
  416 + img {
  417 + margin-top: 24px;
  418 + height: 52px;
  419 + width: 52px;
  420 + }
  421 + }
  422 +
  423 + .text {
  424 + width: 100%;
  425 + text-align: center;
  426 + margin-top: 5px;
  427 + font-size: 20px;
  428 + color: #ffffff;
  429 + }
  430 + }
  431 + }
  432 +
  433 + .right {
  434 + .el-button {
  435 + background-color: #667ffd;
  436 + line-height: 16px;
  437 + color: #ffffff;
  438 + margin-top: 15px;
  439 + padding: 10px 20px !important;
  440 + }
  441 + }
  442 +}
  443 +
  444 +.el-popconfirm__action {
  445 + margin-top: 10px;
  446 +}
  447 +</style>
... ...
src/views/basic/askTestQuestion/update.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <back-box class="detailBack">
  5 + <template slot="title">
  6 + <span class="default-title">
  7 + {{ type == 1 ? "修改试卷" : "修改答案" }}</span>
  8 + </template>
  9 + </back-box>
  10 + </el-header>
  11 + <el-main style="margin-top: 20px !important">
  12 + <div class="content">
  13 + <template v-if="type == 1">
  14 + <p class="tips" v-if="paperModifyLog.modifiedTime">
  15 + <i class="fa fa-bell-o"></i>
  16 + {{
  17 + `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
  18 + }}老师修改了答案
  19 + </p>
  20 + </template>
  21 + <div class="answer-title" :class="type == 1 ? 't-left' : ''">
  22 + <p class="name-box">
  23 + <span>试卷名称:</span>
  24 + <el-input class="ipt-name" v-model="form.title"></el-input>
  25 + </p>
  26 + <p class="name-box">
  27 + <span>分享范围:</span>
  28 + <el-radio class="name-radio" v-model="form.sharingType" :label="0">任课班级分享</el-radio>
  29 + <el-radio class="name-radio" @click.native="_selectClassSharingType" v-model="form.sharingType"
  30 + :label="1">自定义分享班级</el-radio>
  31 + </p>
  32 + </div>
  33 + <div class="question-box">
  34 + <div v-if="paperType == 1">
  35 + <div class="courseware">
  36 + <div class="courseware-title sub-questions">
  37 + <div class="qs-num">题号</div>
  38 + <div class="qs-stem">题干</div>
  39 + <div class="qs-type">题型</div>
  40 + <div class="qs-score">分数</div>
  41 + <div class="qs-partScore">漏选得分</div>
  42 + <div class="qs-options">选项设置</div>
  43 + <div class="qs-oprations">操作</div>
  44 + </div>
  45 + <div v-for="(question, index) in questionList">
  46 + <div class="courseware-content sub-questions" v-for="(subQuestion, subIndex) in question.subQuestions">
  47 + <div class="qs-num">{{ subQuestion.questionId }}</div>
  48 + <div class="qs-stem">
  49 + <iframe style="height: 100% !important" class="screenshot" :src="subQuestion.screenshot"></iframe>
  50 + </div>
  51 + <div class="qs-type">
  52 + <el-select v-model="subQuestion.questionType">
  53 + <el-option v-for="item in questionOption" :key="item.Key" :label="item.Text" :value="item.Key" />
  54 + </el-select>
  55 + </div>
  56 + <div class="qs-score">
  57 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
  58 + v-model="subQuestion.score" label="单题分值" />
  59 + </div>
  60 + <div class="qs-partScore">
  61 + <p v-if="subQuestion.questionType != 3">------</p>
  62 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  63 + :max="subQuestion.score" :step="0.5" v-model="subQuestion.partScore" label="漏选得分" />
  64 + </div>
  65 + <div class="qs-options">
  66 + <p v-if="subQuestion.questionType == 5">--</p>
  67 + <p v-if="subQuestion.questionType == 4" class="answer-box">
  68 + <span class="answer-s" :class="subQuestion.correctAnswer == 1 ? 'answer-active' : ''
  69 + " @click="subQuestion.correctAnswer = 1">✓</span>
  70 + <span class="answer-s" :class="subQuestion.correctAnswer == 2 ? 'answer-active' : ''
  71 + " @click="subQuestion.correctAnswer = 2">✗</span>
  72 + </p>
  73 + <p v-if="subQuestion.questionType == 3" class="answer-box">
  74 + <template v-for="option in subQuestion.answerOptions.split(',')">
  75 + <span v-if="option" class="answer-s" :class="subQuestion.correctAnswer.includes(option)
  76 + ? 'answer-active'
  77 + : ''
  78 + " :key="option" @click="changAnswer(subQuestion, option)">{{ option }}</span>
  79 + </template>
  80 + <span class="answer-s answer-opration" @click="openStem(subQuestion, 4, index, subIndex)">+</span>
  81 + <span class="answer-s answer-opration" @click="openStem(subQuestion, 4, index, subIndex)">-</span>
  82 + </p>
  83 + <p v-if="subQuestion.questionType == 2" class="answer-box">
  84 + <template v-for="option in subQuestion.answerOptions.split(',')">
  85 + <span class="answer-s" v-if="option" :class="subQuestion.correctAnswer == option
  86 + ? 'answer-active'
  87 + : ''
  88 + " :key="option" @click="subQuestion.correctAnswer = option">{{ option }}</span>
  89 + </template>
  90 + <span class="answer-s answer-opration" @click="openStem(subQuestion, 4, index, subIndex)">+</span>
  91 + <span class="answer-s answer-opration" @click="openStem(subQuestion, 5, index, subIndex)">-</span>
  92 + </p>
  93 + </div>
  94 + <div class="qs-oprations">
  95 + <div class="qs-set">
  96 + <el-button class="icon-tickets" type="text" circle size="mini"
  97 + @click="openStem(subQuestion, 1, index, subIndex)">修改题干</el-button>
  98 + </div>
  99 + <div class="qs-set">
  100 + <el-button class="icon-tickets" type="text" circle size="mini"
  101 + @click="openStem(subQuestion, 2, index, subIndex)">修改解析</el-button>
  102 + </div>
  103 + <div class="qs-set">
  104 + <el-button type="text" circle size="mini"
  105 + @click="openKnowledge(subQuestion, index, subIndex)">修改知识点</el-button>
  106 + </div>
  107 + <div class="qs-set">
  108 + <el-button type="text" circle size="mini"
  109 + @click="openStem(subQuestion, 3, index, subIndex)">删除</el-button>
  110 + </div>
  111 + </div>
  112 + </div>
  113 + </div>
  114 + </div>
  115 + </div>
  116 + <div v-if="paperType == 2">
  117 + <div class="paper"></div>
  118 + </div>
  119 + </div>
  120 + <el-dialog :close-on-click-modal="false" title="选择班级分享" :visible.sync="classSharingType" width="400"
  121 + :modal-append-to-body="false" :append-to-body="true">
  122 + <div>
  123 + <el-row class="row-subfix">
  124 + <div class="row-line">
  125 + <span class="line-subfix">年级:</span>
  126 + <span class="line-value">{{ gradeName }}</span>
  127 + </div>
  128 + </el-row>
  129 + <el-row class="row-subfix">
  130 + <span class="line-subfix" style="float: left;">班级:</span>
  131 + <div class="row-line" style="float: left;">
  132 + <span class="line-value" style=" border-radius: 4px; background: rgb(247,247,250);">
  133 + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll"
  134 + @change="handleCheckAllChange">全选</el-checkbox>
  135 + <el-checkbox-group v-model="checkedClass" @change="handleCheckedClassChange">
  136 + <el-checkbox v-for="(item, index) in gradeClass" :label="item.id" :key="item.id">{{
  137 + item.className }}</el-checkbox>
  138 + </el-checkbox-group>
  139 + </span>
  140 + </div>
  141 + </el-row>
  142 + <el-row class="row-subfix" style="float:right;margin-right: 20px;">
  143 + <el-button type="danger" @click="() => { classSharingType == false }">取消</el-button>
  144 + <el-button type="primary" @click="_checkedClass">确定</el-button>
  145 + </el-row>
  146 + </div>
  147 + </el-dialog>
  148 + <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400"
  149 + :modal-append-to-body="false" :append-to-body="true">
  150 + <div class="qs-options set-questions">
  151 + <p class="dia-tips">
  152 + 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
  153 + </p>
  154 + <p>{{ setSubPro(formAns.qusType) }}:</p>
  155 + <p class="ipt">
  156 + <el-input ref="formAnsIpt" v-if="formAns.qusType == 2 || formAns.qusType == 3"
  157 + v-model="formAns.answerList" @keydown.native="keydownAnswer($event, formAns.qusType)"
  158 + @input="setAllAnswer($event, formAns.qusType)"></el-input>
  159 + <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input>
  160 + </p>
  161 + <p class="answer-box">
  162 + <template v-if="formAns.qusType == 4">
  163 + <span class="answer-s answer-active" @click="
  164 + formAns.answerList.length < formAns.subNum
  165 + ? (formAns.answerList += '✓')
  166 + : ''
  167 + ">✓</span>
  168 + <span class="answer-s answer-active" @click="
  169 + formAns.answerList.length < formAns.subNum
  170 + ? (formAns.answerList += '✗')
  171 + : ''
  172 + ">✗</span>
  173 + </template>
  174 + <template v-if="formAns.qusType == 3">
  175 + <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option"
  176 + @click="setMultiple(formAns, option)">{{ option }}</span>
  177 + <span class="answer-s answer-active" @click="setMultiple(formAns, ',')">,</span>
  178 + </template>
  179 + <template v-if="formAns.qusType == 2">
  180 + <span class="answer-s answer-active" v-for="option in formAns.answerOptions.split(',')" :key="option"
  181 + @click="
  182 + formAns.answerList.length < formAns.subNum
  183 + ? (formAns.answerList += option)
  184 + : ''
  185 + ">{{ option }}</span>
  186 + </template>
  187 + <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
  188 + <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
  189 + </p>
  190 + </div>
  191 + <div class="dialog-footer" slot="footer">
  192 + <el-button @click="saveFormAns">确 定</el-button>
  193 + <el-button @click="diaSetAns = false">取 消</el-button>
  194 + </div>
  195 + </el-dialog>
  196 + <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem"
  197 + v-if="dialogStem" width="800px" :append-to-body="true">
  198 + <div class="upload-box">
  199 + <div v-loading="iframeLoading">
  200 + <template v-if="stem.type == 1">
  201 + <iframe ref="screenshot" class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"
  202 + @load="iframeLoading = false"></iframe>
  203 + </template>
  204 + <template v-else>
  205 + <iframe ref="screenshot" class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"
  206 + @load="iframeLoading = false"></iframe>
  207 + </template>
  208 + </div>
  209 + <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError"
  210 + accept="image/*">
  211 + <el-button size="small" type="primary">选择照片</el-button>
  212 + </el-upload>
  213 + </div>
  214 + <div slot="footer">
  215 + <el-button @click="dialogStem = false">确定</el-button>
  216 + </div>
  217 + </el-dialog>
  218 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500px"
  219 + :append-to-body="true">
  220 + <div>
  221 + <el-form ref="form" :model="stem" label-width="160px">
  222 + <el-form-item label="知识点:">
  223 + <el-cascader size="small" filterable :show-all-levels="false" clearable placeholder="选择知识点"
  224 + v-model="stem.knowledge" :options="knowledgeData" :props="{
  225 + expandTrigger: 'hover',
  226 + multiple: true,
  227 + checkStrictly: true,
  228 + }"></el-cascader>
  229 + </el-form-item>
  230 + </el-form>
  231 + </div>
  232 + <div slot="footer">
  233 + <el-button @click="dialogKnowledge = false">取 消</el-button>
  234 + <el-button type="primary" @click="setKnowledge">确 定</el-button>
  235 + </div>
  236 + </el-dialog>
  237 + </div>
  238 + <div class="content-fi">
  239 + <el-button type="danger" @click="linkBack">取消</el-button>
  240 + <el-button type="primary" @click="save">保存</el-button>
  241 + </div>
  242 + </el-main>
  243 + </el-container>
  244 +</template>
  245 +
  246 +<script>
  247 +import { deepClone, checkAnswer } from "utils";
  248 +import knowledgeList from "assets/js/knowledgeList.js";
  249 +export default {
  250 + data() {
  251 + return {
  252 + role: "",
  253 + title: "",
  254 + gradeName: "",
  255 + checkAll: false,
  256 + checkedClass: [],
  257 + gradeClass: [],
  258 + isIndeterminate: true,
  259 + type: 1, //1:答题卡 2:即时测报表题目列表 3:课时题目列表
  260 + questionList: [],
  261 + paperType: 1, //1 备题(随堂问) /2 组卷,
  262 + classId: -1,
  263 + //题型选项
  264 + questionOption: [
  265 + { Key: 2, Text: "单选题" },
  266 + { Key: 3, Text: "多选题" },
  267 + { Key: 4, Text: "判断题" },
  268 + { Key: 5, Text: "主观题" },
  269 + ],
  270 + classSharingType: false,
  271 + optionValues: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"],
  272 + //答题卡详情
  273 + form: {
  274 + examType: 2, //考试类型:0-未知/1-随堂问/2-即时测/3-xx考
  275 + title: "",
  276 + tag: "",
  277 + subjectId: "",
  278 + examsDuration: 90,
  279 + sharingType: -1,
  280 + sectionName: "",
  281 + gradeName: "",
  282 + share: 1,
  283 + questionList: [],
  284 + },
  285 + paperModifyLog: {
  286 + realName: "",
  287 + modifiedTime: "",
  288 + },
  289 + diaSetAns: false,
  290 + formAns: {
  291 + listIndex: 0, //大题位置
  292 + endIndex: 0, //相同题目最后一位题目的questionIndex
  293 + index: 0,
  294 + qusType: "", //题目类型
  295 + subNum: 0, //数量
  296 + answerOptions: [], //答案选项
  297 + answerList: "", //答案列表-字符串
  298 + },
  299 + //v1.5
  300 + dialogStem: false, //截图开关
  301 + dialogKnowledge: false, //知识点开关
  302 + knowledgeList: { ...knowledgeList },
  303 + classList: [],
  304 + stem: {
  305 + type: 1,
  306 + index: 0, //大题位置
  307 + indexs: 0, //小题位置
  308 + screenshot: "", //题干图片地址
  309 + answerScreenshot: "", //题目解析图片地址
  310 + knowledge: [], //知识点
  311 + },
  312 + gradeClassList: [], //学段列表
  313 + uploadUrl: "/file/uploadImgToHtml",
  314 + iframeLoading: false,
  315 + examType: 2,
  316 + };
  317 + },
  318 + computed: {
  319 + allScore: function () {
  320 + let score = 0;
  321 + this.questionList?.map((item) => {
  322 + if (item.subQuestions) {
  323 + score += item.subQuestions.reduce((a, b) => {
  324 + return a + (Number(b.score) || 0);
  325 + }, 0);
  326 + } else {
  327 + score += item.score || 0;
  328 + }
  329 + }, 0);
  330 + return Number(score).toFixed(2);
  331 + },
  332 + // 知识点列表 根据学段-科目筛选
  333 + knowledgeData: function () {
  334 + let jsons = [];
  335 + if (this.form.gradeName && this.form.subjectName) {
  336 + let sectionName = "";
  337 + this.gradeClassList?.map((item) => {
  338 + if (this.form.gradeName == item.gradeName) {
  339 + sectionName = item.sectionName;
  340 + }
  341 + });
  342 + if (
  343 + sectionName &&
  344 + Object.keys(this.knowledgeList).includes(sectionName)
  345 + ) {
  346 + if (
  347 + Object.keys(this.knowledgeList[sectionName]).includes(
  348 + this.form.subjectName
  349 + )
  350 + ) {
  351 + jsons = this.knowledgeList[sectionName][this.form.subjectName];
  352 + }
  353 + }
  354 + }
  355 + return jsons;
  356 + },
  357 + },
  358 + created() {
  359 + this.role =
  360 + this.$store.getters.info.showRole ||
  361 + this.$store.getters.info.permissions[0].role;
  362 + this.type = this.$route.query.type || 1;
  363 + this.examType = this.$route.query.examType || 2;
  364 + this.paperType = this.$route.query.paperType || 2;
  365 + this.classId = this.$route.query.classId || -1;
  366 + this.gradeName = this.$route.query.gradeName || "";
  367 + this.form.title = this.$route.query.title || "";
  368 + this._QueryDetail();
  369 + this._GradeList();
  370 + },
  371 + methods: {
  372 + _checkedClass() {
  373 + this.classSharingType = false;
  374 + },
  375 + handleCheckAllChange(val) {
  376 + this.checkedClass = val ? this.gradeClass : [];
  377 + this.isIndeterminate = false;
  378 + },
  379 + handleCheckedClassChange(value) {
  380 + let checkedCount = value.length;
  381 + this.checkAll = checkedCount === this.checkedClass.length;
  382 + this.isIndeterminate = checkedCount > 0 && checkedCount < this.checkedClass.length;
  383 + },
  384 + async _selectClassSharingType() {
  385 + this.classSharingType = true;
  386 + var classResponse = await this.$request.tClassFromGrade(this.classId);
  387 +
  388 + if (classResponse.status != 0) {
  389 + this.$message.error(classResponse.info);
  390 + }
  391 + this.gradeClass = classResponse.data;
  392 + },
  393 + // v1.5
  394 + //上传截图
  395 + openStem(obj, type, index, indexs) {
  396 + this.iframeLoading = true;
  397 + this.stem.type = type;
  398 + this.stem.index = index;
  399 + this.stem.indexs = indexs;
  400 + if (type == 1) {
  401 + if (!obj.screenshot || obj.screenshot == "") {
  402 + this.iframeLoading = false;
  403 + }
  404 + this.stem.screenshot = obj.screenshot || "";
  405 + this.stem.answerScreenshot = "";
  406 + return;
  407 + } else if (type == 3) {
  408 + } else if (type == 4) {
  409 + var current = this.questionList[index].subQuestions[indexs];
  410 + var currentOps = current.answerOptions.split(",");
  411 + if (currentOps.length >= this.optionValues.length) return;
  412 + current.answerOptions += "," + this.optionValues[currentOps.length];
  413 + return;
  414 + } else if (type == 5) {
  415 + var current = this.questionList[index].subQuestions[indexs];
  416 + var currentOps = current.answerOptions.split(",");
  417 + if (currentOps.length < 3) return;
  418 + current.answerOptions = currentOps
  419 + .splice(0, currentOps.length - 1)
  420 + .join(",");
  421 + return;
  422 + } else {
  423 + if (!obj.answerScreenshot || obj.answerScreenshot == "") {
  424 + this.iframeLoading = false;
  425 + }
  426 + this.stem.answerScreenshot = obj.answerScreenshot || "";
  427 + this.stem.screenshot = "";
  428 + }
  429 + this.dialogStem = true;
  430 + },
  431 + //图片上传成功
  432 + upSuccess(res, file) {
  433 + if (res && res.status == 0) {
  434 + if (this.stem.type == 1) {
  435 + this.stem.screenshot = res.data.url;
  436 + if (this.questionList[0]?.subQuestions) {
  437 + this.questionList[this.stem.index].subQuestions[
  438 + this.stem.indexs
  439 + ].screenshot = this.stem.screenshot;
  440 + } else {
  441 + this.questionList[this.stem.index].screenshot =
  442 + this.stem.screenshot;
  443 + }
  444 + } else {
  445 + this.stem.answerScreenshot = res.data.url;
  446 + if (this.questionList[0]?.subQuestions) {
  447 + this.questionList[this.stem.index].subQuestions[
  448 + this.stem.indexs
  449 + ].answerScreenshot = this.stem.answerScreenshot;
  450 + } else {
  451 + this.questionList[this.stem.index].answerScreenshot =
  452 + this.stem.answerScreenshot;
  453 + }
  454 + }
  455 +
  456 + this.$message.success("上传成功");
  457 + } else {
  458 + this.$message.error(res.info);
  459 + }
  460 + },
  461 + async _GradeList() {
  462 + let fetchClassList =
  463 + this.role == "ROLE_PERSONAL"
  464 + ? this.$request.pClassList
  465 + : this.$request.fetchClassList;
  466 +
  467 + const { data, status, info } = await fetchClassList();
  468 + if (status == 0) {
  469 + this.gradeClassList = data.list;
  470 + } else {
  471 + this.$message.error(info);
  472 + }
  473 + },
  474 + upError(res) {
  475 + this.$message.error("上传失败");
  476 + },
  477 + // 打开知识点
  478 + openKnowledge(obj, index, indexs) {
  479 + this.stem.index = index;
  480 + this.stem.indexs = indexs || 0;
  481 + this.stem.knowledge = (obj.knowledge && obj.knowledge.split("#")) || [];
  482 + this.dialogKnowledge = true;
  483 + },
  484 + // 选择知识点
  485 + setKnowledge() {
  486 + if (this.questionList[0]?.subQuestions) {
  487 + this.questionList[this.stem.index].subQuestions[
  488 + this.stem.indexs
  489 + ].knowledge = this.stem.knowledge.join("#");
  490 + } else {
  491 + this.questionList[this.stem.index].knowledge =
  492 + this.stem.knowledge.join("#");
  493 + }
  494 + this.dialogKnowledge = false;
  495 + },
  496 + //end
  497 +
  498 + linkBack() {
  499 + this.$router.go(-1);
  500 + },
  501 + setSubPro(type) {
  502 + let tit;
  503 + switch (type) {
  504 + case 2:
  505 + tit = "单选题";
  506 + break;
  507 + case 3:
  508 + tit = "多选题";
  509 + break;
  510 + case 4:
  511 + tit = "判断题";
  512 + break;
  513 + case 5:
  514 + tit = "主观题";
  515 + break;
  516 + }
  517 + return tit;
  518 + },
  519 + setBigNum(num) {
  520 + let txt = "";
  521 + let bigNum = [
  522 + "一",
  523 + "二",
  524 + "三",
  525 + "四",
  526 + "五",
  527 + "六",
  528 + "七",
  529 + "八",
  530 + "九",
  531 + "十",
  532 + "十一",
  533 + "十二",
  534 + "十三",
  535 + "十四",
  536 + "十五",
  537 + "十六",
  538 + "十七",
  539 + "十八",
  540 + "十九",
  541 + "二十",
  542 + ];
  543 + txt = bigNum[num];
  544 +
  545 + return txt;
  546 + },
  547 + //计算题号
  548 + setNum(index, indexs, sub) {
  549 + let lengths = 0; //所在大题之前的所有小题数量
  550 + let subIndex = 0; //所在大题的位置
  551 + for (let i = 0; i < index; i++) {
  552 + let subArr = this.questionList[i].subQuestions.filter((item) => {
  553 + return !!item.questionType;
  554 + });
  555 + lengths += subArr.length;
  556 + }
  557 + for (let i = 0; i < indexs; i++) {
  558 + if (!!this.questionList[index].subQuestions[i].questionType) {
  559 + subIndex += 1;
  560 + }
  561 + }
  562 + return lengths + subIndex + 1;
  563 + },
  564 + setScore(question) {
  565 + let score = question.subQuestions.reduce((a, b) => {
  566 + return a + (b.score || 0);
  567 + }, 0);
  568 + return Number(score).toFixed(2);
  569 + },
  570 + //设置多选答案
  571 + changAnswer(sub, option) {
  572 + let str = new RegExp(option, "g");
  573 + if (sub.correctAnswer?.includes(option)) {
  574 + sub.correctAnswer = sub.correctAnswer.replace(str, "");
  575 + } else {
  576 + let arrs = (sub.correctAnswer && sub.correctAnswer.split("")) || [];
  577 + arrs.push(option);
  578 + sub.correctAnswer = arrs.sort().join("");
  579 + }
  580 + },
  581 + keydownAnswer(event, type) {
  582 + let answerA = "ABCDEFG";
  583 + let answer_a = "abcdefg";
  584 + answerA = answerA.substring(0, this.formAns.subNum);
  585 + answer_a = answer_a.substring(0, this.formAns.subNum);
  586 + answerA += answer_a;
  587 + answerA = type == 2 ? answerA : answerA + ",";
  588 + if (
  589 + event.key == "Meta" ||
  590 + event.key == "CapsLock" ||
  591 + event.key == "Shift" ||
  592 + event.key == "Enter" ||
  593 + event.key == "Alt" ||
  594 + event.key == "Backspace" ||
  595 + event.key == "Delete" ||
  596 + event.key == "ArrowUp" ||
  597 + event.key == "ArrowDown" ||
  598 + event.key == "ArrowLeft" ||
  599 + event.key == "v" ||
  600 + event.key == "V" ||
  601 + event.key == "ArrowRight"
  602 + )
  603 + return;
  604 + if (!answerA.includes(event.key)) {
  605 + event.returnValue = "";
  606 + }
  607 + },
  608 + setAllAnswer(event, type) {
  609 + let str = this.formAns.answerList;
  610 + let str2 = checkAnswer(
  611 + str,
  612 + type,
  613 + this.formAns.answerOptions.split(",").length,
  614 + this.formAns.subNum
  615 + );
  616 + this.formAns.answerList = str2;
  617 + },
  618 + setAnswer(type, ans) {
  619 + let txt = "";
  620 + if (type == 2) {
  621 + txt = ans;
  622 + } else if (type == 3) {
  623 + txt = ans + ",";
  624 + } else if (type == 4) {
  625 + txt = ans == 1 ? "✓" : ans == 2 ? "✗" : "";
  626 + }
  627 + return txt;
  628 + },
  629 + insertTxtAndSetcursor(answerList, str) {
  630 + let element = this.$refs.formAnsIpt.$el.children[0]; // 获取到指定标签
  631 + let startPos = element.selectionStart; // 获取光标开始的位置
  632 + if (startPos === undefined) {
  633 + // 如果没有光标位置 不操作
  634 + return answerList;
  635 + } else {
  636 + return {
  637 + text:
  638 + answerList.substring(0, startPos) +
  639 + str +
  640 + answerList.substring(startPos), // 将文本插入
  641 + startPos: startPos + str.length,
  642 + };
  643 + }
  644 + },
  645 + //多选答案设置
  646 + setMultiple(obj, answer) {
  647 + let resault = this.insertTxtAndSetcursor(obj.answerList || "", answer);
  648 + obj.answerList = resault.text;
  649 + let str = obj.answerList;
  650 + let str2 = checkAnswer(
  651 + str,
  652 + 3,
  653 + obj.answerOptions.split(",").length,
  654 + obj.subNum
  655 + );
  656 + obj.answerList = str2;
  657 + this.$refs.formAnsIpt.$el.children[0].focus();
  658 + this.$refs.formAnsIpt.$el.children[0].selectionStart = resault.startPos;
  659 + },
  660 + //初始化要修改的答案
  661 + setFormAns(indexs, index) {
  662 + let answerList = "";
  663 + if (this.questionList[0]?.subQuestions) {
  664 + this.formAns = { ...this.questionList[index].subQuestions[indexs] };
  665 + this.formAns.listIndex = index;
  666 + let startIndex = indexs - this.formAns.subNum; //批量设置大难开始位置
  667 + this.questionList[index].subQuestions.map((item, subIdx) => {
  668 + if (subIdx >= startIndex && subIdx < indexs) {
  669 + answerList += this.setAnswer(item.questionType, item.correctAnswer);
  670 + if (item.qusType == 3) {
  671 + answerList = answerList.slice(0, -1);
  672 + }
  673 + }
  674 + });
  675 + } else {
  676 + this.formAns = { ...this.questionList[indexs] };
  677 + let startIndex = indexs - this.formAns.subNum; //批量设置开始位置
  678 + this.formAns.answerList = [];
  679 + this.formAns.listIndex = indexs;
  680 + this.questionList.map((item, subIdx) => {
  681 + if (subIdx >= startIndex && subIdx < indexs) {
  682 + answerList += this.setAnswer(item.questionType, item.correctAnswer);
  683 + if (item.qusType == 3) {
  684 + answerList = answerList.slice(0, -1);
  685 + }
  686 + }
  687 + });
  688 + }
  689 + this.formAns.answerList = answerList;
  690 + this.diaSetAns = true;
  691 + },
  692 + saveFormAns() {
  693 + //批量修改答案
  694 + let EndIndex;
  695 + let subNum = this.formAns.subNum - 1;
  696 + if (this.questionList[0]?.subQuestions) {
  697 + this.questionList[this.formAns.listIndex].subQuestions.some(
  698 + (item, index) => {
  699 + if (this.formAns.endIndex == item.questionIndex) {
  700 + EndIndex = index;
  701 + }
  702 + return this.formAns.endIndex == item.questionIndex;
  703 + }
  704 + );
  705 + } else {
  706 + this.questionList.some((item, index) => {
  707 + if (this.formAns.endIndex == item.questionIndex) {
  708 + EndIndex = index;
  709 + }
  710 + return this.formAns.endIndex == item.questionIndex;
  711 + });
  712 + }
  713 +
  714 + for (let i = 0; i <= subNum; i++) {
  715 + let correctAnswer = "";
  716 + if (this.formAns.qusType == 2) {
  717 + correctAnswer = this.formAns.answerList[subNum - i] || "";
  718 + } else if (this.formAns.qusType == 3) {
  719 + correctAnswer = this.formAns.answerList.split(",")[subNum - i] || "";
  720 + } else if (this.formAns.qusType == 4) {
  721 + correctAnswer =
  722 + this.formAns.answerList[subNum - i] == "✓"
  723 + ? 1
  724 + : this.formAns.answerList[subNum - i] == "✗"
  725 + ? 2
  726 + : "";
  727 + }
  728 + if (this.questionList[0]?.subQuestions) {
  729 + this.questionList[this.formAns.listIndex].subQuestions[
  730 + EndIndex - i
  731 + ].correctAnswer = correctAnswer;
  732 + } else {
  733 + this.questionList[EndIndex - i].correctAnswer = correctAnswer;
  734 + }
  735 + }
  736 + this.diaSetAns = false;
  737 + },
  738 + async save() {
  739 +
  740 + for (let i = 0; i < this.questionList.length; i++) {
  741 + if (this.questionList[0]?.subQuestions) {
  742 + for (let j = 0; j < this.questionList[i].subQuestions.length; j++) {
  743 + if (this.questionList[i].subQuestions[j].qusType) {
  744 + this.questionList[i].subQuestions.splice(j, 1);
  745 + }
  746 + }
  747 + } else {
  748 + if (this.questionList[i].qusType) {
  749 + this.questionList.splice(i, 1);
  750 + i--;
  751 + }
  752 + }
  753 + }
  754 + let questionList = this.questionList.map((item) => {
  755 + item.score = null;
  756 + // item.questionId = "";
  757 + // item.questionIndex = "";
  758 + return item;
  759 + });
  760 + //更新答题卡
  761 + let modifyPaper, params;
  762 + console.log(this.type)
  763 + if (this.type == 1) {
  764 + modifyPaper =
  765 + this.role == "ROLE_PERSONAL"
  766 + ? this.$request.pModifyPaper
  767 + : this.$request.modifyPaper;
  768 + params = {
  769 + classIds: this.checkedClass,
  770 + sharingType: this.form.sharingType,
  771 + paperId: this.$route.query.paperId,
  772 + questionList: questionList,
  773 + };
  774 + console.log(params)
  775 + } else if (this.type == 2) {
  776 + modifyPaper =
  777 + this.role == "ROLE_PERSONAL"
  778 + ? this.$request.pSetExamAnswer
  779 + : this.$request.setExamAnswer;
  780 + params = {
  781 + examId: this.$route.query.paperId,
  782 + questionList: questionList,
  783 + };
  784 + } else {
  785 + modifyPaper =
  786 + this.role == "ROLE_PERSONAL"
  787 + ? this.$request.pSetPeriodAnswer
  788 + : this.$request.setPeriodAnswer;
  789 + params = {
  790 + periodId: this.$route.query.paperId,
  791 + questionList: questionList,
  792 + };
  793 + }
  794 + const { data, status, info } = await modifyPaper({
  795 + title: this.form.title,
  796 + ...params,
  797 + });
  798 + if (status == 0) {
  799 + this.$router.go(-1);
  800 + } else {
  801 + this.$message.error(message);
  802 + }
  803 + },
  804 + async _QueryDetail() {
  805 + //查询详情
  806 + let detail;
  807 + if (this.role == "ROLE_PERSONAL") {
  808 + detail =
  809 + this.type == 1
  810 + ? this.$request.pPaperDetail
  811 + : this.type == 2
  812 + ? this.$request.pExamQuestionList
  813 + : this.$request.pPeriodQuestionList;
  814 + } else {
  815 + detail =
  816 + this.type == 1
  817 + ? this.$request.fetchPaperDetail
  818 + : this.type == 2
  819 + ? this.$request.examQuestionList
  820 + : this.$request.periodQuestionList;
  821 + }
  822 + let params =
  823 + this.type == 1
  824 + ? { paperId: this.$route.query.paperId }
  825 + : this.type == 2
  826 + ? { examId: this.$route.query.paperId }
  827 + : {
  828 + periodId: this.$route.query.paperId,
  829 + };
  830 + const { data, status, info } = await detail(params);
  831 + if (status == 0) {
  832 + let questionList;
  833 + if (this.type == 1) {
  834 + //修改答案信息
  835 + this.paperModifyLog = {
  836 + ...this.paperModifyLog,
  837 + ...this.form.paperModifyLog,
  838 + };
  839 + this.form = deepClone(data);
  840 + console.log(this.form.sharingType)
  841 + questionList = this.form.questionList.map((item) => {
  842 + if (item.subQuestions) {
  843 + item.subQuestions.map((subQuestion) => {
  844 + subQuestion.questionType == 2 || subQuestion.questionType == 3
  845 + ? (subQuestion.answerOptions =
  846 + subQuestion.answerOptions || "A,B,C,D")
  847 + : "";
  848 + subQuestion.correctAnswer = subQuestion.correctAnswer || "";
  849 + });
  850 + } else {
  851 + item.questionType == 2 || item.questionType == 3
  852 + ? (item.answerOptions = item.answerOptions || "A,B,C,D")
  853 + : "";
  854 + item.correctAnswer = item.correctAnswer || "";
  855 + }
  856 + return item;
  857 + });
  858 + } else {
  859 + questionList = data.list.sort((a, b) => {
  860 + return a.questionIndex - b.questionIndex;
  861 + });
  862 + }
  863 + this.questionList = questionList;
  864 + this.formateQuestion();
  865 + } else {
  866 + this.$message.error(info);
  867 + }
  868 + },
  869 + formateQuestion() {
  870 + let arr = this.questionList;
  871 + if (arr[0]?.subQuestions) {
  872 + this.questionList = arr.map((item) => {
  873 + let types = [{}];
  874 + let addndex = 0;
  875 + item.subQuestions.map((sub, index) => {
  876 + if (!!sub.questionType) {
  877 + if (
  878 + sub.questionType == types[addndex].qusType &&
  879 + sub.questionType != 5
  880 + ) {
  881 + //同类型批量答案+1
  882 + types[addndex].subNum += 1;
  883 + if (
  884 + types[addndex].answerOptions.length < sub.answerOptions.length
  885 + ) {
  886 + types[addndex].answerOptions = sub.answerOptions;
  887 + }
  888 + types[addndex].answerList += this.setAnswer(
  889 + sub.questionType,
  890 + sub.correctAnswer
  891 + );
  892 + if (index == item.subQuestions.length - 1) {
  893 + //循环最后类型数量大于等于5,保存批量答案
  894 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  895 + types[addndex].endIndex = sub.questionIndex;
  896 + types[addndex].index = index;
  897 + }
  898 + }
  899 + } else {
  900 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  901 + //不同类型时如果原有类型数量大于等于5,保存批量答案
  902 + types[addndex].endIndex =
  903 + item.subQuestions[index - 1].questionIndex;
  904 + types[addndex].index = index - 1;
  905 + addndex += 1;
  906 + types[addndex] = {};
  907 + }
  908 + //不同类型初始化批量答案
  909 + types[addndex].qusType = sub.questionType;
  910 + types[addndex].subNum = 1;
  911 + types[addndex].answerOptions = sub.answerOptions;
  912 + types[addndex].answerList = this.setAnswer(
  913 + sub.questionType,
  914 + sub.correctAnswer
  915 + );
  916 + }
  917 + }
  918 + });
  919 + for (let i = 0; i < types.length; i++) {
  920 + if (types[i].qusType == 3) {
  921 + types[i].answerList = types[i].answerList.slice(0, -1);
  922 + }
  923 + if (types[i].subNum >= 5) {
  924 + item.subQuestions.splice(
  925 + types[i].index + i + 1,
  926 + 0,
  927 + deepClone(types[i])
  928 + );
  929 + }
  930 + }
  931 + return item;
  932 + });
  933 + } else {
  934 + let types = [{}];
  935 + let addndex = 0;
  936 + this.questionList = arr.map((sub, index) => {
  937 + if (!!sub.questionType) {
  938 + if (
  939 + sub.questionType == types[addndex].qusType &&
  940 + sub.questionType != 5
  941 + ) {
  942 + //同类型批量答案+1
  943 + types[addndex].subNum += 1;
  944 + //最大选项
  945 + if (
  946 + types[addndex].answerOptions.length < sub.answerOptions.length
  947 + ) {
  948 + types[addndex].answerOptions = sub.answerOptions;
  949 + }
  950 + types[addndex].answerList += this.setAnswer(
  951 + sub.questionType,
  952 + sub.correctAnswer
  953 + );
  954 +
  955 + if (index == arr.length - 1) {
  956 + //循环最后类型数量大于等于5,保存批量答案
  957 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  958 + types[addndex].endIndex = sub.questionIndex;
  959 + types[addndex].index = index;
  960 + }
  961 + }
  962 + } else {
  963 + if (types[addndex].subNum && types[addndex].subNum >= 5) {
  964 + //不同类型时如果原有类型数量大于等于5,保存批量答案
  965 + types[addndex].endIndex =
  966 + this.questionList[index - 1].questionIndex;
  967 + types[addndex].index = index - 1;
  968 + addndex += 1;
  969 + types[addndex] = {};
  970 + }
  971 + //不同类型初始化批量答案
  972 + types[addndex].qusType = sub.questionType;
  973 + types[addndex].subNum = 1;
  974 + types[addndex].answerOptions = sub.answerOptions;
  975 + types[addndex].answerList = this.setAnswer(
  976 + sub.questionType,
  977 + sub.correctAnswer
  978 + );
  979 + }
  980 + }
  981 + return sub;
  982 + });
  983 + for (let i = 0; i < types.length; i++) {
  984 + if (types[i].qusType == 3) {
  985 + types[i].answerList = types[i].answerList.slice(0, -1);
  986 + }
  987 + if (types[i].subNum >= 5) {
  988 + this.questionList.splice(
  989 + types[i].index + i + 1,
  990 + 0,
  991 + deepClone(types[i])
  992 + );
  993 + }
  994 + }
  995 + }
  996 + },
  997 + },
  998 +};
  999 +</script>
  1000 +<style>
  1001 +.screenshot-box {
  1002 + width: 600px;
  1003 +}
  1004 +
  1005 +.screenshot {
  1006 + width: 100%;
  1007 + box-shadow: none;
  1008 + border: none;
  1009 + height: 400px;
  1010 +}
  1011 +
  1012 +.screenshot-img {
  1013 + display: block;
  1014 + width: auto;
  1015 + max-width: 100%;
  1016 + margin: 0 auto;
  1017 + margin-bottom: 10px;
  1018 +}
  1019 +</style>
  1020 +<style lang="scss" scoped>
  1021 +.content-fi {
  1022 + padding-top: 7px;
  1023 + width: 200px;
  1024 + margin: 0px auto;
  1025 +}
  1026 +
  1027 +.content {
  1028 + * {
  1029 + font-size: 14px;
  1030 + font-weight: 400;
  1031 + }
  1032 +
  1033 + height: calc(100% - 60px);
  1034 + overflow-y: auto;
  1035 + width: 100%;
  1036 + box-sizing: border-box;
  1037 + padding: 0px 20px;
  1038 +
  1039 + .ml-20 {
  1040 + margin-left: 20px;
  1041 + }
  1042 +
  1043 + .btn-box {
  1044 + width: 120px;
  1045 + background-color: Red !important;
  1046 + // width: calc(100% - 240px);
  1047 + // position: fixed;
  1048 + // right: 40px;
  1049 + // bottom: 20px;
  1050 + // padding: 10px 0 5px;
  1051 + // background: #fff;
  1052 + // text-align: center;
  1053 + // margin-left: 140px;
  1054 + // z-index: 10;
  1055 + }
  1056 +
  1057 + .tips {
  1058 + height: 48px;
  1059 + line-height: 48px;
  1060 + padding: 0 16px;
  1061 + border: 1px solid #fac7cc;
  1062 + background-color: #ffebec;
  1063 + font-size: 14px;
  1064 + color: #fd9795;
  1065 + margin: 10px 0 20px 0;
  1066 +
  1067 + .fa-bell-o {
  1068 + font-size: 18px;
  1069 + margin-right: 5px;
  1070 + }
  1071 + }
  1072 +}
  1073 +
  1074 +.answer-title {
  1075 + text-align: center;
  1076 + font-size: 20px;
  1077 + color: #333;
  1078 + font-weight: 700;
  1079 + padding-top: 20px;
  1080 + padding-bottom: 10px;
  1081 +
  1082 + &.t-left {
  1083 + text-align: left;
  1084 + }
  1085 +
  1086 + .totals {
  1087 + font-size: 16px;
  1088 + color: #666;
  1089 + font-weight: normal;
  1090 + }
  1091 +
  1092 + .name-box {
  1093 + display: flex;
  1094 + white-space: nowrap;
  1095 + align-items: center;
  1096 + margin-bottom: 20px;
  1097 + font-weight: normal;
  1098 +
  1099 + :deep(.el-input__inner) {
  1100 + color: #333;
  1101 + font-weight: 700;
  1102 + }
  1103 +
  1104 + .name-radio {
  1105 + line-height: 1;
  1106 + }
  1107 + }
  1108 +}
  1109 +
  1110 +.question-title {
  1111 + line-height: 40px;
  1112 +
  1113 + .ipt {
  1114 + width: 300px;
  1115 + margin: 0 16px 0 10px;
  1116 +
  1117 + :deep(.el-input__inner) {
  1118 + border-radius: 20px;
  1119 + border-color: #667ffd;
  1120 + background: rgba($color: #667ffd, $alpha: 0.05);
  1121 + }
  1122 + }
  1123 +
  1124 + .delete {
  1125 + margin-right: 8px;
  1126 + }
  1127 +
  1128 + .title-txt {
  1129 + margin-right: 20px;
  1130 + font-size: 16px;
  1131 + font-weight: 700;
  1132 + }
  1133 +}
  1134 +
  1135 +.question-box {
  1136 + margin-bottom: 20px;
  1137 +
  1138 + .screenshot-box {
  1139 + width: 100%;
  1140 + border: 1px solid #e2e2e2;
  1141 + margin-bottom: 20px;
  1142 +
  1143 + .screenshot-img {
  1144 + margin: 0;
  1145 + }
  1146 + }
  1147 +}
  1148 +
  1149 +.set-ans-btn {
  1150 + width: 100%;
  1151 + padding: 10px 0 10px 630px;
  1152 + box-sizing: border-box;
  1153 + border-bottom: 1px solid #e2e2e2;
  1154 + border-right: 1px solid #e2e2e2;
  1155 +}
  1156 +
  1157 +.el-input-number {
  1158 + width: 140px;
  1159 +}
  1160 +
  1161 +.delete {
  1162 + margin-left: 8px;
  1163 +}
  1164 +
  1165 +.questions-ul {
  1166 + border-left: 1px solid #e2e2e2;
  1167 + border-top: 1px solid #e2e2e2;
  1168 + margin: 12px 0;
  1169 +}
  1170 +
  1171 +.questions-ul2 {
  1172 + margin: 0;
  1173 + border-top: none;
  1174 +
  1175 + &:nth-child(1) {
  1176 + border-top: 1px solid #e2e2e2;
  1177 + }
  1178 +}
  1179 +
  1180 +.courseware-content {
  1181 + background-color: rgb(245, 247, 250);
  1182 + margin-top: 10px;
  1183 + height: 80px;
  1184 + border-radius: 5px;
  1185 +}
  1186 +
  1187 +.sub-questions {
  1188 + width: 100%;
  1189 + display: flex;
  1190 + // border-bottom: 1px solid #e2e2e2;
  1191 +
  1192 + &>div {
  1193 + .answer-active {
  1194 + background: rgba(65, 204, 149, 1);
  1195 + color: white;
  1196 + }
  1197 +
  1198 + min-height: 40px;
  1199 + padding: 5px;
  1200 + flex-shrink: 0;
  1201 + // border-right: 1px solid #e2e2e2;
  1202 + display: flex;
  1203 + justify-content: center;
  1204 + align-items: center;
  1205 + }
  1206 +
  1207 + .qs-num {
  1208 + width: 80px;
  1209 + }
  1210 +
  1211 + .qs-stem {
  1212 + width: 180px;
  1213 + }
  1214 +
  1215 + .qs-type {
  1216 + width: 130px;
  1217 + }
  1218 +
  1219 + .qs-score,
  1220 + .qs-partScore {
  1221 + width: 160px;
  1222 +
  1223 + .el-input-number__decrease,
  1224 + .el-input-number__increase {
  1225 + background: white !important;
  1226 + }
  1227 + }
  1228 +
  1229 + .qs-set {
  1230 + width: 80px;
  1231 + }
  1232 +
  1233 + .qs-oprations {
  1234 + width: 300px;
  1235 + }
  1236 +
  1237 + .qs-options {
  1238 + flex: 1;
  1239 + }
  1240 +
  1241 + // .qs-options2 {
  1242 + // text-align: left;
  1243 + // justify-content: flex-start;
  1244 + // // padding-left: 20px;
  1245 + // }
  1246 +
  1247 + .answer-s {
  1248 + cursor: pointer;
  1249 + margin-right: 2px;
  1250 + margin-bottom: 5px;
  1251 + background-color: white;
  1252 + }
  1253 +
  1254 + .answer-opration {
  1255 + background-color: rgb(107, 126, 245);
  1256 + color: white;
  1257 + font-size: 22px;
  1258 + line-height: 1;
  1259 + height: 32px;
  1260 + width: 32px;
  1261 + line-height: 30px;
  1262 + border-radius: 32px;
  1263 + }
  1264 +
  1265 + :deep(.el-select) {
  1266 + // .el-input__inner {
  1267 + // border-radius: 20px;
  1268 + // border-color: #667ffd;
  1269 + // width: 150px;
  1270 + // height: 32px;
  1271 + // line-height: 32px;
  1272 + // background: rgba($color: #667ffd, $alpha: 0.05);
  1273 + // }
  1274 +
  1275 + .el-input__icon {
  1276 + line-height: 32px;
  1277 + }
  1278 + }
  1279 +}
  1280 +
  1281 +.set-questions {
  1282 + .answer-box {
  1283 + .answer-s {
  1284 + cursor: pointer;
  1285 + user-select: none;
  1286 +
  1287 + &:first-of-type {
  1288 + margin-left: 0;
  1289 + }
  1290 + }
  1291 + }
  1292 +}
  1293 +
  1294 +.upload-box {
  1295 + .upload-demo {
  1296 + text-align: center;
  1297 + }
  1298 +
  1299 + .stem-pic {
  1300 + display: block;
  1301 + margin: 0 auto 20px;
  1302 + max-width: 100%;
  1303 + max-height: 200px;
  1304 + object-fit: cover;
  1305 + }
  1306 +}
  1307 +
  1308 +.row-subfix {
  1309 + margin-bottom: 10px;
  1310 +}
  1311 +</style>
... ...
src/views/basic/askTestQuestion/view.vue 0 → 100644
  1 +<template>
  2 + <el-container class="default-body">
  3 + <el-header>
  4 + <back-box class="detailBack">
  5 + <template slot="title">
  6 + <span class="default-title">查看课件</span>
  7 + </template>
  8 + </back-box>
  9 + </el-header>
  10 + <div class="default-filter">
  11 + <div class="default-title">
  12 + {{ detail.title }}
  13 + </div>
  14 + </div>
  15 + <el-main>
  16 + <div class="question-box">
  17 + <template v-for="question in detail.questionList">
  18 + <template v-if="!question.subQuestions">
  19 + <div class="screenshot-box" v-if="question.screenshot">
  20 + <iframe @load="adjustIframe" class="screenshot" :src="question.screenshot"></iframe>
  21 + </div>
  22 + </template>
  23 + <template v-else>
  24 + <div v-for="subQuestions in question.subQuestions">
  25 + <div class="screenshot-box" v-if="subQuestions.screenshot">
  26 + <iframe class="screenshot" :src="subQuestions.screenshot"></iframe>
  27 + </div>
  28 + </div>
  29 + </template>
  30 + </template>
  31 + </div>
  32 + </el-main>
  33 + </el-container>
  34 +</template>
  35 +<script>
  36 +export default {
  37 + data() {
  38 + return {
  39 + query: null,
  40 + detail: {}
  41 + }
  42 + },
  43 + async created() {
  44 + this.query = this.$route.query
  45 + await this._loadQuestion();
  46 + },
  47 + mounted() {
  48 + // this.$nextTick(() => {
  49 + // var screents = document.getElementsByClassName('screenshot');
  50 + // console.log(screents,screents.length)
  51 + // for (var isc = 0; isc < screents.length; isc++) {
  52 + // var currentIsc = screents[isc]
  53 +
  54 + // console.log(currentIsc.scrollHeight, currentIsc.clientHeight);
  55 + // if (currentIsc.scrollHeight > currentIsc.clientHeight) {
  56 + // console.log(currentIsc.scrollHeight, currentIsc.clientHeight);
  57 + // }
  58 + // }
  59 + // });
  60 + },
  61 + methods: {
  62 + adjustIframe(){},
  63 + async _loadQuestion() {
  64 + this.$loading.open();
  65 + const { data, status, info } = await this.$request.tPaperDetail({
  66 + paperId: this.query.id
  67 + });
  68 + this.$loading.close();
  69 + if (status != 0) {
  70 + this.$message.error(info);
  71 + return;
  72 + }
  73 + this.detail = data;
  74 + }
  75 + }
  76 +}
  77 +</script>
  78 +<style scoped>
  79 +.default-filter {
  80 + margin-bottom: 0px !important;
  81 +
  82 + .default-title {
  83 + text-align: center;
  84 + height: 80px;
  85 + line-height: 80px;
  86 + }
  87 +}
  88 +
  89 +.question-box {
  90 + margin-bottom: 20px;
  91 + padding: 20px;
  92 +
  93 + .screenshot-box {
  94 + width: 100%;
  95 + border: 1px solid #e2e2e2;
  96 + margin-bottom: 20px;
  97 +
  98 + .screenshot-img {
  99 + margin: 0;
  100 + }
  101 +
  102 + .screenshot {
  103 + min-height: 40px;
  104 + }
  105 + }
  106 +}
  107 +</style>
0 108 \ No newline at end of file
... ...
src/views/basic/dataSync/index.vue
... ... @@ -41,7 +41,7 @@
41 41 </div>
42 42 </div>
43 43 </div>
44   - <el-dialog :close-on-click-modal="false" title="" :visible.sync="dialogVisible" width="300" center>
  44 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="" :visible.sync="dialogVisible" width="300" center>
45 45 <el-result icon="success" title="上传成功"> </el-result>
46 46 <el-descriptions title="" :column="1">
47 47 <el-descriptions-item label="导入答题卡数量">{{ tipData.paperNum }}</el-descriptions-item>
... ...
src/views/basic/device/error.vue
... ... @@ -106,7 +106,7 @@
106 106 </el-pagination>
107 107 </div>
108 108 </div>
109   - <el-dialog
  109 + <el-dialog :append-to-body="true"
110 110 :close-on-click-modal="false"
111 111 title="备注"
112 112 :visible.sync="diaNotes"
... ...
src/views/basic/device/index.vue
... ... @@ -532,7 +532,7 @@
532 532 </div>
533 533 </div>
534 534 </div>
535   - <el-dialog
  535 + <el-dialog :append-to-body="true"
536 536 :close-on-click-modal="false"
537 537 title="设备导入"
538 538 :visible.sync="diaUp"
... ... @@ -548,7 +548,7 @@
548 548 <el-button @click="diaUp = false">取 消</el-button>
549 549 </div>
550 550 </el-dialog>
551   - <el-dialog
  551 + <el-dialog :append-to-body="true"
552 552 :close-on-click-modal="false"
553 553 :title="isAdd ? '添加基站' : '修改基站'"
554 554 :visible.sync="diaAnswerEqu"
... ... @@ -625,7 +625,7 @@
625 625 <el-button @click="diaAnswerEqu = false">取 消</el-button>
626 626 </div>
627 627 </el-dialog>
628   - <el-dialog
  628 + <el-dialog :append-to-body="true"
629 629 :close-on-click-modal="false"
630 630 title="设备日志"
631 631 :visible.sync="diaLog"
... ...
src/views/basic/setUp/PersonalStudent.vue
... ... @@ -90,7 +90,7 @@
90 90 </div>
91 91 </div>
92 92 </div>
93   - <el-dialog :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400">
  93 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400">
94 94 <el-form
95 95 ref="formBox"
96 96 :model="formStu"
... ... @@ -140,7 +140,7 @@
140 140 <el-button @click="diaStu = false">取 消</el-button>
141 141 </div>
142 142 </el-dialog>
143   - <el-dialog :close-on-click-modal="false"
  143 + <el-dialog :append-to-body="true" :close-on-click-modal="false"
144 144 :title="formClass.classId ? '修改班级' : '添加班级'"
145 145 :visible.sync="diaClass"
146 146 width="400"
... ... @@ -194,7 +194,7 @@
194 194 >
195 195 </div>
196 196 </el-dialog>
197   - <el-dialog :close-on-click-modal="false" title="学生导入" :visible.sync="diaUp" width="600">
  197 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="学生导入" :visible.sync="diaUp" width="600">
198 198 <upload :url="url" @upSuccess="upSuccess" fileName="学生模板">
199 199 <p class="down-txt" slot="down">
200 200 通过Excel名单导入学生模板,点击
... ...
src/views/basic/setUp/account.vue
... ... @@ -213,7 +213,7 @@
213 213 </el-pagination>
214 214 </div>
215 215 </div>
216   - <el-dialog :close-on-click-modal="false" title="修改账号信息" :visible.sync="diaCount" width="400">
  216 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改账号信息" :visible.sync="diaCount" width="400">
217 217 <el-form
218 218 class="form-box"
219 219 :model="formCount"
... ... @@ -249,7 +249,7 @@
249 249 <el-button @click="diaCount = false">取 消</el-button>
250 250 </div>
251 251 </el-dialog>
252   - <el-dialog :close-on-click-modal="false" title="添加账号" :visible.sync="diaAdd" width="400">
  252 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="添加账号" :visible.sync="diaAdd" width="400">
253 253 <el-form
254 254 class="form-box"
255 255 :model="formAddCount"
... ... @@ -349,7 +349,7 @@
349 349 <el-button @click="diaAdd = false">取 消</el-button>
350 350 </div>
351 351 </el-dialog>
352   - <el-dialog :close-on-click-modal="false" title="导入账号名单" :visible.sync="diaUp" width="600">
  352 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="导入账号名单" :visible.sync="diaUp" width="600">
353 353 <upload
354 354 id="downTeacher"
355 355 :url="url"
... ...
src/views/basic/setUp/clazz.vue
... ... @@ -94,7 +94,7 @@
94 94 </div>
95 95 </div>
96 96 </div>
97   - <el-dialog
  97 + <el-dialog :append-to-body="true"
98 98 :close-on-click-modal="false"
99 99 title="导入班级名单"
100 100 :visible.sync="diaUp"
... ... @@ -110,7 +110,7 @@
110 110 <el-button @click="diaUp = false">取 消</el-button>
111 111 </div>
112 112 </el-dialog>
113   - <el-dialog
  113 + <el-dialog :append-to-body="true"
114 114 :close-on-click-modal="false"
115 115 title="修改班级"
116 116 :visible.sync="diaClass"
... ... @@ -163,7 +163,7 @@
163 163 </el-popconfirm> -->
164 164 </div>
165 165 </el-dialog>
166   - <el-dialog
  166 + <el-dialog :append-to-body="true"
167 167 :close-on-click-modal="false"
168 168 :visible.sync="diaSubject"
169 169 width="400"
... ...
src/views/basic/setUp/conglomerate.vue
... ... @@ -86,7 +86,7 @@
86 86 </div>
87 87 </div>
88 88 </div>
89   - <el-dialog
  89 + <el-dialog :append-to-body="true"
90 90 :close-on-click-modal="false"
91 91 :title="isAdd ? '添加区域/集团' : '修改区域/集团'"
92 92 :visible.sync="diaCL"
... ... @@ -114,7 +114,7 @@
114 114 <el-button round @click="diaCL = false">取 消</el-button>
115 115 </div>
116 116 </el-dialog>
117   - <el-dialog
  117 + <el-dialog :append-to-body="true"
118 118 :close-on-click-modal="false"
119 119 title="添加管理员"
120 120 :visible.sync="diaAdmin"
... ... @@ -164,7 +164,7 @@
164 164 <el-button round @click="diaAdmin = false">取 消</el-button>
165 165 </div>
166 166 </el-dialog>
167   - <el-dialog
  167 + <el-dialog :append-to-body="true"
168 168 :close-on-click-modal="false"
169 169 title="添加学校"
170 170 :visible.sync="diaSchool"
... ... @@ -219,7 +219,7 @@
219 219 <el-button round @click="diaSchool = false">取 消</el-button>
220 220 </div>
221 221 </el-dialog>
222   - <el-dialog
  222 + <el-dialog :append-to-body="true"
223 223 :close-on-click-modal="false"
224 224 title="学校信息修改"
225 225 :visible.sync="diaSchool2"
... ...
src/views/basic/setUp/school.vue
... ... @@ -74,7 +74,7 @@
74 74 </div>
75 75 </div>
76 76 </div>
77   - <el-dialog :close-on-click-modal="false" title="修改学校信息" :visible.sync="diaSchool" width="400">
  77 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改学校信息" :visible.sync="diaSchool" width="400">
78 78 <el-form
79 79 ref="formSchool"
80 80 class="form-box"
... ... @@ -136,7 +136,7 @@
136 136 <el-button @click="diaSchool = false">取 消</el-button>
137 137 </div>
138 138 </el-dialog>
139   - <el-dialog :close-on-click-modal="false" title="班级升级" :visible.sync="diaUpgradeGrade" width="400">
  139 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="班级升级" :visible.sync="diaUpgradeGrade" width="400">
140 140 <p>注意该操作会将所有年级升级,请谨慎操作!</p>
141 141 <div class="dialog-footer" slot="footer">
142 142 <el-button type="danger" @click="_UpgradeGrade()">确认升级</el-button>
... ...
src/views/basic/setUp/student.vue
... ... @@ -201,7 +201,7 @@
201 201 </div>
202 202 </div>
203 203 </div>
204   - <el-dialog
  204 + <el-dialog :append-to-body="true"
205 205 :close-on-click-modal="false"
206 206 title="学生调班"
207 207 :visible.sync="diaChangeClass"
... ... @@ -280,7 +280,7 @@
280 280 <el-button @click="diaChangeClass = false">取 消</el-button>
281 281 </div>
282 282 </el-dialog>
283   - <el-dialog
  283 + <el-dialog :append-to-body="true"
284 284 :close-on-click-modal="false"
285 285 title="调班轨迹"
286 286 :visible.sync="diaChangeClassTrack"
... ... @@ -312,7 +312,7 @@
312 312 <el-button @click="diaChangeClassTrack = false">关 闭</el-button>
313 313 </div>
314 314 </el-dialog>
315   - <el-dialog
  315 + <el-dialog :append-to-body="true"
316 316 :close-on-click-modal="false"
317 317 title="添加学生"
318 318 :visible.sync="diaStu"
... ... @@ -368,7 +368,7 @@
368 368 <el-button @click="diaStu = false">取 消</el-button>
369 369 </div>
370 370 </el-dialog>
371   - <el-dialog
  371 + <el-dialog :append-to-body="true"
372 372 :close-on-click-modal="false"
373 373 title="学生答题器绑定"
374 374 :visible.sync="diaUp"
... ...
src/views/basic/setUp/teacher.vue
... ... @@ -6,103 +6,42 @@
6 6 </template>
7 7 <template slot="btns" v-if="!code">
8 8 <el-tooltip effect="dark" content="导入教师名单" placement="bottom">
9   - <el-button
10   - type="primary"
11   - icon="el-icon-upload2"
12   - size="mini"
13   - plain
14   - circle
15   - @click="diaUp = true"
16   - ></el-button>
  9 + <el-button type="primary" icon="el-icon-upload2" size="mini" plain circle @click="diaUp = true"></el-button>
17 10 </el-tooltip>
18 11 <el-tooltip effect="dark" content="导出教师名单" placement="bottom">
19   - <el-button
20   - type="primary"
21   - icon="el-icon-download"
22   - size="mini"
23   - plain
24   - circle
25   - @click="exportTeacherExl"
26   - ></el-button>
  12 + <el-button type="primary" icon="el-icon-download" size="mini" plain circle
  13 + @click="exportTeacherExl"></el-button>
27 14 </el-tooltip>
28 15 <el-tooltip effect="dark" content="添加教师" placement="bottom">
29   - <el-button
30   - type="primary"
31   - icon="el-icon-plus"
32   - size="mini"
33   - plain
34   - circle
35   - @click="addTeacherDia"
36   - ></el-button>
  16 + <el-button type="primary" icon="el-icon-plus" size="mini" plain circle @click="addTeacherDia"></el-button>
37 17 </el-tooltip>
38 18 </template>
39 19 </back-box>
40 20  
41 21 <div class="answer-header">
42 22 <div class="sel-box">
43   - <el-select
44   - class="sel"
45   - v-model="query.classType"
46   - @change="changeType"
47   - placeholder="选择类型"
48   - >
  23 + <el-select class="sel" v-model="query.classType" @change="changeType" placeholder="选择类型">
49 24 <el-option disabled label="全部" value=""></el-option>
50 25 <el-option label="行政班" :value="0"></el-option>
51 26 <el-option label="教学班" :value="1"></el-option>
52 27 </el-select>
53   - <el-cascader
54   - size="small"
55   - class="sel sel2"
56   - clearable
57   - placeholder="选择范围"
58   - @change="_QueryData(1)"
59   - v-model="query.gradeClassSub"
60   - :options="gradeClassSubList"
61   - :props="{
62   - multiple: true,
63   - checkStrictly: true,
64   - }"
65   - collapse-tags
66   - :show-all-levels="false"
67   - ></el-cascader>
68   - <el-select
69   - class="sel"
70   - v-model="query.type"
71   - @change="_QueryData(4)"
72   - placeholder="选择类型"
73   - >
  28 + <el-cascader size="small" class="sel sel2" clearable placeholder="选择范围" @change="_QueryData(1)"
  29 + v-model="query.gradeClassSub" :options="gradeClassSubList" :props="{
  30 + multiple: true,
  31 + checkStrictly: true,
  32 + }" collapse-tags :show-all-levels="false"></el-cascader>
  33 + <el-select class="sel" v-model="query.type" @change="_QueryData(4)" placeholder="选择类型">
74 34 <el-option disabled label="请选择" :value="9"></el-option>
75 35 <el-option label="已分配任课信息" :value="0"></el-option>
76 36 <el-option label="未分配任课信息" :value="1"></el-option>
77 37 </el-select>
78   - <el-input
79   - placeholder="请输入老师姓名"
80   - v-model="query.teacherName"
81   - class="input-with-select"
82   - maxlength="30"
83   - clearable
84   - @keyup.enter.native="_QueryData(2)"
85   - >
86   - <el-button
87   - slot="append"
88   - icon="el-icon-search"
89   - @click="_QueryData(2)"
90   - ></el-button>
  38 + <el-input placeholder="请输入老师姓名" v-model="query.teacherName" class="input-with-select" maxlength="30" clearable
  39 + @keyup.enter.native="_QueryData(2)">
  40 + <el-button slot="append" icon="el-icon-search" @click="_QueryData(2)"></el-button>
91 41 </el-input>
92   - <el-input
93   - type="number"
94   - oninput="if(value.length > 11) value = value.slice(0,11)"
95   - placeholder="请输入老师手机号"
96   - v-model="query.phone"
97   - clearable
98   - class="input-with-select"
99   - @keyup.enter.native="_QueryData(3)"
100   - >
101   - <el-button
102   - slot="append"
103   - icon="el-icon-search"
104   - @click="_QueryData(3)"
105   - ></el-button>
  42 + <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)" placeholder="请输入老师手机号"
  43 + v-model="query.phone" clearable class="input-with-select" @keyup.enter.native="_QueryData(3)">
  44 + <el-button slot="append" icon="el-icon-search" @click="_QueryData(3)"></el-button>
106 45 </el-input>
107 46 <!-- <el-button class="serach-box" round @click="_QueryData(4)"
108 47 >筛选</el-button
... ... @@ -113,57 +52,26 @@
113 52 共筛选出{{ teacherList.length }}名教师。
114 53 </p>
115 54 <div class="page-content">
116   - <el-empty
117   - :image-size="100"
118   - v-if="!teacherList.length && loading == false"
119   - description="没有更多数据"
120   - ></el-empty>
  55 + <el-empty :image-size="100" v-if="!teacherList.length && loading == false" description="没有更多数据"></el-empty>
121 56 <div class="teacher-box" v-loading="loading" v-else>
122 57 <div class="teacher-list">
123 58 <p class="h-title" v-loading="removeLoading">
124   - <el-checkbox
125   - v-show="showDel"
126   - v-model="AllTeacher"
127   - :indeterminate="indeterminate"
128   - @change="handleCheckAllChange"
129   - >{{ "" }}</el-checkbox
130   - >
  59 + <el-checkbox v-show="showDel" v-model="AllTeacher" :indeterminate="indeterminate"
  60 + @change="handleCheckAllChange">{{ "" }}</el-checkbox>
131 61 <span class="txt">教师列表</span>
132   - <el-popconfirm
133   - v-show="showDel"
134   - title="确定所选教师格式化吗?"
135   - @confirm="remove"
136   - >
137   - <img
138   - slot="reference"
139   - class="clear"
140   - src="../../../assets/images/shuazi.svg"
141   - alt=""
142   - />
  62 + <el-popconfirm v-show="showDel" title="确定所选教师格式化吗?" @confirm="remove">
  63 + <img slot="reference" class="clear" src="../../../assets/images/shuazi.svg" alt="" />
143 64 </el-popconfirm>
144 65 </p>
145   - <el-checkbox-group
146   - v-model="clearTeacher"
147   - @change="handleCheckedChange"
148   - >
  66 + <el-checkbox-group v-model="clearTeacher" @change="handleCheckedChange">
149 67 <ul class="teacher-ul">
150   - <li
151   - class="teacher-item"
152   - v-for="item in teacherList"
153   - :key="item.id"
154   - >
  68 + <li class="teacher-item" v-for="item in teacherList" :key="item.id">
155 69 <el-checkbox v-show="showDel" :label="item.id">{{
156   - ""
157   - }}</el-checkbox>
158   - <p
159   - class="name"
160   - :class="showTId == item.id ? 'active' : ''"
161   - @click="showTeacher(item)"
162   - >
  70 + ""
  71 + }}</el-checkbox>
  72 + <p class="name" :class="showTId == item.id ? 'active' : ''" @click="showTeacher(item)">
163 73 {{ item.realName
164   - }}<template v-if="setClass(item)"
165   - >({{ setClass(item) }})</template
166   - >
  74 + }}<template v-if="setClass(item)">({{ setClass(item) }})</template>
167 75 </p>
168 76 </li>
169 77 </ul>
... ... @@ -172,10 +80,7 @@
172 80 <div class="teacher-detail">
173 81 <div class="icon-box" v-if="!code">
174 82 <i class="icon el-icon-edit-outline" @click="editTeacher(1)"></i>
175   - <i
176   - class="icon el-icon-circle-plus-outline"
177   - @click="editTeacher(2)"
178   - ></i>
  83 + <i class="icon el-icon-circle-plus-outline" @click="editTeacher(2)"></i>
179 84 </div>
180 85 <div class="detail-top">
181 86 <p class="p-item">手机号码:{{ teacherDetail.loginName }}</p>
... ... @@ -184,30 +89,19 @@
184 89 </p>
185 90 <p class="p-item">
186 91 性别:{{
187   - teacherDetail.sex == 1
188   - ? "男"
189   - : teacherDetail.sex == 2
190   - ? "女"
191   - : "未知"
192   - }}
  92 + teacherDetail.sex == 1
  93 + ? "男"
  94 + : teacherDetail.sex == 2
  95 + ? "女"
  96 + : "未知"
  97 + }}
193 98 </p>
194 99 </div>
195   - <div
196   - class="grade-box"
197   - v-if="teacherDetail.managerList && teacherDetail.managerList.length"
198   - >
  100 + <div class="grade-box" v-if="teacherDetail.managerList && teacherDetail.managerList.length">
199 101 <p class="h-title">班主任</p>
200 102 <ul class="grade-info">
201   - <li
202   - class="grade-li"
203   - v-for="item in teacherDetail.managerList"
204   - :key="item.classId"
205   - >
206   - <el-popconfirm
207   - title="确定删除吗?"
208   - @confirm="delTeacherManager(item, 1)"
209   - v-if="!code"
210   - >
  103 + <li class="grade-li" v-for="item in teacherDetail.managerList" :key="item.classId">
  104 + <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 1)" v-if="!code">
211 105 <i class="el-icon-delete" slot="reference"></i>
212 106 </el-popconfirm>
213 107 <div class="grade-item">
... ... @@ -217,46 +111,35 @@
217 111 <div class="grade-class">
218 112 <p>
219 113 <i class="fa fa-address-book-o"></i>学生:{{
220   - item.studentCount
221   - }}个
  114 + item.studentCount
  115 + }}个
222 116 </p>
223 117 </div>
224 118 </div>
225 119 </li>
226 120 </ul>
227 121 </div>
228   - <div
229   - class="grade-box"
230   - v-if="
231   - teacherDetail.teacherCourseList &&
232   - teacherDetail.teacherCourseList.length
233   - "
234   - >
  122 + <div class="grade-box" v-if="teacherDetail.teacherCourseList &&
  123 + teacherDetail.teacherCourseList.length
  124 + ">
235 125 <p class="h-title">任课老师</p>
236 126 <ul class="grade-info">
237   - <li
238   - class="grade-li"
239   - v-for="item in teacherDetail.teacherCourseList"
240   - :key="item.classId + item.subjectName"
241   - >
242   - <el-popconfirm
243   - title="确定删除吗?"
244   - @confirm="delTeacherManager(item, 2)"
245   - v-if="!code"
246   - >
  127 + <li class="grade-li" v-for="item in teacherDetail.teacherCourseList"
  128 + :key="item.classId + item.subjectName">
  129 + <el-popconfirm title="确定删除吗?" @confirm="delTeacherManager(item, 2)" v-if="!code">
247 130 <i class="el-icon-delete" slot="reference"></i>
248 131 </el-popconfirm>
249 132 <div class="grade-item">
250 133 <p class="grade-name">
251 134 {{ item.gradeName }}-{{ item.className }}({{
252   - item.subjectName
253   - }})
  135 + item.subjectName
  136 + }})
254 137 </p>
255 138 <div class="grade-class">
256 139 <p>
257 140 <i class="fa fa-address-book-o"></i>学生:{{
258   - item.studentCount
259   - }}个
  141 + item.studentCount
  142 + }}个
260 143 </p>
261 144 </div>
262 145 </div>
... ... @@ -295,18 +178,8 @@
295 178 </div>
296 179 </div>
297 180 </div>
298   - <el-dialog
299   - :close-on-click-modal="false"
300   - title="导入教师名单"
301   - :visible.sync="diaUp"
302   - width="600"
303   - >
304   - <upload
305   - id="downTeacher"
306   - :url="url"
307   - @upSuccess="upSuccess"
308   - fileName="教师名单"
309   - >
  181 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="导入教师名单" :visible.sync="diaUp" width="600">
  182 + <upload id="downTeacher" :url="url" @upSuccess="upSuccess" fileName="教师名单">
310 183 <p class="down-txt" slot="down">
311 184 通过Excel名单导入教师名单,点击
312 185 <el-link type="danger" @click="downExcel">模板下载</el-link> 。
... ... @@ -316,116 +189,46 @@
316 189 <el-button @click="diaUp = false">取 消</el-button>
317 190 </div>
318 191 </el-dialog>
319   - <el-dialog
320   - :close-on-click-modal="false"
321   - :title="
322   - isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级'
323   - "
324   - :visible.sync="diaTeacher"
325   - width="400"
326   - append-to-body
327   - >
328   - <el-form
329   - class="form-box"
330   - ref="formTeacher"
331   - :model="formTeacher"
332   - :rules="rulesTeacher"
333   - label=""
334   - width="160px"
335   - >
  192 + <el-dialog :append-to-body="true" :close-on-click-modal="false" :title="isAdd ? '添加教师' : setTercherType == 1 ? '编辑教师信息' : '管理班级'
  193 + " :visible.sync="diaTeacher" width="400" append-to-body>
  194 + <el-form class="form-box" ref="formTeacher" :model="formTeacher" :rules="rulesTeacher" label="" width="160px">
336 195 <el-form-item v-show="!isAdd && setTercherType == 2" label="教师姓名:">
337 196 <span>{{ formTeacher.teacherName }}</span>
338 197 </el-form-item>
339   - <el-form-item
340   - v-show="isAdd || (!isAdd && setTercherType == 1)"
341   - label="手机号码:"
342   - prop="loginName"
343   - >
  198 + <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="手机号码:" prop="loginName">
344 199 <el-col :span="10">
345   - <el-input
346   - type="number"
347   - oninput="if(value.length > 11) value = value.slice(0,11)"
348   - v-model.trim="formTeacher.loginName"
349   - />
  200 + <el-input type="number" oninput="if(value.length > 11) value = value.slice(0,11)"
  201 + v-model.trim="formTeacher.loginName" />
350 202 </el-col>
351 203 </el-form-item>
352   - <el-form-item
353   - v-show="isAdd || (!isAdd && setTercherType == 1)"
354   - label="教师姓名:"
355   - prop="teacherName"
356   - >
  204 + <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="教师姓名:" prop="teacherName">
357 205 <el-col :span="10">
358 206 <el-input maxlength="30" v-model.trim="formTeacher.teacherName" />
359 207 </el-col>
360 208 </el-form-item>
361   - <el-form-item
362   - v-show="isAdd || (!isAdd && setTercherType == 1)"
363   - label="性别:"
364   - prop="sex"
365   - >
  209 + <el-form-item v-show="isAdd || (!isAdd && setTercherType == 1)" label="性别:" prop="sex">
366 210 <el-radio-group v-model="formTeacher.sex">
367 211 <el-radio :label="1">男</el-radio>
368 212 <el-radio :label="2">女</el-radio>
369 213 </el-radio-group>
370 214 </el-form-item>
371   - <el-form-item
372   - v-show="isAdd || (!isAdd && setTercherType == 2)"
373   - label="教师角色:"
374   - prop="roleList"
375   - >
376   - <div
377   - class="role-list"
378   - v-for="(item, index) in formTeacher.roleList"
379   - :key="item.id"
380   - >
381   - <el-select
382   - class="sel-c"
383   - v-model="item.roleId"
384   - placeholder="选择角色"
385   - @change="item.classId = []"
386   - >
387   - <el-option
388   - v-for="item in teacherRoleList"
389   - :key="item.value"
390   - :label="item.label"
391   - :value="item.value"
392   - >
  215 + <el-form-item v-show="isAdd || (!isAdd && setTercherType == 2)" label="教师角色:" prop="roleList">
  216 + <div class="role-list" v-for="(item, index) in formTeacher.roleList" :key="item.id">
  217 + <el-select class="sel-c" v-model="item.roleId" placeholder="选择角色" @change="item.classId = []">
  218 + <el-option v-for="item in teacherRoleList" :key="item.value" :label="item.label" :value="item.value">
  219 + </el-option>
  220 + </el-select>
  221 + <el-cascader size="small" v-if="item.roleId == 6" class="sel-t" collapse clearable placeholder="选择年级-班级"
  222 + v-model="item.classId" :options="gradeClassList" :props="{ expandTrigger: 'hover' }"></el-cascader>
  223 + <el-cascader size="small" v-if="item.roleId == 7" class="sel-t teacher-cascader" collapse clearable
  224 + placeholder="选择年级-科目-班级" v-model="item.classId" :options="gradeSubListClass"
  225 + :props="{ expandTrigger: 'hover', multiple: true }" popperClass="cascader-clazz"></el-cascader>
  226 + <el-cascader size="small" v-if="item.roleId == 8" class="sel-t" collapse clearable placeholder="选择年级-科目"
  227 + v-model="item.classId" :options="gradeList" :props="{ expandTrigger: 'hover' }"></el-cascader>
  228 + <el-select v-if="item.roleId == 3" v-model="item.gradeId" placeholder="选择年级">
  229 + <el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value">
393 230 </el-option>
394 231 </el-select>
395   - <el-cascader
396   - size="small"
397   - v-if="item.roleId == 6"
398   - class="sel-t"
399   - collapse
400   - clearable
401   - placeholder="选择年级-班级"
402   - v-model="item.classId"
403   - :options="gradeClassList"
404   - :props="{ expandTrigger: 'hover' }"
405   - ></el-cascader>
406   - <el-cascader
407   - size="small"
408   - v-if="item.roleId == 7"
409   - class="sel-t teacher-cascader"
410   - collapse
411   - clearable
412   - placeholder="选择年级-科目-班级"
413   - v-model="item.classId"
414   - :options="gradeSubListClass"
415   - :props="{ expandTrigger: 'hover', multiple: true }"
416   - popperClass="cascader-clazz"
417   - ></el-cascader>
418   - <el-cascader
419   - size="small"
420   - v-if="item.roleId == 8"
421   - class="sel-t"
422   - collapse
423   - clearable
424   - placeholder="选择年级-科目"
425   - v-model="item.classId"
426   - :options="gradeList"
427   - :props="{ expandTrigger: 'hover' }"
428   - ></el-cascader>
429 232 <i class="el-icon-close" @click="removeRoleList(index)"></i>
430 233 </div>
431 234 <p class="add-box">
... ... @@ -474,6 +277,10 @@ export default {
474 277 RoleList: [
475 278 //角色
476 279 {
  280 + value: 3,
  281 + label: "年级组长"
  282 + },
  283 + {
477 284 value: 6,
478 285 label: "班主任",
479 286 },
... ... @@ -489,6 +296,10 @@ export default {
489 296 teacherRoleList: [
490 297 //角色
491 298 {
  299 + value: 3,
  300 + label: "年级组长"
  301 + },
  302 + {
492 303 value: 6,
493 304 label: "班主任",
494 305 },
... ... @@ -570,8 +381,8 @@ export default {
570 381 handleCheckAllChange(val) {
571 382 this.clearTeacher = val
572 383 ? this.teacherList.map((item) => {
573   - return item.id;
574   - })
  384 + return item.id;
  385 + })
575 386 : [];
576 387 this.indeterminate = false;
577 388 },
... ... @@ -632,6 +443,7 @@ export default {
632 443 id: randomWord(true, 16, 20),
633 444 roleId: "",
634 445 classId: [],
  446 + gradeId: "",
635 447 });
636 448 },
637 449 //删除教师角色
... ... @@ -734,12 +546,7 @@ export default {
734 546 },
735 547 //转换保存教师数据格式
736 548 setTeacharForm() {
737   - let ERR_OK = true;
738   - this.formTeacher.roleList.map((item) => {
739   - if (item.classId.length == 0) {
740   - ERR_OK = false;
741   - }
742   - });
  549 + let ERR_OK = this.formTeacher.roleList.length > 0;
743 550 if (ERR_OK) {
744 551 let [managerList, teacherCourseList, gradeGroupList] = [[], [], []];
745 552 this.formTeacher.roleList.map((item) => {
... ... @@ -761,6 +568,11 @@ export default {
761 568 });
762 569 });
763 570 }
  571 + else if (item.roleId == 3) {
  572 + gradeGroupList.push({
  573 + grade: item.gradeId
  574 + })
  575 + }
764 576 // else {
765 577 // gradeGroupList.push({
766 578 // grade: item.classId[0],
... ... @@ -1218,9 +1030,11 @@ export default {
1218 1030  
1219 1031 .name {
1220 1032 cursor: pointer;
  1033 +
1221 1034 &:hover {
1222 1035 color: #667ffd;
1223 1036 }
  1037 +
1224 1038 &.active {
1225 1039 color: #667ffd;
1226 1040 background: #eee;
... ... @@ -1270,7 +1084,7 @@ export default {
1270 1084 flex-wrap: wrap;
1271 1085 padding: 20px 20px 0;
1272 1086  
1273   - & > li {
  1087 + &>li {
1274 1088 margin-right: 20px;
1275 1089 margin-bottom: 20px;
1276 1090 position: relative;
... ...
src/views/basic/test/analysis.vue
... ... @@ -73,6 +73,7 @@ export default {
73 73 };
74 74 },
75 75 created() {
  76 +
76 77 this.role =
77 78 this.$store.getters.info.showRole ||
78 79 this.$store.getters.info.permissions[0].role;
... ...
src/views/basic/test/components/contrast.vue
... ... @@ -47,7 +47,7 @@
47 47 </div>
48 48 </div>
49 49  
50   - <el-dialog :close-on-click-modal="false" title="等级设置" :visible.sync="diaLogBox" width="800px" @closed="closeDia">
  50 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="等级设置" :visible.sync="diaLogBox" width="800px" @closed="closeDia">
51 51 <el-form class="use-form">
52 52 <el-form-item class="use-form-item-box">
53 53 <el-form-item label="等级名称:" class="use-form-item">
... ...
src/views/basic/test/components/multipleSubTest.vue
... ... @@ -113,7 +113,7 @@
113 113 >打印</el-button
114 114 >
115 115 </div>
116   - <el-dialog
  116 + <el-dialog :append-to-body="true"
117 117 class="chart-dia"
118 118 :visible.sync="chartDia"
119 119 :title="chartTitle"
... ...
src/views/basic/test/components/multipleTest.vue
1 1 <template>
2 2 <div class="table-box" ref="main" v-loading="loading">
3 3 <div id="print-content">
4   - <el-table
5   - :max-height="tableMaxHeight"
6   - :data="tableData"
7   - border
8   - style="width: 100%"
9   - >
10   - <el-table-column
11   - prop="studentCode"
12   - label="学号"
13   - align="center"
14   - fixed
15   - ></el-table-column>
  4 + <el-table :max-height="tableMaxHeight" :data="tableData" border style="width: 100%">
  5 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
16 6 <el-table-column prop="studentName" label="姓名" fixed align="center">
17 7 <template slot-scope="scoped">
18 8 {{ scoped.row.studentName }}
19   - </template></el-table-column
20   - >
21   - <el-table-column
22   - align="center"
23   - v-for="(item, index) in answerList"
24   - :key="index"
25   - :label="item.title"
26   - >
27   - <el-table-column
28   - :prop="'score' + index"
29   - :label="index == 0 ? '总分' : '成绩'"
30   - align="center"
31   - :class-name="index % 2 == 0 ? 'bg' : ''"
32   - >
  9 + </template></el-table-column>
  10 + <el-table-column align="center" v-for="(item, index) in answerList" :key="index" :label="item.title">
  11 + <el-table-column :prop="'score' + index" :label="index == 0 ? '总分' : '成绩'" align="center"
  12 + :class-name="index % 2 == 0 ? 'bg' : ''">
33 13 <template slot-scope="scoped">{{
34   - scoped.row["score" + index] ||
35   - Number(scoped.row["score" + index]) === 0
36   - ? scoped.row["score" + index]
37   - : "-"
38   - }}</template>
  14 + scoped.row["score" + index] ||
  15 + Number(scoped.row["score" + index]) === 0
  16 + ? scoped.row["score" + index]
  17 + : "-"
  18 + }}</template>
39 19 </el-table-column>
40   - <el-table-column
41   - :prop="'classRank' + index"
42   - label="班名"
43   - align="center"
44   - sortable
45   - :class-name="index % 2 == 0 ? 'bg' : ''"
46   - >
  20 + <el-table-column :prop="'classRank' + index" label="班名" align="center" sortable
  21 + :class-name="index % 2 == 0 ? 'bg' : ''">
47 22 <template slot-scope="scoped">{{
48   - scoped.row["classRank" + index] ||
49   - Number(scoped.row["classRank" + index]) === 0
50   - ? scoped.row["classRank" + index]
51   - : "-"
52   - }}</template>
  23 + scoped.row["classRank" + index] ||
  24 + Number(scoped.row["classRank" + index]) === 0
  25 + ? scoped.row["classRank" + index]
  26 + : "-"
  27 + }}</template>
53 28 </el-table-column>
54 29 </el-table-column>
55 30 <el-table-column label="查看折线图" align="center">
56 31 <template slot-scope="scoped">
57   - <el-button
58   - @click="openChart(scoped.row)"
59   - type="primary"
60   - size="mini"
61   - circle
62   - icon="el-icon-arrow-right"
63   - ></el-button>
  32 + <el-button @click="openChart(scoped.row)" type="primary" size="mini" circle
  33 + icon="el-icon-arrow-right"></el-button>
64 34 </template>
65 35 </el-table-column>
66 36 </el-table>
67 37 </div>
68 38 <div class="down">
69   - <el-button
70   - @click="openDown"
71   - type="primary"
72   - plain
73   - round
74   - icon="fa fa-cloud-download"
75   - >导出报表</el-button
76   - >
77   - <el-button
78   - v-if="!this.$store.getters.code"
79   - @click="print"
80   - type="primary"
81   - plain
82   - round
83   - icon="el-icon-printer"
84   - >打印</el-button
85   - >
  39 + <el-button @click="openDown" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  40 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  41 + icon="el-icon-printer">打印</el-button>
86 42 </div>
87   - <el-dialog
88   - class="chart-dia"
89   - :visible.sync="chartDia"
90   - :title="chartTitle"
91   - width="800"
92   - >
  43 + <el-dialog :append-to-body="true" class="chart-dia" :visible.sync="chartDia" :title="chartTitle" width="800">
93 44 <div class="chart-box">
94   - <LineChart
95   - id="lineChart"
96   - :params="chartData"
97   - :xAxis="xAxis"
98   - :formatterYAxis="false"
99   - />
  45 + <LineChart id="lineChart" :params="chartData" :xAxis="xAxis" :formatterYAxis="false" />
100 46 </div>
101 47 </el-dialog>
102   - <ExportDia
103   - :exportStudent="exportStudent"
104   - :diaShow="diaShow"
105   - @cancel="cancel"
106   - @exportData="exportData"
107   - lastLabel="总分"
108   - />
  48 + <ExportDia :exportStudent="exportStudent" :diaShow="diaShow" @cancel="cancel" @exportData="exportData"
  49 + lastLabel="总分" />
109 50 </div>
110 51 <!-- 单科多卷 -->
111 52 </template>
... ...
src/views/basic/test/components/test.vue
... ... @@ -4,134 +4,55 @@
4 4 <p class="tips-p">
5 5 <i class="fa fa-bell-o"></i>
6 6 {{
7   - `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
8   - }}修改了答案,是否重新记分?
  7 + `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
  8 + }}修改了答案,是否重新记分?
9 9 </p>
10 10 <div class="btn-box">
11   - <el-button type="danger" round @click="_ReScore" size="mini"
12   - >重新计分</el-button
13   - >
14   - <el-button
15   - type="danger"
16   - round
17   - plain
18   - size="mini"
19   - @click="paperModifyLog.modifiedTime = ''"
20   - >暂时不计</el-button
21   - >
  11 + <el-button type="danger" round @click="_ReScore" size="mini">重新计分</el-button>
  12 + <el-button type="danger" round plain size="mini" @click="paperModifyLog.modifiedTime = ''">暂时不计</el-button>
22 13 </div>
23 14 </div>
24 15 <div class="content-header">
25 16 <div class="tab-box">
26   - <span
27   - v-for="(item, index) in tabList"
28   - :key="item"
29   - class="tab-item"
30   - :class="type == index ? 'active' : ''"
31   - @click="setType(index)"
32   - >{{ item }}</span
33   - >
  17 + <span v-for="(item, index) in tabList" :key="item" class="tab-item" :class="type == index ? 'active' : ''"
  18 + @click="setType(index)">{{ item }}</span>
34 19 </div>
35   - <el-button
36   - v-if="!status && role != 'ROLE_BANZHUREN'"
37   - class="setMinScore"
38   - @click="diaMinScore = true"
39   - round
40   - size="small"
41   - >设置低分值</el-button
42   - >
  20 + <el-button v-if="!status && role != 'ROLE_BANZHUREN'" class="setMinScore" @click="diaMinScore = true" round
  21 + size="small">设置低分值</el-button>
43 22 </div>
44 23 <div id="print-content" v-loading="loading">
45 24 <div class="table-box">
46   - <el-table
47   - :max-height="tableMaxHeight"
48   - v-show="type == 0"
49   - :data="tableData"
50   - border
51   - style="width: 100%"
52   - >
53   - <el-table-column
54   - prop="questionIndex"
55   - label="题号"
56   - align="center"
57   - fixed
58   - width="60"
59   - ></el-table-column>
60   - <el-table-column
61   - prop="questionType"
62   - label="题型"
63   - align="center"
64   - fixed
65   - width="100"
66   - ><template slot-scope="scope">{{
67   - setSubPro(scope.row.questionType)
68   - }}</template></el-table-column
69   - >
70   - <el-table-column
71   - prop="score"
72   - width="100"
73   - label="满分值"
74   - sortable
75   - align="center"
76   - ></el-table-column>
77   - <el-table-column
78   - width="110"
79   - prop="highestScore"
80   - label="班最高分"
81   - sortable
82   - align="center"
83   - ></el-table-column>
84   - <el-table-column
85   - width="110"
86   - prop="lowestScore"
87   - label="班最低分"
88   - sortable
89   - align="center"
90   - ></el-table-column>
91   - <el-table-column
92   - width="110"
93   - prop="avgScore"
94   - label="班平均分"
95   - sortable
96   - align="center"
97   - ></el-table-column>
98   - <el-table-column
99   - prop="classScoringRate"
100   - width="120"
101   - sortable
102   - label="班级得分率"
103   - align="center"
104   - ><template slot-scope="scoped"
105   - >{{ scoped.row.classScoringRate }}%</template
106   - ></el-table-column
107   - >
108   - <el-table-column prop="correctAnswer" label="答案" align="center"
109   - ><template slot-scope="scoped">{{
110   - scoped.row.correctAnswer == 1
111   - ? "✓"
112   - : scoped.row.correctAnswer == 2
113   - ? "✗"
114   - : scoped.row.correctAnswer
115   - }}</template>
  25 + <el-table :max-height="tableMaxHeight" v-show="type == 0" :data="tableData" border style="width: 100%">
  26 + <el-table-column prop="questionIndex" label="题号" align="center" fixed width="60"></el-table-column>
  27 + <el-table-column prop="questionType" label="题型" align="center" fixed width="100"><template
  28 + slot-scope="scope">{{
  29 + setSubPro(scope.row.questionType)
  30 + }}</template></el-table-column>
  31 + <el-table-column prop="score" width="100" label="满分值" sortable align="center"></el-table-column>
  32 + <el-table-column width="110" prop="highestScore" label="班最高分" sortable align="center"></el-table-column>
  33 + <el-table-column width="110" prop="lowestScore" label="班最低分" sortable align="center"></el-table-column>
  34 + <el-table-column width="110" prop="avgScore" label="班平均分" sortable align="center"></el-table-column>
  35 + <el-table-column prop="classScoringRate" width="120" sortable label="班级得分率" align="center"><template
  36 + slot-scope="scoped">{{ scoped.row.classScoringRate }}%</template></el-table-column>
  37 + <el-table-column prop="correctAnswer" label="答案" align="center"><template slot-scope="scoped">{{
  38 + scoped.row.correctAnswer == 1
  39 + ? "✓"
  40 + : scoped.row.correctAnswer == 2
  41 + ? "✗"
  42 + : scoped.row.correctAnswer
  43 + }}</template>
116 44 </el-table-column>
117   - <el-table-column
118   - v-for="(item, index) in optionsList"
119   - :key="index"
120   - :label="item.title"
121   - :prop="'count' + index"
122   - align="center"
123   - width="120"
124   - ><template slot-scope="scope">
  45 + <el-table-column v-for="(item, index) in optionsList" :key="index" :label="item.title" :prop="'count' + index"
  46 + align="center" width="120"><template slot-scope="scope">
125 47 <p class="persent">
126 48 {{
127   - scope.row.questionType == "5"
128   - ? ""
129   - : scope.row["option" + index]
130   - ? `${scope.row["option" + index]}(${
131   - scope.row["persent" + index]
132   - })`
133   - : ""
134   - }}
  49 + scope.row.questionType == "5"
  50 + ? ""
  51 + : scope.row["option" + index]
  52 + ? `${scope.row["option" + index]}(${scope.row["persent" + index]
  53 + })`
  54 + : ""
  55 + }}
135 56 </p>
136 57 </template>
137 58 </el-table-column>
... ... @@ -166,26 +87,22 @@
166 87 <td width="120">{{ tr.classScoringRate }}%</td>
167 88 <td>
168 89 {{
169   - tr.correctAnswer == 1
170   - ? "✓"
171   - : tr.correctAnswer == 2
172   - ? "✗"
173   - : tr.correctAnswer
174   - }}
  90 + tr.correctAnswer == 1
  91 + ? "✓"
  92 + : tr.correctAnswer == 2
  93 + ? "✗"
  94 + : tr.correctAnswer
  95 + }}
175 96 </td>
176   - <td
177   - v-for="(item, index) in optionsList"
178   - :key="index"
179   - width="120"
180   - >
  97 + <td v-for="(item, index) in optionsList" :key="index" width="120">
181 98 <p class="persent">
182 99 {{
183   - tr.questionType == "5"
184   - ? ""
185   - : tr["option" + index]
186   - ? `${tr["option" + index]}(${tr["persent" + index]})`
187   - : ""
188   - }}
  100 + tr.questionType == "5"
  101 + ? ""
  102 + : tr["option" + index]
  103 + ? `${tr["option" + index]}(${tr["persent" + index]})`
  104 + : ""
  105 + }}
189 106 </p>
190 107 </td>
191 108 </tr>
... ... @@ -198,31 +115,27 @@
198 115 <span class="hui-s s1">主观题</span>
199 116 <span class="hui-s s1">{{ examReport.subjectiveScore }}</span>
200 117 <span class="hui-s s2">{{
201   - examReport.subjectiveHighestScore
202   - }}</span>
  118 + examReport.subjectiveHighestScore
  119 + }}</span>
203 120 <span class="hui-s s2">{{
204   - examReport.subjectiveLowestScore
205   - }}</span>
  121 + examReport.subjectiveLowestScore
  122 + }}</span>
206 123 <span class="hui-s s2">{{
207   - examReport.subjectiveAvgScore
208   - }}</span>
209   - <span class="hui-s s3"
210   - >{{ examReport.subjectiveClassScoringRate }}%</span
211   - >
  124 + examReport.subjectiveAvgScore
  125 + }}</span>
  126 + <span class="hui-s s3">{{ examReport.subjectiveClassScoringRate }}%</span>
212 127 </li>
213 128 <li class="hui-li">
214 129 <span class="hui-s s1">客观题</span>
215 130 <span class="hui-s s1">{{ examReport.objectiveScore }}</span>
216 131 <span class="hui-s s2">{{
217   - examReport.objectiveHighestScore
218   - }}</span>
  132 + examReport.objectiveHighestScore
  133 + }}</span>
219 134 <span class="hui-s s2">{{
220   - examReport.objectiveLowestScore
221   - }}</span>
  135 + examReport.objectiveLowestScore
  136 + }}</span>
222 137 <span class="hui-s s2">{{ examReport.objectiveAvgScore }}</span>
223   - <span class="hui-s s3"
224   - >{{ examReport.objectiveClassScoringRate }}%</span
225   - >
  138 + <span class="hui-s s3">{{ examReport.objectiveClassScoringRate }}%</span>
226 139 </li>
227 140 <li class="hui-li">
228 141 <span class="hui-s s1">整卷</span>
... ... @@ -235,176 +148,51 @@
235 148 </ul>
236 149 </div>
237 150 </div>
238   - <el-table
239   - v-show="type == 1"
240   - :max-height="tableMaxHeight"
241   - :data="tableData2"
242   - border
243   - style="width: 100%"
244   - :default-sort="{ prop: 'dadui', order: 'descending' }"
245   - >
246   - <el-table-column
247   - prop="studentCode"
248   - label="学号"
249   - align="center"
250   - fixed
251   - ></el-table-column>
252   - <el-table-column
253   - prop="studentName"
254   - label="姓名"
255   - fixed
256   - align="center"
257   - ></el-table-column>
258   - <el-table-column
259   - prop="examScore"
260   - label="总分"
261   - sortable
262   - align="center"
263   - ></el-table-column>
264   - <el-table-column
265   - prop="scoringRate"
266   - label="得分率"
267   - sortable
268   - align="center"
269   - ><template slot-scope="scope"
270   - >{{ scope.row.scoringRate }}%</template
271   - ></el-table-column
272   - >
273   - <el-table-column
274   - prop="classRank"
275   - label="班名"
276   - sortable
277   - align="center"
278   - ></el-table-column>
  151 + <el-table v-show="type == 1" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%"
  152 + :default-sort="{ prop: 'dadui', order: 'descending' }">
  153 + <el-table-column prop="studentCode" label="学号" align="center" fixed></el-table-column>
  154 + <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
  155 + <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
  156 + <el-table-column prop="scoringRate" label="得分率" sortable align="center"><template slot-scope="scope">{{
  157 + scope.row.scoringRate }}%</template></el-table-column>
  158 + <el-table-column prop="classRank" label="班名" sortable align="center"></el-table-column>
279 159 <el-table-column label="客观题" align="center">
280   - <el-table-column
281   - prop="objectiveExamScore"
282   - label="得分"
283   - align="center"
284   - ></el-table-column>
285   - <el-table-column
286   - prop="objectiveScoringRate"
287   - label="得分率"
288   - align="center"
289   - ><template slot-scope="scope"
290   - >{{ scope.row.objectiveScoringRate }}%</template
291   - ></el-table-column
292   - >
  160 + <el-table-column prop="objectiveExamScore" label="得分" align="center"></el-table-column>
  161 + <el-table-column prop="objectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{
  162 + scope.row.objectiveScoringRate }}%</template></el-table-column>
293 163 </el-table-column>
294 164 <el-table-column label="主观题" align="center">
295   - <el-table-column
296   - prop="subjectiveExamScore"
297   - label="得分"
298   - align="center"
299   - ></el-table-column>
300   - <el-table-column
301   - prop="subjectiveScoringRate"
302   - label="得分率"
303   - align="center"
304   - ><template slot-scope="scope"
305   - >{{ scope.row.subjectiveScoringRate }}%</template
306   - ></el-table-column
307   - >
  165 + <el-table-column prop="subjectiveExamScore" label="得分" align="center"></el-table-column>
  166 + <el-table-column prop="subjectiveScoringRate" label="得分率" align="center"><template slot-scope="scope">{{
  167 + scope.row.subjectiveScoringRate }}%</template></el-table-column>
308 168 </el-table-column>
309 169 </el-table>
310   - <el-table
311   - v-show="type == 2"
312   - :max-height="tableMaxHeight"
313   - :data="tableData2"
314   - border
315   - style="width: 100%"
316   - :default-sort="{ prop: '', order: 'descending' }"
317   - >
318   - <el-table-column
319   - prop="studentCode"
320   - label="学号"
321   - fixed
322   - align="center"
323   - width="120"
324   - ></el-table-column>
325   - <el-table-column
326   - prop="studentName"
327   - label="姓名"
328   - fixed
329   - align="center"
330   - ></el-table-column>
331   - <el-table-column
332   - prop="examScore"
333   - label="总分"
334   - sortable
335   - align="center"
336   - ></el-table-column>
  170 + <el-table v-show="type == 2" :max-height="tableMaxHeight" :data="tableData2" border style="width: 100%"
  171 + :default-sort="{ prop: '', order: 'descending' }">
  172 + <el-table-column prop="studentCode" label="学号" fixed align="center" width="120"></el-table-column>
  173 + <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
  174 + <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
337 175 <el-table-column label="分数组成" align="center">
338   - <el-table-column
339   - prop="objectiveExamScore"
340   - label="客观题分"
341   - align="center"
342   - ></el-table-column>
343   - <el-table-column
344   - prop="subjectiveExamScore"
345   - label="主观题分"
346   - align="center"
347   - ></el-table-column>
  176 + <el-table-column prop="objectiveExamScore" label="客观题分" align="center"></el-table-column>
  177 + <el-table-column prop="subjectiveExamScore" label="主观题分" align="center"></el-table-column>
348 178 </el-table-column>
349   - <el-table-column
350   - align="center"
351   - v-for="(item, index) in questionList"
352   - :key="index"
353   - :label="'Q' + item.id"
354   - :prop="'score' + item.id"
355   - >
  179 + <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id"
  180 + :prop="'score' + item.id">
356 181 </el-table-column>
357 182 </el-table>
358   - <el-table
359   - :max-height="tableMaxHeight"
360   - v-show="type == 3"
361   - :data="tableData2"
362   - border
363   - style="width: 100%"
364   - :default-sort="{ prop: '', order: 'descending' }"
365   - >
366   - <el-table-column
367   - prop="studentCode"
368   - label="学号"
369   - fixed
370   - align="center"
371   - ></el-table-column>
372   - <el-table-column
373   - prop="studentName"
374   - label="姓名"
375   - fixed
376   - align="center"
377   - ></el-table-column>
378   - <el-table-column
379   - prop="className"
380   - label="班级"
381   - align="center"
382   - ></el-table-column>
383   - <el-table-column
384   - prop="examScore"
385   - label="总分"
386   - sortable
387   - align="center"
388   - ></el-table-column>
389   - <el-table-column
390   - align="center"
391   - v-for="(item, index) in questionList"
392   - :key="index"
393   - :label="'Q' + item.id"
394   - >
  183 + <el-table :max-height="tableMaxHeight" v-show="type == 3" :data="tableData2" border style="width: 100%"
  184 + :default-sort="{ prop: '', order: 'descending' }">
  185 + <el-table-column prop="studentCode" label="学号" fixed align="center"></el-table-column>
  186 + <el-table-column prop="studentName" label="姓名" fixed align="center"></el-table-column>
  187 + <el-table-column prop="className" label="班级" align="center"></el-table-column>
  188 + <el-table-column prop="examScore" label="总分" sortable align="center"></el-table-column>
  189 + <el-table-column align="center" v-for="(item, index) in questionList" :key="index" :label="'Q' + item.id">
395 190 <template slot-scope="scope">
396 191 <span v-if="tableData[index]?.questionType == 5">*</span>
397   - <span
398   - v-else-if="scope.row['answer' + item.id]"
399   - :class="scope.row['isRight' + item.id] ? '' : 'error'"
400   - >
  192 + <span v-else-if="scope.row['answer' + item.id]" :class="scope.row['isRight' + item.id] ? '' : 'error'">
401 193 {{ scope.row["answer" + item.id] }}
402 194 </span>
403   - <span
404   - v-else
405   - :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'"
406   - >-</span
407   - >
  195 + <span v-else :class="scope.row['questionType' + item.id] == 5 ? '' : 'error'">-</span>
408 196 </template>
409 197 </el-table-column>
410 198 </el-table>
... ... @@ -412,79 +200,31 @@
412 200 </div>
413 201 <div class="down">
414 202 <div>
415   - <el-button
416   - @click="exportData"
417   - type="primary"
418   - plain
419   - round
420   - icon="fa fa-cloud-download"
421   - >导出报表</el-button
422   - >
423   - <el-button
424   - v-if="!this.$store.getters.code"
425   - @click="print"
426   - type="primary"
427   - plain
428   - round
429   - icon="el-icon-printer"
430   - >打印</el-button
431   - >
  203 + <el-button @click="exportData" type="primary" plain round icon="fa fa-cloud-download">导出报表</el-button>
  204 + <el-button v-if="!this.$store.getters.code" @click="print" type="primary" plain round
  205 + icon="el-icon-printer">打印</el-button>
432 206 </div>
433   - <div
434   - v-if="
435   - !status && role != 'ROLE_BANZHUREN' && examReport.examPaperId != 0
436   - "
437   - >
438   - <el-button
439   - class="score-set"
440   - v-if="this.showSelect == false"
441   - type="primary"
442   - round
443   - @click="openScoreSet(2)"
444   - >答卷录分</el-button
445   - >
  207 + <div v-if="!status && role != 'ROLE_BANZHUREN' && examReport.examPaperId != 0
  208 + ">
  209 + <el-button class="score-set" v-if="this.showSelect == false" type="primary" round
  210 + @click="openScoreSet(2)">答卷录分</el-button>
446 211 <el-popover v-else placement="bottom" width="194" ref="popoverRef">
447 212 <div style="display: flex">
448   - <el-button size="mini" @click="openScoreSet(1)"
449   - >录入总得分</el-button
450   - >
451   - <el-button type="primary" size="mini" @click="openScoreSet(2)"
452   - >录入小题分</el-button
453   - >
  213 + <el-button size="mini" @click="openScoreSet(1)">录入总得分</el-button>
  214 + <el-button type="primary" size="mini" @click="openScoreSet(2)">录入小题分</el-button>
454 215 </div>
455   - <el-button class="score-set" slot="reference" type="primary" round
456   - >答卷录分</el-button
457   - >
  216 + <el-button class="score-set" slot="reference" type="primary" round>答卷录分</el-button>
458 217 </el-popover>
459 218  
460   - <template
461   - v-if="examReport.subjectiveScore != examReport.examPaperScore"
462   - >
463   - <el-button @click="edit" type="primary" round
464   - >查看题目</el-button
465   - ></template
466   - >
  219 + <template v-if="examReport.subjectiveScore != examReport.examPaperScore">
  220 + <el-button @click="edit" type="primary" round>查看题目</el-button></template>
467 221 </div>
468 222 </div>
469   - <ScoreSet
470   - v-show="diaScoreSet"
471   - :role="role"
472   - :id="id"
473   - :title="title"
474   - :examScore="score"
475   - :showAllSetScore="showAllSetScore"
476   - :showSetScore="showSetScore"
477   - :diaScoreSet="diaScoreSet"
478   - @closeScoreSet="closeScoreSet"
479   - @SuccessScoreSet="SuccessScoreSet"
480   - />
481   - <el-dialog
482   - :close-on-click-modal="false"
483   - title="低分区间设置"
484   - :visible.sync="diaMinScore"
485   - width="480px"
486   - @closed="closeDiaMinScore"
487   - >
  223 + <ScoreSet v-show="diaScoreSet" :role="role" :id="id" :title="title" :examScore="score"
  224 + :showAllSetScore="showAllSetScore" :showSetScore="showSetScore" :diaScoreSet="diaScoreSet"
  225 + @closeScoreSet="closeScoreSet" @SuccessScoreSet="SuccessScoreSet" />
  226 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="低分区间设置" :visible.sync="diaMinScore"
  227 + width="480px" @closed="closeDiaMinScore">
488 228 <el-form>
489 229 <el-form-item label="低分设置模式:">
490 230 <el-select v-model="lowRange.type" @change="changeScore">
... ... @@ -494,35 +234,16 @@
494 234 </el-select>
495 235 </el-form-item>
496 236 <el-form-item label="低分区间:">
497   - <el-input
498   - class="score-ipt"
499   - type="number"
500   - v-model="lowRange.range[0]"
501   - :min="0"
502   - :max="100"
  237 + <el-input class="score-ipt" type="number" v-model="lowRange.range[0]" :min="0" :max="100"
503 238 @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''"
504   - @keydown.native="keydownRange($event)"
505   - ></el-input
506   - >{{ lowRange.type != 0 ? "%" : "分" }}(含)
507   - <el-input
508   - class="score-ipt"
509   - type="number"
510   - v-model="lowRange.range[1]"
511   - :min="0"
512   - :max="100"
  239 + @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含)
  240 + <el-input class="score-ipt" type="number" v-model="lowRange.range[1]" :min="0" :max="100"
513 241 @input="lowRange.range[1] > 100 ? (lowRange.range[1] = 100) : ''"
514   - @keydown.native="keydownRange($event)"
515   - ></el-input
516   - >{{ lowRange.type != 0 ? "%" : "分" }}(含)
  242 + @keydown.native="keydownRange($event)"></el-input>{{ lowRange.type != 0 ? "%" : "分" }}(含)
517 243 </el-form-item>
518 244 </el-form>
519 245  
520   - <div
521   - class="dialog-footer"
522   - slot="footer"
523   - align="center"
524   - v-loading="loadingTange"
525   - >
  246 + <div class="dialog-footer" slot="footer" align="center" v-loading="loadingTange">
526 247 <el-button type="danger" @click="_SavelowRange">保存</el-button>
527 248 <el-button @click="diaMinScore = false">取 消</el-button>
528 249 </div>
... ... @@ -849,8 +570,8 @@ export default {
849 570 ? defaultArr[index]?.option == 1
850 571 ? "✓"
851 572 : defaultArr[index]?.option == 2
852   - ? "✗"
853   - : defaultArr[index]?.option
  573 + ? "✗"
  574 + : defaultArr[index]?.option
854 575 : "";
855 576 items["title"] = "选项" + (index + 1);
856 577 } else {
... ... @@ -993,6 +714,7 @@ div::-webkit-scrollbar-thumb {
993 714 display: flex;
994 715 justify-content: space-between;
995 716 }
  717 +
996 718 .score-set {
997 719 margin-right: 10px;
998 720 }
... ...
src/views/basic/test/list.vue
... ... @@ -5,20 +5,8 @@
5 5 <span>即时测-数据报表</span>
6 6 </template>
7 7 <template slot="btns">
8   - <el-tooltip
9   - v-if="!code && gdClass"
10   - effect="dark"
11   - content="已归档试卷"
12   - placement="bottom"
13   - >
14   - <el-button
15   - type="primary"
16   - icon="fa fa-archive"
17   - size="mini"
18   - plain
19   - circle
20   - @click="toArchiving"
21   - ></el-button>
  8 + <el-tooltip v-if="!code && gdClass" effect="dark" content="已归档试卷" placement="bottom">
  9 + <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button>
22 10 </el-tooltip>
23 11 </template>
24 12 </back-box>
... ... @@ -26,216 +14,96 @@
26 14 <div>
27 15 <p v-if="!isMultipleClass" class="btn-box">
28 16 <el-button type="primary" round @click="linkToTest">筛选</el-button>
29   - <el-button type="primary" round @click="linkToDetail2"
30   - >查看汇总报表</el-button
31   - >
  17 + <el-button type="primary" round @click="linkToDetail2">查看汇总报表</el-button>
32 18 </p>
33   - <el-table
34   - :data="tableData"
35   - :max-height="tableMaxHeight"
36   - border
37   - style="width: 100%"
38   - >
  19 + <el-table :data="tableData" :max-height="tableMaxHeight" border style="width: 100%">
39 20 <template v-if="isMultipleClass">
40   - <el-table-column
41   - prop="subjectName"
42   - label="科目"
43   - align="center"
44   - ></el-table-column>
  21 + <el-table-column prop="subjectName" label="科目" align="center"></el-table-column>
45 22 <el-table-column prop="classList" label="班级" align="center">
46 23 <template slot-scope="scoped">
47 24 <span v-for="(item, index) in scoped.row.classNames">{{
48   - `${index == 0 ? "" : "/"}` + item
49   - }}</span>
  25 + `${index == 0 ? "" : "/"}` + item
  26 + }}</span>
50 27 </template>
51 28 </el-table-column>
52   - <el-table-column
53   - prop="title"
54   - label="试卷名称"
55   - align="center"
56   - ></el-table-column>
57   - <el-table-column
58   - prop="examPaperScore"
59   - label="卷面分"
60   - align="center"
61   - ></el-table-column>
  29 + <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
  30 + <el-table-column prop="examPaperScore" label="卷面分" align="center"></el-table-column>
62 31 <el-table-column label="操作" align="center">
63 32 <template slot-scope="scoped">
64   - <el-button
65   - type="primary"
66   - circle
67   - size="mini"
68   - icon="el-icon-arrow-right"
69   - @click="linkContrast(scoped.row)"
70   - ></el-button>
  33 + <el-button type="primary" circle size="mini" icon="el-icon-arrow-right"
  34 + @click="linkContrast(scoped.row)"></el-button>
71 35 </template>
72 36 </el-table-column>
73 37 </template>
74 38 <template v-if="!isMultipleClass">
75 39 <el-table-column width="48">
76 40 <template slot-scope="scope">
77   - <el-checkbox
78   - v-model="multipleSelection"
79   - :label="scope.row.id"
80   - :disabled="checkboxDisabled(scope.row)"
81   - ><span></span
82   - ></el-checkbox>
  41 + <el-checkbox v-model="multipleSelection" :label="scope.row.id"
  42 + :disabled="checkboxDisabled(scope.row)"><span></span></el-checkbox>
83 43 </template>
84 44 </el-table-column>
85   - <el-table-column
86   - prop="subjectName"
87   - label="科目"
88   - align="center"
89   - ></el-table-column>
90   - <el-table-column
91   - prop="className"
92   - label="班级"
93   - align="center"
94   - ></el-table-column>
95   - <el-table-column
96   - prop="title"
97   - label="试卷名称"
98   - align="center"
99   - ></el-table-column>
100   - <el-table-column
101   - prop="examPaperScore"
102   - label="卷面分"
103   - align="center"
104   - ></el-table-column>
  45 + <el-table-column prop="subjectName" label="科目" align="center"></el-table-column>
  46 + <el-table-column prop="className" label="班级" align="center"></el-table-column>
  47 + <el-table-column prop="title" label="试卷名称" align="center"></el-table-column>
  48 + <el-table-column prop="examPaperScore" label="卷面分" align="center"></el-table-column>
105 49 <el-table-column label="测验人数/班级人数" align="center">
106 50 <template slot-scope="scoped">{{
107   - `${scoped.row.answeredNum}/${scoped.row.classPersonNum}`
108   - }}</template>
  51 + `${scoped.row.answeredNum}/${scoped.row.classPersonNum}`
  52 + }}</template>
109 53 </el-table-column>
110   - <el-table-column
111   - prop="examStartTime"
112   - label="测验开始时间"
113   - align="center"
114   - ></el-table-column>
  54 + <el-table-column prop="examStartTime" label="测验开始时间" align="center"></el-table-column>
115 55 <el-table-column label="操作" align="center">
116 56 <template slot-scope="scoped">
117   - <el-tooltip
118   - v-if="
119   - scoped.row.answerNum != 0 ||
120   - (scoped.row.recordStatus != 0 &&
121   - scoped.row.subjectiveScore == scoped.row.examPaperScore)
122   - "
123   - effect="dark"
124   - content="详情"
125   - placement="top"
126   - >
127   - <el-button
128   - type="primary"
129   - circle
130   - size="mini"
131   - icon="fa fa-arrow-right"
132   - @click="linkTo(scoped.row)"
133   - ></el-button>
  57 + <el-tooltip v-if="scoped.row.answerNum != 0 ||
  58 + (scoped.row.recordStatus != 0 &&
  59 + scoped.row.subjectiveScore == scoped.row.examPaperScore)
  60 + " effect="dark" content="详情" placement="top">
  61 + <el-button type="primary" circle size="mini" icon="fa fa-arrow-right"
  62 + @click="linkTo(scoped.row)"></el-button>
134 63 </el-tooltip>
135   - <template
136   - v-if="
137   - scoped.row.answerNum == 0 &&
138   - scoped.row.subjectiveScore != scoped.row.examPaperScore
139   - "
140   - >
141   - <el-tooltip
142   - v-if="role != 'ROLE_BANZHUREN'"
143   - effect="dark"
144   - content="设置答案"
145   - placement="top"
146   - >
147   - <el-button
148   - type="primary"
149   - circle
150   - size="mini"
151   - icon="fa fa-file-text"
152   - @click="edit(scoped.row)"
153   - ></el-button>
  64 + <template v-if="scoped.row.answerNum == 0 &&
  65 + scoped.row.subjectiveScore != scoped.row.examPaperScore
  66 + ">
  67 + <el-tooltip v-if="role != 'ROLE_BANZHUREN'" effect="dark" content="设置答案" placement="top">
  68 + <el-button type="primary" circle size="mini" icon="fa fa-file-text"
  69 + @click="edit(scoped.row)"></el-button>
154 70 </el-tooltip>
155 71 <template v-else>未设置答案</template>
156 72 </template>
157   - <template
158   - v-if="role != 'ROLE_BANZHUREN' && scoped.row.examPaperId != 0"
159   - >
  73 + <template v-if="role != 'ROLE_BANZHUREN' && scoped.row.examPaperId != 0">
160 74 <template>
161 75 <el-popover placement="bottom" width="194" ref="popoverRef">
162   - <div
163   - style="display: flex"
164   - v-loading="
165   - scoped.row.showSelect == 0 ||
166   - scoped.row.showSelect == 1
167   - ? false
168   - : true
169   - "
170   - >
171   - <el-button
172   - v-if="scoped.row.showSelect == 0"
173   - size="mini"
174   - @click="openScoreSet(scoped.row, 1)"
175   - >录入总得分</el-button
176   - >
177   - <el-button
178   - type="primary"
179   - size="mini"
180   - @click="openScoreSet(scoped.row, 2)"
181   - >录入小题分</el-button
182   - >
  76 + <div style="display: flex" v-loading="scoped.row.showSelect == 0 ||
  77 + scoped.row.showSelect == 1
  78 + ? false
  79 + : true
  80 + ">
  81 + <el-button v-if="scoped.row.showSelect == 0" size="mini"
  82 + @click="openScoreSet(scoped.row, 1)">录入总得分</el-button>
  83 + <el-button type="primary" size="mini" @click="openScoreSet(scoped.row, 2)">录入小题分</el-button>
183 84 </div>
184   - <el-button
185   - class="remove-test"
186   - slot="reference"
187   - type="primary"
188   - circle
189   - size="mini"
190   - @click="queryStatus(scoped.row)"
191   - >分</el-button
192   - >
  85 + <el-button class="remove-test" slot="reference" type="primary" circle size="mini"
  86 + @click="queryStatus(scoped.row)">分</el-button>
193 87 </el-popover>
194 88 </template>
195 89 </template>
196   - <el-popconfirm
197   - v-if="role != 'ROLE_BANZHUREN'"
198   - title="确定删除吗?"
199   - @confirm="removeReport(scoped.row, scoped.$index)"
200   - >
201   - <el-button
202   - class="remove-test"
203   - slot="reference"
204   - type="danger"
205   - circle
206   - size="mini"
207   - icon="el-icon-delete"
208   - :loading="scoped.row.loading"
209   - ></el-button>
  90 + <el-popconfirm v-if="role != 'ROLE_BANZHUREN'" title="确定删除吗?"
  91 + @confirm="removeReport(scoped.row, scoped.$index)">
  92 + <el-button class="remove-test" slot="reference" type="danger" circle size="mini" icon="el-icon-delete"
  93 + :loading="scoped.row.loading"></el-button>
210 94 </el-popconfirm>
211 95 </template>
212 96 </el-table-column>
213 97 </template>
214 98 </el-table>
215 99 <div class="pagination-box">
216   - <el-pagination
217   - small=""
218   - layout="total,prev, pager, next"
219   - :hide-on-single-page="true"
220   - :total="total"
221   - @current-change="changePage"
222   - :current-page="page"
223   - :page-size="size"
224   - >
  100 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  101 + @current-change="changePage" :current-page="page" :page-size="size">
225 102 </el-pagination>
226 103 </div>
227   - <ScoreSet
228   - v-show="diaScoreSet"
229   - :diaScoreSet="diaScoreSet"
230   - :role="role"
231   - :id="examId"
232   - :title="examTitlt"
233   - :examScore="examScore"
234   - :showAllSetScore="showAllSetScore"
235   - :showSetScore="showSetScore"
236   - @closeScoreSet="closeScoreSet"
237   - @SuccessScoreSet="SuccessScoreSet"
238   - />
  104 + <ScoreSet v-show="diaScoreSet" :diaScoreSet="diaScoreSet" :role="role" :id="examId" :title="examTitlt"
  105 + :examScore="examScore" :showAllSetScore="showAllSetScore" :showSetScore="showSetScore"
  106 + @closeScoreSet="closeScoreSet" @SuccessScoreSet="SuccessScoreSet" />
239 107 </div>
240 108 </div>
241 109 <router-view v-show="isDetail"></router-view>
... ... @@ -679,4 +547,4 @@ div::-webkit-scrollbar-thumb {
679 547 top: 4px;
680 548 z-index: 10;
681 549 }
682   -</style>
683 550 \ No newline at end of file
  551 +</style>
... ...
src/views/basic/userInfo/index.vue
... ... @@ -25,80 +25,30 @@
25 25 </ul>
26 26 </div>
27 27 </div>
28   - <el-dialog :close-on-click-modal="false" title="修改个人信息" :visible.sync="diaSchool" width="400">
29   - <el-form
30   - ref="formSchool"
31   - class="form-box"
32   - :model="formSchool"
33   - :rules="rulesSchool"
34   - label-width="160px"
35   - >
36   - <el-form-item label="学校名称:" prop="tenantName"
37   - ><el-col :span="10"
38   - ><el-input
39   - maxlength="30"
40   - v-model="formSchool.tenantName"
41   - placeholder="请输入教师姓名"
42   - ></el-input></el-col
43   - ></el-form-item>
44   - <el-form-item label="教师姓名:" prop="contactPerson"
45   - ><el-col :span="10"
46   - ><el-input
47   - maxlength="30"
48   - v-model="formSchool.contactPerson"
49   - placeholder="请输入教师姓名"
50   - ></el-input></el-col
51   - ></el-form-item>
52   - <el-form-item label="手机号码:" prop="contactPhone"
53   - ><el-col :span="10"
54   - ><el-input
55   - v-model="formSchool.contactPhone"
56   - type="number"
57   - oninput="if(value.length > 11) value = value.slice(0,11)"
58   - placeholder="请输入教师姓名手机号码"
59   - ></el-input></el-col
60   - ></el-form-item>
  28 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改个人信息" :visible.sync="diaSchool"
  29 + width="400">
  30 + <el-form ref="formSchool" class="form-box" :model="formSchool" :rules="rulesSchool" label-width="160px">
  31 + <el-form-item label="学校名称:" prop="tenantName"><el-col :span="10"><el-input maxlength="30"
  32 + v-model="formSchool.tenantName" placeholder="请输入教师姓名"></el-input></el-col></el-form-item>
  33 + <el-form-item label="教师姓名:" prop="contactPerson"><el-col :span="10"><el-input maxlength="30"
  34 + v-model="formSchool.contactPerson" placeholder="请输入教师姓名"></el-input></el-col></el-form-item>
  35 + <el-form-item label="手机号码:" prop="contactPhone"><el-col :span="10"><el-input v-model="formSchool.contactPhone"
  36 + type="number" oninput="if(value.length > 11) value = value.slice(0,11)"
  37 + placeholder="请输入教师姓名手机号码"></el-input></el-col></el-form-item>
61 38 </el-form>
62 39 <div class="dialog-footer" slot="footer">
63 40 <el-button @click="editSchool">确 定</el-button>
64 41 <el-button @click="diaSchool = false">取 消</el-button>
65 42 </div>
66 43 </el-dialog>
67   - <el-dialog :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
68   - <el-form
69   - ref="formPass"
70   - class="form-box"
71   - :model="password"
72   - :rules="rulesPassword"
73   - label-width="160px"
74   - >
75   - <el-form-item label="旧密码:" prop="oldPassword"
76   - ><el-col :span="10"
77   - ><el-input
78   - maxlength="30"
79   - v-model="password.oldPassword"
80   - placeholder="请输入密码"
81   - show-password
82   - ></el-input></el-col
83   - ></el-form-item>
84   - <el-form-item label="新密码:" prop="password"
85   - ><el-col :span="10"
86   - ><el-input
87   - maxlength="30"
88   - v-model="password.password"
89   - placeholder="请输入新密码"
90   - show-password
91   - ></el-input></el-col
92   - ></el-form-item>
93   - <el-form-item label="确认密码:" prop="resetPassword"
94   - ><el-col :span="10"
95   - ><el-input
96   - maxlength="30"
97   - v-model="password.resetPassword"
98   - placeholder="请输入新密码"
99   - show-password
100   - ></el-input></el-col
101   - ></el-form-item>
  44 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
  45 + <el-form ref="formPass" class="form-box" :model="password" :rules="rulesPassword" label-width="160px">
  46 + <el-form-item label="旧密码:" prop="oldPassword"><el-col :span="10"><el-input maxlength="30"
  47 + v-model="password.oldPassword" placeholder="请输入密码" show-password></el-input></el-col></el-form-item>
  48 + <el-form-item label="新密码:" prop="password"><el-col :span="10"><el-input maxlength="30"
  49 + v-model="password.password" placeholder="请输入新密码" show-password></el-input></el-col></el-form-item>
  50 + <el-form-item label="确认密码:" prop="resetPassword"><el-col :span="10"><el-input maxlength="30"
  51 + v-model="password.resetPassword" placeholder="请输入新密码" show-password></el-input></el-col></el-form-item>
102 52 </el-form>
103 53 <div class="dialog-footer" slot="footer">
104 54 <el-button @click="editPass">确 定</el-button>
... ... @@ -214,7 +164,7 @@ export default {
214 164 this.loading = true;
215 165 const { data, status, info } = await this.$request.getInfo();
216 166 this.loading = false;
217   -
  167 +
218 168 if (status === 0) {
219 169 this.Info = { ...data };
220 170 for (let key in this.formSchool) {
... ... @@ -244,10 +194,12 @@ export default {
244 194 <style lang="scss" scoped>
245 195 .page-content {
246 196 padding: 20px;
  197 +
247 198 .content-box {
248 199 background: #f8f8f8;
249 200 border-radius: 16px;
250 201 position: relative;
  202 +
251 203 .el-icon-edit {
252 204 position: absolute;
253 205 top: 12px;
... ... @@ -255,10 +207,12 @@ export default {
255 207 padding: 5px;
256 208 font-size: 18px;
257 209 cursor: pointer;
  210 +
258 211 &:hover {
259 212 color: #36f;
260 213 }
261 214 }
  215 +
262 216 .el-icon-key {
263 217 position: absolute;
264 218 top: 12px;
... ... @@ -266,43 +220,52 @@ export default {
266 220 padding: 5px;
267 221 font-size: 18px;
268 222 cursor: pointer;
  223 +
269 224 &:hover {
270 225 color: #36f;
271 226 }
272 227 }
273 228 }
  229 +
274 230 .school-info {
275 231 display: flex;
276 232 flex-wrap: wrap;
277 233 padding: 16px 0;
278 234 border-bottom: 0.5px solid #f2f2f2;
  235 +
279 236 .school-item {
280 237 width: 50%;
281 238 line-height: 48px;
282 239 padding-left: 100px;
283 240 display: flex;
284 241 box-sizing: border-box;
  242 +
285 243 .s1 {
286 244 width: 160px;
287 245 font-size: 15px;
288 246 color: #888;
289 247 }
  248 +
290 249 .s2 {
291 250 flex: 1;
292 251 }
293 252 }
294 253 }
295 254 }
  255 +
296 256 .form-box {
297 257 margin: 0 20px;
  258 +
298 259 .subject-box {
299 260 height: 90px;
300 261 overflow: hidden;
301 262 position: relative;
  263 +
302 264 &.active {
303 265 height: auto;
304 266 overflow: auto;
305 267 }
  268 +
306 269 .showAll {
307 270 position: absolute;
308 271 bottom: 0;
... ... @@ -311,14 +274,17 @@ export default {
311 274 color: #7f7f7f;
312 275 cursor: pointer;
313 276 padding: 2px;
  277 +
314 278 &:hover {
315 279 color: #667ffd;
316 280 }
317 281 }
318 282 }
319 283 }
  284 +
320 285 .el-icon-plus {
321 286 cursor: pointer;
  287 +
322 288 &:hover {
323 289 color: #667ffd;
324 290 }
... ...
src/views/examinationPaper/add.vue
... ... @@ -7,111 +7,46 @@
7 7 </template>
8 8 </back-box>
9 9 <div class="content">
10   - <el-steps
11   - :active="step"
12   - finish-status="success"
13   - simple
14   - style="margin: 20px 0"
15   - >
  10 + <el-steps :active="step" finish-status="success" simple style="margin: 20px 0">
16 11 <el-step title="基础信息" icon="el-icon-edit"></el-step>
17   - <el-step
18   - v-if="!isUpload"
19   - title="题目编辑"
20   - icon="el-icon-tickets"
21   - ></el-step>
  12 + <el-step v-if="!isUpload" title="题目编辑" icon="el-icon-tickets"></el-step>
22 13 <el-step title="设置答案" icon="el-icon-edit-outline"></el-step>
23   - <el-step
24   - v-if="isUpload"
25   - title="试卷预览"
26   - icon="el-icon-edit-outline"
27   - ></el-step>
  14 + <el-step v-if="isUpload" title="试卷预览" icon="el-icon-edit-outline"></el-step>
28 15 </el-steps>
29 16 <div v-show="step == 0">
30   - <el-form
31   - ref="forms"
32   - :model="form"
33   - :rules="formRules"
34   - label-width="140px"
35   - >
  17 + <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
36 18 <el-form-item label="答题卡名称:" prop="title">
37   - <el-input
38   - class="sel2"
39   - type="text"
40   - placeholder="请输入答题卡名称"
41   - v-model.trim="form.title"
42   - maxlength="50"
43   - size="45"
44   - show-word-limit
45   - >
  19 + <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45"
  20 + show-word-limit>
46 21 </el-input>
47 22 </el-form-item>
48 23 <el-form-item label="测验类型:">
49 24 <el-select v-model="form.tagId" placeholder="选择测验类型">
50 25 <el-option label="--" value=""> </el-option>
51   - <el-option
52   - v-for="item in answerTypeList"
53   - :key="item.id"
54   - :label="item.typeName"
55   - :value="item.id"
56   - >{{ item.typeName }}</el-option
57   - >
  26 + <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{
  27 + item.typeName }}</el-option>
58 28 </el-select>
59   - <el-button
60   - class="ml-20"
61   - type="primary"
62   - round
63   - circle
64   - icon="el-icon-edit"
65   - @click="openTagDia"
66   - ></el-button>
  29 + <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button>
67 30 </el-form-item>
68   - <el-form-item
69   - v-if="role != 'ROLE_PERSONAL'"
70   - label="年级:"
71   - prop="gradeName"
72   - >
73   - <el-select
74   - class="sel"
75   - v-model="form.gradeName"
76   - placeholder=""
77   - @change="changeGrade"
78   - >
79   - <el-option
80   - v-for="item in gradeList"
81   - :key="item"
82   - :label="item"
83   - :value="item"
84   - >
  31 + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName">
  32 + <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade">
  33 + <el-option v-for="item in gradeList" :key="item" :label="item" :value="item">
85 34 </el-option>
86 35 </el-select>
87 36 </el-form-item>
88 37 <el-form-item label="科目:" prop="subjectName">
89 38 <el-select class="sel" v-model="form.subjectName" placeholder="">
90   - <el-option
91   - v-for="item in subjectList"
92   - :key="item.value"
93   - :label="item.label"
94   - :value="item.value"
95   - >{{ item.label }}
  39 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{
  40 + item.label
  41 + }}
96 42 </el-option>
97 43 </el-select>
98 44 </el-form-item>
99 45 <el-form-item label="考试时长:">
100   - <el-input-number
101   - size="medium"
102   - :min="1"
103   - :max="140"
104   - :step-strictly="true"
105   - :step="1"
106   - v-model="form.examsDuration"
107   - label="考试时长"
108   - ></el-input-number>
  46 + <el-input-number size="medium" :min="1" :max="140" :step-strictly="true" :step="1"
  47 + v-model="form.examsDuration" label="考试时长"></el-input-number>
109 48 </el-form-item>
110   - <el-form-item
111   - v-if="role != 'ROLE_PERSONAL'"
112   - label="分享范围:"
113   - prop="sharingType"
114   - >
  49 + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType">
115 50 <el-radio-group v-model="form.sharingType">
116 51 <el-radio :label="0">任课班级分享</el-radio>
117 52 <el-radio :label="1">全年级分享</el-radio>
... ... @@ -119,58 +54,24 @@
119 54 </el-form-item>
120 55 </el-form>
121 56 <div class="btn-box">
122   - <el-button type="danger" plain round @click="linkBack"
123   - >取消</el-button
124   - >
125   - <el-button
126   - type="primary"
127   - round
128   - @click="isUpload ? setStep2() : setStep1()"
129   - >下一步</el-button
130   - >
  57 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
  58 + <el-button type="primary" round @click="isUpload ? setStep2() : setStep1()">下一步</el-button>
131 59 </div>
132   - <el-dialog
133   - :close-on-click-modal="false"
134   - title="设置测验类型"
135   - :visible.sync="dialogVisible"
136   - width="500px"
137   - >
  60 + <el-dialog :close-on-click-modal="false" title="设置测验类型" :visible.sync="dialogVisible" width="500px">
138 61 <div class="dia-content">
139 62 <p class="add-type" v-for="item in tagList" :key="item.id">
140 63 <el-row :gutter="10">
141   - <el-col :span="18"
142   - ><el-input
143   - v-model="item.typeName"
144   - :maxlength="10"
145   - placeholder="请输入答题卡类型名称"
146   - ></el-input
147   - ></el-col>
  64 + <el-col :span="18"><el-input v-model="item.typeName" :maxlength="10"
  65 + placeholder="请输入答题卡类型名称"></el-input></el-col>
148 66 <el-col :span="6">
149 67 <el-tooltip effect="dark" content="保存" placement="top">
150   - <el-button
151   - class="js-set"
152   - type="primary"
153   - size="small"
154   - round
155   - circle
156   - icon="el-icon-check"
157   - @click="editTypeName(item)"
158   - ></el-button>
  68 + <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-check"
  69 + @click="editTypeName(item)"></el-button>
159 70 </el-tooltip>
160 71 <el-tooltip effect="dark" content="删除" placement="right">
161   - <el-popconfirm
162   - title="确定删除这道大题吗?"
163   - @confirm="removeTypeName(item)"
164   - >
165   - <el-button
166   - class="js-set"
167   - type="danger"
168   - size="small"
169   - round
170   - circle
171   - icon="el-icon-delete"
172   - slot="reference"
173   - ></el-button>
  72 + <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)">
  73 + <el-button class="js-set" type="danger" size="small" round circle icon="el-icon-delete"
  74 + slot="reference"></el-button>
174 75 </el-popconfirm>
175 76 </el-tooltip>
176 77 </el-col>
... ... @@ -179,25 +80,13 @@
179 80 <p class="add-type">
180 81 <el-row :gutter="10">
181 82 <el-col :span="18">
182   - <el-input
183   - type="text"
184   - placeholder="请输入答题卡类型名称"
185   - v-model.trim="answerTypeName"
186   - :maxlength="10"
187   - >
  83 + <el-input type="text" placeholder="请输入答题卡类型名称" v-model.trim="answerTypeName" :maxlength="10">
188 84 </el-input>
189 85 </el-col>
190 86 <el-col :span="6">
191 87 <el-tooltip effect="dark" content="添加" placement="right">
192   - <el-button
193   - class="js-set"
194   - type="primary"
195   - size="small"
196   - round
197   - circle
198   - icon="el-icon-plus"
199   - @click="addPaperType"
200   - ></el-button>
  88 + <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-plus"
  89 + @click="addPaperType"></el-button>
201 90 </el-tooltip>
202 91 </el-col>
203 92 </el-row>
... ... @@ -210,44 +99,20 @@
210 99 </div>
211 100 <template v-if="!isUpload">
212 101 <div v-show="step == 1">
213   - <div
214   - class="question-box"
215   - v-for="(question, index) in form.questionList"
216   - :key="index"
217   - >
  102 + <div class="question-box" v-for="(question, index) in form.questionList" :key="index">
218 103 <p class="question-title">
219   - <el-tooltip
220   - effect="dark"
221   - :content="question.show ? '收起' : '展开'"
222   - placement="left"
223   - >
224   - <i
225   - class="el-icon-caret-right"
226   - :class="question.show ? 'active' : ''"
227   - @click="question.show = !question.show"
228   - ></i>
  104 + <el-tooltip effect="dark" :content="question.show ? '收起' : '展开'" placement="left">
  105 + <i class="el-icon-caret-right" :class="question.show ? 'active' : ''"
  106 + @click="question.show = !question.show"></i>
229 107 </el-tooltip>
230 108 <span>{{ setBigNum(index) }}、</span>
231   - <el-input
232   - class="ipt"
233   - v-model.trim="question.questionTitle"
234   - maxlength="30"
235   - placeholder="填写大题名称"
236   - ></el-input>
237   - <el-popconfirm
238   - title="确定删除这道大题吗?"
239   - @confirm="form.questionList.splice(index, 1)"
240   - >
241   - <el-button
242   - slot="reference"
243   - class="delete"
244   - type="danger"
245   - size="mini"
246   - circle
247   - icon="el-icon-delete"
248   - ></el-button>
  109 + <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30"
  110 + placeholder="填写大题名称"></el-input>
  111 + <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)">
  112 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  113 + icon="el-icon-delete"></el-button>
249 114 </el-popconfirm>
250   - <span class="m20">共:{{ question.subQuestions?.length }}题</span>
  115 + <span class="m20">共:{{ question.subQuestions ? question.subQuestions.length : 0 }}题</span>
251 116 <span>共:{{ setScore(question) }}分</span>
252 117 </p>
253 118 <transition name="el-zoom-in-top">
... ... @@ -260,21 +125,12 @@
260 125 <div class="qs-options">选项设置</div>
261 126 <div class="qs-set">操作</div>
262 127 </li>
263   - <template
264   - v-for="(subQuestions, indexs) in question.subQuestions"
265   - >
266   - <li
267   - v-if="!subQuestions.qusType && !subQuestions.subNum"
268   - class="sub-questions"
269   - :key="indexs"
270   - >
  128 + <template v-for="(subQuestions, indexs) in question.subQuestions">
  129 + <li v-if="!subQuestions.qusType && !subQuestions.subNum" class="sub-questions" :key="indexs">
271 130 <div class="qs-num">{{ setNum(index, indexs) }}</div>
272 131 <div class="qs-type">
273   - <el-select
274   - v-model="subQuestions.questionType"
275   - placeholder="选择题目类型"
276   - @change="changeSubQuestions($event, subQuestions)"
277   - >
  132 + <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
  133 + @change="changeSubQuestions($event, subQuestions)">
278 134 <el-option label="单选题" :value="2"></el-option>
279 135 <el-option label="多选题" :value="3"></el-option>
280 136 <el-option label="判断题" :value="4"></el-option>
... ... @@ -282,127 +138,50 @@
282 138 </el-select>
283 139 </div>
284 140 <div class="qs-score">
285   - <el-input-number
286   - class="number-ipt"
287   - size="medium"
288   - :min="1"
289   - :max="200"
290   - :precision="2"
291   - :step="1"
292   - v-model="subQuestions.score"
293   - label="单题分值"
294   - ></el-input-number>
  141 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
  142 + v-model="subQuestions.score" label="单题分值"></el-input-number>
295 143 </div>
296 144 <div class="qs-partScore">
297 145 <p v-if="subQuestions.questionType != 3">--</p>
298   - <el-input-number
299   - class="number-ipt"
300   - v-else
301   - size="medium"
302   - :min="0"
303   - :precision="2"
304   - :max="subQuestions.score"
305   - :step="0.5"
306   - v-model="subQuestions.partScore"
307   - label="漏选得分"
308   - ></el-input-number>
  146 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  147 + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore"
  148 + label="漏选得分"></el-input-number>
309 149 </div>
310 150 <div class="qs-options">
311 151 <p v-if="subQuestions.questionType == 5">--</p>
312   - <p
313   - v-if="subQuestions.questionType == 4"
314   - class="answer-box"
315   - >
316   - <span
317   - class="answer-s"
318   - :class="
319   - subQuestions.correctAnswer == 1 ? 'active' : ''
320   - "
321   - @click="subQuestions.correctAnswer = 1"
322   - >✓</span
323   - >
324   - <span
325   - class="answer-s"
326   - :class="
327   - subQuestions.correctAnswer == 2 ? 'active' : ''
328   - "
329   - @click="subQuestions.correctAnswer = 2"
330   - >✗</span
331   - >
  152 + <p v-if="subQuestions.questionType == 4" class="answer-box">
  153 + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''
  154 + " @click="subQuestions.correctAnswer = 1">✓</span>
  155 + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''
  156 + " @click="subQuestions.correctAnswer = 2">✗</span>
332 157 </p>
333   - <p
334   - v-if="subQuestions.questionType == 3"
335   - class="answer-box"
336   - >
337   - <span
338   - class="answer-s"
339   - v-for="option in subQuestions.answerOptions.split(
340   - ','
341   - )"
342   - :class="
343   - subQuestions.correctAnswer?.includes(option)
344   - ? 'active'
345   - : ''
346   - "
347   - :key="option"
348   - @click="changAnswer(subQuestions, option)"
349   - >{{ option }}</span
350   - >
  158 + <p v-if="subQuestions.questionType == 3" class="answer-box">
  159 + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(
  160 + ','
  161 + )" :class="subQuestions.correctAnswer ? subQuestions.correctAnswer.includes(option)
  162 + ? 'active'
  163 + : '' : ''
  164 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
351 165 </p>
352   - <p
353   - v-if="subQuestions.questionType == 2"
354   - class="answer-box"
355   - >
356   - <span
357   - class="answer-s"
358   - v-for="option in subQuestions.answerOptions.split(
359   - ','
360   - )"
361   - :class="
362   - subQuestions.correctAnswer == option ? 'active' : ''
363   - "
364   - :key="option"
365   - @click="subQuestions.correctAnswer = option"
366   - >{{ option }}</span
367   - >
  166 + <p v-if="subQuestions.questionType == 2" class="answer-box">
  167 + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(
  168 + ','
  169 + )" :class="subQuestions.correctAnswer == option ? 'active' : ''
  170 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
368 171 </p>
369   - <p
370   - v-if="
371   - subQuestions.questionType == 3 ||
372   - subQuestions.questionType == 2
373   - "
374   - class="answer-box answer-box2"
375   - >
376   - <el-button
377   - size="mini"
378   - type="primary"
379   - icon="el-icon-plus"
380   - circle
381   - @click="addOptions(subQuestions)"
382   - ></el-button>
383   - <el-button
384   - size="mini"
385   - type="primary"
386   - icon="el-icon-minus"
387   - round
388   - circle
389   - @click="removeOptions(subQuestions)"
390   - ></el-button>
  172 + <p v-if="subQuestions.questionType == 3 ||
  173 + subQuestions.questionType == 2
  174 + " class="answer-box answer-box2">
  175 + <el-button size="mini" type="primary" icon="el-icon-plus" circle
  176 + @click="addOptions(subQuestions)"></el-button>
  177 + <el-button size="mini" type="primary" icon="el-icon-minus" round circle
  178 + @click="removeOptions(subQuestions)"></el-button>
391 179 </p>
392 180 </div>
393 181 <div class="qs-set">
394   - <el-popconfirm
395   - title="确定删除这道题吗?"
396   - @confirm="delTabData(indexs, index)"
397   - >
398   - <el-button
399   - slot="reference"
400   - class="delete"
401   - type="danger"
402   - size="mini"
403   - circle
404   - icon="el-icon-delete"
405   - ></el-button>
  182 + <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)">
  183 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  184 + icon="el-icon-delete"></el-button>
406 185 </el-popconfirm>
407 186 </div>
408 187 </li>
... ... @@ -410,11 +189,8 @@
410 189 <li class="sub-questions">
411 190 <div class="qs-num">添加</div>
412 191 <div class="qs-type">
413   - <el-select
414   - v-model="addSubQuestionsType"
415   - placeholder="选择题目类型"
416   - @change="changeAddSubQuestions($event, question)"
417   - >
  192 + <el-select v-model="addSubQuestionsType" placeholder="选择题目类型"
  193 + @change="changeAddSubQuestions($event, question)">
418 194 <el-option label="单选题" :value="2"></el-option>
419 195 <el-option label="多选题" :value="3"></el-option>
420 196 <el-option label="判断题" :value="4"></el-option>
... ... @@ -431,216 +207,103 @@
431 207 </div>
432 208 <div class="add-box">
433 209 <p class="add-question" @click="openQuestion">
434   - <el-button
435   - size="mini"
436   - type="primary"
437   - icon="el-icon-plus"
438   - circle
439   - ></el-button>
  210 + <el-button size="mini" type="primary" icon="el-icon-plus" circle></el-button>
440 211 <span class="s1">添加大题</span>
441 212 </p>
442 213 </div>
443 214 <div class="btn-box">
444   - <el-button type="danger" plain round @click="linkBack"
445   - >取消</el-button
446   - >
  215 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
447 216 <el-button round @click="step = 0">上一步</el-button>
448   - <el-button
449   - :type="form.questionList.length == 0 ? 'info' : 'primary'"
450   - round
451   - @click="setStep2"
452   - >下一步</el-button
453   - >
  217 + <el-button :type="form.questionList.length == 0 ? 'info' : 'primary'" round
  218 + @click="setStep2">下一步</el-button>
454 219 </div>
455   - <el-dialog
456   - :close-on-click-modal="false"
457   - title="添加大题"
458   - :visible.sync="addQuestionVisible"
459   - width="600px"
460   - >
  220 + <el-dialog :close-on-click-modal="false" title="添加大题" :visible.sync="addQuestionVisible" width="600px">
461 221 <div class="dia-content">
462   - <el-form
463   - ref="form"
464   - :model="questionForm"
465   - :rules="questionFormRules"
466   - label-width="100px"
467   - >
  222 + <el-form ref="form" :model="questionForm" :rules="questionFormRules" label-width="100px">
468 223 <el-form-item label="标题:">
469 224 <el-col :span="20">
470   - <el-input
471   - v-model.trim="questionForm.questionTitle"
472   - maxlength="30"
473   - placeholder="输入大题名称"
474   - ></el-input>
  225 + <el-input v-model.trim="questionForm.questionTitle" maxlength="30" placeholder="输入大题名称"></el-input>
475 226 </el-col>
476 227 </el-form-item>
477 228 <el-form-item label="选择题型:">
478   - <el-select
479   - v-model="questionForm.questionType"
480   - placeholder=""
481   - @change="setQuestionForm"
482   - >
483   - <el-option
484   - v-for="item in questionOptions"
485   - :key="item.value"
486   - :label="item.label"
487   - :value="item.value"
488   - >
  229 + <el-select v-model="questionForm.questionType" placeholder="" @change="setQuestionForm">
  230 + <el-option v-for="item in questionOptions" :key="item.value" :label="item.label"
  231 + :value="item.value">
489 232 </el-option>
490 233 <el-option label="混合题" :value="6"> </el-option>
491 234 </el-select>
492 235 </el-form-item>
493 236 <el-form-item label="题数:">
494   - <el-input-number
495   - v-model="questionForm.number"
496   - @change="changeQesNum"
497   - :min="1"
498   - :max="100"
499   - :step-strictly="true"
500   - :step="1"
501   - label="label"
502   - ></el-input-number>
  237 + <el-input-number v-model="questionForm.number" @change="changeQesNum" :min="1" :max="100"
  238 + :step-strictly="true" :step="1" label="label"></el-input-number>
503 239 </el-form-item>
504   - <el-form-item
505   - label="选项个数:"
506   - v-show="
507   - questionForm.questionType != 4 &&
508   - questionForm.questionType != 5
509   - "
510   - >
511   - <el-input-number
512   - v-model="questionForm.selectNum"
513   - :min="3"
514   - :max="10"
515   - :step-strictly="true"
516   - :step="1"
517   - label="label"
518   - ></el-input-number>
  240 + <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 &&
  241 + questionForm.questionType != 5
  242 + ">
  243 + <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1"
  244 + label="label"></el-input-number>
519 245 </el-form-item>
520 246 <el-form-item label="单题分数:">
521   - <el-input-number
522   - v-model="questionForm.score"
523   - :min="1"
524   - :max="200"
525   - :precision="2"
526   - :step="1"
527   - label="label"
528   - ></el-input-number>
  247 + <el-input-number v-model="questionForm.score" :min="1" :max="200" :precision="2" :step="1"
  248 + label="label"></el-input-number>
529 249 </el-form-item>
530   - <el-form-item
531   - label="漏选得分:"
532   - v-if="questionForm.questionType == 3"
533   - >
534   - <el-input-number
535   - v-model="questionForm.partScore"
536   - :min="0"
537   - :max="questionForm.score"
538   - :precision="2"
539   - :step="0.5"
540   - label="label"
541   - ></el-input-number>
  250 + <el-form-item label="漏选得分:" v-if="questionForm.questionType == 3">
  251 + <el-input-number v-model="questionForm.partScore" :min="0" :max="questionForm.score" :precision="2"
  252 + :step="0.5" label="label"></el-input-number>
542 253 </el-form-item>
543   - <el-form-item
544   - label="设置答案:"
545   - v-show="
546   - questionForm.questionType != 5 &&
547   - questionForm.questionType != 6
548   - "
549   - >
  254 + <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 &&
  255 + questionForm.questionType != 6
  256 + ">
550 257 <div class="qs-options">
551 258 <p class="ipt">
552   - <el-input
553   - v-if="
554   - questionForm.questionType == 2 ||
555   - questionForm.questionType == 3 ||
556   - questionForm.questionType == 6
557   - "
558   - ref="formAnsIpt2"
559   - v-model="questionForm.answerList"
560   - @keydown.native="
561   - keydownAnswer($event, questionForm.questionType, 1)
562   - "
563   - @input="
564   - setAllAnswer($event, questionForm.questionType, 1)
565   - "
566   - ></el-input>
567   - <el-input
568   - v-if="questionForm.questionType == 4"
569   - v-model="questionForm.answerList"
570   - readonly=""
571   - ></el-input>
  259 + <el-input v-if="questionForm.questionType == 2 ||
  260 + questionForm.questionType == 3 ||
  261 + questionForm.questionType == 6
  262 + " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native="
  263 + keydownAnswer($event, questionForm.questionType, 1)
  264 + " @input="
  265 + setAllAnswer($event, questionForm.questionType, 1)
  266 + "></el-input>
  267 + <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList"
  268 + readonly=""></el-input>
572 269 </p>
573 270 <p class="answer-box">
574 271 <template v-if="questionForm.questionType == 4">
575   - <span
576   - class="answer-s active"
577   - @click="
578   - questionForm.answerList.length < questionForm.number
579   - ? (questionForm.answerList += '✓')
580   - : ''
581   - "
582   - >✓</span
583   - >
584   - <span
585   - class="answer-s active"
586   - @click="
587   - questionForm.answerList.length < questionForm.number
588   - ? (questionForm.answerList += '✗')
589   - : ''
590   - "
591   - >✗</span
592   - >
  272 + <span class="answer-s active" @click="
  273 + questionForm.answerList.length < questionForm.number
  274 + ? (questionForm.answerList += '✓')
  275 + : ''
  276 + ">✓</span>
  277 + <span class="answer-s active" @click="
  278 + questionForm.answerList.length < questionForm.number
  279 + ? (questionForm.answerList += '✗')
  280 + : ''
  281 + ">✗</span>
593 282 </template>
594 283 <template v-if="questionForm.questionType == 3">
595 284 <template v-for="(option, opIdx) in rightOptions">
596   - <span
597   - v-if="opIdx < questionForm.selectNum"
598   - class="answer-s active"
599   - :key="option"
600   - @click="setMultiple(questionForm, option, 1)"
601   - >{{ option }}</span
602   - >
  285 + <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option"
  286 + @click="setMultiple(questionForm, option, 1)">{{ option }}</span>
603 287 </template>
604   - <span
605   - class="answer-s active"
606   - @click="setMultiple(questionForm, ',', 1)"
607   - >,</span
608   - >
  288 + <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span>
609 289 </template>
610   - <template
611   - v-if="
612   - questionForm.questionType == 2 ||
613   - questionForm.questionType == 6
614   - "
615   - >
  290 + <template v-if="questionForm.questionType == 2 ||
  291 + questionForm.questionType == 6
  292 + ">
616 293 <template v-for="(option, opIdx) in rightOptions">
617   - <span
618   - v-if="opIdx < questionForm.selectNum"
619   - class="answer-s active"
620   - :key="option"
621   - @click="
622   - questionForm.answerList.length <
623   - questionForm.number
624   - ? (questionForm.answerList += option)
625   - : ''
626   - "
627   - >{{ option }}</span
628   - >
  294 + <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click="
  295 + questionForm.answerList.length <
  296 + questionForm.number
  297 + ? (questionForm.answerList += option)
  298 + : ''
  299 + ">{{ option }}</span>
629 300 </template>
630 301 </template>
631   - <span
632   - class="answer-s delButton"
633   - @click="
634   - questionForm.answerList =
635   - questionForm.answerList.slice(0, -1)
636   - "
637   - >x</span
638   - >
639   - <span
640   - class="answer-s ac"
641   - @click="questionForm.answerList = ''"
642   - >ac</span
643   - >
  302 + <span class="answer-s delButton" @click="
  303 + questionForm.answerList =
  304 + questionForm.answerList.slice(0, -1)
  305 + ">x</span>
  306 + <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span>
644 307 </p>
645 308 </div>
646 309 </el-form-item>
... ... @@ -658,28 +321,15 @@
658 321 <p class="name">{{ form.title }}</p>
659 322 <p class="totals">卷面总分:{{ allScore }}分</p>
660 323 </div>
661   - <div
662   - class="question-box"
663   - v-for="(question, index) in form.questionList"
664   - :key="index"
665   - >
  324 + <div class="question-box" v-for="(question, index) in form.questionList" :key="index">
666 325 <p class="question-title">
667 326 <span>{{ setBigNum(index) }}、</span>
668 327 <span class="title-txt">{{ question.questionTitle }}</span>
669 328 <span class="m20">共:{{ setNums(question.subQuestions) }}题</span>
670 329 <span>共:{{ setScore(question) }} 分</span>
671   - <el-popconfirm
672   - title="确定删除这道大题吗?"
673   - @confirm="form.questionList.splice(index, 1)"
674   - >
675   - <el-button
676   - slot="reference"
677   - class="delete"
678   - type="danger"
679   - size="mini"
680   - circle
681   - icon="el-icon-delete"
682   - ></el-button>
  330 + <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)">
  331 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  332 + icon="el-icon-delete"></el-button>
683 333 </el-popconfirm>
684 334 </p>
685 335 <ul class="questions-ul">
... ... @@ -694,21 +344,12 @@
694 344 <div class="qs-upload" v-if="isUpload">知识点</div>
695 345 <div class="qs-set">操作</div>
696 346 </li>
697   - <li
698   - v-for="(subQuestions, indexs) in question.subQuestions"
699   - :key="indexs"
700   - >
701   - <p
702   - class="set-ans-btn"
703   - v-if="
704   - subQuestions.qusType &&
705   - subQuestions.subNum &&
706   - subQuestions.subNum > 4
707   - "
708   - >
709   - <el-button type="primary" @click="setFormAns(indexs, index)"
710   - >批量设置答案</el-button
711   - >
  347 + <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
  348 + <p class="set-ans-btn" v-if="subQuestions.qusType &&
  349 + subQuestions.subNum &&
  350 + subQuestions.subNum > 4
  351 + ">
  352 + <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
712 353 </p>
713 354 <div v-else class="sub-questions">
714 355 <div class="qs-num">
... ... @@ -716,17 +357,10 @@
716 357 </div>
717 358 <div class="qs-type">
718 359 <template v-if="isUpload">
719   - <el-select
720   - v-model="subQuestions.questionType"
721   - placeholder="选择题目类型"
722   - @change="changeSubQuestions($event, subQuestions)"
723   - >
724   - <el-option
725   - v-for="options in questionOptions"
726   - :key="options.value"
727   - :label="options.label"
728   - :value="options.value"
729   - ></el-option>
  360 + <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
  361 + @change="changeSubQuestions($event, subQuestions)">
  362 + <el-option v-for="options in questionOptions" :key="options.value" :label="options.label"
  363 + :value="options.value"></el-option>
730 364 </el-select>
731 365 </template>
732 366 <template v-else>
... ... @@ -734,230 +368,106 @@
734 368 </template>
735 369 </div>
736 370 <div class="qs-score">
737   - <el-input-number
738   - class="number-ipt"
739   - size="medium"
740   - :min="1"
741   - :max="200"
742   - :precision="2"
743   - v-model="subQuestions.score"
744   - label="单题分值"
745   - ></el-input-number>
  371 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2"
  372 + v-model="subQuestions.score" label="单题分值"></el-input-number>
746 373 </div>
747 374 <div class="qs-partScore">
748 375 <p v-if="subQuestions.questionType != 3">--</p>
749   - <el-input-number
750   - class="number-ipt"
751   - v-else
752   - size="medium"
753   - :min="0"
754   - :precision="2"
755   - :max="subQuestions.score"
756   - :step="0.5"
757   - v-model="subQuestions.partScore"
758   - label="漏选得分"
759   - ></el-input-number>
  376 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  377 + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore"
  378 + label="漏选得分"></el-input-number>
760 379 </div>
761 380 <div class="qs-options qs-options2">
762 381 <p v-if="subQuestions.questionType == 5">--</p>
763 382 <p v-if="subQuestions.questionType == 4" class="answer-box">
764   - <span
765   - class="answer-s"
766   - :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
767   - @click="subQuestions.correctAnswer = 1"
768   - >✓</span
769   - >
770   - <span
771   - class="answer-s"
772   - :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
773   - @click="subQuestions.correctAnswer = 2"
774   - >✗</span
775   - >
  383 + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
  384 + @click="subQuestions.correctAnswer = 1">✓</span>
  385 + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
  386 + @click="subQuestions.correctAnswer = 2">✗</span>
776 387 </p>
777 388 <p v-if="subQuestions.questionType == 3" class="answer-box">
778   - <span
779   - class="answer-s"
780   - v-for="option in subQuestions.answerOptions.split(',')"
781   - :class="
782   - subQuestions.correctAnswer?.includes(option)
783   - ? 'active'
784   - : ''
785   - "
786   - :key="option"
787   - @click="changAnswer(subQuestions, option)"
788   - >{{ option }}</span
789   - >
  389 + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option)
  390 + ? 'active'
  391 + : ''
  392 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
790 393 </p>
791 394 <p v-if="subQuestions.questionType == 2" class="answer-box">
792   - <span
793   - class="answer-s"
794   - v-for="option in subQuestions.answerOptions.split(',')"
795   - :class="
796   - subQuestions.correctAnswer == option ? 'active' : ''
797   - "
798   - :key="option"
799   - @click="subQuestions.correctAnswer = option"
800   - >{{ option }}</span
801   - >
  395 + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : ''
  396 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
802 397 </p>
803   - <p
804   - v-if="
805   - subQuestions.questionType == 3 ||
806   - subQuestions.questionType == 2
807   - "
808   - class="answer-box answer-box2"
809   - >
810   - <el-button
811   - size="mini"
812   - type="primary"
813   - icon="el-icon-plus"
814   - circle
815   - @click="addOptions(subQuestions)"
816   - ></el-button>
817   - <el-button
818   - size="mini"
819   - type="primary"
820   - icon="el-icon-minus"
821   - round
822   - circle
823   - @click="removeOptions(subQuestions)"
824   - ></el-button>
  398 + <p v-if="subQuestions.questionType == 3 ||
  399 + subQuestions.questionType == 2
  400 + " class="answer-box answer-box2">
  401 + <el-button size="mini" type="primary" icon="el-icon-plus" circle
  402 + @click="addOptions(subQuestions)"></el-button>
  403 + <el-button size="mini" type="primary" icon="el-icon-minus" round circle
  404 + @click="removeOptions(subQuestions)"></el-button>
825 405 </p>
826 406 </div>
827 407 <template v-if="isUpload">
828 408 <div class="qs-upload">
829   - <el-button
830   - slot="reference"
831   - class="icon-tickets"
832   - type="primary"
833   - circle
834   - size="mini"
835   - icon="el-icon-tickets"
836   - @click="openStem(subQuestions, index, indexs, 1)"
837   - ></el-button>
  409 + <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
  410 + icon="el-icon-tickets" @click="openStem(subQuestions, index, indexs, 1)"></el-button>
838 411 </div>
839 412 <div class="qs-upload">
840   - <el-button
841   - slot="reference"
842   - class="icon-tickets"
843   - type="primary"
844   - circle
845   - size="mini"
846   - icon="el-icon-tickets"
847   - @click="openStem(subQuestions, index, indexs, 2)"
848   - ></el-button>
  413 + <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini"
  414 + icon="el-icon-tickets" @click="openStem(subQuestions, index, indexs, 2)"></el-button>
849 415 </div>
850 416 <div class="qs-upload">
851   - <el-button
852   - type="primary"
853   - circle
854   - size="mini"
855   - icon="el-icon-price-tag"
856   - @click="openKnowledge(subQuestions, index, indexs)"
857   - ></el-button>
  417 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  418 + @click="openKnowledge(subQuestions, index, indexs)"></el-button>
858 419 </div>
859 420 </template>
860 421 <div class="qs-set">
861   - <el-popconfirm
862   - title="确定删除这道题吗?"
863   - @confirm="delTabData(indexs, index)"
864   - >
865   - <el-button
866   - slot="reference"
867   - class="delete"
868   - type="danger"
869   - size="mini"
870   - circle
871   - icon="el-icon-delete"
872   - ></el-button>
  422 + <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)">
  423 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  424 + icon="el-icon-delete"></el-button>
873 425 </el-popconfirm>
874 426 </div>
875 427 </div>
876 428 </li>
877 429 </ul>
878 430 </div>
879   - <el-dialog
880   - :close-on-click-modal="false"
881   - title="批量设置答案"
882   - :visible.sync="diaSetAns"
883   - width="400"
884   - :modal-append-to-body="false"
885   - >
  431 + <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400"
  432 + :modal-append-to-body="false">
886 433 <div class="qs-options">
887 434 <p class="dia-tips">
888 435 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
889 436 </p>
890 437 <p>{{ setSubPro(formAns.qusType) }}:</p>
891 438 <p class="ipt">
892   - <el-input
893   - v-if="formAns.qusType == 2 || formAns.qusType == 3"
894   - ref="formAnsIpt"
895   - v-model="formAns.answerList"
896   - @keydown.native="keydownAnswer($event, formAns.qusType)"
897   - @input="setAllAnswer($event, formAns.qusType)"
898   - ></el-input>
899   - <el-input
900   - v-if="formAns.qusType == 4"
901   - v-model="formAns.answerList"
902   - readonly=""
903   - ></el-input>
  439 + <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt"
  440 + v-model="formAns.answerList" @keydown.native="keydownAnswer($event, formAns.qusType)"
  441 + @input="setAllAnswer($event, formAns.qusType)"></el-input>
  442 + <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input>
904 443 </p>
905 444 <p class="answer-box">
906 445 <template v-if="formAns.qusType == 4">
907   - <span
908   - class="answer-s active"
909   - @click="
910   - formAns.answerList.length < formAns.subNum
911   - ? (formAns.answerList += '✓')
912   - : ''
913   - "
914   - >✓</span
915   - >
916   - <span
917   - class="answer-s active"
918   - @click="
919   - formAns.answerList.length < formAns.subNum
920   - ? (formAns.answerList += '✗')
921   - : ''
922   - "
923   - >✗</span
924   - >
  446 + <span class="answer-s active" @click="
  447 + formAns.answerList.length < formAns.subNum
  448 + ? (formAns.answerList += '✓')
  449 + : ''
  450 + ">✓</span>
  451 + <span class="answer-s active" @click="
  452 + formAns.answerList.length < formAns.subNum
  453 + ? (formAns.answerList += '✗')
  454 + : ''
  455 + ">✗</span>
925 456 </template>
926 457 <template v-if="formAns.qusType == 3">
927   - <span
928   - class="answer-s active"
929   - v-for="option in formAns.answerOptions.split(',')"
930   - :key="option"
931   - @click="setMultiple(formAns, option, 2)"
932   - >{{ option }}</span
933   - >
934   - <span
935   - class="answer-s active"
936   - @click="setMultiple(formAns, ',', 2)"
937   - >,</span
938   - >
  458 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option"
  459 + @click="setMultiple(formAns, option, 2)">{{ option }}</span>
  460 + <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span>
939 461 </template>
940 462 <template v-if="formAns.qusType == 2">
941   - <span
942   - class="answer-s active"
943   - v-for="option in formAns.answerOptions.split(',')"
944   - :key="option"
945   - @click="
946   - formAns.answerList.length < formAns.subNum
947   - ? (formAns.answerList += option)
948   - : ''
949   - "
950   - >{{ option }}</span
951   - >
  463 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click="
  464 + formAns.answerList.length < formAns.subNum
  465 + ? (formAns.answerList += option)
  466 + : ''
  467 + ">{{ option }}</span>
952 468 </template>
953   - <span
954   - class="answer-s delButton"
955   - @click="formAns.answerList = formAns.answerList.slice(0, -1)"
956   - >x</span
957   - >
958   - <span class="answer-s ac" @click="formAns.answerList = ''"
959   - >ac</span
960   - >
  469 + <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
  470 + <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
961 471 </p>
962 472 </div>
963 473 <div class="dialog-footer" slot="footer">
... ... @@ -966,18 +476,14 @@
966 476 </div>
967 477 </el-dialog>
968 478 <div class="btn-box">
969   - <el-button type="danger" plain round @click="linkBack"
970   - >取消</el-button
971   - >
  479 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
972 480 <template v-if="!isUpload">
973 481 <el-button round @click="toStep(1)">上一步</el-button>
974 482 <el-button type="primary" round @click="save">保存</el-button>
975 483 </template>
976 484 <template v-else>
977 485 <el-button round @click="step = 0">上一步</el-button>
978   - <el-button type="primary" round @click="toStep(3)"
979   - >下一步</el-button
980   - >
  486 + <el-button type="primary" round @click="toStep(3)">下一步</el-button>
981 487 </template>
982 488 </div>
983 489 </div>
... ... @@ -991,69 +497,37 @@
991 497 <p class="question-title">
992 498 <span>{{ setBigNum(index) }}、</span>
993 499 <span class="title-txt">{{ question.questionTitle }}</span>
994   - <span class="m20"
995   - >共:{{ setNums(question.subQuestions) }}题</span
996   - >
  500 + <span class="m20">共:{{ setNums(question.subQuestions) }}题</span>
997 501 <span>共:{{ setScore(question) }} 分</span>
998 502 </p>
999 503 <div v-for="(subQuestions, indexs) in question.subQuestions">
1000   - <div
1001   - class="screenshot-box"
1002   - v-if="subQuestions.screenshot"
1003   - :key="index + '-' + indexs"
1004   - >
1005   - <iframe
1006   - class="screenshot"
1007   - :src="subQuestions.screenshot"
1008   - ></iframe>
  504 + <div class="screenshot-box" v-if="subQuestions.screenshot" :key="index + '-' + indexs">
  505 + <iframe class="screenshot" :src="subQuestions.screenshot"></iframe>
1009 506 </div>
1010 507 </div>
1011 508 </template>
1012 509 </div>
1013 510 <div class="btn-box">
1014   - <el-button type="danger" plain round @click="linkBack"
1015   - >取消</el-button
1016   - >
  511 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
1017 512 <el-button round @click="toStep(2)">上一步</el-button>
1018 513 <el-button type="primary" round @click="save">保存</el-button>
1019 514 </div>
1020 515 </div>
1021   - <el-dialog
1022   - :close-on-click-modal="false"
1023   - :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
1024   - :visible.sync="dialogStem"
1025   - v-if="dialogStem"
1026   - width="800px"
1027   - >
  516 + <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem"
  517 + v-if="dialogStem" width="800px">
1028 518 <div class="upload-box">
1029 519 <div v-loading="iframeLoading">
1030 520 <template v-if="stem.type == 1">
1031   - <iframe
1032   - ref="screenshot"
1033   - class="screenshot"
1034   - v-if="stem.screenshot"
1035   - :src="stem.screenshot"
1036   - @load="iframeLoading = false"
1037   - ></iframe>
  521 + <iframe ref="screenshot" class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"
  522 + @load="iframeLoading = false"></iframe>
1038 523 </template>
1039 524 <template v-else="stem.type == 2">
1040   - <iframe
1041   - ref="screenshot"
1042   - class="screenshot"
1043   - v-if="stem.answerScreenshot"
1044   - :src="stem.answerScreenshot"
1045   - @load="iframeLoading = false"
1046   - ></iframe>
  525 + <iframe ref="screenshot" class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"
  526 + @load="iframeLoading = false"></iframe>
1047 527 </template>
1048 528 </div>
1049   - <el-upload
1050   - class="upload-demo"
1051   - :action="uploadUrl"
1052   - :limit="1"
1053   - :on-success="upSuccess"
1054   - :on-error="upError"
1055   - accept="image/*"
1056   - >
  529 + <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError"
  530 + accept="image/*">
1057 531 <el-button size="small" type="primary">选择照片</el-button>
1058 532 </el-upload>
1059 533 </div>
... ... @@ -1061,26 +535,13 @@
1061 535 <el-button @click="dialogStem = false">确定</el-button>
1062 536 </div>
1063 537 </el-dialog>
1064   - <el-dialog
1065   - :close-on-click-modal="false"
1066   - title="知识点"
1067   - :visible.sync="dialogKnowledge"
1068   - width="500px"
1069   - >
  538 + <el-dialog :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500px">
1070 539 <div>
1071 540 <el-form ref="form" :model="stem" label-width="160px">
1072 541 <el-form-item label="知识点:">
1073   - <el-cascader
1074   - size="small"
1075   - filterable
1076   - :show-all-levels="false"
1077   - collapse
1078   - clearable
1079   - placeholder="选择知识点"
1080   - v-model="stem.knowledge"
1081   - :options="knowledgeData"
1082   - :props="{ expandTrigger: 'hover', multiple: true }"
1083   - ></el-cascader>
  542 + <el-cascader size="small" filterable :show-all-levels="false" collapse clearable placeholder="选择知识点"
  543 + v-model="stem.knowledge" :options="knowledgeData"
  544 + :props="{ expandTrigger: 'hover', multiple: true }"></el-cascader>
1084 545 </el-form-item>
1085 546 </el-form>
1086 547 </div>
... ... @@ -1349,7 +810,7 @@ export default {
1349 810 linkBack() {
1350 811 this.$confirm(
1351 812 (this.type == 2 ? "修改复制的" : "组建的") +
1352   - "答题卡未保存,确认退出吗?",
  813 + "答题卡未保存,确认退出吗?",
1353 814 "提示",
1354 815 {
1355 816 confirmButtonText: "取消",
... ... @@ -1362,7 +823,7 @@ export default {
1362 823 type: "warning",
1363 824 }
1364 825 )
1365   - .then(() => {})
  826 + .then(() => { })
1366 827 .catch(() => {
1367 828 this.$router.push({
1368 829 path: "/examinationPaper",
... ... @@ -1533,8 +994,8 @@ export default {
1533 994 this.formAns.answerList[subNum - i] == "✓"
1534 995 ? 1
1535 996 : this.formAns.answerList[subNum - i] == "✗"
1536   - ? 2
1537   - : "";
  997 + ? 2
  998 + : "";
1538 999 }
1539 1000 this.form.questionList[this.formAns.listIndex].subQuestions[
1540 1001 EndIndex - i
... ... @@ -1765,8 +1226,8 @@ export default {
1765 1226 this.questionForm.answerList[i] == "✓"
1766 1227 ? 1
1767 1228 : this.questionForm.answerList[i] == "✗"
1768   - ? 2
1769   - : "";
  1229 + ? 2
  1230 + : "";
1770 1231 } else if (questionsOptions.questionType == 3) {
1771 1232 answer = this.questionForm.answerList.split(",")[i] || "";
1772 1233 } else if (questionsOptions.questionType == 2) {
... ... @@ -1991,13 +1452,25 @@ export default {
1991 1452 });
1992 1453 this.saveLoading = false;
1993 1454 if (status == 0) {
1994   - this.$router.push({
1995   - path: "/examinationPaper",
1996   - query: {
1997   - type: this.listType,
1998   - share: this.listShare,
1999   - },
2000   - });
  1455 + if (location.href.indexOf('askPreparationQuestionsAdd') >= 1) {
  1456 + this.$router.push({
  1457 + path: "/askPreparationQuestions"
  1458 + });
  1459 + }
  1460 + else if (location.href.indexOf('testPaperAdd') >= 1) {
  1461 + this.$router.push({
  1462 + path: "/testPaper"
  1463 + });
  1464 + }
  1465 + else {
  1466 + this.$router.push({
  1467 + path: "/examinationPaper",
  1468 + query: {
  1469 + type: this.listType,
  1470 + share: this.listShare,
  1471 + },
  1472 + });
  1473 + }
2001 1474 } else {
2002 1475 this.$message.error(info);
2003 1476 }
... ... @@ -2457,7 +1930,7 @@ export default {
2457 1930 display: flex;
2458 1931 border-bottom: 1px solid #e2e2e2;
2459 1932  
2460   - & > div {
  1933 + &>div {
2461 1934 min-height: 40px;
2462 1935 padding: 5px;
2463 1936 flex-shrink: 0;
... ... @@ -2522,6 +1995,7 @@ export default {
2522 1995 .upload-demo {
2523 1996 text-align: center;
2524 1997 }
  1998 +
2525 1999 .screenshot {
2526 2000 width: 100%;
2527 2001 }
... ...
src/views/examinationPaper/addQs.vue
... ... @@ -7,71 +7,33 @@
7 7 </template>
8 8 </back-box>
9 9 <div class="content">
10   - <el-steps
11   - :active="step"
12   - finish-status="success"
13   - simple
14   - style="margin: 20px 0"
15   - >
  10 + <el-steps :active="step" finish-status="success" simple style="margin: 20px 0">
16 11 <el-step title="基础信息" icon="el-icon-edit"></el-step>
17 12 <el-step title="题目编辑" icon="el-icon-tickets"></el-step>
18 13 <el-step title="课件预览" icon="el-icon-edit-outline"></el-step>
19 14 </el-steps>
20 15 <div v-show="step == 0">
21   - <el-form
22   - ref="forms"
23   - :model="form"
24   - :rules="formRules"
25   - label-width="140px"
26   - >
  16 + <el-form ref="forms" :model="form" :rules="formRules" label-width="140px">
27 17 <el-form-item label="课件名称:" prop="title">
28   - <el-input
29   - class="sel2"
30   - type="text"
31   - placeholder="请输入答题卡名称"
32   - v-model.trim="form.title"
33   - maxlength="50"
34   - size="45"
35   - show-word-limit
36   - >
  18 + <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45"
  19 + show-word-limit>
37 20 </el-input>
38 21 </el-form-item>
39   - <el-form-item
40   - v-if="role != 'ROLE_PERSONAL'"
41   - label="年级:"
42   - prop="gradeName"
43   - >
44   - <el-select
45   - class="sel"
46   - v-model="form.gradeName"
47   - placeholder=""
48   - @change="changeGrade"
49   - >
50   - <el-option
51   - v-for="item in gradeList"
52   - :key="item"
53   - :label="item"
54   - :value="item"
55   - >
  22 + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName">
  23 + <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade">
  24 + <el-option v-for="item in gradeList" :key="item" :label="item" :value="item">
56 25 </el-option>
57 26 </el-select>
58 27 </el-form-item>
59 28 <el-form-item label="科目:" prop="subjectName">
60 29 <el-select class="sel" v-model="form.subjectName" placeholder="">
61   - <el-option
62   - v-for="item in subjectList"
63   - :key="item.value"
64   - :label="item.label"
65   - :value="item.value"
66   - >{{ item.label }}
  30 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{
  31 + item.label
  32 + }}
67 33 </el-option>
68 34 </el-select>
69 35 </el-form-item>
70   - <el-form-item
71   - v-if="role != 'ROLE_PERSONAL'"
72   - label="分享范围:"
73   - prop="sharingType"
74   - >
  36 + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType">
75 37 <el-radio-group v-model="form.sharingType">
76 38 <el-radio :label="0">任课班级分享</el-radio>
77 39 <el-radio :label="1">全年级分享</el-radio>
... ... @@ -79,9 +41,7 @@
79 41 </el-form-item>
80 42 </el-form>
81 43 <div class="btn-box">
82   - <el-button type="danger" plain round @click="linkBack"
83   - >取消</el-button
84   - >
  44 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
85 45 <el-button type="primary" round @click="setStep1">下一步</el-button>
86 46 </div>
87 47 </div>
... ... @@ -107,357 +67,163 @@
107 67 <ul class="questions-ul">
108 68 <template v-if="!question.subQuestions">
109 69 <li>
110   - <p
111   - class="set-ans-btn"
112   - v-if="
113   - question.qusType && question.subNum && question.subNum > 4
114   - "
115   - >
116   - <el-button type="primary" @click="setFormAns(index)"
117   - >批量设置答案</el-button
118   - >
  70 + <p class="set-ans-btn" v-if="question.qusType && question.subNum && question.subNum > 4
  71 + ">
  72 + <el-button type="primary" @click="setFormAns(index)">批量设置答案</el-button>
119 73 </p>
120 74 <div v-else class="sub-questions">
121 75 <div class="qs-num">{{ question.questionIndex }}</div>
122 76 <div class="qs-type">
123   - <el-select
124   - v-model="question.questionType"
125   - placeholder="选择题目类型"
126   - @change="changeSubQuestions($event, question)"
127   - >
128   - <el-option
129   - v-for="options in questionOptions"
130   - :key="options.value"
131   - :label="options.label"
132   - :value="options.value"
133   - ></el-option>
  77 + <el-select v-model="question.questionType" placeholder="选择题目类型"
  78 + @change="changeSubQuestions($event, question)">
  79 + <el-option v-for="options in questionOptions" :key="options.value" :label="options.label"
  80 + :value="options.value"></el-option>
134 81 </el-select>
135 82 </div>
136 83 <div class="qs-score">
137   - <el-input-number
138   - class="number-ipt"
139   - size="medium"
140   - :min="1"
141   - :max="200"
142   - :precision="2"
143   - v-model="question.score"
144   - label="单题分值"
145   - ></el-input-number>
  84 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2"
  85 + v-model="question.score" label="单题分值"></el-input-number>
146 86 </div>
147 87 <div class="qs-partScore">
148 88 <p v-if="question.questionType != 3">--</p>
149   - <el-input-number
150   - class="number-ipt"
151   - v-else
152   - size="medium"
153   - :min="0"
154   - :precision="2"
155   - :max="question.score"
156   - :step="0.5"
157   - v-model="question.partScore"
158   - label="漏选得分"
159   - ></el-input-number>
  89 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  90 + :max="question.score" :step="0.5" v-model="question.partScore" label="漏选得分"></el-input-number>
160 91 </div>
161 92 <div class="qs-options qs-options2">
162 93 <p v-if="question.questionType == 5">--</p>
163 94 <p v-if="question.questionType == 4" class="answer-box">
164   - <span
165   - class="answer-s"
166   - :class="question.correctAnswer == 1 ? 'active' : ''"
167   - @click="question.correctAnswer = 1"
168   - >✓</span
169   - >
170   - <span
171   - class="answer-s"
172   - :class="question.correctAnswer == 2 ? 'active' : ''"
173   - @click="question.correctAnswer = 2"
174   - >✗</span
175   - >
  95 + <span class="answer-s" :class="question.correctAnswer == 1 ? 'active' : ''"
  96 + @click="question.correctAnswer = 1">✓</span>
  97 + <span class="answer-s" :class="question.correctAnswer == 2 ? 'active' : ''"
  98 + @click="question.correctAnswer = 2">✗</span>
176 99 </p>
177 100 <p v-if="question.questionType == 3" class="answer-box">
178   - <span
179   - class="answer-s"
180   - v-for="option in question.answerOptions?.split(',')"
181   - :class="
182   - question.correctAnswer?.includes(option)
183   - ? 'active'
184   - : ''
185   - "
186   - :key="option"
187   - @click="changAnswer(question, option)"
188   - >{{ option }}</span
189   - >
  101 + <span class="answer-s" v-for="option in question.answerOptions?.split(',')" :class="question.correctAnswer?.includes(option)
  102 + ? 'active'
  103 + : ''
  104 + " :key="option" @click="changAnswer(question, option)">{{ option }}</span>
190 105 </p>
191 106 <p v-if="question.questionType == 2" class="answer-box">
192   - <span
193   - class="answer-s"
194   - v-for="option in question.answerOptions?.split(',')"
195   - :class="
196   - question.correctAnswer == option ? 'active' : ''
197   - "
198   - :key="option"
199   - @click="question.correctAnswer = option"
200   - >{{ option }}</span
201   - >
  107 + <span class="answer-s" v-for="option in question.answerOptions?.split(',')" :class="question.correctAnswer == option ? 'active' : ''
  108 + " :key="option" @click="question.correctAnswer = option">{{ option }}</span>
202 109 </p>
203   - <p
204   - v-if="
205   - question.questionType == 3 ||
206   - question.questionType == 2
207   - "
208   - class="answer-box answer-box2"
209   - >
210   - <el-button
211   - size="mini"
212   - type="primary"
213   - icon="el-icon-plus"
214   - circle
215   - @click="addOptions(question)"
216   - ></el-button>
217   - <el-button
218   - size="mini"
219   - type="primary"
220   - icon="el-icon-minus"
221   - round
222   - circle
223   - @click="removeOptions(question)"
224   - ></el-button>
  110 + <p v-if="question.questionType == 3 ||
  111 + question.questionType == 2
  112 + " class="answer-box answer-box2">
  113 + <el-button size="mini" type="primary" icon="el-icon-plus" circle
  114 + @click="addOptions(question)"></el-button>
  115 + <el-button size="mini" type="primary" icon="el-icon-minus" round circle
  116 + @click="removeOptions(question)"></el-button>
225 117 </p>
226 118 </div>
227 119  
228 120 <div class="qs-upload">
229   - <el-button
230   - class="icon-tickets"
231   - type="primary"
232   - circle
233   - size="mini"
234   - icon="el-icon-tickets"
235   - @click="openStem(question, 1, index)"
236   - ></el-button>
  121 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  122 + @click="openStem(question, 1, index)"></el-button>
237 123 </div>
238 124 <div class="qs-upload">
239   - <el-button
240   - class="icon-tickets"
241   - type="primary"
242   - circle
243   - size="mini"
244   - icon="el-icon-tickets"
245   - @click="openStem(question, 2, index)"
246   - ></el-button>
  125 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  126 + @click="openStem(question, 2, index)"></el-button>
247 127 </div>
248 128 <div class="qs-upload" v-if="knowledgeData.length">
249   - <el-button
250   - type="primary"
251   - circle
252   - size="mini"
253   - icon="el-icon-price-tag"
254   - @click="openKnowledge(question, index)"
255   - ></el-button>
  129 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  130 + @click="openKnowledge(question, index)"></el-button>
256 131 </div>
257 132 <div class="qs-set">
258   - <el-popconfirm
259   - title="确定删除这道题吗?"
260   - @confirm="delTabData(index)"
261   - >
262   - <el-button
263   - slot="reference"
264   - class="delete"
265   - type="danger"
266   - size="mini"
267   - circle
268   - icon="el-icon-delete"
269   - ></el-button>
  133 + <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(index)">
  134 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  135 + icon="el-icon-delete"></el-button>
270 136 </el-popconfirm>
271 137 </div>
272 138 </div>
273 139 </li>
274 140 </template>
275 141 <template v-else>
276   - <li
277   - v-for="(subQuestions, indexs) in question.subQuestions"
278   - :key="indexs"
279   - >
280   - <p
281   - class="set-ans-btn"
282   - v-if="
283   - subQuestions.qusType &&
284   - subQuestions.subNum &&
285   - subQuestions.subNum > 4
286   - "
287   - >
288   - <el-button type="primary" @click="setFormAns(index, indexs)"
289   - >批量设置答案</el-button
290   - >
  142 + <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
  143 + <p class="set-ans-btn" v-if="subQuestions.qusType &&
  144 + subQuestions.subNum &&
  145 + subQuestions.subNum > 4
  146 + ">
  147 + <el-button type="primary" @click="setFormAns(index, indexs)">批量设置答案</el-button>
291 148 </p>
292 149 <div v-else class="sub-questions">
293 150 <div class="qs-num">
294 151 {{ setNum(index, indexs, subQuestions) }}
295 152 </div>
296 153 <div class="qs-type">
297   - <el-select
298   - v-model="subQuestions.questionType"
299   - placeholder="选择题目类型"
300   - @change="changeSubQuestions($event, subQuestions)"
301   - >
302   - <el-option
303   - v-for="options in questionOptions"
304   - :key="options.value"
305   - :label="options.label"
306   - :value="options.value"
307   - ></el-option>
  154 + <el-select v-model="subQuestions.questionType" placeholder="选择题目类型"
  155 + @change="changeSubQuestions($event, subQuestions)">
  156 + <el-option v-for="options in questionOptions" :key="options.value" :label="options.label"
  157 + :value="options.value"></el-option>
308 158 </el-select>
309 159 </div>
310 160 <div class="qs-score">
311   - <el-input-number
312   - class="number-ipt"
313   - size="medium"
314   - :min="1"
315   - :max="200"
316   - :precision="2"
317   - v-model="subQuestions.score"
318   - label="单题分值"
319   - ></el-input-number>
  161 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2"
  162 + v-model="subQuestions.score" label="单题分值"></el-input-number>
320 163 </div>
321 164 <div class="qs-partScore">
322 165 <p v-if="subQuestions.questionType != 3">--</p>
323   - <el-input-number
324   - class="number-ipt"
325   - v-else
326   - size="medium"
327   - :min="0"
328   - :precision="2"
329   - :max="subQuestions.score"
330   - :step="0.5"
331   - v-model="subQuestions.partScore"
332   - label="漏选得分"
333   - ></el-input-number>
  166 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  167 + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore"
  168 + label="漏选得分"></el-input-number>
334 169 </div>
335 170 <div class="qs-options qs-options2">
336 171 <p v-if="subQuestions.questionType == 5">--</p>
337   - <p
338   - v-if="subQuestions.questionType == 4"
339   - class="answer-box"
340   - >
341   - <span
342   - class="answer-s"
343   - :class="
344   - subQuestions.correctAnswer == 1 ? 'active' : ''
345   - "
346   - @click="subQuestions.correctAnswer = 1"
347   - >✓</span
348   - >
349   - <span
350   - class="answer-s"
351   - :class="
352   - subQuestions.correctAnswer == 2 ? 'active' : ''
353   - "
354   - @click="subQuestions.correctAnswer = 2"
355   - >✗</span
356   - >
  172 + <p v-if="subQuestions.questionType == 4" class="answer-box">
  173 + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''
  174 + " @click="subQuestions.correctAnswer = 1">✓</span>
  175 + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''
  176 + " @click="subQuestions.correctAnswer = 2">✗</span>
357 177 </p>
358   - <p
359   - v-if="subQuestions.questionType == 3"
360   - class="answer-box"
361   - >
362   - <span
363   - class="answer-s"
364   - v-for="option in subQuestions.answerOptions?.split(
365   - ','
366   - )"
367   - :class="
368   - subQuestions.correctAnswer?.includes(option)
369   - ? 'active'
370   - : ''
371   - "
372   - :key="option"
373   - @click="changAnswer(subQuestions, option)"
374   - >{{ option }}</span
375   - >
  178 + <p v-if="subQuestions.questionType == 3" class="answer-box">
  179 + <span class="answer-s" v-for="option in subQuestions.answerOptions?.split(
  180 + ','
  181 + )" :class="subQuestions.correctAnswer?.includes(option)
  182 + ? 'active'
  183 + : ''
  184 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
376 185 </p>
377   - <p
378   - v-if="subQuestions.questionType == 2"
379   - class="answer-box"
380   - >
381   - <span
382   - class="answer-s"
383   - v-for="option in subQuestions.answerOptions?.split(
384   - ','
385   - )"
386   - :class="
387   - subQuestions.correctAnswer == option ? 'active' : ''
388   - "
389   - :key="option"
390   - @click="subQuestions.correctAnswer = option"
391   - >{{ option }}</span
392   - >
  186 + <p v-if="subQuestions.questionType == 2" class="answer-box">
  187 + <span class="answer-s" v-for="option in subQuestions.answerOptions?.split(
  188 + ','
  189 + )" :class="subQuestions.correctAnswer == option ? 'active' : ''
  190 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
393 191 </p>
394   - <p
395   - v-if="
396   - subQuestions.questionType == 3 ||
397   - subQuestions.questionType == 2
398   - "
399   - class="answer-box answer-box2"
400   - >
401   - <el-button
402   - size="mini"
403   - type="primary"
404   - icon="el-icon-plus"
405   - circle
406   - @click="addOptions(subQuestions)"
407   - ></el-button>
408   - <el-button
409   - size="mini"
410   - type="primary"
411   - icon="el-icon-minus"
412   - round
413   - circle
414   - @click="removeOptions(subQuestions)"
415   - ></el-button>
  192 + <p v-if="subQuestions.questionType == 3 ||
  193 + subQuestions.questionType == 2
  194 + " class="answer-box answer-box2">
  195 + <el-button size="mini" type="primary" icon="el-icon-plus" circle
  196 + @click="addOptions(subQuestions)"></el-button>
  197 + <el-button size="mini" type="primary" icon="el-icon-minus" round circle
  198 + @click="removeOptions(subQuestions)"></el-button>
416 199 </p>
417 200 </div>
418 201  
419 202 <div class="qs-upload">
420   - <el-button
421   - class="icon-tickets"
422   - type="primary"
423   - circle
424   - size="mini"
425   - icon="el-icon-tickets"
426   - @click="openStem(subQuestions, 1, index, indexs)"
427   - ></el-button>
  203 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  204 + @click="openStem(subQuestions, 1, index, indexs)"></el-button>
428 205 </div>
429 206 <div class="qs-upload">
430   - <el-button
431   - class="icon-tickets"
432   - type="primary"
433   - circle
434   - size="mini"
435   - icon="el-icon-tickets"
436   - @click="openStem(subQuestions, 2, index, indexs)"
437   - ></el-button>
438   - </div>
  207 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  208 + @click="openStem(subQuestions, 2, index, indexs)"></el-button>
  209 + </div> if (location.href.indexOf('askPreparationQuestionsAdd') >= 1) {
  210 + this.$router.push({
  211 + path: "/askPreparationQuestions"
  212 + });
  213 + }
  214 + else if (location.href.indexOf('testPaperAdd') >= 1) {
  215 + this.$router.push({
  216 + path: "/testPaper"
  217 + });
  218 + }
439 219 <div class="qs-upload" v-if="knowledgeData.length">
440   - <el-button
441   - type="primary"
442   - circle
443   - size="mini"
444   - icon="el-icon-price-tag"
445   - @click="openKnowledge(subQuestions, index, indexs)"
446   - ></el-button>
  220 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  221 + @click="openKnowledge(subQuestions, index, indexs)"></el-button>
447 222 </div>
448 223 <div class="qs-set">
449   - <el-popconfirm
450   - title="确定删除这道题吗?"
451   - @confirm="delTabData(index, indexs)"
452   - >
453   - <el-button
454   - slot="reference"
455   - class="delete"
456   - type="danger"
457   - size="mini"
458   - circle
459   - icon="el-icon-delete"
460   - ></el-button>
  224 + <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(index, indexs)">
  225 + <el-button slot="reference" class="delete" type="danger" size="mini" circle
  226 + icon="el-icon-delete"></el-button>
461 227 </el-popconfirm>
462 228 </div>
463 229 </div>
... ... @@ -466,88 +232,46 @@
466 232 </ul>
467 233 </template>
468 234 </div>
469   - <el-dialog
470   - :close-on-click-modal="false"
471   - title="批量设置答案"
472   - :visible.sync="diaSetAns"
473   - width="400"
474   - :modal-append-to-body="false"
475   - >
  235 + <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400"
  236 + :modal-append-to-body="true">
476 237 <div class="qs-options">
477 238 <p class="dia-tips">
478 239 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
479 240 </p>
480 241 <p>{{ setSubPro(formAns.qusType) }}:</p>
481 242 <p class="ipt">
482   - <el-input
483   - v-if="formAns.qusType == 2 || formAns.qusType == 3"
484   - ref="formAnsIpt"
485   - v-model="formAns.answerList"
486   - @keydown.native="keydownAnswer($event, formAns.qusType)"
487   - @input="setAllAnswer($event, formAns.qusType)"
488   - ></el-input>
489   - <el-input
490   - v-if="formAns.qusType == 4"
491   - v-model="formAns.answerList"
492   - readonly=""
493   - ></el-input>
  243 + <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt"
  244 + v-model="formAns.answerList" @keydown.native="keydownAnswer($event, formAns.qusType)"
  245 + @input="setAllAnswer($event, formAns.qusType)"></el-input>
  246 + <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input>
494 247 </p>
495 248 <p class="answer-box">
496 249 <template v-if="formAns.qusType == 4">
497   - <span
498   - class="answer-s active"
499   - @click="
500   - formAns.answerList.length < formAns.subNum
501   - ? (formAns.answerList += '✓')
502   - : ''
503   - "
504   - >✓</span
505   - >
506   - <span
507   - class="answer-s active"
508   - @click="
509   - formAns.answerList.length < formAns.subNum
510   - ? (formAns.answerList += '✗')
511   - : ''
512   - "
513   - >✗</span
514   - >
  250 + <span class="answer-s active" @click="
  251 + formAns.answerList.length < formAns.subNum
  252 + ? (formAns.answerList += '✓')
  253 + : ''
  254 + ">✓</span>
  255 + <span class="answer-s active" @click="
  256 + formAns.answerList.length < formAns.subNum
  257 + ? (formAns.answerList += '✗')
  258 + : ''
  259 + ">✗</span>
515 260 </template>
516 261 <template v-if="formAns.qusType == 3">
517   - <span
518   - class="answer-s active"
519   - v-for="option in formAns.answerOptions.split(',')"
520   - :key="option"
521   - @click="setMultiple(formAns, option, 2)"
522   - >{{ option }}</span
523   - >
524   - <span
525   - class="answer-s active"
526   - @click="setMultiple(formAns, ',', 2)"
527   - >,</span
528   - >
  262 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option"
  263 + @click="setMultiple(formAns, option, 2)">{{ option }}</span>
  264 + <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span>
529 265 </template>
530 266 <template v-if="formAns.qusType == 2">
531   - <span
532   - class="answer-s active"
533   - v-for="option in formAns.answerOptions.split(',')"
534   - :key="option"
535   - @click="
536   - formAns.answerList.length < formAns.subNum
537   - ? (formAns.answerList += option)
538   - : ''
539   - "
540   - >{{ option }}</span
541   - >
  267 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click="
  268 + formAns.answerList.length < formAns.subNum
  269 + ? (formAns.answerList += option)
  270 + : ''
  271 + ">{{ option }}</span>
542 272 </template>
543   - <span
544   - class="answer-s delButton"
545   - @click="formAns.answerList = formAns.answerList.slice(0, -1)"
546   - >x</span
547   - >
548   - <span class="answer-s ac" @click="formAns.answerList = ''"
549   - >ac</span
550   - >
  273 + <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
  274 + <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
551 275 </p>
552 276 </div>
553 277 <div class="dialog-footer" slot="footer">
... ... @@ -556,48 +280,25 @@
556 280 </div>
557 281 </el-dialog>
558 282 <div class="btn-box">
559   - <el-button type="danger" plain round @click="linkBack"
560   - >取消</el-button
561   - >
  283 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
562 284 <el-button round @click="step = 0">上一步</el-button>
563 285 <el-button type="primary" round @click="toStep(2)">下一步</el-button>
564 286 </div>
565   - <el-dialog
566   - :close-on-click-modal="false"
567   - :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
568   - :visible.sync="dialogStem"
569   - v-if="dialogStem"
570   - width="800px"
571   - >
  287 + <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem"
  288 + v-if="dialogStem" width="800px">
572 289 <div class="upload-box">
573 290 <div v-loading="iframeLoading">
574 291 <template v-if="stem.type == 1">
575   - <iframe
576   - ref="screenshot"
577   - class="screenshot"
578   - v-if="stem.screenshot"
579   - :src="stem.screenshot"
580   - @load="iframeLoading = false"
581   - ></iframe>
  292 + <iframe ref="screenshot" class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"
  293 + @load="iframeLoading = false"></iframe>
582 294 </template>
583 295 <template v-else="stem.type == 2">
584   - <iframe
585   - ref="screenshot"
586   - class="screenshot"
587   - v-if="stem.answerScreenshot"
588   - :src="stem.answerScreenshot"
589   - @load="iframeLoading = false"
590   - ></iframe>
  296 + <iframe ref="screenshot" class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"
  297 + @load="iframeLoading = false"></iframe>
591 298 </template>
592 299 </div>
593   - <el-upload
594   - class="upload-demo"
595   - :action="uploadUrl"
596   - :limit="1"
597   - :on-success="upSuccess"
598   - :on-error="upError"
599   - accept="image/*"
600   - >
  300 + <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError"
  301 + accept="image/*">
601 302 <el-button size="small" type="primary">选择上传照片</el-button>
602 303 </el-upload>
603 304 </div>
... ... @@ -605,26 +306,12 @@
605 306 <el-button @click="dialogStem = false">保存</el-button>
606 307 </div>
607 308 </el-dialog>
608   - <el-dialog
609   - :close-on-click-modal="false"
610   - title="知识点"
611   - :visible.sync="dialogKnowledge"
612   - width="500px"
613   - >
  309 + <el-dialog :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500px">
614 310 <div>
615 311 <el-form ref="form" :model="stem" label-width="160px">
616 312 <el-form-item label="知识点:">
617   - <el-cascader
618   - size="small"
619   - filterable
620   - :show-all-levels="false"
621   - collapse
622   - clearable
623   - placeholder="选择知识点"
624   - v-model="stem.knowledge"
625   - :options="knowledgeData"
626   - :props="{ expandTrigger: 'hover' }"
627   - ></el-cascader>
  313 + <el-cascader size="small" filterable :show-all-levels="false" collapse clearable placeholder="选择知识点"
  314 + v-model="stem.knowledge" :options="knowledgeData" :props="{ expandTrigger: 'hover' }"></el-cascader>
628 315 </el-form-item>
629 316 </el-form>
630 317 </div>
... ... @@ -648,19 +335,14 @@
648 335 <template v-else>
649 336 <div v-for="subQuestions in question.subQuestions">
650 337 <div class="screenshot-box" v-if="subQuestions.screenshot">
651   - <iframe
652   - class="screenshot"
653   - :src="subQuestions.screenshot"
654   - ></iframe>
  338 + <iframe class="screenshot" :src="subQuestions.screenshot"></iframe>
655 339 </div>
656 340 </div>
657 341 </template>
658 342 </template>
659 343 </div>
660 344 <div class="btn-box">
661   - <el-button type="danger" plain round @click="linkBack"
662   - >取消</el-button
663   - >
  345 + <el-button type="danger" plain round @click="linkBack">取消</el-button>
664 346 <el-button round @click="toStep(1)">上一步</el-button>
665 347 <el-button type="primary" round @click="save">保存</el-button>
666 348 </div>
... ... @@ -894,7 +576,7 @@ export default {
894 576 type: "warning",
895 577 }
896 578 )
897   - .then(() => {})
  579 + .then(() => { })
898 580 .catch(() => {
899 581 this.$router.push({
900 582 path: "/examinationPaper",
... ... @@ -1185,8 +867,8 @@ export default {
1185 867 this.formAns.answerList[subNum - i] == "✓"
1186 868 ? 1
1187 869 : this.formAns.answerList[subNum - i] == "✗"
1188   - ? 2
1189   - : "";
  870 + ? 2
  871 + : "";
1190 872 }
1191 873 this.form.questionList[this.formAns.listIndex].subQuestions[
1192 874 EndIndex - i
... ... @@ -1353,13 +1035,25 @@ export default {
1353 1035 });
1354 1036 this.saveLoading = false;
1355 1037 if (status == 0) {
1356   - this.$router.push({
1357   - path: "/examinationPaper",
1358   - query: {
1359   - type: this.listType,
1360   - share: this.listShare,
1361   - },
1362   - });
  1038 + if (location.href.indexOf('askPreparationQuestionsAdd') >= 1) {
  1039 + this.$router.push({
  1040 + path: "/askPreparationQuestions"
  1041 + });
  1042 + }
  1043 + else if (location.href.indexOf('testPaperAdd') >= 1) {
  1044 + this.$router.push({
  1045 + path: "/testPaper"
  1046 + });
  1047 + }
  1048 + else {
  1049 + this.$router.push({
  1050 + path: "/examinationPaper",
  1051 + query: {
  1052 + type: this.listType,
  1053 + share: this.listShare,
  1054 + },
  1055 + });
  1056 + }
1363 1057 } else {
1364 1058 this.$message.error(info);
1365 1059 }
... ... @@ -1805,7 +1499,7 @@ export default {
1805 1499 display: flex;
1806 1500 border-bottom: 1px solid #e2e2e2;
1807 1501  
1808   - & > div {
  1502 + &>div {
1809 1503 min-height: 40px;
1810 1504 padding: 5px;
1811 1505 flex-shrink: 0;
... ...
src/views/examinationPaper/edit.vue
... ... @@ -10,8 +10,8 @@
10 10 <p class="tips" v-if="paperModifyLog.modifiedTime">
11 11 <i class="fa fa-bell-o"></i>
12 12 {{
13   - `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
14   - }}老师修改了答案
  13 + `${paperModifyLog.modifiedTime} ${paperModifyLog.realName}`
  14 + }}老师修改了答案
15 15 </p>
16 16 </template>
17 17 <div class="answer-title" :class="type == 1 ? 't-left' : ''">
... ... @@ -23,10 +23,7 @@
23 23 <p class="totals">卷面总分:{{ allScore }}分</p>
24 24 </div>
25 25 <div class="question-box">
26   - <ul
27   - class="questions-ul questions-ul2"
28   - v-if="!questionList[0]?.subQuestions"
29   - >
  26 + <ul class="questions-ul questions-ul2" v-if="questionList ? !questionList[0].subQuestions : false">
30 27 <li class="sub-questions">
31 28 <div class="qs-num">题号</div>
32 29 <div class="qs-type">题型</div>
... ... @@ -43,18 +40,11 @@
43 40 <template v-if="question.subQuestions">
44 41 <p class="question-title" v-if="paperType == 2">
45 42 <span>{{ setBigNum(index) }}、</span>
46   - <el-input
47   - class="ipt"
48   - v-model.trim="question.questionTitle"
49   - maxlength="30"
50   - placeholder="填写大题名称"
51   - ></el-input>
  43 + <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30"
  44 + placeholder="填写大题名称"></el-input>
52 45 <span>共 {{ setScore(question) }} 分</span>
53 46 </p>
54   - <div
55   - class="questions-ul"
56   - :class="paperType == 1 ? 'questions-ul2' : ''"
57   - >
  47 + <div class="questions-ul" :class="paperType == 1 ? 'questions-ul2' : ''">
58 48 <div class="sub-questions">
59 49 <div class="qs-num">题号</div>
60 50 <div class="qs-type">题型</div>
... ... @@ -65,21 +55,12 @@
65 55 <div class="qs-set">题目解析</div>
66 56 <div class="qs-set">知识点</div>
67 57 </div>
68   - <div
69   - v-for="(subQuestions, indexs) in question.subQuestions"
70   - :key="indexs"
71   - >
72   - <p
73   - class="set-ans-btn"
74   - v-if="
75   - subQuestions.qusType &&
76   - subQuestions.subNum &&
77   - subQuestions.subNum > 4
78   - "
79   - >
80   - <el-button type="primary" @click="setFormAns(indexs, index)"
81   - >批量设置答案</el-button
82   - >
  58 + <div v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs">
  59 + <p class="set-ans-btn" v-if="subQuestions.qusType &&
  60 + subQuestions.subNum &&
  61 + subQuestions.subNum > 4
  62 + ">
  63 + <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button>
83 64 </p>
84 65 <div v-else class="sub-questions">
85 66 <div class="qs-num">{{ setNum(index, indexs) }}</div>
... ... @@ -87,123 +68,57 @@
87 68 {{ setSubPro(subQuestions.questionType) }}
88 69 </div>
89 70 <div class="qs-score">
90   - <el-input-number
91   - class="number-ipt"
92   - size="medium"
93   - :min="1"
94   - :max="200"
95   - :precision="2"
96   - :step="1"
97   - v-model="subQuestions.score"
98   - label="单题分值"
99   - ></el-input-number>
  71 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
  72 + v-model="subQuestions.score" label="单题分值"></el-input-number>
100 73 </div>
101 74 <div class="qs-partScore">
102 75 <p v-if="subQuestions.questionType != 3">--</p>
103   - <el-input-number
104   - class="number-ipt"
105   - v-else
106   - size="medium"
107   - :min="0"
108   - :precision="2"
109   - :max="subQuestions.score"
110   - :step="0.5"
111   - v-model="subQuestions.partScore"
112   - label="漏选得分"
113   - ></el-input-number>
  76 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2"
  77 + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore"
  78 + label="漏选得分"></el-input-number>
114 79 </div>
115 80 <div class="qs-options qs-options2">
116 81 <p v-if="subQuestions.questionType == 5">--</p>
117 82 <p v-if="subQuestions.questionType == 4" class="answer-box">
118   - <span
119   - class="answer-s"
120   - :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
121   - @click="subQuestions.correctAnswer = 1"
122   - >✓</span
123   - >
124   - <span
125   - class="answer-s"
126   - :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
127   - @click="subQuestions.correctAnswer = 2"
128   - >✗</span
129   - >
  83 + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''"
  84 + @click="subQuestions.correctAnswer = 1">✓</span>
  85 + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''"
  86 + @click="subQuestions.correctAnswer = 2">✗</span>
130 87 </p>
131 88 <p v-if="subQuestions.questionType == 3" class="answer-box">
132   - <template
133   - v-for="option in subQuestions.answerOptions?.split(',')"
134   - >
135   - <span
136   - v-if="option"
137   - class="answer-s"
138   - :class="
139   - subQuestions.correctAnswer?.includes(option)
140   - ? 'active'
141   - : ''
142   - "
143   - :key="option"
144   - @click="changAnswer(subQuestions, option)"
145   - >{{ option }}</span
146   - >
  89 + <template v-for="option in subQuestions.answerOptions?.split(',')">
  90 + <span v-if="option" class="answer-s" :class="subQuestions.correctAnswer?.includes(option)
  91 + ? 'active'
  92 + : ''
  93 + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span>
147 94 </template>
148 95 </p>
149 96 <p v-if="subQuestions.questionType == 2" class="answer-box">
150   - <template
151   - v-for="option in subQuestions.answerOptions?.split(',')"
152   - >
153   - <span
154   - class="answer-s"
155   - v-if="option"
156   - :class="
157   - subQuestions.correctAnswer == option ? 'active' : ''
158   - "
159   - :key="option"
160   - @click="subQuestions.correctAnswer = option"
161   - >{{ option }}</span
162   - >
  97 + <template v-for="option in subQuestions.answerOptions?.split(',')">
  98 + <span class="answer-s" v-if="option" :class="subQuestions.correctAnswer == option ? 'active' : ''
  99 + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span>
163 100 </template>
164 101 </p>
165 102 </div>
166 103 <div class="qs-set">
167   - <el-button
168   - class="icon-tickets"
169   - type="primary"
170   - circle
171   - size="mini"
172   - icon="el-icon-tickets"
173   - @click="openStem(subQuestions, 1, index, indexs)"
174   - ></el-button>
  104 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  105 + @click="openStem(subQuestions, 1, index, indexs)"></el-button>
175 106 </div>
176 107 <div class="qs-set">
177   - <el-button
178   - class="icon-tickets"
179   - type="primary"
180   - circle
181   - size="mini"
182   - icon="el-icon-tickets"
183   - @click="openStem(subQuestions, 2, index, indexs)"
184   - ></el-button>
  108 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  109 + @click="openStem(subQuestions, 2, index, indexs)"></el-button>
185 110 </div>
186 111 <div class="qs-set">
187   - <el-button
188   - type="primary"
189   - circle
190   - size="mini"
191   - icon="el-icon-price-tag"
192   - @click="openKnowledge(subQuestions, index, indexs)"
193   - ></el-button>
  112 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  113 + @click="openKnowledge(subQuestions, index, indexs)"></el-button>
194 114 </div>
195 115 </div>
196 116 </div>
197 117 </div>
198 118 </template>
199 119 <div v-else>
200   - <p
201   - class="set-ans-btn"
202   - v-if="question.qusType && question.subNum && question.subNum > 4"
203   - >
204   - <el-button type="primary" @click="setFormAns(index)"
205   - >批量设置答案</el-button
206   - >
  120 + <p class="set-ans-btn" v-if="question.qusType && question.subNum && question.subNum > 4">
  121 + <el-button type="primary" @click="setFormAns(index)">批量设置答案</el-button>
207 122 </p>
208 123 <div v-else class="sub-questions">
209 124 <div class="qs-num">{{ question.questionIndex }}</div>
... ... @@ -211,106 +126,46 @@
211 126 {{ setSubPro(question.questionType) }}
212 127 </div>
213 128 <div class="qs-score">
214   - <el-input-number
215   - class="number-ipt"
216   - size="medium"
217   - :min="1"
218   - :max="200"
219   - :precision="2"
220   - :step="1"
221   - v-model="question.score"
222   - label="单题分值"
223   - ></el-input-number>
  129 + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1"
  130 + v-model="question.score" label="单题分值"></el-input-number>
224 131 </div>
225 132 <div class="qs-partScore">
226 133 <p v-if="question.questionType != 3">--</p>
227   - <el-input-number
228   - class="number-ipt"
229   - v-else
230   - size="medium"
231   - :min="0"
232   - :precision="2"
233   - :max="question.score"
234   - :step="0.5"
235   - v-model="question.partScore"
236   - label="漏选得分"
237   - ></el-input-number>
  134 + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" :max="question.score"
  135 + :step="0.5" v-model="question.partScore" label="漏选得分"></el-input-number>
238 136 </div>
239 137 <div class="qs-options qs-options2">
240 138 <p v-if="question.questionType == 5">--</p>
241 139 <p v-if="question.questionType == 4" class="answer-box">
242   - <span
243   - class="answer-s"
244   - :class="question.correctAnswer == 1 ? 'active' : ''"
245   - @click="question.correctAnswer = 1"
246   - >✓</span
247   - >
248   - <span
249   - class="answer-s"
250   - :class="question.correctAnswer == 2 ? 'active' : ''"
251   - @click="question.correctAnswer = 2"
252   - >✗</span
253   - >
  140 + <span class="answer-s" :class="question.correctAnswer == 1 ? 'active' : ''"
  141 + @click="question.correctAnswer = 1">✓</span>
  142 + <span class="answer-s" :class="question.correctAnswer == 2 ? 'active' : ''"
  143 + @click="question.correctAnswer = 2">✗</span>
254 144 </p>
255 145 <p v-if="question.questionType == 3" class="answer-box">
256   - <template
257   - v-for="option in question.answerOptions?.split(',')"
258   - >
259   - <span
260   - v-if="option"
261   - class="answer-s"
262   - :class="
263   - question.correctAnswer?.includes(option) ? 'active' : ''
264   - "
265   - :key="option"
266   - @click="changAnswer(question, option)"
267   - >{{ option }}</span
268   - >
  146 + <template v-for="option in question.answerOptions?.split(',')">
  147 + <span v-if="option" class="answer-s" :class="question.correctAnswer?.includes(option) ? 'active' : ''
  148 + " :key="option" @click="changAnswer(question, option)">{{ option }}</span>
269 149 </template>
270 150 </p>
271 151 <p v-if="question.questionType == 2" class="answer-box">
272   - <template
273   - v-for="option in question.answerOptions?.split(',')"
274   - >
275   - <span
276   - class="answer-s"
277   - v-if="option"
278   - :class="question.correctAnswer == option ? 'active' : ''"
279   - :key="option"
280   - @click="question.correctAnswer = option"
281   - >{{ option }}</span
282   - >
  152 + <template v-for="option in question.answerOptions?.split(',')">
  153 + <span class="answer-s" v-if="option" :class="question.correctAnswer == option ? 'active' : ''"
  154 + :key="option" @click="question.correctAnswer = option">{{ option }}</span>
283 155 </template>
284 156 </p>
285 157 </div>
286 158 <div class="qs-set">
287   - <el-button
288   - class="icon-tickets"
289   - type="primary"
290   - circle
291   - size="mini"
292   - icon="el-icon-tickets"
293   - @click="openStem(question, 1, index)"
294   - ></el-button>
  159 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  160 + @click="openStem(question, 1, index)"></el-button>
295 161 </div>
296 162 <div class="qs-set">
297   - <el-button
298   - class="icon-tickets"
299   - type="primary"
300   - circle
301   - size="mini"
302   - icon="el-icon-tickets"
303   - @click="openStem(question, 2, index)"
304   - ></el-button>
  163 + <el-button class="icon-tickets" type="primary" circle size="mini" icon="el-icon-tickets"
  164 + @click="openStem(question, 2, index)"></el-button>
305 165 </div>
306 166 <div class="qs-set">
307   - <el-button
308   - type="primary"
309   - circle
310   - size="mini"
311   - icon="el-icon-price-tag"
312   - @click="openKnowledge(question, index)"
313   - ></el-button>
  167 + <el-button type="primary" circle size="mini" icon="el-icon-price-tag"
  168 + @click="openKnowledge(question, index)"></el-button>
314 169 </div>
315 170 </div>
316 171 </div>
... ... @@ -320,83 +175,45 @@
320 175 <el-button type="danger" plain round @click="linkBack">取消</el-button>
321 176 <el-button type="primary" round @click="save">保存</el-button>
322 177 </div>
323   - <el-dialog
324   - :close-on-click-modal="false"
325   - title="批量设置答案"
326   - :visible.sync="diaSetAns"
327   - width="400"
328   - :modal-append-to-body="false"
329   - >
  178 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400"
  179 + :modal-append-to-body="false">
330 180 <div class="qs-options set-questions">
331 181 <p class="dia-tips">
332 182 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD”
333 183 </p>
334 184 <p>{{ setSubPro(formAns.qusType) }}:</p>
335 185 <p class="ipt">
336   - <el-input
337   - ref="formAnsIpt"
338   - v-if="formAns.qusType == 2 || formAns.qusType == 3"
339   - v-model="formAns.answerList"
  186 + <el-input ref="formAnsIpt" v-if="formAns.qusType == 2 || formAns.qusType == 3" v-model="formAns.answerList"
340 187 @keydown.native="keydownAnswer($event, formAns.qusType)"
341   - @input="setAllAnswer($event, formAns.qusType)"
342   - ></el-input>
343   - <el-input
344   - v-if="formAns.qusType == 4"
345   - v-model="formAns.answerList"
346   - readonly=""
347   - ></el-input>
  188 + @input="setAllAnswer($event, formAns.qusType)"></el-input>
  189 + <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input>
348 190 </p>
349 191 <p class="answer-box">
350 192 <template v-if="formAns.qusType == 4">
351   - <span
352   - class="answer-s active"
353   - @click="
354   - formAns.answerList.length < formAns.subNum
355   - ? (formAns.answerList += '✓')
356   - : ''
357   - "
358   - >✓</span
359   - >
360   - <span
361   - class="answer-s active"
362   - @click="
363   - formAns.answerList.length < formAns.subNum
364   - ? (formAns.answerList += '✗')
365   - : ''
366   - "
367   - >✗</span
368   - >
  193 + <span class="answer-s active" @click="
  194 + formAns.answerList.length < formAns.subNum
  195 + ? (formAns.answerList += '✓')
  196 + : ''
  197 + ">✓</span>
  198 + <span class="answer-s active" @click="
  199 + formAns.answerList.length < formAns.subNum
  200 + ? (formAns.answerList += '✗')
  201 + : ''
  202 + ">✗</span>
369 203 </template>
370 204 <template v-if="formAns.qusType == 3">
371   - <span
372   - class="answer-s active"
373   - v-for="option in formAns.answerOptions.split(',')"
374   - :key="option"
375   - @click="setMultiple(formAns, option)"
376   - >{{ option }}</span
377   - >
378   - <span class="answer-s active" @click="setMultiple(formAns, ',')"
379   - >,</span
380   - >
  205 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option"
  206 + @click="setMultiple(formAns, option)">{{ option }}</span>
  207 + <span class="answer-s active" @click="setMultiple(formAns, ',')">,</span>
381 208 </template>
382 209 <template v-if="formAns.qusType == 2">
383   - <span
384   - class="answer-s active"
385   - v-for="option in formAns.answerOptions.split(',')"
386   - :key="option"
387   - @click="
388   - formAns.answerList.length < formAns.subNum
389   - ? (formAns.answerList += option)
390   - : ''
391   - "
392   - >{{ option }}</span
393   - >
  210 + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click="
  211 + formAns.answerList.length < formAns.subNum
  212 + ? (formAns.answerList += option)
  213 + : ''
  214 + ">{{ option }}</span>
394 215 </template>
395   - <span
396   - class="answer-s delButton"
397   - @click="formAns.answerList = formAns.answerList.slice(0, -1)"
398   - >x</span
399   - >
  216 + <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span>
400 217 <span class="answer-s ac" @click="formAns.answerList = ''">ac</span>
401 218 </p>
402 219 </div>
... ... @@ -405,42 +222,21 @@
405 222 <el-button @click="diaSetAns = false">取 消</el-button>
406 223 </div>
407 224 </el-dialog>
408   - <el-dialog
409   - :close-on-click-modal="false"
410   - :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
411   - :visible.sync="dialogStem"
412   - v-if="dialogStem"
413   - width="800px"
414   - >
  225 + <el-dialog :append-to-body="true" :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem"
  226 + v-if="dialogStem" width="800px">
415 227 <div class="upload-box">
416 228 <div v-loading="iframeLoading">
417 229 <template v-if="stem.type == 1">
418   - <iframe
419   - ref="screenshot"
420   - class="screenshot"
421   - v-if="stem.screenshot"
422   - :src="stem.screenshot"
423   - @load="iframeLoading = false"
424   - ></iframe>
  230 + <iframe ref="screenshot" class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"
  231 + @load="iframeLoading = false"></iframe>
425 232 </template>
426 233 <template v-else>
427   - <iframe
428   - ref="screenshot"
429   - class="screenshot"
430   - v-if="stem.answerScreenshot"
431   - :src="stem.answerScreenshot"
432   - @load="iframeLoading = false"
433   - ></iframe>
  234 + <iframe ref="screenshot" class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"
  235 + @load="iframeLoading = false"></iframe>
434 236 </template>
435 237 </div>
436   - <el-upload
437   - class="upload-demo"
438   - :action="uploadUrl"
439   - :limit="1"
440   - :on-success="upSuccess"
441   - :on-error="upError"
442   - accept="image/*"
443   - >
  238 + <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError"
  239 + accept="image/*">
444 240 <el-button size="small" type="primary">选择照片</el-button>
445 241 </el-upload>
446 242 </div>
... ... @@ -448,29 +244,16 @@
448 244 <el-button @click="dialogStem = false">确定</el-button>
449 245 </div>
450 246 </el-dialog>
451   - <el-dialog
452   - :close-on-click-modal="false"
453   - title="知识点"
454   - :visible.sync="dialogKnowledge"
455   - width="500px"
456   - >
  247 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500px">
457 248 <div>
458 249 <el-form ref="form" :model="stem" label-width="160px">
459 250 <el-form-item label="知识点:">
460   - <el-cascader
461   - size="small"
462   - filterable
463   - :show-all-levels="false"
464   - clearable
465   - placeholder="选择知识点"
466   - v-model="stem.knowledge"
467   - :options="knowledgeData"
468   - :props="{
469   - expandTrigger: 'hover',
470   - multiple: true,
471   - checkStrictly: true,
472   - }"
473   - ></el-cascader>
  251 + <el-cascader size="small" filterable :show-all-levels="false" clearable placeholder="选择知识点"
  252 + v-model="stem.knowledge" :options="knowledgeData" :props="{
  253 + expandTrigger: 'hover',
  254 + multiple: true,
  255 + checkStrictly: true,
  256 + }"></el-cascader>
474 257 </el-form-item>
475 258 </el-form>
476 259 </div>
... ... @@ -908,8 +691,8 @@ export default {
908 691 this.formAns.answerList[subNum - i] == "✓"
909 692 ? 1
910 693 : this.formAns.answerList[subNum - i] == "✗"
911   - ? 2
912   - : "";
  694 + ? 2
  695 + : "";
913 696 }
914 697 if (this.questionList[0]?.subQuestions) {
915 698 this.questionList[this.formAns.listIndex].subQuestions[
... ... @@ -990,22 +773,22 @@ export default {
990 773 this.type == 1
991 774 ? this.$request.pPaperDetail
992 775 : this.type == 2
993   - ? this.$request.pExamQuestionList
994   - : this.$request.pPeriodQuestionList;
  776 + ? this.$request.pExamQuestionList
  777 + : this.$request.pPeriodQuestionList;
995 778 } else {
996 779 detail =
997 780 this.type == 1
998 781 ? this.$request.fetchPaperDetail
999 782 : this.type == 2
1000   - ? this.$request.examQuestionList
1001   - : this.$request.periodQuestionList;
  783 + ? this.$request.examQuestionList
  784 + : this.$request.periodQuestionList;
1002 785 }
1003 786 let params =
1004 787 this.type == 1
1005 788 ? { paperId: this.$route.query.paperId }
1006 789 : this.type == 2
1007   - ? { examId: this.$route.query.paperId }
1008   - : {
  790 + ? { examId: this.$route.query.paperId }
  791 + : {
1009 792 periodId: this.$route.query.paperId,
1010 793 };
1011 794 const { data, status, info } = await detail(params);
... ... @@ -1023,7 +806,7 @@ export default {
1023 806 item.subQuestions.map((subQuestion) => {
1024 807 subQuestion.questionType == 2 || subQuestion.questionType == 3
1025 808 ? (subQuestion.answerOptions =
1026   - subQuestion.answerOptions || "A,B,C,D")
  809 + subQuestion.answerOptions || "A,B,C,D")
1027 810 : "";
1028 811 subQuestion.correctAnswer = subQuestion.correctAnswer || "";
1029 812 });
... ... @@ -1293,6 +1076,7 @@ export default {
1293 1076 font-weight: 700;
1294 1077 }
1295 1078 }
  1079 +
1296 1080 .question-box {
1297 1081 margin-bottom: 20px;
1298 1082  
... ... @@ -1343,7 +1127,7 @@ export default {
1343 1127 display: flex;
1344 1128 border-bottom: 1px solid #e2e2e2;
1345 1129  
1346   - & > div {
  1130 + &>div {
1347 1131 min-height: 40px;
1348 1132 padding: 5px;
1349 1133 flex-shrink: 0;
... ...
src/views/examinationPaper/edit_Old.vue
... ... @@ -310,7 +310,7 @@
310 310 <el-button type="danger" plain round @click="linkBack">取消</el-button>
311 311 <el-button type="primary" round @click="save">保存</el-button>
312 312 </div>
313   - <el-dialog
  313 + <el-dialog :append-to-body="true"
314 314 :close-on-click-modal="false"
315 315 title="批量设置答案"
316 316 :visible.sync="diaSetAns"
... ... @@ -395,7 +395,7 @@
395 395 <el-button @click="diaSetAns = false">取 消</el-button>
396 396 </div>
397 397 </el-dialog>
398   - <el-dialog
  398 + <el-dialog :append-to-body="true"
399 399 :close-on-click-modal="false"
400 400 :title="stem.type == 1 ? '上传题干' : '上传题目解析'"
401 401 :visible.sync="dialogStem"
... ... @@ -429,7 +429,7 @@
429 429 <el-button @click="dialogStem = false">关闭弹窗</el-button>
430 430 </div>
431 431 </el-dialog>
432   - <el-dialog
  432 + <el-dialog :append-to-body="true"
433 433 :close-on-click-modal="false"
434 434 title="题目打标"
435 435 :visible.sync="dialogTag"
... ...
src/views/examinationPaper/index.vue
... ... @@ -5,59 +5,25 @@
5 5 <span>备题组卷</span>
6 6 </template>
7 7 <template slot="btns">
8   - <el-tooltip
9   - v-if="!code && gdClass"
10   - effect="dark"
11   - content="已归档试卷"
12   - placement="bottom"
13   - >
14   - <el-button
15   - type="primary"
16   - icon="fa fa-archive"
17   - size="mini"
18   - plain
19   - circle
20   - @click="toArchiving"
21   - ></el-button>
  8 + <el-tooltip v-if="!code && gdClass" effect="dark" content="已归档试卷" placement="bottom">
  9 + <el-button type="primary" icon="fa fa-archive" size="mini" plain circle @click="toArchiving"></el-button>
22 10 </el-tooltip>
23 11 </template>
24 12 </back-box>
25 13 <div class="examinationPaper-type">
26 14 <el-button-group>
27   - <el-button
28   - size="large"
29   - :type="query.type == 1 ? 'primary' : 'default'"
30   - @click="changPaperType(1)"
31   - >备题</el-button
32   - >
33   - <el-button
34   - size="large"
35   - :type="query.type == 2 ? 'primary' : 'default'"
36   - @click="changPaperType(2)"
37   - >组卷</el-button
38   - >
  15 + <el-button size="large" :type="query.type == 1 ? 'primary' : 'default'"
  16 + @click="changPaperType(1)">备题</el-button>
  17 + <el-button size="large" :type="query.type == 2 ? 'primary' : 'default'"
  18 + @click="changPaperType(2)">组卷</el-button>
39 19 </el-button-group>
40 20  
41 21 <p>
42   - <el-button
43   - v-if="query.type == 1"
44   - type="primary"
45   - size="mini"
46   - icon="el-icon-plus"
47   - round
48   - @click="diaUp = true"
49   - >
50   - 导入课件</el-button
51   - >
52   -
53   - <el-dropdown
54   - v-if="query.type == 2"
55   - trigger="click"
56   - @command="handleAdd"
57   - >
58   - <el-button type="primary" size="mini" icon="el-icon-plus" round
59   - >添加试卷</el-button
60   - >
  22 + <el-button v-if="query.type == 1" type="primary" size="mini" icon="el-icon-plus" round @click="diaUp = true">
  23 + 导入课件</el-button>
  24 +
  25 + <el-dropdown v-if="query.type == 2" trigger="click" @command="handleAdd">
  26 + <el-button type="primary" size="mini" icon="el-icon-plus" round>添加试卷</el-button>
61 27 <el-dropdown-menu slot="dropdown">
62 28 <el-dropdown-item :command="1">导入试卷</el-dropdown-item>
63 29 <el-dropdown-item :command="2">创建答题卡</el-dropdown-item>
... ... @@ -67,60 +33,21 @@
67 33 </div>
68 34 <div class="answer-header">
69 35 <div class="sel-box">
70   - <el-select
71   - class="sel"
72   - v-model="query.classId"
73   - placeholder="选择班级"
74   - @change="changClazz"
75   - >
76   - <el-option
77   - v-for="item in classList"
78   - :key="item.value"
79   - :label="item.label"
80   - :value="item.value"
81   - >
  36 + <el-select class="sel" v-model="query.classId" placeholder="选择班级" @change="changClazz">
  37 + <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value">
82 38 </el-option>
83 39 </el-select>
84   - <el-select
85   - class="sel"
86   - v-model="query.subjectName"
87   - placeholder="选择科目"
88   - @change="getData(false)"
89   - >
90   - <el-option
91   - v-for="item in subjectList"
92   - :key="item.value"
93   - :label="item.label"
94   - :value="item.value"
95   - >
  40 + <el-select class="sel" v-model="query.subjectName" placeholder="选择科目" @change="getData(false)">
  41 + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">
96 42 </el-option>
97 43 </el-select>
98   - <el-select
99   - v-if="query.type == 2"
100   - class="sel"
101   - v-model="query.tagId"
102   - placeholder="选择类型"
103   - @change="getData(false)"
104   - >
105   - <el-option
106   - v-for="item in typeList"
107   - :key="item.label"
108   - :label="item.label"
109   - :value="item.value"
110   - >{{ item.label }}
  44 + <el-select v-if="query.type == 2" class="sel" v-model="query.tagId" placeholder="选择类型" @change="getData(false)">
  45 + <el-option v-for="item in typeList" :key="item.label" :label="item.label" :value="item.value">{{ item.label }}
111 46 </el-option>
112 47 </el-select>
113   - <el-input
114   - placeholder="试卷名称"
115   - v-model="query.title"
116   - class="input-with-select"
117   - @keyup.enter.native="getData(true)"
118   - >
119   - <el-button
120   - slot="append"
121   - icon="el-icon-search"
122   - @click="getData(true)"
123   - ></el-button>
  48 + <el-input placeholder="试卷名称" v-model="query.title" class="input-with-select"
  49 + @keyup.enter.native="getData(true)">
  50 + <el-button slot="append" icon="el-icon-search" @click="getData(true)"></el-button>
124 51 </el-input>
125 52 </div>
126 53 </div>
... ... @@ -130,16 +57,10 @@
130 57 </p>
131 58 <div class="content">
132 59 <p class="tab-box">
133   - <span
134   - :class="['tab-s', query.share == 0 ? 'active' : '']"
135   - @click="changShare(0)"
136   - >我自编的 ({{ totalCount.my }})</span
137   - >
138   - <span
139   - :class="['tab-s', query.share == 1 ? 'active' : '']"
140   - @click="changShare(1)"
141   - >年级共享的 ({{ totalCount.share }})</span
142   - >
  60 + <span :class="['tab-s', query.share == 0 ? 'active' : '']" @click="changShare(0)">我自编的 ({{ totalCount.my
  61 + }})</span>
  62 + <span :class="['tab-s', query.share == 1 ? 'active' : '']" @click="changShare(1)">年级共享的 ({{ totalCount.share
  63 + }})</span>
143 64 </p>
144 65 <ul v-if="tableData && tableData.length" v-loading="loading">
145 66 <li class="item" v-for="item in tableData" :key="item.id">
... ... @@ -161,99 +82,47 @@
161 82 </template>
162 83 <template v-if="role != 'ROLE_PERSONAL'">
163 84 授课端同步:
164   - <span
165   - class="clazz"
166   - v-for="(clazzChild, indexs) in item.classList"
167   - :key="clazzChild.classId"
168   - :class="clazzChild.keepStatus == 1 ? 'active' : ''"
169   - >{{
170   - `${clazzChild.className}${
171   - indexs != item.classList.length - 1 ? "、" : ""
172   - }`
173   - }}
174   - <i
175   - v-if="clazzChild.keepStatus == 1"
176   - class="el-icon-success"
177   - ></i
178   - ></span>
179   - <el-tooltip
180   - effect="dark"
181   - content="刷新同步状态"
182   - placement="right"
183   - >
184   - <i
185   - class="icon-refresh el-icon-refresh"
186   - @click="refreshStic"
187   - ></i>
  85 + <span class="clazz" v-for="(clazzChild, indexs) in item.classList" :key="clazzChild.classId"
  86 + :class="clazzChild.keepStatus == 1 ? 'active' : ''">{{
  87 + `${clazzChild.className}${indexs != item.classList.length - 1 ? "、" : ""
  88 + }`
  89 + }}
  90 + <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i></span>
  91 + <el-tooltip effect="dark" content="刷新同步状态" placement="right">
  92 + <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i>
188 93 </el-tooltip>
189 94 </template>
190 95 </p>
191 96 <p class="person">
192   - {{ item.realName }}<em class="s-line">|</em
193   - ><span class="date">{{ item.modifiedTime }}</span>
  97 + {{ item.realName }}<em class="s-line">|</em><span class="date">{{ item.modifiedTime }}</span>
194 98 </p>
195 99 </div>
196 100 <div class="btn-box">
197 101 <el-tooltip effect="dark" content="修改答案" placement="bottom">
198   - <el-button
199   - class="edit"
200   - type="primary"
201   - size="mini"
202   - circle
203   - icon="el-icon-edit"
204   - @click="toEdit(item)"
205   - ></el-button>
  102 + <el-button class="edit" type="primary" size="mini" circle icon="el-icon-edit"
  103 + @click="toEdit(item)"></el-button>
206 104 </el-tooltip>
207   - <el-dropdown
208   - trigger="click"
209   - @command="handleDropdownClick($event, item)"
210   - >
211   - <el-button
212   - type="info"
213   - size="mini"
214   - circle
215   - icon="el-icon-more"
216   - ></el-button>
  105 + <el-dropdown trigger="click" @command="handleDropdownClick($event, item)">
  106 + <el-button type="info" size="mini" circle icon="el-icon-more"></el-button>
217 107 <el-dropdown-menu slot="dropdown">
218   - <el-dropdown-item
219   - :command="1"
220   - v-if="userName == item.realName && role != 'ROLE_PERSONAL'"
221   - >修改分享范围</el-dropdown-item
222   - >
  108 + <el-dropdown-item :command="1"
  109 + v-if="userName == item.realName && role != 'ROLE_PERSONAL'">修改分享范围</el-dropdown-item>
223 110 <el-dropdown-item :command="2">复制</el-dropdown-item>
224   - <el-dropdown-item v-show="query.share == 0" :command="3"
225   - >放入回收站</el-dropdown-item
226   - >
  111 + <el-dropdown-item v-show="query.share == 0" :command="3">放入回收站</el-dropdown-item>
227 112 </el-dropdown-menu>
228 113 </el-dropdown>
229 114 </div>
230 115 </li>
231 116 </ul>
232 117 <div class="pagination-box">
233   - <el-pagination
234   - small=""
235   - layout="total,prev, pager, next"
236   - :hide-on-single-page="true"
237   - :total="total"
238   - @current-change="changePage"
239   - :current-page="page"
240   - :page-size="size"
241   - >
  118 + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total"
  119 + @current-change="changePage" :current-page="page" :page-size="size">
242 120 </el-pagination>
243 121 </div>
244   - <el-empty
245   - v-if="!loading && tableData.length == 0"
246   - content="没有更多数据"
247   - :image-size="100"
248   - ></el-empty>
  122 + <el-empty v-if="!loading && tableData.length == 0" content="没有更多数据" :image-size="100"></el-empty>
249 123 </div>
250 124  
251   - <el-dialog
252   - :close-on-click-modal="false"
253   - title="选择分享范围"
254   - :visible.sync="dialogVisible"
255   - width="400px"
256   - >
  125 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="选择分享范围" :visible.sync="dialogVisible" width="400px">
257 126 <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px">
258 127 <el-form-item prop="share" label="分享范围:">
259 128 <el-radio-group v-model="shareForm.sharingType">
... ... @@ -267,65 +136,34 @@
267 136 <el-button @click="dialogVisible = false">取 消</el-button>
268 137 </div>
269 138 </el-dialog>
270   - <el-dialog
271   - :close-on-click-modal="false"
272   - title="上传word文档"
273   - :visible.sync="diaUp"
274   - width="600px"
275   - >
276   - <upload
277   - :url="url"
278   - :params="{ type: query.type }"
279   - @upSuccess="upSuccess"
280   - fileName="下载"
281   - >
  139 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="上传word文档" :visible.sync="diaUp" width="600px">
  140 + <upload :url="url" :params="{ type: query.type }" @upSuccess="upSuccess" fileName="下载">
282 141 <div class="down-box p0" slot="down">
283 142 <p class="down-head" v-if="query.type == 1">
284 143 <span>第一步:</span>
285 144 <el-link type="primary" @click="downExcel">下载模板,</el-link>
286   - <span
287   - >或者导出菁优网试卷/组卷网(学科网)试卷;
288   - 为保证第三方试卷导入成功,请注意参考导出示例:</span
289   - >
  145 + <span>或者导出菁优网试卷/组卷网(学科网)试卷;
  146 + 为保证第三方试卷导入成功,请注意参考导出示例:</span>
290 147 <span class="img-box">
291   - <el-image
292   - class="img"
293   - :src="examplePic"
294   - :preview-src-list="examplePicList"
295   - >
  148 + <el-image class="img" :src="examplePic" :preview-src-list="examplePicList">
296 149 </el-image>
297   - 菁优网示例 </span
298   - >/
  150 + 菁优网示例 </span>/
299 151 <span class="img-box">
300   - <el-image
301   - class="img"
302   - :src="examplePic2"
303   - :preview-src-list="examplePicList2"
304   - >
  152 + <el-image class="img" :src="examplePic2" :preview-src-list="examplePicList2">
305 153 </el-image>
306 154 组卷网(学科网)示例。
307 155 </span>
308 156 </p>
309 157 <p class="down-head" v-if="query.type == 2">
310   - <span
311   - >第一步:导出菁优网试卷/组卷网(学科网)试卷;为保证第三方试卷导入成功,请注意参考导出示例:</span
312   - >
  158 + <span>第一步:导出菁优网试卷/组卷网(学科网)试卷;为保证第三方试卷导入成功,请注意参考导出示例:</span>
313 159 <span class="img-box">
314   - <el-image
315   - class="img"
316   - :src="examplePic"
317   - :preview-src-list="examplePicList"
318   - >
  160 + <el-image class="img" :src="examplePic" :preview-src-list="examplePicList">
319 161 </el-image>
320 162 菁优网示例
321 163 </span>
322 164 /
323 165 <span class="img-box">
324   - <el-image
325   - class="img"
326   - :src="examplePic2"
327   - :preview-src-list="examplePicList2"
328   - >
  166 + <el-image class="img" :src="examplePic2" :preview-src-list="examplePicList2">
329 167 </el-image>
330 168 组卷网(学科网)示例。
331 169 </span>
... ... @@ -751,14 +589,17 @@ export default {
751 589 <style scoped lang="scss">
752 590 .down-box {
753 591 padding-left: 20px;
  592 +
754 593 .down-head {
755 594 display: block;
  595 +
756 596 span,
757 597 a {
758 598 vertical-align: middle;
759 599 }
760 600 }
761 601 }
  602 +
762 603 .tips {
763 604 display: flex;
764 605 padding-left: 30px;
... ...
src/views/index/mainIndex.vue
... ... @@ -25,8 +25,7 @@
25 25 <p class="p1">学校管理</p>
26 26 <p class="p2">
27 27 管理
28   - <template v-if="dataInfo.gradeCount"
29   - >{{ dataInfo.gradeCount }}个年级,
  28 + <template v-if="dataInfo.gradeCount">{{ dataInfo.gradeCount }}个年级,
30 29 </template>
31 30 <template v-if="dataInfo.classCount">
32 31 {{ dataInfo.classCount }}个班级,
... ... @@ -43,12 +42,9 @@
43 42 <p class="p1">设备状态</p>
44 43 <p class="p2">
45 44 管理
46   - <template v-if="dataInfo.stationCount"
47   - >{{ dataInfo.stationCount }}个基站,</template
48   - >
  45 + <template v-if="dataInfo.stationCount">{{ dataInfo.stationCount }}个基站,</template>
49 46 <template v-if="dataInfo.keyboardCount">
50   - {{ dataInfo.keyboardCount }}套答题器设备。</template
51   - >
  47 + {{ dataInfo.keyboardCount }}套答题器设备。</template>
52 48 </p>
53 49 </div>
54 50 </li>
... ... @@ -74,43 +70,31 @@
74 70 </ul>
75 71 <ul class="nav-list" v-if="type == 'ROLE_JITUAN'">
76 72 <template v-for="item in navList">
77   - <li
78   - v-if="!item.path.includes('dataSync')"
79   - :key="item.path"
80   - class="nav-item item4"
81   - @click="links(item.path)"
82   - >
  73 + <li v-if="!item.path.includes('dataSync')" :key="item.path" class="nav-item item4" @click="links(item.path)">
83 74 <img class="icon" :src="getImgs(item.path)" alt="" />
84 75 <div class="text" v-if="item.path == '/setUpConglomerate'">
85 76 <p class="p1">学校管理</p>
86 77 <p class="p2">
87 78 管理
88   - <template v-if="dataInfo.regionCount"
89   - >{{ dataInfo.regionCount }}个区域,</template
90   - >
91   - <template v-if="dataInfo.schoolCount"
92   - >{{ dataInfo.schoolCount }}个学校。</template
93   - >
  79 + <template v-if="dataInfo.regionCount">{{ dataInfo.regionCount }}个区域,</template>
  80 + <template v-if="dataInfo.schoolCount">{{ dataInfo.schoolCount }}个学校。</template>
94 81 </p>
95 82 </div>
96 83 <div class="text" v-else-if="item.path == '/setUpAccount'">
97 84 <p class="p1">账号管理</p>
98 85 <p class="p2">
99 86 共{{
100   - dataInfo.regionManagerCount + dataInfo.schoolManagerCount
101   - }}个各层级管理员账号。
  87 + dataInfo.regionManagerCount + dataInfo.schoolManagerCount
  88 + }}个各层级管理员账号。
102 89 </p>
103 90 </div>
104 91 <div class="text" v-else-if="item.path == '/device'">
105 92 <p class="p1">设备状态</p>
106 93 <p class="p2">
107 94 管理
108   - <template v-if="dataInfo.stationCount"
109   - >{{ dataInfo.stationCount }}个基站,</template
110   - >
  95 + <template v-if="dataInfo.stationCount">{{ dataInfo.stationCount }}个基站,</template>
111 96 <template v-if="dataInfo.keyboardCount">
112   - {{ dataInfo.keyboardCount }}套答题器设备。</template
113   - >
  97 + {{ dataInfo.keyboardCount }}套答题器设备。</template>
114 98 </p>
115 99 </div>
116 100 <div class="text" v-else-if="item.path == '/analysis'">
... ... @@ -124,17 +108,9 @@
124 108 </li>
125 109 </template>
126 110 </ul>
127   - <ul
128   - class="nav-list"
129   - v-if="type == 'ROLE_JIAOSHI' || type == 'ROLE_BANZHUREN'"
130   - >
  111 + <ul class="nav-list" v-if="type == 'ROLE_JIAOSHI' || type == 'ROLE_BANZHUREN'">
131 112 <template v-for="item in navList">
132   - <li
133   - v-if="!item.path.includes('dataSync')"
134   - :key="item.path"
135   - class="nav-item item4"
136   - @click="links(item.path)"
137   - >
  113 + <li v-if="!item.path.includes('dataSync')" :key="item.path" class="nav-item item4" @click="links(item.path)">
138 114 <img class="icon" :src="getImgs(item.path)" alt="" />
139 115 <div class="text" v-if="item.path == '/examinationPaper'">
140 116 <p class="p1">备题组卷</p>
... ... @@ -344,23 +320,28 @@ export default {
344 320 justify-content: center;
345 321 align-items: center;
346 322 padding: 100px 90px 0 50px;
  323 +
347 324 .nav-list {
348 325 width: 100%;
349 326 display: flex;
350 327 flex-wrap: wrap;
  328 +
351 329 .nav-item {
352 330 background: #f8f8f8;
353 331 border-radius: 20px;
354 332 box-shadow: 3px 3px 3px #aaaaaa59;
355 333 cursor: pointer;
  334 +
356 335 &:hover {
357 336 background-color: #ededed;
358 337 }
  338 +
359 339 .icon {
360 340 width: 110px;
361 341 height: 110px;
362 342 border-radius: 50%;
363 343 }
  344 +
364 345 .p1 {
365 346 font-size: 18px;
366 347 color: #333;
... ... @@ -368,11 +349,13 @@ export default {
368 349 margin-bottom: 12px;
369 350 font-weight: 500;
370 351 }
  352 +
371 353 .p2 {
372 354 font-size: 14px;
373 355 color: #999;
374 356 }
375 357 }
  358 +
376 359 .item1 {
377 360 width: calc(50% - 10px);
378 361 flex-shrink: 0;
... ... @@ -382,71 +365,87 @@ export default {
382 365 margin-bottom: 20px;
383 366 box-sizing: border-box;
384 367 padding: 40px 20px 40px 80px;
  368 +
385 369 &:nth-child(2) {
386 370 margin-right: 0;
387 371 }
  372 +
388 373 .icon {
389 374 margin-right: 20px;
390 375 }
  376 +
391 377 .text {
392 378 display: flex;
393 379 flex-direction: column;
394 380 justify-content: center;
395 381 padding-top: 10px;
396 382 }
  383 +
397 384 .p2 {
398 385 line-height: 24px;
399 386 }
  387 +
400 388 &.item-child1 {
401 389 width: 100%;
402 390 height: calc(50% - 8px);
403 391 margin-bottom: 16px;
404 392 padding: 0 20px;
405 393 align-items: center;
  394 +
406 395 .icon {
407 396 width: 80px;
408 397 height: 80px;
409 398 }
410 399 }
  400 +
411 401 &.item-child2 {
412 402 height: calc(50% - 8px);
413 403 flex-wrap: wrap;
414 404 padding: 12px 0 12px 30px;
415 405 margin-right: 20px;
  406 +
416 407 .icon {
417 408 width: 60px;
418 409 height: 60px;
419 410 }
  411 +
420 412 .p1 {
421 413 flex: 1;
422 414 line-height: 60px;
423 415 margin-bottom: 0;
424 416 }
  417 +
425 418 .p2 {
426 419 width: 100%;
427 420 }
  421 +
428 422 &:last-of-type {
429 423 margin-right: 0;
430 424 }
431 425 }
  426 +
432 427 &.item-child3 {
433 428 height: calc(50% - 8px);
434 429 flex-wrap: wrap;
435 430 padding: 12px 0 12px 30px;
  431 +
436 432 .icon {
437 433 width: 60px;
438 434 height: 60px;
439 435 }
  436 +
440 437 .p1 {
441 438 flex: 1;
442 439 line-height: 60px;
443 440 margin-bottom: 0;
444 441 }
  442 +
445 443 .p2 {
446 444 width: 100%;
447 445 }
448 446 }
449 447 }
  448 +
450 449 .item2 {
451 450 width: calc(50% - 10px);
452 451 height: 240px;
... ... @@ -459,22 +458,27 @@ export default {
459 458 box-sizing: border-box;
460 459 padding: 30px 0;
461 460 text-align: center;
  461 +
462 462 &:last-of-type {
463 463 margin-right: 0;
464 464 }
  465 +
465 466 .icon {
466 467 margin-bottom: 20px;
467 468 }
  469 +
468 470 .p2 {
469 471 line-height: 16px;
470 472 }
471 473 }
  474 +
472 475 .item3 {
473 476 width: calc(50% - 10px);
474 477 height: 240px;
475 478 display: flex;
476 479 flex-wrap: wrap;
477 480 }
  481 +
478 482 .item4 {
479 483 width: calc(50% - 10px);
480 484 flex-shrink: 0;
... ... @@ -484,18 +488,22 @@ export default {
484 488 margin-bottom: 20px;
485 489 box-sizing: border-box;
486 490 padding: 40px 80px;
  491 +
487 492 &:nth-child(2n) {
488 493 margin-right: 0;
489 494 }
  495 +
490 496 .icon {
491 497 margin-right: 20px;
492 498 }
  499 +
493 500 .text {
494 501 display: flex;
495 502 flex-direction: column;
496 503 justify-content: center;
497 504 padding-top: 10px;
498 505 }
  506 +
499 507 .p2 {
500 508 line-height: 24px;
501 509 }
... ...
src/views/layout/aside/aside.vue
... ... @@ -20,7 +20,7 @@
20 20 class="el-menu-vertical"
21 21 @select="selectmenu"
22 22 :collapse="$store.getters.isCollapse"
23   - background-color="#03152A"
  23 + background-color="#333752"
24 24 text-color="rgba(255,255,255,.7)"
25 25 active-text-color="#ffffff"
26 26 :router="$store.getters.uniquerouter"
... ... @@ -29,28 +29,60 @@
29 29 >
30 30 <template v-for="(item, index) in $store.getters.routers">
31 31 <template v-if="!item.hidden">
32   - <el-submenu
33   - v-if="!item.alone && item.children.length > 0"
34   - :index="index + ''"
35   - :key="index"
36   - >
37   - <template slot="title">
38   - <i :class="item.iconCls ? item.iconCls : [fa, fa - server]"></i>
  32 + <template v-if="!item.alone && item.children.length > 0">
  33 + <el-menu-item-group :class="'el-menu-item'">
  34 + <template slot="title">
  35 + <i
  36 + v-if="item.iconCls"
  37 + :class="item.iconCls ? item.iconCls : [fa, fa - file]"
  38 + />
  39 + <template v-else-if="item.iconImage">
  40 + <el-image
  41 + v-show="$route.path == item.path"
  42 + :src="item.selectedIconImage"
  43 + ></el-image>
  44 + <el-image
  45 + v-show="$route.path != item.path"
  46 + :src="item.iconImage"
  47 + ></el-image>
  48 + </template>
  49 + <span slot="title">{{ item.name }}</span>
  50 + </template>
  51 + </el-menu-item-group>
  52 + <menu-tree
  53 + :class="'el-menu-item-group-item'"
  54 + :menuData="item.children"
  55 + :path="path"
  56 + ></menu-tree>
  57 + </template>
  58 + <template v-else>
  59 + <el-menu-item
  60 + :index="item.path"
  61 + :key="index"
  62 + :class="
  63 + path.includes(item.path)
  64 + ? 'is-active'
  65 + : ''
  66 + "
  67 + @click="isKeep(item.path)"
  68 + >
  69 + <i
  70 + v-if="item.iconCls"
  71 + :class="item.iconCls ? item.iconCls : [fa, fa - file]"
  72 + />
  73 + <template v-else-if="item.iconImage">
  74 + <el-image
  75 + v-show="$route.path == item.path"
  76 + :src="item.selectedIconImage"
  77 + ></el-image>
  78 + <el-image
  79 + v-show="$route.path != item.path"
  80 + :src="item.iconImage"
  81 + ></el-image>
  82 + </template>
39 83 <span slot="title">{{ item.name }}</span>
40   - </template>
41   -
42   - <menu-tree :menuData="item.children" :path="path"></menu-tree>
43   - </el-submenu>
44   - <el-menu-item
45   - :index="item.path"
46   - v-else
47   - :key="item.path"
48   - :class="path.includes(item.path) ? 'is-active' : ''"
49   - @click="isKeep(item.path)"
50   - >
51   - <i :class="item.iconCls ? item.iconCls : [fa, fa - file]" />
52   - <span slot="title">{{ item.name }}</span>
53   - </el-menu-item>
  84 + </el-menu-item>
  85 + </template>
54 86 </template>
55 87 </template>
56 88 </el-menu>
... ... @@ -73,7 +105,7 @@ export default {
73 105 // 监听浏览器直接输入路由,将此路由添加到tabnavBox
74 106 "$route.path": function (val) {
75 107 // this.selectmenu(val);
76   - this.path = val;
  108 + this.path = val;
77 109 BusEvent.$off("keepAlive");
78 110 },
79 111 },
... ... @@ -127,6 +159,7 @@ $top: top;
127 159 $bottom: bottom;
128 160 $left: left;
129 161 $right: right;
  162 +
130 163 %w100 {
131 164 width: 100%;
132 165 }
... ... @@ -144,27 +177,32 @@ $right: right;
144 177 #{$side}-#{$prop}: $value;
145 178 }
146 179 }
  180 +
147 181 .aside-box {
148   - max-width: 200px;
  182 + max-width: 250px;
149 183 }
  184 +
150 185 #asideNav {
151 186 width: auto !important;
152 187 display: flex;
153 188 flex-direction: column;
  189 +
154 190 .logo-name {
155 191 background-color: #03152a !important;
156 192 display: flex;
157 193 align-items: center;
158 194 width: 100%;
159   - height: 50px;
  195 + height: 60px;
160 196 padding: 0 16px;
161 197 box-sizing: border-box;
162 198 @extend %w100;
  199 +
163 200 .logo {
164 201 width: 24px;
165 202 height: 24px;
166 203 margin-right: 10px;
167 204 }
  205 +
168 206 .ellipsis {
169 207 overflow: hidden;
170 208 line-height: 50px;
... ... @@ -173,44 +211,78 @@ $right: right;
173 211 color: #fff;
174 212 }
175 213 }
  214 +
176 215 .el-menu-vertical:not(.el-menu--collapse) {
177   - width: 200px;
  216 + width: 250px;
  217 + padding-top: 20px;
178 218 @extend %h100;
179 219 overflow-y: scroll;
180 220 overflow-x: hidden;
181 221 }
  222 +
182 223 .el-menu {
183 224 flex: 1;
184 225 overflow: inherit;
185 226 border-right: none;
  227 +
186 228 &::-webkit-scrollbar {
187 229 display: none;
188 230 }
189   - .fa {
190   - vertical-align: middle;
191   - margin-right: 5px;
  231 +
  232 + .fa,
  233 + .el-image {
192 234 width: 24px;
  235 + height: 24px;
193 236 text-align: center;
194   - font-size: 18px;
  237 + font-size: 20px;
  238 + margin: 0px 16px !important;
195 239 }
196   - .el-menu-item {
197   - background-color: #020f1d !important;
198   - border-bottom: 1px solid #020f1d;
199   - &:hover {
  240 +
  241 + .el-menu-item,
  242 + .el-submenu__title,
  243 + .el-menu-item-group,
  244 + .el-menu-item-group__title {
  245 + font-size: 14px;
  246 + font-weight: 400;
  247 + padding: 0px !important;
  248 + vertical-align: middle;
  249 + border-radius: 4px;
  250 + width: 218px;
  251 + line-height: 44px;
  252 + height: 44px;
  253 + margin: auto !important;
  254 + background-color: #333752 !important;
  255 +
  256 + span {
  257 + color: #eaecf5 !important;
  258 + }
  259 +
  260 + &:not(.el-menu-item-group__title):hover {
200 261 color: #ffffff !important;
201   - background-color: #375573 !important;
  262 + // background-color: #131523 !important;
202 263 }
203 264 }
  265 +
204 266 .el-menu-item.is-active {
205   - background-color: #56a9ff !important;
  267 + background-color: #f5f6fa !important;
  268 +
  269 + span {
  270 + color: #131523 !important;
  271 + }
  272 +
  273 + i {
  274 + color: #131523 !important;
  275 + }
206 276 }
207   - .is-opened > .el-submenu__title > .el-icon-arrow-down {
208   - color: #ffffff;
209   - font-weight: 500;
210   - font-size: 18px;
  277 +
  278 + .el-menu-item-group-item {
  279 + .el-menu-item {
  280 + padding: 0px 0px 0px 20px !important;
  281 + }
211 282 }
212 283 }
213 284 }
  285 +
214 286 :deep(.is-active) {
215 287 color: #fff;
216 288 }
... ...
src/views/layout/aside/menuTree.vue
... ... @@ -7,21 +7,44 @@
7 7 :key="child.path"
8 8 >
9 9 <template slot="title">
10   - <i :class="child.iconCls ? child.iconCls : [fa, fa - file]" />
  10 + <i
  11 + v-if="child.iconCls"
  12 + :class="child.iconCls ? child.iconCls : [fa, fa - file]"
  13 + />
  14 + <template v-else-if="child.iconImage">
  15 + <el-image
  16 + v-show="$route.path == child.path"
  17 + :src="child.selectedIconImage"
  18 + ></el-image>
  19 + <el-image
  20 + v-show="$route.path != child.path"
  21 + :src="child.iconImage"
  22 + ></el-image>
  23 + </template>
11 24 <span slot="title">{{ child.name }}</span>
12 25 </template>
13 26 <menu-tree :menuData="child.children" />
14 27 </el-submenu>
15   -
16 28 <el-menu-item
17 29 v-else-if="!child.hidden"
18 30 :index="child.path"
19 31 :key="child.path"
20   - :class="
21   - child.path == '/setUpClazz' && path == '/archived' ? 'is-active' : ''
22   - "
  32 + :class="path.includes(child.path) ? 'is-active' : ''"
23 33 >
24   - <i :class="child.iconCls ? child.iconCls : [fa, fa - file]" />
  34 + <i
  35 + v-if="child.iconCls"
  36 + :class="child.iconCls ? child.iconCls : [fa, fa - file]"
  37 + />
  38 + <template v-else-if="child.iconImage">
  39 + <el-image
  40 + v-show="path.includes(child.path)"
  41 + :src="child.selectedIconImage"
  42 + ></el-image>
  43 + <el-image
  44 + v-show="!path.includes(child.path)"
  45 + :src="child.iconImage"
  46 + ></el-image>
  47 + </template>
25 48 <span slot="title">{{ child.name }}</span>
26 49 </el-menu-item>
27 50 </template>
... ... @@ -32,8 +55,11 @@
32 55 export default {
33 56 name: "menuTree",
34 57 props: ["menuData", "path"],
  58 + watch: {
  59 + // 监听浏览器直接输入路由,将此路由添加到tabnavBox
  60 + path: function (val) {},
  61 + },
35 62 };
36 63 </script>
37 64  
38   -<style scoped>
39   -</style>
  65 +<style scoped></style>
... ...
src/views/layout/header/header.vue
... ... @@ -104,7 +104,7 @@
104 104 </ul>
105 105 </el-header>
106 106 <!-- <tabNav></tabNav> -->
107   - <el-dialog :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
  107 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
108 108 <el-form
109 109 v-loading="loading"
110 110 ref="formPass"
... ... @@ -360,8 +360,8 @@ ul.el-menu {
360 360 }
361 361  
362 362 #header {
363   - max-height: 50px;
364   - line-height: 50px;
  363 + max-height: 70px;
  364 + line-height: 70px;
365 365 box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
366 366 background: #03152a;
367 367 display: flex;
... ... @@ -372,7 +372,7 @@ ul.el-menu {
372 372 @extend %cursor;
373 373 i {
374 374 font-size: 24px;
375   - line-height: 50px;
  375 + line-height: 70px;
376 376 }
377 377 }
378 378 .personal {
... ... @@ -383,13 +383,13 @@ ul.el-menu {
383 383 font-size: 12px;
384 384 @extend %cursor;
385 385 position: relative;
386   - line-height: 50px;
  386 + line-height: 70px;
387 387 }
388 388 }
389 389 .userInfo {
390 390 display: flex;
391 391 align-items: center;
392   - height: 50px;
  392 + height: 70px;
393 393 @extend %cursor;
394 394 .txt {
395 395 display: flex;
... ... @@ -421,7 +421,7 @@ ul.el-menu {
421 421 bottom: 0;
422 422 left: 0;
423 423 .dropdown-link {
424   - height: 50px;
  424 + height: 70px;
425 425 }
426 426 }
427 427 }
... ...
src/views/personal/dataSync/index.vue
... ... @@ -40,7 +40,7 @@
40 40 </div>
41 41 </div>
42 42 </div>
43   - <el-dialog :close-on-click-modal="false" title="" :visible.sync="dialogVisible" width="300" center>
  43 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="" :visible.sync="dialogVisible" width="300" center>
44 44 <el-result icon="success" title="上传成功"> </el-result>
45 45 <el-descriptions title="" :column="1">
46 46 <el-descriptions-item label="导入答题卡数量">{{tipData.paperNum}}</el-descriptions-item>
... ...
src/views/personal/setUp/student.vue
... ... @@ -90,7 +90,7 @@
90 90 </div>
91 91 </div>
92 92 </div>
93   - <el-dialog :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400">
  93 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="添加学生" :visible.sync="diaStu" width="400">
94 94 <el-form
95 95 ref="formBox"
96 96 :model="formStu"
... ... @@ -140,7 +140,7 @@
140 140 <el-button @click="diaStu = false">取 消</el-button>
141 141 </div>
142 142 </el-dialog>
143   - <el-dialog :close-on-click-modal="false"
  143 + <el-dialog :append-to-body="true" :close-on-click-modal="false"
144 144 :title="formClass.classId ? '修改班级' : '添加班级'"
145 145 :visible.sync="diaClass"
146 146 width="400"
... ... @@ -194,7 +194,7 @@
194 194 >
195 195 </div>
196 196 </el-dialog>
197   - <el-dialog :close-on-click-modal="false" title="学生导入" :visible.sync="diaUp" width="600">
  197 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="学生导入" :visible.sync="diaUp" width="600">
198 198 <upload :url="url" @upSuccess="upSuccess" fileName="学生模板">
199 199 <p class="down-txt" slot="down">
200 200 通过Excel名单导入学生模板,点击
... ...
src/views/personal/test/analysis.vue
... ... @@ -402,7 +402,7 @@
402 402 >
403 403 </div>
404 404 </div>
405   - <el-dialog :close-on-click-modal="false" title="导入主观题分数" :visible.sync="diaUp" width="600">
  405 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="导入主观题分数" :visible.sync="diaUp" width="600">
406 406 <upload :url="url" :examId="id" @upSuccess="upSuccess">
407 407 <template slot="down">
408 408 <p class="down-txt">
... ...
src/views/personal/test/index.vue
... ... @@ -412,7 +412,7 @@
412 412 >
413 413 </p>
414 414 </div>
415   - <el-dialog :close-on-click-modal="false" title="导入主观题分数" :visible.sync="diaUp" width="600">
  415 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="导入主观题分数" :visible.sync="diaUp" width="600">
416 416 <upload
417 417 :url="url"
418 418 :examId="examId"
... ...
src/views/personal/userInfo/index.vue
... ... @@ -25,7 +25,8 @@
25 25 </ul>
26 26 </div>
27 27 </div>
28   - <el-dialog :close-on-click-modal="false" title="修改个人信息" :visible.sync="diaSchool" width="400">
  28 + <el-dialog :close-on-click-modal="false"
  29 + :append-to-body="true" title="修改个人信息" :visible.sync="diaSchool" width="400">
29 30 <el-form
30 31 ref="formSchool"
31 32 class="form-box"
... ... @@ -64,7 +65,7 @@
64 65 <el-button @click="diaSchool = false">取 消</el-button>
65 66 </div>
66 67 </el-dialog>
67   - <el-dialog :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
  68 + <el-dialog :append-to-body="true" :close-on-click-modal="false" title="修改密码" :visible.sync="diaPass" width="400">
68 69 <el-form
69 70 ref="formPass"
70 71 class="form-box"
... ...