feat: 预计最终到期时间展示新增具体
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m49s
All checks were successful
构建并部署前端到测试环境 / build-and-deploy (push) Successful in 6m49s
This commit is contained in:
@@ -67,7 +67,7 @@ export interface AssetStartResponse {
|
||||
export type AssetRealnamePolicy = 'none' | 'before_order' | 'after_order'
|
||||
|
||||
// 预计最终到期时间状态
|
||||
export type ExpiryEstimateStatus = 'exact' | 'waiting_activation' | string
|
||||
export type ExpiryEstimateStatus = 'exact' | 'waiting_activation' | 'none' | 'invalid_data'
|
||||
|
||||
// 批量更新资产实名认证策略请求
|
||||
export interface BatchUpdateAssetRealnamePolicyRequest {
|
||||
@@ -120,6 +120,7 @@ export interface AssetResolveResponse {
|
||||
estimated_final_expires_at?: string | null // 当前及排队主套餐接续后的预计最终到期时间
|
||||
days_until_final_expiry?: number | null // 距预计最终到期的剩余天数
|
||||
expiry_estimate_status?: ExpiryEstimateStatus // 预计最终到期时间状态
|
||||
expiry_estimate_status_name?: string | null // 预计最终到期时间状态名称
|
||||
is_expiring?: boolean // 是否临期,由后端判断
|
||||
reduction_pct: number // 展示增幅比例(小数,如 0.428571)
|
||||
device_protect_status?: DeviceProtectStatus // 保护期状态:none / stop / start(仅 device)
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import { PaginationParams, ImportTask } from './common'
|
||||
import type { ExpiryEstimateStatus } from './asset'
|
||||
|
||||
// 运营商类型
|
||||
export enum Operator {
|
||||
@@ -401,7 +402,8 @@ export interface StandaloneIotCard {
|
||||
current_month_start_date?: string | null // 本月开始日期
|
||||
estimated_final_expires_at?: string | null // 当前及排队主套餐接续后的预计最终到期时间
|
||||
days_until_final_expiry?: number | null // 距预计最终到期的剩余天数
|
||||
expiry_estimate_status?: string // 预计最终到期时间状态
|
||||
expiry_estimate_status?: ExpiryEstimateStatus // 预计最终到期时间状态
|
||||
expiry_estimate_status_name?: string | null // 预计最终到期时间状态名称
|
||||
is_expiring?: boolean // 是否临期,由后端判断
|
||||
last_month_total_mb?: number // 上月流量总量(MB)
|
||||
last_data_check_at?: string | null // 最后流量检查时间
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
*/
|
||||
|
||||
import { PaginationParams } from './common'
|
||||
import type { ExpiryEstimateStatus } from './asset'
|
||||
|
||||
// ========== 设备状态枚举 ==========
|
||||
|
||||
@@ -69,7 +70,8 @@ export interface Device {
|
||||
real_name_status_name: string // 实名状态名称
|
||||
estimated_final_expires_at?: string | null // 当前及排队主套餐接续后的预计最终到期时间
|
||||
days_until_final_expiry?: number | null // 距预计最终到期的剩余天数
|
||||
expiry_estimate_status?: string // 预计最终到期时间状态
|
||||
expiry_estimate_status?: ExpiryEstimateStatus // 预计最终到期时间状态
|
||||
expiry_estimate_status_name?: string | null // 预计最终到期时间状态名称
|
||||
is_expiring?: boolean // 是否临期,由后端判断
|
||||
authorized_enterprise_id?: number | null // 当前有效授权企业ID
|
||||
authorized_enterprise_name?: string | null // 当前有效授权企业名称
|
||||
|
||||
@@ -1,20 +1,28 @@
|
||||
import { formatDateTime } from './format'
|
||||
import type { ExpiryEstimateStatus } from '@/types/api'
|
||||
|
||||
export interface ExpiryEstimate {
|
||||
estimated_final_expires_at?: string | null
|
||||
days_until_final_expiry?: number | null
|
||||
expiry_estimate_status?: string | null
|
||||
expiry_estimate_status?: ExpiryEstimateStatus | null
|
||||
expiry_estimate_status_name?: string | null
|
||||
is_expiring?: boolean
|
||||
}
|
||||
|
||||
export const getExpiryEstimateText = (estimate: ExpiryEstimate): string => {
|
||||
if (estimate.expiry_estimate_status === 'exact') {
|
||||
return estimate.estimated_final_expires_at
|
||||
? formatDateTime(estimate.estimated_final_expires_at)
|
||||
: '-'
|
||||
switch (estimate.expiry_estimate_status) {
|
||||
case 'exact':
|
||||
return estimate.estimated_final_expires_at
|
||||
? formatDateTime(estimate.estimated_final_expires_at)
|
||||
: '-'
|
||||
case 'waiting_activation':
|
||||
return '待激活后起算'
|
||||
case 'invalid_data':
|
||||
return '数据异常'
|
||||
case 'none':
|
||||
default:
|
||||
return '-'
|
||||
}
|
||||
|
||||
return estimate.expiry_estimate_status ? '待激活后起算' : '-'
|
||||
}
|
||||
|
||||
export const getExpiryEstimateTooltip = (estimate: ExpiryEstimate): string => {
|
||||
|
||||
@@ -588,7 +588,12 @@
|
||||
ElMessage
|
||||
} from 'element-plus'
|
||||
import { CopyDocument } from '@element-plus/icons-vue'
|
||||
import type { AssetExchangeTrace, AssetExchangeTraceAsset, AssetPollingStatus } from '@/types/api'
|
||||
import type {
|
||||
AssetExchangeTrace,
|
||||
AssetExchangeTraceAsset,
|
||||
AssetPollingStatus,
|
||||
ExpiryEstimateStatus
|
||||
} from '@/types/api'
|
||||
import { useAssetFormatters } from '../composables/useAssetFormatters'
|
||||
import { useAuth } from '@/composables/useAuth'
|
||||
import { useUserStore } from '@/store/modules/user'
|
||||
@@ -643,7 +648,8 @@
|
||||
total_virtual_remaining_mb?: number | null
|
||||
estimated_final_expires_at?: string | null
|
||||
days_until_final_expiry?: number | null
|
||||
expiry_estimate_status?: string
|
||||
expiry_estimate_status?: ExpiryEstimateStatus
|
||||
expiry_estimate_status_name?: string | null
|
||||
is_expiring?: boolean
|
||||
last_sync_time?: string | null
|
||||
last_data_check_at?: string | null
|
||||
|
||||
@@ -143,6 +143,7 @@ export function useAssetInfo() {
|
||||
estimated_final_expires_at: data.estimated_final_expires_at ?? null,
|
||||
days_until_final_expiry: data.days_until_final_expiry ?? null,
|
||||
expiry_estimate_status: data.expiry_estimate_status,
|
||||
expiry_estimate_status_name: data.expiry_estimate_status_name ?? null,
|
||||
is_expiring: data.is_expiring ?? false,
|
||||
bound_device_id: data.bound_device_id,
|
||||
bound_device_no: data.bound_device_no || '',
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
* 资产信息页面类型定义
|
||||
*/
|
||||
|
||||
import type { AssetExchangeTrace, AssetPollingStatus } from '@/types/api'
|
||||
import type { AssetExchangeTrace, AssetPollingStatus, ExpiryEstimateStatus } from '@/types/api'
|
||||
|
||||
// 资产类型枚举
|
||||
export type AssetType = 'card' | 'device'
|
||||
@@ -37,7 +37,8 @@ export interface AssetInfo {
|
||||
total_virtual_remaining_mb?: number | null
|
||||
estimated_final_expires_at?: string | null
|
||||
days_until_final_expiry?: number | null
|
||||
expiry_estimate_status?: string
|
||||
expiry_estimate_status?: ExpiryEstimateStatus
|
||||
expiry_estimate_status_name?: string | null
|
||||
is_expiring?: boolean
|
||||
last_sync_time?: string | null
|
||||
last_data_check_at?: string | null
|
||||
|
||||
Reference in New Issue
Block a user