Commit 78d8475793f479479961e403f7a71407eff06735

Authored by 刘有才luck
1 parent 27fca4d6

wip: bug修复

src/views/basic/askTestQuestion/wrongQuestion.vue
@@ -658,23 +658,23 @@ export default { @@ -658,23 +658,23 @@ export default {
658 // let a = this.processString(firstP.innerHTML); 658 // let a = this.processString(firstP.innerHTML);
659 // firstP.innerHTML = a; 659 // firstP.innerHTML = a;
660 // } 660 // }
661 - const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;  
662 - const body = iframeRef.contentWindow.document.body;  
663 - body.style.overflowX = "hidden"; // 不允许出现横向滚动条  
664 - const height = body.offsetHeight; // 获取内容的高度  
665 - console.log(height, "height");  
666 - // console.log("body.offsetHeight:", body.offsetHeight);  
667 - // console.log("body.clientHeight:", body.clientHeight);  
668 - // console.log("body.scrollHeight:", body.scrollHeight);  
669 -  
670 - iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度  
671 - // 获取第一个P标签  
672 - const firstP = doc.getElementsByTagName("p")[0];  
673 - // 或者修改第一个 < p > 标签的内容;  
674 - if (firstP) {  
675 - let a = this.processString(firstP.innerHTML);  
676 - firstP.innerHTML = a;  
677 - } 661 + // const doc = iframeRef.contentDocument || iframeRef.contentWindow.document;
  662 + // const body = iframeRef.contentWindow.document.body;
  663 + // body.style.overflowX = "hidden"; // 不允许出现横向滚动条
  664 + // const height = body.offsetHeight; // 获取内容的高度
  665 + // console.log(height, "height");
  666 + // // console.log("body.offsetHeight:", body.offsetHeight);
  667 + // // console.log("body.clientHeight:", body.clientHeight);
  668 + // // console.log("body.scrollHeight:", body.scrollHeight);
  669 +
  670 + // iframeRef.style.height = `${height + 20}px`; // 设置 iframe 的高度
  671 + // // 获取第一个P标签
  672 + // const firstP = doc.getElementsByTagName("p")[0];
  673 + // // 或者修改第一个 < p > 标签的内容;
  674 + // if (firstP) {
  675 + // let a = this.processString(firstP.innerHTML);
  676 + // firstP.innerHTML = a;
  677 + // }
678 }, 678 },
679 679
680 // 子集删除后 父级需要更新 680 // 子集删除后 父级需要更新
@@ -700,7 +700,7 @@ export default { @@ -700,7 +700,7 @@ export default {
700 const parts = num.toString().split("."); 700 const parts = num.toString().split(".");
701 if (parts.length === 2 && parts[1].length > 2) { 701 if (parts.length === 2 && parts[1].length > 2) {
702 // 如果小数部分超过两位,保留两位小数 702 // 如果小数部分超过两位,保留两位小数
703 - return parseFloat(num.toFixed(2)); 703 + return Math.round(num * 100) / 100;
704 } else { 704 } else {
705 // 否则返回原数据 705 // 否则返回原数据
706 return num; 706 return num;