info.ec61b683.js 39 KB

1234567
  1. import{_ as Q}from"./index.vue.cace3977.js";import{_ as q}from"./client-only.4bc740b3.js";import{u as _}from"./asyncData.0d7e5235.js";import{aq as ee,aO as te,f as E,y as k,N as ie,r as A,k as d,bw as se,o as y,m as $,w as v,c as H,a2 as Z,t as Y,n as I,R as T,d as O,bK as oe,_ as re,bO as ae,as as ne,$ as U,a0 as V,a as f,a4 as L,s as R,j as he,b as C,E as x,J as le,W as G,a9 as pe,a3 as D,H as ce,I as ue,l as N,q as fe,i as de,h as ge,g as me,bP as ve,P as we,au as Ce,bQ as be,p as ye,e as xe,v as Oe}from"./entry.32bca663.js";import{E as Xe}from"./index.813f8bc8.js";import{E as Ye}from"./index.c2ef993e.js";import{a as He,E as Me}from"./index.2edcba6e.js";import{a as F,u as M,E as Se}from"./index.8b7e1442.js";import{d as B}from"./dropdown.998c21fe.js";import{E as We}from"./index.4f29d5ed.js";import{_ as Ie}from"./_plugin-vue_export-helper.c27b6911.js";import"./cloneDeep.b21817e1.js";import"./index.862a4486.js";import"./_getTag.1e4f6237.js";import"./isUndefined.aa0326a0.js";import"./debounce.36839b66.js";const Ee=ee({trigger:F.trigger,placement:B.placement,disabled:F.disabled,visible:M.visible,transition:M.transition,popperOptions:B.popperOptions,tabindex:B.tabindex,content:M.content,popperStyle:M.popperStyle,popperClass:M.popperClass,enterable:{...M.enterable,default:!0},effect:{...M.effect,default:"light"},teleported:M.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}}),ke={"update:visible":e=>te(e),"before-enter":()=>!0,"before-leave":()=>!0,"after-enter":()=>!0,"after-leave":()=>!0},$e="onUpdate:visible",Le=E({name:"ElPopover"}),Ae=E({...Le,props:Ee,emits:ke,setup(e,{expose:t,emit:i}){const s=e,o=k(()=>s[$e]),r=ie("popover"),a=A(),n=k(()=>{var p;return(p=d(a))==null?void 0:p.popperRef}),l=k(()=>[{width:se(s.width)},s.popperStyle]),u=k(()=>[r.b(),s.popperClass,{[r.m("plain")]:!!s.content}]),h=k(()=>s.transition===`${r.namespace.value}-fade-in-linear`),c=()=>{var p;(p=a.value)==null||p.hide()},g=()=>{i("before-enter")},X=()=>{i("before-leave")},w=()=>{i("after-enter")},m=()=>{i("update:visible",!1),i("after-leave")};return t({popperRef:n,hide:c}),(p,b)=>(y(),$(d(Se),oe({ref_key:"tooltipRef",ref:a},p.$attrs,{trigger:p.trigger,placement:p.placement,disabled:p.disabled,visible:p.visible,transition:p.transition,"popper-options":p.popperOptions,tabindex:p.tabindex,content:p.content,offset:p.offset,"show-after":p.showAfter,"hide-after":p.hideAfter,"auto-close":p.autoClose,"show-arrow":p.showArrow,"aria-label":p.title,effect:p.effect,enterable:p.enterable,"popper-class":d(u),"popper-style":d(l),teleported:p.teleported,persistent:p.persistent,"gpu-acceleration":d(h),"onUpdate:visible":d(o),onBeforeShow:g,onBeforeHide:X,onShow:w,onHide:m}),{content:v(()=>[p.title?(y(),H("div",{key:0,class:Z(d(r).e("title")),role:"title"},Y(p.title),3)):I("v-if",!0),T(p.$slots,"default",{},()=>[O(Y(p.content),1)])]),default:v(()=>[p.$slots.reference?T(p.$slots,"reference",{key:0}):I("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 Te=re(Ae,[["__file","popover.vue"]]);const j=(e,t)=>{const i=t.arg||t.value,s=i==null?void 0:i.popperRef;s&&(s.triggerRef=e)};var ze={mounted(e,t){j(e,t)},updated(e,t){j(e,t)}};const Ne="popover",Be=ae(ze,Ne),Pe=ne(Te,{directive:Be});const K={};K.getData=e=>new Promise((t,i)=>{let s={};Ue(e).then(o=>{s.arrayBuffer=o,s.orientation=Fe(o),t(s)}).catch(o=>{i(o)})});function Ue(e){let t=null;return new Promise((i,s)=>{if(e.src)if(/^data\:/i.test(e.src))t=Re(e.src),i(t);else if(/^blob\:/i.test(e.src)){var o=new FileReader;o.onload=function(a){t=a.target.result,i(t)},Ve(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,i(t);else throw"Could not load image";r=null},r.open("GET",e.src,!0),r.responseType="arraybuffer",r.send(null)}else s("img error")})}function Ve(e,t){var i=new XMLHttpRequest;i.open("GET",e,!0),i.responseType="blob",i.onload=function(s){(this.status==200||this.status===0)&&t(this.response)},i.send()}function Re(e){e=e.replace(/^data\:([^\;]+)\;base64,/gmi,"");for(var t=atob(e),i=t.length,s=new ArrayBuffer(i),o=new Uint8Array(s),r=0;r<i;r++)o[r]=t.charCodeAt(r);return s}function De(e,t,i){var s="",o;for(o=t,i+=t;o<i;o++)s+=String.fromCharCode(e.getUint8(o));return s}function Fe(e){var t=new DataView(e),i=t.byteLength,s,o,r,a,n,l,u,h,c,g;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(c=2;c<i;){if(t.getUint8(c)===255&&t.getUint8(c+1)===225){u=c;break}c++}if(u&&(o=u+4,r=u+10,De(t,o,4)==="Exif"&&(l=t.getUint16(r),n=l===18761,(n||l===19789)&&t.getUint16(r+2,n)===42&&(a=t.getUint32(r+4,n),a>=8&&(h=r+a)))),h){for(i=t.getUint16(h,n),g=0;g<i;g++)if(c=h+g*12+2,t.getUint16(c,n)===274){c+=8,s=t.getUint16(c,n);break}}return s}var je=(e,t)=>{const i=e.__vccOpts||e;for(const[s,o]of t)i[s]=o;return i};const qe=E({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(" "),i="";let s=0;const o=new RegExp(e,"i");for(var r=0;r<t.length;r++)o.test(t[r])&&(i=t[r]);return i?s=i.split("/")[1].split("."):s=["0","0","0"],s},checkOrientationImage(e,t,i,s){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=i,o.height=s,r.translate(i,0),r.scale(-1,1);break;case 3:o.width=i,o.height=s,r.translate(i/2,s/2),r.rotate(180*Math.PI/180),r.translate(-i/2,-s/2);break;case 4:o.width=i,o.height=s,r.translate(0,s),r.scale(1,-1);break;case 5:o.height=i,o.width=s,r.rotate(.5*Math.PI),r.scale(1,-1);break;case 6:o.width=s,o.height=i,r.translate(s/2,i/2),r.rotate(90*Math.PI/180),r.translate(-i/2,-s/2);break;case 7:o.height=i,o.width=s,r.rotate(.5*Math.PI),r.translate(i,-s),r.scale(-1,1);break;case 8:o.height=i,o.width=s,r.translate(s/2,i/2),r.rotate(-90*Math.PI/180),r.translate(-i/2,-s/2);break;default:o.width=i,o.height=s}r.drawImage(e,0,0,i,s),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 i=e.width,s=e.height;K.getData(e).then(o=>{this.orientation=o.orientation||1;let r=Number(this.maxImgSize);if(!this.orientation&&i<r&s<r){this.imgs=this.img;return}i>r&&(s=s/i*r,i=r),s>r&&(i=i/s*r,s=r),this.checkOrientationImage(e,this.orientation,i,s)})},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 i=URL.createObjectURL(this.response);e.src=i},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 i={x:this.touches[0].clientX,y:this.touches[0].clientY},s={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(i.x-o.x,2)+Math.pow(i.y-o.y,2)),n=Math.sqrt(Math.pow(s.x-r.x,2)+Math.pow(s.y-r.y,2)),l=n-a,u=1;u=u/this.trueWidth>u/this.trueHeight?u/this.trueHeight:u/this.trueWidth,u=u>.1?.1:u;var h=u*l;if(!this.touchNow){if(this.touchNow=!0,l>0?t+=Math.abs(h):l<0&&t>Math.abs(h)&&(t-=Math.abs(h)),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,i="clientY"in e?e.clientY:e.touches[0].clientY,s,o;s=t-this.moveX,o=i-this.moveY,this.$nextTick(()=>{if(this.centerBox){let r=this.getImgAxis(s,o,this.scale),a=this.getCropAxis(),n=this.trueHeight*this.scale,l=this.trueWidth*this.scale,u,h,c,g;switch(this.rotate){case 1:case-1:case 3:case-3:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2+(n-l)/2,h=this.cropOffsertY-this.trueHeight*(1-this.scale)/2+(l-n)/2,c=u-n+this.cropW,g=h-l+this.cropH;break;default:u=this.cropOffsertX-this.trueWidth*(1-this.scale)/2,h=this.cropOffsertY-this.trueHeight*(1-this.scale)/2,c=u-l+this.cropW,g=h-n+this.cropH;break}r.x1>=a.x1&&(s=u),r.y1>=a.y1&&(o=h),r.x2<=a.x2&&(s=c),r.y2<=a.y2&&(o=g)}this.x=s,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 i=e.deltaY||e.wheelDelta,s=navigator.userAgent.indexOf("Firefox");i=s>0?i*30:i,this.isIE&&(i=-i);var o=this.coe;o=o/this.trueWidth>o/this.trueHeight?o/this.trueHeight:o/this.trueWidth;var r=o*i;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 i=20;if(i=i/this.trueWidth>i/this.trueHeight?i/this.trueHeight:i/this.trueWidth,e=e*i,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,i="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;this.$nextTick(()=>{var s=t-this.cropX,o=i-this.cropY;if(s>0?(this.cropW=s+this.cropChangeX>this.w?this.w-this.cropChangeX:s,this.cropOffsertX=this.cropChangeX):(this.cropW=this.w-this.cropChangeX+Math.abs(s)>this.w?this.cropChangeX:Math.abs(s),this.cropOffsertX=this.cropChangeX+s>0?this.cropChangeX+s: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],s>0?this.cropOffsertX=this.cropChangeX:this.cropOffsertX=this.cropChangeX-this.cropW):this.cropH=r,this.cropOffsertY=this.cropOffsertY}})},changeCropSize(e,t,i,s,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=i,this.changeCropTypeX=s,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,i="clientY"in e?e.clientY:e.touches?e.touches[0].clientY:0;let s=this.w,o=this.h,r=0,a=0;if(this.centerBox){let n=this.getImgAxis(),l=n.x2,u=n.y2;r=n.x1>0?n.x1:0,a=n.y1>0?n.y1:0,s>l&&(s=l),o>u&&(o=u)}this.$nextTick(()=>{var n=t-this.cropX,l=i-this.cropY;if(this.canChangeX&&(this.changeCropTypeX===1?this.cropOldW-n>0?(this.cropW=s-this.cropChangeX-n<=s-r?this.cropOldW-n:this.cropOldW+this.cropChangeX-r,this.cropOffsertX=s-this.cropChangeX-n<=s-r?this.cropChangeX+n:r):(this.cropW=Math.abs(n)+this.cropChangeX<=s?Math.abs(n)-this.cropOldW:s-this.cropOldW-this.cropChangeX,this.cropOffsertX=this.cropChangeX+this.cropOldW):this.changeCropTypeX===2&&(this.cropOldW+n>0?(this.cropW=this.cropOldW+n+this.cropOffsertX<=s?this.cropOldW+n:s-this.cropOffsertX,this.cropOffsertX=this.cropChangeX):(this.cropW=s-this.cropChangeX+Math.abs(n+this.cropOldW)<=s-r?Math.abs(n+this.cropOldW):this.cropChangeX-r,this.cropOffsertX=s-this.cropChangeX+Math.abs(n+this.cropOldW)<=s-r?this.cropChangeX-Math.abs(n+this.cropOldW):r))),this.canChangeY&&(this.changeCropTypeY===1?this.cropOldH-l>0?(this.cropH=o-this.cropChangeY-l<=o-a?this.cropOldH-l:this.cropOldH+this.cropChangeY-a,this.cropOffsertY=o-this.cropChangeY-l<=o-a?this.cropChangeY+l:a):(this.cropH=Math.abs(l)+this.cropChangeY<=o?Math.abs(l)-this.cropOldH:o-this.cropOldH-this.cropChangeY,this.cropOffsertY=this.cropChangeY+this.cropOldH):this.changeCropTypeY===2&&(this.cropOldH+l>0?(this.cropH=this.cropOldH+l+this.cropOffsertY<=o?this.cropOldH+l:o-this.cropOffsertY,this.cropOffsertY=this.cropChangeY):(this.cropH=o-this.cropChangeY+Math.abs(l+this.cropOldH)<=o-a?Math.abs(l+this.cropOldH):this.cropChangeY-a,this.cropOffsertY=o-this.cropChangeY+Math.abs(l+this.cropOldH)<=o-a?this.cropChangeY-Math.abs(l+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 h=this.cropH/this.fixedNumber[1]*this.fixedNumber[0];h+this.cropOffsertX>s?(this.cropW=s-this.cropOffsertX,this.cropH=this.cropW/this.fixedNumber[0]*this.fixedNumber[1]):this.cropW=h}})},checkCropLimitSize(){let{cropW:e,cropH:t,limitMinSize:i}=this,s=new Array;return Array.isArray[i]?s=i:s=[i,i],e=parseFloat(s[0]),t=parseFloat(s[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,i="clientY"in e?e.clientY:e.touches[0].clientY,s,o;s=t-this.cropOffsertX,o=i-this.cropOffsertY,this.cropX=s,this.cropY=o,this.$emit("cropMoving",{moving:!0,axis:this.getCropAxis()}),this.$emit("crop-moving",{moving:!0,axis:this.getCropAxis()})},moveCrop(e,t){let i=0,s=0;e&&(e.preventDefault(),i="clientX"in e?e.clientX:e.touches[0].clientX,s="clientY"in e?e.clientY:e.touches[0].clientY),this.$nextTick(()=>{let o,r,a=i-this.cropX,n=s-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 l=this.getImgAxis();o<=l.x1&&(o=l.x1),o+this.cropW>l.x2&&(o=l.x2-this.cropW),r<=l.y1&&(r=l.y1),r+this.cropH>l.y2&&(r=l.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,i){e=e||this.x,t=t||this.y,i=i||this.scale;let s={x1:0,x2:0,y1:0,y2:0},o=this.trueWidth*i,r=this.trueHeight*i;switch(this.rotate){case 0:s.x1=e+this.trueWidth*(1-i)/2,s.x2=s.x1+this.trueWidth*i,s.y1=t+this.trueHeight*(1-i)/2,s.y2=s.y1+this.trueHeight*i;break;case 1:case-1:case 3:case-3:s.x1=e+this.trueWidth*(1-i)/2+(o-r)/2,s.x2=s.x1+this.trueHeight*i,s.y1=t+this.trueHeight*(1-i)/2+(r-o)/2,s.y2=s.y1+this.trueWidth*i;break;default:s.x1=e+this.trueWidth*(1-i)/2,s.x2=s.x1+this.trueWidth*i,s.y1=t+this.trueHeight*(1-i)/2,s.y2=s.y1+this.trueHeight*i;break}return s},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"),i=new Image,s=this.rotate,o=this.trueWidth,r=this.trueHeight,a=this.cropOffsertX,n=this.cropOffsertY;i.onload=()=>{if(this.cropW!==0){let h=t.getContext("2d"),c=1;this.high&!this.full&&(c=window.devicePixelRatio),this.enlarge!==1&!this.full&&(c=Math.abs(Number(this.enlarge)));let g=this.cropW*c,X=this.cropH*c,w=o*this.scale*c,m=r*this.scale*c,p=(this.x-a+this.trueWidth*(1-this.scale)/2)*c,b=(this.y-n+this.trueHeight*(1-this.scale)/2)*c;switch(u(g,X),h.save(),s){case 0:this.full?(u(g/this.scale,X/this.scale),h.drawImage(i,p/this.scale,b/this.scale,w/this.scale,m/this.scale)):h.drawImage(i,p,b,w,m);break;case 1:case-3:this.full?(u(g/this.scale,X/this.scale),p=p/this.scale+(w/this.scale-m/this.scale)/2,b=b/this.scale+(m/this.scale-w/this.scale)/2,h.rotate(s*90*Math.PI/180),h.drawImage(i,b,-p-m/this.scale,w/this.scale,m/this.scale)):(p=p+(w-m)/2,b=b+(m-w)/2,h.rotate(s*90*Math.PI/180),h.drawImage(i,b,-p-m,w,m));break;case 2:case-2:this.full?(u(g/this.scale,X/this.scale),h.rotate(s*90*Math.PI/180),p=p/this.scale,b=b/this.scale,h.drawImage(i,-p-w/this.scale,-b-m/this.scale,w/this.scale,m/this.scale)):(h.rotate(s*90*Math.PI/180),h.drawImage(i,-p-w,-b-m,w,m));break;case 3:case-1:this.full?(u(g/this.scale,X/this.scale),p=p/this.scale+(w/this.scale-m/this.scale)/2,b=b/this.scale+(m/this.scale-w/this.scale)/2,h.rotate(s*90*Math.PI/180),h.drawImage(i,-b-w/this.scale,p,w/this.scale,m/this.scale)):(p=p+(w-m)/2,b=b+(m-w)/2,h.rotate(s*90*Math.PI/180),h.drawImage(i,-b-w,p,w,m));break;default:this.full?(u(g/this.scale,X/this.scale),h.drawImage(i,p/this.scale,b/this.scale,w/this.scale,m/this.scale)):h.drawImage(i,p,b,w,m)}h.restore()}else{let h=o*this.scale,c=r*this.scale,g=t.getContext("2d");switch(g.save(),s){case 0:u(h,c),g.drawImage(i,0,0,h,c);break;case 1:case-3:u(c,h),g.rotate(s*90*Math.PI/180),g.drawImage(i,0,-c,h,c);break;case 2:case-2:u(h,c),g.rotate(s*90*Math.PI/180),g.drawImage(i,-h,-c,h,c);break;case 3:case-1:u(c,h),g.rotate(s*90*Math.PI/180),g.drawImage(i,-h,0,h,c);break;default:u(h,c),g.drawImage(i,0,0,h,c)}g.restore()}e(t)};var l=this.img.substr(0,4);l!=="data"&&(i.crossOrigin="Anonymous"),i.src=this.imgs;function u(h,c){t.width=Math.round(h),t.height=Math.round(c)}},getCropData(e){this.getCropChecked(t=>{e(t.toDataURL("image/"+this.outputType,this.outputSize))})},getCropBlob(e){this.getCropChecked(t=>{t.toBlob(i=>e(i),"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,i=this.scale;var s={};s.div={width:`${e}px`,height:`${t}px`};let o=(this.x-this.cropOffsertX)/i,r=(this.y-this.cropOffsertY)/i,a=0;s.w=e,s.h=t,s.url=this.imgs,s.img={width:`${this.trueWidth}px`,height:`${this.trueHeight}px`,transform:`scale(${i})translate3d(${o}px, ${r}px, ${a}px)rotateZ(${this.rotate*90}deg)`},s.html=`
  2. <div class="show-preview" style="width: ${s.w}px; height: ${s.h}px,; overflow: hidden">
  3. <div style="width: ${e}px; height: ${t}px">
  4. <img src=${s.url} style="width: ${this.trueWidth}px; height: ${this.trueHeight}px; transform:
  5. scale(${i})translate3d(${o}px, ${r}px, ${a}px)rotateZ(${this.rotate*90}deg)">
  6. </div>
  7. </div>`,this.$emit("realTime",s),this.$emit("real-time",s)},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,i=this.trueHeight;const s=this.mode.split(" ");switch(s[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,i=i*e,i<this.h&&(i=this.h,e=i/this.trueHeight);break;default:try{let o=s[0];if(o.search("px")!==-1){o=o.replace("px",""),t=parseFloat(o);const r=t/this.trueWidth;let a=1,n=s[1];n.search("px")!==-1&&(n=n.replace("px",""),i=parseFloat(n),a=i/this.trueHeight),e=Math.min(r,a)}if(o.search("%")!==-1&&(o=o.replace("%",""),t=parseFloat(o)/100*this.w,e=t/this.trueWidth),s.length===2&&o==="auto"){let r=s[1];r.search("px")!==-1&&(r=r.replace("px",""),i=parseFloat(r),e=i/this.trueHeight),r.search("%")!==-1&&(r=r.replace("%",""),i=parseFloat(r)/100*this.h,e=i/this.trueHeight)}}catch{e=1}}return e},goAutoCrop(e,t){if(this.imgs===""||this.imgs===null)return;this.clearCrop(),this.cropping=!0;let i=this.w,s=this.h;if(this.centerBox){const a=Math.abs(this.rotate)%2>0;let n=(a?this.trueHeight:this.trueWidth)*this.scale,l=(a?this.trueWidth:this.trueHeight)*this.scale;i=n<i?n:i,s=l<s?l:s}var o=e||parseFloat(this.autoCropWidth),r=t||parseFloat(this.autoCropHeight);(o===0||r===0)&&(o=i*.8,r=s*.8),o=o>i?i:o,r=r>s?s: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 i=this.getImgAxis();e>i.x2-i.x1&&(e=i.x2-i.x1,t=e/this.fixedNumber[0]*this.fixedNumber[1]),t>i.y2-i.y1&&(t=i.y2-i.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,i){e=e||this.x,t=t||this.y,i=i||this.scale;let s=!0;if(this.centerBox){let o=this.getImgAxis(e,t,i),r=this.getCropAxis();o.x1>=r.x1&&(s=!1),o.x2<=r.x2&&(s=!1),o.y1>=r.y1&&(s=!1),o.y2<=r.y2&&(s=!1)}return s}},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(i,s,o){for(var r=atob(this.toDataURL(s,o).split(",")[1]),a=r.length,n=new Uint8Array(a),l=0;l<a;l++)n[l]=r.charCodeAt(l);i(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()}}),Ze={key:0,class:"cropper-box"},Ge=["src"],Ke={class:"cropper-view-box"},Je=["src"],Qe={key:1};function _e(e,t,i,s,o,r){return y(),H("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?(y(),H("div",Ze,[U(f("div",{class:"cropper-box-canvas",style:L({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)"})},[f("img",{src:e.imgs,alt:"cropper-img",ref:"cropperImg"},null,8,Ge)],4),[[V,!e.loading]])])):I("",!0),f("div",{class:Z(["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),U(f("div",{class:"cropper-crop-box",style:L({width:e.cropW+"px",height:e.cropH+"px",transform:"translate3d("+e.cropOffsertX+"px,"+e.cropOffsertY+"px,0)"})},[f("span",Ke,[f("img",{style:L({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,Je)]),f("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?(y(),H("span",{key:0,class:"crop-info",style:L({top:e.cropInfo.top})},Y(e.cropInfo.width)+" × "+Y(e.cropInfo.height),5)):I("",!0),e.fixedBox?I("",!0):(y(),H("span",Qe,[f("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),f("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),f("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),f("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),f("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),f("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),f("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),f("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),f("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),f("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),f("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),f("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),[[V,e.cropping]])],544)}var J=je(qe,[["render",_e],["__scopeId","data-v-26736c2c"]]);typeof window<"u"&&window.Vue&&window.Vue.createApp({}).component("VueCropper",J);const et={class:"h-[400px]"},tt={class:"dialog-footer"},it=E({__name:"index",emits:["change"],setup(e,{emit:t}){const i=R(),s=R(),o=he({cropperVisible:!1,imagePath:""}),r=n=>{const l=window.URL||window.webkitURL;o.imagePath=l.createObjectURL(n.raw),o.cropperVisible=!0},a=()=>{var n;(n=i.value)==null||n.getCropBlob(async l=>{var g;const u=`file.${l.type.split("/")[1]}`,h=new window.File([l],u,{type:l.type}),c=await le({file:h});o.cropperVisible=!1,t("change",c.uri),(g=s.value)==null||g.clearFiles()})};return(n,l)=>{const u=q;return y(),$(u,null,{default:v(()=>[f("div",null,[C(d(Xe),{ref_key:"uploadRef",ref:s,"show-file-list":!1,limit:1,"on-change":r,"auto-upload":!1},{default:v(()=>[T(n.$slots,"default")]),_:3},512),C(d(Ye),{modelValue:d(o).cropperVisible,"onUpdate:modelValue":l[0]||(l[0]=h=>d(o).cropperVisible=h),"append-to-body":!0,"close-on-click-modal":!1,width:600,onClose:l[1]||(l[1]=h=>d(o).cropperVisible=!1)},{footer:v(()=>[f("span",tt,[C(d(x),{onClick:a},{default:v(()=>[O(" 确认裁剪 ")]),_:1})])]),default:v(()=>[f("div",et,[C(d(J),{ref_key:"vueCropperRef",ref:i,img:d(o).imagePath,autoCrop:!0,"auto-crop-height":200,"auto-crop-width":200,"output-type":"png"},null,8,["img"])])]),_:1},8,["modelValue"])])]),_:3})}}}),st={class:"popover-input__input mr-[10px] flex-1"},ot={class:"popover-input__btns flex-none"},rt=["onClick"],P=E({__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 i=e,s=A(!1),o=A(!1),r=A(),a=()=>{l(),t("confirm",r.value)},n=()=>{i.disabled||(s.value=!0)},l=()=>{s.value=!1};return G(()=>i.value,u=>{r.value=u},{immediate:!0}),pe(document.documentElement,"click",()=>{o.value||l()}),(u,h)=>(y(),H("div",{onMouseenter:h[4]||(h[4]=c=>o.value=!0),onMouseleave:h[5]||(h[5]=c=>o.value=!1)},[C(d(Pe),{placement:"top",visible:d(s),"onUpdate:visible":h[3]||(h[3]=c=>N(s)?s.value=c:null),width:e.width,trigger:"contextmenu",class:"popover-input",teleported:e.teleported,persistent:!1,"popper-class":"!p-0"},{reference:v(()=>[f("div",{class:"inline",onClick:D(n,["stop"])},[T(u.$slots,"default")],8,rt)]),default:v(()=>[f("div",{class:"flex p-3",onClick:h[2]||(h[2]=D(()=>{},["stop"]))},[f("div",st,[e.type=="select"?(y(),$(d(He),{key:0,class:"flex-1",size:e.size,modelValue:d(r),"onUpdate:modelValue":h[0]||(h[0]=c=>N(r)?r.value=c:null),teleported:e.teleported},{default:v(()=>[(y(!0),H(ce,null,ue(e.options,c=>(y(),$(d(Me),{key:c.value,label:c.label,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["size","modelValue","teleported"])):(y(),$(d(fe),{key:1,modelValue:d(r),"onUpdate:modelValue":h[1]||(h[1]=c=>N(r)?r.value=c: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"]))]),f("div",ot,[C(d(x),{link:"",onClick:l},{default:v(()=>[O("取消")]),_:1}),C(d(x),{type:"primary",size:e.size,onClick:a},{default:v(()=>[O(" 确定 ")]),_:1},8,["size"])])])]),_:3},8,["visible","width","teleported"])],32))}}),S=e=>(ye("data-v-67d75096"),e=e(),xe(),e),at={class:"px-[30px] py-5 user-info"},nt=S(()=>f("div",{class:"border-b border-br pb-5"},[f("span",{class:"text-2xl font-medium"},"个人信息")],-1)),ht={class:"mt-5"},lt={class:"info-item"},pt=S(()=>f("div",{class:"item-name"},"头像",-1)),ct={class:"avatar"},ut={class:"change-btn"},ft=S(()=>f("span",{class:"text-xs text-white"},"修改",-1)),dt={class:"info-item leading-10"},gt=S(()=>f("div",{class:"item-name"},"账号",-1)),mt={class:"info-item leading-10"},vt=S(()=>f("div",{class:"item-name"},"昵称",-1)),wt={class:"info-item leading-10"},Ct=S(()=>f("div",{class:"item-name"},"性别",-1)),bt={class:"info-item leading-10"},yt=S(()=>f("div",{class:"item-name"},"手机号",-1)),xt={key:0},Ot={class:"info-item leading-10"},Xt=S(()=>f("div",{class:"item-name"},"注册时间",-1)),Yt={style:{"margin-top":"30px"}},Ht={class:"mt-[60px] flex justify-center"},Mt=E({__name:"info",async setup(e){let t,i;const{setPopupType:s,toggleShowPopup:o,showPopup:r}=de(),a=ge(),{data:n,refresh:l}=([t,i]=me(()=>_(()=>Oe(),{initialCache:!1},"$9W20iVVFEz")),t=await t,i(),t),u=async(m,p)=>{await ve({field:p,value:m}),l()},h=()=>{},c=()=>{},g=()=>{},X=()=>{s(we.BIND_MOBILE),o(!0)};G(r,m=>{m||l()});const w=async()=>{await Ce.confirm("确定退出登录吗?"),await be(),a.logout()};return(m,p)=>{const b=Q,z=q;return y(),H("div",at,[nt,f("div",ht,[f("div",lt,[pt,f("div",ct,[C(d(We),{size:60,src:d(n).avatar},null,8,["src"]),f("div",ut,[C(it,{onChange:p[0]||(p[0]=W=>u(W,"avatar"))},{default:v(()=>[ft]),_:1})])])]),f("div",dt,[gt,f("div",null,[O(Y(d(n).account)+" ",1),C(z,null,{default:v(()=>[C(P,{class:"inline-block",onConfirm:p[1]||(p[1]=W=>u(W,"account")),limit:30,"show-limit":""},{default:v(()=>[C(d(x),{link:""},{default:v(()=>[C(b,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),f("div",mt,[vt,f("div",null,[O(Y(d(n).nickname)+" ",1),C(z,null,{default:v(()=>[C(P,{class:"inline-block",onConfirm:p[2]||(p[2]=W=>u(W,"nickname")),limit:30,"show-limit":""},{default:v(()=>[C(d(x),{link:""},{default:v(()=>[C(b,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),f("div",wt,[Ct,f("div",null,[f("span",null,Y(d(n).sex),1),C(z,null,{default:v(()=>[C(P,{class:"inline-block",type:"select",teleported:!1,options:[{label:"未知",value:0},{label:"男",value:1},{label:"女",value:2}],onConfirm:p[3]||(p[3]=W=>u(W,"sex"))},{default:v(()=>[C(d(x),{link:""},{default:v(()=>[C(b,{name:"el-icon-Edit",size:16})]),_:1})]),_:1})]),_:1})])]),f("div",bt,[yt,d(n).mobile?(y(),H("div",xt,Y(d(n).mobile),1)):I("",!0),C(d(x),{link:"",type:"primary",style:{color:"#007b44"},onClick:X},{default:v(()=>[O(Y(d(n).mobile?"更换手机号":"绑定手机号"),1)]),_:1})]),f("div",Ot,[Xt,f("div",null,Y(d(n).create_time),1)])]),f("div",Yt,[C(d(x),{type:"primary",class:"bgSty",onClick:h},{default:v(()=>[O("农机手认证")]),_:1}),C(d(x),{type:"primary",class:"bgSty",onClick:c},{default:v(()=>[O("烘干服务商认证")]),_:1}),C(d(x),{type:"primary",class:"bgSty",onClick:g},{default:v(()=>[O("飞防服务商认证")]),_:1})]),f("div",Ht,[C(d(x),{type:"primary",class:"bgSty",onClick:w},{default:v(()=>[O("退出登录")]),_:1})])])}}});const Dt=Ie(Mt,[["__scopeId","data-v-67d75096"]]);export{Dt as default};