Commit 6fffbd556aac41cd9f86c4e8e6e788c1be7f9b76
1 parent
5424ef82
组卷接口调整
Showing
6 changed files
with
77 additions
and
68 deletions
src/views/examinationPaper/add.vue
... | ... | @@ -764,7 +764,7 @@ export default { |
764 | 764 | return; |
765 | 765 | } |
766 | 766 | //添加测验类型 |
767 | - const { data, status, message } = await this.$request.addPaperType({ | |
767 | + const { data, status, info } = await this.$request.addPaperType({ | |
768 | 768 | typeName: this.answerTypeName, |
769 | 769 | }); |
770 | 770 | if (status == 0) { |
... | ... | @@ -773,7 +773,7 @@ export default { |
773 | 773 | this.answerTypeName = ""; |
774 | 774 | this.$message.success("添加成功"); |
775 | 775 | } else { |
776 | - this.$message.error(message); | |
776 | + this.$message.error(info); | |
777 | 777 | } |
778 | 778 | }, |
779 | 779 | async save() { |
... | ... | @@ -789,7 +789,7 @@ export default { |
789 | 789 | items.questionIndex = indexs + 1; |
790 | 790 | }); |
791 | 791 | }); |
792 | - const { data, status, message } = await this.$request.addPaper({ | |
792 | + const { data, status, info } = await this.$request.addPaper({ | |
793 | 793 | ...this.form, |
794 | 794 | }); |
795 | 795 | this.saceLoading = false; |
... | ... | @@ -798,7 +798,7 @@ export default { |
798 | 798 | path: "/examinationPaper", |
799 | 799 | }); |
800 | 800 | } else { |
801 | - this.$message.error(message); | |
801 | + this.$message.error(info); | |
802 | 802 | } |
803 | 803 | }, |
804 | 804 | async changeGrade() { |
... | ... | @@ -807,7 +807,9 @@ export default { |
807 | 807 | }, |
808 | 808 | async _CreatedTypeList() { |
809 | 809 | //测验类型查询 |
810 | - const { data, status, message } = await this.$request.fetchTypeNames(); | |
810 | + const { data, status, info } = await this.$request.fetchTypeNames( | |
811 | + {gradeName :grade} | |
812 | + ); | |
811 | 813 | if (status == 0) { |
812 | 814 | this.answerTypeList = [...data.list] || []; |
813 | 815 | this.answerTypeList.unshift({ |
... | ... | @@ -818,12 +820,12 @@ export default { |
818 | 820 | this.form.tagId = this.answerTypeList[0].id || ""; |
819 | 821 | } |
820 | 822 | } else { |
821 | - this.$message.error(message); | |
823 | + this.$message.error(info); | |
822 | 824 | } |
823 | 825 | }, |
824 | 826 | async _GradeList() { |
825 | 827 | //查询年级列表 |
826 | - const { data, status, message } = await this.$request.fetchGradeList(); | |
828 | + const { data, status, info } = await this.$request.fetchGradeList(); | |
827 | 829 | if (status == 0) { |
828 | 830 | this.gradeList = [...data.gradeNames] || []; |
829 | 831 | if (this.type != 2) { |
... | ... | @@ -831,12 +833,12 @@ export default { |
831 | 833 | } |
832 | 834 | this._QuerySubjectList(this.gradeList[0]); |
833 | 835 | } else { |
834 | - this.$message.error(message); | |
836 | + this.$message.error(info); | |
835 | 837 | } |
836 | 838 | }, |
837 | 839 | async _QuerySubjectList(grade) { |
838 | 840 | //查询科目列表 |
839 | - const { data, status, message } = await this.$request.fetchSubjectList( | |
841 | + const { data, status, info } = await this.$request.fetchSubjectList( | |
840 | 842 | {gradeName :grade} |
841 | 843 | ); |
842 | 844 | if (status === 0) { |
... | ... | @@ -850,12 +852,12 @@ export default { |
850 | 852 | this.form.subjectName = this.subjectList[0].value; |
851 | 853 | } |
852 | 854 | } else { |
853 | - this.$message.error(message); | |
855 | + this.$message.error(info); | |
854 | 856 | } |
855 | 857 | }, |
856 | 858 | async _QueryDetail() { |
857 | 859 | //查询年级列表 |
858 | - const { data, status, message } = await this.$request.fetchPaperDetail({ | |
860 | + const { data, status, info } = await this.$request.fetchPaperDetail({ | |
859 | 861 | paperId: this.$route.query.paperId, |
860 | 862 | }); |
861 | 863 | if (status == 0) { |
... | ... | @@ -883,7 +885,7 @@ export default { |
883 | 885 | }; |
884 | 886 | }); |
885 | 887 | } else { |
886 | - this.$message.error(message); | |
888 | + this.$message.error(info); | |
887 | 889 | } |
888 | 890 | }, |
889 | 891 | }, | ... | ... |
src/views/examinationPaper/edit.vue
... | ... | @@ -16,11 +16,11 @@ |
16 | 16 | <div v-for="(question, index) in form.questionList" :key="index"> |
17 | 17 | <p class="question-title"> |
18 | 18 | <span>{{ setBigNum(index) }}、</span> |
19 | - <el-input | |
20 | - class="ipt" | |
21 | - v-model.trim="question.questionTitle" | |
22 | - placeholder="填写大题名称" | |
23 | - ></el-input> | |
19 | + <el-input | |
20 | + class="ipt" | |
21 | + v-model.trim="question.questionTitle" | |
22 | + placeholder="填写大题名称" | |
23 | + ></el-input> | |
24 | 24 | <span>共 {{ setScore(question) }} 分</span> |
25 | 25 | </p> |
26 | 26 | <ul class="questions-ul"> |
... | ... | @@ -105,7 +105,7 @@ import { deepClone } from "utils"; |
105 | 105 | export default { |
106 | 106 | data() { |
107 | 107 | return { |
108 | - questionList:[], | |
108 | + questionList: [], | |
109 | 109 | form: { |
110 | 110 | //答题卡详情 |
111 | 111 | title: "", |
... | ... | @@ -130,7 +130,7 @@ export default { |
130 | 130 | }, |
131 | 131 | }, |
132 | 132 | created() { |
133 | - this._QueryDetail() | |
133 | + this._QueryDetail(); | |
134 | 134 | }, |
135 | 135 | methods: { |
136 | 136 | linkBack() { |
... | ... | @@ -201,37 +201,38 @@ export default { |
201 | 201 | sub.correctAnswer = arrs.sort().join(""); |
202 | 202 | } |
203 | 203 | }, |
204 | - async save(){ | |
205 | - let questionList = this.form.questionList.map(item=>{ | |
206 | - item.score = null | |
207 | - return item | |
208 | - }) | |
209 | - //更新答题卡 | |
210 | - const { data, status, message } = await this.$request.modifyPaper({ | |
211 | - paperId:this.form.id, | |
212 | - questionList:questionList | |
213 | - }); | |
204 | + async save() { | |
205 | + let questionList = this.form.questionList.map((item) => { | |
206 | + item.score = null; | |
207 | + items.questionId = ""; | |
208 | + items.questionIndex = ""; | |
209 | + return item; | |
210 | + }); | |
211 | + //更新答题卡 | |
212 | + const { data, status, info } = await this.$request.modifyPaper({ | |
213 | + paperId: this.form.id, | |
214 | + questionList: questionList, | |
215 | + }); | |
214 | 216 | if (status == 0) { |
215 | 217 | this.$router.push({ |
216 | - path:"/examinationPaper" | |
217 | - }) | |
218 | + path: "/examinationPaper", | |
219 | + }); | |
218 | 220 | } else { |
219 | - this.$message.error(message); | |
221 | + this.$message.error(info); | |
220 | 222 | } |
221 | 223 | }, |
222 | 224 | async _QueryDetail() { |
223 | 225 | //查询年级列表 |
224 | - const { data, status, message } = await this.$request.fetchPaperDetail({ | |
225 | - paperId:this.$route.query.paperId | |
226 | + const { data, status, info } = await this.$request.fetchPaperDetail({ | |
227 | + paperId: this.$route.query.paperId, | |
226 | 228 | }); |
227 | 229 | if (status == 0) { |
228 | - this.form = deepClone(data) | |
229 | - this.questionList = deepClone(data.questionList) | |
230 | - this.form.questionList.map(item=>{ | |
231 | - item.score = "" | |
232 | - }) | |
230 | + this.form = deepClone(data); | |
231 | + this.form.questionList.map((item) => { | |
232 | + item.score = ""; | |
233 | + }); | |
233 | 234 | } else { |
234 | - this.$message.error(message); | |
235 | + this.$message.error(info); | |
235 | 236 | } |
236 | 237 | }, |
237 | 238 | }, | ... | ... |
src/views/examinationPaper/index.vue
... | ... | @@ -235,7 +235,7 @@ export default { |
235 | 235 | }, |
236 | 236 | async saveShare() { |
237 | 237 | //修改分享范围 |
238 | - const { data, status, message } = await this.$request.modifyPaper({ | |
238 | + const { data, status, info } = await this.$request.modifyPaper({ | |
239 | 239 | paperId: that.shareForm.id, |
240 | 240 | sharingType: that.shareForm.share, |
241 | 241 | }); |
... | ... | @@ -245,12 +245,12 @@ export default { |
245 | 245 | this.shareForm.share = 1; |
246 | 246 | dialogVisible = false; |
247 | 247 | } else { |
248 | - this.$message.error(message); | |
248 | + this.$message.error(info); | |
249 | 249 | } |
250 | 250 | }, |
251 | 251 | async recovery(item) { |
252 | 252 | //归档 |
253 | - const { data, status, message } = await this.$request.modifyPaper({ | |
253 | + const { data, status, info } = await this.$request.modifyPaper({ | |
254 | 254 | paperId: item.id, |
255 | 255 | status: 2, |
256 | 256 | }); |
... | ... | @@ -259,7 +259,7 @@ export default { |
259 | 259 | this.page = 1; |
260 | 260 | this._QueryData(type); |
261 | 261 | } else { |
262 | - this.$message.error(message); | |
262 | + this.$message.error(info); | |
263 | 263 | } |
264 | 264 | }, |
265 | 265 | //切换班级 |
... | ... | @@ -269,7 +269,7 @@ export default { |
269 | 269 | }, |
270 | 270 | // 查找答题卡类型 |
271 | 271 | async _QueryTypeList() { |
272 | - const { data, status, message } = await this.$request.fetchTypeNames({ | |
272 | + const { data, status, info } = await this.$request.fetchTypeNames({ | |
273 | 273 | classId: this.query.classId, |
274 | 274 | }); |
275 | 275 | if (status === 0) { |
... | ... | @@ -285,12 +285,12 @@ export default { |
285 | 285 | label: "--", |
286 | 286 | }); |
287 | 287 | } else { |
288 | - this.$message.error(message); | |
288 | + this.$message.error(info); | |
289 | 289 | } |
290 | 290 | }, |
291 | 291 | // 查找班级 |
292 | 292 | async _QueryClassList() { |
293 | - const { data, status, message } = await this.$request.fetchClassList(); | |
293 | + const { data, status, info } = await this.$request.fetchClassList(); | |
294 | 294 | console.log(status) |
295 | 295 | if (status === 0) { |
296 | 296 | if (!!data.list) { |
... | ... | @@ -303,12 +303,12 @@ export default { |
303 | 303 | this.query.classId = this.classList[0]?.value; |
304 | 304 | } |
305 | 305 | } else { |
306 | - this.$message.error(message); | |
306 | + this.$message.error(info); | |
307 | 307 | } |
308 | 308 | }, |
309 | 309 | // 查找科目 |
310 | 310 | async _QuerySubjectList() { |
311 | - const { data, status, message } = await this.$request.fetchSubjectList({ | |
311 | + const { data, status, info } = await this.$request.fetchSubjectList({ | |
312 | 312 | classId: this.query.classId, |
313 | 313 | }); |
314 | 314 | if (status === 0) { |
... | ... | @@ -320,7 +320,7 @@ export default { |
320 | 320 | }); |
321 | 321 | this.query.subjectName = this.subjectList[0]?.value; |
322 | 322 | } else { |
323 | - this.$message.error(message); | |
323 | + this.$message.error(info); | |
324 | 324 | } |
325 | 325 | }, |
326 | 326 | async _QueryData(type) { |
... | ... | @@ -347,7 +347,7 @@ export default { |
347 | 347 | return; |
348 | 348 | } |
349 | 349 | this.loading = true; |
350 | - const { data, status, message } = await this.$request.fetchPaperList({ | |
350 | + const { data, status, info } = await this.$request.fetchPaperList({ | |
351 | 351 | ...query, |
352 | 352 | status: 1, |
353 | 353 | page: this.page, |
... | ... | @@ -358,7 +358,7 @@ export default { |
358 | 358 | this.total = data.total; |
359 | 359 | this.tableData = (data.list && [...data.list]) || []; |
360 | 360 | } else { |
361 | - this.$message.error(message); | |
361 | + this.$message.error(info); | |
362 | 362 | } |
363 | 363 | }, |
364 | 364 | }, | ... | ... |
src/views/examinationPaper/recycle.vue
... | ... | @@ -186,7 +186,7 @@ export default { |
186 | 186 | methods: { |
187 | 187 | async modify(obj) { |
188 | 188 | //恢复答题卡 |
189 | - const { data, status, message } = await this.$request.modifyPaper({ | |
189 | + const { data, status, info } = await this.$request.modifyPaper({ | |
190 | 190 | paperId: obj.id, |
191 | 191 | status: 1, |
192 | 192 | }); |
... | ... | @@ -194,19 +194,19 @@ export default { |
194 | 194 | let type = this.query.title ? 1 : 0; |
195 | 195 | this._QueryData(type); |
196 | 196 | } else { |
197 | - this.$message.error(message); | |
197 | + this.$message.error(info); | |
198 | 198 | } |
199 | 199 | }, |
200 | 200 | async remove(obj) { |
201 | 201 | //删除答题卡 |
202 | - const { data, status, message } = await this.$request.delPaper({ | |
202 | + const { data, status, info } = await this.$request.delPaper({ | |
203 | 203 | paperId: obj.id, |
204 | 204 | }); |
205 | 205 | if (status == 0) { |
206 | 206 | let type = this.query.title ? 1 : 0; |
207 | 207 | this._QueryData(type); |
208 | 208 | } else { |
209 | - this.$message.error(message); | |
209 | + this.$message.error(info); | |
210 | 210 | } |
211 | 211 | }, |
212 | 212 | //切换班级 |
... | ... | @@ -232,7 +232,7 @@ export default { |
232 | 232 | query[key] = null; |
233 | 233 | } |
234 | 234 | } |
235 | - const { data, status, message } = await this.$request.fetchPaperList({ | |
235 | + const { data, status, info } = await this.$request.fetchPaperList({ | |
236 | 236 | ...query, |
237 | 237 | status:2 |
238 | 238 | }); |
... | ... | @@ -241,12 +241,12 @@ export default { |
241 | 241 | this.total = data.total; |
242 | 242 | this.tableData = (data.list && [...data.list]) || []; |
243 | 243 | } else { |
244 | - this.$message.error(message); | |
244 | + this.$message.error(info); | |
245 | 245 | } |
246 | 246 | }, |
247 | 247 | // 查找班级 |
248 | 248 | async _QueryClassList() { |
249 | - const { data, status, message } = await this.$request.fetchClassList(); | |
249 | + const { data, status, info } = await this.$request.fetchClassList(); | |
250 | 250 | console.log(status); |
251 | 251 | if (status === 0) { |
252 | 252 | if (!!data.list) { |
... | ... | @@ -259,12 +259,12 @@ export default { |
259 | 259 | this.query.classId = this.classList[0]?.value; |
260 | 260 | } |
261 | 261 | } else { |
262 | - this.$message.error(message); | |
262 | + this.$message.error(info); | |
263 | 263 | } |
264 | 264 | }, |
265 | 265 | // 查找科目 |
266 | 266 | async _QuerySubjectList() { |
267 | - const { data, status, message } = await this.$request.fetchSubjectList({ | |
267 | + const { data, status, info } = await this.$request.fetchSubjectList({ | |
268 | 268 | classId: this.query.classId, |
269 | 269 | }); |
270 | 270 | if (status === 0) { |
... | ... | @@ -276,12 +276,12 @@ export default { |
276 | 276 | }); |
277 | 277 | this.query.subjectName = this.subjectList[0]?.value; |
278 | 278 | } else { |
279 | - this.$message.error(message); | |
279 | + this.$message.error(info); | |
280 | 280 | } |
281 | 281 | }, |
282 | 282 | // 查找答题卡类型 |
283 | 283 | async _QueryTypeList() { |
284 | - const { data, status, message } = await this.$request.fetchTypeNames({ | |
284 | + const { data, status, info } = await this.$request.fetchTypeNames({ | |
285 | 285 | classId: this.query.classId, |
286 | 286 | }); |
287 | 287 | if (status === 0) { |
... | ... | @@ -297,7 +297,7 @@ export default { |
297 | 297 | label: "--", |
298 | 298 | }); |
299 | 299 | } else { |
300 | - this.$message.error(message); | |
300 | + this.$message.error(info); | |
301 | 301 | } |
302 | 302 | }, |
303 | 303 | }, | ... | ... |
src/views/layout/header/header.vue
... | ... | @@ -129,9 +129,9 @@ export default { |
129 | 129 | this.$store.dispatch("permissions", this); |
130 | 130 | }, |
131 | 131 | async logOut() { |
132 | - const { data } = await this.$request.logout(); | |
133 | - if (data.status == 0) { | |
134 | - if (data.data) { | |
132 | + const { data,status } = await this.$request.logout(); | |
133 | + if (status == 0) { | |
134 | + if (data) { | |
135 | 135 | window.location.href = data; |
136 | 136 | } else { |
137 | 137 | this.$router.push({ | ... | ... |