|
@@ -0,0 +1,122 @@
|
|
|
|
+<UserControl x:Class="PLCTool.Views.BasicConfigView.DeviceView"
|
|
|
|
+ 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:local="clr-namespace:PLCTool.Views.BasicConfigView"
|
|
|
|
+ xmlns:hc="https://handyorg.github.io/handycontrol"
|
|
|
|
+ xmlns:myContr="clr-namespace:BlankApp1.Controls"
|
|
|
|
+ xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
|
|
|
|
+ mc:Ignorable="d"
|
|
|
|
+ d:DesignHeight="450" d:DesignWidth="800">
|
|
|
|
+ <Grid >
|
|
|
|
+ <Grid.RowDefinitions>
|
|
|
|
+ <RowDefinition Height="40"/>
|
|
|
|
+ <RowDefinition Height="40"/>
|
|
|
|
+ <RowDefinition/>
|
|
|
|
+ <RowDefinition Height="40"/>
|
|
|
|
+
|
|
|
|
+ </Grid.RowDefinitions>
|
|
|
|
+ <UniformGrid Grid.Row="0" Columns="3">
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="设备编号:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding ScheduleName}" />
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="设备名称:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding DeviceName}"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <StackPanel Orientation="Horizontal" >
|
|
|
|
+ <TextBlock Text="创建人:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
|
+ <TextBox Height="28" Width="120" Text="{Binding DeviceName}"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </UniformGrid>
|
|
|
|
+ <Grid Grid.Row="1">
|
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
|
+ <ColumnDefinition/>
|
|
|
|
+ <ColumnDefinition/>
|
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
|
+ <StackPanel Grid.Column="0" Orientation="Horizontal">
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="创建时间:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
|
+ <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160" SelectedDateTime="{Binding StartTime}"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="至:" Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
|
|
|
|
+ <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160" SelectedDateTime="{Binding EndTime}"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ <StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
|
|
+
|
|
|
|
+ <Button Content="查询" Width="80" Margin="5,0" Command="{Binding QueryCommand}" Style="{StaticResource NormalButtonStyle}" />
|
|
|
|
+ <Button Content="重置" Width="80" Margin="5,0" Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}" />
|
|
|
|
+ <Button Content="新增" Width="80" Margin="5,0" Command="{Binding AddPlanCommand}" Style="{StaticResource NormalButtonStyle}"/>
|
|
|
|
+
|
|
|
|
+ <Button Content="导出Excel" Width="80" Margin="5,0" Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </Grid>
|
|
|
|
+ <DataGrid Grid.Row="2" ColumnWidth="*" AutoGenerateColumns="False" HeadersVisibility="All" CanUserAddRows="False" SelectionUnit="FullRow" SelectionMode="Single" RowHeaderWidth="0"
|
|
|
|
+ ColumnHeaderStyle="{StaticResource ColumnHeaderStyle}" RowHeaderStyle="{StaticResource RowHeaderStyle}" RowStyle="{StaticResource DataGridRowtyle}" AlternationCount="2"
|
|
|
|
+ ItemsSource="{Binding BaseConfigList}" IsReadOnly="True" Padding="0" >
|
|
|
|
+ <DataGrid.Columns >
|
|
|
|
+ <DataGridTextColumn Header="序号" Width="50" Binding="{Binding SchemeId}" CellStyle="{StaticResource MyDataGridCellStyle}" />
|
|
|
|
+ <DataGridTextColumn Header="设备编号" Binding="{Binding SchemeName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="设备名称" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="所属项目编号" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="所属设备类型" Binding="{Binding DeviceName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="描述" Binding="{Binding ItemName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="创建者" Binding="{Binding CreateBy}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
|
|
|
|
+ <DataGridTemplateColumn Header="操作" Width="180" CellStyle="{StaticResource MyDataGridCellStyle}">
|
|
|
|
+ <DataGridTemplateColumn.CellTemplate>
|
|
|
|
+ <DataTemplate>
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
|
+ Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchemeId}" Cursor="Hand" Margin="0,0,10,0" >
|
|
|
|
+
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="编辑" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </Button>
|
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
|
+ Command="{Binding DataContext.DeleteCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchemeId}" Cursor="Hand" Margin="0,0,10,0">
|
|
|
|
+
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="删除" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </Button>
|
|
|
|
+ <Button Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
|
|
|
|
+ Command="{Binding DataContext.CopyCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchemeName}" Cursor="Hand" >
|
|
|
|
+
|
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
|
+ <TextBlock Text="复制方案" VerticalAlignment="Center" Foreground="Blue"/>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </Button>
|
|
|
|
+ </StackPanel>
|
|
|
|
+ </DataTemplate>
|
|
|
|
+ </DataGridTemplateColumn.CellTemplate>
|
|
|
|
+ </DataGridTemplateColumn>
|
|
|
|
+
|
|
|
|
+ </DataGrid.Columns>
|
|
|
|
+
|
|
|
|
+ </DataGrid>
|
|
|
|
+ <Grid Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
|
|
|
|
+ <wpfdev:Pagination IsLite="False" Margin="0" Width="auto" Height="30" HorizontalAlignment="Center"
|
|
|
|
+ Count="{Binding TotalCount,Mode=TwoWay}"
|
|
|
|
+ CountPerPage="{Binding CountPerPage,Mode=TwoWay}"
|
|
|
|
+ Current="{Binding CurrentPage,Mode=TwoWay}"/>
|
|
|
|
+ <!--<hc:Pagination MaxPageCount="10" PageIndex="{Binding PageIndex}" IsJumpEnabled="True">
|
|
|
|
+ <hc:Interaction.Triggers>
|
|
|
|
+ <hc:EventTrigger EventName="PageUpdated">
|
|
|
|
+ <hc:EventToCommand Command="{Binding PageUpdatedCmd}" PassEventArgsToCommand="True" />
|
|
|
|
+ </hc:EventTrigger>
|
|
|
|
+ </hc:Interaction.Triggers>
|
|
|
|
+ </hc:Pagination>-->
|
|
|
|
+ </Grid>
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ </Grid>
|
|
|
|
+</UserControl>
|