
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Vue version > 2.6
npm install vprint -S
// main.js
import vprint from 'vprint'
Vue.use(vprint)
<el-button-group>
<el-button size="mini" type="default" @click="handlePrint">
批量打印
</el-button>
<el-button
icon="el-icon-s-tools"
size="mini"
type="primary"
@click="handleConfig"
/>
</el-button-group>
<vprint
class="vprint-wrap"
v-if="isShowPrint"
ref="vprint"
:printData="printData"
:isVisual="true"
:encryptMethod="0"
>
<template #cargo="{ item }">
<div class="cargo-wrap">
<div>托寄物:{{ item.content }}</div>
<div v-if="!hideConfig.isHideRemark">{{ item.remark }}</div>
</div>
</template>
<template #orderExts="{ item }">
<div v-if="item.orderExts && item.orderExts.length">
<span
v-for="(v, i) in item.orderExts"
:key="i"
style="margin-right: 5px;"
>
{{ v.name }}:{{ v.value }}{{ item.currency }}
</span>
</div>
</template>
</vprint>
<el-dialog
width="900px"
top="10px"
title="打印设置"
:append-to-body="true"
:visible.sync="printVisible"
:before-close="closeConfig"
>
<div class="print-wrap" v-if="printVisible">
<vprint
ref="vconfig"
:printData="printData"
:isVisual="true"
:encryptMethod="0"
>
</vprint>
</div>
</el-dialog>
created () {
this.hideConfig = JSON.parse(localStorage.getItem('hideConfig')) || {}
}
handlePrint () {
this.isShowPrint = true
this.$nextTick(() => {
this.$refs.vprint.handlePrint()
})
}
handleConfig () {
this.printVisible = true
this.$nextTick(() => {
this.$refs.vconfig.handleConfig(
// 此处可传一个数组来覆盖默认的预览打印数据
)
})
}
closeConfig () {
this.hideConfig = JSON.parse(localStorage.getItem('hideConfig')) || {}
this.printVisible = false
}
.vprint-wrap {
position: absolute;
top: -2000px;
left: -2000px;
}
.print-wrap {
padding: 20px;
height: 700px;
overflow-y: auto;
}
.cargo-wrap {
position: relative;
width: 50%;
height: 100%;
padding: 5px;
border-bottom: 1px solid #000;
}
| 字段 | 类型 | 默认 | 说明 |
|---|---|---|---|
| printData | Array | [ ] | 打印数据(属性名参考打印字段) |
| isVisual | Boolean | false | 配置是否可视化 |
| encryptMethod | Number | 0 | 0,1,2 分别表示 自定义加密,不加密,全加密 v1.1.8新增 |
| printSize | Number | 150 | 150,210 分别表示 二联,三联; (v1.2.5新增)130表示 一联 |
| hideConfig.isPreview | Boolean | false | 是否预览 |
| hideConfig.isLodop | Boolean | false | 是否使用插件 |
| hideConfig.isHideCargo | Boolean | false | 是否隐藏托寄物 |
| hideConfig.isHideAddedService | Boolean | false | 是否隐藏增值服务 |
| hideConfig.isHideWeight | Boolean | false | 是否隐藏(计费,实际)重量 |
| hideConfig.isHideFee | Boolean | false | 是否费用合计 |
| hideConfig.isHidePayMethod | Boolean | false | 是否隐藏付款方式 |
| hideConfig.isHideRemark | Boolean | false | 是否隐藏备注 |
isReturnTracking: false, // 是否为签回单 (v1.4.0及以上)
isCustom: false, // 内容是否为整单自定义
isImage: false, // 内容是否为图片
imageUrl: '' // 图片地址
isIntel: true, // 是否国际件
isGAT: false, // 是否港澳台
currency: 'USD', // 币种
declaredValue: 5000, // 声明价值
waybillFee: 20, // 运费
expressTypeName: '国际标快-文件', // 国际件的产品类型名称
orderExts: [ // 这里一般是自定义的增值服务(没用到)
{
name: 'DSS',
value: '10.00',
id: 11,
type: 'AddedService',
label: '',
value1: '',
value2: '',
value3: '',
value4: '',
orderId: 'OD480685082101829632'
},
{
name: 'SPP',
value: '5',
id: 12,
type: 'AddedService',
label: '',
value1: '',
value2: '',
value3: '',
value4: '',
orderId: 'OD480685082101829632'
}
], // 国际件增值服务
times: 0, // 打印次数
proCode: '特快', // 中文标签
proName: '限时KC24', // 限时值
destCountry: 'CN', // 收件国家代码
destRouteLabel: '755W-755BFE', // 路由标签信息
destTeamCode: '018', // 目的地单元区域
codingMapping: 'D18', // 入港映射码
sourceTransferCode: '755W', // 原寄地中转场(没用到)
twoDimensionCode:
"MMM={'k1':'755W','k2':'755BF','k3':'018','k4':'T4','k5':'444017634769','k6':'','k7':'56faa109'}", // 二维码
abFlag: 'E', // A,B,E
newAbflag: 'RE', // A,B,E,RE
xbFlag: '1', // 快运转寄
codingMappingOut: '1A', // 出港映射码
// abFlag:A & newAbflag:燃 >融通&笼\蟹\生\易碎>>重点易碎>超重>>大客户>:药\防疫;> 柜
printIcon: '00020001',
newIcon: '01000000',
orderId: '01343795412953600000', // 订单号(没用到)
content: '测试物品', // 托寄物内容
mailNo: 'SF8888888888888,SF8888888888881', // 运单号
deliverCompany: '深圳仓', // 寄,公司
deliverName: '测试账号1', // 寄,姓名
deliverMobile: '15000000000', // 寄,手机号
deliverProvince: '广东省', // 寄,省
deliverCity: '深圳市', // 寄,市
deliverCounty: '福田区', // 寄,区
deliverAddress: '新洲十一区万基商务大厦', // 寄,地址
consignerCompany: '小微科技组', // 收,公司
consignerName: '测试', // 收,姓名
consignerMobile: '15000000000', // 收,手机号
consignerProvince: '广东省', // 收,省
consignerCity: '深圳市', // 收,市
consignerCounty: '福田区', // 收,区
consignerAddress: '万基商务大厦', // 收,地址
payMethod: 1, // 付款方式
payMethodText: '寄付月结' // 优先级大于payMethod (v1.4.0及以上)
monthAccount: '7551234567', // 月结卡号
meterageWeight: null, // 计费重量
cargoWeight: null, // 实际重量
totalFee: 150, // 费用合计
remark: '备注信息', // 备注
cod: 1000, // /代收付款金额
parcelQuantity: 2, // 包裹数,>1表示子母单
cargoCount: null, // 物品数量
expressTypeText: '顺丰标快', // 产品类型名称
addedService: 'COD,1000' // 增值服务
| 名称 | 内容 | 位置 | 版本 |
|---|---|---|---|
| printInfo | 打印信息以及条码 | 第一行 | v1.1.8新增 |
| topInfo | 打印信息 | 第一行条形码下方 | v1.4.0新增 |
| cargo | 托寄物&备注 | 非国际件第五行左边 | |
| addedService | 增值服务 | 非国际件第五行右上方 | v1.2.4新增 |
| weightPayMethod | 重量&付款方式 | 非国际件第五行右下方 | v1.2.4新增 |
| custom | 自定义 | 非国际件第六行左边 | |
| imageContent | 图标 | 非国际件第六行右边 | |
| botContent | 三联的内容 | 非国际件三联第十行 | v1.2.4新增 |
| botInfo | 三联的信息 | 非国际件三联第十一行 | v1.2.4新增 |
| orderExts | 增值服务 | 国际件第七行'VAS增值服务'下面 | v1.1.6新增 |
| config | 配置 | 配置项Radio | v1.2.2新增 |
| customConfig | 配置 | 配置表格 | v1.3.1新增 |
| isCustom | 打印信息 | 自定义整个面单 | v1.4.9新增 |
<!--
<template #插槽名称="{ item }">
自定义内容,其中item为printData数组的子元素
</template>
-->
<vprint
v-if="isShowPrint"
ref="vprint"
:printData="printData"
:isVisual="true"
:encryptMethod="0"
>
<template #config>
<div style="margin-bottom: 10px;">
<el-radio v-model="temp_config" :label="0">
测试0
</el-radio>
<el-radio v-model="temp_config" :label="1">
测试1
</el-radio>
</div>
</template>
<!-- umd -->
<template slot="custom" slot-scope="{item}">
<div v-if="item.isCunGen">寄件存根禁止流通</div>
</template>
<!-- npm -->
<template #cargo="{ item }">
<div class="cargo-wrap">
<div>托寄物:{{ item.content }}</div>
<div v-if="!hideConfig.isHideRemark">{{ item.remark }}</div>
</div>
</template>
</vprint>
this.$refs.vprint.getPrinters() // v1.2.0新增
/* 打印机索引,默认值为-1 */
const printIndex = 0
this.$refs.vprint.handlePrint(printIndex) // v1.2.0新增
<vprint @handlecomplete="handlecomplete"></vprint>
methods: {
// v1.3.7新增
handlecomplete() {
console.log('complete')
}
}
2021-04-27
2021-04-27
2021-04-29
2021-05-12
2021-05-28
2021-06-23
2021-06-09
2021-06-10
2021-07-06
2021-07-15
2021-10-28
2021-12-03
2022-05-23
2022-07-27
2022-08-15
2023-03-23
FAQs
`Vue version > 2.6`
We found that vprint demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.