fix: 轮询按运营商账户限流
All checks were successful
构建并部署前端到测试环境 / deploy (push) Successful in 55s

This commit is contained in:
luo
2026-10-26 14:31:15 +08:00
parent 049f8257fb
commit 06684e1fc0
88 changed files with 7919 additions and 486 deletions

View File

@@ -7,6 +7,9 @@ export interface ExportTaskScenePermissions {
}
export const EXPORT_TASK_DETAIL_PAGE_PERMISSION = 'export_task:detail_page'
export const isPollingPlatformExport = (scene?: ExportTaskScene) =>
!!scene &&
['polling_pause', 'polling_stop_refused_alert', 'stop_resume_rule_dry_run'].includes(scene)
export interface ExportTaskSceneConfig {
scene: ExportTaskScene
@@ -16,6 +19,36 @@ export interface ExportTaskSceneConfig {
}
export const EXPORT_TASK_SCENE_CONFIG: Record<ExportTaskScene, ExportTaskSceneConfig> = {
polling_pause: {
scene: 'polling_pause',
sceneName: '不轮询清单',
pageTitle: '导出不轮询清单',
permissions: {
page: 'export_task:polling_pause_page',
detail: 'export_task:polling_pause_detail',
download: 'export_task:polling_pause_download'
}
},
polling_stop_refused_alert: {
scene: 'polling_stop_refused_alert',
sceneName: '停机被拒告警',
pageTitle: '导出停机被拒告警',
permissions: {
page: 'export_task:polling_stop_refused_alert_page',
detail: 'export_task:polling_stop_refused_alert_detail',
download: 'export_task:polling_stop_refused_alert_download'
}
},
stop_resume_rule_dry_run: {
scene: 'stop_resume_rule_dry_run',
sceneName: '停复机规则演练',
pageTitle: '导出停复机规则演练',
permissions: {
page: 'export_task:stop_resume_rule_dry_run_page',
detail: 'export_task:stop_resume_rule_dry_run_detail',
download: 'export_task:stop_resume_rule_dry_run_download'
}
},
device: {
scene: 'device',
sceneName: '设备管理',

View File

@@ -0,0 +1,43 @@
export const POLLING_CONFIG_PERMISSIONS = {
preview: 'polling_config:match_preview',
progress: 'polling_config:recalculate_progress',
statsPage: 'polling_config_stats:page',
preReset: 'polling_config_stats:pre_reset',
tiers: 'polling_config_stats:tiers'
} as const
export const POLLING_ASSET_STATUSES = [
{ label: '在库', value: 1 },
{ label: '已销售', value: 2 },
{ label: '已换货', value: 3 },
{ label: '已停用', value: 4 }
]
export const POLLING_PACKAGE_STATES = [
{ label: '有生效套餐', value: 'active' },
{ label: '套餐已用完', value: 'depleted' },
{ label: '只有待生效套餐', value: 'pending' },
{ label: '无套餐', value: 'none' }
]
export const POLLING_CARD_CATEGORIES = [
{ label: '普通卡', value: 'normal' },
{ label: '行业卡', value: 'industry' }
]
export const POLLING_CARD_CONDITIONS = [
{ label: '未实名', value: 'not_real_name' },
{ label: '已实名', value: 'real_name' },
{ label: '已激活', value: 'activated' },
{ label: '已停用', value: 'suspended' }
]
export const POLLING_DRAFT_INTERVALS = [
{ field: 'realname_check_interval', label: '实名检查', min: 30 },
{ field: 'carddata_check_interval', label: '流量检查', min: 60 },
{ field: 'package_check_interval', label: '套餐检查', min: 60 },
{ field: 'card_status_check_interval', label: '卡状态检查', min: 30 }
] as const
export const pollingOptionLabel = (
options: { label: string; value: string | number }[],
value: unknown
) =>
options.find((option) => option.value === value)?.label ||
(value == null || value === '' ? '-' : String(value))

View File

@@ -0,0 +1,53 @@
export const SCHEDULER_PERMISSIONS = {
params: {
page: 'polling_carrier_params:page',
detailPage: 'polling_carrier_params:detail_page',
detail: 'polling_carrier_params:detail'
},
scenes: { page: 'polling_check_scene:page' },
alerts: {
page: 'polling_failure_alert:page',
detailPage: 'polling_failure_alert:detail_page',
detail: 'polling_failure_alert:detail',
summary: 'polling_failure_alert:summary',
handle: 'polling_failure_alert:handle',
close: 'polling_failure_alert:close_polling',
export: 'polling_failure_alert:export'
},
queues: { page: 'polling_carrier_queue:page' },
dryRun: { page: 'stop_resume_dry_run:page', export: 'stop_resume_dry_run:export' },
pauses: {
page: 'polling_pause:page',
restore: 'polling_pause:restore',
export: 'polling_pause:export'
},
imports: {
page: 'polling_status_import:page',
create: 'polling_status_import:create',
detailPage: 'polling_status_import:detail_page',
detail: 'polling_status_import:detail'
},
cardState: 'iot_info:polling_state',
deviceCardState: 'device_info:polling_state',
cardBatch: 'iot_card:batch_polling',
deviceBatch: 'device:batch_polling'
} as const
export const POLLING_CLOSE_SOURCES = [
['single', '单资产接口'],
['batch', '勾选批量'],
['import', '文件导入'],
['risk_auto', '风险停机或已销户自动关闭'],
['cascade', '设备级联'],
['order', '支付或下单生效'],
['expiry_change', '修改有效期'],
['alert', '停机被拒告警处理'],
['history', '历史数据']
].map(([value, label]) => ({ value, label }))
export const POLLING_CHECK_TYPES = [
['card_status', '卡状态'],
['carddata', '流量'],
['realname', '实名'],
['package', '套餐'],
['stop_resume', '停复机'],
['all', '账户级']
].map(([value, label]) => ({ value, label }))