"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[2341],{19648:function(t,e,i){i.d(e,{Z:function(){return a}});var n=i(90197),a=(e={name:"QRCodeGenerator",props:{width:{type:Number,default:20},height:{type:Number,default:20},fontSize:{type:Number,default:10},content:{type:String,required:!0}},watch:{content:{immediate:!0,handler:function(t){t&&this.generateQRCode()}}},mounted:function(){this.generateQRCode()},methods:{generateQRCode:function(){var t=this,e=this.$refs.qrcode,i=e.getContext("2d");e.width=this.width,e.height=this.height,n.toDataURL(this.content,{margin:1,width:this.width,height:this.height,errorCorrectionLevel:"H"}).then((function(e){var n=new Image;n.src=e,n.onload=function(){i.drawImage(n,0,0,t.width,t.height),i.fillStyle="#000000",i.font="16px ".concat(t.font),i.textAlign="center",i.fillText(t.content,t.width/2,t.height+20)}}))}}},(0,i(51900).Z)(e,(function(){var t=this;return(0,t._self._c)("canvas",{ref:"qrcode",attrs:{width:t.width,height:t.height,fontSize:t.fontSize}})}),[],!1,null,null,null).exports)},73637:function(t,e,i){i.d(e,{Z:function(){return a}}),e=i(62669);var n=i.n(e),a=(e={props:{value:{},JsBarcodeData:{type:Object},widthStyleObj:{},background:{},lineColor:{},height:{type:Number,default:100},displayValue:{type:Boolean,default:!1}},watch:{value:{immediate:!0,handler:function(){this.drawBarcode()}}},mounted:function(){var t=this;this.$nextTick((function(){t.drawBarcode()}))},methods:{drawBarcode:function(){n()(".barcode",String(this.value),{height:this.height,displayValue:this.displayValue,fontSize:15,background:this.background,lineColor:this.lineColor,margin:0})}}},(0,i(51900).Z)(e,(function(){var t=this._self._c;return t("div",{staticClass:"barcode-wrapper"},[t("img",{staticClass:"barcode",style:this.widthStyleObj})])}),[],!1,null,"46e75cf2",null).exports)},92341:function(t,e,i){i.r(e),i.d(e,{default:function(){return a}}),e=i(73637);var n=i(19648),a=(e={name:"barcode",components:{JsBarcode:e.Z,QRcode:n.Z},props:{value:{},codeType:{Type:String,default:""},isInChildren:{type:Boolean,default:!1}},computed:{isEmpty:function(){return console.log(this.value,"this.value",!this.value),!this.value&&"0"!==this.value||!this.codeType},StyleObj:function(){return this.isInChildren?{width:40,height:30}:{width:160,height:120}}}},(0,i(51900).Z)(e,(function(){var t=this,e=t._self._c;return e("div",[t.isEmpty&&!t.isInChildren?e("div",{staticClass:"empty"},[t._v("\n    条码\n  ")]):e("div",["barcode"===t.codeType?e("JsBarcode",{class:{border_code:!t.isInChildren},style:"height: ".concat(t.StyleObj.height,"px; width: ").concat(t.StyleObj.width,"px; padding: ").concat(t.isInChildren?0:"5px"),attrs:{value:t.value,widthStyleObj:"width: ".concat(t.StyleObj.width,"px;")}}):e("QRcode",{class:{border_code:!t.isInChildren},attrs:{content:t.value,height:t.StyleObj.width,width:t.StyleObj.width}})],1)])}),[],!1,null,"74279551",null).exports)}}]);