import{ax as t,o as s,k as a,i,w as e,j as h,t as r,aA as o,z as d}from"./index-WeUkftbp.js";/* empty css                                                                 */import{_ as n}from"./_plugin-vue_export-helper.BCo6x5W8.js";const l=n({data:()=>({width:300,height:130,radius:114,strokeWidth:15,progress:0,gradientStartColor:"#C1DDFD",gradientEndColor:"#308BF8",init:0}),props:{normal:{type:Number,default:0},abnormal:{type:Number,default:0},total:{type:Number,default:0}},created(){this.initData(),this.$watch("normal",this.handleNormalChange),this.$watch("total",this.handleTotalChange)},methods:{handleNormalChange(t,s){t!==s&&(this.init=0,this.initData())},handleTotalChange(t,s){t!==s&&(this.init=0,this.initData())},initData(){this.normal>0&&this.total>0?this.progress=(this.normal/this.total).toFixed(2):this.progress=0,this.draw()},draw(){this.init+=.01,this.init<=this.progress?(this.drawProgress(),setTimeout((()=>{this.draw()}),5)):this.drawProgress()},drawProgress(){const s=t("canvas");s.clearRect(0,0,this.width,this.height),s.beginPath();const a=Math.PI,i=2*Math.PI;s.arc(this.width/2,this.height,this.radius,a,i),s.lineWidth=this.strokeWidth,s.strokeStyle="#E5E9F2",s.stroke(),s.beginPath();const e=a+this.init*Math.PI;s.arc(this.width/2,this.height,this.radius,a,e);const h=s.createLinearGradient(this.width/2-this.radius,this.height,this.width/2+this.radius,this.height);h.addColorStop(0,this.gradientStartColor),h.addColorStop(1,this.gradientEndColor),s.strokeStyle=h,s.stroke(),s.draw()}},watch:{progress(){this.drawProgress()}}},[["render",function(t,n,l,c,g,u){const p=o,m=d;return s(),a("div",{class:"progress"},[i(p,{"canvas-id":"canvas",width:g.width,height:g.height},null,8,["width","height"]),i(m,{class:"data"},{default:e((()=>[i(m,{class:"item mb"},{default:e((()=>[i(m,{class:"point blue"}),i(m,{class:"text"},{default:e((()=>[h("正常人数")])),_:1}),i(m,{class:"num suc"},{default:e((()=>[h(r(l.normal),1)])),_:1})])),_:1}),i(m,{class:"item"},{default:e((()=>[i(m,{class:"point red"}),i(m,{class:"text"},{default:e((()=>[h("异常人数")])),_:1}),i(m,{class:"num err"},{default:e((()=>[h(r(l.abnormal),1)])),_:1})])),_:1})])),_:1})])}],["__scopeId","data-v-5d16a62e"]]);export{l as p};
