| | |
| | | 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: "单选题", |
| | |
| | | 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], |
| | |
| | | <examinations |
| | | v-if="testOne && questionData" |
| | | ref="examinationOne" |
| | | :cardList="questionData[9]" |
| | | :cardList="questionData[10]" |
| | | :chapter="1" |
| | | :page="2" |
| | | /> |
| | |
| | | return this.$store.state.qiankun.scale / 100; |
| | | } |
| | | }, |
| | | provide() { |
| | | return { |
| | | changeQuestionData: this.changeQuestionData |
| | | }; |
| | | }, |
| | | watch: { |
| | | showCatalogList: { |
| | | handler(newVal, oldVal) { |
| | |
| | | if (testData[catalog][page]) { |
| | | if (Array.isArray(testData[catalog][page])) { |
| | | this.questionData[page] = await getQuestionList( |
| | | [], |
| | | page, |
| | | testData[catalog][page], |
| | | this.config.activeBook |
| | | ); |
| | |
| | | } |
| | | }); |
| | | }, |
| | | changeQuestionData(page, data) { |
| | | this.$props.questionData[page] = data; |
| | | } |
| | | }, |
| | | components: { |
| | | pageHeader, |
| | |
| | | cardData:[] |
| | | }; |
| | | }, |
| | | inject:['changeQuestionData'], |
| | | mounted() { |
| | | this.cardData = this.cardList |
| | | console.log('this.cardList',this.cardList); |