import{M as x,j as A,a3 as D,m as T,am as h,o as b,a as E,_ as d,U as V,F as k,ad as I,b as u,Y as M,n as O,T as P,Q as F,Z as S,P as R,aF as q,aG as j}from"./vue.aade88c7.js";import{_ as B}from"./index.f6b6c69f.js";var w=function(){return w=Object.assign||function(n){for(var e,i=1,s=arguments.length;it.endVal;t.frameVal=a?t.endVal:t.frameVal,t.frameVal=Number(t.frameVal.toFixed(t.options.decimalPlaces)),t.printValue(t.frameVal),r1?t.options.decimal+m[1]:"",t.options.useGrouping){p="";for(var _=3,f=0,l=0,g=a.length;lwindow.scrollY&&e.paused?(e.paused=!1,setTimeout(function(){return e.start()},e.options.scrollSpyDelay),e.options.scrollSpyOnce&&(e.once=!0)):(window.scrollY>o||t>i)&&!e.paused&&e.reset()}},n.prototype.determineDirectionAndSmartEasing=function(){var e=this.finalEndVal?this.finalEndVal:this.endVal;this.countDown=this.startVal>e;var i=e-this.startVal;if(Math.abs(i)>this.options.smartEasingThreshold&&this.options.useEasing){this.finalEndVal=e;var s=this.countDown?1:-1;this.endVal=e+s*this.options.smartEasingAmount,this.duration=this.duration/2}else this.endVal=e,this.finalEndVal=null;this.finalEndVal!==null?this.useEasing=!1:this.useEasing=this.options.useEasing},n.prototype.start=function(e){this.error||(e&&(this.options.onCompleteCallback=e),this.duration>0?(this.determineDirectionAndSmartEasing(),this.paused=!1,this.rAF=requestAnimationFrame(this.count)):this.printValue(this.endVal))},n.prototype.pauseResume=function(){this.paused?(this.startTime=null,this.duration=this.remaining,this.startVal=this.frameVal,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count)):cancelAnimationFrame(this.rAF),this.paused=!this.paused},n.prototype.reset=function(){cancelAnimationFrame(this.rAF),this.paused=!0,this.resetDuration(),this.startVal=this.validateValue(this.options.startVal),this.frameVal=this.startVal,this.printValue(this.startVal)},n.prototype.update=function(e){cancelAnimationFrame(this.rAF),this.startTime=null,this.endVal=this.validateValue(e),this.endVal!==this.frameVal&&(this.startVal=this.frameVal,this.finalEndVal==null&&this.resetDuration(),this.finalEndVal=null,this.determineDirectionAndSmartEasing(),this.rAF=requestAnimationFrame(this.count))},n.prototype.printValue=function(e){var i;if(this.el){var s=this.formattingFn(e);!((i=this.options.plugin)===null||i===void 0)&&i.render?this.options.plugin.render(this.el,s):this.el.tagName==="INPUT"?this.el.value=s:this.el.tagName==="text"||this.el.tagName==="tspan"?this.el.textContent=s:this.el.innerHTML=s}},n.prototype.ensureNumber=function(e){return typeof e=="number"&&!isNaN(e)},n.prototype.validateValue=function(e){var i=Number(e);return this.ensureNumber(i)?i:(this.error="[CountUp] invalid start or end value: ".concat(e),null)},n.prototype.resetDuration=function(){this.startTime=null,this.duration=1e3*Number(this.options.duration),this.remaining=this.duration},n}();const N=n=>(q("data-v-6fdeb3d1"),n=n(),j(),n),U={class:"layout-pd"},Y={class:"countup-card-item-title pb3"},G=N(()=>u("div",{class:"countup-card-item-title-num pb6"},null,-1)),L={class:"countup-card-item-tip pb3"},z=N(()=>u("div",{class:"countup-card-item-tip-num"},null,-1)),H={class:"flex-warp"},Q={class:"flex-warp-item"},Z={class:"flex-warp-item-box"},$=x({name:"funCountup"}),J=x({...$,setup(n){const e=A([]),i=D({topCardItemList:[{title:"今日访问人数",titleNum:"123",tip:"在场人数",tipNum:"911",color:"--el-color-primary",iconColor:"#ffcb47",icon:"iconfont icon-jinridaiban"},{title:"实验室总数",titleNum:"123",tip:"使用中",tipNum:"611",color:"--el-color-success",iconColor:"#70cf41",icon:"iconfont icon-AIshiyanshi"},{title:"申请人数(月)",titleNum:"123",tip:"通过人数",tipNum:"911",color:"--el-color-warning",iconColor:"#dfae64",icon:"iconfont icon-shenqingkaiban"},{title:"销售情况",titleNum:"123",tip:"销售数",tipNum:"911",color:"--el-color-danger",iconColor:"#e56565",icon:"iconfont icon-ditu"}]}),s=()=>{O(()=>{e.value.forEach(o=>{new C(o.querySelector(".countup-card-item-title-num"),Math.random()*1e4).start(),new C(o.querySelector(".countup-card-item-tip-num"),Math.random()*1e3).start()})})},t=()=>{s()};return T(()=>{s()}),(o,r)=>{const a=h("el-alert"),c=h("el-col"),p=h("el-row"),v=h("ele-RefreshRight"),m=h("el-icon"),_=h("el-button"),f=h("el-card");return b(),E("div",U,[d(f,{shadow:"hover",header:"数字滚动演示"},{default:V(()=>[d(a,{title:"感谢优秀的 `countup.js`,项目地址:https://github.com/inorganik/countUp.js",type:"success",closable:!1,class:"mb15"}),d(p,{gutter:20},{default:V(()=>[(b(!0),E(k,null,I(i.topCardItemList,(l,g)=>(b(),P(c,{sm:6,class:"mb15",key:g},{default:V(()=>[u("div",{class:"countup-card-item countup-card-item-box",style:F({background:`var(${l.color})`})},[u("div",{class:"countup-card-item-flex",ref_for:!0,ref_key:"topCardItemRefs",ref:e},[u("div",Y,S(l.title),1),G,u("div",L,S(l.tip),1),z],512),u("i",{class:R(l.icon),style:F({color:l.iconColor})},null,6)],4)]),_:2},1024))),128))]),_:1}),u("div",H,[u("div",Q,[u("div",Z,[d(_,{type:"primary",size:"default",onClick:t},{default:V(()=>[d(m,null,{default:V(()=>[d(v)]),_:1}),M(" 重置/刷新数值 ")]),_:1})])])])]),_:1})])}}});const X=B(J,[["__scopeId","data-v-6fdeb3d1"]]);export{X as default}; //# sourceMappingURL=index.2e39870a.js.map