improvements, fixes...
This commit is contained in:
parent
dd6d9f17b7
commit
4507f69f9e
|
|
@ -137,8 +137,8 @@
|
||||||
private TransferToDriversDetailGrid _transferToDriversGrid = null!;
|
private TransferToDriversDetailGrid _transferToDriversGrid = null!;
|
||||||
private LoggerClient<TransferToDriverGridComponent> _logger = null!;
|
private LoggerClient<TransferToDriverGridComponent> _logger = null!;
|
||||||
|
|
||||||
private List<Car> _cars = [];
|
private static List<Car> _cars = [];
|
||||||
private List<UserProductMapping> _drivers = [];
|
private static List<UserProductMapping> _drivers = [];
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
|
|
@ -146,23 +146,26 @@
|
||||||
|
|
||||||
_logger.Info($"DetailGridData: {ParentData.TransferToDrivers.Count}");
|
_logger.Info($"DetailGridData: {ParentData.TransferToDrivers.Count}");
|
||||||
|
|
||||||
_cars.AddRange((await AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCarsByProductId, [TiamConstClient.TransferProductId])) ?? []);
|
// _cars.AddRange((await AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCarsByProductId, [TiamConstClient.TransferProductId])) ?? []);
|
||||||
_drivers.AddRange(_cars.DistinctBy(x => x.UserProductMappingId).Select(x => x.UserProductMapping));
|
|
||||||
|
|
||||||
// //AdminSignalRClient.GetAllIntoAsync<Car>(_cars, SignalRTags.GetAllCarsByProductId, [TiamConstClient.TransferProductId])
|
|
||||||
// AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCarsByProductId, response =>
|
|
||||||
// {
|
|
||||||
// if (response.Status != SignalResponseStatus.Success || response.ResponseData == null)
|
|
||||||
// {
|
|
||||||
// _logger.Error($"GetAllAsync<List<Car>>(); status: {response.Status}; dataCount: {response.ResponseData?.Count}");
|
|
||||||
// return Task.CompletedTask;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _cars.AddRange(response.ResponseData);
|
|
||||||
// _drivers.AddRange(_cars.DistinctBy(x => x.UserProductMappingId).Select(x => x.UserProductMapping));
|
// _drivers.AddRange(_cars.DistinctBy(x => x.UserProductMappingId).Select(x => x.UserProductMapping));
|
||||||
|
|
||||||
// return Task.CompletedTask;
|
//AdminSignalRClient.GetAllIntoAsync<Car>(_cars, SignalRTags.GetAllCarsByProductId, [TiamConstClient.TransferProductId])
|
||||||
// }, [TiamConstClient.TransferProductId]).Forget();
|
AdminSignalRClient.GetAllAsync<List<Car>>(SignalRTags.GetAllCarsByProductId, async response =>
|
||||||
|
{
|
||||||
|
if (response.Status != SignalResponseStatus.Success || response.ResponseData == null)
|
||||||
|
{
|
||||||
|
_logger.Error($"GetAllAsync<List<Car>>(); status: {response.Status}; dataCount: {response.ResponseData?.Count}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
_cars.Clear();
|
||||||
|
_drivers.Clear();
|
||||||
|
|
||||||
|
_cars.AddRange(response.ResponseData);
|
||||||
|
_drivers.AddRange(_cars.DistinctBy(x => x.UserProductMappingId).Select(x => x.UserProductMapping));
|
||||||
|
|
||||||
|
await InvokeAsync(StateHasChanged);
|
||||||
|
}, [TiamConstClient.TransferProductId]).Forget();
|
||||||
|
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,42 +99,16 @@
|
||||||
private bool? _isNewState = null;
|
private bool? _isNewState = null;
|
||||||
private LoggerClient<UserProductMappingGridComponent> _logger;
|
private LoggerClient<UserProductMappingGridComponent> _logger;
|
||||||
|
|
||||||
private List<User> _users = [];
|
private static List<User> _users = [];
|
||||||
private List<Product> _products = [];
|
private static List<Product> _products = [];
|
||||||
|
|
||||||
protected override async Task OnInitializedAsync()
|
protected override async Task OnInitializedAsync()
|
||||||
{
|
{
|
||||||
_logger = new LoggerClient<UserProductMappingGridComponent>(LogWriters.ToArray());
|
_logger = new LoggerClient<UserProductMappingGridComponent>(LogWriters.ToArray());
|
||||||
|
|
||||||
//_products = (await AdminSignalRClient.GetAllAsync<List<Product>>(SignalRTags.GetAllProducts)) ?? [];
|
|
||||||
|
|
||||||
AdminSignalRClient.GetAllIntoAsync(_products, SignalRTags.GetAllProducts).Forget();
|
AdminSignalRClient.GetAllIntoAsync(_products, SignalRTags.GetAllProducts).Forget();
|
||||||
AdminSignalRClient.GetAllIntoAsync(_users, SignalRTags.GetAllUsers).Forget();
|
AdminSignalRClient.GetAllIntoAsync(_users, SignalRTags.GetAllUsers).Forget();
|
||||||
|
|
||||||
// AdminSignalRClient.GetAllAsync<List<Product>>(SignalRTags.GetAllProducts, response =>
|
|
||||||
// {
|
|
||||||
// if (response.Status != SignalResponseStatus.Success || response.ResponseData == null)
|
|
||||||
// {
|
|
||||||
// _logger.Error($"GetAllAsync<List<Car>>(); status: {response.Status}; dataCount: {response.ResponseData?.Count}");
|
|
||||||
// return Task.CompletedTask;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _products.AddRange(response.ResponseData);
|
|
||||||
// return Task.CompletedTask;
|
|
||||||
// }).Forget();
|
|
||||||
|
|
||||||
// AdminSignalRClient.GetAllAsync<List<User>>(SignalRTags.getal, response =>
|
|
||||||
// {
|
|
||||||
// if (response.Status != SignalResponseStatus.Success || response.ResponseData == null)
|
|
||||||
// {
|
|
||||||
// _logger.Error($"GetAllAsync<List<Car>>(); status: {response.Status}; dataCount: {response.ResponseData?.Count}");
|
|
||||||
// return Task.CompletedTask;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// _products.AddRange(response.ResponseData);
|
|
||||||
// return Task.CompletedTask;
|
|
||||||
// }).Forget();
|
|
||||||
|
|
||||||
await base.OnInitializedAsync();
|
await base.OnInitializedAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue