feat(后台): 日期筛选统一默认当天(7 页 + 告警铃铛),并带上看板列改造的在途改动

- utils/datetime 新增 todayDateInput()/todayDateTimeRange(),8 处日期筛选的初值与「重置」都锁当天;
  撞款监控按口径排除(该页日期是 ASIN 上架时间,默认当天会让首屏几乎为空)。
- NotificationBell 的 hasFilter 不再把日期计入:日期恒有值是默认视图,计入会让
  「无筛选才记录已提醒 id」那条分支永久失效。
- 新增护栏 tests/date-filter-default-today.test.ts(6 例,变异自证 3/3 转红):
  凡带日期控件的页面没接入当天默认就红,不等人工发现首屏是空的。
- 同批带上另一路会话的看板在途改动(task-center-model 的 tabCount/完成数口径、
  TaskCenterBoardPage 列改造与对应用例):它与本页的日期默认改动落在同一文件,
  拆开会让单次提交编译不过,故按现状一起上。
This commit is contained in:
2026-10-04 01:19:28 +08:00
parent f1269f3117
commit 5b8cf59d30
13 changed files with 353 additions and 84 deletions
@@ -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)
}