闫增涛
2024-05-28 2f41de15eafb36e984cacbe6b9973e262ea2501d
题目保存优化
5个文件已修改
27 ■■■■ 已修改文件
src/assets/methods/examination.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/assets/examinationList.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/components/chapter001.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/books/childHealth/view/content/index.vue 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/examinations/index.vue 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/methods/examination.js
@@ -1,6 +1,16 @@
import MG from "@/assets/js/middleGround/WebMiddleGroundApi";
import getPublicImage from "@/assets/js/middleGround/tool";
const getQuestionList = async (oldList, questionList,activeBook) => {
const getQuestionList = async (page, questionList,activeBook) => {
  console.log('page',page);
  const oldAnswerData = localStorage.getItem(activeBook.name + 'oldAnswerData')
  let oldData = null
  let oldList = []
  if(oldAnswerData) {
    oldData = JSON.parse(oldAnswerData)
  }
 if(oldData && oldData[page]) {
  oldList = oldData[page]
 }
  let cardList = [
    {
      catalogName: "单选题",
src/books/childHealth/assets/examinationList.js
@@ -1,6 +1,6 @@
const testData = {
  2: {
    9: [63795, 63796, 63797, 63798, 63804],
    10: [63795, 63796, 63797, 63798, 63804],
    14: [65859, 65860, 65861, 65862],
    17: [65863, 65864, 65865, 65866, 65867, 65868, 65869],
    22: [65870, 65871, 65872, 65873, 65874],
src/books/childHealth/view/content/components/chapter001.vue
@@ -300,7 +300,7 @@
            <examinations
              v-if="testOne && questionData"
              ref="examinationOne"
              :cardList="questionData[9]"
              :cardList="questionData[10]"
              :chapter="1"
              :page="2"
            />
src/books/childHealth/view/content/index.vue
@@ -120,11 +120,6 @@
      return this.$store.state.qiankun.scale / 100;
    }
  },
  provide() {
    return {
      changeQuestionData: this.changeQuestionData
    };
  },
  watch: {
    showCatalogList: {
      handler(newVal, oldVal) {
@@ -510,7 +505,7 @@
                if (testData[catalog][page]) {
                  if (Array.isArray(testData[catalog][page])) {
                    this.questionData[page] = await getQuestionList(
                      [],
                      page,
                      testData[catalog][page],
                      this.config.activeBook
                    );
@@ -537,9 +532,6 @@
        }
      });
    },
    changeQuestionData(page, data) {
      this.$props.questionData[page] = data;
    }
  },
  components: {
    pageHeader,
src/components/examinations/index.vue
@@ -446,7 +446,6 @@
      cardData:[]
    };
  },
  inject:['changeQuestionData'],
  mounted() {
    this.cardData = this.cardList
    console.log('this.cardList',this.cardList);