feat: SMF数据单位转换MB显示
This commit is contained in:
@@ -21,6 +21,7 @@ import PQueue from 'p-queue';
|
||||
import saveAs from 'file-saver';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { useClipboard } from '@vueuse/core';
|
||||
import { parseSizeFromByte } from '@/utils/parse-utils';
|
||||
const { copy } = useClipboard({ legacy: true });
|
||||
const { t } = useI18n();
|
||||
const ws = new WS();
|
||||
@@ -164,7 +165,7 @@ let tableColumns = ref<ColumnsType>([
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataVolumeUplink;
|
||||
return parseSizeFromByte(dataVolumeUplink, 'MB');
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -189,7 +190,7 @@ let tableColumns = ref<ColumnsType>([
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataVolumeDownlink;
|
||||
return parseSizeFromByte(dataVolumeDownlink, 'MB');
|
||||
},
|
||||
},
|
||||
{
|
||||
@@ -214,7 +215,7 @@ let tableColumns = ref<ColumnsType>([
|
||||
}
|
||||
}
|
||||
}
|
||||
return dataTotalVolume;
|
||||
return parseSizeFromByte(dataTotalVolume, 'MB');
|
||||
},
|
||||
},
|
||||
{
|
||||
|
||||
@@ -69,8 +69,8 @@ const option = {
|
||||
} else {
|
||||
downlinkValue = params[1].value;
|
||||
}
|
||||
const uplinkValueF = parseSizeFromByte(uplinkValue);
|
||||
const downlinkValueF = parseSizeFromByte(downlinkValue);
|
||||
const uplinkValueF = parseSizeFromByte(uplinkValue, 'MB');
|
||||
const downlinkValueF = parseSizeFromByte(downlinkValue, 'MB');
|
||||
return `
|
||||
<div style="font-weight: bold;">${title}</div>
|
||||
<div>Downlink: ${downlinkValueF}</div>
|
||||
@@ -466,8 +466,8 @@ function fnRanderChartDataUpdate() {
|
||||
downlinkTotal += dataVolumeDownlinkYSeriesData[index];
|
||||
}
|
||||
state.dataUsage = [
|
||||
parseSizeFromByte(uplinkTotal),
|
||||
parseSizeFromByte(downlinkTotal),
|
||||
parseSizeFromByte(uplinkTotal, 'MB'),
|
||||
parseSizeFromByte(downlinkTotal, 'MB'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user