diff --git a/src/api/apis/apis.js b/src/api/apis/apis.js index 3860fda..337c971 100644 --- a/src/api/apis/apis.js +++ b/src/api/apis/apis.js @@ -8,11 +8,11 @@ const defaltService = (url, data) => { data, }); }; -const defaltGetService = (url, data) => { +const defaltGetService = (url, params) => { return service({ url: url, - method: "Get", - data, + method: "GET", + params, }); }; const downService = (url, data) => { @@ -193,6 +193,35 @@ export default { tPaperDetail(data) { return defaltService(setUpUrls.tPaperDetail, data); }, + tPaperDownload(paperId, title) { + return new Promise((resolve, reject) => { + service({ + method: "get", + url: setUpUrls.tPaperDownload + "?id=" + paperId, // 请求地址 + responseType: "blob" // 表明返回服务器返回的数据类型 + }).then( + (response) => { + resolve(response); + console.log(response) + let fileName = title + ".docx"; + if (window.navigator.msSaveOrOpenBlob) { + navigator.msSaveBlob(response, fileName); + } else { + let link = document.createElement("a"); + link.href = window.URL.createObjectURL(response); + link.download = fileName; + link.click(); + window.URL.revokeObjectURL(link.href); + } + }, + (err) => { + reject(err); + } + ); + }); + + // return defaltGetService(setUpUrls.tPaperDownload + "?id=" + paperId); + }, //任课老师-查询管理班级授课科目 tSubjectList(data) { return defaltService(setUpUrls.tSubjectList, data); diff --git a/src/api/urls/apis.js b/src/api/urls/apis.js index 1863662..12ccdee 100644 --- a/src/api/urls/apis.js +++ b/src/api/urls/apis.js @@ -78,6 +78,7 @@ export default { tTestExamReport: "/api_html/teaching/testExamReport", //任课老师-查询答题卡详情 tPaperDetail: "/api_html/teaching/paperDetail", + tPaperDownload: "/api_html/teaching/wrongQuestion/download", //任课老师-查询管理班级授课科目 tSubjectList: "/api_html/teaching/subjectList", tListExamReport: "/api_html/teaching/listExamReport", @@ -505,7 +506,7 @@ export default { // 获取年级信息 teacherClassList: "api_html/teaching/classList", // 获取班级信息 - teacherGradeList: "api_html/teaching/grade", + teacherGradeList: "api_html/teaching/gradeByTeacher", // 保存接口 getWrongQuestionSave: "api_html/teaching/wrongQuestion/save", }; diff --git a/src/assets/images/aside/wrong-question-default.png b/src/assets/images/aside/wrong-question-default.png new file mode 100644 index 0000000..93e6849 --- /dev/null +++ b/src/assets/images/aside/wrong-question-default.png diff --git a/src/assets/images/aside/wrong-question.png b/src/assets/images/aside/wrong-question.png new file mode 100644 index 0000000..7543ea6 --- /dev/null +++ b/src/assets/images/aside/wrong-question.png diff --git a/src/router/index.js b/src/router/index.js index 456cb56..18fc709 100755 --- a/src/router/index.js +++ b/src/router/index.js @@ -346,8 +346,8 @@ let addrouters = [ }, { path: "/wrongQuestion", - iconImage: require("@/assets/images/aside/suitangwen-baobiao-default.png"), - selectedIconImage: require("@/assets/images/aside/suitangwen-baobiao-selected.png"), + iconImage: require("@/assets/images/aside/wrong-question-default.png"), + selectedIconImage: require("@/assets/images/aside/wrong-question.png"), name: "错题组卷", demoRoles: ["ROLE_JIAOSHI"], component: wrongQuestion, diff --git a/src/utils/index.js b/src/utils/index.js index 2624b57..7391166 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -614,13 +614,18 @@ export function getBlob(url) { }); } export function fetchHTML(url) { - var xhr = new XMLHttpRequest(); - xhr.open("GET", url, false); - xhr.send(); - if (xhr.status === 200) { - return xhr.responseText; - } else { - return null; + try { + var xhr = new XMLHttpRequest(); + xhr.open("GET", url, false); + xhr.send(); + if (xhr.status === 200) { + return xhr.responseText; + } else { + return ""; + } + } + catch (e) { + return ""; } } /** @@ -990,7 +995,6 @@ export function paperPrint(paper) { // size: A4 portrait; // size: A3 landscape; - printWin.document.title = "中天易教"; const style = printWin.document.createElement('style'); style.innerHTML = ` @media print @@ -998,7 +1002,7 @@ export function paperPrint(paper) { @page { size: A4 portrait; margin-top:0mm; - margin-bottom:10mm; + margin-bottom:8.5mm; margin-left:4mm; margin-right:4mm; } diff --git a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue index 80c1d28..60423dc 100644 --- a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue +++ b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue @@ -37,6 +37,11 @@ style="padding: 0 200px" /> +
+
班级:_____________
+
姓名:_____________
+
学号:_____________
+
@@ -95,7 +100,7 @@ left: tooltipPosition.x + 'px', }" > - 单击设置试卷标题 + 单击修改大题名称
- 保存试卷 - 保存并打印
-
+
题目排序 - (拖拽题号可拖拽排序)(拖拽题号可排序)
@@ -202,7 +215,10 @@ v-model="group.questionScore" :min="1" :max="30" - style="width: 100px" + style="width: 120px" + :precision="1" + :step="0.5" + @change="handleInput" >
@@ -232,7 +248,6 @@ @@ -739,9 +840,9 @@ export default { .test { flex: 1; height: fit-content; - max-height: 742px; + height: 742px; overflow-y: auto; - box-shadow: 0 0 10px 0 #999999; + box-shadow: 0 0 10px 0 #cfcfcf; margin-right: 20px; box-sizing: border-box; padding: 0 20px; @@ -763,13 +864,17 @@ export default { justify-content: space-around; align-items: center; } - + .binding { + display: flex; + padding: 20px 80px; + justify-content: space-around; + } .test-group { .test-group-title { position: relative; height: 40px; - line-height: 30px; - padding: 10px 0 0 0; + line-height: 40px; + padding: 0; } } } @@ -782,7 +887,8 @@ export default { .edit-title { width: 100%; height: 200px; - border: 1px solid #999999; + border: 1px solid #cfcfcf; + border-radius: 5px; .edit-title-info { height: 60px; @@ -814,11 +920,12 @@ export default { .edit-info { flex: 1; - border: 1px solid #999999; + border: 1px solid #cfcfcf; margin-top: 20px; max-height: 500px; padding: 10px; overflow: auto; + border-radius: 5px; .group-item { margin: 10px; @@ -831,20 +938,21 @@ export default { height: 40px; justify-content: space-between; cursor: pointer; + padding: 0 10px; } } .questions { display: flex; flex-wrap: wrap; - + padding: 10px 0; .question-item { width: 35px; height: 35px; border: 1px solid rgb(172, 188, 249); border-radius: 4px; cursor: grab; - margin: 5px 8px; + margin: 0 10px 10px 10px; line-height: 35px; text-align: center; font-size: 16px !important; @@ -881,6 +989,7 @@ export default { .border { border: 1px solid rgb(173, 190, 250); position: relative; + border-radius: 3px; .border-del { position: absolute; @@ -893,7 +1002,7 @@ export default { color: rgb(67, 141, 255); font-size: 14px !important; line-height: 28px; - font-weight: 600; + cursor: pointer; } } @@ -918,9 +1027,16 @@ export default { background: rgb(233, 237, 253); width: fit-content; } +.borderTitle { + background: rgba(102, 127, 253, 0.1); + padding: 0; +} .title-bg { background: rgb(115, 142, 246); border-bottom: 1px solid rgb(115, 142, 246); } - \ No newline at end of file +.font-weight { + font-weight: 400; +} + diff --git a/src/views/basic/askTestQuestion/index.vue b/src/views/basic/askTestQuestion/index.vue index c5e639b..c621fc8 100644 --- a/src/views/basic/askTestQuestion/index.vue +++ b/src/views/basic/askTestQuestion/index.vue @@ -72,6 +72,8 @@ @click.native="_detailQ(item.id)">查看 打印 + 下载 修改 复制 @@ -658,7 +660,12 @@ export default { } paperPrint(data); this.$loading.close(); - }) + }) + }, + async _download(item) { + this.$loading.open(); + await this.$request.tPaperDownload(item.id, item.title); + this.$loading.close(); }, _updateQ(item) { diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index 80060fd..1f0020f 100644 --- a/src/views/basic/askTestQuestion/wrongQuestion.vue +++ b/src/views/basic/askTestQuestion/wrongQuestion.vue @@ -1,7 +1,13 @@