Merge branch 'master' of http://192.168.0.105:10010/r/zhba_enterprises
| | |
| | | |
| | | export const getSubjectIds = (param) => { |
| | | return request({ |
| | | url: '/api/exampaper/queryPagerSubject/', |
| | | url: '/api/exampaper/queryRandomSubject/', |
| | | method: 'get', |
| | | params: { |
| | | ...param |
| | |
| | | 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 |
| | | }] |
| | | }, |
| | | ] |
| | |
| | | } |
| | | }; |
| | | } |
| | | |
| | | /** |
| | | * 判断对象是否为空 |
| | | * @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 }) |
| | | } |
| | |
| | | }, |
| | | 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 |
| | | }) |
| | | } |
| | | |
| | |
| | | }) |
| | | }, |
| | | doSubmitExam () { |
| | | |
| | | var obj = { |
| | | examName: this.$route.query.examName, |
| | | securityName: this.userInfo.user_name, |