From 6ef047050db1b5070744048f06894f9c34131728 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 9 Apr 2026 12:28:30 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=B0=86=E8=AE=A2=E9=98=85?= =?UTF-8?q?=E5=92=8C=E6=8F=92=E4=BB=B6=E8=BF=87=E6=BB=A4=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E7=AB=99=E7=82=B9=E7=AE=A1=E7=90=86=E9=A3=8E?= =?UTF-8?q?=E6=A0=BC=E7=9A=84=E4=B8=8B=E6=8B=89=E5=88=97=E8=A1=A8=E8=8F=9C?= =?UTF-8?q?=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/subscribe.vue | 80 ++++---- src/views/plugin/PluginCardListView.vue | 234 +++++++++++++++--------- 2 files changed, 192 insertions(+), 122 deletions(-) diff --git a/src/pages/subscribe.vue b/src/pages/subscribe.vue index 038fb520..13c83e2f 100644 --- a/src/pages/subscribe.vue +++ b/src/pages/subscribe.vue @@ -82,14 +82,25 @@ const filterOptions = computed(() => { ] }) -// 计算筛选按钮颜色 +// 当前选中的筛选选项 +const currentFilter = computed(() => { + return filterOptions.value.find(option => option.value === (subscribeStatusFilter.value || 'all')) +}) + +// 计算筛选按钮颜色 - 有名称筛选或状态筛选时高亮 const filterButtonColor = computed(() => { if (subscribeFilter.value || (subscribeStatusFilter.value && subscribeStatusFilter.value !== 'all')) { - return 'primary' + return currentFilter.value?.color || 'primary' } return 'gray' }) +// 选择筛选选项 +function selectFilter(value: string) { + subscribeStatusFilter.value = value + filterSubscribeDialog.value = false +} + // VMenu activator选择器 const filterActivator = computed(() => '[data-menu-activator="filter-btn"]') const searchActivator = computed(() => '[data-menu-activator="search-btn"]') @@ -200,44 +211,47 @@ onMounted(() => { - + - - - - - {{ t('subscribe.filterSubscriptions') }} - - - - - - - - - - - - - - - - + + +
+ +
+ + + + {{ t('common.status') }} + + + {{ option.label }} + + +
diff --git a/src/views/plugin/PluginCardListView.vue b/src/views/plugin/PluginCardListView.vue index 20726059..977d06a7 100644 --- a/src/views/plugin/PluginCardListView.vue +++ b/src/views/plugin/PluginCardListView.vue @@ -219,6 +219,16 @@ const isFilterFormEmpty = computed(() => { ) }) +// 切换市场过滤器多选项 +function toggleMarketFilter(field: 'author' | 'label' | 'repo', value: string) { + const index = filterForm[field].indexOf(value) + if (index > -1) { + filterForm[field].splice(index, 1) + } else { + filterForm[field].push(value) + } +} + // 插件过滤条件 const installedFilter = ref(null) @@ -1289,113 +1299,159 @@ function onDragStartPlugin(evt: any) {