dev #704

Merged
ysCha merged 4 commits from dev into dev-deploy 2026-03-10 15:08:06 +09:00
3 changed files with 99 additions and 88 deletions

View File

@ -1,4 +1,4 @@
'ues client'
'use client'
// import { correntObjectNoState } from '@/store/settingAtom'
import { notFound, usePathname, useSearchParams } from 'next/navigation'

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>

View File

@ -326,9 +326,14 @@ export function useCanvasSetting(executeEffect = true) {
}
try {
const apiUrl = `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`
logger.log('🔍 fetchBasicSettings API 호출:', apiUrl)
logger.log('🔍 correntObjectNo:', correntObjectNo, 'planNo:', planNo)
await get({
url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}/${planNo}`,
url: apiUrl,
}).then((res) => {
logger.log('📦 API 응답 데이터:', res)
let roofsRow = {}
let roofsArray = {}
@ -388,17 +393,23 @@ export function useCanvasSetting(executeEffect = true) {
/** 메뉴에서 배치면 초기설정 클릭 시 실행하지 않음 */
if (openPoint === null) {
logger.log('🎯 팝업 열기 조건 충족: openPoint=', openPoint, 'res.length=', res.length)
/** 배치면 초기설정 미저장 상태이면 화면 열기 */
const placementInitialProps = {
id: popupId,
pos: {
x: 50,
y: 180,
},
planNo: planNo,
openPoint: 'useCanvasSetting',
}
addPopup(popupId, 1, <PlacementShapeSetting {...placementInitialProps} />)
// 다른 closeAll 호출이 끝날 때까지 기다림
//setTimeout(() => {
const placementInitialProps = {
id : popupId,
pos : {
x: 50,
y: 180,
},
planNo : planNo,
openPoint: 'useCanvasSetting',
}
addPopup(popupId, 1, <PlacementShapeSetting {...placementInitialProps} />)
// },50)
} else {
logger.log('❌ 팝업 열기 조건 불충족: openPoint=', openPoint)
}
}