지붕재 데이터 hook 사용
This commit is contained in:
parent
b5aeed7874
commit
7e2180cd76
@ -14,6 +14,7 @@ export function useMasterController() {
|
|||||||
const getRoofMaterialList = async () => {
|
const getRoofMaterialList = async () => {
|
||||||
return await get({ url: '/api/v1/master/getRoofMaterialList' }).then((res) => {
|
return await get({ url: '/api/v1/master/getRoofMaterialList' }).then((res) => {
|
||||||
console.log('🚀🚀 ~ getRoofMaterialList ~ res:', res)
|
console.log('🚀🚀 ~ getRoofMaterialList ~ res:', res)
|
||||||
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,6 +26,7 @@ export function useMasterController() {
|
|||||||
const getModuleTypeItemList = async (roofMaterialCd) => {
|
const getModuleTypeItemList = async (roofMaterialCd) => {
|
||||||
return await get({ url: `/api/v1/master/getModuleTypeItemList/${roofMaterialCd}` }).then((res) => {
|
return await get({ url: `/api/v1/master/getModuleTypeItemList/${roofMaterialCd}` }).then((res) => {
|
||||||
console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
|
console.log('🚀🚀 ~ getModuleTypeItemList ~ res:', res)
|
||||||
|
return res
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -27,6 +27,7 @@ import { globalFontAtom } from '@/store/fontAtom'
|
|||||||
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
||||||
import { gridColorState } from '@/store/gridAtom'
|
import { gridColorState } from '@/store/gridAtom'
|
||||||
import { useColor } from 'react-color-palette'
|
import { useColor } from 'react-color-palette'
|
||||||
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
|
|
||||||
const defaultDotLineGridSetting = {
|
const defaultDotLineGridSetting = {
|
||||||
INTERVAL: {
|
INTERVAL: {
|
||||||
@ -91,7 +92,7 @@ export function useCanvasSetting() {
|
|||||||
|
|
||||||
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
const [canvasSetting, setCanvasSetting] = useRecoilState(canvasSettingState)
|
||||||
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState)
|
||||||
|
const { getRoofMaterialList } = useMasterController()
|
||||||
const [roofMaterials, setRoofMaterials] = useRecoilState(roofMaterialsAtom)
|
const [roofMaterials, setRoofMaterials] = useRecoilState(roofMaterialsAtom)
|
||||||
|
|
||||||
const SelectOptions = [
|
const SelectOptions = [
|
||||||
@ -101,10 +102,9 @@ export function useCanvasSetting() {
|
|||||||
{ id: 4, name: '1/10', value: 1 / 10 },
|
{ id: 4, name: '1/10', value: 1 / 10 },
|
||||||
]
|
]
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(async () => {
|
||||||
get({ url: `/api/v1/master/getRoofMaterialList` }).then((res) => {
|
const { data } = await getRoofMaterialList()
|
||||||
setRoofMaterials(res.data)
|
setRoofMaterials(data)
|
||||||
})
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user