From 068d44c53e879ef0559515fa17174fd302011920 Mon Sep 17 00:00:00 2001 From: geht <2947093423@qq.com> Date: Sat, 9 May 2026 15:55:36 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=85=A8=E9=87=8F=E6=8B=89?= =?UTF-8?q?=E5=8F=96=E5=8A=9F=E8=83=BD=EF=BC=8C=E5=85=81=E8=AE=B8=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E4=BB=8E=E8=BF=9C=E7=A8=8B=E5=90=8C=E6=AD=A5=E6=89=80?= =?UTF-8?q?=E6=9C=89=E7=89=A9=E6=96=99=E6=95=B0=E6=8D=AE=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E7=94=A8=E6=88=B7=E4=BD=93=E9=AA=8C=E3=80=82=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E5=89=8D=E7=AB=AF=E8=A7=86=E5=9B=BE=E4=BB=A5=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E6=96=B0=E5=91=BD=E4=BB=A4=EF=BC=8C=E5=B9=B6=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=90=8C=E6=AD=A5=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86?= =?UTF-8?q?=EF=BC=8C=E7=A1=AE=E4=BF=9D=E6=93=8D=E4=BD=9C=E7=9A=84=E5=AE=89?= =?UTF-8?q?=E5=85=A8=E6=80=A7=E5=92=8C=E5=8F=8D=E9=A6=88=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MixerMaterialListViewModel.cs | 23 +++++++++++++++++++ .../MixerMaterial/MixerMaterialListView.xaml | 7 ++++++ 2 files changed, 30 insertions(+) diff --git a/yy-admin-master/YY.Admin/ViewModels/MixerMaterial/MixerMaterialListViewModel.cs b/yy-admin-master/YY.Admin/ViewModels/MixerMaterial/MixerMaterialListViewModel.cs index fc400fd..00530a3 100644 --- a/yy-admin-master/YY.Admin/ViewModels/MixerMaterial/MixerMaterialListViewModel.cs +++ b/yy-admin-master/YY.Admin/ViewModels/MixerMaterial/MixerMaterialListViewModel.cs @@ -84,9 +84,13 @@ public class MixerMaterialListViewModel : BaseViewModel public string ToggleExpandButtonText => _isTreeAllExpanded ? "折叠全部" : "展开全部"; + private bool _isSyncing; + public bool IsSyncing { get => _isSyncing; set => SetProperty(ref _isSyncing, value); } + public DelegateCommand SearchCommand { get; } public DelegateCommand ResetCommand { get; } public DelegateCommand AddCommand { get; } + public DelegateCommand PullAllCommand { get; } public DelegateCommand EditCommand { get; } public DelegateCommand DeleteCommand { get; } public DelegateCommand PrevPageCommand { get; } @@ -120,6 +124,25 @@ public class MixerMaterialListViewModel : BaseViewModel PrevPageCommand = new DelegateCommand(async () => { if (PageNo > 1) { PageNo--; await LoadAsync(); } }); NextPageCommand = new DelegateCommand(async () => { if ((long)PageNo * PageSize < Total) { PageNo++; await LoadAsync(); } }); ToggleExpandCommand = new DelegateCommand(ToggleExpand); + PullAllCommand = new DelegateCommand(async () => + { + if (IsSyncing) return; + IsSyncing = true; + try + { + await _mixerMaterialService.SyncFromRemoteAsync(); + await LoadAsync(); + Growl.Success("全量拉取完成!"); + } + catch (Exception ex) + { + Growl.Error($"全量拉取失败:{ex.Message}"); + } + finally + { + IsSyncing = false; + } + }); _materialChangedToken = _eventAggregator .GetEvent() diff --git a/yy-admin-master/YY.Admin/Views/MixerMaterial/MixerMaterialListView.xaml b/yy-admin-master/YY.Admin/Views/MixerMaterial/MixerMaterialListView.xaml index bbdcdbe..02b3edb 100644 --- a/yy-admin-master/YY.Admin/Views/MixerMaterial/MixerMaterialListView.xaml +++ b/yy-admin-master/YY.Admin/Views/MixerMaterial/MixerMaterialListView.xaml @@ -93,6 +93,13 @@ +