fix: some
This commit is contained in:
@@ -987,6 +987,19 @@
|
||||
formatter: (row: ExchangeResponse) =>
|
||||
h(ElTag, { type: getStatusType(row.status) }, () => row.status_name || '--')
|
||||
},
|
||||
{
|
||||
prop: 'migration_status',
|
||||
label: '迁移状态',
|
||||
width: 130,
|
||||
formatter: (row: ExchangeResponse) =>
|
||||
row.migration_status
|
||||
? h(
|
||||
ElTag,
|
||||
{ type: getMigrationStatusType(row.migration_status) },
|
||||
() => row.migration_status_name || '--'
|
||||
)
|
||||
: '--'
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
@@ -1006,6 +1019,18 @@
|
||||
return types[status] || 'info'
|
||||
}
|
||||
|
||||
const getMigrationStatusType = (
|
||||
migrationStatus?: string
|
||||
): 'success' | 'info' | 'warning' | 'danger' | 'primary' => {
|
||||
const types: Record<string, 'success' | 'info' | 'warning' | 'danger' | 'primary'> = {
|
||||
not_migrated: 'info',
|
||||
pending: 'warning',
|
||||
migrated: 'success',
|
||||
failed: 'danger'
|
||||
}
|
||||
return types[migrationStatus || ''] || 'info'
|
||||
}
|
||||
|
||||
const getAssetTypeName = (assetType?: string | null) => {
|
||||
if (assetType === 'iot_card') return '物联网卡'
|
||||
if (assetType === 'device') return '设备'
|
||||
@@ -1638,7 +1663,9 @@
|
||||
|
||||
// 状态3(已发货待确认):确认完成
|
||||
if (status === 3) {
|
||||
if (hasAuth('exchange:complete')) {
|
||||
// migration_status=failed 的重试仅超管/平台账号可操作,代理/企业不渲染入口(后端以 403/1005 兜底)
|
||||
const canRetryFailed = row.migration_status !== 'failed' || userType === 1 || userType === 2
|
||||
if (hasAuth('exchange:complete') && canRetryFailed) {
|
||||
actions.push({
|
||||
label: '确认完成',
|
||||
handler: () => handleCompleteExchange(row),
|
||||
|
||||
Reference in New Issue
Block a user