feat(utils): add common utility functions and validation constants

This commit is contained in:
Ray.Hao
2025-11-18 18:25:21 +08:00
parent a0b714999e
commit dc79401c13
14 changed files with 548 additions and 201 deletions

View File

@@ -0,0 +1,12 @@
/**
* 通用对话框模式枚举
* @description 定义对话框的操作模式(创建、编辑、查看)
*/
export enum DialogMode {
/** 创建模式 - 新增数据 */
CREATE = "create",
/** 编辑模式 - 修改数据 */
EDIT = "edit",
/** 查看模式 - 只读展示 */
VIEW = "view",
}

View File

@@ -0,0 +1,22 @@
/**
* 通用状态枚举
* 适用于大多数业务实体的启用/禁用状态
*/
export enum CommonStatus {
/** 禁用 */
DISABLED = 0,
/** 启用 */
ENABLED = 1,
}
/**
* 审核状态枚举
*/
export enum AuditStatus {
/** 待审核 */
PENDING = 0,
/** 已通过 */
APPROVED = 1,
/** 已拒绝 */
REJECTED = 2,
}

View File

@@ -8,4 +8,8 @@ export * from "./settings/theme-enum";
export * from "./settings/locale-enum";
export * from "./settings/device-enum";
export * from "./common/dialog-enum";
export * from "./common/status-enum";
export * from "./system/menu-enum";
export * from "./system/user-enum";

View File

@@ -0,0 +1,11 @@
/**
* 用户性别枚举
*/
export enum UserGender {
/** 未知 */
UNKNOWN = 0,
/** 男 */
MALE = 1,
/** 女 */
FEMALE = 2,
}