diff --git a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor
index 2a7049e4..d4ca070c 100644
--- a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor
+++ b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor
@@ -32,7 +32,7 @@
@GenAppVisitCard(UvTitle, _uva)
- @GenAppVisitCard(UvTitle, _uvta)
+ @GenAppVisitCard(UvtTitle, _uvta)
@GenAppVisitCard(PvTitle, _pva)
@@ -133,7 +133,7 @@
@icon
- @(rate.ToString("P"))%
+ @(rate.ToString("P", ZhCN))
};
diff --git a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor.cs b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor.cs
index f5d6e360..fc174016 100644
--- a/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor.cs
+++ b/src/Web/Masa.Tsc.Web.Admin.Rcl/Pages/Analysis/AppVisitAnalysis.razor.cs
@@ -1,6 +1,7 @@
// Copyright (c) MASA Stack All rights reserved.
// Licensed under the Apache License. See LICENSE.txt in the project root for license information.
+using System.Globalization;
using System.Timers;
using GraphQL.Client.Http;
using GraphQL.Client.Serializer.SystemTextJson;
@@ -20,6 +21,8 @@ public partial class AppVisitAnalysis : TscComponentBase
private const string Top10UvtTitle = UvtTitle + " Top10";
private const string Top10PvTitle = PvTitle + " Top10";
+ private static readonly CultureInfo ZhCN = new("zh-CN");
+
private GraphQLHttpClient _graphClient = null!;
private AppVisit? _uva;
private AppVisit? _uvta;
@@ -137,20 +140,51 @@ private async Task RefreshAppVisitHourAsync()
{
var response = await _graphClient.SendQueryAsync>(GetAppVisitHourQuery());
- var x = response.Data.Items.Select(u => u.AppVisitHour.TimeKey).ToArray();
- var tuv = response.Data.Items.Select(u => u.AppVisitHour.Tuv).ToArray();
- var yuv = response.Data.Items.Select(u => u.AppVisitHour.Yuv).ToArray();
- var suv = response.Data.Items.Select(u => u.AppVisitHour.Suv).ToArray();
- var tuvt = response.Data.Items.Select(u => u.AppVisitHour.Tuvt).ToArray();
- var yuvt = response.Data.Items.Select(u => u.AppVisitHour.Yuvt).ToArray();
- var suvt = response.Data.Items.Select(u => u.AppVisitHour.Suvt).ToArray();
- var tpv = response.Data.Items.Select(u => u.AppVisitHour.Tpv).ToArray();
- var ypv = response.Data.Items.Select(u => u.AppVisitHour.Ypv).ToArray();
- var spv = response.Data.Items.Select(u => u.AppVisitHour.Spv).ToArray();
+ var currentHour = DateTime.UtcNow.Add(CurrentTimeZone.BaseUtcOffset).Hour;
+
+ var x = new List();
+ var tuv = new List();
+ var yuv = new List();
+ var suv = new List();
+ var tuvt = new List();
+ var yuvt = new List();
+ var suvt = new List();
+ var tpv = new List();
+ var ypv = new List();
+ var spv = new List();
+
+ foreach (var item in response.Data.Items)
+ {
+ x.Add(item.AppVisitHour.TimeKey);
+ if (item.AppVisitHour.TimeNum <= currentHour)
+ {
+ tuv.Add(item.AppVisitHour.Tuv);
+ }
+
+ yuv.Add(item.AppVisitHour.Yuv);
+ suv.Add(item.AppVisitHour.Suv);
+
+ if (item.AppVisitHour.TimeNum <= currentHour)
+ {
+ tuvt.Add(item.AppVisitHour.Tuvt);
+ }
+
+ yuvt.Add(item.AppVisitHour.Yuvt);
+ suvt.Add(item.AppVisitHour.Suvt);
+
+ if (item.AppVisitHour.TimeNum <= currentHour)
+ {
+ tpv.Add(item.AppVisitHour.Tpv);
+ }
+
+ ypv.Add(item.AppVisitHour.Ypv);
+ spv.Add(item.AppVisitHour.Spv);
+ }
_uvOption = GetSharedHourOption(UvTitle, x, tuv, yuv, suv);
_uvtOption = GetSharedHourOption(UvtTitle, x, tuvt, yuvt, suvt);
_pvOption = GetSharedHourOption(PvTitle, x, tpv, ypv, spv);
+
StateHasChanged();
}
@@ -178,7 +212,6 @@ private async Task