min length

This commit is contained in:
Kseninia Mikhaylova 2024-07-24 09:33:19 +03:00
parent e342aa306c
commit 1e627afe2e
1 changed files with 7 additions and 8 deletions

View File

@ -51,12 +51,7 @@ const form_refs = {
}
const changeParametres = () => {
console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000)
if ((form_state.total_length * 1000) <= (parametric.length.min + parametric.height.step)) {
form_state.total_length = (parametric.length.min + parametric.height.step) / 1000
// return
}
// console.log(form_state.total_length * 1000, copy_form_state.total_length * 1000)
const lamelles = Math.floor(form_state.height / parametric.height.step)
@ -79,6 +74,7 @@ const changeParametres = () => {
let { fence_length, total_length_mm, auto_length, length, full_sections } = form_state
length = parseFloat(length.toString())
if (total_length_mm < parametric.length.min) total_length_mm = parametric.length.min
if (auto_length) {
let w = parametric.length.min
@ -152,13 +148,13 @@ const goal = (target: string, params: object) => {
<div class="form-row">
<div class="form-item w-full">
<label for="length">Длина ламельного блока, мм</label>
<input disabled :value="`${form_state.length} мм`" class="w-28" />
<input disabled :value.input="`${form_state.length.toFixed(0)} мм`" class="w-28" />
<input id="length" type="range" class="xl:w-full" v-bind="parametric.length"
v-model="form_state.length" :disabled="form_state.auto_length" :ref="form_refs.length" />
</div>
<div class="form-item w-full">
<label for="height">Высота забора, мм</label>
<input disabled :value="`${form_state.height} мм`" class="w-28" />
<input disabled :value="`${form_state.height.toFixed(0)} мм`" class="w-28" />
<input id="height" type="range" class="xl:w-full" v-bind="parametric.height"
v-model="form_state.height" :ref="form_refs.height" />
</div>
@ -188,6 +184,9 @@ const goal = (target: string, params: object) => {
v-model="form_state.total_length" :ref="form_refs.total_length" />
</div>
<div class="form-item xl:w-2/4 text-sm xl:text-base">
<p v-if="form_state.total_length_mm < parametric.length.min" class="text-ioprim">
Длина забора слишком мала
</p>
<p v-if="form_state.extra_section" class="text-ioprim">
Внимание! Дополнительная секция приводит к увеличению стоимости.
Рекомендуем вам изменить длину забора или длину секции!