<pu:WindowX x:Class="Plugin.DeviceConfig.VersionManageModal"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
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:pw="https://opensource.panuon.com/wpf"
|
xmlns:pu="https://opensource.panuon.com/wpf-ui"
|
xmlns:dp="clr-namespace:HMI.UI.DpUtil;assembly=HMI.UI"
|
xmlns:local="clr-namespace:Plugin.DeviceConfig"
|
mc:Ignorable="d"
|
Title="版本管理"
|
Height="520"
|
Width="800"
|
WindowStartupLocation="CenterOwner"
|
Style="{StaticResource ModalWindow}">
|
<pu:WindowX.Resources>
|
<ResourceDictionary>
|
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary Source="/HMI.UI;component/Style/PanuonListView.xaml"/>
|
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary>
|
</pu:WindowX.Resources>
|
|
<Grid Margin="16">
|
<Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="*"/>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
</Grid.RowDefinitions>
|
|
<!-- 操作按钮栏 -->
|
<StackPanel Grid.Row="0" Orientation="Horizontal" dp:StackPanelHelper.ChildSpace="10" Margin="0,0,0,8">
|
<Button x:Name="publishBtn" Click="PublishBtn_Click" Content="发布选中版本"
|
Style="{StaticResource AddBtn}" Width="110"/>
|
<Button x:Name="applyBtn" Click="ApplyBtn_Click" Content="应用选中版本"
|
Style="{StaticResource AddBtn}" Width="110"/>
|
<Button x:Name="detailBtn" Click="DetailBtn_Click" Content="版本详情"
|
Style="{StaticResource RfhBtn}" Width="90"/>
|
<Button x:Name="rfhBtn" Click="RfhBtn_Click" Content="刷新"
|
Style="{StaticResource RfhBtn}" Width="70"/>
|
</StackPanel>
|
|
<!-- 版本列表 -->
|
<ListView Grid.Row="1" Style="{StaticResource DefaultListTable}" x:Name="versionListView"
|
VirtualizingPanel.IsVirtualizing="True"
|
VirtualizingPanel.VirtualizationMode="Standard">
|
<ListView.View>
|
<GridView AllowsColumnReorder="False">
|
<GridViewColumn Width="50" Header="#">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<TextBlock Style="{StaticResource ListTableTextBlock}"
|
Text="{Binding Converter={StaticResource lvRowNumber},
|
RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ListViewItem,AncestorLevel=1}}"/>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Width="180" Header="VersionId">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<TextBlock Style="{StaticResource ListTableTextBlock}" Text="{Binding VersionId}"/>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Width="100" Header="Status">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<StackPanel Orientation="Horizontal">
|
<Border Width="10" Height="10" CornerRadius="5" Margin="0,0,6,0"
|
VerticalAlignment="Center">
|
<Border.Style>
|
<Style TargetType="Border">
|
<Setter Property="Background" Value="Gray"/>
|
<Style.Triggers>
|
<DataTrigger Binding="{Binding Status}" Value="Draft">
|
<Setter Property="Background" Value="Gray"/>
|
</DataTrigger>
|
<DataTrigger Binding="{Binding Status}" Value="Published">
|
<Setter Property="Background" Value="#2196F3"/>
|
</DataTrigger>
|
<DataTrigger Binding="{Binding Status}" Value="Effective">
|
<Setter Property="Background" Value="#4CAF50"/>
|
</DataTrigger>
|
</Style.Triggers>
|
</Style>
|
</Border.Style>
|
</Border>
|
<TextBlock Style="{StaticResource ListTableTextBlock}" Text="{Binding Status}" VerticalAlignment="Center"/>
|
</StackPanel>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Width="200" Header="Hash">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<TextBlock Style="{StaticResource ListTableTextBlock}"
|
Text="{Binding HashShort}"
|
ToolTip="{Binding Hash}"/>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Width="100" Header="Author">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<TextBlock Style="{StaticResource ListTableTextBlock}" Text="{Binding Author}"/>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
<GridViewColumn Width="160" Header="Timestamp">
|
<GridViewColumn.CellTemplate>
|
<DataTemplate>
|
<Border Style="{StaticResource CellBorder}">
|
<TextBlock Style="{StaticResource ListTableTextBlock}"
|
Text="{Binding Timestamp, StringFormat=yyyy-MM-dd HH:mm:ss}"/>
|
</Border>
|
</DataTemplate>
|
</GridViewColumn.CellTemplate>
|
</GridViewColumn>
|
</GridView>
|
</ListView.View>
|
</ListView>
|
|
<!-- 版本详情区 -->
|
<Border Grid.Row="2" BorderBrush="{DynamicResource BorderBrush}" BorderThickness="1" CornerRadius="4"
|
Margin="0,8,0,0" Padding="10" x:Name="detailPanel" Visibility="Collapsed">
|
<Grid>
|
<Grid.ColumnDefinitions>
|
<ColumnDefinition Width="80"/>
|
<ColumnDefinition Width="*"/>
|
</Grid.ColumnDefinitions>
|
<Grid.RowDefinitions>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
</Grid.RowDefinitions>
|
|
<TextBlock Grid.Row="0" Grid.Column="0" Text="完整Hash:" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
<TextBlock Grid.Row="0" Grid.Column="1" x:Name="tbDetailHash" TextWrapping="Wrap"
|
FontFamily="Consolas" Margin="4,2"/>
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Text="差异描述:" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
<TextBlock Grid.Row="1" Grid.Column="1" x:Name="tbDetailDiff" TextWrapping="Wrap" Margin="4,2"/>
|
|
<TextBlock Grid.Row="2" Grid.Column="0" Text="作者:" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
<TextBlock Grid.Row="2" Grid.Column="1" x:Name="tbDetailAuthor" Margin="4,2"/>
|
</Grid>
|
</Border>
|
|
<!-- 底部按钮 -->
|
<StackPanel Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,12,0,0">
|
<Button x:Name="closeBtn" Click="CloseBtn_Click" Content="关闭"
|
Style="{StaticResource RfhBtn}" Width="90"/>
|
</StackPanel>
|
</Grid>
|
</pu:WindowX>
|