diff --git a/frontend/src/styles/admin.css b/frontend/src/styles/admin.css index 584db33..85f9d3d 100644 --- a/frontend/src/styles/admin.css +++ b/frontend/src/styles/admin.css @@ -474,7 +474,7 @@ h1 { .table-panel { margin-top: 0; width: 100%; - overflow-x: auto; + overflow-x: hidden; background: #ffffff; border-radius: 14px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); @@ -500,6 +500,58 @@ h1 { min-width: 760px; } +.admin-listings-table.el-table .el-table__inner-wrapper { + min-width: 0; +} + +.admin-listings-table.el-table .el-scrollbar__wrap { + overflow-x: hidden !important; +} + +.admin-listings-table.el-table .el-scrollbar__bar.is-horizontal { + display: none; +} + +.admin-listings-table.el-table { + font-size: 12px; +} + +.admin-listings-table.el-table th { + font-size: 11px; + letter-spacing: 0; + text-transform: none; +} + +.admin-listings-table.el-table .cell { + padding: 0 5px; + line-height: 1.35; + white-space: normal; + word-break: break-word; +} + +.admin-listings-table.el-table th .cell { + white-space: nowrap; + word-break: keep-all; + overflow-wrap: normal; + overflow: visible; +} + +.admin-listings-table .listing-code { + display: inline-block; + font-size: 11px; + line-height: 1; + white-space: nowrap; + word-break: keep-all; +} + +.admin-listings-table.el-table .el-table__cell { + padding: 8px 0; +} + +.admin-listings-table.el-table .el-button--small { + padding: 4px 8px; +} + .table-subtext { display: block; margin-top: 4px; diff --git a/frontend/src/styles/pc.css b/frontend/src/styles/pc.css index e59c080..4efda52 100644 --- a/frontend/src/styles/pc.css +++ b/frontend/src/styles/pc.css @@ -58,7 +58,7 @@ .page { width: 100%; - max-width: 1440px; + max-width: 1720px; } .page-header { @@ -605,7 +605,7 @@ h1 { } .pc-main { - width: min(1280px, calc(100% - 40px)); + width: min(1720px, calc(100% - 40px)); margin: 0 auto; padding: 18px 0 56px; } diff --git a/frontend/src/utils/listingDisplay.ts b/frontend/src/utils/listingDisplay.ts index 3fba7a8..fc28d30 100644 --- a/frontend/src/utils/listingDisplay.ts +++ b/frontend/src/utils/listingDisplay.ts @@ -20,6 +20,10 @@ export function getCoinM(item: Listing) { return getCoinWan(item) / 100; } +export function formatListingCode(item: Listing) { + return `SP${String(item.id).padStart(6, "0")}`; +} + export function formatHafCoinM(amountWan: number) { const amountM = amountWan / 100; const rounded = Math.round(amountM * 10) / 10; @@ -185,10 +189,32 @@ export function getOnlineTimeText(item: Listing) { } export function getDailyLoss(item: Listing) { + const dailyLossM = getDailyLossM(item); + return dailyLossM > 0 ? `${formatCompactNumber(dailyLossM)}M` : ""; +} + +export function getDailyLossM(item: Listing) { + const configuredLoss = readAssetNumber(item, "daily_loss_m"); + if (configuredLoss > 0) return configuredLoss; + const coinWan = getCoinWan(item); - if (coinWan >= 30000) return "30M"; - if (coinWan >= 10000) return "20M"; - return "10M"; + if (coinWan >= 30000) return 30; + if (coinWan >= 10000) return 20; + return 10; +} + +export function getEstimatedRentalDays(item: Listing) { + const coinM = getCoinM(item); + const dailyLossM = getDailyLossM(item); + if (coinM <= 0 || dailyLossM <= 0) return 0; + return coinM / dailyLossM; +} + +export function formatEstimatedRentalDuration(item: Listing) { + const days = getEstimatedRentalDays(item); + if (days <= 0) return "--"; + if (days < 1) return `约${Math.max(1, Math.round(days * 24))}小时`; + return `约${formatCompactNumber(days)}天`; } export function readAssetString(item: Listing, key: string) { @@ -237,3 +263,8 @@ function formatRatioNumber(value: number) { const rounded = roundMoney(value); return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(2); } + +function formatCompactNumber(value: number) { + const rounded = Math.round(value * 10) / 10; + return Number.isInteger(rounded) ? `${rounded}` : rounded.toFixed(1); +} diff --git a/frontend/src/views/account/ChatView.vue b/frontend/src/views/account/ChatView.vue index 1076210..62d593c 100644 --- a/frontend/src/views/account/ChatView.vue +++ b/frontend/src/views/account/ChatView.vue @@ -308,7 +308,7 @@ function handleKeydown(e: KeyboardEvent) {