mirror of https://github.com/jeecgboot/jeecg-boot
通知公告
parent
7f0c035c4c
commit
de3285dc1b
|
@ -128,8 +128,32 @@
|
||||||
</#if>
|
</#if>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div id="content"></div>
|
||||||
${data.msgContent!''}
|
<script>
|
||||||
</div>
|
//update-begin-author:liusq---date:2023-10-30--for: 【QQYUN-6802】查看公告详情,此段端渲染有问题
|
||||||
|
// 获取富文本内容的容器元素
|
||||||
|
let contentContainer = document.getElementById('content');
|
||||||
|
|
||||||
|
// 富文本内容
|
||||||
|
let richText = `${data.msgContent!""}`;
|
||||||
|
if(richText.includes("<") || richText.includes(">")){
|
||||||
|
richText = richText.replace(/</g, '<').replace(/>/g, '>');
|
||||||
|
}
|
||||||
|
// 将富文本内容插入到容器中
|
||||||
|
contentContainer.innerHTML = richText;
|
||||||
|
// 找到所有的iframe元素
|
||||||
|
let iframes = contentContainer.getElementsByTagName('iframe');
|
||||||
|
|
||||||
|
// 动态加载和渲染每个iframe
|
||||||
|
Array.prototype.forEach.call(iframes, function(iframe) {
|
||||||
|
iframe.onload = function() {
|
||||||
|
// iframe加载完成后,调整它的高度以适应内容
|
||||||
|
iframe.style.width = '100%';
|
||||||
|
iframe.style.height = iframe.contentWindow.document.body.scrollHeight +'px';
|
||||||
|
};
|
||||||
|
iframe.src = iframe.getAttribute('src');
|
||||||
|
});
|
||||||
|
//update-end-author:liusq---date:2023-10-30--for: 【QQYUN-6802】查看公告详情,此段端渲染有问题
|
||||||
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
Loading…
Reference in New Issue