67 lines
1.8 KiB
JavaScript
67 lines
1.8 KiB
JavaScript
|
|
import { hiprint } from 'vue-plugin-hiprint'
|
||
|
|
export const customProvider = function (options) {
|
||
|
|
var addElementTypes = function (context) {
|
||
|
|
context.removePrintElementTypes('customProvider')
|
||
|
|
context.addPrintElementTypes('customProvider', [
|
||
|
|
new hiprint.PrintElementTypeGroup('', [
|
||
|
|
{
|
||
|
|
tid: 'providerModule1.date',
|
||
|
|
title: '业务日期',
|
||
|
|
data: '2020-01-01',
|
||
|
|
type: 'text',
|
||
|
|
options: {
|
||
|
|
field: 'date',
|
||
|
|
testData: '2020-01-01',
|
||
|
|
height: 16,
|
||
|
|
fontSize: 6.75,
|
||
|
|
fontWeight: '700',
|
||
|
|
textAlign: 'left',
|
||
|
|
textContentVerticalAlign: 'middle',
|
||
|
|
hideTitle: true
|
||
|
|
}
|
||
|
|
},
|
||
|
|
{
|
||
|
|
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: 'Logo',
|
||
|
|
data: 'https://foruda.gitee.com/avatar/1677050350324030848/5400665_ccsimple_1591166830.png!avatar200',
|
||
|
|
type: 'image'
|
||
|
|
}
|
||
|
|
])
|
||
|
|
])
|
||
|
|
}
|
||
|
|
return {
|
||
|
|
addElementTypes: addElementTypes
|
||
|
|
}
|
||
|
|
}
|