diff --git a/nezha-fronted/src/components/page/dashboard/overview/overview2.scss b/nezha-fronted/src/components/page/dashboard/overview/overview2.scss index 6fa129111..ef0e0a70b 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/overview2.scss +++ b/nezha-fronted/src/components/page/dashboard/overview/overview2.scss @@ -595,4 +595,7 @@ } } } +.over-num{ + margin-left: -11px; +} diff --git a/nezha-fronted/src/components/page/dashboard/overview/overview2.vue b/nezha-fronted/src/components/page/dashboard/overview/overview2.vue index c3c1b1583..d1350a677 100644 --- a/nezha-fronted/src/components/page/dashboard/overview/overview2.vue +++ b/nezha-fronted/src/components/page/dashboard/overview/overview2.vue @@ -27,7 +27,9 @@
- + + + {{(assetData ? assetData.totalStat.total : '') | unitFormat}}
{{$t("dashboard.overview.asset.title")}}
@@ -39,7 +41,8 @@
- + + + {{(projectData ? projectData.projectStat.length : '') | unitFormat}}
{{$t("dashboard.overview.project.project")}}
@@ -51,7 +54,8 @@
- + + + {{(moduleData ? moduleData.moduleStat.length : '') | unitFormat}}
{{$t("dashboard.overview.module.module")}}
@@ -63,7 +67,8 @@
- + + + {{(endpointData ? endpointData.total : '') | unitFormat}}
{{$t("dashboard.overview.endpoint.endpoint")}}
@@ -75,7 +80,8 @@
- + + + {{(alertMessageData ? alertMessageData.alertMessageTotal : '') | unitFormat}}
{{$t("overall.alert")}}
@@ -305,9 +311,25 @@ if (num < 1000) { return num; } else if (num < 1000000) { - return (num/1000).toFixed(fixed); + num=num/1000; + num = num.toString(); + let index = num.indexOf('.'); + if (index !== -1) { + num = num.substring(0, fixed + index + 1); + } else { + num = num.substring(0); + } + return parseFloat(num).toFixed(fixed) } else if (num < 1000000000) { - return (num/1000000).toFixed(fixed); + num=num/1000000; + num = num.toString(); + let index = num.indexOf('.'); + if (index !== -1) { + num = num.substring(0, fixed + index + 1); + } else { + num = num.substring(0); + } + return parseFloat(num).toFixed(fixed) } } catch (err) { return 0;