PC端富文本-移动端HTML联动原创
金蝶云社区-云社区用户6QzL0379
云社区用户6QzL0379
2人赞赏了该文章 270次浏览 未经作者许可,禁止转载编辑于2024年04月09日 17:19:39

需求描述:PC端维护富文本数据-移动端进行展示

PC端富文本保存:通过大文本储存

RichTextEditor richTextEditor = this.getControl("富文本编辑器标识");
String text = richTextEditor.getText();
if (StringUtils.isNotEmpty(text)) {
    this.getModel().setValue("大文本标识_tag", text);
}

PC端富文本展示:取值大文本内容

String  largeText = (String) this.getModel().getValue("大文本标识_tag");
if (StringUtils.isBlank(largeText)) {
    return;
}
RichTextEditor richTextEditor = this.getControl("富文本编辑器标识");
richTextEditor.setText(largeText);

移动端-HTML控件展示:取值大文本内容

Object content = this.getModel().getValue("大文本标识_tag");
Html htmlap = this.getView().getControl("htmlap");
htmlap.setConent(content.toString());

由于默认布局方式应该不一样,需要更改自定义样式

image.png

效果图:

更改前:

1fcfc2f3c9478078d863270e032161c.png

更改后:

image.png

赞 2