From d99455ed336631cf644d02bb52cdb551cc8f273a Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Thu, 29 Jul 2021 18:10:04 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises

---
 src/router/views/index.js     |   59 ++++++++++++++++++++++++++++-
 src/util/util.js              |   40 ++++++++++++++++++++
 src/api/exam/exam.js          |    2 
 src/views/startexam/index.vue |   16 +++----
 4 files changed, 105 insertions(+), 12 deletions(-)

diff --git a/src/api/exam/exam.js b/src/api/exam/exam.js
index b87bfe5..eb925cc 100644
--- a/src/api/exam/exam.js
+++ b/src/api/exam/exam.js
@@ -36,7 +36,7 @@
 
 export const getSubjectIds = (param) => {
   return request({
-    url: '/api/exampaper/queryPagerSubject/',
+    url: '/api/exampaper/queryRandomSubject/',
     method: 'get',
     params: {
       ...param
diff --git a/src/router/views/index.js b/src/router/views/index.js
index 2e38e8c..b031e53 100644
--- a/src/router/views/index.js
+++ b/src/router/views/index.js
@@ -660,5 +660,60 @@
             component: () =>
                 import ( /* webpackChunkName: "views" */ '@/views/trainExam/index')
         }]
-    }
-]
\ No newline at end of file
+    },
+  {
+    path: '/applyexam',
+    redirect: '/applyexam/index',
+    component: Layout,
+    children: [{
+      path: 'index',
+      name: '报名考试',
+      meta: {
+        i18n: 'index',
+      },
+      component: () =>
+        import( /* webpackChunkName: "views" */ '@/views/applyexam/index')
+    }]
+  },
+  {
+    path: '/startexam',
+    redirect: '/startexam/index',
+    component: Layout,
+    children: [{
+      path: 'index',
+      name: '开始考试',
+      meta: {
+        i18n: 'index',
+      },
+      component: () =>
+        import( /* webpackChunkName: "views" */ '@/views/startexam/index')
+    }]
+  },
+  {
+    path: '/titleDetails',
+    component: () =>
+      import( /* webpackChunkName: "views" */ '@/views/exam/topicDetails')
+  },
+  {
+    path: '',
+    component: Layout,
+    children: [{
+      path: '/exam/subjects/:id',
+      component: () => import('@/views/exam/examSubjects'),
+      name: '题目管理',
+      title: '题目管理',
+      noCache: true
+    }]
+  },
+  {
+    path: '',
+    component: Layout,
+    children: [{
+      path: '/startexam/:id',
+      component: () => import('@/views/startexam/index'),
+      name: '开始考试',
+      title: '开始考试',
+      noCache: true
+    }]
+  },
+]
diff --git a/src/util/util.js b/src/util/util.js
index 6634ab1..0c0cdb8 100644
--- a/src/util/util.js
+++ b/src/util/util.js
@@ -365,3 +365,43 @@
     }
   };
 }
+
+/**
+ * 判断对象是否为空
+ * @param obj
+ * @returns {boolean}
+ */
+export const isNotEmpty = (obj) => {
+  let flag = true
+  if (obj === '' || obj == null || obj === undefined || obj === 'undefined') {
+    flag = false
+  }
+  return flag
+}
+
+/**
+ * 警告消息提示
+ * @param obj
+ * @param message
+ */
+export const messageWarn = (obj, message) => {
+  obj.$message({ message: message, type: 'warning', offset: 70 })
+}
+
+/**
+ * 失败消息提示
+ * @param obj
+ * @param message
+ */
+export const messageFail = (obj, message) => {
+  obj.$message({ message: message, type: 'error', offset: 70 })
+}
+
+/**
+ * 成功消息提示
+ * @param obj
+ * @param message
+ */
+export const messageSuccess = (obj, message) => {
+  obj.$message({ message: message, type: 'success', offset: 70 })
+}
diff --git a/src/views/startexam/index.vue b/src/views/startexam/index.vue
index baf14c7..32bec52 100644
--- a/src/views/startexam/index.vue
+++ b/src/views/startexam/index.vue
@@ -240,19 +240,18 @@
         },
         startExam () {
             // 获取题目ID列表
-            getSubjectIds({ id: this.query.examinationId }).then(subjectResponse => {
-                const subjectData = subjectResponse.data.data.examExaminationSubjects
+            getSubjectIds().then(subjectResponse => {
+                const subjectData = subjectResponse.data.data
                 if (subjectData.length > 0) {
                     for (let i = 0; i < subjectData.length; i++) {
-                        const { examSubjectChoices } = subjectData[i]
                         this.subjectIds.push({
-                            subjectId: subjectResponse.data.data.id,
-                            everyID: examSubjectChoices.id,
-                            type: examSubjectChoices.choicesType,
+                            subjectId: 1,
+                            everyID: subjectData[i].id,
+                            type: subjectData[i].choicesType,
                             index: i + 1,
                             answered: false,
-                            answer: examSubjectChoices.answer,
-                            score: examSubjectChoices.score
+                            answer: subjectData[i].answer,
+                            score: subjectData[i].score
                         })
                     }
 
@@ -444,7 +443,6 @@
             })
         },
         doSubmitExam () {
-
             var obj = {
                 examName: this.$route.query.examName,
                 securityName: this.userInfo.user_name,

--
Gitblit v1.9.3