|
|
<Application xmlns="https://github.com/avaloniaui"
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
x:Class="AI.App"
|
|
|
xmlns:local="using:AI"
|
|
|
xmlns:md="clr-namespace:LiveMarkdown.Avalonia;assembly=LiveMarkdown.Avalonia"
|
|
|
xmlns:converters="clr-namespace:AI.Converters;assembly=AI"
|
|
|
xmlns:viewmodels="using:AI.ViewModels"
|
|
|
RequestedThemeVariant="Light">
|
|
|
<!-- "Default" ThemeVariant follows system theme variant. "Dark" or "Light" are other available options. -->
|
|
|
|
|
|
<Application.Resources>
|
|
|
<ResourceDictionary>
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
|
<ResourceInclude Source="avares://LiveMarkdown.Avalonia/Defaults.axaml"/>
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
|
|
<converters:AuthorToColorConverter x:Key="AuthorToColorConverter"/>
|
|
|
<converters:FileSizeConverter x:Key="FileSizeConverter"/>
|
|
|
<converters:WorkflowStatusToIconConverter x:Key="StatusToIconConverter"/>
|
|
|
<converters:WorkflowStatusToColorConverter x:Key="StatusToColorConverter"/>
|
|
|
<converters:StringToBoolConverter x:Key="StringToBoolConverter"/>
|
|
|
<converters:StatusToCompletedConverter x:Key="StatusToCompletedConverter"/>
|
|
|
<converters:FormBoolConverter x:Key="FormBoolConverter"/>
|
|
|
<converters:FormNumberConverter x:Key="FormNumberConverter"/>
|
|
|
<converters:FormNullableDoubleConverter x:Key="FormNullableDoubleConverter"/>
|
|
|
<converters:FormFieldTypeVisibilityConverter x:Key="FormFieldTypeVisibilityConverter"/>
|
|
|
<converters:ParameterSetFieldTypeVisibilityConverter x:Key="ParameterSetFieldTypeVisibilityConverter"/>
|
|
|
|
|
|
<!-- 表单字段:仅 Boolean,避免与 Choice 同屏时 TwoWay 把列名 "0" 写成 "False" -->
|
|
|
<DataTemplate x:Key="FormFieldBooleanTemplate">
|
|
|
<StackPanel Margin="0,4">
|
|
|
<StackPanel>
|
|
|
<TextBlock Text="{Binding Label}"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,2"/>
|
|
|
<TextBlock Text="{Binding Description}"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,0,0,2"
|
|
|
IsVisible="{Binding Description, Converter={StaticResource StringToBoolConverter}}"/>
|
|
|
</StackPanel>
|
|
|
<CheckBox IsChecked="{Binding CurrentValue, Converter={StaticResource FormBoolConverter}}"
|
|
|
Content=""
|
|
|
MinHeight="28"/>
|
|
|
</StackPanel>
|
|
|
</DataTemplate>
|
|
|
<!-- 表单字段:仅 Choice(列头匹配等) -->
|
|
|
<DataTemplate x:Key="FormFieldChoiceTemplate">
|
|
|
<Grid Margin="0,4">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="Auto" MinWidth="60"/>
|
|
|
<ColumnDefinition Width="*" MinWidth="100"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBlock Grid.Column="0"
|
|
|
Text="{Binding Label}"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
VerticalAlignment="Center"
|
|
|
Margin="0,0,8,0"/>
|
|
|
<ComboBox Grid.Column="1"
|
|
|
ItemsSource="{Binding Options}"
|
|
|
SelectedItem="{Binding CurrentValue}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"/>
|
|
|
</Grid>
|
|
|
</DataTemplate>
|
|
|
<!-- 表单字段:其余类型(Text / MultiLine / Json / FilePath / Number / MultiSelect) -->
|
|
|
<DataTemplate x:Key="FormFieldDefaultTemplate">
|
|
|
<StackPanel Margin="0,4">
|
|
|
<StackPanel>
|
|
|
<TextBlock Text="{Binding Label}"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,2"/>
|
|
|
<TextBlock Text="{Binding Description}"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,0,0,2"
|
|
|
IsVisible="{Binding Description, Converter={StaticResource StringToBoolConverter}}"/>
|
|
|
</StackPanel>
|
|
|
<TextBox Text="{Binding CurrentValue}"
|
|
|
Watermark="{Binding Placeholder}"
|
|
|
MaxLength="{Binding MaxLength}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=Text}"/>
|
|
|
<TextBox Text="{Binding CurrentValue}"
|
|
|
Watermark="{Binding Placeholder}"
|
|
|
MaxLength="{Binding MaxLength}"
|
|
|
MinHeight="28"
|
|
|
AcceptsReturn="True"
|
|
|
TextWrapping="Wrap"
|
|
|
MinLines="2"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=MultiLine}"/>
|
|
|
<TextBox Text="{Binding CurrentValue}"
|
|
|
Watermark=""
|
|
|
MinHeight="28"
|
|
|
AcceptsReturn="True"
|
|
|
TextWrapping="Wrap"
|
|
|
MinLines="2"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=Json}"/>
|
|
|
<Grid IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=FilePath}">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBox Grid.Column="0" Text="{Binding CurrentValue}"
|
|
|
Watermark="{Binding Placeholder}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,6,0"/>
|
|
|
<Button Grid.Column="1"
|
|
|
Content="选择文件"
|
|
|
MinHeight="28"
|
|
|
Padding="8,4"
|
|
|
Command="{Binding $parent[Window].DataContext.PickFileForFieldCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</Grid>
|
|
|
<NumericUpDown Value="{Binding CurrentValue, Converter={StaticResource FormNumberConverter}}"
|
|
|
Minimum="{Binding Min, Converter={StaticResource FormNullableDoubleConverter}, ConverterParameter=min}"
|
|
|
Maximum="{Binding Max, Converter={StaticResource FormNullableDoubleConverter}, ConverterParameter=max}"
|
|
|
Increment="{Binding Step, Converter={StaticResource FormNullableDoubleConverter}, ConverterParameter=step}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=Number}"/>
|
|
|
<ItemsControl ItemsSource="{Binding MultiSelectOptions}"
|
|
|
IsVisible="{Binding Type, Converter={StaticResource FormFieldTypeVisibilityConverter}, ConverterParameter=MultiSelect}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<CheckBox Content="{Binding Option}"
|
|
|
IsChecked="{Binding IsSelected}"
|
|
|
Margin="0,2"/>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
</DataTemplate>
|
|
|
<converters:FormFieldTemplateSelector x:Key="FormFieldTemplateSelector"
|
|
|
BooleanTemplate="{StaticResource FormFieldBooleanTemplate}"
|
|
|
ChoiceTemplate="{StaticResource FormFieldChoiceTemplate}"
|
|
|
DefaultTemplate="{StaticResource FormFieldDefaultTemplate}"/>
|
|
|
|
|
|
<!-- 文本消息模板 -->
|
|
|
<DataTemplate x:Key="TextMessageTemplate">
|
|
|
<Border Background="{Binding Author, Converter={StaticResource AuthorToColorConverter}}"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="12,8">
|
|
|
<md:MarkdownRenderer MarkdownBuilder="{Binding MarkdownBuilder}"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 文件消息模板 -->
|
|
|
<DataTemplate x:Key="FileMessageTemplate">
|
|
|
<Border Background="Transparent"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="12,8"
|
|
|
HorizontalAlignment="Left"
|
|
|
MaxWidth="500">
|
|
|
<Border Background="White"
|
|
|
BorderBrush="#E1E3EA"
|
|
|
BorderThickness="1"
|
|
|
CornerRadius="8"
|
|
|
Padding="8,4">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto" />
|
|
|
<RowDefinition Height="Auto" />
|
|
|
</Grid.RowDefinitions>
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="Auto" />
|
|
|
<ColumnDefinition Width="*" />
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<!-- 文件图标 -->
|
|
|
<Viewbox Grid.Row="0" Grid.Column="0"
|
|
|
Grid.RowSpan="2"
|
|
|
Width="16" Height="16"
|
|
|
VerticalAlignment="Center"
|
|
|
Margin="0,0,8,0">
|
|
|
<Path Fill="#666666"
|
|
|
Data="M886.7 247.6L713.4 73.4c-6-6-14.2-9.4-22.7-9.4H192c-35.3 0-64 28.7-64 64v768c0 35.3 28.7 64 64 64h640c35.3 0 64-28.7 64-64V270.2c0-8.5-3.3-16.6-9.3-22.6zM832 864c0 17.7-14.3 32-32 32H224c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h384v160c0 35.3 28.7 64 64 64h160v512zM704 288c-17.7 0-32-14.3-32-32V128l160 160H704z M671 672H287c-17.7 0-32 14.3-32 32s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32zM287 480c-17.7 0-32 14.3-32 32s14.3 32 32 32h384c17.7 0 32-14.3 32-32s-14.3-32-32-32H287zM287 352h192c17.7 0 32-14.3 32-32s-14.3-32-32-32H287c-17.7 0-32 14.3-32 32s14.3 32 32 32z" />
|
|
|
</Viewbox>
|
|
|
|
|
|
<!-- 文件信息 -->
|
|
|
<TextBlock Grid.Row="0" Grid.Column="1"
|
|
|
Text="{Binding FileName}"
|
|
|
VerticalAlignment="Center"
|
|
|
FontSize="12"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,16,0"
|
|
|
TextTrimming="CharacterEllipsis"/>
|
|
|
|
|
|
<TextBlock Grid.Row="1" Grid.Column="1"
|
|
|
Text="{Binding FileSize, Converter={StaticResource FileSizeConverter}, Mode=OneTime}"
|
|
|
VerticalAlignment="Center"
|
|
|
FontSize="10"
|
|
|
Foreground="#666666"
|
|
|
Margin="0,0,16,0"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 工作流状态消息模板 -->
|
|
|
<DataTemplate x:Key="WorkflowStatusTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto" />
|
|
|
<RowDefinition Height="Auto" />
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
<TextBlock Grid.Row="0"
|
|
|
Text="{Binding SpecialContent.Title}"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,8"/>
|
|
|
|
|
|
<!-- 步骤列表 -->
|
|
|
<ItemsControl Grid.Row="1"
|
|
|
ItemsSource="{Binding SpecialContent.Steps}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Grid Margin="0,4">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="25"/>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
|
<!-- 状态图标 -->
|
|
|
<Grid Grid.Column="0"
|
|
|
VerticalAlignment="Center"
|
|
|
HorizontalAlignment="Center"
|
|
|
Width="20"
|
|
|
Height="20">
|
|
|
<!-- 圆圈背景 -->
|
|
|
<TextBlock Text="○"
|
|
|
FontSize="14"
|
|
|
VerticalAlignment="Center"
|
|
|
HorizontalAlignment="Center"
|
|
|
Foreground="{Binding Status, Converter={StaticResource StatusToColorConverter}}"/>
|
|
|
<!-- 已完成时显示勾 -->
|
|
|
<TextBlock Text="✓"
|
|
|
FontSize="12"
|
|
|
FontWeight="Bold"
|
|
|
VerticalAlignment="Center"
|
|
|
HorizontalAlignment="Center"
|
|
|
Foreground="{Binding Status, Converter={StaticResource StatusToColorConverter}}"
|
|
|
IsVisible="{Binding Status, Converter={StaticResource StatusToCompletedConverter}}"/>
|
|
|
</Grid>
|
|
|
|
|
|
<!-- 步骤名称 -->
|
|
|
<TextBlock Grid.Column="1"
|
|
|
Text="{Binding DisplayName}"
|
|
|
FontSize="13"
|
|
|
VerticalAlignment="Center"
|
|
|
Foreground="{Binding Status, Converter={StaticResource StatusToColorConverter}}"/>
|
|
|
|
|
|
<!-- 重新执行按钮 - 已移除,使用新的 Workflow1 系统 -->
|
|
|
<!--
|
|
|
<Button Grid.Column="2"
|
|
|
Content="重新执行"
|
|
|
IsVisible="{Binding CanReset}"
|
|
|
FontSize="11"
|
|
|
Padding="6,3"
|
|
|
Background="#FF9800"
|
|
|
Foreground="White"
|
|
|
CornerRadius="4"
|
|
|
BorderThickness="0"
|
|
|
Command="{Binding $parent[Window].DataContext.ResetWorkflowStepCommand}"
|
|
|
CommandParameter="{Binding Id}"/>
|
|
|
-->
|
|
|
</Grid>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 表单消息模板 -->
|
|
|
<DataTemplate x:Key="FormMessageTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MinWidth="280"
|
|
|
MaxWidth="420">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<TextBlock Grid.Row="0"
|
|
|
Text="{Binding SpecialContent.Definition.Title}"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,10"/>
|
|
|
|
|
|
<ItemsControl Grid.Row="1"
|
|
|
ItemsSource="{Binding SpecialContent.FieldsWithValues}"
|
|
|
ItemTemplate="{StaticResource FormFieldTemplateSelector}"
|
|
|
Margin="0,0,0,10"/>
|
|
|
|
|
|
<Button Grid.Row="2"
|
|
|
Content="{Binding SpecialContent.SubmitLabel}"
|
|
|
Background="#007AFF"
|
|
|
Foreground="White"
|
|
|
CornerRadius="8"
|
|
|
Padding="16,8"
|
|
|
HorizontalAlignment="Right"
|
|
|
Command="{Binding $parent[Window].DataContext.SubmitFormCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 表格数据预览消息模板 -->
|
|
|
<DataTemplate x:Key="TableMessageTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MaxWidth="700">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<TextBlock Grid.Row="0"
|
|
|
Text="{Binding SpecialContent.Title}"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,8"/>
|
|
|
|
|
|
<ScrollViewer Grid.Row="1"
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
MaxHeight="280">
|
|
|
<StackPanel>
|
|
|
<!-- 表头 -->
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.ColumnNames}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="#E1E3EA"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1,1,1,2"
|
|
|
Padding="8,6"
|
|
|
MinWidth="80">
|
|
|
<TextBlock Text="{Binding}"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
TextTrimming="CharacterEllipsis"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
<!-- 数据行 -->
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.Rows}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<ItemsControl ItemsSource="{Binding Cells}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="White"
|
|
|
BorderBrush="#E1E3EA"
|
|
|
BorderThickness="1"
|
|
|
Padding="8,6"
|
|
|
MinWidth="80">
|
|
|
<TextBlock Text="{Binding}"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
TextTrimming="CharacterEllipsis"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
</ScrollViewer>
|
|
|
|
|
|
<TextBlock Grid.Row="2"
|
|
|
Text="{Binding SpecialContent.SummaryText}"
|
|
|
IsVisible="{Binding SpecialContent.HasMoreRows}"
|
|
|
Margin="0,6,0,0"
|
|
|
FontSize="11"
|
|
|
Foreground="#666666"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 必需列与预览列匹配消息模板 -->
|
|
|
<DataTemplate x:Key="ColumnMatchMessageTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MaxWidth="600">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
<TextBlock Grid.Row="0"
|
|
|
Text="{Binding SpecialContent.Title}"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,10"/>
|
|
|
|
|
|
<StackPanel Grid.Row="1" Margin="0,0,0,8">
|
|
|
<TextBlock Text="必需列"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,4"/>
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.RequiredColumns}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<WrapPanel/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="#E1E3EA"
|
|
|
CornerRadius="4"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,4,4">
|
|
|
<TextBlock Text="{Binding}" FontSize="12" Foreground="#333333"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
|
|
|
<StackPanel Grid.Row="2" Margin="0,0,0,8">
|
|
|
<TextBlock Text="预览列"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,4"/>
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.PreviewColumns}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<WrapPanel/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="#E8F0E8"
|
|
|
CornerRadius="4"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,4,4">
|
|
|
<TextBlock Text="{Binding}" FontSize="12" Foreground="#333333"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
|
|
|
<StackPanel Grid.Row="3">
|
|
|
<TextBlock Text="匹配关系"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,4"/>
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.Mappings}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Grid Margin="0,2">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBlock Grid.Column="0" Text="{Binding RequiredColumn}"
|
|
|
FontSize="12" Foreground="#333333" VerticalAlignment="Center"/>
|
|
|
<TextBlock Grid.Column="1" Text="→"
|
|
|
FontSize="12" Foreground="#666666" Margin="8,0" VerticalAlignment="Center"/>
|
|
|
<TextBlock Grid.Column="2" Text="{Binding MatchedColumn}"
|
|
|
FontSize="12" Foreground="#333333" VerticalAlignment="Center"/>
|
|
|
</Grid>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 参数集特殊消息模板(名称/值可编辑:成图算法 ComboBox、文件选择按钮、数字 NumericUpDown、文本 TextBox) -->
|
|
|
<DataTemplate x:Key="ParameterSetMessageTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MaxWidth="560">
|
|
|
<Grid>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
<TextBlock Grid.Row="0"
|
|
|
Text="{Binding SpecialContent.Title}"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,10"/>
|
|
|
<ScrollViewer Grid.Row="1"
|
|
|
MaxHeight="320"
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.Items}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="White"
|
|
|
BorderBrush="#E1E3EA"
|
|
|
BorderThickness="0,0,0,1"
|
|
|
Padding="8,6"
|
|
|
Margin="0,0,0,2">
|
|
|
<Grid>
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="Auto" MinWidth="100"/>
|
|
|
<ColumnDefinition Width="*" MinWidth="80"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
|
Text="{Binding Name}"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#555555"
|
|
|
VerticalAlignment="Center"/>
|
|
|
<!-- 文本 -->
|
|
|
<TextBox Grid.Row="0" Grid.Column="1"
|
|
|
Text="{Binding ValueText}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Text}"/>
|
|
|
<!-- 数字 -->
|
|
|
<NumericUpDown Grid.Row="0" Grid.Column="1"
|
|
|
Value="{Binding NumericValue}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Number}"/>
|
|
|
<!-- 成图算法等下拉 -->
|
|
|
<ComboBox Grid.Row="0" Grid.Column="1"
|
|
|
ItemsSource="{Binding Options}"
|
|
|
SelectedItem="{Binding ValueText}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Choice}"/>
|
|
|
<!-- 文件选择:文本框 + 右侧按钮 -->
|
|
|
<Grid Grid.Row="0" Grid.Column="1"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=FilePath}">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBox Grid.Column="0"
|
|
|
Text="{Binding ValueText}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,6,0"/>
|
|
|
<Button Grid.Column="1"
|
|
|
Content="选择"
|
|
|
MinHeight="28"
|
|
|
Padding="8,4"
|
|
|
Command="{Binding $parent[Window].DataContext.PickFileForParameterItemCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</Grid>
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
Text="{Binding Description}"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,2,0,0"
|
|
|
IsVisible="{Binding Description, Converter={StaticResource StringToBoolConverter}}"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</ScrollViewer>
|
|
|
<Button Grid.Row="2"
|
|
|
Content="应用参数"
|
|
|
HorizontalAlignment="Right"
|
|
|
Margin="0,8,0,0"
|
|
|
Padding="12,6"
|
|
|
Command="{Binding $parent[Window].DataContext.ApplyParameterSetCommand}"
|
|
|
CommandParameter="{Binding SpecialContent}"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 散点文件加载综合卡片(打开文件 + 数据预览 + 列头匹配,全程由卡片驱动,无需 AI 参与中间步骤) -->
|
|
|
<DataTemplate x:Key="XyzLoadCardTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MinWidth="300"
|
|
|
MaxWidth="700">
|
|
|
<StackPanel>
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
<TextBlock Text="加载散点文件"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,12"/>
|
|
|
|
|
|
<!-- ── 第一步:选择文件 ── -->
|
|
|
<TextBlock Text="文件路径"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
Margin="0,0,0,4"/>
|
|
|
<Grid>
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBox Grid.Column="0"
|
|
|
Text="{Binding SpecialContent.FilePath}"
|
|
|
IsEnabled="{Binding SpecialContent.IsFileInputEnabled}"
|
|
|
Watermark="请选择或输入 .xyz / .csv 文件路径..."
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,6,0"/>
|
|
|
<!-- 选择文件按钮(提交或加载中时隐藏) -->
|
|
|
<Button Grid.Column="1"
|
|
|
Content="选择文件"
|
|
|
IsVisible="{Binding SpecialContent.ShowLoadButtons}"
|
|
|
MinHeight="28"
|
|
|
Padding="8,4"
|
|
|
Margin="0,0,6,0"
|
|
|
Command="{Binding $parent[Window].DataContext.PickFileForXyzLoadCardCommand}"
|
|
|
CommandParameter="{Binding SpecialContent}"/>
|
|
|
<!-- 加载按钮(提交或加载中时隐藏) -->
|
|
|
<Button Grid.Column="2"
|
|
|
Content="加载"
|
|
|
IsVisible="{Binding SpecialContent.ShowLoadButtons}"
|
|
|
Background="#007AFF"
|
|
|
Foreground="White"
|
|
|
CornerRadius="8"
|
|
|
MinHeight="28"
|
|
|
Padding="8,4"
|
|
|
Command="{Binding $parent[Window].DataContext.SubmitXyzLoadCardCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</Grid>
|
|
|
|
|
|
<!-- 正在加载提示 -->
|
|
|
<TextBlock Text="⏳ 正在加载文件并读取列信息,请稍候..."
|
|
|
IsVisible="{Binding SpecialContent.IsLoading}"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,6,0,0"/>
|
|
|
|
|
|
<!-- 错误提示(红色) -->
|
|
|
<TextBlock Text="{Binding SpecialContent.StatusMessage}"
|
|
|
IsVisible="{Binding SpecialContent.HasStatusMessage}"
|
|
|
FontSize="11"
|
|
|
Foreground="#D32F2F"
|
|
|
Margin="0,4,0,0"
|
|
|
TextWrapping="Wrap"/>
|
|
|
|
|
|
<!-- 已加载标记(提交后显示,加载中时不显示) -->
|
|
|
<TextBlock Text="✓ 文件已加载"
|
|
|
IsVisible="{Binding SpecialContent.HasSubmittedFile}"
|
|
|
FontSize="11"
|
|
|
Foreground="#34A853"
|
|
|
Margin="0,4,0,0"/>
|
|
|
|
|
|
<!-- ── 分隔线(数据预览区可见时) ── -->
|
|
|
<Border IsVisible="{Binding SpecialContent.ShowPreviewSection}"
|
|
|
Height="1"
|
|
|
Background="#D0D4D8"
|
|
|
Margin="0,12,0,10"/>
|
|
|
|
|
|
<!-- ── 第二步:数据预览 ── -->
|
|
|
<StackPanel IsVisible="{Binding SpecialContent.ShowPreviewSection}">
|
|
|
<TextBlock Text="{Binding SpecialContent.TablePreview.Title}"
|
|
|
FontSize="13"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,8"/>
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Auto"
|
|
|
VerticalScrollBarVisibility="Auto"
|
|
|
MaxHeight="240">
|
|
|
<StackPanel>
|
|
|
<!-- 表头 -->
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.TablePreview.ColumnNames}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="#E1E3EA"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1,1,1,2"
|
|
|
Padding="8,6"
|
|
|
MinWidth="80">
|
|
|
<TextBlock Text="{Binding}"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
TextTrimming="CharacterEllipsis"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
<!-- 数据行 -->
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.TablePreview.Rows}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<ItemsControl ItemsSource="{Binding Cells}">
|
|
|
<ItemsControl.ItemsPanel>
|
|
|
<ItemsPanelTemplate>
|
|
|
<StackPanel Orientation="Horizontal"/>
|
|
|
</ItemsPanelTemplate>
|
|
|
</ItemsControl.ItemsPanel>
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="White"
|
|
|
BorderBrush="#E1E3EA"
|
|
|
BorderThickness="1"
|
|
|
Padding="8,6"
|
|
|
MinWidth="80">
|
|
|
<TextBlock Text="{Binding}"
|
|
|
FontSize="12"
|
|
|
Foreground="#555555"
|
|
|
TextTrimming="CharacterEllipsis"/>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</StackPanel>
|
|
|
</ScrollViewer>
|
|
|
<TextBlock Text="{Binding SpecialContent.TablePreview.SummaryText}"
|
|
|
IsVisible="{Binding SpecialContent.TablePreview.HasMoreRows, FallbackValue=False}"
|
|
|
Margin="0,4,0,0"
|
|
|
FontSize="11"
|
|
|
Foreground="#666666"/>
|
|
|
</StackPanel>
|
|
|
|
|
|
<!-- ── 分隔线(列头匹配区可见时) ── -->
|
|
|
<Border IsVisible="{Binding SpecialContent.ShowMatchSection}"
|
|
|
Height="1"
|
|
|
Background="#D0D4D8"
|
|
|
Margin="0,12,0,10"/>
|
|
|
|
|
|
<!-- ── 第三步:列头匹配 ── -->
|
|
|
<StackPanel IsVisible="{Binding SpecialContent.ShowMatchSection}">
|
|
|
<TextBlock Text="列头匹配"
|
|
|
FontSize="13"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,4"/>
|
|
|
<TextBlock Text="请为每个必需列选择对应的文件列"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,0,0,8"/>
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.ColumnMatchFields}"
|
|
|
ItemTemplate="{StaticResource FormFieldChoiceTemplate}"
|
|
|
Margin="0,0,0,10"/>
|
|
|
<Button Content="{Binding SpecialContent.MatchButtonLabel}"
|
|
|
IsVisible="{Binding SpecialContent.ShowMatchButton}"
|
|
|
Background="#007AFF"
|
|
|
Foreground="White"
|
|
|
CornerRadius="8"
|
|
|
Padding="16,8"
|
|
|
HorizontalAlignment="Right"
|
|
|
Command="{Binding $parent[Window].DataContext.ConfirmXyzColumnMatchCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</StackPanel>
|
|
|
|
|
|
</StackPanel>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 网格化参数设置综合卡片(参数加载+编辑+生成按钮,全程自治,无需 AI 参与中间步骤) -->
|
|
|
<DataTemplate x:Key="GriddingParamCardTemplate">
|
|
|
<Border Background="#F0F4F8"
|
|
|
CornerRadius="12"
|
|
|
Margin="5"
|
|
|
Padding="15,12"
|
|
|
BorderBrush="#D0D4D8"
|
|
|
BorderThickness="1"
|
|
|
HorizontalAlignment="Left"
|
|
|
MinWidth="300"
|
|
|
MaxWidth="560">
|
|
|
<StackPanel>
|
|
|
|
|
|
<!-- 标题 -->
|
|
|
<TextBlock Text="网格化参数设置"
|
|
|
FontSize="14"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#333333"
|
|
|
Margin="0,0,0,12"/>
|
|
|
|
|
|
<!-- 加载中占位 -->
|
|
|
<TextBlock Text="⏳ 正在加载参数,请稍候..."
|
|
|
IsVisible="{Binding SpecialContent.IsLoading}"
|
|
|
FontSize="12"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,0,0,8"/>
|
|
|
|
|
|
<!-- 生成中提示 -->
|
|
|
<TextBlock Text="⏳ 正在执行成图,请稍候..."
|
|
|
IsVisible="{Binding SpecialContent.IsGenerating}"
|
|
|
FontSize="12"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,0,0,8"/>
|
|
|
|
|
|
<!-- 参数列表 -->
|
|
|
<ScrollViewer IsVisible="{Binding SpecialContent.ShowItems}"
|
|
|
MaxHeight="320"
|
|
|
HorizontalScrollBarVisibility="Auto"
|
|
|
VerticalScrollBarVisibility="Auto">
|
|
|
<ItemsControl ItemsSource="{Binding SpecialContent.Items}">
|
|
|
<ItemsControl.ItemTemplate>
|
|
|
<DataTemplate>
|
|
|
<Border Background="White"
|
|
|
BorderBrush="#E1E3EA"
|
|
|
BorderThickness="0,0,0,1"
|
|
|
Padding="8,6"
|
|
|
Margin="0,0,0,2">
|
|
|
<Grid>
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="Auto" MinWidth="100"/>
|
|
|
<ColumnDefinition Width="*" MinWidth="80"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
</Grid.RowDefinitions>
|
|
|
<TextBlock Grid.Row="0" Grid.Column="0"
|
|
|
Text="{Binding Name}"
|
|
|
FontSize="12"
|
|
|
FontWeight="SemiBold"
|
|
|
Foreground="#555555"
|
|
|
VerticalAlignment="Center"/>
|
|
|
<!-- 文本 -->
|
|
|
<TextBox Grid.Row="0" Grid.Column="1"
|
|
|
Text="{Binding ValueText}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Text}"/>
|
|
|
<!-- 数字 -->
|
|
|
<NumericUpDown Grid.Row="0" Grid.Column="1"
|
|
|
Value="{Binding NumericValue}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Number}"/>
|
|
|
<!-- 下拉选择 -->
|
|
|
<ComboBox Grid.Row="0" Grid.Column="1"
|
|
|
ItemsSource="{Binding Options}"
|
|
|
SelectedItem="{Binding ValueText}"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=Choice}"/>
|
|
|
<!-- 文件选择 -->
|
|
|
<Grid Grid.Row="0" Grid.Column="1"
|
|
|
IsVisible="{Binding FieldType, Converter={StaticResource ParameterSetFieldTypeVisibilityConverter}, ConverterParameter=FilePath}">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
<ColumnDefinition Width="Auto"/>
|
|
|
</Grid.ColumnDefinitions>
|
|
|
<TextBox Grid.Column="0"
|
|
|
Text="{Binding ValueText}"
|
|
|
FontSize="12"
|
|
|
MinHeight="28"
|
|
|
Padding="6,4"
|
|
|
Margin="0,0,6,0"/>
|
|
|
<Button Grid.Column="1"
|
|
|
Content="选择"
|
|
|
MinHeight="28"
|
|
|
Padding="8,4"
|
|
|
Command="{Binding $parent[Window].DataContext.PickFileForParameterItemCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
</Grid>
|
|
|
<TextBlock Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2"
|
|
|
Text="{Binding Description}"
|
|
|
FontSize="11"
|
|
|
Foreground="#888888"
|
|
|
Margin="0,2,0,0"
|
|
|
IsVisible="{Binding Description, Converter={StaticResource StringToBoolConverter}}"/>
|
|
|
</Grid>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
</ItemsControl.ItemTemplate>
|
|
|
</ItemsControl>
|
|
|
</ScrollViewer>
|
|
|
|
|
|
<!-- 成图完成标记 -->
|
|
|
<TextBlock Text="✓ 成图完成"
|
|
|
IsVisible="{Binding SpecialContent.ShowDoneBadge}"
|
|
|
FontSize="12"
|
|
|
Foreground="#34A853"
|
|
|
Margin="0,8,0,0"/>
|
|
|
|
|
|
<!-- 错误信息 -->
|
|
|
<TextBlock Text="{Binding SpecialContent.StatusMessage}"
|
|
|
IsVisible="{Binding SpecialContent.ShowErrorMessage}"
|
|
|
FontSize="11"
|
|
|
Foreground="#D32F2F"
|
|
|
Margin="0,6,0,0"
|
|
|
TextWrapping="Wrap"/>
|
|
|
|
|
|
<!-- 生成按钮(仅 Ready 阶段显示) -->
|
|
|
<Button Content="{Binding SpecialContent.GenerateButtonLabel}"
|
|
|
IsVisible="{Binding SpecialContent.ShowGenerateButton}"
|
|
|
Background="#007AFF"
|
|
|
Foreground="White"
|
|
|
CornerRadius="8"
|
|
|
Padding="16,8"
|
|
|
Margin="0,10,0,0"
|
|
|
HorizontalAlignment="Right"
|
|
|
Command="{Binding $parent[Window].DataContext.SubmitGriddingParamCardCommand}"
|
|
|
CommandParameter="{Binding}"/>
|
|
|
|
|
|
</StackPanel>
|
|
|
</Border>
|
|
|
</DataTemplate>
|
|
|
|
|
|
<!-- 消息模板选择器 -->
|
|
|
<converters:MessageTemplateSelector x:Key="MessageTemplateSelector"
|
|
|
TextMessageTemplate="{StaticResource TextMessageTemplate}"
|
|
|
FileMessageTemplate="{StaticResource FileMessageTemplate}"
|
|
|
WorkflowStatusTemplate="{StaticResource WorkflowStatusTemplate}"
|
|
|
FormMessageTemplate="{StaticResource FormMessageTemplate}"
|
|
|
TableMessageTemplate="{StaticResource TableMessageTemplate}"
|
|
|
ColumnMatchMessageTemplate="{StaticResource ColumnMatchMessageTemplate}"
|
|
|
ParameterSetMessageTemplate="{StaticResource ParameterSetMessageTemplate}"
|
|
|
XyzLoadCardTemplate="{StaticResource XyzLoadCardTemplate}"
|
|
|
GriddingParamCardTemplate="{StaticResource GriddingParamCardTemplate}" />
|
|
|
</ResourceDictionary>
|
|
|
</Application.Resources>
|
|
|
|
|
|
<Application.DataTemplates>
|
|
|
<local:ViewLocator/>
|
|
|
</Application.DataTemplates>
|
|
|
|
|
|
<Application.Styles>
|
|
|
<FluentTheme />
|
|
|
<StyleInclude Source="avares://LiveMarkdown.Avalonia/Styles.axaml"/>
|
|
|
</Application.Styles>
|
|
|
|
|
|
</Application> |