This repository was archived by the owner on Jul 30, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +15
-5
lines changed
Expand file tree Collapse file tree 3 files changed +15
-5
lines changed Original file line number Diff line number Diff line change 3232 @on-change =" toggleAll" ></Checkbox >
3333 </div >
3434 <div class =" td" >{{ task.response.fileName }}</div >
35- <div class =" td" >{{ task.response.totalSize?$numeral(task.response.totalSize).format('0.000 ib'):$t('tasks.unknowLeft') }}</div >
35+ <div class =" td" >{{ task.response.totalSize?$numeral(task.response.totalSize).format('0.00 ib'):$t('tasks.unknowLeft') }}</div >
3636 <div class =" td" >{{ calcProgress(task) }}</div >
37- <div class =" td" >{{ $numeral(task.info.speed).format('0.000 ib') }}/S</div >
37+ <div class =" td" >{{ $numeral(task.info.speed).format('0.00 ib') }}/S</div >
3838 <div class =" td" >{{ calcStatus(task) }}</div >
3939 <div class =" td" >
4040 <Icon v-if =" task.info.status === 1"
7575 </p >
7676 <p >
7777 <b >{{ $t('tasks.fileSize') }}:</b >
78- <span >{{ $numeral(task.response.totalSize).format('0.000 ib') }}</span >
78+ <span >{{ $numeral(task.response.totalSize).format('0.00 ib') }}</span >
7979 </p >
8080 <p >
8181 <b >{{ $t('tasks.connections') }}:</b >
8282 <span >{{ task.config.connections }}</span >
8383 </p >
8484 <p >
8585 <b >{{ $t('tasks.downloadSpeed') }}:</b >
86- <span >{{ $numeral(task.info.speed).format('0.000 ib') }}/S</span >
86+ <span >{{ $numeral(task.info.speed).format('0.00 ib') }}/S</span >
8787 </p >
8888 <p >
8989 <b >{{ $t('tasks.status') }}:</b >
Original file line number Diff line number Diff line change @@ -59,7 +59,17 @@ Vue.prototype.$http.interceptors.response.use(
5959 }
6060)
6161
62+ //去除字节大小格式化后的i字符
63+ const format = numeral . prototype . constructor . fn . format
64+ numeral . prototype . constructor . fn . format = function ( fmt ) {
65+ let result = format . call ( this , fmt )
66+ if ( / ^ .* i b $ / . test ( fmt ) ) {
67+ result = result . replace ( 'i' , '' )
68+ }
69+ return result
70+ }
6271Vue . prototype . $numeral = numeral
72+
6373Date . prototype . format = function ( fmt ) {
6474 var o = {
6575 'M+' : this . getMonth ( ) + 1 , // Month
Original file line number Diff line number Diff line change 111111 <Circle :percent =" updateInfo.progress"
112112 :size =" 150" >
113113 <h1 >{{ updateInfo.progress.toFixed(2) }}%</h1 >
114- <p >{{ $numeral(updateInfo.speed).format('0.000 ib') }}/S</p >
114+ <p >{{ $numeral(updateInfo.speed).format('0.00 ib') }}/S</p >
115115 </Circle >
116116 </Spin >
117117
You can’t perform that action at this time.
0 commit comments