From 1a80f5482f1cedfe3547ac809b9c871920fd8960 Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 4 Feb 2026 19:27:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=9B=B2=E7=9B=92=E6=A8=A1=E5=BC=8F?= =?UTF-8?q?=E7=A6=81=E7=94=A8=E4=BB=BB=E5=8A=A1=E6=90=9C=E7=B4=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 盲盒模式下禁用搜索框并清空关键词,同时请求参数忽略关键词。 --- frontend/src/components/TaskFilters.vue | 22 +++++++++++++++++++++- frontend/src/views/TaskHall.vue | 21 ++++++++++++++++++--- 2 files changed, 39 insertions(+), 4 deletions(-) diff --git a/frontend/src/components/TaskFilters.vue b/frontend/src/components/TaskFilters.vue index 511f177..8d1104c 100644 --- a/frontend/src/components/TaskFilters.vue +++ b/frontend/src/components/TaskFilters.vue @@ -4,8 +4,9 @@
@@ -287,6 +288,11 @@ const props = defineProps({ type: String, default: '搜索任务编号、标题、SPU信息、发布人...' }, + // 是否禁用搜索 + disableSearch: { + type: Boolean, + default: false + }, // 统计文本 statsText: { type: String, @@ -418,10 +424,24 @@ watch( // 筛选条件变更 const handleFilterChange = () => { + if (props.disableSearch) { + localFilters.keyword = undefined + } emit('update:modelValue', { ...localFilters }) emit('change', { ...localFilters }) } +watch( + () => props.disableSearch, + (disabled) => { + if (disabled && localFilters.keyword) { + localFilters.keyword = undefined + emit('update:modelValue', { ...localFilters }) + emit('change', { ...localFilters }) + } + } +) + // 重置筛选条件 const handleReset = () => { localFilters.keyword = undefined diff --git a/frontend/src/views/TaskHall.vue b/frontend/src/views/TaskHall.vue index 6928385..1ab362a 100644 --- a/frontend/src/views/TaskHall.vue +++ b/frontend/src/views/TaskHall.vue @@ -77,6 +77,8 @@ :sort-options="availableSortOptions" :status-options="availableStatusOptions" status-placeholder="任务状态" + :disable-search="showBlindBox" + :search-placeholder="showBlindBox ? '盲盒模式下不可搜索' : '搜索任务编号、标题、SPU信息、发布人...'" :show-receiving-dept="true" :demand-types="demandTypes" :task-sub-types="taskSubTypes" @@ -2490,7 +2492,7 @@