|
@@ -125,7 +125,6 @@ export default {
|
|
curLevel: "",
|
|
curLevel: "",
|
|
paperList: [],
|
|
paperList: [],
|
|
papers: [],
|
|
papers: [],
|
|
- isLoading: false,
|
|
|
|
// change standard
|
|
// change standard
|
|
levelModalIsShow: false,
|
|
levelModalIsShow: false,
|
|
curChangePaper: {},
|
|
curChangePaper: {},
|
|
@@ -142,16 +141,12 @@ export default {
|
|
...mapState("marker", ["IS_MARK_LEADER"])
|
|
...mapState("marker", ["IS_MARK_LEADER"])
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- async visibleChange(visible) {
|
|
|
|
|
|
+ visibleChange(visible) {
|
|
if (!visible) return;
|
|
if (!visible) return;
|
|
|
|
|
|
- if (!this.paperList.length) {
|
|
|
|
- await this.getPaperList();
|
|
|
|
- }
|
|
|
|
- this.updatePapers();
|
|
|
|
|
|
+ this.getPaperList();
|
|
},
|
|
},
|
|
async getPaperList() {
|
|
async getPaperList() {
|
|
- this.isLoading = true;
|
|
|
|
const datas = {
|
|
const datas = {
|
|
questionId: this.questionId,
|
|
questionId: this.questionId,
|
|
level: "",
|
|
level: "",
|
|
@@ -161,13 +156,15 @@ export default {
|
|
size: 1000
|
|
size: 1000
|
|
};
|
|
};
|
|
const data = await paperList(datas).catch(() => {});
|
|
const data = await paperList(datas).catch(() => {});
|
|
- this.isLoading = false;
|
|
|
|
if (!data) return;
|
|
if (!data) return;
|
|
this.paperList = data.data.map(item => {
|
|
this.paperList = data.data.map(item => {
|
|
item.title = `NO.${item.sn}`;
|
|
item.title = `NO.${item.sn}`;
|
|
item.loading = false;
|
|
item.loading = false;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
|
|
+ this.paperList.sort((a, b) => (a.level < b.level ? -1 : 1));
|
|
|
|
+
|
|
|
|
+ this.updatePapers();
|
|
},
|
|
},
|
|
updatePapers() {
|
|
updatePapers() {
|
|
if (this.curLevel) {
|
|
if (this.curLevel) {
|
|
@@ -178,34 +175,6 @@ export default {
|
|
this.papers = this.paperList;
|
|
this.papers = this.paperList;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
- async updateLevelPapers(levelName) {
|
|
|
|
- const datas = {
|
|
|
|
- questionId: this.questionId,
|
|
|
|
- level: levelName,
|
|
|
|
- sort: "secretNumber",
|
|
|
|
- isSample: true,
|
|
|
|
- page: 0,
|
|
|
|
- size: 100
|
|
|
|
- };
|
|
|
|
- const data = await paperList(datas).catch(() => {});
|
|
|
|
- this.isLoading = false;
|
|
|
|
- if (!data) return;
|
|
|
|
-
|
|
|
|
- this.paperList = this.paperList.filter(
|
|
|
|
- paper => paper.level !== levelName
|
|
|
|
- );
|
|
|
|
-
|
|
|
|
- const papers = data.data.map(item => {
|
|
|
|
- item.title = `NO.${item.sn}`;
|
|
|
|
- item.loading = false;
|
|
|
|
- return item;
|
|
|
|
- });
|
|
|
|
- this.paperList = [...this.paperList, ...papers];
|
|
|
|
-
|
|
|
|
- if (this.curLevel === levelName) {
|
|
|
|
- this.papers = papers;
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
setCurLevel(levelName) {
|
|
setCurLevel(levelName) {
|
|
this.curLevel = levelName;
|
|
this.curLevel = levelName;
|
|
this.updatePapers();
|
|
this.updatePapers();
|
|
@@ -228,7 +197,7 @@ export default {
|
|
const res = await cancelStandardPaper(paper.id).catch(() => {});
|
|
const res = await cancelStandardPaper(paper.id).catch(() => {});
|
|
paper.loading = false;
|
|
paper.loading = false;
|
|
if (!res) return;
|
|
if (!res) return;
|
|
- this.updateLevelPapers(paper.level);
|
|
|
|
|
|
+ this.getPaperList();
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
@@ -261,9 +230,8 @@ export default {
|
|
if (!result) return;
|
|
if (!result) return;
|
|
|
|
|
|
this.$Message.success("操作成功!");
|
|
this.$Message.success("操作成功!");
|
|
- await this.getPaperList();
|
|
|
|
|
|
+ this.getPaperList();
|
|
this.cancelChange();
|
|
this.cancelChange();
|
|
- this.updatePapers();
|
|
|
|
},
|
|
},
|
|
cancelChange() {
|
|
cancelChange() {
|
|
this.curSelectLevel = null;
|
|
this.curSelectLevel = null;
|