From 51f898981d35f9aba3a7ff68a1b836c2fdede856 Mon Sep 17 00:00:00 2001 From: hskwon Date: Thu, 4 Dec 2025 16:23:27 +0900 Subject: [PATCH] =?UTF-8?q?feat:=20[quote]=20=EC=8B=9C=EB=AE=AC=EB=A0=88?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20CONTROLLER=5FTYPE=20=EC=9E=85=EB=A0=A5=20?= =?UTF-8?q?=EC=A7=80=EC=9B=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - CONTROLLER_TYPE select 드롭다운 추가 (매립형/노출형/일체형) - 문자열 입력값 지원 (isNaN 체크로 숫자/문자열 구분) --- .../views/quote-formulas/simulator.blade.php | 45 ++++++++++++++++--- 1 file changed, 38 insertions(+), 7 deletions(-) diff --git a/resources/views/quote-formulas/simulator.blade.php b/resources/views/quote-formulas/simulator.blade.php index a19402b9..15a8218c 100644 --- a/resources/views/quote-formulas/simulator.blade.php +++ b/resources/views/quote-formulas/simulator.blade.php @@ -189,18 +189,47 @@ function renderInputFields() { vars.forEach(v => { const defaultValue = v.default_value || ''; - html += ` -
- + // TYPE이 포함된 변수는 문자열 입력 (select 또는 text) + const isTextInput = v.variable.includes('TYPE') || v.variable.includes('_CODE'); + + let inputHtml = ''; + if (isTextInput && v.variable === 'CONTROLLER_TYPE') { + // 제어기 유형은 select로 표시 + inputHtml = ` + + `; + } else if (isTextInput) { + inputHtml = ` + + `; + } else { + inputHtml = ` + `; + } + + html += ` +
+ + ${inputHtml}
`; }); @@ -243,7 +272,9 @@ function renderCategoryOrder() { const inputs = {}; for (const [key, value] of formData.entries()) { if (value !== '') { - inputs[key] = parseFloat(value); + // 숫자로 변환 가능하면 숫자로, 아니면 문자열로 유지 + const numValue = parseFloat(value); + inputs[key] = isNaN(numValue) ? value : numValue; } }