Commit d703d72cae8c331e0ae3839d44380f7dc0a2a300

Authored by 梁保满
1 parent c2460294

首页,个人信息,班级名单,部分备题组卷接口联调

src/api/apis/apis.js
... ... @@ -795,6 +795,13 @@ export default {
795 795  
796 796 /** 个人版 */
797 797 // 修改个人信息
  798 + getInfo(data) {
  799 + return service({
  800 + url: setUpUrls.getInfo,
  801 + method: "POST",
  802 + data
  803 + });
  804 + },
798 805 modifyInfo(data) {
799 806 return service({
800 807 url: setUpUrls.modifyInfo,
... ... @@ -834,6 +841,14 @@ export default {
834 841 data
835 842 });
836 843 },
  844 + // 删除班级
  845 + pDelClass(data) {
  846 + return service({
  847 + url: setUpUrls.pDelClass,
  848 + method: "POST",
  849 + data
  850 + });
  851 + },
837 852 // 增加学生
838 853 pAddStudent(data) {
839 854 return service({
... ... @@ -1202,4 +1217,29 @@ export default {
1202 1217 data
1203 1218 });
1204 1219 },
  1220 + //班级名册导入
  1221 + studentTemplateUrl(data) {
  1222 + return service({
  1223 + url: setUpUrls.studentTemplateUrl,
  1224 + method: "POST",
  1225 + data
  1226 + });
  1227 + },
  1228 + //班级名册导出
  1229 + exportStudent(data) {
  1230 + return service({
  1231 + url: setUpUrls.exportStudent,
  1232 + method: "POST",
  1233 + data,
  1234 + responseType: 'arraybuffer',
  1235 + });
  1236 + },
  1237 + //班级名册导出
  1238 + puploadImg(data) {
  1239 + return service({
  1240 + url: setUpUrls.uploadImg,
  1241 + method: "POST",
  1242 + data,
  1243 + });
  1244 + },
1205 1245 };
... ...
src/api/urls/apis.js
... ... @@ -203,6 +203,8 @@ export default {
203 203  
204 204 // 个人版首页统计数据
205 205 personalIndex:"/api_html/personal/index",
  206 + // 个人信息
  207 + getInfo:"/api_html/personal/personalInfo",
206 208 // 修改个人信息
207 209 modifyInfo:"/api_html/personal/modifyInfo",
208 210 // 查询班级列表
... ... @@ -213,6 +215,8 @@ export default {
213 215 pStudentList:"/api_html/personal/studentList",
214 216 // 新增或修改班级
215 217 pSaveClass:"/api_html/personal/saveClass",
  218 + // 删除班级
  219 + pDelClass:"/api_html/personal/delClass",
216 220 // 增加学生
217 221 pAddStudent:"/api_html/personal/addStudent",
218 222 // 删除学生
... ... @@ -308,6 +312,10 @@ export default {
308 312 pDeviceLogList:"/api_html/system/deviceLogList",
309 313 // 文件上传
310 314 uploadApp:"/file/uploadApp",
311   - // 文件上传
  315 + // 图片上传
312 316 uploadImg:"/file/uploadImg",
  317 + // 班级名册导入
  318 + studentTemplateUrl:"/api_html/personal/studentTemplateUrl",
  319 + // 班级名册导出
  320 + exportStudent:"/api_html/personal/exportStudent",
313 321 }
... ...
src/views/index/mainIndex.vue
... ... @@ -163,11 +163,8 @@
163 163 <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" />
164 164 <div class="text">
165 165 <p class="p1">备题组卷</p>
166   - <p class="p2">
167   - 管理
168   - <template v-if="dataInfo.paperCount">
169   - {{ dataInfo.paperCount }}套答题卡,
170   - </template>
  166 + <p class="p2" v-if="dataInfo.paperCount">
  167 + 管理 {{ dataInfo.paperCount }}套答题卡,
171 168 </p>
172 169 </div>
173 170 </li>
... ... @@ -175,11 +172,8 @@
175 172 <img class="icon" src="../../assets/nav/setUpSchool.png" alt="" />
176 173 <div class="text">
177 174 <p class="p1">班级名单</p>
178   - <p class="p2">
179   - 管理
180   - <template v-if="dataInfo.classCount">
181   - {{ dataInfo.classCount }}个班级的学生名单,
182   - </template>
  175 + <p class="p2" v-if="dataInfo.classCount">
  176 + 管理{{ dataInfo.classCount }}个班级的学生名单,
183 177 </p>
184 178 </div>
185 179 </li>
... ... @@ -187,11 +181,8 @@
187 181 <img class="icon" src="../../assets/nav/device.png" alt="" />
188 182 <div class="text">
189 183 <p class="p1">学生画像</p>
190   - <p class="p2">
191   - 共分析
192   - <template v-if="dataInfo.stationCount"
193   - >{{ dataInfo.stationCount }}名学生成绩</template
194   - >
  184 + <p class="p2" v-if="dataInfo.stationCount">
  185 + 共分析{{ dataInfo.stationCount }}名学生成绩
195 186 </p>
196 187 </div>
197 188 </li>
... ... @@ -199,20 +190,15 @@
199 190 <div class="nav-item item1 item-child2" @click="links('/ask')">
200 191 <img class="icon" src="../../assets/nav/card.png" alt="" />
201 192 <p class="p1">随堂问报表</p>
202   - <p class="p2">
203   - 对
204   - <template v-if="dataInfo.classPeriodCount"
205   - >{{ dataInfo.classPeriodCount }}套随堂问答题记录分析</template
206   - >
  193 + <p class="p2" v-if="dataInfo.classPeriodCount">
  194 + 对{{ dataInfo.classPeriodCount }}套随堂问答题记录分析
207 195 </p>
208 196 </div>
209 197 <div class="nav-item item1 item-child2" @click="links('/test')">
210 198 <img class="icon" src="../../assets/nav/analysis.png" alt="" />
211 199 <p class="p1">即时测报表</p>
212   - <p class="p2">
213   - 对<template v-if="dataInfo.examCount"
214   - >{{ dataInfo.examCount }}套即时测答题记录分析</template
215   - >
  200 + <p class="p2" v-if="dataInfo.examCount">
  201 + 对{{ dataInfo.examCount }}套即时测答题记录分析
216 202 </p>
217 203 </div>
218 204 <div class="nav-item item1 item-child1" @click="links('/down')">
... ...
src/views/personal/examinationPaper/add.vue
... ... @@ -330,7 +330,7 @@
330 330 circle
331 331 size="mini"
332 332 icon="el-icon-tickets"
333   - @click="openStem(subQuestions, 1)"
  333 + @click="openStem(subQuestions, 1, index, indexs)"
334 334 ></el-button>
335 335 </el-tooltip>
336 336 <el-tooltip effect="dark" content="题目打标" placement="top">
... ... @@ -339,7 +339,7 @@
339 339 circle
340 340 size="mini"
341 341 icon="el-icon-price-tag"
342   - @click="openTag(subQuestions)"
  342 + @click="openTag(subQuestions, 3, index, indexs)"
343 343 ></el-button>
344 344 </el-tooltip>
345 345 <el-tooltip
... ... @@ -352,7 +352,7 @@
352 352 circle
353 353 size="mini"
354 354 icon="el-icon-upload"
355   - @click="openStem(subQuestions, 2)"
  355 + @click="openStem(subQuestions, 2, index, indexs)"
356 356 ></el-button>
357 357 </el-tooltip>
358 358 <el-popconfirm
... ... @@ -835,10 +835,10 @@
835 835 width="500"
836 836 >
837 837 <div>
838   - <img class="stem-pic" :src="stem.src" alt="" />
  838 + <img class="stem-pic" :src="stem.screenshot" alt="" />
839 839 <el-upload
840 840 class="upload-demo"
841   - action="https://jsonplaceholder.typicode.com/posts/"
  841 + action="http://121.40.127.171/file/uploadImg"
842 842 :limit="1"
843 843 :with-credentials="true"
844 844 :on-success="upSuccess"
... ... @@ -858,25 +858,32 @@
858 858 <div>
859 859 <el-form ref="form" :model="stem" label-width="160px">
860 860 <el-form-item label="题目难度:">
861   - <el-select v-model="stem.type" placeholder="选择题目难度">
862   - <el-option label="简单" :value="0"></el-option>
863   - <el-option label="正常" :value="1"></el-option>
864   - <el-option label="困难" :value="2"></el-option>
  861 + <el-select
  862 + v-model="stem.difficultyFactor"
  863 + placeholder="选择题目难度"
  864 + >
  865 + <el-option label="简单" value="简单"></el-option>
  866 + <el-option label="正常" value="正常"></el-option>
  867 + <el-option label="困难" value="困难"></el-option>
865 868 </el-select>
866 869 </el-form-item>
867 870 <el-form-item label="知识点:">
868   - <el-select v-model="stem.tag" multiple placeholder="选择知识点">
869   - <el-option label="生字积累" :value="0"></el-option>
870   - <el-option label="字词运用" :value="1"></el-option>
871   - <el-option label="阅读理解" :value="2"></el-option>
872   - <el-option label="作文" :value="2"></el-option>
  871 + <el-select
  872 + v-model="stem.knowledge"
  873 + multiple
  874 + placeholder="选择知识点"
  875 + >
  876 + <el-option label="生字积累" value="生字积累"></el-option>
  877 + <el-option label="字词运用" value="字词运用"></el-option>
  878 + <el-option label="阅读理解" value="阅读理解"></el-option>
  879 + <el-option label="写作方法" value="写作方法"></el-option>
873 880 </el-select>
874 881 </el-form-item>
875 882 </el-form>
876 883 </div>
877 884 <div slot="footer">
878 885 <el-button @click="dialogTag = false">取 消</el-button>
879   - <el-button type="primary" @click="dialogTag = false">确 定</el-button>
  886 + <el-button type="primary" @click="setKnowledge">确 定</el-button>
880 887 </div>
881 888 </el-dialog>
882 889 </div>
... ... @@ -927,9 +934,14 @@ export default {
927 934 dialogTag: false,
928 935 upLoadType: 1,
929 936 stem: {
930   - src: "", //题干图片地址
931   - type: 0, //题目难度
932   - tag: [], //知识点
  937 + id: "",
  938 + type: 1,
  939 + index: 0,
  940 + indexs: 0,
  941 + screenshot: "", //题干图片地址
  942 + answerScreenshot: "", //题干解析图片地址
  943 + difficultyFactor: 0, //题目难度
  944 + knowledge: [], //知识点
933 945 },
934 946 type: 1, //1-创建,2-复制答题卡
935 947 dialogVisible: false, //测验类型设置弹窗
... ... @@ -954,7 +966,7 @@ export default {
954 966 ],
955 967 rightOptions: ["A", "B", "C", "D", "E", "F", "G"],
956 968 addSubQuestionsType: "",
957   - step: 0, //步骤
  969 + step: 1, //步骤
958 970 gradeList: [], //年级
959 971 subjectList: [], //科目
960 972 answerTypeList: [], //测验类型
... ... @@ -1007,28 +1019,52 @@ export default {
1007 1019 }
1008 1020 },
1009 1021 methods: {
1010   - openStem(obj, type) {
  1022 + openStem(obj, type, index, indexs) {
  1023 + //上传截图
1011 1024 this.upLoadType = type;
1012   - this.stem = { ...this.stem, obj };
  1025 + this.stem.id = obj.id;
  1026 + this.stem.type = type;
  1027 + this.stem.index = index;
  1028 + this.stem.indexs = indexs;
  1029 + this.stem.screenshot = type == 1 ? obj.screenshot : obj.answerScreenshot;
1013 1030 this.dialogStem = true;
1014 1031 },
1015   - openTag(obj) {
  1032 + openTag(obj, type, index, indexs) {
  1033 + //难度,知识点
1016 1034 this.stem = { ...this.stem, obj };
  1035 + this.stem.id = obj.id;
  1036 + this.stem.type = type;
  1037 + this.stem.index = index;
  1038 + this.stem.indexs = indexs;
  1039 + this.stem.knowledge = obj.knowledge?.split(",") || [];
  1040 + this.stem.difficultyFactor = obj.difficultyFactor || "";
1017 1041 this.dialogTag = true;
1018 1042 },
1019 1043 upSuccess(res) {
  1044 + //图片上传成功
1020 1045 if (res && res.status == 0) {
  1046 + this.dialogStem = false;
  1047 + let keys = this.stem.type == 1 ? "screenshot" : "answerScreenshot";
  1048 + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs][
  1049 + keys
  1050 + ] = this.stem[keys];
1021 1051 this.$message.success("上传成功");
1022 1052 } else {
1023 1053 this.$message.error(res.info);
1024 1054 }
1025 1055 },
  1056 + setKnowledge() {
  1057 + //保存难度、知识点
  1058 + this.form.questionList[this.stem.index].subQuestions[
  1059 + this.stem.indexs
  1060 + ].knowledge = this.stem.knowledge.join(",");
  1061 + this.form.questionList[this.stem.index].subQuestions[
  1062 + this.stem.indexs
  1063 + ].difficultyFactor = this.stem.difficultyFactor;
  1064 + this.dialogTag = false;
  1065 + },
1026 1066 upError(res) {
1027   - if (res && res.status == 0) {
1028   - this.$message.error("上传失败");
1029   - } else {
1030   - this.$message.error(res.message);
1031   - }
  1067 + this.$message.error("上传失败");
1032 1068 },
1033 1069 linkBack() {
1034 1070 this.$confirm(
... ... @@ -1605,7 +1641,7 @@ export default {
1605 1641 },
1606 1642 async removeTypeName(obj) {
1607 1643 //删除测验类型
1608   - const { data, status, info } = await this.$request.pDelPaper({
  1644 + const { data, status, info } = await this.$request.pDelPaperType({
1609 1645 tagId: obj.id,
1610 1646 });
1611 1647 if (status == 0) {
... ... @@ -1694,8 +1730,8 @@ export default {
1694 1730 this.subjectList =
1695 1731 data.subjectNames?.map((item) => {
1696 1732 return {
1697   - value: item,
1698   - label: item,
  1733 + value: item.subjectName,
  1734 + label: item.subjectName,
1699 1735 };
1700 1736 }) || [];
1701 1737 console.log(this.subjectList);
... ... @@ -1986,8 +2022,8 @@ export default {
1986 2022 }
1987 2023 .qs-set {
1988 2024 width: 190px;
1989   - .delete{
1990   - margin-left:9px;
  2025 + .delete {
  2026 + margin-left: 9px;
1991 2027 }
1992 2028 }
1993 2029 .qs-options2 {
... ... @@ -2012,7 +2048,7 @@ export default {
2012 2048 }
2013 2049 }
2014 2050 }
2015   -.upload-demo{
  2051 +.upload-demo {
2016 2052 text-align: center;
2017 2053 }
2018 2054 .stem-pic {
... ...
src/views/personal/examinationPaper/edit.vue
... ... @@ -142,18 +142,18 @@
142 142 <el-button
143 143 type="primary"
144 144 circle
145   - size="small"
  145 + size="mini"
146 146 icon="el-icon-tickets"
147   - @click="openStem(subQuestions, 1)"
  147 + @click="openStem(subQuestions, 1, index, indexs)"
148 148 ></el-button>
149 149 </el-tooltip>
150 150 <el-tooltip effect="dark" content="题目打标" placement="top">
151 151 <el-button
152 152 type="primary"
153 153 circle
154   - size="small"
  154 + size="mini"
155 155 icon="el-icon-price-tag"
156   - @click="openTag(subQuestions)"
  156 + @click="openTag(subQuestions, 3, index, indexs)"
157 157 ></el-button>
158 158 </el-tooltip>
159 159 <el-tooltip
... ... @@ -164,11 +164,24 @@
164 164 <el-button
165 165 type="primary"
166 166 circle
167   - size="small"
  167 + size="mini"
168 168 icon="el-icon-upload"
169   - @click="openStem(subQuestions, 2)"
  169 + @click="openStem(subQuestions, 2, index, indexs)"
170 170 ></el-button>
171 171 </el-tooltip>
  172 + <el-popconfirm
  173 + title="确定删除这道题吗?"
  174 + @confirm="delTabData(indexs, index)"
  175 + >
  176 + <el-button
  177 + slot="reference"
  178 + class="delete"
  179 + type="danger"
  180 + size="mini"
  181 + circle
  182 + icon="el-icon-delete"
  183 + ></el-button>
  184 + </el-popconfirm>
172 185 </div>
173 186 </div>
174 187 </li>
... ... @@ -275,29 +288,42 @@
275 288 <el-button
276 289 type="primary"
277 290 circle
278   - size="small"
  291 + size="mini"
279 292 icon="el-icon-tickets"
280   - @click="openStem(subQuestions, 1)"
  293 + @click="openStem(subQuestions, 1, indexs)"
281 294 ></el-button>
282 295 </el-tooltip>
283 296 <el-tooltip effect="dark" content="题目打标" placement="top">
284 297 <el-button
285 298 type="primary"
286 299 circle
287   - size="small"
  300 + size="mini"
288 301 icon="el-icon-price-tag"
289   - @click="openTag(subQuestions)"
  302 + @click="openTag(subQuestions, 3, indexs)"
290 303 ></el-button>
291 304 </el-tooltip>
292 305 <el-tooltip effect="dark" content="上传题目解析" placement="top">
293 306 <el-button
294 307 type="primary"
295 308 circle
296   - size="small"
  309 + size="mini"
297 310 icon="el-icon-upload"
298   - @click="openStem(subQuestions, 2)"
  311 + @click="openStem(subQuestions, 2, indexs)"
299 312 ></el-button>
300 313 </el-tooltip>
  314 + <el-popconfirm
  315 + title="确定删除这道题吗?"
  316 + @confirm="delTabData(indexs, index)"
  317 + >
  318 + <el-button
  319 + slot="reference"
  320 + class="delete"
  321 + type="danger"
  322 + size="mini"
  323 + circle
  324 + icon="el-icon-delete"
  325 + ></el-button>
  326 + </el-popconfirm>
301 327 </div>
302 328 </div>
303 329 </li>
... ... @@ -397,10 +423,10 @@
397 423 width="500"
398 424 >
399 425 <div>
400   - <img class="stem-pic" :src="stem.src" alt="" />
  426 + <img class="stem-pic" :src="stem.screenshot" alt="" />
401 427 <el-upload
402 428 class="upload-demo"
403   - action="/file/uploadImg"
  429 + action="http://121.40.127.171/file/uploadImg"
404 430 :limit="1"
405 431 :with-credentials="true"
406 432 :on-success="upSuccess"
... ... @@ -420,18 +446,25 @@
420 446 <div>
421 447 <el-form ref="form" :model="stem" label-width="160px">
422 448 <el-form-item label="题目难度:">
423   - <el-select v-model="stem.type" placeholder="选择题目难度">
424   - <el-option label="简单" :value="0"></el-option>
425   - <el-option label="正常" :value="1"></el-option>
426   - <el-option label="困难" :value="2"></el-option>
  449 + <el-select
  450 + v-model="stem.difficultyFactor"
  451 + placeholder="选择题目难度"
  452 + >
  453 + <el-option label="简单" value="简单"></el-option>
  454 + <el-option label="正常" value="正常"></el-option>
  455 + <el-option label="困难" value="困难"></el-option>
427 456 </el-select>
428 457 </el-form-item>
429 458 <el-form-item label="知识点:">
430   - <el-select v-model="stem.tag" multiple placeholder="选择知识点">
431   - <el-option label="生字积累" :value="0"></el-option>
432   - <el-option label="字词运用" :value="1"></el-option>
433   - <el-option label="阅读理解" :value="2"></el-option>
434   - <el-option label="作文" :value="2"></el-option>
  459 + <el-select
  460 + v-model="stem.knowledge"
  461 + multiple
  462 + placeholder="选择知识点"
  463 + >
  464 + <el-option label="生字积累" value="生字积累"></el-option>
  465 + <el-option label="字词运用" value="字词运用"></el-option>
  466 + <el-option label="阅读理解" value="阅读理解"></el-option>
  467 + <el-option label="写作方法" value="写作方法"></el-option>
435 468 </el-select>
436 469 </el-form-item>
437 470 </el-form>
... ... @@ -454,9 +487,14 @@ export default {
454 487 dialogTag: false,
455 488 upLoadType: 1,
456 489 stem: {
457   - src: "", //题干图片地址
458   - type: 0, //题目难度
459   - tag: [], //知识点
  490 + id: "",
  491 + type: 1,
  492 + index: 0,
  493 + indexs: 0,
  494 + screenshot: "", //题干图片地址
  495 + answerScreenshot: "", //题干解析图片地址
  496 + difficultyFactor: 0, //题目难度
  497 + knowledge: [], //知识点
460 498 },
461 499 title: "",
462 500 type: 1,
... ... @@ -508,28 +546,64 @@ export default {
508 546 this._QueryDetail();
509 547 },
510 548 methods: {
511   - openStem(obj, type) {
  549 + openStem(obj, type, index, indexs) {
  550 + //上传截图
512 551 this.upLoadType = type;
513   - this.stem = { ...this.stem, obj };
  552 + this.stem.id = obj.id;
  553 + this.stem.type = type;
  554 + this.stem.index = index;
  555 + this.stem.indexs = indexs;
  556 + this.stem.screenshot = type == 1 ? obj.screenshot : obj.answerScreenshot;
514 557 this.dialogStem = true;
515 558 },
516   - openTag(obj) {
  559 + openTag(obj, type, index, indexs) {
  560 + //难度,知识点
517 561 this.stem = { ...this.stem, obj };
  562 + this.stem.id = obj.id;
  563 + this.stem.type = type;
  564 + this.stem.index = index;
  565 + this.stem.indexs = indexs;
  566 + this.stem.knowledge = obj.knowledge?.split(",") || [];
  567 + this.stem.difficultyFactor = obj.difficultyFactor || "";
518 568 this.dialogTag = true;
519 569 },
520 570 upSuccess(res) {
  571 + //图片上传成功
521 572 if (res && res.status == 0) {
  573 + this.dialogStem = false;
  574 + let keys = this.stem.type == 1 ? "screenshot" : "answerScreenshot";
  575 + if (typeof this.stem.indexs != undefined) {
  576 + this.questionList[this.stem.index].subQuestions[this.stem.indexs][
  577 + keys
  578 + ] = this.stem[keys];
  579 + } else {
  580 + this.questionList[this.stem.index][keys] = this.stem[keys];
  581 + }
  582 +
522 583 this.$message.success("上传成功");
523 584 } else {
524 585 this.$message.error(res.info);
525 586 }
526 587 },
527   - upError(res) {
528   - if (res && res.status == 0) {
529   - this.$message.error("上传失败");
  588 + setKnowledge() {
  589 + //保存难度、知识点
  590 + if (typeof this.stem.indexs != undefined) {
  591 + this.questionList[this.stem.index].subQuestions[
  592 + this.stem.indexs
  593 + ].knowledge = this.stem.knowledge.join(",");
  594 + this.questionList[this.stem.index].subQuestions[
  595 + this.stem.indexs
  596 + ].difficultyFactor = this.stem.difficultyFactor;
530 597 } else {
531   - this.$message.error(res.message);
  598 + this.questionList[this.stem.index].knowledge =
  599 + this.stem.knowledge.join(",");
  600 + this.questionList[this.stem.index].difficultyFactor =
  601 + this.stem.difficultyFactor;
532 602 }
  603 + this.dialogTag = false;
  604 + },
  605 + upError(res) {
  606 + this.$message.error("上传失败");
533 607 },
534 608 linkBack() {
535 609 this.$router.go(-1);
... ... @@ -1046,7 +1120,9 @@ export default {
1046 1120 .el-input-number {
1047 1121 width: 140px;
1048 1122 }
1049   -
  1123 +.delete {
  1124 + margin-left: 8px;
  1125 +}
1050 1126 .questions-ul {
1051 1127 border-left: 1px solid #e2e2e2;
1052 1128 border-top: 1px solid #e2e2e2;
... ...
src/views/personal/examinationPaper/index.vue
... ... @@ -232,6 +232,7 @@ export default {
232 232 //切换班级
233 233 async changClazz() {
234 234 await this._QuerySubjectList();
  235 + this._QueryTypeList()
235 236 this._QueryData(false);
236 237 },
237 238 // 查找答题卡类型
... ... @@ -250,7 +251,7 @@ export default {
250 251 }) || [];
251 252 this.typeList.unshift({
252 253 value: "",
253   - label: "请选择标签",
  254 + label: "全部",
254 255 });
255 256 } else {
256 257 this.$message.error(info);
... ... @@ -266,7 +267,7 @@ export default {
266 267 this.classList =
267 268 data.list?.map((item) => {
268 269 return {
269   - value: item.classId,
  270 + value: item.id,
270 271 label: item.className,
271 272 };
272 273 }) || [];
... ...
src/views/personal/examinationPaper/recycle.vue
... ... @@ -86,7 +86,8 @@
86 86 </div>
87 87 <div class="info">
88 88 <p class="title">
89   - {{ item.title }} <span class="label" v-if="item.tag">{{ item.tag }}</span>
  89 + {{ item.title }}
  90 + <span class="label" v-if="item.tag">{{ item.tag }}</span>
90 91 </p>
91 92 <p class="num">
92 93 {{ item.gradeName }}
... ... @@ -136,7 +137,11 @@
136 137 >
137 138 </el-pagination>
138 139 </div>
139   - <el-empty :image-size="100" v-if="!tableData.length&&loading==false" description="没有更多数据"></el-empty>
  140 + <el-empty
  141 + :image-size="100"
  142 + v-if="!tableData.length && loading == false"
  143 + description="没有更多数据"
  144 + ></el-empty>
140 145 </div>
141 146 </template>
142 147  
... ... @@ -144,7 +149,7 @@
144 149 export default {
145 150 data() {
146 151 return {
147   - loading:false,
  152 + loading: false,
148 153 props: { multiple: true, checkStrictly: true },
149 154 options: [
150 155 {
... ... @@ -187,8 +192,8 @@ export default {
187 192 typeList: [],
188 193 tableData: [],
189 194 total: 0,
190   - page:1,
191   - size:20
  195 + page: 1,
  196 + size: 20,
192 197 };
193 198 },
194 199 async created() {
... ... @@ -228,13 +233,13 @@ export default {
228 233 await this._QuerySubjectList();
229 234 this._QueryData(false);
230 235 },
231   - changePage(page){
232   - this.page = page
233   - this._QueryData(this.query.title)
  236 + changePage(page) {
  237 + this.page = page;
  238 + this._QueryData(this.query.title);
234 239 },
235 240 async _QueryData(type) {
236 241 //获取答题卡列表
237   - this.loading=true
  242 + this.loading = true;
238 243 let query = {};
239 244 if (!type) {
240 245 this.query.title = "";
... ... @@ -244,7 +249,7 @@ export default {
244 249 this.query.type = "";
245 250 this.query.subjectId = "";
246 251 }
247   - query.classId = this.query.classId;
  252 + query.classId = this.query.classId;
248 253 for (let key in query) {
249 254 if (!query[key]) {
250 255 query[key] = null;
... ... @@ -252,9 +257,9 @@ export default {
252 257 }
253 258 const { data, status, info } = await this.$request.pPaperList({
254 259 ...query,
255   - status:2,
256   - page:this.page,
257   - size:this.size
  260 + status: 2,
  261 + page: this.page,
  262 + size: this.size,
258 263 });
259 264 this.loading = false;
260 265 if (status === 0) {
... ... @@ -270,12 +275,13 @@ export default {
270 275 console.log(status);
271 276 if (status === 0) {
272 277 if (!!data.list) {
273   - this.classList = data.list?.map((item) => {
274   - return {
275   - value: item.classId,
276   - label: item.className,
277   - };
278   - })||[];
  278 + this.classList =
  279 + data.list?.map((item) => {
  280 + return {
  281 + value: item.id,
  282 + label: item.className,
  283 + };
  284 + }) || [];
279 285 this.query.classId = this.classList[0]?.value;
280 286 }
281 287 } else {
... ... @@ -288,12 +294,13 @@ export default {
288 294 classId: this.query.classId,
289 295 });
290 296 if (status === 0) {
291   - this.subjectList = data.subjectNames?.map((item) => {
292   - return {
293   - value: item,
294   - label: item,
295   - };
296   - })||[];
  297 + this.subjectList =
  298 + data.subjectNames?.map((item) => {
  299 + return {
  300 + value: item,
  301 + label: item,
  302 + };
  303 + }) || [];
297 304 this.query.subjectName = this.subjectList[0]?.value;
298 305 } else {
299 306 this.$message.error(info);
... ... @@ -303,7 +310,7 @@ export default {
303 310 async _QueryTypeList() {
304 311 const { data, status, info } = await this.$request.pPaperTagList({
305 312 classId: this.query.classId,
306   - tyle:0
  313 + tyle: 0,
307 314 });
308 315 if (status === 0) {
309 316 this.typeList =
... ...
src/views/personal/setUp/student.vue
... ... @@ -15,6 +15,16 @@
15 15 @click="diaUp = true"
16 16 ></el-button>
17 17 </el-tooltip>
  18 + <el-tooltip effect="dark" content="学生导出" placement="bottom">
  19 + <el-button
  20 + type="primary"
  21 + icon="el-icon-download"
  22 + size="mini"
  23 + plain
  24 + circle
  25 + @click="exportStudentExl"
  26 + ></el-button>
  27 + </el-tooltip>
18 28 <el-tooltip effect="dark" content="添加班级" placement="bottom">
19 29 <el-button
20 30 type="primary"
... ... @@ -156,7 +166,7 @@
156 166 <el-checkbox
157 167 v-for="item in subjectList"
158 168 :label="item"
159   - :key="item"
  169 + :key="item.id"
160 170 >{{ item }}</el-checkbox
161 171 >
162 172 </el-checkbox-group>
... ... @@ -186,7 +196,6 @@
186 196 </el-dialog>
187 197 <el-dialog title="学生导入" :visible.sync="diaUp" width="600">
188 198 <up-load
189   - id="downTeacher"
190 199 :url="url"
191 200 @upSuccess="upSuccess"
192 201 fileName="学生模板"
... ... @@ -209,15 +218,16 @@ export default {
209 218 data() {
210 219 return {
211 220 loading: false,
212   - diaUp: false,//导入弹窗
213   - url: "/api_html/school/manager/importStudentClicker",
214   - diaStu: false,//添加学生
215   - diaClass: false,//添加-修改班级
  221 + diaUp: false, //导入弹窗
  222 + url: "/api_html/personal/importStudent",
  223 + diaStu: false, //添加学生
  224 + diaClass: false, //添加-修改班级
216 225 showAll: false, //修改年级科目显示
217 226 query: {
218 227 classId: "",
219 228 },
220   - formStu: {//添加学生信息
  229 + formStu: {
  230 + //添加学生信息
221 231 className: "",
222 232 studentName: "",
223 233 studentCode: "",
... ... @@ -233,7 +243,8 @@ export default {
233 243 { required: true, message: "请输入学生长学号", trigger: "blur" },
234 244 ],
235 245 },
236   - formClass: {//添加班级信息
  246 + formClass: {
  247 + //添加班级信息
237 248 classId: "",
238 249 className: "",
239 250 subjectNames: [],
... ... @@ -242,17 +253,20 @@ export default {
242 253 className: [
243 254 { required: true, message: "请输入班级名称", trigger: "blur" },
244 255 ],
  256 + subjectNames: [
  257 + { required: true, message: "请输入科目名称", trigger: "blur" },
  258 + ],
245 259 },
246   - classList: [],//班级列表
247   - studentList: [],//学生列表
248   - subjectList: [],//科目列表
249   - subjectName: "",//添加科目名称
  260 + classList: [], //班级列表
  261 + studentList: [], //学生列表
  262 + subjectList: [], //科目列表
  263 + subjectName: "", //添加科目名称
250 264 };
251 265 },
252 266 async created() {
253   - // await this._QueryClass();
254   - // this._QuerySubject();
255   - // this._QueryData();
  267 + await this._QueryClass();
  268 + this._QuerySubject();
  269 + this._QueryData();
256 270 },
257 271 methods: {
258 272 addClass() {
... ... @@ -295,7 +309,7 @@ export default {
295 309 saveClass() {
296 310 this.$refs.formClass.validate(async (valid) => {
297 311 if (valid) {
298   - const { data, status, info } = await this.$request.updateClass({
  312 + const { data, status, info } = await this.$request.pSaveClass({
299 313 classId: this.formClass.classId,
300 314 className: this.formClass.className,
301 315 subjectNames: this.formClass.subjectNames,
... ... @@ -324,7 +338,7 @@ export default {
324 338 this.$message.warning("有学生的班级不能删除!");
325 339 return;
326 340 }
327   - const { data, status, info } = await this.$request.updateClass({
  341 + const { data, status, info } = await this.$request.pDelClass({
328 342 classId: this.formClass.classId,
329 343 });
330 344 if (status === 0) {
... ... @@ -355,21 +369,9 @@ export default {
355 369 this.$message.error(info);
356 370 }
357 371 },
358   - async downExcel() {
359   - this.loadingDown = true;
360   - let { data, info, status } =
361   - await this.$request.studentClickerTemplateUrl();
362   - this.loadingDown = false;
363   - if (status == 0) {
364   - getBlob(data.downloadUrl).then((res) => {
365   - downloadFile("学生模板", res);
366   - });
367   - } else {
368   - this.$message.error(info);
369   - }
370   - },
  372 +
371 373 async removeStu(obj, index) {
372   - const { data, status, info } = await this.$request.delStudent({
  374 + const { data, status, info } = await this.$request.pDelStudent({
373 375 studentId: obj.id,
374 376 });
375 377 if (status === 0) {
... ... @@ -398,7 +400,7 @@ export default {
398 400 this.$message.warning("学生姓名已存在");
399 401 return;
400 402 }
401   - const { data, status, info } = await this.$request.addStudent({
  403 + const { data, status, info } = await this.$request.pAddStudent({
402 404 classId: this.query.classId,
403 405 ...query,
404 406 });
... ... @@ -419,7 +421,7 @@ export default {
419 421 },
420 422 async _QueryData() {
421 423 this.loading = true;
422   - const { data, status, info } = await this.$request.studentList({
  424 + const { data, status, info } = await this.$request.pStudentList({
423 425 ...this.query,
424 426 });
425 427 this.loading = false;
... ... @@ -432,7 +434,9 @@ export default {
432 434 },
433 435  
434 436 async _QueryClass() {
435   - const { data, status, info } = await this.$request.schoolClassList();
  437 + const { data, status, info } = await this.$request.pClassList({
  438 + needStudentCount:1
  439 + });
436 440 if (status === 0) {
437 441 this.classList = [...data.list] || [];
438 442 this.query.classId = this.classList[0]?.id;
... ... @@ -441,6 +445,37 @@ export default {
441 445 this.$message.error(info);
442 446 }
443 447 },
  448 + async downExcel() {
  449 + this.loadingDown = true;
  450 + let { data, info, status } = await this.$request.studentTemplateUrl();
  451 + this.loadingDown = false;
  452 + if (status == 0) {
  453 + // getBlob(data.downloadUrl).then((res) => {
  454 + // downloadFile("学生模板", res);
  455 + // });
  456 + const a = document.createElement("a");
  457 + a.href = data.downloadUrl;
  458 + a.download = data.appName;
  459 + document.body.appendChild(a);
  460 + a.click();
  461 + a.remove();
  462 + } else {
  463 + this.$message.error(info);
  464 + }
  465 + },
  466 + async exportStudentExl() {
  467 + this.loadingDown = true;
  468 + let data = await this.$request.exportStudent();
  469 + this.loadingDown = false;
  470 + if (data) {
  471 + let blob = new Blob([data], {
  472 + type: "application/vnd.ms-excel;charset=utf-8",
  473 + });
  474 + downloadFile(`学生名单.xlsx`, blob);
  475 + } else {
  476 + this.$message.error("下载失败");
  477 + }
  478 + },
444 479 },
445 480 };
446 481 </script>
... ... @@ -565,7 +600,7 @@ export default {
565 600 }
566 601 .form-box {
567 602 .subject-box {
568   - padding-right:50px;
  603 + padding-right: 50px;
569 604 max-height: 90px;
570 605 overflow: hidden;
571 606 position: relative;
... ...
src/views/personal/userInfo/index.vue
... ... @@ -8,30 +8,20 @@
8 8 <div class="page-content">
9 9 <div class="content-box">
10 10 <i class="el-icon-edit" @click="diaSchool = true"></i>
  11 + <i class="el-icon-key" @click="diaPass = true"></i>
11 12 <ul class="school-info">
12 13 <li class="school-item">
13 14 <span class="s1">学校名称:</span>
14   - <span class="s2">{{ school.schoolName || "--" }}</span>
15   - </li>
16   - <li class="school-item">
17   - <span class="s1">授课端管理密码:</span>
18   - <span class="s2">{{ school.managePwd || "--" }}</span>
  15 + <span class="s2">{{ Info.tenantName || "--" }}</span>
19 16 </li>
20 17 <li class="school-item">
21 18 <span class="s1">教师姓名:</span>
22   - <span class="s2">{{ school.contactPerson || "--" }}</span>
  19 + <span class="s2">{{ Info.contactPerson || "--" }}</span>
23 20 </li>
24 21 <li class="school-item">
25 22 <span class="s1">手机号码:</span>
26   - <span class="s2">{{ school.contactPhone || "--" }}</span>
27   - </li>
28   - <li class="school-item">
29   - <span class="s1">科目:</span>
30   - <span class="s2">{{
31   - school.sections | getSections(school.sections)
32   - }}</span>
  23 + <span class="s2">{{ Info.contactPhone || "--" }}</span>
33 24 </li>
34   -
35 25 </ul>
36 26 </div>
37 27 </div>
... ... @@ -43,16 +33,14 @@
43 33 :rules="rulesSchool"
44 34 label-width="160px"
45 35 >
46   - <el-form-item label="授课端管理密码:" prop="managePwd">
47   - <el-col :span="10">
48   - <el-input
49   - maxlength="20"
50   - v-model="formSchool.managePwd"
51   - show-password
52   - placeholder="请输入授课端管理密码"
53   - ></el-input>
54   - </el-col>
55   - </el-form-item>
  36 + <el-form-item label="学校名称:" prop="tenantName"
  37 + ><el-col :span="10"
  38 + ><el-input
  39 + maxlength="30"
  40 + v-model="formSchool.tenantName"
  41 + placeholder="请输入教师姓名"
  42 + ></el-input></el-col
  43 + ></el-form-item>
56 44 <el-form-item label="教师姓名:" prop="contactPerson"
57 45 ><el-col :span="10"
58 46 ><el-input
... ... @@ -75,92 +63,95 @@
75 63 <el-button @click="editSchool">确 定</el-button>
76 64 <el-button @click="diaSchool = false">取 消</el-button>
77 65 </div>
78   - </el-dialog>
  66 + </el-dialog>
  67 + <el-dialog title="修改密码" :visible.sync="diaPass" width="400">
  68 + <el-form
  69 + ref="formPass"
  70 + class="form-box"
  71 + :model="password"
  72 + :rules="rulesPassword"
  73 + label-width="160px"
  74 + >
  75 + <el-form-item label="旧密码:" prop="oldPassword"
  76 + ><el-col :span="10"
  77 + ><el-input
  78 + maxlength="30"
  79 + v-model="password.oldPassword"
  80 + placeholder="请输入密码"
  81 + show-password
  82 + ></el-input></el-col
  83 + ></el-form-item>
  84 + <el-form-item label="新密码:" prop="password"
  85 + ><el-col :span="10"
  86 + ><el-input
  87 + maxlength="30"
  88 + v-model="password.password"
  89 + placeholder="请输入新密码"
  90 + show-password
  91 + ></el-input></el-col
  92 + ></el-form-item>
  93 + <el-form-item label="确认密码:" prop="resetPassword"
  94 + ><el-col :span="10"
  95 + ><el-input
  96 + maxlength="30"
  97 + v-model="password.resetPassword"
  98 + placeholder="请输入新密码"
  99 + show-password
  100 + ></el-input></el-col
  101 + ></el-form-item>
  102 + </el-form>
  103 + <div class="dialog-footer" slot="footer">
  104 + <el-button @click="editPass">确 定</el-button>
  105 + <el-button @click="diaPass = false">取 消</el-button>
  106 + </div>
  107 + </el-dialog>
79 108 </div>
80 109 </template>
81 110  
82 111 <script>
83   -import { downloadFile } from "@/utils";
  112 +import { downloadFile, encryptLoginPassword } from "@/utils";
84 113 export default {
85   - filters: {
86   - getSections(val) {
87   - let arr = val.split(",");
88   - let sections = arr.map((item) => {
89   - let txt;
90   - switch (item) {
91   - case "0":
92   - txt = "未知";
93   - break;
94   - case "1":
95   - txt = "小学";
96   - break;
97   - case "2":
98   - txt = "初中";
99   - break;
100   - case "3":
101   - txt = "高中";
102   - break;
103   - case "4":
104   - txt = "大学";
105   - break;
106   - case "7":
107   - txt = "未知";
108   - break;
109   - default:
110   - txt = "未知";
111   - }
112   - return txt;
113   - });
114   - return sections.join(",");
115   - },
116   - },
117 114 data() {
118 115 return {
119 116 loading: false,
120 117 diaSchool: false,
121   - school: {
122   - schoolName: "",
123   - managePwd: "",
  118 + diaPass: false,
  119 + Info: {
  120 + tenantName: "",
124 121 contactPerson: "",
125 122 contactPhone: "",
126 123 sections: "",
127 124 },
  125 + password: {
  126 + oldPassword: "",
  127 + password: "",
  128 + resetPassword: "",
  129 + },
  130 + rulesPassword: {
  131 + oldPassword: [
  132 + { required: true, message: "请输入旧密码", trigger: "blur" },
  133 + ],
  134 + password: [
  135 + { required: true, message: "请输入新密码", trigger: "blur" },
  136 + ],
  137 + resetPassword: [
  138 + { required: true, message: "请输入新密码", trigger: "blur" },
  139 + ],
  140 + },
128 141 tableData: [],
129 142 formSchool: {
130   - sections: "",
131   - managePwd: "",
  143 + tenantName: "",
132 144 contactPerson: "",
133 145 contactPhone: "",
134 146 },
135   - subjectName: "",
136   - subjectList: [],
  147 + rulesSchool: {},
137 148 };
138 149 },
139 150 created() {
140   - // this._QueryDataSchool();
141   - // this._QuerySubject();
  151 + this._QueryData();
142 152 },
143 153 methods: {
144   - addSubjectName() {
145   - if (!this.subjectName) {
146   - this.$message.warning("请填写科目名称");
147   - return;
148   - }else if(this.subjectList.includes(this.subjectName)){
149   - this.$message.warning("科目已存在,请重新填写~");
150   - return;
151   - }
152   - this.subjectList.push(this.subjectName);
153   - this.subjectName = "";
154   - },
155 154 editSchool() {
156   - if (!this.formSchool.sections.length) {
157   - this.$message.error("请选择科目!");
158   - return;
159   - }
160   - if (!this.formSchool.managePwd) {
161   - this.$message.error("请填写密码!");
162   - return;
163   - }
164 155 if (this.loading) {
165 156 return;
166 157 }
... ... @@ -168,15 +159,14 @@ export default {
168 159 if (valid) {
169 160 this.loading = true;
170 161 let form = { ...this.formSchool };
171   - form.sections = this.formSchool.sections.join(",");
172   - const { data, status, info } = await this.$request.updateSchool({
  162 + const { data, status, info } = await this.$request.modifyInfo({
173 163 ...form,
174 164 });
175 165 this.loading = false;
176 166 if (status === 0) {
177 167 this.$message.success("修改成功~");
178 168 this.diaSchool = false;
179   - this._QueryDataSchool();
  169 + this._QueryData();
180 170 } else {
181 171 this.$message.error(info);
182 172 }
... ... @@ -185,25 +175,51 @@ export default {
185 175 }
186 176 });
187 177 },
188   - async _QueryDataSchool() {
  178 + editPass() {
  179 + if (this.loading) {
  180 + return;
  181 + }
  182 + this.$refs.formPass.validate(async (valid) => {
  183 + if (valid) {
  184 + if (this.password.password != this.password.resetPassword) {
  185 + this.$message.warning("两次输入密码不一致请检查!");
  186 + return;
  187 + }
  188 + this.loading = true;
  189 + const { data, status, info } = await this.$request.modifyInfo({
  190 + oldPassword: encryptLoginPassword(this.password.oldPassword),
  191 + password: encryptLoginPassword(this.password.password),
  192 + });
  193 + this.loading = false;
  194 + if (status === 0) {
  195 + this.$message.success("密码修改成功~");
  196 + this.diaPass = false;
  197 + const res = await this.$request.logout();
  198 + this.$store.commit("setToken", "");
  199 + this.$store.commit("setInfo", {});
  200 + this.$store.commit("setRouters", []);
  201 + this.$store.commit("resetTabnavBox");
  202 + this.$router.push({
  203 + path: "/login",
  204 + });
  205 + } else {
  206 + this.$message.error(info);
  207 + }
  208 + } else {
  209 + this.$message.error("数据有误,请检查!");
  210 + }
  211 + });
  212 + },
  213 + async _QueryData() {
189 214 this.loading = true;
190   - const { data, status, info } = await this.$request.schoolDetail();
  215 + const { data, status, info } = await this.$request.getInfo();
191 216 this.loading = false;
192 217 console.log(status);
193 218 if (status === 0) {
194   - this.school = { ...data };
  219 + this.Info = { ...data };
195 220 for (let key in this.formSchool) {
196 221 this.formSchool[key] = data[key] || "";
197 222 }
198   - this.formSchool.sections = this.formSchool.sections.split(",");
199   - } else {
200   - this.$message.error(info);
201   - }
202   - },
203   - async _QuerySubject() {
204   - const { data, status, info } = await this.$request.subjectList();
205   - if (status === 0) {
206   - this.subjectList = [...data.subjectNames] || [];
207 223 } else {
208 224 this.$message.error(info);
209 225 }
... ... @@ -235,6 +251,17 @@ export default {
235 251 .el-icon-edit {
236 252 position: absolute;
237 253 top: 12px;
  254 + right: 40px;
  255 + padding: 5px;
  256 + font-size: 18px;
  257 + cursor: pointer;
  258 + &:hover {
  259 + color: #36f;
  260 + }
  261 + }
  262 + .el-icon-key {
  263 + position: absolute;
  264 + top: 12px;
238 265 right: 12px;
239 266 padding: 5px;
240 267 font-size: 18px;
... ...