Merge branch 'master' of http://git2.aycode.com/Adam/TourIAm
This commit is contained in:
commit
0489b543b8
|
|
@ -82,7 +82,7 @@
|
|||
<Items>
|
||||
@foreach (var transfer in PageModel.Upcomings)
|
||||
{
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"{transfer.Appointment} - {transfer.FromAddress} [#{transfer.OrderId}]")>
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"[#{transfer.OrderId}] {transfer.Appointment} - {transfer.FromAddress}")>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
|
@ -108,7 +108,7 @@
|
|||
@foreach (var transfer in PageModel.Problems)
|
||||
{
|
||||
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"{transfer.Appointment} - {transfer.FromAddress} [#{transfer.OrderId}]")>
|
||||
<DxAccordionItem CssClass="@GetCustomColor(transfer.TransferStatusType)" Text=@($"[#{transfer.OrderId}] {transfer.Appointment} - {transfer.FromAddress}")>
|
||||
<ContentTemplate>
|
||||
<div class="py-3 px-3">
|
||||
<TransferCardComponent DataChanged="RefreshComponent" Context="@transfer" />
|
||||
|
|
@ -147,8 +147,6 @@
|
|||
ContextIds="new object[] {driverId}"
|
||||
CustomizeElement="Grid_CustomizeElement"
|
||||
ShowGroupPanel="true"
|
||||
CustomGroup="Grid_CustomGroup"
|
||||
CustomizeGroupValueDisplayText="Grid_CustomizeGroupValueDisplayText"
|
||||
ColumnResizeMode="GridColumnResizeMode.NextColumn"
|
||||
AllowSelectRowByClick="false"
|
||||
PageSize="13"
|
||||
|
|
@ -156,8 +154,16 @@
|
|||
|
||||
<Columns>
|
||||
<DxGridDataColumn FieldName="Id" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Appointment" SortOrder="GridColumnSortOrder.Descending" GroupIndex="0" GroupInterval="GridColumnGroupInterval.Custom" DisplayFormat="g" Width="125" />
|
||||
<DxGridDataColumn FieldName="OrderId" Caption="Order" SortIndex="1" SortOrder="GridColumnSortOrder.Descending" Width="70" />
|
||||
<DxGridDataColumn FieldName="Appointment" Caption="Appointment" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" SortOrder="GridColumnSortOrder.Descending" GroupIndex="0" GroupInterval="GridColumnGroupInterval.Date" DisplayFormat="d" Width="95" />
|
||||
<DxGridDataColumn Caption="Time" Width="50" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var appointment = (Transfer)context.DataItem;
|
||||
<text>@appointment.Appointment.ToString("t")</text>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="FromAddress" />
|
||||
<DxGridDataColumn FieldName="ToAddress" />
|
||||
<DxGridDataColumn FieldName="Created" DisplayFormat="g" Width="125" Visible="false" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center" />
|
||||
|
|
@ -259,14 +265,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
void Grid_CustomGroup(GridCustomGroupEventArgs e)
|
||||
{
|
||||
if (e.FieldName == "Appointment")
|
||||
{
|
||||
e.SameGroup = Grid_CompareColumnValues(((DateTime)e.Value1).Date, ((DateTime)e.Value2).Date);
|
||||
e.Handled = true;
|
||||
}
|
||||
}
|
||||
// void Grid_CustomGroup(GridCustomGroupEventArgs e)
|
||||
// {
|
||||
// if (e.FieldName == "Appointment")
|
||||
// {
|
||||
// e.SameGroup = Grid_CompareColumnValues(((DateTime)e.Value1).Date, ((DateTime)e.Value2).Date);
|
||||
// e.Handled = true;
|
||||
// }
|
||||
// }
|
||||
bool Grid_CompareColumnValues(DateTime value1, DateTime value2)
|
||||
{
|
||||
if (value1 == value2)
|
||||
|
|
@ -274,15 +280,14 @@
|
|||
else
|
||||
return false;
|
||||
}
|
||||
void Grid_CustomizeGroupValueDisplayText(GridCustomizeGroupValueDisplayTextEventArgs e)
|
||||
{
|
||||
if (e.FieldName == "Appointment")
|
||||
{
|
||||
|
||||
string displayText = ((DateTime)e.Value).Date.ToString();
|
||||
e.DisplayText = displayText;
|
||||
}
|
||||
}
|
||||
// void Grid_CustomizeGroupValueDisplayText(GridCustomizeGroupValueDisplayTextEventArgs e)
|
||||
// {
|
||||
// if (e.FieldName == "Appointment")
|
||||
// {
|
||||
// string displayText = ((DateTime)e.Value).Date.ToString();
|
||||
// e.DisplayText = displayText;
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
private void RefreshComponent()
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
|
||||
<div class="container-fluid">
|
||||
|
||||
<MessageDetailGridComponent ContextId="UserId" GetAllMessageTag="SignalRTags.GetMessagesByUserId" IsSenderEmailVisible="false" IsMessageTextVisible="!_isMobile"></MessageDetailGridComponent>
|
||||
<MessageDetailGridComponent ContextId="UserId" GetAllMessageTag="SignalRTags.GetMessagesByUserId" IsSenderEmailVisible="false" IsMessageTextVisible="!_isMobile" ShowFilterRow="true"/>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
@ -38,7 +38,15 @@
|
|||
// var upmId = sessionService.User.UserModelDto.UserProductMappings.Select(x => x.Id).FirstOrDefault();
|
||||
// if(!upmId.IsNullOrEmpty()) _contextParams.Add(upmId);
|
||||
|
||||
try
|
||||
{
|
||||
_isMobile = await jsRuntime.InvokeAsync<bool>("isDevice");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Console.WriteLine(ex);
|
||||
}
|
||||
|
||||
await base.OnInitializedAsync();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -31,25 +31,14 @@
|
|||
SignalRClient="AdminSignalRClient"
|
||||
GetAllMessageTag="GetAllMessageTag"
|
||||
ContextIds="@(ContextId.IsNullOrEmpty() ? throw new InvalidDataException($"ContextId.IsNullOrEmpty(); ContextId: {ContextId}") : [ContextId.Value])"
|
||||
CustomizeElement="CustomizeElement">
|
||||
CustomizeElement="CustomizeElement"
|
||||
ShowFilterRow="ShowFilterRow">
|
||||
<Columns>
|
||||
<DxGridCommandColumn Width="135" MinWidth="135" Visible="AcDomain.IsDeveloperVersion" DeleteButtonVisible="AcDomain.IsDeveloperVersion" EditButtonVisible="AcDomain.IsDeveloperVersion" FixedPosition="GridColumnFixedPosition.Left" />
|
||||
<DxGridDataColumn FieldName="Id" Width="150" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="ContextId" Width="150px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="80" SortIndex="0" SortOrder="GridColumnSortOrder.Descending" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<DxGridDataColumn FieldName="SenderId" Caption=" " Width="30px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" DisplayFormat="N" AllowSort="false">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var Date = ((EmailMessage)context.DataItem).Created.Date;
|
||||
var Time = ((EmailMessage)context.DataItem).Created;
|
||||
<p style="padding:3px; margin: 0 auto;">@Date.ToString("yy.MM.dd")</p>
|
||||
<p style="padding:3px; margin: 0 auto;">@Time.ToString("HH:mm")</p>
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="SenderId" Caption="/" Width="30px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" DisplayFormat="N">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
bool isOutgoing = ((EmailMessage)context.DataItem).SenderId == myUserId;
|
||||
var isOutgoing = ((EmailMessage)context.DataItem).SenderId == myUserId;
|
||||
if (isOutgoing)
|
||||
{
|
||||
<i class="fa-solid fa-right-from-bracket text-info"></i>
|
||||
|
|
@ -61,8 +50,8 @@
|
|||
}
|
||||
<span> | </span>
|
||||
@{
|
||||
MessageContextType a = ((EmailMessage)context.DataItem).ContextType;
|
||||
switch (a)
|
||||
var contextType = ((EmailMessage)context.DataItem).ContextType;
|
||||
switch (contextType)
|
||||
{
|
||||
case MessageContextType.Transfer:
|
||||
{
|
||||
|
|
@ -94,12 +83,40 @@
|
|||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
<DxGridDataColumn FieldName="Id" Width="150" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="ContextId" Width="150px" ShowInColumnChooser="AcDomain.IsDeveloperVersion" Visible="AcDomain.IsDeveloperVersion" DisplayFormat="N" />
|
||||
<DxGridDataColumn FieldName="Created" Caption="Received" DisplayFormat="g" Width="@(IsMessageTextVisible ? 140.ToString() : 85.ToString())" CaptionAlignment="GridTextAlignment.Center" TextAlignment="GridTextAlignment.Center">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
var created = ((EmailMessage)context.DataItem).Created;
|
||||
|
||||
if (IsMessageTextVisible)
|
||||
{
|
||||
@created.ToString("g")
|
||||
}
|
||||
else
|
||||
{
|
||||
<div style="padding: 3px 3px 1px 3px; margin: 0 auto;">@created.ToString("d").Replace(" ", string.Empty)</div>
|
||||
<div style="padding: 2px 3px 3px 3px; margin: 0 auto;">@created.ToString("t").Replace(" ", string.Empty)</div>
|
||||
}
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
|
||||
<DxGridDataColumn FieldName="EmailAddress" Caption="Sender" Width="200px" Visible="IsSenderEmailVisible || AcDomain.IsDeveloperVersion" />
|
||||
<DxGridDataColumn FieldName="Subject">
|
||||
<CellDisplayTemplate>
|
||||
@{
|
||||
string subjectString = ((EmailMessage)context.DataItem).Subject;
|
||||
var subjectString = ((EmailMessage)context.DataItem).Subject;
|
||||
<p style="word-break: normal; white-space: normal; padding: 0; margin: 0 auto;">@subjectString</p>
|
||||
|
||||
if (!IsMessageTextVisible)
|
||||
{
|
||||
var textString = System.Text.RegularExpressions.Regex.Replace(((EmailMessage)context.DataItem).Text!, "<(.|\n)*?>", string.Empty);
|
||||
if (textString.Length > 80) textString = textString[..80] + "...";
|
||||
|
||||
<div style="color: darkgray; word-break: normal; white-space: normal; padding: 3px 5px 0 0; margin: 0 auto;">@textString</div>
|
||||
}
|
||||
}
|
||||
</CellDisplayTemplate>
|
||||
</DxGridDataColumn>
|
||||
|
|
@ -134,6 +151,7 @@
|
|||
[Parameter] public bool IsSenderEmailVisible { get; set; } = true;
|
||||
|
||||
[Parameter] public int GetAllMessageTag { get; set; } = SignalRTags.GetMessagesByContextId;
|
||||
[Parameter] public bool ShowFilterRow { get; set; } = false;
|
||||
|
||||
private MessageGrid _messageGrid = null!;
|
||||
private LoggerClient<MessageDetailGridComponent> _logger = null!;
|
||||
|
|
|
|||
Loading…
Reference in New Issue