0.1.0-beta4 • Published 11 months ago
@code4x/print-form v0.1.0-beta4
@code4x/print-form
安装
推荐使用pnpm 安装
@code4x/print-form
需要依赖@code4x/cw-utils
这个工具包
npm install @code4x/cw-utils @code4x/print-form
or
pnpm add @code4x/cw-utils @code4x/print-form
props
属性名称 | 描述 | 属性类型 | 默认值 | 必填 |
---|---|---|---|---|
title | 表单标题 | string | 是 | |
dataForm | 表单数据对象 | object | 是 | |
formItems | 表单item列表 | array | 详见下表 | 是 |
formItem
属性名称 | 描述 | 属性类型 | 默认值 | 必填 |
---|---|---|---|---|
type | 表单项类型 | string | 详见type表 | 是 |
colAttrs | 表单项分栏 | object | 参考el-col | 否 |
formAttrs | 表单项配置 | object | 参考el-form-item 配置 | 否 |
contentAttrs | 表单项内容配置 | object | 根据不同控件参考,如text 参考el-input | 否 |
title | 仅type='table'时有效,子表标题 | string | 否 | |
prop | 仅type='table'时有效,子表字段名称 | string | 否 | |
showSummaryRow | 仅type='table'时有效,是否显示子表合计行 | string | 否 | |
columns | 仅type='table'时有效,子表列配置 | string | 详见columns | 否 |
options | 仅type='select'时有效,下拉选项列表 | string | 详见columns | 否 |
type
属性名称 | 描述 | 备注 |
---|---|---|
date | 日期 | 表单项支持在contentAttrs 中添加 format:'YYYY-MM-DD' 等支持的格式格式化,子表则在attrs |
time | 时间 | 表单项支持在contentAttrs 中添加 format:'YYYY-MM-DD' 等支持的格式格式化,子表则在attrs |
datetime | 日期时间 | 表单项支持在contentAttrs 中添加 format:'YYYY-MM-DD' 等支持的格式格式化,子表则在attrs |
year | 年 | 表单项支持在contentAttrs 中添加 format:'YYYY-MM-DD' 等支持的格式格式化,子表则在attrs |
daterange | 时间段 | 表单项支持在contentAttrs 中添加 format:'YYYY-MM-DD' 等支持的格式格式化,子表则在attrs |
amount | 金额 | 默认千分符分隔 |
number | 数字 | 默认千分符分隔 |
select | 下拉 | 默认千分符分隔 |
select | 下拉 | 支持树形下拉 |
fileList | 文件列表 | |
cbkm | 成本科目 | |
cbkzjd | 成本控制节点 | |
address | 地址 | |
userSelect | 用户下拉 | |
html | html |
columns
属性名称 | 描述 | 属性类型 | 默认值 | 必填 |
---|---|---|---|---|
type | 列字段类型 | string | 参考type | 是 |
attrs | 列字段配置 | object | 详见 attrs | 是 |
options | 仅type="select"有效, 下拉列表,支持树形下拉 | object | 详见 attrs | 是 |
attrs
属性名称 | 描述 | 属性类型 | 默认值 | 必填 |
---|---|---|---|---|
label | 列标题 | string | 是 | |
prop | 列字段 | object | --- | 是 |
format | 进type 为日期类型或者日期段时有效 | string | --- | 否 |
更新记录
2023年6月2日
- feat.新增日期传入
format
自定义格式化样式
2023年4月27日
- 兼容vite
新增支持附件列表打印,需要设置
type
为fileList
,注意值必须是一个JSON数组
2023年4月23日
- 修复代码异常
0.1.0-beta4
11 months ago
0.1.0-beta3
1 year ago
0.1.0-beta2
1 year ago
0.1.0-beta1
1 year ago
0.1.0-beta
1 year ago