"use strict";(self.webpackChunkmy_package_ext=self.webpackChunkmy_package_ext||[]).push([[2861],{19648:function(t,e,n){n.d(e,{Z:function(){return a}});var i=n(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,n=e.getContext("2d");e.width=this.width,e.height=this.height,i.toDataURL(this.content,{margin:1,width:this.width,height:this.height,errorCorrectionLevel:"H"}).then((function(e){var i=new Image;i.src=e,i.onload=function(){n.drawImage(i,0,0,t.width,t.height),n.fillStyle="#000000",n.font="16px ".concat(t.font),n.textAlign="center",n.fillText(t.content,t.width/2,t.height+20)}}))}}},(0,n(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,n){n.d(e,{Z:function(){return a}}),e=n(62669);var i=n.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(){i()(".barcode",String(this.value),{height:this.height,displayValue:this.displayValue,fontSize:15,background:this.background,lineColor:this.lineColor,margin:0})}}},(0,n(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)},72861:function(t,e,n){n.r(e),n.d(e,{default:function(){return a}}),e=n(73637);var i=n(19648),a=(e={name:"barcode",components:{JsBarcode:e.Z,QRcode:i.Z},props:{value:{},codeType:{Type:String,default:""},isInChildren:{type:Boolean,default:!1},mode:{default:"edit"}},data:function(){return{show:!1}},computed:{isEmpty:function(){return!this.value&&"0"!==this.value||!this.codeType},disabledOrReadonly:function(){return this.$attrs.readonly||this.$attrs.disabled}},methods:{switchPopup:function(t){this.show=t}}},(0,n(51900).Z)(e,(function(){var t=this,e=t._self._c;return e("div",[t.isInChildren?e("div",[e("van-icon",{attrs:{name:"qr"}})],1):e("div",{staticClass:"content-box",on:{click:function(e){return e.stopPropagation(),t.switchPopup(!0)}}},[e("div",[e("van-icon",{attrs:{name:"qr"}}),t._v(" "),t.disabledOrReadonly?t._e():e("van-icon",{attrs:{name:"arrow"}})],1)]),t._v(" "),e("van-popup",{staticStyle:{padding:"10px"},attrs:{round:""},model:{value:t.show,callback:function(e){t.show=e},expression:"show"}},[t.isEmpty?e("div",{staticClass:"empty"},[t._v("\n      无效条码\n    ")]):"barcode"===t.codeType?e("JsBarcode",{staticStyle:{height:"120px",width:"160px"},attrs:{value:t.value,widthStyleObj:"width: 160px;"}}):e("QRcode",{attrs:{content:t.value,height:160,width:160}})],1)],1)}),[],!1,null,"e9f0b932",null).exports)}}]);