This commit is contained in:
2026-08-22 22:05:59 +03:30
parent be59cca162
commit 1171390996
3 changed files with 42 additions and 84 deletions
+26 -12
View File
@@ -114,18 +114,23 @@ export function useTvMonitorPage() {
.sort((a, b) => Number(a.amount ?? 0) - Number(b.amount ?? 0)),
)
/** آبشده، شمش، … — هر چیزی غیر از سکه/سیمرغ */
const otherProducts = computed(() =>
catalogProducts.value.filter(
(p) => !isParsianCoin(p) && !isBankCoin(p) && !isSimorghBar(p),
),
/** تیکر پایین: شمش / آبشده / هر محصول غیرسکه */
const tickerProducts = computed(() =>
catalogProducts.value
.filter((p) => !isParsianCoin(p) && !isBankCoin(p))
.sort((a, b) => Number(a.amount ?? 0) - Number(b.amount ?? 0)),
)
const tickerTitle = computed(() => {
const items = tickerProducts.value
if (!items.length) return ''
if (items.every(isSimorghBar)) return 'شمش سیمرغ'
if (items.every((p) => isMeltedTradeGroup(p.group_type))) return 'آبشده'
return 'محصولات تابلو'
})
const hasBoardContent = computed(
() =>
hasCoinBoard.value
|| otherProducts.value.length > 0
|| simorghBars.value.length > 0,
() => hasCoinBoard.value || tickerProducts.value.length > 0,
)
const statusBanner = computed(() => {
@@ -221,6 +226,15 @@ export function useTvMonitorPage() {
return `${amount} گرم`
}
function tickerItemLabel(product: Product) {
if (isSimorghBar(product)) return simorghWeightLabel(product)
const amount = Number(product.amount ?? 0)
if (isMeltedTradeGroup(product.group_type)) {
return amount > 0 ? `${product.title} · ${amount} گرم` : product.title
}
return amount > 0 ? `${product.title} · ${amount} گرم` : product.title
}
function productBuyLabel(product: Product) {
if (isProductPriceInactive(product)) return NO_QUOTE_MESSAGE
const value = getProductBuyPrice(product)
@@ -285,8 +299,8 @@ export function useTvMonitorPage() {
hasCoinBoard,
hasBoardContent,
coinRowCount,
otherProducts,
simorghBars,
tickerProducts,
tickerTitle,
statusBanner,
liveBuy,
liveSell,
@@ -295,7 +309,7 @@ export function useTvMonitorPage() {
cursorHidden,
loading,
productWeightLabel,
simorghWeightLabel,
tickerItemLabel,
productBuyLabel,
productSellLabel,
liveQuoteLabel,