info.aae31e7b.js 42 KB

1234567
  1. import{_ as ue}from"./index.vue.40828aaf.js";import{_ as ee}from"./client-only.146da847.js";import{E as te}from"./index.94b99298.js";import{Y as de,ad as fe,f as L,L as T,D as ge,r as D,k as f,bz as me,o as S,m as z,w as v,c as k,O as se,t as X,n as $,ar as B,d as H,bN as ve,_ as we,bR as Ce,aS as be,ak as q,aq as Z,a as c,al as N,s as G,j as A,b as m,E as M,a$ as ye,a4 as ie,aM as xe,N as Q,Q as Se,T as Oe,l as U,q as Xe,i as Ie,h as Ye,g as Me,M as He,bS as We,b5 as V,b6 as _,aV as R,bT as ke,P as Ee,bc as $e,bU as Le,p as Te,e as Ae,v as ze}from"./entry.b7903528.js";/* empty css */import{u as Ne}from"./asyncData.068bb708.js";import{E as De}from"./index.da5fdd20.js";import{d as Be,a as Pe}from"./index.4b4206a2.js";import{a as K,u as E,E as Ue}from"./index.78c50613.js";import{d as F}from"./dropdown.68f181ce.js";import{_ as oe}from"./_plugin-vue_export-helper.c27b6911.js";import{v as Ve}from"./vue-qr.f2516f0d.js";import{E as _e}from"./index.b6524c60.js";import"./util.8a34bab4.js";import"./isUndefined.aa0326a0.js";import"./_baseClone.baf75b53.js";import"./_getTag.363e3852.js";import"./index.fa80204c.js";import"./debounce.adc59cc5.js";const Re=de({trigger:K.trigger,placement:F.placement,disabled:K.disabled,visible:E.visible,transition:E.transition,popperOptions:F.popperOptions,tabindex:F.tabindex,content:E.content,popperStyle:E.popperStyle,popperClass:E.popperClass,enterable:{...E.enterable,default:!0},effect:{...E.effect,default:"light"},teleported:E.teleported,title:String,width:{type:[String,Number],default:150},offset:{type:Number,default:void 0},showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0},showArrow:{type:Boolean,default:!0},persistent:{type:Boolean,default:!0},"onUpdate:visible":{type:Function}}),Fe={"update:visible":e=>fe(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},je="onUpdate:visible",qe=L({name:"ElPopover"}),Ze=L({...qe,props:Re,emits:Fe,setup(e,{expose:t,emit:s}){const i=e,o=T(()=>i[je]),r=ge("popover"),a=D(),n=T(()=>{var d;return(d=f(a))==null?void 0:d.popperRef}),h=T(()=>[{width:me(i.width)},i.popperStyle]),u=T(()=>[r.b(),i.popperClass,{[r.m("plain")]:!!i.content}]),l=T(()=>i.transition===`${r.namespace.value}-fade-in-linear`),p=()=>{var d;(d=a.value)==null||d.hide()},g=()=>{s("before-enter")},O=()=>{s("before-leave")},w=()=>{s("after-enter")},C=()=>{s("update:visible",!1),s("after-leave")};return t({popperRef:n,hide:p}),(d,b)=>(S(),z(f(Ue),ve({ref_key:"tooltipRef",ref:a},d.$attrs,{trigger:d.trigger,placement:d.placement,disabled:d.disabled,visible:d.visible,transition:d.transition,"popper-options":d.popperOptions,tabindex:d.tabindex,content:d.content,offset:d.offset,"show-after":d.showAfter,"hide-after":d.hideAfter,"auto-close":d.autoClose,"show-arrow":d.showArrow,"aria-label":d.title,effect:d.effect,enterable:d.enterable,"popper-class":f(u),"popper-style":f(h),teleported:d.teleported,persistent:d.persistent,"gpu-acceleration":f(l),"onUpdate:visible":f(o),onBeforeShow:g,onBeforeHide:O,onShow:w,onHide:C}),{content:v(()=>[d.title?(S(),k("div",{key:0,class:se(f(r).e("title")),role:"title"},X(d.title),3)):$("v-if",!0),B(d.$slots,"default",{},()=>[H(X(d.content),1)])]),default:v(()=>[d.$slots.reference?B(d.$slots,"reference",{key:0}):$("v-if",!0)]),_:3},16,["trigger","placement","disabled","visible","transition","popper-options","tabindex","content","offset","show-after","hide-after","auto-close","show-arrow","aria-label","effect","enterable","popper-class","popper-style","teleported","persistent","gpu-acceleration","onUpdate:visible"]))}});var Ge=we(Ze,[["__file","popover.vue"]]);const J=(e,t)=>{const s=t.arg||t.value,i=s==null?void 0:s.popperRef;i&&(i.triggerRef=e)};var Qe={mounted(e,t){J(e,t)},updated(e,t){J(e,t)}};const Ke="popover",Je=Ce(Qe,Ke),et=be(Ge,{directive:Je});const re={};re.getData=e=>new Promise((t,s)=>{let i={};tt(e).then(o=>{i.arrayBuffer=o,i.orientation=rt(o),t(i)}).catch(o=>{s(o)})});function tt(e){let t=null;return new Promise((s,i)=>{if(e.src)if(/^data\:/i.test(e.src))t=it(e.src),s(t);else if(/^blob\:/i.test(e.src)){var o=new FileReader;o.onload=function(a){t=a.target.result,s(t)},st(e.src,function(a){o.readAsArrayBuffer(a)})}else{var r=new XMLHttpRequest;r.onload=function(){if(this.status==200||this.status===0)t=r.response,s(t);else throw"Could not load image";r=null},r.open("GET",e.src,!0),r.responseType="arraybuffer",r.send(null)}else i("img error")})}function st(e,t){var s=new XMLHttpRequest;s.open("GET",e,!0),s.responseType="blob",s.onload=function(i){(this.status==200||this.status===0)&&t(this.response)},s.send()}function it(e){e=e.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var t=atob(e),s=t.length,i=new ArrayBuffer(s),o=new Uint8Array(i),r=0;r<s;r++)o[r]=t.charCodeAt(r);return i}function ot(e,t,s){var i="",o;for(o=t,s+=t;o<s;o++)i+=String.fromCharCode(e.getUint8(o));return i}function rt(e){var t=new DataView(e),s=t.byteLength,i,o,r,a,n,h,u,l,p,g;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(p=2;p<s;){if(t.getUint8(p)===255&&t.getUint8(p+1)===225){u=p;break}p++}if(u&&(o=u+4,r=u+10,ot(t,o,4)==="Exif"&&(h=t.getUint16(r),n=h===18761,(n||h===19789)&&t.getUint16(r+2,n)===42&&(a=t.getUint32(r+4,n),a>=8&&(l=r+a)))),l){for(s=t.getUint16(l,n),g=0;g<s;g++)if(p=l+g*12+2,t.getUint16(p,n)===274){p+=8,i=t.getUint16(p,n);break}}return i}var at=(e,t)=>{const s=e.__vccOpts||e;for(const[i,o]of t)s[i]=o;return s};const nt=L({data:function(){return{w:0,h:0,scale:1,x:0,y:0,loading:!0,trueWidth:0,trueHeight:0,move:!0,moveX:0,moveY:0,crop:!1,cropping:!1,cropW:0,cropH:0,cropOldW:0,cropOldH:0,canChangeX:!1,canChangeY:!1,changeCropTypeX:1,changeCropTypeY:1,cropX:0,cropY:0,cropChangeX:0,cropChangeY:0,cropOffsertX:0,cropOffsertY:0,support:"",touches:[],touchNow:!1,rotate:0,isIos:!1,orientation:0,imgs:"",coe:.2,scaling:!1,scalingSet:"",coeStatus:"",isCanShow:!0}},props:{img:{type:[String,Blob,null,File],default:""},outputSize:{type:Number,default:1},outputType:{type:String,default:"jpeg"},info:{type:Boolean,default:!0},canScale:{type:Boolean,default:!0},autoCrop:{type:Boolean,default:!1},autoCropWidth:{type:[Number,String],default:0},autoCropHeight:{type:[Number,String],default:0},fixed:{type:Boolean,default:!1},fixedNumber:{type:Array,default:()=>[1,1]},fixedBox:{type:Boolean,default:!1},full:{type:Boolean,default:!1},canMove:{type:Boolean,default:!0},canMoveBox:{type:Boolean,default:!0},original:{type:Boolean,default:!1},centerBox:{type:Boolean,default:!1},high:{type:Boolean,default:!0},infoTrue:{type:Boolean,default:!1},maxImgSize:{type:[Number,String],default:2e3},enlarge:{type:[Number,String],default:1},preW:{type:[Number,String],default:0},mode:{type:String,default:"contain"},limitMinSize:{type:[Number,Array,String],default:()=>10}},computed:{cropInfo(){let e={};if(e.top=this.cropOffsertY>21?"-21px":"0px",e.width=this.cropW>0?this.cropW:0,e.height=this.cropH>0?this.cropH:0,this.infoTrue){let t=1;this.high&&!this.full&&(t=window.devicePixelRatio),this.enlarge!==1&!this.full&&(t=Math.abs(Number(this.enlarge))),e.width=e.width*t,e.height=e.height*t,this.full&&(e.width=e.width/this.scale,e.height=e.height/this.scale)}return e.width=e.width.toFixed(0),e.height=e.height.toFixed(0),e},isIE(){return!!window.ActiveXObject||"ActiveXObject"in window},passive(){return this.isIE?null:{passive:!1}}},watch:{img(){this.checkedImg()},imgs(e){e!==""&&this.reload()},cropW(){this.showPreview()},cropH(){this.showPreview()},cropOffsertX(){this.showPreview()},cropOffsertY(){this.showPreview()},scale(e,t){this.showPreview()},x(){this.showPreview()},y(){this.showPreview()},autoCrop(e){e&&this.goAutoCrop()},autoCropWidth(){this.autoCrop&&this.goAutoCrop()},autoCropHeight(){this.autoCrop&&this.goAutoCrop()},mode(){this.checkedImg()},rotate(){this.showPreview(),this.autoCrop?this.goAutoCrop(this.cropW,this.cropH):(this.cropW>0||this.cropH>0)&&this.goAutoCrop(this.cropW,this.cropH)}},methods:{getVersion(e){var t=navigator.userAgent.split(" "),s="";let i=0;const o=new RegExp(e,"i");for(var r=0;r<t.length;r++)o.test(t[r])&&(s=t[r]);return s?i=s.split("/")[1].split("."):i=["0","0","0"],i},checkOrientationImage(e,t,s,i){if(this.getVersion("chrome")[0]>=81)t=-1;else if(this.getVersion("safari")[0]>=605){const a=this.getVersion("version");a[0]>13&&a[1]>1&&(t=-1)}else{const a=navigator.userAgent.toLowerCase().match(/cpu iphone os (.*?) like mac os/);if(a){let n=a[1];n=n.split("_"),(n[0]>13||n[0]>=13&&n[1]>=4)&&(t=-1)}}let o=document.createElement("canvas"),r=o.getContext("2d");switch(r.save(),t){case 2:o.width=s,o.height=i,r.translate(s,0),r.scale(-1,1);break;case 3:o.width=s,o.height=i,r.translate(s/2,i/2),r.rotate(180*Math.PI/180),r.translate(-s/2,-i/2);break;case 4:o.width=s,o.height=i,r.translate(0,i),r.scale(1,-1);break;case 5:o.height=s,o.width=i,r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:o.width=i,o.height=s,r.translate(i/2,s/2),r.rotate(90*Math.PI/180),r.translate(-s/2,-i/2);break;case 7:o.height=s,o.width=i,r.rotate(.5*Math.PI),r.translate(s,-i),r.scale(-1,1);break;case 8:o.height=s,o.width=i,r.translate(i/2,s/2),r.rotate(-90*Math.PI/180),r.translate(-s/2,-i/2);break;default:o.width=s,o.height=i}r.drawImage(e,0,0,s,i),r.restore(),o.toBlob(a=>{let n=URL.createObjectURL(a);URL.revokeObjectURL(this.imgs),this.imgs=n},"image/"+this.outputType,1)},checkedImg(){if(this.img===null||this.img===""){this.imgs="",this.clearCrop();return}this.loading=!0,this.scale=1,this.rotate=0,this.clearCrop();let e=new Image;if(e.onload=()=>{if(this.img==="")return this.$emit("img-load","error"),!1;let s=e.width,i=e.height;re.getData(e).then(o=>{this.orientation=o.orientation||1;let r=Number(this.maxImgSize);if(!this.orientation&&s<r&i<r){this.imgs=this.img;return}s>r&&(i=i/s*r,s=r),i>r&&(s=s/i*r,i=r),this.checkOrientationImage(e,this.orientation,s,i)})},e.onerror=()=>{this.$emit("img-load","error")},this.img.substr(0,4)!=="data"&&(e.crossOrigin=""),this.isIE){var t=new XMLHttpRequest;t.onload=function(){var s=URL.createObjectURL(this.response);e.src=s},t.open("GET",this.img,!0),t.responseType="blob",t.send()}else e.src=this.img},startMove(e){if(e.preventDefault(),this.move&&!this.crop){if(!this.canMove)return!1;this.moveX=("clientX"in e?e.clientX:e.touches[0].clientX)-this.x,this.moveY=("clientY"in e?e.clientY:e.touches[0].clientY)-this.y,e.touches?(window.addEventListener("touchmove",this.moveImg),window.addEventListener("touchend",this.leaveImg),e.touches.length==2&&(this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale))):(window.addEventListener("mousemove",this.moveImg),window.addEventListener("mouseup",this.leaveImg)),this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})}else this.cropping=!0,window.addEventListener("mousemove",this.createCrop),window.addEventListener("mouseup",this.endCrop),window.addEventListener("touchmove",this.createCrop),window.addEventListener("touchend",this.endCrop),this.cropOffsertX=e.offsetX?e.offsetX:e.touches[0].pageX-this.$refs.cropper.offsetLeft,this.cropOffsertY=e.offsetY?e.offsetY:e.touches[0].pageY-this.$refs.cropper.offsetTop,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.cropW=0,this.cropH=0},touchScale(e){e.preventDefault();let t=this.scale;var s={x:this.touches[0].clientX,y:this.touches[0].clientY},i={x:e.touches[0].clientX,y:e.touches[0].clientY},o={x:this.touches[1].clientX,y:this.touches[1].clientY},r={x:e.touches[1].clientX,y:e.touches[1].clientY},a=Math.sqrt(Math.pow(s.x-o.x,2)+Math.pow(s.y-o.y,2)),n=Math.sqrt(Math.pow(i.x-r.x,2)+Math.pow(i.y-r.y,2)),h=n-a,u=1;u=u/this.trueWidth>u/this.trueHeight?u/this.trueHeight:u/this.trueWidth,u=u>.1?.1:u;var l=u*h;if(!this.touchNow){if(this.touchNow=!0,h>0?t+=Math.abs(l):h<0&&t>Math.abs(l)&&(t-=Math.abs(l)),this.touches=e.touches,setTimeout(()=>{this.touchNow=!1},8),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t}},cancelTouchScale(e){window.removeEventListener("touchmove",this.touchScale)},moveImg(e){if(e.preventDefault(),e.touches&&e.touches.length===2)return this.touches=e.touches,window.addEventListener("touchmove",this.touchScale),window.addEventListener("touchend",this.cancelTouchScale),window.removeEventListener("touchmove",this.moveImg),!1;let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,o;i=t-this.moveX,o=s-this.moveY,this.$nextTick(()=>{if(this.centerBox){let r=this.getImgAxis(i,o,this.scale),a=this.getCropAxis(),n=this.trueHeight*this.scale,h=this.trueWidth*this.scale,u,l,p,g;switch(this.rotate){case 1:case-1:case 3:case-3:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(n-h)/2,l=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(h-n)/2,p=u-n+this.cropW,g=l-h+this.cropH;break;default:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,l=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,p=u-h+this.cropW,g=l-n+this.cropH;break}r.x1>=a.x1&&(i=u),r.y1>=a.y1&&(o=l),r.x2<=a.x2&&(i=p),r.y2<=a.y2&&(o=g)}this.x=i,this.y=o,this.$emit("imgMoving",{moving:!0,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!0,axis:this.getImgAxis()})})},leaveImg(e){window.removeEventListener("mousemove",this.moveImg),window.removeEventListener("touchmove",this.moveImg),window.removeEventListener("mouseup",this.leaveImg),window.removeEventListener("touchend",this.leaveImg),this.$emit("imgMoving",{moving:!1,axis:this.getImgAxis()}),this.$emit("img-moving",{moving:!1,axis:this.getImgAxis()})},scaleImg(){this.canScale&&window.addEventListener(this.support,this.changeSize,this.passive)},cancelScale(){this.canScale&&window.removeEventListener(this.support,this.changeSize)},changeSize(e){e.preventDefault();let t=this.scale;var s=e.deltaY||e.wheelDelta,i=navigator.userAgent.indexOf("Firefox");s=i>0?s*30:s,this.isIE&&(s=-s);var o=this.coe;o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth;var r=o*s;r<0?t+=Math.abs(r):t>Math.abs(r)&&(t-=Math.abs(r));let a=r<0?"add":"reduce";if(a!==this.coeStatus&&(this.coeStatus=a,this.coe=.2),this.scaling||(this.scalingSet=setTimeout(()=>{this.scaling=!1,this.coe=this.coe+=.01},50)),this.scaling=!0,!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},changeScale(e){let t=this.scale;e=e||1;var s=20;if(s=s/this.trueWidth>s/this.trueHeight?s/this.trueHeight:s/this.trueWidth,e=e*s,e>0?t+=Math.abs(e):t>Math.abs(e)&&(t-=Math.abs(e)),!this.checkoutImgAxis(this.x,this.y,t))return!1;this.scale=t},createCrop(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(()=>{var i=t-this.cropX,o=s-this.cropY;if(i>0?(this.cropW=i+this.cropChangeX>this.w?this.w-this.cropChangeX:i,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(i)>this.w?this.cropChangeX:Math.abs(i),this.cropOffsertX=this.cropChangeX+i>0?this.cropChangeX+i:0),!this.fixed)o>0?(this.cropH=o+this.cropChangeY>this.h?this.h-this.cropChangeY:o,this.cropOffsertY=this.cropChangeY):(this.cropH=this.h-this.cropChangeY+Math.abs(o)>this.h?this.cropChangeY:Math.abs(o),this.cropOffsertY=this.cropChangeY+o>0?this.cropChangeY+o:0);else{var r=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];r+this.cropOffsertY>this.h?(this.cropH=this.h-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0],i>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=r,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(e,t,s,i,o){e.preventDefault(),window.addEventListener("mousemove",this.changeCropNow),window.addEventListener("mouseup",this.changeCropEnd),window.addEventListener("touchmove",this.changeCropNow),window.addEventListener("touchend",this.changeCropEnd),this.canChangeX=t,this.canChangeY=s,this.changeCropTypeX=i,this.changeCropTypeY=o,this.cropX="clientX"in e?e.clientX:e.touches[0].clientX,this.cropY="clientY"in e?e.clientY:e.touches[0].clientY,this.cropOldW=this.cropW,this.cropOldH=this.cropH,this.cropChangeX=this.cropOffsertX,this.cropChangeY=this.cropOffsertY,this.fixed&&this.canChangeX&&this.canChangeY&&(this.canChangeY=0),this.$emit("change-crop-size",{width:this.cropW,height:this.cropH})},changeCropNow(e){e.preventDefault();var t="clientX"in e?e.clientX:e.touches?e.touches[0].clientX:0,s="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;let i=this.w,o=this.h,r=0,a=0;if(this.centerBox){let n=this.getImgAxis(),h=n.x2,u=n.y2;r=n.x1>0?n.x1:0,a=n.y1>0?n.y1:0,i>h&&(i=h),o>u&&(o=u)}this.$nextTick(()=>{var n=t-this.cropX,h=s-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-n>0?(this.cropW=i-this.cropChangeX-n<=i-r?this.cropOldW-n:this.cropOldW+this.cropChangeX-r,this.cropOffsertX=i-this.cropChangeX-n<=i-r?this.cropChangeX+n:r):(this.cropW=Math.abs(n)+this.cropChangeX<=i?Math.abs(n)-this.cropOldW:i-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+n>0?(this.cropW=this.cropOldW+n+this.cropOffsertX<=i?this.cropOldW+n:i-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-r?Math.abs(n+this.cropOldW):this.cropChangeX-r,this.cropOffsertX=i-this.cropChangeX+Math.abs(n+this.cropOldW)<=i-r?this.cropChangeX-Math.abs(n+this.cropOldW):r))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-h>0?(this.cropH=o-this.cropChangeY-h<=o-a?this.cropOldH-h:this.cropOldH+this.cropChangeY-a,this.cropOffsertY=o-this.cropChangeY-h<=o-a?this.cropChangeY+h:a):(this.cropH=Math.abs(h)+this.cropChangeY<=o?Math.abs(h)-this.cropOldH:o-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+h>0?(this.cropH=this.cropOldH+h+this.cropOffsertY<=o?this.cropOldH+h:o-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=o-this.cropChangeY+Math.abs(h+this.cropOldH)<=o-a?Math.abs(h+this.cropOldH):this.cropChangeY-a,this.cropOffsertY=o-this.cropChangeY+Math.abs(h+this.cropOldH)<=o-a?this.cropChangeY-Math.abs(h+this.cropOldH):a))),this.canChangeX&&this.fixed){var u=this.cropW/this.fixedNumber[0]*this.fixedNumber[1];u+this.cropOffsertY>o?(this.cropH=o-this.cropOffsertY,this.cropW=this.cropH/this.fixedNumber[1]*this.fixedNumber[0]):this.cropH=u}if(this.canChangeY&&this.fixed){var l=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];l+this.cropOffsertX>i?(this.cropW=i-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=l}})},checkCropLimitSize(){let{cropW:e,cropH:t,limitMinSize:s}=this,i=new Array;return Array.isArray[s]?i=s:i=[s,s],e=parseFloat(i[0]),t=parseFloat(i[1]),[e,t]},changeCropEnd(e){window.removeEventListener("mousemove",this.changeCropNow),window.removeEventListener("mouseup",this.changeCropEnd),window.removeEventListener("touchmove",this.changeCropNow),window.removeEventListener("touchend",this.changeCropEnd)},endCrop(){this.cropW===0&&this.cropH===0&&(this.cropping=!1),window.removeEventListener("mousemove",this.createCrop),window.removeEventListener("mouseup",this.endCrop),window.removeEventListener("touchmove",this.createCrop),window.removeEventListener("touchend",this.endCrop)},startCrop(){this.crop=!0},stopCrop(){this.crop=!1},clearCrop(){this.cropping=!1,this.cropW=0,this.cropH=0},cropMove(e){if(e.preventDefault(),!this.canMoveBox)return this.crop=!1,this.startMove(e),!1;if(e.touches&&e.touches.length===2)return this.crop=!1,this.startMove(e),this.leaveCrop(),!1;window.addEventListener("mousemove",this.moveCrop),window.addEventListener("mouseup",this.leaveCrop),window.addEventListener("touchmove",this.moveCrop),window.addEventListener("touchend",this.leaveCrop);let t="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY,i,o;i=t-this.cropOffsertX,o=s-this.cropOffsertY,this.cropX=i,this.cropY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(e,t){let s=0,i=0;e&&(e.preventDefault(),s="clientX"in e?e.clientX:e.touches[0].clientX,i="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick(()=>{let o,r,a=s-this.cropX,n=i-this.cropY;if(t&&(a=this.cropOffsertX,n=this.cropOffsertY),a<=0?o=0:a+this.cropW>this.w?o=this.w-this.cropW:o=a,n<=0?r=0:n+this.cropH>this.h?r=this.h-this.cropH:r=n,this.centerBox){let h=this.getImgAxis();o<=h.x1&&(o=h.x1),o+this.cropW>h.x2&&(o=h.x2-this.cropW),r<=h.y1&&(r=h.y1),r+this.cropH>h.y2&&(r=h.y2-this.cropH)}this.cropOffsertX=o,this.cropOffsertY=r,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})})},getImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i={x1:0,x2:0,y1:0,y2:0},o=this.trueWidth*s,r=this.trueHeight*s;switch(this.rotate){case 0:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break;case 1:case-1:case 3:case-3:i.x1=e+this.trueWidth*(1-s)/2+(o-r)/2,i.x2=i.x1+this.trueHeight*s,i.y1=t+this.trueHeight*(1-s)/2+(r-o)/2,i.y2=i.y1+this.trueWidth*s;break;default:i.x1=e+this.trueWidth*(1-s)/2,i.x2=i.x1+this.trueWidth*s,i.y1=t+this.trueHeight*(1-s)/2,i.y2=i.y1+this.trueHeight*s;break}return i},getCropAxis(){let e={x1:0,x2:0,y1:0,y2:0};return e.x1=this.cropOffsertX,e.x2=e.x1+this.cropW,e.y1=this.cropOffsertY,e.y2=e.y1+this.cropH,e},leaveCrop(e){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.$emit("cropMoving",{moving:!1,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!1,axis:this.getCropAxis()})},getCropChecked(e){let t=document.createElement("canvas"),s=new Image,i=this.rotate,o=this.trueWidth,r=this.trueHeight,a=this.cropOffsertX,n=this.cropOffsertY;s.onload=()=>{if(this.cropW!==0){let l=t.getContext("2d"),p=1;this.high&!this.full&&(p=window.devicePixelRatio),this.enlarge!==1&!this.full&&(p=Math.abs(Number(this.enlarge)));let g=this.cropW*p,O=this.cropH*p,w=o*this.scale*p,C=r*this.scale*p,d=(this.x-a+this.trueWidth*(1-this.scale)/2)*p,b=(this.y-n+this.trueHeight*(1-this.scale)/2)*p;switch(u(g,O),l.save(),i){case 0:this.full?(u(g/this.scale,O/this.scale),l.drawImage(s,d/this.scale,b/this.scale,w/this.scale,C/this.scale)):l.drawImage(s,d,b,w,C);break;case 1:case-3:this.full?(u(g/this.scale,O/this.scale),d=d/this.scale+(w/this.scale-C/this.scale)/2,b=b/this.scale+(C/this.scale-w/this.scale)/2,l.rotate(i*90*Math.PI/180),l.drawImage(s,b,-d-C/this.scale,w/this.scale,C/this.scale)):(d=d+(w-C)/2,b=b+(C-w)/2,l.rotate(i*90*Math.PI/180),l.drawImage(s,b,-d-C,w,C));break;case 2:case-2:this.full?(u(g/this.scale,O/this.scale),l.rotate(i*90*Math.PI/180),d=d/this.scale,b=b/this.scale,l.drawImage(s,-d-w/this.scale,-b-C/this.scale,w/this.scale,C/this.scale)):(l.rotate(i*90*Math.PI/180),l.drawImage(s,-d-w,-b-C,w,C));break;case 3:case-1:this.full?(u(g/this.scale,O/this.scale),d=d/this.scale+(w/this.scale-C/this.scale)/2,b=b/this.scale+(C/this.scale-w/this.scale)/2,l.rotate(i*90*Math.PI/180),l.drawImage(s,-b-w/this.scale,d,w/this.scale,C/this.scale)):(d=d+(w-C)/2,b=b+(C-w)/2,l.rotate(i*90*Math.PI/180),l.drawImage(s,-b-w,d,w,C));break;default:this.full?(u(g/this.scale,O/this.scale),l.drawImage(s,d/this.scale,b/this.scale,w/this.scale,C/this.scale)):l.drawImage(s,d,b,w,C)}l.restore()}else{let l=o*this.scale,p=r*this.scale,g=t.getContext("2d");switch(g.save(),i){case 0:u(l,p),g.drawImage(s,0,0,l,p);break;case 1:case-3:u(p,l),g.rotate(i*90*Math.PI/180),g.drawImage(s,0,-p,l,p);break;case 2:case-2:u(l,p),g.rotate(i*90*Math.PI/180),g.drawImage(s,-l,-p,l,p);break;case 3:case-1:u(p,l),g.rotate(i*90*Math.PI/180),g.drawImage(s,-l,0,l,p);break;default:u(l,p),g.drawImage(s,0,0,l,p)}g.restore()}e(t)};var h=this.img.substr(0,4);h!=="data"&&(s.crossOrigin="Anonymous"),s.src=this.imgs;function u(l,p){t.width=Math.round(l),t.height=Math.round(p)}},getCropData(e){this.getCropChecked(t=>{e(t.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(e){this.getCropChecked(t=>{t.toBlob(s=>e(s),"image/"+this.outputType,this.outputSize)})},showPreview(){if(this.isCanShow)this.isCanShow=!1,setTimeout(()=>{this.isCanShow=!0},16);else return!1;let e=this.cropW,t=this.cropH,s=this.scale;var i={};i.div={width:`${e}px`,height:`${t}px`};let o=(this.x-this.cropOffsertX)/s,r=(this.y-this.cropOffsertY)/s,a=0;i.w=e,i.h=t,i.url=this.imgs,i.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${s})translate3d(${o}px, ${r}px, ${a}px)rotateZ(${this.rotate*90}deg)`},i.html=`
  2. <div class="show-preview" style="width: ${i.w}px; height: ${i.h}px,; overflow: hidden">
  3. <div style="width: ${e}px; height: ${t}px">
  4. <img src=${i.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
  5. scale(${s})translate3d(${o}px, ${r}px, ${a}px)rotateZ(${this.rotate*90}deg)">
  6. </div>
  7. </div>`,this.$emit("realTime",i),this.$emit("real-time",i)},reload(){let e=new Image;e.onload=()=>{this.w=parseFloat(window.getComputedStyle(this.$refs.cropper).width),this.h=parseFloat(window.getComputedStyle(this.$refs.cropper).height),this.trueWidth=e.width,this.trueHeight=e.height,this.original?this.scale=1:this.scale=this.checkedMode(),this.$nextTick(()=>{this.x=-(this.trueWidth-this.trueWidth*this.scale)/2+(this.w-this.trueWidth*this.scale)/2,this.y=-(this.trueHeight-this.trueHeight*this.scale)/2+(this.h-this.trueHeight*this.scale)/2,this.loading=!1,this.autoCrop&&this.goAutoCrop(),this.$emit("img-load","success"),this.$emit("imgLoad","success"),setTimeout(()=>{this.showPreview()},20)})},e.onerror=()=>{this.$emit("imgLoad","error"),this.$emit("img-load","error")},e.src=this.imgs},checkedMode(){let e=1,t=this.trueWidth,s=this.trueHeight;const i=this.mode.split(" ");switch(i[0]){case"contain":this.trueWidth>this.w&&(e=this.w/this.trueWidth),this.trueHeight*e>this.h&&(e=this.h/this.trueHeight);break;case"cover":t=this.w,e=t/this.trueWidth,s=s*e,s<this.h&&(s=this.h,e=s/this.trueHeight);break;default:try{let o=i[0];if(o.search("px")!==-1){o=o.replace("px",""),t=parseFloat(o);const r=t/this.trueWidth;let a=1,n=i[1];n.search("px")!==-1&&(n=n.replace("px",""),s=parseFloat(n),a=s/this.trueHeight),e=Math.min(r,a)}if(o.search("%")!==-1&&(o=o.replace("%",""),t=parseFloat(o)/100*this.w,e=t/this.trueWidth),i.length===2&&o==="auto"){let r=i[1];r.search("px")!==-1&&(r=r.replace("px",""),s=parseFloat(r),e=s/this.trueHeight),r.search("%")!==-1&&(r=r.replace("%",""),s=parseFloat(r)/100*this.h,e=s/this.trueHeight)}}catch{e=1}}return e},goAutoCrop(e,t){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let s=this.w,i=this.h;if(this.centerBox){const a=Math.abs(this.rotate)%2>0;let n=(a?this.trueHeight:this.trueWidth)*this.scale,h=(a?this.trueWidth:this.trueHeight)*this.scale;s=n<s?n:s,i=h<i?h:i}var o=e||parseFloat(this.autoCropWidth),r=t||parseFloat(this.autoCropHeight);(o===0||r===0)&&(o=s*.8,r=i*.8),o=o>s?s:o,r=r>i?i:r,this.fixed&&(r=o/this.fixedNumber[0]*this.fixedNumber[1]),r>this.h&&(r=this.h,o=r/this.fixedNumber[1]*this.fixedNumber[0]),this.changeCrop(o,r)},changeCrop(e,t){if(this.centerBox){let s=this.getImgAxis();e>s.x2-s.x1&&(e=s.x2-s.x1,t=e/this.fixedNumber[0]*this.fixedNumber[1]),t>s.y2-s.y1&&(t=s.y2-s.y1,e=t/this.fixedNumber[1]*this.fixedNumber[0])}this.cropW=e,this.cropH=t,this.checkCropLimitSize(),this.$nextTick(()=>{this.cropOffsertX=(this.w-this.cropW)/2,this.cropOffsertY=(this.h-this.cropH)/2,this.centerBox&&this.moveCrop(null,!0)})},refresh(){this.img,this.imgs="",this.scale=1,this.crop=!1,this.rotate=0,this.w=0,this.h=0,this.trueWidth=0,this.trueHeight=0,this.clearCrop(),this.$nextTick(()=>{this.checkedImg()})},rotateLeft(){this.rotate=this.rotate<=-3?0:this.rotate-1},rotateRight(){this.rotate=this.rotate>=3?0:this.rotate+1},rotateClear(){this.rotate=0},checkoutImgAxis(e,t,s){e=e||this.x,t=t||this.y,s=s||this.scale;let i=!0;if(this.centerBox){let o=this.getImgAxis(e,t,s),r=this.getCropAxis();o.x1>=r.x1&&(i=!1),o.x2<=r.x2&&(i=!1),o.y1>=r.y1&&(i=!1),o.y2<=r.y2&&(i=!1)}return i}},mounted(){this.support="onwheel"in document.createElement("div")?"wheel":document.onmousewheel!==void 0?"mousewheel":"DOMMouseScroll";let e=this;var t=navigator.userAgent;this.isIOS=!!t.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/),HTMLCanvasElement.prototype.toBlob||Object.defineProperty(HTMLCanvasElement.prototype,"toBlob",{value:function(s,i,o){for(var r=atob(this.toDataURL(i,o).split(",")[1]),a=r.length,n=new Uint8Array(a),h=0;h<a;h++)n[h]=r.charCodeAt(h);s(new Blob([n],{type:e.type||"image/png"}))}}),this.showPreview(),this.checkedImg()},unmounted(){window.removeEventListener("mousemove",this.moveCrop),window.removeEventListener("mouseup",this.leaveCrop),window.removeEventListener("touchmove",this.moveCrop),window.removeEventListener("touchend",this.leaveCrop),this.cancelScale()}}),ht={key:0,class:"cropper-box"},lt=["src"],ct={class:"cropper-view-box"},pt=["src"],ut={key:1};function dt(e,t,s,i,o,r){return S(),k("div",{class:"vue-cropper",ref:"cropper",onMouseover:t[28]||(t[28]=(...a)=>e.scaleImg&&e.scaleImg(...a)),onMouseout:t[29]||(t[29]=(...a)=>e.cancelScale&&e.cancelScale(...a))},[e.imgs?(S(),k("div",ht,[q(c("div",{class:"cropper-box-canvas",style:N({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+e.x/e.scale+"px,"+e.y/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"})},[c("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,lt)],4),[[Z,!e.loading]])])):$("",!0),c("div",{class:se(["cropper-drag-box",{"cropper-move":e.move&&!e.crop,"cropper-crop":e.crop,"cropper-modal":e.cropping}]),onMousedown:t[0]||(t[0]=(...a)=>e.startMove&&e.startMove(...a)),onTouchstart:t[1]||(t[1]=(...a)=>e.startMove&&e.startMove(...a))},null,34),q(c("div",{class:"cropper-crop-box",style:N({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[c("span",ct,[c("img",{style:N({width:e.trueWidth+"px",height:e.trueHeight+"px",transform:"scale("+e.scale+","+e.scale+") translate3d("+(e.x-e.cropOffsertX)/e.scale+"px,"+(e.y-e.cropOffsertY)/e.scale+"px,0)rotateZ("+e.rotate*90+"deg)"}),src:e.imgs,alt:"cropper-img"},null,12,pt)]),c("span",{class:"cropper-face cropper-move",onMousedown:t[2]||(t[2]=(...a)=>e.cropMove&&e.cropMove(...a)),onTouchstart:t[3]||(t[3]=(...a)=>e.cropMove&&e.cropMove(...a))},null,32),e.info?(S(),k("span",{key:0,class:"crop-info",style:N({top:e.cropInfo.top})},X(e.cropInfo.width)+" × "+X(e.cropInfo.height),5)):$("",!0),e.fixedBox?$("",!0):(S(),k("span",ut,[c("span",{class:"crop-line line-w",onMousedown:t[4]||(t[4]=a=>e.changeCropSize(a,!1,!0,0,1)),onTouchstart:t[5]||(t[5]=a=>e.changeCropSize(a,!1,!0,0,1))},null,32),c("span",{class:"crop-line line-a",onMousedown:t[6]||(t[6]=a=>e.changeCropSize(a,!0,!1,1,0)),onTouchstart:t[7]||(t[7]=a=>e.changeCropSize(a,!0,!1,1,0))},null,32),c("span",{class:"crop-line line-s",onMousedown:t[8]||(t[8]=a=>e.changeCropSize(a,!1,!0,0,2)),onTouchstart:t[9]||(t[9]=a=>e.changeCropSize(a,!1,!0,0,2))},null,32),c("span",{class:"crop-line line-d",onMousedown:t[10]||(t[10]=a=>e.changeCropSize(a,!0,!1,2,0)),onTouchstart:t[11]||(t[11]=a=>e.changeCropSize(a,!0,!1,2,0))},null,32),c("span",{class:"crop-point point1",onMousedown:t[12]||(t[12]=a=>e.changeCropSize(a,!0,!0,1,1)),onTouchstart:t[13]||(t[13]=a=>e.changeCropSize(a,!0,!0,1,1))},null,32),c("span",{class:"crop-point point2",onMousedown:t[14]||(t[14]=a=>e.changeCropSize(a,!1,!0,0,1)),onTouchstart:t[15]||(t[15]=a=>e.changeCropSize(a,!1,!0,0,1))},null,32),c("span",{class:"crop-point point3",onMousedown:t[16]||(t[16]=a=>e.changeCropSize(a,!0,!0,2,1)),onTouchstart:t[17]||(t[17]=a=>e.changeCropSize(a,!0,!0,2,1))},null,32),c("span",{class:"crop-point point4",onMousedown:t[18]||(t[18]=a=>e.changeCropSize(a,!0,!1,1,0)),onTouchstart:t[19]||(t[19]=a=>e.changeCropSize(a,!0,!1,1,0))},null,32),c("span",{class:"crop-point point5",onMousedown:t[20]||(t[20]=a=>e.changeCropSize(a,!0,!1,2,0)),onTouchstart:t[21]||(t[21]=a=>e.changeCropSize(a,!0,!1,2,0))},null,32),c("span",{class:"crop-point point6",onMousedown:t[22]||(t[22]=a=>e.changeCropSize(a,!0,!0,1,2)),onTouchstart:t[23]||(t[23]=a=>e.changeCropSize(a,!0,!0,1,2))},null,32),c("span",{class:"crop-point point7",onMousedown:t[24]||(t[24]=a=>e.changeCropSize(a,!1,!0,0,2)),onTouchstart:t[25]||(t[25]=a=>e.changeCropSize(a,!1,!0,0,2))},null,32),c("span",{class:"crop-point point8",onMousedown:t[26]||(t[26]=a=>e.changeCropSize(a,!0,!0,2,2)),onTouchstart:t[27]||(t[27]=a=>e.changeCropSize(a,!0,!0,2,2))},null,32)]))],4),[[Z,e.cropping]])],544)}var ae=at(nt,[["render",dt],["__scopeId","data-v-26736c2c"]]);typeof window<"u"&&window.Vue&&window.Vue.createApp({}).component("VueCropper",ae);const ft={class:"h-[400px]"},gt={class:"dialog-footer"},mt=L({__name:"index",emits:["change"],setup(e,{emit:t}){const s=G(),i=G(),o=A({cropperVisible:!1,imagePath:""}),r=n=>{const h=window.URL||window.webkitURL;o.imagePath=h.createObjectURL(n.raw),o.cropperVisible=!0},a=()=>{var n;(n=s.value)==null||n.getCropBlob(async h=>{var g;const u=`file.${h.type.split("/")[1]}`,l=new window.File([h],u,{type:h.type}),p=await ye({file:l});o.cropperVisible=!1,t("change",p.uri),(g=i.value)==null||g.clearFiles()})};return(n,h)=>{const u=ee;return S(),z(u,null,{default:v(()=>[c("div",null,[m(f(De),{ref_key:"uploadRef",ref:i,"show-file-list":!1,limit:1,"on-change":r,"auto-upload":!1},{default:v(()=>[B(n.$slots,"default")]),_:3},512),m(f(te),{modelValue:f(o).cropperVisible,"onUpdate:modelValue":h[0]||(h[0]=l=>f(o).cropperVisible=l),"append-to-body":!0,"close-on-click-modal":!1,width:600,onClose:h[1]||(h[1]=l=>f(o).cropperVisible=!1)},{footer:v(()=>[c("span",gt,[m(f(M),{onClick:a},{default:v(()=>[H(" 确认裁剪 ")]),_:1})])]),default:v(()=>[c("div",ft,[m(f(ae),{ref_key:"vueCropperRef",ref:s,img:f(o).imagePath,autoCrop:!0,"auto-crop-height":200,"auto-crop-width":200,"output-type":"png"},null,8,["img"])])]),_:1},8,["modelValue"])])]),_:3})}}}),vt={class:"popover-input__input mr-[10px] flex-1"},wt={class:"popover-input__btns flex-none"},Ct=["onClick"],bt=L({__name:"index",props:{value:{type:String},type:{type:String,default:"text"},width:{type:[Number,String],default:"300px"},placeholder:String,disabled:{type:Boolean,default:!1},options:{type:Array,default:()=>[]},size:{type:String,default:"default"},limit:{type:Number,default:200},showLimit:{type:Boolean,default:!1},teleported:{type:Boolean,default:!0}},emits:["confirm"],setup(e,{emit:t}){const s=e,i=D(!1),o=D(!1),r=D(),a=()=>{h(),t("confirm",r.value)},n=()=>{s.disabled||(i.value=!0)},h=()=>{i.value=!1};return ie(()=>s.value,u=>{r.value=u},{immediate:!0}),xe(document.documentElement,"click",()=>{o.value||h()}),(u,l)=>(S(),k("div",{onMouseenter:l[4]||(l[4]=p=>o.value=!0),onMouseleave:l[5]||(l[5]=p=>o.value=!1)},[m(f(et),{placement:"top",visible:f(i),"onUpdate:visible":l[3]||(l[3]=p=>U(i)?i.value=p:null),width:e.width,trigger:"contextmenu",class:"popover-input",teleported:e.teleported,persistent:!1,"popper-class":"!p-0"},{reference:v(()=>[c("div",{class:"inline",onClick:Q(n,["stop"])},[B(u.$slots,"default",{},void 0,!0)],8,Ct)]),default:v(()=>[c("div",{class:"flex p-3",onClick:l[2]||(l[2]=Q(()=>{},["stop"]))},[c("div",vt,[e.type=="select"?(S(),z(f(Be),{key:0,class:"flex-1",size:e.size,modelValue:f(r),"onUpdate:modelValue":l[0]||(l[0]=p=>U(r)?r.value=p:null),teleported:e.teleported},{default:v(()=>[(S(!0),k(Se,null,Oe(e.options,p=>(S(),z(f(Pe),{key:p.value,label:p.label,value:p.value},null,8,["label","value"]))),128))]),_:1},8,["size","modelValue","teleported"])):(S(),z(f(Xe),{key:1,modelValue:f(r),"onUpdate:modelValue":l[1]||(l[1]=p=>U(r)?r.value=p:null),modelModifiers:{trim:!0},maxlength:e.limit,"show-word-limit":e.showLimit,type:e.type,size:e.size,clearable:"",placeholder:e.placeholder},null,8,["modelValue","maxlength","show-word-limit","type","size","placeholder"]))]),c("div",wt,[m(f(M),{link:"",onClick:h},{default:v(()=>[H("取消")]),_:1}),m(f(M),{class:"bgSty",type:"primary",size:e.size,onClick:a},{default:v(()=>[H(" 确定 ")]),_:1},8,["size"])])])]),_:3},8,["visible","width","teleported"])],32))}});const j=oe(bt,[["__scopeId","data-v-14e79168"]]),Y=e=>(Te("data-v-9c575a07"),e=e(),Ae(),e),yt={class:"px-[30px] py-5 user-info"},xt=Y(()=>c("div",{class:"border-b border-br pb-5"},[c("span",{class:"text-2xl font-medium"},"个人信息")],-1)),St={class:"mt-5"},Ot={class:"info-item"},Xt=Y(()=>c("div",{class:"item-name"},"头像",-1)),It={class:"avatar"},Yt={class:"change-btn"},Mt=Y(()=>c("span",{class:"text-xs text-white"},"修改",-1)),Ht={class:"info-item leading-10"},Wt=Y(()=>c("div",{class:"item-name"},"账号",-1)),kt={class:"info-item leading-10"},Et=Y(()=>c("div",{class:"item-name"},"昵称",-1)),$t={class:"info-item leading-10"},Lt=Y(()=>c("div",{class:"item-name"},"性别",-1)),Tt={class:"info-item leading-10"},At=Y(()=>c("div",{class:"item-name"},"手机号",-1)),zt={key:0},Nt={class:"info-item leading-10"},Dt=Y(()=>c("div",{class:"item-name"},"注册时间",-1)),Bt={class:"info-item leading-10"},Pt=Y(()=>c("div",{class:"item-name"},"农机手认证",-1)),Ut={class:"info-item leading-10"},Vt=Y(()=>c("div",{class:"item-name"},"烘干服务商认证",-1)),_t={class:"info-item leading-10"},Rt=Y(()=>c("div",{class:"item-name"},"飞防服务商认证",-1)),Ft={class:"mt-[60px] flex justify-center"},jt={class:"flex flex-col row-center black",style:{"text-align":"center"}},qt=Y(()=>c("div",{class:"m-t-8",style:{"font-size":"18px","text-align":"center"}}," 微信扫一扫,完成支付 ",-1)),Zt={class:"pay-money flex center",style:{"text-align":"center"}},Gt={class:"primary"},Qt=L({__name:"info",async setup(e){let t,s;const{setPopupType:i,toggleShowPopup:o,showPopup:r}=Ie(),a=Ye(),n=A({getData:""}),h=A({isShow:!1}),{data:u,refresh:l}=([t,s]=Me(()=>Ne(()=>ze(),{initialCache:!1},"$9W20iVVFEz")),t=await t,s(),t),p=A({getCard:"",content:""}),g=A({data:""}),O=async(x,y)=>{await We({field:y,value:x}),l()},w=()=>{if(n.getData.agricultural_status!=0)if(n.getData.agricultural_status==1){let x={from:"service",order_id:n.getData.agricultural.id,pay_way:"2"};V(x).then(y=>{h.isShow=!0,p.getCard=y.config,clearInterval(g.data),g.data=setInterval(()=>{_({order_id:x.order_id}).then(I=>{console.log(I,"ressss获取状态"),I.pay_status==1&&(clearInterval(g.data),R.success("支付成功"),h.isShow=!1)})},3e3)})}else n.getData.agricultural_status==2},C=()=>{if(n.getData.bake_status!=0)if(n.getData.bake_status==1){h.isShow=!0;let x={from:"service",order_id:n.getData.bake.id,pay_way:"2"};V(x).then(y=>{console.log(y.config,"dataaaaaaaa"),p.getCard=y.config,clearInterval(g.data),g.data=setInterval(()=>{_({order_id:x.order_id}).then(I=>{console.log(I,"ressss获取状态"),I.pay_status==1&&(clearInterval(g.data),R.success("支付成功"),h.isShow=!1)})},3e3)})}else n.getData.air_status==2},d=()=>{if(n.getData.air_status!=0)if(n.getData.air_status==1){h.isShow=!0;let x={from:"service",order_id:n.getData.air.id,pay_way:"2"};V(x).then(y=>{console.log(y.config,"dataaaaaaaa"),p.getCard=y.config,clearInterval(g.data),g.data=setInterval(()=>{_({order_id:x.order_id}).then(I=>{console.log(I,"ressss获取状态"),I.pay_status==1&&(clearInterval(g.data),R.success("支付成功"),h.isShow=!1)})},3e3)})}else n.getData.air_status==2},b=()=>{console.log(11111),clearInterval(g.data)},ne=()=>{ke("").then(x=>{console.log(x,"huoqu 获取状态"),n.getData=x})},he=()=>{i(Ee.BIND_MOBILE),o(!0)};ie(r,x=>{x||l()});const le=async()=>{await $e.confirm("确定退出登录吗?"),await Le(),a.logout()};return ne(),(x,y)=>{const I=ue,P=ee,ce=He("price-formate"),pe=te;return S(),k("div",yt,[xt,c("div",St,[c("div",Ot,[Xt,c("div",It,[m(f(_e),{size:60,src:f(u).avatar},null,8,["src"]),c("div",Yt,[m(mt,{onChange:y[0]||(y[0]=W=>O(W,"avatar"))},{default:v(()=>[Mt]),_:1})])])]),c("div",Ht,[Wt,c("div",null,[H(X(f(u).account)+" ",1),m(P,null,{default:v(()=>[m(j,{class:"inline-block",onConfirm:y[1]||(y[1]=W=>O(W,"account")),limit:30,"show-limit":""},{default:v(()=>[m(f(M),{link:""},{default:v(()=>[m(I,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),c("div",kt,[Et,c("div",null,[H(X(f(u).nickname)+" ",1),m(P,null,{default:v(()=>[m(j,{class:"inline-block",onConfirm:y[2]||(y[2]=W=>O(W,"nickname")),limit:30,"show-limit":""},{default:v(()=>[m(f(M),{link:""},{default:v(()=>[m(I,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),c("div",$t,[Lt,c("div",null,[c("span",null,X(f(u).sex),1),m(P,null,{default:v(()=>[m(j,{class:"inline-block",type:"select",teleported:!1,options:[{label:"未知",value:0},{label:"男",value:1},{label:"女",value:2}],onConfirm:y[3]||(y[3]=W=>O(W,"sex"))},{default:v(()=>[m(f(M),{link:""},{default:v(()=>[m(I,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),c("div",Tt,[At,f(u).mobile?(S(),k("div",zt,X(f(u).mobile),1)):$("",!0),m(f(M),{link:"",type:"primary",style:{color:"#007b44"},onClick:he},{default:v(()=>[H(X(f(u).mobile?"更换手机号":"绑定手机号"),1)]),_:1})]),c("div",Nt,[Dt,c("div",null,X(f(u).create_time),1)]),c("div",Bt,[Pt,m(f(M),{link:"",type:"primary",style:{color:"#007b44"},onClick:w},{default:v(()=>[H(X(f(n).getData.agricultural_status==0?"未申请":f(n).getData.agricultural_status==1?"未缴费 ":f(n).getData.agricultural_status==2?"已认证":"已过期"),1)]),_:1})]),c("div",Ut,[Vt,m(f(M),{link:"",type:"primary",style:{color:"#007b44"},onClick:C},{default:v(()=>[H(X(f(n).getData.bake_status==0?"未申请":f(n).getData.bake_status==1?"未缴费 ":f(n).getData.bake_status==2?"已认证 ":"已过期"),1)]),_:1})]),c("div",_t,[Rt,m(f(M),{link:"",type:"primary",style:{color:"#007b44"},onClick:d},{default:v(()=>[H(X(f(n).getData.air_status==0?"未申请":f(n).getData.air_status==1?"未缴费 ":f(n).getData.air_status==2?"已认证":"已过期"),1)]),_:1})])]),c("div",Ft,[m(f(M),{type:"primary",class:"bgSty",onClick:le},{default:v(()=>[H("退出登录")]),_:1})]),m(pe,{title:"微信支付",modelValue:f(h).isShow,"onUpdate:modelValue":y[4]||(y[4]=W=>f(h).isShow=W),width:"700px",center:"",onClose:b},{default:v(()=>[c("div",jt,[m(Ve,{style:{width:"200px",height:"200px",margin:"10px auto"},class:"bicode",logoScale:20,margin:0,dotScale:1,text:f(p).getCard},null,8,["text"]),qt,c("div",Zt,[c("span",Gt,[m(ce,{price:"245","subscript-size":18,"first-size":28,"second-size":28})])])])]),_:1},8,["modelValue"])])}}});const vs=oe(Qt,[["__scopeId","data-v-9c575a07"]]);export{vs as default};