修改登录跳转页面
This commit is contained in:
		
							parent
							
								
									44215a008b
								
							
						
					
					
						commit
						f7df2f6c79
					
				| 
						 | 
					@ -596,7 +596,7 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
            //    };
 | 
					            //    };
 | 
				
			||||||
            //    timer.Start();
 | 
					            //    timer.Start();
 | 
				
			||||||
            //}
 | 
					            //}
 | 
				
			||||||
            logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间");
 | 
					            //logger.Info($"当前时间:{DateTime.Now}\r\n获取录像机的时间");
 | 
				
			||||||
            //获取录像机的时间
 | 
					            //获取录像机的时间
 | 
				
			||||||
            //_chkFunction.HIK_DVR_TIME();
 | 
					            //_chkFunction.HIK_DVR_TIME();
 | 
				
			||||||
            //_chkFunction.HIKStartDVRRecord();
 | 
					            //_chkFunction.HIKStartDVRRecord();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -96,12 +96,12 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        //    get => !_portUtil.fridgeSerial.IsOpen;
 | 
					        //    get => !_portUtil.fridgeSerial.IsOpen;
 | 
				
			||||||
        //}
 | 
					        //}
 | 
				
			||||||
        //录像机登录状态
 | 
					        //录像机登录状态
 | 
				
			||||||
        private bool _hikMsg;
 | 
					        //private bool _hikMsg;
 | 
				
			||||||
        public bool HIKMsg
 | 
					        //public bool HIKMsg
 | 
				
			||||||
        {
 | 
					        //{
 | 
				
			||||||
            get=>_hikMsg;
 | 
					        //    get=>_hikMsg;
 | 
				
			||||||
            set=>SetProperty(ref _hikMsg, value);
 | 
					        //    set=>SetProperty(ref _hikMsg, value);
 | 
				
			||||||
        }
 | 
					        //}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        //public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, FingerprintUtil fingerprintUtil)
 | 
					        //public LoginWindowViewModel(IRegionManager regionManager, IEventAggregator eventAggregator, PortUtil portUtil, FingerprintUtil fingerprintUtil)
 | 
				
			||||||
        //{
 | 
					        //{
 | 
				
			||||||
| 
						 | 
					@ -255,10 +255,10 @@ _exitCommand ??= new DelegateCommand(Exit);
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                //添加参数,键值对格式
 | 
					                //添加参数,键值对格式
 | 
				
			||||||
                keys.Add("operator", user);
 | 
					                keys.Add("operator", user);
 | 
				
			||||||
                System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
					                //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
				
			||||||
                {
 | 
					                //{
 | 
				
			||||||
                    _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
					                    _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
				
			||||||
                }));
 | 
					                //}));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
            // 双人登录模式
 | 
					            // 双人登录模式
 | 
				
			||||||
            else
 | 
					            else
 | 
				
			||||||
| 
						 | 
					@ -271,10 +271,10 @@ _exitCommand ??= new DelegateCommand(Exit);
 | 
				
			||||||
                        keys.Add("reviewer", user);
 | 
					                        keys.Add("reviewer", user);
 | 
				
			||||||
                        Reviewer = user;
 | 
					                        Reviewer = user;
 | 
				
			||||||
                        RaisePropertyChanged("Reviewer");
 | 
					                        RaisePropertyChanged("Reviewer");
 | 
				
			||||||
                        System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
					                        //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
				
			||||||
                        {
 | 
					                        //{
 | 
				
			||||||
                            _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
					                            _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
				
			||||||
                        }));
 | 
					                        //}));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -295,10 +295,10 @@ _exitCommand ??= new DelegateCommand(Exit);
 | 
				
			||||||
                        keys.Add("operator", user);
 | 
					                        keys.Add("operator", user);
 | 
				
			||||||
                        Operator = user;
 | 
					                        Operator = user;
 | 
				
			||||||
                        RaisePropertyChanged("Operator");
 | 
					                        RaisePropertyChanged("Operator");
 | 
				
			||||||
                        System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
					                        //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
				
			||||||
                        {
 | 
					                        //{
 | 
				
			||||||
                            _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
					                            _regionManager.RequestNavigate("MainRegion", "HomeWindow", keys);
 | 
				
			||||||
                        }));
 | 
					                        //}));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                    }
 | 
					                    }
 | 
				
			||||||
                    else
 | 
					                    else
 | 
				
			||||||
| 
						 | 
					@ -364,10 +364,10 @@ _exitCommand ??= new DelegateCommand(Exit);
 | 
				
			||||||
        void LoginEvent(FingerprintMsg msg)
 | 
					        void LoginEvent(FingerprintMsg msg)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            logger.Info(msg.ToString());
 | 
					            logger.Info(msg.ToString());
 | 
				
			||||||
            //if (msg.Message.Equals("CONNECT"))
 | 
					            if (msg.Message.Equals("CONNECT"))
 | 
				
			||||||
            //{
 | 
					            {
 | 
				
			||||||
            //    FingerMsg = !msg.Result;
 | 
					                FingerMsg = !msg.Result;
 | 
				
			||||||
            //}
 | 
					            }
 | 
				
			||||||
            if (LoginBtnEnable)
 | 
					            if (LoginBtnEnable)
 | 
				
			||||||
            {
 | 
					            {
 | 
				
			||||||
                if (msg.Message.Equals("LOGIN"))
 | 
					                if (msg.Message.Equals("LOGIN"))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,23 +64,22 @@ namespace DM_Weight.ViewModels
 | 
				
			||||||
        IRegionManager _regionManager;
 | 
					        IRegionManager _regionManager;
 | 
				
			||||||
        IUnityContainer _container;
 | 
					        IUnityContainer _container;
 | 
				
			||||||
        //private CHKFunction _cHKFunction;
 | 
					        //private CHKFunction _cHKFunction;
 | 
				
			||||||
        public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator, ScreenUtil screenUtil)
 | 
					        public MainWindowViewModel(IRegionManager regionManager, IUnityContainer container, IEventAggregator eventAggregator)
 | 
				
			||||||
        {
 | 
					        {
 | 
				
			||||||
            //_portUtil = portUtil;
 | 
					            //_portUtil = portUtil;
 | 
				
			||||||
            this.eventAggregator = eventAggregator;
 | 
					            this.eventAggregator = eventAggregator;
 | 
				
			||||||
            this.eventAggregator.GetEvent<SnackbarEvent>().Subscribe(doMyPrismEvent2);
 | 
					            this.eventAggregator.GetEvent<SnackbarEvent>().Subscribe(doMyPrismEvent2);
 | 
				
			||||||
            _screenUtil = screenUtil;
 | 
					 | 
				
			||||||
            //_fingerprintUtil = fingerprintUtil;
 | 
					            //_fingerprintUtil = fingerprintUtil;
 | 
				
			||||||
            _regionManager = regionManager;
 | 
					            _regionManager = regionManager;
 | 
				
			||||||
            _container = container;
 | 
					            _container = container;
 | 
				
			||||||
            //_cHKFunction = cHKFunction;
 | 
					            //_cHKFunction = cHKFunction;
 | 
				
			||||||
            System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
					            //System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
 | 
				
			||||||
            {
 | 
					            //{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
                _container.RegisterType<object, LoginWindow>("LoginWindow");
 | 
					                _container.RegisterType<object, LoginWindow>("LoginWindow");
 | 
				
			||||||
                _regionManager.RequestNavigate("MainRegion", "LoginWindow");
 | 
					                _regionManager.RegisterViewWithRegion("MainRegion", "LoginWindow");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
            }));
 | 
					            //}));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        void doMyPrismEvent2(AlertMsg msg)
 | 
					        void doMyPrismEvent2(AlertMsg msg)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue