mirror of
https://gitee.com/lab1024/smart-admin.git
synced 2025-10-03 02:36:39 +08:00
1 line
2.4 KiB
JavaScript
1 line
2.4 KiB
JavaScript
(window["RCDLjsonFunction"]=window["RCDLjsonFunction"]||[]).push([[78],{237:function(e,t,r){"use strict";r.r(t);var a=r(21);var n=r.n(a);var o=r(20);var u=r.n(o);var i=r(32);var c=r.n(i);var l=r(22);var s=r.n(l);var f=r(262);var v=r.n(f);var d=r(99);var p=r(375);var h=r.n(p);var m=r(615);var y=r.n(m);function asyncGeneratorStep(e,t,r,a,n,o,u){try{var i=e[o](u);var c=i.value}catch(e){r(e);return}if(i.done){t(c)}else{Promise.resolve(c).then(a,n)}}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function _next(e){asyncGeneratorStep(o,a,n,_next,_throw,"next",e)}function _throw(e){asyncGeneratorStep(o,a,n,_next,_throw,"throw",e)}_next(undefined)}))}}RCDL.features.loader=function(e,t){Object(d["DOMcheckElements"])({elements:t,selectors:e,name:"loader"}).forEach((function(e){return RCDL.features.loader.prototype.create(e)}))};RCDL.features.loader.prototype.defaultSelector=null;RCDL.features.loader.prototype.create=function(e){var t=e.getElementsByClassName("rc-loader__canvas")[0];if(t){var r=null;var a=new MutationObserver((function(){o(48.5,48.5)}));a.observe(t,{attributeFilter:["data-js-value"],attributes:true,childList:false,subtree:false});var n=t.getContext("2d");var o=function createCircle(e,a){r=t.getAttribute("data-js-percentage")||t.getAttribute("data-js-value");var o=45;var u=r;var i=Math.PI*2;var c=Math.PI/2;var l=0;n.strokeStyle="#E2001A";n.lineWidth=4;n.lineCap="square";var s=c;var f=function animate(t){n.lineWidth=4;n.clearRect(e-o-n.lineWidth,a-o-n.lineWidth,o*2+n.lineWidth*2,o*2+n.lineWidth*2);n.beginPath();n.arc(e,a,o,s,i*t+s,false);n.stroke();n.closePath();l++;if(l<u){requestAnimationFrame((function(){animate(l/100)}))}};f()};o(48.5,48.5)}};RCDL.features.loader.prototype.start=function(e){var t=e.element,r=e.selectors,a=r===void 0?RCDL.features.loader.prototype.defaultSelector:r;Object(d["DOMcheckElements"])({elements:t,selectors:a,name:"loader"}).forEach((function(e){return RCDL.features.loader.prototype.create(e)}))};t["default"]={fn:function(){var e=_asyncToGenerator(regeneratorRuntime.mark((function _callee(e){return regeneratorRuntime.wrap((function _callee$(t){while(1){switch(t.prev=t.next){case 0:return t.abrupt("return",RCDL.features.loader.prototype.start({element:e}));case 1:case"end":return t.stop()}}}),_callee)})));function fn(t){return e.apply(this,arguments)}return fn}(),setup:function setup(e){RCDL.features.loader.prototype.defaultSelector=e}}}}]); |