Fix grafici

This commit is contained in:
zaccaria.majid
2022-10-03 12:56:31 +02:00
parent 801441fd1a
commit 372318a290
6 changed files with 53 additions and 44 deletions
@@ -10,17 +10,17 @@
@if (!string.IsNullOrEmpty(currRecord.CssIcon))
{
<div class="d-flex flex-column">
<div class="small"><sup>@currRecord.Title</sup></div>
<div class="small @cssLast(@currRecord.Title)"><sup>@currRecord.Title</sup></div>
<div><i class="@currRecord.CssIcon"></i></div>
</div>
}
else
{
<div>
<b>@currRecord.Title</b>
<b><span class="class= @cssLast(@currRecord.Title)">@currRecord.Title</span></b>
<div class="col-6 pl-0 float-end">
<div class="d-flex flex-column">
<div class="d-flex flex-row-reverse"><span class="float-end"><b>@currRecord.Value</b></span></div>
<div class="d-flex flex-row-reverse "><span class="float-end"><b>@currRecord.Value</b></span></div>
</div>
</div>
</div>
@@ -9,8 +9,8 @@ namespace MP.MONO.UI.Components
[Parameter]
public DisplayDataDTO? currRecord { get; set; } = null;
[Parameter]
public List<string> SelVal { get; set; } = new List<string>();
#endregion Public Properties
@@ -24,7 +24,19 @@ namespace MP.MONO.UI.Components
answ = $"width: {ratio:P0};";
return answ;
}
protected string cssLast(string toolName)
{
string answ = SelVal.Contains(toolName) ? "bg-dark text-light" : "";
// se è ultima testo giallo...
if (SelVal != null && SelVal.Count > 0)
{
if (SelVal.LastOrDefault().Equals(toolName))
{
answ = "bg-dark text-warning";
}
}
return answ;
}
#endregion Protected Methods
}
+1 -1
View File
@@ -39,7 +39,7 @@
</li>*@
<li class="list-group-item list-group-item-action @cssActive(item.Title)" @onclick="()=>toggleSelect(item.Title)">
<DisplayRecordComponent currRecord="@item"></DisplayRecordComponent>
<DisplayRecordComponent selVal="@SelVal" currRecord="@item"></DisplayRecordComponent>
</li>
}
</ul>
+5 -5
View File
@@ -63,22 +63,22 @@ namespace MP.MONO.UI.Components
.ToList();
}
}
protected string cssLast(string ParamName)
protected string cssLast(string toolName)
{
string answ = SelVal.Contains(ParamName) ? "bg-dark text-light" : "";
string answ = SelVal.Contains(toolName) ? "bg-dark text-light" : "";
// se è ultima testo giallo...
if (SelVal != null && SelVal.Count > 0)
{
if (SelVal.LastOrDefault().Equals(ParamName))
if (SelVal.LastOrDefault().Equals(toolName))
{
answ = "bg-dark text-warning";
}
}
return answ;
}
protected string cssActive(string ParamName)
protected string cssActive(string toolName)
{
string answ = SelVal.Contains(ParamName) ? "bg-dark text-light" : "";
string answ = SelVal.Contains(toolName) ? "bg-dark text-light" : "";
return answ;
}
protected void toggleSelect(string SelectedValue)
+17 -15
View File
@@ -1,22 +1,24 @@
@page "/Tools"
<div class="row">
<div class="col-4">
<div class="card">
<div class="card-header">
<h3>Tools</h3>
</div>
<div class="card-body">
<ToolsOverview SelVal="@selParams" EC_AddValue="paramAdded" EC_RemValue="paramRemoved"></ToolsOverview>
<div class="card">
<div class="card-header">
<h3>Tools</h3>
</div>
<div class="card-body">
<div class="row">
<div class="col-3">
<ToolsOverview SelVal="@selTools" EC_AddValue="toolAdded" EC_RemValue="toolRemoved"></ToolsOverview>
</div>
<div class="row col-9">
@foreach (var item in selTools)
{
<div class="@pcss">
<ToolsPlot SelectedTool="@item" maxRecord="@maxRecord" sampleSecMin="@sampleSecMin"></ToolsPlot>
</div>
}
</div>
</div>
</div>
</div>
<div class="row col-8">
@foreach (var item in selParams)
{
<div class="@pcss">
<ToolsPlot SelectedTool="@item" maxRecord="@maxRecord" sampleSecMin="@sampleSecMin"></ToolsPlot>
</div>
}
</div>
</div>
+12 -17
View File
@@ -39,10 +39,10 @@
protected string btnResetCss
{
get => selParams != null && selParams.Count > 0 ? "" : "disabled";
get => selTools != null && selTools.Count > 0 ? "" : "disabled";
}
protected List<string> selParams { get; set; } = new List<string>();
protected List<string> selTools { get; set; } = new List<string>();
#endregion Protected Properties
@@ -53,7 +53,7 @@
get
{
string answ = "col-12";
int numPar = selParams.Count;
int numPar = selTools.Count;
if (numPar > 6)
{
answ = "col-4";
@@ -70,20 +70,15 @@
#region Private Methods
private void toggleParam()
{
showParam = !showParam;
}
#endregion Private Methods
#region Protected Methods
protected void paramAdded(string toolName)
protected void toolAdded(string toolName)
{
if (!selParams.Contains(toolName))
if (!selTools.Contains(toolName))
{
selParams.Add(toolName);
selTools.Add(toolName);
}
}
@@ -92,29 +87,29 @@
get
{
string answ = "";
if (selParams.Count > 0)
if (selTools.Count > 0)
{
answ = $"{selParams.LastOrDefault()}";
answ = $"{selTools.LastOrDefault()}";
}
return answ;
}
}
protected void paramRemoved(string toolName)
protected void toolRemoved(string toolName)
{
if (selParams.Contains(toolName))
if (selTools.Contains(toolName))
{
// controllo se è ultimo rimuovo direttamente
if (toolName == lastTool)
{
selParams.Remove(toolName);
selTools.Remove(toolName);
}
}
}
protected void resetSel()
{
selParams = new List<string>();
selTools = new List<string>();
}
protected void toggleRT()