@using static HotelPms.Client.Blazor.Util.SystemEnum
|
<MudDialog Style="width: 360px;">
|
<TitleContent>
|
<MudText Typo="Typo.h6">
|
<MudIcon Icon="@Icons.Material.Filled.ColorLens" Class="mr-3 mb-n1"/>
|
@Title
|
</MudText>
|
</TitleContent>
|
<DialogContent>
|
<MudPaper Class="pa-4 mb-4">
|
<MudStack Row="true" Justify="Justify.Center" Spacing="5" AlignItems="AlignItems.Center">
|
<MudText Typo="Typo.body1">元色</MudText>
|
<MudText Typo="Typo.body1">@m_OrgData</MudText>
|
<MudPaper Class="pa-3" Style="@($"background-color: {m_OrgData};")"></MudPaper>
|
</MudStack>
|
</MudPaper>
|
<MudColorPicker @ref="colorPicker" @bind-Text="Data" Style="@($"color: {Data};")" DisableToolbar="false" PickerVariant="PickerVariant.Static" ColorPickerMode="ColorPickerMode.HEX" />
|
</DialogContent>
|
<DialogActions>
|
<MudGrid Spacing="2" Justify="Justify.Center" Class="my-3">
|
<MudItem>
|
<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Primary" OnClick="Save" StartIcon="@Icons.Filled.Done" Style="width: 100px; height: 40px;">OK</MudButton>
|
</MudItem>
|
<MudItem>
|
<MudButton Variant="Variant.Filled" Color="MudBlazor.Color.Error" OnClick="Close" StartIcon="@Icons.Filled.Close" Style="width: 100px; height: 40px;">戻る</MudButton>
|
</MudItem>
|
</MudGrid>
|
</DialogActions>
|
</MudDialog>
|
|
@code {
|
[CascadingParameter] MudDialogInstance MudDialog { get; set; }
|
[Parameter] public string Title { get; set; }
|
private bool isFirst = true;
|
private MudColorPicker colorPicker;
|
private string m_OrgData = string.Empty;
|
|
private string m_Data = string.Empty;
|
[Parameter] public string Data
|
{
|
get { return m_Data; }
|
set
|
{
|
m_Data = value;
|
if (isFirst) { m_OrgData = m_Data; }
|
}
|
}
|
|
protected override void OnAfterRender(bool firstRender)
|
{
|
if (firstRender)
|
{
|
isFirst = false;
|
}
|
}
|
|
private void ToDate()
|
{
|
}
|
|
private void Close()
|
{
|
MudDialog.Cancel();
|
}
|
|
private void Save()
|
{
|
MudDialog.Close(DialogResult.Ok(Data));
|
}
|
}
|