import{_ as g,v as f}from"./vendor-vue-esign.0fac9558.js";import{f as p,b8 as o,b2 as i,ax as l,ay as s,ah as m,c as a,bu as n,H as u,av as c,aw as d,ag as w,F as v}from"./vendor-@vue.54cfd5db.js";const y=p({name:"esign-view",components:{vueEsign:f},props:{value:{required:!0,type:[String],default:""},label:{type:String,required:!0,default:""},width:{required:!0,type:Number,default:800},height:{required:!0,type:Number,default:300},lineWidth:{required:!0,type:Number,default:4},darkColor:{required:!0,type:String,default:"#000000"},lightColor:{required:!0,type:String,default:"#ffffff"},isCrop:{required:!0,type:Boolean,default:!1}},emits:["clear","ok"],data(){return{resultImg:"",showSign:!0}},watch:{value(e){e?(this.showSign=!1,this.resultImg=e):this.showSign=!0}},created(){this.value?(this.showSign=!1,this.resultImg=this.value):this.showSign=!0},methods:{clear(){this.resultImg="",this.showSign=!0,this.$nextTick(()=>{this.$refs.esign.reset(),this.$emit("clear","")})},ok(){this.$refs.esign.generate().then(e=>{e&&(this.showSign=!1,this.resultImg=e,this.$emit("ok",this.resultImg))}).catch(()=>{abp.notify.warn("\u8BF7\u7B7E\u540D")})}}}),_={class:"sigbut"},b={class:"tip"},k={class:"left-bu"},S={class:"online-sign"},C=["src"];function $(e,t,q,B,I,N){const r=o("a-button"),h=o("vue-esign");return i(),l(v,null,[s("div",_,[s("div",b,m(e.label),1),s("div",k,[a(r,{size:"small",onClick:e.clear},{default:n(()=>[...t[0]||(t[0]=[u("\u6E05\u7A7A",-1)])]),_:1},8,["onClick"]),a(r,{size:"small",type:"primary",onClick:e.ok,disabled:!e.showSign},{default:n(()=>[...t[1]||(t[1]=[u("\u786E\u8BA4",-1)])]),_:1},8,["onClick","disabled"])])]),s("div",S,[e.showSign?(i(),c(h,{key:0,value:e.value,ref:"esign",width:e.width,height:e.height,"is-crop":e.isCrop,"line-width":e.lineWidth,"line-color":e.darkColor,"bg-color":e.lightColor,style:{flex:"1"}},null,8,["value","width","height","is-crop","line-width","line-color","bg-color"])):d("",!0),e.showSign?d("",!0):(i(),l("img",{key:1,src:e.resultImg,alt:"",class:"sign-img",style:w({width:e.width?e.width+"px":"100%"})},null,12,C))])],64)}var z=g(y,[["render",$],["__scopeId","data-v-7212604d"]]);export{z as default};
