优化列表资产展示逻辑
This commit is contained in:
@@ -88,7 +88,7 @@ const screenshotColumns = [
|
||||
{
|
||||
label: '租期',
|
||||
width: 92,
|
||||
read: (row: Listing) => `${formatEstimatedRentalDuration(row)}\n日耗 ${getDailyLoss(row)}`,
|
||||
read: (row: Listing) => rentalPeriodText(row),
|
||||
},
|
||||
] as const
|
||||
|
||||
@@ -376,7 +376,15 @@ function rentAndDepositText(row: Listing) {
|
||||
}
|
||||
|
||||
function estimateTitle(row: Listing) {
|
||||
return `按哈夫币 ${listingCoinM(row)}、日耗 ${getDailyLoss(row)} 估算`
|
||||
const dailyLoss = getDailyLoss(row)
|
||||
return dailyLoss ? `按哈夫币 ${listingCoinM(row)}、日耗 ${dailyLoss} 估算` : '未配置日耗'
|
||||
}
|
||||
|
||||
function rentalPeriodText(row: Listing) {
|
||||
const dailyLoss = getDailyLoss(row)
|
||||
return [formatEstimatedRentalDuration(row), dailyLoss ? `日耗 ${dailyLoss}` : '']
|
||||
.filter(Boolean)
|
||||
.join('\n')
|
||||
}
|
||||
|
||||
function formatQuantity(value: number) {
|
||||
@@ -547,7 +555,7 @@ function formatQuantity(value: number) {
|
||||
<el-table-column label="租期" width="82">
|
||||
<template #default="{ row }">
|
||||
<span :title="estimateTitle(row)">{{ formatEstimatedRentalDuration(row) }}</span>
|
||||
<span class="table-subtext">日耗 {{ getDailyLoss(row) }}</span>
|
||||
<span v-if="getDailyLoss(row)" class="table-subtext">日耗 {{ getDailyLoss(row) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="详情" width="60">
|
||||
|
||||
Reference in New Issue
Block a user