配置面初期設定 - 계산기 토클버튼 추가

This commit is contained in:
ysCha 2026-03-19 16:51:36 +09:00
parent ebc6181bd4
commit 025b7ede7c
3 changed files with 27 additions and 4 deletions

View File

@ -1,5 +1,5 @@
import { useEffect, useRef, useState } from 'react' import { useEffect, useRef, useState } from 'react'
import Image from 'next/image'
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -35,6 +35,8 @@ export const ROOF_MATERIAL_LAYOUT = {
export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, planNo, openPoint }) { export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, planNo, openPoint }) {
const [showSizeGuideModal, setShowSizeGuidModal] = useState(false) const [showSizeGuideModal, setShowSizeGuidModal] = useState(false)
const [showMaterialGuideModal, setShowMaterialGuidModal] = useState(false) const [showMaterialGuideModal, setShowMaterialGuidModal] = useState(false)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const { getMessage } = useMessage() const { getMessage } = useMessage()
const roofMaterials = useRecoilValue(roofMaterialsAtom) const roofMaterials = useRecoilValue(roofMaterialsAtom)
@ -398,6 +400,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.widAuth === 'R'} readOnly={currentRoof?.widAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -433,6 +436,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.lenAuth === 'R'} readOnly={currentRoof?.lenAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -490,6 +494,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
}} }}
readOnly={currentRoof?.roofPchAuth === 'R'} readOnly={currentRoof?.roofPchAuth === 'R'}
disabled={currentRoof?.roofSizeSet === '3'} disabled={currentRoof?.roofSizeSet === '3'}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: false, //(index !== 0), allowDecimal: false, //(index !== 0),
@ -588,6 +593,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
})) }))
} }
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true, allowDecimal: true,
@ -603,7 +609,10 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, pla
</tbody> </tbody>
</table> </table>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSaveBtn}> <button className="btn-frame modal act" onClick={handleSaveBtn}>
{getMessage('modal.common.save')} {getMessage('modal.common.save')}
</button> </button>

View File

@ -1,5 +1,6 @@
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox' import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting' import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -38,6 +39,8 @@ export default function ContextRoofAllocationSetting(props) {
handleChangePitch, handleChangePitch,
} = useRoofAllocationSetting(id) } = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const { findCommonCode } = useCommonCode() const { findCommonCode } = useCommonCode()
const pitchText = useRecoilValue(pitchTextSelector) const pitchText = useRecoilValue(pitchTextSelector)
const globalLocale = useRecoilValue(globalLocaleStore) const globalLocale = useRecoilValue(globalLocaleStore)
@ -223,6 +226,7 @@ export default function ContextRoofAllocationSetting(props) {
onChange={(value) => { onChange={(value) => {
handleChangePitch(value, index) handleChangePitch(value, index)
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -238,7 +242,10 @@ export default function ContextRoofAllocationSetting(props) {
})} })}
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSaveContext}> <button className="btn-frame modal act" onClick={handleSaveContext}>
{getMessage('modal.roof.alloc.apply')} {getMessage('modal.roof.alloc.apply')}
</button> </button>

View File

@ -1,5 +1,6 @@
import { useMessage } from '@/hooks/useMessage' import { useMessage } from '@/hooks/useMessage'
import WithDraggable from '@/components/common/draggable/WithDraggable' import WithDraggable from '@/components/common/draggable/WithDraggable'
import Image from 'next/image'
import QSelectBox from '@/components/common/select/QSelectBox' import QSelectBox from '@/components/common/select/QSelectBox'
import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting' import { useRoofAllocationSetting } from '@/hooks/roofcover/useRoofAllocationSetting'
import { usePopup } from '@/hooks/usePopup' import { usePopup } from '@/hooks/usePopup'
@ -37,6 +38,8 @@ export default function RoofAllocationSetting(props) {
handleChangeInput, handleChangeInput,
handleChangePitch, handleChangePitch,
} = useRoofAllocationSetting(id) } = useRoofAllocationSetting(id)
const [useCalcPad, setUseCalcPad] = useState(false)
const disableKeypad = !useCalcPad
const pitchText = useRecoilValue(pitchTextSelector) const pitchText = useRecoilValue(pitchTextSelector)
const { findCommonCode } = useCommonCode() const { findCommonCode } = useCommonCode()
const [raftCodes, setRaftCodes] = useState([]) const [raftCodes, setRaftCodes] = useState([])
@ -224,6 +227,7 @@ export default function RoofAllocationSetting(props) {
onChange={(value) => { onChange={(value) => {
handleChangePitch(value, index) handleChangePitch(value, index)
}} }}
disableKeypad={disableKeypad}
options={{ options={{
allowNegative: false, allowNegative: false,
allowDecimal: true //(index !== 0), allowDecimal: true //(index !== 0),
@ -260,7 +264,10 @@ export default function RoofAllocationSetting(props) {
})} })}
</div> </div>
</div> </div>
<div className="grid-btn-wrap"> <div className="grid-btn-wrap" style={{ display: 'flex', alignItems: 'center', justifyContent: 'flex-end', gap: '5px' }}>
<button style={{ width: 'auto' }} onClick={() => setUseCalcPad((prev) => !prev)}>
<Image src={useCalcPad ? '/static/images/common/Icon_ON_Black.png' : '/static/images/common/Icon_OFF_Black.png'} alt="toggle" width={34} height={34} />
</button>
<button className="btn-frame modal act" onClick={handleSave}> <button className="btn-frame modal act" onClick={handleSave}>
{getMessage('modal.roof.alloc.apply')} {getMessage('modal.roof.alloc.apply')}
</button> </button>