From ce278878fa648b5eb3b4234899cef29c6f957f4a Mon Sep 17 00:00:00 2001 From: 梁保满 Date: Fri, 2 Feb 2024 17:29:44 +0800 Subject: [PATCH] 2-2 bugfix --- src/api/apis/apis.js | 3 ++- src/api/axios.js | 1 - src/api/urls/apis.js | 34 +--------------------------------- src/components/charts/lineChart.vue | 8 +++++++- src/components/exportDia.vue | 2 +- src/router/index.js | 14 +++++++------- src/store/index.js | 5 +++++ src/views/basic/ask/analysis.vue | 42 +++++++++++++++++------------------------- src/views/basic/ask/components/answerQustion.vue | 343 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------------------------------------------------------------------------------------------------------- src/views/basic/ask/components/example.vue | 3 +-- src/views/basic/setUp/teacher.vue | 12 ++++++++++-- src/views/basic/test/components/multipleSubTest.vue | 10 ++++++---- src/views/basic/test/components/multipleTest.vue | 10 ++++++---- src/views/basic/test/components/test.vue | 21 +++------------------ src/views/examinationPaper/add.vue | 59 +++++++++++++++++++++++++++-------------------------------- src/views/examinationPaper/addAsk.vue | 1363 ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- src/views/examinationPaper/addQs.vue | 1332 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ src/views/examinationPaper/edit.vue | 26 +++++++------------------- src/views/examinationPaper/index.vue | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++++--------- 19 files changed, 1717 insertions(+), 1632 deletions(-) delete mode 100644 src/views/examinationPaper/addAsk.vue create mode 100644 src/views/examinationPaper/addQs.vue diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index a0d5e8d..17b39bf 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -1653,7 +1653,8 @@ export default { return service({ url: setUpUrls.tClassAndStudentTemplate, method: "POST", - data + data, + responseType: 'arraybuffer', }); }, //教学班班级名册导出 diff --git a/src/api/axios.js b/src/api/axios.js index 01247b5..89387b9 100644 --- a/src/api/axios.js +++ b/src/api/axios.js @@ -29,7 +29,6 @@ service.interceptors.request.use( config.headers.manager = 1 config.headers.classes = classes } - console.log(config) return config; }, (error) => { diff --git a/src/api/urls/apis.js b/src/api/urls/apis.js index d013f3c..aeeadff 100644 --- a/src/api/urls/apis.js +++ b/src/api/urls/apis.js @@ -364,9 +364,6 @@ export default { // 载指定版本授课端 pGetAppDownloadUrl: "/api_html/personal/getAppDownloadUrl", - //导出随堂问单科多课时报表 - pExportPhaseAnswerReport: "/api_html/personal/exportPhaseAnswerReport", - // 修改密码 changePwd: "/api_html/changePwd", @@ -409,6 +406,7 @@ export default { // 删除班级信息 removeClass: "/api_html/school/manager/delClass", + //删除即时测考试 deleteReport: "/api_html/teaching/deleteReport", //设置单班科目分析低分区间 @@ -419,34 +417,4 @@ export default { exportExamMultiReport: "/api_html/teaching/exportExamMultiReport", //查询即时测多班默认等级列表 defaultLevels: "/api_html/teaching/defaultLevels", - - - - /** v1.5 */ - // 教师/个人版导入备题组卷Word文档 - paperWordUpload: "/api_html/common/paper/upload", - // 删除随堂问报表 - deletePaperReport: "/api_html/teaching/deletePaperReport", - // 删除基站 - deleteStation: "/api_html/school/manager/deleteStation", - // 导出授课端日志 - downloadDeviceLog: "/api_html/school/manager/downloadDeviceLog", - // 教学班班级名册模板下载 - tClassAndStudentTemplate: "/api_html/school/manager/tClassAndStudentTemplate", - // 教学班班级名册导出 - exportTClassAndStudent: "/api_html/school/manager/exportTClassAndStudent", - // 删除班级信息(新) - deleteClass: "/api_html/school/manager/deleteClass", - // 清除老师下所有关联班级 - clearTeacherClasses: "/api_html/school/manager/clearTeacherClasses", - - // 下载即时测导入分数模板 - scoreTemplate: "/api_html/teaching/scoreTemplate", - // 导入即时测报表分数 - importScore: "/api_html/teaching/importScore", - // 获取即时测报表学生名单和题目列表 - listStudentsAndQuestions: "/api_html/teaching/listStudentsAndQuestions", - // 提交即时测报表分数 - submitScore: "/api_html/teaching/submitScore", - } diff --git a/src/components/charts/lineChart.vue b/src/components/charts/lineChart.vue index 1ef9ff9..cc42c99 100644 --- a/src/components/charts/lineChart.vue +++ b/src/components/charts/lineChart.vue @@ -10,7 +10,8 @@ export default { params: Array, xAxis: Array, colors: Array, - formatterYAxis: true + formatterYAxis: true, + tooltipFormatter:false }, watch: { params: { @@ -40,6 +41,11 @@ export default { tooltip: { trigger: "item", confine: true, + formatter(v) { + let html = `

${v.seriesName}

` + html += `${v.marker} ${v.name}:${v.value}${that.tooltipFormatter?'%':''}` + return html + }, }, legend: { show: true, diff --git a/src/components/exportDia.vue b/src/components/exportDia.vue index 8468471..30bb64c 100644 --- a/src/components/exportDia.vue +++ b/src/components/exportDia.vue @@ -92,7 +92,7 @@ export default { return item.studentId }) } - this.$emit('exportData', studentIds) + this.$emit('exportData', this.downType==1?null:studentIds) }, cancel() { if (this.exportType == 2) { diff --git a/src/router/index.js b/src/router/index.js index 51ed0fb..340ac50 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -9,7 +9,7 @@ import HomeMain from "@/views/index/mainIndex" const NotFound = () => import("@/views/page404") const ExaminationPaper = () => import("@/views/examinationPaper/index") const ExaminationPaperAdd = () => import("@/views/examinationPaper/add") -const ExaminationPaperAddAsk = () => import("@/views/examinationPaper/addAsk") +const ExaminationPaperAddQs = () => import("@/views/examinationPaper/addQs") const ExaminationPaperEdit = () => import("@/views/examinationPaper/edit") const ExaminationPaperRecycle = () => import("@/views/examinationPaper/recycle") const ExaminationPaperArchiving = () => import("@/views/examinationPaper/archiving") @@ -169,10 +169,10 @@ let addrouters = [ children: [] }, { - path: "/examinationPaperAddAsk", + path: "/examinationPaperAddQs", iconCls: "", // 图标样式class - name: "examinationPaperAddAsk", - component: ExaminationPaperAddAsk, + name: "examinationPaperAddQs", + component: ExaminationPaperAddQs, parent: "examinationPaper", children: [] }, @@ -810,10 +810,10 @@ const addroutersPersonal = [ children: [] }, { - path: "/examinationPaperAddAsk", + path: "/examinationPaperAddQs", iconCls: "", - name: "examinationPaperAddAsk", - component: ExaminationPaperAddAsk, + name: "examinationPaperAddQs", + component: ExaminationPaperAddQs, parent: "examinationPaper", children: [] }, diff --git a/src/store/index.js b/src/store/index.js index bb2260c..6dc062e 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -26,6 +26,7 @@ const store = new Vuex.Store({ : [], //动态路由 tokenSources: new Map(), //正在请求接口(切换取消请求) classes: localStorage.getItem("classes") || "", //班主任选择班级查询报表(用于教学班学生筛选) + refreshTestList: false, //重新计分刷新列表 }, mutations: { setToken(state, token) { @@ -75,6 +76,9 @@ const store = new Vuex.Store({ setClasses(state, data) { state.classes = data; localStorage.setItem("classes", data); + }, + setRefreshTestList(state, data) { + state.refreshTestList = data; } }, actions: { @@ -206,6 +210,7 @@ const store = new Vuex.Store({ uniquerouter: (state) => state.layoutStore.uniquerouter, tabnavBox: (state) => state.layoutStore.tabnavBox, rightNav: (state) => state.layoutStore.rightNav, + refreshTestList: (state) => state.refreshTestList, }, modules: { layoutStore, diff --git a/src/views/basic/ask/analysis.vue b/src/views/basic/ask/analysis.vue index d18fac6..e9c87ce 100644 --- a/src/views/basic/ask/analysis.vue +++ b/src/views/basic/ask/analysis.vue @@ -103,7 +103,7 @@ export default { this.id = JSON.parse(this.$route.query.id) this.status = this.$route.query.status ? this.$route.query.status : 0; this._QueryData(); - this._QueryDataQuestionRank(); + this.types != 1 ?this._QueryDataQuestionRank():''; this.types != 3 ? this.periodDetail() : ''; }, methods: { @@ -209,13 +209,7 @@ export default { }); this.loading = false; if (status === 0) { - if (this.type == 2) { - this.tableData = data?.list || [] - } else { - this.tableData = data?.list.sort((a, b) => { - return a.questionIndex - b.questionIndex; - }); - } + this.tableData = data?.list || [] this.total = data.count; } else { this.$message.error(info); @@ -224,22 +218,13 @@ export default { async _QueryDataQuestionRank() { let queryData; let query = {}; - if (this.types == 1) { - if (this.role == "ROLE_PERSONAL") { - queryData = this.$request.pPeriodStudentReport - } else { - queryData = this.$request.periodStudentReport - } - query.type = this.type - 1 - query.periodId = this.id[0] - } else { + query.periodIds = this.id if (this.types == 2) { queryData = this.$request.phaseAnswerReport } else if (this.types == 3) { queryData = this.$request.cTPhaseAnswerReport } - } if (this.types != 1) { query.classId = this.classId } @@ -249,6 +234,7 @@ export default { ...query, }); this.loading = false; + console.log(data) if (status === 0) { this.exportStudent = data?.list && [...data?.list] || [] } else { @@ -268,16 +254,21 @@ export default { this.exportLoading = true; let studentIds = arr let query = {}; - if (studentIds.length > 0) { - query.studentIds = studentIds - } else { - query.studentIds = [] + if(studentIds != null){ + if (studentIds.length > 0) { + query.studentIds = studentIds + } else { + query.studentIds = [] + } } let exportPeriodReport = "" - if (this.id.length == 1) { + if (this.types == 1) { query.periodId = this.id[0] - exportPeriodReport = this.role == "ROLE_PERSONAL" ? this.$request.pExportPhaseAnswerReport : this.$request.exportPeriodReport - } else { + exportPeriodReport = this.role == "ROLE_PERSONAL" ? this.$request.pExportPeriodReport : this.$request.exportPeriodReport + } else if(this.types == 2){ + query.periodIds = this.id + exportPeriodReport = this.role == "ROLE_PERSONAL" ?this.$request.pExportPhaseAnswerReport:this.$request.exportPhaseAnswerReport + }else{ query.periodIds = this.id exportPeriodReport = this.$request.cTExportPhaseAnswerReport } @@ -287,6 +278,7 @@ export default { }); this.exportLoading = false; if (data) { + this.cancel() let blob = new Blob([data], { type: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", }); diff --git a/src/views/basic/ask/components/answerQustion.vue b/src/views/basic/ask/components/answerQustion.vue index 31b83e6..bcb1647 100644 --- a/src/views/basic/ask/components/answerQustion.vue +++ b/src/views/basic/ask/components/answerQustion.vue @@ -1,22 +1,68 @@ - \ No newline at end of file diff --git a/src/views/examinationPaper/addQs.vue b/src/views/examinationPaper/addQs.vue new file mode 100644 index 0000000..4ef7cb3 --- /dev/null +++ b/src/views/examinationPaper/addQs.vue @@ -0,0 +1,1332 @@ + + + + + + \ No newline at end of file diff --git a/src/views/examinationPaper/edit.vue b/src/views/examinationPaper/edit.vue index d473a1f..e5b9a07 100644 --- a/src/views/examinationPaper/edit.vue +++ b/src/views/examinationPaper/edit.vue @@ -80,11 +80,7 @@
- - +

重新选择图片

@@ -95,12 +91,8 @@
- -

重新选择图片

@@ -281,14 +273,9 @@ - - {{ - stem.screenshot && !stem.screenshot.includes('html') ? "重新上传" : "选择照片" - }} - {{ - stem.answerScreenshot && !stem.answerScreenshot.includes('html') ? "重新上传" : "选择照片" - }} + + 选择照片
@@ -364,7 +351,8 @@ export default { answerScreenshot: "", //题目解析图片地址 knowledge: [], //知识点 }, - gradeClassList: [] //学段列表 + gradeClassList: [], //学段列表 + uploadUrl: "/file/uploadImgToHtml" }; }, computed: { diff --git a/src/views/examinationPaper/index.vue b/src/views/examinationPaper/index.vue index ae10f6d..04e8234 100644 --- a/src/views/examinationPaper/index.vue +++ b/src/views/examinationPaper/index.vue @@ -39,7 +39,10 @@ - + + {{ item.label }} + + @@ -101,7 +104,7 @@ 修改分享范围 - 复制 + 复制 放入回收站 @@ -168,12 +171,14 @@ export default { query: { classId: "", subjectName: "", + tagId: "", title: "", type: 1, //试卷类型 share: 0, //分享类型 }, classList: [], subjectList: [], + typeList: [], archivedTotal: 0, //已归档答题卡数量 tableData: [], shareForm: { @@ -213,6 +218,7 @@ export default { if (!this.query.classId) { return; } + this._QueryTypeList() await this._QuerySubjectList(); this._QueryData(); }, @@ -228,7 +234,7 @@ export default { path: "/examinationPaperArchiving", }); }, - //去备题 + //去组卷 toAdd(query) { if (!this.query.classId) { this.$message.warning("没有任课班级,请先设置。"); @@ -240,18 +246,19 @@ export default { ...query, listType: this.query.type, listShare: this.query.share, + subjectName: this.query.subjectName } }; this.$router.push(routerItem); }, - //去组卷 - toAddAsk(query) { + //去备题 + toAddQs(query) { if (!this.query.classId) { this.$message.warning("没有任课班级,请先设置。"); return; } let routerItem = { - path: "/examinationPaperAddAsk", + path: "/examinationPaperAddQs", query: { ...query, listType: this.query.type, @@ -280,7 +287,11 @@ export default { break; case 2: //复制 - that.toAdd({ type: 2, paperId: item.id }); + if (that.type == 2) { + that.toAdd({ type: 2, paperId: item.id }); + } else { + that.toAddQs({ type: 2, paperId: item.id }); + } break; case 3: //归档 @@ -290,8 +301,8 @@ export default { }, changPaperType(type) { this.query.type = type + this.query.tagId = "" this.changShare(0) - }, changePage(page) { this.page = page; @@ -339,6 +350,9 @@ export default { //切换班级 async changClazz() { this.page = 1; + if (this.query.type == 2) { + await this._QueryTypeList() + } await this._QuerySubjectList(); this._QueryData(false); }, @@ -418,6 +432,35 @@ export default { this.$message.error(info); } }, + // 查找答题卡类型 + async _QueryTypeList() { + if (!this.query.classId) return; + let fetchTypeNames = + this.role == "ROLE_PERSONAL" + ? this.$request.pPaperTagList + : this.$request.fetchTypeNames; + + const { data, status, info } = await fetchTypeNames({ + classId: this.query.classId, + type: 0, + }); + if (status === 0) { + this.typeList = + data.list.map((item) => { + return { + value: item.tagId, + label: item.tag, + }; + }) || []; + this.typeList.unshift({ + value: "", + label: "请选择标签", + }); + this.query.tagId = "" + } else { + this.$message.error(info); + } + }, async _QueryData(type) { if (!this.query.classId) return; this.loading = true; @@ -479,7 +522,7 @@ export default { if (this.query.type == 2) { this.toAdd({ params, isUpload: 1 }) } else { - this.toAddAsk({ params }) + this.toAddQs({ params }) } } }, -- libgit2 0.21.4