diff --git a/MP.Data/Conf/RecipeBlockConfig.cs b/MP.Data/Conf/RecipeBlockConfig.cs index f95a879b..3cc966dc 100644 --- a/MP.Data/Conf/RecipeBlockConfig.cs +++ b/MP.Data/Conf/RecipeBlockConfig.cs @@ -12,17 +12,13 @@ namespace MP.Data.Conf public class RecipeBlockConfig { /// - /// Dizionario delle chiavi prefissate + /// Dizionario delle chiavi, differenziate dai primi caratteri: + /// [C] --> Calcolato + /// [F] --> Fixed (NON modificabile) + /// [E] --> Enum: modificabile ma da dizionario valori seguente + /// "" --> editabile /// - public Dictionary FixedKeys { get; set; } = new Dictionary(); - /// - /// Dizionario delle chiavi Calcolate - /// - public Dictionary CalcKeys { get; set; } = new Dictionary(); - /// - /// Dizionario delle chiavi Editabili - /// - public Dictionary EditKeys { get; set; } = new Dictionary(); + public Dictionary ListKeys { get; set; } = new Dictionary(); /// /// Dizionario degli enum permessi diff --git a/MP.Data/Controllers/MpMongoController.cs b/MP.Data/Controllers/MpMongoController.cs index 785dec09..b148332a 100644 --- a/MP.Data/Controllers/MpMongoController.cs +++ b/MP.Data/Controllers/MpMongoController.cs @@ -65,14 +65,21 @@ namespace MP.Data.Controllers { string rawData = File.ReadAllText(fullPath); var currRecipe = JsonConvert.DeserializeObject(rawData); - // copio la mia ricetta... + // copio la mia ricetta come conf... answ = new RecipeModel() { IdxPODL = idxPODL, TemplateFile = currRecipe.TemplateFile, HeadConf = currRecipe.HeadConf, - RowsConf = currRecipe.RowsConf + RowsConf = currRecipe.RowsConf, + HeadVal = currRecipe.HeadConf.ListKeys, + // aggiungo 1 riga... + RowsVal = new Dictionary>() + { + { 1, currRecipe.RowsConf.ListKeys} + } }; + } return answ; @@ -82,7 +89,7 @@ namespace MP.Data.Controllers private static IConfiguration _configuration; - private static NLog.Logger Log = LogManager.GetCurrentClassLogger(); + private static Logger Log = LogManager.GetCurrentClassLogger(); public static string RecipePath(string ruleName) { diff --git a/MP.Data/MgModels/RecipeModel.cs b/MP.Data/MgModels/RecipeModel.cs index 0595e5fb..13e3de31 100644 --- a/MP.Data/MgModels/RecipeModel.cs +++ b/MP.Data/MgModels/RecipeModel.cs @@ -18,6 +18,17 @@ namespace MP.Data.MgModels public int IdxPODL { get; set; } = 0; public int IdxODL { get; set; } = 0; + + /// + /// Dizionario chiavi/valori campi header + /// + public Dictionary HeadVal { get; set; } = new Dictionary(); + /// + /// Elenco righe ricetta (ogni riga dizionario chiavi/valori) + /// + public Dictionary> RowsVal { get; set; } = new Dictionary>(); + + public string RawRecipe { get; set; } = ""; } diff --git a/MP.SPEC/Components/ListPODL.razor b/MP.SPEC/Components/ListPODL.razor index ada1a2d1..d1a0f0b5 100644 --- a/MP.SPEC/Components/ListPODL.razor +++ b/MP.SPEC/Components/ListPODL.razor @@ -148,7 +148,7 @@ else @if (showRecipe && currRecord != null) { - + } diff --git a/MP.SPEC/Components/ListPODL.razor.cs b/MP.SPEC/Components/ListPODL.razor.cs index 80719ed0..354367ca 100644 --- a/MP.SPEC/Components/ListPODL.razor.cs +++ b/MP.SPEC/Components/ListPODL.razor.cs @@ -281,7 +281,7 @@ namespace MP.SPEC.Components private string mainCss { - get => showRecipe ? "col-8" : "col-12"; + get => showRecipe ? "col-6" : "col-12"; } private int numRecord diff --git a/MP.SPEC/Components/RecipeMan.razor b/MP.SPEC/Components/RecipeMan.razor index c472bdbf..2ff2117a 100644 --- a/MP.SPEC/Components/RecipeMan.razor +++ b/MP.SPEC/Components/RecipeMan.razor @@ -1,11 +1,22 @@ -RecipeMan - - -@if(CurrRecipe==null) +@if (isLoading) { } else { - dati ricetta + + + Dati Ricetta + @if (CurrRecipe?.HeadVal != null) + { + testata: @CurrRecipe.HeadVal.Count valori + } + + + @if (CurrRecipe?.RowsVal != null) + { + righe: @CurrRecipe.RowsVal.Count valori + } + + } diff --git a/MP.SPEC/Components/RecipeMan.razor.cs b/MP.SPEC/Components/RecipeMan.razor.cs index 928517b5..386d034a 100644 --- a/MP.SPEC/Components/RecipeMan.razor.cs +++ b/MP.SPEC/Components/RecipeMan.razor.cs @@ -33,12 +33,15 @@ namespace MP.SPEC.Components protected RecipeModel? CurrRecipe { get; set; } = null; + protected bool isLoading = false; + protected override async Task OnParametersSetAsync() { await Task.Delay(1); + isLoading = true; if (IdxPODL != 0 && !string.IsNullOrEmpty(RecipePath)) { - RecipeModel CurrRecipe = new RecipeModel(); + CurrRecipe = new RecipeModel(); // effettua ricerca ricetta su MongoDb CurrRecipe = await MDService.RecipeGetByPODL(IdxPODL); // se non trova crea nuova... @@ -47,6 +50,9 @@ namespace MP.SPEC.Components CurrRecipe = MDService.InitRecipe(IdxPODL, RecipePath); } } + await Task.Delay(1); + isLoading = false; + //await InvokeAsync(StateHasChanged); } } } \ No newline at end of file diff --git a/MP.SPEC/MP.SPEC.csproj b/MP.SPEC/MP.SPEC.csproj index 6ba24e47..77ad4dca 100644 --- a/MP.SPEC/MP.SPEC.csproj +++ b/MP.SPEC/MP.SPEC.csproj @@ -5,7 +5,7 @@ enable enable MP.SPEC - 6.16.2302.809 + 6.16.2302.810 diff --git a/MP.SPEC/Recipe/Fimat/RecipeConf.json b/MP.SPEC/Recipe/Fimat/RecipeConf.json index ed7ba862..f8f7beb7 100644 --- a/MP.SPEC/Recipe/Fimat/RecipeConf.json +++ b/MP.SPEC/Recipe/Fimat/RecipeConf.json @@ -1,32 +1,28 @@ { "TemplateFile": "TemplateOutput.tpl", "HeadConf": { - "FixedKeys": { - "CustDrumCode": "", - "Taglio-N": "1", - "Taglio-D": "4", - "ServiceType": "N", - "RecipeType": "C", - "ViscoName": "", - "ViscoValue": "0" - }, - "CalcKeys": { - "LotID": "PODL01", - "OrderCode": "PODL02", - "Article": "Art2PODL01", - "Info1": "Art2PODL02" - }, - "EditKeys": { - "Prio": "Enum:Priority", - "DrumType": "Enum:DrumType", + "ListKeys": { + "CustDrumCode": "F:", + "Taglio-N": "F:1", + "Taglio-D": "F:4", + "ServiceType": "F:N", + "RecipeType": "F:C", + "ViscoName": "F:", + "ViscoValue": "F:0", + "LotID": "C:PODL01", + "OrderCode": "C:PODL02", + "Article": "C:Art2PODL01", + "Info1": "C:Art2PODL02", + "Prio": "E:Priority", + "DrumType": "E:DrumType", "Customer": "Tenditalia", "Design": "DESIGN", "Screen": "SCREEN", "Variant": "VARIANT", "RecName": "CODE000", - "Series": "Enum:Series", - "UM": "Enum:UM", - "DosType": "Enum:DosType", + "Series": "E:Series", + "UM": "E:UM", + "DosType": "E:DosType", "Note1": "", "Note2": "", "Sequence": "1", @@ -84,16 +80,12 @@ } }, "RowsConf": { - "FixedKeys": { - "Weight-gr-prev": "0.00" - }, - "CalcKeys": { - "CompNumber": "#" - }, - "EditKeys": { + "ListKeys": { + "Weight-gr-prev": "F:0.00", + "CompNumber": "C:#", "ColourCode": "C001", "Description": "COLOR1", - "TypComp": "ColType", + "TypComp": "E:ColType", "PartsWeight": "1.00", "PartsPerc": "0.10", "Weight-gr": "30.00" diff --git a/MP.SPEC/Resources/ChangeLog.html b/MP.SPEC/Resources/ChangeLog.html index 37087c9c..be294f9d 100644 --- a/MP.SPEC/Resources/ChangeLog.html +++ b/MP.SPEC/Resources/ChangeLog.html @@ -1,6 +1,6 @@ Modulo MAPOSPEC - Versione: 6.16.2302.809 + Versione: 6.16.2302.810 Note di rilascio: diff --git a/MP.SPEC/Resources/VersNum.txt b/MP.SPEC/Resources/VersNum.txt index 860c0968..9411db86 100644 --- a/MP.SPEC/Resources/VersNum.txt +++ b/MP.SPEC/Resources/VersNum.txt @@ -1 +1 @@ -6.16.2302.809 +6.16.2302.810 diff --git a/MP.SPEC/Resources/manifest.xml b/MP.SPEC/Resources/manifest.xml index 6a63bc72..70f4553d 100644 --- a/MP.SPEC/Resources/manifest.xml +++ b/MP.SPEC/Resources/manifest.xml @@ -1,6 +1,6 @@ - 6.16.2302.809 + 6.16.2302.810 https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/MP.SPEC.zip https://nexus.steamware.net/repository/SWS/MP-SPEC/stable/LAST/ChangeLog.html false
testata: @CurrRecipe.HeadVal.Count valori
righe: @CurrRecipe.RowsVal.Count valori