calc test

This commit is contained in:
Kseninia Mikhaylova 2024-06-13 13:31:03 +03:00
parent 2e43a43478
commit 2e458a8905
1 changed files with 25 additions and 21 deletions

View File

@ -9,7 +9,8 @@ const lamelle_color = useState<ralTypes>('lamelle_color', () => '1002')
const section_count = useState('section_count', () => 1)
const extra_section = useState('extra_section', () => 0)
const parametric = {
const parametric_state = useState('parametric', () => {
return {
length: {
min: 1000,
max: 2400,
@ -25,7 +26,9 @@ const parametric = {
max: 2400,
step: 115,
}
}
}
})
const parametric = parametric_state.value
const form_state = reactive({
length: fence_section.value * 1000,
fence_length: 100,
@ -35,11 +38,6 @@ const form_state = reactive({
full_sections: 1,
extra_section: 0
})
const form_errors = reactive({
length: false,
height: false,
total_length: false,
})
const form_refs = {
length: ref(),
height: ref(),
@ -89,6 +87,12 @@ const changeParametres = () => {
if (form_state.extra_section && form_state.extra_section < parametric.length.min) {
form_refs.total_length.value.setCustomValidity('Расчет невозможен')
}
setTimeout(() => {
if (form_state.total_length < parametric.total_length.min) {
form_state.total_length = parametric.total_length.min
form_state.length = parametric.length.min
}
}, 300)
}
}