calc test
This commit is contained in:
parent
2e43a43478
commit
2e458a8905
|
@ -9,7 +9,8 @@ const lamelle_color = useState<ralTypes>('lamelle_color', () => '1002')
|
||||||
const section_count = useState('section_count', () => 1)
|
const section_count = useState('section_count', () => 1)
|
||||||
const extra_section = useState('extra_section', () => 0)
|
const extra_section = useState('extra_section', () => 0)
|
||||||
|
|
||||||
const parametric = {
|
const parametric_state = useState('parametric', () => {
|
||||||
|
return {
|
||||||
length: {
|
length: {
|
||||||
min: 1000,
|
min: 1000,
|
||||||
max: 2400,
|
max: 2400,
|
||||||
|
@ -26,6 +27,8 @@ const parametric = {
|
||||||
step: 115,
|
step: 115,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
const parametric = parametric_state.value
|
||||||
const form_state = reactive({
|
const form_state = reactive({
|
||||||
length: fence_section.value * 1000,
|
length: fence_section.value * 1000,
|
||||||
fence_length: 100,
|
fence_length: 100,
|
||||||
|
@ -35,11 +38,6 @@ const form_state = reactive({
|
||||||
full_sections: 1,
|
full_sections: 1,
|
||||||
extra_section: 0
|
extra_section: 0
|
||||||
})
|
})
|
||||||
const form_errors = reactive({
|
|
||||||
length: false,
|
|
||||||
height: false,
|
|
||||||
total_length: false,
|
|
||||||
})
|
|
||||||
const form_refs = {
|
const form_refs = {
|
||||||
length: ref(),
|
length: ref(),
|
||||||
height: ref(),
|
height: ref(),
|
||||||
|
@ -89,6 +87,12 @@ const changeParametres = () => {
|
||||||
if (form_state.extra_section && form_state.extra_section < parametric.length.min) {
|
if (form_state.extra_section && form_state.extra_section < parametric.length.min) {
|
||||||
form_refs.total_length.value.setCustomValidity('Расчет невозможен')
|
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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue