diff --git a/opencode.json b/opencode.json new file mode 100644 index 0000000..9983b76 --- /dev/null +++ b/opencode.json @@ -0,0 +1,37 @@ +{ + "$schema": "https://opencode.ai/config.json", + "provider": { + "anthropic": { + "options": { + "baseURL": "http://45.155.220.179:8317/v1", + "apiKey": "sk-ZBGcMXCdwtSK7G35s" + } + }, + "google": { + "options": { + "baseURL": "http://45.155.220.179:8317/v1beta", + "apiKey": "sk-ZBGcMXCdwtSK7G35s" + } + } + }, + "mcp": { + "context7": { + "type": "remote", + "url": "https://mcp.context7.com/mcp", + "enabled": true, + "timeout": 10000 + }, + "dbhub": { + "type": "local", + "command": [ + "npx", + "-y", + "@bytebase/dbhub@latest", + "--transport", + "stdio", + "--config", + ".config/dbhub.toml" + ] + } + } +} diff --git a/src/types/api/asset.ts b/src/types/api/asset.ts index ada5ccb..61cb3f3 100644 --- a/src/types/api/asset.ts +++ b/src/types/api/asset.ts @@ -205,6 +205,8 @@ export interface AssetPackageUsageRecord { virtual_used_mb?: number // 已用虚流量 MB virtual_remain_mb?: number // 剩余虚流量 MB virtual_ratio?: number // 虚流量比例(real/virtual) + enable_virtual_data?: boolean // 是否启用虚流量 + package_price?: number // 套餐价格(分) activated_at?: string // 激活时间 expires_at?: string // 到期时间 master_usage_id?: number | null // 主套餐 ID(加油包时有值) diff --git a/src/views/asset-management/asset-information/components/BasicInfoCard.vue b/src/views/asset-management/asset-information/components/BasicInfoCard.vue index 669b122..c873057 100644 --- a/src/views/asset-management/asset-information/components/BasicInfoCard.vue +++ b/src/views/asset-management/asset-information/components/BasicInfoCard.vue @@ -60,6 +60,21 @@ {{ getAssetStatusName(cardInfo?.status) }} + + @@ -329,17 +344,7 @@ - - - + @@ -377,7 +382,7 @@ ElTableColumn, ElButton, ElEmpty, - ElAlert + ElMessageBox } from 'element-plus' import { useAssetFormatters } from '../composables/useAssetFormatters' import { formatDateTime } from '@/utils/business/format' @@ -415,6 +420,9 @@ series_name?: string real_name_at?: string supplier?: string + bound_device_id?: number + bound_device_no?: string + bound_device_name?: string bound_card_count?: number max_sim_slots?: number activated_at?: string @@ -481,6 +489,7 @@ (e: 'enableBindingCard', payload: { card: BindingCard }): void (e: 'disableBindingCard', payload: { card: BindingCard }): void (e: 'navigateToCard', iccid: string): void + (e: 'navigateToDevice', deviceNo: string): void } const emit = defineEmits() @@ -565,11 +574,27 @@ // 绑定卡操作 const handleEnableBindingCard = (card: BindingCard) => { - emit('enableBindingCard', { card }) + ElMessageBox.confirm(`确定要启用此卡(${card.iccid})吗?`, '启用确认', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + emit('enableBindingCard', { card }) + }) + .catch(() => {}) } const handleDisableBindingCard = (card: BindingCard) => { - emit('disableBindingCard', { card }) + ElMessageBox.confirm(`确定要停用此卡(${card.iccid})吗?`, '停用确认', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + emit('disableBindingCard', { card }) + }) + .catch(() => {}) } diff --git a/src/views/asset-management/asset-information/components/CurrentPackageCard.vue b/src/views/asset-management/asset-information/components/CurrentPackageCard.vue index ae8017a..3948bca 100644 --- a/src/views/asset-management/asset-information/components/CurrentPackageCard.vue +++ b/src/views/asset-management/asset-information/components/CurrentPackageCard.vue @@ -12,114 +12,110 @@ {{ currentPackage?.status_name || '-' }} + + +
+
+ 流量 + + + + +
+ +
+
套餐充值
+ + + - + -
- - - - {{ currentPackage.package_name || '-' }} - - - {{ formatAmount(currentPackage.package_price) }} - - - {{ formatDataSize(currentPackage.package_total_data || 0) }} - - - {{ getPackageTypeName(currentPackage.package_type) }} - - - {{ currentPackage.virtual_ratio || '-' }} - - - - - {{ currentPackage.duration_days }}天 - - - - -
-
- 真流量 - - 已用 {{ formatDataSize(currentPackage.real_data_used || 0) }} / 剩余 - {{ formatDataSize(currentPackage.real_data_remaining || 0) }} / 总量 - {{ formatDataSize(currentPackage.real_data_total || 0) }} - -
- -
- - -
-
- 虚流量 - - 已用 {{ formatDataSize(currentPackage.virtual_data_used || 0) }} / 剩余 - {{ formatDataSize(currentPackage.virtual_data_remaining || 0) }} / 总量 - {{ formatDataSize(currentPackage.virtual_data_total || 0) }} - -
- -
- - - - - {{ formatDateTime(currentPackage.start_time) || '-' }} - - - {{ formatDateTime(currentPackage.expire_time) || '-' }} - - - - {{ currentPackage.status_name || '-' }} - - - -
+ + + {{ currentPackage.package_name || '-' }} + + + {{ formatAmount(currentPackage.package_price) }} + + + {{ getPackageTypeName(currentPackage.package_type) }} + + + {{ currentPackage.virtual_ratio || '-' }} + + + {{ currentPackage.duration_days }}天 + + + {{ formatDateTime(currentPackage.start_time) || '-' }} + + + {{ formatDateTime(currentPackage.expire_time) || '-' }} + + + + {{ currentPackage.status_name || '-' }} + + + @@ -155,16 +151,23 @@ currentPackage: PackageInfo | null loading?: boolean errorMsg?: string + boundDeviceId?: number + boundDeviceNo?: string + boundDeviceName?: string } - withDefaults(defineProps(), { + const props = withDefaults(defineProps(), { loading: false, - errorMsg: '' + errorMsg: '', + boundDeviceId: undefined, + boundDeviceNo: '', + boundDeviceName: '' }) // Emits const emit = defineEmits<{ showRecharge: [] + navigateToDevice: [deviceNo: string] }>() // Methods @@ -208,34 +211,32 @@ } } - .traffic-progress-wrapper { - padding: 16px; - margin-top: 16px; - background: var(--el-fill-color-light); - border-radius: 8px; + .header-progress { + flex: 1; + min-width: 0; + padding: 0 24px; - .progress-info { + .header-progress-info { display: flex; - align-items: center; - justify-content: space-between; - margin-bottom: 12px; + align-items: baseline; + gap: 12px; + margin-bottom: 6px; - .progress-label { - font-size: 15px; - font-weight: 500; + .progress-title { + flex-shrink: 0; + font-size: 13px; + font-weight: 600; color: var(--el-text-color-primary); } .progress-text { - font-size: 13px; - color: var(--el-text-color-regular); + font-size: 12px; + color: var(--el-text-color-secondary); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; } } } - - .package-actions { - margin-top: 16px; - text-align: right; - } } diff --git a/src/views/asset-management/asset-information/components/PackageListCard.vue b/src/views/asset-management/asset-information/components/PackageListCard.vue index 421d0e8..6bf0883 100644 --- a/src/views/asset-management/asset-information/components/PackageListCard.vue +++ b/src/views/asset-management/asset-information/components/PackageListCard.vue @@ -6,110 +6,117 @@
-
- - - - - - - - - - - - - - - + + + + + + + + + +
- +
@@ -139,6 +146,7 @@ ElEmpty, ElPagination } from 'element-plus' + import { useAssetFormatters } from '../composables/useAssetFormatters' import { formatDateTime } from '@/utils/business/format' import type { AssetPackageUsageRecord } from '@/types/api' @@ -151,12 +159,16 @@ total?: number page?: number pageSize?: number + boundDeviceId?: number + boundDeviceNo?: string } const props = withDefaults(defineProps(), { total: 0, page: 1, - pageSize: 10 + pageSize: 10, + boundDeviceId: undefined, + boundDeviceNo: '' }) // Emits @@ -164,6 +176,7 @@ (e: 'showDailyRecords', payload: { packageRow: PackageInfo }): void (e: 'page-change', page: number): void (e: 'size-change', size: number): void + (e: 'navigateToDevice', deviceNo: string): void } const emit = defineEmits() diff --git a/src/views/asset-management/asset-information/components/WalletTransactionCard.vue b/src/views/asset-management/asset-information/components/WalletTransactionCard.vue index 785a856..559b688 100644 --- a/src/views/asset-management/asset-information/components/WalletTransactionCard.vue +++ b/src/views/asset-management/asset-information/components/WalletTransactionCard.vue @@ -3,10 +3,26 @@ -
- + + + + + + +