Commit e7f7bfcecdf945566e2dc121080d222bf725783a

Authored by 刘有才luck
1 parent ac4842e3

细节调整

src/views/basic/askTestQuestion/components/wrongQuestionDialog.vue
@@ -429,20 +429,20 @@ export default { @@ -429,20 +429,20 @@ export default {
429 }, 429 },
430 onIFrameLoad(id) { 430 onIFrameLoad(id) {
431 const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe 431 const iframeRef = this.$refs["iframe" + id][0]; // 获取对应的 iframe
432 - const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;  
433 - const body = iframeRef.contentWindow.document.body;  
434 - body.style.overflowX = "hidden"; // 不允许出现横向滚动条  
435 - const height = body.offsetHeight; // 获取内容的高度  
436 - console.log(height, "height");  
437 - console.log(body, "body");  
438 - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度  
439 - // 获取第一个P标签  
440 - const firstP = doc.getElementsByTagName("p")[0];  
441 - // 或者修改第一个 < p > 标签的内容;  
442 - if (firstP) {  
443 - let a = this.processString(firstP.innerHTML);  
444 - firstP.innerHTML = a;  
445 - } 432 + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
  433 + // const body = iframeRef.contentWindow.document.body;
  434 + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  435 + // const height = body.offsetHeight; // 获取内容的高度
  436 + // console.log(height, "height");
  437 + // console.log(body, "body");
  438 + // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度
  439 + // // 获取第一个P标签
  440 + // const firstP = doc.getElementsByTagName("p")[0];
  441 + // // 或者修改第一个 < p > 标签的内容;
  442 + // if (firstP) {
  443 + // let a = this.processString(firstP.innerHTML);
  444 + // firstP.innerHTML = a;
  445 + // }
446 }, 446 },
447 447
448 // 启动编辑模式 448 // 启动编辑模式
@@ -810,14 +810,16 @@ export default { @@ -810,14 +810,16 @@ export default {
810 ); 810 );
811 }, 811 },
812 dataYesNo(data) { 812 dataYesNo(data) {
813 - if (data.length < 1 && !data) { 813 + if (data.length < 1) {
814 return true; 814 return true;
815 } 815 }
816 let list = []; 816 let list = [];
817 data.forEach((item) => { 817 data.forEach((item) => {
818 list.push(...item.subQuestionIds); 818 list.push(...item.subQuestionIds);
819 }); 819 });
820 - if (list.length < 1 && !list) { 820 + console.log(list, "list");
  821 +
  822 + if (list.length < 1) {
821 return true; 823 return true;
822 } else { 824 } else {
823 return false; 825 return false;
src/views/basic/askTestQuestion/wrongQuestion.vue
@@ -657,23 +657,23 @@ export default { @@ -657,23 +657,23 @@ export default {
657 // let a = this.processString(firstP.innerHTML); 657 // let a = this.processString(firstP.innerHTML);
658 // firstP.innerHTML = a; 658 // firstP.innerHTML = a;
659 // } 659 // }
660 - const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;  
661 - const body = iframeRef.contentWindow.document.body;  
662 - body.style.overflowX = "hidden"; // 不允许出现横向滚动条  
663 - const height = body.offsetHeight; // 获取内容的高度  
664 - console.log(height, "height");  
665 - // console.log("body.offsetHeight:", body.offsetHeight);  
666 - // console.log("body.clientHeight:", body.clientHeight);  
667 - // console.log("body.scrollHeight:", body.scrollHeight);  
668 -  
669 - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度  
670 - // 获取第一个P标签  
671 - const firstP = doc.getElementsByTagName("p")[0];  
672 - // 或者修改第一个 < p > 标签的内容;  
673 - if (firstP) {  
674 - let a = this.processString(firstP.innerHTML);  
675 - firstP.innerHTML = a;  
676 - } 660 + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
  661 + // const body = iframeRef.contentWindow.document.body;
  662 + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  663 + // const height = body.offsetHeight; // 获取内容的高度
  664 + // console.log(height, "height");
  665 + // // console.log("body.offsetHeight:", body.offsetHeight);
  666 + // // console.log("body.clientHeight:", body.clientHeight);
  667 + // // console.log("body.scrollHeight:", body.scrollHeight);
  668 +
  669 + // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度
  670 + // // 获取第一个P标签
  671 + // const firstP = doc.getElementsByTagName("p")[0];
  672 + // // 或者修改第一个 < p > 标签的内容;
  673 + // if (firstP) {
  674 + // let a = this.processString(firstP.innerHTML);
  675 + // firstP.innerHTML = a;
  676 + // }
677 }, 677 },
678 678
679 // 子集删除后 父级需要更新 679 // 子集删除后 父级需要更新