Browse Source

添加账户退出,取消mes 日志显示

刘彬 1 week ago
parent
commit
a1c9563d8a
4 changed files with 34 additions and 6 deletions
  1. 1 1
      Core/Management.cs
  2. 1 1
      Log4xml/LogHelper.cs
  3. 10 0
      ViewModels/WorkRunViewModel.cs
  4. 22 4
      Views/WorkRunView.xaml

+ 1 - 1
Core/Management.cs

@@ -91,7 +91,7 @@ namespace DefaultEdit.Core
 
         public CurentApplicationSettings CurentApplicationSettings { get => _CurentApplicationSettings; set { SetProperty(ref _CurentApplicationSettings, value); } }
 
-        public bool Ismeswork { get => ismeswork; set => ismeswork = value; }
+        public bool Ismeswork { get => ismeswork; set { SetProperty(ref ismeswork, value); } }
 
         private bool ismeswork = true;
         //运行线程

+ 1 - 1
Log4xml/LogHelper.cs

@@ -36,7 +36,7 @@ namespace DefaultEdit.Log4xml
             if ( infologgermes.IsInfoEnabled )
             {
                 infologgermes.Info(message);
-                logChangHandler?.Invoke(new Log() { Time = DateTime.Now.ToString("yyyy-MM-dd:HH:mm:ss"), Msg = message });
+                //logChangHandler?.Invoke(new Log() { Time = DateTime.Now.ToString("yyyy-MM-dd:HH:mm:ss"), Msg = message });
             }
         }
 

+ 10 - 0
ViewModels/WorkRunViewModel.cs

@@ -37,6 +37,10 @@ namespace DefaultEdit.ViewModels
         public DelegateCommand OpenRoleLoginViewCommand =>
             _OpenRoleLoginViewCommand ?? ( _OpenRoleLoginViewCommand = new DelegateCommand(RoleLoginViewShow) );
 
+        private DelegateCommand _DLoginCommand;
+        public DelegateCommand DLoginCommand =>
+            _DLoginCommand ?? (_DLoginCommand = new DelegateCommand(DLoginViewShow));
+
         private DelegateCommand _SwitchModeCommand;
         public DelegateCommand  SwitchModeCommand =>
             _SwitchModeCommand ?? ( _SwitchModeCommand = new DelegateCommand(SwitchModeMethod) );
@@ -131,6 +135,12 @@ namespace DefaultEdit.ViewModels
             roleLoginView.ShowDialog();
         }
 
+        void DLoginViewShow()
+        {
+            Management.UserId = "";
+            Management.UserName = "";
+        }
+
 
 
 

+ 22 - 4
Views/WorkRunView.xaml

@@ -55,22 +55,40 @@
                                    FontSize="18" />
                     </StackPanel>
 
-                    <StackPanel  Orientation="Horizontal"
+                    <StackPanel  Orientation="Vertical"
                                  Grid.Row="1"
                                  VerticalAlignment="Bottom">
+                        <StackPanel Orientation="Horizontal">
                         <Button Content="登录"
                                 Width="65"
                                 Background="#7E61E0"
                                 Margin="20,5,5,5"
                                 Command="{Binding OpenRoleLoginViewCommand}"
                                 FontSize="18" />
-                        <TextBlock Text="当前:" Margin="10,10,0,0"/>
-                        <Button Content="{Binding Management.Ismeswork,Converter={StaticResource boolTostr}}"
+
+                        <Button Content="账户退出"
+                    Width="75"
+                    Background="#7E61E0"
+                    Margin="20,5,5,5"
+                    Command="{Binding DLoginCommand}"
+                    FontSize="18" />
+                            <TextBlock Text="当前:" Margin="10,10,0,0"/>
+                            <Button  Content="{Binding Management.Ismeswork,Converter={StaticResource boolTostr}}"
+     Width="65"
+     Command="{Binding SwitchModeCommand}"
+     Background="#7E61E0"
+     Margin="0,5,5,5"
+     FontSize="18" />
+                        </StackPanel>
+                        <!--<StackPanel Orientation="Horizontal">
+                            <TextBlock Text="当前:" Margin="10,10,0,0"/>
+                            <Button Content="{Binding Management.Ismeswork,Converter={StaticResource boolTostr}}"
                                 Width="65"
                                 Command="{Binding SwitchModeCommand}"
                                 Background="#7E61E0"
                                 Margin="0,5,5,5"
                                 FontSize="18" />
+                        </StackPanel>-->
                     </StackPanel>
                 </Grid>
                 <Grid Grid.Column="1"
@@ -303,7 +321,7 @@
                         <TextBlock Text="{Binding Management.Formulasdata.第一次离心转速}"
            Grid.Row="1"
            Grid.Column="2" />
-                        
+
                         <TextBlock Text="第一次离心时间"
                                    Grid.Row="2"
                                    Grid.Column="0" />