(this.webpackJsonp=this.webpackJsonp||[]).push([["chunk-0c77"],{cLjf:function(t,e,n){t.exports=n("xOJF")},hDQ3:function(t,e,n){"use strict";e.__esModule=!0;var r=function(t){return t&&t.__esModule?t:{default:t}}(n("Asgo"));e.default=function(t){return function(){var e=t.apply(this,arguments);return new r.default(function(t,n){return function i(o,a){try{var s=e[o](a),c=s.value}catch(t){return void n(t)}if(!s.done)return r.default.resolve(c).then(function(t){i("next",t)},function(t){i("throw",t)});t(c)}("next")})}}},k4Ii:function(t,e){!function(e){"use strict";var n,r=Object.prototype,i=r.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",c=o.toStringTag||"@@toStringTag",l="object"==typeof t,u=e.regeneratorRuntime;if(u)l&&(t.exports=u);else{(u=e.regeneratorRuntime=l?t.exports:{}).wrap=_;var h="suspendedStart",f="suspendedYield",d="executing",m="completed",p={},g={};g[a]=function(){return this};var v=Object.getPrototypeOf,y=v&&v(v(A([])));y&&y!==r&&i.call(y,a)&&(g=y);var w=k.prototype=b.prototype=Object.create(g);L.prototype=w.constructor=k,k.constructor=L,k[c]=L.displayName="GeneratorFunction",u.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===L||"GeneratorFunction"===(e.displayName||e.name))},u.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,k):(t.__proto__=k,c in t||(t[c]="GeneratorFunction")),t.prototype=Object.create(w),t},u.awrap=function(t){return{__await:t}},E(O.prototype),O.prototype[s]=function(){return this},u.AsyncIterator=O,u.async=function(t,e,n,r){var i=new O(_(t,e,n,r));return u.isGeneratorFunction(e)?i:i.next().then(function(t){return t.done?t.value:i.next()})},E(w),w[c]="Generator",w[a]=function(){return this},w.toString=function(){return"[object Generator]"},u.keys=function(t){var e=[];for(var n in t)e.push(n);return e.reverse(),function n(){for(;e.length;){var r=e.pop();if(r in t)return n.value=r,n.done=!1,n}return n.done=!0,n}},u.values=A,S.prototype={constructor:S,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(F),!t)for(var e in this)"t"===e.charAt(0)&&i.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,i){return s.type="throw",s.arg=t,e.next=r,i&&(e.method="next",e.arg=n),!!i}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],s=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var c=i.call(a,"catchLoc"),l=i.call(a,"finallyLoc");if(c&&l){if(this.prev=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),F(n),p}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var i=r.arg;F(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:A(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),p}}}function _(t,e,n,r){var i=e&&e.prototype instanceof b?e:b,o=Object.create(i.prototype),a=new S(r||[]);return o._invoke=function(t,e,n){var r=h;return function(i,o){if(r===d)throw new Error("Generator is already running");if(r===m){if("throw"===i)throw o;return N()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=I(a,n);if(s){if(s===p)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(r===h)throw r=m,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r=d;var c=x(t,e,n);if("normal"===c.type){if(r=n.done?m:f,c.arg===p)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r=m,n.method="throw",n.arg=c.arg)}}}(t,n,a),o}function x(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}function b(){}function L(){}function k(){}function E(t){["next","throw","return"].forEach(function(e){t[e]=function(t){return this._invoke(e,t)}})}function O(t){var e;this._invoke=function(n,r){function o(){return new Promise(function(e,o){!function e(n,r,o,a){var s=x(t[n],t,r);if("throw"!==s.type){var c=s.arg,l=c.value;return l&&"object"==typeof l&&i.call(l,"__await")?Promise.resolve(l.__await).then(function(t){e("next",t,o,a)},function(t){e("throw",t,o,a)}):Promise.resolve(l).then(function(t){c.value=t,o(c)},a)}a(s.arg)}(n,r,e,o)})}return e=e?e.then(o,o):o()}}function I(t,e){var r=t.iterator[e.method];if(r===n){if(e.delegate=null,"throw"===e.method){if(t.iterator.return&&(e.method="return",e.arg=n,I(t,e),"throw"===e.method))return p;e.method="throw",e.arg=new TypeError("The iterator does not provide a 'throw' method")}return p}var i=x(r,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,p;var o=i.arg;return o?o.done?(e[t.resultName]=o.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,p):o:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,p)}function C(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function S(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(C,this),this.reset(!0)}function A(t){if(t){var e=t[a];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var r=-1,o=function e(){for(;++r{t.apply(this,n),e=!1}))}}const c={CONTAIN:{name:"contain",icon:"el-icon-full-screen"},ORIGINAL:{name:"original",icon:"el-icon-c-scale-to-original"}},l=!r.default.prototype.$isServer&&window.navigator.userAgent.match(/firefox/i)?"DOMMouseScroll":"mousewheel";var u={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}},data(){return{index:this.initialIndex,isShow:!1,infinite:!0,loading:!1,mode:c.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:t,deg:e,offsetX:n,offsetY:r,enableTransition:i}=this.transform,o={transform:`scale(${t}) rotate(${e}deg)`,transition:i?"transform .3s":"","margin-left":`${n}px`,"margin-top":`${r}px`};return this.mode===c.CONTAIN&&(o.maxWidth=o.maxHeight="100%"),o}},watch:{index:{handler:function(t){this.reset(),this.onSwitch(t)}},currentImg(t){this.$nextTick(t=>{this.$refs.img[0].complete||(this.loading=!0)})}},methods:{hide(){this.deviceSupportUninstall(),this.onClose()},deviceSupportInstall(){this._keyDownHandler=s(t=>{switch(t.keyCode){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")}}),this._mouseWheelHandler=s(t=>{(t.wheelDelta?t.wheelDelta:-t.detail)>0?this.handleActions("zoomIn",{zoomRate:.015,enableTransition:!1}):this.handleActions("zoomOut",{zoomRate:.015,enableTransition:!1})}),o(document,"keydown",this._keyDownHandler),o(document,l,this._mouseWheelHandler)},deviceSupportUninstall(){a(document,"keydown",this._keyDownHandler),a(document,l,this._mouseWheelHandler),this._keyDownHandler=null,this._mouseWheelHandler=null},handleImgLoad(t){this.loading=!1},handleImgError(t){this.loading=!1,t.target.alt="加载失败"},handleMouseDown(t){if(this.loading||0!==t.button)return;const{offsetX:e,offsetY:n}=this.transform,r=t.pageX,i=t.pageY;this._dragHandler=s(t=>{this.transform.offsetX=e+t.pageX-r,this.transform.offsetY=n+t.pageY-i}),o(document,"mousemove",this._dragHandler),o(document,"mouseup",t=>{a(document,"mousemove",this._dragHandler)}),t.preventDefault()},reset(){this.transform={scale:1,deg:0,offsetX:0,offsetY:0,enableTransition:!1}},toggleMode(){if(this.loading)return;const t=Object.keys(c),e=(Object.values(c).indexOf(this.mode)+1)%t.length;this.mode=c[t[e]],this.reset()},prev(){if(this.isFirst&&!this.infinite)return;const t=this.urlList.length;this.index=(this.index-1+t)%t},next(){if(this.isLast&&!this.infinite)return;const t=this.urlList.length;this.index=(this.index+1)%t},handleActions(t,e={}){if(this.loading)return;const{zoomRate:n,rotateDeg:r,enableTransition:i}={zoomRate:.2,rotateDeg:90,enableTransition:!0,...e},{transform:o}=this;switch(t){case"zoomOut":o.scale>.2&&(o.scale=parseFloat((o.scale-n).toFixed(3)));break;case"zoomIn":o.scale=parseFloat((o.scale+n).toFixed(3));break;case"clocelise":o.deg+=r;break;case"anticlocelise":o.deg-=r}o.enableTransition=i}},mounted(){this.deviceSupportInstall(),this.$refs["el-image-viewer__wrapper"].focus()}},h=n("ZrdR"),f=Object(h.a)(u,function(){var t=this,e=t.$createElement,n=t._self._c||e;return n("transition",{attrs:{name:"viewer-fade"}},[n("div",{ref:"el-image-viewer__wrapper",staticClass:"el-image-viewer__wrapper",style:{"z-index":t.zIndex},attrs:{tabindex:"-1"}},[n("div",{staticClass:"el-image-viewer__mask"}),t._v(" "),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__close",on:{click:t.hide}},[n("i",{staticClass:"el-icon-circle-close"})]),t._v(" "),t.isSingle?t._e():[n("span",{staticClass:"el-image-viewer__btn el-image-viewer__prev",class:{"is-disabled":!t.infinite&&t.isFirst},on:{click:t.prev}},[n("i",{staticClass:"el-icon-arrow-left"})]),t._v(" "),n("span",{staticClass:"el-image-viewer__btn el-image-viewer__next",class:{"is-disabled":!t.infinite&&t.isLast},on:{click:t.next}},[n("i",{staticClass:"el-icon-arrow-right"})])],t._v(" "),n("div",{staticClass:"el-image-viewer__btn el-image-viewer__actions"},[n("div",{staticClass:"el-image-viewer__actions__inner"},[n("i",{staticClass:"el-icon-zoom-out",on:{click:function(e){t.handleActions("zoomOut")}}}),t._v(" "),n("i",{staticClass:"el-icon-zoom-in",on:{click:function(e){t.handleActions("zoomIn")}}}),t._v(" "),n("i",{staticClass:"el-image-viewer__actions__divider"}),t._v(" "),n("i",{class:t.mode.icon,on:{click:t.toggleMode}}),t._v(" "),n("i",{staticClass:"el-image-viewer__actions__divider"}),t._v(" "),n("i",{staticClass:"el-icon-refresh-left",on:{click:function(e){t.handleActions("anticlocelise")}}}),t._v(" "),n("i",{staticClass:"el-icon-refresh-right",on:{click:function(e){t.handleActions("clocelise")}}})])]),t._v(" "),n("div",{staticClass:"el-image-viewer__canvas"},t._l(t.urlList,function(e,r){return r===t.index?n("img",{key:e,ref:"img",refInFor:!0,staticClass:"el-image-viewer__img",style:t.imgStyle,attrs:{src:t.currentImg},on:{load:t.handleImgLoad,error:t.handleImgError,mousedown:t.handleMouseDown}}):t._e()}))],2)])},[],!1,null,null,null);f.options.__file="image-viewer.vue";e.a=f.exports},xOJF:function(t,e,n){var r=function(){return this}()||Function("return this")(),i=r.regeneratorRuntime&&Object.getOwnPropertyNames(r).indexOf("regeneratorRuntime")>=0,o=i&&r.regeneratorRuntime;if(r.regeneratorRuntime=void 0,t.exports=n("k4Ii"),i)r.regeneratorRuntime=o;else try{delete r.regeneratorRuntime}catch(t){r.regeneratorRuntime=void 0}}}]);