Infopath入门到精通系列-7 Infopath 生成html

1、Infopath 介绍

Infopath工具保存后默认生成xsn格式的文件。
在这里插入图片描述
将上图中的文件后缀名修改为全国面上广告申请.zip 并进行解压。如下图所示:
在这里插入图片描述
效果图如下:
在这里插入图片描述

2、Infopath 内容转换为html思路

Infopath包含有html样式,元数据信息。用户可以根据元数据信息进行关键信息的获取,然后进行内容的占位处理,比如${请假天数} 则可以转换为 <el-input v-model="input" placeholder="请输入内容"></el-input>。思路如下
1、xsn文件信息的上传和解析
2、xsn 中xsd元数据信息获取,xsl内容获取。
3、视图的解析,系统需要区分出来主表、子表(Table).主表的直接渲染魏组件,子表的需要使用table形式的进行展示
4、生成html

3、Infopath 主表 子表内容解析封装

public FormTableBean getMasterTableBean() {
        List<FormTableBean> tableList = getTableList();
        for (int i = 0; i < tableList.size(); i++) {
            FormTableBean tableBean = tableList.get(i);
            if (tableBean.isMainTable()) {
                return tableBean;
            }
        }
        return null;
    }

    public List<FormTableBean> getSubTableBean() {
        List<FormTableBean> tableList = getTableList();
        List<FormTableBean> subList = new ArrayList<FormTableBean>();
        for (int i = 0; i < tableList.size(); i++) {
            FormTableBean tableBean = tableList.get(i);
            if (!tableBean.isMainTable()) {
                subList.add(tableBean);
            }
        }
        return subList;
    }

4、Infopath 字段信息封装

在这里插入图片描述
在这里插入图片描述


   Map<String, FormFieldBean> fieldMap4Name = mainFormTableBean.getFieldMap4Name();
   @Getter
@Setter
public class FormFieldBean  extends BasePO {
    public static final String FORM_FIELD_PRE = "field";
    public static final String FORM_FIELD_REG = "field\\d+";
    private String name;
    private String display;
    private FieldOptionBean fieldOptionBean;
    private String fieldType;
    private String currentUserName;
    private String fieldLength;
    private String digitNum;
    private boolean isNull;

}

infopath地址:https://gitee.com/pangu-dm/infopath

上面文章来自盘古BPM研究院:http://vue.pangubpm.com/
文章翻译提交:https://github.com/qiudaoke/flowable-userguide
了解更多文章可以关注微信公众号:
在这里插入图片描述

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值