diff --git a/front/src/components/Table/index.vue b/front/src/components/Table/index.vue index 523d07a8..6d3da86a 100644 --- a/front/src/components/Table/index.vue +++ b/front/src/components/Table/index.vue @@ -32,9 +32,9 @@ @on-change="toggleAll">
{{ task.response.fileName }}
-
{{ task.response.totalSize?$numeral(task.response.totalSize).format('0.000 ib'):$t('tasks.unknowLeft') }}
+
{{ task.response.totalSize?$numeral(task.response.totalSize).format('0.00 ib'):$t('tasks.unknowLeft') }}
{{ calcProgress(task) }}
-
{{ $numeral(task.info.speed).format('0.000 ib') }}/S
+
{{ $numeral(task.info.speed).format('0.00 ib') }}/S
{{ calcStatus(task) }}

{{ $t('tasks.fileSize') }}: - {{ $numeral(task.response.totalSize).format('0.000 ib') }} + {{ $numeral(task.response.totalSize).format('0.00 ib') }}

{{ $t('tasks.connections') }}: @@ -83,7 +83,7 @@

{{ $t('tasks.downloadSpeed') }}: - {{ $numeral(task.info.speed).format('0.000 ib') }}/S + {{ $numeral(task.info.speed).format('0.00 ib') }}/S

{{ $t('tasks.status') }}: diff --git a/front/src/main.js b/front/src/main.js index a3f64f4c..95a1e203 100755 --- a/front/src/main.js +++ b/front/src/main.js @@ -59,7 +59,17 @@ Vue.prototype.$http.interceptors.response.use( } ) +//去除字节大小格式化后的i字符 +const format = numeral.prototype.constructor.fn.format +numeral.prototype.constructor.fn.format = function(fmt) { + let result = format.call(this, fmt) + if (/^.*ib$/.test(fmt)) { + result = result.replace('i', '') + } + return result +} Vue.prototype.$numeral = numeral + Date.prototype.format = function(fmt) { var o = { 'M+': this.getMonth() + 1, // Month diff --git a/front/src/views/About.vue b/front/src/views/About.vue index 03e1b052..9d0244d0 100644 --- a/front/src/views/About.vue +++ b/front/src/views/About.vue @@ -111,7 +111,7 @@

{{ updateInfo.progress.toFixed(2) }}%

-

{{ $numeral(updateInfo.speed).format('0.000 ib') }}/S

+

{{ $numeral(updateInfo.speed).format('0.00 ib') }}/S