111 lines
6.4 KiB
Plaintext
111 lines
6.4 KiB
Plaintext
|
|
<UserControl x:Class="SSPCTester.UI.Views.ReportView"
|
||
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
|
|
xmlns:vm="clr-namespace:SSPCTester.UI.ViewModels"
|
||
|
|
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
|
||
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||
|
|
mc:Ignorable="d"
|
||
|
|
d:DataContext="{d:DesignInstance Type=vm:ReportViewModel}">
|
||
|
|
<Grid Margin="20">
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
<RowDefinition Height="*" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
|
||
|
|
<Grid Margin="0,0,0,12">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
<ColumnDefinition Width="Auto" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<TextBlock Text="测试报告" FontSize="{StaticResource FsH1}" FontWeight="Bold" />
|
||
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||
|
|
<ComboBox Width="130"
|
||
|
|
Margin="0,0,8,0"
|
||
|
|
ItemsSource="{Binding FormatChoices}"
|
||
|
|
SelectedItem="{Binding SelectedFormatChoice}"
|
||
|
|
DisplayMemberPath="DisplayName" />
|
||
|
|
<ComboBox Width="300"
|
||
|
|
Margin="0,0,8,0"
|
||
|
|
ItemsSource="{Binding ReportFiles}"
|
||
|
|
SelectedItem="{Binding SelectedReportFile}"
|
||
|
|
DisplayMemberPath="DisplayName" />
|
||
|
|
<Button Content="刷新" Command="{Binding RefreshReportsCommand}" Margin="0,0,8,0" />
|
||
|
|
<Button Content="打开文件夹" Command="{Binding OpenFolderCommand}" Margin="0,0,8,0" />
|
||
|
|
<Button Style="{StaticResource PrimaryButton}" Content="生成报告" Command="{Binding GenerateCommand}">
|
||
|
|
<Button.ContentTemplate>
|
||
|
|
<DataTemplate>
|
||
|
|
<TextBlock Text="{Binding}" Foreground="{StaticResource TextInverseBrush}" />
|
||
|
|
</DataTemplate>
|
||
|
|
</Button.ContentTemplate>
|
||
|
|
</Button>
|
||
|
|
</StackPanel>
|
||
|
|
</Grid>
|
||
|
|
|
||
|
|
<Grid Grid.Row="1">
|
||
|
|
<Grid.ColumnDefinitions>
|
||
|
|
<ColumnDefinition Width="320" />
|
||
|
|
<ColumnDefinition Width="*" />
|
||
|
|
</Grid.ColumnDefinitions>
|
||
|
|
<Border Style="{StaticResource Card}" Margin="0,0,12,0">
|
||
|
|
<StackPanel>
|
||
|
|
<TextBlock Style="{StaticResource CardTitle}" Text="报告内容" />
|
||
|
|
<CheckBox Margin="0,4" Content="封面 + 综合判定" IsChecked="{Binding Project.Report.Cover}" />
|
||
|
|
<CheckBox Margin="0,4" Content="基础测试" IsChecked="{Binding Project.Report.Basic}" />
|
||
|
|
<CheckBox Margin="0,4" Content="开启与关断曲线" IsChecked="{Binding Project.Report.Curve}" />
|
||
|
|
<CheckBox Margin="0,4" Content="功率损耗" IsChecked="{Binding Project.Report.Power}" />
|
||
|
|
<CheckBox Margin="0,4" Content="保护功能" IsChecked="{Binding Project.Report.Protect}" />
|
||
|
|
|
||
|
|
<TextBlock Style="{StaticResource CardTitle}" Text="文件名" Margin="0,16,0,8" />
|
||
|
|
<TextBox Text="{Binding Project.Report.FileName, UpdateSourceTrigger=PropertyChanged}" FontFamily="{StaticResource FontMono}" />
|
||
|
|
<TextBlock Text="{Binding LastOutputPath, StringFormat='上次输出:{0}'}" Foreground="{StaticResource TextMutedBrush}" FontSize="{StaticResource FsSmall}" Margin="0,8,0,0" TextWrapping="Wrap" />
|
||
|
|
</StackPanel>
|
||
|
|
</Border>
|
||
|
|
|
||
|
|
<Border Style="{StaticResource Card}" Grid.Column="1">
|
||
|
|
<Grid>
|
||
|
|
<Grid.RowDefinitions>
|
||
|
|
<RowDefinition Height="*" />
|
||
|
|
<RowDefinition Height="Auto" />
|
||
|
|
</Grid.RowDefinitions>
|
||
|
|
<wv2:WebView2 Grid.Row="0"
|
||
|
|
x:Name="PdfPreview"
|
||
|
|
CoreWebView2InitializationCompleted="PdfPreview_CoreWebView2InitializationCompleted"
|
||
|
|
Visibility="{Binding HasPreview, Converter={StaticResource BoolToVis}}" />
|
||
|
|
<Border Grid.Row="0"
|
||
|
|
Background="{StaticResource BgSurfaceBrush}"
|
||
|
|
Visibility="{Binding HasPreview, Converter={StaticResource BoolToVis}, ConverterParameter=Invert}">
|
||
|
|
<TextBlock Text="{Binding PreviewMessage}"
|
||
|
|
HorizontalAlignment="Center"
|
||
|
|
VerticalAlignment="Center"
|
||
|
|
Foreground="{StaticResource TextMutedBrush}"
|
||
|
|
FontSize="{StaticResource FsBody}"
|
||
|
|
TextWrapping="Wrap"
|
||
|
|
TextAlignment="Center"
|
||
|
|
MaxWidth="360" />
|
||
|
|
</Border>
|
||
|
|
<Border Grid.Row="1"
|
||
|
|
Margin="0,12,0,0"
|
||
|
|
Padding="12"
|
||
|
|
BorderBrush="{StaticResource BorderBrush}"
|
||
|
|
BorderThickness="1"
|
||
|
|
Visibility="{Binding HasWordInfo, Converter={StaticResource BoolToVis}}">
|
||
|
|
<DockPanel LastChildFill="True">
|
||
|
|
<Button DockPanel.Dock="Right"
|
||
|
|
Content="打开文件"
|
||
|
|
Command="{Binding OpenSelectedFileCommand}"
|
||
|
|
Margin="12,0,0,0"
|
||
|
|
VerticalAlignment="Top" />
|
||
|
|
<TextBlock Text="{Binding WordInfoText}"
|
||
|
|
FontFamily="{StaticResource FontMono}"
|
||
|
|
FontSize="{StaticResource FsSmall}"
|
||
|
|
Foreground="{StaticResource TextSecondaryBrush}"
|
||
|
|
TextWrapping="Wrap" />
|
||
|
|
</DockPanel>
|
||
|
|
</Border>
|
||
|
|
</Grid>
|
||
|
|
</Border>
|
||
|
|
</Grid>
|
||
|
|
</Grid>
|
||
|
|
</UserControl>
|