feat(admin): add product switch for TV board display

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-18 17:17:01 +03:30
co-authored by Cursor
parent 69b6a1c4a9
commit 808562d3ed
3 changed files with 16 additions and 0 deletions
+1
View File
@@ -26,6 +26,7 @@ export interface Product{
open_sell: boolean open_sell: boolean
show: boolean show: boolean
show_in_assets?: boolean show_in_assets?: boolean
show_on_tv?: boolean
trade_by_quantity?: boolean trade_by_quantity?: boolean
override_trading_hours?: boolean override_trading_hours?: boolean
use_last_price_if_zero?: boolean use_last_price_if_zero?: boolean
@@ -403,6 +403,14 @@
<a-switch v-model:checked="form.show_in_assets" /> <a-switch v-model:checked="form.show_in_assets" />
</a-form-item> </a-form-item>
</div> </div>
<div class="product-editor-panel product-spec-switch-row">
<div class="product-spec-label">
<DashboardLabelWithHelp label="نمایش در تابلو TV" :help="showOnTvHelp" size="sm" />
</div>
<a-form-item name="show_on_tv" class="!mb-0">
<a-switch v-model:checked="form.show_on_tv" />
</a-form-item>
</div>
</div> </div>
</a-tab-pane> </a-tab-pane>
@@ -657,6 +665,10 @@ const showInAssetsHelp: DashboardHelp = {
description: 'روشن: این محصول در صفحه دارایی‌های مشتری نمایش داده می‌شود.', description: 'روشن: این محصول در صفحه دارایی‌های مشتری نمایش داده می‌شود.',
} }
const showOnTvHelp: DashboardHelp = {
description: 'روشن: این محصول در صفحه تابلو قیمت مشتری (/tv) نمایش داده می‌شود.',
}
const autoOpenHelp: DashboardHelp = { const autoOpenHelp: DashboardHelp = {
description: 'ساعت شروع معامله این محصول — فقط وقتی ساعت اختصاصی روشن باشد.', description: 'ساعت شروع معامله این محصول — فقط وقتی ساعت اختصاصی روشن باشد.',
} }
@@ -366,6 +366,7 @@ async function edit(record: Product) {
form.value = normalizeProductOrderLimitForm({ form.value = normalizeProductOrderLimitForm({
...productData, ...productData,
show_in_assets: productData.show_in_assets ?? false, show_in_assets: productData.show_in_assets ?? false,
show_on_tv: productData.show_on_tv ?? false,
trade_by_quantity: productData.trade_by_quantity ?? false, trade_by_quantity: productData.trade_by_quantity ?? false,
app_price: Boolean(productData.app_price), app_price: Boolean(productData.app_price),
price_formula_enabled: Boolean(productData.price_formula_enabled), price_formula_enabled: Boolean(productData.price_formula_enabled),
@@ -442,6 +443,7 @@ function resetData() {
file: undefined, file: undefined,
order_limit_enabled: false, order_limit_enabled: false,
show_in_assets: false, show_in_assets: false,
show_on_tv: false,
trade_by_quantity: false, trade_by_quantity: false,
override_trading_hours: false, override_trading_hours: false,
use_last_price_if_zero: false, use_last_price_if_zero: false,
@@ -480,6 +482,7 @@ const DETAILS_FIELDS = new Set([
'inventory', 'inventory',
'trade_by_quantity', 'trade_by_quantity',
'show_in_assets', 'show_in_assets',
'show_on_tv',
]) ])
const FEES_FIELDS = new Set(['cash_fee_buy', 'cash_fee_sell']) const FEES_FIELDS = new Set(['cash_fee_buy', 'cash_fee_sell'])
const HOURS_FIELDS = new Set(['override_trading_hours', 'auto_open_at', 'auto_close_at']) const HOURS_FIELDS = new Set(['override_trading_hours', 'auto_open_at', 'auto_close_at'])