This commit is contained in:
yanran200830
2024-10-28 18:30:26 +08:00
parent 86f4256eb4
commit 8225f21d14
8 changed files with 56416 additions and 225 deletions

View File

@@ -13,10 +13,10 @@ export const customProvider = function (options) {
const elId = options.elId || 'barCode-' + new Date().getTime()
const codeWidth = parseInt((options.width - 22) * 0.85)
let printData = {
labelCode: 96778555251,
productSkuId: 6606980005,
skuExtCode: 'AAA1100mWh-orange',
skuSpecName: '8pcs'
labelCode: 123456789,
productSkuId: `XXXXXXXXXXXXXX`,
skuExtCode: 'XXXXXXXXXXXXXX',
skuSpecName: 'XXXXX'
}
options.elId = `${elId}`
@@ -32,7 +32,7 @@ export const customProvider = function (options) {
JsBarcode('#' + elId, printData.labelCode, {
format: 'CODE128B',
width: 2,
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
margin: 0,
displayValue: false
})
@@ -43,10 +43,10 @@ export const customProvider = function (options) {
$(`body>#codewrapper-${elId}`).remove()
// eslint-disable-next-line no-undef
const resizeObserver = new ResizeObserver(() => {
JsBarcode('#'+ elId, printData.labelCode, {
JsBarcode('#' + elId, printData.labelCode, {
format: "CODE128B",
width: 2,
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
height: parseInt(hinnn.pt.toPx(options.height - 22).toString()) * 0.6,
margin: 0,
displayValue: false
})
@@ -61,8 +61,8 @@ export const customProvider = function (options) {
var html = `
<div class="temuBarCode" id="temuBarCode-${elId}">
<div class="temuBarCode-top">
<div class="hiprint-printElement-text-content hiprint-printElement-content">${ printData.skuExtCode }</div>
<div class="hiprint-printElement-text-content hiprint-printElement-content">${ printData.skuSpecName }</div>
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.skuExtCode || printData.productSkcId}</div>
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.skuSpecName}</div>
</div>
<div class="temuBarCode-middle">
<div class="hiprint-printElement-text-content hiprint-printElement-content temuBarCode-code" style="width: 100%">
@@ -70,7 +70,7 @@ export const customProvider = function (options) {
</div>
</div>
<div class="temuBarCode-bottom">
<div class="hiprint-printElement-text-content hiprint-printElement-content">${ printData.productSkuId }</div>
<div class="hiprint-printElement-text-content hiprint-printElement-content">${printData.productSkuId}</div>
<div class="hiprint-printElement-text-content hiprint-printElement-content">Made in China</div>
</div>
</div>
@@ -85,37 +85,37 @@ export const customProvider = function (options) {
printElementType: {
}
},
{
tid: 'providerModule1.barcode',
title: '条形码',
data: 'XS888888888',
type: 'text',
options: {
field: 'barcode',
testData: 'XS888888888',
height: 32,
fontSize: 12,
lineHeight: 18,
textAlign: 'left',
textType: 'barcode',
hideTitle: false
}
},
{
tid: 'providerModule1.qrcode',
title: '二维码',
data: 'XS888888888',
type: 'text',
options: {
field: '',
testData: '',
height: 32,
fontSize: 12,
lineHeight: 18,
textType: 'qrcode',
hideTitle: false
}
},
// {
// tid: 'providerModule1.barcode',
// title: '条形码',
// data: 'XS888888888',
// type: 'text',
// options: {
// field: 'barcode',
// testData: 'XS888888888',
// height: 32,
// fontSize: 12,
// lineHeight: 18,
// textAlign: 'left',
// textType: 'barcode',
// hideTitle: false
// }
// },
// {
// tid: 'providerModule1.qrcode',
// title: '二维码',
// data: 'XS888888888',
// type: 'text',
// options: {
// field: '',
// testData: '',
// height: 32,
// fontSize: 12,
// lineHeight: 18,
// textType: 'qrcode',
// hideTitle: false
// }
// },
{
tid: 'providerModule1.image',
title: '图片',