This commit is contained in:
Đăng Nguyễn
2025-12-22 19:31:55 +07:00
parent 1289a6c331
commit 4ceec9abd5
5 changed files with 17 additions and 8 deletions

View File

@@ -46,8 +46,10 @@
<div class="flex-grow-1">
<MudTextField Value="@OrderJson"
ReadOnly
T="string"
ValueChanged="OrderJsonChange"
Variant="Variant.Filled"
Immediate=true
Lines="50"
Style="font-family: 'Roboto Mono', Consolas, monospace;
font-size: 0.85rem;
@@ -62,6 +64,8 @@
[Parameter] public bool? SendSuccess { get; set; }
[Parameter] public bool DisableCancel { get; set; }
[Parameter] public EventCallback<string> OrderJsonChanged { get; set; }
[Parameter] public EventCallback OnCopy { get; set; }
[Parameter] public EventCallback OnSend { get; set; }
[Parameter] public EventCallback OnImport { get; set; }
@@ -90,4 +94,11 @@
false => Icons.Material.Filled.Error,
_ => Icons.Material.Filled.Send
};
private void OrderJsonChange(string value)
{
OrderJson = value;
OrderJsonChanged.InvokeAsync(OrderJson);
StateHasChanged();
}
}

View File

@@ -46,7 +46,7 @@
<!-- ================= RIGHT ================= -->
<MudItem xs="12" md="5" Class="h-100">
<JsonOutputPanel OrderJson="@OrderJson"
<JsonOutputPanel @bind-OrderJson="@OrderJson"
Copied="@copied"
SendSuccess="@sendSuccess"
OnCopy="CopyJsonToClipboard"
@@ -226,7 +226,7 @@
sendSuccess = response.IsSuccessStatusCode;
}
catch (Exception ex)
catch
{
sendSuccess = false;
}