From a753bc5a4f9c5ada244ba383831ae5f7a5b1e97d Mon Sep 17 00:00:00 2001 From: geht <2947093423@qq.com> Date: Wed, 6 May 2026 17:17:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E4=BE=9B=E5=BA=94=E5=95=86?= =?UTF-8?q?=E5=88=97=E8=A1=A8=E8=A7=86=E5=9B=BE=E7=9A=84=E5=88=86=E9=A1=B5?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E6=B7=BB=E5=8A=A0=E4=B8=8A=E4=B8=80?= =?UTF-8?q?=E9=A1=B5=E5=92=8C=E4=B8=8B=E4=B8=80=E9=A1=B5=E5=91=BD=E4=BB=A4?= =?UTF-8?q?=E3=80=82=E4=BC=98=E5=8C=96=E6=90=9C=E7=B4=A2=E5=92=8C=E9=87=8D?= =?UTF-8?q?=E7=BD=AE=E5=91=BD=E4=BB=A4=EF=BC=8C=E7=A1=AE=E4=BF=9D=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=8F=B7=E6=9B=B4=E6=96=B0=E6=97=B6=E8=A7=A6=E5=8F=91?= =?UTF-8?q?=E5=B1=9E=E6=80=A7=E5=8F=98=E5=8C=96=E3=80=82=E6=9B=B4=E6=96=B0?= =?UTF-8?q?=E4=BE=9B=E5=BA=94=E5=95=86=E8=BF=87=E6=BB=A4=E5=99=A8=E7=9A=84?= =?UTF-8?q?=E7=95=8C=E9=9D=A2=EF=BC=8C=E5=A2=9E=E5=BC=BA=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=BD=93=E9=AA=8C=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Supplier/SupplierListViewModel.cs | 28 +++- .../Views/Supplier/SupplierListView.xaml | 124 +++++++++++++++--- .../Views/Vehicle/VehicleListView.xaml | 36 ----- 3 files changed, 135 insertions(+), 53 deletions(-) diff --git a/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs b/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs index 18918eb..2a53afb 100644 --- a/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs +++ b/yy-admin-master/YY.Admin/ViewModels/Supplier/SupplierListViewModel.cs @@ -37,6 +37,8 @@ public class SupplierListViewModel : BaseViewModel public DelegateCommand EditCommand { get; } public DelegateCommand DeleteCommand { get; } public DelegateCommand ToggleStatusCommand { get; } + public DelegateCommand PrevPageCommand { get; } + public DelegateCommand NextPageCommand { get; } public SupplierListViewModel( ISupplierService supplierService, @@ -47,17 +49,41 @@ public class SupplierListViewModel : BaseViewModel { _supplierService = supplierService; _dictSyncService = dictSyncService; - SearchCommand = new DelegateCommand(async () => { PageNo = 1; await LoadAsync(); }); + SearchCommand = new DelegateCommand(async () => + { + PageNo = 1; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + }); ResetCommand = new DelegateCommand(async () => { FilterSupplierCode = FilterSupplierName = FilterSupplierShortName = FilterErpCode = FilterStatus = null; PageNo = 1; + RaisePropertyChanged(nameof(PageNo)); await LoadAsync(); }); AddCommand = new DelegateCommand(async () => await ShowAddDialogAsync()); EditCommand = new DelegateCommand(async s => await ShowEditDialogAsync(s)); DeleteCommand = new DelegateCommand(async s => await DeleteAsync(s)); ToggleStatusCommand = new DelegateCommand(async s => await ToggleStatusAsync(s)); + PrevPageCommand = new DelegateCommand(async () => + { + if (PageNo > 1) + { + PageNo--; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + } + }); + NextPageCommand = new DelegateCommand(async () => + { + if ((long)PageNo * PageSize < Total) + { + PageNo++; + RaisePropertyChanged(nameof(PageNo)); + await LoadAsync(); + } + }); _supplierChangedToken = _eventAggregator.GetEvent() .Subscribe(async p => await OnSupplierChangedAsync(p), ThreadOption.UIThread); diff --git a/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml b/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml index bf32544..8d55638 100644 --- a/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml +++ b/yy-admin-master/YY.Admin/Views/Supplier/SupplierListView.xaml @@ -9,33 +9,115 @@ prism:ViewModelLocator.AutoWireViewModel="True" mc:Ignorable="d"> - + + + + + + - - - - - + + + + + + + + + + + + + - - - + + + - + + + + + + - - - - - - + + + + + + @@ -79,5 +161,15 @@ + + + + + - @@ -114,36 +108,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - -