You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

454 lines
23 KiB
Plaintext

5 days ago
<Window x:Class="Sln_Wpf.Page.AddWindows.AddSubtaskWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="新增子任务" Height="750" Width="780"
WindowStartupLocation="CenterOwner"
WindowStyle="None" ResizeMode="NoResize"
Background="#F5F7FA">
<Window.Resources>
<!-- 卡片样式 -->
<Style x:Key="CardStyle" TargetType="Border">
<Setter Property="Background" Value="White"/>
<Setter Property="CornerRadius" Value="12"/>
<Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Color="LightGray" BlurRadius="15" ShadowDepth="2" Opacity="0.3"/>
</Setter.Value>
</Setter>
</Style>
<!-- 输入框样式 -->
<Style x:Key="FormTextBoxStyle" TargetType="TextBox">
<Setter Property="Height" Value="36"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="12,8"/>
<Setter Property="BorderBrush" Value="#E0E4E8"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="#2C3E50"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#3A7CA5"/>
</Trigger>
<Trigger Property="IsFocused" Value="True">
<Setter Property="BorderBrush" Value="#3A7CA5"/>
<Setter Property="BorderThickness" Value="2"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 下拉框样式 -->
<Style x:Key="FormComboBoxStyle" TargetType="ComboBox">
<Setter Property="Height" Value="36"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="BorderBrush" Value="#E0E4E8"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Background" Value="White"/>
<Setter Property="Foreground" Value="#2C3E50"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="BorderBrush" Value="#3A7CA5"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 标签样式 -->
<Style x:Key="LabelStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="13"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="#4A627A"/>
<Setter Property="Margin" Value="0,0,0,6"/>
</Style>
<!-- 分组标题样式 -->
<Style x:Key="GroupTitleStyle" TargetType="TextBlock">
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="#3A7CA5"/>
<Setter Property="Margin" Value="0,0,0,15"/>
<Setter Property="Padding" Value="0,0,0,8"/>
</Style>
<!-- 确认按钮样式 -->
<Style x:Key="ConfirmButtonStyle" TargetType="Button">
<Setter Property="Height" Value="42"/>
<Setter Property="Width" Value="120"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#27AE60"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="12,10">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#229954"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#1E8449"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 取消按钮样式 -->
<Style x:Key="CancelButtonStyle" TargetType="Button">
<Setter Property="Height" Value="42"/>
<Setter Property="Width" Value="120"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Foreground" Value="#5A6E7A"/>
<Setter Property="Background" Value="#F0F2F5"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="8"
Padding="12,10">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E0E4E8"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 窗口控制按钮样式 -->
<Style x:Key="WindowControlButtonStyle" TargetType="Button">
<Setter Property="Width" Value="40"/>
<Setter Property="Height" Value="40"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Foreground" Value="#5A6E7A"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E9ECF1"/>
<Setter Property="Foreground" Value="#2C3E50"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 关闭按钮样式 -->
<Style x:Key="CloseButtonStyle" TargetType="Button" BasedOn="{StaticResource WindowControlButtonStyle}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E74C3C"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="60"/>
<RowDefinition Height="*"/>
<RowDefinition Height="80"/>
</Grid.RowDefinitions>
<!-- 顶部栏:标题 + 窗口控制按钮 -->
<Border Grid.Row="0" Background="White" BorderBrush="#E9ECF1" BorderThickness="0,0,0,1">
<Grid Margin="20,0,15,0">
<Rectangle Fill="Transparent" MouseLeftButtonDown="Window_MouseLeftButtonDown" Cursor="SizeAll"/>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock Text="🛤️ " FontSize="22" VerticalAlignment="Center"/>
<TextBlock Text="新增子任务" FontSize="18" FontWeight="Bold" Foreground="#2C3E50" VerticalAlignment="Center" Margin="5,0,0,0"/>
<TextBlock Text=" | 配置子任务路径与设备动作" FontSize="13" Foreground="#7F8C8D" VerticalAlignment="Center" Margin="10,0,0,0"/>
</StackPanel>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" VerticalAlignment="Center">
<Button x:Name="BtnMinimize" Style="{StaticResource WindowControlButtonStyle}" Content="─" Click="BtnMinimize_Click" ToolTip="最小化"/>
<Button x:Name="BtnClose" Style="{StaticResource CloseButtonStyle}" Content="✕" Click="BtnClose_Click" ToolTip="关闭"/>
</StackPanel>
</Grid>
</Border>
<!-- 表单内容区 -->
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Auto">
<Border Style="{StaticResource CardStyle}" Margin="30,25,30,15" Padding="30,25">
<StackPanel>
<!-- ========== 基本信息区域 ========== -->
<TextBlock Style="{StaticResource GroupTitleStyle}" Text="📋 基本信息"/>
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 子任务编码 -->
<StackPanel Grid.Row="0" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="子任务编码"/>
<TextBox x:Name="TxtSubtaskCode"
Style="{StaticResource FormTextBoxStyle}"
Margin="0,0,15,15"
/>
</StackPanel>
<!-- 子任务名称 -->
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="子任务名称"/>
<TextBox x:Name="TxtSubtaskName"
Style="{StaticResource FormTextBoxStyle}"
Margin="0,0,0,15"
/>
</StackPanel>
<!-- 子任务类型 -->
<StackPanel Grid.Row="1" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="子任务类型"/>
<ComboBox x:Name="CmbSubtaskType"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,15" SelectedIndex="0">
<ComboBoxItem Content="取货" Tag="取货"/>
<ComboBoxItem Content="放货" Tag="放货"/>
<ComboBoxItem Content="搬运" Tag="搬运"/>
<ComboBoxItem Content="返回" Tag="返回"/>
<ComboBoxItem Content="等待" Tag="等待"/>
<ComboBoxItem Content="充电" Tag="充电"/>
</ComboBox>
</StackPanel>
<!-- 状态INT类型0-禁用 1-启用) -->
<StackPanel Grid.Row="1" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="状态"/>
<ComboBox x:Name="CmbStatus"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,0" SelectedIndex="0">
<ComboBoxItem Content="启用" Tag="1"/>
<ComboBoxItem Content="禁用" Tag="0"/>
</ComboBox>
</StackPanel>
</Grid>
<!-- ========== 设备配置区域 ========== -->
<TextBlock Style="{StaticResource GroupTitleStyle}" Text="⚙️ 设备配置" Margin="0,10,0,0"/>
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 执行设备类型 -->
<StackPanel Grid.Row="0" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="执行设备类型"/>
<ComboBox x:Name="CmbDeviceType"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,15" SelectedIndex="0">
<ComboBoxItem Content="AGV" Tag="AGV"/>
<ComboBoxItem Content="提升机" Tag="提升机"/>
<ComboBoxItem Content="堆垛机" Tag="堆垛机"/>
<ComboBoxItem Content="输送线" Tag="输送线"/>
</ComboBox>
</StackPanel>
<!-- 设备动作 -->
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="设备动作"/>
<ComboBox x:Name="CmbDeviceAction"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,0,15" SelectedIndex="0">
<ComboBoxItem Content="MoveToSource" Tag="MoveToSource"/>
<ComboBoxItem Content="MoveToTarget" Tag="MoveToTarget"/>
<ComboBoxItem Content="Move" Tag="Move"/>
<ComboBoxItem Content="Return" Tag="Return"/>
<ComboBoxItem Content="Wait" Tag="Wait"/>
<ComboBoxItem Content="Charge" Tag="Charge"/>
<ComboBoxItem Content="Scan" Tag="Scan"/>
</ComboBox>
</StackPanel>
<!-- 物料操作 -->
<StackPanel Grid.Row="1" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="物料操作"/>
<ComboBox x:Name="CmbMaterialAction"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,0" SelectedIndex="0">
<ComboBoxItem Content="取货" Tag="取货"/>
<ComboBoxItem Content="放货" Tag="放货"/>
<ComboBoxItem Content="搬运" Tag="搬运"/>
<ComboBoxItem Content="等待" Tag="等待"/>
<ComboBoxItem Content="空车返回" Tag="空车返回"/>
</ComboBox>
</StackPanel>
<!-- 容器类型 -->
<StackPanel Grid.Row="1" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="容器类型"/>
<ComboBox x:Name="CmbContainerType"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,0,0" SelectedIndex="0">
<ComboBoxItem Content="托盘" Tag="托盘"/>
<ComboBoxItem Content="四宫格料箱" Tag="四宫格料箱"/>
<ComboBoxItem Content="小料箱" Tag="小料箱"/>
<ComboBoxItem Content="色粉" Tag="色粉"/>
<ComboBoxItem Content="无" Tag="无"/>
</ComboBox>
</StackPanel>
</Grid>
<!-- ========== 位置配置区域 ========== -->
<TextBlock Style="{StaticResource GroupTitleStyle}" Text="📍 位置配置" Margin="0,10,0,0"/>
<Grid Margin="0,0,0,20">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 源位置类型 -->
<StackPanel Grid.Row="0" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="源位置类型"/>
<ComboBox x:Name="CmbSourceLocationType"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,15" SelectedIndex="0">
<ComboBoxItem Content="库位" Tag="库位"/>
<ComboBoxItem Content="缓存位" Tag="缓存位"/>
<ComboBoxItem Content="出库口" Tag="出库口"/>
<ComboBoxItem Content="入库口" Tag="入库口"/>
<ComboBoxItem Content="待命点" Tag="待命点"/>
<ComboBoxItem Content="充电位" Tag="充电位"/>
</ComboBox>
</StackPanel>
<!-- 源位置编码模板 -->
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="源位置编码模板"/>
<TextBox x:Name="TxtSourceLocationCode"
Style="{StaticResource FormTextBoxStyle}"
Margin="0,0,0,15"
/>
</StackPanel>
<!-- 目标位置类型 -->
<StackPanel Grid.Row="1" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="目标位置类型"/>
<ComboBox x:Name="CmbTargetLocationType"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,0" SelectedIndex="0">
<ComboBoxItem Content="库位" Tag="库位"/>
<ComboBoxItem Content="缓存位" Tag="缓存位"/>
<ComboBoxItem Content="出库口" Tag="出库口"/>
<ComboBoxItem Content="入库口" Tag="入库口"/>
<ComboBoxItem Content="待命点" Tag="待命点"/>
<ComboBoxItem Content="充电位" Tag="充电位"/>
</ComboBox>
</StackPanel>
<!-- 目标位置编码模板 -->
<StackPanel Grid.Row="1" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="目标位置编码模板"/>
<TextBox x:Name="TxtTargetLocationCode"
Style="{StaticResource FormTextBoxStyle}"
Margin="0,0,0,0"
/>
</StackPanel>
</Grid>
<!-- ========== 其他配置区域 ========== -->
<TextBlock Style="{StaticResource GroupTitleStyle}" Text="🔧 其他配置" Margin="0,10,0,0"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- 是否携带物料 -->
<StackPanel Grid.Row="0" Grid.Column="0">
<TextBlock Style="{StaticResource LabelStyle}" Text="是否携带物料"/>
<ComboBox x:Name="CmbIsCarryMaterial"
Style="{StaticResource FormComboBoxStyle}"
Margin="0,0,15,15" SelectedIndex="0">
<ComboBoxItem Content="是" Tag="true"/>
<ComboBoxItem Content="否" Tag="false"/>
</ComboBox>
</StackPanel>
<!-- 必需的参数列表 -->
<StackPanel Grid.Row="0" Grid.Column="1">
<TextBlock Style="{StaticResource LabelStyle}" Text="必需的参数列表"/>
<TextBox x:Name="TxtRequiredParams"
Style="{StaticResource FormTextBoxStyle}"
Margin="0,0,0,15"
/>
</StackPanel>
</Grid>
</StackPanel>
</Border>
</ScrollViewer>
<!-- 底部按钮区 -->
<Border Grid.Row="2" Background="White" BorderBrush="#E9ECF1" BorderThickness="0,1,0,0">
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center" >
<Button x:Name="BtnConfirm" Style="{StaticResource ConfirmButtonStyle}" Content="✅ 确认添加" Click="BtnConfirm_Click"/>
<Button x:Name="BtnCancel" Style="{StaticResource CancelButtonStyle}" Content="❌ 取消" Click="BtnCancel_Click"/>
</StackPanel>
</Border>
</Grid>
</Window>