接口, 出库,任务下发
This commit is contained in:
1 parent
f5423e78fe
commit
5c13b2a85c
38 files changed
+22919
-115
No files matched your search
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2021 CcSimple
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,523 @@
|
||||
<div align="center" style="margin-top: 10px">
|
||||
<a href="http://hiprint.io/">
|
||||
<img width="100" height="100" src="http://hiprint.io/Content/assets/hi.png">
|
||||
</a>
|
||||
<a href="https://cn.vuejs.org/">
|
||||
<img width="100" height="100" src="https://v2.cn.vuejs.org/images/logo.svg">
|
||||
</a>
|
||||
</div>
|
||||
|
||||

|
||||

|
||||
<a href="https://gitee.com/CcSimple/vue-plugin-hiprint">
|
||||
<img src="https://gitee.com/CcSimple/vue-plugin-hiprint/badge/star.svg?theme=dark" alt="Gitee star">
|
||||
</a>
|
||||
<a href="https://gitee.com/CcSimple/vue-plugin-hiprint">
|
||||
<img src="https://gitee.com/CcSimple/vue-plugin-hiprint/badge/fork.svg?theme=dark" alt="Gitee fork">
|
||||
</a>
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
|
||||
## 关于此插件
|
||||
|
||||
vue-plugin-hiprint(基于[hiprint 2.5.4](http://hiprint.io/)) 当时只是为了方便<span style="color: red">我(并非hiprint原作者)</span> 在vue项目中引入使用,所以以此命名。
|
||||
|
||||
此<span style="color: red">插件</span>仅仅是一个<span style="color: red">JavaScript【工具库】</span>而非 <span style="color: yellow">Vue【组件库】</span>,所以它默认是不包含demo中所见的那些组件页面的(demo代码随便复制修改拿去用)。
|
||||
|
||||
由于hiprint官网最后一次更新时间为2019年【hiprint 2.5.4 是 [LGPL](#关于lgpl协议) 协议】,后在诸多使用者及反馈下进行了许多优化调整。[详情](CHANGELOG.md)(同时感谢各位群友支持和参与)
|
||||
|
||||
## vue-plugin-hiprint
|
||||
> hiprint for Vue2.x / Vue3.x (基于jQuery, 理论上应该也是支持其他框架的)
|
||||
|
||||
> **jQuery/uniapp** 项目 见下方 [jQuery/uniapp 项目使用](#jQuery/uniapp 项目使用)
|
||||
|
||||
## 注意事项!!
|
||||
|
||||
- <div style="color: red">不要用本项目设计导出的模板,在官网提供的版本中使用!</div>
|
||||
- <div style="color: red">不要用本项目设计导出的模板,在官网提供的版本中使用!</div>
|
||||
- <div style="color: red">不要用本项目设计导出的模板,在官网提供的版本中使用!</div>
|
||||
- <div style="color: orange">请使用我提供的打印客户端,或者自行修改打印客户端的源码,以适配本项目的模板!</div>
|
||||
- <div style="color: orange">请使用我提供的打印客户端,或者自行修改打印客户端的源码,以适配本项目的模板!</div>
|
||||
- <div style="color: orange">请使用我提供的打印客户端,或者自行修改打印客户端的源码,以适配本项目的模板!</div>
|
||||
- 主分支是融合版本的最新代码,如果你不需要修改 hiprint 相关代码. 请使用 npm 包的方式安装.
|
||||
- 使用直接客户端时,本地开发连接没问题,部署到线上出现跨域无法连接打印客户端问题:
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
|
||||
## 快速链接
|
||||
|
||||
Demo预览:[https://ccsimple.gitee.io/vue-plugin-hiprint/](https://ccsimple.gitee.io/vue-plugin-hiprint/)
|
||||
|
||||
更新记录:[npm包版本及更新记录](CHANGELOG.md)
|
||||
|
||||
打印客户端:[https://gitee.com/CcSimple/electron-hiprint](https://gitee.com/CcSimple/electron-hiprint)
|
||||
|
||||
## 文章链接
|
||||
|
||||
入门篇: [【vue-plugin-hiprint】使用-入门篇](https://mp.weixin.qq.com/s/4N4f7CkxodA-fuTJ_FbkOQ)
|
||||
|
||||
进阶篇: [【vue-plugin-hiprint】使用-进阶篇](https://mp.weixin.qq.com/s/LYZP2iqV0gy4m76mttplAw)
|
||||
|
||||
provider: [【vue-plugin-hiprint】如何自定义可拖拽元素 provider](https://mp.weixin.qq.com/s/n9i1j8hhVJvnlfJRPRtWog)
|
||||
|
||||
打印篇: [【vue-plugin-hiprint】使用-打印篇](https://mp.weixin.qq.com/s/P-Zz8YfELmRNi4EuED4QmA)
|
||||
|
||||
参数篇: [【vue-plugin-hiprint】使用-参数篇](https://mp.weixin.qq.com/s/vfgSG62tAXn7Ot7y3x68fw)
|
||||
|
||||
实战动态provider: [【vue-plugin-hiprint】实战-动态provider](https://mp.weixin.qq.com/s/UVkhul1tynjaUjdC_NaHfw)
|
||||
|
||||
实战动态模板: [【vue-plugin-hiprint】实战-动态模板](https://mp.weixin.qq.com/s/JXXC9Fyy_PgPXrwh1mDBTQ)
|
||||
|
||||
常见问题汇总①: [【vue-plugin-hiprint】常见问题汇总①](https://mp.weixin.qq.com/s/E-ZfuKLH3-GvKn4AosRvaw)
|
||||
|
||||
常见问题汇总②: [【vue-plugin-hiprint】常见问题汇总②](https://mp.weixin.qq.com/s/UEnr24bB_P6KmpZ7iZmYvA)
|
||||
|
||||
常见问题汇总③: [【vue-plugin-hiprint】常见问题汇总③](https://mp.weixin.qq.com/s/lRimQ-cjuwN3mg6RicPyag)
|
||||
|
||||
## 更多参数的文档请仔细查阅文档
|
||||
|
||||
hiprint官方文档:[http://hiprint.io/docs/start](http://hiprint.io/docs/start)
|
||||
|
||||
本人写的部分文档: [https://ccsimple.gitee.io/sv-print-docs/config/hiprint.html](https://ccsimple.gitee.io/sv-print-docs/config/hiprint.html)
|
||||
|
||||
## 安装使用
|
||||
```
|
||||
npm install vue-plugin-hiprint
|
||||
```
|
||||
|
||||
```html
|
||||
<!--【必须】在index.html 文件中添加打印所需样式(此cdn可能不稳定):-->
|
||||
<link rel="stylesheet" type="text/css" media="print" href="https://cdn.jsdelivr.net/npm/vue-plugin-hiprint@latest/dist/print-lock.css">
|
||||
<!-- 可以调整成 相对链接/自有链接, 【重要】名称需要一致 【print-lock.css】-->
|
||||
<link rel="stylesheet" type="text/css" media="print" href="/print-lock.css">
|
||||
```
|
||||
|
||||
## 项目截图
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/img_0.png"/></td>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/img_1.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/img_2.png"/></td>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/img_3.png"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/gif00.gif"/></td>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/gif01.gif"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
|
||||
## 拖拽设计使用
|
||||
```javascript
|
||||
import {hiprint,defaultElementTypeProvider} from 'vue-plugin-hiprint'
|
||||
// 初始化可拖拽的元素
|
||||
hiprint.init({
|
||||
providers: [new defaultElementTypeProvider()]
|
||||
})
|
||||
// $('.ep-draggable-item') 包含 tid, 与上边的 provider 中的 tid 对应 才能正常拖拽生成元素
|
||||
hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'));
|
||||
hiprintTemplate = new hiprint.PrintTemplate({
|
||||
template: {}, // 模板json
|
||||
settingContainer: '#PrintElementOptionSetting', // 元素参数容器
|
||||
paginationContainer: '.hiprint-printPagination', // 多面板的容器, 实现多面板, 需要在添加一个 <div class="hiprint-printPagination"/>
|
||||
// ------- 下列是可选功能 -------
|
||||
// ------- 下列是可选功能 -------
|
||||
// ------- 下列是可选功能 -------
|
||||
// 图片选择功能
|
||||
onImageChooseClick: (target) => {
|
||||
// 测试 3秒后修改图片地址值
|
||||
setTimeout(() => {
|
||||
// target.refresh(url,options,callback)
|
||||
// callback(el, width, height) // 原元素,宽,高
|
||||
// target.refresh(url,false,(el,width,height)=>{
|
||||
// el.options.width = width;
|
||||
// el.designTarget.css('width', width + "pt");
|
||||
// el.designTarget.children('.resize-panel').trigger($.Event('click'));
|
||||
// })
|
||||
target.refresh("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAtAAAAIIAQMAAAB99EudAAAABlBMVEUmf8vG2O41LStnAAABD0lEQVR42u3XQQqCQBSAYcWFS4/QUTpaHa2jdISWLUJjjMpclJoPGvq+1WsYfiJCZ4oCAAAAAAAAAAAAAAAAAHin6pL9c6H/fOzHbRrP0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0u/SY9LS0tLS0tLS0tLS0n+edm+UlpaWlpaWlpaWlpaW/tl0Ndyzbno7/+tPTJdd1wal69dNa6abx+Lq6TSeYtK7BX/Diek0XULSZZrakPRtV0i6Hu/KIt30q4fM0pvBqvR9mvsQkZaW9gyJT+f5lsnzjR54xAk8mAUeJyMPwYFH98ALx5Jr0kRLLndT7b64UX9QR/0eAAAAAAAAAAAAAAAAAAD/4gpryzr/bja4QgAAAABJRU5ErkJggg==",{
|
||||
// auto: true, // 根据图片宽高自动等比(宽>高?width:height)
|
||||
// width: true, // 按宽调整高
|
||||
// height: true, // 按高调整宽
|
||||
real: true // 根据图片实际尺寸调整(转pt)
|
||||
})
|
||||
}, 3000)
|
||||
// target.getValue()
|
||||
// target.refresh(url)
|
||||
},
|
||||
// 自定义可选字体
|
||||
// 或者使用 hiprintTemplate.setFontList([])
|
||||
// 或元素中 options.fontList: []
|
||||
fontList: [
|
||||
{title: '微软雅黑', value: 'Microsoft YaHei'},
|
||||
{title: '黑体', value: 'STHeitiSC-Light'},
|
||||
{title: '思源黑体', value: 'SourceHanSansCN-Normal'},
|
||||
{title: '王羲之书法体', value: '王羲之书法体'},
|
||||
{title: '宋体', value: 'SimSun'},
|
||||
{title: '华为楷体', value: 'STKaiti'},
|
||||
{title: 'cursive', value: 'cursive'},
|
||||
],
|
||||
dataMode: 1, // 1:getJson 其他:getJsonTid 默认1
|
||||
history: true, // 是否需要 撤销重做功能
|
||||
onDataChanged: (type, json) => { // 模板发生改变回调
|
||||
console.log(type); // 新增、移动、删除、修改(参数调整)、大小、旋转
|
||||
console.log(json); // 返回 template
|
||||
},
|
||||
onUpdateError: (e) => { // 更新失败回调
|
||||
console.log(e);
|
||||
},
|
||||
});
|
||||
// 设计器的容器
|
||||
hiprintTemplate.design('#hiprint-printTemplate');
|
||||
```
|
||||
|
||||
## 代码模式使用
|
||||
|
||||
```javascript
|
||||
import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint'
|
||||
// 引入后使用示例
|
||||
hiprint.init();
|
||||
// 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
|
||||
// 想要实现拖拽设计页面,请往下看 '自定义设计'
|
||||
var hiprintTemplate = new hiprint.PrintTemplate();
|
||||
var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 });
|
||||
//文本
|
||||
panel.addPrintText({ options: { width: 140, height: 15, top: 20, left: 20, title: 'hiprint插件手动添加text', textAlign: 'center' } });
|
||||
//条形码
|
||||
panel.addPrintText({ options: { width: 140, height: 35, top: 40, left: 20, title: '123456', textType: 'barcode' } });
|
||||
//二维码
|
||||
panel.addPrintText({ options: { width: 35, height: 35, top: 40, left: 165, title: '123456', textType: 'qrcode' } });
|
||||
//长文本
|
||||
panel.addPrintLongText({ options: { width: 180, height: 35, top: 90, left: 20, title: '长文本:hiprint是一个很好的webjs打印,浏览器在的地方他都可以运行' } });
|
||||
//打印
|
||||
hiprintTemplate.print({});
|
||||
```
|
||||
|
||||
## vue/vue3 全局引入
|
||||
|
||||
> 全局引入,方便在任何地方不引入直接调用打印。示例为代码模式 (拖拽设计请往下看)
|
||||
|
||||
```javascript
|
||||
// main.js中 引入安装
|
||||
import {hiPrintPlugin} from 'vue-plugin-hiprint'
|
||||
Vue.use(hiPrintPlugin, '$pluginName')
|
||||
hiPrintPlugin.disAutoConnect(); // 取消自动连接直接打印客户端
|
||||
|
||||
// 下列代码为示例,不要再 main.js中 使用
|
||||
// 引入后使用示例
|
||||
this.$pluginName.init();
|
||||
// 下列方法都是没有拖拽设计页面的, 相当于代码模式, 使用代码设计页面
|
||||
// 想要实现拖拽设计页面,请往下看 '自定义设计'
|
||||
var hiprintTemplate = new this.$pluginName.PrintTemplate();
|
||||
var panel = hiprintTemplate.addPrintPanel({ width: 100, height: 130, paperFooter: 340, paperHeader: 10 });
|
||||
//文本
|
||||
panel.addPrintText({ options: { width: 140, height: 15, top: 20, left: 20, title: 'hiprint插件手动添加text', textAlign: 'center' } });
|
||||
//条形码
|
||||
panel.addPrintText({ options: { width: 140, height: 35, top: 40, left: 20, title: '123456', textType: 'barcode' } });
|
||||
//二维码
|
||||
panel.addPrintText({ options: { width: 35, height: 35, top: 40, left: 165, title: '123456', textType: 'qrcode' } });
|
||||
//长文本
|
||||
panel.addPrintLongText({ options: { width: 180, height: 35, top: 90, left: 20, title: '长文本:hiprint是一个很好的webjs打印,浏览器在的地方他都可以运行' } });
|
||||
//表格
|
||||
panel.addPrintTable({ options: { width: 252, height: 35, top: 130, left: 20, content: $('#testTable').html() } });
|
||||
//Html
|
||||
panel.addPrintHtml({ options: { width: 140, height: 35, top: 180, left: 20, content:'' } });
|
||||
//竖线//不设置宽度
|
||||
panel.addPrintVline({ options: { height: 35, top: 230, left: 20 } });
|
||||
//横线 //不设置高度
|
||||
panel.addPrintHline({ options: { width: 140, top: 245, left: 120 } });
|
||||
//矩形
|
||||
panel.addPrintRect({ options: { width: 35, height: 35, top: 230, left: 60 } });
|
||||
//打印
|
||||
hiprintTemplate.print({});
|
||||
//直接打印,需要安装客户端
|
||||
hiprintTemplate.print2({});
|
||||
```
|
||||
|
||||
## jQuery/uniapp 项目使用
|
||||
|
||||
> uniapp 需要嵌入到 web 浏览器中.(需要支持 window 全局对象环境)
|
||||
|
||||
```html
|
||||
<!-- index.html -->
|
||||
<head>
|
||||
<!-- 打印样式是必须的,你可以调整成自由链接, 注意名称 print-lock.css -->
|
||||
<link rel="stylesheet" type="text/css" media="print" href="https://unpkg.com/vue-plugin-hiprint@latest/dist/print-lock.css" />
|
||||
<!-- 下列使用的都是 unpkg提供的 稳定性未知, 建议下载自行处理 -->
|
||||
<!-- jquery 必须 -->
|
||||
<script src="https://unpkg.com/jquery@3.6.1/dist/jquery.js"></script>
|
||||
<!-- 条形码 -->
|
||||
<script src="https://unpkg.com/jsbarcode@3.11.5/dist/JsBarcode.all.min.js"></script>
|
||||
<!-- 颜色选择器 -->
|
||||
<script src="https://unpkg.com/@claviska/jquery-minicolors@2.3.6/jquery.minicolors.min.js"></script>
|
||||
<!-- 直接打印(print2)需要 -->
|
||||
<script src="https://unpkg.com/socket.io-client@4.5.1/dist/socket.io.min.js"></script>
|
||||
<!-- toPdf需要 -->
|
||||
<script src="https://unpkg.com/canvg@3.0.10/lib/umd.js"></script>
|
||||
<script src="https://unpkg.com/jspdf@2.5.1/dist/jspdf.umd.min.js"></script>
|
||||
<script src="https://unpkg.com/html2canvas@1.4.1/dist/html2canvas.js"></script>
|
||||
<!-- vue-plugin-hiprint 😃 -->
|
||||
<script src="https://unpkg.com/vue-plugin-hiprint@latest/dist/vue-plugin-hiprint.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- 注意 defer -->
|
||||
<script defer>
|
||||
console.log('vue-plugin-hiprint')
|
||||
console.log(window['vue-plugin-hiprint'])
|
||||
console.log('hiprint')
|
||||
// hiprint 以注入 全局
|
||||
console.log(hiprint)
|
||||
var autoConnect = window['vue-plugin-hiprint'].autoConnect,
|
||||
disAutoConnect = window['vue-plugin-hiprint'].disAutoConnect,
|
||||
defaultElementTypeProvider = window['vue-plugin-hiprint'].defaultElementTypeProvider;
|
||||
</script>
|
||||
</body>
|
||||
```
|
||||
|
||||
## 配套直接打印客户端(win/mac/linux)
|
||||
<div style="color:red">如果使用npm包或者本项目,请使用如下样子的直接打印客户端</div>
|
||||
<div style="color:red">如果使用npm包或者本项目,请使用如下样子的直接打印客户端</div>
|
||||
<div style="color:red">如果使用npm包或者本项目,请使用如下样子的直接打印客户端</div>
|
||||
<div align="center">
|
||||
|
||||

|
||||
|
||||
</div>
|
||||
<div style="color:red">本项目需要上面样式的直接打印客户端; 下载地址见下表:</div>
|
||||
|
||||
| 版本 | 下载地址 |
|
||||
|------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
|
||||
| Win64 | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_win_x64-1.0.6.exe">下载(v1.0.6)</a> |
|
||||
| Win32 | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_win_x32-1.0.6.exe">下载(v1.0.6)</a> |
|
||||
| Linux64 (需要桌面系统) | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_linux_64-1.0.6.tar.xz">下载(v1.0.6)</a> |
|
||||
| Linux64 arm64 (需要桌面系统) | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_linux_arm64-1.0.6.tar.xz">下载(v1.0.6)</a> |
|
||||
| Mac (intel) | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_mac_x64-1.0.6.dmg">下载(v1.0.6)</a> |
|
||||
| Mac (M1) | <a href="https://gitee.com/CcSimple/electron-hiprint/releases/download/1.0.6/hiprint_mac_arm64-1.0.6.dmg">下载(v1.0.6)</a> |
|
||||
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
- [线上跨域问题,请升级 https! 说明:https://www.cnblogs.com/daysme/p/15493523.html](https://www.cnblogs.com/daysme/p/15493523.html)
|
||||
|
||||
## 常见问题
|
||||
> design时怎么修改默认图片?
|
||||
```vue
|
||||
<!-- 组件内, 显示的图片-->
|
||||
<style lang="less" scoped>
|
||||
/deep/ .hiprint-printElement-image-content {
|
||||
img {
|
||||
content: url("~@/assets/logo.png");
|
||||
}
|
||||
}
|
||||
</style>
|
||||
<!-- App.vue 拖拽时显示的图片-->
|
||||
<!-- 不要 scoped, 拖拽时是添加到 html body内的-->
|
||||
<style lang="less">
|
||||
.hiprint-printElement-image-content {
|
||||
img {
|
||||
content: url("~@/assets/logo.png");
|
||||
}
|
||||
}
|
||||
</style>
|
||||
```
|
||||
> print/print2 打印回调
|
||||
```javascript
|
||||
// 浏览器预览打印
|
||||
hiprintTemplate.print(this.printData, {}, {
|
||||
callback: () => {
|
||||
console.log('浏览器打印窗口已打开')
|
||||
}
|
||||
})
|
||||
// 直接打印
|
||||
// 打印机名称: 通过 hiprintTemplate.getPrinterList() 获取 其中的 name
|
||||
hiprintTemplate.print2(printData, {printer: '打印机名称', title: '打印标题'})
|
||||
hiprintTemplate.on('printSuccess', function (data) {
|
||||
console.log('打印完成')
|
||||
})
|
||||
hiprintTemplate.on('printError', function (data) {
|
||||
console.log('打印失败')
|
||||
})
|
||||
```
|
||||
> 打印重叠 / 样式问题
|
||||
```javascript
|
||||
/**
|
||||
* 从 0.0.19 起, 在index.html添加:
|
||||
* <link rel="stylesheet" type="text/css" media="print" href="https://cdn.jsdelivr.net/npm/vue-plugin-hiprint@latest/dist/print-lock.css">
|
||||
* 以处理打印所需css, 当然你也可以自行处理
|
||||
* 比如: index.html目录下放一个print-lock.css, 然后在index.html添加:
|
||||
* <link rel="stylesheet" type="text/css" media="print" href="/print-lock.css">
|
||||
*/
|
||||
|
||||
// 添加自定义样式
|
||||
hiprintTemplate.print(this.printData, {}, {
|
||||
styleHandler: () => {
|
||||
// 这里拼接成放html->head标签内的css/style
|
||||
// 1.例如:使用hiprin官网的样式
|
||||
let css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">'
|
||||
// 2.重写样式:所有文本红色
|
||||
css += '<style>.hiprint-printElement-text{color:red !important;}</style>'
|
||||
return css
|
||||
}
|
||||
})
|
||||
// 直接打印
|
||||
hiprintTemplate.print2(this.printData, {
|
||||
styleHandler: () => {
|
||||
// 这里拼接成放html->head标签内的css/style
|
||||
// 1.例如:使用hiprin官网的样式
|
||||
let css = '<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">'
|
||||
// 2.重写样式:所有文本红色
|
||||
css += '<style>.hiprint-printElement-text{color:red !important;}</style>'
|
||||
return css
|
||||
}
|
||||
})
|
||||
```
|
||||
> 修改默认配置 / 显示/隐藏元素设置参数
|
||||
```javascript
|
||||
// 0.0.13, 新增setConfig方法
|
||||
// 还原配置
|
||||
hiprint.setConfig()
|
||||
// 替换配置
|
||||
hiprint.setConfig({
|
||||
movingDistance: 2.5,
|
||||
text:{
|
||||
supportOptions: [
|
||||
{
|
||||
name: 'styler',
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
name: 'formatter',
|
||||
hidden: true
|
||||
},
|
||||
]
|
||||
}
|
||||
})
|
||||
```
|
||||
> 取消自动socket连接 / socket连接报错问题
|
||||
```javascript
|
||||
/**
|
||||
* 取消自动连接
|
||||
*/
|
||||
// 在main.js中设置
|
||||
import {hiPrintPlugin} from 'vue-plugin-hiprint'
|
||||
Vue.use(hiPrintPlugin,'$hiprint', false);
|
||||
// hiPrintPlugin 同时提供了 disAutoConnect 方法
|
||||
hiPrintPlugin.disAutoConnect();
|
||||
// 在组件中使用 见: demo/design/index.vue
|
||||
import {disAutoConnect, autoConnect, hiprint} from 'vue-plugin-hiprint'
|
||||
disAutoConnect();
|
||||
// 同时 export了 autoConnect,disAutoConnect 方法
|
||||
/**
|
||||
* 连接回调及打印
|
||||
*/
|
||||
autoConnect((status,msg) => {
|
||||
if (status) {
|
||||
hiprintTemplate.print2(printData, {printer: '', title: 'hiprint测试打印'});
|
||||
}
|
||||
});
|
||||
/**
|
||||
* socket连接报错?
|
||||
* 由于npm包更新到socket.io 3.x版本,官网提供的客户端,npm包是无法连接的
|
||||
* 请使用gitee提供的客户端, 同时gitee客户端可传更多的参数, 如是否打印颜色/打印份数/DPI等
|
||||
* 详情electron见:https://www.electronjs.org/zh/docs/latest/api/web-contents
|
||||
*/
|
||||
```
|
||||
|
||||
## 参与项目
|
||||
```console
|
||||
git clone https://gitee.com/CcSimple/vue-plugin-hiprint.git
|
||||
// init
|
||||
cd vue-plugin-hiprint
|
||||
npm i
|
||||
// 调试预览
|
||||
npm run serve
|
||||
// 打包
|
||||
npm run build
|
||||
```
|
||||
## demo调试(显示打印iframe)
|
||||
```javascript
|
||||
// 快速显示/隐藏 打印iframe 方便调试  ̄□ ̄||
|
||||
// 在浏览器控制台输入:
|
||||
// 显示打印页面
|
||||
$('#app').css('display','none');
|
||||
$('#hiwprint_iframe').css('visibility','visible');
|
||||
$('#hiwprint_iframe').css('width','100%');
|
||||
$('#hiwprint_iframe').css('height','251.09mm'); // 这里替换个实际高度才能显示完
|
||||
// 显示vue页面
|
||||
$('#app').css('display','block');
|
||||
$('#hiwprint_iframe').css('visibility','hidden');
|
||||
```
|
||||
|
||||
## 交流群
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/group.png"/></td>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/wechat.png"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
> 群人数已超过200 请 '加我好友' 备注加群, 邀你进群
|
||||
|
||||
## 捐赠支持, 或者请我喝杯咖啡☕️
|
||||
|
||||
> 如果对您有帮助,请点击右上角⭐Star关注或扫码捐赠,感谢支持开源!
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/zWechat.png"/></td>
|
||||
<td><img src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/zAlipay.png"/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
## 状态/调整/优化 请查看[更新记录](CHANGELOG.md)
|
||||
|
||||
本项目使用 <a href="https://jb.gg/OpenSourceSupport"><img height="40" width="100" src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/WebStorm.svg"/></a><a href="https://jb.gg/OpenSourceSupport"><img width="50" height="50" src="https://gitee.com/CcSimple/vue-plugin-hiprint/raw/main/res/WebStorm_icon.svg"/></a> 开发
|
||||
|
||||
## 分支说明
|
||||
> main: vue2.x + ant1.7.x融合版 及 npm包源代码
|
||||
|
||||
> npm_demo: vue2.x + ant1.7.x + npm包使用 示例
|
||||
|
||||
> npm_demo_ele: vue2.x + ElementUi 2.x + npm包使用 示例
|
||||
|
||||
> npm_demo_v3: vue3.x + vite + npm包(0.0.18)使用 示例
|
||||
|
||||
## 关于如何融合处理
|
||||
> 自己融合请查看 vue.config.js 对比 hiprint.bundle.js
|
||||
|
||||
> webpack.config.js,是npm打包需要处理的
|
||||
|
||||
## 开源使用说明
|
||||
> npm包是基于hiprint官网2.5.4版本基础做的调整及优化;<br/>
|
||||
> 本人对开源协议理解有限,如有侵权不合理的地方,请联系告知我;<br/>
|
||||
|
||||
hiprint 开源协议如下:
|
||||
```
|
||||
/**
|
||||
* jQuery Hiprint 2.5.4
|
||||
*
|
||||
* Copyright (c) 2016-2021 www.hinnn.com. All rights reserved.
|
||||
*
|
||||
* Licensed under the LGPL or commercial licenses
|
||||
* To use it on other terms please contact us: hinnn.com@gmail.com
|
||||
*
|
||||
*/
|
||||
```
|
||||
|
||||
## 关于LGPL协议
|
||||
|
||||
```
|
||||
LGPL是GPL的一个为主要为类库使用设计的开源协议。和GPL要求任何使用/修改/衍生之GPL类库的的软件必须采用GPL协议不同。
|
||||
|
||||
LGPL允许商业软件通过类库引用(link)方式使用LGPL类库而不需要开源商业软件的代码。这使得采用LGPL协议的开源代码可以被商业软件作为类库引用并发布和销售。
|
||||
|
||||
但是如果修改LGPL协议的代码或者衍生,则所有修改的代码,涉及修改部分的额外代码和衍生的代码都必须采用LGPL协议。
|
||||
|
||||
因此LGPL协议的开源代码很适合作为第三方类库被商业软件引用,但不适合希望以LGPL协议代码为基础,通过修改和衍生的方式做二次开发的商业软件采用。
|
||||
|
||||
GPL/LGPL都保障原作者的知识产权,避免有人利用开源代码复制并开发类似的产品。
|
||||
```
|
||||
@@ -0,0 +1,339 @@
|
||||
@media print {
|
||||
body {
|
||||
margin: 0px;
|
||||
padding: 0px;
|
||||
}
|
||||
}
|
||||
|
||||
@page {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.hiprint-printPaper * {
|
||||
box-sizing: border-box;
|
||||
-moz-box-sizing: border-box; /* Firefox */
|
||||
-webkit-box-sizing: border-box; /* Safari */
|
||||
}
|
||||
|
||||
.hiprint-printPaper *:focus {
|
||||
outline: -webkit-focus-ring-color auto 0px;
|
||||
}
|
||||
|
||||
.hiprint-printPaper {
|
||||
position: relative;
|
||||
padding: 0 0 0 0;
|
||||
page-break-after: always;
|
||||
-webkit-user-select: none; /* Chrome/Safari/Opera */
|
||||
-moz-user-select: none; /* Firefox */
|
||||
user-select: none;
|
||||
overflow-x: hidden;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hiprint-printPaper .hiprint-printPaper-content {
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* 火狐浏览器打印 第一页过后 重叠问题 */
|
||||
@-moz-document url-prefix() {
|
||||
.hiprint-printPaper .hiprint-printPaper-content {
|
||||
position: relative;
|
||||
margin-top: 20px;
|
||||
top: -20px
|
||||
}
|
||||
}
|
||||
|
||||
.hiprint-printPaper.design {
|
||||
overflow: visible;
|
||||
}
|
||||
|
||||
|
||||
.hiprint-printTemplate .hiprint-printPanel {
|
||||
page-break-after: always;
|
||||
}
|
||||
|
||||
.hiprint-printPaper, hiprint-printPanel {
|
||||
box-sizing: border-box;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
.hiprint-printPanel .hiprint-printPaper:last-child {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
.hiprint-printTemplate .hiprint-printPanel:last-child {
|
||||
page-break-after: avoid;
|
||||
}
|
||||
|
||||
.hiprint-printPaper .hideheaderLinetarget {
|
||||
border-top: 0px dashed rgb(201, 190, 190) !important;
|
||||
}
|
||||
|
||||
.hiprint-printPaper .hidefooterLinetarget {
|
||||
border-top: 0px dashed rgb(201, 190, 190) !important;
|
||||
}
|
||||
|
||||
.hiprint-printPaper.design {
|
||||
border: 1px dashed rgba(170, 170, 170, 0.7);
|
||||
}
|
||||
|
||||
.design .hiprint-printElement-table-content, .design .hiprint-printElement-longText-content {
|
||||
overflow: hidden;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.design .resize-panel {
|
||||
box-sizing: border-box;
|
||||
border: 1px dotted;
|
||||
}
|
||||
|
||||
.hiprint-printElement-text {
|
||||
background-color: transparent;
|
||||
background-repeat: repeat;
|
||||
padding: 0 0 0 0;
|
||||
border: 0.75pt none rgb(0, 0, 0);
|
||||
direction: ltr;
|
||||
font-family: 'SimSun';
|
||||
font-size: 9pt;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
padding-bottom: 0pt;
|
||||
padding-left: 0pt;
|
||||
padding-right: 0pt;
|
||||
padding-top: 0pt;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
line-height: 9.75pt;
|
||||
box-sizing: border-box;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.design .hiprint-printElement-text-content {
|
||||
border: 1px dashed rgb(206, 188, 188);
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.hiprint-printElement-longText {
|
||||
background-color: transparent;
|
||||
background-repeat: repeat;
|
||||
border: 0.75pt none rgb(0, 0, 0);
|
||||
direction: ltr;
|
||||
font-family: 'SimSun';
|
||||
font-size: 9pt;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
padding-bottom: 0pt;
|
||||
padding-left: 0pt;
|
||||
padding-right: 0pt;
|
||||
padding-top: 0pt;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
line-height: 9.75pt;
|
||||
box-sizing: border-box;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
/*white-space: pre-wrap*/
|
||||
}
|
||||
|
||||
|
||||
.hiprint-printElement-table {
|
||||
background-color: transparent;
|
||||
background-repeat: repeat;
|
||||
color: rgb(0, 0, 0);
|
||||
border-color: rgb(0, 0, 0);
|
||||
border-style: none;
|
||||
direction: ltr;
|
||||
font-family: 'SimSun';
|
||||
font-size: 9pt;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
padding-bottom: 0pt;
|
||||
padding-left: 0pt;
|
||||
padding-right: 0pt;
|
||||
padding-top: 0pt;
|
||||
text-align: left;
|
||||
text-decoration: none;
|
||||
padding: 0 0 0 0;
|
||||
box-sizing: border-box;
|
||||
line-height: 9.75pt;
|
||||
}
|
||||
|
||||
.hiprint-printElement-table thead {
|
||||
background: #e8e8e8;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.hiprint-printElement-tableTarget, .hiprint-printElement-tableTarget tr, .hiprint-printElement-tableTarget td {
|
||||
border-color: rgb(0, 0, 0);
|
||||
/*border-style: none;*/
|
||||
/*border: 1px solid rgb(0, 0, 0);*/
|
||||
font-weight: normal;
|
||||
direction: ltr;
|
||||
padding-bottom: 0pt;
|
||||
padding-left: 4pt;
|
||||
padding-right: 4pt;
|
||||
padding-top: 0pt;
|
||||
text-decoration: none;
|
||||
vertical-align: middle;
|
||||
box-sizing: border-box;
|
||||
word-wrap: break-word;
|
||||
word-break: break-all;
|
||||
/*line-height: 9.75pt;
|
||||
font-size: 9pt;*/
|
||||
}
|
||||
|
||||
.hiprint-printElement-tableTarget-border-all {
|
||||
border: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-none {
|
||||
border: 0px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-lr {
|
||||
border-left: 1px solid;
|
||||
border-right: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-left {
|
||||
border-left: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-right {
|
||||
border-right: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-tb {
|
||||
border-top: 1px solid;
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-top {
|
||||
border-top: 1px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-bottom {
|
||||
border-bottom: 1px solid;
|
||||
}
|
||||
|
||||
.hiprint-printElement-tableTarget-border-td-none td {
|
||||
border: 0px solid;
|
||||
}
|
||||
.hiprint-printElement-tableTarget-border-td-all td:not(:last-child) {
|
||||
border-right: 1px solid;
|
||||
}
|
||||
|
||||
/*.hiprint-printElement-tableTarget tr,*/
|
||||
.hiprint-printElement-tableTarget td {
|
||||
height: 18pt;
|
||||
}
|
||||
|
||||
.hiprint-printPaper .hiprint-paperNumber {
|
||||
font-size: 9pt;
|
||||
}
|
||||
|
||||
.design .hiprint-printElement-table-handle {
|
||||
position: absolute;
|
||||
height: 21pt;
|
||||
width: 21pt;
|
||||
background: red;
|
||||
z-index: 1;
|
||||
}
|
||||
|
||||
.hiprint-printPaper .hiprint-paperNumber-disabled {
|
||||
float: right !important;
|
||||
right: 0 !important;
|
||||
color: gainsboro !important;
|
||||
}
|
||||
|
||||
.hiprint-printElement-vline, .hiprint-printElement-hline {
|
||||
border: 0px none rgb(0, 0, 0);
|
||||
|
||||
}
|
||||
|
||||
.hiprint-printElement-vline {
|
||||
border-left: 0.75pt solid #000;
|
||||
border-right: 0px none rgb(0, 0, 0) !important;
|
||||
border-bottom: 0px none rgb(0, 0, 0) !important;
|
||||
border-top: 0px none rgb(0, 0, 0) !important;
|
||||
}
|
||||
|
||||
.hiprint-printElement-hline {
|
||||
border-top: 0.75pt solid #000;
|
||||
border-right: 0px none rgb(0, 0, 0) !important;
|
||||
border-bottom: 0px none rgb(0, 0, 0) !important;
|
||||
border-left: 0px none rgb(0, 0, 0) !important;
|
||||
}
|
||||
|
||||
.hiprint-printElement-oval, .hiprint-printElement-rect {
|
||||
border: 0.75pt solid #000;
|
||||
}
|
||||
|
||||
.hiprint-text-content-middle {
|
||||
}
|
||||
|
||||
.hiprint-text-content-middle > div {
|
||||
display: grid;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.hiprint-text-content-bottom {
|
||||
}
|
||||
|
||||
.hiprint-text-content-bottom > div {
|
||||
display: grid;
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
.hiprint-text-content-wrap {
|
||||
}
|
||||
|
||||
.hiprint-text-content-wrap .hiprint-text-content-wrap-nowrap {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.hiprint-text-content-wrap .hiprint-text-content-wrap-clip {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: clip;
|
||||
}
|
||||
|
||||
.hiprint-text-content-wrap .hiprint-text-content-wrap-ellipsis {
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
/*hi-grid-row */
|
||||
.hi-grid-row {
|
||||
position: relative;
|
||||
height: auto;
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
zoom: 1;
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.hi-grid-row::after, .hi-grid-row::before {
|
||||
display: table;
|
||||
content: '';
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.hi-grid-col {
|
||||
display: block;
|
||||
box-sizing: border-box;
|
||||
position: relative;
|
||||
float: left;
|
||||
flex: 0 0 auto;
|
||||
}
|
||||
|
||||
.table-grid-row {
|
||||
margin-left: -0pt;
|
||||
margin-right: -0pt;
|
||||
}
|
||||
|
||||
.tableGridColumnsGutterRow {
|
||||
padding-left: 0pt;
|
||||
padding-right: 0pt;
|
||||
}
|
||||
|
||||
.hiprint-gridColumnsFooter {
|
||||
text-align: left;
|
||||
clear: both;
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("jquery"),require("jsbarcode"),require("socket.io-client"),require("jspdf"),require("html2canvas"),require("canvg")):"function"==typeof define&&define.amd?define("vue-plugin-hiprint",["jquery","jsbarcode","socket.io-client","jspdf","html2canvas","canvg"],e):"object"==typeof exports?exports["vue-plugin-hiprint"]=e(require("jquery"),require("jsbarcode"),require("socket.io-client"),require("jspdf"),require("html2canvas"),require("canvg")):t["vue-plugin-hiprint"]=e(t.jQuery,t.JsBarcode,t.io,t.jspdf,t.html2canvas,t.canvg)}(window,function(__WEBPACK_EXTERNAL_MODULE__0__,__WEBPACK_EXTERNAL_MODULE__4__,__WEBPACK_EXTERNAL_MODULE__7__,__WEBPACK_EXTERNAL_MODULE__10__,__WEBPACK_EXTERNAL_MODULE__11__,__WEBPACK_EXTERNAL_MODULE__12__){return function(i){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t].call(e.exports,e,e.exports,o),e.l=!0,e.exports}return o.m=i,o.c=n,o.d=function(t,e,i){o.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:i})},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},o.t=function(e,t){if(1&t&&(e=o(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(o.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var n in e)o.d(i,n,function(t){return e[t]}.bind(null,n));return i},o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,"a",e),e},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},o.p="/dist/",o(o.s=14)}([function(t,e){t.exports=__WEBPACK_EXTERNAL_MODULE__0__},function(module,__webpack_exports__,__webpack_require__){"use strict";!function(jQuery){__webpack_require__.d(__webpack_exports__,"b",function(){return hiprint}),__webpack_require__.d(__webpack_exports__,"a",function(){return defaultElementTypeProvider});var jquery__WEBPACK_IMPORTED_MODULE_0__=__webpack_require__(0),jquery__WEBPACK_IMPORTED_MODULE_0___default=__webpack_require__.n(jquery__WEBPACK_IMPORTED_MODULE_0__),_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1__=__webpack_require__(15),_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1___default=__webpack_require__.n(_claviska_jquery_minicolors_jquery_minicolors_min__WEBPACK_IMPORTED_MODULE_1__),jsbarcode__WEBPACK_IMPORTED_MODULE_2__=__webpack_require__(4),jsbarcode__WEBPACK_IMPORTED_MODULE_2___default=__webpack_require__.n(jsbarcode__WEBPACK_IMPORTED_MODULE_2__),_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3__=__webpack_require__(16),_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3___default=__webpack_require__.n(_plugins_qrcode_js__WEBPACK_IMPORTED_MODULE_3__),_plugins_watermark_js__WEBPACK_IMPORTED_MODULE_4__=__webpack_require__(3),socket_io_client__WEBPACK_IMPORTED_MODULE_5__=__webpack_require__(7),socket_io_client__WEBPACK_IMPORTED_MODULE_5___default=__webpack_require__.n(socket_io_client__WEBPACK_IMPORTED_MODULE_5__),_css_image_l_img_svg__WEBPACK_IMPORTED_MODULE_6__=__webpack_require__(8),_css_image_l_img_svg__WEBPACK_IMPORTED_MODULE_6___default=__webpack_require__.n(_css_image_l_img_svg__WEBPACK_IMPORTED_MODULE_6__),_css_image_v_img_svg__WEBPACK_IMPORTED_MODULE_7__=__webpack_require__(9),_css_image_v_img_svg__WEBPACK_IMPORTED_MODULE_7___default=__webpack_require__.n(_css_image_v_img_svg__WEBPACK_IMPORTED_MODULE_7__),jspdf__WEBPACK_IMPORTED_MODULE_8__=__webpack_require__(10),jspdf__WEBPACK_IMPORTED_MODULE_8___default=__webpack_require__.n(jspdf__WEBPACK_IMPORTED_MODULE_8__),html2canvas__WEBPACK_IMPORTED_MODULE_9__=__webpack_require__(11),html2canvas__WEBPACK_IMPORTED_MODULE_9___default=__webpack_require__.n(html2canvas__WEBPACK_IMPORTED_MODULE_9__),nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_10__=__webpack_require__(2),nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_10___default=__webpack_require__.n(nzh_dist_nzh_min_js__WEBPACK_IMPORTED_MODULE_10__),canvg__WEBPACK_IMPORTED_MODULE_11__=__webpack_require__(12),canvg__WEBPACK_IMPORTED_MODULE_11___default=__webpack_require__.n(canvg__WEBPACK_IMPORTED_MODULE_11__),_etypes_default_etyps_provider__WEBPACK_IMPORTED_MODULE_12__=__webpack_require__(13);function _instanceof(t,e){return null!=e&&"undefined"!=typeof Symbol&&e[Symbol.hasInstance]?!!e[Symbol.hasInstance](t):t instanceof e}function _typeof(t){return(_typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}window.$=window.jQuery=jquery__WEBPACK_IMPORTED_MODULE_0___default.a,window.autoConnect=!0,window.io=socket_io_client__WEBPACK_IMPORTED_MODULE_5__.io;var hiprint=function(i){var n={};function o(t){if(n[t])return n[t].exports;var e=n[t]={i:t,l:!1,exports:{}};return i[t]Line truncated
|
||||
<option value='${t.v}'>${t.t}</option>`}),this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="hiprint-option-item hiprint-option-item-row">\n<div class="hiprint-option-item-label">\n转大小写\n</div>\n<div class="hiprint-option-item-field">\n<select class="auto-submit"></select>\n</div>\n</div>'),this.target.find(".auto-submit").append(jquery__WEBPACK_IMPORTED_MODULE_0___default()(e)),this.target},pi.prototype.getValue=function(){var t=this.target.find("select").val();if(t)return t.toString()},pi.prototype.setValue=function(t){this.target.find("select").val(t)},pi.prototype.destroy=function(){this.target.remove()},pi),ce=(si.prototype.createTarget=function(){return this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()('<div class="hiprint-option-item"><div class="hiprint-option-item-label">底部聚合类型</div><div class="hiprint-option-item-field"><select class="auto-submit"><option value="">不聚合</option><option value="count">计数</option><option value="sum">合计</option><option value="avg">平均值</option><option value="min">最小值</option><option value="max">最大值</option><option value="text">仅文本</option></select></div></div>'),this.target},si.prototype.getValue=function(){return this.target.find("select").val()},si.prototype.setValue=function(t){this.target.find("select").val(t)},si.prototype.destroy=function(){this.target.remove()},si),ue=(li.prototype.createTarget=function(){return this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(' <div class="hiprint-option-item hiprint-option-item-row">\n <div class="hiprint-option-item-label">\n 顶部偏移\n </div>\n <div class="hiprint-option-item-field">\n <input type="text" placeholder="偏移量pt" class="auto-submit">\n </div>\n </div>'),this.target},li.prototype.getValue=function(){var t=this.target.find("input").val();if(t)return parseFloat(t.toString())},li.prototype.setValue=function(t){this.target.find("input").val(t)},li.prototype.destroy=function(){this.target.remove()},li),de=(ai.prototype.createTarget=function(){return this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n 一行多组\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit">\n <option value="" >默认</option>\n <option value="2" >一行二列</option>\n <option value="3" >一行三列</option>\n <option value="4" >一行四列</option>\n </select>\n </div>\n </div>'),this.target},ai.prototype.getValue=function(){var t=this.target.find("select").val();if(t)return parseFloat(t.toString())},ai.prototype.setValue=function(t){t&&!this.target.find('option[value="'+t+'"]').length&&this.target.find("select").prepend('<option value="'+t+'" >'+t+"</option>"),this.target.find("select").val(t)},ai.prototype.destroy=function(){this.target.remove()},ai),ge=(n.prototype.createTarget=function(){return this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n 一行多组间隔\n </div>\n <div class="hiprint-option-item-field">\n <select class="auto-submit">\n <option value="" >默认</option>\n <option value="1.5" >1.5pt</option>\n <option value="2.25" >2.25pt</option>\n <option value="3" >3pt</option>\n <option value="3.75" >3.75pt</option>\n <option value="4.5" >4.5pt</option>\n <option value="5.25" >5.25pt</option>\n <option value="6" >6pt</option>\n <option value="6.75" >6.75pt</option>\n <option value="7.25" >7.25pt</option>\n <option value="8.5" >8.5pt</option>\n <option value="9" >9pt</option>\n </select>\n </div>\n </div>'),this.target},n.prototype.getValue=function(){var t=this.target.find("select").val();if(t)return parseFloat(t.toString())},n.prototype.css=function(t,e){if(t&&t.length){if(e)return t.find(".table-grid-row").css("margin-left","-"+e+"pt").css("margin-right","-"+e+"pt"),t.find(".tableGridColumnsGutterRow").css("padding-left",e+"pt").css("padding-right",e+"pt"),null;t.find(".table-grid-row").map(function(t,e){e.style.marginLeft="",e.style.marginRight=""}),t.find(".tableGridColumnsGutterRow").map(function(t,e){e.style.paddingLeft="",e.style.paddingRight=""})}return null},n.prototype.setValue=function(t){t&&!this.target.find('option[value="'+t+'"]').length&&this.target.find("select").prepend('<option value="'+t+'" >'+t+"</option>"),this.target.find("select").val(t)},n.prototype.destroy=function(){this.target.remove()},n),he=(ri.prototype.createTarget=function(){return this.target=jquery__WEBPACK_IMPORTED_MODULE_0___default()(' <div class="hiprint-option-item">\n <div class="hiprint-option-item-label">\n 表格头显示\n </div>\n <div class="hipriLine truncated
|
||||
//# sourceMappingURL=vue-plugin-hiprint.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"vue-plugin-hiprint.js","sources":["webpack://vue-plugin-hiprint/vue-plugin-hiprint.js"],"mappings":"AAAA;AAmvIA","sourceRoot":""}
|
||||
@@ -0,0 +1,63 @@
|
||||
{
|
||||
"name": "vue-plugin-hiprint",
|
||||
"description": "hiprint for Vue2.x / Vue3.x 支持拖拽(分页(不分页)、表头表脚、样式设置、复制粘贴、缩放、撤销重做)生成打印模板、导出json模板数据、静默打印/获取MAC地址(借助客户端)",
|
||||
"version": "0.0.54-fix",
|
||||
"author": "CcSimple",
|
||||
"license": "MIT",
|
||||
"main": "dist/vue-plugin-hiprint.js",
|
||||
"private": false,
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/CcSimple/vue-plugin-hiprint.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/CcSimple/vue-plugin-hiprint/issues"
|
||||
},
|
||||
"keywords": [
|
||||
"vue",
|
||||
"hiprint",
|
||||
"print"
|
||||
],
|
||||
"files": [
|
||||
"dist"
|
||||
],
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build-demo": "vue-cli-service build",
|
||||
"build": "cross-env NODE_ENV=production webpack --progress",
|
||||
"pub": "npm run build && npm --registry https://registry.npmjs.org/ publish",
|
||||
"up-version": "node ./scripts/change-version.js",
|
||||
"pub-beta": "npm run build && npm --registry https://registry.npmjs.org/ publish --tag beta"
|
||||
},
|
||||
"browserslist": [
|
||||
"> 1%",
|
||||
"last 2 versions",
|
||||
"not ie <= 8"
|
||||
],
|
||||
"devDependencies": {
|
||||
"@vue/cli-plugin-babel": "^4.5.15",
|
||||
"@vue/cli-service": "^4.5.15",
|
||||
"ant-design-vue": "^1.7.8",
|
||||
"bootstrap": "^3.3.7",
|
||||
"concurrent-tasks": "^1.0.7",
|
||||
"copy-webpack-plugin": "^5.1.2",
|
||||
"core-js": "^3.6.5",
|
||||
"cross-env": "^5.0.5",
|
||||
"less-loader": "^6.1.1",
|
||||
"uglifyjs-webpack-plugin": "^2.2.0",
|
||||
"vue": "^2.5.11",
|
||||
"vue-ls": "^4.0.0",
|
||||
"vue-template-compiler": "^2.6.11",
|
||||
"webpack-cli": "^4.9.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@claviska/jquery-minicolors": "^2.3.6",
|
||||
"canvg": "^3.0.10",
|
||||
"html2canvas": "^1.4.1",
|
||||
"jquery": "^3.6.0",
|
||||
"jsbarcode": "^3.11.5",
|
||||
"jspdf": "^2.5.1",
|
||||
"nzh": "^1.0.8",
|
||||
"socket.io-client": "^4.5.1"
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user