|
@@ -241,43 +241,44 @@ export default {
|
|
|
console.log("--333--" + JSON.stringify(res.data));
|
|
|
if (res.data) {
|
|
|
let httpResultData = [];
|
|
|
- res.data.forEach((item, index) => {
|
|
|
- this.getExamQuestionsListFun(
|
|
|
- item,
|
|
|
- httpResultData,
|
|
|
- index === res.data.length - 1
|
|
|
- );
|
|
|
+ res.data.forEach((item) => {
|
|
|
+ httpResultData.push(this.setPersonDataFun(item));
|
|
|
});
|
|
|
- }
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- this.$store.commit("toggleLoading", false);
|
|
|
- });
|
|
|
- },
|
|
|
- // 查询:试题信息
|
|
|
- async getExamQuestionsListFun(questionId, httpResultData, isLast) {
|
|
|
- this.$_http
|
|
|
- .get(
|
|
|
- this.$pathParams(this.$_API.GET_JTXT_GET_EXAMS_ONE_QUESTIONS_LIST, {
|
|
|
- questionId: questionId
|
|
|
- })
|
|
|
- )
|
|
|
- .then(res => {
|
|
|
- let resData = { ...res.data };
|
|
|
- httpResultData.push(this.setPersonDataFun(resData));
|
|
|
- if (isLast) {
|
|
|
this.examQuestionList = httpResultData;
|
|
|
this.handleExamQuestionItemFun(this.examQuestionList[0], 0); // 设置第一题开始
|
|
|
this.isInited = true;
|
|
|
this.getExamTimeFun(); // 获取:当前时间及考试限时
|
|
|
this.setIntervalFun(); // 设置:倒计时定时器
|
|
|
- this.$store.commit("toggleLoading", false);
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|
|
|
this.$store.commit("toggleLoading", false);
|
|
|
});
|
|
|
},
|
|
|
+ // // 查询:试题信息
|
|
|
+ // async getExamQuestionsListFun(questionId, httpResultData, isLast) {
|
|
|
+ // this.$_http
|
|
|
+ // .get(
|
|
|
+ // this.$pathParams(this.$_API.GET_JTXT_GET_EXAMS_ONE_QUESTIONS_LIST, {
|
|
|
+ // questionId: questionId
|
|
|
+ // })
|
|
|
+ // )
|
|
|
+ // .then(res => {
|
|
|
+ // let resData = { ...res.data };
|
|
|
+ // httpResultData.push(this.setPersonDataFun(resData));
|
|
|
+ // if (isLast) {
|
|
|
+ // this.examQuestionList = httpResultData;
|
|
|
+ // this.handleExamQuestionItemFun(this.examQuestionList[0], 0); // 设置第一题开始
|
|
|
+ // this.isInited = true;
|
|
|
+ // this.getExamTimeFun(); // 获取:当前时间及考试限时
|
|
|
+ // this.setIntervalFun(); // 设置:倒计时定时器
|
|
|
+ // this.$store.commit("toggleLoading", false);
|
|
|
+ // }
|
|
|
+ // })
|
|
|
+ // .catch(() => {
|
|
|
+ // this.$store.commit("toggleLoading", false);
|
|
|
+ // });
|
|
|
+ // },
|
|
|
// 方法:过滤试题的类型,添加用户作答的字段
|
|
|
setPersonDataFun(httpResultDataItme) {
|
|
|
let results = this.formatQuestionType(
|