Commit 8f573b82501c0067d9b6dad6b009de94c38fc1dc
1 parent
6fffbd55
组卷接口联调
Showing
6 changed files
with
150 additions
and
146 deletions
package.json
@@ -8,17 +8,18 @@ | @@ -8,17 +8,18 @@ | ||
8 | "lint": "vue-cli-service lint" | 8 | "lint": "vue-cli-service lint" |
9 | }, | 9 | }, |
10 | "dependencies": { | 10 | "dependencies": { |
11 | + "axios": "^0.21.1", | ||
11 | "core-js": "^3.6.5", | 12 | "core-js": "^3.6.5", |
12 | "echarts": "5.3.2", | 13 | "echarts": "5.3.2", |
13 | "element-ui": "^2.15.1", | 14 | "element-ui": "^2.15.1", |
15 | + "font-awesome": "^4.7.0", | ||
14 | "js-cookie": "^2.2.0", | 16 | "js-cookie": "^2.2.0", |
15 | "jsencrypt": "^3.2.0", | 17 | "jsencrypt": "^3.2.0", |
16 | "nprogress": "^0.2.0", | 18 | "nprogress": "^0.2.0", |
17 | - "font-awesome": "^4.7.0", | 19 | + "script-ext-html-webpack-plugin": "^2.1.5", |
18 | "vue": "^2.6.11", | 20 | "vue": "^2.6.11", |
19 | "vue-i18n": "^8.4.0", | 21 | "vue-i18n": "^8.4.0", |
20 | "vue-router": "^3.5.1", | 22 | "vue-router": "^3.5.1", |
21 | - "axios": "^0.21.1", | ||
22 | "vuex": "^3.6.2" | 23 | "vuex": "^3.6.2" |
23 | }, | 24 | }, |
24 | "devDependencies": { | 25 | "devDependencies": { |
@@ -26,8 +27,8 @@ | @@ -26,8 +27,8 @@ | ||
26 | "@vue/cli-service": "~4.5.0", | 27 | "@vue/cli-service": "~4.5.0", |
27 | "autoprefixer": "^7.1.2", | 28 | "autoprefixer": "^7.1.2", |
28 | "babel-core": "^6.22.1", | 29 | "babel-core": "^6.22.1", |
29 | - "babel-loader": "^7.1.1", | ||
30 | "babel-eslint": "^10.1.0", | 30 | "babel-eslint": "^10.1.0", |
31 | + "babel-loader": "^7.1.1", | ||
31 | "babel-polyfill": "^6.26.0", | 32 | "babel-polyfill": "^6.26.0", |
32 | "eslint": "^6.7.2", | 33 | "eslint": "^6.7.2", |
33 | "eslint-plugin-vue": "^6.2.2", | 34 | "eslint-plugin-vue": "^6.2.2", |
@@ -35,11 +36,11 @@ | @@ -35,11 +36,11 @@ | ||
35 | "html-webpack-plugin": "^4.2.0", | 36 | "html-webpack-plugin": "^4.2.0", |
36 | "mini-css-extract-plugin": "^0.9.0", | 37 | "mini-css-extract-plugin": "^0.9.0", |
37 | "node-sass": "^4.13.0", | 38 | "node-sass": "^4.13.0", |
38 | - "sass-loader": "^7.1.0", | 39 | + "optimize-css-assets-webpack-plugin": "^3.2.0", |
39 | "postcss-import": "^12.0.1", | 40 | "postcss-import": "^12.0.1", |
40 | "postcss-loader": "^3.0.0", | 41 | "postcss-loader": "^3.0.0", |
41 | "postcss-url": "^7.2.1", | 42 | "postcss-url": "^7.2.1", |
42 | - "optimize-css-assets-webpack-plugin": "^3.2.0", | 43 | + "sass-loader": "^7.1.0", |
43 | "vue-template-compiler": "^2.5.2" | 44 | "vue-template-compiler": "^2.5.2" |
44 | } | 45 | } |
45 | } | 46 | } |
src/api/axios.js
1 | -import axios from "axios" | ||
2 | -import Cookies from "js-cookie" | ||
3 | -import NProgress from "nprogress" | ||
4 | -import { Message } from "element-ui" | ||
5 | -import router from "@/router/index" | ||
6 | -import store from "@/store" | 1 | +import axios from "axios"; |
2 | +import Cookies from "js-cookie"; | ||
3 | +import NProgress from "nprogress"; | ||
4 | +import { Message } from "element-ui"; | ||
5 | +import router from "@/router/index"; | ||
6 | +import store from "@/store"; | ||
7 | import conf from "../config/index"; // 路径配置 | 7 | import conf from "../config/index"; // 路径配置 |
8 | // axios默认配置 | 8 | // axios默认配置 |
9 | const service = axios.create({ | 9 | const service = axios.create({ |
@@ -12,86 +12,84 @@ const service = axios.create({ | @@ -12,86 +12,84 @@ const service = axios.create({ | ||
12 | withCredentials: true, | 12 | withCredentials: true, |
13 | }); | 13 | }); |
14 | // http request 拦截器 | 14 | // http request 拦截器 |
15 | -service.interceptors.request.use(config => { | ||
16 | - NProgress.start() | ||
17 | - config.headers["Content-Type"] = "application/json;charset=UTF-8" | 15 | +service.interceptors.request.use( |
16 | + (config) => { | ||
17 | + NProgress.start(); | ||
18 | + config.headers["Content-Type"] = "application/json;charset=UTF-8"; | ||
18 | 19 | ||
19 | - const source = axios.CancelToken.source(); | ||
20 | - store.commit('setTokenSources', [source.token, source.cancel]) | ||
21 | - config.cancelToken = source.token; | ||
22 | - // if (Cookies.get("access_token")) { | ||
23 | - // config.headers.Authorization = "Bearer" + Cookies.get("access_token") | ||
24 | - // } | ||
25 | - return config | ||
26 | -}, | ||
27 | - error => { | ||
28 | - return Promise.reject(error.response) | ||
29 | - }) | 20 | + const source = axios.CancelToken.source(); |
21 | + store.commit("setTokenSources", [source.token, source.cancel]); | ||
22 | + config.cancelToken = source.token; | ||
23 | + // if (Cookies.get("access_token")) { | ||
24 | + // config.headers.Authorization = "Bearer" + Cookies.get("access_token") | ||
25 | + // } | ||
26 | + return config; | ||
27 | + }, | ||
28 | + (error) => { | ||
29 | + return Promise.reject(error.response); | ||
30 | + } | ||
31 | +); | ||
30 | 32 | ||
31 | // http response 拦截器 | 33 | // http response 拦截器 |
32 | service.interceptors.response.use( | 34 | service.interceptors.response.use( |
33 | - response => { | 35 | + (response) => { |
34 | const res = response.data; | 36 | const res = response.data; |
35 | - NProgress.done() | 37 | + NProgress.done(); |
36 | if (response.config.cancelToken) { | 38 | if (response.config.cancelToken) { |
37 | - store.commit('delTokenSources', response.config.cancelToken) | 39 | + store.commit("delTokenSources", response.config.cancelToken); |
38 | } | 40 | } |
39 | if (response.status == 200) { | 41 | if (response.status == 200) { |
40 | // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | 42 | // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) |
41 | // console.log(response.status) | 43 | // console.log(response.status) |
42 | - if (res.code == 999) { | ||
43 | - if (!location.href.includes('localhost')) { | 44 | + if (res.status == 999) { |
45 | + // if (!location.href.includes("localhost")) { | ||
44 | if (res.data) { | 46 | if (res.data) { |
45 | - window.location.href = res.data | 47 | + window.location.href = res.data; |
46 | } else { | 48 | } else { |
47 | - router.push({ path: '/login' }) | ||
48 | - if (res.message.includes('不存在')) { | 49 | + router.push({ path: "/login" }); |
50 | + if (res.message.includes("不存在")) { | ||
49 | Message({ | 51 | Message({ |
50 | message: res.message, | 52 | message: res.message, |
51 | - type: 'error', | ||
52 | - duration: 3 * 1000 | ||
53 | - }) | 53 | + type: "error", |
54 | + duration: 3 * 1000, | ||
55 | + }); | ||
54 | } | 56 | } |
55 | } | 57 | } |
56 | - } | ||
57 | - return | 58 | + // } |
58 | } else { | 59 | } else { |
59 | // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) | 60 | // Cookies.set("access_token", response.data.message, { expires: 1 / 12 }) |
60 | } | 61 | } |
61 | } | 62 | } |
62 | - console.log(response) | ||
63 | - return Promise.resolve(res) | 63 | + return Promise.resolve(res); |
64 | }, | 64 | }, |
65 | - error => { | 65 | + (error) => { |
66 | Message({ | 66 | Message({ |
67 | - message: error.message, | ||
68 | - type: 'error', | ||
69 | - duration: 3 * 1000 | ||
70 | - }) | 67 | + message: error, |
68 | + type: "error", | ||
69 | + duration: 3 * 1000, | ||
70 | + }); | ||
71 | if (error.response == undefined) { | 71 | if (error.response == undefined) { |
72 | return Promise.reject(error); | 72 | return Promise.reject(error); |
73 | } | 73 | } |
74 | - Message.closeAll() | ||
75 | - const { | ||
76 | - data, | ||
77 | - status | ||
78 | - } = error.response | 74 | + const { data, status } = error.response; |
79 | if (status === 403 || status === 401) { | 75 | if (status === 403 || status === 401) { |
76 | + Message.closeAll(); | ||
80 | Message({ | 77 | Message({ |
81 | - message: data.info||"未登录或登录超时,即将跳转到登录页面", | ||
82 | - type: 'error', | ||
83 | - duration: 3 * 1000 | ||
84 | - }) | ||
85 | - if (!window.location.href.includes('login')) { | 78 | + message: data.info || "未登录或登录超时,即将跳转到登录页面", |
79 | + type: "error", | ||
80 | + duration: 3 * 1000, | ||
81 | + }); | ||
82 | + if (!window.location.href.includes("login")) { | ||
86 | router.push({ | 83 | router.push({ |
87 | - path: '/login', | 84 | + path: "/login", |
88 | query: { | 85 | query: { |
89 | - url: window.location.href | ||
90 | - } | ||
91 | - }) | 86 | + url: window.location.href, |
87 | + }, | ||
88 | + }); | ||
92 | } | 89 | } |
93 | - return | 90 | + return; |
94 | } | 91 | } |
95 | - return Promise.reject(error.response) // 返回接口返回的错误信息 | ||
96 | - }) | ||
97 | -export default service | 92 | + return Promise.reject(error.response); // 返回接口返回的错误信息 |
93 | + } | ||
94 | +); | ||
95 | +export default service; |
src/views/examinationPaper/add.vue
@@ -78,7 +78,7 @@ | @@ -78,7 +78,7 @@ | ||
78 | :key="item.value" | 78 | :key="item.value" |
79 | :label="item.label" | 79 | :label="item.label" |
80 | :value="item.value" | 80 | :value="item.value" |
81 | - > | 81 | + >{{ item.label }} |
82 | </el-option> | 82 | </el-option> |
83 | </el-select> | 83 | </el-select> |
84 | </el-form-item> | 84 | </el-form-item> |
@@ -470,7 +470,7 @@ export default { | @@ -470,7 +470,7 @@ export default { | ||
470 | { label: "判断题", value: 4 }, | 470 | { label: "判断题", value: 4 }, |
471 | { label: "主观题", value: 5 }, | 471 | { label: "主观题", value: 5 }, |
472 | ], | 472 | ], |
473 | - rightOptions: ["A","B","C","D","E","F","G"], | 473 | + rightOptions: ["A", "B", "C", "D", "E", "F", "G"], |
474 | addSubQuestionsType: "", | 474 | addSubQuestionsType: "", |
475 | step: 0, //步骤 | 475 | step: 0, //步骤 |
476 | gradeList: [], //年级 | 476 | gradeList: [], //年级 |
@@ -509,8 +509,9 @@ export default { | @@ -509,8 +509,9 @@ export default { | ||
509 | }; | 509 | }; |
510 | }, | 510 | }, |
511 | async created() { | 511 | async created() { |
512 | - await this._GradeList() | ||
513 | - await this._CreatedTypeList() | 512 | + await this._GradeList(); |
513 | + await this._QuerySubjectList(this.gradeList[0]); | ||
514 | + await this._TypeList(); | ||
514 | this.type = this.$route.query.type ? this.$route.query.type : 1; | 515 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
515 | if (this.type == 2) { | 516 | if (this.type == 2) { |
516 | this._QueryDetail(); | 517 | this._QueryDetail(); |
@@ -630,16 +631,14 @@ export default { | @@ -630,16 +631,14 @@ export default { | ||
630 | }; | 631 | }; |
631 | switch (questionsOptions.questionType) { | 632 | switch (questionsOptions.questionType) { |
632 | case 2: | 633 | case 2: |
633 | - questionsOptions.answerOptions = this.rightOptions.slice( | ||
634 | - 0, | ||
635 | - questionsOptions.selectNum | ||
636 | - ).join(','); | 634 | + questionsOptions.answerOptions = this.rightOptions |
635 | + .slice(0, questionsOptions.selectNum) | ||
636 | + .join(","); | ||
637 | break; | 637 | break; |
638 | case 3: | 638 | case 3: |
639 | - questionsOptions.answerOptions = this.rightOptions.slice( | ||
640 | - 0, | ||
641 | - questionsOptions.selectNum | ||
642 | - ).join(','); | 639 | + questionsOptions.answerOptions = this.rightOptions |
640 | + .slice(0, questionsOptions.selectNum) | ||
641 | + .join(","); | ||
643 | questionsOptions.partScore = 0.5; | 642 | questionsOptions.partScore = 0.5; |
644 | break; | 643 | break; |
645 | case 4: | 644 | case 4: |
@@ -678,16 +677,14 @@ export default { | @@ -678,16 +677,14 @@ export default { | ||
678 | }; | 677 | }; |
679 | switch (questionsOptions.questionType) { | 678 | switch (questionsOptions.questionType) { |
680 | case 2: | 679 | case 2: |
681 | - questionsOptions.answerOptions = this.rightOptions.slice( | ||
682 | - 0, | ||
683 | - questionsOptions.selectNum | ||
684 | - ).join(','); | 680 | + questionsOptions.answerOptions = this.rightOptions |
681 | + .slice(0, questionsOptions.selectNum) | ||
682 | + .join(","); | ||
685 | break; | 683 | break; |
686 | case 3: | 684 | case 3: |
687 | - questionsOptions.answerOptions = this.rightOptions.slice( | ||
688 | - 0, | ||
689 | - questionsOptions.selectNum | ||
690 | - ).join(','); | 685 | + questionsOptions.answerOptions = this.rightOptions |
686 | + .slice(0, questionsOptions.selectNum) | ||
687 | + .join(","); | ||
691 | questionsOptions.partScore = 0.5; | 688 | questionsOptions.partScore = 0.5; |
692 | break; | 689 | break; |
693 | case 4: | 690 | case 4: |
@@ -708,16 +705,14 @@ export default { | @@ -708,16 +705,14 @@ export default { | ||
708 | subQuestions.selectNum = 4; | 705 | subQuestions.selectNum = 4; |
709 | switch (val) { | 706 | switch (val) { |
710 | case 2: | 707 | case 2: |
711 | - subQuestions.answerOptions = that.rightOptions.slice( | ||
712 | - 0, | ||
713 | - subQuestions.selectNum | ||
714 | - ).join(','); | 708 | + subQuestions.answerOptions = that.rightOptions |
709 | + .slice(0, subQuestions.selectNum) | ||
710 | + .join(","); | ||
715 | break; | 711 | break; |
716 | case 3: | 712 | case 3: |
717 | - subQuestions.answerOptions = that.rightOptions.slice( | ||
718 | - 0, | ||
719 | - subQuestions.selectNum | ||
720 | - ).join(','); | 713 | + subQuestions.answerOptions = that.rightOptions |
714 | + .slice(0, subQuestions.selectNum) | ||
715 | + .join(","); | ||
721 | subQuestions.partScore = 0.5; | 716 | subQuestions.partScore = 0.5; |
722 | break; | 717 | break; |
723 | case 4: | 718 | case 4: |
@@ -728,23 +723,21 @@ export default { | @@ -728,23 +723,21 @@ export default { | ||
728 | }, | 723 | }, |
729 | addOptions(subQuestions) { | 724 | addOptions(subQuestions) { |
730 | //添加选项 | 725 | //添加选项 |
731 | - let length = subQuestions.answerOptions.split(',').length; | 726 | + let length = subQuestions.answerOptions.split(",").length; |
732 | if (length > 6) return; | 727 | if (length > 6) return; |
733 | subQuestions.selectNum = length + 1; | 728 | subQuestions.selectNum = length + 1; |
734 | - subQuestions.answerOptions = this.rightOptions.slice( | ||
735 | - 0, | ||
736 | - subQuestions.selectNum | ||
737 | - ).join(','); | 729 | + subQuestions.answerOptions = this.rightOptions |
730 | + .slice(0, subQuestions.selectNum) | ||
731 | + .join(","); | ||
738 | }, | 732 | }, |
739 | removeOptions(subQuestions) { | 733 | removeOptions(subQuestions) { |
740 | //删除选项 | 734 | //删除选项 |
741 | - let length = subQuestions.answerOptions.split(',').length; | 735 | + let length = subQuestions.answerOptions.split(",").length; |
742 | if (length < 2) return; | 736 | if (length < 2) return; |
743 | subQuestions.selectNum = length - 1; | 737 | subQuestions.selectNum = length - 1; |
744 | - subQuestions.answerOptions = this.rightOptions.slice( | ||
745 | - 0, | ||
746 | - subQuestions.selectNum | ||
747 | - ).join(','); | 738 | + subQuestions.answerOptions = this.rightOptions |
739 | + .slice(0, subQuestions.selectNum) | ||
740 | + .join(","); | ||
748 | }, | 741 | }, |
749 | changAnswer(sub, option) { | 742 | changAnswer(sub, option) { |
750 | //设置多选答案 | 743 | //设置多选答案 |
@@ -765,10 +758,10 @@ export default { | @@ -765,10 +758,10 @@ export default { | ||
765 | } | 758 | } |
766 | //添加测验类型 | 759 | //添加测验类型 |
767 | const { data, status, info } = await this.$request.addPaperType({ | 760 | const { data, status, info } = await this.$request.addPaperType({ |
768 | - typeName: this.answerTypeName, | 761 | + tag: this.answerTypeName, |
769 | }); | 762 | }); |
770 | if (status == 0) { | 763 | if (status == 0) { |
771 | - this._CreatedTypeList(); | 764 | + this._TypeList(); |
772 | this.dialogVisible = false; | 765 | this.dialogVisible = false; |
773 | this.answerTypeName = ""; | 766 | this.answerTypeName = ""; |
774 | this.$message.success("添加成功"); | 767 | this.$message.success("添加成功"); |
@@ -777,8 +770,8 @@ export default { | @@ -777,8 +770,8 @@ export default { | ||
777 | } | 770 | } |
778 | }, | 771 | }, |
779 | async save() { | 772 | async save() { |
780 | - if (this.saceLoading) return; | ||
781 | - this.saceLoading = true; | 773 | + if (this.saveLoading) return; |
774 | + this.saveLoading = true; | ||
782 | //添加题目ID、序号 | 775 | //添加题目ID、序号 |
783 | this.form.questionList.map((item, index) => { | 776 | this.form.questionList.map((item, index) => { |
784 | item.questionId = index + 1; | 777 | item.questionId = index + 1; |
@@ -792,7 +785,7 @@ export default { | @@ -792,7 +785,7 @@ export default { | ||
792 | const { data, status, info } = await this.$request.addPaper({ | 785 | const { data, status, info } = await this.$request.addPaper({ |
793 | ...this.form, | 786 | ...this.form, |
794 | }); | 787 | }); |
795 | - this.saceLoading = false; | 788 | + this.saveLoading = false; |
796 | if (status == 0) { | 789 | if (status == 0) { |
797 | this.$router.push({ | 790 | this.$router.push({ |
798 | path: "/examinationPaper", | 791 | path: "/examinationPaper", |
@@ -805,17 +798,20 @@ export default { | @@ -805,17 +798,20 @@ export default { | ||
805 | //切换年级查询科目 | 798 | //切换年级查询科目 |
806 | this._QuerySubjectList(this.form.gradeName); | 799 | this._QuerySubjectList(this.form.gradeName); |
807 | }, | 800 | }, |
808 | - async _CreatedTypeList() { | 801 | + async _TypeList() { |
809 | //测验类型查询 | 802 | //测验类型查询 |
810 | - const { data, status, info } = await this.$request.fetchTypeNames( | ||
811 | - {gradeName :grade} | ||
812 | - ); | 803 | + const { data, status, info } = await this.$request.fetchTypeNames({ |
804 | + gradeName: this.form.gradeName, | ||
805 | + type: 1, | ||
806 | + }); | ||
813 | if (status == 0) { | 807 | if (status == 0) { |
814 | - this.answerTypeList = [...data.list] || []; | ||
815 | - this.answerTypeList.unshift({ | ||
816 | - typeName: "", | ||
817 | - id: "", | ||
818 | - }); | 808 | + this.answerTypeList = |
809 | + data.list.map((item) => { | ||
810 | + return { | ||
811 | + typeName: item.tag, | ||
812 | + id: item.tagId, | ||
813 | + }; | ||
814 | + }) || []; | ||
819 | if (this.type != 2) { | 815 | if (this.type != 2) { |
820 | this.form.tagId = this.answerTypeList[0].id || ""; | 816 | this.form.tagId = this.answerTypeList[0].id || ""; |
821 | } | 817 | } |
@@ -831,26 +827,27 @@ export default { | @@ -831,26 +827,27 @@ export default { | ||
831 | if (this.type != 2) { | 827 | if (this.type != 2) { |
832 | this.form.gradeName = this.gradeList[0]; | 828 | this.form.gradeName = this.gradeList[0]; |
833 | } | 829 | } |
834 | - this._QuerySubjectList(this.gradeList[0]); | ||
835 | } else { | 830 | } else { |
836 | this.$message.error(info); | 831 | this.$message.error(info); |
837 | } | 832 | } |
838 | }, | 833 | }, |
839 | async _QuerySubjectList(grade) { | 834 | async _QuerySubjectList(grade) { |
840 | //查询科目列表 | 835 | //查询科目列表 |
841 | - const { data, status, info } = await this.$request.fetchSubjectList( | ||
842 | - {gradeName :grade} | ||
843 | - ); | 836 | + const { data, status, info } = await this.$request.fetchSubjectList({ |
837 | + gradeName: grade, | ||
838 | + }); | ||
844 | if (status === 0) { | 839 | if (status === 0) { |
845 | - this.subjectList = data.list.map((item) => { | 840 | + this.subjectList = data.subjectNames.map((item) => { |
846 | return { | 841 | return { |
847 | - value: item.subjectName, | ||
848 | - label: item.subjectName, | 842 | + value: item, |
843 | + label: item, | ||
849 | }; | 844 | }; |
850 | }); | 845 | }); |
846 | + console.log(this.subjectList); | ||
851 | if (this.subjectList.length) { | 847 | if (this.subjectList.length) { |
852 | this.form.subjectName = this.subjectList[0].value; | 848 | this.form.subjectName = this.subjectList[0].value; |
853 | } | 849 | } |
850 | + console.log(this.form); | ||
854 | } else { | 851 | } else { |
855 | this.$message.error(info); | 852 | this.$message.error(info); |
856 | } | 853 | } |
@@ -861,10 +858,10 @@ export default { | @@ -861,10 +858,10 @@ export default { | ||
861 | paperId: this.$route.query.paperId, | 858 | paperId: this.$route.query.paperId, |
862 | }); | 859 | }); |
863 | if (status == 0) { | 860 | if (status == 0) { |
864 | - this.form.title = data.title; | 861 | + this.form.title = data.title+'_副本'; |
865 | this.form.tagId = data.tagId; | 862 | this.form.tagId = data.tagId; |
866 | this.form.subjectName = data.subjectName; | 863 | this.form.subjectName = data.subjectName; |
867 | - this.form.gradeName = data.grade; | 864 | + this.form.gradeName = data.gradeName; |
868 | this.form.examsDuration = data.examsDuration; | 865 | this.form.examsDuration = data.examsDuration; |
869 | this.form.sharingType = data.sharingType; | 866 | this.form.sharingType = data.sharingType; |
870 | this.form.questionList = data.questionList?.map((item) => { | 867 | this.form.questionList = data.questionList?.map((item) => { |
@@ -874,8 +871,8 @@ export default { | @@ -874,8 +871,8 @@ export default { | ||
874 | questionType: items.questionType, | 871 | questionType: items.questionType, |
875 | score: items.score, | 872 | score: items.score, |
876 | partScore: items.partScore, | 873 | partScore: items.partScore, |
877 | - selectNum: items.answerOptions.split(',').length, | ||
878 | - answerOptions: items.answerOptions||"A,B,C,D", | 874 | + selectNum: items.answerOptions.split(",").length, |
875 | + answerOptions: items.answerOptions || "A,B,C,D", | ||
879 | correctAnswer: items.correctAnswer, | 876 | correctAnswer: items.correctAnswer, |
880 | }; | 877 | }; |
881 | }) || []; | 878 | }) || []; |
src/views/examinationPaper/edit.vue
@@ -204,8 +204,8 @@ export default { | @@ -204,8 +204,8 @@ export default { | ||
204 | async save() { | 204 | async save() { |
205 | let questionList = this.form.questionList.map((item) => { | 205 | let questionList = this.form.questionList.map((item) => { |
206 | item.score = null; | 206 | item.score = null; |
207 | - items.questionId = ""; | ||
208 | - items.questionIndex = ""; | 207 | + // item.questionId = ""; |
208 | + // item.questionIndex = ""; | ||
209 | return item; | 209 | return item; |
210 | }); | 210 | }); |
211 | //更新答题卡 | 211 | //更新答题卡 |
src/views/examinationPaper/index.vue
@@ -87,7 +87,7 @@ | @@ -87,7 +87,7 @@ | ||
87 | </div> | 87 | </div> |
88 | <div class="info"> | 88 | <div class="info"> |
89 | <p class="title"> | 89 | <p class="title"> |
90 | - {{ item.title }} <span class="label">{{ item.tag }}</span> | 90 | + {{ item.title }} <span class="label" v-if="item.tag">{{ item.tag }}</span> |
91 | </p> | 91 | </p> |
92 | <p class="num"> | 92 | <p class="num"> |
93 | 总题数:{{ item.questionNum }} | 93 | 总题数:{{ item.questionNum }} |
@@ -104,7 +104,7 @@ | @@ -104,7 +104,7 @@ | ||
104 | indexs != item.classList.length-1? "、" : "" | 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 |
108 | ></span> | 108 | ></span> |
109 | </p> | 109 | </p> |
110 | <p class="person"> | 110 | <p class="person"> |
@@ -134,7 +134,7 @@ | @@ -134,7 +134,7 @@ | ||
134 | icon="el-icon-more" | 134 | icon="el-icon-more" |
135 | ></el-button> | 135 | ></el-button> |
136 | <el-dropdown-menu slot="dropdown"> | 136 | <el-dropdown-menu slot="dropdown"> |
137 | - <el-dropdown-item :command="1" v-if="userId == item.id" | 137 | + <el-dropdown-item :command="1" v-if="userName == item.realName" |
138 | >修改分享范围</el-dropdown-item | 138 | >修改分享范围</el-dropdown-item |
139 | > | 139 | > |
140 | <el-dropdown-item :command="2">复制</el-dropdown-item> | 140 | <el-dropdown-item :command="2">复制</el-dropdown-item> |
@@ -147,9 +147,9 @@ | @@ -147,9 +147,9 @@ | ||
147 | <el-dialog title="选择分享范围" :visible.sync="dialogVisible" width="400"> | 147 | <el-dialog title="选择分享范围" :visible.sync="dialogVisible" width="400"> |
148 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> | 148 | <el-form :model="shareForm" :rules="shareRulesForm" label-width="160px"> |
149 | <el-form-item prop="share" label="分享范围:"> | 149 | <el-form-item prop="share" label="分享范围:"> |
150 | - <el-radio-group v-model="shareForm.share"> | ||
151 | - <el-radio :label="1">任课班级分享</el-radio> | ||
152 | - <el-radio :label="2">全年级分享</el-radio> | 150 | + <el-radio-group v-model="shareForm.sharingType"> |
151 | + <el-radio :label="0">任课班级分享</el-radio> | ||
152 | + <el-radio :label="1">全年级分享</el-radio> | ||
153 | </el-radio-group> | 153 | </el-radio-group> |
154 | </el-form-item> | 154 | </el-form-item> |
155 | </el-form> | 155 | </el-form> |
@@ -166,7 +166,7 @@ export default { | @@ -166,7 +166,7 @@ export default { | ||
166 | name: "examinationPaper", | 166 | name: "examinationPaper", |
167 | data() { | 167 | data() { |
168 | return { | 168 | return { |
169 | - userId: "", | 169 | + userName: "", |
170 | dialogVisible: false, | 170 | dialogVisible: false, |
171 | query: { | 171 | query: { |
172 | classId: "", | 172 | classId: "", |
@@ -181,17 +181,17 @@ export default { | @@ -181,17 +181,17 @@ export default { | ||
181 | tableData: [], | 181 | tableData: [], |
182 | shareForm: { | 182 | shareForm: { |
183 | id: "", | 183 | id: "", |
184 | - share: 1, | 184 | + sharingType: 1,//0-任课班级/1-全年级 |
185 | }, | 185 | }, |
186 | shareRulesForm: { | 186 | shareRulesForm: { |
187 | - share: [{ required: true, message: "选择分享范围", trigger: "blur" }], | 187 | + sharingType: [{ required: true, message: "选择分享范围", trigger: "blur" }], |
188 | }, | 188 | }, |
189 | page: 1, | 189 | page: 1, |
190 | size: 20, | 190 | size: 20, |
191 | }; | 191 | }; |
192 | }, | 192 | }, |
193 | async created() { | 193 | async created() { |
194 | - this.userId = this.$store.getters.info.uid || ""; | 194 | + this.userName = this.$store.getters.info.name || ""; |
195 | await this._QueryClassList(); | 195 | await this._QueryClassList(); |
196 | await this._QuerySubjectList(); | 196 | await this._QuerySubjectList(); |
197 | this._QueryData(); | 197 | this._QueryData(); |
@@ -220,7 +220,7 @@ export default { | @@ -220,7 +220,7 @@ export default { | ||
220 | case 1: | 220 | case 1: |
221 | //修改分享范围 | 221 | //修改分享范围 |
222 | that.shareForm.id = item.id; | 222 | that.shareForm.id = item.id; |
223 | - that.shareForm.share = item.share || 1; | 223 | + that.shareForm.sharingType = item.sharingType || 1; |
224 | that.dialogVisible = true; | 224 | that.dialogVisible = true; |
225 | break; | 225 | break; |
226 | case 2: | 226 | case 2: |
@@ -236,14 +236,15 @@ export default { | @@ -236,14 +236,15 @@ export default { | ||
236 | async saveShare() { | 236 | async saveShare() { |
237 | //修改分享范围 | 237 | //修改分享范围 |
238 | const { data, status, info } = await this.$request.modifyPaper({ | 238 | const { data, status, info } = await this.$request.modifyPaper({ |
239 | - paperId: that.shareForm.id, | ||
240 | - sharingType: that.shareForm.share, | 239 | + paperId: this.shareForm.id, |
240 | + sharingType: this.shareForm.sharingType, | ||
241 | }); | 241 | }); |
242 | this.loading = false; | 242 | this.loading = false; |
243 | if (status === 0) { | 243 | if (status === 0) { |
244 | this.shareForm.id = ""; | 244 | this.shareForm.id = ""; |
245 | - this.shareForm.share = 1; | ||
246 | - dialogVisible = false; | 245 | + this.shareForm.sharingType = 1; |
246 | + this.dialogVisible = false; | ||
247 | + this.$message.success(info) | ||
247 | } else { | 248 | } else { |
248 | this.$message.error(info); | 249 | this.$message.error(info); |
249 | } | 250 | } |
@@ -271,6 +272,7 @@ export default { | @@ -271,6 +272,7 @@ export default { | ||
271 | async _QueryTypeList() { | 272 | async _QueryTypeList() { |
272 | const { data, status, info } = await this.$request.fetchTypeNames({ | 273 | const { data, status, info } = await this.$request.fetchTypeNames({ |
273 | classId: this.query.classId, | 274 | classId: this.query.classId, |
275 | + type:0 | ||
274 | }); | 276 | }); |
275 | if (status === 0) { | 277 | if (status === 0) { |
276 | this.typeList = | 278 | this.typeList = |
@@ -355,6 +357,7 @@ export default { | @@ -355,6 +357,7 @@ export default { | ||
355 | }); | 357 | }); |
356 | this.loading = false; | 358 | this.loading = false; |
357 | if (status === 0) { | 359 | if (status === 0) { |
360 | + this.archivedTotal = data.archivedTotal | ||
358 | this.total = data.total; | 361 | this.total = data.total; |
359 | this.tableData = (data.list && [...data.list]) || []; | 362 | this.tableData = (data.list && [...data.list]) || []; |
360 | } else { | 363 | } else { |
@@ -443,7 +446,11 @@ export default { | @@ -443,7 +446,11 @@ export default { | ||
443 | color: #667ffd; | 446 | color: #667ffd; |
444 | font-weight: 500; | 447 | font-weight: 500; |
445 | position: relative; | 448 | position: relative; |
446 | - margin-right: 8px; | 449 | + position: relative; |
450 | + &.active:after{ | ||
451 | + content: "\e79c"; | ||
452 | + color: #667ffd; | ||
453 | + } | ||
447 | .el-icon-success { | 454 | .el-icon-success { |
448 | position: absolute; | 455 | position: absolute; |
449 | right: 0; | 456 | right: 0; |
src/views/examinationPaper/recycle.vue
@@ -86,7 +86,7 @@ | @@ -86,7 +86,7 @@ | ||
86 | </div> | 86 | </div> |
87 | <div class="info"> | 87 | <div class="info"> |
88 | <p class="title"> | 88 | <p class="title"> |
89 | - {{ item.title }} <span class="label">{{ item.tag }}</span> | 89 | + {{ item.title }} <span class="label" v-if="item.tag">{{ item.tag }}</span> |
90 | </p> | 90 | </p> |
91 | <p class="num"> | 91 | <p class="num"> |
92 | {{ item.gradeName }} | 92 | {{ item.gradeName }} |
@@ -124,7 +124,7 @@ | @@ -124,7 +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 | + <el-empty :image-size="100" v-if="!tableData.length&&loading==false" description="没有更多数据"></el-empty> |
128 | </div> | 128 | </div> |
129 | </template> | 129 | </template> |
130 | 130 | ||
@@ -283,6 +283,7 @@ export default { | @@ -283,6 +283,7 @@ export default { | ||
283 | async _QueryTypeList() { | 283 | async _QueryTypeList() { |
284 | const { data, status, info } = await this.$request.fetchTypeNames({ | 284 | const { data, status, info } = await this.$request.fetchTypeNames({ |
285 | classId: this.query.classId, | 285 | classId: this.query.classId, |
286 | + tyle:0 | ||
286 | }); | 287 | }); |
287 | if (status === 0) { | 288 | if (status === 0) { |
288 | this.typeList = | 289 | this.typeList = |