Commit 352c53cc5456abfe5b4fbd5d35568980afd602ce
1 parent
6192eba8
上传word回传数据
Showing
8 changed files
with
711 additions
and
912 deletions
package.json
@@ -21,8 +21,9 @@ | @@ -21,8 +21,9 @@ | ||
21 | "vue": "^2.6.11", | 21 | "vue": "^2.6.11", |
22 | "vue-i18n": "^8.4.0", | 22 | "vue-i18n": "^8.4.0", |
23 | "vue-router": "^3.5.1", | 23 | "vue-router": "^3.5.1", |
24 | + "vuedraggable": "^2.24.3", | ||
24 | "vuex": "^3.6.2", | 25 | "vuex": "^3.6.2", |
25 | - "vuedraggable": "^2.24.3" | 26 | + "mockjs": "1.1.0" |
26 | }, | 27 | }, |
27 | "devDependencies": { | 28 | "devDependencies": { |
28 | "@vue/cli-plugin-babel": "~4.5.0", | 29 | "@vue/cli-plugin-babel": "~4.5.0", |
@@ -45,4 +46,4 @@ | @@ -45,4 +46,4 @@ | ||
45 | "sass-loader": "^7.1.0", | 46 | "sass-loader": "^7.1.0", |
46 | "vue-template-compiler": "^2.5.2" | 47 | "vue-template-compiler": "^2.5.2" |
47 | } | 48 | } |
48 | -} | 49 | -} |
50 | +} | ||
49 | \ No newline at end of file | 51 | \ No newline at end of file |
src/api/apis/apis.js
@@ -1604,4 +1604,22 @@ export default { | @@ -1604,4 +1604,22 @@ export default { | ||
1604 | }); | 1604 | }); |
1605 | }, | 1605 | }, |
1606 | 1606 | ||
1607 | + | ||
1608 | + /** v1.5 */ | ||
1609 | + // 教师/个人版查询答题卡列表的分享数量 | ||
1610 | + paperShareCount(data) { | ||
1611 | + return service({ | ||
1612 | + url: setUpUrls.paperShareCount, | ||
1613 | + method: "POST", | ||
1614 | + data | ||
1615 | + }); | ||
1616 | + }, | ||
1617 | + // 教师/个人版导入备题组卷Word文档 | ||
1618 | + paperWordUpload(data) { | ||
1619 | + return service({ | ||
1620 | + url: setUpUrls.paperWordUpload, | ||
1621 | + method: "POST", | ||
1622 | + data | ||
1623 | + }); | ||
1624 | + }, | ||
1607 | }; | 1625 | }; |
src/api/urls/apis.js
@@ -416,4 +416,12 @@ export default { | @@ -416,4 +416,12 @@ export default { | ||
416 | exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", | 416 | exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", |
417 | //查询即时测多班默认等级列表 | 417 | //查询即时测多班默认等级列表 |
418 | defaultLevels: "/api_html/teaching/defaultLevels", | 418 | defaultLevels: "/api_html/teaching/defaultLevels", |
419 | + | ||
420 | + | ||
421 | + | ||
422 | + /** v1.5 */ | ||
423 | + //教师/个人版查询答题卡列表的分享数量 | ||
424 | + paperShareCount: "/api_html/common/paper/paperShareCount", | ||
425 | + //教师/个人版导入备题组卷Word文档 | ||
426 | + paperWordUpload: "/api_html/common/paper/upload", | ||
419 | } | 427 | } |
src/main.js
@@ -28,6 +28,7 @@ Vue.use(permission) | @@ -28,6 +28,7 @@ Vue.use(permission) | ||
28 | NProgress.inc(0.2) | 28 | NProgress.inc(0.2) |
29 | NProgress.configure({ easing: "ease", speed: 500, showSpinner: false }) | 29 | NProgress.configure({ easing: "ease", speed: 500, showSpinner: false }) |
30 | 30 | ||
31 | +import "@/mock/index.js" | ||
31 | 32 | ||
32 | Array.prototype.remove = function (val) { | 33 | Array.prototype.remove = function (val) { |
33 | var index = this.indexOf(val); | 34 | var index = this.indexOf(val); |
src/mock/index.js
0 → 100644
1 | +import Mock from "mockjs" | ||
2 | +Mock.mock( | ||
3 | + "/api_html/common/paper/paperShareCount", { | ||
4 | + info: "success", | ||
5 | + status: 0, | ||
6 | + data: { | ||
7 | + myCount: 24, | ||
8 | + grade: 30 | ||
9 | + } | ||
10 | +} | ||
11 | +) | ||
12 | +Mock.mock( | ||
13 | + "/api_html/common/paper/upload", { | ||
14 | + info: "success", | ||
15 | + status: 0, | ||
16 | + data: { | ||
17 | + "name": "@cname", | ||
18 | + "id|+1": 11, | ||
19 | + "questionList": [ | ||
20 | + { | ||
21 | + "examQuestionId|+1": 0, | ||
22 | + "questionId|+1": 1, | ||
23 | + "questionTitle": "@cname", | ||
24 | + "questionType|1-4": 1, | ||
25 | + "score|1-2": 1, | ||
26 | + "partScore|0.5-1": 0.5, | ||
27 | + "answerOptions": "A,B,C,D", | ||
28 | + "correctAnswer|1": ["A", "B", "C", "D"], | ||
29 | + "subQuestions": [ | ||
30 | + { | ||
31 | + "questionType|1-4": 1, | ||
32 | + "score": 1, | ||
33 | + "partScore": 0, | ||
34 | + "selectNum": 4, | ||
35 | + "answerOptions": "A,B,C,D", | ||
36 | + "correctAnswer|1": ["A", "B", "C", "D"], | ||
37 | + "screenshot": "xxxx", | ||
38 | + } | ||
39 | + ] | ||
40 | + } | ||
41 | + ] | ||
42 | + } | ||
43 | +} | ||
44 | +) | ||
0 | \ No newline at end of file | 45 | \ No newline at end of file |
src/views/basic/setUp/archived.vue
@@ -16,18 +16,8 @@ | @@ -16,18 +16,8 @@ | ||
16 | <li v-show="step == 0"> | 16 | <li v-show="step == 0"> |
17 | <div class="form-item"> | 17 | <div class="form-item"> |
18 | <span class="s-txt">选择分班年级:</span> | 18 | <span class="s-txt">选择分班年级:</span> |
19 | - <el-select | ||
20 | - class="sel" | ||
21 | - v-model="grade" | ||
22 | - placeholder="选择年级" | ||
23 | - @change="changeGrade" | ||
24 | - > | ||
25 | - <el-option | ||
26 | - v-for="item in gradeList" | ||
27 | - :key="item.value" | ||
28 | - :label="item.label" | ||
29 | - :value="item.value" | ||
30 | - > | 19 | + <el-select class="sel" v-model="grade" placeholder="选择年级" @change="changeGrade"> |
20 | + <el-option v-for="item in gradeList" :key="item.value" :label="item.label" :value="item.value"> | ||
31 | </el-option> | 21 | </el-option> |
32 | </el-select> | 22 | </el-select> |
33 | </div> | 23 | </div> |
@@ -36,18 +26,11 @@ | @@ -36,18 +26,11 @@ | ||
36 | <i class="el-icon-loading" v-show="loadingClass"></i> | 26 | <i class="el-icon-loading" v-show="loadingClass"></i> |
37 | <div class="check-box" v-if="classList.length && !loadingClass"> | 27 | <div class="check-box" v-if="classList.length && !loadingClass"> |
38 | <p class="all-check"> | 28 | <p class="all-check"> |
39 | - <el-checkbox | ||
40 | - :indeterminate="isIndeterminate" | ||
41 | - v-model="checkAll" | ||
42 | - @change="handleCheckAllChange" | ||
43 | - >全选</el-checkbox | ||
44 | - > | 29 | + <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" |
30 | + @change="handleCheckAllChange">全选</el-checkbox> | ||
45 | </p> | 31 | </p> |
46 | - <el-checkbox-group | ||
47 | - v-model="classIds" | ||
48 | - @change="handleCheckedChange" | ||
49 | - > | ||
50 | - <el-checkbox v-for="item in classList" :label="item.id">{{ | 32 | + <el-checkbox-group v-model="classIds" @change="handleCheckedChange"> |
33 | + <el-checkbox v-for="item in classList" :key="item.id" :label="item.id">{{ | ||
51 | item.className | 34 | item.className |
52 | }}</el-checkbox> | 35 | }}</el-checkbox> |
53 | </el-checkbox-group> | 36 | </el-checkbox-group> |
@@ -56,39 +39,23 @@ | @@ -56,39 +39,23 @@ | ||
56 | <div class="form-item"> | 39 | <div class="form-item"> |
57 | <span class="s-txt"></span> | 40 | <span class="s-txt"></span> |
58 | <p class="tips"> | 41 | <p class="tips"> |
59 | - <i class="el-icon-warning"></i | ||
60 | - >请谨慎操作,班级归档后,学生解除班级关系且相关老师任课信息将不存在。 | 42 | + <i class="el-icon-warning"></i>请谨慎操作,班级归档后,学生解除班级关系且相关老师任课信息将不存在。 |
61 | </p> | 43 | </p> |
62 | </div> | 44 | </div> |
63 | <div class="btn-box"> | 45 | <div class="btn-box"> |
64 | <el-button class="btn" round @click="toClazz">取消</el-button> | 46 | <el-button class="btn" round @click="toClazz">取消</el-button> |
65 | - <el-popconfirm | ||
66 | - confirm-button-text="确定" | ||
67 | - cancel-button-text="取消" | ||
68 | - icon="el-icon-info" | ||
69 | - icon-color="red" | ||
70 | - title="确定要将所选班级归档吗?" | ||
71 | - @confirm="_ClassArchiving" | ||
72 | - > | ||
73 | - <el-button class="btn" slot="reference" type="primary" round | ||
74 | - >归档</el-button | ||
75 | - > | 47 | + <el-popconfirm confirm-button-text="确定" cancel-button-text="取消" icon="el-icon-info" icon-color="red" |
48 | + title="确定要将所选班级归档吗?" @confirm="_ClassArchiving"> | ||
49 | + <el-button class="btn" slot="reference" type="primary" round>归档</el-button> | ||
76 | </el-popconfirm> | 50 | </el-popconfirm> |
77 | </div> | 51 | </div> |
78 | </li> | 52 | </li> |
79 | <li v-show="step == 1"> | 53 | <li v-show="step == 1"> |
80 | <div class="step-item"> | 54 | <div class="step-item"> |
81 | - <upload | ||
82 | - id="downTeacher" | ||
83 | - :url="urlClazz" | ||
84 | - @upSuccess="upStudentSuccess" | ||
85 | - fileName="学生名单模板" | ||
86 | - > | 55 | + <upload id="downTeacher" :url="urlClazz" @upSuccess="upStudentSuccess" fileName="学生名单模板"> |
87 | <p class="down-txt" slot="down"> | 56 | <p class="down-txt" slot="down"> |
88 | 通过Excel名单导入学生名单模板,点击 | 57 | 通过Excel名单导入学生名单模板,点击 |
89 | - <el-link type="primary" @click="downStudentExcel" | ||
90 | - >导出未分配学生</el-link | ||
91 | - > | 58 | + <el-link type="primary" @click="downStudentExcel">导出未分配学生</el-link> |
92 | 。 | 59 | 。 |
93 | </p> | 60 | </p> |
94 | </upload> | 61 | </upload> |
@@ -96,17 +63,10 @@ | @@ -96,17 +63,10 @@ | ||
96 | </li> | 63 | </li> |
97 | <li v-show="step == 2"> | 64 | <li v-show="step == 2"> |
98 | <div class="step-item"> | 65 | <div class="step-item"> |
99 | - <upload | ||
100 | - id="downTeacher" | ||
101 | - :url="urlTeacher" | ||
102 | - @upSuccess="upTeacherSuccess" | ||
103 | - fileName="任课老师名单模板" | ||
104 | - > | 66 | + <upload id="downTeacher" :url="urlTeacher" @upSuccess="upTeacherSuccess" fileName="任课老师名单模板"> |
105 | <p class="down-txt" slot="down"> | 67 | <p class="down-txt" slot="down"> |
106 | 通过Excel名单导入任课老师名单模板,点击 | 68 | 通过Excel名单导入任课老师名单模板,点击 |
107 | - <el-link type="primary" @click="downTeacherExcel" | ||
108 | - >导出未分配教师</el-link | ||
109 | - >。 | 69 | + <el-link type="primary" @click="downTeacherExcel">导出未分配教师</el-link>。 |
110 | </p> | 70 | </p> |
111 | </upload> | 71 | </upload> |
112 | </div> | 72 | </div> |
@@ -114,14 +74,8 @@ | @@ -114,14 +74,8 @@ | ||
114 | <li v-show="step == 3"> | 74 | <li v-show="step == 3"> |
115 | <div class="step-item2"> | 75 | <div class="step-item2"> |
116 | <p class="p2"> | 76 | <p class="p2"> |
117 | - <el-button | ||
118 | - class="btn" | ||
119 | - type="success" | ||
120 | - icon="el-icon-check" | ||
121 | - circle | ||
122 | - size="small" | ||
123 | - ></el-button | ||
124 | - >恭喜您,分班已经完成,分班后老师第一次上课时注意事项: | 77 | + <el-button class="btn" type="success" icon="el-icon-check" circle |
78 | + size="small"></el-button>恭喜您,分班已经完成,分班后老师第一次上课时注意事项: | ||
125 | </p> | 79 | </p> |
126 | <p class="p1"> | 80 | <p class="p1"> |
127 | 1、点击授课端的设置—应用设置—初始化设置—重新选择绑定班级。 | 81 | 1、点击授课端的设置—应用设置—初始化设置—重新选择绑定班级。 |
@@ -135,21 +89,8 @@ | @@ -135,21 +89,8 @@ | ||
135 | <li v-show="step != 0"> | 89 | <li v-show="step != 0"> |
136 | <div class="btn-box"> | 90 | <div class="btn-box"> |
137 | <el-button class="btn" round @click="step -= 1">上一步</el-button> | 91 | <el-button class="btn" round @click="step -= 1">上一步</el-button> |
138 | - <el-button | ||
139 | - v-show="step != 3" | ||
140 | - class="btn" | ||
141 | - type="primary" | ||
142 | - round | ||
143 | - @click="step += 1" | ||
144 | - >下一步</el-button | ||
145 | - ><el-button | ||
146 | - v-show="step == 3" | ||
147 | - class="btn" | ||
148 | - type="primary" | ||
149 | - round | ||
150 | - @click="toClazz" | ||
151 | - >完成</el-button | ||
152 | - > | 92 | + <el-button v-show="step != 3" class="btn" type="primary" round @click="step += 1">下一步</el-button><el-button |
93 | + v-show="step == 3" class="btn" type="primary" round @click="toClazz">完成</el-button> | ||
153 | </div> | 94 | </div> |
154 | </li> | 95 | </li> |
155 | </ul> | 96 | </ul> |
@@ -183,8 +124,8 @@ export default { | @@ -183,8 +124,8 @@ export default { | ||
183 | handleCheckAllChange(val) { | 124 | handleCheckAllChange(val) { |
184 | this.classIds = val | 125 | this.classIds = val |
185 | ? this.classList.map((item) => { | 126 | ? this.classList.map((item) => { |
186 | - return item.id; | ||
187 | - }) | 127 | + return item.id; |
128 | + }) | ||
188 | : []; | 129 | : []; |
189 | this.isIndeterminate = false; | 130 | this.isIndeterminate = false; |
190 | }, | 131 | }, |
@@ -315,59 +256,73 @@ export default { | @@ -315,59 +256,73 @@ export default { | ||
315 | padding: 20px; | 256 | padding: 20px; |
316 | box-sizing: border-box; | 257 | box-sizing: border-box; |
317 | } | 258 | } |
259 | + | ||
318 | .step { | 260 | .step { |
319 | margin-bottom: 40px; | 261 | margin-bottom: 40px; |
320 | } | 262 | } |
263 | + | ||
321 | .form-item { | 264 | .form-item { |
322 | width: 70%; | 265 | width: 70%; |
323 | display: flex; | 266 | display: flex; |
324 | margin: 0 auto 20px; | 267 | margin: 0 auto 20px; |
268 | + | ||
325 | .check-box { | 269 | .check-box { |
326 | flex: 1; | 270 | flex: 1; |
327 | } | 271 | } |
272 | + | ||
328 | .all-check { | 273 | .all-check { |
329 | margin-right: 30px; | 274 | margin-right: 30px; |
330 | } | 275 | } |
276 | + | ||
331 | &:first-of-type { | 277 | &:first-of-type { |
332 | .s-txt { | 278 | .s-txt { |
333 | line-height: 40px; | 279 | line-height: 40px; |
334 | } | 280 | } |
335 | } | 281 | } |
282 | + | ||
336 | .s-txt { | 283 | .s-txt { |
337 | width: 160px; | 284 | width: 160px; |
338 | flex-shrink: 0; | 285 | flex-shrink: 0; |
339 | } | 286 | } |
287 | + | ||
340 | .sel { | 288 | .sel { |
341 | :deep(.el-input__inner) { | 289 | :deep(.el-input__inner) { |
342 | border-radius: 20px; | 290 | border-radius: 20px; |
343 | } | 291 | } |
344 | } | 292 | } |
293 | + | ||
345 | :deep(.el-checkbox) { | 294 | :deep(.el-checkbox) { |
346 | margin-bottom: 12px; | 295 | margin-bottom: 12px; |
347 | } | 296 | } |
297 | + | ||
348 | .tips { | 298 | .tips { |
349 | display: flex; | 299 | display: flex; |
350 | align-items: center; | 300 | align-items: center; |
351 | color: #666; | 301 | color: #666; |
352 | } | 302 | } |
303 | + | ||
353 | .el-icon-warning { | 304 | .el-icon-warning { |
354 | font-size: 20px; | 305 | font-size: 20px; |
355 | color: #ec7f8c; | 306 | color: #ec7f8c; |
356 | margin-right: 10px; | 307 | margin-right: 10px; |
357 | } | 308 | } |
358 | } | 309 | } |
310 | + | ||
359 | .btn-box { | 311 | .btn-box { |
360 | width: 80%; | 312 | width: 80%; |
361 | margin: 60px auto 0; | 313 | margin: 60px auto 0; |
362 | display: flex; | 314 | display: flex; |
363 | justify-content: flex-end; | 315 | justify-content: flex-end; |
316 | + | ||
364 | .btn { | 317 | .btn { |
365 | margin: 0 10px; | 318 | margin: 0 10px; |
366 | } | 319 | } |
367 | } | 320 | } |
321 | + | ||
368 | .step-item { | 322 | .step-item { |
369 | text-align: center; | 323 | text-align: center; |
370 | } | 324 | } |
325 | + | ||
371 | .step-item2 { | 326 | .step-item2 { |
372 | width: 100%; | 327 | width: 100%; |
373 | display: flex; | 328 | display: flex; |
@@ -375,19 +330,23 @@ export default { | @@ -375,19 +330,23 @@ export default { | ||
375 | align-items: center; | 330 | align-items: center; |
376 | color: #000; | 331 | color: #000; |
377 | font-weight: 500; | 332 | font-weight: 500; |
333 | + | ||
378 | .p2 { | 334 | .p2 { |
379 | font-size: 16px; | 335 | font-size: 16px; |
380 | margin: 0 0 20px -68px; | 336 | margin: 0 0 20px -68px; |
337 | + | ||
381 | .btn { | 338 | .btn { |
382 | margin-right: 14px; | 339 | margin-right: 14px; |
383 | } | 340 | } |
384 | } | 341 | } |
342 | + | ||
385 | .p1 { | 343 | .p1 { |
386 | width: 450px; | 344 | width: 450px; |
387 | text-align: left; | 345 | text-align: left; |
388 | margin-bottom: 20px; | 346 | margin-bottom: 20px; |
389 | } | 347 | } |
390 | } | 348 | } |
349 | + | ||
391 | :deep(.down-txt) { | 350 | :deep(.down-txt) { |
392 | justify-content: center; | 351 | justify-content: center; |
393 | padding-left: 0; | 352 | padding-left: 0; |
src/views/examinationPaper/add.vue
@@ -6,102 +6,44 @@ | @@ -6,102 +6,44 @@ | ||
6 | </template> | 6 | </template> |
7 | </back-box> | 7 | </back-box> |
8 | <div class="content"> | 8 | <div class="content"> |
9 | - <el-steps | ||
10 | - :active="step" | ||
11 | - finish-status="success" | ||
12 | - simple | ||
13 | - style="margin: 20px 0" | ||
14 | - > | 9 | + <el-steps :active="step" finish-status="success" simple style="margin: 20px 0"> |
15 | <el-step title="基础信息" icon="el-icon-edit"></el-step> | 10 | <el-step title="基础信息" icon="el-icon-edit"></el-step> |
16 | - <el-step title="题目编辑" icon="el-icon-tickets"></el-step> | 11 | + <el-step v-if="!isUpload" title="题目编辑" icon="el-icon-tickets"></el-step> |
17 | <el-step title="设置答案" icon="el-icon-edit-outline"></el-step> | 12 | <el-step title="设置答案" icon="el-icon-edit-outline"></el-step> |
18 | </el-steps> | 13 | </el-steps> |
19 | <div v-show="step == 0"> | 14 | <div v-show="step == 0"> |
20 | - <el-form | ||
21 | - ref="forms" | ||
22 | - :model="form" | ||
23 | - :rules="formRules" | ||
24 | - label-width="140px" | ||
25 | - > | 15 | + <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> |
26 | <el-form-item label="答题卡名称:" prop="title"> | 16 | <el-form-item label="答题卡名称:" prop="title"> |
27 | - <el-input | ||
28 | - class="sel2" | ||
29 | - type="text" | ||
30 | - placeholder="请输入答题卡名称" | ||
31 | - v-model.trim="form.title" | ||
32 | - maxlength="30" | ||
33 | - size="45" | ||
34 | - show-word-limit | ||
35 | - > | 17 | + <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="30" size="45" |
18 | + show-word-limit> | ||
36 | </el-input> | 19 | </el-input> |
37 | </el-form-item> | 20 | </el-form-item> |
38 | <el-form-item label="测验类型:"> | 21 | <el-form-item label="测验类型:"> |
39 | <el-select v-model="form.tagId" placeholder="选择测验类型"> | 22 | <el-select v-model="form.tagId" placeholder="选择测验类型"> |
40 | <el-option label="--" value=""> </el-option> | 23 | <el-option label="--" value=""> </el-option> |
41 | - <el-option | ||
42 | - v-for="item in answerTypeList" | ||
43 | - :key="item.id" | ||
44 | - :label="item.typeName" | ||
45 | - :value="item.id" | ||
46 | - >{{ item.typeName }}</el-option | ||
47 | - > | 24 | + <el-option v-for="item in answerTypeList" :key="item.id" :label="item.typeName" :value="item.id">{{ |
25 | + item.typeName }}</el-option> | ||
48 | </el-select> | 26 | </el-select> |
49 | - <el-button | ||
50 | - class="ml-20" | ||
51 | - type="primary" | ||
52 | - round | ||
53 | - circle | ||
54 | - icon="el-icon-edit" | ||
55 | - @click="openTagDia" | ||
56 | - ></el-button> | 27 | + <el-button class="ml-20" type="primary" round circle icon="el-icon-edit" @click="openTagDia"></el-button> |
57 | </el-form-item> | 28 | </el-form-item> |
58 | - <el-form-item | ||
59 | - v-if="role != 'ROLE_PERSONAL'" | ||
60 | - label="年级:" | ||
61 | - prop="gradeName" | ||
62 | - > | ||
63 | - <el-select | ||
64 | - class="sel" | ||
65 | - v-model="form.gradeName" | ||
66 | - placeholder="" | ||
67 | - @change="changeGrade" | ||
68 | - > | ||
69 | - <el-option | ||
70 | - v-for="item in gradeList" | ||
71 | - :key="item" | ||
72 | - :label="item" | ||
73 | - :value="item" | ||
74 | - > | 29 | + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName"> |
30 | + <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade"> | ||
31 | + <el-option v-for="item in gradeList" :key="item" :label="item" :value="item"> | ||
75 | </el-option> | 32 | </el-option> |
76 | </el-select> | 33 | </el-select> |
77 | </el-form-item> | 34 | </el-form-item> |
78 | <el-form-item label="科目:" prop="subjectName"> | 35 | <el-form-item label="科目:" prop="subjectName"> |
79 | <el-select class="sel" v-model="form.subjectName" placeholder=""> | 36 | <el-select class="sel" v-model="form.subjectName" placeholder=""> |
80 | - <el-option | ||
81 | - v-for="item in subjectList" | ||
82 | - :key="item.value" | ||
83 | - :label="item.label" | ||
84 | - :value="item.value" | ||
85 | - >{{ item.label }} | 37 | + <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{ |
38 | + item.label }} | ||
86 | </el-option> | 39 | </el-option> |
87 | </el-select> | 40 | </el-select> |
88 | </el-form-item> | 41 | </el-form-item> |
89 | <el-form-item label="考试时长:"> | 42 | <el-form-item label="考试时长:"> |
90 | - <el-input-number | ||
91 | - size="medium" | ||
92 | - :min="1" | ||
93 | - :max="140" | ||
94 | - :step-strictly="true" | ||
95 | - :step="1" | ||
96 | - v-model="form.examsDuration" | ||
97 | - label="考试时长" | ||
98 | - ></el-input-number> | 43 | + <el-input-number size="medium" :min="1" :max="140" :step-strictly="true" :step="1" |
44 | + v-model="form.examsDuration" label="考试时长"></el-input-number> | ||
99 | </el-form-item> | 45 | </el-form-item> |
100 | - <el-form-item | ||
101 | - v-if="role != 'ROLE_PERSONAL'" | ||
102 | - label="分享范围:" | ||
103 | - prop="sharingType" | ||
104 | - > | 46 | + <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType"> |
105 | <el-radio-group v-model="form.sharingType"> | 47 | <el-radio-group v-model="form.sharingType"> |
106 | <el-radio :label="0">任课班级分享</el-radio> | 48 | <el-radio :label="0">任课班级分享</el-radio> |
107 | <el-radio :label="1">全年级分享</el-radio> | 49 | <el-radio :label="1">全年级分享</el-radio> |
@@ -109,52 +51,24 @@ | @@ -109,52 +51,24 @@ | ||
109 | </el-form-item> | 51 | </el-form-item> |
110 | </el-form> | 52 | </el-form> |
111 | <div class="btn-box"> | 53 | <div class="btn-box"> |
112 | - <el-button type="danger" plain round @click="linkBack" | ||
113 | - >取消</el-button | ||
114 | - > | ||
115 | - <el-button type="primary" round @click="setStep1">下一步</el-button> | 54 | + <el-button type="danger" plain round @click="linkBack">取消</el-button> |
55 | + <el-button type="primary" round @click="isUpload ? setStep2() : setStep1()">下一步</el-button> | ||
116 | </div> | 56 | </div> |
117 | - <el-dialog :close-on-click-modal="false" | ||
118 | - title="设置测验类型" | ||
119 | - :visible.sync="dialogVisible" | ||
120 | - width="500px" | ||
121 | - > | 57 | + <el-dialog :close-on-click-modal="false" title="设置测验类型" :visible.sync="dialogVisible" width="500px"> |
122 | <div class="dia-content"> | 58 | <div class="dia-content"> |
123 | <p class="add-type" v-for="item in tagList" :key="item.id"> | 59 | <p class="add-type" v-for="item in tagList" :key="item.id"> |
124 | <el-row :gutter="10"> | 60 | <el-row :gutter="10"> |
125 | - <el-col :span="18" | ||
126 | - ><el-input | ||
127 | - v-model="item.typeName" | ||
128 | - :maxlength="10" | ||
129 | - placeholder="请输入答题卡类型名称" | ||
130 | - ></el-input | ||
131 | - ></el-col> | 61 | + <el-col :span="18"><el-input v-model="item.typeName" :maxlength="10" |
62 | + placeholder="请输入答题卡类型名称"></el-input></el-col> | ||
132 | <el-col :span="6"> | 63 | <el-col :span="6"> |
133 | <el-tooltip effect="dark" content="保存" placement="top"> | 64 | <el-tooltip effect="dark" content="保存" placement="top"> |
134 | - <el-button | ||
135 | - class="js-set" | ||
136 | - type="primary" | ||
137 | - size="small" | ||
138 | - round | ||
139 | - circle | ||
140 | - icon="el-icon-check" | ||
141 | - @click="editTypeName(item)" | ||
142 | - ></el-button> | 65 | + <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-check" |
66 | + @click="editTypeName(item)"></el-button> | ||
143 | </el-tooltip> | 67 | </el-tooltip> |
144 | <el-tooltip effect="dark" content="删除" placement="right"> | 68 | <el-tooltip effect="dark" content="删除" placement="right"> |
145 | - <el-popconfirm | ||
146 | - title="确定删除这道大题吗?" | ||
147 | - @confirm="removeTypeName(item)" | ||
148 | - > | ||
149 | - <el-button | ||
150 | - class="js-set" | ||
151 | - type="danger" | ||
152 | - size="small" | ||
153 | - round | ||
154 | - circle | ||
155 | - icon="el-icon-delete" | ||
156 | - slot="reference" | ||
157 | - ></el-button> | 69 | + <el-popconfirm title="确定删除这道大题吗?" @confirm="removeTypeName(item)"> |
70 | + <el-button class="js-set" type="danger" size="small" round circle icon="el-icon-delete" | ||
71 | + slot="reference"></el-button> | ||
158 | </el-popconfirm> | 72 | </el-popconfirm> |
159 | </el-tooltip> | 73 | </el-tooltip> |
160 | </el-col> | 74 | </el-col> |
@@ -163,25 +77,13 @@ | @@ -163,25 +77,13 @@ | ||
163 | <p class="add-type"> | 77 | <p class="add-type"> |
164 | <el-row :gutter="10"> | 78 | <el-row :gutter="10"> |
165 | <el-col :span="18"> | 79 | <el-col :span="18"> |
166 | - <el-input | ||
167 | - type="text" | ||
168 | - placeholder="请输入答题卡类型名称" | ||
169 | - v-model.trim="answerTypeName" | ||
170 | - :maxlength="10" | ||
171 | - > | 80 | + <el-input type="text" placeholder="请输入答题卡类型名称" v-model.trim="answerTypeName" :maxlength="10"> |
172 | </el-input> | 81 | </el-input> |
173 | </el-col> | 82 | </el-col> |
174 | <el-col :span="6"> | 83 | <el-col :span="6"> |
175 | <el-tooltip effect="dark" content="添加" placement="right"> | 84 | <el-tooltip effect="dark" content="添加" placement="right"> |
176 | - <el-button | ||
177 | - class="js-set" | ||
178 | - type="primary" | ||
179 | - size="small" | ||
180 | - round | ||
181 | - circle | ||
182 | - icon="el-icon-plus" | ||
183 | - @click="addPaperType" | ||
184 | - ></el-button> | 85 | + <el-button class="js-set" type="primary" size="small" round circle icon="el-icon-plus" |
86 | + @click="addPaperType"></el-button> | ||
185 | </el-tooltip> | 87 | </el-tooltip> |
186 | </el-col> | 88 | </el-col> |
187 | </el-row> | 89 | </el-row> |
@@ -192,438 +94,223 @@ | @@ -192,438 +94,223 @@ | ||
192 | </div> | 94 | </div> |
193 | </el-dialog> | 95 | </el-dialog> |
194 | </div> | 96 | </div> |
195 | - <div v-show="step == 1"> | ||
196 | - <div | ||
197 | - class="question-box" | ||
198 | - v-for="(question, index) in form.questionList" | ||
199 | - :key="index" | ||
200 | - > | ||
201 | - <p class="question-title"> | ||
202 | - <el-tooltip | ||
203 | - effect="dark" | ||
204 | - :content="question.show ? '收起' : '展开'" | ||
205 | - placement="left" | ||
206 | - > | ||
207 | - <i | ||
208 | - class="el-icon-caret-right" | ||
209 | - :class="question.show ? 'active' : ''" | ||
210 | - @click="question.show = !question.show" | ||
211 | - ></i> | ||
212 | - </el-tooltip> | ||
213 | - <span>{{ setBigNum(index) }}、</span> | ||
214 | - <el-input | ||
215 | - class="ipt" | ||
216 | - v-model.trim="question.questionTitle" | ||
217 | - maxlength="30" | ||
218 | - placeholder="填写大题名称" | ||
219 | - ></el-input> | ||
220 | - <el-popconfirm | ||
221 | - title="确定删除这道大题吗?" | ||
222 | - @confirm="form.questionList.splice(index, 1)" | ||
223 | - > | ||
224 | - <el-button | ||
225 | - slot="reference" | ||
226 | - class="delete" | ||
227 | - type="danger" | ||
228 | - size="mini" | ||
229 | - circle | ||
230 | - icon="el-icon-delete" | ||
231 | - ></el-button> | ||
232 | - </el-popconfirm> | ||
233 | - <span class="m20">共:{{ question.subQuestions.length }}题</span> | ||
234 | - <span>共:{{ setScore(question) }}分</span> | ||
235 | - </p> | ||
236 | - <transition name="el-zoom-in-top"> | ||
237 | - <ul v-show="question.show" class="questions-ul"> | ||
238 | - <li class="sub-questions"> | ||
239 | - <div class="qs-num">题号</div> | ||
240 | - <div class="qs-type">题型</div> | ||
241 | - <div class="qs-score">分数</div> | ||
242 | - <div class="qs-partScore">漏选得分</div> | ||
243 | - <div class="qs-options">选项设置</div> | ||
244 | - <div class="qs-set">操作</div> | ||
245 | - </li> | ||
246 | - <li | ||
247 | - class="sub-questions" | ||
248 | - v-for="(subQuestions, indexs) in question.subQuestions" | ||
249 | - :key="indexs" | ||
250 | - > | ||
251 | - <div class="qs-num">{{ setNum(index, indexs) }}</div> | ||
252 | - <div class="qs-type"> | ||
253 | - <el-select | ||
254 | - v-model="subQuestions.questionType" | ||
255 | - placeholder="选择题目类型" | ||
256 | - @change="changeSubQuestions($event, subQuestions)" | ||
257 | - > | ||
258 | - <el-option label="单选题" :value="2"></el-option> | ||
259 | - <el-option label="多选题" :value="3"></el-option> | ||
260 | - <el-option label="判断题" :value="4"></el-option> | ||
261 | - <el-option label="主观题" :value="5"></el-option> | ||
262 | - </el-select> | ||
263 | - </div> | ||
264 | - <div class="qs-score"> | ||
265 | - <el-input-number | ||
266 | - class="number-ipt" | ||
267 | - size="medium" | ||
268 | - :min="1" | ||
269 | - :max="200" | ||
270 | - :precision="2" | ||
271 | - :step="1" | ||
272 | - v-model="subQuestions.score" | ||
273 | - label="单题分值" | ||
274 | - ></el-input-number> | ||
275 | - </div> | ||
276 | - <div class="qs-partScore"> | ||
277 | - <p v-if="subQuestions.questionType != 3">--</p> | ||
278 | - <el-input-number | ||
279 | - class="number-ipt" | ||
280 | - v-else | ||
281 | - size="medium" | ||
282 | - :min="0" | ||
283 | - :precision="2" | ||
284 | - :max="subQuestions.score" | ||
285 | - :step="0.5" | ||
286 | - v-model="subQuestions.partScore" | ||
287 | - label="漏选得分" | ||
288 | - ></el-input-number> | ||
289 | - </div> | ||
290 | - <div class="qs-options"> | ||
291 | - <p v-if="subQuestions.questionType == 5">--</p> | ||
292 | - <p v-if="subQuestions.questionType == 4" class="answer-box"> | ||
293 | - <span | ||
294 | - class="answer-s" | ||
295 | - :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
296 | - @click="subQuestions.correctAnswer = 1" | ||
297 | - >✓</span | ||
298 | - > | ||
299 | - <span | ||
300 | - class="answer-s" | ||
301 | - :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
302 | - @click="subQuestions.correctAnswer = 2" | ||
303 | - >✗</span | ||
304 | - > | ||
305 | - </p> | ||
306 | - <p v-if="subQuestions.questionType == 3" class="answer-box"> | ||
307 | - <span | ||
308 | - class="answer-s" | ||
309 | - v-for="option in subQuestions.answerOptions.split(',')" | ||
310 | - :class=" | ||
311 | - subQuestions.correctAnswer?.includes(option) | ||
312 | - ? 'active' | ||
313 | - : '' | ||
314 | - " | ||
315 | - :key="option" | ||
316 | - @click="changAnswer(subQuestions, option)" | ||
317 | - >{{ option }}</span | ||
318 | - > | ||
319 | - </p> | ||
320 | - <p v-if="subQuestions.questionType == 2" class="answer-box"> | ||
321 | - <span | ||
322 | - class="answer-s" | ||
323 | - v-for="option in subQuestions.answerOptions.split(',')" | ||
324 | - :class=" | ||
325 | - subQuestions.correctAnswer == option ? 'active' : '' | ||
326 | - " | ||
327 | - :key="option" | ||
328 | - @click="subQuestions.correctAnswer = option" | ||
329 | - >{{ option }}</span | ||
330 | - > | ||
331 | - </p> | ||
332 | - <p | ||
333 | - v-if=" | ||
334 | - subQuestions.questionType == 3 || | 97 | + <template v-if="!isUpload"> |
98 | + <div v-show="step == 1"> | ||
99 | + <div class="question-box" v-for="(question, index) in form.questionList" :key="index"> | ||
100 | + <p class="question-title"> | ||
101 | + <el-tooltip effect="dark" :content="question.show ? '收起' : '展开'" placement="left"> | ||
102 | + <i class="el-icon-caret-right" :class="question.show ? 'active' : ''" | ||
103 | + @click="question.show = !question.show"></i> | ||
104 | + </el-tooltip> | ||
105 | + <span>{{ setBigNum(index) }}、</span> | ||
106 | + <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30" placeholder="填写大题名称"></el-input> | ||
107 | + <el-popconfirm title="确定删除这道大题吗?" @confirm="form.questionList.splice(index, 1)"> | ||
108 | + <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
109 | + icon="el-icon-delete"></el-button> | ||
110 | + </el-popconfirm> | ||
111 | + <span class="m20">共:{{ question.subQuestions?.length }}题</span> | ||
112 | + <span>共:{{ setScore(question) }}分</span> | ||
113 | + </p> | ||
114 | + <transition name="el-zoom-in-top"> | ||
115 | + <ul v-show="question.show" class="questions-ul"> | ||
116 | + <li class="sub-questions"> | ||
117 | + <div class="qs-num">题号</div> | ||
118 | + <div class="qs-type">题型</div> | ||
119 | + <div class="qs-score">分数</div> | ||
120 | + <div class="qs-partScore">漏选得分</div> | ||
121 | + <div class="qs-options">选项设置</div> | ||
122 | + <div class="qs-set">操作</div> | ||
123 | + </li> | ||
124 | + <li class="sub-questions" v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> | ||
125 | + <div class="qs-num">{{ setNum(index, indexs) }}</div> | ||
126 | + <div class="qs-type"> | ||
127 | + <el-select v-model="subQuestions.questionType" placeholder="选择题目类型" | ||
128 | + @change="changeSubQuestions($event, subQuestions)"> | ||
129 | + <el-option label="单选题" :value="2"></el-option> | ||
130 | + <el-option label="多选题" :value="3"></el-option> | ||
131 | + <el-option label="判断题" :value="4"></el-option> | ||
132 | + <el-option label="主观题" :value="5"></el-option> | ||
133 | + </el-select> | ||
134 | + </div> | ||
135 | + <div class="qs-score"> | ||
136 | + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1" | ||
137 | + v-model="subQuestions.score" label="单题分值"></el-input-number> | ||
138 | + </div> | ||
139 | + <div class="qs-partScore"> | ||
140 | + <p v-if="subQuestions.questionType != 3">--</p> | ||
141 | + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | ||
142 | + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" | ||
143 | + label="漏选得分"></el-input-number> | ||
144 | + </div> | ||
145 | + <div class="qs-options"> | ||
146 | + <p v-if="subQuestions.questionType == 5">--</p> | ||
147 | + <p v-if="subQuestions.questionType == 4" class="answer-box"> | ||
148 | + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
149 | + @click="subQuestions.correctAnswer = 1">✓</span> | ||
150 | + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
151 | + @click="subQuestions.correctAnswer = 2">✗</span> | ||
152 | + </p> | ||
153 | + <p v-if="subQuestions.questionType == 3" class="answer-box"> | ||
154 | + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) | ||
155 | + ? 'active' | ||
156 | + : '' | ||
157 | + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | ||
158 | + </p> | ||
159 | + <p v-if="subQuestions.questionType == 2" class="answer-box"> | ||
160 | + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
161 | + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | ||
162 | + </p> | ||
163 | + <p v-if="subQuestions.questionType == 3 || | ||
335 | subQuestions.questionType == 2 | 164 | subQuestions.questionType == 2 |
336 | - " | ||
337 | - class="answer-box answer-box2" | ||
338 | - > | ||
339 | - <el-button | ||
340 | - size="mini" | ||
341 | - type="primary" | ||
342 | - icon="el-icon-plus" | ||
343 | - circle | ||
344 | - @click="addOptions(subQuestions)" | ||
345 | - ></el-button> | ||
346 | - <el-button | ||
347 | - size="mini" | ||
348 | - type="primary" | ||
349 | - icon="el-icon-minus" | ||
350 | - round | ||
351 | - circle | ||
352 | - @click="removeOptions(subQuestions)" | ||
353 | - ></el-button> | ||
354 | - </p> | ||
355 | - </div> | ||
356 | - <div class="qs-set"> | ||
357 | - <el-popconfirm | ||
358 | - title="确定删除这道题吗?" | ||
359 | - @confirm="delTabData(indexs, index)" | ||
360 | - > | ||
361 | - <el-button | ||
362 | - slot="reference" | ||
363 | - class="delete" | ||
364 | - type="danger" | ||
365 | - size="mini" | ||
366 | - circle | ||
367 | - icon="el-icon-delete" | ||
368 | - ></el-button> | ||
369 | - </el-popconfirm> | ||
370 | - </div> | ||
371 | - </li> | ||
372 | - <li class="sub-questions"> | ||
373 | - <div class="qs-num">添加</div> | ||
374 | - <div class="qs-type"> | ||
375 | - <el-select | ||
376 | - v-model="addSubQuestionsType" | ||
377 | - placeholder="选择题目类型" | ||
378 | - @change="changeAddSubQuestions($event, question)" | ||
379 | - > | ||
380 | - <el-option label="单选题" :value="2"></el-option> | ||
381 | - <el-option label="多选题" :value="3"></el-option> | ||
382 | - <el-option label="判断题" :value="4"></el-option> | ||
383 | - <el-option label="主观题" :value="5"></el-option> | 165 | + " class="answer-box answer-box2"> |
166 | + <el-button size="mini" type="primary" icon="el-icon-plus" circle | ||
167 | + @click="addOptions(subQuestions)"></el-button> | ||
168 | + <el-button size="mini" type="primary" icon="el-icon-minus" round circle | ||
169 | + @click="removeOptions(subQuestions)"></el-button> | ||
170 | + </p> | ||
171 | + </div> | ||
172 | + <div class="qs-set"> | ||
173 | + <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)"> | ||
174 | + <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
175 | + icon="el-icon-delete"></el-button> | ||
176 | + </el-popconfirm> | ||
177 | + </div> | ||
178 | + </li> | ||
179 | + <li class="sub-questions"> | ||
180 | + <div class="qs-num">添加</div> | ||
181 | + <div class="qs-type"> | ||
182 | + <el-select v-model="addSubQuestionsType" placeholder="选择题目类型" | ||
183 | + @change="changeAddSubQuestions($event, question)"> | ||
184 | + <el-option label="单选题" :value="2"></el-option> | ||
185 | + <el-option label="多选题" :value="3"></el-option> | ||
186 | + <el-option label="判断题" :value="4"></el-option> | ||
187 | + <el-option label="主观题" :value="5"></el-option> | ||
188 | + </el-select> | ||
189 | + </div> | ||
190 | + <div class="qs-score"></div> | ||
191 | + <div class="qs-partScore"></div> | ||
192 | + <div class="qs-options"></div> | ||
193 | + <div class="qs-set"></div> | ||
194 | + </li> | ||
195 | + </ul> | ||
196 | + </transition> | ||
197 | + </div> | ||
198 | + <div class="add-box"> | ||
199 | + <p class="add-question" @click="openQuestion"> | ||
200 | + <el-button size="mini" type="primary" icon="el-icon-plus" circle></el-button> | ||
201 | + <span class="s1">添加大题</span> | ||
202 | + </p> | ||
203 | + </div> | ||
204 | + <div class="btn-box"> | ||
205 | + <el-button type="danger" plain round @click="linkBack">取消</el-button> | ||
206 | + <el-button round @click="step = 0">上一步</el-button> | ||
207 | + <el-button :type="form.questionList.length == 0 ? 'info' : 'primary'" round @click="setStep2">下一步</el-button> | ||
208 | + </div> | ||
209 | + <el-dialog :close-on-click-modal="false" title="添加大题" :visible.sync="addQuestionVisible" width="600px"> | ||
210 | + <div class="dia-content"> | ||
211 | + <el-form ref="form" :model="questionForm" :rules="questionFormRules" label-width="100px"> | ||
212 | + <el-form-item label="标题:"> | ||
213 | + <el-col :span="20"> | ||
214 | + <el-input v-model.trim="questionForm.questionTitle" maxlength="30" placeholder="输入大题名称"></el-input> | ||
215 | + </el-col> | ||
216 | + </el-form-item> | ||
217 | + <el-form-item label="选择题型:"> | ||
218 | + <el-select v-model="questionForm.questionType" placeholder="" @change="setQuestionForm"> | ||
219 | + <el-option v-for="item in questionOptions" :key="item.value" :label="item.label" :value="item.value"> | ||
220 | + </el-option> | ||
221 | + <el-option label="混合题" :value="6"> </el-option> | ||
384 | </el-select> | 222 | </el-select> |
385 | - </div> | ||
386 | - <div class="qs-score"></div> | ||
387 | - <div class="qs-partScore"></div> | ||
388 | - <div class="qs-options"></div> | ||
389 | - <div class="qs-set"></div> | ||
390 | - </li> | ||
391 | - </ul> | ||
392 | - </transition> | ||
393 | - </div> | ||
394 | - <div class="add-box"> | ||
395 | - <p class="add-question" @click="openQuestion"> | ||
396 | - <el-button | ||
397 | - size="mini" | ||
398 | - type="primary" | ||
399 | - icon="el-icon-plus" | ||
400 | - circle | ||
401 | - ></el-button> | ||
402 | - <span class="s1">添加大题</span> | ||
403 | - </p> | ||
404 | - </div> | ||
405 | - <div class="btn-box"> | ||
406 | - <el-button type="danger" plain round @click="linkBack" | ||
407 | - >取消</el-button | ||
408 | - > | ||
409 | - <el-button round @click="step = 0">上一步</el-button> | ||
410 | - <el-button | ||
411 | - :type="form.questionList.length == 0 ? 'info' : 'primary'" | ||
412 | - round | ||
413 | - @click="setStep2" | ||
414 | - >下一步</el-button | ||
415 | - > | ||
416 | - </div> | ||
417 | - <el-dialog :close-on-click-modal="false" | ||
418 | - title="添加大题" | ||
419 | - :visible.sync="addQuestionVisible" | ||
420 | - width="600px" | ||
421 | - > | ||
422 | - <div class="dia-content"> | ||
423 | - <el-form | ||
424 | - ref="form" | ||
425 | - :model="questionForm" | ||
426 | - :rules="questionFormRules" | ||
427 | - label-width="100px" | ||
428 | - > | ||
429 | - <el-form-item label="标题:"> | ||
430 | - <el-col :span="20"> | ||
431 | - <el-input | ||
432 | - v-model.trim="questionForm.questionTitle" | ||
433 | - maxlength="30" | ||
434 | - placeholder="输入大题名称" | ||
435 | - ></el-input> | ||
436 | - </el-col> | ||
437 | - </el-form-item> | ||
438 | - <el-form-item label="选择题型:"> | ||
439 | - <el-select | ||
440 | - v-model="questionForm.questionType" | ||
441 | - placeholder="" | ||
442 | - @change="setQuestionForm" | ||
443 | - > | ||
444 | - <el-option | ||
445 | - v-for="item in questionOptions" | ||
446 | - :key="item.value" | ||
447 | - :label="item.label" | ||
448 | - :value="item.value" | ||
449 | - > | ||
450 | - </el-option> | ||
451 | - <el-option label="混合题" :value="6"> </el-option> | ||
452 | - </el-select> | ||
453 | - </el-form-item> | ||
454 | - <el-form-item label="题数:"> | ||
455 | - <el-input-number | ||
456 | - v-model="questionForm.number" | ||
457 | - @change="changeQesNum" | ||
458 | - :min="1" | ||
459 | - :max="100" | ||
460 | - :step-strictly="true" | ||
461 | - :step="1" | ||
462 | - label="label" | ||
463 | - ></el-input-number> | ||
464 | - </el-form-item> | ||
465 | - <el-form-item | ||
466 | - label="选项个数:" | ||
467 | - v-show=" | ||
468 | - questionForm.questionType != 4 && | 223 | + </el-form-item> |
224 | + <el-form-item label="题数:"> | ||
225 | + <el-input-number v-model="questionForm.number" @change="changeQesNum" :min="1" :max="100" | ||
226 | + :step-strictly="true" :step="1" label="label"></el-input-number> | ||
227 | + </el-form-item> | ||
228 | + <el-form-item label="选项个数:" v-show="questionForm.questionType != 4 && | ||
469 | questionForm.questionType != 5 | 229 | questionForm.questionType != 5 |
470 | - " | ||
471 | - > | ||
472 | - <el-input-number | ||
473 | - v-model="questionForm.selectNum" | ||
474 | - :min="3" | ||
475 | - :max="10" | ||
476 | - :step-strictly="true" | ||
477 | - :step="1" | ||
478 | - label="label" | ||
479 | - ></el-input-number> | ||
480 | - </el-form-item> | ||
481 | - <el-form-item label="单题分数:"> | ||
482 | - <el-input-number | ||
483 | - v-model="questionForm.score" | ||
484 | - :min="1" | ||
485 | - :max="200" | ||
486 | - :precision="2" | ||
487 | - :step="1" | ||
488 | - label="label" | ||
489 | - ></el-input-number> | ||
490 | - </el-form-item> | ||
491 | - <el-form-item | ||
492 | - label="漏选得分:" | ||
493 | - v-if="questionForm.questionType == 3" | ||
494 | - > | ||
495 | - <el-input-number | ||
496 | - v-model="questionForm.partScore" | ||
497 | - :min="0" | ||
498 | - :max="questionForm.score" | ||
499 | - :precision="2" | ||
500 | - :step="0.5" | ||
501 | - label="label" | ||
502 | - ></el-input-number> | ||
503 | - </el-form-item> | ||
504 | - <el-form-item | ||
505 | - label="设置答案:" | ||
506 | - v-show=" | ||
507 | - questionForm.questionType != 5 && | 230 | + "> |
231 | + <el-input-number v-model="questionForm.selectNum" :min="3" :max="10" :step-strictly="true" :step="1" | ||
232 | + label="label"></el-input-number> | ||
233 | + </el-form-item> | ||
234 | + <el-form-item label="单题分数:"> | ||
235 | + <el-input-number v-model="questionForm.score" :min="1" :max="200" :precision="2" :step="1" | ||
236 | + label="label"></el-input-number> | ||
237 | + </el-form-item> | ||
238 | + <el-form-item label="漏选得分:" v-if="questionForm.questionType == 3"> | ||
239 | + <el-input-number v-model="questionForm.partScore" :min="0" :max="questionForm.score" :precision="2" | ||
240 | + :step="0.5" label="label"></el-input-number> | ||
241 | + </el-form-item> | ||
242 | + <el-form-item label="设置答案:" v-show="questionForm.questionType != 5 && | ||
508 | questionForm.questionType != 6 | 243 | questionForm.questionType != 6 |
509 | - " | ||
510 | - > | ||
511 | - <div class="qs-options"> | ||
512 | - <p class="ipt"> | ||
513 | - <el-input | ||
514 | - v-if=" | ||
515 | - questionForm.questionType == 2 || | 244 | + "> |
245 | + <div class="qs-options"> | ||
246 | + <p class="ipt"> | ||
247 | + <el-input v-if="questionForm.questionType == 2 || | ||
516 | questionForm.questionType == 3 || | 248 | questionForm.questionType == 3 || |
517 | questionForm.questionType == 6 | 249 | questionForm.questionType == 6 |
518 | - " | ||
519 | - ref="formAnsIpt2" | ||
520 | - v-model="questionForm.answerList" | ||
521 | - @keydown.native=" | ||
522 | - keydownAnswer($event, questionForm.questionType, 1) | ||
523 | - " | ||
524 | - @input=" | ||
525 | - setAllAnswer($event, questionForm.questionType, 1) | ||
526 | - " | ||
527 | - ></el-input> | ||
528 | - <el-input | ||
529 | - v-if="questionForm.questionType == 4" | ||
530 | - v-model="questionForm.answerList" | ||
531 | - readonly="" | ||
532 | - ></el-input> | ||
533 | - </p> | ||
534 | - <p class="answer-box"> | ||
535 | - <template v-if="questionForm.questionType == 4"> | ||
536 | - <span | ||
537 | - class="answer-s active" | ||
538 | - @click=" | 250 | + " ref="formAnsIpt2" v-model="questionForm.answerList" @keydown.native=" |
251 | + keydownAnswer($event, questionForm.questionType, 1) | ||
252 | + " @input=" | ||
253 | + setAllAnswer($event, questionForm.questionType, 1) | ||
254 | + "></el-input> | ||
255 | + <el-input v-if="questionForm.questionType == 4" v-model="questionForm.answerList" | ||
256 | + readonly=""></el-input> | ||
257 | + </p> | ||
258 | + <p class="answer-box"> | ||
259 | + <template v-if="questionForm.questionType == 4"> | ||
260 | + <span class="answer-s active" @click=" | ||
539 | questionForm.answerList.length < questionForm.number | 261 | questionForm.answerList.length < questionForm.number |
540 | ? (questionForm.answerList += '✓') | 262 | ? (questionForm.answerList += '✓') |
541 | : '' | 263 | : '' |
542 | - " | ||
543 | - >✓</span | ||
544 | - > | ||
545 | - <span | ||
546 | - class="answer-s active" | ||
547 | - @click=" | 264 | + ">✓</span> |
265 | + <span class="answer-s active" @click=" | ||
548 | questionForm.answerList.length < questionForm.number | 266 | questionForm.answerList.length < questionForm.number |
549 | ? (questionForm.answerList += '✗') | 267 | ? (questionForm.answerList += '✗') |
550 | : '' | 268 | : '' |
551 | - " | ||
552 | - >✗</span | ||
553 | - > | ||
554 | - </template> | ||
555 | - <template v-if="questionForm.questionType == 3"> | ||
556 | - <template v-for="(option, opIdx) in rightOptions"> | ||
557 | - <span | ||
558 | - v-if="opIdx < questionForm.selectNum" | ||
559 | - class="answer-s active" | ||
560 | - :key="option" | ||
561 | - @click="setMultiple(questionForm, option, 1)" | ||
562 | - >{{ option }}</span | ||
563 | - > | 269 | + ">✗</span> |
270 | + </template> | ||
271 | + <template v-if="questionForm.questionType == 3"> | ||
272 | + <template v-for="(option, opIdx) in rightOptions"> | ||
273 | + <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" | ||
274 | + @click="setMultiple(questionForm, option, 1)">{{ option }}</span> | ||
275 | + </template> | ||
276 | + <span class="answer-s active" @click="setMultiple(questionForm, ',', 1)">,</span> | ||
564 | </template> | 277 | </template> |
565 | - <span | ||
566 | - class="answer-s active" | ||
567 | - @click="setMultiple(questionForm, ',', 1)" | ||
568 | - >,</span | ||
569 | - > | ||
570 | - </template> | ||
571 | - <template | ||
572 | - v-if=" | ||
573 | - questionForm.questionType == 2 || | 278 | + <template v-if="questionForm.questionType == 2 || |
574 | questionForm.questionType == 6 | 279 | questionForm.questionType == 6 |
575 | - " | ||
576 | - > | ||
577 | - <template v-for="(option, opIdx) in rightOptions"> | ||
578 | - <span | ||
579 | - v-if="opIdx < questionForm.selectNum" | ||
580 | - class="answer-s active" | ||
581 | - :key="option" | ||
582 | - @click=" | 280 | + "> |
281 | + <template v-for="(option, opIdx) in rightOptions"> | ||
282 | + <span v-if="opIdx < questionForm.selectNum" class="answer-s active" :key="option" @click=" | ||
583 | questionForm.answerList.length < questionForm.number | 283 | questionForm.answerList.length < questionForm.number |
584 | ? (questionForm.answerList += option) | 284 | ? (questionForm.answerList += option) |
585 | : '' | 285 | : '' |
586 | - " | ||
587 | - >{{ option }}</span | ||
588 | - > | 286 | + ">{{ option }}</span> |
287 | + </template> | ||
589 | </template> | 288 | </template> |
590 | - </template> | ||
591 | - <span | ||
592 | - class="answer-s delButton" | ||
593 | - @click=" | 289 | + <span class="answer-s delButton" @click=" |
594 | questionForm.answerList = questionForm.answerList.slice( | 290 | questionForm.answerList = questionForm.answerList.slice( |
595 | 0, | 291 | 0, |
596 | -1 | 292 | -1 |
597 | ) | 293 | ) |
598 | - " | ||
599 | - >x</span | ||
600 | - > | ||
601 | - <span | ||
602 | - class="answer-s ac" | ||
603 | - @click="questionForm.answerList = ''" | ||
604 | - >ac</span | ||
605 | - > | ||
606 | - </p> | ||
607 | - </div> | ||
608 | - </el-form-item> | ||
609 | - </el-form> | ||
610 | - </div> | ||
611 | - <div class="dialog-footer" slot="footer"> | ||
612 | - <el-button type="primary" @click="addQuestion">确 定</el-button> | ||
613 | - <el-button @click="addQuestionVisible = false">取 消</el-button> | ||
614 | - </div> | ||
615 | - </el-dialog> | ||
616 | - </div> | 294 | + ">x</span> |
295 | + <span class="answer-s ac" @click="questionForm.answerList = ''">ac</span> | ||
296 | + </p> | ||
297 | + </div> | ||
298 | + </el-form-item> | ||
299 | + </el-form> | ||
300 | + </div> | ||
301 | + <div class="dialog-footer" slot="footer"> | ||
302 | + <el-button type="primary" @click="addQuestion">确 定</el-button> | ||
303 | + <el-button @click="addQuestionVisible = false">取 消</el-button> | ||
304 | + </div> | ||
305 | + </el-dialog> | ||
306 | + </div> | ||
307 | + </template> | ||
617 | <div v-show="step == 2"> | 308 | <div v-show="step == 2"> |
618 | <div class="answer-title"> | 309 | <div class="answer-title"> |
619 | <p class="name">{{ form.title }}</p> | 310 | <p class="name">{{ form.title }}</p> |
620 | <p class="totals">卷面总分:{{ allScore }}分</p> | 311 | <p class="totals">卷面总分:{{ allScore }}分</p> |
621 | </div> | 312 | </div> |
622 | - <div | ||
623 | - class="question-box" | ||
624 | - v-for="(question, index) in form.questionList" | ||
625 | - :key="index" | ||
626 | - > | 313 | + <div class="question-box" v-for="(question, index) in form.questionList" :key="index"> |
627 | <p class="question-title"> | 314 | <p class="question-title"> |
628 | <span>{{ setBigNum(index) }}、</span> | 315 | <span>{{ setBigNum(index) }}、</span> |
629 | <span class="title-txt">{{ question.questionTitle }}</span> | 316 | <span class="title-txt">{{ question.questionTitle }}</span> |
@@ -638,21 +325,12 @@ | @@ -638,21 +325,12 @@ | ||
638 | <div class="qs-partScore">漏选得分</div> | 325 | <div class="qs-partScore">漏选得分</div> |
639 | <div class="qs-options qs-options2">选项设置</div> | 326 | <div class="qs-options qs-options2">选项设置</div> |
640 | </li> | 327 | </li> |
641 | - <li | ||
642 | - v-for="(subQuestions, indexs) in question.subQuestions" | ||
643 | - :key="indexs" | ||
644 | - > | ||
645 | - <p | ||
646 | - class="set-ans-btn" | ||
647 | - v-if=" | ||
648 | - subQuestions.qusType && | ||
649 | - subQuestions.subNum && | ||
650 | - subQuestions.subNum > 4 | ||
651 | - " | ||
652 | - > | ||
653 | - <el-button type="primary" @click="setFormAns(indexs, index)" | ||
654 | - >批量设置答案</el-button | ||
655 | - > | 328 | + <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> |
329 | + <p class="set-ans-btn" v-if="subQuestions.qusType && | ||
330 | + subQuestions.subNum && | ||
331 | + subQuestions.subNum > 4 | ||
332 | + "> | ||
333 | + <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button> | ||
656 | </p> | 334 | </p> |
657 | <div v-else class="sub-questions"> | 335 | <div v-else class="sub-questions"> |
658 | <div class="qs-num"> | 336 | <div class="qs-num"> |
@@ -662,158 +340,77 @@ | @@ -662,158 +340,77 @@ | ||
662 | {{ setSubPro(subQuestions.questionType) }} | 340 | {{ setSubPro(subQuestions.questionType) }} |
663 | </div> | 341 | </div> |
664 | <div class="qs-score"> | 342 | <div class="qs-score"> |
665 | - <el-input-number | ||
666 | - class="number-ipt" | ||
667 | - size="medium" | ||
668 | - :min="1" | ||
669 | - :max="200" | ||
670 | - :precision="2" | ||
671 | - v-model="subQuestions.score" | ||
672 | - label="单题分值" | ||
673 | - ></el-input-number> | 343 | + <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" |
344 | + v-model="subQuestions.score" label="单题分值"></el-input-number> | ||
674 | </div> | 345 | </div> |
675 | <div class="qs-partScore"> | 346 | <div class="qs-partScore"> |
676 | <p v-if="subQuestions.questionType != 3">--</p> | 347 | <p v-if="subQuestions.questionType != 3">--</p> |
677 | - <el-input-number | ||
678 | - class="number-ipt" | ||
679 | - v-else | ||
680 | - size="medium" | ||
681 | - :min="0" | ||
682 | - :precision="2" | ||
683 | - :max="subQuestions.score" | ||
684 | - :step="0.5" | ||
685 | - v-model="subQuestions.partScore" | ||
686 | - label="漏选得分" | ||
687 | - ></el-input-number> | 348 | + <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" |
349 | + :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number> | ||
688 | </div> | 350 | </div> |
689 | <div class="qs-options qs-options2"> | 351 | <div class="qs-options qs-options2"> |
690 | <p v-if="subQuestions.questionType == 5">--</p> | 352 | <p v-if="subQuestions.questionType == 5">--</p> |
691 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 353 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
692 | - <span | ||
693 | - class="answer-s" | ||
694 | - :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
695 | - @click="subQuestions.correctAnswer = 1" | ||
696 | - >✓</span | ||
697 | - > | ||
698 | - <span | ||
699 | - class="answer-s" | ||
700 | - :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
701 | - @click="subQuestions.correctAnswer = 2" | ||
702 | - >✗</span | ||
703 | - > | 354 | + <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" |
355 | + @click="subQuestions.correctAnswer = 1">✓</span> | ||
356 | + <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
357 | + @click="subQuestions.correctAnswer = 2">✗</span> | ||
704 | </p> | 358 | </p> |
705 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 359 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
706 | - <span | ||
707 | - class="answer-s" | ||
708 | - v-for="option in subQuestions.answerOptions.split(',')" | ||
709 | - :class=" | ||
710 | - subQuestions.correctAnswer?.includes(option) | ||
711 | - ? 'active' | ||
712 | - : '' | ||
713 | - " | ||
714 | - :key="option" | ||
715 | - @click="changAnswer(subQuestions, option)" | ||
716 | - >{{ option }}</span | ||
717 | - > | 360 | + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) |
361 | + ? 'active' | ||
362 | + : '' | ||
363 | + " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | ||
718 | </p> | 364 | </p> |
719 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 365 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
720 | - <span | ||
721 | - class="answer-s" | ||
722 | - v-for="option in subQuestions.answerOptions.split(',')" | ||
723 | - :class=" | ||
724 | - subQuestions.correctAnswer == option ? 'active' : '' | ||
725 | - " | ||
726 | - :key="option" | ||
727 | - @click="subQuestions.correctAnswer = option" | ||
728 | - >{{ option }}</span | ||
729 | - > | 366 | + <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' |
367 | + " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | ||
730 | </p> | 368 | </p> |
731 | </div> | 369 | </div> |
732 | </div> | 370 | </div> |
733 | </li> | 371 | </li> |
734 | </ul> | 372 | </ul> |
735 | </div> | 373 | </div> |
736 | - <el-dialog :close-on-click-modal="false" | ||
737 | - title="批量设置答案" | ||
738 | - :visible.sync="diaSetAns" | ||
739 | - width="400" | ||
740 | - :modal-append-to-body="false" | ||
741 | - > | 374 | + <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400" |
375 | + :modal-append-to-body="false"> | ||
742 | <div class="qs-options"> | 376 | <div class="qs-options"> |
743 | <p class="dia-tips"> | 377 | <p class="dia-tips"> |
744 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” | 378 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
745 | </p> | 379 | </p> |
746 | <p>{{ setSubPro(formAns.qusType) }}:</p> | 380 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
747 | <p class="ipt"> | 381 | <p class="ipt"> |
748 | - <el-input | ||
749 | - v-if="formAns.qusType == 2 || formAns.qusType == 3" | ||
750 | - ref="formAnsIpt" | ||
751 | - v-model="formAns.answerList" | 382 | + <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt" v-model="formAns.answerList" |
752 | @keydown.native="keydownAnswer($event, formAns.qusType)" | 383 | @keydown.native="keydownAnswer($event, formAns.qusType)" |
753 | - @input="setAllAnswer($event, formAns.qusType)" | ||
754 | - ></el-input> | ||
755 | - <el-input | ||
756 | - v-if="formAns.qusType == 4" | ||
757 | - v-model="formAns.answerList" | ||
758 | - readonly="" | ||
759 | - ></el-input> | 384 | + @input="setAllAnswer($event, formAns.qusType)"></el-input> |
385 | + <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input> | ||
760 | </p> | 386 | </p> |
761 | <p class="answer-box"> | 387 | <p class="answer-box"> |
762 | <template v-if="formAns.qusType == 4"> | 388 | <template v-if="formAns.qusType == 4"> |
763 | - <span | ||
764 | - class="answer-s active" | ||
765 | - @click=" | ||
766 | - formAns.answerList.length < formAns.subNum | ||
767 | - ? (formAns.answerList += '✓') | ||
768 | - : '' | ||
769 | - " | ||
770 | - >✓</span | ||
771 | - > | ||
772 | - <span | ||
773 | - class="answer-s active" | ||
774 | - @click=" | ||
775 | - formAns.answerList.length < formAns.subNum | ||
776 | - ? (formAns.answerList += '✗') | ||
777 | - : '' | ||
778 | - " | ||
779 | - >✗</span | ||
780 | - > | 389 | + <span class="answer-s active" @click=" |
390 | + formAns.answerList.length < formAns.subNum | ||
391 | + ? (formAns.answerList += '✓') | ||
392 | + : '' | ||
393 | + ">✓</span> | ||
394 | + <span class="answer-s active" @click=" | ||
395 | + formAns.answerList.length < formAns.subNum | ||
396 | + ? (formAns.answerList += '✗') | ||
397 | + : '' | ||
398 | + ">✗</span> | ||
781 | </template> | 399 | </template> |
782 | <template v-if="formAns.qusType == 3"> | 400 | <template v-if="formAns.qusType == 3"> |
783 | - <span | ||
784 | - class="answer-s active" | ||
785 | - v-for="option in formAns.answerOptions.split(',')" | ||
786 | - :key="option" | ||
787 | - @click="setMultiple(formAns, option, 2)" | ||
788 | - >{{ option }}</span | ||
789 | - > | ||
790 | - <span | ||
791 | - class="answer-s active" | ||
792 | - @click="setMultiple(formAns, ',', 2)" | ||
793 | - >,</span | ||
794 | - > | 401 | + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" |
402 | + @click="setMultiple(formAns, option, 2)">{{ option }}</span> | ||
403 | + <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span> | ||
795 | </template> | 404 | </template> |
796 | <template v-if="formAns.qusType == 2"> | 405 | <template v-if="formAns.qusType == 2"> |
797 | - <span | ||
798 | - class="answer-s active" | ||
799 | - v-for="option in formAns.answerOptions.split(',')" | ||
800 | - :key="option" | ||
801 | - @click=" | ||
802 | - formAns.answerList.length < formAns.subNum | ||
803 | - ? (formAns.answerList += option) | ||
804 | - : '' | ||
805 | - " | ||
806 | - >{{ option }}</span | ||
807 | - > | 406 | + <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click=" |
407 | + formAns.answerList.length < formAns.subNum | ||
408 | + ? (formAns.answerList += option) | ||
409 | + : '' | ||
410 | + ">{{ option }}</span> | ||
808 | </template> | 411 | </template> |
809 | - <span | ||
810 | - class="answer-s delButton" | ||
811 | - @click="formAns.answerList = formAns.answerList.slice(0, -1)" | ||
812 | - >x</span | ||
813 | - > | ||
814 | - <span class="answer-s ac" @click="formAns.answerList = ''" | ||
815 | - >ac</span | ||
816 | - > | 412 | + <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> |
413 | + <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> | ||
817 | </p> | 414 | </p> |
818 | </div> | 415 | </div> |
819 | <div class="dialog-footer" slot="footer"> | 416 | <div class="dialog-footer" slot="footer"> |
@@ -822,13 +419,25 @@ | @@ -822,13 +419,25 @@ | ||
822 | </div> | 419 | </div> |
823 | </el-dialog> | 420 | </el-dialog> |
824 | <div class="btn-box"> | 421 | <div class="btn-box"> |
825 | - <el-button type="danger" plain round @click="linkBack" | ||
826 | - >取消</el-button | ||
827 | - > | 422 | + <el-button type="danger" plain round @click="linkBack">取消</el-button> |
828 | <el-button round @click="backStep1">上一步</el-button> | 423 | <el-button round @click="backStep1">上一步</el-button> |
829 | <el-button type="primary" round @click="save">保存</el-button> | 424 | <el-button type="primary" round @click="save">保存</el-button> |
830 | </div> | 425 | </div> |
831 | </div> | 426 | </div> |
427 | + <el-dialog :close-on-click-modal="false" title="上传题干" :visible.sync="dialogStem" v-if="dialogStem" width="500"> | ||
428 | + <div class="upload-box"> | ||
429 | + <img v-if="stem.screenshot" :src="stem.screenshot" class="stem-pic" /> | ||
430 | + <el-upload class="upload-demo" action="http://121.40.127.171/file/uploadImg" :limit="1" :on-success="upSuccess" | ||
431 | + :on-error="upError" accept="image/*"> | ||
432 | + <el-button size="small" type="primary">{{ | ||
433 | + stem.screenshot ? "重新上传" : "选择照片" | ||
434 | + }}</el-button> | ||
435 | + </el-upload> | ||
436 | + </div> | ||
437 | + <div slot="footer"> | ||
438 | + <el-button @click="dialogStem = false">关闭弹窗</el-button> | ||
439 | + </div> | ||
440 | + </el-dialog> | ||
832 | </div> | 441 | </div> |
833 | </div> | 442 | </div> |
834 | </template> | 443 | </template> |
@@ -857,7 +466,7 @@ export default { | @@ -857,7 +466,7 @@ export default { | ||
857 | allScore: function () { | 466 | allScore: function () { |
858 | let score = 0; | 467 | let score = 0; |
859 | this.form.questionList.map((item) => { | 468 | this.form.questionList.map((item) => { |
860 | - score += item.subQuestions.reduce((a, b) => { | 469 | + score += item.subQuestions?.reduce((a, b) => { |
861 | return a + Number(b.score ? b.score : 0); | 470 | return a + Number(b.score ? b.score : 0); |
862 | }, 0); | 471 | }, 0); |
863 | }, 0); | 472 | }, 0); |
@@ -941,6 +550,15 @@ export default { | @@ -941,6 +550,15 @@ export default { | ||
941 | ], | 550 | ], |
942 | rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"], | 551 | rightOptions: ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"], |
943 | addSubQuestionsType: "", | 552 | addSubQuestionsType: "", |
553 | + | ||
554 | + //v1.5 | ||
555 | + isUpload: false, | ||
556 | + dialogStem: false, //截图开关 | ||
557 | + stem: { | ||
558 | + index: 0, //大题位置 | ||
559 | + indexs: 0, //小题位置 | ||
560 | + screenshot: "", //题干图片地址 | ||
561 | + }, | ||
944 | }; | 562 | }; |
945 | }, | 563 | }, |
946 | async created() { | 564 | async created() { |
@@ -954,6 +572,13 @@ export default { | @@ -954,6 +572,13 @@ export default { | ||
954 | ]; | 572 | ]; |
955 | await this._GradeList(); | 573 | await this._GradeList(); |
956 | } | 574 | } |
575 | + this.isUpload = this.$route.query.isUpload || false | ||
576 | + if (this.isUpload) { | ||
577 | + let params = this.$route.query.params && JSON.parse(this.$route.query.params) || null | ||
578 | + this.form.title = params?.name | ||
579 | + this.form.id = params?.id | ||
580 | + this.formatData(params) | ||
581 | + } | ||
957 | await this._QuerySubjectList(this.gradeList[0]); | 582 | await this._QuerySubjectList(this.gradeList[0]); |
958 | await this._TypeList(); | 583 | await this._TypeList(); |
959 | if (this.type == 2) { | 584 | if (this.type == 2) { |
@@ -961,11 +586,41 @@ export default { | @@ -961,11 +586,41 @@ export default { | ||
961 | } | 586 | } |
962 | }, | 587 | }, |
963 | methods: { | 588 | methods: { |
964 | - | 589 | + |
590 | + // v1.5 | ||
591 | + //上传截图 | ||
592 | + openStem(obj, index, indexs) { | ||
593 | + this.stem.index = index; | ||
594 | + this.stem.indexs = indexs; | ||
595 | + if (type == 1) { | ||
596 | + this.stem.screenshot = obj.screenshot || ""; | ||
597 | + } else { | ||
598 | + this.stem.screenshot = ""; | ||
599 | + } | ||
600 | + this.dialogStem = true; | ||
601 | + }, | ||
602 | + //图片上传成功 | ||
603 | + upSuccess(res, file) { | ||
604 | + if (res && res.status == 0) { | ||
605 | + this.stem.screenshot = res.data.url; | ||
606 | + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs][ | ||
607 | + keys | ||
608 | + ] = this.stem.screenshot; | ||
609 | + this.$message.success("上传成功"); | ||
610 | + } else { | ||
611 | + this.$message.error(res.info); | ||
612 | + } | ||
613 | + }, | ||
614 | + | ||
615 | + upError(res) { | ||
616 | + this.$message.error("上传失败"); | ||
617 | + }, | ||
618 | + //end | ||
619 | + | ||
965 | linkBack() { | 620 | linkBack() { |
966 | this.$confirm( | 621 | this.$confirm( |
967 | (this.type == 2 ? "修改复制的" : "组建的") + | 622 | (this.type == 2 ? "修改复制的" : "组建的") + |
968 | - "答题卡未保存,确认退出吗?", | 623 | + "答题卡未保存,确认退出吗?", |
969 | "提示", | 624 | "提示", |
970 | { | 625 | { |
971 | confirmButtonText: "取消", | 626 | confirmButtonText: "取消", |
@@ -978,7 +633,7 @@ export default { | @@ -978,7 +633,7 @@ export default { | ||
978 | type: "warning", | 633 | type: "warning", |
979 | } | 634 | } |
980 | ) | 635 | ) |
981 | - .then(() => {}) | 636 | + .then(() => { }) |
982 | .catch(() => { | 637 | .catch(() => { |
983 | this.$router.push({ | 638 | this.$router.push({ |
984 | path: "/examinationPaper", | 639 | path: "/examinationPaper", |
@@ -1022,9 +677,9 @@ export default { | @@ -1022,9 +677,9 @@ export default { | ||
1022 | }, | 677 | }, |
1023 | setNums(ques) { | 678 | setNums(ques) { |
1024 | let lengths = 0; | 679 | let lengths = 0; |
1025 | - let subArr = ques.filter((item) => { | 680 | + let subArr = ques?.filter((item) => { |
1026 | return !!item.questionType; | 681 | return !!item.questionType; |
1027 | - }); | 682 | + }) || []; |
1028 | lengths = subArr.length; | 683 | lengths = subArr.length; |
1029 | return lengths; | 684 | return lengths; |
1030 | }, | 685 | }, |
@@ -1169,8 +824,8 @@ export default { | @@ -1169,8 +824,8 @@ export default { | ||
1169 | this.formAns.answerList[subNum - i] == "✓" | 824 | this.formAns.answerList[subNum - i] == "✓" |
1170 | ? 1 | 825 | ? 1 |
1171 | : this.formAns.answerList[subNum - i] == "✗" | 826 | : this.formAns.answerList[subNum - i] == "✗" |
1172 | - ? 2 | ||
1173 | - : ""; | 827 | + ? 2 |
828 | + : ""; | ||
1174 | } | 829 | } |
1175 | this.form.questionList[this.formAns.listIndex].subQuestions[ | 830 | this.form.questionList[this.formAns.listIndex].subQuestions[ |
1176 | EndIndex - i | 831 | EndIndex - i |
@@ -1244,7 +899,7 @@ export default { | @@ -1244,7 +899,7 @@ export default { | ||
1244 | }, | 899 | }, |
1245 | backStep1() { | 900 | backStep1() { |
1246 | this.formatQuestionList(); | 901 | this.formatQuestionList(); |
1247 | - this.step = 1; | 902 | + this.step = this.isUpload ? 0 : 1 |
1248 | }, | 903 | }, |
1249 | setStep1() { | 904 | setStep1() { |
1250 | if (this.subjectList.length == 0) { | 905 | if (this.subjectList.length == 0) { |
@@ -1269,7 +924,7 @@ export default { | @@ -1269,7 +924,7 @@ export default { | ||
1269 | //添加题目ID、序号 | 924 | //添加题目ID、序号 |
1270 | this.form.questionList.map((item, index) => { | 925 | this.form.questionList.map((item, index) => { |
1271 | item.questionType = 0; | 926 | item.questionType = 0; |
1272 | - item.subQuestions.map((items, indexs) => { | 927 | + item.subQuestions?.map((items, indexs) => { |
1273 | items.questionId = this.setNum(index, indexs); | 928 | items.questionId = this.setNum(index, indexs); |
1274 | items.questionIndex = this.setNum(index, indexs); | 929 | items.questionIndex = this.setNum(index, indexs); |
1275 | }); | 930 | }); |
@@ -1278,7 +933,7 @@ export default { | @@ -1278,7 +933,7 @@ export default { | ||
1278 | this.form.questionList?.map((item) => { | 933 | this.form.questionList?.map((item) => { |
1279 | let types = [{}]; | 934 | let types = [{}]; |
1280 | let addndex = 0; | 935 | let addndex = 0; |
1281 | - item.subQuestions.map((sub, index) => { | 936 | + item.subQuestions?.map((sub, index) => { |
1282 | if (!!sub.questionType) { | 937 | if (!!sub.questionType) { |
1283 | if ( | 938 | if ( |
1284 | sub.questionType == types[addndex].qusType && | 939 | sub.questionType == types[addndex].qusType && |
@@ -1323,7 +978,7 @@ export default { | @@ -1323,7 +978,7 @@ export default { | ||
1323 | }); | 978 | }); |
1324 | for (let i = 0; i < types.length; i++) { | 979 | for (let i = 0; i < types.length; i++) { |
1325 | if (types[i].subNum >= 5) { | 980 | if (types[i].subNum >= 5) { |
1326 | - item.subQuestions.splice( | 981 | + item.subQuestions?.splice( |
1327 | types[i].index + i + 1, | 982 | types[i].index + i + 1, |
1328 | 0, | 983 | 0, |
1329 | deepClone(types[i]) | 984 | deepClone(types[i]) |
@@ -1339,11 +994,11 @@ export default { | @@ -1339,11 +994,11 @@ export default { | ||
1339 | for (let i = 0; i < this.form.questionList.length; i++) { | 994 | for (let i = 0; i < this.form.questionList.length; i++) { |
1340 | for ( | 995 | for ( |
1341 | let j = 0; | 996 | let j = 0; |
1342 | - j < this.form.questionList[i].subQuestions.length; | 997 | + j < this.form.questionList[i].subQuestions?.length; |
1343 | j++ | 998 | j++ |
1344 | ) { | 999 | ) { |
1345 | - if (this.form.questionList[i].subQuestions[j].qusType) { | ||
1346 | - this.form.questionList[i].subQuestions.splice(j, 1); | 1000 | + if (this.form.questionList[i].subQuestions[j]?.qusType) { |
1001 | + this.form.questionList[i].subQuestions?.splice(j, 1); | ||
1347 | } | 1002 | } |
1348 | } | 1003 | } |
1349 | } | 1004 | } |
@@ -1391,8 +1046,8 @@ export default { | @@ -1391,8 +1046,8 @@ export default { | ||
1391 | this.questionForm.answerList[i] == "✓" | 1046 | this.questionForm.answerList[i] == "✓" |
1392 | ? 1 | 1047 | ? 1 |
1393 | : this.questionForm.answerList[i] == "✗" | 1048 | : this.questionForm.answerList[i] == "✗" |
1394 | - ? 2 | ||
1395 | - : ""; | 1049 | + ? 2 |
1050 | + : ""; | ||
1396 | } else if (questionsOptions.questionType == 3) { | 1051 | } else if (questionsOptions.questionType == 3) { |
1397 | answer = this.questionForm.answerList.split(",")[i] || ""; | 1052 | answer = this.questionForm.answerList.split(",")[i] || ""; |
1398 | } else if (questionsOptions.questionType == 2) { | 1053 | } else if (questionsOptions.questionType == 2) { |
@@ -1415,7 +1070,7 @@ export default { | @@ -1415,7 +1070,7 @@ export default { | ||
1415 | this.form.questionList[index].subQuestions.splice(subIndex, 1); | 1070 | this.form.questionList[index].subQuestions.splice(subIndex, 1); |
1416 | }, | 1071 | }, |
1417 | setScore(question) { | 1072 | setScore(question) { |
1418 | - let score = question.subQuestions.reduce((a, b) => { | 1073 | + let score = question.subQuestions?.reduce((a, b) => { |
1419 | return a + (b.score ? b.score : 0); | 1074 | return a + (b.score ? b.score : 0); |
1420 | }, 0); | 1075 | }, 0); |
1421 | return Number(score).toFixed(2); | 1076 | return Number(score).toFixed(2); |
@@ -1446,7 +1101,7 @@ export default { | @@ -1446,7 +1101,7 @@ export default { | ||
1446 | questionsOptions.selectNum = 0; | 1101 | questionsOptions.selectNum = 0; |
1447 | break; | 1102 | break; |
1448 | } | 1103 | } |
1449 | - question.subQuestions.push(questionsOptions); | 1104 | + question.subQuestions ? question.subQuestions.push(questionsOptions) : question.subQuestions = [(questionsOptions)]; |
1450 | this.addSubQuestionsType = ""; | 1105 | this.addSubQuestionsType = ""; |
1451 | } | 1106 | } |
1452 | }, | 1107 | }, |
@@ -1600,15 +1255,6 @@ export default { | @@ -1600,15 +1255,6 @@ export default { | ||
1600 | let formDatas = deepClone(this.form); | 1255 | let formDatas = deepClone(this.form); |
1601 | for (let i = 0; i < formDatas.questionList.length; i++) { | 1256 | for (let i = 0; i < formDatas.questionList.length; i++) { |
1602 | delete formDatas.questionList[i].show; | 1257 | delete formDatas.questionList[i].show; |
1603 | - for (let j = 0; j < formDatas.questionList[i].subQuestions; j++) { | ||
1604 | - if (!!formDatas.questionList[i].subQuestions[j].answerScreenshotSrc) { | ||
1605 | - delete formDatas.questionList[i].subQuestions[j] | ||
1606 | - .answerScreenshotSrc; | ||
1607 | - } | ||
1608 | - if (!!formDatas.questionList[i].subQuestions[j].screenshotSrc) { | ||
1609 | - delete formDatas.questionList[i].subQuestions[j].screenshotSrc; | ||
1610 | - } | ||
1611 | - } | ||
1612 | } | 1258 | } |
1613 | let addPaper = | 1259 | let addPaper = |
1614 | this.role == "ROLE_PERSONAL" | 1260 | this.role == "ROLE_PERSONAL" |
@@ -1668,7 +1314,7 @@ export default { | @@ -1668,7 +1314,7 @@ export default { | ||
1668 | }, | 1314 | }, |
1669 | async _QuerySubjectList(grade) { | 1315 | async _QuerySubjectList(grade) { |
1670 | //查询科目列表 | 1316 | //查询科目列表 |
1671 | - if (!grade) { | 1317 | + if (!grade && this.role != "ROLE_PERSONAL") { |
1672 | return; | 1318 | return; |
1673 | } | 1319 | } |
1674 | let query = {}; | 1320 | let query = {}; |
@@ -1707,56 +1353,56 @@ export default { | @@ -1707,56 +1353,56 @@ export default { | ||
1707 | if (status == 0) { | 1353 | if (status == 0) { |
1708 | this.form.title = data.title + "_副本"; | 1354 | this.form.title = data.title + "_副本"; |
1709 | this.form.tagId = data.tagId === 0 ? "" : data.tagId; | 1355 | this.form.tagId = data.tagId === 0 ? "" : data.tagId; |
1710 | - if (this.subjectList.length) { | ||
1711 | - this.subjectList.map((item) => { | ||
1712 | - if (item.label == data.subjectName) { | ||
1713 | - this.form.subjectName = item.value; | 1356 | + |
1357 | + this.formatData(data) | ||
1358 | + } else { | ||
1359 | + this.$message.error(info); | ||
1360 | + } | ||
1361 | + }, | ||
1362 | + | ||
1363 | + formatData(data) { | ||
1364 | + if (this.subjectList.length) { | ||
1365 | + this.subjectList.map((item) => { | ||
1366 | + if (item.label == data.subjectName) { | ||
1367 | + this.form.subjectName = item.value; | ||
1368 | + } | ||
1369 | + }); | ||
1370 | + } else { | ||
1371 | + this.form.subjectName = ""; | ||
1372 | + } | ||
1373 | + this.form.examsDuration = data.examsDuration; | ||
1374 | + if (this.role != "ROLE_PERSONAL") { | ||
1375 | + this.form.sharingType = data.sharingType; | ||
1376 | + if (this.gradeList.length) { | ||
1377 | + this.gradeList.map((item) => { | ||
1378 | + if (item == data.gradeName) { | ||
1379 | + this.form.gradeName = data.gradeName; | ||
1714 | } | 1380 | } |
1715 | }); | 1381 | }); |
1716 | } else { | 1382 | } else { |
1717 | - this.form.subjectName = ""; | 1383 | + this.form.gradeName = ""; |
1718 | } | 1384 | } |
1719 | - this.form.examsDuration = data.examsDuration; | ||
1720 | - if (this.role != "ROLE_PERSONAL") { | ||
1721 | - this.form.sharingType = data.sharingType; | ||
1722 | - if (this.gradeList.length) { | ||
1723 | - this.gradeList.map((item) => { | ||
1724 | - if (item == data.gradeName) { | ||
1725 | - this.form.gradeName = data.gradeName; | ||
1726 | - } | ||
1727 | - }); | ||
1728 | - } else { | ||
1729 | - this.form.gradeName = ""; | ||
1730 | - } | ||
1731 | - } | ||
1732 | - this.form.questionList = data.questionList?.map((item) => { | ||
1733 | - let subQuestions = | ||
1734 | - item.subQuestions?.map((items) => { | ||
1735 | - return { | ||
1736 | - questionType: items.questionType, | ||
1737 | - score: items.score, | ||
1738 | - partScore: items.partScore, | ||
1739 | - selectNum: items.answerOptions.split(",").length, | ||
1740 | - answerOptions: items.answerOptions || "A,B,C,D", | ||
1741 | - correctAnswer: items.correctAnswer, | ||
1742 | - screenshot: items.screenshot || "", | ||
1743 | - screenshotSrc: items.screenshot || "", | ||
1744 | - answerScreenshot: items.answerScreenshot || "", | ||
1745 | - answerScreenshotSrc: items.answerScreenshot || "", | ||
1746 | - difficultyFactor: items.difficultyFactor || "", //题目难度 | ||
1747 | - knowledge: items.knowledge || null, //知识点 | ||
1748 | - }; | ||
1749 | - }) || []; | ||
1750 | - return { | ||
1751 | - questionTitle: item.questionTitle, | ||
1752 | - subQuestions: subQuestions, | ||
1753 | - show: false, | ||
1754 | - }; | ||
1755 | - }); | ||
1756 | - } else { | ||
1757 | - this.$message.error(info); | ||
1758 | } | 1385 | } |
1759 | - }, | 1386 | + this.form.questionList = data.questionList?.map((item) => { |
1387 | + let subQuestions = | ||
1388 | + item.subQuestions?.map((items) => { | ||
1389 | + return { | ||
1390 | + questionType: items.questionType, | ||
1391 | + score: items.score, | ||
1392 | + partScore: items.partScore, | ||
1393 | + selectNum: items.answerOptions.split(",").length, | ||
1394 | + answerOptions: items.answerOptions || "A,B,C,D", | ||
1395 | + correctAnswer: items.correctAnswer, | ||
1396 | + screenshot: items.screenshot || "", | ||
1397 | + }; | ||
1398 | + }) || []; | ||
1399 | + return { | ||
1400 | + questionTitle: item.questionTitle, | ||
1401 | + subQuestions: subQuestions, | ||
1402 | + show: false, | ||
1403 | + }; | ||
1404 | + }); | ||
1405 | + } | ||
1760 | }, | 1406 | }, |
1761 | }; | 1407 | }; |
1762 | </script> | 1408 | </script> |
@@ -1765,24 +1411,30 @@ export default { | @@ -1765,24 +1411,30 @@ export default { | ||
1765 | .red { | 1411 | .red { |
1766 | color: #f30; | 1412 | color: #f30; |
1767 | } | 1413 | } |
1414 | + | ||
1768 | .qs-options { | 1415 | .qs-options { |
1769 | flex: 1; | 1416 | flex: 1; |
1417 | + | ||
1770 | .ipt { | 1418 | .ipt { |
1771 | margin-bottom: 5px; | 1419 | margin-bottom: 5px; |
1772 | } | 1420 | } |
1421 | + | ||
1773 | .answer-box { | 1422 | .answer-box { |
1774 | .answer-s { | 1423 | .answer-s { |
1775 | cursor: pointer; | 1424 | cursor: pointer; |
1776 | user-select: none; | 1425 | user-select: none; |
1777 | margin-bottom: 10px; | 1426 | margin-bottom: 10px; |
1427 | + | ||
1778 | &:first-of-type { | 1428 | &:first-of-type { |
1779 | margin-left: 0; | 1429 | margin-left: 0; |
1780 | } | 1430 | } |
1781 | } | 1431 | } |
1782 | } | 1432 | } |
1433 | + | ||
1783 | .answer-box2 { | 1434 | .answer-box2 { |
1784 | margin-bottom: 10px; | 1435 | margin-bottom: 10px; |
1785 | } | 1436 | } |
1437 | + | ||
1786 | .delButton { | 1438 | .delButton { |
1787 | text-indent: -9999999px; | 1439 | text-indent: -9999999px; |
1788 | border-color: #ff6868; | 1440 | border-color: #ff6868; |
@@ -1790,9 +1442,11 @@ export default { | @@ -1790,9 +1442,11 @@ export default { | ||
1790 | background-size: 19px; | 1442 | background-size: 19px; |
1791 | color: transparent; | 1443 | color: transparent; |
1792 | } | 1444 | } |
1445 | + | ||
1793 | .answer-s.ac { | 1446 | .answer-s.ac { |
1794 | border: none; | 1447 | border: none; |
1795 | } | 1448 | } |
1449 | + | ||
1796 | .ac { | 1450 | .ac { |
1797 | border-color: #ff6868; | 1451 | border-color: #ff6868; |
1798 | background: #ff6868; | 1452 | background: #ff6868; |
@@ -1803,6 +1457,7 @@ export default { | @@ -1803,6 +1457,7 @@ export default { | ||
1803 | .sel2 { | 1457 | .sel2 { |
1804 | width: 480px; | 1458 | width: 480px; |
1805 | } | 1459 | } |
1460 | + | ||
1806 | .set-ans-btn { | 1461 | .set-ans-btn { |
1807 | width: 100%; | 1462 | width: 100%; |
1808 | padding: 10px 0 10px 630px; | 1463 | padding: 10px 0 10px 630px; |
@@ -1810,23 +1465,28 @@ export default { | @@ -1810,23 +1465,28 @@ export default { | ||
1810 | border-right: 1px solid #e2e2e2; | 1465 | border-right: 1px solid #e2e2e2; |
1811 | border-bottom: 1px solid #e2e2e2; | 1466 | border-bottom: 1px solid #e2e2e2; |
1812 | } | 1467 | } |
1468 | + | ||
1813 | .content-box { | 1469 | .content-box { |
1814 | width: 100%; | 1470 | width: 100%; |
1815 | height: 100%; | 1471 | height: 100%; |
1816 | overflow-y: auto; | 1472 | overflow-y: auto; |
1817 | } | 1473 | } |
1474 | + | ||
1818 | .content { | 1475 | .content { |
1819 | width: 100%; | 1476 | width: 100%; |
1820 | box-sizing: border-box; | 1477 | box-sizing: border-box; |
1821 | padding: 0 24px; | 1478 | padding: 0 24px; |
1479 | + | ||
1822 | .ml-20 { | 1480 | .ml-20 { |
1823 | margin-left: 20px; | 1481 | margin-left: 20px; |
1824 | } | 1482 | } |
1483 | + | ||
1825 | .btn-box { | 1484 | .btn-box { |
1826 | text-align: right; | 1485 | text-align: right; |
1827 | margin-left: 140px; | 1486 | margin-left: 140px; |
1828 | } | 1487 | } |
1829 | } | 1488 | } |
1489 | + | ||
1830 | .dia-content { | 1490 | .dia-content { |
1831 | .dia-tit { | 1491 | .dia-tit { |
1832 | font-size: 20px; | 1492 | font-size: 20px; |
@@ -1834,27 +1494,33 @@ export default { | @@ -1834,27 +1494,33 @@ export default { | ||
1834 | font-weight: 700; | 1494 | font-weight: 700; |
1835 | text-align: center; | 1495 | text-align: center; |
1836 | } | 1496 | } |
1497 | + | ||
1837 | .add-type { | 1498 | .add-type { |
1838 | width: 100%; | 1499 | width: 100%; |
1839 | margin-bottom: 10px; | 1500 | margin-bottom: 10px; |
1501 | + | ||
1840 | .js-set { | 1502 | .js-set { |
1841 | margin: 2.5px 10px 0 0; | 1503 | margin: 2.5px 10px 0 0; |
1842 | font-size: 14px; | 1504 | font-size: 14px; |
1843 | } | 1505 | } |
1844 | } | 1506 | } |
1507 | + | ||
1845 | .add-btn { | 1508 | .add-btn { |
1846 | margin-left: 20px; | 1509 | margin-left: 20px; |
1847 | } | 1510 | } |
1848 | } | 1511 | } |
1512 | + | ||
1849 | .el-message-box { | 1513 | .el-message-box { |
1850 | :deep(.el-button--default) { | 1514 | :deep(.el-button--default) { |
1851 | color: #fff; | 1515 | color: #fff; |
1852 | } | 1516 | } |
1853 | } | 1517 | } |
1518 | + | ||
1854 | .add-box { | 1519 | .add-box { |
1855 | display: flex; | 1520 | display: flex; |
1856 | justify-content: center; | 1521 | justify-content: center; |
1857 | align-items: center; | 1522 | align-items: center; |
1523 | + | ||
1858 | .add-question { | 1524 | .add-question { |
1859 | display: flex; | 1525 | display: flex; |
1860 | justify-content: center; | 1526 | justify-content: center; |
@@ -1863,84 +1529,103 @@ export default { | @@ -1863,84 +1529,103 @@ export default { | ||
1863 | font-weight: bolder; | 1529 | font-weight: bolder; |
1864 | padding: 2px; | 1530 | padding: 2px; |
1865 | cursor: pointer; | 1531 | cursor: pointer; |
1532 | + | ||
1866 | .s1 { | 1533 | .s1 { |
1867 | margin-left: 6px; | 1534 | margin-left: 6px; |
1868 | } | 1535 | } |
1536 | + | ||
1869 | :deep(.el-icon-plus) { | 1537 | :deep(.el-icon-plus) { |
1870 | font-size: 24px; | 1538 | font-size: 24px; |
1871 | font-weight: 900; | 1539 | font-weight: 900; |
1872 | } | 1540 | } |
1541 | + | ||
1873 | :deep(.el-button--mini.is-circle) { | 1542 | :deep(.el-button--mini.is-circle) { |
1874 | padding: 3px; | 1543 | padding: 3px; |
1875 | } | 1544 | } |
1876 | } | 1545 | } |
1877 | } | 1546 | } |
1547 | + | ||
1878 | .dialog-footer { | 1548 | .dialog-footer { |
1879 | text-align: center; | 1549 | text-align: center; |
1550 | + | ||
1880 | :deep(.el-button) { | 1551 | :deep(.el-button) { |
1881 | border-radius: 20px; | 1552 | border-radius: 20px; |
1882 | padding: 8px 20px 7px; | 1553 | padding: 8px 20px 7px; |
1883 | margin: 0 12px; | 1554 | margin: 0 12px; |
1884 | } | 1555 | } |
1885 | } | 1556 | } |
1557 | + | ||
1886 | .question-box { | 1558 | .question-box { |
1887 | margin-bottom: 20px; | 1559 | margin-bottom: 20px; |
1888 | } | 1560 | } |
1561 | + | ||
1889 | .question-title { | 1562 | .question-title { |
1890 | line-height: 40px; | 1563 | line-height: 40px; |
1891 | display: flex; | 1564 | display: flex; |
1892 | align-items: center; | 1565 | align-items: center; |
1893 | margin-bottom: 12px; | 1566 | margin-bottom: 12px; |
1567 | + | ||
1894 | .m20 { | 1568 | .m20 { |
1895 | margin: 0 20px; | 1569 | margin: 0 20px; |
1896 | } | 1570 | } |
1571 | + | ||
1897 | .ipt { | 1572 | .ipt { |
1898 | width: 300px; | 1573 | width: 300px; |
1899 | margin: 0 16px 0 10px; | 1574 | margin: 0 16px 0 10px; |
1575 | + | ||
1900 | :deep(.el-input__inner) { | 1576 | :deep(.el-input__inner) { |
1901 | border-radius: 20px; | 1577 | border-radius: 20px; |
1902 | border-color: #667ffd; | 1578 | border-color: #667ffd; |
1903 | background: rgba($color: #667ffd, $alpha: 0.05); | 1579 | background: rgba($color: #667ffd, $alpha: 0.05); |
1904 | } | 1580 | } |
1905 | } | 1581 | } |
1582 | + | ||
1906 | .delete { | 1583 | .delete { |
1907 | margin-right: 8px; | 1584 | margin-right: 8px; |
1908 | } | 1585 | } |
1586 | + | ||
1909 | .title-txt { | 1587 | .title-txt { |
1910 | margin-right: 20px; | 1588 | margin-right: 20px; |
1911 | font-size: 16px; | 1589 | font-size: 16px; |
1912 | font-weight: 700; | 1590 | font-weight: 700; |
1913 | } | 1591 | } |
1592 | + | ||
1914 | .el-icon-caret-right { | 1593 | .el-icon-caret-right { |
1915 | font-size: 24px; | 1594 | font-size: 24px; |
1916 | color: #888; | 1595 | color: #888; |
1917 | transition: all 0.4s; | 1596 | transition: all 0.4s; |
1918 | margin-right: 12px; | 1597 | margin-right: 12px; |
1919 | cursor: pointer; | 1598 | cursor: pointer; |
1599 | + | ||
1920 | &.active { | 1600 | &.active { |
1921 | transform: rotate(90deg); | 1601 | transform: rotate(90deg); |
1922 | } | 1602 | } |
1923 | } | 1603 | } |
1924 | } | 1604 | } |
1605 | + | ||
1925 | .questions-ul { | 1606 | .questions-ul { |
1926 | border-left: 1px solid #e2e2e2; | 1607 | border-left: 1px solid #e2e2e2; |
1927 | border-top: 1px solid #e2e2e2; | 1608 | border-top: 1px solid #e2e2e2; |
1928 | } | 1609 | } |
1610 | + | ||
1929 | .el-input-number { | 1611 | .el-input-number { |
1930 | width: 140px; | 1612 | width: 140px; |
1931 | } | 1613 | } |
1614 | + | ||
1932 | .answer-title { | 1615 | .answer-title { |
1933 | text-align: center; | 1616 | text-align: center; |
1934 | font-size: 20px; | 1617 | font-size: 20px; |
1935 | color: #333; | 1618 | color: #333; |
1936 | font-weight: 700; | 1619 | font-weight: 700; |
1937 | padding-bottom: 20px; | 1620 | padding-bottom: 20px; |
1621 | + | ||
1938 | .totals { | 1622 | .totals { |
1939 | font-size: 16px; | 1623 | font-size: 16px; |
1940 | color: #888; | 1624 | color: #888; |
1941 | font-weight: normal; | 1625 | font-weight: normal; |
1942 | } | 1626 | } |
1943 | } | 1627 | } |
1628 | + | ||
1944 | .answer-box { | 1629 | .answer-box { |
1945 | .answer-s { | 1630 | .answer-s { |
1946 | display: inline-block; | 1631 | display: inline-block; |
@@ -1953,6 +1638,7 @@ export default { | @@ -1953,6 +1638,7 @@ export default { | ||
1953 | color: #333; | 1638 | color: #333; |
1954 | text-align: center; | 1639 | text-align: center; |
1955 | line-height: 30px; | 1640 | line-height: 30px; |
1641 | + | ||
1956 | &.active { | 1642 | &.active { |
1957 | background: #5e78fa; | 1643 | background: #5e78fa; |
1958 | border-color: #5e78fa; | 1644 | border-color: #5e78fa; |
@@ -1960,6 +1646,7 @@ export default { | @@ -1960,6 +1646,7 @@ export default { | ||
1960 | } | 1646 | } |
1961 | } | 1647 | } |
1962 | } | 1648 | } |
1649 | + | ||
1963 | .qs-options { | 1650 | .qs-options { |
1964 | .answer-s { | 1651 | .answer-s { |
1965 | display: inline-block; | 1652 | display: inline-block; |
@@ -1973,6 +1660,7 @@ export default { | @@ -1973,6 +1660,7 @@ export default { | ||
1973 | text-align: center; | 1660 | text-align: center; |
1974 | line-height: 30px; | 1661 | line-height: 30px; |
1975 | cursor: pointer; | 1662 | cursor: pointer; |
1663 | + | ||
1976 | &.active { | 1664 | &.active { |
1977 | background: #5e78fa; | 1665 | background: #5e78fa; |
1978 | border-color: #5e78fa; | 1666 | border-color: #5e78fa; |
@@ -1980,11 +1668,13 @@ export default { | @@ -1980,11 +1668,13 @@ export default { | ||
1980 | } | 1668 | } |
1981 | } | 1669 | } |
1982 | } | 1670 | } |
1671 | + | ||
1983 | .sub-questions { | 1672 | .sub-questions { |
1984 | width: 100%; | 1673 | width: 100%; |
1985 | display: flex; | 1674 | display: flex; |
1986 | border-bottom: 1px solid #e2e2e2; | 1675 | border-bottom: 1px solid #e2e2e2; |
1987 | - & > div { | 1676 | + |
1677 | + &>div { | ||
1988 | min-height: 40px; | 1678 | min-height: 40px; |
1989 | padding: 5px; | 1679 | padding: 5px; |
1990 | flex-shrink: 0; | 1680 | flex-shrink: 0; |
@@ -1993,30 +1683,38 @@ export default { | @@ -1993,30 +1683,38 @@ export default { | ||
1993 | justify-content: center; | 1683 | justify-content: center; |
1994 | align-items: center; | 1684 | align-items: center; |
1995 | } | 1685 | } |
1686 | + | ||
1996 | .qs-num { | 1687 | .qs-num { |
1997 | width: 70px; | 1688 | width: 70px; |
1998 | } | 1689 | } |
1690 | + | ||
1999 | .qs-type { | 1691 | .qs-type { |
2000 | width: 160px; | 1692 | width: 160px; |
2001 | } | 1693 | } |
1694 | + | ||
2002 | .qs-score, | 1695 | .qs-score, |
2003 | .qs-partScore { | 1696 | .qs-partScore { |
2004 | width: 160px; | 1697 | width: 160px; |
2005 | } | 1698 | } |
1699 | + | ||
2006 | .qs-options { | 1700 | .qs-options { |
2007 | flex: 1; | 1701 | flex: 1; |
2008 | } | 1702 | } |
1703 | + | ||
2009 | .qs-set { | 1704 | .qs-set { |
2010 | width: 60px; | 1705 | width: 60px; |
2011 | } | 1706 | } |
1707 | + | ||
2012 | .qs-options2 { | 1708 | .qs-options2 { |
2013 | text-align: left; | 1709 | text-align: left; |
2014 | justify-content: flex-start; | 1710 | justify-content: flex-start; |
2015 | padding-left: 20px; | 1711 | padding-left: 20px; |
1712 | + | ||
2016 | .answer-s { | 1713 | .answer-s { |
2017 | cursor: pointer; | 1714 | cursor: pointer; |
2018 | } | 1715 | } |
2019 | } | 1716 | } |
1717 | + | ||
2020 | :deep(.el-select) { | 1718 | :deep(.el-select) { |
2021 | .el-input__inner { | 1719 | .el-input__inner { |
2022 | border-radius: 20px; | 1720 | border-radius: 20px; |
@@ -2026,6 +1724,7 @@ export default { | @@ -2026,6 +1724,7 @@ export default { | ||
2026 | line-height: 32px; | 1724 | line-height: 32px; |
2027 | background: rgba($color: #667ffd, $alpha: 0.05); | 1725 | background: rgba($color: #667ffd, $alpha: 0.05); |
2028 | } | 1726 | } |
1727 | + | ||
2029 | .el-input__icon { | 1728 | .el-input__icon { |
2030 | line-height: 32px; | 1729 | line-height: 32px; |
2031 | } | 1730 | } |
src/views/examinationPaper/index.vue
@@ -38,14 +38,13 @@ | @@ -38,14 +38,13 @@ | ||
38 | <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value"> | 38 | <el-option v-for="item in classList" :key="item.value" :label="item.label" :value="item.value"> |
39 | </el-option> | 39 | </el-option> |
40 | </el-select> | 40 | </el-select> |
41 | - <el-select class="sel" v-model="query.subjectName" placeholder="选择科目" @change="_QueryData()"> | 41 | + <el-select class="sel" v-model="query.subjectName" placeholder="选择科目" @change="getData(false)"> |
42 | <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value"> | 42 | <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value"> |
43 | </el-option> | 43 | </el-option> |
44 | </el-select> | 44 | </el-select> |
45 | 45 | ||
46 | - <el-input placeholder="试卷名称" v-model="query.title" class="input-with-select" | ||
47 | - @keyup.enter.native="_QueryData(true)"> | ||
48 | - <el-button slot="append" icon="el-icon-search" @click="_QueryData(true)"></el-button> | 46 | + <el-input placeholder="试卷名称" v-model="query.title" class="input-with-select" @keyup.enter.native="getData(true)"> |
47 | + <el-button slot="append" icon="el-icon-search" @click="getData(true)"></el-button> | ||
49 | </el-input> | 48 | </el-input> |
50 | </div> | 49 | </div> |
51 | </div> | 50 | </div> |
@@ -53,63 +52,72 @@ | @@ -53,63 +52,72 @@ | ||
53 | <span>回收站内已有{{ archivedTotal }}份答题卡,</span> | 52 | <span>回收站内已有{{ archivedTotal }}份答题卡,</span> |
54 | <router-link to="/examinationPaperRecycle">点击查看>></router-link> | 53 | <router-link to="/examinationPaperRecycle">点击查看>></router-link> |
55 | </p> | 54 | </p> |
56 | - | ||
57 | - <ul class="content" v-if="tableData && tableData.length"> | ||
58 | - <li class="item" v-for="item in tableData" :key="item.id"> | ||
59 | - <div class="pic-box"> | ||
60 | - <p class="i-box"><i class="fa fa-map-o"></i></p> | ||
61 | - <p class="ids">{{ item.id }}</p> | ||
62 | - </div> | ||
63 | - <div class="info"> | ||
64 | - <p class="title"> | ||
65 | - {{ item.title }} | ||
66 | - <span class="label" v-if="!!item.tag">{{ item.tag }}</span> | ||
67 | - </p> | ||
68 | - <p class="num"> | ||
69 | - 总题数:{{ item.questionNum }} | ||
70 | - <em class="s-line">|</em> | ||
71 | - 预计时长:{{ item.examsDuration }} | ||
72 | - <em class="s-line">|</em> | ||
73 | - <template v-if="role != 'ROLE_PERSONAL'"> | ||
74 | - 授课端同步: | ||
75 | - <span class="clazz" v-for="(clazzChild, indexs) in item.classList" :key="clazzChild.classId" | ||
76 | - :class="clazzChild.keepStatus == 1 ? 'active' : ''">{{ | ||
77 | - `${clazzChild.className}${indexs != item.classList.length - 1 ? "、" : "" | ||
78 | - }` | ||
79 | - }} | ||
80 | - <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i></span> | ||
81 | - <el-tooltip effect="dark" content="刷新同步状态" placement="right"> | ||
82 | - <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> | ||
83 | - </el-tooltip> | ||
84 | - </template> | ||
85 | - </p> | ||
86 | - <p class="person"> | ||
87 | - {{ item.realName }}<em class="s-line">|</em><span class="date">{{ item.modifiedTime }}</span> | ||
88 | - </p> | ||
89 | - </div> | ||
90 | - <div class="btn-box"> | ||
91 | - <el-tooltip effect="dark" content="修改答案" placement="bottom"> | ||
92 | - <el-button class="edit" type="primary" size="mini" circle icon="el-icon-edit" | ||
93 | - @click="toEdit(item)"></el-button> | ||
94 | - </el-tooltip> | ||
95 | - <el-dropdown trigger="click" @command="handleDropdownClick($event, item)"> | ||
96 | - <el-button type="info" size="mini" circle icon="el-icon-more"></el-button> | ||
97 | - <el-dropdown-menu slot="dropdown"> | ||
98 | - <el-dropdown-item :command="1" | ||
99 | - v-if="userName == item.realName && role != 'ROLE_PERSONAL'">修改分享范围</el-dropdown-item> | ||
100 | - <el-dropdown-item :command="2">复制</el-dropdown-item> | ||
101 | - <el-dropdown-item :command="3">放入回收站</el-dropdown-item> | ||
102 | - </el-dropdown-menu> | ||
103 | - </el-dropdown> | ||
104 | - </div> | ||
105 | - </li> | ||
106 | - </ul> | ||
107 | - <div class="pagination-box"> | ||
108 | - <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total" | ||
109 | - @current-change="changePage" :current-page="page" :page-size="size"> | ||
110 | - </el-pagination> | 55 | + <div class="content"> |
56 | + <p class="tab-box"> | ||
57 | + <span :class="['tab-s', query.type == 1 ? 'active' : '']" @click="changType(1)">我自编的 ({{ totalCount.my | ||
58 | + }})</span> | ||
59 | + <span :class="['tab-s', query.type == 2 ? 'active' : '']" @click="changType(2)">年级共享的 ({{ totalCount.share | ||
60 | + }})</span> | ||
61 | + </p> | ||
62 | + <ul v-if="tableData && tableData.length" v-loading="loading"> | ||
63 | + <li class="item" v-for="item in tableData" :key="item.id"> | ||
64 | + <div class="pic-box"> | ||
65 | + <p class="i-box"><i class="fa fa-map-o"></i></p> | ||
66 | + <p class="ids">{{ item.id }}</p> | ||
67 | + </div> | ||
68 | + <div class="info"> | ||
69 | + <p class="title"> | ||
70 | + {{ item.title }} | ||
71 | + <span class="label" v-if="!!item.tag">{{ item.tag }}</span> | ||
72 | + </p> | ||
73 | + <p class="num"> | ||
74 | + 总题数:{{ item.questionNum }} | ||
75 | + <em class="s-line">|</em> | ||
76 | + 预计时长:{{ item.examsDuration }} | ||
77 | + <em class="s-line">|</em> | ||
78 | + <template v-if="role != 'ROLE_PERSONAL'"> | ||
79 | + 授课端同步: | ||
80 | + <span class="clazz" v-for="(clazzChild, indexs) in item.classList" :key="clazzChild.classId" | ||
81 | + :class="clazzChild.keepStatus == 1 ? 'active' : ''">{{ | ||
82 | + `${clazzChild.className}${indexs != item.classList.length - 1 ? "、" : "" | ||
83 | + }` | ||
84 | + }} | ||
85 | + <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i></span> | ||
86 | + <el-tooltip effect="dark" content="刷新同步状态" placement="right"> | ||
87 | + <i class="icon-refresh el-icon-refresh" @click="refreshStic"></i> | ||
88 | + </el-tooltip> | ||
89 | + </template> | ||
90 | + </p> | ||
91 | + <p class="person"> | ||
92 | + {{ item.realName }}<em class="s-line">|</em><span class="date">{{ item.modifiedTime }}</span> | ||
93 | + </p> | ||
94 | + </div> | ||
95 | + <div class="btn-box"> | ||
96 | + <el-tooltip effect="dark" content="修改答案" placement="bottom"> | ||
97 | + <el-button class="edit" type="primary" size="mini" circle icon="el-icon-edit" | ||
98 | + @click="toEdit(item)"></el-button> | ||
99 | + </el-tooltip> | ||
100 | + <el-dropdown trigger="click" @command="handleDropdownClick($event, item)"> | ||
101 | + <el-button type="info" size="mini" circle icon="el-icon-more"></el-button> | ||
102 | + <el-dropdown-menu slot="dropdown"> | ||
103 | + <el-dropdown-item :command="1" | ||
104 | + v-if="userName == item.realName && role != 'ROLE_PERSONAL'">修改分享范围</el-dropdown-item> | ||
105 | + <el-dropdown-item :command="2">复制</el-dropdown-item> | ||
106 | + <el-dropdown-item :command="3">放入回收站</el-dropdown-item> | ||
107 | + </el-dropdown-menu> | ||
108 | + </el-dropdown> | ||
109 | + </div> | ||
110 | + </li> | ||
111 | + </ul> | ||
112 | + <div class="pagination-box"> | ||
113 | + <el-pagination small="" layout="total,prev, pager, next" :hide-on-single-page="true" :total="total" | ||
114 | + @current-change="changePage" :current-page="page" :page-size="size"> | ||
115 | + </el-pagination> | ||
116 | + </div> | ||
117 | + <el-empty v-if="!loading && tableData.length == 0" content="没有更多数据" :image-size="100"></el-empty> | ||
111 | </div> | 118 | </div> |
112 | - <el-empty v-if="!loading && tableData.length == 0" content="没有更多数据" :image-size="100"></el-empty> | 119 | + |
120 | + | ||
113 | <el-dialog :close-on-click-modal="false" title="选择分享范围" :visible.sync="dialogVisible" width="400"> | 121 | <el-dialog :close-on-click-modal="false" title="选择分享范围" :visible.sync="dialogVisible" width="400"> |
114 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> | 122 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> |
115 | <el-form-item prop="share" label="分享范围:"> | 123 | <el-form-item prop="share" label="分享范围:"> |
@@ -125,7 +133,7 @@ | @@ -125,7 +133,7 @@ | ||
125 | </div> | 133 | </div> |
126 | </el-dialog> | 134 | </el-dialog> |
127 | <el-dialog :close-on-click-modal="false" title="上传word文档" :visible.sync="diaUp" width="600"> | 135 | <el-dialog :close-on-click-modal="false" title="上传word文档" :visible.sync="diaUp" width="600"> |
128 | - <upload id="upWords" :url="url" @upSuccess="upSuccess" fileName="下载"> | 136 | + <upload :url="url" :params="{ type: examinationPaperType }" @upSuccess="upSuccess" fileName="下载"> |
129 | <div class="down-box" slot="down"> | 137 | <div class="down-box" slot="down"> |
130 | <p>第一步:导出菁优网试卷或 | 138 | <p>第一步:导出菁优网试卷或 |
131 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 | 139 | <el-link type="danger" @click="downExcel">模板下载</el-link> 。 |
@@ -154,6 +162,7 @@ export default { | @@ -154,6 +162,7 @@ export default { | ||
154 | classId: "", | 162 | classId: "", |
155 | subjectName: "", | 163 | subjectName: "", |
156 | title: "", | 164 | title: "", |
165 | + type: 1, //试卷类型 | ||
157 | }, | 166 | }, |
158 | classList: [], | 167 | classList: [], |
159 | subjectList: [], | 168 | subjectList: [], |
@@ -173,9 +182,13 @@ export default { | @@ -173,9 +182,13 @@ export default { | ||
173 | size: 20, | 182 | size: 20, |
174 | 183 | ||
175 | // v1.5 | 184 | // v1.5 |
176 | - diaUp: false, | 185 | + totalCount: {//数量统计 |
186 | + my: 0, | ||
187 | + share: 0, | ||
188 | + }, | ||
189 | + diaUp: false,//上传word弹窗开关 | ||
177 | examinationPaperType: 1,//题型类型 | 190 | examinationPaperType: 1,//题型类型 |
178 | - url: "xxxxx",//上传文档地址 | 191 | + url: "/api_html/common/paper/upload",//上传文档地址 |
179 | }; | 192 | }; |
180 | }, | 193 | }, |
181 | async created() { | 194 | async created() { |
@@ -184,13 +197,14 @@ export default { | @@ -184,13 +197,14 @@ export default { | ||
184 | this.$store.getters.info.showRole || | 197 | this.$store.getters.info.showRole || |
185 | this.$store.getters.info.permissions[0].role; | 198 | this.$store.getters.info.permissions[0].role; |
186 | this.userName = this.$store.getters.info.name || ""; | 199 | this.userName = this.$store.getters.info.name || ""; |
187 | - // this._QueryClassList2() | ||
188 | - // await this._QueryClassList(); | ||
189 | - // if (!this.query.classId) { | ||
190 | - // return; | ||
191 | - // } | ||
192 | - // await this._QuerySubjectList(); | ||
193 | - // this._QueryData(); | 200 | + this._QueryClassList2() |
201 | + await this._QueryClassList(); | ||
202 | + if (!this.query.classId) { | ||
203 | + return; | ||
204 | + } | ||
205 | + await this._QuerySubjectList(); | ||
206 | + this._QueryData(); | ||
207 | + this._QueryTotal(); | ||
194 | }, | 208 | }, |
195 | methods: { | 209 | methods: { |
196 | refreshStic() { | 210 | refreshStic() { |
@@ -222,8 +236,7 @@ export default { | @@ -222,8 +236,7 @@ export default { | ||
222 | }, | 236 | }, |
223 | }); | 237 | }); |
224 | }, | 238 | }, |
225 | - handleDropdownClick(value, item) { | ||
226 | - //更多 | 239 | + handleDropdownClick(value, item) {//更多 |
227 | const that = this; | 240 | const that = this; |
228 | switch (value) { | 241 | switch (value) { |
229 | case 1: | 242 | case 1: |
@@ -246,8 +259,8 @@ export default { | @@ -246,8 +259,8 @@ export default { | ||
246 | this.page = page; | 259 | this.page = page; |
247 | this._QueryData(this.query.title); | 260 | this._QueryData(this.query.title); |
248 | }, | 261 | }, |
262 | + //修改分享范围 | ||
249 | async saveShare() { | 263 | async saveShare() { |
250 | - //修改分享范围 | ||
251 | const { data, status, info } = await this.$request.modifyPaper({ | 264 | const { data, status, info } = await this.$request.modifyPaper({ |
252 | paperId: this.shareForm.id, | 265 | paperId: this.shareForm.id, |
253 | sharingType: this.shareForm.sharingType, | 266 | sharingType: this.shareForm.sharingType, |
@@ -262,8 +275,8 @@ export default { | @@ -262,8 +275,8 @@ export default { | ||
262 | this.$message.error(info); | 275 | this.$message.error(info); |
263 | } | 276 | } |
264 | }, | 277 | }, |
278 | + //归档 | ||
265 | async recovery(item) { | 279 | async recovery(item) { |
266 | - //归档 | ||
267 | let modifyPaper = | 280 | let modifyPaper = |
268 | this.role == "ROLE_PERSONAL" | 281 | this.role == "ROLE_PERSONAL" |
269 | ? this.$request.pModifyPaper | 282 | ? this.$request.pModifyPaper |
@@ -273,17 +286,29 @@ export default { | @@ -273,17 +286,29 @@ export default { | ||
273 | status: 2, | 286 | status: 2, |
274 | }); | 287 | }); |
275 | if (status === 0) { | 288 | if (status === 0) { |
276 | - let type = this.query.title ? 1 : 0; | 289 | + let type = this.query.title ? true : false; |
277 | this.page = 1; | 290 | this.page = 1; |
278 | this._QueryData(type); | 291 | this._QueryData(type); |
279 | } else { | 292 | } else { |
280 | this.$message.error(info); | 293 | this.$message.error(info); |
281 | } | 294 | } |
282 | }, | 295 | }, |
296 | + //根据试卷名称查找 | ||
297 | + async getData(bool) { | ||
298 | + this._QueryData(bool); | ||
299 | + this._QueryTotal(); | ||
300 | + }, | ||
283 | //切换班级 | 301 | //切换班级 |
284 | async changClazz() { | 302 | async changClazz() { |
285 | await this._QuerySubjectList(); | 303 | await this._QuerySubjectList(); |
286 | this._QueryData(false); | 304 | this._QueryData(false); |
305 | + this._QueryTotal(); | ||
306 | + }, | ||
307 | + //切换类型 | ||
308 | + async changType(type) { | ||
309 | + this.query.type = type | ||
310 | + this.page = 1; | ||
311 | + this._QueryData(false); | ||
287 | }, | 312 | }, |
288 | // 查找班级 | 313 | // 查找班级 |
289 | async _QueryClassList2() { | 314 | async _QueryClassList2() { |
@@ -363,7 +388,7 @@ export default { | @@ -363,7 +388,7 @@ export default { | ||
363 | query.subjectName = this.query.subjectName; | 388 | query.subjectName = this.query.subjectName; |
364 | for (let key in query) { | 389 | for (let key in query) { |
365 | if (!query[key]) { | 390 | if (!query[key]) { |
366 | - query[key] = null; | 391 | + delete query[key] |
367 | } | 392 | } |
368 | } | 393 | } |
369 | if (!query.classId) { | 394 | if (!query.classId) { |
@@ -393,20 +418,41 @@ export default { | @@ -393,20 +418,41 @@ export default { | ||
393 | this.$message.error(info); | 418 | this.$message.error(info); |
394 | } | 419 | } |
395 | }, | 420 | }, |
421 | + async _QueryTotal() { | ||
422 | + //获取答题卡列表 | ||
423 | + let query = { ...this.query }; | ||
424 | + for (let key in query) { | ||
425 | + if (!query[key]) { | ||
426 | + delete query[key] | ||
427 | + } | ||
428 | + } | ||
429 | + const { data, status, info } = await this.$request.paperShareCount({ | ||
430 | + ...query, | ||
431 | + }); | ||
432 | + if (status === 0) { | ||
433 | + this.totalCount.my = data?.myCount || 0; | ||
434 | + this.totalCount.share = data?.grade || 0; | ||
435 | + } else { | ||
436 | + this.$message.error(info); | ||
437 | + } | ||
438 | + }, | ||
396 | 439 | ||
397 | 440 | ||
398 | //v1.5 | 441 | //v1.5 |
399 | upSuccess(res) { | 442 | upSuccess(res) { |
400 | - //导入成功 | ||
401 | - this.$message.closeAll(); | ||
402 | - this.$message({ | ||
403 | - showClose: true, | ||
404 | - message: `成功(${res.data.success})`, | ||
405 | - type: "success", | ||
406 | - duration: 5000, | ||
407 | - }); | ||
408 | - this.diaUp = false; | ||
409 | - | 443 | + if (res.status == 0) { |
444 | + //导入成功 | ||
445 | + this.$message.closeAll(); | ||
446 | + this.$message({ | ||
447 | + showClose: true, | ||
448 | + message: `${res.info}`, | ||
449 | + type: "success", | ||
450 | + duration: 2000, | ||
451 | + }); | ||
452 | + this.diaUp = false; | ||
453 | + let params = JSON.stringify(res.data) | ||
454 | + this.toAdd({ params, isUpload: 1 }) | ||
455 | + } | ||
410 | }, | 456 | }, |
411 | handleAdd(value) { | 457 | handleAdd(value) { |
412 | if (value == 2) { | 458 | if (value == 2) { |
@@ -589,4 +635,27 @@ export default { | @@ -589,4 +635,27 @@ export default { | ||
589 | display: flex; | 635 | display: flex; |
590 | justify-content: space-between; | 636 | justify-content: space-between; |
591 | } | 637 | } |
638 | + | ||
639 | +.content { | ||
640 | + .tab-box { | ||
641 | + padding-bottom: 10px; | ||
642 | + | ||
643 | + .tab-s { | ||
644 | + margin: 0 10px; | ||
645 | + font-size: 17px; | ||
646 | + line-height: 24px; | ||
647 | + font-weight: 500; | ||
648 | + cursor: pointer; | ||
649 | + | ||
650 | + &:hover { | ||
651 | + color: #667ffd; | ||
652 | + } | ||
653 | + | ||
654 | + &.active { | ||
655 | + color: #667ffd; | ||
656 | + border-bottom: 1px solid #667ffd | ||
657 | + } | ||
658 | + } | ||
659 | + } | ||
660 | +} | ||
592 | </style> | 661 | </style> |
593 | \ No newline at end of file | 662 | \ No newline at end of file |