diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 2402b3e0..426724eb 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -11,6 +11,7 @@ import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' import { isObjectNotEmpty } from '@/util/common-utils' import { normalizeDecimal} from '@/util/input-utils' +import { CalculatorInput } from '@/components/common/input/CalcInput' export default function Module({ setTabNum }) { const { getMessage } = useMessage() @@ -185,11 +186,23 @@ export default function Module({ setTabNum }) {
- setInputInstallHeight(normalizeDecimal(e.target.value))}*/} + {/*/>*/} + setInputInstallHeight(normalizeDecimal(e.target.value))} + onChange={(value) => setInputInstallHeight(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
m diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index 6359163f..fdf599be 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -10,6 +10,7 @@ import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' import { useCommonCode } from '@/hooks/common/useCommonCode' import Swal from 'sweetalert2' import { normalizeDecimal} from '@/util/input-utils' +import { CalculatorInput } from '@/components/common/input/CalcInput' export const Orientation = forwardRef((props, ref) => { const { getMessage } = useMessage() @@ -436,13 +437,26 @@ export const Orientation = forwardRef((props, ref) => {
- checkDegree(e.target.value)}*/} + {/*/>*/} + checkDegree(e.target.value)} + onChange={(value) => setInputCompasDeg(value)} + options={{ + allowNegative: true, + allowDecimal: false + }} />
° @@ -533,7 +547,19 @@ export const Orientation = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.placement.area')}
- setInputMargin(normalizeDecimal(e.target.value))} /> + {/* setInputMargin(normalizeDecimal(e.target.value))} />*/} + setInputMargin(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} + />
m
@@ -561,11 +587,23 @@ export const Orientation = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.fitting.height')}
- handleChangeInstallHeight(normalizeDecimal(e.target.value))}*/} + {/*/>*/} + handleChangeInstallHeight(normalizeDecimal(e.target.value))} + onChange={(value) => handleChangeInstallHeight(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
m @@ -589,11 +627,23 @@ export const Orientation = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.standard.snowfall.amount')}
- handleChangeVerticalSnowCover(normalizeDecimal(e.target.value))}*/} + {/*/>*/} + handleChangeVerticalSnowCover(normalizeDecimal(e.target.value))} + value={inputInstallHeight} + onChange={(value) => handleChangeVerticalSnowCover(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
cm diff --git a/src/components/floor-plan/modal/basic/step/Trestle.jsx b/src/components/floor-plan/modal/basic/step/Trestle.jsx index 13f46a31..a1061a87 100644 --- a/src/components/floor-plan/modal/basic/step/Trestle.jsx +++ b/src/components/floor-plan/modal/basic/step/Trestle.jsx @@ -10,6 +10,7 @@ import { forwardRef, useContext, useEffect, useImperativeHandle, useRef, useStat import { useRecoilState, useRecoilValue } from 'recoil' import Swal from 'sweetalert2' import { normalizeDigits } from '@/util/input-utils' +import { CalculatorInput } from '@/components/common/input/CalcInput' const Trestle = forwardRef((props, ref) => { const { tabNum, setTabNum, trestleTrigger, roofs, setRoofs, moduleSelectionData, setModuleSelectionData, setRoofsStore } = props @@ -885,12 +886,24 @@ const Trestle = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.placement.area.eaves')}
- dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, eavesMargin: e.target.value } })}*/} + {/* onChange={(e) => setEavesMargin(+e.target.value)}*/} + {/*/>*/} + dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, eavesMargin: e.target.value } })} - onChange={(e) => setEavesMargin(+e.target.value)} + onChange={(value) => setEavesMargin(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
mm @@ -898,12 +911,24 @@ const Trestle = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.placement.area.ridge')}
- dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, ridgeMargin: e.target.value } })}*/} + {/* onChange={(e) => setRidgeMargin(+e.target.value)}*/} + {/*/>*/} + dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, ridgeMargin: e.target.value } })} - onChange={(e) => setRidgeMargin(+e.target.value)} + onChange={(value) => setRidgeMargin(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
mm @@ -911,12 +936,24 @@ const Trestle = forwardRef((props, ref) => {
{getMessage('modal.module.basic.setting.module.placement.area.keraba')}
- dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, kerabaMargin: e.target.value } })}*/} + {/* onChange={(e) => setKerabaMargin(+e.target.value)}*/} + {/*/>*/} + dispatch({ type: 'SET_TRESTLE_DETAIL', roof: { ...trestleState, kerabaMargin: e.target.value } })} - onChange={(e) => setKerabaMargin(+e.target.value)} + onChange={(value) => setKerabaMargin(value)} + options={{ + allowNegative: false, + allowDecimal: false + }} />
mm diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index e0843b5d..dfcc547c 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -23,6 +23,7 @@ import { QcastContext } from '@/app/QcastProvider' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useSwal } from '@/hooks/useSwal' import { sanitizeIntegerInputEvent } from '@/util/input-utils' +import { CalculatorInput } from '@/components/common/input/CalcInput' export default function StuffDetail() { const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState) @@ -1204,8 +1205,10 @@ export default function StuffDetail() { } // 저장 - const onValid = async () => { - const formData = form.getValues() + const onValid = async (actionType) => { + const formData = form.getValues(); + if(actionType !== 'save') return false + console.log('Action type:', actionType); // 'save' 또는 'tempSave' let errors = {} let fieldNm @@ -1715,7 +1718,7 @@ export default function StuffDetail() { - - - - - -