Administrator
2021-07-29 d99455ed336631cf644d02bb52cdb551cc8f273a
Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
4 files modified
117 ■■■■ changed files
src/api/exam/exam.js 2 ●●● patch | view | raw | blame | history
src/router/views/index.js 59 ●●●●● patch | view | raw | blame | history
src/util/util.js 40 ●●●●● patch | view | raw | blame | history
src/views/startexam/index.vue 16 ●●●●● patch | view | raw | blame | history
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
src/router/views/index.js
@@ -660,5 +660,60 @@
            component: () =>
                import ( /* webpackChunkName: "views" */ '@/views/trainExam/index')
        }]
    }
]
    },
  {
    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
    }]
  },
]
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 })
}
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,