浏览代码

Merge remote-tracking branch 'origin/master'

xgb 1 周之前
父节点
当前提交
f70bf55b91
共有 1 个文件被更改,包括 1 次插入4 次删除
  1. 1 4
      src/views/course/courseTrafficLog/index.vue

+ 1 - 4
src/views/course/courseTrafficLog/index.vue

@@ -212,10 +212,7 @@ export default {
       this.getList();
       this.getList();
     },
     },
     formatTrafficData(traffic) {
     formatTrafficData(traffic) {
-      if (traffic < 1024) return `${traffic} B`;
-      if (traffic < 1024 ** 2) return `${(traffic / 1024).toFixed(2)} KB`;
-      if (traffic < 1024 ** 3) return `${(traffic / 1024 ** 2).toFixed(2)} MB`;
-      return `${(traffic / 1024 ** 3).toFixed(2)} GB`;
+      return `${(traffic / (1024 ** 3)).toFixed(4)} GB`;
     },
     },
     handleSelectionChange(selection) {
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.logId);
       this.ids = selection.map(item => item.logId);