报表页增加能量统计显示

master
tayttt 5 days ago
parent 123a676cc8
commit 6ad2e7e227

@ -230,6 +230,36 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
SetProperty(ref _searchCount, value);
}
}
private double _totalEnergy = 0;
public double TotalEnergy
{
get { return _totalEnergy; }
set
{
SetProperty(ref _totalEnergy, value);
}
}
private double _averageEnergy = 0;
public double AverageEnergy
{
get { return _averageEnergy; }
set
{
SetProperty(ref _averageEnergy, value);
}
}
private double _maxEnergy = 0;
public double MaxEnergy
{
get { return _maxEnergy; }
set
{
SetProperty(ref _maxEnergy, value);
}
}
private string _likeCondition;
public string LikeCondition
@ -656,9 +686,25 @@ namespace Txgy.EWS.Client.PageModule.ViewModels
}
}
SearchCount = results.Count;
UpdateEnergyStats(results);
return results;
}
private void UpdateEnergyStats(List<GridItemEventResult> results)
{
if (results == null || results.Count == 0)
{
TotalEnergy = 0;
AverageEnergy = 0;
MaxEnergy = 0;
return;
}
TotalEnergy = Math.Round(results.Sum(rs => rs.Energy), 2);
AverageEnergy = Math.Round(results.Average(rs => rs.Energy), 2);
MaxEnergy = Math.Round(results.Max(rs => rs.Energy), 2);
}
public void ExportEventListReport(ReportView rView)
{
string fileNmae = "微震事件列表_" + DateTime.Now.ToString("yyyyMMdd");

@ -484,35 +484,60 @@
Content="月报"
FontSize="16"
Style="{StaticResource MaterialDesignRaisedDarkButton}" />
<StackPanel Grid.Row="1"
Grid.ColumnSpan="3"
VerticalAlignment="Center"
Orientation="Horizontal">
<Button Grid.Row="1"
Grid.Column="3"
Width="70"
Height="34"
Content="导出"
FontSize="16"
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Command="{Binding ExportEventListFileExcelCmd}"
CommandParameter="{Binding ElementName=rView}" />
</Grid>
</Grid>
<StackPanel Margin="20,0,20,10">
<WrapPanel Margin="20,0,0,10"
VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center" Text="事件总数:" FontSize="16" />
<TextBlock VerticalAlignment="Center"
d:Text="11142"
Width="60"
Foreground="Black"
FontWeight="SemiBold"
Text="{Binding SearchCount}"
FontSize="16" />
<TextBlock Margin="10,0,0,0" Text="中等能量事件:" FontSize="16" />
<TextBlock d:Text="1000"
Foreground="Black"
FontSize="16"
Width="60"
FontWeight="SemiBold"
Text="{Binding MiddleEventCount}"
Cursor="" />
</StackPanel>
<Button Grid.Row="1"
Grid.Column="3"
Width="70"
Height="34"
Content="导出"
<TextBlock Text="总能量:" FontSize="16" />
<TextBlock Foreground="Black"
FontSize="16"
Style="{StaticResource MaterialDesignRaisedDarkButton}"
Command="{Binding ExportEventListFileExcelCmd}"
CommandParameter="{Binding ElementName=rView}" />
</Grid>
</Grid>
Width="80"
FontWeight="SemiBold"
Text="{Binding TotalEnergy, StringFormat={}{0:F0}J}" />
<TextBlock Margin="20,0,0,0" Text="平均能量:" FontSize="16" />
<TextBlock Foreground="Black"
FontSize="16"
Width="60"
d:Text="11111J"
FontWeight="SemiBold"
Text="{Binding AverageEnergy, StringFormat={}{0:F0}J}" />
<TextBlock Margin="20,0,0,0" Text="最大能量:" FontSize="16" />
<TextBlock Foreground="Black"
FontSize="16"
FontWeight="SemiBold"
Width="60"
Text="{Binding MaxEnergy, StringFormat={}{0:F0}J}" />
</WrapPanel>
</StackPanel>
</StackPanel>
</StackPanel>
</md:Card>
<!--<md:Card Margin="5,0,5,5"

Loading…
Cancel
Save