Pārlūkot izejas kodu

添加项目、设备、设备类型界面

ltwork 1 gadu atpakaļ
vecāks
revīzija
c97817a0d0

+ 3 - 1
BlankApp1/BlankApp1/App.xaml.cs

@@ -62,8 +62,10 @@ namespace BlankApp1
             containerRegistry.RegisterForNavigation<PLCReadView, PLCReadViewModel>();
             containerRegistry.RegisterForNavigation<PLCWriteView, PLCWriteViewModel>();
             containerRegistry.RegisterForNavigation<PLCConfigView, PLCConfigViewModel>();
-            
 
+            containerRegistry.RegisterForNavigation<DeviceKindView, DeviceKindViewModel>();
+            containerRegistry.RegisterForNavigation<DeviceView, DeviceViewModel>();
+            containerRegistry.RegisterForNavigation<ProjectView, ProjectViewModel>();
 
             containerRegistry.RegisterDialog<AddOrEditSchView, AddOrEditSchViewModel>();
             containerRegistry.RegisterDialog<AddDetailView, AddDetailViewModel>();

+ 12 - 0
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/DeviceKindViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PLCTool.ViewModels.BasicConfigViewModel
+{
+    class DeviceKindViewModel
+    {
+    }
+}

+ 12 - 0
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/DeviceViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PLCTool.ViewModels.BasicConfigViewModel
+{
+    class DeviceViewModel
+    {
+    }
+}

+ 12 - 0
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/ProjectViewModel.cs

@@ -0,0 +1,12 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace PLCTool.ViewModels.BasicConfigViewModel
+{
+    class ProjectViewModel
+    {
+    }
+}

+ 120 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceKindView.xaml

@@ -0,0 +1,120 @@
+<UserControl x:Class="PLCTool.Views.BasicConfigView.DeviceKindView"
+             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 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>

+ 28 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceKindView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PLCTool.Views.BasicConfigView
+{
+    /// <summary>
+    /// DeviceKindView.xaml 的交互逻辑
+    /// </summary>
+    public partial class DeviceKindView : UserControl
+    {
+        public DeviceKindView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 122 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceView.xaml

@@ -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>

+ 28 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PLCTool.Views.BasicConfigView
+{
+    /// <summary>
+    /// DeviceView.xaml 的交互逻辑
+    /// </summary>
+    public partial class DeviceView : UserControl
+    {
+        public DeviceView()
+        {
+            InitializeComponent();
+        }
+    }
+}

+ 122 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/ProjectView.xaml

@@ -0,0 +1,122 @@
+<UserControl x:Class="PLCTool.Views.BasicConfigView.ProjectView"
+             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 ItemType}" 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>
+

+ 28 - 0
BlankApp1/BlankApp1/Views/BasicConfigView/ProjectView.xaml.cs

@@ -0,0 +1,28 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Controls;
+using System.Windows.Data;
+using System.Windows.Documents;
+using System.Windows.Input;
+using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+
+namespace PLCTool.Views.BasicConfigView
+{
+    /// <summary>
+    /// ProjectView.xaml 的交互逻辑
+    /// </summary>
+    public partial class ProjectView : UserControl
+    {
+        public ProjectView()
+        {
+            InitializeComponent();
+        }
+    }
+}