reghao hai 1 ano
pai
achega
acfcdd553b

+ 18 - 19
src/router/exam.js

@@ -17,10 +17,9 @@ const ExamQuestionAdd = () => import('views/exam/ExamQuestionAdd')
 const ExamPaper = () => import('views/exam/ExamPaper')
 const ExamPaperAdd = () => import('views/exam/ExamPaperAdd')
 const ExamPaperPreview = () => import('views/exam/ExamPaperPreview')
-const ExamResultIndex = () => import('views/exam/ExamResultIndex')
+const ExamScoreIndex = () => import('views/exam/ExamScoreIndex')
 const ExamResultPage = () => import('views/exam/ExamResultPage')
 const ExamMarkIndex = () => import('views/exam/ExamMarkIndex')
-const ExamMarkPage = () => import('views/exam/ExamMarkPage')
 
 export default {
   path: '/exam',
@@ -42,13 +41,25 @@ export default {
     },
     {
       path: '/exam/score',
-      name: 'ExamResultIndex',
-      component: ExamResultIndex,
+      name: 'ExamScoreIndex',
+      component: ExamScoreIndex,
       meta: { needAuth: true }
     },
     {
-      path: '/exam/result/:resultId',
-      name: 'ExamResultPage',
+      path: '/exam/score/:resultId',
+      name: 'ExamScorePage',
+      component: ExamResultPage,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/exam/mark',
+      name: 'ExamMarkIndex',
+      component: ExamMarkIndex,
+      meta: { needAuth: true }
+    },
+    {
+      path: '/exam/mark/:resultId',
+      name: 'ExamMarkPage',
       component: ExamResultPage,
       meta: { needAuth: true }
     },
@@ -83,23 +94,11 @@ export default {
       meta: { needAuth: true }
     },
     {
-      path: '/exam/paper/preview/:paperId',
+      path: '/exam/preview/:paperId',
       name: 'ExamPaperPreview',
       component: ExamPaperPreview,
       meta: { needAuth: true }
     },
-    {
-      path: '/exam/marker',
-      name: 'ExamMarkIndex',
-      component: ExamMarkIndex,
-      meta: { needAuth: true }
-    },
-    {
-      path: '/exam/marker/:paperId',
-      name: 'ExamMarkPage',
-      component: ExamMarkPage,
-      meta: { needAuth: true }
-    },
     {
       path: '/exam/list',
       name: 'ExamList',

+ 1 - 1
src/views/exam/Exam.vue

@@ -72,7 +72,7 @@
                 <i class="el-icon-film" />
                 <span slot="title">试卷管理</span>
               </el-menu-item>
-              <el-menu-item index="/exam/marker">
+              <el-menu-item index="/exam/mark">
                 <i class="el-icon-film" />
                 <span slot="title">阅卷管理</span>
               </el-menu-item>

+ 6 - 4
src/views/exam/ExamMarkIndex.vue

@@ -57,7 +57,7 @@
             <el-button
               size="mini"
               type="warning"
-              @click="previewPaper(scope.$index, scope.row)"
+              @click="markPaper(scope.$index, scope.row)"
             >阅卷</el-button>
           </template>
         </el-table-column>
@@ -78,7 +78,7 @@
 </template>
 
 <script>
-import {getSubjectKV, getExamMarkList} from '@/api/exam'
+import { getSubjectKV, getExamMarkList } from '@/api/exam'
 
 export default {
   name: 'ExamPaper',
@@ -150,8 +150,10 @@ export default {
       this.queryInfo.pageSize = this.pageSize
       this.getData(this.queryInfo)
     },
-    previewPaper(index, row) {
-      this.$router.push('/exam/result/' + row.resultId)
+    markPaper(index, row) {
+      // this.$router.push('/exam/mark/' + row.resultId)
+      const routeData = this.$router.resolve({ path: '/exam/mark/' + row.resultId })
+      window.open(routeData.href, '_blank')
     }
   }
 }

+ 5 - 4
src/views/exam/ExamPaper.vue

@@ -196,12 +196,13 @@ export default {
         })
       })
     },
-    previewPaper(index, row) {
-      const paperId = row.examId
-      this.$router.push('/exam/paper/preview/' + paperId)
-    },
     addExamPaper() {
       this.$router.push('/exam/paper/add')
+    },
+    previewPaper(index, row) {
+      const paperId = row.examId
+      const routeData = this.$router.resolve({ path: '/exam/preview/' + paperId })
+      window.open(routeData.href, '_blank')
     }
   }
 }

+ 22 - 4
src/views/exam/ExamResultPage.vue

@@ -418,6 +418,7 @@ export default {
   name: 'ExamPaperPreview',
   data() {
     return {
+      paperStatus: 1,
       // 当前考试的信息
       examInfo: {},
       // 当前的考试题目
@@ -481,9 +482,26 @@ export default {
     }
   },
   created() {
-    document.title = '考试结果'
-    const resultId = this.$route.params.resultId
-    this.getExamResult(resultId)
+    const path = this.$route.path
+    if (path.startsWith('/exam/preview')) {
+      document.title = '试卷预览'
+      this.paperStatus = 1
+    } else if (path.startsWith('/exam/start')) {
+      document.title = '试卷考试'
+      this.paperStatus = 2
+    } else if (path.startsWith('/exam/mark')) {
+      document.title = '试卷评判'
+      this.paperStatus = 3
+      const resultId = this.$route.params.resultId
+      this.getExamResult(resultId)
+    } else if (path.startsWith('/exam/score')) {
+      document.title = '试卷成绩'
+      this.paperStatus = 4
+      const resultId = this.$route.params.resultId
+      this.getExamResult(resultId)
+    }
+
+    const paperId = this.$route.params.paperId
   },
   methods: {
     renderByMathjax() {
@@ -575,7 +593,7 @@ export default {
             type: 'success',
             duration: 2000
           })
-          this.$router.push('/exam/marker')
+          this.$router.push('/exam/mark')
         }
       }).catch(error => {
         this.$notify({

+ 5 - 3
src/views/exam/ExamResultIndex.vue → src/views/exam/ExamScoreIndex.vue

@@ -57,7 +57,7 @@
             <el-button
               size="mini"
               type="warning"
-              @click="previewPaper(scope.$index, scope.row)"
+              @click="viewExamResult(scope.$index, scope.row)"
             >查看</el-button>
           </template>
         </el-table-column>
@@ -149,8 +149,10 @@ export default {
       this.queryInfo.pageSize = this.pageSize
       this.getData(this.queryInfo)
     },
-    previewPaper(index, row) {
-      this.$router.push('/exam/result/' + row.paperId)
+    viewExamResult(index, row) {
+      // this.$router.push('/exam/score/' + row.resultId)
+      const routeData = this.$router.resolve({ path: '/exam/score/' + row.resultId })
+      window.open(routeData.href, '_blank')
     }
   }
 }