This commit is contained in:
陶坤
2024-05-15 18:49:11 +08:00
parent 65bb836721
commit e3d3726cbe
18 changed files with 446 additions and 70 deletions

View File

@ -61,7 +61,7 @@ namespace 货架标准上位机
}
}
public class Scanner()
public class Scanner
{
public SerialPortClient SerialPortClient { get; set; }

View File

@ -49,34 +49,34 @@ namespace 货架标准上位机.ViewModel
public async void AddUserControl()
{
//var dia = Dialog.Show(new TextDialog());
try
{
var body = new GetShelfStatusRequest()
{
UserName = "xxx",
DeviceType = "WCS前端",
GroupNames = LocalFile.Config.GroupName,
//try
//{
// var body = new GetShelfStatusRequest()
// {
// UserName = "xxx",
// DeviceType = "WCS前端",
// GroupNames = LocalFile.Config.GroupName,
};
var Result = await ApiHelp.Post<GetShelfStatusResponse>([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body);
if (Result != null && Result.Data?.Count > 0)
{
wrapPanel.Children.Clear();
Result.Data.ForEach(t =>
{
var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName);
wrapPanel.Children.Add(shelf);
});
}
}
catch (Exception ex)
{
// };
// var Result = await ApiHelp.Post<GetShelfStatusResponse>([LocalFile.Config.ApiIpHost, "home/getShelfStatus"], body);
// if (Result != null && Result.Data?.Count > 0)
// {
// wrapPanel.Children.Clear();
// Result.Data.ForEach(t =>
// {
// var shelf = new ShelfStatusControl(t.ShelfCode, t.CurentMode, t.GroupName);
// wrapPanel.Children.Add(shelf);
// });
// }
//}
//catch (Exception ex)
//{
}
finally
{
//dia.Close();
}
//}
//finally
//{
// //dia.Close();
//}
}
#endregion

View File

@ -108,7 +108,7 @@ namespace 货架标准上位机.ViewModel
}
Items.CanNotify = true;
}
public class DataModel()
public class DataModel
{
public string MatCode { get; set; }
}

View File

@ -120,7 +120,7 @@ namespace 货架标准上位机.ViewModel
}
Items.CanNotify = true;
}
public class DataModel()
public class DataModel
{
public string MatCode { get; set; }
}

View File

@ -128,43 +128,43 @@ namespace 货架标准上位机
/// </summary>
public static void NotLogin()
{
try
{
var body = new GetUsersRequest()
{
UserName = "admin",
DeviceType = "WCS前端",
Info = "123",
};
var Result = ApiHelp.Post<ResponseCommon<List<UserModel>>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result;
if (Result != null && Result.Data.Any())
{
UserInfoView.viewModel.User = Result.Data.First();
}
//try
//{
// var body = new GetUsersRequest()
// {
// UserName = "admin",
// DeviceType = "WCS前端",
// Info = "123",
// };
// var Result = ApiHelp.Post<ResponseCommon<List<UserModel>>>([LocalFile.Config.ApiIpHost, "user/getUsers"], body).Result;
// if (Result != null && Result.Data.Any())
// {
// UserInfoView.viewModel.User = Result.Data.First();
// }
var bodyRole = new GetUsersRequest()
{
UserName = "admin",
DeviceType = "WCS前端",
Info = "123",
// var bodyRole = new GetUsersRequest()
// {
// UserName = "admin",
// DeviceType = "WCS前端",
// Info = "123",
};
var ResultRole = ApiHelp.Post<ResponseCommon<List<RoleModel>>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result;
if (ResultRole != null && ResultRole.Data.Any())
{
UserInfoView.viewModel.Roles = ResultRole.Data;
}
// };
// var ResultRole = ApiHelp.Post<ResponseCommon<List<RoleModel>>>([LocalFile.Config.ApiIpHost, "user/getRoles"], body).Result;
// if (ResultRole != null && ResultRole.Data.Any())
// {
// UserInfoView.viewModel.Roles = ResultRole.Data;
// }
UserInfoView.viewModel.IsLogin = true;
}
catch (Exception ex)
{
Growl.Error("加载数据失败:" + ex.Message);
}
finally
{
//dia.Close();
}
// UserInfoView.viewModel.IsLogin = true;
//}
//catch (Exception ex)
//{
// Growl.Error("加载数据失败:" + ex.Message);
//}
//finally
//{
// //dia.Close();
//}
}
//接口获取User对象