From 5b8cf59d306f35bb7861cf5b26902b220b4ad6ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E8=87=AA=E8=BE=BE?= <980324341@qq.com> Date: Sun, 4 Oct 2026 01:19:28 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=90=8E=E5=8F=B0):=20=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=AD=9B=E9=80=89=E7=BB=9F=E4=B8=80=E9=BB=98=E8=AE=A4=E5=BD=93?= =?UTF-8?q?=E5=A4=A9=EF=BC=887=20=E9=A1=B5=20+=20=E5=91=8A=E8=AD=A6?= =?UTF-8?q?=E9=93=83=E9=93=9B=EF=BC=89=EF=BC=8C=E5=B9=B6=E5=B8=A6=E4=B8=8A?= =?UTF-8?q?=E7=9C=8B=E6=9D=BF=E5=88=97=E6=94=B9=E9=80=A0=E7=9A=84=E5=9C=A8?= =?UTF-8?q?=E9=80=94=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - utils/datetime 新增 todayDateInput()/todayDateTimeRange(),8 处日期筛选的初值与「重置」都锁当天; 撞款监控按口径排除(该页日期是 ASIN 上架时间,默认当天会让首屏几乎为空)。 - NotificationBell 的 hasFilter 不再把日期计入:日期恒有值是默认视图,计入会让 「无筛选才记录已提醒 id」那条分支永久失效。 - 新增护栏 tests/date-filter-default-today.test.ts(6 例,变异自证 3/3 转红): 凡带日期控件的页面没接入当天默认就红,不等人工发现首屏是空的。 - 同批带上另一路会话的看板在途改动(task-center-model 的 tabCount/完成数口径、 TaskCenterBoardPage 列改造与对应用例):它与本页的日期默认改动落在同一文件, 拆开会让单次提交编译不过,故按现状一起上。 --- .../src/components/NotificationBell.vue | 12 ++- .../src/pages/account/UserSecretUsagePage.vue | 11 ++- .../src/pages/asin/DedupeRegistryPage.vue | 4 +- .../src/pages/records/DeviceLogsPage.vue | 60 +++++++----- .../src/pages/records/RecordsHistoryPage.vue | 5 +- .../pages/task-center/TaskCenterBoardPage.vue | 76 +++++++++----- .../pages/task-center/task-center-model.ts | 34 +++++-- .../src/pages/tasks/ImageVideoTasksPage.vue | 9 +- .../src/pages/tasks/ShopDataTasksPage.vue | 9 +- admin-frontend-vue/src/utils/datetime.ts | 11 +++ .../tests/date-filter-default-today.test.ts | 98 +++++++++++++++++++ .../tests/task-center-board.test.ts | 97 ++++++++++++++++-- docs/specs/16-client-task-console.md | 11 ++- 13 files changed, 353 insertions(+), 84 deletions(-) create mode 100644 admin-frontend-vue/tests/date-filter-default-today.test.ts diff --git a/admin-frontend-vue/src/components/NotificationBell.vue b/admin-frontend-vue/src/components/NotificationBell.vue index 258c0b8c9..48b165889 100644 --- a/admin-frontend-vue/src/components/NotificationBell.vue +++ b/admin-frontend-vue/src/components/NotificationBell.vue @@ -145,6 +145,7 @@ import { readLastNotifiedId, writeLastNotifiedId, } from '@/layout/notification-bell-model' +import { todayDateInput } from '@/utils/datetime' const PAGE_SIZE = 10 @@ -162,13 +163,14 @@ const loading = ref(false) const markingAll = ref(false) const loadError = ref('') const keyword = ref('') -const startDate = ref('') -const endDate = ref('') +const startDate = ref(todayDateInput()) +const endDate = ref(todayDateInput()) const badgeText = computed(() => formatUnreadBadge(unreadCount.value)) const groupedItems = computed(() => groupNotificationsByDay(items.value)) const totalPages = computed(() => Math.max(1, Math.ceil(total.value / PAGE_SIZE))) -const hasFilter = computed(() => Boolean(keyword.value.trim() || startDate.value || endDate.value)) +/** 日期恒为「当天」是默认视图、不算主动筛选:若计入,下方「无筛选才记录已提醒 id」的分支会永久失效。 */ +const hasFilter = computed(() => Boolean(keyword.value.trim())) /** * el-date-picker 的绑定桥:日期区间在内部仍用 startDate/endDate 两个 ref 表示 @@ -279,8 +281,8 @@ function onKeywordInput() { function resetFilters() { keyword.value = '' - startDate.value = '' - endDate.value = '' + startDate.value = todayDateInput() + endDate.value = todayDateInput() void loadPage(1) } diff --git a/admin-frontend-vue/src/pages/account/UserSecretUsagePage.vue b/admin-frontend-vue/src/pages/account/UserSecretUsagePage.vue index 5eac0d9c8..d6ff78a3e 100644 --- a/admin-frontend-vue/src/pages/account/UserSecretUsagePage.vue +++ b/admin-frontend-vue/src/pages/account/UserSecretUsagePage.vue @@ -2,6 +2,7 @@ import { computed, onMounted, ref } from 'vue' import { ElMessage } from 'element-plus' import OldPagination from '@/components/OldPagination.vue' +import { todayDateInput } from '@/utils/datetime' import { fetchUserSecretUsage, type AdminUserSecretUsageRow, @@ -19,8 +20,8 @@ const total = ref(0) const page = ref(1) const pageSize = ref(15) const keyword = ref('') -const startDate = ref('') -const endDate = ref('') +const startDate = ref(todayDateInput()) +const endDate = ref(todayDateInput()) const groupFilter = ref(null) const groupOptions = ref([]) @@ -68,8 +69,8 @@ function search() { function reset() { keyword.value = '' - startDate.value = '' - endDate.value = '' + startDate.value = todayDateInput() + endDate.value = todayDateInput() groupFilter.value = null page.value = 1 load() @@ -180,7 +181,7 @@ onMounted(load) - {{ keyword || startDate || endDate || groupFilter ? '暂无匹配记录' : '暂无用量记录' }} + {{ keyword || groupFilter ? '暂无匹配记录' : '暂无用量记录' }} diff --git a/admin-frontend-vue/src/pages/asin/DedupeRegistryPage.vue b/admin-frontend-vue/src/pages/asin/DedupeRegistryPage.vue index f23fc117b..16620a620 100644 --- a/admin-frontend-vue/src/pages/asin/DedupeRegistryPage.vue +++ b/admin-frontend-vue/src/pages/asin/DedupeRegistryPage.vue @@ -1,5 +1,5 @@ - 加载中... + 加载中... - - {{ keyword || sourceFilter || startDate || endDate ? '暂无匹配日志' : '暂无日志上报(客户端/采集机上报后自动出现在这里)' }} + + {{ sourceFilter || uidFilter ? '暂无匹配日志' : '暂无日志上报(客户端/采集机上报后自动出现在这里)' }} diff --git a/admin-frontend-vue/src/pages/records/RecordsHistoryPage.vue b/admin-frontend-vue/src/pages/records/RecordsHistoryPage.vue index 3436f2722..75ec56421 100644 --- a/admin-frontend-vue/src/pages/records/RecordsHistoryPage.vue +++ b/admin-frontend-vue/src/pages/records/RecordsHistoryPage.vue @@ -1,7 +1,7 @@