fix(product): simplify TV formula help text and show regular formula for melted products

- Move FormulaPriceSection outside usesMeltedPricing guard so it appears for all product types
- Shorten TV formula tooltip to a single sentence

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-19 12:06:27 +03:30
co-authored by Cursor
parent 2ab99255da
commit f1699f2848
2 changed files with 11 additions and 18 deletions
@@ -219,15 +219,16 @@
</div>
</div>
<FormulaPriceSection
:model-value="form"
:reference-middle-price="formulaReferenceMiddlePrice"
:product-amount="Number(form.amount) || 0"
@update:model-value="onFormulaFormPatch"
@enabled-change="onFormulaEnabledChange"
/>
</div>
<FormulaPriceSection
:model-value="form"
:reference-middle-price="formulaReferenceMiddlePrice"
:product-amount="Number(form.amount) || 0"
@update:model-value="onFormulaFormPatch"
@enabled-change="onFormulaEnabledChange"
/>
<div class="live-price-preview rounded-lg border border-solid px-3 py-2">
<div class="flex flex-col gap-2 md:flex-row md:items-center md:justify-between md:gap-3">
<div class="flex flex-wrap items-center gap-x-3 gap-y-1 md:min-w-0 md:flex-1">
@@ -46,7 +46,6 @@
import { computed, ref, watch } from 'vue'
import {
DEFAULT_PRICE_FORMULA,
getFormulaVariableHelp,
resolveFormulaWeight,
computeFormulaProductPrice
} from '@/utils/formulaPrice'
@@ -83,16 +82,9 @@ watch(
const formulaWeight = computed(() => resolveFormulaWeight(props.productAmount))
const formulaHelp = computed((): DashboardHelp => {
const lines = getFormulaVariableHelp(formulaWeight.value)
.map((item) => `${item.symbol} = ${item.label}`)
.join(' | ')
return {
description:
'فرمول جداگانه برای قیمت نمایشی روی تابلو TV. این فرمول فقط روی صفحه TV تأثیر دارد و قیمت عادی محصول را تغییر نمی‌دهد.',
formula: `${lines}. مثال: ROUND(((P)/MG)*W+100000, -3)`,
}
})
const formulaHelp = computed((): DashboardHelp => ({
description: 'فرمول مخصوص تابلو TV — کاری با قیمت عادی ندارد.',
}))
const computedProductPrice = computed(() =>
computeFormulaProductPrice(