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
+6
View File
@@ -13,17 +13,21 @@ declare module 'vue' {
ADivider: typeof import('ant-design-vue/es')['Divider'] ADivider: typeof import('ant-design-vue/es')['Divider']
AForm: typeof import('ant-design-vue/es')['Form'] AForm: typeof import('ant-design-vue/es')['Form']
AFormItem: typeof import('ant-design-vue/es')['FormItem'] AFormItem: typeof import('ant-design-vue/es')['FormItem']
AImage: typeof import('ant-design-vue/es')['Image']
AInput: typeof import('ant-design-vue/es')['Input'] AInput: typeof import('ant-design-vue/es')['Input']
AInputPassword: typeof import('ant-design-vue/es')['InputPassword'] AInputPassword: typeof import('ant-design-vue/es')['InputPassword']
AModal: typeof import('ant-design-vue/es')['Modal'] AModal: typeof import('ant-design-vue/es')['Modal']
AppCreditLink: typeof import('./src/components/AppCreditLink.vue')['default'] AppCreditLink: typeof import('./src/components/AppCreditLink.vue')['default']
ARadio: typeof import('ant-design-vue/es')['Radio']
ARadioButton: typeof import('ant-design-vue/es')['RadioButton'] ARadioButton: typeof import('ant-design-vue/es')['RadioButton']
ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup'] ARadioGroup: typeof import('ant-design-vue/es')['RadioGroup']
ASelect: typeof import('ant-design-vue/es')['Select'] ASelect: typeof import('ant-design-vue/es')['Select']
ASelectOption: typeof import('ant-design-vue/es')['SelectOption'] ASelectOption: typeof import('ant-design-vue/es')['SelectOption']
ASlider: typeof import('ant-design-vue/es')['Slider'] ASlider: typeof import('ant-design-vue/es')['Slider']
ASpin: typeof import('ant-design-vue/es')['Spin'] ASpin: typeof import('ant-design-vue/es')['Spin']
ASwitch: typeof import('ant-design-vue/es')['Switch']
ATag: typeof import('ant-design-vue/es')['Tag'] ATag: typeof import('ant-design-vue/es')['Tag']
ATextarea: typeof import('ant-design-vue/es')['Textarea']
ATooltip: typeof import('ant-design-vue/es')['Tooltip'] ATooltip: typeof import('ant-design-vue/es')['Tooltip']
BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default'] BaseDatePicker: typeof import('./src/components/BasicPacks/BaseDatePicker/src/BaseDatePicker.vue')['default']
Basic: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/basic.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'] Empty: typeof import('./src/components/empty.vue')['default']
ExtraFooter: typeof import('./src/components/BasicPacks/BaseDatePicker/src/datePick/demo/extra-footer.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'] 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'] GoldLoading: typeof import('./src/components/GoldLoading.vue')['default']
InstallButton: typeof import('./src/components/InstallButton.vue')['default'] InstallButton: typeof import('./src/components/InstallButton.vue')['default']
ListAnim: typeof import('./src/components/ListAnim.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'] TransactionSkeleton: typeof import('./src/components/TransactionSkeleton.vue')['default']
VanActionSheet: typeof import('vant/es')['ActionSheet'] VanActionSheet: typeof import('vant/es')['ActionSheet']
VanDialog: typeof import('vant/es')['Dialog'] VanDialog: typeof import('vant/es')['Dialog']
VanField: typeof import('vant/es')['Field']
} }
} }
+26 -12
View File
@@ -114,18 +114,23 @@ export function useTvMonitorPage() {
.sort((a, b) => Number(a.amount ?? 0) - Number(b.amount ?? 0)), .sort((a, b) => Number(a.amount ?? 0) - Number(b.amount ?? 0)),
) )
/** آبشده، شمش، … — هر چیزی غیر از سکه/سیمرغ */ /** تیکر پایین: شمش / آبشده / هر محصول غیرسکه */
const otherProducts = computed(() => const tickerProducts = computed(() =>
catalogProducts.value.filter( catalogProducts.value
(p) => !isParsianCoin(p) && !isBankCoin(p) && !isSimorghBar(p), .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( const hasBoardContent = computed(
() => () => hasCoinBoard.value || tickerProducts.value.length > 0,
hasCoinBoard.value
|| otherProducts.value.length > 0
|| simorghBars.value.length > 0,
) )
const statusBanner = computed(() => { const statusBanner = computed(() => {
@@ -221,6 +226,15 @@ export function useTvMonitorPage() {
return `${amount} گرم` 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) { function productBuyLabel(product: Product) {
if (isProductPriceInactive(product)) return NO_QUOTE_MESSAGE if (isProductPriceInactive(product)) return NO_QUOTE_MESSAGE
const value = getProductBuyPrice(product) const value = getProductBuyPrice(product)
@@ -285,8 +299,8 @@ export function useTvMonitorPage() {
hasCoinBoard, hasCoinBoard,
hasBoardContent, hasBoardContent,
coinRowCount, coinRowCount,
otherProducts, tickerProducts,
simorghBars, tickerTitle,
statusBanner, statusBanner,
liveBuy, liveBuy,
liveSell, liveSell,
@@ -295,7 +309,7 @@ export function useTvMonitorPage() {
cursorHidden, cursorHidden,
loading, loading,
productWeightLabel, productWeightLabel,
simorghWeightLabel, tickerItemLabel,
productBuyLabel, productBuyLabel,
productSellLabel, productSellLabel,
liveQuoteLabel, liveQuoteLabel,
+10 -72
View File
@@ -135,48 +135,7 @@
</section> </section>
</div> </div>
<section <div v-else-if="!loading && !hasBoardContent" class="tv-monitor__empty">
v-if="otherProducts.length"
class="tv-col tv-col--others"
:class="{ 'tv-col--others-alone': !hasCoinBoard }"
>
<header class="tv-col__head">
<h2>محصولات تابلو</h2>
<span>خرید و فروش</span>
</header>
<div class="tv-col__labels">
<span class="tv-col__labels-gap" />
<div class="tv-col__price-heads">
<span class="tv-col__label tv-col__label--sell">فروش</span>
<span class="tv-col__label tv-col__label--buy">خرید</span>
</div>
</div>
<div class="tv-col__list tv-col__list--others">
<article
v-for="item in otherProducts"
:key="item.id"
class="tv-row"
>
<div class="tv-row__media">
<ProductImage :product="item" img-class="tv-row__img" />
</div>
<div class="tv-row__meta">
<h3>{{ item.title }}</h3>
<p>{{ productWeightLabel(item) }}</p>
</div>
<div class="tv-row__prices">
<div class="tv-row__price tv-row__price--sell">
<strong>{{ productBuyLabel(item) }}</strong>
</div>
<div class="tv-row__price tv-row__price--buy">
<strong>{{ productSellLabel(item) }}</strong>
</div>
</div>
</article>
</div>
</section>
<div v-if="!loading && !hasBoardContent" class="tv-monitor__empty">
محصولی برای نمایش روی تابلو انتخاب نشده است محصولی برای نمایش روی تابلو انتخاب نشده است
</div> </div>
</a-spin> </a-spin>
@@ -188,22 +147,22 @@
<footer class="tv-monitor__footer"> <footer class="tv-monitor__footer">
<div <div
v-if="simorghBars.length" v-if="tickerProducts.length"
class="tv-ticker" class="tv-ticker"
:style="{ '--tv-ticker-duration': `${Math.max(simorghBars.length * 7, 36)}s` }" :style="{ '--tv-ticker-duration': `${Math.max(tickerProducts.length * 7, 36)}s` }"
> >
<div class="tv-ticker__label"> <div class="tv-ticker__label">
<strong>شمش سیمرغ</strong> <strong>{{ tickerTitle }}</strong>
<span>خرید و فروش</span> <span>خرید و فروش</span>
</div> </div>
<div class="tv-ticker__viewport"> <div class="tv-ticker__viewport">
<div class="tv-ticker__track"> <div class="tv-ticker__track">
<article <article
v-for="item in simorghBars" v-for="item in tickerProducts"
:key="item.id" :key="item.id"
class="tv-ticker__item" class="tv-ticker__item"
> >
<span class="tv-ticker__weight">{{ simorghWeightLabel(item) }}</span> <span class="tv-ticker__weight">{{ tickerItemLabel(item) }}</span>
<span class="tv-ticker__price tv-ticker__price--sell"> <span class="tv-ticker__price tv-ticker__price--sell">
فروش فروش
<b>{{ productBuyLabel(item) }}</b> <b>{{ productBuyLabel(item) }}</b>
@@ -243,8 +202,8 @@ const {
hasCoinBoard, hasCoinBoard,
hasBoardContent, hasBoardContent,
coinRowCount, coinRowCount,
otherProducts, tickerProducts,
simorghBars, tickerTitle,
statusBanner, statusBanner,
liveBuy, liveBuy,
liveSell, liveSell,
@@ -253,7 +212,7 @@ const {
cursorHidden, cursorHidden,
loading, loading,
productWeightLabel, productWeightLabel,
simorghWeightLabel, tickerItemLabel,
productBuyLabel, productBuyLabel,
productSellLabel, productSellLabel,
liveQuoteLabel, liveQuoteLabel,
@@ -463,43 +422,22 @@ const {
} }
.tv-monitor__board { .tv-monitor__board {
display: flex;
flex: 1; flex: 1;
flex-direction: column;
min-height: 0; min-height: 0;
:deep(.tv-monitor__spin), :deep(.tv-monitor__spin),
:deep(.ant-spin-nested-loading), :deep(.ant-spin-nested-loading),
:deep(.ant-spin-container) { :deep(.ant-spin-container) {
display: flex;
flex: 1;
flex-direction: column;
height: 100%; height: 100%;
min-height: 0;
} }
} }
.tv-monitor__columns { .tv-monitor__columns {
display: grid; display: grid;
flex: 1;
grid-template-columns: 1fr 1fr; grid-template-columns: 1fr 1fr;
gap: clamp(12px, 1.6vw, 22px); gap: clamp(12px, 1.6vw, 22px);
min-height: 0;
}
.tv-col--others {
margin-top: clamp(12px, 1.6vw, 22px);
max-height: 42%;
}
.tv-col--others-alone {
margin-top: 0;
height: 100%; height: 100%;
max-height: none; min-height: 0;
}
.tv-col__list--others {
grid-auto-rows: minmax(56px, auto);
} }
.tv-col { .tv-col {