diff --git a/src/api/index.js b/src/api/index.js index 2b678e2..f316091 100644 --- a/src/api/index.js +++ b/src/api/index.js @@ -56,4 +56,25 @@ export default { AddRandomPractiseExamAnswerDetail: `/user/randomPractice/AddRandomPractiseExamAnswerDetail`, addPractiseRecordRandom: `/user/randomPractice/addPractiseRecord`, previewPaper:`/management/testPaper/previewPaper`, + + // 错题本 + typesList:`cjEnterprise/questionTypes/typesList`, + getMineWrong:`/user/wrong/getMineWrong`, + getPaperInfo: `/user/wrong/getPaperInfo`, + questionInfo: `/user/wrong/questionInfo`, + + // 留言板 + delComment:`/management/messageBoard/delComment`, + delReply:`/management/messageBoard/delReply`, + delMessageBoard:`/management/messageBoard/delMessageBoard`, + queryMessageBoard:`/management/messageBoard/queryMessageBoard`, + queryMessageBoardDetail:`/management/messageBoard/queryMessageBoardDetail`, + saveComment:`/management/messageBoard/saveComment`, + saveMessageBoard:`/management/messageBoard/saveMessageBoard`, + saveReply:`/management/messageBoard/saveReply`, + + // 首页 + waitReply:`/management/index/waitReply`, + waitReplyDel:`/management/index/waitReplyDel`, + waitExam:`/user/index/waitExam`, } \ No newline at end of file diff --git a/src/assets/img/index/achievement.png b/src/assets/img/index/achievement.png new file mode 100644 index 0000000..34474e8 Binary files /dev/null and b/src/assets/img/index/achievement.png differ diff --git a/src/assets/img/index/assesment.png b/src/assets/img/index/assesment.png new file mode 100644 index 0000000..08bc6ae Binary files /dev/null and b/src/assets/img/index/assesment.png differ diff --git a/src/assets/img/index/msg.png b/src/assets/img/index/msg.png new file mode 100644 index 0000000..87d5dfa Binary files /dev/null and b/src/assets/img/index/msg.png differ diff --git a/src/assets/img/index/practice.png b/src/assets/img/index/practice.png new file mode 100644 index 0000000..8eb169f Binary files /dev/null and b/src/assets/img/index/practice.png differ diff --git a/src/components/quill/index.vue b/src/components/quill/index.vue new file mode 100644 index 0000000..f4d2118 --- /dev/null +++ b/src/components/quill/index.vue @@ -0,0 +1,179 @@ + + + + diff --git a/src/components/quill/options.js b/src/components/quill/options.js new file mode 100644 index 0000000..5a90edd --- /dev/null +++ b/src/components/quill/options.js @@ -0,0 +1,16 @@ +export default [ + ['bold', 'italic', 'underline', 'strike'], + ['blockquote', 'code-block'], + [{ 'header': 1 }, { 'header': 2 }], + [{ 'list': 'ordered' }, { 'list': 'bullet' }], + [{ 'script': 'sub' }, { 'script': 'super' }], + [{ 'indent': '-1' }, { 'indent': '+1' }], + [{ 'direction': 'rtl' }], + [{ 'size': ['small', false, 'large', 'huge'] }], + [{ 'header': [1, 2, 3, 4, 5, 6, false] }], + [{ 'color': [] }, { 'background': [] }], + [{ 'font': [] }], + [{ 'align': [] }], + ['clean'], + ['link', 'image', 'video'] +] \ No newline at end of file diff --git a/src/layouts/navbar/index.vue b/src/layouts/navbar/index.vue index 5a8b361..8a7432b 100644 --- a/src/layouts/navbar/index.vue +++ b/src/layouts/navbar/index.vue @@ -13,8 +13,13 @@ export default { activeName: this.$route.path, tabList: [ { - icon: 'el-icon-lx-home', + icon: 'el-icon-folder-checked', index: '/index/list', + title: '首页' + }, + { + icon: 'el-icon-lx-home', + index: '/practice/list', title: '我的练习' }, { @@ -32,6 +37,11 @@ export default { index: '/wrongBook/list', title: '我的错题本' }, + { + icon: 'el-icon-chat-dot-round', + index: '/messageBoard/list', + title: '交流互动' + } ], hideNavList: ['article','matchDetail','courseSection','personalCenter'] }; diff --git a/src/libs/util.js b/src/libs/util.js index 1c8fb9a..37d0731 100644 --- a/src/libs/util.js +++ b/src/libs/util.js @@ -72,7 +72,14 @@ const util = { isImg(ext) { if('jpg,jpeg,png,gif,svg,psd'.includes(ext)) return true return false - } + }, + // 循环去除html标签 + removeHtmlTag(list,attr) { + list.map(n => { + n[attr] = n[attr].replace(/<\/?.+?>/gi,'') + }) + return list + }, } export default util \ No newline at end of file diff --git a/src/pages/achievement/detail/index.vue b/src/pages/achievement/detail/index.vue index eb087c1..8d9f4fd 100644 --- a/src/pages/achievement/detail/index.vue +++ b/src/pages/achievement/detail/index.vue @@ -2,14 +2,18 @@

{{paperName }}

-
+
总分: 100分
-
+
考试时长: {{time}}分钟
+
+ 排名: + {{ranking}} +
    @@ -65,6 +69,7 @@ export default { return { paperName: '', time: 0, + ranking: 1, selectVisible: false, tabs: [ { @@ -105,6 +110,7 @@ export default { .then(res => { this.paperName = res.paperName this.time = res.time + this.ranking = res.ranking this.allData = res.data this.curType = this.allData.list1 this.handleOptions() diff --git a/src/pages/achievement/list/examResults.vue b/src/pages/achievement/list/examResults.vue index d33b787..b530def 100644 --- a/src/pages/achievement/list/examResults.vue +++ b/src/pages/achievement/list/examResults.vue @@ -2,15 +2,10 @@
    -
    -

    - 筛选 -
    -
    -
    -
    - -
    +
    筛选
    +
    +
    +
    @@ -80,11 +75,11 @@ export default { this.$post(`${this.api.getMyAchievement}?userId=${this.userId}&pageSize=${this.pageSize}&pageNum=${this.page}`).then(res => { this.listData = res.data.list.list this.total = res.data.list.totalCount - }).catch(res => {}); + }).catch(res => {}) }, handleCurrentChange(val) { - this.page = val; - this.getData(); + this.page = val + this.getData() }, show(row){ this.setInfo({ diff --git a/src/pages/achievement/list/practiceResults.vue b/src/pages/achievement/list/practiceResults.vue index 4265cb1..e9670d7 100644 --- a/src/pages/achievement/list/practiceResults.vue +++ b/src/pages/achievement/list/practiceResults.vue @@ -2,15 +2,11 @@
    -
    -

    - 筛选 -
    -
    -
    -
    - -
    +
    筛选
    + +
    +
    +
    @@ -31,7 +27,7 @@ @@ -90,14 +86,13 @@ export default { }) .then(() => { this.$del(`${this.api.deleteCourse}/${row.id}`).then(res => { - this.$message.success('删除成功'); + this.$message.success('删除成功') this.getData() - }).catch(res => {}); - }) - .catch(() => {}); + }).catch(res => {}) + }).catch(() => {}) }, handleSelectionChange(val) { - this.multipleSelection = val; + this.multipleSelection = val }, handleCurrentChange(val) { this.page = val diff --git a/src/pages/exam/detail/index.vue b/src/pages/exam/detail/index.vue index 15b5c72..ebf9e33 100644 --- a/src/pages/exam/detail/index.vue +++ b/src/pages/exam/detail/index.vue @@ -102,16 +102,13 @@ export default { methods: { getData() { this.$post(`${this.api.answerDetail}?userId=${this.userId}&assessmentId=${this.assessmentId}&paperId=${this.testPaperId}`) - // this.$post(`${this.api.answerDetail}?userId=${1}&assessmentId=${1}&paperId=${1}`) .then(res => { this.paperName = res.paperName this.time = res.time this.allData = res.data this.curType = this.allData.list1 this.handleOptions() - }) - .catch(err => {}); - + }).catch(err => {}) }, tabChange(id){ this.active = id @@ -125,7 +122,6 @@ export default { let options = {} for(let i in n){ if(i.includes('option') && n[i]){ - console.log(i.replace('option_','')) options[i.replace('option_','')] = n[i] } } diff --git a/src/pages/exam/do/index.vue b/src/pages/exam/do/index.vue index c0767e4..ea76110 100644 --- a/src/pages/exam/do/index.vue +++ b/src/pages/exam/do/index.vue @@ -53,23 +53,26 @@ {{index+1}}.
    +
    @@ -120,7 +123,8 @@ export default { time: '00:00:00', progress: 0, isSubmit: false, - isDone: false + isDone: false, + totalLen: 0 }; }, computed: { @@ -157,6 +161,7 @@ export default { } }, mounted() { + this.insertScript() this.getData() this.addLeaveEvent() this.queryState() @@ -165,6 +170,7 @@ export default { clearInterval(this.timer) clearInterval(this.queryStateTimer) window.onbeforeunload = null + window.updateProgress = null this.addRecords() }, methods: { @@ -191,6 +197,7 @@ export default { this.fillBlanksScore = data.fillInTheBlanklist.length ? data.fillInTheBlanklist[0].fillBlanksScore : 0 this.briefAnswerScore = data.shortAnswerList.length ? data.shortAnswerList[0].briefAnswerScore : 0 this.scoreList = [this.singlePoint,this.multipleChoiceScore,this.fillBlanksScore,this.briefAnswerScore,this.briefAnswerScore] + this.handleOptions() }) .catch(err => {}) @@ -201,6 +208,7 @@ export default { let records = res.data.data let len = 0 this.subjects.map(n => len += n.length) + this.totalLen = len this.progress = len ? Math.floor((records.length / len * 100)) : 0 this.singleAnsweredCount = records.filter(n => n.typeId == 1).length @@ -235,12 +243,19 @@ export default { }, handleOptions(){ let subjects = this.subjects + window.updateProgress = (item) => { + this.updateProgress(item,1) + } + let index = 0 subjects.forEach((e,i) => { - e.forEach(n => { + e.forEach((n,j) => { + index++ + n.mediaEleId = `player${index}` + this.initMedia(n) if(i == 1){ this.$set(n,'val',[]) }else if(i == 3){ - n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,``) + n.questionStem = n.questionStem.replace(/\(\)\(\)\(\)/g,``) }else{ this.$set(n,'val','') } @@ -258,6 +273,23 @@ export default { this.subjects = subjects this.getAnswer() }, + initMedia(item){ + if(item.videoAudio && !item.player){ + this.$get(`${this.api.getPlayAuth}/${item.videoAudio}`).then(res => { + let playAuth = res.data.playAuth + this.$nextTick(() => { + item.player = new Aliplayer({ + id: item.mediaEleId, + width: '100%', + autoplay: false, + vid : item.videoAudio, + playauth : playAuth, + encryptType:1, //当播放私有加密流时需要设置。 + }) + }) + }).catch(res => {}) + } + }, addLeaveEvent(){ window.onbeforeunload = e => { e = e || window.event; @@ -373,150 +405,47 @@ export default { }) .catch(err => {}) } - } + }, + updateProgress(item,isFillBlank){ + let subjects = this.subjects + if(isFillBlank){ + let index = item.getAttribute('data-index') + if([...item.parentElement.querySelectorAll('input')].some(n => n.value)){ + subjects[3][index].hadAnswer = 1 + }else{ + subjects[3][index].hadAnswer = 0 + } + this.fillBlankAnsweredCount = subjects[3].filter(n => n.hadAnswer).length + }else{ + this.singleAnsweredCount = subjects[0].filter(n => n.val).length + this.multipleAnsweredCount = subjects[1].filter(n => n.val.length).length + this.judgeAnsweredCount = subjects[2].filter(n => n.val).length + this.briefAnswerAnsweredCount = subjects[4].filter(n => n.val).length + } + let answered = this.singleAnsweredCount + this.multipleAnsweredCount + this.judgeAnsweredCount + this.fillBlankAnsweredCount + this.briefAnswerAnsweredCount + this.progress = this.totalLen ? Math.floor((answered / this.totalLen * 100)) : 0 + }, + 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')) + }) + }, }, } \ No newline at end of file diff --git a/src/pages/exam/list/index.vue b/src/pages/exam/list/index.vue index fd6f5e3..2d1ce00 100644 --- a/src/pages/exam/list/index.vue +++ b/src/pages/exam/list/index.vue @@ -2,23 +2,19 @@
    -
    -

    - 筛选 -
    -
    -
    - - - - - - - - -
    - -
    +
    筛选
    + +
    + + + + + + + + +
    +
    @@ -39,7 +35,7 @@ {{getDegreeName(scope.row.degree)}} - +