瀏覽代碼

修改发方案编辑

user_lt 1 年之前
父節點
當前提交
60b8e2232b

+ 6 - 0
BlankApp1/BlankApp1/App.xaml

@@ -2,6 +2,7 @@
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              xmlns:local="clr-namespace:BlankApp1"
+             xmlns:wd="https://github.com/WPFDevelopersOrg/WPFDevelopers"
              xmlns:prism="http://prismlibrary.com/" >
     <Application.Resources>
         <ResourceDictionary>
@@ -9,6 +10,11 @@
                 <ResourceDictionary Source="Controls/Resources/DatagridStyle.xaml"/>
                 <ResourceDictionary Source="Controls/Resources/NormalBtnStyle.xaml"/>
                 <ResourceDictionary Source="Controls/Resources/NormalTextBlockStyle.xaml"/>
+                
+                <ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Light.Blue.xaml"/>
+                <wd:Resources Theme="Light"/>
+                <ResourceDictionary Source="pack://application:,,,/WPFDevelopers;component/Themes/Theme.xaml"/>
+                
                 <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml" />
                 <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml" />
 

+ 2 - 2
BlankApp1/BlankApp1/App.xaml.cs

@@ -60,8 +60,8 @@ namespace BlankApp1
             containerRegistry.RegisterForNavigation<PLCReadView, PLCReadViewModel>();
             containerRegistry.RegisterForNavigation<PLCWriteView, PLCWriteViewModel>();
             containerRegistry.RegisterDialog<PopView, PopViewModel>();
-          
-            containerRegistry.RegisterDialog<AddPlanView, AddPlanViewModel>();
+            containerRegistry.RegisterDialog<AddOrEditSchView, AddOrEditSchViewModel>();
+           
             containerRegistry.RegisterDialog<AddDetailView, AddDetailViewModel>();
             
         }

+ 1 - 0
BlankApp1/BlankApp1/PLCTool.csproj

@@ -25,6 +25,7 @@
     <PackageReference Include="Prism.DryIoc" Version="8.1.97" />
     <PackageReference Include="SqlSugarCore" Version="5.1.4.113" />
     <PackageReference Include="System.Configuration.ConfigurationManager" Version="7.0.0" />
+    <PackageReference Include="WPFDevelopers" Version="1.1.0.2-preview3" />
   </ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\BizService\BizService.csproj" />

+ 79 - 72
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/AddPlanViewModel.cs → BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/AddOrEditSchViewModel.cs

@@ -1,9 +1,7 @@
 using AutoMapper;
 using BizService;
-using BlankApp1.Events;
 using Model.Dto;
 using Model.Entities;
-using NetTaste;
 using Newtonsoft.Json;
 using NLog;
 using PLCTool.Common;
@@ -11,11 +9,9 @@ using Prism.Commands;
 using Prism.Events;
 using Prism.Mvvm;
 using Prism.Services.Dialogs;
-using SqlSugar;
 using System;
 using System.Collections.Generic;
 using System.Collections.ObjectModel;
-using System.IdentityModel.Tokens.Jwt;
 using System.Linq;
 using System.Text;
 using System.Threading.Tasks;
@@ -23,7 +19,7 @@ using System.Windows;
 
 namespace PLCTool.ViewModels.BasicConfigViewModel
 {
-    public class AddPlanViewModel : BindableBase, IDialogAware
+    public class AddOrEditSchViewModel  : BindableBase, IDialogAware
     {
         private readonly IDialogService _dialog;
         private readonly IEventAggregator _aggregator;
@@ -33,15 +29,15 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         private readonly IMapper _mapper;
         private readonly ILogger _logger;
         private List<OptionConfigDto> _optionConfigs;
-        public AddPlanViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService,IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService,IMapper mapper,ILogger logger)
+        public AddOrEditSchViewModel(IDialogService dialog, IEventAggregator aggregator, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IMapper mapper)
         {
             _dialog = dialog;
             _aggregator = aggregator;
-            _optionConfigService= optionConfigService;
-            _basicPlcTestSchemeService= basicPlcTestSchemeService;
-            _basicPlcTestSchemeDtlService= basicPlcTestSchemeDtlService;
+            _optionConfigService = optionConfigService;
+            _basicPlcTestSchemeService = basicPlcTestSchemeService;
+            _basicPlcTestSchemeDtlService = basicPlcTestSchemeDtlService;
             _mapper = mapper;
-            _logger = logger;
+            //_logger = logger;
             CloseCommand = new DelegateCommand(Close);
             SureCommand = new DelegateCommand<string>(Sure);
             ResetCommand = new DelegateCommand<string>(ResetMethod);
@@ -85,69 +81,81 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                     Title = "编辑方案";
                     int id = Convert.ToInt32(item);
                     //根据 测试方案明细主键ID 查找测试方案id 及方案名和设备名
-                    var findEntity=_basicPlcTestSchemeDtlService.Find(id);
+                    var findEntity = _basicPlcTestSchemeDtlService.Find(id);
                     var findresult = _mapper.Map<bas_plc_test_scheme_dtl, BasicPlcTestSchemeDtlDto>(findEntity);
                     if (findresult != null)
                     {
                         //根据方案id 在方案表中查找方案名 设备名
-                        int schID =Convert.ToInt32( findresult.SchemeId);
-                        var findSch=_basicPlcTestSchemeService.Find(schID);
-                        if(findSch != null )
+                        int schID = Convert.ToInt32(findresult.SchemeId);
+                        var findSch = _basicPlcTestSchemeService.Find(schID);
+                        if (findSch != null)
                         {
                             ScheduleName = findSch.scheme_name;
                             DeviceName = findSch.device_name;
-                           
+
                         }
                         TestName = findresult.ItemName;
                         SelectTest = findresult.ItemType;
                         //前置项解析
                         string preconStr = findresult.Precondition.ToString();
-                        JsonModel preconditionModel = JsonConvert.DeserializeObject<JsonModel>(preconStr);
-                        BeforeSelectJudge = preconditionModel.ItemType;
-                        SelectLogic = preconditionModel.ItemLogical;
-                        BeforeDetail = preconditionModel.Description;
-                        BeforeConList.Clear();
-                        foreach(var detail in preconditionModel.DetailInfo)
+                        if (!string.IsNullOrEmpty(preconStr))
                         {
-                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                            basPlcItemConfigDto.PlcItem=detail.PlcItem;
-                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                            basPlcItemConfigDto.Remark = detail.Remark;
-                            beforeConList.Add(basPlcItemConfigDto);
+                            JsonModel preconditionModel = JsonConvert.DeserializeObject<JsonModel>(preconStr);
+                            BeforeSelectJudge = preconditionModel.ItemType;
+                            SelectLogic = preconditionModel.ItemLogical;
+                            BeforeDetail = preconditionModel.Description;
+                            BeforeConList.Clear();
+                            foreach (var detail in preconditionModel.DetailInfo)
+                            {
+                                BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                                basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                                basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                                basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                                basPlcItemConfigDto.Remark = detail.Remark;
+                                beforeConList.Add(basPlcItemConfigDto);
+                            }
                         }
+                          
                         //输入项解析
                         string inStr = findresult.Action.ToString();
-                        JsonModel inModel = JsonConvert.DeserializeObject<JsonModel>(inStr);
-                        SelectInJudge = inModel.ItemType;
-                        InSelectLogic = inModel.ItemLogical;
-                        InDetail = inModel.Description;
-                        InConList.Clear();
-                        foreach (var detail in inModel.DetailInfo)
+                        if (!string.IsNullOrEmpty(inStr))
                         {
-                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                            basPlcItemConfigDto.PlcItem = detail.PlcItem;
-                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                            basPlcItemConfigDto.Remark = detail.Remark;
-                            InConList.Add(basPlcItemConfigDto);
+                            JsonModel inModel = JsonConvert.DeserializeObject<JsonModel>(inStr);
+                            SelectInJudge = inModel.ItemType;
+                            InSelectLogic = inModel.ItemLogical;
+                            InDetail = inModel.Description;
+                            InConList.Clear();
+                            foreach (var detail in inModel.DetailInfo)
+                            {
+                                BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                                basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                                basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                                basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                                basPlcItemConfigDto.Remark = detail.Remark;
+                                InConList.Add(basPlcItemConfigDto);
+                            }
                         }
+                           
                         //输出项解析
                         string outStr = findresult.JudgementResult.ToString();
-                        JsonModel outModel = JsonConvert.DeserializeObject<JsonModel>(outStr);
-                        SelectOutJudge = outModel.ItemType;
-                        OutSelectLogic = outModel.ItemLogical;
-                        OutDetail = outModel.Description;
-                        OutConList.Clear();
-                        foreach (var detail in outModel.DetailInfo)
+                        if(!string.IsNullOrEmpty(outStr))
                         {
-                            BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
-                            basPlcItemConfigDto.PlcItem = detail.PlcItem;
-                            basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
-                            basPlcItemConfigDto.PlcValue = detail.PlcValue;
-                            basPlcItemConfigDto.Remark = detail.Remark;
-                            OutConList.Add(basPlcItemConfigDto);
+                            JsonModel outModel = JsonConvert.DeserializeObject<JsonModel>(outStr);
+                            SelectOutJudge = outModel.ItemType;
+                            OutSelectLogic = outModel.ItemLogical;
+                            OutDetail = outModel.Description;
+                            OutConList.Clear();
+                            foreach (var detail in outModel.DetailInfo)
+                            {
+                                BasPlcItemConfigDto basPlcItemConfigDto = new BasPlcItemConfigDto();
+                                basPlcItemConfigDto.PlcItem = detail.PlcItem;
+                                basPlcItemConfigDto.PlcAddress = detail.PlcAddress;
+                                basPlcItemConfigDto.PlcValue = detail.PlcValue;
+                                basPlcItemConfigDto.Remark = detail.Remark;
+                                OutConList.Add(basPlcItemConfigDto);
+                            }
                         }
+                       
                     }
 
                 }
@@ -339,12 +347,12 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// <param name="obj"></param>
         private void Sure(string obj)
         {
-            if(Title=="新增方案")
+            if (Title == "新增方案")
             {
                 var finsSche = _basicPlcTestSchemeService.FindByName(ScheduleName);
                 if (finsSche != null)
                 {
-                    
+
                     MessageBoxResult boxResult = MessageBox.Show("测试方案名称已存在,请填写其他名称", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                     return;
                 }
@@ -359,10 +367,10 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                 bas_plc_test_scheme schEntity = _mapper.Map<BasicPlcTestSchemeDto, bas_plc_test_scheme>(schDto);
                 _basicPlcTestSchemeService.Add(schEntity);
             }
-         
+
             //查找测试方案id
             var finsScheHave = _basicPlcTestSchemeService.FindByName(ScheduleName);
-            if(finsScheHave != null)
+            if (finsScheHave != null)
             {
                 long id = finsScheHave.scheme_id;
                 //增加或修改方案明细表
@@ -377,7 +385,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         private void AddOrEditDetailsToDb(long scheduleId)
         {
             //前置项json转化
-            string prefixJsonStr=ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
+            string prefixJsonStr = ModelToJsonToStr(BeforeSelectJudge, SelectLogic, BeforeDetail, BeforeConList);
             //输入项json转化
             string inJsonStr = ModelToJsonToStr(SelectInJudge, InSelectLogic, InDetail, InConList);
             //输出项json转化
@@ -387,7 +395,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             BasicPlcTestSchemeDtlDto schDtlDto = new BasicPlcTestSchemeDtlDto();
             schDtlDto.SchemeId = scheduleId;
             schDtlDto.ItemName = TestName;
-            
+
             schDtlDto.ItemType = SelectTest;
             schDtlDto.Precondition = prefixJsonStr;
             schDtlDto.PreconditionDescribe = BeforeDetail;
@@ -400,14 +408,14 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             schDtlDto.UpdateTime = DateTime.Now;
             schDtlDto.UpdateBy = Appsession.UserName;
             bas_plc_test_scheme_dtl schDtlEntity = _mapper.Map<BasicPlcTestSchemeDtlDto, bas_plc_test_scheme_dtl>(schDtlDto);
-            if(Title=="新增方案")
+            if (Title == "新增方案")
             {
 
-                bool isAddSucc=_basicPlcTestSchemeDtlService.Add(schDtlEntity);
+                bool isAddSucc = _basicPlcTestSchemeDtlService.Add(schDtlEntity);
                 if (isAddSucc)
                 {
                     _logger.Info($"新增方案成功。方案名{ScheduleName},测试项{TestName}");
-                     MessageBoxResult boxResult = MessageBox.Show("更新成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
+                    MessageBoxResult boxResult = MessageBox.Show("更新成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
                 }
                 else
                 {
@@ -420,13 +428,13 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                 if (Title == "编辑方案")
                 {
                     //修改 必须给主键SchemeDtlId值
-                    var schDtl=_basicPlcTestSchemeDtlService.FindSchDtlIdBySchIdAndItem(scheduleId, TestName);
-                    if(schDtl != null)
+                    var schDtl = _basicPlcTestSchemeDtlService.FindSchDtlIdBySchIdAndItem(scheduleId, TestName);
+                    if (schDtl != null)
                     {
                         schDtlDto.SchemeDtlId = schDtl.scheme_dtl_id;
                         bas_plc_test_scheme_dtl schDtlEntityEdit = _mapper.Map<BasicPlcTestSchemeDtlDto, bas_plc_test_scheme_dtl>(schDtlDto);
-                        bool isSucc=_basicPlcTestSchemeDtlService.Edit(schDtlEntityEdit);
-                        if(isSucc)
+                        bool isSucc = _basicPlcTestSchemeDtlService.Edit(schDtlEntityEdit);
+                        if (isSucc)
                         {
                             _logger.Info($"更新方案成功。方案名{ScheduleName},测试项{TestName}");
                             MessageBoxResult boxResult = MessageBox.Show("更新成功", "提示", MessageBoxButton.OK, MessageBoxImage.Information);
@@ -438,10 +446,10 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                         }
 
                     }
-               
+
                 }
             }
-            
+
         }
         /// <summary>
         /// mode转json
@@ -452,7 +460,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// <param name="conList"></param>
         /// <returns></returns>
 
-        private string ModelToJsonToStr(string itemType,string itemLogical,string description, ObservableCollection<BasPlcItemConfigDto> conList)
+        private string ModelToJsonToStr(string itemType, string itemLogical, string description, ObservableCollection<BasPlcItemConfigDto> conList)
         {
             JsonModel prefixJsonModel = new JsonModel();
             prefixJsonModel.ItemType = itemType;
@@ -478,7 +486,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// <param name="obj"></param>
         private void ResetMethod(string obj)
         {
-            
+
         }
         #endregion
 
@@ -505,7 +513,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// 输入项
         /// </summary>
         public DelegateCommand<Object> DeleteInCommand { set; get; }
-      
+
         public DelegateCommand<Object> EditInCommand { set; get; }
 
         /// <summary>
@@ -547,7 +555,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// <summary>
         /// 测试项类型
         /// </summary>
-        private List<string> testKinds=new List<string>();
+        private List<string> testKinds = new List<string>();
         public List<string> TestKinds
         {
             get { return testKinds; }
@@ -565,7 +573,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         /// <summary>
         /// 判定类型(前置项)
         /// </summary>
-        private List<string> beforeJudgeKinds=new List<string>();
+        private List<string> beforeJudgeKinds = new List<string>();
         public List<string> BeforeJudgeKinds
         {
             get { return beforeJudgeKinds; }
@@ -698,4 +706,3 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
 }
 
 
-

+ 55 - 20
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/BaseConfigViewModel.cs

@@ -51,7 +51,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             AddPlanCommand = new DelegateCommand<string>(AddPlan);
             EditCommand = new DelegateCommand<object>(Edit);
             DeleteCommand = new DelegateCommand<object>(Delete);
-            PageUpdatedCmd = new DelegateCommand(PageUpdated);
+           
             GetConfigOption();
             GetContent();
         }
@@ -60,15 +60,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
 
 
         #region 私有方法
-        /// <summary>
-        /// 上下页
-        /// </summary>
-        /// <param name="obj"></param>
-        private void PageUpdated()
-        {
-            var disDatas = conditionConfig.Skip((PageIndex - 1) * PageCount).Take(PageCount).ToList();
-            BaseConfigList = new ObservableCollection<BasicPlcTestSchemeDto>(disDatas);
-        }
+     
         private void Reset(object obj)
         {
             ScheduleName = string.Empty;
@@ -101,8 +93,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                                            && (string.IsNullOrEmpty(SelectTest) ? true : (a.ItemType == SelectTest))
                                select a).ToList();
             //默认显示的第一页
-            PageIndex = 1;
-            PageUpdated();
+            Getpage();
             //BaseConfigList = new ObservableCollection<BasicPlcTestSchemeDto>(conditionConfig);
         }
         /// <summary>
@@ -130,7 +121,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             DialogParameters parm = new DialogParameters();
             parm.Add("Key", id);
             //弹出详情对话框
-            _dialog.ShowDialog("AddPlanView",parm, async callback =>
+            _dialog.ShowDialog("AddOrEditSchView", parm, async callback =>
             {
                 if (callback.Result == ButtonResult.OK)
                 {
@@ -164,7 +155,7 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
         {
 
             //弹出详情对话框
-            _dialog.ShowDialog("AddPlanView", async callback =>
+            _dialog.ShowDialog("AddOrEditSchView", async callback =>
             {
                 if (callback.Result == ButtonResult.OK)
                 {
@@ -268,12 +259,35 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
                    
                 }
                 //默认显示的第一页
-                PageIndex = 1;
-                PageUpdated();
+                Getpage();
             }
           
         }
 
+        /// <summary>
+        /// 获取页面
+        /// </summary>
+        private void Getpage()
+        {
+            CurrentPage = 1;
+            TotalCount = conditionConfig.Count;
+            CurrentPageChanged();
+
+
+        }
+        /// <summary>
+        /// 页面变化
+        /// </summary>
+        private void CurrentPageChanged()
+        {
+
+            BaseConfigList.Clear();
+
+            foreach (var i in conditionConfig.Skip((CurrentPage - 1) * CountPerPage).Take(CountPerPage))
+            {
+                BaseConfigList.Add(i);
+            }
+        }
         #endregion
         #region 命令绑定
 
@@ -348,11 +362,32 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             set { endTime = value; RaisePropertyChanged(); }
         }
 
-        private int pageIndex = 1;
-        public int PageIndex
+        /// <summary>
+        /// 总条数
+        /// </summary>
+        private int totalCount;
+        public int TotalCount
+        {
+            get { return totalCount; }
+            set { totalCount = value; RaisePropertyChanged(); CurrentPageChanged(); }
+        }
+        /// <summary>
+        /// 每页数量
+        /// </summary>
+        private int countPerPage = 1;
+        public int CountPerPage
+        {
+            get { return countPerPage; }
+            set { countPerPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
+        }
+        /// <summary>
+        /// 单前页
+        /// </summary>
+        private int currentPage = 1;
+        public int CurrentPage
         {
-            get { return pageIndex; }
-            set { pageIndex = value; RaisePropertyChanged(); }
+            get { return currentPage; }
+            set { currentPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
         }
 
         private ObservableCollection<BasicPlcTestSchemeDto> baseConfigList = new ObservableCollection<BasicPlcTestSchemeDto>();

+ 6 - 5
BlankApp1/BlankApp1/Views/BasicConfigView/AddPlanView.xaml → BlankApp1/BlankApp1/Views/BasicConfigView/AddOrEditSchView.xaml

@@ -1,10 +1,10 @@
-<UserControl x:Class="PLCTool.Views.AddPlanView"
+<UserControl x:Class="PLCTool.Views.BasicConfigView.AddOrEditSchView"
              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" 
-             xmlns:prism="http://prismlibrary.com/" 
+             xmlns:local="clr-namespace:PLCTool.Views.BasicConfigView"
+                        xmlns:prism="http://prismlibrary.com/" 
              BorderBrush="#CBCBCB" BorderThickness="1"
              Height="600" Width="1000" >
     <!--<prism:Dialog.WindowStyle>
@@ -28,13 +28,13 @@
 
     <Grid>
         <Grid.RowDefinitions>
-          
+
             <RowDefinition Height="50" />
             <RowDefinition />
             <RowDefinition />
             <RowDefinition />
         </Grid.RowDefinitions>
-   
+
         <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="10">
             <StackPanel Orientation="Horizontal">
                 <TextBlock Text="测试方案名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
@@ -324,3 +324,4 @@
         <Border Grid.Row="3"  BorderBrush="#CBCBCB" BorderThickness="0,1,0,0" />
     </Grid>
 </UserControl>
+

+ 4 - 13
BlankApp1/BlankApp1/Views/BasicConfigView/AddPlanView.xaml.cs → BlankApp1/BlankApp1/Views/BasicConfigView/AddOrEditSchView.xaml.cs

@@ -13,25 +13,16 @@ using System.Windows.Media.Imaging;
 using System.Windows.Navigation;
 using System.Windows.Shapes;
 
-namespace PLCTool.Views
+namespace PLCTool.Views.BasicConfigView
 {
     /// <summary>
-    /// AddPlanView.xaml 的交互逻辑
+    /// AddOrEditSchView.xaml 的交互逻辑
     /// </summary>
-    public partial class AddPlanView : UserControl
+    public partial class AddOrEditSchView : UserControl
     {
-        public AddPlanView()
+        public AddOrEditSchView()
         {
             InitializeComponent();
         }
-
-        private void UserControl_MouseMove(object sender, MouseEventArgs e)
-        {
-            if (e.LeftButton == MouseButtonState.Pressed)
-            {
-
-            }
-                //this.DragMove();
-        }
     }
 }

+ 8 - 4
BlankApp1/BlankApp1/Views/BasicConfigView/BaseConfigView.xaml

@@ -6,6 +6,7 @@
              xmlns:local="clr-namespace:BlankApp1.Views"
              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 >
@@ -70,7 +71,7 @@
                 <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}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
+                <DataGridTextColumn Header="创建时间" Binding="{Binding CreateTime,StringFormat={}{0:yyyy-MM-dd HH:mm:ss}}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
                 <DataGridTemplateColumn Header="操作"  CellStyle="{StaticResource MyDataGridCellStyle}">
                         <DataGridTemplateColumn.CellTemplate>
                             <DataTemplate>
@@ -99,14 +100,17 @@
 
             </DataGrid>
         <Grid Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center">
-           
-            <hc:Pagination MaxPageCount="10" PageIndex="{Binding PageIndex}" IsJumpEnabled="True">
+            <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>
+            </hc:Pagination>-->
         </Grid>