From d0940596d5f35ef96a5818ee315f86454c3d0ab1 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 01 七月 2024 17:05:21 +0800
Subject: [PATCH] 题库功能优化

---
 src/views/examination/index.vue |   26 ++++++++------------------
 1 files changed, 8 insertions(+), 18 deletions(-)

diff --git a/src/views/examination/index.vue b/src/views/examination/index.vue
index 573ab21..d54014d 100644
--- a/src/views/examination/index.vue
+++ b/src/views/examination/index.vue
@@ -663,11 +663,6 @@
 }
 // 鑾峰彇鏀惰棌澶�
 const getCollectDataList = async () => {
-  if (!examination.collectList.length) {
-    examination.loading = false
-    examination.noData = true
-    return false
-  }
   // 寮�濮嬭姹�
   let oldData = null
   let oldList = []
@@ -897,9 +892,7 @@
 
   for (let index = 0; index < jsonCollectList.length; index++) {
     const item = jsonCollectList[index]
-    if (item.type && item.type == 'material') {
-      examination.cardList.push(item)
-    } else if (item.questionType == 'singleChoice') {
+  if (item.questionType == 'singleChoice') {
       examination.cardList[0].infoList.push(item)
     } else if (item.questionType == 'judge') {
       examination.cardList[1].infoList.push(item)
@@ -909,6 +902,8 @@
       examination.cardList[3].infoList.push(item)
     } else if (item.questionType == 'shortAnswer') {
       examination.cardList[4].infoList.push(item)
+    } else if (item.type && item.type == 'material') {
+      examination.cardList[examination.cardList.length] = item
     }
   }
   examination.cardList = examination.cardList.filter((item) => item.infoList.length > 0)
@@ -935,6 +930,7 @@
         examination.cardList = (await getErrorDataList()) as any
         await getJsonError()
       } else {
+        examination.noData = true
         examination.loading = false
         ElMessageBox.confirm('閿欓闆嗘殏鏃犳暟鎹�!', '鎻愮ず', {
           confirmButtonText: '纭畾',
@@ -953,12 +949,6 @@
 }
 // 鑾峰彇閿欓闆�
 const getErrorDataList = async () => {
-  if (!examination.errorList.length) {
-    examination.loading = false
-    examination.noData = true
-    return false
-  }
-  // 寮�濮嬭姹�
   let oldData = null
   let oldList:any = []
   let cardList = [
@@ -1187,9 +1177,7 @@
 
   for (let index = 0; index < jsonCollectList.length; index++) {
     const item = jsonCollectList[index]
-    if (item.type && item.type == 'material') {
-      examination.cardList.push(item)
-    } else if (item.questionType == 'singleChoice') {
+    if (item.questionType == 'singleChoice') {
       examination.cardList[0].infoList.push(item)
     } else if (item.questionType == 'judge') {
       examination.cardList[1].infoList.push(item)
@@ -1199,6 +1187,8 @@
       examination.cardList[3].infoList.push(item)
     } else if (item.questionType == 'shortAnswer') {
       examination.cardList[4].infoList.push(item)
+    } else if (item.type && item.type == 'material') {
+      examination.cardList[examination.cardList.length] = item
     }
   }
   examination.cardList = examination.cardList.filter((item) => item.infoList.length > 0)
@@ -1426,7 +1416,7 @@
       ]
     })
     .then((res:any) => {
-      console.log('閿欓宸蹭繚瀛�', examination.allError)
+      console.log('閿欓宸叉竻绌�')
     })
 }
 defineExpose({ handleExaminationDialog })

--
Gitblit v1.9.1