From d703d72cae8c331e0ae3839d44380f7dc0a2a300 Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Thu, 2 Mar 2023 09:10:15 +0800 Subject: [PATCH] 首页,个人信息,班级名单,部分备题组卷接口联调 --- src/api/apis/apis.js | 40 ++++++++++++++++++++++++++++++++++++++++ src/api/urls/apis.js | 10 +++++++++- src/views/index/mainIndex.vue | 34 ++++++++++------------------------ src/views/personal/examinationPaper/add.vue | 102 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------- src/views/personal/examinationPaper/edit.vue | 144 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++---------------------------------- src/views/personal/examinationPaper/index.vue | 5 +++-- src/views/personal/examinationPaper/recycle.vue | 59 +++++++++++++++++++++++++++++++++-------------------------- src/views/personal/setUp/student.vue | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------- src/views/personal/userInfo/index.vue | 229 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------- 9 files changed, 472 insertions(+), 256 deletions(-) diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index 922436b..97b5242 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -795,6 +795,13 @@ export default { /** 个人版 */ // 修改个人信息 + getInfo(data) { + return service({ + url: setUpUrls.getInfo, + method: "POST", + data + }); + }, modifyInfo(data) { return service({ url: setUpUrls.modifyInfo, @@ -834,6 +841,14 @@ export default { data }); }, + // 删除班级 + pDelClass(data) { + return service({ + url: setUpUrls.pDelClass, + method: "POST", + data + }); + }, // 增加学生 pAddStudent(data) { return service({ @@ -1202,4 +1217,29 @@ export default { data }); }, + //班级名册导入 + studentTemplateUrl(data) { + return service({ + url: setUpUrls.studentTemplateUrl, + method: "POST", + data + }); + }, + //班级名册导出 + exportStudent(data) { + return service({ + url: setUpUrls.exportStudent, + method: "POST", + data, + responseType: 'arraybuffer', + }); + }, + //班级名册导出 + puploadImg(data) { + return service({ + url: setUpUrls.uploadImg, + method: "POST", + data, + }); + }, }; diff --git a/src/api/urls/apis.js b/src/api/urls/apis.js index e813a90..bc29003 100644 --- a/src/api/urls/apis.js +++ b/src/api/urls/apis.js @@ -203,6 +203,8 @@ export default { // 个人版首页统计数据 personalIndex:"/api_html/personal/index", + // 个人信息 + getInfo:"/api_html/personal/personalInfo", // 修改个人信息 modifyInfo:"/api_html/personal/modifyInfo", // 查询班级列表 @@ -213,6 +215,8 @@ export default { pStudentList:"/api_html/personal/studentList", // 新增或修改班级 pSaveClass:"/api_html/personal/saveClass", + // 删除班级 + pDelClass:"/api_html/personal/delClass", // 增加学生 pAddStudent:"/api_html/personal/addStudent", // 删除学生 @@ -308,6 +312,10 @@ export default { pDeviceLogList:"/api_html/system/deviceLogList", // 文件上传 uploadApp:"/file/uploadApp", - // 文件上传 + // 图片上传 uploadImg:"/file/uploadImg", + // 班级名册导入 + studentTemplateUrl:"/api_html/personal/studentTemplateUrl", + // 班级名册导出 + exportStudent:"/api_html/personal/exportStudent", } diff --git a/src/views/index/mainIndex.vue b/src/views/index/mainIndex.vue index b618840..59bae3a 100644 --- a/src/views/index/mainIndex.vue +++ b/src/views/index/mainIndex.vue @@ -163,11 +163,8 @@

备题组卷

-

- 管理 - +

+ 管理 {{ dataInfo.paperCount }}套答题卡,

@@ -175,11 +172,8 @@

班级名单

-

- 管理 - +

+ 管理{{ dataInfo.classCount }}个班级的学生名单,

@@ -187,11 +181,8 @@

学生画像

-

- 共分析 - +

+ 共分析{{ dataInfo.stationCount }}名学生成绩

@@ -199,20 +190,15 @@ @@ -927,9 +934,14 @@ export default { dialogTag: false, upLoadType: 1, stem: { - src: "", //题干图片地址 - type: 0, //题目难度 - tag: [], //知识点 + id: "", + type: 1, + index: 0, + indexs: 0, + screenshot: "", //题干图片地址 + answerScreenshot: "", //题干解析图片地址 + difficultyFactor: 0, //题目难度 + knowledge: [], //知识点 }, type: 1, //1-创建,2-复制答题卡 dialogVisible: false, //测验类型设置弹窗 @@ -954,7 +966,7 @@ export default { ], rightOptions: ["A", "B", "C", "D", "E", "F", "G"], addSubQuestionsType: "", - step: 0, //步骤 + step: 1, //步骤 gradeList: [], //年级 subjectList: [], //科目 answerTypeList: [], //测验类型 @@ -1007,28 +1019,52 @@ export default { } }, methods: { - openStem(obj, type) { + openStem(obj, type, index, indexs) { + //上传截图 this.upLoadType = type; - this.stem = { ...this.stem, obj }; + this.stem.id = obj.id; + this.stem.type = type; + this.stem.index = index; + this.stem.indexs = indexs; + this.stem.screenshot = type == 1 ? obj.screenshot : obj.answerScreenshot; this.dialogStem = true; }, - openTag(obj) { + openTag(obj, type, index, indexs) { + //难度,知识点 this.stem = { ...this.stem, obj }; + this.stem.id = obj.id; + this.stem.type = type; + this.stem.index = index; + this.stem.indexs = indexs; + this.stem.knowledge = obj.knowledge?.split(",") || []; + this.stem.difficultyFactor = obj.difficultyFactor || ""; this.dialogTag = true; }, upSuccess(res) { + //图片上传成功 if (res && res.status == 0) { + this.dialogStem = false; + let keys = this.stem.type == 1 ? "screenshot" : "answerScreenshot"; + this.form.questionList[this.stem.index].subQuestions[this.stem.indexs][ + keys + ] = this.stem[keys]; this.$message.success("上传成功"); } else { this.$message.error(res.info); } }, + setKnowledge() { + //保存难度、知识点 + this.form.questionList[this.stem.index].subQuestions[ + this.stem.indexs + ].knowledge = this.stem.knowledge.join(","); + this.form.questionList[this.stem.index].subQuestions[ + this.stem.indexs + ].difficultyFactor = this.stem.difficultyFactor; + this.dialogTag = false; + }, upError(res) { - if (res && res.status == 0) { - this.$message.error("上传失败"); - } else { - this.$message.error(res.message); - } + this.$message.error("上传失败"); }, linkBack() { this.$confirm( @@ -1605,7 +1641,7 @@ export default { }, async removeTypeName(obj) { //删除测验类型 - const { data, status, info } = await this.$request.pDelPaper({ + const { data, status, info } = await this.$request.pDelPaperType({ tagId: obj.id, }); if (status == 0) { @@ -1694,8 +1730,8 @@ export default { this.subjectList = data.subjectNames?.map((item) => { return { - value: item, - label: item, + value: item.subjectName, + label: item.subjectName, }; }) || []; console.log(this.subjectList); @@ -1986,8 +2022,8 @@ export default { } .qs-set { width: 190px; - .delete{ - margin-left:9px; + .delete { + margin-left: 9px; } } .qs-options2 { @@ -2012,7 +2048,7 @@ export default { } } } -.upload-demo{ +.upload-demo { text-align: center; } .stem-pic { diff --git a/src/views/personal/examinationPaper/edit.vue b/src/views/personal/examinationPaper/edit.vue index deaafce..7dad0c5 100644 --- a/src/views/personal/examinationPaper/edit.vue +++ b/src/views/personal/examinationPaper/edit.vue @@ -142,18 +142,18 @@ + + + @@ -275,29 +288,42 @@ + + + @@ -397,10 +423,10 @@ width="500" >
- + - - - - + + + + - - - - - + + + + + @@ -454,9 +487,14 @@ export default { dialogTag: false, upLoadType: 1, stem: { - src: "", //题干图片地址 - type: 0, //题目难度 - tag: [], //知识点 + id: "", + type: 1, + index: 0, + indexs: 0, + screenshot: "", //题干图片地址 + answerScreenshot: "", //题干解析图片地址 + difficultyFactor: 0, //题目难度 + knowledge: [], //知识点 }, title: "", type: 1, @@ -508,28 +546,64 @@ export default { this._QueryDetail(); }, methods: { - openStem(obj, type) { + openStem(obj, type, index, indexs) { + //上传截图 this.upLoadType = type; - this.stem = { ...this.stem, obj }; + this.stem.id = obj.id; + this.stem.type = type; + this.stem.index = index; + this.stem.indexs = indexs; + this.stem.screenshot = type == 1 ? obj.screenshot : obj.answerScreenshot; this.dialogStem = true; }, - openTag(obj) { + openTag(obj, type, index, indexs) { + //难度,知识点 this.stem = { ...this.stem, obj }; + this.stem.id = obj.id; + this.stem.type = type; + this.stem.index = index; + this.stem.indexs = indexs; + this.stem.knowledge = obj.knowledge?.split(",") || []; + this.stem.difficultyFactor = obj.difficultyFactor || ""; this.dialogTag = true; }, upSuccess(res) { + //图片上传成功 if (res && res.status == 0) { + this.dialogStem = false; + let keys = this.stem.type == 1 ? "screenshot" : "answerScreenshot"; + if (typeof this.stem.indexs != undefined) { + this.questionList[this.stem.index].subQuestions[this.stem.indexs][ + keys + ] = this.stem[keys]; + } else { + this.questionList[this.stem.index][keys] = this.stem[keys]; + } + this.$message.success("上传成功"); } else { this.$message.error(res.info); } }, - upError(res) { - if (res && res.status == 0) { - this.$message.error("上传失败"); + setKnowledge() { + //保存难度、知识点 + if (typeof this.stem.indexs != undefined) { + this.questionList[this.stem.index].subQuestions[ + this.stem.indexs + ].knowledge = this.stem.knowledge.join(","); + this.questionList[this.stem.index].subQuestions[ + this.stem.indexs + ].difficultyFactor = this.stem.difficultyFactor; } else { - this.$message.error(res.message); + this.questionList[this.stem.index].knowledge = + this.stem.knowledge.join(","); + this.questionList[this.stem.index].difficultyFactor = + this.stem.difficultyFactor; } + this.dialogTag = false; + }, + upError(res) { + this.$message.error("上传失败"); }, linkBack() { this.$router.go(-1); @@ -1046,7 +1120,9 @@ export default { .el-input-number { width: 140px; } - +.delete { + margin-left: 8px; +} .questions-ul { border-left: 1px solid #e2e2e2; border-top: 1px solid #e2e2e2; diff --git a/src/views/personal/examinationPaper/index.vue b/src/views/personal/examinationPaper/index.vue index 26711df..c69618d 100644 --- a/src/views/personal/examinationPaper/index.vue +++ b/src/views/personal/examinationPaper/index.vue @@ -232,6 +232,7 @@ export default { //切换班级 async changClazz() { await this._QuerySubjectList(); + this._QueryTypeList() this._QueryData(false); }, // 查找答题卡类型 @@ -250,7 +251,7 @@ export default { }) || []; this.typeList.unshift({ value: "", - label: "请选择标签", + label: "全部", }); } else { this.$message.error(info); @@ -266,7 +267,7 @@ export default { this.classList = data.list?.map((item) => { return { - value: item.classId, + value: item.id, label: item.className, }; }) || []; diff --git a/src/views/personal/examinationPaper/recycle.vue b/src/views/personal/examinationPaper/recycle.vue index f8f63f4..a174b3a 100644 --- a/src/views/personal/examinationPaper/recycle.vue +++ b/src/views/personal/examinationPaper/recycle.vue @@ -86,7 +86,8 @@

- {{ item.title }} {{ item.tag }} + {{ item.title }} + {{ item.tag }}

{{ item.gradeName }} @@ -136,7 +137,11 @@ >

- + @@ -144,7 +149,7 @@ export default { data() { return { - loading:false, + loading: false, props: { multiple: true, checkStrictly: true }, options: [ { @@ -187,8 +192,8 @@ export default { typeList: [], tableData: [], total: 0, - page:1, - size:20 + page: 1, + size: 20, }; }, async created() { @@ -228,13 +233,13 @@ export default { await this._QuerySubjectList(); this._QueryData(false); }, - changePage(page){ - this.page = page - this._QueryData(this.query.title) + changePage(page) { + this.page = page; + this._QueryData(this.query.title); }, async _QueryData(type) { //获取答题卡列表 - this.loading=true + this.loading = true; let query = {}; if (!type) { this.query.title = ""; @@ -244,7 +249,7 @@ export default { this.query.type = ""; this.query.subjectId = ""; } - query.classId = this.query.classId; + query.classId = this.query.classId; for (let key in query) { if (!query[key]) { query[key] = null; @@ -252,9 +257,9 @@ export default { } const { data, status, info } = await this.$request.pPaperList({ ...query, - status:2, - page:this.page, - size:this.size + status: 2, + page: this.page, + size: this.size, }); this.loading = false; if (status === 0) { @@ -270,12 +275,13 @@ export default { console.log(status); if (status === 0) { if (!!data.list) { - this.classList = data.list?.map((item) => { - return { - value: item.classId, - label: item.className, - }; - })||[]; + this.classList = + data.list?.map((item) => { + return { + value: item.id, + label: item.className, + }; + }) || []; this.query.classId = this.classList[0]?.value; } } else { @@ -288,12 +294,13 @@ export default { classId: this.query.classId, }); if (status === 0) { - this.subjectList = data.subjectNames?.map((item) => { - return { - value: item, - label: item, - }; - })||[]; + this.subjectList = + data.subjectNames?.map((item) => { + return { + value: item, + label: item, + }; + }) || []; this.query.subjectName = this.subjectList[0]?.value; } else { this.$message.error(info); @@ -303,7 +310,7 @@ export default { async _QueryTypeList() { const { data, status, info } = await this.$request.pPaperTagList({ classId: this.query.classId, - tyle:0 + tyle: 0, }); if (status === 0) { this.typeList = diff --git a/src/views/personal/setUp/student.vue b/src/views/personal/setUp/student.vue index a334fcd..0a89616 100644 --- a/src/views/personal/setUp/student.vue +++ b/src/views/personal/setUp/student.vue @@ -15,6 +15,16 @@ @click="diaUp = true" > + + + {{ item }} @@ -186,7 +196,6 @@ { if (valid) { - const { data, status, info } = await this.$request.updateClass({ + const { data, status, info } = await this.$request.pSaveClass({ classId: this.formClass.classId, className: this.formClass.className, subjectNames: this.formClass.subjectNames, @@ -324,7 +338,7 @@ export default { this.$message.warning("有学生的班级不能删除!"); return; } - const { data, status, info } = await this.$request.updateClass({ + const { data, status, info } = await this.$request.pDelClass({ classId: this.formClass.classId, }); if (status === 0) { @@ -355,21 +369,9 @@ export default { this.$message.error(info); } }, - async downExcel() { - this.loadingDown = true; - let { data, info, status } = - await this.$request.studentClickerTemplateUrl(); - this.loadingDown = false; - if (status == 0) { - getBlob(data.downloadUrl).then((res) => { - downloadFile("学生模板", res); - }); - } else { - this.$message.error(info); - } - }, + async removeStu(obj, index) { - const { data, status, info } = await this.$request.delStudent({ + const { data, status, info } = await this.$request.pDelStudent({ studentId: obj.id, }); if (status === 0) { @@ -398,7 +400,7 @@ export default { this.$message.warning("学生姓名已存在"); return; } - const { data, status, info } = await this.$request.addStudent({ + const { data, status, info } = await this.$request.pAddStudent({ classId: this.query.classId, ...query, }); @@ -419,7 +421,7 @@ export default { }, async _QueryData() { this.loading = true; - const { data, status, info } = await this.$request.studentList({ + const { data, status, info } = await this.$request.pStudentList({ ...this.query, }); this.loading = false; @@ -432,7 +434,9 @@ export default { }, async _QueryClass() { - const { data, status, info } = await this.$request.schoolClassList(); + const { data, status, info } = await this.$request.pClassList({ + needStudentCount:1 + }); if (status === 0) { this.classList = [...data.list] || []; this.query.classId = this.classList[0]?.id; @@ -441,6 +445,37 @@ export default { this.$message.error(info); } }, + async downExcel() { + this.loadingDown = true; + let { data, info, status } = await this.$request.studentTemplateUrl(); + this.loadingDown = false; + if (status == 0) { + // getBlob(data.downloadUrl).then((res) => { + // downloadFile("学生模板", res); + // }); + const a = document.createElement("a"); + a.href = data.downloadUrl; + a.download = data.appName; + document.body.appendChild(a); + a.click(); + a.remove(); + } else { + this.$message.error(info); + } + }, + async exportStudentExl() { + this.loadingDown = true; + let data = await this.$request.exportStudent(); + this.loadingDown = false; + if (data) { + let blob = new Blob([data], { + type: "application/vnd.ms-excel;charset=utf-8", + }); + downloadFile(`学生名单.xlsx`, blob); + } else { + this.$message.error("下载失败"); + } + }, }, }; @@ -565,7 +600,7 @@ export default { } .form-box { .subject-box { - padding-right:50px; + padding-right: 50px; max-height: 90px; overflow: hidden; position: relative; diff --git a/src/views/personal/userInfo/index.vue b/src/views/personal/userInfo/index.vue index 11cdf1b..38d1ead 100644 --- a/src/views/personal/userInfo/index.vue +++ b/src/views/personal/userInfo/index.vue @@ -8,30 +8,20 @@
+
  • 学校名称: - {{ school.schoolName || "--" }} -
  • -
  • - 授课端管理密码: - {{ school.managePwd || "--" }} + {{ Info.tenantName || "--" }}
  • 教师姓名: - {{ school.contactPerson || "--" }} + {{ Info.contactPerson || "--" }}
  • 手机号码: - {{ school.contactPhone || "--" }} -
  • -
  • - 科目: - {{ - school.sections | getSections(school.sections) - }} + {{ Info.contactPhone || "--" }}
  • -
@@ -43,16 +33,14 @@ :rules="rulesSchool" label-width="160px" > - - - - - + 确 定
取 消 - + + + + + + + + +