From 117139099600c06f2a79891faf270f49191303b9 Mon Sep 17 00:00:00 2001 From: adonis Date: Sat, 22 Aug 2026 22:05:59 +0330 Subject: [PATCH] fix tv --- components.d.ts | 6 ++ src/views/tv/composables/useTvMonitorPage.ts | 38 ++++++--- src/views/tv/index.vue | 82 +++----------------- 3 files changed, 42 insertions(+), 84 deletions(-) diff --git a/components.d.ts b/components.d.ts index fd234c1..0a3014b 100644 --- a/components.d.ts +++ b/components.d.ts @@ -13,17 +13,21 @@ declare module 'vue' { ADivider: typeof import('ant-design-vue/es')['Divider'] AForm: typeof import('ant-design-vue/es')['Form'] AFormItem: typeof import('ant-design-vue/es')['FormItem'] + AImage: typeof import('ant-design-vue/es')['Image'] AInput: typeof import('ant-design-vue/es')['Input'] AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] AModal: typeof import('ant-design-vue/es')['Modal'] AppCreditLink: typeof import('./src/components/AppCreditLink.vue')['default'] + ARadio: typeof import('ant-design-vue/es')['Radio'] ARadioButton: typeof import('ant-design-vue/es')['RadioButton'] ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ASelect: typeof import('ant-design-vue/es')['Select'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASlider: typeof import('ant-design-vue/es')['Slider'] ASpin: typeof import('ant-design-vue/es')['Spin'] + ASwitch: typeof import('ant-design-vue/es')['Switch'] ATag: typeof import('ant-design-vue/es')['Tag'] + ATextarea: typeof import('ant-design-vue/es')['Textarea'] ATooltip: typeof import('ant-design-vue/es')['Tooltip'] BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default'] Basic: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/basic.vue')['default'] @@ -50,6 +54,7 @@ declare module 'vue' { Empty: typeof import('./src/components/empty.vue')['default'] ExtraFooter: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/extra-footer.vue')['default'] Format: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/format.vue')['default'] + GoldDayCalculatorModal: typeof import('./src/components/GoldDayCalculatorModal.vue')['default'] GoldLoading: typeof import('./src/components/GoldLoading.vue')['default'] InstallButton: typeof import('./src/components/InstallButton.vue')['default'] ListAnim: typeof import('./src/components/ListAnim.vue')['default'] @@ -75,5 +80,6 @@ declare module 'vue' { TransactionSkeleton: typeof import('./src/components/TransactionSkeleton.vue')['default'] VanActionSheet: typeof import('vant/es')['ActionSheet'] VanDialog: typeof import('vant/es')['Dialog'] + VanField: typeof import('vant/es')['Field'] } } diff --git a/src/views/tv/composables/useTvMonitorPage.ts b/src/views/tv/composables/useTvMonitorPage.ts index 7ff2183..4c4a500 100644 --- a/src/views/tv/composables/useTvMonitorPage.ts +++ b/src/views/tv/composables/useTvMonitorPage.ts @@ -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, diff --git a/src/views/tv/index.vue b/src/views/tv/index.vue index 2faac49..75e5226 100644 --- a/src/views/tv/index.vue +++ b/src/views/tv/index.vue @@ -135,48 +135,7 @@ -
-
-

محصولات تابلو

- خرید و فروش -
-
- -
- فروش - خرید -
-
-
-
-
- -
-
-

{{ item.title }}

-

{{ productWeightLabel(item) }}

-
-
-
- {{ productBuyLabel(item) }} -
-
- {{ productSellLabel(item) }} -
-
-
-
-
- -
+
محصولی برای نمایش روی تابلو انتخاب نشده است
@@ -188,22 +147,22 @@