From e7f7bfcecdf945566e2dc121080d222bf725783a Mon Sep 17 00:00:00 2001 From: 刘有才luck <14606842+liu-youcai-luck@user.noreply.gitee.com> Date: Fri, 6 Dec 2024 15:09:41 +0800 Subject: [PATCH] 细节调整 --- src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue | 34 ++++++++++++++++++---------------- src/views/basic/askTestQuestion/wrongQuestion.vue | 34 +++++++++++++++++----------------- 2 files changed, 35 insertions(+), 33 deletions(-) diff --git a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue index aac6c67..6ea3314 100644 --- a/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue +++ b/src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue @@ -429,20 +429,20 @@ export default { }, onIFrameLoad(id) { const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe - const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; - const body = iframeRef.contentWindow.document.body; - body.style.overflowX = "hidden"; // 不允许出现横向滚动条 - const height = body.offsetHeight; // 获取内容的高度 - console.log(height, "height"); - console.log(body, "body"); - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 - // 获取第一个P标签 - const firstP = doc.getElementsByTagName("p")[0]; - // 或者修改第一个 < p > 标签的内容; - if (firstP) { - let a = this.processString(firstP.innerHTML); - firstP.innerHTML = a; - } + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; + // const body = iframeRef.contentWindow.document.body; + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 + // const height = body.offsetHeight; // 获取内容的高度 + // console.log(height, "height"); + // console.log(body, "body"); + // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 + // // 获取第一个P标签 + // const firstP = doc.getElementsByTagName("p")[0]; + // // 或者修改第一个 < p > 标签的内容; + // if (firstP) { + // let a = this.processString(firstP.innerHTML); + // firstP.innerHTML = a; + // } }, // 启动编辑模式 @@ -810,14 +810,16 @@ export default { ); }, dataYesNo(data) { - if (data.length < 1 && !data) { + if (data.length < 1) { return true; } let list = []; data.forEach((item) => { list.push(...item.subQuestionIds); }); - if (list.length < 1 && !list) { + console.log(list, "list"); + + if (list.length < 1) { return true; } else { return false; diff --git a/src/views/basic/askTestQuestion/wrongQuestion.vue b/src/views/basic/askTestQuestion/wrongQuestion.vue index bd7203f..f3ec342 100644 --- a/src/views/basic/askTestQuestion/wrongQuestion.vue +++ b/src/views/basic/askTestQuestion/wrongQuestion.vue @@ -657,23 +657,23 @@ export default { // let a = this.processString(firstP.innerHTML); // firstP.innerHTML = a; // } - const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; - const body = iframeRef.contentWindow.document.body; - body.style.overflowX = "hidden"; // 不允许出现横向滚动条 - const height = body.offsetHeight; // 获取内容的高度 - console.log(height, "height"); - // console.log("body.offsetHeight:", body.offsetHeight); - // console.log("body.clientHeight:", body.clientHeight); - // console.log("body.scrollHeight:", body.scrollHeight); - - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 - // 获取第一个P标签 - const firstP = doc.getElementsByTagName("p")[0]; - // 或者修改第一个 < p > 标签的内容; - if (firstP) { - let a = this.processString(firstP.innerHTML); - firstP.innerHTML = a; - } + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document; + // const body = iframeRef.contentWindow.document.body; + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条 + // const height = body.offsetHeight; // 获取内容的高度 + // console.log(height, "height"); + // // console.log("body.offsetHeight:", body.offsetHeight); + // // console.log("body.clientHeight:", body.clientHeight); + // // console.log("body.scrollHeight:", body.scrollHeight); + + // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度 + // // 获取第一个P标签 + // const firstP = doc.getElementsByTagName("p")[0]; + // // 或者修改第一个 < p > 标签的内容; + // if (firstP) { + // let a = this.processString(firstP.innerHTML); + // firstP.innerHTML = a; + // } }, // 子集删除后 父级需要更新 -- libgit2 0.21.4