ltwork 1 سال پیش
والد
کامیت
3b7e2e7358

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

@@ -53,7 +53,7 @@ namespace BlankApp1
             containerRegistry.Register(typeof(IMapper), GetMapper);
             containerRegistry.RegisterForNavigation<BaseConfigView, BaseConfigViewModel>();
        
-            containerRegistry.RegisterForNavigation<TestOperView, TestOperViewModel>();
+         
        
             containerRegistry.RegisterForNavigation<TreeMenuView, TreeMenuViewModel>();
             containerRegistry.RegisterForNavigation<StatisticsView, StatisticsViewModel>();

+ 4 - 0
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/BaseConfigViewModel.cs

@@ -80,6 +80,10 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             {
                 DeviceKindNameList.Add(kind);
             }
+
+            DeviceKindName = "---";
+
+        
         }
 
         /// <summary>

+ 4 - 1
BlankApp1/BlankApp1/ViewModels/BasicConfigViewModel/DeviceKindViewModel.cs

@@ -59,7 +59,10 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             {
                 DeviceKindNameList.Add(kind);
             }
-           // DeviceKindNameList= _iBasicDeviceKindService.FindAllDeviceKind();
+
+            DeviceKindName = "---";
+     
+            // DeviceKindNameList= _iBasicDeviceKindService.FindAllDeviceKind();
         }
         private void Reset(object obj)
         {

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

@@ -72,6 +72,9 @@ namespace PLCTool.ViewModels.BasicConfigViewModel
             {
                 ProjectNameList.Add(project);
             }
+
+            DeviceKindName = "---";
+            ProjectName = "---";
         }
         private void Reset(object obj)
         {

+ 25 - 8
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/DeviceTestViewModel.cs

@@ -65,14 +65,31 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// </summary>
         private void OnLoad()
         {
-            DeviceKindNameList = _iBasicDeviceKindService.FindAllDeviceKind();
-            ProjectNameList = _iBasicProjectService.FindAllProject();
+            DeviceKindNameList.Clear();
+            DeviceKindNameList.Add("---");
+            ProjectNameList.Clear();
+            ProjectNameList.Add("---");
+            var Kinds = _iBasicDeviceKindService.FindAllDeviceKind();
+            foreach (var kind in Kinds)
+            {
+                DeviceKindNameList.Add(kind);
+            }
+            var projects = _iBasicProjectService.FindAllProject();
+            foreach (var project in projects)
+            {
+                ProjectNameList.Add(project);
+            }
+            DeviceKindName = "---";
+            ProjectName = "---";
+
             GetProjectConfig();
         }
         private void Reset(object obj)
         {
             DeviceNo = string.Empty;
             DeviceName = string.Empty;
+            DeviceKindName = "---";
+            ProjectName = "---";
 
 
         }
@@ -136,8 +153,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             conditionDevices = (from a in allDeviceList
                                 where (string.IsNullOrEmpty(DeviceName) ? true : (a.DeviceName == DeviceName))
                                 && (string.IsNullOrEmpty(DeviceNo) ? true : (a.DeviceNo == DeviceNo))
-                                //&& (string.IsNullOrEmpty(DeviceKindName) ? true : (a.DeviceKindId == DeviceKindName))
-                                // && (string.IsNullOrEmpty(ProjectName) ? true : (a.ProjectId == ProjectName))
+                                && (DeviceKindName == "---") ? true : (a.DeviceKindName == DeviceKindName)
+                                   && (ProjectName == "---") ? true : (a.ProjectName == ProjectName)
                                 select a).ToList();
             //默认显示的第一页
             conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
@@ -319,8 +336,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// <summary>
         /// 项目名称
         /// </summary>
-        private List<string> projectNameList;
-        public List<string> ProjectNameList
+        private ObservableCollection<string> projectNameList = new ObservableCollection<string>();
+        public ObservableCollection<string> ProjectNameList
         {
             get { return projectNameList; }
             set { projectNameList = value; RaisePropertyChanged(); }
@@ -328,8 +345,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// <summary>
         /// 设备类型
         /// </summary>
-        private List<string> deviceKindNameList;
-        public List<string> DeviceKindNameList
+        private ObservableCollection<string> deviceKindNameList = new ObservableCollection<string>();
+        public ObservableCollection<string> DeviceKindNameList
         {
             get { return deviceKindNameList; }
             set { deviceKindNameList = value; RaisePropertyChanged(); }

+ 24 - 9
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/ResultQueryViewModel.cs

@@ -95,15 +95,30 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// </summary>
         private void OnLoad()
         {
-            DeviceKindNameList = _iBasicDeviceKindService.FindAllDeviceKind();
-            ProjectNameList = _iBasicProjectService.FindAllProject();
+            DeviceKindNameList.Clear();
+            DeviceKindNameList.Add("---");
+            ProjectNameList.Clear();
+            ProjectNameList.Add("---");
+            var Kinds = _iBasicDeviceKindService.FindAllDeviceKind();
+            foreach (var kind in Kinds)
+            {
+                DeviceKindNameList.Add(kind);
+            }
+            var projects = _iBasicProjectService.FindAllProject();
+            foreach (var project in projects)
+            {
+                ProjectNameList.Add(project);
+            }
+            DeviceKindName = "---";
+            ProjectName = "---";
             GetProjectConfig();
         }
         private void Reset(object obj)
         {
             DeviceNo = string.Empty;
             DeviceName = string.Empty;
-
+            DeviceKindName = "---";
+            ProjectName = "---";
 
         }
 
@@ -139,8 +154,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             conditionDevices = (from a in allDeviceList
                                 where (string.IsNullOrEmpty(DeviceName) ? true : (a.DeviceName == DeviceName))
                                 && (string.IsNullOrEmpty(DeviceNo) ? true : (a.DeviceNo == DeviceNo))
-                                //&& (string.IsNullOrEmpty(DeviceKindName) ? true : (a.DeviceKindId == DeviceKindName))
-                                // && (string.IsNullOrEmpty(ProjectName) ? true : (a.ProjectId == ProjectName))
+                                  && (DeviceKindName == "---") ? true : (a.DeviceKindName == DeviceKindName)
+                                   && (ProjectName == "---") ? true : (a.ProjectName == ProjectName)
                                 select a).ToList();
             //默认显示的第一页
             conditionDevices = conditionDevices.OrderBy(x => x.DeviceId).ToList();
@@ -573,8 +588,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// <summary>
         /// 项目名称
         /// </summary>
-        private List<string> projectNameList;
-        public List<string> ProjectNameList
+        private ObservableCollection<string> projectNameList = new ObservableCollection<string>();
+        public ObservableCollection<string> ProjectNameList
         {
             get { return projectNameList; }
             set { projectNameList = value; RaisePropertyChanged(); }
@@ -582,8 +597,8 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
         /// <summary>
         /// 设备类型
         /// </summary>
-        private List<string> deviceKindNameList;
-        public List<string> DeviceKindNameList
+        private ObservableCollection<string> deviceKindNameList = new ObservableCollection<string>();
+        public ObservableCollection<string> DeviceKindNameList
         {
             get { return deviceKindNameList; }
             set { deviceKindNameList = value; RaisePropertyChanged(); }

+ 0 - 445
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/TestOperViewModel.cs

@@ -1,445 +0,0 @@
-using AutoMapper;
-using BizService;
-using MiniExcelLibs;
-using Model.Dto;
-using Model.Entities;
-using NLog;
-using Prism.Commands;
-using Prism.Mvvm;
-using Prism.Services.Dialogs;
-using System;
-using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.Linq;
-using System.Text;
-using System.Threading.Tasks;
-using System.Windows;
-
-namespace PLCTool.ViewModels.BusinessManageViewModel
-{
-    public class TestOperViewModel : BindableBase
-    {
-        private readonly IDialogService _dialog;
-        private readonly IOptionConfigService _optionConfigService;
-        private readonly IBasicPlcTestSchemeService _basicPlcTestSchemeService;
-        private readonly IBasicPlcTestSchemeDtlService _basicPlcTestSchemeDtlService;
-        private readonly ILogger _logger;
-        private readonly IMapper _mapper;
-        private readonly IMenuService _menuService;
-
-        private List<BasicPlcTestSchemeDto> allConfigList = new List<BasicPlcTestSchemeDto>();//所有方案
-        private List<BasicPlcTestSchemeDto> conditionConfig = new List<BasicPlcTestSchemeDto>();//所有方案
-
-        private const int PageCount = 1; //每一页显示个数
-        public TestOperViewModel(IDialogService dialog, IMenuService menuService, IOptionConfigService optionConfigService, IBasicPlcTestSchemeService basicPlcTestSchemeService, IBasicPlcTestSchemeDtlService basicPlcTestSchemeDtlService, IMapper mapper)
-        {
-            _dialog = dialog;
-            _optionConfigService = optionConfigService;
-            _basicPlcTestSchemeService = basicPlcTestSchemeService;
-            _basicPlcTestSchemeDtlService = basicPlcTestSchemeDtlService;
-            //_logger = logger;
-            _mapper = mapper;
-            _menuService = menuService;
-            QueryCommand = new DelegateCommand<object>(Query);
-            ResetCommand = new DelegateCommand<object>(Reset);
-            ExportCommand = new DelegateCommand<string>(Export);
-       
-            EditCommand = new DelegateCommand<object>(Edit);
-            DeleteCommand = new DelegateCommand<object>(Delete);
-            //手动  自动测试
-            AutoTestCommand = new DelegateCommand<object>(AutoDest);
-            ManualTestCommand = new DelegateCommand<object>(ManualTest);
-            OnLoadCommand = new DelegateCommand(OnLoad);
-            GetConfigOption();
-            
-        }
-
-
-
-
-
-
-        #region 私有方法
-
-        private void OnLoad()
-        {
-            GetContent();
-        }
-        private void ManualTest(object obj)
-        {
-             //测试方案明细主键ID
-            long id = Convert.ToInt64(obj);
-            DialogParameters parm = new DialogParameters();
-            parm.Add("Key", id);
-            //弹出详情对话框
-            //弹出详情对话框
-            _dialog.ShowDialog("ManualTestView", parm, async callback =>
-            {
-                if (callback.Result == ButtonResult.OK)
-                {
-                    //更新表格,重新获取
-                    GetContent();
-                }
-
-            });
-        }
-        /// <summary>
-        /// 自动测试
-        /// </summary>
-        /// <param name="obj"></param>
-        private void AutoDest(object obj)
-        {
-            //测试方案明细主键ID
-            long id = Convert.ToInt64(obj);
-            DialogParameters parm = new DialogParameters();
-            parm.Add("Key", id);
-            //弹出详情对话框
-            //弹出详情对话框
-            _dialog.ShowDialog("AutoTestView",parm, async callback =>
-            {
-                if (callback.Result == ButtonResult.OK)
-                {
-                    //更新表格,重新获取
-                    GetContent();
-                }
-
-            });
-        }
-
-        /// <summary>
-        /// 重置
-        /// </summary>
-        /// <param name="obj"></param>
-        private void Reset(object obj)
-        {
-            ScheduleName = string.Empty;
-            DeviceKindName = string.Empty;
-            TestName = string.Empty;
-            SelectTest = string.Empty;
-            StartTime = DateTime.MinValue;
-            EndTime = DateTime.MinValue;
-        }
-        /// <summary>
-        /// 查询
-        /// </summary>
-        /// <param name="obj"></param>
-        private void Query(object obj)
-        {
-
-            if (StartTime > EndTime)
-            {
-                MessageBox.Show("起始时间大于结束时间,请重新输入", "确认", MessageBoxButton.OK, MessageBoxImage.Warning);
-                return;
-            }
-
-
-
-            conditionConfig = (from a in allConfigList
-                               where (EndTime == DateTime.MinValue ? true : (a.CreateTime < Convert.ToDateTime(EndTime)) && (Convert.ToDateTime(StartTime) < a.CreateTime))
-                                && (string.IsNullOrEmpty(ScheduleName) ? true : (a.SchemeName == ScheduleName))
-                                 && (string.IsNullOrEmpty(TestName) ? true : (a.ItemName == TestName))
-                                  && (string.IsNullOrEmpty(DeviceKindName) ? true : (a.DeviceKindName == DeviceKindName))
-                                    && (string.IsNullOrEmpty(SelectTest) ? true : (a.ItemType == SelectTest))
-                               select a).ToList();
-            //默认显示的第一页
-            conditionConfig = conditionConfig.OrderBy(x => x.SchemeName).ThenBy(x => x.SchemeId).ToList();
-            Getpage();
-            //BaseConfigList = new ObservableCollection<BasicPlcTestSchemeDto>(conditionConfig);
-        }
-        /// <summary>
-        /// 获取配置
-        /// </summary>
-        private void GetConfigOption()
-        {
-            var configList = _optionConfigService.QueryList();
-            var _optionConfigs = _mapper.Map<List<OptionConfig>, List<OptionConfigDto>>(configList);
-            var tests = _optionConfigs.FindAll(x => x.TypeID == 1);
-            TestKinds = new List<string>();
-            foreach (var test in tests)
-            {
-                TestKinds.Add(test.ContentOption);
-            }
-        }
-        /// <summary>
-        /// 编辑
-        /// </summary>
-        /// <param name="obj"></param>
-        private void Edit(object obj)
-        {
-            //测试方案明细主键ID
-            long id = Convert.ToInt64(obj);
-            DialogParameters parm = new DialogParameters();
-            parm.Add("Key", id);
-            //弹出详情对话框
-            _dialog.ShowDialog("AddOrEditSchView", parm, async callback =>
-            {
-                if (callback.Result == ButtonResult.OK)
-                {
-                    //更新表格,重新获取
-                    GetContent();
-                }
-
-            });
-        }
-        /// <summary>
-        /// 删除操作
-        /// </summary>
-        /// <param name="obj"></param>
-        private void Delete(object obj)
-        {
-            int id = Convert.ToInt32(obj);
-            MessageBoxResult boxResult = MessageBox.Show("确认删除此条数据?", "确认", MessageBoxButton.OKCancel, MessageBoxImage.Question);
-            if (boxResult == MessageBoxResult.OK)
-            {
-
-                _basicPlcTestSchemeDtlService.Delete(id);
-
-                //更新表格,重新获取
-                GetContent();
-            }
-        }
-      
-        /// <summary>
-        /// excel导出
-        /// </summary>
-        /// <param name="obj"></param>
-        private void Export(object obj)
-        {
-
-
-            using (System.Windows.Forms.SaveFileDialog saveFileDialog = new System.Windows.Forms.SaveFileDialog()
-            {
-                //设置文件类型
-                //书写规则例如:txt files(*.txt)|*.txt
-                Filter = "Excel files(*.xlsx)|*.xlsx|All files(*.*)|*.*",
-                //设置默认文件名(可以不设置)
-                FileName = "测试项" + string.Format("{0:yyyyMMddHHmm}", DateTime.Now),
-
-                //获取或设置一个值,该值指示如果用户省略扩展名,文件对话框是否自动在文件名中添加扩展名。(可以不设置)
-                AddExtension = true,
-
-                //保存对话框是否记忆上次打开的目录
-                RestoreDirectory = true
-            })
-            {
-                // Show save file dialog box
-
-                //点了保存按钮进入
-                if (saveFileDialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
-                {
-                    try
-                    {
-                        //获得文件路径
-                        string localFilePath = saveFileDialog.FileName.ToString();
-
-                        //string filePathWithName = localFilePath + ".xlsx";
-
-                        //获取文件内容
-                        MiniExcel.SaveAs(localFilePath, BaseConfigList);
-                    }
-                    catch (Exception ex)
-                    {
-
-                    }
-
-
-                }
-
-            }
-        }
-        /// <summary>
-        /// 获取解决方案
-        /// </summary>
-        private void GetContent()
-        {
-            //所有测试方案
-            var schlist = _basicPlcTestSchemeService.QueryList();
-            var configList = _mapper.Map<List<bas_plc_test_scheme>, List<BasicPlcTestSchemeDto>>(schlist);
-            //清空集合
-            BaseConfigList.Clear();
-            allConfigList.Clear();
-            conditionConfig.Clear();
-            //查找测试项名称
-            foreach (var sch in configList)
-            {
-                long schId = sch.SchemeId;
-                //在解决方案详细表中查找所有的测试项
-                var items = _basicPlcTestSchemeDtlService.FindAllBySchId(schId);
-                foreach (var item in items)
-                {
-                    BasicPlcTestSchemeDto basicPlcTestSchemeDto = new BasicPlcTestSchemeDto();
-                    basicPlcTestSchemeDto.SchemeId = item.scheme_dtl_id;
-                    basicPlcTestSchemeDto.SchemeName = sch.SchemeName;
-                    basicPlcTestSchemeDto.DeviceKindName = sch.DeviceKindName;
-                    switch (item.item_type)
-                    {
-                        case 0:
-                            basicPlcTestSchemeDto.ItemType = "前置项";
-                            break;
-                        case 1:
-                            basicPlcTestSchemeDto.ItemType = "PLC点位测试项";
-                            break;
-                        case 2:
-                            basicPlcTestSchemeDto.ItemType = "Robot动作测试";
-                            break;
-                    }
-
-                    basicPlcTestSchemeDto.ItemName = item.item_name;
-                    basicPlcTestSchemeDto.CreateBy = sch.CreateBy;
-                    basicPlcTestSchemeDto.CreateTime = sch.CreateTime;
-
-                    allConfigList.Add(basicPlcTestSchemeDto);
-                    conditionConfig.Add(basicPlcTestSchemeDto);
-
-                }
-                conditionConfig = conditionConfig.OrderBy(x => x.SchemeName).ThenBy(x => x.SchemeId).ToList();
-                //默认显示的第一页
-                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 命令绑定
-
-        public DelegateCommand<object> EditCommand { set; get; }
-        public DelegateCommand<string> AddPlanCommand { set; get; }
-        public DelegateCommand<object> QueryCommand { set; get; }
-        public DelegateCommand<object> ResetCommand { set; get; }
-        public DelegateCommand<object> DeleteCommand { set; get; }
-        public DelegateCommand<string> ExportCommand { set; get; }
-
-        public DelegateCommand PageUpdatedCmd { set; get; }
-
-        public DelegateCommand<object> AutoTestCommand { set; get; }
-
-        public DelegateCommand<object> ManualTestCommand { set; get; }
-        public DelegateCommand OnLoadCommand { set; get; }
-        #endregion
-        #region 数据绑定
-        /// <summary>
-        /// 测试方案编码
-        /// </summary>
-        private string scheduleName;
-        public string ScheduleName
-        {
-            get { return scheduleName; }
-            set { scheduleName = value; RaisePropertyChanged(); }
-        }
-        /// <summary>
-        /// 设备名称
-        /// </summary>
-        private string deviceKindName;
-        public string DeviceKindName
-        {
-            get { return deviceKindName; }
-            set { deviceKindName = value; RaisePropertyChanged(); }
-        }
-        /// <summary>
-        /// 测试项名称
-        /// </summary>
-        private string testName;
-        public string TestName
-        {
-            get { return testName; }
-            set { testName = value; RaisePropertyChanged(); }
-        }
-        /// <summary>
-        /// 测试项类型
-        /// </summary>
-
-
-        private List<string> testKinds = new List<string>();
-        public List<string> TestKinds
-        {
-            get { return testKinds; }
-            set { testKinds = value; RaisePropertyChanged(); }
-        }
-        /// <summary>
-        /// 
-        /// </summary>
-        private string selectTest;
-        public string SelectTest
-        {
-            get { return selectTest; }
-            set { selectTest = value; RaisePropertyChanged(); }
-        }
-
-        private DateTime startTime = DateTime.Now;
-        public DateTime StartTime
-        {
-            get { return startTime; }
-            set { startTime = value; RaisePropertyChanged(); }
-        }
-        private DateTime endTime = DateTime.Now;
-        public DateTime EndTime
-        {
-            get { return endTime; }
-            set { endTime = value; RaisePropertyChanged(); }
-        }
-
-        /// <summary>
-        /// 总条数
-        /// </summary>
-        private int totalCount;
-        public int TotalCount
-        {
-            get { return totalCount; }
-            set { totalCount = value; RaisePropertyChanged(); CurrentPageChanged(); }
-        }
-        /// <summary>
-        /// 每页数量
-        /// </summary>
-        private int countPerPage = 15;
-        public int CountPerPage
-        {
-            get { return countPerPage; }
-            set { countPerPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
-        }
-        /// <summary>
-        /// 单前页
-        /// </summary>
-        private int currentPage = 1;
-        public int CurrentPage
-        {
-            get { return currentPage; }
-            set { currentPage = value; RaisePropertyChanged(); CurrentPageChanged(); }
-        }
-
-        private ObservableCollection<BasicPlcTestSchemeDto> baseConfigList = new ObservableCollection<BasicPlcTestSchemeDto>();
-        public ObservableCollection<BasicPlcTestSchemeDto> BaseConfigList
-        {
-            get { return baseConfigList; }
-            set { SetProperty(ref baseConfigList, value); }
-        }
-
-        #endregion
-
-    }
-}
-
-

+ 0 - 115
BlankApp1/BlankApp1/Views/BusinessManageView/TestOperView.xaml

@@ -1,115 +0,0 @@
-<UserControl x:Class="PLCTool.Views.BusinessManageView.TestOperView"
-             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.BusinessManageView"
-             xmlns:hc="https://handyorg.github.io/handycontrol"
-             xmlns:myContr="clr-namespace:BlankApp1.Controls"
-             xmlns:wpfdev="https://github.com/WPFDevelopersOrg/WPFDevelopers"
-             xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
-             mc:Ignorable="d" 
-             d:DesignHeight="450" d:DesignWidth="800">
-    <Grid >
-        <b:Interaction.Triggers>
-            <b:EventTrigger EventName="Loaded">
-                <b:InvokeCommandAction Command="{Binding OnLoadCommand}"/>
-            </b:EventTrigger>
-        </b:Interaction.Triggers>
-        <Grid.RowDefinitions>
-            <RowDefinition Height="40"/>
-            <RowDefinition Height="40"/>
-            <RowDefinition/>
-            <RowDefinition Height="40"/>
-
-        </Grid.RowDefinitions>
-        <UniformGrid Grid.Row="0" Columns="4">
-            <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 DeviceKindName}"/>
-            </StackPanel>
-            <StackPanel Orientation="Horizontal" >
-                <TextBlock Text="测试项类型:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                <ComboBox  Height="28" Width="120" ItemsSource="{Binding TestKinds}" SelectedItem="{Binding SelectTest}" />
-            </StackPanel>
-            <StackPanel Orientation="Horizontal">
-                <TextBlock Text="测试项名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                <TextBox  Height="28" Width="120"  Text="{Binding TestName}"/>
-            </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}" />
-            </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="序号" Binding="{Binding SchemeId}" CellStyle="{StaticResource MyDataGridCellStyle}" />
-                <DataGridTextColumn Header="测试方案名称" Binding="{Binding SchemeName}" CellStyle="{StaticResource MyDataGridCellStyle}"/>
-                <DataGridTextColumn Header="设备类型" Binding="{Binding DeviceKindName}" 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="160"  CellStyle="{StaticResource MyDataGridCellStyle}">
-                    <DataGridTemplateColumn.CellTemplate>
-                        <DataTemplate>
-                            <UniformGrid Columns="2">
-                                <Button  Width="auto" Background="Transparent" HorizontalContentAlignment ="Left" Foreground="Black" Height="25" BorderThickness="0"
-                                      Command="{Binding DataContext.ManualTestCommand, 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.AutoTestCommand, RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=DataGrid}}" CommandParameter="{Binding SchemeId}" Cursor="Hand" >
-
-                                    <StackPanel Orientation="Horizontal">
-                                        <TextBlock  Text="自动测试" VerticalAlignment="Center" Foreground="Blue"/>
-                                    </StackPanel>
-                                </Button>
-
-                            </UniformGrid>
-                        </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}"/>
-            
-        </Grid>
-
-
-    </Grid>
-</UserControl>

+ 0 - 28
BlankApp1/BlankApp1/Views/BusinessManageView/TestOperView.xaml.cs

@@ -1,28 +0,0 @@
-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.BusinessManageView
-{
-    /// <summary>
-    /// TestOperView.xaml 的交互逻辑
-    /// </summary>
-    public partial class TestOperView : UserControl
-    {
-        public TestOperView()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 3 - 6
BlankApp1/BlankApp1/Views/BusinessManageView/TestResultDetailView.xaml

@@ -62,13 +62,10 @@
                     <TextBox  Height="28" Width="120"  Text="{Binding SelectTest}" IsReadOnly="True"/>
                 </StackPanel>
                 <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="测试项名称:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
-                    <TextBox  Height="28" Width="160"  Text="{Binding TestName}" IsReadOnly="True"/>
-                </StackPanel>
-                <StackPanel Orientation="Horizontal">
-                    <TextBlock Text="{Binding TestDtlResult}"  Style="{StaticResource NormalTextBlockStyle}" FontSize="25" Margin="10,0,5,0" />
-                    
+                    <TextBlock Text="测试结果:"  Style="{StaticResource NormalTextBlockStyle}" Margin="10,0,5,0"/>
+                    <TextBlock Text="{Binding TestDtlResult}"  Style="{StaticResource NormalTextBlockStyle}" FontSize="25"/>
                 </StackPanel>
+                
             </StackPanel>
             <Border Grid.Row="0"  BorderBrush="#CBCBCB" BorderThickness="0,1" />
             <Grid Grid.Row="1">