(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-2d229835"],{de86:function(e,t,n){"use strict";n.r(t);var i=function(){var e=this,t=e._self._c;return e.dlgVisible?t("ElImageViewer",{attrs:{"on-close":e.closeViewer,"url-list":e.srcList,"z-index":9999,"initial-index":e.imageIndex}}):e._e()},o=[],s=function(){var e=this,t=e._self._c;return t("transition",{attrs:{name:"viewer-fade"}},[t("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":e.viewerZIndex},attrs:{tabindex:"-1"}},[t("div",{staticClass:"el-image-viewer__mask",on:{click:function(t){return t.target!==t.currentTarget?null:e.handleMaskClick.apply(null,arguments)}}}),t("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:e.hide}},[t("i",{staticClass:"el-icon-close"})]),e.isSingle?e._e():[t("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!e.infinite&&e.isFirst},on:{click:e.prev}},[t("i",{staticClass:"el-icon-arrow-left"})]),t("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!e.infinite&&e.isLast},on:{click:e.next}},[t("i",{staticClass:"el-icon-arrow-right"})])],t("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[t("div",{staticClass:"el-image-viewer__actions__inner"},[t("i",{staticClass:"el-icon-zoom-out",on:{click:function(t){return e.handleActions("zoomOut")}}}),t("i",{staticClass:"el-icon-zoom-in",on:{click:function(t){return e.handleActions("zoomIn")}}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{class:e.mode.icon,on:{click:e.toggleMode}}),t("i",{staticClass:"el-image-viewer__actions__divider"}),t("i",{staticClass:"el-icon-refresh-left",on:{click:function(t){return e.handleActions("anticlocelise")}}}),t("i",{staticClass:"el-icon-refresh-right",on:{click:function(t){return e.handleActions("clocelise")}}})])]),t("div",{staticClass:"el-image-viewer__canvas"},e._l(e.urlList,(function(n,i){return i===e.index?t("img",{key:n,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:e.imgStyle,attrs:{src:e.currentImg},on:{load:e.handleImgLoad,error:e.handleImgError,mousedown:e.handleMouseDown}}):e._e()})),0)],2)])},a=[],l=n("2b0e");const r=l["default"].prototype.$isServer,c=/([\:\-\_]+(.))/g,d=/^moz([A-Z])/,u=r?0:Number(document.documentMode),h=function(e){return(e||"").replace(/^[\s\uFEFF]+|[\s\uFEFF]+$/g,"")},f=function(e){return e.replace(c,(function(e,t,n,i){return i?n.toUpperCase():n})).replace(d,"Moz$1")},m=function(){return!r&&document.addEventListener?function(e,t,n){e&&t&&n&&e.addEventListener(t,n,!1)}:function(e,t,n){e&&t&&n&&e.attachEvent("on"+t,n)}}(),p=function(){return!r&&document.removeEventListener?function(e,t,n){e&&t&&e.removeEventListener(t,n,!1)}:function(e,t,n){e&&t&&e.detachEvent("on"+t,n)}}();function g(e,t){if(!e||!t)return!1;if(-1!==t.indexOf(" "))throw new Error("className should not contain space.");return e.classList?e.classList.contains(t):(" "+e.className+" ").indexOf(" "+t+" ")>-1}function v(e,t){if(e){for(var n=e.className,i=(t||"").split(" "),o=0,s=i.length;o<s;o++){var a=i[o];a&&(e.classList?e.classList.add(a):g(e,a)||(n+=" "+a))}e.classList||e.setAttribute("class",n)}}function y(e,t){if(e&&t){for(var n=t.split(" "),i=" "+e.className+" ",o=0,s=n.length;o<s;o++){var a=n[o];a&&(e.classList?e.classList.remove(a):g(e,a)&&(i=i.replace(" "+a+" "," ")))}e.classList||e.setAttribute("class",h(i))}}const w=u<9?function(e,t){if(!r){if(!e||!t)return null;t=f(t),"float"===t&&(t="styleFloat");try{switch(t){case"opacity":try{return e.filters.item("alpha").opacity/100}catch(n){return 1}default:return e.style[t]||e.currentStyle?e.currentStyle[t]:null}}catch(n){return e.style[t]}}}:function(e,t){if(!r){if(!e||!t)return null;t=f(t),"float"===t&&(t="cssFloat");try{var n=document.defaultView.getComputedStyle(e,"");return e.style[t]||n?n[t]:null}catch(i){return e.style[t]}}};let _=e=>{var t={};return e&&"[object Function]"===t.toString.call(e)};"object"===typeof Int8Array||!l["default"].prototype.$isServer&&"function"===typeof document.childNodes||(_=function(e){return"function"===typeof e||!1});Object.prototype.hasOwnProperty;const b=function(){return!l["default"].prototype.$isServer&&!!window.navigator.userAgent.match(/firefox/i)};function k(e){let t=!1;return function(...n){t||(t=!0,window.requestAnimationFrame(i=>{e.apply(this,n),t=!1}))}}var x=function(e){for(let t=1,n=arguments.length;t<n;t++){let n=arguments[t]||{};for(let t in n)if(n.hasOwnProperty(t)){let i=n[t];void 0!==i&&(e[t]=i)}}return e};let C,I=!1,S=!1;const L=function(){if(l["default"].prototype.$isServer)return;let e=N.modalDom;return e?I=!0:(I=!1,e=document.createElement("div"),N.modalDom=e,e.addEventListener("touchmove",(function(e){e.preventDefault(),e.stopPropagation()})),e.addEventListener("click",(function(){N.doOnModalClick&&N.doOnModalClick()}))),e},z={},N={modalFade:!0,getInstance:function(e){return z[e]},register:function(e,t){e&&t&&(z[e]=t)},deregister:function(e){e&&(z[e]=null,delete z[e])},nextZIndex:function(){return N.zIndex++},modalStack:[],doOnModalClick:function(){const e=N.modalStack[N.modalStack.length-1];if(!e)return;const t=N.getInstance(e.id);t&&t.closeOnClickModal&&t.close()},openModal:function(e,t,n,i,o){if(l["default"].prototype.$isServer)return;if(!e||void 0===t)return;this.modalFade=o;const s=this.modalStack;for(let l=0,r=s.length;l<r;l++){const t=s[l];if(t.id===e)return}const a=L();if(v(a,"v-modal"),this.modalFade&&!I&&v(a,"v-modal-enter"),i){let e=i.trim().split(/\s+/);e.forEach(e=>v(a,e))}setTimeout(()=>{y(a,"v-modal-enter")},200),n&&n.parentNode&&11!==n.parentNode.nodeType?n.parentNode.appendChild(a):document.body.appendChild(a),t&&(a.style.zIndex=t),a.tabIndex=0,a.style.display="",this.modalStack.push({id:e,zIndex:t,modalClass:i})},closeModal:function(e){const t=this.modalStack,n=L();if(t.length>0){const i=t[t.length-1];if(i.id===e){if(i.modalClass){let e=i.modalClass.trim().split(/\s+/);e.forEach(e=>y(n,e))}t.pop(),t.length>0&&(n.style.zIndex=t[t.length-1].zIndex)}else for(let n=t.length-1;n>=0;n--)if(t[n].id===e){t.splice(n,1);break}}0===t.length&&(this.modalFade&&v(n,"v-modal-leave"),setTimeout(()=>{0===t.length&&(n.parentNode&&n.parentNode.removeChild(n),n.style.display="none",N.modalDom=void 0),y(n,"v-modal-leave")},200))}};Object.defineProperty(N,"zIndex",{configurable:!0,get(){return S||(C=C||(l["default"].prototype.$ELEMENT||{}).zIndex||2e3,S=!0),C},set(e){C=e}});const E=function(){if(!l["default"].prototype.$isServer&&N.modalStack.length>0){const e=N.modalStack[N.modalStack.length-1];if(!e)return;const t=N.getInstance(e.id);return t}};l["default"].prototype.$isServer||window.addEventListener("keydown",(function(e){if(27===e.keyCode){const e=E();e&&e.closeOnPressEscape&&(e.handleClose?e.handleClose():e.handleAction?e.handleAction("cancel"):e.close())}}));var O=N;let F;var A=function(){if(l["default"].prototype.$isServer)return 0;if(void 0!==F)return F;const e=document.createElement("div");e.className="el-scrollbar__wrap",e.style.visibility="hidden",e.style.width="100px",e.style.position="absolute",e.style.top="-9999px",document.body.appendChild(e);const t=e.offsetWidth;e.style.overflow="scroll";const n=document.createElement("div");n.style.width="100%",e.appendChild(n);const i=n.offsetWidth;return e.parentNode.removeChild(e),F=t-i,F};let $,T=1;Boolean,Boolean,Boolean,Boolean,Boolean,Boolean,Boolean;const M={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},D=b()?"DOMMouseScroll":"mousewheel";var B={name:"elImageViewer",props:{urlList:{type:Array,default:()=>[]},zIndex:{type:Number,default:2e3},onSwitch:{type:Function,default:()=>{}},onClose:{type:Function,default:()=>{}},initialIndex:{type:Number,default:0},appendToBody:{type:Boolean,default:!0},maskClosable:{type:Boolean,default:!0}},data(){return{index:this.initialIndex,isShow:!1,infinite:!0,loading:!1,mode:M.CONTAIN,transform:{scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}}},computed:{isSingle(){return this.urlList.length<=1},isFirst(){return 0===this.index},isLast(){return this.index===this.urlList.length-1},currentImg(){return this.urlList[this.index]},imgStyle(){const{scale:e,deg:t,offsetX:n,offsetY:i,enableTransition:o}=this.transform,s={transform:`scale(${e}) rotate(${t}deg)`,transition:o?"transform .3s":"","margin-left":n+"px","margin-top":i+"px"};return this.mode===M.CONTAIN&&(s.maxWidth=s.maxHeight="100%"),s},viewerZIndex(){const e=O.nextZIndex();return this.zIndex>e?this.zIndex:e}},watch:{index:{handler:function(e){this.reset(),this.onSwitch(e)}},currentImg(e){this.$nextTick(e=>{const t=this.$refs.img[0];t.complete||(this.loading=!0)})}},methods:{hide(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall(){this._keyDownHandler=e=>{e.stopPropagation();const t=e.keyCode;switch(t){case 27:this.hide();break;case 32:this.toggleMode();break;case 37:this.prev();break;case 38:this.handleActions("zoomIn");break;case 39:this.next();break;case 40:this.handleActions("zoomOut");break}},this._mouseWheelHandler=k(e=>{const t=e.wheelDelta?e.wheelDelta:-e.detail;t>0?this.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):this.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),m(document,"keydown",this._keyDownHandler),m(document,D,this._mouseWheelHandler)},deviceSupportUninstall(){p(document,"keydown",this._keyDownHandler),p(document,D,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad(e){this.loading=!1},handleImgError(e){this.loading=!1,e.target.alt="加载失败"},handleMouseDown(e){if(this.loading||0!==e.button)return;const{offsetX:t,offsetY:n}=this.transform,i=e.pageX,o=e.pageY;this._dragHandler=k(e=>{this.transform.offsetX=t+e.pageX-i,this.transform.offsetY=n+e.pageY-o}),m(document,"mousemove",this._dragHandler),m(document,"mouseup",e=>{p(document,"mousemove",this._dragHandler)}),e.preventDefault()},handleMaskClick(){this.maskClosable&&this.hide()},reset(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode(){if(this.loading)return;const e=Object.keys(M),t=Object.values(M),n=t.indexOf(this.mode),i=(n+1)%e.length;this.mode=M[e[i]],this.reset()},prev(){if(this.isFirst&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index-1+e)%e},next(){if(this.isLast&&!this.infinite)return;const e=this.urlList.length;this.index=(this.index+1)%e},handleActions(e,t={}){if(this.loading)return;const{zoomRate:n,rotateDeg:i,enableTransition:o}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...t},{transform:s}=this;switch(e){case"zoomOut":s.scale>.2&&(s.scale=parseFloat((s.scale-n).toFixed(3)));break;case"zoomIn":s.scale=parseFloat((s.scale+n).toFixed(3));break;case"clocelise":s.deg+=i;break;case"anticlocelise":s.deg-=i;break}s.enableTransition=o}},mounted(){this.deviceSupportInstall(),this.appendToBody&&document.body.appendChild(this.$el),this.$refs["el-image-viewer__wrapper"].focus()},destroyed(){this.appendToBody&&this.$el&&this.$el.parentNode&&this.$el.parentNode.removeChild(this.$el)}},H=B,j=n("2877"),V=Object(j["a"])(H,s,a,!1,null,null,null),U=V.exports,W={components:{ElImageViewer:U},props:{dlgVisible:{type:Boolean,default:!1},getUrl:{type:[Array,String],default:null},initial:{type:Number,default:0}},data(){return{}},computed:{srcList(){return"string"==typeof this.getUrl?[this.getUrl]:this.getUrl},imageIndex(){return this.initial}},methods:{closeViewer(){this.$emit("dlgClose","showImg")}}},X=W,Y=Object(j["a"])(X,i,o,!1,null,"c034401e",null);t["default"]=Y.exports}}]);