Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

支持使用一个占位符批量渲染多个图像 #1164

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

yangbuyiya
Copy link

sayi 作者你好,因业务需求需要一个列表的单元格里面渲染多个图片所以改动了一下代码,没有啥规范的

新增了 ObjectToPicturesRenderDataConverter 因原来的无法达到List

    public List<PictureRenderData> convert(Object source) throws Exception {
        List<PictureRenderData> pictureRenderDataList = new ArrayList<>();
        // 多图片循环解析
        if (source instanceof List) {
            for (Object o : ((List) source)) {
                pictureRenderDataList.add(Pictures.of(o.toString()).fitSize().create());
            }
        } else {
            // 其他类型的使用原来逻辑
            if (null == source || source instanceof PictureRenderData){
                PictureRenderData source1 = (PictureRenderData) source;
                pictureRenderDataList.add(source1);
            } else {
                pictureRenderDataList.add(Pictures.of(source.toString()).fitSize().create());
            }
        }
        return pictureRenderDataList;
    }

image

但请别合并此pr,我看仓库没有issue的窗口则发起了PR,代码改的很垃,但是可以测试通过,思路就是移除,默认的只能一个图片的规则解析器支持集合进行操作。

如果可以的话,看看是否符合逻辑有时间您操作操作支持一下多个图片

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant