1 |
- webpackJsonp([35],{"1Nfu":function(e,t){},Szih:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n("//Fk"),r=n.n(i),o=(n("OLZS"),n("4j1Q")),a=(n("3AsM"),n("7ZPY")),s=(n("zP7x"),n("rD0v")),u=(n("XmAh"),n("il3B")),l=(n("nsZj"),n("cTzj")),c=n.n(l).a;n("NYxO");n("7+uW").a.use(o.a).use(a.a).use(s.a).use(u.a).use(c);var d={name:"management",components:{},props:{manNUm:{type:Number,default:0}},data:function(){return{notice_list:[],menu:[],images:[],isShowImg:!1,defaultImg:"url(static/images/qyc.jpg)",total:0,site_info:{},menuJxList:[],app_list:window.plus?JSON.parse(plus.storage.getItem("menu")):JSON.parse(localStorage.getItem("menu")),userInfo:{}}},created:function(){var e=this;this.getKqList(),this.get_notice_list(),this.getSiteInfo(function(t){t.performance&&1==t.performance.global_status&&1==t.performance.status&&t.performance.expire_day>0&&e.setJxMoun()})},activated:function(){this.setMenu(),this.site_info.performance&&1==this.site_info.performance.global_status&&1==this.site_info.performance.status&&this.site_info.performance.expire_day>0&&this.setJxMoun()},methods:{openText:function(){this.$toast("APP端暂不支持添加公告,请前往PC端添加")},setMenu:function(){this.app_list=window.plus?JSON.parse(plus.storage.getItem("menu")):JSON.parse(localStorage.getItem("menu"))},setJxMoun:function(){var e=this;this.$store.dispatch("getUserInfo").then(function(t){e.userInfo=t,e.setRouters()})},setRouters:function(){var e=this.userInfo.main;"manager"==this.userInfo.per_role?1==e?this.setRole("masterAdministrator"):this.setRole("childAdministrator"):this.$userInfo().is_creator?this.setRole("creator"):this.$userInfo().employee_detail.manage_dept_ids.length>0?this.setRole("deptManager"):this.setRole("employee")},setRole:function(e){var t=this;this.plusStoSet("role",e,function(){var e=[{isJx:!0,icon:"static/images/gzt.png",index:0,code:t.$getRole(3)||t.$getRole(4)?"我的":"工作台"}];(t.$userInfo().employee_detail.manage_dept_ids.length>0||t.$getRole(1)&&t.$getPermis(16))&&e.push({isJx:!0,icon:"static/images/jx.png",index:1,code:"报表统计"}),(t.$getRole(1)||t.$getRole(2))&&e.push({isJx:!0,icon:"static/images/wd.png",index:2,code:"我的"}),t.menuJxList=e;var n={remark:"绩效管理(新)",child:e},i=window.plus?JSON.parse(plus.storage.getItem("menu")):JSON.parse(localStorage.getItem("menu"));i.splice(3,0,n),t.$isApp||(i=i.filter(function(e){return"attendance_manage"!=e.code_id})),t.app_list=i})},plusStoSet:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};window.plus?plus.storage.setItem(e,t):localStorage.setItem(e,t),n()},getKqList:function(){var e=this;this.$axiosKq("post","/ad/review",{page:1,type:-1,status:"waiting",page_size:10,keyword:"",is_reviewer:1}).then(function(t){e.total=t.data.data.total})},getSiteInfo:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:function(){};this.$axiosUser("get","/api/pro/site/info").then(function(n){e.site_info=n.data.data,t(n.data.data)})},openTs:function(){this.$supremeAuthority("employee")||Object(u.a)({message:"可在功道云系统后台企业信息中设置文化墙"})},openJx:function(e){this.$router.push({name:"navigation",query:{index:e.index}})},url_jump:function(e){if(e.isJx)return this.openJx(e),!1;var t=e.url;if(t)if(t.indexOf("#")>=0){var n=n.substring(n.indexOf("#")+1);this.$router.push({path:n})}else this.$router.push({path:t})},get_notice_list:function(){var e=this;this.$toast.loading({message:"加载中...",loadingType:"spinner"});var t=this.$axiosUser("get","/api/pro/information/list/page"),n=this.$axiosUser("get","/api/pro/integral/site/config");r.a.all([t,n]).then(function(t){e.isShowImg=!0,1==t[0].data.code&&(e.notice_list=t[0].data.data.list),1==t[1].data.code&&(e.images=t[1].data.data.bg)}).finally(function(){e.$toast.clear()})}}},h={render:function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticStyle:{height:"100%"}},[n("van-nav-bar",{attrs:{title:"管理中心","left-text":"返回","left-arrow":""},on:{"click-left":function(t){return e.$route_back()}}}),e._v(" "),n("scroller",{ref:"work_box_scroller",staticClass:"all",staticStyle:{position:"relative"}},[n("footer",{staticClass:"footer"},[n("div",{staticClass:"app_list_box"},e._l(e.app_list,function(t,i){return n("div",{key:i,staticClass:"app_list_box"},["绩效管理"==t.remark?n("div",{staticClass:"menu_title"},[e._v("绩效管理(旧),该绩效功能将于9月份下架")]):n("div",{staticClass:"menu_title"},[e._v(e._s(t.remark))]),e._v(" "),n("van-grid",{attrs:{border:!1}},e._l(t.child,function(t,i){return n("van-grid-item",{key:i,attrs:{icon:t.icon,text:t.code},on:{click:function(n){return e.url_jump(t)}}},[n("template",{slot:"icon"},[n("img",{attrs:{src:t.icon}}),e._v(" "),e.total>0&&"att_review"==t.code_id?n("span",{staticClass:"num9",class:{num10:e.total>9},attrs:{color:"#F56C6C"}},[e._v(e._s(e.total))]):e._e()])],2)}),1)],1)}),0)]),e._v(" "),n("div",{staticStyle:{height:"1rem"}})])],1)},staticRenderFns:[]};var f=n("VU/8")(d,h,!1,function(e){n("1Nfu")},"data-v-4e70fbb2",null);t.default=f.exports},cTzj:function(e,t,n){var i;i=function(){"use strict";function e(e){e=e||{};var i=arguments.length,r=0;if(1===i)return e;for(;++r<i;){var o=arguments[r];d(e)&&(e=o),n(o)&&t(e,o)}return e}function t(t,r){for(var o in h(t,r),r)if("__proto__"!==o&&i(r,o)){var a=r[o];n(a)?("undefined"===p(t[o])&&"function"===p(a)&&(t[o]=a),t[o]=e(t[o]||{},a)):t[o]=a}return t}function n(e){return"object"===p(e)||"function"===p(e)}function i(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function r(e,t){if(e.length){var n=e.indexOf(t);return n>-1?e.splice(n,1):void 0}}function o(e,t){if("IMG"===e.tagName&&e.getAttribute("data-srcset")){var n=e.getAttribute("data-srcset"),i=[],r=e.parentNode.offsetWidth*t,o=void 0,a=void 0,s=void 0;(n=n.trim().split(",")).map(function(e){e=e.trim(),-1===(o=e.lastIndexOf(" "))?(a=e,s=999998):(a=e.substr(0,o),s=parseInt(e.substr(o+1,e.length-o-2),10)),i.push([s,a])}),i.sort(function(e,t){if(e[0]<t[0])return-1;if(e[0]>t[0])return 1;if(e[0]===t[0]){if(-1!==t[1].indexOf(".webp",t[1].length-5))return 1;if(-1!==e[1].indexOf(".webp",e[1].length-5))return-1}return 0});for(var u="",l=void 0,c=i.length,d=0;d<c;d++)if((l=i[d])[0]>=r){u=l[1];break}return u}}function a(e,t){for(var n=void 0,i=0,r=e.length;i<r;i++)if(t(e[i])){n=e[i];break}return n}function s(){}var u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},l=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},c=function(){function e(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,i.key,i)}}return function(t,n,i){return n&&e(t.prototype,n),i&&e(t,i),t}}(),d=function(e){return null==e||"function"!=typeof e&&"object"!==(void 0===e?"undefined":u(e))},h=function(e,t){if(null===e||void 0===e)throw new TypeError("expected first argument to be an object.");if(void 0===t||"undefined"==typeof Symbol)return e;if("function"!=typeof Object.getOwnPropertySymbols)return e;for(var n=Object.prototype.propertyIsEnumerable,i=Object(e),r=arguments.length,o=0;++o<r;)for(var a=Object(arguments[o]),s=Object.getOwnPropertySymbols(a),u=0;u<s.length;u++){var l=s[u];n.call(a,l)&&(i[l]=a[l])}return i},f=Object.prototype.toString,p=function(e){var t=void 0===e?"undefined":u(e);return"undefined"===t?"undefined":null===e?"null":!0===e||!1===e||e instanceof Boolean?"boolean":"string"===t||e instanceof String?"string":"number"===t||e instanceof Number?"number":"function"===t||e instanceof Function?void 0!==e.constructor.name&&"Generator"===e.constructor.name.slice(0,9)?"generatorfunction":"function":void 0!==Array.isArray&&Array.isArray(e)?"array":e instanceof RegExp?"regexp":e instanceof Date?"date":"[object RegExp]"===(t=f.call(e))?"regexp":"[object Date]"===t?"date":"[object Arguments]"===t?"arguments":"[object Error]"===t?"error":"[object Promise]"===t?"promise":function(e){return e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}(e)?"buffer":"[object Set]"===t?"set":"[object WeakSet]"===t?"weakset":"[object Map]"===t?"map":"[object WeakMap]"===t?"weakmap":"[object Symbol]"===t?"symbol":"[object Map Iterator]"===t?"mapiterator":"[object Set Iterator]"===t?"setiterator":"[object String Iterator]"===t?"stringiterator":"[object Array Iterator]"===t?"arrayiterator":"[object Int8Array]"===t?"int8array":"[object Uint8Array]"===t?"uint8array":"[object Uint8ClampedArray]"===t?"uint8clampedarray":"[object Int16Array]"===t?"int16array":"[object Uint16Array]"===t?"uint16array":"[object Int32Array]"===t?"int32array":"[object Uint32Array]"===t?"uint32array":"[object Float32Array]"===t?"float32array":"[object Float64Array]"===t?"float64array":"object"},v=e,g="undefined"!=typeof window,m=g&&"IntersectionObserver"in window,b={event:"event",observer:"observer"},y=function(){function e(e,t){t=t||{bubbles:!1,cancelable:!1,detail:void 0};var n=document.createEvent("CustomEvent");return n.initCustomEvent(e,t.bubbles,t.cancelable,t.detail),n}if(g)return"function"==typeof window.CustomEvent?window.CustomEvent:(e.prototype=window.Event.prototype,e)}(),_=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return g&&window.devicePixelRatio||e},w=function(){if(g){var e=!1;try{var t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener("test",null,t)}catch(e){}return e}}(),L={on:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];w?e.addEventListener(t,n,{capture:i,passive:!0}):e.addEventListener(t,n,i)},off:function(e,t,n){var i=arguments.length>3&&void 0!==arguments[3]&&arguments[3];e.removeEventListener(t,n,i)}},k=function(e,t,n){var i=new Image;i.src=e.src,i.onload=function(){t({naturalHeight:i.naturalHeight,naturalWidth:i.naturalWidth,src:i.src})},i.onerror=function(e){n(e)}},x=function(e,t){return"undefined"!=typeof getComputedStyle?getComputedStyle(e,null).getPropertyValue(t):e.style[t]},A=function(e){return x(e,"overflow")+x(e,"overflow-y")+x(e,"overflow-x")},j={},E=function(){function e(t){var n=t.el,i=t.src,r=t.error,o=t.loading,a=t.bindType,s=t.$parent,u=t.options,c=t.elRenderer;l(this,e),this.el=n,this.src=i,this.error=r,this.loading=o,this.bindType=a,this.attempt=0,this.naturalHeight=0,this.naturalWidth=0,this.options=u,this.rect=null,this.$parent=s,this.elRenderer=c,this.performanceData={init:Date.now(),loadStart:0,loadEnd:0},this.filter(),this.initState(),this.render("loading",!1)}return c(e,[{key:"initState",value:function(){this.el.dataset.src=this.src,this.state={error:!1,loaded:!1,rendered:!1}}},{key:"record",value:function(e){this.performanceData[e]=Date.now()}},{key:"update",value:function(e){var t=e.src,n=e.loading,i=e.error,r=this.src;this.src=t,this.loading=n,this.error=i,this.filter(),r!==this.src&&(this.attempt=0,this.initState())}},{key:"getRect",value:function(){this.rect=this.el.getBoundingClientRect()}},{key:"checkInView",value:function(){return this.getRect(),this.rect.top<window.innerHeight*this.options.preLoad&&this.rect.bottom>this.options.preLoadTop&&this.rect.left<window.innerWidth*this.options.preLoad&&this.rect.right>0}},{key:"filter",value:function(){var e=this;(function(e){if(!(e instanceof Object))return[];if(Object.keys)return Object.keys(e);var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t})(this.options.filter).map(function(t){e.options.filter[t](e,e.options)})}},{key:"renderLoading",value:function(e){var t=this;k({src:this.loading},function(n){t.render("loading",!1),e()},function(){e(),t.options.silent||console.warn("VueLazyload log: load failed with loading image("+t.loading+")")})}},{key:"load",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:s;return this.attempt>this.options.attempt-1&&this.state.error?(this.options.silent||console.log("VueLazyload log: "+this.src+" tried too more than "+this.options.attempt+" times"),void t()):this.state.loaded||j[this.src]?(this.state.loaded=!0,t(),this.render("loaded",!0)):void this.renderLoading(function(){e.attempt++,e.record("loadStart"),k({src:e.src},function(n){e.naturalHeight=n.naturalHeight,e.naturalWidth=n.naturalWidth,e.state.loaded=!0,e.state.error=!1,e.record("loadEnd"),e.render("loaded",!1),j[e.src]=1,t()},function(t){!e.options.silent&&console.error(t),e.state.error=!0,e.state.loaded=!1,e.render("error",!1)})})}},{key:"render",value:function(e,t){this.elRenderer(this,e,t)}},{key:"performance",value:function(){var e="loading",t=0;return this.state.loaded&&(e="loaded",t=(this.performanceData.loadEnd-this.performanceData.loadStart)/1e3),this.state.error&&(e="error"),{src:this.src,state:e,time:t}}},{key:"destroy",value:function(){this.el=null,this.src=null,this.error=null,this.loading=null,this.bindType=null,this.attempt=0}}]),e}(),I="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",$=["scroll","wheel","mousewheel","resize","animationend","transitionend","touchmove"],S={rootMargin:"0px",threshold:0},z=function(e){return function(){function t(e){var n=e.preLoad,i=e.error,r=e.throttleWait,o=e.preLoadTop,a=e.dispatchEvent,s=e.loading,u=e.attempt,c=e.silent,d=void 0===c||c,h=e.scale,f=e.listenEvents,p=(e.hasbind,e.filter),v=e.adapter,m=e.observer,y=e.observerOptions;l(this,t),this.version="1.2.3",this.mode=b.event,this.ListenerQueue=[],this.TargetIndex=0,this.TargetQueue=[],this.options={silent:d,dispatchEvent:!!a,throttleWait:r||200,preLoad:n||1.3,preLoadTop:o||0,error:i||I,loading:s||I,attempt:u||3,scale:h||_(h),ListenEvents:f||$,hasbind:!1,supportWebp:function(){if(!g)return!1;var e=!0,t=document;try{var n=t.createElement("object");n.type="image/webp",n.style.visibility="hidden",n.innerHTML="!",t.body.appendChild(n),e=!n.offsetWidth,t.body.removeChild(n)}catch(t){e=!1}return e}(),filter:p||{},adapter:v||{},observer:!!m,observerOptions:y||S},this._initEvent(),this.lazyLoadHandler=function(e,t){var n=null,i=0;return function(){if(!n){var r=this,o=arguments,a=function(){i=Date.now(),n=!1,e.apply(r,o)};Date.now()-i>=t?a():n=setTimeout(a,t)}}}(this._lazyLoadHandler.bind(this),this.options.throttleWait),this.setMode(this.options.observer?b.observer:b.event)}return c(t,[{key:"config",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};v(this.options,e)}},{key:"performance",value:function(){var e=[];return this.ListenerQueue.map(function(t){e.push(t.performance())}),e}},{key:"addLazyBox",value:function(e){this.ListenerQueue.push(e),g&&(this._addListenerTarget(window),this._observer&&this._observer.observe(e.el),e.$el&&e.$el.parentNode&&this._addListenerTarget(e.$el.parentNode))}},{key:"add",value:function(t,n,i){var r=this;if(function(e,t){for(var n=!1,i=0,r=e.length;i<r;i++)if(t(e[i])){n=!0;break}return n}(this.ListenerQueue,function(e){return e.el===t}))return this.update(t,n),e.nextTick(this.lazyLoadHandler);var a=this._valueFormatter(n.value),s=a.src,u=a.loading,l=a.error;e.nextTick(function(){s=o(t,r.options.scale)||s,r._observer&&r._observer.observe(t);var a=Object.keys(n.modifiers)[0],c=void 0;a&&(c=(c=i.context.$refs[a])?c.$el||c:document.getElementById(a)),c||(c=function(e){if(g){if(!(e instanceof HTMLElement))return window;for(var t=e;t&&t!==document.body&&t!==document.documentElement&&t.parentNode;){if(/(scroll|auto)/.test(A(t)))return t;t=t.parentNode}return window}}(t));var d=new E({bindType:n.arg,$parent:c,el:t,loading:u,error:l,src:s,elRenderer:r._elRenderer.bind(r),options:r.options});r.ListenerQueue.push(d),g&&(r._addListenerTarget(window),r._addListenerTarget(c)),r.lazyLoadHandler(),e.nextTick(function(){return r.lazyLoadHandler()})})}},{key:"update",value:function(t,n){var i=this,r=this._valueFormatter(n.value),s=r.src,u=r.loading,l=r.error;s=o(t,this.options.scale)||s;var c=a(this.ListenerQueue,function(e){return e.el===t});c&&c.update({src:s,loading:u,error:l}),this._observer&&(this._observer.unobserve(t),this._observer.observe(t)),this.lazyLoadHandler(),e.nextTick(function(){return i.lazyLoadHandler()})}},{key:"remove",value:function(e){if(e){this._observer&&this._observer.unobserve(e);var t=a(this.ListenerQueue,function(t){return t.el===e});t&&(this._removeListenerTarget(t.$parent),this._removeListenerTarget(window),r(this.ListenerQueue,t)&&t.destroy())}}},{key:"removeComponent",value:function(e){e&&(r(this.ListenerQueue,e),this._observer&&this._observer.unobserve(e.el),e.$parent&&e.$el.parentNode&&this._removeListenerTarget(e.$el.parentNode),this._removeListenerTarget(window))}},{key:"setMode",value:function(e){var t=this;m||e!==b.observer||(e=b.event),this.mode=e,e===b.event?(this._observer&&(this.ListenerQueue.forEach(function(e){t._observer.unobserve(e.el)}),this._observer=null),this.TargetQueue.forEach(function(e){t._initListen(e.el,!0)})):(this.TargetQueue.forEach(function(e){t._initListen(e.el,!1)}),this._initIntersectionObserver())}},{key:"_addListenerTarget",value:function(e){if(e){var t=a(this.TargetQueue,function(t){return t.el===e});return t?t.childrenCount++:(t={el:e,id:++this.TargetIndex,childrenCount:1,listened:!0},this.mode===b.event&&this._initListen(t.el,!0),this.TargetQueue.push(t)),this.TargetIndex}}},{key:"_removeListenerTarget",value:function(e){var t=this;this.TargetQueue.forEach(function(n,i){n.el===e&&(--n.childrenCount||(t._initListen(n.el,!1),t.TargetQueue.splice(i,1),n=null))})}},{key:"_initListen",value:function(e,t){var n=this;this.options.ListenEvents.forEach(function(i){return L[t?"on":"off"](e,i,n.lazyLoadHandler)})}},{key:"_initEvent",value:function(){var e=this;this.Event={listeners:{loading:[],loaded:[],error:[]}},this.$on=function(t,n){e.Event.listeners[t].push(n)},this.$once=function(t,n){var i=e;e.$on(t,function e(){i.$off(t,e),n.apply(i,arguments)})},this.$off=function(t,n){n?r(e.Event.listeners[t],n):e.Event.listeners[t]=[]},this.$emit=function(t,n,i){e.Event.listeners[t].forEach(function(e){return e(n,i)})}}},{key:"_lazyLoadHandler",value:function(){var e=this;this.ListenerQueue.forEach(function(t,n){t.state.loaded||t.checkInView()&&t.load(function(){!t.error&&t.loaded&&e.ListenerQueue.splice(n,1)})})}},{key:"_initIntersectionObserver",value:function(){var e=this;m&&(this._observer=new IntersectionObserver(this._observerHandler.bind(this),this.options.observerOptions),this.ListenerQueue.length&&this.ListenerQueue.forEach(function(t){e._observer.observe(t.el)}))}},{key:"_observerHandler",value:function(e,t){var n=this;e.forEach(function(e){e.isIntersecting&&n.ListenerQueue.forEach(function(t){if(t.el===e.target){if(t.state.loaded)return n._observer.unobserve(t.el);t.load()}})})}},{key:"_elRenderer",value:function(e,t,n){if(e.el){var i=e.el,r=e.bindType,o=void 0;switch(t){case"loading":o=e.loading;break;case"error":o=e.error;break;default:o=e.src}if(r?i.style[r]='url("'+o+'")':i.getAttribute("src")!==o&&i.setAttribute("src",o),i.setAttribute("lazy",t),this.$emit(t,e,n),this.options.adapter[t]&&this.options.adapter[t](e,this.options),this.options.dispatchEvent){var a=new y(t,{detail:e});i.dispatchEvent(a)}}}},{key:"_valueFormatter",value:function(e){var t=e,n=this.options.loading,i=this.options.error;return function(e){return null!==e&&"object"===(void 0===e?"undefined":u(e))}(e)&&(e.src||this.options.silent||console.error("Vue Lazyload warning: miss src with "+e),t=e.src,n=e.loading||this.options.loading,i=e.error||this.options.error),{src:t,loading:n,error:i}}}]),t}()},T=function(){function e(t){var n=t.lazy;l(this,e),this.lazy=n,n.lazyContainerMananger=this,this._queue=[]}return c(e,[{key:"bind",value:function(e,t,n){var i=new R({el:e,binding:t,vnode:n,lazy:this.lazy});this._queue.push(i)}},{key:"update",value:function(e,t,n){var i=a(this._queue,function(t){return t.el===e});i&&i.update({el:e,binding:t,vnode:n})}},{key:"unbind",value:function(e,t,n){var i=a(this._queue,function(t){return t.el===e});i&&(i.clear(),r(this._queue,i))}}]),e}(),O={selector:"img"},R=function(){function e(t){var n=t.el,i=t.binding,r=t.vnode,o=t.lazy;l(this,e),this.el=null,this.vnode=r,this.binding=i,this.options={},this.lazy=o,this._queue=[],this.update({el:n,binding:i})}return c(e,[{key:"update",value:function(e){var t=this,n=e.el,i=e.binding;this.el=n,this.options=v({},O,i.value),this.getImgs().forEach(function(e){t.lazy.add(e,v({},t.binding,{value:{src:e.dataset.src,error:e.dataset.error,loading:e.dataset.loading}}),t.vnode)})}},{key:"getImgs",value:function(){return function(e){for(var t=e.length,n=[],i=0;i<t;i++)n.push(e[i]);return n}(this.el.querySelectorAll(this.options.selector))}},{key:"clear",value:function(){var e=this;this.getImgs().forEach(function(t){return e.lazy.remove(t)}),this.vnode=null,this.binding=null,this.lazy=null}}]),e}();return{install:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=new(z(e))(t),i=new T({lazy:n}),r="2"===e.version.split(".")[0];e.prototype.$Lazyload=n,t.lazyComponent&&e.component("lazy-component",function(e){return{props:{tag:{type:String,default:"div"}},render:function(e){return!1===this.show?e(this.tag):e(this.tag,null,this.$slots.default)},data:function(){return{el:null,state:{loaded:!1},rect:{},show:!1}},mounted:function(){this.el=this.$el,e.addLazyBox(this),e.lazyLoadHandler()},beforeDestroy:function(){e.removeComponent(this)},methods:{getRect:function(){this.rect=this.$el.getBoundingClientRect()},checkInView:function(){return this.getRect(),g&&this.rect.top<window.innerHeight*e.options.preLoad&&this.rect.bottom>0&&this.rect.left<window.innerWidth*e.options.preLoad&&this.rect.right>0},load:function(){this.show=!0,this.state.loaded=!0,this.$emit("show",this)}}}}(n)),r?(e.directive("lazy",{bind:n.add.bind(n),update:n.update.bind(n),componentUpdated:n.lazyLoadHandler.bind(n),unbind:n.remove.bind(n)}),e.directive("lazy-container",{bind:i.bind.bind(i),update:i.update.bind(i),unbind:i.unbind.bind(i)})):(e.directive("lazy",{bind:n.lazyLoadHandler.bind(n),update:function(e,t){v(this.vm.$refs,this.vm.$els),n.add(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:e,oldValue:t},{context:this.vm})},unbind:function(){n.remove(this.el)}}),e.directive("lazy-container",{update:function(e,t){i.update(this.el,{modifiers:this.modifiers||{},arg:this.arg,value:e,oldValue:t},{context:this.vm})},unbind:function(){i.unbind(this.el)}}))}}},e.exports=i()}});
|