更新
This commit is contained in:
@@ -21,64 +21,69 @@
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Grid.Row="0" Padding="20" CornerRadius="22" Background="{StaticResource HeroBrush}">
|
||||
<Border Grid.Row="0" Padding="14,12" CornerRadius="18" Background="{StaticResource HeroBrush}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding PageTitle}" FontSize="28" FontWeight="Bold" Foreground="White" TextWrapping="Wrap" />
|
||||
<TextBlock Margin="0,6,0,0" Foreground="#D9F6F9" FontSize="14" Text="检测、记录、追溯一体化工作台" TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
<WrapPanel Grid.Row="1" Margin="0,14,0,0">
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="当前阶段" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding CurrentStage}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="设备状态" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding DeviceStatus}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="实时告警" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding AlarmSummaryDisplay}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="合格率" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding ComplianceDisplay}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="合格项" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding QualifiedCount}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="12" Text="待处理" />
|
||||
<TextBlock Foreground="White" FontSize="16" FontWeight="Bold" Text="{Binding PendingCount}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
<StackPanel Grid.Row="2" Margin="0,10,0,0">
|
||||
<WrapPanel>
|
||||
<Button Command="{Binding ToggleAcquisitionCommand}" Content="采集" Background="#FFFFFFFF" Foreground="{StaticResource HeaderBrush}" />
|
||||
<Button Command="{Binding AcknowledgeAlarmCommand}" Content="消警" Background="#33FFFFFF" />
|
||||
<Button Command="{Binding CompleteDetectionCommand}" Content="完成检测" Background="#FFF0B145" />
|
||||
<Button Command="{Binding ExportReportCommand}" Content="导出 PDF" Background="#FFEA7E3C" />
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel VerticalAlignment="Center">
|
||||
<TextBlock Text="{Binding PageTitle}"
|
||||
FontSize="21"
|
||||
FontWeight="Bold"
|
||||
Foreground="White"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
<WrapPanel Margin="0,8,0,0">
|
||||
<Border Style="{StaticResource PillBorderStyle}" Padding="12,6" Margin="0,0,8,6">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="11" Text="阶段" />
|
||||
<TextBlock Foreground="White" FontSize="14" FontWeight="Bold" Text="{Binding CurrentStage}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}" Padding="12,6" Margin="0,0,8,6">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="11" Text="设备" />
|
||||
<TextBlock Foreground="White" FontSize="14" FontWeight="Bold" Text="{Binding DeviceStatus}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}" Padding="12,6" Margin="0,0,8,6">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="11" Text="告警" />
|
||||
<TextBlock Foreground="White" FontSize="14" FontWeight="Bold" Text="{Binding AlarmSummaryDisplay}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}" Padding="12,6" Margin="0,0,8,6">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="11" Text="待处理" />
|
||||
<TextBlock Foreground="White" FontSize="14" FontWeight="Bold" Text="{Binding PendingCount}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
<Border Style="{StaticResource PillBorderStyle}" Padding="12,6" Margin="0,0,0,6">
|
||||
<StackPanel>
|
||||
<TextBlock Foreground="#D9F6F9" FontSize="11" Text="合格率" />
|
||||
<TextBlock Foreground="White" FontSize="14" FontWeight="Bold" Text="{Binding ComplianceDisplay}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</WrapPanel>
|
||||
<TextBlock Margin="0,2,0,0" Foreground="#EFFAFC" FontSize="14" Text="{Binding ExportStateText}" TextWrapping="Wrap" />
|
||||
<TextBlock Margin="0,6,0,0" Foreground="#EFFAFC" FontSize="14" Text="{Binding LatestAction}" TextWrapping="Wrap" />
|
||||
<TextBlock Margin="0,4,0,0"
|
||||
Foreground="#EFFAFC"
|
||||
FontSize="12"
|
||||
Text="{Binding LatestAction}"
|
||||
TextTrimming="CharacterEllipsis" />
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="1" Margin="16,0,0,0" VerticalAlignment="Center">
|
||||
<WrapPanel HorizontalAlignment="Right">
|
||||
<Button MinWidth="92" MinHeight="36" Padding="12,7" Margin="0,0,8,8" Command="{Binding ToggleAcquisitionCommand}" Content="采集" Background="#FFFFFFFF" Foreground="{StaticResource HeaderBrush}" />
|
||||
<Button MinWidth="92" MinHeight="36" Padding="12,7" Margin="0,0,8,8" Command="{Binding AcknowledgeAlarmCommand}" Content="消警" Background="#33FFFFFF" />
|
||||
<Button MinWidth="108" MinHeight="36" Padding="12,7" Margin="0,0,8,8" Command="{Binding CompleteDetectionCommand}" Content="完成检测" Background="#FFF0B145" />
|
||||
<Button MinWidth="136" MinHeight="36" Padding="12,7" Margin="0,0,0,8" Command="{Binding ExportReportCommand}" Content="导出检查报告" Background="#FFEA7E3C" />
|
||||
</WrapPanel>
|
||||
<TextBlock HorizontalAlignment="Right"
|
||||
Foreground="#EFFAFC"
|
||||
FontSize="12"
|
||||
Text="{Binding ExportStateText}"
|
||||
TextWrapping="Wrap" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
@@ -262,7 +262,7 @@ public partial class MainViewModel : ObservableObject
|
||||
|
||||
public string ComplianceDisplay => $"{ComplianceRate:F0}%";
|
||||
public string DeltaPressureDisplay => HasChannelTelemetry("近端压力", "远端压力") ? $"{DeltaPressure:F1} mmHg" : "--";
|
||||
public string ExportStateText => DetectionCompleted ? "检测已完成,可导出 PDF 正式报表" : "检测进行中,完成后导出 PDF 正式报表";
|
||||
public string ExportStateText => DetectionCompleted ? "检测已完成,可导出检查报告" : "检测进行中,完成后可导出检查报告";
|
||||
public string SelectedItemTitle => SelectedItem?.Item ?? "未选择项目";
|
||||
public string SelectedItemStatusText => SelectedItem?.StatusText ?? "待检";
|
||||
public string RealtimeRecirculationDisplay => ChannelDisplay("再循环率", "F1", "%");
|
||||
@@ -804,7 +804,7 @@ public partial class MainViewModel : ObservableObject
|
||||
AcquisitionRunning = false;
|
||||
_timer.Stop();
|
||||
DeviceStatus = "采集停止";
|
||||
LatestAction = PendingCount == 0 ? "检测完成,全部项目已填写,可导出 PDF 报表。" : $"检测完成,但仍有 {PendingCount} 项待处理,请确认后导出 PDF 报表。";
|
||||
LatestAction = PendingCount == 0 ? "检测完成,全部项目已填写,可导出检查报告。" : $"检测完成,但仍有 {PendingCount} 项待处理,请确认后导出检查报告。";
|
||||
TraceEvents.Insert(0, NewTrace("检测完成", "检测员结束本次检测任务"));
|
||||
}
|
||||
|
||||
@@ -830,7 +830,7 @@ public partial class MainViewModel : ObservableObject
|
||||
var outputDirectory = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory);
|
||||
var timestamp = DateTime.Now.ToString("yyyyMMdd-HHmmss");
|
||||
var batchToken = string.IsNullOrWhiteSpace(BatchNumber) ? "未填写批号" : BatchNumber.Trim();
|
||||
var pdfPath = Path.Combine(outputDirectory, $"检测报表-{batchToken}-{timestamp}.pdf");
|
||||
var pdfPath = Path.Combine(outputDirectory, $"检查报告-{batchToken}-{timestamp}.pdf");
|
||||
|
||||
try
|
||||
{
|
||||
@@ -862,13 +862,13 @@ public partial class MainViewModel : ObservableObject
|
||||
recirculationLimitDisplay: RecirculationLimitDisplay);
|
||||
|
||||
document.GeneratePdf(pdfPath);
|
||||
LatestAction = $"已导出 PDF 正式报表: {pdfPath}";
|
||||
TraceEvents.Insert(0, NewTrace("报表导出", Path.GetFileName(pdfPath)));
|
||||
LatestAction = $"已导出检查报告: {pdfPath}";
|
||||
TraceEvents.Insert(0, NewTrace("检查报告导出", Path.GetFileName(pdfPath)));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
LatestAction = $"PDF 导出失败: {ex.Message}";
|
||||
TraceEvents.Insert(0, NewTrace("报表导出失败", ex.Message));
|
||||
LatestAction = $"检查报告导出失败: {ex.Message}";
|
||||
TraceEvents.Insert(0, NewTrace("检查报告导出失败", ex.Message));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user