Merge branch 'dev' into dev-yj

This commit is contained in:
lelalela 2025-01-17 17:13:45 +09:00
commit 39516f4533
54 changed files with 2341 additions and 2060 deletions

View File

@ -48,14 +48,14 @@ const FloorPlanProvider = ({ children }) => {
const objectNo = searchParams.get('objectNo') const objectNo = searchParams.get('objectNo')
const pid = searchParams.get('pid') const pid = searchParams.get('pid')
useEffect(() => { // 오류 발생으로 useEffect 사용 //useEffect(() => { // 오류 발생으로 useEffect 사용
if (pathname === '/floor-plan') { if (pathname === '/floor-plan') {
if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) {
notFound() notFound()
} }
setCurrentObjectNo(objectNo) setCurrentObjectNo(objectNo)
} }
}, [pid, objectNo]) //}, [pid, objectNo])
const [floorPlanState, setFloorPlanState] = useState({ const [floorPlanState, setFloorPlanState] = useState({
// 플랜 파일 업로드 모달 오픈 제어 // 플랜 파일 업로드 모달 오픈 제어

View File

@ -66,24 +66,22 @@ export default async function RootLayout({ children }) {
<GlobalDataProvider> <GlobalDataProvider>
<html lang="en"> <html lang="en">
<body> <body>
<Suspense fallback={<GlobalSpinner />}> {headerPathname === '/login' || headerPathname === '/join' ? (
{headerPathname === '/login' || headerPathname === '/join' ? ( <QcastProvider>{children}</QcastProvider>
<QcastProvider>{children}</QcastProvider> ) : (
) : ( <QcastProvider>
<QcastProvider> <div className="wrap">
<div className="wrap"> <Header userSession={sessionProps} />
<Header userSession={sessionProps} /> <div className="content">
<div className="content"> <Dimmed />
<Dimmed /> <SessionProvider useSession={sessionProps}>{children}</SessionProvider>
<SessionProvider useSession={sessionProps}>{children}</SessionProvider>
</div>
<Footer />
</div> </div>
</QcastProvider> <Footer />
)} </div>
<QModal /> </QcastProvider>
<PopupManager /> )}
</Suspense> <QModal />
<PopupManager />
</body> </body>
</html> </html>
</GlobalDataProvider> </GlobalDataProvider>

View File

@ -33,9 +33,9 @@ export default function ColorPickerModal(props) {
}, [isShow]) }, [isShow])
return ( return (
<WithDraggable isShow={true} pos={pos ?? ''}> <WithDraggable isShow={true} pos={pos ?? ''} handle=".modal-handle">
<div className={`modal-pop-wrap lr mount`}> <div className={`modal-pop-wrap lr mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.color.picker.title')}</h1> <h1 className="title">{getMessage('modal.color.picker.title')}</h1>
<button <button
className="modal-close" className="modal-close"
@ -78,6 +78,7 @@ export default function ColorPickerModal(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -20,7 +20,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 },
<Draggable <Draggable
position={{ x: position.x, y: position.y }} position={{ x: position.x, y: position.y }}
onDrag={(e, data) => handleOnDrag(e, data)} onDrag={(e, data) => handleOnDrag(e, data)}
handle={handle === '' ? '.modal-head' : handle} handle={handle === '' ? '.modal-handle' : handle}
> >
{children} {children}
</Draggable> </Draggable>

View File

@ -67,9 +67,9 @@ export default function FontSetting(props) {
} }
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos} handle=".modal-handle">
<div className={`modal-pop-wrap lrr mount`}> <div className={`modal-pop-wrap lrr mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.font')}</h1> <h1 className="title">{getMessage('modal.font')}</h1>
<button <button
className="modal-close" className="modal-close"
@ -133,6 +133,7 @@ export default function FontSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -135,7 +135,7 @@ export default function Estimate({}) {
useEffect(() => { useEffect(() => {
console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan) console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan)
if (selectedPlan) initEstimate(selectedPlan.ordering) if (selectedPlan) initEstimate(selectedPlan.planNo)
}, [selectedPlan]) }, [selectedPlan])
useEffect(() => { useEffect(() => {

View File

@ -30,22 +30,22 @@ export default function CanvasLayout({ children }) {
<div className="canvas-layout"> <div className="canvas-layout">
<div className={`canvas-page-list ${menuNumber === 2 || menuNumber === 3 || menuNumber === 4 ? 'active' : ''}`}> <div className={`canvas-page-list ${menuNumber === 2 || menuNumber === 3 || menuNumber === 4 ? 'active' : ''}`}>
<div className="canvas-plane-wrap"> <div className="canvas-plane-wrap">
{plans.map((plan) => ( {plans.map((plan, index) => (
<button <button
key={`plan-${plan.id}`} key={`plan-${plan.id}`}
className={`canvas-page-box ${plan.isCurrent === true ? 'on' : ''}`} className={`canvas-page-box ${plan.isCurrent === true ? 'on' : ''}`}
onClick={() => handleCurrentPlan(plan.id)} onClick={() => handleCurrentPlan(plan.id)}
> >
<span>{`Plan ${plan.ordering}`}</span> <span>{`Plan ${plan.planNo}`}</span>
{plan.ordering !== 1 && ( {index !== 0 && (
<i <i
className="close" className="close"
onClick={(e) => onClick={(e) =>
swalFire({ swalFire({
text: `Plan ${plan.ordering} ` + getMessage('plan.message.confirm.delete'), text: `Plan ${plan.planNo} ` + getMessage('plan.message.confirm.delete'),
type: 'confirm', type: 'confirm',
confirmFn: () => { confirmFn: () => {
handleDeletePlan(e, plan.id) handleDeletePlan(e, plan)
}, },
}) })
} }

View File

@ -171,14 +171,14 @@ export default function CanvasMenu(props) {
break break
case 5: case 5:
// let pid = urlParams.get('pid') // let pid = urlParams.get('pid')
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
if (res.status === 200) { if (res.status === 200) {
const estimateDetail = res.data const estimateDetail = res.data
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
setMenuNumber(menu.index) setMenuNumber(menu.index)
setCurrentMenu(menu.title) setCurrentMenu(menu.title)
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
} else { } else {
swalFire({ text: getMessage('estimate.menu.move.valid1') }) swalFire({ text: getMessage('estimate.menu.move.valid1') })
} }
@ -186,13 +186,13 @@ export default function CanvasMenu(props) {
}) })
break break
case 6: case 6:
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
if (res.status === 200) { if (res.status === 200) {
const estimateDetail = res.data const estimateDetail = res.data
if (estimateDetail.tempFlg === '0') { if (estimateDetail.tempFlg === '0') {
setMenuNumber(menu.index) setMenuNumber(menu.index)
setCurrentMenu(menu.title) setCurrentMenu(menu.title)
router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.planNo}&objectNo=${objectNo}`)
} else { } else {
swalFire({ text: getMessage('simulator.menu.move.valid1') }) swalFire({ text: getMessage('simulator.menu.move.valid1') })
} }

View File

@ -15,7 +15,7 @@ export default function Slope({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xxxm`}> <div className={`modal-pop-wrap xxxm`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.placement.surface.slope.setting')} </h1> <h1 className="title">{getMessage('plan.menu.placement.surface.slope.setting')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -45,6 +45,7 @@ export default function Slope({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -126,7 +126,7 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r`}> <div className={`modal-pop-wrap r`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.auxiliary.drawing')}</h1> <h1 className="title">{getMessage('modal.auxiliary.drawing')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -160,6 +160,7 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -46,7 +46,7 @@ export default function AuxiliaryEdit(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage(type === 'copy' ? 'modal.auxiliary.copy' : 'modal.auxiliary.move')} </h1> <h1 className="title">{getMessage(type === 'copy' ? 'modal.auxiliary.copy' : 'modal.auxiliary.move')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -111,6 +111,7 @@ export default function AuxiliaryEdit(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -14,7 +14,7 @@ export default function AuxiliarySize(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.auxiliary.size.edit')} </h1> <h1 className="title">{getMessage('modal.auxiliary.size.edit')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -63,6 +63,7 @@ export default function AuxiliarySize(props) {
<button className="btn-frame modal act">{getMessage('modal.common.save')}</button> <button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -51,7 +51,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap lx-2`}> <div className={`modal-pop-wrap lx-2`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.module.circuit.setting.default')}</h1> <h1 className="title">{getMessage('plan.menu.module.circuit.setting.default')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -115,6 +115,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
)} )}
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -83,7 +83,7 @@ export default function CircuitTrestleSetting({ id }) {
return ( return (
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }}> <WithDraggable isShow={true} pos={{ x: 50, y: 230 }}>
<div className={`modal-pop-wrap l-2`}> <div className={`modal-pop-wrap l-2`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.circuit.trestle.setting')} </h1> <h1 className="title">{getMessage('modal.circuit.trestle.setting')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -131,6 +131,7 @@ export default function CircuitTrestleSetting({ id }) {
</div> </div>
)} )}
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -85,7 +85,7 @@ export default function DimensionLineSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('contextmenu.display.edit')} </h1> <h1 className="title">{getMessage('contextmenu.display.edit')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -141,6 +141,7 @@ export default function DimensionLineSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -18,7 +18,7 @@ export default function Distance(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xxxm`}> <div className={`modal-pop-wrap xxxm`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.distance')} </h1> <h1 className="title">{getMessage('modal.distance')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -68,6 +68,7 @@ export default function Distance(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -40,7 +40,7 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r`}> <div className={`modal-pop-wrap r`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.eaves.gable.edit')}</h1> <h1 className="title">{getMessage('modal.eaves.gable.edit')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -62,6 +62,7 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) {
{type === TYPES.SHED && <Shed {...shedProps} />} {type === TYPES.SHED && <Shed {...shedProps} />}
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -65,7 +65,7 @@ export default function FlowDirectionSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ml mount`}> <div className={`modal-pop-wrap ml mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.shape.flow.direction.setting')} </h1> <h1 className="title">{getMessage('modal.shape.flow.direction.setting')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -176,6 +176,7 @@ export default function FlowDirectionSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -179,7 +179,7 @@ export default function DotLineGrid(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ssm mount`}> <div className={`modal-pop-wrap ssm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.canvas.setting.grid.dot.line.setting')}</h1> <h1 className="title">{getMessage('modal.canvas.setting.grid.dot.line.setting')}</h1>
<button <button
className="modal-close" className="modal-close"
@ -293,6 +293,7 @@ export default function DotLineGrid(props) {
</div> </div>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</WithDraggable> </WithDraggable>
) )
} }

View File

@ -22,7 +22,7 @@ export default function GridCopy(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.grid.copy')} </h1> <h1 className="title">{getMessage('modal.grid.copy')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -77,6 +77,7 @@ export default function GridCopy(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -75,7 +75,7 @@ export default function GridMove(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.grid.move')} </h1> <h1 className="title">{getMessage('modal.grid.move')} </h1>
<button className="modal-close" onClick={handleClose}> <button className="modal-close" onClick={handleClose}>
닫기 닫기
@ -156,6 +156,7 @@ export default function GridMove(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -52,7 +52,7 @@ export default function LinePropertySetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('contextmenu.line.property.edit')} </h1> <h1 className="title">{getMessage('contextmenu.line.property.edit')} </h1>
<button className="modal-close" onClick={() => handleClosePopup()}> <button className="modal-close" onClick={() => handleClosePopup()}>
닫기 닫기
@ -91,6 +91,7 @@ export default function LinePropertySetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -16,7 +16,7 @@ export default function CircuitNumberEdit(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title"> {getMessage('modal.module.circuit.number.edit')}</h1> <h1 className="title"> {getMessage('modal.module.circuit.number.edit')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -42,6 +42,7 @@ export default function CircuitNumberEdit(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -84,7 +84,7 @@ export default function PanelEdit(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title"> <h1 className="title">
{getMessage([PANEL_EDIT_TYPE.MOVE, PANEL_EDIT_TYPE.COLUMN_MOVE].includes(type) ? 'modal.move.setting' : 'modal.copy.setting')}{' '} {getMessage([PANEL_EDIT_TYPE.MOVE, PANEL_EDIT_TYPE.COLUMN_MOVE].includes(type) ? 'modal.move.setting' : 'modal.copy.setting')}{' '}
</h1> </h1>
@ -139,6 +139,7 @@ export default function PanelEdit(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -26,7 +26,7 @@ export default function ColumnInsert(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.panel.column.insert')} </h1> <h1 className="title">{getMessage('modal.panel.column.insert')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -105,6 +105,7 @@ export default function ColumnInsert(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -29,7 +29,7 @@ export default function ColumnRemove(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.panel.column.remove')} </h1> <h1 className="title">{getMessage('modal.panel.column.remove')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -115,6 +115,7 @@ export default function ColumnRemove(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -26,7 +26,7 @@ export default function RowInsert(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.row.insert')} </h1> <h1 className="title">{getMessage('modal.row.insert')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -105,6 +105,7 @@ export default function RowInsert(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -29,7 +29,7 @@ export default function RowRemove(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.row.remove')}</h1> <h1 className="title">{getMessage('modal.row.remove')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -115,6 +115,7 @@ export default function RowRemove(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -18,7 +18,7 @@ export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r`}> <div className={`modal-pop-wrap r`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.roof.cover.movement.shape.updown')}</h1> <h1 className="title">{getMessage('plan.menu.roof.cover.movement.shape.updown')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -43,6 +43,7 @@ export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -42,7 +42,7 @@ export default function DormerOffset(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xm mount`}> <div className={`modal-pop-wrap xm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{title}</h1> <h1 className="title">{title}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -103,6 +103,7 @@ export default function DormerOffset(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -77,7 +77,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap lrr`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}> <div className={`modal-pop-wrap lrr`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.placement.surface.object')} </h1> <h1 className="title">{getMessage('plan.menu.placement.surface.object')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -109,6 +109,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -23,7 +23,7 @@ export default function RoofMaterialSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xxxm mount`}> <div className={`modal-pop-wrap xxxm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.roof.material.edit')} </h1> <h1 className="title">{getMessage('modal.roof.material.edit')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -39,6 +39,7 @@ export default function RoofMaterialSetting(props) {
<button className="btn-frame modal act">{getMessage('modal.common.save')}</button> <button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -47,7 +47,7 @@ export default function SizeSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ssm mount`}> <div className={`modal-pop-wrap ssm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.size.setting')} </h1> <h1 className="title">{getMessage('modal.size.setting')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -95,6 +95,7 @@ export default function SizeSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -10,7 +10,7 @@ export default function PropertiesSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ssm`}> <div className={`modal-pop-wrap ssm`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.canvas.setting.wallline.properties.setting')}</h1> <h1 className="title">{getMessage('modal.canvas.setting.wallline.properties.setting')}</h1>
<button className="modal-close" onClick={() => closeModal(id)}> <button className="modal-close" onClick={() => closeModal(id)}>
닫기 닫기
@ -38,6 +38,7 @@ export default function PropertiesSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -116,7 +116,7 @@ export default function WallLineSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={{ x: 50, y: 230 }}> <WithDraggable isShow={true} pos={{ x: 50, y: 230 }}>
<div className={`modal-pop-wrap r mount`}> <div className={`modal-pop-wrap r mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.cover.outline.drawing')}</h1> <h1 className="title">{getMessage('modal.cover.outline.drawing')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}></button> <button className="modal-close" onClick={() => closePopup(id)}></button>
</div> </div>
@ -184,6 +184,7 @@ export default function WallLineSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -123,7 +123,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r`}> <div className={`modal-pop-wrap r`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.placement.surface.drawing')}</h1> <h1 className="title">{getMessage('plan.menu.placement.surface.drawing')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -159,6 +159,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -56,25 +56,24 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
] ]
// //
// useEffect(() => { // useEffect(() => {
// if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return // if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return
// const raftCodeList = findCommonCode('203800') // const raftCodeList = findCommonCode('203800')
// setRaftCodes(raftCodeList) // setRaftCodes(raftCodeList)
// console.log('🚀 ~ useEffect ~ >>>>>>>>>>>>> raftCodeList 11 :', raftCodeList) // console.log('🚀 ~ useEffect ~ >>>>>>>>>>>>> raftCodeList 11 :', raftCodeList)
// if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) { // if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) {
// setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet }) // setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet })
// } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) { // } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) {
// setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet }) // setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet })
// } // }
// }, []) // }, [])
useEffect(() => { useEffect(() => {
if (addedRoofs.length > 0) { if (addedRoofs.length > 0) {
const raftCodeList = findCommonCode('203800') const raftCodeList = findCommonCode('203800')
setRaftCodes(raftCodeList) setRaftCodes(raftCodeList)
setCurrentRoof({ ...addedRoofs[0] }) setCurrentRoof({ ...addedRoofs[0] })
} }
}, [addedRoofs]) }, [addedRoofs])
@ -182,7 +181,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ll mount`}> <div className={`modal-pop-wrap ll mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.placement.surface.initial.setting')}</h1> <h1 className="title">{getMessage('plan.menu.placement.surface.initial.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -261,7 +260,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
title={ title={
currentRoof?.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : currentRoof?.roofMatlNm currentRoof?.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : currentRoof?.roofMatlNm
} }
ref={roofRef.roofCd} //ref={roofRef.roofCd}
options={roofMaterials.map((roof) => { options={roofMaterials.map((roof) => {
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp } return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
})} })}
@ -347,9 +346,10 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
<div className="select-wrap" style={{ width: '160px' }}> <div className="select-wrap" style={{ width: '160px' }}>
<QSelectBox <QSelectBox
options={raftCodes} options={raftCodes}
ref={roofRef.rafter} //ref={roofRef.rafter}
title={ title={
raftCodes?.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)).clCodeNm raftCodes?.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft))
.clCodeNm
} }
value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft} value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft}
onChange={(e) => handleRafterChange(e.clCode)} onChange={(e) => handleRafterChange(e.clCode)}
@ -423,6 +423,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
</div> </div>
{showSizeGuideModal && <SizeGuide setShowSizeGuidModal={setShowSizeGuidModal} />} {showSizeGuideModal && <SizeGuide setShowSizeGuidModal={setShowSizeGuidModal} />}
{showMaterialGuideModal && <MaterialGuide setShowMaterialGuidModal={setShowMaterialGuidModal} />} {showMaterialGuideModal && <MaterialGuide setShowMaterialGuidModal={setShowMaterialGuidModal} />}
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -242,7 +242,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap lr-2`}> <div className={`modal-pop-wrap lr-2`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.placement.surface.arrangement')} </h1> <h1 className="title">{getMessage('plan.menu.placement.surface.arrangement')} </h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -290,6 +290,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
</div> </div>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -63,7 +63,7 @@ export default function ActualSizeSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap ssm mount`}> <div className={`modal-pop-wrap ssm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.actual.size.setting')}</h1> <h1 className="title">{getMessage('modal.actual.size.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -116,6 +116,7 @@ export default function ActualSizeSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -45,7 +45,7 @@ export default function ContextRoofAllocationSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap lr mount`}> <div className={`modal-pop-wrap lr mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1> <h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -214,6 +214,7 @@ export default function ContextRoofAllocationSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -49,7 +49,7 @@ export default function RoofAllocationSetting(props) {
<div className={`modal-pop-wrap lr mount`}> <div className={`modal-pop-wrap lr mount`}>
{currentRoofList && ( {currentRoofList && (
<> <>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1> <h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -235,6 +235,7 @@ export default function RoofAllocationSetting(props) {
</div> </div>
</> </>
)} )}
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -31,7 +31,7 @@ export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 }
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xxm`}> <div className={`modal-pop-wrap xxm`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('plan.menu.roof.cover.roof.shape.passivity.setting')}</h1> <h1 className="title">{getMessage('plan.menu.roof.cover.roof.shape.passivity.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -67,6 +67,7 @@ export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 }
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -90,7 +90,7 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap lr mount`}> <div className={`modal-pop-wrap lr mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.roof.shape.setting')}</h1> <h1 className="title">{getMessage('modal.roof.shape.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -120,6 +120,7 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -75,7 +75,7 @@ export default function SettingModal01(props) {
<> <>
<WithDraggable isShow={true} pos={{ x: 1275, y: 180 }}> <WithDraggable isShow={true} pos={{ x: 1275, y: 180 }}>
<div className={`modal-pop-wrap sm mount`}> <div className={`modal-pop-wrap sm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.canvas.setting')}</h1> <h1 className="title">{getMessage('modal.canvas.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id, true)}> <button className="modal-close" onClick={() => closePopup(id, true)}>
닫기 닫기
@ -100,6 +100,7 @@ export default function SettingModal01(props) {
{buttonAct === 2 && <SecondOption {...secondProps} />} {buttonAct === 2 && <SecondOption {...secondProps} />}
{buttonAct === 3 && <GridOption {...gridProps} />} {buttonAct === 3 && <GridOption {...gridProps} />}
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
</> </>

View File

@ -192,7 +192,7 @@ export default function DimensionLineSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xxxm mount`}> <div className={`modal-pop-wrap xxxm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.canvas.setting.font.plan.absorption.dimension.line')} </h1> <h1 className="title">{getMessage('modal.canvas.setting.font.plan.absorption.dimension.line')} </h1>
<button <button
className="modal-close" className="modal-close"
@ -258,6 +258,7 @@ export default function DimensionLineSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -57,7 +57,7 @@ export default function PlanSizeSetting(props) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap xsm mount`}> <div className={`modal-pop-wrap xsm mount`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}</h1> <h1 className="title">{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}</h1>
<button <button
className="modal-close" className="modal-close"
@ -104,6 +104,7 @@ export default function PlanSizeSetting(props) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -41,7 +41,7 @@ export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
return ( return (
<WithDraggable isShow={true} pos={pos}> <WithDraggable isShow={true} pos={pos}>
<div className={`modal-pop-wrap r`}> <div className={`modal-pop-wrap r`}>
<div className="modal-head"> <div className="modal-head modal-handle">
<h1 className="title">{getMessage('modal.wallline.offset.setting')}</h1> <h1 className="title">{getMessage('modal.wallline.offset.setting')}</h1>
<button className="modal-close" onClick={() => closePopup(id)}> <button className="modal-close" onClick={() => closePopup(id)}>
닫기 닫기
@ -66,6 +66,7 @@ export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) {
</button> </button>
</div> </div>
</div> </div>
<div className="modal-foot modal-handle"></div>
</div> </div>
</WithDraggable> </WithDraggable>
) )

View File

@ -111,7 +111,7 @@ export default function Simulator() {
setHatsudenryouPeakcutAllSnow([]) setHatsudenryouPeakcutAllSnow([])
if (objectNo && pid && selectedPlan) { if (objectNo && pid && selectedPlan) {
fetchObjectDetail(objectNo, selectedPlan.ordering) fetchObjectDetail(objectNo, selectedPlan.planNo)
fetchSimulatorNotice() fetchSimulatorNotice()
setPwrGnrSimType('D') setPwrGnrSimType('D')
setPwrRecoil({ ...pwrRecoil, type: 'D' }) setPwrRecoil({ ...pwrRecoil, type: 'D' })

View File

@ -290,7 +290,7 @@ export function useCanvasSetting() {
let roofsRow = {} let roofsRow = {}
let roofsArray = {} let roofsArray = {}
if (res.length > 0) { if (res) {
roofsRow = res.map((item) => { roofsRow = res.map((item) => {
return { return {
roofSizeSet: String(item.roofSizeSet), roofSizeSet: String(item.roofSizeSet),
@ -674,7 +674,7 @@ export function useCanvasSetting() {
// HTTP POST 요청 보내기 // HTTP POST 요청 보내기
await post({ url: `/api/canvas-management/canvas-settings`, data: patternData }) await post({ url: `/api/canvas-management/canvas-settings`, data: patternData })
.then((res) => { .then((res) => {
// swalFire({ text: getMessage(res.returnMessage) }) swalFire({ text: getMessage(res.returnMessage) })
// Canvas 디스플레이 설정 시 해당 옵션 적용 // Canvas 디스플레이 설정 시 해당 옵션 적용
frontSettings() frontSettings()
@ -682,7 +682,8 @@ export function useCanvasSetting() {
fetchSettings() fetchSettings()
}) })
.catch((error) => { .catch((error) => {
swalFire({ text: getMessage(res.returnMessage), icon: 'error' }) //swalFire({ text: getMessage(res.returnMessage), icon: 'error' })
swalFire({ text: error.message, icon: 'error' })
}) })
//setAdsorptionRange(item.range) //setAdsorptionRange(item.range)

View File

@ -97,13 +97,11 @@ export function useAxios(lang = '') {
const getFetcher = async (url) => { const getFetcher = async (url) => {
const res = await get({ url }) const res = await get({ url })
console.log('🚀 ~ getFetcher ~ res:', res)
return res return res
} }
const postFetcher = async (url, { arg }) => { const postFetcher = async (url, arg) => {
const res = await post({ url, data: arg }) const res = await post({ url, data: arg })
console.log('🚀 ~ postFetcher ~ res:', res)
return res return res
} }

View File

@ -4,7 +4,6 @@ import { useContext, useEffect, useState } from 'react'
import { usePathname, useRouter, useSearchParams } from 'next/navigation' import { usePathname, useRouter, useSearchParams } from 'next/navigation'
import { useRecoilState } from 'recoil' import { useRecoilState } from 'recoil'
import { v4 as uuidv4 } from 'uuid'
import { canvasState, currentCanvasPlanState, plansState } from '@/store/canvasAtom' import { canvasState, currentCanvasPlanState, plansState } from '@/store/canvasAtom'
import { useAxios } from '@/hooks/useAxios' import { useAxios } from '@/hooks/useAxios'
@ -18,7 +17,6 @@ import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateCon
export function usePlan(params = {}) { export function usePlan(params = {}) {
const { floorPlanState } = useContext(FloorPlanContext) const { floorPlanState } = useContext(FloorPlanContext)
const [planNum, setPlanNum] = useState(0)
const [selectedPlan, setSelectedPlan] = useState(null) const [selectedPlan, setSelectedPlan] = useState(null)
const [canvas, setCanvas] = useRecoilState(canvasState) const [canvas, setCanvas] = useRecoilState(canvasState)
@ -131,35 +129,52 @@ export function usePlan(params = {}) {
*/ */
const getCanvasByObjectNo = async (userId, objectNo) => { const getCanvasByObjectNo = async (userId, objectNo) => {
return await get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) => return await get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) =>
res.map((item, index) => ({ res.map((item) => ({
id: item.id, id: item.id,
objectNo: item.objectNo,
planNo: item.planNo,
userId: item.userId, userId: item.userId,
canvasStatus: dbToCanvasFormat(item.canvasStatus), canvasStatus: dbToCanvasFormat(item.canvasStatus),
isCurrent: false, isCurrent: false,
bgImageName: item.bgImageName, bgImageName: item.bgImageName,
mapPositionAddress: item.mapPositionAddress, mapPositionAddress: item.mapPositionAddress,
ordering: index + 1,
})), })),
) )
} }
/**
* 물건번호(object) plan 추가 (canvas 생성 planNo 할당)
*/
const postObjectPlan = async (userId, objectNo) => {
return await promisePost({ url: '/api/object/add-plan', data: { userId: userId, objectNo: objectNo } })
.then((res) => {
return res.data.planNo
})
.catch((error) => {
swalFire({ text: error.response.data.message, icon: 'error' })
return null
})
}
/** /**
* 신규 canvas 데이터를 저장 * 신규 canvas 데이터를 저장
*/ */
const postCanvasStatus = async (userId, objectNo, canvasStatus) => { const postCanvasStatus = async (userId, objectNo, canvasStatus) => {
const planNo = await postObjectPlan(userId, objectNo)
if (!planNo) return
const planData = { const planData = {
userId: userId, userId: userId,
imageName: 'image_name', // api 필수항목이여서 임시로 넣음, 이후 삭제 필요
objectNo: objectNo, objectNo: objectNo,
planNo: planNo,
bgImageName: currentCanvasPlan?.bgImageName ?? null, bgImageName: currentCanvasPlan?.bgImageName ?? null,
mapPositionAddress: currentCanvasPlan?.mapPositionAddress ?? null, mapPositionAddress: currentCanvasPlan?.mapPositionAddress ?? null,
canvasStatus: canvasToDbFormat(canvasStatus), canvasStatus: canvasToDbFormat(canvasStatus),
} }
await promisePost({ url: '/api/canvas-management/canvas-statuses', data: planData }) await promisePost({ url: '/api/canvas-management/canvas-statuses', data: planData })
.then((res) => { .then((res) => {
setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, userId: userId, canvasStatus: canvasStatus, ordering: planNum + 1 }]) setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }])
updateCurrentPlan(res.data) updateCurrentPlan(res.data)
setPlanNum(planNum + 1)
}) })
.catch((error) => { .catch((error) => {
swalFire({ text: error.message, icon: 'error' }) swalFire({ text: error.message, icon: 'error' })
@ -204,12 +219,12 @@ export function usePlan(params = {}) {
* 현재 plan의 작업상태를 저장 이동 * 현재 plan의 작업상태를 저장 이동
*/ */
const handleCurrentPlan = async (newCurrentId) => { const handleCurrentPlan = async (newCurrentId) => {
const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering const planNo = plans?.find((obj) => obj.id === newCurrentId).planNo
const objectNo = floorPlanState.objectNo const objectNo = floorPlanState.objectNo
//견적서 or 발전시뮬 //견적서 or 발전시뮬
if (pathname !== '/floor-plan') { if (pathname !== '/floor-plan') {
await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` }) await promiseGet({ url: `/api/estimate/${objectNo}/${planNo}/detail` })
.then((res) => { .then((res) => {
if (res.status === 200) { if (res.status === 200) {
const estimateDetail = res.data const estimateDetail = res.data
@ -278,7 +293,7 @@ export function usePlan(params = {}) {
const handleCurrentPlanUrl = () => { const handleCurrentPlanUrl = () => {
const currentPlan = plans.find((plan) => plan.isCurrent) const currentPlan = plans.find((plan) => plan.isCurrent)
if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.ordering}&objectNo=${floorPlanState?.objectNo}`) if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
} }
const setBgImage = () => { const setBgImage = () => {
@ -295,7 +310,7 @@ export function usePlan(params = {}) {
} }
JSON.parse(currentCanvasData()).objects.length > 0 JSON.parse(currentCanvasData()).objects.length > 0
? swalFire({ ? swalFire({
text: `Plan ${currentCanvasPlan.ordering} ` + getMessage('plan.message.confirm.copy'), text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'),
type: 'confirm', type: 'confirm',
confirmFn: async () => { confirmFn: async () => {
await postCanvasStatus(userId, objectNo, currentCanvasData()) await postCanvasStatus(userId, objectNo, currentCanvasData())
@ -308,31 +323,31 @@ export function usePlan(params = {}) {
} }
/** /**
* DB에 추가하지 않고 화면 상에서 plan을 추가하는 함수 * 물건번호(object) plan 삭제 (canvas 삭제 planNo 삭제)
*/ */
const addPlan = (userId, objectNo, canvasStatus) => { const deleteObjectPlan = async (userId, objectNo, planNo) => {
const id = uuidv4() return await promiseDel({ url: `/api/object/plan/${objectNo}/${planNo}?userId=${userId}` })
const newPlan = { .then((res) => {
id: id, return true
objectNo: objectNo, })
userId: userId, .catch((error) => {
canvasStatus: canvasStatus, swalFire({ text: error.response.data.message, icon: 'error' })
ordering: planNum + 1, return false
} })
setPlans([...plans, newPlan])
handleCurrentPlan(id)
setPlanNum(planNum + 1)
} }
/** /**
* plan 삭제 * plan 삭제
*/ */
const handleDeletePlan = async (e, id) => { const handleDeletePlan = async (e, targetPlan) => {
e.stopPropagation() // 이벤트 버블링 방지 e.stopPropagation() // 이벤트 버블링 방지
await delCanvasById(id) const isSuccess = await deleteObjectPlan(targetPlan.id, targetPlan.objectNo, targetPlan.planNo)
if (!isSuccess) return
await delCanvasById(targetPlan.id)
.then((res) => { .then((res) => {
setPlans((plans) => plans.filter((plan) => plan.id !== id)) setPlans((plans) => plans.filter((plan) => plan.id !== targetPlan.id))
removeImage(currentCanvasPlan.id) removeImage(currentCanvasPlan.id)
swalFire({ text: getMessage('plan.message.delete') }) swalFire({ text: getMessage('plan.message.delete') })
}) })
@ -341,11 +356,10 @@ export function usePlan(params = {}) {
}) })
// 삭제 후 last 데이터에 포커싱 // 삭제 후 last 데이터에 포커싱
const lastPlan = plans.filter((plan) => plan.id !== id).at(-1) const lastPlan = plans.filter((plan) => plan.id !== targetPlan.id).at(-1)
if (!lastPlan) { if (!lastPlan) {
setPlanNum(0)
setCurrentCanvasPlan(null) setCurrentCanvasPlan(null)
} else if (id !== lastPlan.id) { } else if (targetPlan.id !== lastPlan.id) {
updateCurrentPlan(lastPlan.id) updateCurrentPlan(lastPlan.id)
} }
} }
@ -353,13 +367,11 @@ export function usePlan(params = {}) {
/** /**
* plan 조회 * plan 조회
*/ */
const loadCanvasPlanData = async (userId, objectNo, pid) => { const loadCanvasPlanData = async (userId, objectNo, planNo) => {
await getCanvasByObjectNo(userId, objectNo).then((res) => { await getCanvasByObjectNo(userId, objectNo).then((res) => {
// console.log('canvas 목록 ', res)
if (res.length > 0) { if (res.length > 0) {
setPlans(res) setPlans(res)
updateCurrentPlan(res[pid - 1].id) updateCurrentPlan(res.find((plan) => plan.planNo === planNo).id)
setPlanNum(res.length)
} else { } else {
postCanvasStatus(userId, objectNo, '') postCanvasStatus(userId, objectNo, '')
} }
@ -370,7 +382,7 @@ export function usePlan(params = {}) {
* 현재 plan 이동 -> 새로운 링크로 이동 * 현재 plan 이동 -> 새로운 링크로 이동
*/ */
const handlePlanMove = () => { const handlePlanMove = () => {
router.push(`${pathname}?objectNo=${floorPlanState.objectNo}&pid=${currentCanvasPlan?.ordering}`) router.push(`${pathname}?objectNo=${floorPlanState.objectNo}&pid=${currentCanvasPlan?.planNo}`)
} }
return { return {

View File

@ -427,6 +427,13 @@ export const usePolygon = () => {
text = '西西南' text = '西西南'
} }
const sameDirectionCnt = canvas.getObjects().filter((obj) => {
const onlyStrDirection = obj.directionText?.replace(/[0-9]/g, '')
return obj.name === POLYGON_TYPE.ROOF && onlyStrDirection === text
})
text = text + (sameDirectionCnt.length + 1)
polygon.set('directionText', text)
const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, { const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, {
fontFamily: flowFontOptions.fontFamily.value, fontFamily: flowFontOptions.fontFamily.value,
fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal',

File diff suppressed because it is too large Load Diff

View File

@ -134,3 +134,18 @@ export const getQueryString = (o) => {
.join('&') .join('&')
return `?${queryString}` return `?${queryString}`
} }
export const unescapeString = (str) => {
const regex = /&(amp|lt|gt|quot|#39);/g
const chars = {
'&amp;': '&',
'&lt;': '<',
'&gt;': '>',
'&quot;': '"',
'&#39;': "'",
}
if (regex.test(str)) {
return str.replace(regex, (matched) => chars[matched] || matched)
}
}