Commit 5424ef82f9e020408262626018d1c7651a783cc0

Authored by 梁保满
1 parent ee6e7628

接口调整

src/api/axios.js
@@ -59,7 +59,8 @@ service.interceptors.response.use( @@ -59,7 +59,8 @@ service.interceptors.response.use(
59 // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) 59 // Cookies.set("access_token", response.data.message, { expires: 1 / 12 })
60 } 60 }
61 } 61 }
62 - return Promise.resolve(response) 62 + console.log(response)
  63 + return Promise.resolve(res)
63 }, 64 },
64 error => { 65 error => {
65 Message({ 66 Message({
src/api/urls/answerSheet.js
@@ -2,7 +2,7 @@ export default { @@ -2,7 +2,7 @@ export default {
2 // 答题卡列表 2 // 答题卡列表
3 paperList: "/api_html/teaching/paperList", 3 paperList: "/api_html/teaching/paperList",
4 // 答题卡详情 4 // 答题卡详情
5 - paperList: "/api_html/teaching/paperDetail", 5 + paperDetail: "/api_html/teaching/paperDetail",
6 // 查找年级 6 // 查找年级
7 gradeList: "/api_html/teaching/gradeList", 7 gradeList: "/api_html/teaching/gradeList",
8 // 测验类型 8 // 测验类型
src/store/index.js
@@ -65,7 +65,7 @@ const store = new Vuex.Store({ @@ -65,7 +65,7 @@ const store = new Vuex.Store({
65 loginForm.username = params.username; 65 loginForm.username = params.username;
66 loginForm.password = encryptLoginPassword(params.password); 66 loginForm.password = encryptLoginPassword(params.password);
67 request.login({ ...loginForm }).then(res => { 67 request.login({ ...loginForm }).then(res => {
68 - let response = res.data 68 + let response = res
69 if (response.status == 0) { 69 if (response.status == 0) {
70 const userInfo = { ...response.data } 70 const userInfo = { ...response.data }
71 commit("setToken", "isLogin"); 71 commit("setToken", "isLogin");
src/views/examinationPaper/add.vue
@@ -433,7 +433,6 @@ @@ -433,7 +433,6 @@
433 433
434 <script> 434 <script>
435 import { formatDate, deepClone } from "utils"; 435 import { formatDate, deepClone } from "utils";
436 -import { number } from "echarts";  
437 const questionForm = { 436 const questionForm = {
438 questionTitle: "", 437 questionTitle: "",
439 questionType: 2, 438 questionType: 2,
@@ -509,7 +508,9 @@ export default { @@ -509,7 +508,9 @@ export default {
509 }, 508 },
510 }; 509 };
511 }, 510 },
512 - created() { 511 + async created() {
  512 + await this._GradeList()
  513 + await this._CreatedTypeList()
513 this.type = this.$route.query.type ? this.$route.query.type : 1; 514 this.type = this.$route.query.type ? this.$route.query.type : 1;
514 if (this.type == 2) { 515 if (this.type == 2) {
515 this._QueryDetail(); 516 this._QueryDetail();
@@ -833,14 +834,10 @@ export default { @@ -833,14 +834,10 @@ export default {
833 this.$message.error(message); 834 this.$message.error(message);
834 } 835 }
835 }, 836 },
836 - async _QuerySubjectList(grade, dont) { 837 + async _QuerySubjectList(grade) {
837 //查询科目列表 838 //查询科目列表
838 - let param = {};  
839 - if (grade) {  
840 - param.gradeName = grade;  
841 - }  
842 const { data, status, message } = await this.$request.fetchSubjectList( 839 const { data, status, message } = await this.$request.fetchSubjectList(
843 - param 840 + {gradeName :grade}
844 ); 841 );
845 if (status === 0) { 842 if (status === 0) {
846 this.subjectList = data.list.map((item) => { 843 this.subjectList = data.list.map((item) => {
@@ -865,7 +862,7 @@ export default { @@ -865,7 +862,7 @@ export default {
865 this.form.title = data.title; 862 this.form.title = data.title;
866 this.form.tagId = data.tagId; 863 this.form.tagId = data.tagId;
867 this.form.subjectName = data.subjectName; 864 this.form.subjectName = data.subjectName;
868 - this.form.gradeName = data.gradeName; 865 + this.form.gradeName = data.grade;
869 this.form.examsDuration = data.examsDuration; 866 this.form.examsDuration = data.examsDuration;
870 this.form.sharingType = data.sharingType; 867 this.form.sharingType = data.sharingType;
871 this.form.questionList = data.questionList?.map((item) => { 868 this.form.questionList = data.questionList?.map((item) => {
@@ -876,7 +873,7 @@ export default { @@ -876,7 +873,7 @@ export default {
876 score: items.score, 873 score: items.score,
877 partScore: items.partScore, 874 partScore: items.partScore,
878 selectNum: items.answerOptions.split(',').length, 875 selectNum: items.answerOptions.split(',').length,
879 - answerOptions: [...items.answerOptions], 876 + answerOptions: items.answerOptions||"A,B,C,D",
880 correctAnswer: items.correctAnswer, 877 correctAnswer: items.correctAnswer,
881 }; 878 };
882 }) || []; 879 }) || [];
src/views/examinationPaper/edit.vue
@@ -69,7 +69,7 @@ @@ -69,7 +69,7 @@
69 <p v-if="subQuestions.questionType == 3" class="answer-box"> 69 <p v-if="subQuestions.questionType == 3" class="answer-box">
70 <span 70 <span
71 class="answer-s" 71 class="answer-s"
72 - v-for="option in subQuestions.answerOptions" 72 + v-for="option in subQuestions.answerOptions.split(',')"
73 :class=" 73 :class="
74 subQuestions.correctAnswer.includes(option) ? 'active' : '' 74 subQuestions.correctAnswer.includes(option) ? 'active' : ''
75 " 75 "
@@ -81,7 +81,7 @@ @@ -81,7 +81,7 @@
81 <p v-if="subQuestions.questionType == 2" class="answer-box"> 81 <p v-if="subQuestions.questionType == 2" class="answer-box">
82 <span 82 <span
83 class="answer-s" 83 class="answer-s"
84 - v-for="option in subQuestions.answerOptions" 84 + v-for="option in subQuestions.answerOptions.split(',')"
85 :class="subQuestions.correctAnswer == option ? 'active' : ''" 85 :class="subQuestions.correctAnswer == option ? 'active' : ''"
86 :key="option" 86 :key="option"
87 @click="subQuestions.correctAnswer = option" 87 @click="subQuestions.correctAnswer = option"
@@ -101,6 +101,7 @@ @@ -101,6 +101,7 @@
101 </template> 101 </template>
102 102
103 <script> 103 <script>
  104 +import { deepClone } from "utils";
104 export default { 105 export default {
105 data() { 106 data() {
106 return { 107 return {
@@ -201,7 +202,10 @@ export default { @@ -201,7 +202,10 @@ export default {
201 } 202 }
202 }, 203 },
203 async save(){ 204 async save(){
204 - let questionList = [] 205 + let questionList = this.form.questionList.map(item=>{
  206 + item.score = null
  207 + return item
  208 + })
205 //更新答题卡 209 //更新答题卡
206 const { data, status, message } = await this.$request.modifyPaper({ 210 const { data, status, message } = await this.$request.modifyPaper({
207 paperId:this.form.id, 211 paperId:this.form.id,
src/views/examinationPaper/index.vue
@@ -55,10 +55,10 @@ @@ -55,10 +55,10 @@
55 > 55 >
56 <el-option 56 <el-option
57 v-for="item in typeList" 57 v-for="item in typeList"
58 - :key="item" 58 + :key="item.label"
59 :label="item.label" 59 :label="item.label"
60 :value="item.value" 60 :value="item.value"
61 - >{{ item }} 61 + >{{ item.label }}
62 </el-option> 62 </el-option>
63 </el-select> 63 </el-select>
64 <el-input 64 <el-input
@@ -100,8 +100,8 @@ @@ -100,8 +100,8 @@
100 v-for="(clazzChild, indexs) in item.classList" 100 v-for="(clazzChild, indexs) in item.classList"
101 :key="clazzChild.classId" 101 :key="clazzChild.classId"
102 >{{ 102 >{{
103 - `${clazzChild.className}班${  
104 - indexs != item.aboutClazz.length - 1 ? "、" : "" 103 + `${clazzChild.className}${
  104 + indexs != item.classList.length-1? "、" : ""
105 }` 105 }`
106 }} 106 }}
107 <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i 107 <i v-if="clazzChild.keepStatus == 1" class="el-icon-success"></i
@@ -178,72 +178,7 @@ export default { @@ -178,72 +178,7 @@ export default {
178 subjectList: [], 178 subjectList: [],
179 typeList: [], 179 typeList: [],
180 archivedTotal: 0, //已归档答题卡数量 180 archivedTotal: 0, //已归档答题卡数量
181 - tableData: [  
182 - {  
183 - title: "数学样例试卷202211-324654",  
184 - id: "1062837",  
185 - tag: "周测",  
186 - answerNum: 45,  
187 - time: 90,  
188 - aboutClazz: [203, 204],  
189 - teacher: "张老师",  
190 - date: "2022-11-04 18:09:49",  
191 - share: 1,  
192 - score: 100,  
193 - gradeName: "二年级",  
194 - subjectId: 1,  
195 - examsDuration: 4800,  
196 - questionList: [  
197 - {  
198 - questionTitle: "f",  
199 - score: 1,  
200 - subQuestions: [  
201 - {  
202 - questionIndex: 1,  
203 - questionType: 2,  
204 - score: 1,  
205 - partScore: 0,  
206 - selectNum: 4,  
207 - answerOptions: "A,B,C,D",  
208 - correctAnswer: "B",  
209 - },  
210 - ],  
211 - },  
212 - ],  
213 - },  
214 - {  
215 - title: "数学样例试卷202211-4180949",  
216 - id: "1062838",  
217 - tag: "周测",  
218 - answerNum: 45,  
219 - time: 90,  
220 - aboutClazz: [203, 204],  
221 - teacher: "张老师",  
222 - date: "2022-11-04 18:09:49",  
223 - share: 1,  
224 - score: 100,  
225 - gradeName: "二年级",  
226 - subjectId: 1,  
227 - examsDuration: 3000,  
228 - questionList: [  
229 - {  
230 - questionTitle: "f",  
231 - score: 1,  
232 - subQuestions: [  
233 - {  
234 - questionIndex: 2,  
235 - questionType: 3,  
236 - score: 1,  
237 - partScore: 0,  
238 - selectNum: 4,  
239 - answerOptions: ["A", "B", "C", "D"],  
240 - correctAnswer: "A,C",  
241 - },  
242 - ],  
243 - },  
244 - ],  
245 - },  
246 - ], 181 + tableData: [],
247 shareForm: { 182 shareForm: {
248 id: "", 183 id: "",
249 share: 1, 184 share: 1,
@@ -334,16 +269,18 @@ export default { @@ -334,16 +269,18 @@ export default {
334 }, 269 },
335 // 查找答题卡类型 270 // 查找答题卡类型
336 async _QueryTypeList() { 271 async _QueryTypeList() {
337 - const { data, status, message } = await this.$request.fetchTypeNames(); 272 + const { data, status, message } = await this.$request.fetchTypeNames({
  273 + classId: this.query.classId,
  274 + });
338 if (status === 0) { 275 if (status === 0) {
339 this.typeList = 276 this.typeList =
340 - data.subjectNames.map((item) => { 277 + data.list.map((item) => {
341 return { 278 return {
342 value: item.tagId, 279 value: item.tagId,
343 label: item.tag, 280 label: item.tag,
344 }; 281 };
345 }) || []; 282 }) || [];
346 - this.subjectNames.unshift({ 283 + this.typeList.unshift({
347 value: "", 284 value: "",
348 label: "--", 285 label: "--",
349 }); 286 });
@@ -354,15 +291,16 @@ export default { @@ -354,15 +291,16 @@ export default {
354 // 查找班级 291 // 查找班级
355 async _QueryClassList() { 292 async _QueryClassList() {
356 const { data, status, message } = await this.$request.fetchClassList(); 293 const { data, status, message } = await this.$request.fetchClassList();
  294 + console.log(status)
357 if (status === 0) { 295 if (status === 0) {
358 if (!!data.list) { 296 if (!!data.list) {
359 this.classList = data.list.map((item) => { 297 this.classList = data.list.map((item) => {
360 return { 298 return {
361 - value: item.clazzId,  
362 - label: item.clazzName, 299 + value: item.classId,
  300 + label: item.className,
363 }; 301 };
364 }); 302 });
365 - this.query.clazzId = this.classList[0]?.value; 303 + this.query.classId = this.classList[0]?.value;
366 } 304 }
367 } else { 305 } else {
368 this.$message.error(message); 306 this.$message.error(message);
@@ -371,7 +309,7 @@ export default { @@ -371,7 +309,7 @@ export default {
371 // 查找科目 309 // 查找科目
372 async _QuerySubjectList() { 310 async _QuerySubjectList() {
373 const { data, status, message } = await this.$request.fetchSubjectList({ 311 const { data, status, message } = await this.$request.fetchSubjectList({
374 - clazzId: this.query.clazzId, 312 + classId: this.query.classId,
375 }); 313 });
376 if (status === 0) { 314 if (status === 0) {
377 this.subjectList = data.subjectNames.map((item) => { 315 this.subjectList = data.subjectNames.map((item) => {
@@ -380,7 +318,7 @@ export default { @@ -380,7 +318,7 @@ export default {
380 label: item, 318 label: item,
381 }; 319 };
382 }); 320 });
383 - this.query.clazzId = this.subjectList[0]?.value; 321 + this.query.subjectName = this.subjectList[0]?.value;
384 } else { 322 } else {
385 this.$message.error(message); 323 this.$message.error(message);
386 } 324 }
@@ -396,13 +334,13 @@ export default { @@ -396,13 +334,13 @@ export default {
396 this.query.tagId = ""; 334 this.query.tagId = "";
397 this.query.subjectName = ""; 335 this.query.subjectName = "";
398 } 336 }
399 - query.clazzId = this.query.clazzId; 337 + query.classId = this.query.classId;
400 for (let key in query) { 338 for (let key in query) {
401 if (!query[key]) { 339 if (!query[key]) {
402 query[key] = null; 340 query[key] = null;
403 } 341 }
404 } 342 }
405 - if (!query.clazzId) { 343 + if (!query.classId) {
406 this.total = 0; 344 this.total = 0;
407 this.tableData = []; 345 this.tableData = [];
408 this.loading = false; 346 this.loading = false;
src/views/examinationPaper/recycle.vue
@@ -57,10 +57,10 @@ @@ -57,10 +57,10 @@
57 > 57 >
58 <el-option 58 <el-option
59 v-for="item in typeList" 59 v-for="item in typeList"
60 - :key="item" 60 + :key="item.label"
61 :label="item.label" 61 :label="item.label"
62 :value="item.value" 62 :value="item.value"
63 - >{{ item }} 63 + >{{ item.label }}
64 </el-option> 64 </el-option>
65 </el-select> 65 </el-select>
66 66
@@ -78,7 +78,7 @@ @@ -78,7 +78,7 @@
78 </el-input> 78 </el-input>
79 </div> 79 </div>
80 </div> 80 </div>
81 - <ul class="content"> 81 + <ul class="content" v-loading="loading">
82 <li class="item" v-for="item in tableData" :key="item.id"> 82 <li class="item" v-for="item in tableData" :key="item.id">
83 <div class="pic-box"> 83 <div class="pic-box">
84 <p class="i-box"><i class="fa fa-map-o"></i></p> 84 <p class="i-box"><i class="fa fa-map-o"></i></p>
@@ -124,6 +124,7 @@ @@ -124,6 +124,7 @@
124 </div> 124 </div>
125 </li> 125 </li>
126 </ul> 126 </ul>
  127 + <el-empty :image-size="100" v-if="tableData&&!tableData.legnth&&loading==false" description="没有更多数据"></el-empty>
127 </div> 128 </div>
128 </template> 129 </template>
129 130
@@ -131,6 +132,7 @@ @@ -131,6 +132,7 @@
131 export default { 132 export default {
132 data() { 133 data() {
133 return { 134 return {
  135 + loading:false,
134 props: { multiple: true, checkStrictly: true }, 136 props: { multiple: true, checkStrictly: true },
135 options: [ 137 options: [
136 { 138 {
@@ -163,55 +165,15 @@ export default { @@ -163,55 +165,15 @@ export default {
163 }, 165 },
164 ], 166 ],
165 query: { 167 query: {
166 - classId: 2003,  
167 - subjectName: "语文",  
168 - tagId: 1, 168 + classId: "",
  169 + subjectName: "",
  170 + tagId: "",
169 title: "", 171 title: "",
170 }, 172 },
171 - classList: [  
172 - {  
173 - label: "2003班",  
174 - value: 2003,  
175 - },  
176 - ],  
177 - subjectList: [  
178 - {  
179 - label: "语文",  
180 - value: "语文",  
181 - },  
182 - ],  
183 - typeList: [  
184 - {  
185 - label: "周测",  
186 - value: 1,  
187 - },  
188 - ],  
189 - tableData: [  
190 - {  
191 - title: "数学样例试卷202211-324654",  
192 - id: "1062837",  
193 - gradeName: "二年级",  
194 - typeName: "周测",  
195 - answerNum: 45,  
196 - time: 90,  
197 - aboutClazz: [203, 204],  
198 - teacher: "张老师",  
199 - date: "2022-11-04 18:09:49",  
200 - share: 1,  
201 - },  
202 - {  
203 - title: "数学样例试卷202211-4180949",  
204 - id: "1062838",  
205 - gradeName: "二年级",  
206 - typeName: "周测",  
207 - answerNum: 45,  
208 - time: 90,  
209 - aboutClazz: [203, 204],  
210 - teacher: "张老师",  
211 - date: "2022-11-04 18:09:49",  
212 - share: 1,  
213 - },  
214 - ], 173 + classList: [],
  174 + subjectList: [],
  175 + typeList: [],
  176 + tableData: null,
215 total: 0, 177 total: 0,
216 }; 178 };
217 }, 179 },
@@ -226,7 +188,7 @@ export default { @@ -226,7 +188,7 @@ export default {
226 //恢复答题卡 188 //恢复答题卡
227 const { data, status, message } = await this.$request.modifyPaper({ 189 const { data, status, message } = await this.$request.modifyPaper({
228 paperId: obj.id, 190 paperId: obj.id,
229 - status: 2, 191 + status: 1,
230 }); 192 });
231 if (status == 0) { 193 if (status == 0) {
232 let type = this.query.title ? 1 : 0; 194 let type = this.query.title ? 1 : 0;
@@ -254,6 +216,7 @@ export default { @@ -254,6 +216,7 @@ export default {
254 }, 216 },
255 async _QueryData(type) { 217 async _QueryData(type) {
256 //获取答题卡列表 218 //获取答题卡列表
  219 + this.loading=true
257 let query = {}; 220 let query = {};
258 if (!type) { 221 if (!type) {
259 this.query.title = ""; 222 this.query.title = "";
@@ -263,14 +226,15 @@ export default { @@ -263,14 +226,15 @@ export default {
263 this.query.type = ""; 226 this.query.type = "";
264 this.query.subjectId = ""; 227 this.query.subjectId = "";
265 } 228 }
  229 + query.classId = this.query.classId;
266 for (let key in query) { 230 for (let key in query) {
267 if (!query[key]) { 231 if (!query[key]) {
268 query[key] = null; 232 query[key] = null;
269 } 233 }
270 } 234 }
271 - this.loading = true;  
272 - const { data, status, message } = await this.$request.fetchAnswerList({ 235 + const { data, status, message } = await this.$request.fetchPaperList({
273 ...query, 236 ...query,
  237 + status:2
274 }); 238 });
275 this.loading = false; 239 this.loading = false;
276 if (status === 0) { 240 if (status === 0) {
@@ -283,15 +247,16 @@ export default { @@ -283,15 +247,16 @@ export default {
283 // 查找班级 247 // 查找班级
284 async _QueryClassList() { 248 async _QueryClassList() {
285 const { data, status, message } = await this.$request.fetchClassList(); 249 const { data, status, message } = await this.$request.fetchClassList();
  250 + console.log(status);
286 if (status === 0) { 251 if (status === 0) {
287 if (!!data.list) { 252 if (!!data.list) {
288 this.classList = data.list.map((item) => { 253 this.classList = data.list.map((item) => {
289 return { 254 return {
290 - value: item.clazzId,  
291 - label: item.clazzName, 255 + value: item.classId,
  256 + label: item.className,
292 }; 257 };
293 }); 258 });
294 - this.query.clazzId = this.classList[0]?.value; 259 + this.query.classId = this.classList[0]?.value;
295 } 260 }
296 } else { 261 } else {
297 this.$message.error(message); 262 this.$message.error(message);
@@ -300,7 +265,7 @@ export default { @@ -300,7 +265,7 @@ export default {
300 // 查找科目 265 // 查找科目
301 async _QuerySubjectList() { 266 async _QuerySubjectList() {
302 const { data, status, message } = await this.$request.fetchSubjectList({ 267 const { data, status, message } = await this.$request.fetchSubjectList({
303 - clazzId: this.query.clazzId, 268 + classId: this.query.classId,
304 }); 269 });
305 if (status === 0) { 270 if (status === 0) {
306 this.subjectList = data.subjectNames.map((item) => { 271 this.subjectList = data.subjectNames.map((item) => {
@@ -309,22 +274,28 @@ export default { @@ -309,22 +274,28 @@ export default {
309 label: item, 274 label: item,
310 }; 275 };
311 }); 276 });
312 - this.query.clazzId = this.subjectList[0]?.value; 277 + this.query.subjectName = this.subjectList[0]?.value;
313 } else { 278 } else {
314 this.$message.error(message); 279 this.$message.error(message);
315 } 280 }
316 }, 281 },
317 // 查找答题卡类型 282 // 查找答题卡类型
318 async _QueryTypeList() { 283 async _QueryTypeList() {
319 - const { data, status, message } = await this.$request.fetchTypeNames(); 284 + const { data, status, message } = await this.$request.fetchTypeNames({
  285 + classId: this.query.classId,
  286 + });
320 if (status === 0) { 287 if (status === 0) {
321 this.typeList = 288 this.typeList =
322 - data.subjectNames.map((item) => { 289 + data.list.map((item) => {
323 return { 290 return {
324 value: item.tagId, 291 value: item.tagId,
325 label: item.tag, 292 label: item.tag,
326 }; 293 };
327 }) || []; 294 }) || [];
  295 + this.typeList.unshift({
  296 + value: "",
  297 + label: "--",
  298 + });
328 } else { 299 } else {
329 this.$message.error(message); 300 this.$message.error(message);
330 } 301 }
vue.config.js
@@ -22,7 +22,7 @@ module.exports = { @@ -22,7 +22,7 @@ module.exports = {
22 }, 22 },
23 proxy: { 23 proxy: {
24 "/": { 24 "/": {
25 - target:"http://192.168.3.29:8080", 25 + target:"http://47.104.214.8",
26 changeOrigin: true, 26 changeOrigin: true,
27 ws:true, 27 ws:true,
28 }, 28 },