This commit is contained in:
@@ -85,7 +85,7 @@
|
||||
<span class="stat-item">
|
||||
<span class="stat-label">已使用</span>
|
||||
<span class="stat-value">{{
|
||||
formatDataSize(currentPackage.virtual_used_mb || 0)
|
||||
formatDataSize(currentPackage.virtual_data_used || 0)
|
||||
}}</span>
|
||||
</span>
|
||||
<span class="stat-item">
|
||||
@@ -98,7 +98,7 @@
|
||||
<span class="stat-label">剩余</span>
|
||||
<span class="stat-value">{{
|
||||
formatDataSize(
|
||||
(currentPackage.virtual_limit_mb || 0) - (currentPackage.virtual_used_mb || 0)
|
||||
(currentPackage.virtual_limit_mb || 0) - (currentPackage.virtual_data_used || 0)
|
||||
)
|
||||
}}</span>
|
||||
</span>
|
||||
@@ -106,14 +106,14 @@
|
||||
<ElProgress
|
||||
:percentage="
|
||||
getUsageProgress(
|
||||
currentPackage.virtual_used_mb || 0,
|
||||
currentPackage.virtual_data_used || 0,
|
||||
currentPackage.virtual_limit_mb || 0
|
||||
)
|
||||
"
|
||||
:color="
|
||||
getProgressColorByPercentage(
|
||||
getUsageProgress(
|
||||
currentPackage.virtual_used_mb || 0,
|
||||
currentPackage.virtual_data_used || 0,
|
||||
currentPackage.virtual_limit_mb || 0
|
||||
)
|
||||
)
|
||||
@@ -133,7 +133,7 @@
|
||||
{{
|
||||
formatDataSize(
|
||||
currentPackage.enable_virtual_data
|
||||
? currentPackage.virtual_used_mb || 0
|
||||
? currentPackage.virtual_data_used || 0
|
||||
: currentPackage.data_usage_mb || 0
|
||||
)
|
||||
}}
|
||||
@@ -161,7 +161,7 @@
|
||||
:percentage="
|
||||
getUsageProgress(
|
||||
currentPackage.enable_virtual_data
|
||||
? currentPackage.virtual_used_mb || 0
|
||||
? currentPackage.virtual_data_used || 0
|
||||
: currentPackage.data_usage_mb || 0,
|
||||
currentPackage.data_limit_mb || 0
|
||||
)
|
||||
@@ -170,7 +170,7 @@
|
||||
getProgressColorByPercentage(
|
||||
getUsageProgress(
|
||||
currentPackage.enable_virtual_data
|
||||
? currentPackage.virtual_used_mb || 0
|
||||
? currentPackage.virtual_data_used || 0
|
||||
: currentPackage.data_usage_mb || 0,
|
||||
currentPackage.data_limit_mb || 0
|
||||
)
|
||||
|
||||
@@ -709,6 +709,41 @@
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'shelf_status',
|
||||
label: '上架状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.shelf_status === 1,
|
||||
activeText: getShelfStatusText(1),
|
||||
inactiveText: getShelfStatusText(2),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_away'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleShelfStatusChange(row, val ? 1 : 2)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status ?? 0)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'real_data_mb',
|
||||
label: '真流量',
|
||||
@@ -814,41 +849,6 @@
|
||||
? `¥${((row.suggested_retail_price ?? 0) / 100).toFixed(2)}`
|
||||
: '-'
|
||||
},
|
||||
{
|
||||
prop: 'shelf_status',
|
||||
label: '上架状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
return h(ElSwitch, {
|
||||
modelValue: row.shelf_status === 1,
|
||||
activeText: getShelfStatusText(1),
|
||||
inactiveText: getShelfStatusText(2),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_away'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleShelfStatusChange(row, val ? 1 : 2)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'status',
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: PackageResponse) => {
|
||||
const frontendStatus = apiStatusToFrontend(row.status ?? 0)
|
||||
return h(ElSwitch, {
|
||||
modelValue: frontendStatus,
|
||||
activeValue: CommonStatus.ENABLED,
|
||||
inactiveValue: CommonStatus.DISABLED,
|
||||
activeText: getStatusText(CommonStatus.ENABLED),
|
||||
inactiveText: getStatusText(CommonStatus.DISABLED),
|
||||
inlinePrompt: true,
|
||||
disabled: !hasAuth('package:update_status'),
|
||||
'onUpdate:modelValue': (val: string | number | boolean) =>
|
||||
handleStatusChange(row, val as number)
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
prop: 'created_at',
|
||||
label: '创建时间',
|
||||
|
||||
Reference in New Issue
Block a user