지붕재 선택 작업중

This commit is contained in:
hyojun.choi 2024-12-17 17:20:01 +09:00
parent b38cbd39de
commit 9ab38ec8af
4 changed files with 27 additions and 9 deletions

View File

@ -28,11 +28,9 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
const { basicSetting, setBasicSettings, fetchBasicSettings, basicSettingSave } = useCanvasSetting()
const { findCommonCode } = useCommonCode()
const [raftCodes, setRaftCodes] = useState([])
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(
isObjectNotEmpty(basicSetting.selectedRoofMaterial) ? basicSetting.selectedRoofMaterial : roofMaterials[0],
)
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(basicSetting.selectedRoofMaterial)
const [roofLayout, setRoofLayout] = useState(ROOF_MATERIAL_LAYOUT.PARALLEL)
const [roofLayout, setRoofLayout] = useState(basicSetting.selectedRoofMaterial.layout)
const roofRef = {
roofCd: useRef(null),
@ -66,7 +64,6 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
selected: true,
layout: roofLayout,
}
console.log('roofInfo', roofInfo)
const addedRoofs = []
addedRoofs.push(roofInfo)
@ -290,6 +287,23 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
</div>
)}
</div>
<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)}
>
{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)}
>
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
</button>
</div>
</div>
</td>
</tr>
</tbody>

View File

@ -72,7 +72,7 @@ export default function RoofAllocationSetting(props) {
return (
<div className="grid-option-box" key={index}>
<div className="d-check-radio pop no-text">
<input type="radio" name="radio01" checked={roof.selected} readOnly={true} />
<input type="radio" name="radio01" checked={roof.selected && 'checked'} readOnly={true} />
<label
htmlFor="ra01"
onClick={(e) => {
@ -99,7 +99,7 @@ export default function RoofAllocationSetting(props) {
<div className="flex-ment">
<span>W</span>
<div className="input-grid" style={{ width: '100px' }}>
<input type="text" className="input-origin block" defaultValue={100} readOnly />
<input type="text" className="input-origin block" defaultValue={roof.width} readOnly />
</div>
{/* <div className="select-wrap" style={{ width: '84px' }}>
<select className="select-light dark" name="" id="">
@ -112,7 +112,7 @@ export default function RoofAllocationSetting(props) {
<div className="flex-ment">
<span>L</span>
<div className="input-grid" style={{ width: '100px' }}>
<input type="text" className="input-origin block" defaultValue={100} readOnly />
<input type="text" className="input-origin block" defaultValue={roof.length} readOnly />
</div>
{/* <div className="select-wrap" style={{ width: '84px' }}>
<select className="select-light dark" name="" id="">

View File

@ -8,7 +8,6 @@ export function useRoofFn() {
//면형상 선택 클릭시 지붕 패턴 입히기
function setSurfaceShapePattern(polygon, mode = 'onlyBorder', trestleMode = false) {
debugger
const ratio = window.devicePixelRatio || 1
let width = selectedRoofMaterial.width / 10

View File

@ -30,6 +30,7 @@ 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 = {
INTERVAL: {
@ -107,6 +108,9 @@ export function useCanvasSetting() {
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
useEffect(() => {
if (roofMaterials.length !== 0) {
return
}
addRoofMaterials()
}, [])
@ -131,6 +135,7 @@ export function useCanvasSetting() {
length: item.lenBase && parseInt(item.lenBase),
width: item.widBase && parseInt(item.widBase),
raft: item.raftBase && parseInt(item.raftBase),
layout: ROOF_MATERIAL_LAYOUT.PARALLEL,
hajebichi: item.roofPchBase && parseInt(item.roofPchBase),
}))
setRoofMaterials(roofLists)