闫增涛
2024-07-01 d0940596d5f35ef96a5818ee315f86454c3d0ab1
题库功能优化
4个文件已修改
34 ■■■■■ 已修改文件
src/views/examination/components/list.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/examination/components/sheet.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/examination/index.vue 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/readerPages/webHome.vue 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/examination/components/list.vue
@@ -380,6 +380,9 @@
</script>
<style lang="less" scoped>
.catalogName {
  margin-top: 40px;
}
.collect-png {
  cursor: pointer;
  width: 24px;
@@ -444,6 +447,7 @@
  margin-top: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  .titleContent {
    width: 95%;
    display: flex;
src/views/examination/components/sheet.vue
@@ -65,7 +65,7 @@
        </li>
      </ul>
      <div class="sheet-btn">
      <el-button @click="saveData">
      <el-button @click="saveData" v-if="!submitStatus">
        提交
      </el-button>
    </div>
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 })
src/views/readerPages/webHome.vue
@@ -2206,6 +2206,8 @@
              })
            }
        }
      } else {
        resourceDataList.value = []
      }
    })
  } else {