add dateFilter.ts

This commit is contained in:
Timi
2026-10-22 15:16:53 +08:00
parent bba4a2d4d6
commit d31441481e
14 changed files with 48 additions and 132 deletions
+1 -10
View File
@@ -175,6 +175,7 @@ import PointAPI from "@/api/PointAPI";
import CustomerSelector from "@/components/CustomerSelector.vue";
import type { PointRedemption, PointRedemptionStatus } from "@/types/Point";
import { buildPresetDateRange, parseDateFilterType, parseDateTime } from "@/utils/date";
import { DATE_FILTER_OPTIONS as dateOptions, type DateFilterType } from "@/utils/dateFilter";
import { Message } from "@/utils/message";
import { formatWanInteger } from "@/utils/money";
import { getPackageQuantityText } from "@/utils/package";
@@ -188,16 +189,6 @@ defineOptions({ name: "PointRedemptionList" });
const route = useRoute();
const router = useRouter();
const result = reactive({ total: 0, list: [] as PointRedemption[] });
type DateFilterType = "today" | "yesterday" | "thisWeek" | "thisMonth" | "lastMonth" | "all" | "custom";
const dateOptions: Array<{ label: string; value: DateFilterType }> = [
{ label: "今天", value: "today" },
{ label: "昨天", value: "yesterday" },
{ label: "本周", value: "thisWeek" },
{ label: "本月", value: "thisMonth" },
{ label: "上个月", value: "lastMonth" },
{ label: "全部", value: "all" },
{ label: "自定义范围", value: "custom" }
];
const keyword = ref(getQueryText(route.query.keyword));
const customerId = ref(getQueryText(route.query.customerId));
const selectedCustomer = ref<Customer>();