withDraggable spinner 추가
This commit is contained in:
parent
2da7ea0c78
commit
9e9bd8f9c4
@ -51,6 +51,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
} = props
|
} = props
|
||||||
const [inputCompasDeg, setInputCompasDeg] = useState(compasDeg ?? 0)
|
const [inputCompasDeg, setInputCompasDeg] = useState(compasDeg ?? 0)
|
||||||
const [inputInstallHeight, setInputInstallHeight] = useState('0')
|
const [inputInstallHeight, setInputInstallHeight] = useState('0')
|
||||||
|
const [inputMargin, setInputMargin] = useState('0')
|
||||||
const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState('0')
|
const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState('0')
|
||||||
const [inputRoughness, setInputRoughness] = useState(selectedSurfaceType)
|
const [inputRoughness, setInputRoughness] = useState(selectedSurfaceType)
|
||||||
const [inputStandardWindSpeed, setInputStandardWindSpeed] = useState(standardWindSpeed)
|
const [inputStandardWindSpeed, setInputStandardWindSpeed] = useState(standardWindSpeed)
|
||||||
@ -93,7 +94,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (addedRoofs) {
|
if (addedRoofs) {
|
||||||
setRoofs(addedRoofs)
|
// setRoofs(addedRoofs)
|
||||||
// setAddedRoofs(roofsStore)
|
// setAddedRoofs(roofsStore)
|
||||||
}
|
}
|
||||||
}, [addedRoofs])
|
}, [addedRoofs])
|
||||||
@ -113,6 +114,7 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
saleStoreNorthFlg: managementState?.saleStoreNorthFlg,
|
saleStoreNorthFlg: managementState?.saleStoreNorthFlg,
|
||||||
moduleTpCd: selectedModules.itemTp,
|
moduleTpCd: selectedModules.itemTp,
|
||||||
moduleItemId: selectedModules.itemId,
|
moduleItemId: selectedModules.itemId,
|
||||||
|
margin: inputMargin,
|
||||||
}
|
}
|
||||||
setCompasDeg(inputCompasDeg)
|
setCompasDeg(inputCompasDeg)
|
||||||
setInstallHeight(inputInstallHeight)
|
setInstallHeight(inputInstallHeight)
|
||||||
@ -199,7 +201,6 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeModule = (e) => {
|
const handleChangeModule = (e) => {
|
||||||
console.log('hhㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗㅗ')
|
|
||||||
resetRoofs()
|
resetRoofs()
|
||||||
setSelectedModules(e)
|
setSelectedModules(e)
|
||||||
}
|
}
|
||||||
@ -383,23 +384,18 @@ export const Orientation = forwardRef((props, ref) => {
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
{basicSetting && basicSetting.roofSizeSet === '3' && (
|
{basicSetting && basicSetting.roofSizeSet == '3' && (
|
||||||
<div className="outline-form mt15">
|
<div className="outline-form mt15">
|
||||||
<span>{getMessage('modal.module.basic.setting.module.placement.area')}</span>
|
<span>{getMessage('modal.module.basic.setting.module.placement.area')}</span>
|
||||||
<div className="input-grid mr10" style={{ width: '60px' }}>
|
<div className="input-grid mr10" style={{ width: '60px' }}>
|
||||||
<input
|
<input type="text" className="input-origin block" value={inputMargin} onChange={(e) => setInputMargin(e.target.value)} />
|
||||||
type="text"
|
|
||||||
className="input-origin block"
|
|
||||||
value={inputInstallHeight}
|
|
||||||
onChange={(e) => setInputInstallHeight(e.target.value)}
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<span className="thin">m</span>
|
<span className="thin">m</span>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{basicSetting && basicSetting.roofSizeSet !== '3' && (
|
{basicSetting && basicSetting.roofSizeSet != '3' && (
|
||||||
<div className="compas-table-box">
|
<div className="compas-table-box">
|
||||||
<div className="compas-grid-table">
|
<div className="compas-grid-table">
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
|
|||||||
@ -2,8 +2,9 @@ import { use, useContext, useEffect, useReducer, useState } from 'react'
|
|||||||
import { useCommonCode } from '../common/useCommonCode'
|
import { useCommonCode } from '../common/useCommonCode'
|
||||||
import { useMasterController } from '../common/useMasterController'
|
import { useMasterController } from '../common/useMasterController'
|
||||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
|
import { popSpinnerState } from '@/store/popupAtom'
|
||||||
|
|
||||||
const RAFT_BASE_CODE = '203800'
|
const RAFT_BASE_CODE = '203800'
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ export function useModuleTrestle(props) {
|
|||||||
const [kerabaMargin, setKerabaMargin] = useState(0)
|
const [kerabaMargin, setKerabaMargin] = useState(0)
|
||||||
const [trestleState, dispatch] = useReducer(trestleReducer, null)
|
const [trestleState, dispatch] = useReducer(trestleReducer, null)
|
||||||
const [trestleDetail, setTrestleDetail] = useState(null)
|
const [trestleDetail, setTrestleDetail] = useState(null)
|
||||||
|
const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const raftCodeList = findCommonCode(RAFT_BASE_CODE)
|
const raftCodeList = findCommonCode(RAFT_BASE_CODE)
|
||||||
@ -120,39 +122,58 @@ export function useModuleTrestle(props) {
|
|||||||
}, [trestleState])
|
}, [trestleState])
|
||||||
|
|
||||||
const handleSetTrestleList = () => {
|
const handleSetTrestleList = () => {
|
||||||
|
setPopSpinnerStore(true)
|
||||||
getTrestleList({
|
getTrestleList({
|
||||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
if (res?.data) setTrestleList(res.data)
|
if (res?.data) setTrestleList(res.data)
|
||||||
|
setPopSpinnerStore(false)
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
setPopSpinnerStore(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetConstMthdList = () => {
|
const handleSetConstMthdList = () => {
|
||||||
|
setPopSpinnerStore(true)
|
||||||
getTrestleList({
|
getTrestleList({
|
||||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||||
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
if (res?.data) setConstMthdList(res.data)
|
if (res?.data) setConstMthdList(res.data)
|
||||||
|
setPopSpinnerStore(false)
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
setPopSpinnerStore(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetRoofBaseList = () => {
|
const handleSetRoofBaseList = () => {
|
||||||
|
setPopSpinnerStore(true)
|
||||||
getTrestleList({
|
getTrestleList({
|
||||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||||
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
raftBaseCd: trestleState?.raftBaseCd ?? '',
|
||||||
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
trestleMkrCd: trestleState?.trestleMkrCd ?? '',
|
||||||
constMthdCd: trestleState?.constMthdCd ?? '',
|
constMthdCd: trestleState?.constMthdCd ?? '',
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
if (res?.data) setRoofBaseList(res.data)
|
if (res?.data) setRoofBaseList(res.data)
|
||||||
|
setPopSpinnerStore(false)
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
setPopSpinnerStore(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetConstructionList = () => {
|
const handleSetConstructionList = () => {
|
||||||
|
setPopSpinnerStore(true)
|
||||||
getConstructionList({
|
getConstructionList({
|
||||||
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
moduleTpCd: trestleState?.moduleTpCd ?? '',
|
||||||
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
roofMatlCd: trestleState?.roofMatlCd ?? '',
|
||||||
@ -166,12 +187,18 @@ export function useModuleTrestle(props) {
|
|||||||
inclCd: trestleState.inclCd ?? '',
|
inclCd: trestleState.inclCd ?? '',
|
||||||
raftBaseCd: trestleState.raftBaseCd ?? '',
|
raftBaseCd: trestleState.raftBaseCd ?? '',
|
||||||
roofPitch: Math.round(trestleState.roofPitch) ?? '',
|
roofPitch: Math.round(trestleState.roofPitch) ?? '',
|
||||||
}).then((res) => {
|
})
|
||||||
|
.then((res) => {
|
||||||
if (res?.data) setConstructionList(res.data)
|
if (res?.data) setConstructionList(res.data)
|
||||||
|
setPopSpinnerStore(false)
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
setPopSpinnerStore(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSetTrestleDetailData = () => {
|
const handleSetTrestleDetailData = () => {
|
||||||
|
setPopSpinnerStore(true)
|
||||||
getTrestleDetailList([
|
getTrestleDetailList([
|
||||||
{
|
{
|
||||||
moduleTpCd: trestleState.moduleTpCd ?? '',
|
moduleTpCd: trestleState.moduleTpCd ?? '',
|
||||||
@ -189,7 +216,8 @@ export function useModuleTrestle(props) {
|
|||||||
roofPitch: trestleState.roofPitch ?? '',
|
roofPitch: trestleState.roofPitch ?? '',
|
||||||
workingWidth: trestleState.workingWidth ?? '',
|
workingWidth: trestleState.workingWidth ?? '',
|
||||||
},
|
},
|
||||||
]).then((res) => {
|
])
|
||||||
|
.then((res) => {
|
||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
if (!res[0].data) return
|
if (!res[0].data) return
|
||||||
setEavesMargin(res[0].data.eaveIntvl)
|
setEavesMargin(res[0].data.eaveIntvl)
|
||||||
@ -206,6 +234,10 @@ export function useModuleTrestle(props) {
|
|||||||
// },
|
// },
|
||||||
// })
|
// })
|
||||||
}
|
}
|
||||||
|
setPopSpinnerStore(false)
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
setPopSpinnerStore(false)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user