update permission and product

This commit is contained in:
Timi
2026-09-04 23:07:59 +08:00
parent 1df5748f54
commit fc9e6a5023
48 changed files with 1670 additions and 2475 deletions
+17 -1
View File
@@ -2,10 +2,26 @@ import type { EventBizType, EventItem } from "@/types/EventItem";
/** 返回事件业务类型的前端文案。 */
export function getEventBizTypeText(bizType?: EventBizType): string {
return bizType === "PACKAGE_PURCHASE" ? "套餐购买" : "普通登记";
if (bizType === "PACKAGE_PURCHASE") {
return "套餐购买";
}
if (bizType === "LEGACY_CONSUMPTION") {
return "历史消费(退役)";
}
return "普通登记";
}
/** 判断事件是否为套餐购买事件。 */
export function isPackagePurchaseEvent(event?: Pick<EventItem, "bizType">): boolean {
return event?.bizType === "PACKAGE_PURCHASE";
}
/** 判断事件是否为历史消费退役事件,此类事件不可再登记或作为规则触发对象。 */
export function isLegacyConsumptionEvent(event?: Pick<EventItem, "bizType">): boolean {
return event?.bizType === "LEGACY_CONSUMPTION";
}
/** 判断事件是否已退役,退役事件只能通过历史详情查看。 */
export function isRetiredEvent(event?: Pick<EventItem, "bizType">): boolean {
return isPackagePurchaseEvent(event) || isLegacyConsumptionEvent(event);
}