[1456]배치면 초기 설정에서의 지붕재와 촌 위치 변경

This commit is contained in:
ysCha 2026-03-10 15:06:55 +09:00
parent b3e85a11dc
commit 07ce6b6f4d

View File

@ -342,82 +342,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
</div>
</td>
</tr>
<tr>
<th>{getMessage('modal.placement.initial.setting.roof.angle.setting')}</th>
<td>
<div className="pop-form-radio place">
{currentRoof &&
roofAngleSetArray.map((item, index) => (
<div className="outline-form" key={item.id}>
<span>
<div className="d-check-radio pop">
<input
type="radio"
id={item.id}
name={item.name}
value={item.value}
checked={String(currentRoof?.roofAngleSet) === item.value}
onChange={(e) => setCurrentRoof({ ...currentRoof, roofAngleSet: e.target.value })}
/>
<label htmlFor={item.id}>{getMessage(item.message)}</label>
</div>
</span>
<div className="input-grid mr5">
{/* <input
type="text"
className="input-origin block"
readOnly={currentRoof?.roofAngleSet !== item.value}
value={index === 0 ? currentRoof?.pitch || '0' : currentRoof?.angle || '0'}
onChange={(e) => {
const v = normalizeDecimal(e.target.value)
e.target.value = v
if (index === 0) {
const num = v === '' ? '' : Number(v)
setCurrentRoof({ ...currentRoof, pitch: num === '' ? '' : num, angle: num === '' ? '' : getDegreeByChon(num) })
} else {
const num = v === '' ? '' : Number(v)
setCurrentRoof({ ...currentRoof, pitch: num === '' ? '' : getChonByDegree(num), angle: num === '' ? '' : num })
}
}}
/> */}
<CalculatorInput
id=""
name=""
label=""
className="input-origin block"
readOnly={currentRoof?.roofAngleSet !== item.value}
value={index === 0 ? (currentRoof?.pitch ?? basicSetting?.inclBase ?? '0') : (currentRoof?.angle ?? '0')}
onChange={(value) => {
if (index === 0) {
const pitch = value === '' ? '' : Number(value)
const angle = pitch === '' ? '' : getDegreeByChon(pitch)
setCurrentRoof((prev) => ({
...prev,
pitch,
angle,
}))
} else {
const angle = value === '' ? '' : Number(value)
const pitch = angle === '' ? '' : getChonByDegree(angle)
setCurrentRoof((prev) => ({
...prev,
pitch,
angle,
}))
}
}}
options={{
allowNegative: false,
allowDecimal: true,
}}
/>
</div>
<span className="thin">{index === 0 ? '寸' : '度'}</span>
</div>
))}
</div>
</td>
</tr>
<tr>
<th>
<div className="tip-wrap">
@ -600,6 +524,82 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
)} */}
</td>
</tr>
<tr>
<th>{getMessage('modal.placement.initial.setting.roof.angle.setting')}</th>
<td>
<div className="pop-form-radio place">
{currentRoof &&
roofAngleSetArray.map((item, index) => (
<div className="outline-form" key={item.id}>
<span>
<div className="d-check-radio pop">
<input
type="radio"
id={item.id}
name={item.name}
value={item.value}
checked={String(currentRoof?.roofAngleSet) === item.value}
onChange={(e) => setCurrentRoof({ ...currentRoof, roofAngleSet: e.target.value })}
/>
<label htmlFor={item.id}>{getMessage(item.message)}</label>
</div>
</span>
<div className="input-grid mr5">
{/* <input
type="text"
className="input-origin block"
readOnly={currentRoof?.roofAngleSet !== item.value}
value={index === 0 ? currentRoof?.pitch || '0' : currentRoof?.angle || '0'}
onChange={(e) => {
const v = normalizeDecimal(e.target.value)
e.target.value = v
if (index === 0) {
const num = v === '' ? '' : Number(v)
setCurrentRoof({ ...currentRoof, pitch: num === '' ? '' : num, angle: num === '' ? '' : getDegreeByChon(num) })
} else {
const num = v === '' ? '' : Number(v)
setCurrentRoof({ ...currentRoof, pitch: num === '' ? '' : getChonByDegree(num), angle: num === '' ? '' : num })
}
}}
/> */}
<CalculatorInput
id=""
name=""
label=""
className="input-origin block"
readOnly={currentRoof?.roofAngleSet !== item.value}
value={index === 0 ? (currentRoof?.pitch ?? basicSetting?.inclBase ?? '0') : (currentRoof?.angle ?? '0')}
onChange={(value) => {
if (index === 0) {
const pitch = value === '' ? '' : Number(value)
const angle = pitch === '' ? '' : getDegreeByChon(pitch)
setCurrentRoof((prev) => ({
...prev,
pitch,
angle,
}))
} else {
const angle = value === '' ? '' : Number(value)
const pitch = angle === '' ? '' : getChonByDegree(angle)
setCurrentRoof((prev) => ({
...prev,
pitch,
angle,
}))
}
}}
options={{
allowNegative: false,
allowDecimal: true,
}}
/>
</div>
<span className="thin">{index === 0 ? '寸' : '度'}</span>
</div>
))}
</div>
</td>
</tr>
</tbody>
</table>
</div>