|
@@ -53,6 +53,13 @@
|
|
>●</span
|
|
>●</span
|
|
>
|
|
>
|
|
{{ section.examName }}
|
|
{{ section.examName }}
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ v-if="section.newRecordStatus"
|
|
|
|
+ >上次做到</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<div class="btn_div">
|
|
<div class="btn_div">
|
|
<!-- 正确率
|
|
<!-- 正确率
|
|
@@ -163,6 +170,13 @@
|
|
>●</span
|
|
>●</span
|
|
>
|
|
>
|
|
{{ section.examName }}
|
|
{{ section.examName }}
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ v-if="section.newRecordStatus"
|
|
|
|
+ >上次做到</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
style="width: auto; padding: 0px 14px"
|
|
style="width: auto; padding: 0px 14px"
|
|
@@ -233,6 +247,13 @@
|
|
>●</span
|
|
>●</span
|
|
>
|
|
>
|
|
{{ item.name }}
|
|
{{ item.name }}
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ v-if="item.newRecordStatus"
|
|
|
|
+ >上次做到</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<div
|
|
<div
|
|
style="width: auto; padding: 0px 14px"
|
|
style="width: auto; padding: 0px 14px"
|
|
@@ -306,6 +327,13 @@
|
|
<div class="bank-section__item__text">
|
|
<div class="bank-section__item__text">
|
|
<span style="margin-right: 8px; color: #a7b0b8">●</span>
|
|
<span style="margin-right: 8px; color: #a7b0b8">●</span>
|
|
{{ item.examName }}
|
|
{{ item.examName }}
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="primary"
|
|
|
|
+ plain
|
|
|
|
+ v-if="item.newRecordStatus"
|
|
|
|
+ >上次做到</el-button
|
|
|
|
+ >
|
|
</div>
|
|
</div>
|
|
<div style="width: auto; padding: 0px 14px" class="btn_div">
|
|
<div style="width: auto; padding: 0px 14px" class="btn_div">
|
|
<!-- 正确率
|
|
<!-- 正确率
|
|
@@ -750,6 +778,7 @@ export default {
|
|
wrongTotal: 0,
|
|
wrongTotal: 0,
|
|
recommendList: [],
|
|
recommendList: [],
|
|
needOpen: true, //是否需要打开第一章节
|
|
needOpen: true, //是否需要打开第一章节
|
|
|
|
+ recordItem: null,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
mounted() {},
|
|
mounted() {},
|
|
@@ -778,21 +807,173 @@ export default {
|
|
},
|
|
},
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- async initData(data) {
|
|
|
|
|
|
+ async initData(data, recordItem) {
|
|
|
|
+ this.recordItem = recordItem;
|
|
this.orderGoodsId = data.orderGoodsId;
|
|
this.orderGoodsId = data.orderGoodsId;
|
|
this.goodsId = data.goodsId;
|
|
this.goodsId = data.goodsId;
|
|
await this.getExamType(data.goodsId);
|
|
await this.getExamType(data.goodsId);
|
|
this.goodsBankQuestionNum();
|
|
this.goodsBankQuestionNum();
|
|
- this.goodsBank();
|
|
|
|
|
|
+ if (this.recordItem) {
|
|
|
|
+ this.getRecordItem();
|
|
|
|
+ } else {
|
|
|
|
+ await this.goodsBank();
|
|
|
|
+ }
|
|
this.getDetail();
|
|
this.getDetail();
|
|
this.examaperList();
|
|
this.examaperList();
|
|
},
|
|
},
|
|
|
|
+ getRecordItem() {
|
|
|
|
+ this.$request
|
|
|
|
+ .goodsBank({
|
|
|
|
+ orderGoodsId: this.recordItem.orderGoodsId,
|
|
|
|
+ goodsId: this.recordItem.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then(async (res) => {
|
|
|
|
+ res.data.forEach((item) => {
|
|
|
|
+ if (item.type == 2 || item.type == 1) {
|
|
|
|
+ item.showList = false;
|
|
|
|
+ item.list = [];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.bankList = res.data;
|
|
|
|
+ // for (let i = 0; i < this.bankList.length; i++) {
|
|
|
|
+ // if (this.bankList[i].type == 1) {
|
|
|
|
+ // await this.moduleExam(this.bankList[i]);
|
|
|
|
+ // break;
|
|
|
|
+ // } else if (this.bankList[i].type == 2) {
|
|
|
|
+ // this.needOpen = false;
|
|
|
|
+ // await this.chapterExam(this.bankList[i], 0);
|
|
|
|
+ // break;
|
|
|
|
+ // }
|
|
|
|
+ // }
|
|
|
|
+ const DW = this.bankList.findIndex((item) => {
|
|
|
|
+ if (
|
|
|
|
+ item.type == 1 &&
|
|
|
|
+ this.recordItem.moduleExamId > 0 &&
|
|
|
|
+ this.recordItem.moduleExamId == item.majorId
|
|
|
|
+ ) {
|
|
|
|
+ return item;
|
|
|
|
+ } else if (
|
|
|
|
+ item.type == 2 &&
|
|
|
|
+ !this.recordItem.moduleExamId &&
|
|
|
|
+ this.recordItem.chapterExamId == item.majorId
|
|
|
|
+ ) {
|
|
|
|
+ return item;
|
|
|
|
+ } else if (
|
|
|
|
+ item.type == 3 &&
|
|
|
|
+ !this.recordItem.moduleExamId &&
|
|
|
|
+ !this.recordItem.chapterExamId &&
|
|
|
|
+ this.recordItem.examId == item.majorId
|
|
|
|
+ ) {
|
|
|
|
+ return item;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ if (DW != -1) {
|
|
|
|
+ if (this.bankList[DW].type == 1) {
|
|
|
|
+
|
|
|
|
+ console.log(1)
|
|
|
|
+ this.$request
|
|
|
|
+ .goodsChapterList({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ moduleExamId: this.recordItem.moduleExamId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then(async (res) => {
|
|
|
|
+ res.data.forEach((item) => {
|
|
|
|
+ item.showList = false;
|
|
|
|
+ item.list = [];
|
|
|
|
+ });
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW],
|
|
|
|
+ "showList",
|
|
|
|
+ !this.bankList[DW].showList
|
|
|
|
+ );
|
|
|
|
+ this.$set(this.bankList[DW], "list", res.data);
|
|
|
|
+ const DWChapter = this.bankList[DW].list.findIndex(
|
|
|
|
+ (items) => {
|
|
|
|
+ return (
|
|
|
|
+ items.chapterExamId == this.recordItem.chapterExamId
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (DWChapter != -1) {
|
|
|
|
+ this.$request
|
|
|
|
+ .bankExamExamList({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ moduleExamId: this.bankList[DW].majorId,
|
|
|
|
+ chapterExamId:
|
|
|
|
+ this.bankList[DW].list[DWChapter].chapterExamId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW].list[DWChapter],
|
|
|
|
+ "showList",
|
|
|
|
+ !this.bankList[DW].list[DWChapter].showList
|
|
|
|
+ );
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW].list[DWChapter],
|
|
|
|
+ "list",
|
|
|
|
+ res.data
|
|
|
|
+ );
|
|
|
|
+ const DWChapters = this.bankList[DW].list[
|
|
|
|
+ DWChapter
|
|
|
|
+ ].list.findIndex((itemsy) => {
|
|
|
|
+ return itemsy.examId == this.recordItem.examId;
|
|
|
|
+ });
|
|
|
|
+ if (DWChapters != -1) {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW].list[DWChapter].list[DWChapters],
|
|
|
|
+ "newRecordStatus",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else if (this.bankList[DW].type == 2) {
|
|
|
|
+ console.log(2)
|
|
|
|
+ this.$request
|
|
|
|
+ .bankExamExamList({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ moduleExamId: 0,
|
|
|
|
+ chapterExamId: this.bankList[DW].majorId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW],
|
|
|
|
+ "showList",
|
|
|
|
+ !this.bankList[DW].showList
|
|
|
|
+ );
|
|
|
|
+ this.$set(this.bankList[DW], "list", res.data);
|
|
|
|
+ const DWChapter = this.bankList[DW].list.findIndex(
|
|
|
|
+ (items) => {
|
|
|
|
+ return items.examId == this.recordItem.examId;
|
|
|
|
+ }
|
|
|
|
+ );
|
|
|
|
+ if (DWChapter != -1) {
|
|
|
|
+ this.$set(
|
|
|
|
+ this.bankList[DW].list[DWChapter],
|
|
|
|
+ "newRecordStatus",
|
|
|
|
+ true
|
|
|
|
+ );
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ } else if (this.bankList[DW].type == 3) {
|
|
|
|
+ console.log(3)
|
|
|
|
+ this.$set(this.bankList[DW], "newRecordStatus", true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ console.log("DW", DW,this.bankList);
|
|
|
|
+
|
|
|
|
+ });
|
|
|
|
+ },
|
|
getExamType(id) {
|
|
getExamType(id) {
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
this.$request.exampapergoodsExamPaper(id).then((res) => {
|
|
this.$request.exampapergoodsExamPaper(id).then((res) => {
|
|
this.newList = res.data;
|
|
this.newList = res.data;
|
|
- if(parseInt(this.activeName) > 0){
|
|
|
|
- this.tabChange({name:this.activeName})
|
|
|
|
|
|
+ if (parseInt(this.activeName) > 0) {
|
|
|
|
+ this.tabChange({ name: this.activeName });
|
|
}
|
|
}
|
|
resolve();
|
|
resolve();
|
|
});
|
|
});
|
|
@@ -876,81 +1057,90 @@ export default {
|
|
* 获取课程目录
|
|
* 获取课程目录
|
|
*/
|
|
*/
|
|
goodsBank() {
|
|
goodsBank() {
|
|
- this.$request
|
|
|
|
- .goodsBank({
|
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- res.data.forEach((item) => {
|
|
|
|
- if (item.type == 2 || item.type == 1) {
|
|
|
|
- item.showList = false;
|
|
|
|
- item.list = [];
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ this.$request
|
|
|
|
+ .goodsBank({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then(async (res) => {
|
|
|
|
+ res.data.forEach((item) => {
|
|
|
|
+ if (item.type == 2 || item.type == 1) {
|
|
|
|
+ item.showList = false;
|
|
|
|
+ item.list = [];
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ this.bankList = res.data;
|
|
|
|
+ for (let i = 0; i < this.bankList.length; i++) {
|
|
|
|
+ if (this.bankList[i].type == 1) {
|
|
|
|
+ await this.moduleExam(this.bankList[i]);
|
|
|
|
+ break;
|
|
|
|
+ } else if (this.bankList[i].type == 2) {
|
|
|
|
+ this.needOpen = false;
|
|
|
|
+ await this.chapterExam(this.bankList[i], 0);
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
+ resolve();
|
|
});
|
|
});
|
|
- this.bankList = res.data;
|
|
|
|
-
|
|
|
|
- for (let i = 0; i < this.bankList.length; i++) {
|
|
|
|
- if (this.bankList[i].type == 1) {
|
|
|
|
- this.moduleExam(this.bankList[i]);
|
|
|
|
- break;
|
|
|
|
- } else if (this.bankList[i].type == 2) {
|
|
|
|
- this.needOpen = false;
|
|
|
|
- this.chapterExam(this.bankList[i], 0);
|
|
|
|
- break;
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
* 展开模块卷
|
|
* 展开模块卷
|
|
*/
|
|
*/
|
|
moduleExam(Module) {
|
|
moduleExam(Module) {
|
|
- if (Module.list.length) {
|
|
|
|
- Module.showList = !Module.showList;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this.$request
|
|
|
|
- .goodsChapterList({
|
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
|
- moduleExamId: Module.majorId,
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- res.data.forEach((item) => {
|
|
|
|
- item.showList = false;
|
|
|
|
- item.list = [];
|
|
|
|
- });
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ if (Module.list.length) {
|
|
Module.showList = !Module.showList;
|
|
Module.showList = !Module.showList;
|
|
- Module.list = res.data;
|
|
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.$request
|
|
|
|
+ .goodsChapterList({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ moduleExamId: Module.majorId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then(async (res) => {
|
|
|
|
+ console.log(res, "resresres");
|
|
|
|
+ res.data.forEach((item) => {
|
|
|
|
+ item.showList = false;
|
|
|
|
+ item.list = [];
|
|
|
|
+ });
|
|
|
|
+ Module.showList = !Module.showList;
|
|
|
|
+ Module.list = res.data;
|
|
|
|
|
|
- if (this.needOpen) {
|
|
|
|
- this.needOpen = false;
|
|
|
|
- this.chapterExam(Module.list[0], Module.majorId);
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ if (this.needOpen) {
|
|
|
|
+ this.needOpen = false;
|
|
|
|
+ await this.chapterExam(Module.list[0], Module.majorId);
|
|
|
|
+ }
|
|
|
|
+ resolve();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
/**
|
|
/**
|
|
* 展开章卷
|
|
* 展开章卷
|
|
*/
|
|
*/
|
|
chapterExam(chapter, moduleId = 0) {
|
|
chapterExam(chapter, moduleId = 0) {
|
|
- if (chapter.list.length) {
|
|
|
|
- chapter.showList = !chapter.showList;
|
|
|
|
- return;
|
|
|
|
- }
|
|
|
|
- this.$request
|
|
|
|
- .bankExamExamList({
|
|
|
|
- orderGoodsId: this.orderGoodsId,
|
|
|
|
- moduleExamId: moduleId,
|
|
|
|
- chapterExamId: chapter.chapterExamId || chapter.majorId,
|
|
|
|
- goodsId: this.goodsId,
|
|
|
|
- })
|
|
|
|
- .then((res) => {
|
|
|
|
- console.log(res,"res")
|
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
+ if (chapter.list.length) {
|
|
chapter.showList = !chapter.showList;
|
|
chapter.showList = !chapter.showList;
|
|
- chapter.list = res.data;
|
|
|
|
- });
|
|
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ this.$request
|
|
|
|
+ .bankExamExamList({
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ moduleExamId: moduleId,
|
|
|
|
+ chapterExamId: chapter.chapterExamId || chapter.majorId,
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ })
|
|
|
|
+ .then((res) => {
|
|
|
|
+ console.log(res, "res");
|
|
|
|
+ chapter.showList = !chapter.showList;
|
|
|
|
+ chapter.list = res.data;
|
|
|
|
+ resolve();
|
|
|
|
+ });
|
|
|
|
+ });
|
|
},
|
|
},
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -1177,7 +1367,11 @@ export default {
|
|
tabChange(e) {
|
|
tabChange(e) {
|
|
if (parseInt(e.name) > 0) {
|
|
if (parseInt(e.name) > 0) {
|
|
this.$request
|
|
this.$request
|
|
- .bankexamgetPaperExamList({ goodsId: this.goodsId, paperId: e.name,orderGoodsId:this.orderGoodsId })
|
|
|
|
|
|
+ .bankexamgetPaperExamList({
|
|
|
|
+ goodsId: this.goodsId,
|
|
|
|
+ paperId: e.name,
|
|
|
|
+ orderGoodsId: this.orderGoodsId,
|
|
|
|
+ })
|
|
.then((res) => {
|
|
.then((res) => {
|
|
console.log(res, "resssssss");
|
|
console.log(res, "resssssss");
|
|
this.examListNew = res.data;
|
|
this.examListNew = res.data;
|