diff --git a/Docs/ActualToDo.pdf b/Docs/ActualToDo.pdf index 514bf9b..d82b8a7 100644 Binary files a/Docs/ActualToDo.pdf and b/Docs/ActualToDo.pdf differ diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor index 45b4548..648b2f2 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor @@ -8,11 +8,11 @@ else {
- +
- +
diff --git a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs index ceecfea..8fcc296 100644 --- a/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs +++ b/WebDoorCreator.UI/Components/Hardware/HardwareNewPanel.razor.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Components; using Newtonsoft.Json; using WebDoorCreator.Data.DbModels; +using WebDoorCreator.UI.Components.SvgComp; using WebDoorCreator.UI.Data; using static WebDoorCreator.UI.Data.WDCRefreshService; @@ -100,10 +101,24 @@ namespace WebDoorCreator.UI.Components.Hardware #region Protected Methods - protected async Task backToList() + protected async Task exeFun(HwSvgObj.ActionReq action) { await Task.Delay(1); - await E_act2Rel.InvokeAsync(true); + switch (action) + { + case HwSvgObj.ActionReq.Minus: + // nulla (x ora) + break; + + case HwSvgObj.ActionReq.Plus: + await hwToAdd(""); + break; + + case HwSvgObj.ActionReq.Select: + default: + await E_act2Rel.InvokeAsync(true); + break; + } } protected int getDoorOpInstNum(int doorOpId) @@ -285,7 +300,6 @@ namespace WebDoorCreator.UI.Components.Hardware DoorOpList = null; await Task.Delay(1); ListRecord = await WDCService.DoorOpGetByDoorId(DoorId); - var tempListVal = await WDCService.ListValuesGetAll(HwCode, "Folder"); if (ListRecord != null) { DoorOpList = ListRecord.Where(x => (x.DoorId == DoorId) && (x.ObjectId == HwCode)).ToList(); diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor index bcdd3f8..e81b0e2 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor @@ -1,7 +1,7 @@  -
+
@ItemName
@@ -26,19 +26,30 @@ - + @if (!string.IsNullOrEmpty(ImagePath)) + { + + } @if (ShowPlus) { - + } @if (ShowPlus) { - + } else { - + + } + @if (string.IsNullOrEmpty(ImagePath)) + { + + + + + } \ No newline at end of file diff --git a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs index 40ad5ef..9c3ee82 100644 --- a/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs +++ b/WebDoorCreator.UI/Components/SvgComp/HwSvgObj.razor.cs @@ -1,47 +1,45 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; using Microsoft.AspNetCore.Components; -using System.Net.Http; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Components.Authorization; -using Microsoft.AspNetCore.Components.Forms; -using Microsoft.AspNetCore.Components.Routing; -using Microsoft.AspNetCore.Components.Web; -using Microsoft.AspNetCore.Components.Web.Virtualization; -using Microsoft.JSInterop; -using WebDoorCreator.UI; -using WebDoorCreator.UI.Components; -using WebDoorCreator.UI.Components.Buttons; -using WebDoorCreator.UI.Components.CompMan; -using WebDoorCreator.UI.Components.DoorMan; -using WebDoorCreator.UI.Components.DoorDef; -using WebDoorCreator.UI.Components.Gen; -using WebDoorCreator.UI.Components.Order; -using WebDoorCreator.UI.Components.Users; -using WebDoorCreator.UI.Components.Hardware; -using WebDoorCreator.UI.Components.SvgComp; -using WebDoorCreator.UI.Components.Filters; -using WebDoorCreator.UI.Components.Report; -using WebDoorCreator.UI.Shared; -using WebDoorCreator.Data.DbModels; -using EgwCoreLib.Razor; namespace WebDoorCreator.UI.Components.SvgComp { public partial class HwSvgObj { + #region Public Enums + + /// + /// Enum delle azioni associate al controllo + /// + public enum ActionReq + { + Minus, + Plus, + Select + } + + #endregion Public Enums + #region Public Properties [Parameter] - public EventCallback EC_ExeFunct { get; set; } + public EventCallback EC_ExeFunct { get; set; } + + /// + /// Tag icona da mostrare (secondario se img != null) + /// + [Parameter] + public string IconTag { get; set; } = ""; + + /// + /// Path img da mostrare (prioritario su icona) + /// + [Parameter] + public string ImagePath { get; set; } = ""; [Parameter] - public EventCallback EC_ExePlus { get; set; } + public int ItemCount { get; set; } = 0; [Parameter] - public string ImagePath { get; set; } = "images/LogoEgw.png"; + public string ItemName { get; set; } = ""; [Parameter] public string LineColor { get; set; } = "#00838F"; @@ -49,16 +47,6 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int LineWidth { get; set; } = 8; - [Parameter] - public string ItemName { get; set; } = ""; - - [Parameter] - public int ItemCount { get; set; } = 0; - - - [Parameter] - public string PlusColor { get; set; } = "green"; - [Parameter] public int ObjH { get; set; } = 204; @@ -68,6 +56,9 @@ namespace WebDoorCreator.UI.Components.SvgComp [Parameter] public int ObjW { get; set; } = 450; + [Parameter] + public string PlusColor { get; set; } = "green"; + [Parameter] public bool ShowPlus { get; set; } = false; @@ -78,6 +69,10 @@ namespace WebDoorCreator.UI.Components.SvgComp #region Protected Properties + protected string cardClass + { + get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; + } protected CircleData CircleImg { get; set; } = null!; @@ -95,11 +90,6 @@ namespace WebDoorCreator.UI.Components.SvgComp get => ObjW - (ObjH * 90 / 100); } - protected string cardClass - { - get => ItemCount > 0 ? "bg-primary text-light" : "bg-inactive text-dark"; - } - #endregion Protected Properties #region Protected Methods @@ -107,20 +97,19 @@ namespace WebDoorCreator.UI.Components.SvgComp /// /// Invia evento principale /// - /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... - protected void execFunc(bool forceSend) + /// Azione richiesta + /// + /// se true manda sempre EC_ExeFunct, altrimenti NON invia se showPlus attivo... + /// + protected void doExecFunc(ActionReq action, bool forceSend) { + // invia la chiamata richiesta secondo configurazione... if (forceSend || !ShowPlus) { - EC_ExeFunct.InvokeAsync(true); + EC_ExeFunct.InvokeAsync(action); } } - protected void execPlus() - { - EC_ExePlus.InvokeAsync(true); - } - protected override void OnParametersSet() { setupGraphParams(); diff --git a/WebDoorCreator.UI/Pages/TestPage.razor b/WebDoorCreator.UI/Pages/TestPage.razor index 0541e63..e0b48ed 100644 --- a/WebDoorCreator.UI/Pages/TestPage.razor +++ b/WebDoorCreator.UI/Pages/TestPage.razor @@ -21,23 +21,27 @@
- +
- +
-
- +
+
-
+
+
-
- +
+ +
+
+
@@ -96,11 +100,6 @@ protected override async Task OnInitializedAsync() { - //return base.OnInitializedAsync(); - //} - - //protected override void OnInitialized() - //{ msgList = new Dictionary(); msgList.Add("T1", "Titolo"); msgList.Add("M1", "Messaggio 1"); @@ -110,7 +109,11 @@ protected List? DoorsList { get; set; } = null; - protected async Task exeFun() + protected async Task exeDoor() + { + await Task.Delay(1); + } + protected async Task exeFun(HwSvgObj.ActionReq action) { await Task.Delay(1); }