1 |
- "use strict";var _typeof="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};!function(e,o,r){"object"===("undefined"==typeof exports?"undefined":_typeof(exports))&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):e.circleProcessBar=r()}(window,jQuery,function(){var e={width:100,strokeWidth:6,strokeColor:"#52c41a",bgColor:"#f8f8f8",percent:0,fontColor:"#999",fontSize:"14px",format:function(e){return 100*e+"%"},footer:function(e){return""}};return function(o){if("object"===(void 0===(o=$.extend({},e,o))?"undefined":_typeof(o))||void 0===o){var r=(v=o,(b=$("<div class='circle-progress-body'></div>")).css({width:v.width+"px",height:v.width+"px"}),b),t=(l=o,a=$('<svg class="circle-progress-inner"></svg>'),u=$('<circle class="circle-progress-inner-path"></circle>'),h=(l.width-l.strokeWidth)/2,y=Math.PI*h*2,u.attr({cx:l.width/2,cy:l.width/2,r:h}).css({stroke:l.strokeColor,"stroke-width":l.strokeWidth+"px","stroke-dasharray":y,"stroke-dashoffset":y*(1-l.percent)}),a.append(u)),i=(f=o,(p=$('<div class="circle-progress-outer"></div>')).css({"border-width":f.strokeWidth,"border-color":f.bgColor}),p),s=(n=(c=o).format(c.percent),(d=$('<div class="circle-progress-info">'+n+"</div>")).css({"line-height":c.width+"px","font-size":c.fontSize,color:c.fontColor}),d);return r.append(t).append(i).append(s),'<div class="circle-progress">'+$('<div class="circle-progress"></div>').append(r).html()+'<div class="circle-progress-footer">'+o.footer()+"</div></div>"}return console.error("circleProcessBar参数不合法"),"";var c,n,d,f,p,l,a,u,h,y,v,b}});
|