统计页面 修改 增加统计Border。优化部分统计DataGrid的列展示
This commit is contained in:
1 parent
f2d619eafb
commit
b6b72e6bc3
9 files changed
+883
-687
No files matched your search
@@ -4,6 +4,7 @@
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:stat="clr-namespace:_29WxOrderWpf.Ctrls.Statistics"
|
||||
xmlns:vm="clr-namespace:_29WxOrderWpf.Ctrls.Statistics.ViewModels"
|
||||
d:Background="#F5F7FB"
|
||||
d:DataContext="{d:DesignInstance Type=vm:PeriodRevenueStatisticsViewModel}"
|
||||
@@ -13,11 +14,6 @@
|
||||
<UserControl.Resources>
|
||||
<BooleanToVisibilityConverter x:Key="boolToVisibilityConverter" />
|
||||
|
||||
<!-- 日期只允许从日历选择,禁止手工输入 -->
|
||||
<Style TargetType="DatePickerTextBox">
|
||||
<Setter Property="IsReadOnly" Value="True" />
|
||||
</Style>
|
||||
|
||||
<!-- 卡片样式(白底、圆角、阴影) -->
|
||||
<Style x:Key="CardBorderStyle" TargetType="Border">
|
||||
<Setter Property="Background" Value="White" />
|
||||
@@ -50,219 +46,160 @@
|
||||
</UserControl.Resources>
|
||||
|
||||
<Grid Background="#F5F7FB">
|
||||
<Grid Margin="12">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<ScrollViewer HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Auto">
|
||||
<StackPanel Margin="12">
|
||||
|
||||
<!-- ============ 查询条件工具栏 ============ -->
|
||||
<Border
|
||||
Grid.Row="0"
|
||||
Margin="6,6,6,0"
|
||||
Padding="14,10"
|
||||
Style="{StaticResource CardBorderStyle}">
|
||||
<WrapPanel>
|
||||
<TextBlock
|
||||
Margin="6,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="时间" />
|
||||
<ComboBox IsEditable="False"
|
||||
Width="110"
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="Text"
|
||||
ItemsSource="{Binding TimeRangeOptions}"
|
||||
SelectedItem="{Binding SelectedTimeRange, Mode=TwoWay}"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
<TextBlock
|
||||
Margin="14,0,6,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="日期" />
|
||||
<DatePicker
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectedDate="{Binding StartDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBlock
|
||||
Margin="6,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="~" />
|
||||
<DatePicker
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
SelectedDate="{Binding EndDate, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<TextBlock
|
||||
Margin="14,0,6,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="#666666"
|
||||
Text="店铺" />
|
||||
<ComboBox IsEditable="False"
|
||||
Width="130"
|
||||
Height="32"
|
||||
VerticalContentAlignment="Center"
|
||||
DisplayMemberPath="ShopName"
|
||||
ItemsSource="{Binding ShopOptions}"
|
||||
SelectedItem="{Binding SelectedShop, Mode=TwoWay}"
|
||||
Style="{StaticResource BaseComboBoxStyle}" />
|
||||
<Button
|
||||
Height="32"
|
||||
Margin="18,0,0,0"
|
||||
Padding="16,0"
|
||||
Command="{Binding QueryCommand}"
|
||||
Content=" 查询 "
|
||||
Style="{StaticResource BasePageButtonStyle}" />
|
||||
<Button
|
||||
Height="32"
|
||||
Margin="8,0,0,0"
|
||||
Padding="16,0"
|
||||
Command="{Binding ResetCommand}"
|
||||
Content=" 重置 "
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
<!-- ============ 查询条件工具栏(共享 UserControl) ============ -->
|
||||
<stat:RevenueStatisticsSearchBar />
|
||||
|
||||
<!-- ============ 周期×店铺统计表格 ============ -->
|
||||
<Border
|
||||
Grid.Row="1"
|
||||
Margin="6,8,6,12"
|
||||
Style="{StaticResource CardBorderStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<!-- ============ 汇总卡片(共享 UserControl) ============ -->
|
||||
<stat:RevenueSummaryCards />
|
||||
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,10"
|
||||
Style="{StaticResource PanelTitleStyle}"
|
||||
Text="{Binding PageTitle}" />
|
||||
<!-- ============ 周期统计表格 ============ -->
|
||||
<Border
|
||||
Margin="6,8,6,12"
|
||||
Style="{StaticResource CardBorderStyle}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
AlternatingRowBackground="#FAFAFA"
|
||||
AutoGenerateColumns="False"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
|
||||
FontSize="13"
|
||||
Foreground="#333333"
|
||||
GridLinesVisibility="Horizontal"
|
||||
HeadersVisibility="Column"
|
||||
HorizontalGridLinesBrush="#EEEEEE"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Statistics}"
|
||||
RowHeight="46"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||
SelectionMode="Single"
|
||||
SelectionUnit="FullRow">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="1.4*"
|
||||
Binding="{Binding Period}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource mainForegroundColorBrush}"
|
||||
Text="{Binding DataContext.PeriodColumnHeader, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding OrderCount, StringFormat={}{0:N0}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="订单数" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding SalesAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="销售额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding Profit, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="利润" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding RefundAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="退款金额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding CustomerCount, StringFormat={}{0:N0}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="客户数" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding AvgOrderAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="客单价" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,0,0,10"
|
||||
Style="{StaticResource PanelTitleStyle}"
|
||||
Text="{Binding PageTitle}" />
|
||||
|
||||
<!-- ============ 底部翻页 ============ -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0,10,0,0"
|
||||
Padding="0,4"
|
||||
Background="#F8F9FB"
|
||||
CornerRadius="6">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Foreground="#666666"
|
||||
Text="{Binding PagerText}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding FirstPageCommand}"
|
||||
Content="首页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding PrevPageCommand}"
|
||||
Content="上一页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding NextPageCommand}"
|
||||
Content="下一页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding LastPageCommand}"
|
||||
Content="末页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
<DataGrid
|
||||
Grid.Row="1"
|
||||
AlternatingRowBackground="#FAFAFA"
|
||||
AutoGenerateColumns="False"
|
||||
Background="Transparent"
|
||||
BorderThickness="0"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserReorderColumns="False"
|
||||
CanUserResizeRows="False"
|
||||
ColumnHeaderStyle="{StaticResource BaseDataGridColumnHeaderStyle}"
|
||||
FontSize="13"
|
||||
Foreground="#333333"
|
||||
GridLinesVisibility="Horizontal"
|
||||
HeadersVisibility="Column"
|
||||
HorizontalGridLinesBrush="#EEEEEE"
|
||||
IsReadOnly="True"
|
||||
ItemsSource="{Binding Statistics}"
|
||||
RowHeight="46"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
ScrollViewer.VerticalScrollBarVisibility="Disabled"
|
||||
SelectionMode="Single"
|
||||
SelectionUnit="FullRow">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn
|
||||
Width="1.4*"
|
||||
Binding="{Binding Period}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}">
|
||||
<DataGridTextColumn.Header>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
FontWeight="Bold"
|
||||
Foreground="{DynamicResource mainForegroundColorBrush}"
|
||||
Text="{Binding DataContext.PeriodColumnHeader, RelativeSource={RelativeSource AncestorType=DataGrid}}" />
|
||||
</DataGridTextColumn.Header>
|
||||
</DataGridTextColumn>
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding OrderCount, StringFormat={}{0:N0}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="订单数" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding SalesAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="销售额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding Profit, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="利润" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding RefundAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="退款金额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding PlatformFeeTotal, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="平台服务费总额" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding Commission, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="达人佣金" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding AverageProfitRate, StringFormat={}{0:0.00}%}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="平均利润率" />
|
||||
<DataGridTextColumn
|
||||
Width="*"
|
||||
Binding="{Binding AvgOrderAmount, StringFormat={}¥{0:N2}}"
|
||||
ElementStyle="{StaticResource CenterCellTextStyle}"
|
||||
Header="客单价" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- ============ 底部翻页 ============ -->
|
||||
<Border
|
||||
Grid.Row="2"
|
||||
Margin="0,10,0,0"
|
||||
Padding="0,4"
|
||||
Background="#F8F9FB"
|
||||
CornerRadius="6">
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Margin="0,0,12,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="13"
|
||||
Foreground="#666666"
|
||||
Text="{Binding PagerText}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding FirstPageCommand}"
|
||||
Content="首页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding PrevPageCommand}"
|
||||
Content="上一页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding NextPageCommand}"
|
||||
Content="下一页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
<Button
|
||||
Height="28"
|
||||
Margin="4,0,0,0"
|
||||
Padding="12,0"
|
||||
Command="{Binding LastPageCommand}"
|
||||
Content="末页"
|
||||
Style="{StaticResource BasePageButtonLightStyle}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
|
||||
<!-- ============ 加载遮罩 ============ -->
|
||||
<Border Background="#66FFFFFF" Visibility="{Binding IsLoading, Converter={StaticResource boolToVisibilityConverter}}" d:Visibility="Collapsed">
|
||||
|
||||
Reference in new issue
Block a user