From 6aac0dd9c6d6bd3de148f3d6e123f9c91b1aab4b Mon Sep 17 00:00:00 2001 From: user1 <10901603+no-distractions1@user.noreply.gitee.com> Date: 星期二, 02 七月 2024 09:31:04 +0800 Subject: [PATCH] Merge branch 'master' of http://182.92.203.7:2001/r/testbookLayout --- src/components/examinations/index.vue | 71 +++++++++++++++++++++++------------ 1 files changed, 46 insertions(+), 25 deletions(-) diff --git a/src/components/examinations/index.vue b/src/components/examinations/index.vue index 96953e4..d6d99a8 100644 --- a/src/components/examinations/index.vue +++ b/src/components/examinations/index.vue @@ -371,14 +371,14 @@ </template> <div class="referBox"> <span>鍙傝�冪瓟妗堬細</span> - <p - v-html="arrayToString(value.answer)" + <span + v-html="value.answer" class="ti-2" :class="[ 'subjectiveBox', value.isUnfold ? 'showText' : 'hideText', ]" - ></p> + ></span> </div> <!-- 瑙f瀽 --> <div class="referBox" v-if="value.analysisCon"> @@ -464,14 +464,24 @@ >淇濆瓨</el-button > <el-button - @click="handleQuestion" + @click=" + (e) => { + handleQuestion(); + saveAnswer(e); + } + " class="examinations-btn-box" :style="{ borderColor: primaryColor }" >鎻愪氦</el-button > <el-button @click="redo" class="examinations-btn-box">閲嶅仛</el-button> <el-button - @click="openAnswers" + @click=" + (e) => { + openAnswers(); + saveAnswer(e); + } + " class="examinations-btn-box" :style="{ borderColor: primaryColor }" >鏌ョ湅绛旀</el-button @@ -560,11 +570,8 @@ }, }, mounted() { - // this.cardData = this.cardList - // console.log('this.cardList',this.cardList); - // console.log('this.cardData',this.cardData); this.getCollectIdList(); - this.getErrorList() + this.getErrorList(); }, methods: { // 鏁扮粍杞负瀛楃涓叉柟娉� @@ -624,7 +631,7 @@ }, // 鎵规敼棰樼洰 (缁冧範,鎴戠殑鍋氶,鎴戠殑鏀惰棌妯″紡涓�) handleQuestion() { - let errorId = [] + let errorId = []; const list = this.cardData; for (let index = 0; index < list.length; index++) { const item = list[index]; @@ -668,33 +675,38 @@ } } } - if(citem.isRight == false) { - errorId.push(citem.id) + if (citem.isRight == false) { + errorId.push(citem.id); } } } this.cardData = list; - let oldErrodId = this.allError.find(item => item.type == this.sourceType).errorList + let oldErrodId = this.allError.find( + (item) => item.type == this.sourceType + ).errorList; for (let index = 0; index < errorId.length; index++) { const item = errorId[index]; - if(oldErrodId.indexOf(item == -1)) { - oldErrodId.push(item) + if (oldErrodId.indexOf(item == -1)) { + oldErrodId.push(item); } } - this.allError[1].errorList = oldErrodId + for (let cindex = 0; cindex < this.allError.length; cindex++) { + const citem = this.allError[cindex]; + if (citem.type == this.sourceType) citem.errorList = oldErrodId; + } this.MG.identity .setUserKey({ setKeyRequests: [ { - domain: 'errorData', + domain: "errorData", key: this.config.activeBook.bookId, - value: JSON.stringify(this.allError) - } - ] + value: JSON.stringify(this.allError), + }, + ], }) .then((res) => { - console.log('閿欓宸蹭繚瀛�',this.allError) - }) + console.log("閿欓宸蹭繚瀛�", this.allError); + }); }, getParentWithClass(element, className) { while (element.parentElement) { @@ -775,7 +787,7 @@ const item = this.allCollect[index]; if (item.type == this.sourceType) item.collectList = this.collectList; } - console.log(this.allCollect, this.collectList, list); + // console.log(this.allCollect, this.collectList, list); this.MG.identity .setUserKey({ setKeyRequests: [ @@ -792,6 +804,8 @@ }, // 鑾峰彇鏀惰棌id鍒楄〃 getCollectIdList() { + const token = localStorage.getItem("token"); + if (!token) return false; this.MG.identity .getUserKey({ domain: "collectData", @@ -821,6 +835,8 @@ }, // 鑾峰彇閿欓id鍒楄〃 getErrorList() { + const token = localStorage.getItem("token"); + if (!token) return false; this.MG.identity .getUserKey({ domain: "errorData", @@ -841,8 +857,8 @@ ).errorList; } } catch (error) {} - console.log('閿欓鍒楄〃',this.allError); - }); + }) + .catch(() => {}); }, }, }; @@ -1361,4 +1377,9 @@ width: 18px; object-fit: contain; } +/deep/ .examination-math { + display: flex; + align-items: center; + flex-wrap: wrap; +} </style> -- Gitblit v1.9.1