From 2bfda34103ad5c7aea88ddc1a3e49957f89231a2 Mon Sep 17 00:00:00 2001 From: zhougf Date: Thu, 19 Dec 2024 15:35:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=E5=9B=BE=E6=A0=87=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- HHWMS.Web/Controllers/HomeController.cs | 22 +++++ HHWMS.Web/Views/Home/FrontPage.cshtml | 110 ++++++++++++++++++++++++ 2 files changed, 132 insertions(+) diff --git a/HHWMS.Web/Controllers/HomeController.cs b/HHWMS.Web/Controllers/HomeController.cs index bfa625e..3e3f887 100644 --- a/HHWMS.Web/Controllers/HomeController.cs +++ b/HHWMS.Web/Controllers/HomeController.cs @@ -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(); + var locations = Wtm.DC.Set().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")] diff --git a/HHWMS.Web/Views/Home/FrontPage.cshtml b/HHWMS.Web/Views/Home/FrontPage.cshtml index e69de29..fef9b14 100644 --- a/HHWMS.Web/Views/Home/FrontPage.cshtml +++ b/HHWMS.Web/Views/Home/FrontPage.cshtml @@ -0,0 +1,110 @@ +@model WalkingTec.Mvvm.Core.BaseVM +@using System.Text.Json + +
+
+
+
+
+
ShortCut
+ +
+
+ +
+
+
Controllers
+
+ +
+
+
+
+
+
Models
+
+ +
+
+
+
+
+
Mock data
+
+ + +
+
+
+
+
+
+