Configureable barcode format via bwp-js
This commit is contained in:
parent
e5a01bcd76
commit
9e06c46411
12
package.json
12
package.json
|
@ -8,27 +8,27 @@
|
|||
"postbuild": "node env_fix.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"jsbarcode": "^3.11.5",
|
||||
"bwip-js": "^3.2.2",
|
||||
"marked": "2.0.3",
|
||||
"redaxios": "0.4.1",
|
||||
"toastify-js": "1.10.0",
|
||||
"validator": "13.5.2",
|
||||
"vue-i18n": "9.1.4",
|
||||
"vue-toastification": "2.0.0-rc.1",
|
||||
"vue": "3.0.9",
|
||||
"vue-router": "4.0.5"
|
||||
"vue-i18n": "9.1.4",
|
||||
"vue-router": "4.0.5",
|
||||
"vue-toastification": "2.0.0-rc.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tailwindcss/jit": "0.1.18",
|
||||
"@tailwindcss/aspect-ratio": "0.2.0",
|
||||
"@tailwindcss/forms": "0.3.2",
|
||||
"@tailwindcss/jit": "0.1.18",
|
||||
"@tailwindcss/line-clamp": "0.2.0",
|
||||
"@tailwindcss/typography": "0.4.0",
|
||||
"@vitejs/plugin-vue": "1.2.1",
|
||||
"@vue/compiler-sfc": "3.0.11",
|
||||
"autoprefixer": "10.2.5",
|
||||
"tailwindcss": "2.1.1",
|
||||
"release-it": "14.6.1",
|
||||
"tailwindcss": "2.1.1",
|
||||
"vite": "2.1.5"
|
||||
},
|
||||
"release-it": {
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -10,5 +10,6 @@ const config = {
|
|||
// optional, will fallback to baseurl_selfservice/imprint
|
||||
url_imprint: '',
|
||||
// optional, will fallback to baseurl_selfservice/privacy
|
||||
url_privacy: ''
|
||||
url_privacy: '',
|
||||
codeformat: 'code39'
|
||||
};
|
||||
|
|
|
@ -331,11 +331,22 @@
|
|||
import { reactive } from "vue";
|
||||
import { TYPE, useToast } from "vue-toastification";
|
||||
import axios from "redaxios";
|
||||
import JsBarcode from "jsbarcode";
|
||||
import bwipjs from "bwip-js";
|
||||
|
||||
function textToBase64Barcode(text){
|
||||
var canvas = document.createElement("canvas");
|
||||
JsBarcode(canvas, text, {format: "CODE128", displayValue:false});
|
||||
bwipjs.toCanvas(canvas,
|
||||
{
|
||||
bcid: config.codeformat,
|
||||
text: text,
|
||||
scale: 4,
|
||||
height: 10,
|
||||
// width: 10,
|
||||
includetext: true,
|
||||
textxalign: 'center',
|
||||
backgroundcolor: 'ffffff'
|
||||
}
|
||||
)
|
||||
return canvas.toDataURL("image/png");
|
||||
}
|
||||
|
||||
|
@ -353,6 +364,7 @@ const state = reactive({
|
|||
delete_active: false,
|
||||
fullobject: {}
|
||||
})
|
||||
state.barcode = textToBase64Barcode("12345");
|
||||
const toast = useToast();
|
||||
const props = defineProps({
|
||||
token: String
|
||||
|
|
Loading…
Reference in New Issue