Commit d703d72cae8c331e0ae3839d44380f7dc0a2a300
1 parent
c2460294
首页,个人信息,班级名单,部分备题组卷接口联调
Showing
9 changed files
with
472 additions
and
256 deletions
src/api/apis/apis.js
@@ -795,6 +795,13 @@ export default { | @@ -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 | modifyInfo(data) { | 805 | modifyInfo(data) { |
799 | return service({ | 806 | return service({ |
800 | url: setUpUrls.modifyInfo, | 807 | url: setUpUrls.modifyInfo, |
@@ -834,6 +841,14 @@ export default { | @@ -834,6 +841,14 @@ export default { | ||
834 | data | 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 | pAddStudent(data) { | 853 | pAddStudent(data) { |
839 | return service({ | 854 | return service({ |
@@ -1202,4 +1217,29 @@ export default { | @@ -1202,4 +1217,29 @@ export default { | ||
1202 | data | 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,6 +203,8 @@ export default { | ||
203 | 203 | ||
204 | // 个人版首页统计数据 | 204 | // 个人版首页统计数据 |
205 | personalIndex:"/api_html/personal/index", | 205 | personalIndex:"/api_html/personal/index", |
206 | + // 个人信息 | ||
207 | + getInfo:"/api_html/personal/personalInfo", | ||
206 | // 修改个人信息 | 208 | // 修改个人信息 |
207 | modifyInfo:"/api_html/personal/modifyInfo", | 209 | modifyInfo:"/api_html/personal/modifyInfo", |
208 | // 查询班级列表 | 210 | // 查询班级列表 |
@@ -213,6 +215,8 @@ export default { | @@ -213,6 +215,8 @@ export default { | ||
213 | pStudentList:"/api_html/personal/studentList", | 215 | pStudentList:"/api_html/personal/studentList", |
214 | // 新增或修改班级 | 216 | // 新增或修改班级 |
215 | pSaveClass:"/api_html/personal/saveClass", | 217 | pSaveClass:"/api_html/personal/saveClass", |
218 | + // 删除班级 | ||
219 | + pDelClass:"/api_html/personal/delClass", | ||
216 | // 增加学生 | 220 | // 增加学生 |
217 | pAddStudent:"/api_html/personal/addStudent", | 221 | pAddStudent:"/api_html/personal/addStudent", |
218 | // 删除学生 | 222 | // 删除学生 |
@@ -308,6 +312,10 @@ export default { | @@ -308,6 +312,10 @@ export default { | ||
308 | pDeviceLogList:"/api_html/system/deviceLogList", | 312 | pDeviceLogList:"/api_html/system/deviceLogList", |
309 | // 文件上传 | 313 | // 文件上传 |
310 | uploadApp:"/file/uploadApp", | 314 | uploadApp:"/file/uploadApp", |
311 | - // 文件上传 | 315 | + // 图片上传 |
312 | uploadImg:"/file/uploadImg", | 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,11 +163,8 @@ | ||
163 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> | 163 | <img class="icon" src="../../assets/nav/setUpAccount.png" alt="" /> |
164 | <div class="text"> | 164 | <div class="text"> |
165 | <p class="p1">备题组卷</p> | 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 | </p> | 168 | </p> |
172 | </div> | 169 | </div> |
173 | </li> | 170 | </li> |
@@ -175,11 +172,8 @@ | @@ -175,11 +172,8 @@ | ||
175 | <img class="icon" src="../../assets/nav/setUpSchool.png" alt="" /> | 172 | <img class="icon" src="../../assets/nav/setUpSchool.png" alt="" /> |
176 | <div class="text"> | 173 | <div class="text"> |
177 | <p class="p1">班级名单</p> | 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 | </p> | 177 | </p> |
184 | </div> | 178 | </div> |
185 | </li> | 179 | </li> |
@@ -187,11 +181,8 @@ | @@ -187,11 +181,8 @@ | ||
187 | <img class="icon" src="../../assets/nav/device.png" alt="" /> | 181 | <img class="icon" src="../../assets/nav/device.png" alt="" /> |
188 | <div class="text"> | 182 | <div class="text"> |
189 | <p class="p1">学生画像</p> | 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 | </p> | 186 | </p> |
196 | </div> | 187 | </div> |
197 | </li> | 188 | </li> |
@@ -199,20 +190,15 @@ | @@ -199,20 +190,15 @@ | ||
199 | <div class="nav-item item1 item-child2" @click="links('/ask')"> | 190 | <div class="nav-item item1 item-child2" @click="links('/ask')"> |
200 | <img class="icon" src="../../assets/nav/card.png" alt="" /> | 191 | <img class="icon" src="../../assets/nav/card.png" alt="" /> |
201 | <p class="p1">随堂问报表</p> | 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 | </p> | 195 | </p> |
208 | </div> | 196 | </div> |
209 | <div class="nav-item item1 item-child2" @click="links('/test')"> | 197 | <div class="nav-item item1 item-child2" @click="links('/test')"> |
210 | <img class="icon" src="../../assets/nav/analysis.png" alt="" /> | 198 | <img class="icon" src="../../assets/nav/analysis.png" alt="" /> |
211 | <p class="p1">即时测报表</p> | 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 | </p> | 202 | </p> |
217 | </div> | 203 | </div> |
218 | <div class="nav-item item1 item-child1" @click="links('/down')"> | 204 | <div class="nav-item item1 item-child1" @click="links('/down')"> |
src/views/personal/examinationPaper/add.vue
@@ -330,7 +330,7 @@ | @@ -330,7 +330,7 @@ | ||
330 | circle | 330 | circle |
331 | size="mini" | 331 | size="mini" |
332 | icon="el-icon-tickets" | 332 | icon="el-icon-tickets" |
333 | - @click="openStem(subQuestions, 1)" | 333 | + @click="openStem(subQuestions, 1, index, indexs)" |
334 | ></el-button> | 334 | ></el-button> |
335 | </el-tooltip> | 335 | </el-tooltip> |
336 | <el-tooltip effect="dark" content="题目打标" placement="top"> | 336 | <el-tooltip effect="dark" content="题目打标" placement="top"> |
@@ -339,7 +339,7 @@ | @@ -339,7 +339,7 @@ | ||
339 | circle | 339 | circle |
340 | size="mini" | 340 | size="mini" |
341 | icon="el-icon-price-tag" | 341 | icon="el-icon-price-tag" |
342 | - @click="openTag(subQuestions)" | 342 | + @click="openTag(subQuestions, 3, index, indexs)" |
343 | ></el-button> | 343 | ></el-button> |
344 | </el-tooltip> | 344 | </el-tooltip> |
345 | <el-tooltip | 345 | <el-tooltip |
@@ -352,7 +352,7 @@ | @@ -352,7 +352,7 @@ | ||
352 | circle | 352 | circle |
353 | size="mini" | 353 | size="mini" |
354 | icon="el-icon-upload" | 354 | icon="el-icon-upload" |
355 | - @click="openStem(subQuestions, 2)" | 355 | + @click="openStem(subQuestions, 2, index, indexs)" |
356 | ></el-button> | 356 | ></el-button> |
357 | </el-tooltip> | 357 | </el-tooltip> |
358 | <el-popconfirm | 358 | <el-popconfirm |
@@ -835,10 +835,10 @@ | @@ -835,10 +835,10 @@ | ||
835 | width="500" | 835 | width="500" |
836 | > | 836 | > |
837 | <div> | 837 | <div> |
838 | - <img class="stem-pic" :src="stem.src" alt="" /> | 838 | + <img class="stem-pic" :src="stem.screenshot" alt="" /> |
839 | <el-upload | 839 | <el-upload |
840 | class="upload-demo" | 840 | class="upload-demo" |
841 | - action="https://jsonplaceholder.typicode.com/posts/" | 841 | + action="http://121.40.127.171/file/uploadImg" |
842 | :limit="1" | 842 | :limit="1" |
843 | :with-credentials="true" | 843 | :with-credentials="true" |
844 | :on-success="upSuccess" | 844 | :on-success="upSuccess" |
@@ -858,25 +858,32 @@ | @@ -858,25 +858,32 @@ | ||
858 | <div> | 858 | <div> |
859 | <el-form ref="form" :model="stem" label-width="160px"> | 859 | <el-form ref="form" :model="stem" label-width="160px"> |
860 | <el-form-item label="题目难度:"> | 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 | </el-select> | 868 | </el-select> |
866 | </el-form-item> | 869 | </el-form-item> |
867 | <el-form-item label="知识点:"> | 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 | </el-select> | 880 | </el-select> |
874 | </el-form-item> | 881 | </el-form-item> |
875 | </el-form> | 882 | </el-form> |
876 | </div> | 883 | </div> |
877 | <div slot="footer"> | 884 | <div slot="footer"> |
878 | <el-button @click="dialogTag = false">取 消</el-button> | 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 | </div> | 887 | </div> |
881 | </el-dialog> | 888 | </el-dialog> |
882 | </div> | 889 | </div> |
@@ -927,9 +934,14 @@ export default { | @@ -927,9 +934,14 @@ export default { | ||
927 | dialogTag: false, | 934 | dialogTag: false, |
928 | upLoadType: 1, | 935 | upLoadType: 1, |
929 | stem: { | 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 | type: 1, //1-创建,2-复制答题卡 | 946 | type: 1, //1-创建,2-复制答题卡 |
935 | dialogVisible: false, //测验类型设置弹窗 | 947 | dialogVisible: false, //测验类型设置弹窗 |
@@ -954,7 +966,7 @@ export default { | @@ -954,7 +966,7 @@ export default { | ||
954 | ], | 966 | ], |
955 | rightOptions: ["A", "B", "C", "D", "E", "F", "G"], | 967 | rightOptions: ["A", "B", "C", "D", "E", "F", "G"], |
956 | addSubQuestionsType: "", | 968 | addSubQuestionsType: "", |
957 | - step: 0, //步骤 | 969 | + step: 1, //步骤 |
958 | gradeList: [], //年级 | 970 | gradeList: [], //年级 |
959 | subjectList: [], //科目 | 971 | subjectList: [], //科目 |
960 | answerTypeList: [], //测验类型 | 972 | answerTypeList: [], //测验类型 |
@@ -1007,28 +1019,52 @@ export default { | @@ -1007,28 +1019,52 @@ export default { | ||
1007 | } | 1019 | } |
1008 | }, | 1020 | }, |
1009 | methods: { | 1021 | methods: { |
1010 | - openStem(obj, type) { | 1022 | + openStem(obj, type, index, indexs) { |
1023 | + //上传截图 | ||
1011 | this.upLoadType = type; | 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 | this.dialogStem = true; | 1030 | this.dialogStem = true; |
1014 | }, | 1031 | }, |
1015 | - openTag(obj) { | 1032 | + openTag(obj, type, index, indexs) { |
1033 | + //难度,知识点 | ||
1016 | this.stem = { ...this.stem, obj }; | 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 | this.dialogTag = true; | 1041 | this.dialogTag = true; |
1018 | }, | 1042 | }, |
1019 | upSuccess(res) { | 1043 | upSuccess(res) { |
1044 | + //图片上传成功 | ||
1020 | if (res && res.status == 0) { | 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 | this.$message.success("上传成功"); | 1051 | this.$message.success("上传成功"); |
1022 | } else { | 1052 | } else { |
1023 | this.$message.error(res.info); | 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 | upError(res) { | 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 | linkBack() { | 1069 | linkBack() { |
1034 | this.$confirm( | 1070 | this.$confirm( |
@@ -1605,7 +1641,7 @@ export default { | @@ -1605,7 +1641,7 @@ export default { | ||
1605 | }, | 1641 | }, |
1606 | async removeTypeName(obj) { | 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 | tagId: obj.id, | 1645 | tagId: obj.id, |
1610 | }); | 1646 | }); |
1611 | if (status == 0) { | 1647 | if (status == 0) { |
@@ -1694,8 +1730,8 @@ export default { | @@ -1694,8 +1730,8 @@ export default { | ||
1694 | this.subjectList = | 1730 | this.subjectList = |
1695 | data.subjectNames?.map((item) => { | 1731 | data.subjectNames?.map((item) => { |
1696 | return { | 1732 | return { |
1697 | - value: item, | ||
1698 | - label: item, | 1733 | + value: item.subjectName, |
1734 | + label: item.subjectName, | ||
1699 | }; | 1735 | }; |
1700 | }) || []; | 1736 | }) || []; |
1701 | console.log(this.subjectList); | 1737 | console.log(this.subjectList); |
@@ -1986,8 +2022,8 @@ export default { | @@ -1986,8 +2022,8 @@ export default { | ||
1986 | } | 2022 | } |
1987 | .qs-set { | 2023 | .qs-set { |
1988 | width: 190px; | 2024 | width: 190px; |
1989 | - .delete{ | ||
1990 | - margin-left:9px; | 2025 | + .delete { |
2026 | + margin-left: 9px; | ||
1991 | } | 2027 | } |
1992 | } | 2028 | } |
1993 | .qs-options2 { | 2029 | .qs-options2 { |
@@ -2012,7 +2048,7 @@ export default { | @@ -2012,7 +2048,7 @@ export default { | ||
2012 | } | 2048 | } |
2013 | } | 2049 | } |
2014 | } | 2050 | } |
2015 | -.upload-demo{ | 2051 | +.upload-demo { |
2016 | text-align: center; | 2052 | text-align: center; |
2017 | } | 2053 | } |
2018 | .stem-pic { | 2054 | .stem-pic { |
src/views/personal/examinationPaper/edit.vue
@@ -142,18 +142,18 @@ | @@ -142,18 +142,18 @@ | ||
142 | <el-button | 142 | <el-button |
143 | type="primary" | 143 | type="primary" |
144 | circle | 144 | circle |
145 | - size="small" | 145 | + size="mini" |
146 | icon="el-icon-tickets" | 146 | icon="el-icon-tickets" |
147 | - @click="openStem(subQuestions, 1)" | 147 | + @click="openStem(subQuestions, 1, index, indexs)" |
148 | ></el-button> | 148 | ></el-button> |
149 | </el-tooltip> | 149 | </el-tooltip> |
150 | <el-tooltip effect="dark" content="题目打标" placement="top"> | 150 | <el-tooltip effect="dark" content="题目打标" placement="top"> |
151 | <el-button | 151 | <el-button |
152 | type="primary" | 152 | type="primary" |
153 | circle | 153 | circle |
154 | - size="small" | 154 | + size="mini" |
155 | icon="el-icon-price-tag" | 155 | icon="el-icon-price-tag" |
156 | - @click="openTag(subQuestions)" | 156 | + @click="openTag(subQuestions, 3, index, indexs)" |
157 | ></el-button> | 157 | ></el-button> |
158 | </el-tooltip> | 158 | </el-tooltip> |
159 | <el-tooltip | 159 | <el-tooltip |
@@ -164,11 +164,24 @@ | @@ -164,11 +164,24 @@ | ||
164 | <el-button | 164 | <el-button |
165 | type="primary" | 165 | type="primary" |
166 | circle | 166 | circle |
167 | - size="small" | 167 | + size="mini" |
168 | icon="el-icon-upload" | 168 | icon="el-icon-upload" |
169 | - @click="openStem(subQuestions, 2)" | 169 | + @click="openStem(subQuestions, 2, index, indexs)" |
170 | ></el-button> | 170 | ></el-button> |
171 | </el-tooltip> | 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 | </div> | 185 | </div> |
173 | </div> | 186 | </div> |
174 | </li> | 187 | </li> |
@@ -275,29 +288,42 @@ | @@ -275,29 +288,42 @@ | ||
275 | <el-button | 288 | <el-button |
276 | type="primary" | 289 | type="primary" |
277 | circle | 290 | circle |
278 | - size="small" | 291 | + size="mini" |
279 | icon="el-icon-tickets" | 292 | icon="el-icon-tickets" |
280 | - @click="openStem(subQuestions, 1)" | 293 | + @click="openStem(subQuestions, 1, indexs)" |
281 | ></el-button> | 294 | ></el-button> |
282 | </el-tooltip> | 295 | </el-tooltip> |
283 | <el-tooltip effect="dark" content="题目打标" placement="top"> | 296 | <el-tooltip effect="dark" content="题目打标" placement="top"> |
284 | <el-button | 297 | <el-button |
285 | type="primary" | 298 | type="primary" |
286 | circle | 299 | circle |
287 | - size="small" | 300 | + size="mini" |
288 | icon="el-icon-price-tag" | 301 | icon="el-icon-price-tag" |
289 | - @click="openTag(subQuestions)" | 302 | + @click="openTag(subQuestions, 3, indexs)" |
290 | ></el-button> | 303 | ></el-button> |
291 | </el-tooltip> | 304 | </el-tooltip> |
292 | <el-tooltip effect="dark" content="上传题目解析" placement="top"> | 305 | <el-tooltip effect="dark" content="上传题目解析" placement="top"> |
293 | <el-button | 306 | <el-button |
294 | type="primary" | 307 | type="primary" |
295 | circle | 308 | circle |
296 | - size="small" | 309 | + size="mini" |
297 | icon="el-icon-upload" | 310 | icon="el-icon-upload" |
298 | - @click="openStem(subQuestions, 2)" | 311 | + @click="openStem(subQuestions, 2, indexs)" |
299 | ></el-button> | 312 | ></el-button> |
300 | </el-tooltip> | 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 | </div> | 327 | </div> |
302 | </div> | 328 | </div> |
303 | </li> | 329 | </li> |
@@ -397,10 +423,10 @@ | @@ -397,10 +423,10 @@ | ||
397 | width="500" | 423 | width="500" |
398 | > | 424 | > |
399 | <div> | 425 | <div> |
400 | - <img class="stem-pic" :src="stem.src" alt="" /> | 426 | + <img class="stem-pic" :src="stem.screenshot" alt="" /> |
401 | <el-upload | 427 | <el-upload |
402 | class="upload-demo" | 428 | class="upload-demo" |
403 | - action="/file/uploadImg" | 429 | + action="http://121.40.127.171/file/uploadImg" |
404 | :limit="1" | 430 | :limit="1" |
405 | :with-credentials="true" | 431 | :with-credentials="true" |
406 | :on-success="upSuccess" | 432 | :on-success="upSuccess" |
@@ -420,18 +446,25 @@ | @@ -420,18 +446,25 @@ | ||
420 | <div> | 446 | <div> |
421 | <el-form ref="form" :model="stem" label-width="160px"> | 447 | <el-form ref="form" :model="stem" label-width="160px"> |
422 | <el-form-item label="题目难度:"> | 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 | </el-select> | 456 | </el-select> |
428 | </el-form-item> | 457 | </el-form-item> |
429 | <el-form-item label="知识点:"> | 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 | </el-select> | 468 | </el-select> |
436 | </el-form-item> | 469 | </el-form-item> |
437 | </el-form> | 470 | </el-form> |
@@ -454,9 +487,14 @@ export default { | @@ -454,9 +487,14 @@ export default { | ||
454 | dialogTag: false, | 487 | dialogTag: false, |
455 | upLoadType: 1, | 488 | upLoadType: 1, |
456 | stem: { | 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 | title: "", | 499 | title: "", |
462 | type: 1, | 500 | type: 1, |
@@ -508,28 +546,64 @@ export default { | @@ -508,28 +546,64 @@ export default { | ||
508 | this._QueryDetail(); | 546 | this._QueryDetail(); |
509 | }, | 547 | }, |
510 | methods: { | 548 | methods: { |
511 | - openStem(obj, type) { | 549 | + openStem(obj, type, index, indexs) { |
550 | + //上传截图 | ||
512 | this.upLoadType = type; | 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 | this.dialogStem = true; | 557 | this.dialogStem = true; |
515 | }, | 558 | }, |
516 | - openTag(obj) { | 559 | + openTag(obj, type, index, indexs) { |
560 | + //难度,知识点 | ||
517 | this.stem = { ...this.stem, obj }; | 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 | this.dialogTag = true; | 568 | this.dialogTag = true; |
519 | }, | 569 | }, |
520 | upSuccess(res) { | 570 | upSuccess(res) { |
571 | + //图片上传成功 | ||
521 | if (res && res.status == 0) { | 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 | this.$message.success("上传成功"); | 583 | this.$message.success("上传成功"); |
523 | } else { | 584 | } else { |
524 | this.$message.error(res.info); | 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 | } else { | 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 | linkBack() { | 608 | linkBack() { |
535 | this.$router.go(-1); | 609 | this.$router.go(-1); |
@@ -1046,7 +1120,9 @@ export default { | @@ -1046,7 +1120,9 @@ export default { | ||
1046 | .el-input-number { | 1120 | .el-input-number { |
1047 | width: 140px; | 1121 | width: 140px; |
1048 | } | 1122 | } |
1049 | - | 1123 | +.delete { |
1124 | + margin-left: 8px; | ||
1125 | +} | ||
1050 | .questions-ul { | 1126 | .questions-ul { |
1051 | border-left: 1px solid #e2e2e2; | 1127 | border-left: 1px solid #e2e2e2; |
1052 | border-top: 1px solid #e2e2e2; | 1128 | border-top: 1px solid #e2e2e2; |
src/views/personal/examinationPaper/index.vue
@@ -232,6 +232,7 @@ export default { | @@ -232,6 +232,7 @@ export default { | ||
232 | //切换班级 | 232 | //切换班级 |
233 | async changClazz() { | 233 | async changClazz() { |
234 | await this._QuerySubjectList(); | 234 | await this._QuerySubjectList(); |
235 | + this._QueryTypeList() | ||
235 | this._QueryData(false); | 236 | this._QueryData(false); |
236 | }, | 237 | }, |
237 | // 查找答题卡类型 | 238 | // 查找答题卡类型 |
@@ -250,7 +251,7 @@ export default { | @@ -250,7 +251,7 @@ export default { | ||
250 | }) || []; | 251 | }) || []; |
251 | this.typeList.unshift({ | 252 | this.typeList.unshift({ |
252 | value: "", | 253 | value: "", |
253 | - label: "请选择标签", | 254 | + label: "全部", |
254 | }); | 255 | }); |
255 | } else { | 256 | } else { |
256 | this.$message.error(info); | 257 | this.$message.error(info); |
@@ -266,7 +267,7 @@ export default { | @@ -266,7 +267,7 @@ export default { | ||
266 | this.classList = | 267 | this.classList = |
267 | data.list?.map((item) => { | 268 | data.list?.map((item) => { |
268 | return { | 269 | return { |
269 | - value: item.classId, | 270 | + value: item.id, |
270 | label: item.className, | 271 | label: item.className, |
271 | }; | 272 | }; |
272 | }) || []; | 273 | }) || []; |
src/views/personal/examinationPaper/recycle.vue
@@ -86,7 +86,8 @@ | @@ -86,7 +86,8 @@ | ||
86 | </div> | 86 | </div> |
87 | <div class="info"> | 87 | <div class="info"> |
88 | <p class="title"> | 88 | <p class="title"> |
89 | - {{ item.title }} <span class="label" v-if="item.tag">{{ item.tag }}</span> | 89 | + {{ item.title }} |
90 | + <span class="label" v-if="item.tag">{{ item.tag }}</span> | ||
90 | </p> | 91 | </p> |
91 | <p class="num"> | 92 | <p class="num"> |
92 | {{ item.gradeName }} | 93 | {{ item.gradeName }} |
@@ -136,7 +137,11 @@ | @@ -136,7 +137,11 @@ | ||
136 | > | 137 | > |
137 | </el-pagination> | 138 | </el-pagination> |
138 | </div> | 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 | </div> | 145 | </div> |
141 | </template> | 146 | </template> |
142 | 147 | ||
@@ -144,7 +149,7 @@ | @@ -144,7 +149,7 @@ | ||
144 | export default { | 149 | export default { |
145 | data() { | 150 | data() { |
146 | return { | 151 | return { |
147 | - loading:false, | 152 | + loading: false, |
148 | props: { multiple: true, checkStrictly: true }, | 153 | props: { multiple: true, checkStrictly: true }, |
149 | options: [ | 154 | options: [ |
150 | { | 155 | { |
@@ -187,8 +192,8 @@ export default { | @@ -187,8 +192,8 @@ export default { | ||
187 | typeList: [], | 192 | typeList: [], |
188 | tableData: [], | 193 | tableData: [], |
189 | total: 0, | 194 | total: 0, |
190 | - page:1, | ||
191 | - size:20 | 195 | + page: 1, |
196 | + size: 20, | ||
192 | }; | 197 | }; |
193 | }, | 198 | }, |
194 | async created() { | 199 | async created() { |
@@ -228,13 +233,13 @@ export default { | @@ -228,13 +233,13 @@ export default { | ||
228 | await this._QuerySubjectList(); | 233 | await this._QuerySubjectList(); |
229 | this._QueryData(false); | 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 | async _QueryData(type) { | 240 | async _QueryData(type) { |
236 | //获取答题卡列表 | 241 | //获取答题卡列表 |
237 | - this.loading=true | 242 | + this.loading = true; |
238 | let query = {}; | 243 | let query = {}; |
239 | if (!type) { | 244 | if (!type) { |
240 | this.query.title = ""; | 245 | this.query.title = ""; |
@@ -244,7 +249,7 @@ export default { | @@ -244,7 +249,7 @@ export default { | ||
244 | this.query.type = ""; | 249 | this.query.type = ""; |
245 | this.query.subjectId = ""; | 250 | this.query.subjectId = ""; |
246 | } | 251 | } |
247 | - query.classId = this.query.classId; | 252 | + query.classId = this.query.classId; |
248 | for (let key in query) { | 253 | for (let key in query) { |
249 | if (!query[key]) { | 254 | if (!query[key]) { |
250 | query[key] = null; | 255 | query[key] = null; |
@@ -252,9 +257,9 @@ export default { | @@ -252,9 +257,9 @@ export default { | ||
252 | } | 257 | } |
253 | const { data, status, info } = await this.$request.pPaperList({ | 258 | const { data, status, info } = await this.$request.pPaperList({ |
254 | ...query, | 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 | this.loading = false; | 264 | this.loading = false; |
260 | if (status === 0) { | 265 | if (status === 0) { |
@@ -270,12 +275,13 @@ export default { | @@ -270,12 +275,13 @@ export default { | ||
270 | console.log(status); | 275 | console.log(status); |
271 | if (status === 0) { | 276 | if (status === 0) { |
272 | if (!!data.list) { | 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 | this.query.classId = this.classList[0]?.value; | 285 | this.query.classId = this.classList[0]?.value; |
280 | } | 286 | } |
281 | } else { | 287 | } else { |
@@ -288,12 +294,13 @@ export default { | @@ -288,12 +294,13 @@ export default { | ||
288 | classId: this.query.classId, | 294 | classId: this.query.classId, |
289 | }); | 295 | }); |
290 | if (status === 0) { | 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 | this.query.subjectName = this.subjectList[0]?.value; | 304 | this.query.subjectName = this.subjectList[0]?.value; |
298 | } else { | 305 | } else { |
299 | this.$message.error(info); | 306 | this.$message.error(info); |
@@ -303,7 +310,7 @@ export default { | @@ -303,7 +310,7 @@ export default { | ||
303 | async _QueryTypeList() { | 310 | async _QueryTypeList() { |
304 | const { data, status, info } = await this.$request.pPaperTagList({ | 311 | const { data, status, info } = await this.$request.pPaperTagList({ |
305 | classId: this.query.classId, | 312 | classId: this.query.classId, |
306 | - tyle:0 | 313 | + tyle: 0, |
307 | }); | 314 | }); |
308 | if (status === 0) { | 315 | if (status === 0) { |
309 | this.typeList = | 316 | this.typeList = |
src/views/personal/setUp/student.vue
@@ -15,6 +15,16 @@ | @@ -15,6 +15,16 @@ | ||
15 | @click="diaUp = true" | 15 | @click="diaUp = true" |
16 | ></el-button> | 16 | ></el-button> |
17 | </el-tooltip> | 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 | <el-tooltip effect="dark" content="添加班级" placement="bottom"> | 28 | <el-tooltip effect="dark" content="添加班级" placement="bottom"> |
19 | <el-button | 29 | <el-button |
20 | type="primary" | 30 | type="primary" |
@@ -156,7 +166,7 @@ | @@ -156,7 +166,7 @@ | ||
156 | <el-checkbox | 166 | <el-checkbox |
157 | v-for="item in subjectList" | 167 | v-for="item in subjectList" |
158 | :label="item" | 168 | :label="item" |
159 | - :key="item" | 169 | + :key="item.id" |
160 | >{{ item }}</el-checkbox | 170 | >{{ item }}</el-checkbox |
161 | > | 171 | > |
162 | </el-checkbox-group> | 172 | </el-checkbox-group> |
@@ -186,7 +196,6 @@ | @@ -186,7 +196,6 @@ | ||
186 | </el-dialog> | 196 | </el-dialog> |
187 | <el-dialog title="学生导入" :visible.sync="diaUp" width="600"> | 197 | <el-dialog title="学生导入" :visible.sync="diaUp" width="600"> |
188 | <up-load | 198 | <up-load |
189 | - id="downTeacher" | ||
190 | :url="url" | 199 | :url="url" |
191 | @upSuccess="upSuccess" | 200 | @upSuccess="upSuccess" |
192 | fileName="学生模板" | 201 | fileName="学生模板" |
@@ -209,15 +218,16 @@ export default { | @@ -209,15 +218,16 @@ export default { | ||
209 | data() { | 218 | data() { |
210 | return { | 219 | return { |
211 | loading: false, | 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 | showAll: false, //修改年级科目显示 | 225 | showAll: false, //修改年级科目显示 |
217 | query: { | 226 | query: { |
218 | classId: "", | 227 | classId: "", |
219 | }, | 228 | }, |
220 | - formStu: {//添加学生信息 | 229 | + formStu: { |
230 | + //添加学生信息 | ||
221 | className: "", | 231 | className: "", |
222 | studentName: "", | 232 | studentName: "", |
223 | studentCode: "", | 233 | studentCode: "", |
@@ -233,7 +243,8 @@ export default { | @@ -233,7 +243,8 @@ export default { | ||
233 | { required: true, message: "请输入学生长学号", trigger: "blur" }, | 243 | { required: true, message: "请输入学生长学号", trigger: "blur" }, |
234 | ], | 244 | ], |
235 | }, | 245 | }, |
236 | - formClass: {//添加班级信息 | 246 | + formClass: { |
247 | + //添加班级信息 | ||
237 | classId: "", | 248 | classId: "", |
238 | className: "", | 249 | className: "", |
239 | subjectNames: [], | 250 | subjectNames: [], |
@@ -242,17 +253,20 @@ export default { | @@ -242,17 +253,20 @@ export default { | ||
242 | className: [ | 253 | className: [ |
243 | { required: true, message: "请输入班级名称", trigger: "blur" }, | 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 | async created() { | 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 | methods: { | 271 | methods: { |
258 | addClass() { | 272 | addClass() { |
@@ -295,7 +309,7 @@ export default { | @@ -295,7 +309,7 @@ export default { | ||
295 | saveClass() { | 309 | saveClass() { |
296 | this.$refs.formClass.validate(async (valid) => { | 310 | this.$refs.formClass.validate(async (valid) => { |
297 | if (valid) { | 311 | if (valid) { |
298 | - const { data, status, info } = await this.$request.updateClass({ | 312 | + const { data, status, info } = await this.$request.pSaveClass({ |
299 | classId: this.formClass.classId, | 313 | classId: this.formClass.classId, |
300 | className: this.formClass.className, | 314 | className: this.formClass.className, |
301 | subjectNames: this.formClass.subjectNames, | 315 | subjectNames: this.formClass.subjectNames, |
@@ -324,7 +338,7 @@ export default { | @@ -324,7 +338,7 @@ export default { | ||
324 | this.$message.warning("有学生的班级不能删除!"); | 338 | this.$message.warning("有学生的班级不能删除!"); |
325 | return; | 339 | return; |
326 | } | 340 | } |
327 | - const { data, status, info } = await this.$request.updateClass({ | 341 | + const { data, status, info } = await this.$request.pDelClass({ |
328 | classId: this.formClass.classId, | 342 | classId: this.formClass.classId, |
329 | }); | 343 | }); |
330 | if (status === 0) { | 344 | if (status === 0) { |
@@ -355,21 +369,9 @@ export default { | @@ -355,21 +369,9 @@ export default { | ||
355 | this.$message.error(info); | 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 | async removeStu(obj, index) { | 373 | async removeStu(obj, index) { |
372 | - const { data, status, info } = await this.$request.delStudent({ | 374 | + const { data, status, info } = await this.$request.pDelStudent({ |
373 | studentId: obj.id, | 375 | studentId: obj.id, |
374 | }); | 376 | }); |
375 | if (status === 0) { | 377 | if (status === 0) { |
@@ -398,7 +400,7 @@ export default { | @@ -398,7 +400,7 @@ export default { | ||
398 | this.$message.warning("学生姓名已存在"); | 400 | this.$message.warning("学生姓名已存在"); |
399 | return; | 401 | return; |
400 | } | 402 | } |
401 | - const { data, status, info } = await this.$request.addStudent({ | 403 | + const { data, status, info } = await this.$request.pAddStudent({ |
402 | classId: this.query.classId, | 404 | classId: this.query.classId, |
403 | ...query, | 405 | ...query, |
404 | }); | 406 | }); |
@@ -419,7 +421,7 @@ export default { | @@ -419,7 +421,7 @@ export default { | ||
419 | }, | 421 | }, |
420 | async _QueryData() { | 422 | async _QueryData() { |
421 | this.loading = true; | 423 | this.loading = true; |
422 | - const { data, status, info } = await this.$request.studentList({ | 424 | + const { data, status, info } = await this.$request.pStudentList({ |
423 | ...this.query, | 425 | ...this.query, |
424 | }); | 426 | }); |
425 | this.loading = false; | 427 | this.loading = false; |
@@ -432,7 +434,9 @@ export default { | @@ -432,7 +434,9 @@ export default { | ||
432 | }, | 434 | }, |
433 | 435 | ||
434 | async _QueryClass() { | 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 | if (status === 0) { | 440 | if (status === 0) { |
437 | this.classList = [...data.list] || []; | 441 | this.classList = [...data.list] || []; |
438 | this.query.classId = this.classList[0]?.id; | 442 | this.query.classId = this.classList[0]?.id; |
@@ -441,6 +445,37 @@ export default { | @@ -441,6 +445,37 @@ export default { | ||
441 | this.$message.error(info); | 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 | </script> | 481 | </script> |
@@ -565,7 +600,7 @@ export default { | @@ -565,7 +600,7 @@ export default { | ||
565 | } | 600 | } |
566 | .form-box { | 601 | .form-box { |
567 | .subject-box { | 602 | .subject-box { |
568 | - padding-right:50px; | 603 | + padding-right: 50px; |
569 | max-height: 90px; | 604 | max-height: 90px; |
570 | overflow: hidden; | 605 | overflow: hidden; |
571 | position: relative; | 606 | position: relative; |
src/views/personal/userInfo/index.vue
@@ -8,30 +8,20 @@ | @@ -8,30 +8,20 @@ | ||
8 | <div class="page-content"> | 8 | <div class="page-content"> |
9 | <div class="content-box"> | 9 | <div class="content-box"> |
10 | <i class="el-icon-edit" @click="diaSchool = true"></i> | 10 | <i class="el-icon-edit" @click="diaSchool = true"></i> |
11 | + <i class="el-icon-key" @click="diaPass = true"></i> | ||
11 | <ul class="school-info"> | 12 | <ul class="school-info"> |
12 | <li class="school-item"> | 13 | <li class="school-item"> |
13 | <span class="s1">学校名称:</span> | 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 | </li> | 16 | </li> |
20 | <li class="school-item"> | 17 | <li class="school-item"> |
21 | <span class="s1">教师姓名:</span> | 18 | <span class="s1">教师姓名:</span> |
22 | - <span class="s2">{{ school.contactPerson || "--" }}</span> | 19 | + <span class="s2">{{ Info.contactPerson || "--" }}</span> |
23 | </li> | 20 | </li> |
24 | <li class="school-item"> | 21 | <li class="school-item"> |
25 | <span class="s1">手机号码:</span> | 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 | </li> | 24 | </li> |
34 | - | ||
35 | </ul> | 25 | </ul> |
36 | </div> | 26 | </div> |
37 | </div> | 27 | </div> |
@@ -43,16 +33,14 @@ | @@ -43,16 +33,14 @@ | ||
43 | :rules="rulesSchool" | 33 | :rules="rulesSchool" |
44 | label-width="160px" | 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 | <el-form-item label="教师姓名:" prop="contactPerson" | 44 | <el-form-item label="教师姓名:" prop="contactPerson" |
57 | ><el-col :span="10" | 45 | ><el-col :span="10" |
58 | ><el-input | 46 | ><el-input |
@@ -75,92 +63,95 @@ | @@ -75,92 +63,95 @@ | ||
75 | <el-button @click="editSchool">确 定</el-button> | 63 | <el-button @click="editSchool">确 定</el-button> |
76 | <el-button @click="diaSchool = false">取 消</el-button> | 64 | <el-button @click="diaSchool = false">取 消</el-button> |
77 | </div> | 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 | </div> | 108 | </div> |
80 | </template> | 109 | </template> |
81 | 110 | ||
82 | <script> | 111 | <script> |
83 | -import { downloadFile } from "@/utils"; | 112 | +import { downloadFile, encryptLoginPassword } from "@/utils"; |
84 | export default { | 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 | data() { | 114 | data() { |
118 | return { | 115 | return { |
119 | loading: false, | 116 | loading: false, |
120 | diaSchool: false, | 117 | diaSchool: false, |
121 | - school: { | ||
122 | - schoolName: "", | ||
123 | - managePwd: "", | 118 | + diaPass: false, |
119 | + Info: { | ||
120 | + tenantName: "", | ||
124 | contactPerson: "", | 121 | contactPerson: "", |
125 | contactPhone: "", | 122 | contactPhone: "", |
126 | sections: "", | 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 | tableData: [], | 141 | tableData: [], |
129 | formSchool: { | 142 | formSchool: { |
130 | - sections: "", | ||
131 | - managePwd: "", | 143 | + tenantName: "", |
132 | contactPerson: "", | 144 | contactPerson: "", |
133 | contactPhone: "", | 145 | contactPhone: "", |
134 | }, | 146 | }, |
135 | - subjectName: "", | ||
136 | - subjectList: [], | 147 | + rulesSchool: {}, |
137 | }; | 148 | }; |
138 | }, | 149 | }, |
139 | created() { | 150 | created() { |
140 | - // this._QueryDataSchool(); | ||
141 | - // this._QuerySubject(); | 151 | + this._QueryData(); |
142 | }, | 152 | }, |
143 | methods: { | 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 | editSchool() { | 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 | if (this.loading) { | 155 | if (this.loading) { |
165 | return; | 156 | return; |
166 | } | 157 | } |
@@ -168,15 +159,14 @@ export default { | @@ -168,15 +159,14 @@ export default { | ||
168 | if (valid) { | 159 | if (valid) { |
169 | this.loading = true; | 160 | this.loading = true; |
170 | let form = { ...this.formSchool }; | 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 | ...form, | 163 | ...form, |
174 | }); | 164 | }); |
175 | this.loading = false; | 165 | this.loading = false; |
176 | if (status === 0) { | 166 | if (status === 0) { |
177 | this.$message.success("修改成功~"); | 167 | this.$message.success("修改成功~"); |
178 | this.diaSchool = false; | 168 | this.diaSchool = false; |
179 | - this._QueryDataSchool(); | 169 | + this._QueryData(); |
180 | } else { | 170 | } else { |
181 | this.$message.error(info); | 171 | this.$message.error(info); |
182 | } | 172 | } |
@@ -185,25 +175,51 @@ export default { | @@ -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 | this.loading = true; | 214 | this.loading = true; |
190 | - const { data, status, info } = await this.$request.schoolDetail(); | 215 | + const { data, status, info } = await this.$request.getInfo(); |
191 | this.loading = false; | 216 | this.loading = false; |
192 | console.log(status); | 217 | console.log(status); |
193 | if (status === 0) { | 218 | if (status === 0) { |
194 | - this.school = { ...data }; | 219 | + this.Info = { ...data }; |
195 | for (let key in this.formSchool) { | 220 | for (let key in this.formSchool) { |
196 | this.formSchool[key] = data[key] || ""; | 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 | } else { | 223 | } else { |
208 | this.$message.error(info); | 224 | this.$message.error(info); |
209 | } | 225 | } |
@@ -235,6 +251,17 @@ export default { | @@ -235,6 +251,17 @@ export default { | ||
235 | .el-icon-edit { | 251 | .el-icon-edit { |
236 | position: absolute; | 252 | position: absolute; |
237 | top: 12px; | 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 | right: 12px; | 265 | right: 12px; |
239 | padding: 5px; | 266 | padding: 5px; |
240 | font-size: 18px; | 267 | font-size: 18px; |