Files
fast_response/front/public/gl/assets/u-line-progress.18a4cafc.js
Your Name dce091da91 t
2025-03-27 07:52:44 +00:00

2 lines
1.8 KiB
JavaScript
Executable File

import{M as e,N as s,O as t,P as r,Q as i,as as a,T as o,af as n,o as l,c as g,w as d,a as h,x as u,X as c,d as p,E as _,v as y,i as f,H as P}from"./index-fea56fdb.js";import{_ as m}from"./_plugin-vue_export-helper.1b428a4d.js";const x=m({name:"u-line-progress",mixins:[t,r,e({props:{activeColor:{type:String,default:()=>s.lineProgress.activeColor},inactiveColor:{type:String,default:()=>s.lineProgress.color},percentage:{type:[String,Number],default:()=>s.lineProgress.inactiveColor},showText:{type:Boolean,default:()=>s.lineProgress.showText},height:{type:[String,Number],default:()=>s.lineProgress.height}}})],data:()=>({lineWidth:0}),watch:{percentage(e){this.resizeProgressWidth()}},computed:{progressStyle(){let e={};return e.width=this.lineWidth,e.backgroundColor=this.activeColor,e.height=i(this.height),e},innserPercentage(){return a(0,100,this.percentage)}},mounted(){this.init()},methods:{addStyle:o,addUnit:i,init(){n(20).then((()=>{this.resizeProgressWidth()}))},getProgressWidth(){return this.$uGetRect(".u-line-progress__background")},resizeProgressWidth(){this.getProgressWidth().then((e=>{const{width:s}=e;this.lineWidth=s*this.innserPercentage/100+"px"}))}}},[["render",function(e,s,t,r,i,a){const o=f,n=P;return l(),g(o,{class:"u-line-progress",style:u([a.addStyle(e.customStyle)])},{default:d((()=>[h(o,{class:"u-line-progress__background",ref:"u-line-progress__background",style:u([{backgroundColor:e.inactiveColor,height:a.addUnit(e.height)}])},null,8,["style"]),h(o,{class:"u-line-progress__line",style:u([a.progressStyle])},{default:d((()=>[c(e.$slots,"default",{},(()=>[e.showText&&e.percentage>=10?(l(),g(n,{key:0,class:"u-line-progress__text"},{default:d((()=>[p(_(a.innserPercentage+"%"),1)])),_:1})):y("",!0)]),!0)])),_:3},8,["style"])])),_:3},8,["style"])}],["__scopeId","data-v-4a20372c"]]);export{x as _};