This commit is contained in:
15
src/config/constants/enableStatus.ts
Normal file
15
src/config/constants/enableStatus.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
/**
|
||||
* 启用状态配置
|
||||
* 用于一次性佣金、强充等功能的启用/未启用状态
|
||||
*/
|
||||
|
||||
// 启用状态选项(用于搜索表单和下拉选择)
|
||||
export const ENABLE_STATUS_OPTIONS = [
|
||||
{ label: '已启用', value: true },
|
||||
{ label: '未启用', value: false }
|
||||
]
|
||||
|
||||
// 获取启用状态文本
|
||||
export function getEnableStatusText(enabled: boolean): string {
|
||||
return enabled ? '已启用' : '未启用'
|
||||
}
|
||||
@@ -25,3 +25,9 @@ export * from './carrierTypes'
|
||||
|
||||
// 套餐管理相关
|
||||
export * from './package'
|
||||
|
||||
// 角色类型相关
|
||||
export * from './roleTypes'
|
||||
|
||||
// 启用状态相关
|
||||
export * from './enableStatus'
|
||||
|
||||
@@ -132,6 +132,14 @@ export const SHELF_STATUS_OPTIONS = [
|
||||
}
|
||||
]
|
||||
|
||||
/**
|
||||
* 上架状态选项(精简版,用于搜索表单和下拉选择)
|
||||
*/
|
||||
export const SHELF_STATUS_SELECT_OPTIONS = [
|
||||
{ label: '上架', value: ShelfStatus.ON_SHELF },
|
||||
{ label: '下架', value: ShelfStatus.OFF_SHELF }
|
||||
]
|
||||
|
||||
/**
|
||||
* 上架状态映射
|
||||
*/
|
||||
|
||||
25
src/config/constants/roleTypes.ts
Normal file
25
src/config/constants/roleTypes.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* 角色类型配置
|
||||
*/
|
||||
|
||||
import { RoleType } from '@/types/api'
|
||||
|
||||
// 角色类型选项
|
||||
export const ROLE_TYPE_OPTIONS = [
|
||||
{ label: '平台角色', value: RoleType.PLATFORM },
|
||||
{ label: '客户角色', value: RoleType.CUSTOMER }
|
||||
]
|
||||
|
||||
// 角色类型映射
|
||||
export const ROLE_TYPE_MAP = ROLE_TYPE_OPTIONS.reduce(
|
||||
(map, item) => {
|
||||
map[item.value] = item
|
||||
return map
|
||||
},
|
||||
{} as Record<RoleType, { label: string; value: RoleType }>
|
||||
)
|
||||
|
||||
// 获取角色类型标签
|
||||
export function getRoleTypeLabel(type: RoleType): string {
|
||||
return ROLE_TYPE_MAP[type]?.label || '未知'
|
||||
}
|
||||
Reference in New Issue
Block a user