Merge branch 'dev' into dev-yj
This commit is contained in:
commit
d7e5fd8a87
@ -10,11 +10,12 @@ import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { roofMaterialsAtom } from '@/store/settingAtom'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
|
||||
import { onlyNumberInputChange } from '@/util/input-utils'
|
||||
|
||||
export const ROOF_MATERIAL_LAYOUT = {
|
||||
PARALLEL: 'P',
|
||||
STAIRS: 'S',
|
||||
@ -29,10 +30,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
||||
const { basicSetting, setBasicSettings, fetchBasicSettings, basicSettingSave, addedRoofs, setAddedRoofs } = useCanvasSetting()
|
||||
const { findCommonCode } = useCommonCode()
|
||||
const [raftCodes, setRaftCodes] = useState([])
|
||||
//const [currentRoofMaterial, setCurrentRoofMaterial] = useState(basicSetting.selectedRoofMaterial)
|
||||
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(addedRoofs[0]) // 지붕재 정보
|
||||
const [roofLayout, setRoofLayout] = useState(addedRoofs[0].layout) // 지붕 레이아웃
|
||||
const [raftCodes, setRaftCodes] = useState([]) //서까래 정보
|
||||
|
||||
const roofRef = {
|
||||
roofCd: useRef(null),
|
||||
@ -47,52 +45,77 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
fetchBasicSettings()
|
||||
const raftCodeList = findCommonCode('203800')
|
||||
setRaftCodes(raftCodeList)
|
||||
console.log('raftCodeList', raftCodeList)
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
//console.log('currentRoofMaterial >>>>>>>>>>>>>>>>>>> ', currentRoofMaterial)
|
||||
|
||||
console.log(' basicSetting.roofs[0] >>>>>>>>>>>>>>>>>>> ', basicSetting.roofs[0])
|
||||
//console.log('basicSetting >>>>>>>>>>>>>>>>>>> ', basicSetting)
|
||||
console.log('roofLayout >>>>>>>>>>>>>>>>>>> ', roofLayout)
|
||||
if (basicSetting.roofs.length > 0) {
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofsData: {
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: basicSetting.roofs[0].roofMatlCd,
|
||||
roofWidth: basicSetting.roofs[0].width,
|
||||
roofHeight: basicSetting.roofs[0].length,
|
||||
roofHajebichi: basicSetting.roofs[0].hajebichi,
|
||||
roofGap: basicSetting.roofs[0].raft,
|
||||
roofLayout: basicSetting.roofs[0].layout,
|
||||
},
|
||||
})
|
||||
}
|
||||
}, [basicSetting.roofs, basicSetting.roofSizeSet, basicSetting.roofAngleSet])
|
||||
|
||||
const changeInput = (value, e) => {
|
||||
const { name } = e.target
|
||||
console.log('🚀 ~ changeInput ~ value name :', value, name)
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofsData: {
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: currentRoofMaterial.roofMatlCd === null ? 'ROOF_ID_WA_53A' : currentRoofMaterial.roofMatlCd,
|
||||
roofWidth: currentRoofMaterial.width === null ? 0 : currentRoofMaterial.width,
|
||||
roofHeight: currentRoofMaterial.length === null ? 0 : currentRoofMaterial.length,
|
||||
roofHajebichi: currentRoofMaterial.hajebichi === null ? 0 : currentRoofMaterial.hajebichi,
|
||||
roofGap: currentRoofMaterial.raftBaseCd === null ? 'HEI_455' : currentRoofMaterial.raftBaseCd,
|
||||
roofLayout: roofLayout,
|
||||
},
|
||||
})
|
||||
}, [currentRoofMaterial, roofLayout, basicSetting.roofSizeSet, basicSetting.roofAngleSet])
|
||||
roofs: basicSetting.roofs.map((roof) => ({
|
||||
...roof,
|
||||
[name]: Number(value),
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
// Function to update the roofType and corresponding values
|
||||
const handleRoofTypeChange = (value) => {
|
||||
const selectedRoofMaterial = roofMaterials.find((roof) => roof.roofMatlCd === value)
|
||||
setCurrentRoofMaterial(selectedRoofMaterial)
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofs: [selectedRoofMaterial], // 선택된 데이터로 roofs 배열 초기화
|
||||
});
|
||||
}
|
||||
|
||||
const handleRafterChange = (value) => {
|
||||
const selectedRafter = raftCodes.find((raft) => raft.clCode === value)
|
||||
setCurrentRoofMaterial({ ...currentRoofMaterial, raft: selectedRafter.clCode })
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofs: basicSetting.roofs.map((roof) => ({
|
||||
...roof,
|
||||
raft: value,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
const handleRoofLayoutChange = (value) => {
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofs: basicSetting.roofs.map((roof) => ({
|
||||
...roof,
|
||||
layout: value,
|
||||
})),
|
||||
});
|
||||
}
|
||||
|
||||
const handleSaveBtn = () => {
|
||||
const roofInfo = {
|
||||
...currentRoofMaterial,
|
||||
const roofInfo = {
|
||||
...basicSetting.roofs,
|
||||
roofCd: roofRef.roofCd.current?.value,
|
||||
width: roofRef.width.current?.value,
|
||||
length: roofRef.length.current?.value,
|
||||
hajebichi: roofRef.hajebichi.current?.value,
|
||||
// raft: roofRef.rafter.current?.value,
|
||||
//raft: roofRef.rafter.current?.value,
|
||||
selected: true,
|
||||
layout: roofLayout,
|
||||
layout: basicSetting.roofs[0].layout,
|
||||
index: 0,
|
||||
}
|
||||
|
||||
@ -107,17 +130,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
selectedRoofMaterial: {
|
||||
// 선택된 지붕재 정보
|
||||
roofInfo,
|
||||
},
|
||||
roofsData: {
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: currentRoofMaterial.roofMatlCd === null ? 'ROOF_ID_WA_53A' : currentRoofMaterial.roofMatlCd,
|
||||
roofWidth: currentRoofMaterial.width === null ? 0 : currentRoofMaterial.width,
|
||||
roofHeight: currentRoofMaterial.length === null ? 0 : currentRoofMaterial.length,
|
||||
roofHajebichi: currentRoofMaterial.hajebichi === null ? 0 : currentRoofMaterial.hajebichi,
|
||||
roofGap: currentRoofMaterial.raftBaseCd === null ? 'HEI_455' : currentRoofMaterial.raftBaseCd,
|
||||
roofLayout: roofLayout,
|
||||
},
|
||||
}
|
||||
})
|
||||
|
||||
setBasicSettings({
|
||||
@ -127,6 +140,16 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
...roofInfo,
|
||||
},
|
||||
roofs: addedRoofs,
|
||||
roofsData: {
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: basicSetting.roofs[0].roofMatlCd,
|
||||
roofWidth: basicSetting.roofs[0].width,
|
||||
roofHeight: basicSetting.roofs[0].length,
|
||||
roofHajebichi: basicSetting.roofs[0].hajebichi,
|
||||
roofGap: basicSetting.roofs[0].raft,
|
||||
roofLayout: basicSetting.roofs[0].layout,
|
||||
},
|
||||
})
|
||||
|
||||
basicSettingSave()
|
||||
@ -238,17 +261,19 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
<div className="placement-option">
|
||||
<div className="grid-select no-flx" style={{ width: '171px' }}>
|
||||
<QSelectBox
|
||||
title={basicSetting.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : ''}
|
||||
title={basicSetting.roofSizeSet == 3 ? getMessage('modal.placement.initial.setting.size.none.pitch') : basicSetting.roofs[0]?.roofMatlNm}
|
||||
ref={roofRef.roofCd}
|
||||
options={roofMaterials.map((roof, index) => {
|
||||
return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
|
||||
})}
|
||||
value={basicSetting.roofSizeSet === '3' ? null : currentRoofMaterial}
|
||||
//value={roofMaterials.find((r) => r.roofMatlCd === basicSetting.roofs[0]?.roofMatlCd)}
|
||||
//title={basicSetting.roofs[0]?.roofMatlNm}
|
||||
value={basicSetting.roofSizeSet == 3 ? null : basicSetting.roofs[0]?.roofMatlCd}
|
||||
onChange={(e) => handleRoofTypeChange(e.roofMatlCd)}
|
||||
sourceKey="id"
|
||||
targetKey="id"
|
||||
showKey="name"
|
||||
disabled={basicSetting.roofSizeSet === '3'}
|
||||
//sourceKey="id"
|
||||
//targetKey="id"
|
||||
//showKey="name"
|
||||
disabled={basicSetting.roofSizeSet == 3}
|
||||
/>
|
||||
{/* <select
|
||||
className="select-light dark"
|
||||
@ -268,17 +293,19 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
})}
|
||||
</select> */}
|
||||
</div>
|
||||
{currentRoofMaterial && ['R', 'C'].includes(currentRoofMaterial.widAuth) && (
|
||||
{basicSetting && ['R', 'C'].includes(basicSetting.roofs[0]?.widAuth) && (
|
||||
<div className="flex-ment">
|
||||
<span>W</span>
|
||||
<div className="input-grid" style={{ width: '84px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
name={`width`}
|
||||
ref={roofRef.width}
|
||||
value={parseInt(currentRoofMaterial.width)}
|
||||
onChange={(e) => setCurrentRoofMaterial({ ...currentRoofMaterial, width: e.target.value })}
|
||||
readOnly={currentRoofMaterial.widAuth === 'R'}
|
||||
value={parseInt(basicSetting.roofs[0]?.width)}
|
||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||
readOnly={basicSetting.roofs[0]?.widAuth === 'R'}
|
||||
disabled={basicSetting.roofSizeSet == 3}
|
||||
/>
|
||||
</div>
|
||||
{/* <div className="input-grid" style={{ width: '63px' }}>
|
||||
@ -291,17 +318,19 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
</div> */}
|
||||
</div>
|
||||
)}
|
||||
{currentRoofMaterial && ['R', 'C'].includes(currentRoofMaterial.lenAuth) && (
|
||||
{basicSetting && ['R', 'C'].includes(basicSetting.roofs[0]?.lenAuth) && (
|
||||
<div className="flex-ment">
|
||||
<span>L</span>
|
||||
<div className="input-grid" style={{ width: '84px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
name={`length`}
|
||||
ref={roofRef.length}
|
||||
value={parseInt(currentRoofMaterial.length)}
|
||||
onChange={(e) => setCurrentRoofMaterial({ ...currentRoofMaterial, length: e.target.value })}
|
||||
readOnly={currentRoofMaterial.lenAuth === 'R'}
|
||||
value={parseInt(basicSetting.roofs[0]?.length)}
|
||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||
readOnly={basicSetting.roofs[0]?.lenAuth === 'R'}
|
||||
disabled={basicSetting.roofSizeSet == 3}
|
||||
/>
|
||||
</div>
|
||||
{/* <div className="input-grid" style={{ width: '63px' }}>
|
||||
@ -314,21 +343,22 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
</div> */}
|
||||
</div>
|
||||
)}
|
||||
{currentRoofMaterial && ['C', 'R'].includes(currentRoofMaterial.raftAuth) && (
|
||||
{basicSetting && ['C', 'R'].includes(basicSetting.roofs[0]?.raftAuth) && (
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
||||
{raftCodes.length > 0 && (
|
||||
<div className="select-wrap" style={{ width: '160px' }}>
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
value={currentRoofMaterial}
|
||||
onChange={(e) => handleRafterChange(e.clCode)}
|
||||
sourceKey="clCode"
|
||||
targetKey={currentRoofMaterial.raft ? 'raft' : 'raftBaseCd'}
|
||||
showKey="clCodeNm"
|
||||
disabled={basicSetting.roofSizeSet === '3'}
|
||||
/>
|
||||
{/* <select className="select-light dark" name="roofGap" ref={roofRef.rafter}>
|
||||
<div className="select-wrap" style={{ width: '160px' }}>
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
title={raftCodes.find((r) => r.clCode === (basicSetting.roofs[0]?.raft === undefined ? basicSetting.roofs[0]?.raftBaseCd : basicSetting.roofs[0]?.raft))?.clCodeNm}
|
||||
value={basicSetting.roofs[0]?.raft === undefined ? basicSetting.roofs[0]?.raftBaseCd : basicSetting.roofs[0]?.raft}
|
||||
onChange={(e) => handleRafterChange(e.clCode)}
|
||||
sourceKey="clCode"
|
||||
targetKey={basicSetting.roofs[0]?.raft ? 'raft' : 'raftBaseCd'}
|
||||
showKey="clCodeNm"
|
||||
disabled={basicSetting.roofSizeSet == 3}
|
||||
/>
|
||||
{/* <select className="select-light dark" name="roofGap" ref={roofRef.rafter}>
|
||||
{raftCodes.map((raft, index) => {
|
||||
return (
|
||||
<option key={index} value={raft.clCode} selected={currentRoofMaterial.raft === raft.clCode}>
|
||||
@ -337,21 +367,23 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
)
|
||||
})}
|
||||
</select> */}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{currentRoofMaterial && ['C', 'R'].includes(currentRoofMaterial.roofPchAuth) && (
|
||||
{basicSetting && ['C', 'R'].includes(basicSetting.roofs[0]?.roofPchAuth) && (
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('hajebichi')}</span>
|
||||
<div className="input-grid" style={{ width: '84px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
name={`hajebichi`}
|
||||
ref={roofRef.hajebichi}
|
||||
value={parseInt(currentRoofMaterial.hajebichi)}
|
||||
onChange={(e) => setCurrentRoofMaterial({ ...currentRoofMaterial, hajebichi: e.target.value })}
|
||||
readOnly={currentRoofMaterial.roofPchAuth === 'R'}
|
||||
value={parseInt(basicSetting.roofs[0]?.hajebichi)}
|
||||
onChange={(e) => onlyNumberInputChange(e, changeInput)}
|
||||
readOnly={basicSetting.roofs[0]?.roofPchAuth === 'R'}
|
||||
disabled={basicSetting.roofSizeSet == 3}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@ -360,15 +392,17 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
<div className="placement-roof-btn-wrap">
|
||||
<div className="icon-btn-wrap mt10">
|
||||
<button
|
||||
className={`${roofLayout === ROOF_MATERIAL_LAYOUT.PARALLEL && 'act'}`}
|
||||
onClick={() => setRoofLayout(ROOF_MATERIAL_LAYOUT.PARALLEL)}
|
||||
className={`${basicSetting.roofs[0]?.layout === ROOF_MATERIAL_LAYOUT.PARALLEL && 'act'}`}
|
||||
value={ROOF_MATERIAL_LAYOUT.PARALLEL}
|
||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.PARALLEL)}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.parallel')}
|
||||
<i className="allocation01"></i>
|
||||
</button>
|
||||
<button
|
||||
className={`${roofLayout === ROOF_MATERIAL_LAYOUT.STAIRS && 'act'}`}
|
||||
onClick={() => setRoofLayout(ROOF_MATERIAL_LAYOUT.STAIRS)}
|
||||
className={`${basicSetting.roofs[0]?.layout === ROOF_MATERIAL_LAYOUT.STAIRS && 'act'}`}
|
||||
value={ROOF_MATERIAL_LAYOUT.STAIRS}
|
||||
onClick={() => handleRoofLayoutChange(ROOF_MATERIAL_LAYOUT.STAIRS)}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
|
||||
</button>
|
||||
|
||||
@ -319,7 +319,13 @@ export default function StuffDetail() {
|
||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
if (res.status === 200) {
|
||||
if (isObjectNotEmpty(res.data)) {
|
||||
setManagementState(res.data)
|
||||
let surfaceTypeValue
|
||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||
surfaceTypeValue = '3'
|
||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
||||
surfaceTypeValue = '2'
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
} else {
|
||||
setManagementState({})
|
||||
alert(getMessage('stuff.detail.header.notExistObjectNo'))
|
||||
|
||||
@ -87,7 +87,7 @@ export default function PlanRequestPop(props) {
|
||||
const onSubmit = (page, type) => {
|
||||
//2차점 테스트 201X112
|
||||
const params = {
|
||||
// saleStoreId: 'T100',
|
||||
// saleStoreId: 'X112',
|
||||
// saleStoreLevel: '1',
|
||||
saleStoreId: props?.otherSaleStoreId ? props.otherSaleStoreId : props.saleStoreId,
|
||||
saleStoreLevel: props?.otherSaleStoreLevel ? props.otherSaleStoreLevel : props.saleStoreLevel,
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { useCallback, useEffect, useState } from 'react'
|
||||
import { useEffect, useState } from 'react'
|
||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||
import {
|
||||
adsorptionPointModeState,
|
||||
@ -19,7 +19,6 @@ import {
|
||||
settingModalSecondOptionsState,
|
||||
settingModalGridOptionsState,
|
||||
basicSettingState,
|
||||
settingsState,
|
||||
roofMaterialsAtom,
|
||||
selectedRoofMaterialSelector,
|
||||
addedRoofsState,
|
||||
@ -30,7 +29,6 @@ import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
||||
import { gridColorState } from '@/store/gridAtom'
|
||||
import { useColor } from 'react-color-palette'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
|
||||
|
||||
const defaultDotLineGridSetting = {
|
||||
@ -144,7 +142,7 @@ export function useCanvasSetting() {
|
||||
newAddedRoofs.push({ ...selectedRoofMaterial, selected: true, index: 0 })
|
||||
setAddedRoofs(newAddedRoofs)
|
||||
}
|
||||
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial })
|
||||
setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial, roofMaterials: selectedRoofMaterial })
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
@ -270,6 +268,18 @@ export function useCanvasSetting() {
|
||||
roofAngleSet: item.roofAngleSet,
|
||||
}
|
||||
})
|
||||
roofsArray = res.map((item) => {
|
||||
return {
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: item.roofMatlCd,
|
||||
roofWidth: item.roofWidth,
|
||||
roofHeight: item.roofHeight,
|
||||
roofHajebichi: item.roofHajebichi,
|
||||
roofGap: item.roofGap,
|
||||
roofLayout: item.roofLayout,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
roofsRow = [
|
||||
{
|
||||
@ -299,7 +309,7 @@ export function useCanvasSetting() {
|
||||
roofs: roofsArray, // 만들어진 roofs 배열
|
||||
}
|
||||
|
||||
console.log('patternData', patternData)
|
||||
console.log('fetchBasicSettings patternData', patternData)
|
||||
|
||||
// 데이터 설정
|
||||
//setBasicSettings({ ...basicSetting, roofSizeSet: roofsRow[0].roofSizeSet, roofAngleSet: roofsRow[0].roofAngleSet, roofsData: roofsArray})
|
||||
@ -307,20 +317,22 @@ export function useCanvasSetting() {
|
||||
roofMaterials.map((material) => {
|
||||
if (material.id === roofsArray[0].roofMatlCd) {
|
||||
//setRoofMaterials({ ...roofMaterials, layout: roofsArray[0].roofLayout })
|
||||
addRoofs.push({ ...material, selected: true, layout: roofsArray[0].roofLayout })
|
||||
setBasicSettings({
|
||||
...basicSetting,
|
||||
roofMaterials: material,
|
||||
roofs: addRoofs,
|
||||
roofSizeSet: roofsRow[0].roofSizeSet,
|
||||
roofAngleSet: roofsRow[0].roofAngleSet,
|
||||
roofsData: roofsArray,
|
||||
})
|
||||
addRoofs.push({ ...material, selected: true
|
||||
, width: roofsArray[0].roofWidth
|
||||
, length: roofsArray[0].roofHeight
|
||||
, hajebichi: roofsArray[0].roofHajebichi
|
||||
, raft: roofsArray[0].roofGap
|
||||
, layout: roofsArray[0].roofLayout
|
||||
})
|
||||
setBasicSettings({ ...basicSetting, roofMaterials: material
|
||||
, roofs: addRoofs
|
||||
, roofSizeSet: roofsRow[0].roofSizeSet
|
||||
, roofAngleSet: roofsRow[0].roofAngleSet
|
||||
, roofsData: roofsArray
|
||||
, selectedRoofMaterial: material })
|
||||
}
|
||||
})
|
||||
|
||||
// 데이터 설정
|
||||
setBasicSettings({ ...basicSetting, roofSizeSet: roofsRow[0].roofSizeSet, roofAngleSet: roofsRow[0].roofAngleSet, roofsData: roofsArray })
|
||||
|
||||
})
|
||||
} catch (error) {
|
||||
console.error('Data fetching error:', error)
|
||||
@ -343,17 +355,17 @@ export function useCanvasSetting() {
|
||||
{
|
||||
roofApply: true,
|
||||
roofSeq: 1,
|
||||
roofMatlCd: basicSetting.roofsData.roofMatlCd === null ? 'ROOF_ID_WA_53A' : basicSetting.roofsData.roofMatlCd,
|
||||
roofWidth: basicSetting.roofsData.roofWidth === null ? 0 : basicSetting.roofsData.roofWidth,
|
||||
roofHeight: basicSetting.roofsData.roofHeight === null ? 0 : basicSetting.roofsData.roofHeight,
|
||||
roofHajebichi: basicSetting.roofsData.roofHajebichi === null ? 0 : basicSetting.roofsData.roofHajebichi,
|
||||
roofGap: basicSetting.roofsData.roofGap === null ? 'HEI_455' : basicSetting.roofsData.roofGap,
|
||||
roofMatlCd: basicSetting.roofsData.roofMatlCd === null || basicSetting.roofsData.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : basicSetting.roofsData.roofMatlCd,
|
||||
roofWidth: basicSetting.roofsData.roofWidth === null || basicSetting.roofsData.roofWidth === undefined ? 0 : basicSetting.roofsData.roofWidth,
|
||||
roofHeight: basicSetting.roofsData.roofHeight === null || basicSetting.roofsData.roofHeight === undefined ? 0 : basicSetting.roofsData.roofHeight,
|
||||
roofHajebichi: basicSetting.roofsData.roofHajebichi === null || basicSetting.roofsData.roofHajebichi === undefined ? 0 : basicSetting.roofsData.roofHajebichi,
|
||||
roofGap: basicSetting.roofsData.roofGap === null || basicSetting.roofsData.roofGap === undefined ? 'HEI_455' : basicSetting.roofsData.roofGap,
|
||||
roofLayout: basicSetting.roofsData.roofLayout,
|
||||
},
|
||||
],
|
||||
}
|
||||
|
||||
console.log('patternData 55', patternData)
|
||||
console.log('basicSettingSave patternData ', patternData)
|
||||
|
||||
await post({ url: `/api/canvas-management/canvas-basic-settings`, data: patternData }).then((res) => {
|
||||
swalFire({ text: getMessage(res.returnMessage) })
|
||||
|
||||
@ -108,6 +108,14 @@ export function useRoofAllocationSetting(id) {
|
||||
|
||||
// 지붕재 오른쪽 마우스 클릭 후 단일로 지붕재 변경 필요한 경우
|
||||
const handleSaveContext = () => {
|
||||
setBasicSetting((prev) => {
|
||||
return {
|
||||
...prev,
|
||||
selectedRoofMaterial: currentRoofList.find((roof) => roof.selected),
|
||||
}
|
||||
})
|
||||
|
||||
setRoofList(currentRoofList)
|
||||
const selectedRoofMaterial = currentRoofList.find((roof) => roof.selected)
|
||||
setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial)
|
||||
closeAll()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user