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 @@