rwadurian/frontend/admin-web/src/utils/constants.ts

157 lines
3.5 KiB
TypeScript

// 应用常量定义
// 分页配置
export const PAGINATION = {
DEFAULT_PAGE: 1,
DEFAULT_PAGE_SIZE: 10,
PAGE_SIZE_OPTIONS: [10, 20, 50, 100],
} as const;
// 用户角色
export const USER_ROLES = {
SUPER_ADMIN: 'super_admin',
OPERATOR: 'operator',
ANALYST: 'analyst',
} as const;
export const USER_ROLE_LABELS: Record<string, string> = {
super_admin: '超级管理员',
operator: '运营人员',
analyst: '数据分析员',
};
// 用户状态
export const USER_STATUS = {
ACTIVE: 'active',
INACTIVE: 'inactive',
} as const;
export const USER_STATUS_LABELS: Record<string, string> = {
active: '活跃',
inactive: '停用',
};
// 授权状态
export const AUTH_STATUS = {
AUTHORIZED: 'authorized',
PENDING: 'pending',
UNAUTHORIZED: 'unauthorized',
} as const;
export const AUTH_STATUS_LABELS: Record<string, string> = {
authorized: '已授权',
pending: '待授权',
unauthorized: '未授权',
};
// 考核周期
export const ASSESSMENT_CYCLES = {
MONTHLY: 'monthly',
QUARTERLY: 'quarterly',
} as const;
export const ASSESSMENT_CYCLE_LABELS: Record<string, string> = {
monthly: '月度',
quarterly: '季度',
};
// 结算货币
export const CURRENCIES = ['BNB', 'OG', '积分', 'DST'] as const;
// 龙虎榜类型
export const LEADERBOARD_TYPES = {
DAILY: 'daily',
WEEKLY: 'weekly',
MONTHLY: 'monthly',
} as const;
export const LEADERBOARD_TYPE_LABELS: Record<string, string> = {
daily: '日榜',
weekly: '周榜',
monthly: '月榜',
};
// 收益来源
export const REVENUE_SOURCES = {
MINING: 'mining',
ADOPTION_COMPLETION: 'adoption_completion',
SHARE: 'share',
} as const;
export const REVENUE_SOURCE_LABELS: Record<string, string> = {
mining: '挖矿收益',
adoption_completion: '认种完成奖励',
share: '分享奖励',
};
// 活动类型
export const ACTIVITY_TYPES = {
USER_REGISTER: 'user_register',
COMPANY_ACTIVITY: 'company_activity',
SYSTEM_UPDATE: 'system_update',
REPORT_GENERATED: 'report_generated',
} as const;
export const ACTIVITY_TYPE_LABELS: Record<string, string> = {
user_register: '用户注册',
company_activity: '公司动态',
system_update: '系统更新',
report_generated: '报表生成',
};
// 时间范围选项
export const TIME_RANGE_OPTIONS = [
{ label: '7天', value: '7d' },
{ label: '30天', value: '30d' },
{ label: '90天', value: '90d' },
{ label: '本月', value: 'month' },
{ label: '本季度', value: 'quarter' },
{ label: '本年度', value: 'year' },
] as const;
// 省份列表
export const PROVINCES = [
'北京市',
'天津市',
'河北省',
'山西省',
'内蒙古自治区',
'辽宁省',
'吉林省',
'黑龙江省',
'上海市',
'江苏省',
'浙江省',
'安徽省',
'福建省',
'江西省',
'山东省',
'河南省',
'湖北省',
'湖南省',
'广东省',
'广西壮族自治区',
'海南省',
'重庆市',
'四川省',
'贵州省',
'云南省',
'西藏自治区',
'陕西省',
'甘肃省',
'青海省',
'宁夏回族自治区',
'新疆维吾尔自治区',
'台湾省',
'香港特别行政区',
'澳门特别行政区',
] as const;
// 文档分类
export const DOCUMENT_CATEGORIES = {
SYSTEM_SETTINGS: '系统设置',
ACCOUNT_SECURITY: '账号安全',
DATA_STATISTICS: '数据统计',
AUTHORIZATION_MANAGEMENT: '授权管理',
} as const;