首页图标测试

This commit is contained in:
zhougf committed 2024-12-19 15:35:52 +08:00
1 parent ad932a7050
commit 2bfda34103
2 files changed
+132

No files matched your search

+22
View File
@@ -4,6 +4,7 @@ using System.Linq;
using System.Reflection;
using System.Text;
using System.Web;
using HHWMS.Web.Models;
using HHWMS.Web.Support;
using HHWMS.Web.ViewModels.HomeVMs;
using Microsoft.AspNetCore.Authentication;
@@ -126,6 +127,27 @@ namespace HHWMS.Web.Controllers
var rv = data.ToChartData();
return Json(rv);
}
[AllowAnonymous]
public IActionResult GetLocationChart()
{
var data = new List<ChartData>();
var locations = Wtm.DC.Set<Location>().AsEnumerable()
.GroupBy(x => x.Status).ToList()
.Select(x => new { status = x.Key, count = x.Count() });
foreach (var item in locations)
{
data.Add(new ChartData
{
Value = item.count,
Category = item.status,
Series = "locations"
});
}
var rv = data.ToChartData();
return Json(rv);
}
[AllRights]
[ActionDescription("Layout")]