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 | 167 | }, |
168 | 168 | methods: { |
169 | 169 | print() { |
170 | + let title = this.detail.title || this.subjectNames.join(); | |
170 | 171 | let name = ""; |
171 | 172 | this.tabList.map((item) => { |
172 | 173 | if (item.value == this.type) { |
173 | 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 | 182 | setType(type) { |
182 | 183 | this.type = type; | ... | ... |
src/views/basic/setUp/teacher.vue
... | ... | @@ -993,10 +993,6 @@ export default { |
993 | 993 | ...query, |
994 | 994 | }); |
995 | 995 | if (status === 0) { |
996 | - this.classList = []; | |
997 | - this.gradeClassList = []; | |
998 | - this.gradeClassSubList = []; | |
999 | - this.gradeSubListClass = []; | |
1000 | 996 | this.gradeList = |
1001 | 997 | data.list?.map((item) => { |
1002 | 998 | let subList = item.subjectNames?.map((items) => { |
... | ... | @@ -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 | 1019 | this.gradeSubListClass.push({ |
1038 | 1020 | value: item.grade, |
... | ... | @@ -1063,6 +1045,7 @@ export default { |
1063 | 1045 | }), |
1064 | 1046 | }); |
1065 | 1047 | } else { |
1048 | + this.gradeClassSubList = []; | |
1066 | 1049 | if (this.query.classType == 0) { |
1067 | 1050 | //学校-年级-科目 |
1068 | 1051 | this.gradeClassSubList.push({ | ... | ... |
src/views/basic/test/index.vue
... | ... | @@ -157,14 +157,14 @@ export default { |
157 | 157 | } |
158 | 158 | }, |
159 | 159 | handleCheckAllChangeSub(val) { |
160 | - this.isIndeterminate = false; | |
160 | + this.isIndeterminateSub = false; | |
161 | 161 | this.query.subjectNames = val ? this.subjectList : []; |
162 | 162 | }, |
163 | 163 | CheckedSub(value) { |
164 | 164 | console.log(value); |
165 | 165 | let checkedCount = value.length; |
166 | 166 | this.allSubject = checkedCount === this.subjectList.length; |
167 | - this.isIndeterminate = | |
167 | + this.isIndeterminateSub = | |
168 | 168 | checkedCount > 0 && checkedCount < this.subjectList.length; |
169 | 169 | }, |
170 | 170 | setDate(index) { | ... | ... |
src/views/examinationPaper/add.vue
... | ... | @@ -805,70 +805,26 @@ |
805 | 805 | </div> |
806 | 806 | <template v-if="isUpload"> |
807 | 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 | 817 | </div> |
840 | 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 | 828 | </div> |
873 | 829 | <div class="qs-upload"> |
874 | 830 | <el-button |
... | ... | @@ -1039,20 +995,26 @@ |
1039 | 995 | width="500" |
1040 | 996 | > |
1041 | 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 | 1018 | <el-upload |
1057 | 1019 | class="upload-demo" |
1058 | 1020 | :action="uploadUrl" |
... | ... | @@ -1254,6 +1216,7 @@ export default { |
1254 | 1216 | listType: 1, |
1255 | 1217 | listShare: 0, |
1256 | 1218 | uploadUrl: "/file/uploadImgToHtml", |
1219 | + iframeLoading: false, | |
1257 | 1220 | }; |
1258 | 1221 | }, |
1259 | 1222 | async created() { |
... | ... | @@ -1292,13 +1255,20 @@ export default { |
1292 | 1255 | // v1.5 |
1293 | 1256 | //上传截图 |
1294 | 1257 | openStem(obj, index, indexs, type) { |
1258 | + this.iframeLoading = true; | |
1295 | 1259 | this.stem.index = index; |
1296 | 1260 | this.stem.indexs = indexs; |
1297 | 1261 | this.stem.type = type; |
1298 | 1262 | if (type == 1) { |
1263 | + if (obj.screenshot == "") { | |
1264 | + this.iframeLoading = false; | |
1265 | + } | |
1299 | 1266 | this.stem.screenshot = obj.screenshot || ""; |
1300 | 1267 | this.stem.answerScreenshot = ""; |
1301 | 1268 | } else { |
1269 | + if (obj.answerScreenshot == "") { | |
1270 | + this.iframeLoading = false; | |
1271 | + } | |
1302 | 1272 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
1303 | 1273 | this.stem.screenshot = ""; |
1304 | 1274 | } | ... | ... |
src/views/examinationPaper/addQs.vue
... | ... | @@ -7,32 +7,71 @@ |
7 | 7 | </template> |
8 | 8 | </back-box> |
9 | 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 | 16 | <el-step title="基础信息" icon="el-icon-edit"></el-step> |
12 | 17 | <el-step title="题目编辑" icon="el-icon-tickets"></el-step> |
13 | 18 | <el-step title="课件预览" icon="el-icon-edit-outline"></el-step> |
14 | 19 | </el-steps> |
15 | 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 | 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 | 37 | </el-input> |
21 | 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 | 56 | </el-option> |
26 | 57 | </el-select> |
27 | 58 | </el-form-item> |
28 | 59 | <el-form-item label="科目:" prop="subjectName"> |
29 | 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 | 67 | </el-option> |
33 | 68 | </el-select> |
34 | 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 | 75 | <el-radio-group v-model="form.sharingType"> |
37 | 76 | <el-radio :label="0">任课班级分享</el-radio> |
38 | 77 | <el-radio :label="1">全年级分享</el-radio> |
... | ... | @@ -40,7 +79,9 @@ |
40 | 79 | </el-form-item> |
41 | 80 | </el-form> |
42 | 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 | 85 | <el-button type="primary" round @click="setStep1">下一步</el-button> |
45 | 86 | </div> |
46 | 87 | </div> |
... | ... | @@ -64,78 +105,174 @@ |
64 | 105 | </ul> |
65 | 106 | <template v-for="(question, index) in form.questionList"> |
66 | 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 | 123 | </p> |
74 | 124 | <div v-else class="sub-questions"> |
75 | 125 | <div class="qs-num"> |
76 | 126 | {{ setNum(index, indexs, subQuestions) }} |
77 | 127 | </div> |
78 | 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 | 140 | </el-select> |
84 | 141 | </div> |
85 | 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 | 152 | </div> |
89 | 153 | <div class="qs-partScore"> |
90 | 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 | 166 | </div> |
95 | 167 | <div class="qs-options qs-options2"> |
96 | 168 | <p v-if="subQuestions.questionType == 5">--</p> |
97 | 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 | 182 | </p> |
103 | 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 | 196 | </p> |
109 | 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 | 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 | 231 | </p> |
121 | 232 | </div> |
122 | 233 | |
123 | 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 | 243 | </div> |
127 | 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 | 253 | </div> |
131 | 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 | 262 | </div> |
135 | 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 | 276 | </el-popconfirm> |
140 | 277 | </div> |
141 | 278 | </div> |
... | ... | @@ -143,46 +280,88 @@ |
143 | 280 | </ul> |
144 | 281 | </template> |
145 | 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 | 290 | <div class="qs-options"> |
149 | 291 | <p class="dia-tips"> |
150 | 292 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
151 | 293 | </p> |
152 | 294 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
153 | 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 | 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 | 308 | </p> |
159 | 309 | <p class="answer-box"> |
160 | 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 | 329 | </template> |
172 | 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 | 343 | </template> |
177 | 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 | 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 | 365 | </p> |
187 | 366 | </div> |
188 | 367 | <div class="dialog-footer" slot="footer"> |
... | ... | @@ -191,21 +370,48 @@ |
191 | 370 | </div> |
192 | 371 | </el-dialog> |
193 | 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 | 376 | <el-button round @click="step = 0">上一步</el-button> |
196 | 377 | <el-button type="primary" round @click="toStep(2)">下一步</el-button> |
197 | 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 | 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 | 415 | <el-button size="small" type="primary">选择上传照片</el-button> |
210 | 416 | </el-upload> |
211 | 417 | </div> |
... | ... | @@ -213,12 +419,26 @@ |
213 | 419 | <el-button @click="dialogStem = false">保存</el-button> |
214 | 420 | </div> |
215 | 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 | 428 | <div> |
218 | 429 | <el-form ref="form" :model="stem" label-width="160px"> |
219 | 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 | 442 | </el-form-item> |
223 | 443 | </el-form> |
224 | 444 | </div> |
... | ... | @@ -234,13 +454,22 @@ |
234 | 454 | </div> |
235 | 455 | <div class="question-box"> |
236 | 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 | 466 | </div> |
240 | 467 | </template> |
241 | 468 | </div> |
242 | 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 | 473 | <el-button round @click="toStep(1)">上一步</el-button> |
245 | 474 | <el-button type="primary" round @click="save">保存</el-button> |
246 | 475 | </div> |
... | ... | @@ -279,9 +508,7 @@ export default { |
279 | 508 | trigger: "blur", |
280 | 509 | }, |
281 | 510 | ], |
282 | - gradeName: [ | |
283 | - { required: true, message: "请选择年级", trigger: "blur" }, | |
284 | - ], | |
511 | + gradeName: [{ required: true, message: "请选择年级", trigger: "blur" }], | |
285 | 512 | subjectName: [ |
286 | 513 | { required: true, message: "请选择科目", trigger: "blur" }, |
287 | 514 | ], |
... | ... | @@ -318,27 +545,35 @@ export default { |
318 | 545 | //返回列表页参数记录 |
319 | 546 | listType: 1, |
320 | 547 | listShare: 0, |
321 | - uploadUrl: "/file/uploadImgToHtml" | |
548 | + uploadUrl: "/file/uploadImgToHtml", | |
549 | + iframeLoading: false, | |
322 | 550 | }; |
323 | 551 | }, |
324 | 552 | computed: { |
325 | 553 | // 知识点列表 根据学段-科目筛选 |
326 | 554 | knowledgeData: function () { |
327 | - let jsons = [] | |
555 | + let jsons = []; | |
328 | 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 | 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 | 579 | watch: { |
... | ... | @@ -350,19 +585,23 @@ export default { |
350 | 585 | }, |
351 | 586 | async created() { |
352 | 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 | 591 | this.type = this.$route.query.type ? this.$route.query.type : 1; |
355 | 592 | this.role = |
356 | 593 | this.$store.getters.info.showRole || |
357 | 594 | this.$store.getters.info.permissions[0].role; |
358 | 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 | 605 | if (this.role != "ROLE_PERSONAL") { |
367 | 606 | this.formRules.gradeName = [ |
368 | 607 | { required: true, message: "请选择年级", trigger: "blur" }, |
... | ... | @@ -378,13 +617,20 @@ export default { |
378 | 617 | // v1.5 |
379 | 618 | //上传截图 |
380 | 619 | openStem(obj, index, indexs, type) { |
620 | + this.iframeLoading = true; | |
381 | 621 | this.stem.index = index; |
382 | 622 | this.stem.indexs = indexs; |
383 | 623 | this.stem.type = type; |
384 | 624 | if (type == 1) { |
625 | + if (obj.screenshot == "") { | |
626 | + this.iframeLoading = false; | |
627 | + } | |
385 | 628 | this.stem.screenshot = obj.screenshot || ""; |
386 | 629 | this.stem.answerScreenshot = ""; |
387 | 630 | } else { |
631 | + if (obj.answerScreenshot == "") { | |
632 | + this.iframeLoading = false; | |
633 | + } | |
388 | 634 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
389 | 635 | this.stem.screenshot = ""; |
390 | 636 | } |
... | ... | @@ -397,10 +643,14 @@ export default { |
397 | 643 | if (res && res.status == 0) { |
398 | 644 | if (this.stem.type == 1) { |
399 | 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 | 649 | } else { |
402 | 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 | 655 | this.$message.success("上传成功"); |
406 | 656 | } else { |
... | ... | @@ -420,15 +670,16 @@ export default { |
420 | 670 | }, |
421 | 671 | // 知识点 |
422 | 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 | 676 | this.dialogKnowledge = false; |
425 | 677 | }, |
426 | 678 | |
427 | 679 | //end |
428 | 680 | linkBack() { |
429 | 681 | this.$confirm( |
430 | - (this.type == 2 ? "修改复制的" : "导入的") + | |
431 | - "课件未保存,确认退出吗?", | |
682 | + (this.type == 2 ? "修改复制的" : "导入的") + "课件未保存,确认退出吗?", | |
432 | 683 | "提示", |
433 | 684 | { |
434 | 685 | confirmButtonText: "取消", |
... | ... | @@ -441,14 +692,14 @@ export default { |
441 | 692 | type: "warning", |
442 | 693 | } |
443 | 694 | ) |
444 | - .then(() => { }) | |
695 | + .then(() => {}) | |
445 | 696 | .catch(() => { |
446 | 697 | this.$router.push({ |
447 | 698 | path: "/examinationPaper", |
448 | 699 | query: { |
449 | 700 | type: this.listType, |
450 | 701 | share: this.listShare, |
451 | - } | |
702 | + }, | |
452 | 703 | }); |
453 | 704 | }); |
454 | 705 | }, |
... | ... | @@ -473,8 +724,8 @@ export default { |
473 | 724 | }, |
474 | 725 | //计算题号 |
475 | 726 | setNum(index, indexs, sub) { |
476 | - let lengths = 0;//所在大题之前的所有小题数量 | |
477 | - let subIndex = 0;//所在大题的位置 | |
727 | + let lengths = 0; //所在大题之前的所有小题数量 | |
728 | + let subIndex = 0; //所在大题的位置 | |
478 | 729 | for (let i = 0; i < index; i++) { |
479 | 730 | let subArr = this.form.questionList[i].subQuestions.filter((item) => { |
480 | 731 | return !!item.questionType; |
... | ... | @@ -490,7 +741,7 @@ export default { |
490 | 741 | }, |
491 | 742 | //整理问题 |
492 | 743 | formateQuestion() { |
493 | - this.formatQuestionList() | |
744 | + this.formatQuestionList(); | |
494 | 745 | this.form.questionList?.map((item) => { |
495 | 746 | let types = [{}]; |
496 | 747 | let addndex = 0; |
... | ... | @@ -641,7 +892,7 @@ export default { |
641 | 892 | if (this.formAns.endIndex == item.questionIndex) { |
642 | 893 | EndIndex = index; |
643 | 894 | } |
644 | - return this.formAns.endIndex == item.questionIndex | |
895 | + return this.formAns.endIndex == item.questionIndex; | |
645 | 896 | } |
646 | 897 | ); |
647 | 898 | for (let i = 0; i <= subNum; i++) { |
... | ... | @@ -655,8 +906,8 @@ export default { |
655 | 906 | this.formAns.answerList[subNum - i] == "✓" |
656 | 907 | ? 1 |
657 | 908 | : this.formAns.answerList[subNum - i] == "✗" |
658 | - ? 2 | |
659 | - : ""; | |
909 | + ? 2 | |
910 | + : ""; | |
660 | 911 | } |
661 | 912 | this.form.questionList[this.formAns.listIndex].subQuestions[ |
662 | 913 | EndIndex - i |
... | ... | @@ -694,7 +945,6 @@ export default { |
694 | 945 | } |
695 | 946 | }, |
696 | 947 | setAllAnswer(event, type) { |
697 | - | |
698 | 948 | let str = this.formAns.answerList; |
699 | 949 | let str2 = checkAnswer( |
700 | 950 | str, |
... | ... | @@ -703,7 +953,6 @@ export default { |
703 | 953 | this.formAns.subNum |
704 | 954 | ); |
705 | 955 | this.formAns.answerList = str2; |
706 | - | |
707 | 956 | }, |
708 | 957 | setAnswer(type, ans) { |
709 | 958 | let txt = ""; |
... | ... | @@ -720,7 +969,7 @@ export default { |
720 | 969 | this.formatQuestionList(); |
721 | 970 | this.step = step; |
722 | 971 | if (step == 1) { |
723 | - this.formateQuestion() | |
972 | + this.formateQuestion(); | |
724 | 973 | } |
725 | 974 | }, |
726 | 975 | setStep1() { |
... | ... | @@ -731,7 +980,7 @@ export default { |
731 | 980 | this.$refs["forms"].validate((valid) => { |
732 | 981 | // 验证通过:保存 |
733 | 982 | if (valid) { |
734 | - this.formateQuestion() | |
983 | + this.formateQuestion(); | |
735 | 984 | this.step = 1; |
736 | 985 | } else { |
737 | 986 | this.$message.error("数据有误,请检查!"); |
... | ... | @@ -757,7 +1006,7 @@ export default { |
757 | 1006 | //删除题 |
758 | 1007 | delTabData(subIndex, index) { |
759 | 1008 | this.form.questionList[index].subQuestions.splice(subIndex, 1); |
760 | - this.formateQuestion() | |
1009 | + this.formateQuestion(); | |
761 | 1010 | }, |
762 | 1011 | //切换题型 |
763 | 1012 | changeSubQuestions(val, subQuestions) { |
... | ... | @@ -785,7 +1034,7 @@ export default { |
785 | 1034 | subQuestions.selectNum = 0; |
786 | 1035 | break; |
787 | 1036 | } |
788 | - this.formateQuestion() | |
1037 | + this.formateQuestion(); | |
789 | 1038 | }, |
790 | 1039 | //设置多选答案 |
791 | 1040 | changAnswer(sub, option) { |
... | ... | @@ -799,9 +1048,6 @@ export default { |
799 | 1048 | } |
800 | 1049 | }, |
801 | 1050 | |
802 | - | |
803 | - | |
804 | - | |
805 | 1051 | async save() { |
806 | 1052 | if (this.saveLoading) return; |
807 | 1053 | this.saveLoading = true; |
... | ... | @@ -822,7 +1068,7 @@ export default { |
822 | 1068 | query: { |
823 | 1069 | type: this.listType, |
824 | 1070 | share: this.listShare, |
825 | - } | |
1071 | + }, | |
826 | 1072 | }); |
827 | 1073 | } else { |
828 | 1074 | this.$message.error(info); |
... | ... | @@ -846,12 +1092,12 @@ export default { |
846 | 1092 | const { data, status, info } = await fetchClassList(); |
847 | 1093 | if (status == 0) { |
848 | 1094 | this.gradeClassList = data.list?.map((item) => { |
849 | - console.log(!this.gradeList.includes(item.gradeName)) | |
1095 | + console.log(!this.gradeList.includes(item.gradeName)); | |
850 | 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 | 1101 | // this.gradeList = (data.gradeNames && [...data.gradeNames]) || []; |
856 | 1102 | if (this.type != 2) { |
857 | 1103 | this.form.gradeName = this.gradeList[0]; |
... | ... | @@ -906,7 +1152,7 @@ export default { |
906 | 1152 | this.form.sharingType = data.sharingType; |
907 | 1153 | } |
908 | 1154 | this.form.tagId = ""; |
909 | - this.formatData(data) | |
1155 | + this.formatData(data); | |
910 | 1156 | } else { |
911 | 1157 | this.$message.error(info); |
912 | 1158 | } |
... | ... | @@ -951,7 +1197,7 @@ export default { |
951 | 1197 | show: false, |
952 | 1198 | }; |
953 | 1199 | }); |
954 | - } | |
1200 | + }, | |
955 | 1201 | }, |
956 | 1202 | }; |
957 | 1203 | </script> |
... | ... | @@ -1255,7 +1501,7 @@ export default { |
1255 | 1501 | display: flex; |
1256 | 1502 | border-bottom: 1px solid #e2e2e2; |
1257 | 1503 | |
1258 | - &>div { | |
1504 | + & > div { | |
1259 | 1505 | min-height: 40px; |
1260 | 1506 | padding: 5px; |
1261 | 1507 | flex-shrink: 0; | ... | ... |
src/views/examinationPaper/edit.vue
... | ... | @@ -23,7 +23,10 @@ |
23 | 23 | <p class="totals">卷面总分:{{ allScore }}分</p> |
24 | 24 | </div> |
25 | 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 | 30 | <li class="sub-questions"> |
28 | 31 | <div class="qs-num">题号</div> |
29 | 32 | <div class="qs-type">题型</div> |
... | ... | @@ -35,11 +38,17 @@ |
35 | 38 | <div class="qs-set">知识点</div> |
36 | 39 | </li> |
37 | 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 | 52 | </p> |
44 | 53 | <div v-else class="sub-questions"> |
45 | 54 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> |
... | ... | @@ -51,58 +60,97 @@ |
51 | 60 | </div> |
52 | 61 | <div class="qs-partScore"> |
53 | 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 | 74 | </div> |
57 | 75 | <div class="qs-options qs-options2"> |
58 | 76 | <p v-if="subQuestions.questionType == 5">--</p> |
59 | 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 | 90 | </p> |
65 | 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 | 107 | </template> |
72 | 108 | </p> |
73 | 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 | 123 | </template> |
78 | 124 | </p> |
79 | 125 | </div> |
80 | 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 | 135 | </div> |
91 | 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 | 145 | </div> |
103 | 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 | 154 | </div> |
107 | 155 | </div> |
108 | 156 | </li> |
... | ... | @@ -111,7 +159,12 @@ |
111 | 159 | <template v-for="(question, index) in questionList"> |
112 | 160 | <p class="question-title"> |
113 | 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 | 168 | <span>共 {{ setScore(question) }} 分</span> |
116 | 169 | </p> |
117 | 170 | <div class="questions-ul"> |
... | ... | @@ -125,12 +178,21 @@ |
125 | 178 | <div class="qs-set">题目解析</div> |
126 | 179 | <div class="qs-set">知识点</div> |
127 | 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 | 196 | </p> |
135 | 197 | <div v-else class="sub-questions"> |
136 | 198 | <div class="qs-num">{{ subQuestions.questionIndex }}</div> |
... | ... | @@ -138,73 +200,110 @@ |
138 | 200 | {{ setSubPro(subQuestions.questionType) }} |
139 | 201 | </div> |
140 | 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 | 213 | </div> |
144 | 214 | <div class="qs-partScore"> |
145 | 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 | 227 | </div> |
150 | 228 | <div class="qs-options qs-options2"> |
151 | 229 | <p v-if="subQuestions.questionType == 5">--</p> |
152 | 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 | 243 | </p> |
158 | 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 | 260 | </template> |
165 | 261 | </p> |
166 | 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 | 276 | </template> |
171 | 277 | </p> |
172 | 278 | </div> |
173 | 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 | 288 | </div> |
189 | 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 | 298 | </div> |
205 | 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 | 307 | </div> |
209 | 308 | </div> |
210 | 309 | </div> |
... | ... | @@ -216,45 +315,83 @@ |
216 | 315 | <el-button type="danger" plain round @click="linkBack">取消</el-button> |
217 | 316 | <el-button type="primary" round @click="save">保存</el-button> |
218 | 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 | 325 | <div class="qs-options set-questions"> |
222 | 326 | <p class="dia-tips"> |
223 | 327 | 请点击选项按钮设置答案,多选题题目之间用“,”隔开,若添加5道题:“AC,AD,BD,AC,CD” |
224 | 328 | </p> |
225 | 329 | <p>{{ setSubPro(formAns.qusType) }}:</p> |
226 | 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 | 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 | 343 | </p> |
232 | 344 | <p class="answer-box"> |
233 | 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 | 364 | </template> |
245 | 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 | 376 | </template> |
250 | 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 | 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 | 395 | <span class="answer-s ac" @click="formAns.answerList = ''">ac</span> |
259 | 396 | </p> |
260 | 397 | </div> |
... | ... | @@ -263,18 +400,42 @@ |
263 | 400 | <el-button @click="diaSetAns = false">取 消</el-button> |
264 | 401 | </div> |
265 | 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 | 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 | 439 | <el-button size="small" type="primary">选择照片</el-button> |
279 | 440 | </el-upload> |
280 | 441 | </div> |
... | ... | @@ -282,13 +443,29 @@ |
282 | 443 | <el-button @click="dialogStem = false">确定</el-button> |
283 | 444 | </div> |
284 | 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 | 452 | <div> |
287 | 453 | <el-form ref="form" :model="stem" label-width="160px"> |
288 | 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 | 469 | </el-form-item> |
293 | 470 | </el-form> |
294 | 471 | </div> |
... | ... | @@ -311,7 +488,7 @@ export default { |
311 | 488 | title: "", |
312 | 489 | type: 1, |
313 | 490 | questionList: [], |
314 | - paperType: 1,//1 备题(随堂问) /2 组卷 | |
491 | + paperType: 1, //1 备题(随堂问) /2 组卷 | |
315 | 492 | //答题卡详情 |
316 | 493 | form: { |
317 | 494 | examType: 2, //考试类型:0-未知/1-随堂问/2-即时测/3-xx考 |
... | ... | @@ -352,7 +529,8 @@ export default { |
352 | 529 | knowledge: [], //知识点 |
353 | 530 | }, |
354 | 531 | gradeClassList: [], //学段列表 |
355 | - uploadUrl: "/file/uploadImgToHtml" | |
532 | + uploadUrl: "/file/uploadImgToHtml", | |
533 | + iframeLoading: false, | |
356 | 534 | }; |
357 | 535 | }, |
358 | 536 | computed: { |
... | ... | @@ -364,30 +542,37 @@ export default { |
364 | 542 | return a + (Number(b.score) || 0); |
365 | 543 | }, 0); |
366 | 544 | } else { |
367 | - score += (item.score || 0); | |
545 | + score += item.score || 0; | |
368 | 546 | } |
369 | 547 | }, 0); |
370 | 548 | return Number(score).toFixed(2); |
371 | 549 | }, |
372 | 550 | // 知识点列表 根据学段-科目筛选 |
373 | 551 | knowledgeData: function () { |
374 | - let jsons = [] | |
552 | + let jsons = []; | |
375 | 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 | 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 | 578 | created() { |
... | ... | @@ -404,12 +589,20 @@ export default { |
404 | 589 | // v1.5 |
405 | 590 | //上传截图 |
406 | 591 | openStem(obj, type, index, indexs) { |
592 | + this.iframeLoading = true; | |
593 | + this.stem.type = type; | |
407 | 594 | this.stem.index = index; |
408 | 595 | this.stem.indexs = indexs; |
409 | 596 | if (type == 1) { |
597 | + if (obj.screenshot == "") { | |
598 | + this.iframeLoading = false; | |
599 | + } | |
410 | 600 | this.stem.screenshot = obj.screenshot || ""; |
411 | 601 | this.stem.answerScreenshot = ""; |
412 | 602 | } else { |
603 | + if (obj.answerScreenshot == "") { | |
604 | + this.iframeLoading = false; | |
605 | + } | |
413 | 606 | this.stem.answerScreenshot = obj.answerScreenshot || ""; |
414 | 607 | this.stem.screenshot = ""; |
415 | 608 | } |
... | ... | @@ -422,18 +615,22 @@ export default { |
422 | 615 | this.stem.screenshot = res.data.url; |
423 | 616 | if (this.stem.type == 1) { |
424 | 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 | 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 | 625 | } else { |
431 | 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 | 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 | 636 | this.$message.success("上传成功"); |
... | ... | @@ -449,7 +646,7 @@ export default { |
449 | 646 | |
450 | 647 | const { data, status, info } = await fetchClassList(); |
451 | 648 | if (status == 0) { |
452 | - this.gradeClassList = data.list | |
649 | + this.gradeClassList = data.list; | |
453 | 650 | } else { |
454 | 651 | this.$message.error(info); |
455 | 652 | } |
... | ... | @@ -471,13 +668,13 @@ export default { |
471 | 668 | this.stem.indexs |
472 | 669 | ].knowledge = this.stem.knowledge.join("#"); |
473 | 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 | 674 | this.dialogKnowledge = false; |
477 | 675 | }, |
478 | 676 | //end |
479 | 677 | |
480 | - | |
481 | 678 | linkBack() { |
482 | 679 | this.$router.go(-1); |
483 | 680 | }, |
... | ... | @@ -665,7 +862,7 @@ export default { |
665 | 862 | if (this.formAns.endIndex == item.questionIndex) { |
666 | 863 | EndIndex = index; |
667 | 864 | } |
668 | - return this.formAns.endIndex == item.questionIndex | |
865 | + return this.formAns.endIndex == item.questionIndex; | |
669 | 866 | } |
670 | 867 | ); |
671 | 868 | } else { |
... | ... | @@ -673,7 +870,7 @@ export default { |
673 | 870 | if (this.formAns.endIndex == item.questionIndex) { |
674 | 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 | 885 | this.formAns.answerList[subNum - i] == "✓" |
689 | 886 | ? 1 |
690 | 887 | : this.formAns.answerList[subNum - i] == "✗" |
691 | - ? 2 | |
692 | - : ""; | |
888 | + ? 2 | |
889 | + : ""; | |
693 | 890 | } |
694 | 891 | if (this.questionList[0]?.subQuestions) { |
695 | 892 | this.questionList[this.formAns.listIndex].subQuestions[ |
... | ... | @@ -770,22 +967,22 @@ export default { |
770 | 967 | this.type == 1 |
771 | 968 | ? this.$request.pPaperDetail |
772 | 969 | : this.type == 2 |
773 | - ? this.$request.pExamQuestionList | |
774 | - : this.$request.pPeriodQuestionList; | |
970 | + ? this.$request.pExamQuestionList | |
971 | + : this.$request.pPeriodQuestionList; | |
775 | 972 | } else { |
776 | 973 | detail = |
777 | 974 | this.type == 1 |
778 | 975 | ? this.$request.fetchPaperDetail |
779 | 976 | : this.type == 2 |
780 | - ? this.$request.examQuestionList | |
781 | - : this.$request.periodQuestionList; | |
977 | + ? this.$request.examQuestionList | |
978 | + : this.$request.periodQuestionList; | |
782 | 979 | } |
783 | 980 | let params = |
784 | 981 | this.type == 1 |
785 | 982 | ? { paperId: this.$route.query.paperId } |
786 | 983 | : this.type == 2 |
787 | - ? { examId: this.$route.query.paperId } | |
788 | - : { | |
984 | + ? { examId: this.$route.query.paperId } | |
985 | + : { | |
789 | 986 | periodId: this.$route.query.paperId, |
790 | 987 | }; |
791 | 988 | const { data, status, info } = await detail(params); |
... | ... | @@ -803,7 +1000,7 @@ export default { |
803 | 1000 | return a.questionIndex - b.questionIndex; |
804 | 1001 | }); |
805 | 1002 | } |
806 | - this.formateQuestion() | |
1003 | + this.formateQuestion(); | |
807 | 1004 | } else { |
808 | 1005 | this.$message.error(info); |
809 | 1006 | } |
... | ... | @@ -822,8 +1019,7 @@ export default { |
822 | 1019 | //同类型批量答案+1 |
823 | 1020 | types[addndex].subNum += 1; |
824 | 1021 | if ( |
825 | - types[addndex].answerOptions.length < | |
826 | - sub.answerOptions.length | |
1022 | + types[addndex].answerOptions.length < sub.answerOptions.length | |
827 | 1023 | ) { |
828 | 1024 | types[addndex].answerOptions = sub.answerOptions; |
829 | 1025 | } |
... | ... | @@ -935,7 +1131,26 @@ export default { |
935 | 1131 | }, |
936 | 1132 | }; |
937 | 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 | 1154 | <style lang="scss" scoped> |
940 | 1155 | .content { |
941 | 1156 | width: 100%; |
... | ... | @@ -1032,6 +1247,19 @@ export default { |
1032 | 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 | 1264 | .set-ans-btn { |
1037 | 1265 | width: 100%; |
... | ... | @@ -1069,7 +1297,7 @@ export default { |
1069 | 1297 | display: flex; |
1070 | 1298 | border-bottom: 1px solid #e2e2e2; |
1071 | 1299 | |
1072 | - &>div { | |
1300 | + & > div { | |
1073 | 1301 | min-height: 40px; |
1074 | 1302 | padding: 5px; |
1075 | 1303 | flex-shrink: 0; | ... | ... |