This commit is contained in:
@@ -85,7 +85,7 @@
|
|||||||
<span class="stat-item">
|
<span class="stat-item">
|
||||||
<span class="stat-label">已使用</span>
|
<span class="stat-label">已使用</span>
|
||||||
<span class="stat-value">{{
|
<span class="stat-value">{{
|
||||||
formatDataSize(currentPackage.virtual_used_mb || 0)
|
formatDataSize(currentPackage.virtual_data_used || 0)
|
||||||
}}</span>
|
}}</span>
|
||||||
</span>
|
</span>
|
||||||
<span class="stat-item">
|
<span class="stat-item">
|
||||||
@@ -98,7 +98,7 @@
|
|||||||
<span class="stat-label">剩余</span>
|
<span class="stat-label">剩余</span>
|
||||||
<span class="stat-value">{{
|
<span class="stat-value">{{
|
||||||
formatDataSize(
|
formatDataSize(
|
||||||
(currentPackage.virtual_limit_mb || 0) - (currentPackage.virtual_used_mb || 0)
|
(currentPackage.virtual_limit_mb || 0) - (currentPackage.virtual_data_used || 0)
|
||||||
)
|
)
|
||||||
}}</span>
|
}}</span>
|
||||||
</span>
|
</span>
|
||||||
@@ -106,14 +106,14 @@
|
|||||||
<ElProgress
|
<ElProgress
|
||||||
:percentage="
|
:percentage="
|
||||||
getUsageProgress(
|
getUsageProgress(
|
||||||
currentPackage.virtual_used_mb || 0,
|
currentPackage.virtual_data_used || 0,
|
||||||
currentPackage.virtual_limit_mb || 0
|
currentPackage.virtual_limit_mb || 0
|
||||||
)
|
)
|
||||||
"
|
"
|
||||||
:color="
|
:color="
|
||||||
getProgressColorByPercentage(
|
getProgressColorByPercentage(
|
||||||
getUsageProgress(
|
getUsageProgress(
|
||||||
currentPackage.virtual_used_mb || 0,
|
currentPackage.virtual_data_used || 0,
|
||||||
currentPackage.virtual_limit_mb || 0
|
currentPackage.virtual_limit_mb || 0
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -133,7 +133,7 @@
|
|||||||
{{
|
{{
|
||||||
formatDataSize(
|
formatDataSize(
|
||||||
currentPackage.enable_virtual_data
|
currentPackage.enable_virtual_data
|
||||||
? currentPackage.virtual_used_mb || 0
|
? currentPackage.virtual_data_used || 0
|
||||||
: currentPackage.data_usage_mb || 0
|
: currentPackage.data_usage_mb || 0
|
||||||
)
|
)
|
||||||
}}
|
}}
|
||||||
@@ -161,7 +161,7 @@
|
|||||||
:percentage="
|
:percentage="
|
||||||
getUsageProgress(
|
getUsageProgress(
|
||||||
currentPackage.enable_virtual_data
|
currentPackage.enable_virtual_data
|
||||||
? currentPackage.virtual_used_mb || 0
|
? currentPackage.virtual_data_used || 0
|
||||||
: currentPackage.data_usage_mb || 0,
|
: currentPackage.data_usage_mb || 0,
|
||||||
currentPackage.data_limit_mb || 0
|
currentPackage.data_limit_mb || 0
|
||||||
)
|
)
|
||||||
@@ -170,7 +170,7 @@
|
|||||||
getProgressColorByPercentage(
|
getProgressColorByPercentage(
|
||||||
getUsageProgress(
|
getUsageProgress(
|
||||||
currentPackage.enable_virtual_data
|
currentPackage.enable_virtual_data
|
||||||
? currentPackage.virtual_used_mb || 0
|
? currentPackage.virtual_data_used || 0
|
||||||
: currentPackage.data_usage_mb || 0,
|
: currentPackage.data_usage_mb || 0,
|
||||||
currentPackage.data_limit_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',
|
prop: 'real_data_mb',
|
||||||
label: '真流量',
|
label: '真流量',
|
||||||
@@ -814,41 +849,6 @@
|
|||||||
? `¥${((row.suggested_retail_price ?? 0) / 100).toFixed(2)}`
|
? `¥${((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',
|
prop: 'created_at',
|
||||||
label: '创建时间',
|
label: '创建时间',
|
||||||
|
|||||||
Reference in New Issue
Block a user