Commit 5424ef82f9e020408262626018d1c7651a783cc0

Authored by 梁保满
1 parent ee6e7628

接口调整

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