inventaire fonctionnel

master
Lucas Delanier 2 years ago
parent d665666102
commit ab49c32f19

@ -9,6 +9,9 @@
@if (Item != null) @if (Item != null)
{ {
<img src="data:image/png;base64, @(Item.ImageBase64)" title="@Item.DisplayName" alt="@Item.DisplayName" style="min-width: 64px; max-width: 64px" /> <div style="position:relative">
<img src="data:image/png;base64, @(Item.ImageBase64)" title="@Item.DisplayName" alt="@Item.DisplayName" style="min-width: 64px; max-width: 64px" />
<p >@(Item.Num)</p>
</div>
} }
</div> </div>

@ -47,8 +47,14 @@ namespace BlazorApp.Components
{ {
return; return;
} }
if(this.Item == null)
this.Item = Parent.CurrentDragItem; {
this.Item = Parent.CurrentDragItem;
}
else if(this.Item.Id == Parent.CurrentDragItem.Id){
this.Item = Parent.CurrentDragItem;
this.Item.Num += 1;
}
Parent.Actions.Add(new InventoryAction { Action = "Drop", Item = this.Item, Index = this.Index }); Parent.Actions.Add(new InventoryAction { Action = "Drop", Item = this.Item, Index = this.Index });

@ -12,5 +12,7 @@
public DateTime CreatedDate { get; set; } public DateTime CreatedDate { get; set; }
public DateTime? UpdatedDate { get; set; } public DateTime? UpdatedDate { get; set; }
public string ImageBase64 { get; set; } public string ImageBase64 { get; set; }
public int Num = 1;
} }
} }

@ -92,3 +92,20 @@
2.0 2.0
2.0 2.0
2.0 2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0
2.0

Loading…
Cancel
Save