npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@code4x/print-form

v0.1.0-beta4

Published

## 安装

Downloads

3

Readme

@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
  • 新增支持附件列表打印,需要设置 typefileList,注意值必须是一个JSON数组

2023年4月23日

  • 修复代码异常