优化了后台管理界面,
This commit is contained in:
@@ -3,6 +3,19 @@ import { Search } from '@element-plus/icons-vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
|
||||
import { fetchAdminListings, type Listing } from '@/api/listings'
|
||||
import {
|
||||
formatMoney,
|
||||
formatRatio,
|
||||
getAdminListingPricing,
|
||||
listingAssetTags,
|
||||
listingBadgeTags,
|
||||
listingBuyerPrice,
|
||||
listingDisplayTitle,
|
||||
listingResourceTags,
|
||||
listingRiskTags,
|
||||
listingSellerPrice,
|
||||
ownerName,
|
||||
} from '@/views/admin/listingAdminDisplay'
|
||||
import { listingReviewStatusLabel, listingStatusLabel } from '@/utils/statusLabels'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
|
||||
@@ -38,18 +51,6 @@ function resetFilters() {
|
||||
void loadListings()
|
||||
}
|
||||
|
||||
function money(value: number) {
|
||||
return `¥${Number(value || 0).toFixed(2)}`
|
||||
}
|
||||
|
||||
function listingPrice(row: Listing) {
|
||||
return money(row.price_daily || row.price_hourly)
|
||||
}
|
||||
|
||||
function ownerName(row: Listing) {
|
||||
return row.owner_phone || row.owner_nickname || `号主 ${row.owner_id}`
|
||||
}
|
||||
|
||||
function statusType(status: string) {
|
||||
if (status === 'published') return 'success'
|
||||
if (status === 'rented') return 'warning'
|
||||
@@ -126,10 +127,21 @@ function reviewType(status: string) {
|
||||
|
||||
<el-table v-loading="loading" class="table-panel" :data="listings">
|
||||
<el-table-column prop="id" label="ID" width="80" />
|
||||
<el-table-column label="商品" min-width="220">
|
||||
<el-table-column label="商品" min-width="270" fixed="left">
|
||||
<template #default="{ row }">
|
||||
<strong>{{ row.title }}</strong>
|
||||
<strong>{{ listingDisplayTitle(row) }}</strong>
|
||||
<span class="table-subtext">账号 ID: {{ row.account_id }}</span>
|
||||
<div v-if="listingBadgeTags(row).length" class="admin-tag-row compact">
|
||||
<el-tag
|
||||
v-for="tag in listingBadgeTags(row)"
|
||||
:key="`${row.id}-${tag}`"
|
||||
size="small"
|
||||
:type="tag === '特惠' ? 'danger' : 'warning'"
|
||||
effect="plain"
|
||||
>
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="号主" min-width="150">
|
||||
@@ -138,15 +150,49 @@ function reviewType(status: string) {
|
||||
<span class="table-subtext">ID: {{ row.owner_id }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="server_region" label="区服" width="120" />
|
||||
<el-table-column prop="login_platform" label="平台" width="120" />
|
||||
<el-table-column prop="rank_level" label="段位" width="110" />
|
||||
<el-table-column prop="haf_coin_amount" label="哈夫币" width="110" />
|
||||
<el-table-column label="价格" width="100">
|
||||
<template #default="{ row }">{{ listingPrice(row) }}</template>
|
||||
<el-table-column label="资产配置" min-width="260">
|
||||
<template #default="{ row }">
|
||||
<div class="admin-tag-row">
|
||||
<el-tag v-for="tag in listingAssetTags(row).slice(0, 8)" :key="`${row.id}-${tag}`" size="small" effect="plain">
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="资源" min-width="220">
|
||||
<template #default="{ row }">
|
||||
<div v-if="listingResourceTags(row).length" class="admin-tag-row">
|
||||
<el-tag v-for="tag in listingResourceTags(row)" :key="`${row.id}-${tag}`" size="small" type="info" effect="plain">
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<span v-else class="table-subtext">无额外资源</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="交接风控" min-width="230">
|
||||
<template #default="{ row }">
|
||||
<div class="admin-tag-row">
|
||||
<el-tag v-for="tag in listingRiskTags(row)" :key="`${row.id}-${tag}`" size="small" type="info" effect="plain">
|
||||
{{ tag }}
|
||||
</el-tag>
|
||||
</div>
|
||||
<span class="table-subtext">{{ row.server_region }} / {{ row.login_platform }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="价格" min-width="170">
|
||||
<template #default="{ row }">
|
||||
<strong>{{ listingBuyerPrice(row) }}</strong>
|
||||
<span class="table-subtext">卖家 {{ listingSellerPrice(row) }}</span>
|
||||
<span class="table-subtext">
|
||||
卖家 {{ formatRatio(getAdminListingPricing(row).sellerRatio) }} / 买家 {{ formatRatio(getAdminListingPricing(row).buyerRatio) }}
|
||||
</span>
|
||||
<span v-if="getAdminListingPricing(row).platformMarkup > 0" class="table-subtext">
|
||||
平台加价 {{ formatMoney(getAdminListingPricing(row).platformMarkup) }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="押金" width="100">
|
||||
<template #default="{ row }">{{ money(row.deposit_amount) }}</template>
|
||||
<template #default="{ row }">{{ formatMoney(row.deposit_amount) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="商品状态" width="110">
|
||||
<template #default="{ row }">
|
||||
|
||||
Reference in New Issue
Block a user