fix: some
Some checks failed
构建并部署前端到测试环境 / build-and-deploy (push) Has been cancelled

This commit is contained in:
luo
2026-09-17 18:37:20 +08:00
parent 068d0c4ac2
commit 68d8f769d1
21 changed files with 1281 additions and 85 deletions

View File

@@ -43,3 +43,6 @@ export * from './packageTrafficAlert'
export * from './bulkPurchase'
export * from './julyIteration'
export * from './augustIteration'
// 轮询优先队列相关
export * from './pollingPriorityQueue'

View File

@@ -0,0 +1,71 @@
/**
* 轮询优先队列相关常量
* 对应 docs/产品迭代8月份/优先队列.md
*/
import type {
PollingPriorityTaskType,
PollingPriorityItemStatus,
PollingPriorityTriggerType,
PollingPriorityResult
} from '@/types/api'
/** 任务类型选项 */
export const POLLING_PRIORITY_TASK_TYPE_OPTIONS: Array<{
label: string
value: PollingPriorityTaskType
}> = [
{ label: '实名检查', value: 'polling:realname' },
{ label: '流量检查', value: 'polling:carddata' },
{ label: '套餐检查', value: 'polling:package' },
{ label: '卡状态检查', value: 'polling:card_status' }
]
export const getPollingPriorityTaskTypeName = (
taskType?: PollingPriorityTaskType | string | null
) =>
POLLING_PRIORITY_TASK_TYPE_OPTIONS.find((item) => item.value === taskType)?.label ||
String(taskType || '-')
/** 状态选项 */
export const POLLING_PRIORITY_STATUS_OPTIONS: Array<{
label: string
value: PollingPriorityItemStatus
}> = [
{ label: '待处理', value: 'pending' },
{ label: '处理中', value: 'processing' },
{ label: '已完成', value: 'completed' },
{ label: '失败', value: 'failed' }
]
export const getPollingPriorityStatusName = (
status?: PollingPriorityItemStatus | string | null
) =>
POLLING_PRIORITY_STATUS_OPTIONS.find((item) => item.value === status)?.label ||
String(status || '-')
/** 触发类型选项 */
export const POLLING_PRIORITY_TRIGGER_TYPE_OPTIONS: Array<{
label: string
value: PollingPriorityTriggerType
}> = [
{ label: '购买激活', value: 'purchase_activated' },
{ label: '续费激活', value: 'renewal_activated' },
{ label: '队列激活', value: 'queue_activated' },
{ label: '附加套餐激活', value: 'addon_activated' },
{ label: '无有效套餐', value: 'no_valid_package' },
{ label: '人工触发', value: 'manual_trigger' }
]
export const getPollingPriorityTriggerTypeName = (
triggerType?: PollingPriorityTriggerType | string | null
) =>
POLLING_PRIORITY_TRIGGER_TYPE_OPTIONS.find((item) => item.value === triggerType)?.label ||
String(triggerType || '-')
/** 执行结果名称(result 为空时展示为未出结果) */
export const getPollingPriorityResultName = (result?: PollingPriorityResult | string | null) => {
if (result === 'success') return '成功'
if (result === 'failed') return '失败'
return '未出结果'
}