ltwork 1 سال پیش
والد
کامیت
6c3190e4fd

+ 2 - 2
BlankApp1/BlankApp1/Controls/Resources/DatagridStyle.xaml

@@ -7,8 +7,8 @@
         <Setter Property="FontSize" Value="14"/>
         <Setter Property="Height" Value="38"/>
         <Setter Property="AllowDrop" Value="True"/>
-        <Setter Property="Background" Value="#409EFF"/>
-        <Setter Property="Foreground" Value="White"/>
+        <Setter Property="Background" Value="#F2F2F2"/>
+        <Setter Property="Foreground" Value="Black"/>
         <Setter Property="BorderThickness" Value="0,0,1,0" />
         <Setter Property="BorderBrush" Value="#CBCBCB" />
 

+ 3 - 0
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/DeviceTestViewModel.cs

@@ -86,6 +86,9 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             ProjectName = "---";
 
             GetProjectConfig();
+            //清空下方表格
+            SchItemList =new ObservableCollection<BasDeviceWithSchModel>();
+
         }
         private void Reset(object obj)
         {

+ 1 - 0
BlankApp1/BlankApp1/ViewModels/BusinessManageViewModel/ResultQueryViewModel.cs

@@ -120,6 +120,7 @@ namespace PLCTool.ViewModels.BusinessManageViewModel
             DeviceKindName = "---";
             ProjectName = "---";
             GetProjectConfig();
+            SchItemResultList = new ObservableCollection<DeviceDtlWithResultModel>();
         }
         private void Reset(object obj)
         {

+ 22 - 2
BlankApp1/BlankApp1/ViewModels/MonitorManageViewModel/LogViewModel.cs

@@ -1,4 +1,8 @@
-using Prism.Mvvm;
+using PLCTool.Events;
+using PLCTool.Models;
+using Prism.Commands;
+using Prism.Events;
+using Prism.Mvvm;
 using System;
 using System.Collections.Generic;
 using System.Linq;
@@ -9,6 +13,22 @@ namespace PLCTool.ViewModels.MonitorManageViewModel
 {
     public  class LogViewModel:BindableBase
     {
-        public LogViewModel() { }  
+        private readonly IEventAggregator _aggregator;
+        private List<CrumbViewModel> breadCrumbs = new List<CrumbViewModel>();
+        public LogViewModel(IEventAggregator aggregator) 
+        { 
+            _aggregator = aggregator;
+            OnLoadCommand = new DelegateCommand(OnLoad);
+        }
+        private void OnLoad()
+        {
+            
+            //发布面包靴
+            breadCrumbs.Clear();
+            breadCrumbs.Add(new CrumbViewModel { Name = "监控管理" });
+            breadCrumbs.Add(new CrumbViewModel { Name = "系统实时Log" });
+            _aggregator.GetEvent<BreadEvent>().Publish(breadCrumbs);
+        }
+        public DelegateCommand OnLoadCommand { set; get; }
     }
 }

+ 33 - 1
BlankApp1/BlankApp1/ViewModels/MonitorManageViewModel/PLCPointViewModel.cs

@@ -1,6 +1,9 @@
 using BlankApp1.Common;
+using PLCTool.Events;
+using PLCTool.Models;
 using PLCTool.Views.MonitorManageView;
 using Prism.Commands;
+using Prism.Events;
 using Prism.Regions;
 using System;
 using System.Collections.Generic;
@@ -12,9 +15,12 @@ namespace PLCTool.ViewModels.MonitorManageViewModel
 {
     public  class PLCPointViewModel
     {
+        private readonly IEventAggregator _aggregator;
         private readonly IRegionManager _regionManager;
-        public PLCPointViewModel(IRegionManager regionManager)
+        private List<CrumbViewModel> breadCrumbs = new List<CrumbViewModel>();
+        public PLCPointViewModel(IEventAggregator aggregator,IRegionManager regionManager)
         {
+            _aggregator = aggregator;
             _regionManager = regionManager; 
             ButtonNavigateCommand = new DelegateCommand<string>(NavigateMethod);
             OnLoadCommand = new DelegateCommand(OnLoad);
@@ -23,6 +29,12 @@ namespace PLCTool.ViewModels.MonitorManageViewModel
         private void OnLoad()
         {
             _regionManager.Regions["PLCRegion"].RequestNavigate("PLCReadView");
+            //发布面包靴
+            breadCrumbs.Clear();
+            breadCrumbs.Add(new CrumbViewModel { Name = "监控管理" });
+            breadCrumbs.Add(new CrumbViewModel { Name = "PLC点位监控" });
+            _aggregator.GetEvent<BreadEvent>().Publish(breadCrumbs);
+
         }
 
         private void NavigateMethod(string strPar)
@@ -33,6 +45,26 @@ namespace PLCTool.ViewModels.MonitorManageViewModel
             }
             //导航页面
             _regionManager.Regions["PLCRegion"].RequestNavigate(strPar);
+            //
+            switch(strPar)
+            {
+                case "PLCReadView":
+                    //发布面包靴
+                    breadCrumbs.Clear();
+                    breadCrumbs.Add(new CrumbViewModel { Name = "监控管理" });
+                    breadCrumbs.Add(new CrumbViewModel { Name = "PLC点位监控",NavigateRegion="PLCPointView" });
+                    breadCrumbs.Add(new CrumbViewModel { Name = "PLC变量读取" });
+                    _aggregator.GetEvent<BreadEvent>().Publish(breadCrumbs);
+                    break;
+                case "PLCWriteView":
+                    //发布面包靴
+                    breadCrumbs.Clear();
+                    breadCrumbs.Add(new CrumbViewModel { Name = "监控管理" });
+                    breadCrumbs.Add(new CrumbViewModel { Name = "PLC点位监控", NavigateRegion = "PLCPointView" });
+                    breadCrumbs.Add(new CrumbViewModel { Name = "PLC写入变量" });
+                    _aggregator.GetEvent<BreadEvent>().Publish(breadCrumbs);
+                    break;
+            }
         }
 
 

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

@@ -56,13 +56,13 @@
                     <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160"  Text="{Binding EndTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                 </StackPanel>
             </StackPanel>
-            <StackPanel Grid.Column="1" Orientation="Horizontal">
+            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
 
                 <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="重置" Width="80"  Margin="5,0"  Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}" Background=" #7F7F7F"/>
+                <Button  Content="新增" Width="80"  Margin="5,0"  Command="{Binding AddPlanCommand}" Style="{StaticResource NormalButtonStyle}" Background="#00BFBF"/>
 
-                <Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" 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"

+ 4 - 4
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceKindView.xaml

@@ -49,13 +49,13 @@
                     <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160"  Text="{Binding EndTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                 </StackPanel>
             </StackPanel>
-            <StackPanel Grid.Column="1" Orientation="Horizontal">
+            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
 
                 <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 AddCommand}" Style="{StaticResource NormalButtonStyle}"/>
+                <Button  Content="重置" Width="80"  Margin="5,0"  Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}" Background=" #7F7F7F"  />
+                <Button  Content="新增" Width="80"  Margin="5,0"  Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}" Background="#00BFBF"/>
 
-                <Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" 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"

+ 4 - 4
BlankApp1/BlankApp1/Views/BasicConfigView/DeviceView.xaml

@@ -59,13 +59,13 @@
                     <hc:DateTimePicker ShowClearButton="True" Style="{StaticResource DateTimePickerExtend}" Height="25" Width="160"  Text="{Binding EndTime, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/>
                 </StackPanel>
             </StackPanel>
-            <StackPanel Grid.Column="1" Orientation="Horizontal">
+            <StackPanel Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right">
 
                 <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 AddCommand}" Style="{StaticResource NormalButtonStyle}"/>
+                <Button  Content="重置" Width="80"  Margin="5,0"  Command="{Binding ResetCommand}" Style="{StaticResource NormalButtonStyle}"  Background=" #7F7F7F" />
+                <Button  Content="新增" Width="80"  Margin="5,0"  Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}" Background="#00BFBF"/>
 
-                <Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" 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"

+ 3 - 3
BlankApp1/BlankApp1/Views/BasicConfigView/PLCConfigView.xaml

@@ -33,10 +33,10 @@
                 <TextBox  Height="28" Width="120" Text="{Binding PLCItem}"/>
             </StackPanel>
             
-            <StackPanel Orientation="Horizontal">
+            <StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
                 <Button Content="查询" Width="80"  Margin="5,0"  Command="{Binding QueryCommand}" Style="{StaticResource NormalButtonStyle}" />
-                <Button Content="新增PLC变量" Width="80"  Margin="5,0"  Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}" />
-                <Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />
+                <Button Content="新增PLC变量" Width="80"  Margin="5,0"  Command="{Binding AddCommand}" Style="{StaticResource NormalButtonStyle}" Background="#00BFBF"/>
+                <!--<Button Content="导出Excel" Width="80"  Margin="5,0"  Command="{Binding ExportCommand}" Style="{StaticResource NormalButtonStyle}" />-->
                
             </StackPanel>
 

+ 7 - 1
BlankApp1/BlankApp1/Views/MonitorManageView/LogView.xaml

@@ -4,7 +4,8 @@
              xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
              xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
              xmlns:local="clr-namespace:PLCTool.Views.MonitorManageView"
-                 xmlns:nlog ="clr-namespace:NlogViewer;assembly=NlogViewer"
+             xmlns:nlog ="clr-namespace:NlogViewer;assembly=NlogViewer"
+             xmlns:b="http://schemas.microsoft.com/xaml/behaviors"
              mc:Ignorable="d" 
              d:DesignHeight="450" d:DesignWidth="800">
     <!--<UserControl.Resources>
@@ -13,6 +14,11 @@
         </Style>
     </UserControl.Resources>-->
     <Grid>
+        <b:Interaction.Triggers>
+            <b:EventTrigger EventName="Loaded">
+                <b:InvokeCommandAction Command="{Binding OnLoadCommand}"/>
+            </b:EventTrigger>
+        </b:Interaction.Triggers>
         <Grid.RowDefinitions>
             <RowDefinition Height="60"/>
             <RowDefinition/>