Przeglądaj źródła

fix(web): 统一账单明细自然月筛选组件

sy 2 dni temu
rodzic
commit
33774e5506
1 zmienionych plików z 3 dodań i 6 usunięć
  1. 3 6
      web-scaffold/src/pages/SettlementRecordPages.tsx

+ 3 - 6
web-scaffold/src/pages/SettlementRecordPages.tsx

@@ -33,7 +33,6 @@ import {
 } from "../lib/recon";
 import {
   ACTION_FLAG_PENDING_NOTE,
-  ALL_PERIODS_LABEL,
   BACK_TO_BILL_LIST,
   BACK_TO_RECON_LIST,
   BACKEND_NOT_WIRED,
@@ -802,7 +801,8 @@ export function SettlementBillListPage() {
   const table = useSettlementLedgerTable(billColumns);
   const q = filters.get("q");
   const type = filters.get("type");
-  const month = filters.get("month");
+  const monthParam = filters.get("month");
+  const month = monthParam === "all" ? "" : monthParam;
   const page = Number(filters.get("page") || "1") || 1;
   const hasFilter = Boolean(q || type || month);
 
@@ -839,10 +839,7 @@ export function SettlementBillListPage() {
             <option value="partner">{HOLDER_TYPE_TEXT.partner}</option>
             <option value="ops_team">{HOLDER_TYPE_TEXT.ops_team}</option>
           </FilterSelect>
-          <FilterSelect icon="month" aria-label="自然月" value={month} onChange={(event) => { filters.set("page", ""); filters.set("month", event.target.value); }}>
-            <option value="">{ALL_PERIODS_LABEL}</option>
-            {(periods ?? []).map((p) => <option key={p} value={p}>{p}</option>)}
-          </FilterSelect>
+          <MonthFilter value={month} availableMonths={periods ?? (month ? [month] : [])} onChange={(value) => filters.set("month", value, true)} />
           {hasFilter && <Button variant="ghost" size="sm" onClick={filters.reset}>重置筛选</Button>}
         </div>