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

print-design

v1.0.5

Published

打印模板

Downloads

1

Readme

打印模板插件

  • vue3 demo

http://git.ppst.top/pp/vue3-print-design

安装

pnpm install  print-design

使用

import {  
hiprint,
defaultElementTypeProvider,
defaultPaperTypes,
defaultPanels,
getSubTabulationConfig,
defaultFontList 
} from "print-design";
//  hiprint

属性方法

hiprint

web 打印的js组件

defaultElementTypeProvider()

  • 默认属性组件([])

  • 参数:数组

  • 传入子表参数,可以显示多个子表组件

defaultFontList()

  • 默认字体列表数据

  • 返回数组

return [
		{ title: "微软雅黑", value: "Microsoft YaHei" },
		{ title: "黑体", value: "STHeitiSC-Light" },
		{ title: "思源黑体", value: "SourceHanSansCN-Normal" },
		{ title: "王羲之书法体", value: "王羲之书法体" },
		{ title: "宋体", value: "SimSun" },
		{ title: "华为楷体", value: "STKaiti" },
		{ title: "cursive", value: "cursive" },
	]

defaultPaperTypes()

  • 默认纸张

  • 返回属性

return {
		A3: {
			width: 420,
			height: 296.6,
		},
		A4: {
			width: 210,
			height: 296.6,
		},
		A5: {
			width: 210,
			height: 147.6,
		},
		B3: {
			width: 500,
			height: 352.6,
		},
		B4: {
			width: 250,
			height: 352.6,
		},
		B5: {
			width: 250,
			height: 175.6,
		},
	};

defaultPanels()

返回默认面板属性

return {
		panels: [
			{
				index: 0,
				name: 1,
				height: 297,
				width: 210,
				paperHeader: 49.5,
				paperFooter: 780,
				printElements: [],
				paperNumberLeft: 565.5,
				paperNumberTop: 819,
				watermarkOptions: {},
			},
		],
	}

getSubTabulationConfig(tid, title, tableName, fields, columns)

根据传参返回子表配置(tid, title, tableName, fields, columns)

  • tid 对应 左侧菜单tid

  • title 左侧菜单显示名称

  • tableName 名称

  • fields 子表下拉可选值 数组

  • columns 子表列数据

方法: setFieldsLocalStorage

设置api主表数据

//  主表数据mainFields
hiprint.PrintElementTypeManager.setFieldsLocalStorage(mainFields);

方法 setDefaultLogoLocalStorage

设置图片默认地址

 hiprint.PrintElementTypeManager.setDefaultLogoLocalStorage(
        url
      );

方法: setPreviewContentDesign

预览

// 参数: id,打印模板,api数据
hiprint.PrintElementTypeManager.setPreviewContentDesign('preview_content_design',hiprintTemplate,printApiData);

方法: clickRightPropertyBox

点击展示打印模板属性面板

// 点击展示打印模板属性面板
hiprint.PrintElementTypeManager.clickRightPropertyBox();