|
@@ -626,6 +626,7 @@ export default {
|
|
|
},
|
|
|
paper: {
|
|
|
handler(newValue, oldValue) {
|
|
|
+ this.dataLoading = true;
|
|
|
// 加上題目索引
|
|
|
if (newValue.item && newValue.item.length) {
|
|
|
let index = 0 //题目索引
|
|
@@ -644,20 +645,34 @@ export default {
|
|
|
i.index = index++
|
|
|
//this.paperScore.push(i.score || 0)
|
|
|
}
|
|
|
- if (!i.score) i.score = 0
|
|
|
+ if (!i.score) i.score = 0
|
|
|
})
|
|
|
-
|
|
|
- if (this.isExamMark) { // 批閱模式 先篩選出主觀題
|
|
|
+
|
|
|
+ if (this.isExamMark) { // 批閱模式 先篩選出主觀題
|
|
|
for (let i = 0; i < newValue.item.length; i++) {
|
|
|
- if (newValue.item[i].type === 'subjective' || newValue.item[i].type === 'complete') {
|
|
|
- this.quIndex = i;
|
|
|
- break;
|
|
|
+ if (newValue.item[i].type === "compose") {
|
|
|
+ for (let j = 0; j < newValue.item[i].children.length; j++) {
|
|
|
+ if (newValue.item[i].children[j].type === 'subjective' || newValue.item[i].children[j].type === 'complete') {
|
|
|
+ this.quIndex = j;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (newValue.item[i].type === 'subjective' || newValue.item[i].type === 'complete') {
|
|
|
+ this.quIndex = i;
|
|
|
+ break;
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
this.paperInfo = newValue
|
|
|
//this.handleInitPaper(newPaper)
|
|
|
+ //this.dataLoading = false;
|
|
|
+ // 延遲處理 加上遮罩效果
|
|
|
+ setTimeout(() => {
|
|
|
+ this.dataLoading = false; // 完成後關閉 loading
|
|
|
+ }, 500); // 模擬一個處理延遲
|
|
|
},
|
|
|
deep: true,
|
|
|
immediate: true
|