|
@@ -11,34 +11,8 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
{
|
|
{
|
|
public partial class PersonalInfoPageViewModel : ObservableValidator
|
|
public partial class PersonalInfoPageViewModel : ObservableValidator
|
|
{
|
|
{
|
|
- [ObservableProperty]
|
|
|
|
- private string _loginName = string.Empty;
|
|
|
|
-
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _userName = string.Empty;
|
|
|
|
-
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _supervisionUnitName = string.Empty;
|
|
|
|
-
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _roleDesc = string.Empty;
|
|
|
|
-
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _idNumber = string.Empty;
|
|
|
|
-
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _registerDate = string.Empty;
|
|
|
|
-
|
|
|
|
- //所属企业、监管单位可见状态
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _companyVisible = "Visible";//Visible Collapsed
|
|
|
|
-
|
|
|
|
- //单位可见状态
|
|
|
|
- [ObservableProperty]
|
|
|
|
- private string _supervisionVisible = "Collapsed";//Visible Collapsed
|
|
|
|
-
|
|
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
- private string? _companyName;
|
|
|
|
|
|
+ private UserModel? _currentUser;
|
|
|
|
|
|
[ObservableProperty]
|
|
[ObservableProperty]
|
|
[Required(ErrorMessage = "原密码不能为空")]
|
|
[Required(ErrorMessage = "原密码不能为空")]
|
|
@@ -61,26 +35,8 @@ namespace UniformMaterialManagementSystem.ViewModels
|
|
{
|
|
{
|
|
_userService = service;
|
|
_userService = service;
|
|
if (App.CurrentUser == null) return;
|
|
if (App.CurrentUser == null) return;
|
|
- UserModel userModel = new UserModel(App.CurrentUser);
|
|
|
|
-
|
|
|
|
- //初始化界面数据
|
|
|
|
- LoginName = userModel.LoginName;
|
|
|
|
- UserName = userModel.UserName;
|
|
|
|
- SupervisionUnitName = userModel.SupervisionUnitName;
|
|
|
|
- RoleDesc = userModel.RoleDesc;
|
|
|
|
- IdNumber = userModel.IdNumber;
|
|
|
|
- RegisterDate = userModel.RegisterDate.ToString("yyyy-MM-dd");
|
|
|
|
- CompanyName = userModel.CompanyName;
|
|
|
|
- if (userModel.RoleName.Contains("CompanyName")) //企业端
|
|
|
|
- {
|
|
|
|
- CompanyVisible = "Visible";
|
|
|
|
- SupervisionVisible = "Collapsed";
|
|
|
|
- }
|
|
|
|
- else if (userModel.RoleName.Contains("Supervision")) //区域站端
|
|
|
|
- {
|
|
|
|
- CompanyVisible = "Collapsed";
|
|
|
|
- SupervisionVisible = "Visible";
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
+ CurrentUser = new UserModel(App.CurrentUser);
|
|
}
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
/// <summary>
|