feat(listing): 调整商品管理资产与价格列

This commit is contained in:
yml
2026-11-12 15:32:02 +08:00
parent 7b2566ad21
commit 7dc8ddd193
@@ -60,18 +60,19 @@ const listingTableWidth = ref(1296)
const activeFilterPopover = ref<FilterPopover | ''>('')
const publishOptions = ref(emptyListingPublishOptions)
const listingColumnUnits = {
code: 70,
zone: 75,
region: 105,
core: 85,
level: 60,
equipment: 80,
skin: 145,
face: 60,
remark: 85,
price: 100,
period: 55,
ratio: 35,
code: 68,
zone: 70,
region: 100,
core: 80,
level: 58,
equipment: 78,
skin: 135,
face: 58,
remark: 80,
purePrice: 72,
period: 50,
rentDeposit: 76,
ratio: 30,
detail: 45,
} as const
type ListingColumnKey = keyof typeof listingColumnUnits
@@ -153,39 +154,36 @@ const skinFilterLabel = computed(() => {
})
const screenshotColumns = [
{ label: '商品编码', width: 98, read: (row: Listing) => formatListingCode(row) },
{ label: '商品编码', width: 95, read: (row: Listing) => formatListingCode(row) },
{
label: '专区/赔付',
width: 105,
width: 98,
read: (row: Listing) => zoneCompensationText(row),
},
{
label: '地区/上号/纯币',
width: 147,
width: 140,
read: (row: Listing) => regionLoginCoinText(row),
},
{
label: '体力/负重/保险',
width: 119,
label: '保险/体力/负重',
width: 112,
read: (row: Listing) => coreAssetText(row),
},
{ label: '等级/KD', width: 84, read: (row: Listing) => levelKdText(row) },
{ label: '等级/KD', width: 81, read: (row: Listing) => levelKdText(row) },
{
label: 'AWM/六头/六甲',
width: 112,
width: 109,
read: (row: Listing) => equipmentText(row),
},
{ label: '皮肤资产', width: 203, read: (row: Listing) => skinAssetText(row) },
{ label: '人脸/全英雄', width: 84, read: (row: Listing) => faceHeroText(row) },
{ label: '号主备注', width: 119, read: (row: Listing) => ownerRemarkText(row) },
{
label: '纯币/租金/押金',
width: 140,
read: (row: Listing) => priceRentDepositText(row),
},
{ label: '租期', width: 77, read: (row: Listing) => rentalPeriodText(row) },
{ label: '比例', width: 49, read: (row: Listing) => formatRatio(row) },
{ label: '详情', width: 63, read: () => '详情' },
{ label: '皮肤资产', width: 189, read: (row: Listing) => skinAssetText(row) },
{ label: '人脸/全英雄', width: 81, read: (row: Listing) => faceHeroText(row) },
{ label: '号主备注', width: 112, read: (row: Listing) => ownerRemarkText(row) },
{ label: '租客纯币价格', width: 101, read: (row: Listing) => renterPureCoinPriceText(row) },
{ label: '租期', width: 70, read: (row: Listing) => rentalPeriodText(row) },
{ label: '租金/押金', width: 106, read: (row: Listing) => rentAndDepositText(row) },
{ label: '比例', width: 42, read: (row: Listing) => formatRatio(row) },
{ label: '详情', width: 64, read: () => '详情' },
] as const
async function queryListings() {
@@ -661,9 +659,9 @@ function insuranceSlotText(row: Listing) {
function coreAssetText(row: Listing) {
return [
insuranceSlotText(row),
levelText(row, 'stamina_level'),
levelText(row, 'load_level'),
insuranceSlotText(row),
].join('/')
}
@@ -672,7 +670,7 @@ function coreAssetTitle(row: Listing) {
const slots = insurance === '-' ? '-' : insuranceSlotLabel(insurance)
const insuranceText =
insurance === '-' || slots === insurance ? insurance : `${insurance}=${slots}格`
return `体力 ${levelText(row, 'stamina_level')} / 负重 ${levelText(row, 'load_level')} / 保险 ${insuranceText}`
return `保险 ${insuranceText} / 体力 ${levelText(row, 'stamina_level')} / 负重 ${levelText(row, 'load_level')}`
}
function levelKdText(row: Listing) {
@@ -717,14 +715,6 @@ function faceHeroText(row: Listing) {
return [faceOwnerText(row), allHeroText(row)].join('/')
}
function priceRentDepositText(row: Listing) {
return [
renterPureCoinPriceText(row),
listingPrice(row),
formatCentWithSymbol(row.deposit_amount_cent),
].join('\n')
}
function ownerRemarkText(row: Listing) {
const remark = row.description?.trim()
return remark || '-'
@@ -747,6 +737,10 @@ function renterPureCoinPriceText(row: Listing) {
return formatCentWithSymbol(Math.round(price * 100))
}
function rentAndDepositText(row: Listing) {
return `${listingPrice(row)}/${formatCentWithSymbol(row.deposit_amount_cent)}`
}
function estimateTitle(row: Listing) {
const dailyLoss = getDailyLoss(row)
return dailyLoss ? `按哈夫币 ${listingCoinM(row)}、日耗 ${dailyLoss} 估算` : '未配置日耗'
@@ -1086,7 +1080,7 @@ function formatQuantity(value: number) {
</template>
</el-table-column>
<el-table-column
label="体力/负重/保险"
label="保险/体力/负重"
:width="listingColumnWidths.core"
label-class-name="listing-merged-header"
>
@@ -1136,13 +1130,11 @@ function formatQuantity(value: number) {
<el-table-column label="号主备注" :width="listingColumnWidths.remark" show-overflow-tooltip>
<template #default="{ row }">{{ ownerRemarkText(row) }}</template>
</el-table-column>
<el-table-column
label="纯币/租金/押金"
:width="listingColumnWidths.price"
label-class-name="listing-merged-header"
>
<el-table-column label="租客纯币价格" :width="listingColumnWidths.purePrice">
<template #default="{ row }">
<span class="listing-multiline-cell">{{ priceRentDepositText(row) }}</span>
<span :title="`租客纯币价格(不含消耗品)${renterPureCoinPriceText(row)}`">
{{ renterPureCoinPriceText(row) }}
</span>
</template>
</el-table-column>
<el-table-column label="租期" :width="listingColumnWidths.period">
@@ -1151,6 +1143,9 @@ function formatQuantity(value: number) {
<span v-if="getDailyLoss(row)" class="table-subtext">日耗 {{ getDailyLoss(row) }}</span>
</template>
</el-table-column>
<el-table-column label="租金/押金" :width="listingColumnWidths.rentDeposit">
<template #default="{ row }">{{ rentAndDepositText(row) }}</template>
</el-table-column>
<el-table-column label="比例" :width="listingColumnWidths.ratio">
<template #default="{ row }">{{ formatRatio(row) }}</template>
</el-table-column>