Commit ddcd75d7fd690526dfacd033d635167296859b8e
1 parent
c410e3c4
教师二次管理数据问题
Showing
6 changed files
with
843 additions
and
415 deletions
src/views/basic/ask/analysis.vue
@@ -167,16 +167,17 @@ export default { | @@ -167,16 +167,17 @@ export default { | ||
167 | }, | 167 | }, |
168 | methods: { | 168 | methods: { |
169 | print() { | 169 | print() { |
170 | + let title = this.detail.title || this.subjectNames.join(); | ||
170 | let name = ""; | 171 | let name = ""; |
171 | this.tabList.map((item) => { | 172 | this.tabList.map((item) => { |
172 | if (item.value == this.type) { | 173 | if (item.value == this.type) { |
173 | name = item.name; | 174 | name = item.name; |
174 | } | 175 | } |
175 | }); | 176 | }); |
176 | - tablePrint( | ||
177 | - "print-content", | ||
178 | - (this.detail.title || this.subjectNames.join()) + "_" + name | ||
179 | - ); | 177 | + if (this.types == 2) { |
178 | + title = this.subjectNames.join(); | ||
179 | + } | ||
180 | + tablePrint("print-content", this.className + title + "_" + name); | ||
180 | }, | 181 | }, |
181 | setType(type) { | 182 | setType(type) { |
182 | this.type = type; | 183 | this.type = type; |
src/views/basic/setUp/teacher.vue
@@ -993,10 +993,6 @@ export default { | @@ -993,10 +993,6 @@ export default { | ||
993 | ...query, | 993 | ...query, |
994 | }); | 994 | }); |
995 | if (status === 0) { | 995 | if (status === 0) { |
996 | - this.classList = []; | ||
997 | - this.gradeClassList = []; | ||
998 | - this.gradeClassSubList = []; | ||
999 | - this.gradeSubListClass = []; | ||
1000 | this.gradeList = | 996 | this.gradeList = |
1001 | data.list?.map((item) => { | 997 | data.list?.map((item) => { |
1002 | let subList = item.subjectNames?.map((items) => { | 998 | let subList = item.subjectNames?.map((items) => { |
@@ -1019,20 +1015,6 @@ export default { | @@ -1019,20 +1015,6 @@ export default { | ||
1019 | }; | 1015 | }; |
1020 | }), | 1016 | }), |
1021 | }); | 1017 | }); |
1022 | - | ||
1023 | - let subjectNames = item.classList.map((clazz) => { | ||
1024 | - return { | ||
1025 | - value: clazz.subjectName, | ||
1026 | - label: clazz.subjectName, | ||
1027 | - children: [ | ||
1028 | - { | ||
1029 | - value: clazz.id, | ||
1030 | - label: clazz.className, | ||
1031 | - }, | ||
1032 | - ], | ||
1033 | - }; | ||
1034 | - }); | ||
1035 | - | ||
1036 | //学校-科目-班级 | 1018 | //学校-科目-班级 |
1037 | this.gradeSubListClass.push({ | 1019 | this.gradeSubListClass.push({ |
1038 | value: item.grade, | 1020 | value: item.grade, |
@@ -1063,6 +1045,7 @@ export default { | @@ -1063,6 +1045,7 @@ export default { | ||
1063 | }), | 1045 | }), |
1064 | }); | 1046 | }); |
1065 | } else { | 1047 | } else { |
1048 | + this.gradeClassSubList = []; | ||
1066 | if (this.query.classType == 0) { | 1049 | if (this.query.classType == 0) { |
1067 | //学校-年级-科目 | 1050 | //学校-年级-科目 |
1068 | this.gradeClassSubList.push({ | 1051 | this.gradeClassSubList.push({ |
src/views/basic/test/index.vue
@@ -157,14 +157,14 @@ export default { | @@ -157,14 +157,14 @@ export default { | ||
157 | } | 157 | } |
158 | }, | 158 | }, |
159 | handleCheckAllChangeSub(val) { | 159 | handleCheckAllChangeSub(val) { |
160 | - this.isIndeterminate = false; | 160 | + this.isIndeterminateSub = false; |
161 | this.query.subjectNames = val ? this.subjectList : []; | 161 | this.query.subjectNames = val ? this.subjectList : []; |
162 | }, | 162 | }, |
163 | CheckedSub(value) { | 163 | CheckedSub(value) { |
164 | console.log(value); | 164 | console.log(value); |
165 | let checkedCount = value.length; | 165 | let checkedCount = value.length; |
166 | this.allSubject = checkedCount === this.subjectList.length; | 166 | this.allSubject = checkedCount === this.subjectList.length; |
167 | - this.isIndeterminate = | 167 | + this.isIndeterminateSub = |
168 | checkedCount > 0 && checkedCount < this.subjectList.length; | 168 | checkedCount > 0 && checkedCount < this.subjectList.length; |
169 | }, | 169 | }, |
170 | setDate(index) { | 170 | setDate(index) { |
src/views/examinationPaper/add.vue
@@ -805,70 +805,26 @@ | @@ -805,70 +805,26 @@ | ||
805 | </div> | 805 | </div> |
806 | <template v-if="isUpload"> | 806 | <template v-if="isUpload"> |
807 | <div class="qs-upload"> | 807 | <div class="qs-upload"> |
808 | - <el-popover placement="right" width="600" trigger="click"> | ||
809 | - <div class="screenshot-box"> | ||
810 | - <iframe | ||
811 | - class="screenshot" | ||
812 | - v-if="subQuestions.screenshot" | ||
813 | - :src="subQuestions.screenshot" | ||
814 | - ></iframe> | ||
815 | - <p style="textalign: center"> | ||
816 | - <el-button | ||
817 | - type="primary" | ||
818 | - round | ||
819 | - size="mini" | ||
820 | - icon="el-icon-upload" | ||
821 | - @click="openStem(subQuestions, index, indexs, 1)" | ||
822 | - >{{ | ||
823 | - subQuestions.screenshot | ||
824 | - ? "重新选择图片" | ||
825 | - : "上传题干" | ||
826 | - }}</el-button | ||
827 | - > | ||
828 | - </p> | ||
829 | - </div> | ||
830 | - <el-button | ||
831 | - slot="reference" | ||
832 | - class="icon-tickets" | ||
833 | - type="primary" | ||
834 | - circle | ||
835 | - size="mini" | ||
836 | - icon="el-icon-tickets" | ||
837 | - ></el-button> | ||
838 | - </el-popover> | 808 | + <el-button |
809 | + slot="reference" | ||
810 | + class="icon-tickets" | ||
811 | + type="primary" | ||
812 | + circle | ||
813 | + size="mini" | ||
814 | + icon="el-icon-tickets" | ||
815 | + @click="openStem(subQuestions, index, indexs, 1)" | ||
816 | + ></el-button> | ||
839 | </div> | 817 | </div> |
840 | <div class="qs-upload"> | 818 | <div class="qs-upload"> |
841 | - <el-popover placement="right" width="600" trigger="click"> | ||
842 | - <div class="screenshot-box"> | ||
843 | - <iframe | ||
844 | - class="screenshot" | ||
845 | - v-if="subQuestions.answerScreenshot" | ||
846 | - :src="subQuestions.answerScreenshot" | ||
847 | - ></iframe> | ||
848 | - <p style="textalign: center"> | ||
849 | - <el-button | ||
850 | - type="primary" | ||
851 | - round | ||
852 | - size="mini" | ||
853 | - icon="el-icon-upload" | ||
854 | - @click="openStem(subQuestions, index, indexs, 2)" | ||
855 | - >{{ | ||
856 | - subQuestions.answerScreenshot | ||
857 | - ? "重新选择图片" | ||
858 | - : "上传题目解析" | ||
859 | - }}</el-button | ||
860 | - > | ||
861 | - </p> | ||
862 | - </div> | ||
863 | - <el-button | ||
864 | - slot="reference" | ||
865 | - class="icon-tickets" | ||
866 | - type="primary" | ||
867 | - circle | ||
868 | - size="mini" | ||
869 | - icon="el-icon-tickets" | ||
870 | - ></el-button> | ||
871 | - </el-popover> | 819 | + <el-button |
820 | + slot="reference" | ||
821 | + class="icon-tickets" | ||
822 | + type="primary" | ||
823 | + circle | ||
824 | + size="mini" | ||
825 | + icon="el-icon-tickets" | ||
826 | + @click="openStem(subQuestions, index, indexs, 2)" | ||
827 | + ></el-button> | ||
872 | </div> | 828 | </div> |
873 | <div class="qs-upload"> | 829 | <div class="qs-upload"> |
874 | <el-button | 830 | <el-button |
@@ -1039,20 +995,26 @@ | @@ -1039,20 +995,26 @@ | ||
1039 | width="500" | 995 | width="500" |
1040 | > | 996 | > |
1041 | <div class="upload-box"> | 997 | <div class="upload-box"> |
1042 | - <template v-show="stem.type == 1"> | ||
1043 | - <iframe | ||
1044 | - class="screenshot" | ||
1045 | - v-if="stem.screenshot" | ||
1046 | - :src="stem.screenshot" | ||
1047 | - ></iframe> | ||
1048 | - </template> | ||
1049 | - <template v-show="stem.type == 2"> | ||
1050 | - <iframe | ||
1051 | - class="screenshot" | ||
1052 | - v-if="stem.answerScreenshot" | ||
1053 | - :src="stem.answerScreenshot" | ||
1054 | - ></iframe> | ||
1055 | - </template> | 998 | + <div v-loading="iframeLoading"> |
999 | + <template v-if="stem.type == 1"> | ||
1000 | + <iframe | ||
1001 | + ref="screenshot" | ||
1002 | + class="screenshot" | ||
1003 | + v-if="stem.screenshot" | ||
1004 | + :src="stem.screenshot" | ||
1005 | + @load="iframeLoading = false" | ||
1006 | + ></iframe> | ||
1007 | + </template> | ||
1008 | + <template v-else="stem.type == 2"> | ||
1009 | + <iframe | ||
1010 | + ref="screenshot" | ||
1011 | + class="screenshot" | ||
1012 | + v-if="stem.answerScreenshot" | ||
1013 | + :src="stem.answerScreenshot" | ||
1014 | + @load="iframeLoading = false" | ||
1015 | + ></iframe> | ||
1016 | + </template> | ||
1017 | + </div> | ||
1056 | <el-upload | 1018 | <el-upload |
1057 | class="upload-demo" | 1019 | class="upload-demo" |
1058 | :action="uploadUrl" | 1020 | :action="uploadUrl" |
@@ -1254,6 +1216,7 @@ export default { | @@ -1254,6 +1216,7 @@ export default { | ||
1254 | listType: 1, | 1216 | listType: 1, |
1255 | listShare: 0, | 1217 | listShare: 0, |
1256 | uploadUrl: "/file/uploadImgToHtml", | 1218 | uploadUrl: "/file/uploadImgToHtml", |
1219 | + iframeLoading: false, | ||
1257 | }; | 1220 | }; |
1258 | }, | 1221 | }, |
1259 | async created() { | 1222 | async created() { |
@@ -1292,13 +1255,20 @@ export default { | @@ -1292,13 +1255,20 @@ export default { | ||
1292 | // v1.5 | 1255 | // v1.5 |
1293 | //上传截图 | 1256 | //上传截图 |
1294 | openStem(obj, index, indexs, type) { | 1257 | openStem(obj, index, indexs, type) { |
1258 | + this.iframeLoading = true; | ||
1295 | this.stem.index = index; | 1259 | this.stem.index = index; |
1296 | this.stem.indexs = indexs; | 1260 | this.stem.indexs = indexs; |
1297 | this.stem.type = type; | 1261 | this.stem.type = type; |
1298 | if (type == 1) { | 1262 | if (type == 1) { |
1263 | + if (obj.screenshot == "") { | ||
1264 | + this.iframeLoading = false; | ||
1265 | + } | ||
1299 | this.stem.screenshot = obj.screenshot || ""; | 1266 | this.stem.screenshot = obj.screenshot || ""; |
1300 | this.stem.answerScreenshot = ""; | 1267 | this.stem.answerScreenshot = ""; |
1301 | } else { | 1268 | } else { |
1269 | + if (obj.answerScreenshot == "") { | ||
1270 | + this.iframeLoading = false; | ||
1271 | + } | ||
1302 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 1272 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
1303 | this.stem.screenshot = ""; | 1273 | this.stem.screenshot = ""; |
1304 | } | 1274 | } |
src/views/examinationPaper/addQs.vue
@@ -7,32 +7,71 @@ | @@ -7,32 +7,71 @@ | ||
7 | </template> | 7 | </template> |
8 | </back-box> | 8 | </back-box> |
9 | <div class="content"> | 9 | <div class="content"> |
10 | - <el-steps :active="step" finish-status="success" simple style="margin: 20px 0"> | 10 | + <el-steps |
11 | + :active="step" | ||
12 | + finish-status="success" | ||
13 | + simple | ||
14 | + style="margin: 20px 0" | ||
15 | + > | ||
11 | <el-step title="基础信息" icon="el-icon-edit"></el-step> | 16 | <el-step title="基础信息" icon="el-icon-edit"></el-step> |
12 | <el-step title="题目编辑" icon="el-icon-tickets"></el-step> | 17 | <el-step title="题目编辑" icon="el-icon-tickets"></el-step> |
13 | <el-step title="课件预览" icon="el-icon-edit-outline"></el-step> | 18 | <el-step title="课件预览" icon="el-icon-edit-outline"></el-step> |
14 | </el-steps> | 19 | </el-steps> |
15 | <div v-show="step == 0"> | 20 | <div v-show="step == 0"> |
16 | - <el-form ref="forms" :model="form" :rules="formRules" label-width="140px"> | 21 | + <el-form |
22 | + ref="forms" | ||
23 | + :model="form" | ||
24 | + :rules="formRules" | ||
25 | + label-width="140px" | ||
26 | + > | ||
17 | <el-form-item label="课件名称:" prop="title"> | 27 | <el-form-item label="课件名称:" prop="title"> |
18 | - <el-input class="sel2" type="text" placeholder="请输入答题卡名称" v-model.trim="form.title" maxlength="50" size="45" | ||
19 | - show-word-limit> | 28 | + <el-input |
29 | + class="sel2" | ||
30 | + type="text" | ||
31 | + placeholder="请输入答题卡名称" | ||
32 | + v-model.trim="form.title" | ||
33 | + maxlength="50" | ||
34 | + size="45" | ||
35 | + show-word-limit | ||
36 | + > | ||
20 | </el-input> | 37 | </el-input> |
21 | </el-form-item> | 38 | </el-form-item> |
22 | - <el-form-item v-if="role != 'ROLE_PERSONAL'" label="年级:" prop="gradeName"> | ||
23 | - <el-select class="sel" v-model="form.gradeName" placeholder="" @change="changeGrade"> | ||
24 | - <el-option v-for="item in gradeList" :key="item" :label="item" :value="item"> | 39 | + <el-form-item |
40 | + v-if="role != 'ROLE_PERSONAL'" | ||
41 | + label="年级:" | ||
42 | + prop="gradeName" | ||
43 | + > | ||
44 | + <el-select | ||
45 | + class="sel" | ||
46 | + v-model="form.gradeName" | ||
47 | + placeholder="" | ||
48 | + @change="changeGrade" | ||
49 | + > | ||
50 | + <el-option | ||
51 | + v-for="item in gradeList" | ||
52 | + :key="item" | ||
53 | + :label="item" | ||
54 | + :value="item" | ||
55 | + > | ||
25 | </el-option> | 56 | </el-option> |
26 | </el-select> | 57 | </el-select> |
27 | </el-form-item> | 58 | </el-form-item> |
28 | <el-form-item label="科目:" prop="subjectName"> | 59 | <el-form-item label="科目:" prop="subjectName"> |
29 | <el-select class="sel" v-model="form.subjectName" placeholder=""> | 60 | <el-select class="sel" v-model="form.subjectName" placeholder=""> |
30 | - <el-option v-for="item in subjectList" :key="item.value" :label="item.label" :value="item.value">{{ | ||
31 | - item.label }} | 61 | + <el-option |
62 | + v-for="item in subjectList" | ||
63 | + :key="item.value" | ||
64 | + :label="item.label" | ||
65 | + :value="item.value" | ||
66 | + >{{ item.label }} | ||
32 | </el-option> | 67 | </el-option> |
33 | </el-select> | 68 | </el-select> |
34 | </el-form-item> | 69 | </el-form-item> |
35 | - <el-form-item v-if="role != 'ROLE_PERSONAL'" label="分享范围:" prop="sharingType"> | 70 | + <el-form-item |
71 | + v-if="role != 'ROLE_PERSONAL'" | ||
72 | + label="分享范围:" | ||
73 | + prop="sharingType" | ||
74 | + > | ||
36 | <el-radio-group v-model="form.sharingType"> | 75 | <el-radio-group v-model="form.sharingType"> |
37 | <el-radio :label="0">任课班级分享</el-radio> | 76 | <el-radio :label="0">任课班级分享</el-radio> |
38 | <el-radio :label="1">全年级分享</el-radio> | 77 | <el-radio :label="1">全年级分享</el-radio> |
@@ -40,7 +79,9 @@ | @@ -40,7 +79,9 @@ | ||
40 | </el-form-item> | 79 | </el-form-item> |
41 | </el-form> | 80 | </el-form> |
42 | <div class="btn-box"> | 81 | <div class="btn-box"> |
43 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 82 | + <el-button type="danger" plain round @click="linkBack" |
83 | + >取消</el-button | ||
84 | + > | ||
44 | <el-button type="primary" round @click="setStep1">下一步</el-button> | 85 | <el-button type="primary" round @click="setStep1">下一步</el-button> |
45 | </div> | 86 | </div> |
46 | </div> | 87 | </div> |
@@ -64,78 +105,174 @@ | @@ -64,78 +105,174 @@ | ||
64 | </ul> | 105 | </ul> |
65 | <template v-for="(question, index) in form.questionList"> | 106 | <template v-for="(question, index) in form.questionList"> |
66 | <ul class="questions-ul"> | 107 | <ul class="questions-ul"> |
67 | - <li v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> | ||
68 | - <p class="set-ans-btn" v-if="subQuestions.qusType && | ||
69 | - subQuestions.subNum && | ||
70 | - subQuestions.subNum > 4 | ||
71 | - "> | ||
72 | - <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button> | 108 | + <li |
109 | + v-for="(subQuestions, indexs) in question.subQuestions" | ||
110 | + :key="indexs" | ||
111 | + > | ||
112 | + <p | ||
113 | + class="set-ans-btn" | ||
114 | + v-if=" | ||
115 | + subQuestions.qusType && | ||
116 | + subQuestions.subNum && | ||
117 | + subQuestions.subNum > 4 | ||
118 | + " | ||
119 | + > | ||
120 | + <el-button type="primary" @click="setFormAns(indexs, index)" | ||
121 | + >批量设置答案</el-button | ||
122 | + > | ||
73 | </p> | 123 | </p> |
74 | <div v-else class="sub-questions"> | 124 | <div v-else class="sub-questions"> |
75 | <div class="qs-num"> | 125 | <div class="qs-num"> |
76 | {{ setNum(index, indexs, subQuestions) }} | 126 | {{ setNum(index, indexs, subQuestions) }} |
77 | </div> | 127 | </div> |
78 | <div class="qs-type"> | 128 | <div class="qs-type"> |
79 | - <el-select v-model="subQuestions.questionType" placeholder="选择题目类型" | ||
80 | - @change="changeSubQuestions($event, subQuestions)"> | ||
81 | - <el-option v-for="options in questionOptions" :key="options.value" :label="options.label" | ||
82 | - :value="options.value"></el-option> | 129 | + <el-select |
130 | + v-model="subQuestions.questionType" | ||
131 | + placeholder="选择题目类型" | ||
132 | + @change="changeSubQuestions($event, subQuestions)" | ||
133 | + > | ||
134 | + <el-option | ||
135 | + v-for="options in questionOptions" | ||
136 | + :key="options.value" | ||
137 | + :label="options.label" | ||
138 | + :value="options.value" | ||
139 | + ></el-option> | ||
83 | </el-select> | 140 | </el-select> |
84 | </div> | 141 | </div> |
85 | <div class="qs-score"> | 142 | <div class="qs-score"> |
86 | - <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" | ||
87 | - v-model="subQuestions.score" label="单题分值"></el-input-number> | 143 | + <el-input-number |
144 | + class="number-ipt" | ||
145 | + size="medium" | ||
146 | + :min="1" | ||
147 | + :max="200" | ||
148 | + :precision="2" | ||
149 | + v-model="subQuestions.score" | ||
150 | + label="单题分值" | ||
151 | + ></el-input-number> | ||
88 | </div> | 152 | </div> |
89 | <div class="qs-partScore"> | 153 | <div class="qs-partScore"> |
90 | <p v-if="subQuestions.questionType != 3">--</p> | 154 | <p v-if="subQuestions.questionType != 3">--</p> |
91 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | ||
92 | - :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" | ||
93 | - label="漏选得分"></el-input-number> | 155 | + <el-input-number |
156 | + class="number-ipt" | ||
157 | + v-else | ||
158 | + size="medium" | ||
159 | + :min="0" | ||
160 | + :precision="2" | ||
161 | + :max="subQuestions.score" | ||
162 | + :step="0.5" | ||
163 | + v-model="subQuestions.partScore" | ||
164 | + label="漏选得分" | ||
165 | + ></el-input-number> | ||
94 | </div> | 166 | </div> |
95 | <div class="qs-options qs-options2"> | 167 | <div class="qs-options qs-options2"> |
96 | <p v-if="subQuestions.questionType == 5">--</p> | 168 | <p v-if="subQuestions.questionType == 5">--</p> |
97 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 169 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
98 | - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
99 | - @click="subQuestions.correctAnswer = 1">✓</span> | ||
100 | - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
101 | - @click="subQuestions.correctAnswer = 2">✗</span> | 170 | + <span |
171 | + class="answer-s" | ||
172 | + :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
173 | + @click="subQuestions.correctAnswer = 1" | ||
174 | + >✓</span | ||
175 | + > | ||
176 | + <span | ||
177 | + class="answer-s" | ||
178 | + :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
179 | + @click="subQuestions.correctAnswer = 2" | ||
180 | + >✗</span | ||
181 | + > | ||
102 | </p> | 182 | </p> |
103 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 183 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
104 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer?.includes(option) | ||
105 | - ? 'active' | ||
106 | - : '' | ||
107 | - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | 184 | + <span |
185 | + class="answer-s" | ||
186 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
187 | + :class=" | ||
188 | + subQuestions.correctAnswer?.includes(option) | ||
189 | + ? 'active' | ||
190 | + : '' | ||
191 | + " | ||
192 | + :key="option" | ||
193 | + @click="changAnswer(subQuestions, option)" | ||
194 | + >{{ option }}</span | ||
195 | + > | ||
108 | </p> | 196 | </p> |
109 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 197 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
110 | - <span class="answer-s" v-for="option in subQuestions.answerOptions.split(',')" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
111 | - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | 198 | + <span |
199 | + class="answer-s" | ||
200 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
201 | + :class=" | ||
202 | + subQuestions.correctAnswer == option ? 'active' : '' | ||
203 | + " | ||
204 | + :key="option" | ||
205 | + @click="subQuestions.correctAnswer = option" | ||
206 | + >{{ option }}</span | ||
207 | + > | ||
112 | </p> | 208 | </p> |
113 | - <p v-if="subQuestions.questionType == 3 || | ||
114 | - subQuestions.questionType == 2 | ||
115 | - " class="answer-box answer-box2"> | ||
116 | - <el-button size="mini" type="primary" icon="el-icon-plus" circle | ||
117 | - @click="addOptions(subQuestions)"></el-button> | ||
118 | - <el-button size="mini" type="primary" icon="el-icon-minus" round circle | ||
119 | - @click="removeOptions(subQuestions)"></el-button> | 209 | + <p |
210 | + v-if=" | ||
211 | + subQuestions.questionType == 3 || | ||
212 | + subQuestions.questionType == 2 | ||
213 | + " | ||
214 | + class="answer-box answer-box2" | ||
215 | + > | ||
216 | + <el-button | ||
217 | + size="mini" | ||
218 | + type="primary" | ||
219 | + icon="el-icon-plus" | ||
220 | + circle | ||
221 | + @click="addOptions(subQuestions)" | ||
222 | + ></el-button> | ||
223 | + <el-button | ||
224 | + size="mini" | ||
225 | + type="primary" | ||
226 | + icon="el-icon-minus" | ||
227 | + round | ||
228 | + circle | ||
229 | + @click="removeOptions(subQuestions)" | ||
230 | + ></el-button> | ||
120 | </p> | 231 | </p> |
121 | </div> | 232 | </div> |
122 | 233 | ||
123 | <div class="qs-upload"> | 234 | <div class="qs-upload"> |
124 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
125 | - icon="el-icon-tickets" @click="openStem(subQuestions, index, indexs, 1)"></el-button> | 235 | + <el-button |
236 | + class="icon-tickets" | ||
237 | + type="primary" | ||
238 | + circle | ||
239 | + size="mini" | ||
240 | + icon="el-icon-tickets" | ||
241 | + @click="openStem(subQuestions, index, indexs, 1)" | ||
242 | + ></el-button> | ||
126 | </div> | 243 | </div> |
127 | <div class="qs-upload"> | 244 | <div class="qs-upload"> |
128 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
129 | - icon="el-icon-tickets" @click="openStem(subQuestions, index, indexs, 2)"></el-button> | 245 | + <el-button |
246 | + class="icon-tickets" | ||
247 | + type="primary" | ||
248 | + circle | ||
249 | + size="mini" | ||
250 | + icon="el-icon-tickets" | ||
251 | + @click="openStem(subQuestions, index, indexs, 2)" | ||
252 | + ></el-button> | ||
130 | </div> | 253 | </div> |
131 | <div class="qs-upload" v-if="knowledgeData.length"> | 254 | <div class="qs-upload" v-if="knowledgeData.length"> |
132 | - <el-button type="primary" circle size="mini" icon="el-icon-price-tag" | ||
133 | - @click="openKnowledge(subQuestions, index, indexs)"></el-button> | 255 | + <el-button |
256 | + type="primary" | ||
257 | + circle | ||
258 | + size="mini" | ||
259 | + icon="el-icon-price-tag" | ||
260 | + @click="openKnowledge(subQuestions, index, indexs)" | ||
261 | + ></el-button> | ||
134 | </div> | 262 | </div> |
135 | <div class="qs-set"> | 263 | <div class="qs-set"> |
136 | - <el-popconfirm title="确定删除这道题吗?" @confirm="delTabData(indexs, index)"> | ||
137 | - <el-button slot="reference" class="delete" type="danger" size="mini" circle | ||
138 | - icon="el-icon-delete"></el-button> | 264 | + <el-popconfirm |
265 | + title="确定删除这道题吗?" | ||
266 | + @confirm="delTabData(indexs, index)" | ||
267 | + > | ||
268 | + <el-button | ||
269 | + slot="reference" | ||
270 | + class="delete" | ||
271 | + type="danger" | ||
272 | + size="mini" | ||
273 | + circle | ||
274 | + icon="el-icon-delete" | ||
275 | + ></el-button> | ||
139 | </el-popconfirm> | 276 | </el-popconfirm> |
140 | </div> | 277 | </div> |
141 | </div> | 278 | </div> |
@@ -143,46 +280,88 @@ | @@ -143,46 +280,88 @@ | ||
143 | </ul> | 280 | </ul> |
144 | </template> | 281 | </template> |
145 | </div> | 282 | </div> |
146 | - <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400" | ||
147 | - :modal-append-to-body="false"> | 283 | + <el-dialog |
284 | + :close-on-click-modal="false" | ||
285 | + title="批量设置答案" | ||
286 | + :visible.sync="diaSetAns" | ||
287 | + width="400" | ||
288 | + :modal-append-to-body="false" | ||
289 | + > | ||
148 | <div class="qs-options"> | 290 | <div class="qs-options"> |
149 | <p class="dia-tips"> | 291 | <p class="dia-tips"> |
150 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” | 292 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
151 | </p> | 293 | </p> |
152 | <p>{{ setSubPro(formAns.qusType) }}:</p> | 294 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
153 | <p class="ipt"> | 295 | <p class="ipt"> |
154 | - <el-input v-if="formAns.qusType == 2 || formAns.qusType == 3" ref="formAnsIpt" v-model="formAns.answerList" | 296 | + <el-input |
297 | + v-if="formAns.qusType == 2 || formAns.qusType == 3" | ||
298 | + ref="formAnsIpt" | ||
299 | + v-model="formAns.answerList" | ||
155 | @keydown.native="keydownAnswer($event, formAns.qusType)" | 300 | @keydown.native="keydownAnswer($event, formAns.qusType)" |
156 | - @input="setAllAnswer($event, formAns.qusType)"></el-input> | ||
157 | - <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input> | 301 | + @input="setAllAnswer($event, formAns.qusType)" |
302 | + ></el-input> | ||
303 | + <el-input | ||
304 | + v-if="formAns.qusType == 4" | ||
305 | + v-model="formAns.answerList" | ||
306 | + readonly="" | ||
307 | + ></el-input> | ||
158 | </p> | 308 | </p> |
159 | <p class="answer-box"> | 309 | <p class="answer-box"> |
160 | <template v-if="formAns.qusType == 4"> | 310 | <template v-if="formAns.qusType == 4"> |
161 | - <span class="answer-s active" @click=" | ||
162 | - formAns.answerList.length < formAns.subNum | ||
163 | - ? (formAns.answerList += '✓') | ||
164 | - : '' | ||
165 | - ">✓</span> | ||
166 | - <span class="answer-s active" @click=" | ||
167 | - formAns.answerList.length < formAns.subNum | ||
168 | - ? (formAns.answerList += '✗') | ||
169 | - : '' | ||
170 | - ">✗</span> | 311 | + <span |
312 | + class="answer-s active" | ||
313 | + @click=" | ||
314 | + formAns.answerList.length < formAns.subNum | ||
315 | + ? (formAns.answerList += '✓') | ||
316 | + : '' | ||
317 | + " | ||
318 | + >✓</span | ||
319 | + > | ||
320 | + <span | ||
321 | + class="answer-s active" | ||
322 | + @click=" | ||
323 | + formAns.answerList.length < formAns.subNum | ||
324 | + ? (formAns.answerList += '✗') | ||
325 | + : '' | ||
326 | + " | ||
327 | + >✗</span | ||
328 | + > | ||
171 | </template> | 329 | </template> |
172 | <template v-if="formAns.qusType == 3"> | 330 | <template v-if="formAns.qusType == 3"> |
173 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" | ||
174 | - @click="setMultiple(formAns, option, 2)">{{ option }}</span> | ||
175 | - <span class="answer-s active" @click="setMultiple(formAns, ',', 2)">,</span> | 331 | + <span |
332 | + class="answer-s active" | ||
333 | + v-for="option in formAns.answerOptions.split(',')" | ||
334 | + :key="option" | ||
335 | + @click="setMultiple(formAns, option, 2)" | ||
336 | + >{{ option }}</span | ||
337 | + > | ||
338 | + <span | ||
339 | + class="answer-s active" | ||
340 | + @click="setMultiple(formAns, ',', 2)" | ||
341 | + >,</span | ||
342 | + > | ||
176 | </template> | 343 | </template> |
177 | <template v-if="formAns.qusType == 2"> | 344 | <template v-if="formAns.qusType == 2"> |
178 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click=" | ||
179 | - formAns.answerList.length < formAns.subNum | ||
180 | - ? (formAns.answerList += option) | ||
181 | - : '' | ||
182 | - ">{{ option }}</span> | 345 | + <span |
346 | + class="answer-s active" | ||
347 | + v-for="option in formAns.answerOptions.split(',')" | ||
348 | + :key="option" | ||
349 | + @click=" | ||
350 | + formAns.answerList.length < formAns.subNum | ||
351 | + ? (formAns.answerList += option) | ||
352 | + : '' | ||
353 | + " | ||
354 | + >{{ option }}</span | ||
355 | + > | ||
183 | </template> | 356 | </template> |
184 | - <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> | ||
185 | - <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> | 357 | + <span |
358 | + class="answer-s delButton" | ||
359 | + @click="formAns.answerList = formAns.answerList.slice(0, -1)" | ||
360 | + >x</span | ||
361 | + > | ||
362 | + <span class="answer-s ac" @click="formAns.answerList = ''" | ||
363 | + >ac</span | ||
364 | + > | ||
186 | </p> | 365 | </p> |
187 | </div> | 366 | </div> |
188 | <div class="dialog-footer" slot="footer"> | 367 | <div class="dialog-footer" slot="footer"> |
@@ -191,21 +370,48 @@ | @@ -191,21 +370,48 @@ | ||
191 | </div> | 370 | </div> |
192 | </el-dialog> | 371 | </el-dialog> |
193 | <div class="btn-box"> | 372 | <div class="btn-box"> |
194 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 373 | + <el-button type="danger" plain round @click="linkBack" |
374 | + >取消</el-button | ||
375 | + > | ||
195 | <el-button round @click="step = 0">上一步</el-button> | 376 | <el-button round @click="step = 0">上一步</el-button> |
196 | <el-button type="primary" round @click="toStep(2)">下一步</el-button> | 377 | <el-button type="primary" round @click="toStep(2)">下一步</el-button> |
197 | </div> | 378 | </div> |
198 | - <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem" | ||
199 | - v-if="dialogStem" width="500"> | 379 | + <el-dialog |
380 | + :close-on-click-modal="false" | ||
381 | + :title="stem.type == 1 ? '上传题干' : '上传题目解析'" | ||
382 | + :visible.sync="dialogStem" | ||
383 | + v-if="dialogStem" | ||
384 | + width="500" | ||
385 | + > | ||
200 | <div class="upload-box"> | 386 | <div class="upload-box"> |
201 | - <template v-show="stem.type == 1"> | ||
202 | - <iframe class="screenshot" v-if="stem.screenshot" :src="stem.screenshot"></iframe> | ||
203 | - </template> | ||
204 | - <template v-show="stem.type == 2"> | ||
205 | - <iframe class="screenshot" v-if="stem.answerScreenshot" :src="stem.answerScreenshot"></iframe> | ||
206 | - </template> | ||
207 | - <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError" | ||
208 | - accept="image/*"> | 387 | + <div v-loading="iframeLoading"> |
388 | + <template v-if="stem.type == 1"> | ||
389 | + <iframe | ||
390 | + ref="screenshot" | ||
391 | + class="screenshot" | ||
392 | + v-if="stem.screenshot" | ||
393 | + :src="stem.screenshot" | ||
394 | + @load="iframeLoading = false" | ||
395 | + ></iframe> | ||
396 | + </template> | ||
397 | + <template v-else="stem.type == 2"> | ||
398 | + <iframe | ||
399 | + ref="screenshot" | ||
400 | + class="screenshot" | ||
401 | + v-if="stem.answerScreenshot" | ||
402 | + :src="stem.answerScreenshot" | ||
403 | + @load="iframeLoading = false" | ||
404 | + ></iframe> | ||
405 | + </template> | ||
406 | + </div> | ||
407 | + <el-upload | ||
408 | + class="upload-demo" | ||
409 | + :action="uploadUrl" | ||
410 | + :limit="1" | ||
411 | + :on-success="upSuccess" | ||
412 | + :on-error="upError" | ||
413 | + accept="image/*" | ||
414 | + > | ||
209 | <el-button size="small" type="primary">选择上传照片</el-button> | 415 | <el-button size="small" type="primary">选择上传照片</el-button> |
210 | </el-upload> | 416 | </el-upload> |
211 | </div> | 417 | </div> |
@@ -213,12 +419,26 @@ | @@ -213,12 +419,26 @@ | ||
213 | <el-button @click="dialogStem = false">保存</el-button> | 419 | <el-button @click="dialogStem = false">保存</el-button> |
214 | </div> | 420 | </div> |
215 | </el-dialog> | 421 | </el-dialog> |
216 | - <el-dialog :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500"> | 422 | + <el-dialog |
423 | + :close-on-click-modal="false" | ||
424 | + title="知识点" | ||
425 | + :visible.sync="dialogKnowledge" | ||
426 | + width="500" | ||
427 | + > | ||
217 | <div> | 428 | <div> |
218 | <el-form ref="form" :model="stem" label-width="160px"> | 429 | <el-form ref="form" :model="stem" label-width="160px"> |
219 | <el-form-item label="知识点:"> | 430 | <el-form-item label="知识点:"> |
220 | - <el-cascader size="small" filterable :show-all-levels="false" collapse clearable placeholder="选择知识点" | ||
221 | - v-model="stem.knowledge" :options="knowledgeData" :props="{ expandTrigger: 'hover' }"></el-cascader> | 431 | + <el-cascader |
432 | + size="small" | ||
433 | + filterable | ||
434 | + :show-all-levels="false" | ||
435 | + collapse | ||
436 | + clearable | ||
437 | + placeholder="选择知识点" | ||
438 | + v-model="stem.knowledge" | ||
439 | + :options="knowledgeData" | ||
440 | + :props="{ expandTrigger: 'hover' }" | ||
441 | + ></el-cascader> | ||
222 | </el-form-item> | 442 | </el-form-item> |
223 | </el-form> | 443 | </el-form> |
224 | </div> | 444 | </div> |
@@ -234,13 +454,22 @@ | @@ -234,13 +454,22 @@ | ||
234 | </div> | 454 | </div> |
235 | <div class="question-box"> | 455 | <div class="question-box"> |
236 | <template v-for="question in form.questionList"> | 456 | <template v-for="question in form.questionList"> |
237 | - <div class="screenshot-box" v-for="subQuestions in question.subQuestions"> | ||
238 | - <iframe class="screenshot" v-if="subQuestions.screenshot" :src="subQuestions.screenshot"></iframe> | 457 | + <div |
458 | + class="screenshot-box" | ||
459 | + v-for="subQuestions in question.subQuestions" | ||
460 | + > | ||
461 | + <iframe | ||
462 | + class="screenshot" | ||
463 | + v-if="subQuestions.screenshot" | ||
464 | + :src="subQuestions.screenshot" | ||
465 | + ></iframe> | ||
239 | </div> | 466 | </div> |
240 | </template> | 467 | </template> |
241 | </div> | 468 | </div> |
242 | <div class="btn-box"> | 469 | <div class="btn-box"> |
243 | - <el-button type="danger" plain round @click="linkBack">取消</el-button> | 470 | + <el-button type="danger" plain round @click="linkBack" |
471 | + >取消</el-button | ||
472 | + > | ||
244 | <el-button round @click="toStep(1)">上一步</el-button> | 473 | <el-button round @click="toStep(1)">上一步</el-button> |
245 | <el-button type="primary" round @click="save">保存</el-button> | 474 | <el-button type="primary" round @click="save">保存</el-button> |
246 | </div> | 475 | </div> |
@@ -279,9 +508,7 @@ export default { | @@ -279,9 +508,7 @@ export default { | ||
279 | trigger: "blur", | 508 | trigger: "blur", |
280 | }, | 509 | }, |
281 | ], | 510 | ], |
282 | - gradeName: [ | ||
283 | - { required: true, message: "请选择年级", trigger: "blur" }, | ||
284 | - ], | 511 | + gradeName: [{ required: true, message: "请选择年级", trigger: "blur" }], |
285 | subjectName: [ | 512 | subjectName: [ |
286 | { required: true, message: "请选择科目", trigger: "blur" }, | 513 | { required: true, message: "请选择科目", trigger: "blur" }, |
287 | ], | 514 | ], |
@@ -318,27 +545,35 @@ export default { | @@ -318,27 +545,35 @@ export default { | ||
318 | //返回列表页参数记录 | 545 | //返回列表页参数记录 |
319 | listType: 1, | 546 | listType: 1, |
320 | listShare: 0, | 547 | listShare: 0, |
321 | - uploadUrl: "/file/uploadImgToHtml" | 548 | + uploadUrl: "/file/uploadImgToHtml", |
549 | + iframeLoading: false, | ||
322 | }; | 550 | }; |
323 | }, | 551 | }, |
324 | computed: { | 552 | computed: { |
325 | // 知识点列表 根据学段-科目筛选 | 553 | // 知识点列表 根据学段-科目筛选 |
326 | knowledgeData: function () { | 554 | knowledgeData: function () { |
327 | - let jsons = [] | 555 | + let jsons = []; |
328 | if (this.form.gradeName && this.form.subjectName) { | 556 | if (this.form.gradeName && this.form.subjectName) { |
329 | - let sectionName = "" | ||
330 | - this.gradeClassList.map(item => { | 557 | + let sectionName = ""; |
558 | + this.gradeClassList.map((item) => { | ||
331 | if (this.form.gradeName == item.gradeName) { | 559 | if (this.form.gradeName == item.gradeName) { |
332 | - sectionName = item.sectionName | 560 | + sectionName = item.sectionName; |
333 | } | 561 | } |
334 | - }) | ||
335 | - if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { | ||
336 | - if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { | ||
337 | - jsons = this.knowledgeList[sectionName][this.form.subjectName] | 562 | + }); |
563 | + if ( | ||
564 | + sectionName && | ||
565 | + Object.keys(this.knowledgeList).includes(sectionName) | ||
566 | + ) { | ||
567 | + if ( | ||
568 | + Object.keys(this.knowledgeList[sectionName]).includes( | ||
569 | + this.form.subjectName | ||
570 | + ) | ||
571 | + ) { | ||
572 | + jsons = this.knowledgeList[sectionName][this.form.subjectName]; | ||
338 | } | 573 | } |
339 | } | 574 | } |
340 | } | 575 | } |
341 | - return jsons | 576 | + return jsons; |
342 | }, | 577 | }, |
343 | }, | 578 | }, |
344 | watch: { | 579 | watch: { |
@@ -350,19 +585,23 @@ export default { | @@ -350,19 +585,23 @@ export default { | ||
350 | }, | 585 | }, |
351 | async created() { | 586 | async created() { |
352 | this.listType = this.$route.query.listType ? this.$route.query.listType : 1; | 587 | this.listType = this.$route.query.listType ? this.$route.query.listType : 1; |
353 | - this.listShare = this.$route.query.listShare ? this.$route.query.listShare : 0; | 588 | + this.listShare = this.$route.query.listShare |
589 | + ? this.$route.query.listShare | ||
590 | + : 0; | ||
354 | this.type = this.$route.query.type ? this.$route.query.type : 1; | 591 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
355 | this.role = | 592 | this.role = |
356 | this.$store.getters.info.showRole || | 593 | this.$store.getters.info.showRole || |
357 | this.$store.getters.info.permissions[0].role; | 594 | this.$store.getters.info.permissions[0].role; |
358 | if (this.type != 2) { | 595 | if (this.type != 2) { |
359 | - let params = this.$route.query.params && JSON.parse(this.$route.query.params) || null | ||
360 | - this.form.title = params?.name | ||
361 | - this.form.id = params?.id | ||
362 | - this.form.sharingType = params?.sharingType || 0 | ||
363 | - this.formatData(params) | 596 | + let params = |
597 | + (this.$route.query.params && JSON.parse(this.$route.query.params)) || | ||
598 | + null; | ||
599 | + this.form.title = params?.name; | ||
600 | + this.form.id = params?.id; | ||
601 | + this.form.sharingType = params?.sharingType || 0; | ||
602 | + this.formatData(params); | ||
364 | } | 603 | } |
365 | - console.log(this.form) | 604 | + console.log(this.form); |
366 | if (this.role != "ROLE_PERSONAL") { | 605 | if (this.role != "ROLE_PERSONAL") { |
367 | this.formRules.gradeName = [ | 606 | this.formRules.gradeName = [ |
368 | { required: true, message: "请选择年级", trigger: "blur" }, | 607 | { required: true, message: "请选择年级", trigger: "blur" }, |
@@ -378,13 +617,20 @@ export default { | @@ -378,13 +617,20 @@ export default { | ||
378 | // v1.5 | 617 | // v1.5 |
379 | //上传截图 | 618 | //上传截图 |
380 | openStem(obj, index, indexs, type) { | 619 | openStem(obj, index, indexs, type) { |
620 | + this.iframeLoading = true; | ||
381 | this.stem.index = index; | 621 | this.stem.index = index; |
382 | this.stem.indexs = indexs; | 622 | this.stem.indexs = indexs; |
383 | this.stem.type = type; | 623 | this.stem.type = type; |
384 | if (type == 1) { | 624 | if (type == 1) { |
625 | + if (obj.screenshot == "") { | ||
626 | + this.iframeLoading = false; | ||
627 | + } | ||
385 | this.stem.screenshot = obj.screenshot || ""; | 628 | this.stem.screenshot = obj.screenshot || ""; |
386 | this.stem.answerScreenshot = ""; | 629 | this.stem.answerScreenshot = ""; |
387 | } else { | 630 | } else { |
631 | + if (obj.answerScreenshot == "") { | ||
632 | + this.iframeLoading = false; | ||
633 | + } | ||
388 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 634 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
389 | this.stem.screenshot = ""; | 635 | this.stem.screenshot = ""; |
390 | } | 636 | } |
@@ -397,10 +643,14 @@ export default { | @@ -397,10 +643,14 @@ export default { | ||
397 | if (res && res.status == 0) { | 643 | if (res && res.status == 0) { |
398 | if (this.stem.type == 1) { | 644 | if (this.stem.type == 1) { |
399 | this.stem.screenshot = res.data.url; | 645 | this.stem.screenshot = res.data.url; |
400 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot; | 646 | + this.form.questionList[this.stem.index].subQuestions[ |
647 | + this.stem.indexs | ||
648 | + ].screenshot = this.stem.screenshot; | ||
401 | } else { | 649 | } else { |
402 | this.stem.answerScreenshot = res.data.url; | 650 | this.stem.answerScreenshot = res.data.url; |
403 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot; | 651 | + this.form.questionList[this.stem.index].subQuestions[ |
652 | + this.stem.indexs | ||
653 | + ].answerScreenshot = this.stem.answerScreenshot; | ||
404 | } | 654 | } |
405 | this.$message.success("上传成功"); | 655 | this.$message.success("上传成功"); |
406 | } else { | 656 | } else { |
@@ -420,15 +670,16 @@ export default { | @@ -420,15 +670,16 @@ export default { | ||
420 | }, | 670 | }, |
421 | // 知识点 | 671 | // 知识点 |
422 | setKnowledge() { | 672 | setKnowledge() { |
423 | - this.form.questionList[this.stem.index].subQuestions[this.stem.indexs].knowledge = this.stem.knowledge.join("#"); | 673 | + this.form.questionList[this.stem.index].subQuestions[ |
674 | + this.stem.indexs | ||
675 | + ].knowledge = this.stem.knowledge.join("#"); | ||
424 | this.dialogKnowledge = false; | 676 | this.dialogKnowledge = false; |
425 | }, | 677 | }, |
426 | 678 | ||
427 | //end | 679 | //end |
428 | linkBack() { | 680 | linkBack() { |
429 | this.$confirm( | 681 | this.$confirm( |
430 | - (this.type == 2 ? "修改复制的" : "导入的") + | ||
431 | - "课件未保存,确认退出吗?", | 682 | + (this.type == 2 ? "修改复制的" : "导入的") + "课件未保存,确认退出吗?", |
432 | "提示", | 683 | "提示", |
433 | { | 684 | { |
434 | confirmButtonText: "取消", | 685 | confirmButtonText: "取消", |
@@ -441,14 +692,14 @@ export default { | @@ -441,14 +692,14 @@ export default { | ||
441 | type: "warning", | 692 | type: "warning", |
442 | } | 693 | } |
443 | ) | 694 | ) |
444 | - .then(() => { }) | 695 | + .then(() => {}) |
445 | .catch(() => { | 696 | .catch(() => { |
446 | this.$router.push({ | 697 | this.$router.push({ |
447 | path: "/examinationPaper", | 698 | path: "/examinationPaper", |
448 | query: { | 699 | query: { |
449 | type: this.listType, | 700 | type: this.listType, |
450 | share: this.listShare, | 701 | share: this.listShare, |
451 | - } | 702 | + }, |
452 | }); | 703 | }); |
453 | }); | 704 | }); |
454 | }, | 705 | }, |
@@ -473,8 +724,8 @@ export default { | @@ -473,8 +724,8 @@ export default { | ||
473 | }, | 724 | }, |
474 | //计算题号 | 725 | //计算题号 |
475 | setNum(index, indexs, sub) { | 726 | setNum(index, indexs, sub) { |
476 | - let lengths = 0;//所在大题之前的所有小题数量 | ||
477 | - let subIndex = 0;//所在大题的位置 | 727 | + let lengths = 0; //所在大题之前的所有小题数量 |
728 | + let subIndex = 0; //所在大题的位置 | ||
478 | for (let i = 0; i < index; i++) { | 729 | for (let i = 0; i < index; i++) { |
479 | let subArr = this.form.questionList[i].subQuestions.filter((item) => { | 730 | let subArr = this.form.questionList[i].subQuestions.filter((item) => { |
480 | return !!item.questionType; | 731 | return !!item.questionType; |
@@ -490,7 +741,7 @@ export default { | @@ -490,7 +741,7 @@ export default { | ||
490 | }, | 741 | }, |
491 | //整理问题 | 742 | //整理问题 |
492 | formateQuestion() { | 743 | formateQuestion() { |
493 | - this.formatQuestionList() | 744 | + this.formatQuestionList(); |
494 | this.form.questionList?.map((item) => { | 745 | this.form.questionList?.map((item) => { |
495 | let types = [{}]; | 746 | let types = [{}]; |
496 | let addndex = 0; | 747 | let addndex = 0; |
@@ -641,7 +892,7 @@ export default { | @@ -641,7 +892,7 @@ export default { | ||
641 | if (this.formAns.endIndex == item.questionIndex) { | 892 | if (this.formAns.endIndex == item.questionIndex) { |
642 | EndIndex = index; | 893 | EndIndex = index; |
643 | } | 894 | } |
644 | - return this.formAns.endIndex == item.questionIndex | 895 | + return this.formAns.endIndex == item.questionIndex; |
645 | } | 896 | } |
646 | ); | 897 | ); |
647 | for (let i = 0; i <= subNum; i++) { | 898 | for (let i = 0; i <= subNum; i++) { |
@@ -655,8 +906,8 @@ export default { | @@ -655,8 +906,8 @@ export default { | ||
655 | this.formAns.answerList[subNum - i] == "✓" | 906 | this.formAns.answerList[subNum - i] == "✓" |
656 | ? 1 | 907 | ? 1 |
657 | : this.formAns.answerList[subNum - i] == "✗" | 908 | : this.formAns.answerList[subNum - i] == "✗" |
658 | - ? 2 | ||
659 | - : ""; | 909 | + ? 2 |
910 | + : ""; | ||
660 | } | 911 | } |
661 | this.form.questionList[this.formAns.listIndex].subQuestions[ | 912 | this.form.questionList[this.formAns.listIndex].subQuestions[ |
662 | EndIndex - i | 913 | EndIndex - i |
@@ -694,7 +945,6 @@ export default { | @@ -694,7 +945,6 @@ export default { | ||
694 | } | 945 | } |
695 | }, | 946 | }, |
696 | setAllAnswer(event, type) { | 947 | setAllAnswer(event, type) { |
697 | - | ||
698 | let str = this.formAns.answerList; | 948 | let str = this.formAns.answerList; |
699 | let str2 = checkAnswer( | 949 | let str2 = checkAnswer( |
700 | str, | 950 | str, |
@@ -703,7 +953,6 @@ export default { | @@ -703,7 +953,6 @@ export default { | ||
703 | this.formAns.subNum | 953 | this.formAns.subNum |
704 | ); | 954 | ); |
705 | this.formAns.answerList = str2; | 955 | this.formAns.answerList = str2; |
706 | - | ||
707 | }, | 956 | }, |
708 | setAnswer(type, ans) { | 957 | setAnswer(type, ans) { |
709 | let txt = ""; | 958 | let txt = ""; |
@@ -720,7 +969,7 @@ export default { | @@ -720,7 +969,7 @@ export default { | ||
720 | this.formatQuestionList(); | 969 | this.formatQuestionList(); |
721 | this.step = step; | 970 | this.step = step; |
722 | if (step == 1) { | 971 | if (step == 1) { |
723 | - this.formateQuestion() | 972 | + this.formateQuestion(); |
724 | } | 973 | } |
725 | }, | 974 | }, |
726 | setStep1() { | 975 | setStep1() { |
@@ -731,7 +980,7 @@ export default { | @@ -731,7 +980,7 @@ export default { | ||
731 | this.$refs["forms"].validate((valid) => { | 980 | this.$refs["forms"].validate((valid) => { |
732 | // 验证通过:保存 | 981 | // 验证通过:保存 |
733 | if (valid) { | 982 | if (valid) { |
734 | - this.formateQuestion() | 983 | + this.formateQuestion(); |
735 | this.step = 1; | 984 | this.step = 1; |
736 | } else { | 985 | } else { |
737 | this.$message.error("数据有误,请检查!"); | 986 | this.$message.error("数据有误,请检查!"); |
@@ -757,7 +1006,7 @@ export default { | @@ -757,7 +1006,7 @@ export default { | ||
757 | //删除题 | 1006 | //删除题 |
758 | delTabData(subIndex, index) { | 1007 | delTabData(subIndex, index) { |
759 | this.form.questionList[index].subQuestions.splice(subIndex, 1); | 1008 | this.form.questionList[index].subQuestions.splice(subIndex, 1); |
760 | - this.formateQuestion() | 1009 | + this.formateQuestion(); |
761 | }, | 1010 | }, |
762 | //切换题型 | 1011 | //切换题型 |
763 | changeSubQuestions(val, subQuestions) { | 1012 | changeSubQuestions(val, subQuestions) { |
@@ -785,7 +1034,7 @@ export default { | @@ -785,7 +1034,7 @@ export default { | ||
785 | subQuestions.selectNum = 0; | 1034 | subQuestions.selectNum = 0; |
786 | break; | 1035 | break; |
787 | } | 1036 | } |
788 | - this.formateQuestion() | 1037 | + this.formateQuestion(); |
789 | }, | 1038 | }, |
790 | //设置多选答案 | 1039 | //设置多选答案 |
791 | changAnswer(sub, option) { | 1040 | changAnswer(sub, option) { |
@@ -799,9 +1048,6 @@ export default { | @@ -799,9 +1048,6 @@ export default { | ||
799 | } | 1048 | } |
800 | }, | 1049 | }, |
801 | 1050 | ||
802 | - | ||
803 | - | ||
804 | - | ||
805 | async save() { | 1051 | async save() { |
806 | if (this.saveLoading) return; | 1052 | if (this.saveLoading) return; |
807 | this.saveLoading = true; | 1053 | this.saveLoading = true; |
@@ -822,7 +1068,7 @@ export default { | @@ -822,7 +1068,7 @@ export default { | ||
822 | query: { | 1068 | query: { |
823 | type: this.listType, | 1069 | type: this.listType, |
824 | share: this.listShare, | 1070 | share: this.listShare, |
825 | - } | 1071 | + }, |
826 | }); | 1072 | }); |
827 | } else { | 1073 | } else { |
828 | this.$message.error(info); | 1074 | this.$message.error(info); |
@@ -846,12 +1092,12 @@ export default { | @@ -846,12 +1092,12 @@ export default { | ||
846 | const { data, status, info } = await fetchClassList(); | 1092 | const { data, status, info } = await fetchClassList(); |
847 | if (status == 0) { | 1093 | if (status == 0) { |
848 | this.gradeClassList = data.list?.map((item) => { | 1094 | this.gradeClassList = data.list?.map((item) => { |
849 | - console.log(!this.gradeList.includes(item.gradeName)) | 1095 | + console.log(!this.gradeList.includes(item.gradeName)); |
850 | if (!this.gradeList.includes(item.gradeName)) { | 1096 | if (!this.gradeList.includes(item.gradeName)) { |
851 | - this.gradeList.push(item.gradeName) | 1097 | + this.gradeList.push(item.gradeName); |
852 | } | 1098 | } |
853 | - return item | ||
854 | - }) | 1099 | + return item; |
1100 | + }); | ||
855 | // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; | 1101 | // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; |
856 | if (this.type != 2) { | 1102 | if (this.type != 2) { |
857 | this.form.gradeName = this.gradeList[0]; | 1103 | this.form.gradeName = this.gradeList[0]; |
@@ -906,7 +1152,7 @@ export default { | @@ -906,7 +1152,7 @@ export default { | ||
906 | this.form.sharingType = data.sharingType; | 1152 | this.form.sharingType = data.sharingType; |
907 | } | 1153 | } |
908 | this.form.tagId = ""; | 1154 | this.form.tagId = ""; |
909 | - this.formatData(data) | 1155 | + this.formatData(data); |
910 | } else { | 1156 | } else { |
911 | this.$message.error(info); | 1157 | this.$message.error(info); |
912 | } | 1158 | } |
@@ -951,7 +1197,7 @@ export default { | @@ -951,7 +1197,7 @@ export default { | ||
951 | show: false, | 1197 | show: false, |
952 | }; | 1198 | }; |
953 | }); | 1199 | }); |
954 | - } | 1200 | + }, |
955 | }, | 1201 | }, |
956 | }; | 1202 | }; |
957 | </script> | 1203 | </script> |
@@ -1255,7 +1501,7 @@ export default { | @@ -1255,7 +1501,7 @@ export default { | ||
1255 | display: flex; | 1501 | display: flex; |
1256 | border-bottom: 1px solid #e2e2e2; | 1502 | border-bottom: 1px solid #e2e2e2; |
1257 | 1503 | ||
1258 | - &>div { | 1504 | + & > div { |
1259 | min-height: 40px; | 1505 | min-height: 40px; |
1260 | padding: 5px; | 1506 | padding: 5px; |
1261 | flex-shrink: 0; | 1507 | flex-shrink: 0; |
src/views/examinationPaper/edit.vue
@@ -23,7 +23,10 @@ | @@ -23,7 +23,10 @@ | ||
23 | <p class="totals">卷面总分:{{ allScore }}分</p> | 23 | <p class="totals">卷面总分:{{ allScore }}分</p> |
24 | </div> | 24 | </div> |
25 | <div class="question-box"> | 25 | <div class="question-box"> |
26 | - <ul class="questions-ul questions-ul2" v-if="!questionList[0]?.subQuestions"> | 26 | + <ul |
27 | + class="questions-ul questions-ul2" | ||
28 | + v-if="!questionList[0]?.subQuestions" | ||
29 | + > | ||
27 | <li class="sub-questions"> | 30 | <li class="sub-questions"> |
28 | <div class="qs-num">题号</div> | 31 | <div class="qs-num">题号</div> |
29 | <div class="qs-type">题型</div> | 32 | <div class="qs-type">题型</div> |
@@ -35,11 +38,17 @@ | @@ -35,11 +38,17 @@ | ||
35 | <div class="qs-set">知识点</div> | 38 | <div class="qs-set">知识点</div> |
36 | </li> | 39 | </li> |
37 | <li v-for="(subQuestions, indexs) in questionList" :key="indexs"> | 40 | <li v-for="(subQuestions, indexs) in questionList" :key="indexs"> |
38 | - <p class="set-ans-btn" v-if="subQuestions.qusType && | ||
39 | - subQuestions.subNum && | ||
40 | - subQuestions.subNum > 4 | ||
41 | - "> | ||
42 | - <el-button type="primary" @click="setFormAns(indexs)">批量设置答案</el-button> | 41 | + <p |
42 | + class="set-ans-btn" | ||
43 | + v-if=" | ||
44 | + subQuestions.qusType && | ||
45 | + subQuestions.subNum && | ||
46 | + subQuestions.subNum > 4 | ||
47 | + " | ||
48 | + > | ||
49 | + <el-button type="primary" @click="setFormAns(indexs)" | ||
50 | + >批量设置答案</el-button | ||
51 | + > | ||
43 | </p> | 52 | </p> |
44 | <div v-else class="sub-questions"> | 53 | <div v-else class="sub-questions"> |
45 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> | 54 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> |
@@ -51,58 +60,97 @@ | @@ -51,58 +60,97 @@ | ||
51 | </div> | 60 | </div> |
52 | <div class="qs-partScore"> | 61 | <div class="qs-partScore"> |
53 | <p v-if="subQuestions.questionType != 3">--</p> | 62 | <p v-if="subQuestions.questionType != 3">--</p> |
54 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" :max="subQuestions.score" | ||
55 | - :step="0.5" v-model="subQuestions.partScore" label="漏选得分"></el-input-number> | 63 | + <el-input-number |
64 | + class="number-ipt" | ||
65 | + v-else | ||
66 | + size="medium" | ||
67 | + :min="0" | ||
68 | + :precision="2" | ||
69 | + :max="subQuestions.score" | ||
70 | + :step="0.5" | ||
71 | + v-model="subQuestions.partScore" | ||
72 | + label="漏选得分" | ||
73 | + ></el-input-number> | ||
56 | </div> | 74 | </div> |
57 | <div class="qs-options qs-options2"> | 75 | <div class="qs-options qs-options2"> |
58 | <p v-if="subQuestions.questionType == 5">--</p> | 76 | <p v-if="subQuestions.questionType == 5">--</p> |
59 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 77 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
60 | - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
61 | - @click="subQuestions.correctAnswer = 1">✓</span> | ||
62 | - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
63 | - @click="subQuestions.correctAnswer = 2">✗</span> | 78 | + <span |
79 | + class="answer-s" | ||
80 | + :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
81 | + @click="subQuestions.correctAnswer = 1" | ||
82 | + >✓</span | ||
83 | + > | ||
84 | + <span | ||
85 | + class="answer-s" | ||
86 | + :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
87 | + @click="subQuestions.correctAnswer = 2" | ||
88 | + >✗</span | ||
89 | + > | ||
64 | </p> | 90 | </p> |
65 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 91 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
66 | - <template v-for="option in subQuestions.answerOptions.split(',')"> | ||
67 | - <span v-if="option" class="answer-s" :class="subQuestions.correctAnswer.includes(option) | ||
68 | - ? 'active' | ||
69 | - : '' | ||
70 | - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | 92 | + <template |
93 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
94 | + > | ||
95 | + <span | ||
96 | + v-if="option" | ||
97 | + class="answer-s" | ||
98 | + :class=" | ||
99 | + subQuestions.correctAnswer.includes(option) | ||
100 | + ? 'active' | ||
101 | + : '' | ||
102 | + " | ||
103 | + :key="option" | ||
104 | + @click="changAnswer(subQuestions, option)" | ||
105 | + >{{ option }}</span | ||
106 | + > | ||
71 | </template> | 107 | </template> |
72 | </p> | 108 | </p> |
73 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 109 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
74 | - <template v-for="option in subQuestions.answerOptions.split(',')"> | ||
75 | - <span class="answer-s" v-if="option" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
76 | - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | 110 | + <template |
111 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
112 | + > | ||
113 | + <span | ||
114 | + class="answer-s" | ||
115 | + v-if="option" | ||
116 | + :class=" | ||
117 | + subQuestions.correctAnswer == option ? 'active' : '' | ||
118 | + " | ||
119 | + :key="option" | ||
120 | + @click="subQuestions.correctAnswer = option" | ||
121 | + >{{ option }}</span | ||
122 | + > | ||
77 | </template> | 123 | </template> |
78 | </p> | 124 | </p> |
79 | </div> | 125 | </div> |
80 | <div class="qs-set"> | 126 | <div class="qs-set"> |
81 | - <el-popover placement="right" width="600" trigger="click"> | ||
82 | - <div class="screenshot-box"> | ||
83 | - <iframe class="screenshot" v-if="subQuestions.screenshot" :src="subQuestions.screenshot"></iframe> | ||
84 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
85 | - @click="openStem(subQuestions, 1, indexs)">重新选择图片</el-button></p> | ||
86 | - </div> | ||
87 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
88 | - icon="el-icon-tickets"></el-button> | ||
89 | - </el-popover> | 127 | + <el-button |
128 | + class="icon-tickets" | ||
129 | + type="primary" | ||
130 | + circle | ||
131 | + size="mini" | ||
132 | + icon="el-icon-tickets" | ||
133 | + @click="openStem(subQuestions, 1, indexs)" | ||
134 | + ></el-button> | ||
90 | </div> | 135 | </div> |
91 | <div class="qs-set"> | 136 | <div class="qs-set"> |
92 | - <el-popover placement="right" width="600" trigger="click"> | ||
93 | - <div class="screenshot-box"> | ||
94 | - <iframe class="screenshot" v-if="subQuestions.answerScreenshot" | ||
95 | - :src="subQuestions.answerScreenshot"></iframe> | ||
96 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
97 | - @click="openStem(subQuestions, 2, indexs)">重新选择图片</el-button></p> | ||
98 | - </div> | ||
99 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
100 | - icon="el-icon-tickets"></el-button> | ||
101 | - </el-popover> | 137 | + <el-button |
138 | + class="icon-tickets" | ||
139 | + type="primary" | ||
140 | + circle | ||
141 | + size="mini" | ||
142 | + icon="el-icon-tickets" | ||
143 | + @click="openStem(subQuestions, 2, indexs)" | ||
144 | + ></el-button> | ||
102 | </div> | 145 | </div> |
103 | <div class="qs-set"> | 146 | <div class="qs-set"> |
104 | - <el-button type="primary" circle size="mini" icon="el-icon-price-tag" | ||
105 | - @click="openKnowledge(subQuestions, indexs)"></el-button> | 147 | + <el-button |
148 | + type="primary" | ||
149 | + circle | ||
150 | + size="mini" | ||
151 | + icon="el-icon-price-tag" | ||
152 | + @click="openKnowledge(subQuestions, indexs)" | ||
153 | + ></el-button> | ||
106 | </div> | 154 | </div> |
107 | </div> | 155 | </div> |
108 | </li> | 156 | </li> |
@@ -111,7 +159,12 @@ | @@ -111,7 +159,12 @@ | ||
111 | <template v-for="(question, index) in questionList"> | 159 | <template v-for="(question, index) in questionList"> |
112 | <p class="question-title"> | 160 | <p class="question-title"> |
113 | <span>{{ setBigNum(index) }}、</span> | 161 | <span>{{ setBigNum(index) }}、</span> |
114 | - <el-input class="ipt" v-model.trim="question.questionTitle" maxlength="30" placeholder="填写大题名称"></el-input> | 162 | + <el-input |
163 | + class="ipt" | ||
164 | + v-model.trim="question.questionTitle" | ||
165 | + maxlength="30" | ||
166 | + placeholder="填写大题名称" | ||
167 | + ></el-input> | ||
115 | <span>共 {{ setScore(question) }} 分</span> | 168 | <span>共 {{ setScore(question) }} 分</span> |
116 | </p> | 169 | </p> |
117 | <div class="questions-ul"> | 170 | <div class="questions-ul"> |
@@ -125,12 +178,21 @@ | @@ -125,12 +178,21 @@ | ||
125 | <div class="qs-set">题目解析</div> | 178 | <div class="qs-set">题目解析</div> |
126 | <div class="qs-set">知识点</div> | 179 | <div class="qs-set">知识点</div> |
127 | </div> | 180 | </div> |
128 | - <div v-for="(subQuestions, indexs) in question.subQuestions" :key="indexs"> | ||
129 | - <p class="set-ans-btn" v-if="subQuestions.qusType && | ||
130 | - subQuestions.subNum && | ||
131 | - subQuestions.subNum > 4 | ||
132 | - "> | ||
133 | - <el-button type="primary" @click="setFormAns(indexs, index)">批量设置答案</el-button> | 181 | + <div |
182 | + v-for="(subQuestions, indexs) in question.subQuestions" | ||
183 | + :key="indexs" | ||
184 | + > | ||
185 | + <p | ||
186 | + class="set-ans-btn" | ||
187 | + v-if=" | ||
188 | + subQuestions.qusType && | ||
189 | + subQuestions.subNum && | ||
190 | + subQuestions.subNum > 4 | ||
191 | + " | ||
192 | + > | ||
193 | + <el-button type="primary" @click="setFormAns(indexs, index)" | ||
194 | + >批量设置答案</el-button | ||
195 | + > | ||
134 | </p> | 196 | </p> |
135 | <div v-else class="sub-questions"> | 197 | <div v-else class="sub-questions"> |
136 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> | 198 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> |
@@ -138,73 +200,110 @@ | @@ -138,73 +200,110 @@ | ||
138 | {{ setSubPro(subQuestions.questionType) }} | 200 | {{ setSubPro(subQuestions.questionType) }} |
139 | </div> | 201 | </div> |
140 | <div class="qs-score"> | 202 | <div class="qs-score"> |
141 | - <el-input-number class="number-ipt" size="medium" :min="1" :max="200" :precision="2" :step="1" | ||
142 | - v-model="subQuestions.score" label="单题分值"></el-input-number> | 203 | + <el-input-number |
204 | + class="number-ipt" | ||
205 | + size="medium" | ||
206 | + :min="1" | ||
207 | + :max="200" | ||
208 | + :precision="2" | ||
209 | + :step="1" | ||
210 | + v-model="subQuestions.score" | ||
211 | + label="单题分值" | ||
212 | + ></el-input-number> | ||
143 | </div> | 213 | </div> |
144 | <div class="qs-partScore"> | 214 | <div class="qs-partScore"> |
145 | <p v-if="subQuestions.questionType != 3">--</p> | 215 | <p v-if="subQuestions.questionType != 3">--</p> |
146 | - <el-input-number class="number-ipt" v-else size="medium" :min="0" :precision="2" | ||
147 | - :max="subQuestions.score" :step="0.5" v-model="subQuestions.partScore" | ||
148 | - label="漏选得分"></el-input-number> | 216 | + <el-input-number |
217 | + class="number-ipt" | ||
218 | + v-else | ||
219 | + size="medium" | ||
220 | + :min="0" | ||
221 | + :precision="2" | ||
222 | + :max="subQuestions.score" | ||
223 | + :step="0.5" | ||
224 | + v-model="subQuestions.partScore" | ||
225 | + label="漏选得分" | ||
226 | + ></el-input-number> | ||
149 | </div> | 227 | </div> |
150 | <div class="qs-options qs-options2"> | 228 | <div class="qs-options qs-options2"> |
151 | <p v-if="subQuestions.questionType == 5">--</p> | 229 | <p v-if="subQuestions.questionType == 5">--</p> |
152 | <p v-if="subQuestions.questionType == 4" class="answer-box"> | 230 | <p v-if="subQuestions.questionType == 4" class="answer-box"> |
153 | - <span class="answer-s" :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
154 | - @click="subQuestions.correctAnswer = 1">✓</span> | ||
155 | - <span class="answer-s" :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
156 | - @click="subQuestions.correctAnswer = 2">✗</span> | 231 | + <span |
232 | + class="answer-s" | ||
233 | + :class="subQuestions.correctAnswer == 1 ? 'active' : ''" | ||
234 | + @click="subQuestions.correctAnswer = 1" | ||
235 | + >✓</span | ||
236 | + > | ||
237 | + <span | ||
238 | + class="answer-s" | ||
239 | + :class="subQuestions.correctAnswer == 2 ? 'active' : ''" | ||
240 | + @click="subQuestions.correctAnswer = 2" | ||
241 | + >✗</span | ||
242 | + > | ||
157 | </p> | 243 | </p> |
158 | <p v-if="subQuestions.questionType == 3" class="answer-box"> | 244 | <p v-if="subQuestions.questionType == 3" class="answer-box"> |
159 | - <template v-for="option in subQuestions.answerOptions.split(',')"> | ||
160 | - <span v-if="option" class="answer-s" :class="subQuestions.correctAnswer.includes(option) | ||
161 | - ? 'active' | ||
162 | - : '' | ||
163 | - " :key="option" @click="changAnswer(subQuestions, option)">{{ option }}</span> | 245 | + <template |
246 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
247 | + > | ||
248 | + <span | ||
249 | + v-if="option" | ||
250 | + class="answer-s" | ||
251 | + :class=" | ||
252 | + subQuestions.correctAnswer.includes(option) | ||
253 | + ? 'active' | ||
254 | + : '' | ||
255 | + " | ||
256 | + :key="option" | ||
257 | + @click="changAnswer(subQuestions, option)" | ||
258 | + >{{ option }}</span | ||
259 | + > | ||
164 | </template> | 260 | </template> |
165 | </p> | 261 | </p> |
166 | <p v-if="subQuestions.questionType == 2" class="answer-box"> | 262 | <p v-if="subQuestions.questionType == 2" class="answer-box"> |
167 | - <template v-for="option in subQuestions.answerOptions.split(',')"> | ||
168 | - <span class="answer-s" v-if="option" :class="subQuestions.correctAnswer == option ? 'active' : '' | ||
169 | - " :key="option" @click="subQuestions.correctAnswer = option">{{ option }}</span> | 263 | + <template |
264 | + v-for="option in subQuestions.answerOptions.split(',')" | ||
265 | + > | ||
266 | + <span | ||
267 | + class="answer-s" | ||
268 | + v-if="option" | ||
269 | + :class=" | ||
270 | + subQuestions.correctAnswer == option ? 'active' : '' | ||
271 | + " | ||
272 | + :key="option" | ||
273 | + @click="subQuestions.correctAnswer = option" | ||
274 | + >{{ option }}</span | ||
275 | + > | ||
170 | </template> | 276 | </template> |
171 | </p> | 277 | </p> |
172 | </div> | 278 | </div> |
173 | <div class="qs-set"> | 279 | <div class="qs-set"> |
174 | - <el-popover placement="right" width="600" trigger="click"> | ||
175 | - <div class="screenshot-box"> | ||
176 | - <iframe class="screenshot" | ||
177 | - v-if="subQuestions.screenshot && subQuestions.screenshot.includes('html')" | ||
178 | - :src="subQuestions.screenshot"></iframe> | ||
179 | - <img class="screenshot screenshot-img" | ||
180 | - v-if="subQuestions.screenshot && !subQuestions.screenshot.includes('html')" | ||
181 | - :src="subQuestions.screenshot" alt=""> | ||
182 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
183 | - @click="openStem(subQuestions, 1, index, indexs)">重新选择图片</el-button></p> | ||
184 | - </div> | ||
185 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
186 | - icon="el-icon-tickets"></el-button> | ||
187 | - </el-popover> | 280 | + <el-button |
281 | + class="icon-tickets" | ||
282 | + type="primary" | ||
283 | + circle | ||
284 | + size="mini" | ||
285 | + icon="el-icon-tickets" | ||
286 | + @click="openStem(subQuestions, 1, index, indexs)" | ||
287 | + ></el-button> | ||
188 | </div> | 288 | </div> |
189 | <div class="qs-set"> | 289 | <div class="qs-set"> |
190 | - <el-popover placement="right" width="600" trigger="click"> | ||
191 | - <div class="screenshot-box"> | ||
192 | - <iframe class="screenshot" | ||
193 | - v-if="subQuestions.answerScreenshot && subQuestions.answerScreenshot.includes('html')" | ||
194 | - :src="subQuestions.answerScreenshot"></iframe> | ||
195 | - <img class="screenshot screenshot-img" | ||
196 | - v-if="subQuestions.answerScreenshot && !subQuestions.answerScreenshot.includes('html')" | ||
197 | - :src="subQuestions.answerScreenshot" alt=""> | ||
198 | - <p style="textAlign:center"><el-button type="primary" round size="mini" icon="el-icon-upload" | ||
199 | - @click="openStem(subQuestions, 2, index, indexs)">重新选择图片</el-button></p> | ||
200 | - </div> | ||
201 | - <el-button slot="reference" class="icon-tickets" type="primary" circle size="mini" | ||
202 | - icon="el-icon-tickets"></el-button> | ||
203 | - </el-popover> | 290 | + <el-button |
291 | + class="icon-tickets" | ||
292 | + type="primary" | ||
293 | + circle | ||
294 | + size="mini" | ||
295 | + icon="el-icon-tickets" | ||
296 | + @click="openStem(subQuestions, 2, index, indexs)" | ||
297 | + ></el-button> | ||
204 | </div> | 298 | </div> |
205 | <div class="qs-set"> | 299 | <div class="qs-set"> |
206 | - <el-button type="primary" circle size="mini" icon="el-icon-price-tag" | ||
207 | - @click="openKnowledge(subQuestions, index, indexs)"></el-button> | 300 | + <el-button |
301 | + type="primary" | ||
302 | + circle | ||
303 | + size="mini" | ||
304 | + icon="el-icon-price-tag" | ||
305 | + @click="openKnowledge(subQuestions, index, indexs)" | ||
306 | + ></el-button> | ||
208 | </div> | 307 | </div> |
209 | </div> | 308 | </div> |
210 | </div> | 309 | </div> |
@@ -216,45 +315,83 @@ | @@ -216,45 +315,83 @@ | ||
216 | <el-button type="danger" plain round @click="linkBack">取消</el-button> | 315 | <el-button type="danger" plain round @click="linkBack">取消</el-button> |
217 | <el-button type="primary" round @click="save">保存</el-button> | 316 | <el-button type="primary" round @click="save">保存</el-button> |
218 | </div> | 317 | </div> |
219 | - <el-dialog :close-on-click-modal="false" title="批量设置答案" :visible.sync="diaSetAns" width="400" | ||
220 | - :modal-append-to-body="false"> | 318 | + <el-dialog |
319 | + :close-on-click-modal="false" | ||
320 | + title="批量设置答案" | ||
321 | + :visible.sync="diaSetAns" | ||
322 | + width="400" | ||
323 | + :modal-append-to-body="false" | ||
324 | + > | ||
221 | <div class="qs-options set-questions"> | 325 | <div class="qs-options set-questions"> |
222 | <p class="dia-tips"> | 326 | <p class="dia-tips"> |
223 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” | 327 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
224 | </p> | 328 | </p> |
225 | <p>{{ setSubPro(formAns.qusType) }}:</p> | 329 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
226 | <p class="ipt"> | 330 | <p class="ipt"> |
227 | - <el-input ref="formAnsIpt" v-if="formAns.qusType == 2 || formAns.qusType == 3" v-model="formAns.answerList" | 331 | + <el-input |
332 | + ref="formAnsIpt" | ||
333 | + v-if="formAns.qusType == 2 || formAns.qusType == 3" | ||
334 | + v-model="formAns.answerList" | ||
228 | @keydown.native="keydownAnswer($event, formAns.qusType)" | 335 | @keydown.native="keydownAnswer($event, formAns.qusType)" |
229 | - @input="setAllAnswer($event, formAns.qusType)"></el-input> | ||
230 | - <el-input v-if="formAns.qusType == 4" v-model="formAns.answerList" readonly=""></el-input> | 336 | + @input="setAllAnswer($event, formAns.qusType)" |
337 | + ></el-input> | ||
338 | + <el-input | ||
339 | + v-if="formAns.qusType == 4" | ||
340 | + v-model="formAns.answerList" | ||
341 | + readonly="" | ||
342 | + ></el-input> | ||
231 | </p> | 343 | </p> |
232 | <p class="answer-box"> | 344 | <p class="answer-box"> |
233 | <template v-if="formAns.qusType == 4"> | 345 | <template v-if="formAns.qusType == 4"> |
234 | - <span class="answer-s active" @click=" | ||
235 | - formAns.answerList.length < formAns.subNum | ||
236 | - ? (formAns.answerList += '✓') | ||
237 | - : '' | ||
238 | - ">✓</span> | ||
239 | - <span class="answer-s active" @click=" | ||
240 | - formAns.answerList.length < formAns.subNum | ||
241 | - ? (formAns.answerList += '✗') | ||
242 | - : '' | ||
243 | - ">✗</span> | 346 | + <span |
347 | + class="answer-s active" | ||
348 | + @click=" | ||
349 | + formAns.answerList.length < formAns.subNum | ||
350 | + ? (formAns.answerList += '✓') | ||
351 | + : '' | ||
352 | + " | ||
353 | + >✓</span | ||
354 | + > | ||
355 | + <span | ||
356 | + class="answer-s active" | ||
357 | + @click=" | ||
358 | + formAns.answerList.length < formAns.subNum | ||
359 | + ? (formAns.answerList += '✗') | ||
360 | + : '' | ||
361 | + " | ||
362 | + >✗</span | ||
363 | + > | ||
244 | </template> | 364 | </template> |
245 | <template v-if="formAns.qusType == 3"> | 365 | <template v-if="formAns.qusType == 3"> |
246 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" | ||
247 | - @click="setMultiple(formAns, option)">{{ option }}</span> | ||
248 | - <span class="answer-s active" @click="setMultiple(formAns, ',')">,</span> | 366 | + <span |
367 | + class="answer-s active" | ||
368 | + v-for="option in formAns.answerOptions.split(',')" | ||
369 | + :key="option" | ||
370 | + @click="setMultiple(formAns, option)" | ||
371 | + >{{ option }}</span | ||
372 | + > | ||
373 | + <span class="answer-s active" @click="setMultiple(formAns, ',')" | ||
374 | + >,</span | ||
375 | + > | ||
249 | </template> | 376 | </template> |
250 | <template v-if="formAns.qusType == 2"> | 377 | <template v-if="formAns.qusType == 2"> |
251 | - <span class="answer-s active" v-for="option in formAns.answerOptions.split(',')" :key="option" @click=" | ||
252 | - formAns.answerList.length < formAns.subNum | ||
253 | - ? (formAns.answerList += option) | ||
254 | - : '' | ||
255 | - ">{{ option }}</span> | 378 | + <span |
379 | + class="answer-s active" | ||
380 | + v-for="option in formAns.answerOptions.split(',')" | ||
381 | + :key="option" | ||
382 | + @click=" | ||
383 | + formAns.answerList.length < formAns.subNum | ||
384 | + ? (formAns.answerList += option) | ||
385 | + : '' | ||
386 | + " | ||
387 | + >{{ option }}</span | ||
388 | + > | ||
256 | </template> | 389 | </template> |
257 | - <span class="answer-s delButton" @click="formAns.answerList = formAns.answerList.slice(0, -1)">x</span> | 390 | + <span |
391 | + class="answer-s delButton" | ||
392 | + @click="formAns.answerList = formAns.answerList.slice(0, -1)" | ||
393 | + >x</span | ||
394 | + > | ||
258 | <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> | 395 | <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> |
259 | </p> | 396 | </p> |
260 | </div> | 397 | </div> |
@@ -263,18 +400,42 @@ | @@ -263,18 +400,42 @@ | ||
263 | <el-button @click="diaSetAns = false">取 消</el-button> | 400 | <el-button @click="diaSetAns = false">取 消</el-button> |
264 | </div> | 401 | </div> |
265 | </el-dialog> | 402 | </el-dialog> |
266 | - <el-dialog :close-on-click-modal="false" :title="stem.type == 1 ? '上传题干' : '上传题目解析'" :visible.sync="dialogStem" | ||
267 | - v-if="dialogStem" width="500"> | 403 | + <el-dialog |
404 | + :close-on-click-modal="false" | ||
405 | + :title="stem.type == 1 ? '上传题干' : '上传题目解析'" | ||
406 | + :visible.sync="dialogStem" | ||
407 | + v-if="dialogStem" | ||
408 | + width="500" | ||
409 | + > | ||
268 | <div class="upload-box"> | 410 | <div class="upload-box"> |
269 | - <template v-show="stem.type == 1"> | ||
270 | - <img v-if="stem.screenshot && !stem.screenshot.includes('html')" :src="stem.screenshot" class="stem-pic" /> | ||
271 | - </template> | ||
272 | - <template v-show="stem.type == 2"> | ||
273 | - <img v-if="stem.answerScreenshot && !stem.answerScreenshot.includes('html')" :src="stem.answerScreenshot" | ||
274 | - class="stem-pic" /> | ||
275 | - </template> | ||
276 | - <el-upload class="upload-demo" :action="uploadUrl" :limit="1" :on-success="upSuccess" :on-error="upError" | ||
277 | - accept="image/*"> | 411 | + <div v-loading="iframeLoading"> |
412 | + <template v-if="stem.type == 1"> | ||
413 | + <iframe | ||
414 | + ref="screenshot" | ||
415 | + class="screenshot" | ||
416 | + v-if="stem.screenshot" | ||
417 | + :src="stem.screenshot" | ||
418 | + @load="iframeLoading = false" | ||
419 | + ></iframe> | ||
420 | + </template> | ||
421 | + <template v-else> | ||
422 | + <iframe | ||
423 | + ref="screenshot" | ||
424 | + class="screenshot" | ||
425 | + v-if="stem.answerScreenshot" | ||
426 | + :src="stem.answerScreenshot" | ||
427 | + @load="iframeLoading = false" | ||
428 | + ></iframe> | ||
429 | + </template> | ||
430 | + </div> | ||
431 | + <el-upload | ||
432 | + class="upload-demo" | ||
433 | + :action="uploadUrl" | ||
434 | + :limit="1" | ||
435 | + :on-success="upSuccess" | ||
436 | + :on-error="upError" | ||
437 | + accept="image/*" | ||
438 | + > | ||
278 | <el-button size="small" type="primary">选择照片</el-button> | 439 | <el-button size="small" type="primary">选择照片</el-button> |
279 | </el-upload> | 440 | </el-upload> |
280 | </div> | 441 | </div> |
@@ -282,13 +443,29 @@ | @@ -282,13 +443,29 @@ | ||
282 | <el-button @click="dialogStem = false">确定</el-button> | 443 | <el-button @click="dialogStem = false">确定</el-button> |
283 | </div> | 444 | </div> |
284 | </el-dialog> | 445 | </el-dialog> |
285 | - <el-dialog :close-on-click-modal="false" title="知识点" :visible.sync="dialogKnowledge" width="500"> | 446 | + <el-dialog |
447 | + :close-on-click-modal="false" | ||
448 | + title="知识点" | ||
449 | + :visible.sync="dialogKnowledge" | ||
450 | + width="500" | ||
451 | + > | ||
286 | <div> | 452 | <div> |
287 | <el-form ref="form" :model="stem" label-width="160px"> | 453 | <el-form ref="form" :model="stem" label-width="160px"> |
288 | <el-form-item label="知识点:"> | 454 | <el-form-item label="知识点:"> |
289 | - <el-cascader size="small" filterable :show-all-levels="false" clearable placeholder="选择知识点" | ||
290 | - v-model="stem.knowledge" :options="knowledgeData" | ||
291 | - :props="{ expandTrigger: 'hover', multiple: true, checkStrictly: true }"></el-cascader> | 455 | + <el-cascader |
456 | + size="small" | ||
457 | + filterable | ||
458 | + :show-all-levels="false" | ||
459 | + clearable | ||
460 | + placeholder="选择知识点" | ||
461 | + v-model="stem.knowledge" | ||
462 | + :options="knowledgeData" | ||
463 | + :props="{ | ||
464 | + expandTrigger: 'hover', | ||
465 | + multiple: true, | ||
466 | + checkStrictly: true, | ||
467 | + }" | ||
468 | + ></el-cascader> | ||
292 | </el-form-item> | 469 | </el-form-item> |
293 | </el-form> | 470 | </el-form> |
294 | </div> | 471 | </div> |
@@ -311,7 +488,7 @@ export default { | @@ -311,7 +488,7 @@ export default { | ||
311 | title: "", | 488 | title: "", |
312 | type: 1, | 489 | type: 1, |
313 | questionList: [], | 490 | questionList: [], |
314 | - paperType: 1,//1 备题(随堂问) /2 组卷 | 491 | + paperType: 1, //1 备题(随堂问) /2 组卷 |
315 | //答题卡详情 | 492 | //答题卡详情 |
316 | form: { | 493 | form: { |
317 | examType: 2, //考试类型:0-未知/1-随堂问/2-即时测/3-xx考 | 494 | examType: 2, //考试类型:0-未知/1-随堂问/2-即时测/3-xx考 |
@@ -352,7 +529,8 @@ export default { | @@ -352,7 +529,8 @@ export default { | ||
352 | knowledge: [], //知识点 | 529 | knowledge: [], //知识点 |
353 | }, | 530 | }, |
354 | gradeClassList: [], //学段列表 | 531 | gradeClassList: [], //学段列表 |
355 | - uploadUrl: "/file/uploadImgToHtml" | 532 | + uploadUrl: "/file/uploadImgToHtml", |
533 | + iframeLoading: false, | ||
356 | }; | 534 | }; |
357 | }, | 535 | }, |
358 | computed: { | 536 | computed: { |
@@ -364,30 +542,37 @@ export default { | @@ -364,30 +542,37 @@ export default { | ||
364 | return a + (Number(b.score) || 0); | 542 | return a + (Number(b.score) || 0); |
365 | }, 0); | 543 | }, 0); |
366 | } else { | 544 | } else { |
367 | - score += (item.score || 0); | 545 | + score += item.score || 0; |
368 | } | 546 | } |
369 | }, 0); | 547 | }, 0); |
370 | return Number(score).toFixed(2); | 548 | return Number(score).toFixed(2); |
371 | }, | 549 | }, |
372 | // 知识点列表 根据学段-科目筛选 | 550 | // 知识点列表 根据学段-科目筛选 |
373 | knowledgeData: function () { | 551 | knowledgeData: function () { |
374 | - let jsons = [] | 552 | + let jsons = []; |
375 | if (this.form.gradeName && this.form.subjectName) { | 553 | if (this.form.gradeName && this.form.subjectName) { |
376 | - let sectionName = "" | ||
377 | - this.gradeClassList?.map(item => { | 554 | + let sectionName = ""; |
555 | + this.gradeClassList?.map((item) => { | ||
378 | if (this.form.gradeName == item.gradeName) { | 556 | if (this.form.gradeName == item.gradeName) { |
379 | - sectionName = item.sectionName | 557 | + sectionName = item.sectionName; |
380 | } | 558 | } |
381 | - }) | ||
382 | - console.log(this.gradeClassList) | ||
383 | - console.log(sectionName) | ||
384 | - if (sectionName && Object.keys(this.knowledgeList).includes(sectionName)) { | ||
385 | - if (Object.keys(this.knowledgeList[sectionName]).includes(this.form.subjectName)) { | ||
386 | - jsons = this.knowledgeList[sectionName][this.form.subjectName] | 559 | + }); |
560 | + console.log(this.gradeClassList); | ||
561 | + console.log(sectionName); | ||
562 | + if ( | ||
563 | + sectionName && | ||
564 | + Object.keys(this.knowledgeList).includes(sectionName) | ||
565 | + ) { | ||
566 | + if ( | ||
567 | + Object.keys(this.knowledgeList[sectionName]).includes( | ||
568 | + this.form.subjectName | ||
569 | + ) | ||
570 | + ) { | ||
571 | + jsons = this.knowledgeList[sectionName][this.form.subjectName]; | ||
387 | } | 572 | } |
388 | } | 573 | } |
389 | } | 574 | } |
390 | - return jsons | 575 | + return jsons; |
391 | }, | 576 | }, |
392 | }, | 577 | }, |
393 | created() { | 578 | created() { |
@@ -404,12 +589,20 @@ export default { | @@ -404,12 +589,20 @@ export default { | ||
404 | // v1.5 | 589 | // v1.5 |
405 | //上传截图 | 590 | //上传截图 |
406 | openStem(obj, type, index, indexs) { | 591 | openStem(obj, type, index, indexs) { |
592 | + this.iframeLoading = true; | ||
593 | + this.stem.type = type; | ||
407 | this.stem.index = index; | 594 | this.stem.index = index; |
408 | this.stem.indexs = indexs; | 595 | this.stem.indexs = indexs; |
409 | if (type == 1) { | 596 | if (type == 1) { |
597 | + if (obj.screenshot == "") { | ||
598 | + this.iframeLoading = false; | ||
599 | + } | ||
410 | this.stem.screenshot = obj.screenshot || ""; | 600 | this.stem.screenshot = obj.screenshot || ""; |
411 | this.stem.answerScreenshot = ""; | 601 | this.stem.answerScreenshot = ""; |
412 | } else { | 602 | } else { |
603 | + if (obj.answerScreenshot == "") { | ||
604 | + this.iframeLoading = false; | ||
605 | + } | ||
413 | this.stem.answerScreenshot = obj.answerScreenshot || ""; | 606 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
414 | this.stem.screenshot = ""; | 607 | this.stem.screenshot = ""; |
415 | } | 608 | } |
@@ -422,18 +615,22 @@ export default { | @@ -422,18 +615,22 @@ export default { | ||
422 | this.stem.screenshot = res.data.url; | 615 | this.stem.screenshot = res.data.url; |
423 | if (this.stem.type == 1) { | 616 | if (this.stem.type == 1) { |
424 | if (this.questionList[0]?.subQuestions) { | 617 | if (this.questionList[0]?.subQuestions) { |
425 | - this.questionList[this.stem.index].subQuestions[this.stem.indexs].screenshot = this.stem.screenshot; | 618 | + this.questionList[this.stem.index].subQuestions[ |
619 | + this.stem.indexs | ||
620 | + ].screenshot = this.stem.screenshot; | ||
426 | } else { | 621 | } else { |
427 | - this.questionList[this.stem.index].screenshot = this.stem.screenshot; | 622 | + this.questionList[this.stem.index].screenshot = |
623 | + this.stem.screenshot; | ||
428 | } | 624 | } |
429 | - | ||
430 | } else { | 625 | } else { |
431 | if (this.questionList[0]?.subQuestions) { | 626 | if (this.questionList[0]?.subQuestions) { |
432 | - this.questionList[this.stem.index].subQuestions[this.stem.indexs].answerScreenshot = this.stem.answerScreenshot; | 627 | + this.questionList[this.stem.index].subQuestions[ |
628 | + this.stem.indexs | ||
629 | + ].answerScreenshot = this.stem.answerScreenshot; | ||
433 | } else { | 630 | } else { |
434 | - this.questionList[this.stem.index].answerScreenshot = this.stem.answerScreenshot; | 631 | + this.questionList[this.stem.index].answerScreenshot = |
632 | + this.stem.answerScreenshot; | ||
435 | } | 633 | } |
436 | - | ||
437 | } | 634 | } |
438 | 635 | ||
439 | this.$message.success("上传成功"); | 636 | this.$message.success("上传成功"); |
@@ -449,7 +646,7 @@ export default { | @@ -449,7 +646,7 @@ export default { | ||
449 | 646 | ||
450 | const { data, status, info } = await fetchClassList(); | 647 | const { data, status, info } = await fetchClassList(); |
451 | if (status == 0) { | 648 | if (status == 0) { |
452 | - this.gradeClassList = data.list | 649 | + this.gradeClassList = data.list; |
453 | } else { | 650 | } else { |
454 | this.$message.error(info); | 651 | this.$message.error(info); |
455 | } | 652 | } |
@@ -471,13 +668,13 @@ export default { | @@ -471,13 +668,13 @@ export default { | ||
471 | this.stem.indexs | 668 | this.stem.indexs |
472 | ].knowledge = this.stem.knowledge.join("#"); | 669 | ].knowledge = this.stem.knowledge.join("#"); |
473 | } else { | 670 | } else { |
474 | - this.questionList[this.stem.index].knowledge = this.stem.knowledge.join("#"); | 671 | + this.questionList[this.stem.index].knowledge = |
672 | + this.stem.knowledge.join("#"); | ||
475 | } | 673 | } |
476 | this.dialogKnowledge = false; | 674 | this.dialogKnowledge = false; |
477 | }, | 675 | }, |
478 | //end | 676 | //end |
479 | 677 | ||
480 | - | ||
481 | linkBack() { | 678 | linkBack() { |
482 | this.$router.go(-1); | 679 | this.$router.go(-1); |
483 | }, | 680 | }, |
@@ -665,7 +862,7 @@ export default { | @@ -665,7 +862,7 @@ export default { | ||
665 | if (this.formAns.endIndex == item.questionIndex) { | 862 | if (this.formAns.endIndex == item.questionIndex) { |
666 | EndIndex = index; | 863 | EndIndex = index; |
667 | } | 864 | } |
668 | - return this.formAns.endIndex == item.questionIndex | 865 | + return this.formAns.endIndex == item.questionIndex; |
669 | } | 866 | } |
670 | ); | 867 | ); |
671 | } else { | 868 | } else { |
@@ -673,7 +870,7 @@ export default { | @@ -673,7 +870,7 @@ export default { | ||
673 | if (this.formAns.endIndex == item.questionIndex) { | 870 | if (this.formAns.endIndex == item.questionIndex) { |
674 | EndIndex = index; | 871 | EndIndex = index; |
675 | } | 872 | } |
676 | - return this.formAns.endIndex == item.questionIndex | 873 | + return this.formAns.endIndex == item.questionIndex; |
677 | }); | 874 | }); |
678 | } | 875 | } |
679 | 876 | ||
@@ -688,8 +885,8 @@ export default { | @@ -688,8 +885,8 @@ export default { | ||
688 | this.formAns.answerList[subNum - i] == "✓" | 885 | this.formAns.answerList[subNum - i] == "✓" |
689 | ? 1 | 886 | ? 1 |
690 | : this.formAns.answerList[subNum - i] == "✗" | 887 | : this.formAns.answerList[subNum - i] == "✗" |
691 | - ? 2 | ||
692 | - : ""; | 888 | + ? 2 |
889 | + : ""; | ||
693 | } | 890 | } |
694 | if (this.questionList[0]?.subQuestions) { | 891 | if (this.questionList[0]?.subQuestions) { |
695 | this.questionList[this.formAns.listIndex].subQuestions[ | 892 | this.questionList[this.formAns.listIndex].subQuestions[ |
@@ -770,22 +967,22 @@ export default { | @@ -770,22 +967,22 @@ export default { | ||
770 | this.type == 1 | 967 | this.type == 1 |
771 | ? this.$request.pPaperDetail | 968 | ? this.$request.pPaperDetail |
772 | : this.type == 2 | 969 | : this.type == 2 |
773 | - ? this.$request.pExamQuestionList | ||
774 | - : this.$request.pPeriodQuestionList; | 970 | + ? this.$request.pExamQuestionList |
971 | + : this.$request.pPeriodQuestionList; | ||
775 | } else { | 972 | } else { |
776 | detail = | 973 | detail = |
777 | this.type == 1 | 974 | this.type == 1 |
778 | ? this.$request.fetchPaperDetail | 975 | ? this.$request.fetchPaperDetail |
779 | : this.type == 2 | 976 | : this.type == 2 |
780 | - ? this.$request.examQuestionList | ||
781 | - : this.$request.periodQuestionList; | 977 | + ? this.$request.examQuestionList |
978 | + : this.$request.periodQuestionList; | ||
782 | } | 979 | } |
783 | let params = | 980 | let params = |
784 | this.type == 1 | 981 | this.type == 1 |
785 | ? { paperId: this.$route.query.paperId } | 982 | ? { paperId: this.$route.query.paperId } |
786 | : this.type == 2 | 983 | : this.type == 2 |
787 | - ? { examId: this.$route.query.paperId } | ||
788 | - : { | 984 | + ? { examId: this.$route.query.paperId } |
985 | + : { | ||
789 | periodId: this.$route.query.paperId, | 986 | periodId: this.$route.query.paperId, |
790 | }; | 987 | }; |
791 | const { data, status, info } = await detail(params); | 988 | const { data, status, info } = await detail(params); |
@@ -803,7 +1000,7 @@ export default { | @@ -803,7 +1000,7 @@ export default { | ||
803 | return a.questionIndex - b.questionIndex; | 1000 | return a.questionIndex - b.questionIndex; |
804 | }); | 1001 | }); |
805 | } | 1002 | } |
806 | - this.formateQuestion() | 1003 | + this.formateQuestion(); |
807 | } else { | 1004 | } else { |
808 | this.$message.error(info); | 1005 | this.$message.error(info); |
809 | } | 1006 | } |
@@ -822,8 +1019,7 @@ export default { | @@ -822,8 +1019,7 @@ export default { | ||
822 | //同类型批量答案+1 | 1019 | //同类型批量答案+1 |
823 | types[addndex].subNum += 1; | 1020 | types[addndex].subNum += 1; |
824 | if ( | 1021 | if ( |
825 | - types[addndex].answerOptions.length < | ||
826 | - sub.answerOptions.length | 1022 | + types[addndex].answerOptions.length < sub.answerOptions.length |
827 | ) { | 1023 | ) { |
828 | types[addndex].answerOptions = sub.answerOptions; | 1024 | types[addndex].answerOptions = sub.answerOptions; |
829 | } | 1025 | } |
@@ -935,7 +1131,26 @@ export default { | @@ -935,7 +1131,26 @@ export default { | ||
935 | }, | 1131 | }, |
936 | }; | 1132 | }; |
937 | </script> | 1133 | </script> |
1134 | +<style> | ||
1135 | +.screenshot-box { | ||
1136 | + width: 600px; | ||
1137 | +} | ||
1138 | + | ||
1139 | +.screenshot { | ||
1140 | + width: 100%; | ||
1141 | + box-shadow: none; | ||
1142 | + border: none; | ||
1143 | + height: 400px; | ||
1144 | +} | ||
938 | 1145 | ||
1146 | +.screenshot-img { | ||
1147 | + display: block; | ||
1148 | + width: auto; | ||
1149 | + max-width: 100%; | ||
1150 | + margin: 0 auto; | ||
1151 | + margin-bottom: 10px; | ||
1152 | +} | ||
1153 | +</style> | ||
939 | <style lang="scss" scoped> | 1154 | <style lang="scss" scoped> |
940 | .content { | 1155 | .content { |
941 | width: 100%; | 1156 | width: 100%; |
@@ -1032,6 +1247,19 @@ export default { | @@ -1032,6 +1247,19 @@ export default { | ||
1032 | font-weight: 700; | 1247 | font-weight: 700; |
1033 | } | 1248 | } |
1034 | } | 1249 | } |
1250 | +.question-box { | ||
1251 | + margin-bottom: 20px; | ||
1252 | + | ||
1253 | + .screenshot-box { | ||
1254 | + width: 100%; | ||
1255 | + border: 1px solid #e2e2e2; | ||
1256 | + margin-bottom: 20px; | ||
1257 | + | ||
1258 | + .screenshot-img { | ||
1259 | + margin: 0; | ||
1260 | + } | ||
1261 | + } | ||
1262 | +} | ||
1035 | 1263 | ||
1036 | .set-ans-btn { | 1264 | .set-ans-btn { |
1037 | width: 100%; | 1265 | width: 100%; |
@@ -1069,7 +1297,7 @@ export default { | @@ -1069,7 +1297,7 @@ export default { | ||
1069 | display: flex; | 1297 | display: flex; |
1070 | border-bottom: 1px solid #e2e2e2; | 1298 | border-bottom: 1px solid #e2e2e2; |
1071 | 1299 | ||
1072 | - &>div { | 1300 | + & > div { |
1073 | min-height: 40px; | 1301 | min-height: 40px; |
1074 | padding: 5px; | 1302 | padding: 5px; |
1075 | flex-shrink: 0; | 1303 | flex-shrink: 0; |