208 lines
16 KiB
XML
208 lines
16 KiB
XML
<Page x:Class="WPFWCSDemo.Views.TaskView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:md="http://materialdesigninxaml.net/winfx/xaml/themes"
|
|
xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
|
|
xmlns:b="clr-namespace:System.Windows.Input;assembly=netstandard"
|
|
xmlns:local="clr-namespace:WPFWCSDemo.Views"
|
|
xmlns:viewmodels="clr-namespace:WPFWCSDemo.ViewModels"
|
|
d:DataContext="{d:DesignInstance Type=viewmodels:TaskViewModel}"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="720" d:DesignWidth="1600"
|
|
Title="TaskView">
|
|
|
|
<Page.Resources>
|
|
<Style TargetType="ComboBox" BasedOn="{StaticResource MaterialDesignComboBox}">
|
|
<Setter Property="MinWidth" Value="72"/>
|
|
<Setter Property="IsEditable" Value="True"/>
|
|
</Style>
|
|
<Style x:Key="topComboBox" TargetType="ComboBox" BasedOn="{StaticResource MaterialDesignComboBox}">
|
|
<Setter Property="IsEditable" Value="True"/>
|
|
<Setter Property="Margin" Value="10,0"/>
|
|
</Style>
|
|
|
|
</Page.Resources>
|
|
|
|
<!--弹出对话框-->
|
|
<md:DialogHost>
|
|
<!--右侧对话框弹出-->
|
|
<!--右侧对话框弹出-->
|
|
<!--右侧对话框弹出-->
|
|
<md:DrawerHost IsRightDrawerOpen="{Binding IsRightDrawerOpen}" IsTopDrawerOpen="{Binding IsTopDrawerOpen}">
|
|
<md:DrawerHost.RightDrawerContent>
|
|
<DockPanel Width="300" LastChildFill="False">
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top">
|
|
<Border Width="260" Height="40" HorizontalAlignment="Stretch" CornerRadius="8" Background="Orange" Margin="10">
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="2" ShadowDepth="2" Opacity=".3" Direction="300"/>
|
|
</Border.Effect>
|
|
<!--标题-->
|
|
<TextBlock Text="新任务" FontSize="20" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
|
</Border>
|
|
<!--提示信息-->
|
|
<Button Content="{md:PackIcon Kind=InformationOutline}" BorderThickness="0" VerticalAlignment="Center" Background="DarkViolet" Padding="1" Width="20" Height="20" Opacity="0.3"/>
|
|
</StackPanel>
|
|
|
|
<!--选择任务类型-->
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
|
<TextBlock Text="状态:" VerticalAlignment="Center"/>
|
|
<ComboBox Width="100" IsReadOnly="True" md:HintAssist.Hint="请选择" SelectedIndex="{Binding SelectedTaskTypeIndex}" HorizontalContentAlignment="Center">
|
|
<ComboBoxItem Content="实垛"/>
|
|
<ComboBoxItem Content="空托"/>
|
|
<ComboBoxItem Content="进休息区"/>
|
|
<ComboBoxItem Content="返回轨道"/>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
<!--参数1-->
|
|
<!--<TextBox md:HintAssist.Hint="请输入托盘条码" Text="{Binding InputPalletId}" Margin="20" DockPanel.Dock="Top"/>-->
|
|
<!--参数2-->
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
|
<TextBlock Text="取货站点" FontSize="14" Foreground="Silver" VerticalAlignment="Center"/>
|
|
<ComboBox md:HintAssist.Hint="" MinWidth="160" ItemsSource="{Binding .}" Text="{Binding SelectedSourceLocation}" Margin="20 0 0 0" HorizontalContentAlignment="Center">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction Command="{Binding .}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
|
|
<!--参数3-->
|
|
<StackPanel Orientation="Horizontal" DockPanel.Dock="Top" Margin="20">
|
|
<TextBlock Text="目标站点" FontSize="14" Foreground="Silver" VerticalAlignment="Center"/>
|
|
<DockPanel LastChildFill="False" DockPanel.Dock="Top" Margin="20 10">
|
|
<ComboBox md:HintAssist.Hint="" MinWidth="160" Text="{Binding SelectedTargetLocation}" SelectedValue="{Binding SelectedTargetLocation}" HorizontalContentAlignment="Center"/>
|
|
</DockPanel>
|
|
</StackPanel>
|
|
|
|
<Button Content="添加任务" Margin="20" DockPanel.Dock="Top" Command="{Binding AddTaskCommand}"/>
|
|
</DockPanel>
|
|
</md:DrawerHost.RightDrawerContent>
|
|
|
|
<!--顶部弹出面板-->
|
|
<!--顶部弹出面板-->
|
|
<!--顶部弹出面板-->
|
|
<md:DrawerHost.TopDrawerContent>
|
|
<Border>
|
|
<DockPanel Height="70" Margin="0,-10,0,0">
|
|
<Border Width="160" CornerRadius="15" Background="Orange" Margin="0,10,50,10">
|
|
<Border.Effect>
|
|
<DropShadowEffect BlurRadius="2" ShadowDepth="2" Opacity=".3" Direction="300"/>
|
|
</Border.Effect>
|
|
<TextBlock Text="环穿测试" HorizontalAlignment="Center" VerticalAlignment="Center" FontSize="22" FontWeight="Bold"/>
|
|
</Border>
|
|
<TextBlock Text="任务类型:" Foreground="Gray" VerticalAlignment="Center"/>
|
|
<ListBox SelectedIndex="{Binding TestingTaskTypeIndex,Mode=TwoWay}" VerticalAlignment="Center" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" Margin="0,0,30,0">
|
|
<ListBoxItem Content="常规任务"/>
|
|
<ListBoxItem Content="进入休息区"/>
|
|
<ListBoxItem Content="返回轨道"/>
|
|
</ListBox>
|
|
<!--编号-->
|
|
<StackPanel Orientation="Horizontal" Margin="30 0 30 0">
|
|
<TextBlock Text="小车编号:" VerticalAlignment="Center" Foreground="Gray"/>
|
|
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Numbers..." MinWidth="60" HorizontalContentAlignment="Center" ItemsSource="{Binding RGVNumbers}" SelectedValue="{Binding SelectedRGVNumber}" Style="{StaticResource topComboBox}"/>
|
|
</StackPanel>
|
|
<!--取货站点-->
|
|
<StackPanel Orientation="Horizontal" Margin="10 0 0 0">
|
|
<TextBlock Text="取货站点:" VerticalAlignment="Center" Foreground="Gray" Margin="10,0"/>
|
|
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Sources..." MinWidth="120" HorizontalContentAlignment="Center" ItemsSource="{Binding .}" Text="{Binding SelectedSourceLocation}" Style="{StaticResource topComboBox}"/>
|
|
</StackPanel>
|
|
<!--目标站点-->
|
|
<StackPanel Orientation="Horizontal" Margin="30 0 -20 0">
|
|
<TextBlock Text="目标站点:" VerticalAlignment="Center" Foreground="Gray" Margin="0,0"/>
|
|
<ComboBox DockPanel.Dock="Left" md:HintAssist.Hint="Targets..." MinWidth="120" HorizontalContentAlignment="Center" ItemsSource="{Binding .}" Text="{Binding SelectedTargetLocation}" Style="{StaticResource topComboBox}"/>
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
|
<Button Width="120" Content="下发任务" BorderThickness="0" Margin="10,0" Command="{Binding SendRGVTestCommand}"/>
|
|
<Button Width="120" Content="清空" Background="GhostWhite" BorderThickness="0" Foreground="DarkOrange" Margin="10,0" Command="{Binding TestClearCommand}"/>
|
|
</StackPanel>
|
|
|
|
</DockPanel>
|
|
</Border>
|
|
</md:DrawerHost.TopDrawerContent>
|
|
|
|
|
|
<!--主页面内容-->
|
|
<!--主页面内容-->
|
|
<!--主页面内容-->
|
|
<Grid>
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="auto"/>
|
|
<RowDefinition Height="auto"/>
|
|
<RowDefinition Height="auto"/>
|
|
</Grid.RowDefinitions>
|
|
<TextBlock Text="调度任务" Style="{StaticResource screenTitle}"/>
|
|
<!--调度任务窗口顶部导航栏-->
|
|
<DockPanel Grid.Row="1" LastChildFill="True">
|
|
<StackPanel Orientation="Horizontal" Margin="50,10">
|
|
<!--<TextBlock Text="列名:" VerticalAlignment="Center" Margin="10"/>
|
|
<ComboBox Text="{Binding ColumnName,Mode=TwoWay}" IsReadOnly="True" HorizontalContentAlignment="Center" Width="150" ItemsSource="{Binding ColumnList}" md:ComboBoxAssist.MaxLength="2" md:HintAssist.Hint="Search" md:HintAssist.HintOpacity=".26"/>
|
|
<TextBlock Text="关键字:" VerticalAlignment="Center" Margin="10 0 0 0"/>
|
|
<TextBox x:Name="tbQuery" Text="{Binding Keywords,Mode=TwoWay}" HorizontalContentAlignment="Left" Width="150" md:HintAssist.Hint="Search..." md:TextFieldAssist.HasClearButton="True" Margin="10"/>-->
|
|
<!--<ListBox SelectedIndex="{Binding TaskTypeSelectedIndex,Mode=TwoWay}" Style="{StaticResource MaterialDesignChoiceChipPrimaryOutlineListBox}" Margin="10,0">
|
|
<i:Interaction.Triggers>
|
|
<i:EventTrigger EventName="SelectionChanged">
|
|
<i:InvokeCommandAction Command="{Binding TaskTypeSelectItemChangedCommand}"/>
|
|
</i:EventTrigger>
|
|
</i:Interaction.Triggers>
|
|
<ListBoxItem Content=" 默认 "/>
|
|
<ListBoxItem Content="常规任务"/>
|
|
<ListBoxItem Content="其他任务"/>
|
|
</ListBox>-->
|
|
<!--<Button Width="100" Content="查询" Command="{Binding QueryCommand}" Margin="20,0" IsDefault="True"/>-->
|
|
<Button Width="200" Content="重置/刷新" BorderThickness="0" Style="{StaticResource MaterialDesignPaperDarkButton}" Command="{Binding ClearCommand}"/>
|
|
<!--<Button Width="100" Content="测试" Background="White" Foreground="BlueViolet" Command="{Binding TaskFinishCommand}"/>-->
|
|
</StackPanel>
|
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="40,0">
|
|
<!--<Button x:Name="btnScheduleHistory" HorizontalAlignment="Right" Content="历史记录" Command="{Binding ScheduleHistoryCommand}" Margin="10"/>-->
|
|
<Button x:Name="btnOrder" HorizontalAlignment="Right" Content="环穿写入测试" Command="{Binding StackerTestingCommand}" Background="Orange" Foreground="Black" BorderBrush="Orange" Margin="10"/>
|
|
<Button x:Name="btnAdd" HorizontalAlignment="Right" Content="+ 添加任务" Command="{Binding NewTaskCommand}" Margin="10"/>
|
|
</StackPanel>
|
|
</DockPanel>
|
|
|
|
<!--表格区域-->
|
|
<DataGrid x:Name="myDataGrid" Grid.Row="2" Height="670" GridLinesVisibility="None" VerticalScrollBarVisibility="Auto" ScrollViewer.CanContentScroll="False" AlternatingRowBackground="Lavender" Margin="50,0,50,20" VerticalContentAlignment="Center" ItemsSource="{Binding TaskView}" RowHeight="50" ColumnHeaderStyle="{StaticResource MaterialDesignRaisedButton}" AutoGenerateColumns="False" ColumnHeaderHeight="50" IsReadOnly="True" CanUserAddRows="False" SelectionMode="Extended" SelectionUnit="Cell" >
|
|
<DataGrid.CellStyle>
|
|
<Style TargetType="DataGridCell">
|
|
<Setter Property="FontSize" Value="14"/>
|
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
<Setter Property="HorizontalAlignment" Value="Center"/>
|
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="BorderBrush" Value="Transparent"/>
|
|
</Style>
|
|
</DataGrid.CellStyle>
|
|
<DataGrid.Columns>
|
|
<DataGridTextColumn Header="环穿编号" Binding="{Binding JobId}" Width="*"/>
|
|
<DataGridTextColumn Header="任务号" Binding="{Binding TaskId}" Width="1.2*"/>
|
|
<DataGridTextColumn Header="任务类型" Binding="{Binding TaskType}" Width="*"/>
|
|
<DataGridTextColumn Header="源站点" Binding="{Binding SourceLocation}" Width="*"/>
|
|
<DataGridTextColumn Header="目标站点" Binding="{Binding TargetLocation}" Width="*"/>
|
|
<DataGridTextColumn Header="任务状态" Binding="{Binding TaskState}" Width="1.2*"/>
|
|
<DataGridTextColumn Header="调度状态" Binding="{Binding ScheduleState}" Width="2*"/>
|
|
<DataGridTextColumn Header="生成时间" Binding="{Binding CreateTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
|
<DataGridTextColumn Header="调度时间" Binding="{Binding ScheduleTime, StringFormat=\{0:yyyy-MM-dd HH:mm:ss\}}" Width="2*"/>
|
|
<!--<DataGridTextColumn Header="取货状态" Binding="{Binding ReportState}" Width="100"/>-->
|
|
<DataGridTemplateColumn Header="人工处理" Width="3*">
|
|
<DataGridTemplateColumn.CellTemplate>
|
|
<DataTemplate>
|
|
<StackPanel Orientation="Horizontal" Margin="0 0 0 0">
|
|
<Button Content="完成" FontSize="12" Background="SeaGreen" BorderThickness="0" Width="60" Command="{Binding DataContext.TaskFinishCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}"/>
|
|
<Button Content="取消" FontSize="12" Background="Crimson" BorderThickness="0" Width="60" Command="{Binding DataContext.TaskDeleteCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}" Margin="10,0"/>
|
|
<Button Content="重新下发" FontSize="12" Background="DarkOrange" BorderThickness="0" Width="90" Command="{Binding DataContext.UpdateTaskStateToReadyCommand,ElementName=myDataGrid}" CommandParameter="{Binding TaskId}" Margin="0 0"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</DataGridTemplateColumn.CellTemplate>
|
|
</DataGridTemplateColumn>
|
|
</DataGrid.Columns>
|
|
</DataGrid>
|
|
|
|
</Grid>
|
|
</md:DrawerHost>
|
|
</md:DialogHost>
|
|
|
|
</Page>
|