From 707e739922fbb53f8f6ee9947ffa53014c7fc5b4 Mon Sep 17 00:00:00 2001 From: yujialong <479214531@qq.com> Date: Tue, 19 Jan 2021 16:11:46 +0800 Subject: [PATCH] . --- package-lock.json | 144 ++++++++- package.json | 1 + src/api/index.js | 6 +- src/components/doReview/index.vue | 42 ++- src/components/pdf/index.vue | 124 ++++++++ src/libs/util.js | 5 + src/mixins/file/index.js | 70 +++++ src/pages/achievement/detail/index.vue | 291 ----------------- src/pages/achievement/list/examResults.vue | 4 +- src/pages/achievement/statistics/index.vue | 75 ++++- src/pages/assessment/detail/index.vue | 81 +++-- src/pages/assessment/doReview/index.vue | 343 +++++++++++++++++++++ src/pages/assessment/review/index.vue | 4 +- src/pages/assessment/scoreQuery/index.vue | 2 +- src/pages/practice/detail/index.vue | 33 +- src/pages/practice/doReview/index.vue | 43 ++- src/pages/quesBank/list/myQuesBank.vue | 3 +- src/pages/system/list/role.vue | 266 +--------------- src/pages/testPaper/add/index.vue | 2 + src/pages/testPaper/list/myTestPaper.vue | 4 +- src/router/modules/achievement.js | 6 - src/router/modules/assessment.js | 18 +- src/router/modules/testPaper.js | 5 - src/setting.js | 9 +- 24 files changed, 958 insertions(+), 623 deletions(-) create mode 100644 src/components/pdf/index.vue create mode 100644 src/mixins/file/index.js delete mode 100644 src/pages/achievement/detail/index.vue create mode 100644 src/pages/assessment/doReview/index.vue diff --git a/package-lock.json b/package-lock.json index 066a91e..e7c3b43 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1039,8 +1039,7 @@ "@types/json-schema": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", - "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", - "dev": true + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==" }, "@types/minimatch": { "version": "3.0.3", @@ -1597,8 +1596,7 @@ "ajv-keywords": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.4.1.tgz", - "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==", - "dev": true + "integrity": "sha512-RO1ibKvd27e6FEShVFfPALuHI3WjSVNeK5FIsmme/LYRNxjKuNj+Dt7bucLa6NdSv3JcVTyMlm9kGR84z1XpaQ==" }, "alphanum-sort": { "version": "1.0.2", @@ -2099,6 +2097,11 @@ "resolve": "^1.4.0" } }, + "babel-plugin-syntax-dynamic-import": { + "version": "6.18.0", + "resolved": "https://registry.npmjs.org/babel-plugin-syntax-dynamic-import/-/babel-plugin-syntax-dynamic-import-6.18.0.tgz", + "integrity": "sha1-jWomIpyDdFqZgqRBBRVyyqF5sdo=" + }, "babel-polyfill": { "version": "6.26.0", "resolved": "https://registry.npmjs.org/babel-polyfill/-/babel-polyfill-6.26.0.tgz", @@ -9332,6 +9335,11 @@ "sha.js": "^2.4.8" } }, + "pdfjs-dist": { + "version": "2.5.207", + "resolved": "https://registry.npmjs.org/pdfjs-dist/-/pdfjs-dist-2.5.207.tgz", + "integrity": "sha512-xGDUhnCYPfHy+unMXCLCJtlpZaaZ17Ew3WIL0tnSgKFUZXHAPD49GO9xScyszSsQMoutNDgRb+rfBXIaX/lJbw==" + }, "performance-now": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", @@ -10435,6 +10443,71 @@ "unpipe": "1.0.0" } }, + "raw-loader": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/raw-loader/-/raw-loader-4.0.2.tgz", + "integrity": "sha512-ZnScIV3ag9A4wPX/ZayxL/jZH+euYb6FcUinPcgiQW0+UBtEv0O6Q3lGd3cqJ+GHH+rksEv3Pj99oxJ3u3VIKA==", + "requires": { + "loader-utils": "^2.0.0", + "schema-utils": "^3.0.0" + }, + "dependencies": { + "ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "requires": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ajv-keywords": { + "version": "3.5.2", + "resolved": "https://registry.npmjs.org/ajv-keywords/-/ajv-keywords-3.5.2.tgz", + "integrity": "sha512-5p6WTN0DdTGVQk6VjcEju19IgaHudalcfabD7yhDGeA6bcQnmL+CpveLJq/3hvfwd1aof6L386Ougkx6RfyMIQ==" + }, + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" + }, + "fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==" + }, + "json5": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", + "requires": { + "minimist": "^1.2.5" + } + }, + "loader-utils": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", + "integrity": "sha512-rP4F0h2RaWSvPEkD7BLDFQnvSf+nK+wr3ESUjNTyAGobqrijmW92zc+SO6d4p4B1wh7+B/Jg1mkQe5NYUEHtHQ==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^2.1.2" + } + }, + "schema-utils": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-3.0.0.tgz", + "integrity": "sha512-6D82/xSzO094ajanoOSbe4YvXWMfn2A//8Y1+MUqFAJul5Bs+yn36xbK9OtNDcRVSBJ9jjeoXftM6CfztsjOAA==", + "requires": { + "@types/json-schema": "^7.0.6", + "ajv": "^6.12.5", + "ajv-keywords": "^3.5.2" + } + } + } + }, "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", @@ -12807,6 +12880,44 @@ "vue-style-loader": "^4.1.0" } }, + "vue-pdf": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/vue-pdf/-/vue-pdf-4.2.0.tgz", + "integrity": "sha512-GpAbZfM48Hom1R8f4XL5ZzoVBLlbyy+4z0VYmTQORVOSieVIIu+XtnNl0RY6EXg60Qni6T6nIgrmsCcCkWv39A==", + "requires": { + "babel-plugin-syntax-dynamic-import": "^6.18.0", + "loader-utils": "^1.4.0", + "pdfjs-dist": "^2.5.207", + "raw-loader": "^4.0.1", + "vue-resize-sensor": "^2.0.0", + "worker-loader": "^2.0.0" + }, + "dependencies": { + "emojis-list": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-3.0.0.tgz", + "integrity": "sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q==" + }, + "json5": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", + "requires": { + "minimist": "^1.2.0" + } + }, + "loader-utils": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.4.0.tgz", + "integrity": "sha512-qH0WSMBtn/oHuwjy/NucEgbx5dbxxnxup9s4PVXJUDHZBQY+s0NWA9rJf53RBnQZxfch7euUui7hpoAPvALZdA==", + "requires": { + "big.js": "^5.2.2", + "emojis-list": "^3.0.0", + "json5": "^1.0.1" + } + } + } + }, "vue-quill-editor": { "version": "3.0.6", "resolved": "https://registry.npmjs.org/vue-quill-editor/-/vue-quill-editor-3.0.6.tgz", @@ -12816,6 +12927,11 @@ "quill": "^1.3.4" } }, + "vue-resize-sensor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/vue-resize-sensor/-/vue-resize-sensor-2.0.0.tgz", + "integrity": "sha512-W+y2EAI/BxS4Vlcca9scQv8ifeBFck56DRtSwWJ2H4Cw1GLNUYxiZxUHHkuzuI5JPW/cYtL1bPO5xPyEXx4LmQ==" + }, "vue-router": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.1.3.tgz", @@ -13389,6 +13505,26 @@ "errno": "~0.1.7" } }, + "worker-loader": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/worker-loader/-/worker-loader-2.0.0.tgz", + "integrity": "sha512-tnvNp4K3KQOpfRnD20m8xltE3eWh89Ye+5oj7wXEEHKac1P4oZ6p9oTj8/8ExqoSBnk9nu5Pr4nKfQ1hn2APJw==", + "requires": { + "loader-utils": "^1.0.0", + "schema-utils": "^0.4.0" + }, + "dependencies": { + "schema-utils": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/schema-utils/-/schema-utils-0.4.7.tgz", + "integrity": "sha512-v/iwU6wvwGK8HbU9yi3/nhGzP0yGSuhQMzL6ySiec1FSrZZDkhm4noOSWzrNFo/jEc+SJY6jRTwuwbSXJPDUnQ==", + "requires": { + "ajv": "^6.1.0", + "ajv-keywords": "^3.1.0" + } + } + } + }, "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", diff --git a/package.json b/package.json index b7c4a64..c25b1ab 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "vue": "^2.6.10", "vue-cropperjs": "^3.0.0", "vue-i18n": "^8.10.0", + "vue-pdf": "^4.2.0", "vue-quill-editor": "^3.0.6", "vue-router": "^3.0.3", "vue-schart": "^2.0.0", diff --git a/src/api/index.js b/src/api/index.js index 47157c2..ac2f19d 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -1,5 +1,5 @@ import Setting from '@/setting' -let uploadURL = Setting.apiUploadURL +let uploadURL = Setting.upload.apiURL export default { // 登录  logins: `management/userInfo/login`, @@ -166,7 +166,9 @@ export default { savepaperRecord:`management/paperRecord/save`, teacherByGetAchievement:`management/paperRecord/teacherByGetAchievement`, achievementStatistics:`/management/paperRecord/achievementStatistics`, - exportAssessment:`/management/paperRecord/export`, + exportAssessment:`${Setting.apiBaseURL}/management/paperRecord/export`, + getRanking:`/management/paperRecord/getRanking`, + getRankingExport:`${Setting.apiBaseURL}/management/paperRecord/getRankingExport`, // 留言板 delComment:`/management/messageBoard/delComment`, diff --git a/src/components/doReview/index.vue b/src/components/doReview/index.vue index 0b2bce6..13d6cf3 100644 --- a/src/components/doReview/index.vue +++ b/src/components/doReview/index.vue @@ -43,6 +43,13 @@ 知识点: {{item.knowledge_points}} +
+

附件:

+
+ {{item.fileName}} + 下载 +
+
答案解析: {{item.answer_analysis}} @@ -66,13 +73,22 @@
+ +
+
+ +
+
+ + \ No newline at end of file diff --git a/src/libs/util.js b/src/libs/util.js index 37d0731..acb054d 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -73,6 +73,11 @@ const util = { if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true return false }, + // 传入文件后缀判断是否是pdf以外的文档 + isDoc(ext) { + if(!util.isVideo(ext) && !util.isAudio(ext) && !util.isImg(ext) && ext != 'pdf') return true + return false + }, // 循环去除html标签 removeHtmlTag(list,attr) { list.map(n => { diff --git a/src/mixins/file/index.js b/src/mixins/file/index.js new file mode 100644 index 0000000..2cda996 --- /dev/null +++ b/src/mixins/file/index.js @@ -0,0 +1,70 @@ +import util from '@/libs/util' +export default { + data() { + return { + playAuth: '', + player: null, + iframeSrc: '', + pdfVisible: false, + pdfSrc: '' + } + }, + mounted() { + this.insertScript() + }, + methods: { + preview(row){ + let ext = row.fileurl.substring(row.fileurl.lastIndexOf('.') + 1) + console.log(11,row.fileurl,row.fileurl.lastIndexOf('.'),ext) + if(row.videoAudio){ + this.$get(`${this.api.getPlayAuth}/${row.fileurl}`).then(res => { + this.playAuth = res.data.playAuth + if(this.player){ + this.player.replayByVidAndPlayAuth(row.fileurl,this.playAuth) + }else{ + console.log(11,row,res.data.playAuth) + this.player = new Aliplayer({ + id: 'player', + width: '100%', + autoplay: false, + vid : row.fileurl, + playauth : this.playAuth, + encryptType:1, //当播放私有加密流时需要设置。 + }) + } + }).catch(res => {}) + }else if(ext == 'pdf'){ + this.pdfSrc = row.fileurl + this.pdfVisible = true + }else if(util.isDoc(ext)){ + window.open(`https://view.officeapps.live.com/op/view.aspx?src=${row.fileurl}`) + }else if(util.isImg(ext)){ + window.open(row.fileurl) + } + }, + insertScript(){ + const linkTag = document.createElement('link') + linkTag.id = 'aliplayerLink' + linkTag.rel = 'stylesheet' + linkTag.href = 'https://g.alicdn.com/de/prismplayer/2.8.2/skins/default/aliplayer-min.css' + document.body.appendChild(linkTag) + + const scriptTag = document.createElement('script') + scriptTag.id = 'aliplayerScript' + scriptTag.type = 'text/javascript' + scriptTag.src = 'https://g.alicdn.com/de/prismplayer/2.8.2/aliplayer-min.js' + document.body.appendChild(scriptTag) + this.$once('hook:beforeDestroy', function () { + document.body.removeChild(document.querySelector('#aliplayerLink')) + document.body.removeChild(document.querySelector('#aliplayerScript')) + }) + }, + closePlayer(){ + this.playAuth = '' + this.player.pause() + }, + download(row){ + window.open(row.fileurl) + } + } +} \ No newline at end of file diff --git a/src/pages/achievement/detail/index.vue b/src/pages/achievement/detail/index.vue deleted file mode 100644 index de8a429..0000000 --- a/src/pages/achievement/detail/index.vue +++ /dev/null @@ -1,291 +0,0 @@ - - - - \ No newline at end of file diff --git a/src/pages/achievement/list/examResults.vue b/src/pages/achievement/list/examResults.vue index 17db4f0..7a4be56 100644 --- a/src/pages/achievement/list/examResults.vue +++ b/src/pages/achievement/list/examResults.vue @@ -183,7 +183,7 @@ export default { stuId: row.stuId, thisScore: row.thisScore }) - this.$router.push('detail') + this.$router.push('/assessment/detail') }, toStat(){ if(this.listData.length){ @@ -202,7 +202,7 @@ export default { } }, exportData(){ - location.href = `${Setting.apiBaseURL}${this.api.exportAssessment}?assessmentId=${this.assessmentId}&classId=${this.classId}&userId=${this.userId}` + location.href = `${this.api.exportAssessment}?assessmentId=${this.assessmentId}&classId=${this.classId}&userId=${this.userId}` }, } }; diff --git a/src/pages/achievement/statistics/index.vue b/src/pages/achievement/statistics/index.vue index 7413ca8..9633de3 100644 --- a/src/pages/achievement/statistics/index.vue +++ b/src/pages/achievement/statistics/index.vue @@ -1,5 +1,6 @@ + + \ No newline at end of file diff --git a/src/pages/assessment/review/index.vue b/src/pages/assessment/review/index.vue index fe6e369..de6c114 100644 --- a/src/pages/assessment/review/index.vue +++ b/src/pages/assessment/review/index.vue @@ -57,7 +57,7 @@ {{getReviewStatusName(scope.row.reviewStatus)}} - +