Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
김민식 2025-02-12 12:27:30 +09:00
commit 58ca5abfed
3 changed files with 19 additions and 10 deletions

View File

@ -21,6 +21,8 @@ const Placement = forwardRef((props, refs) => {
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
const { makeModuleInitArea } = useModuleBasicSetting(3)
const [isMultiModule, setIsMultiModule] = useState(false)
//
useEffect(() => {
if (moduleSelectionData) {
@ -49,6 +51,11 @@ const Placement = forwardRef((props, refs) => {
setSelectedItems(initCheckedModule)
setSelectedModules(moduleSelectionData.module)
}
//
if (moduleSelectionData.module.itemList.length > 1) {
setIsMultiModule(true)
}
}
}, [moduleSelectionData])
@ -190,6 +197,7 @@ const Placement = forwardRef((props, refs) => {
checked={setupLocation === 'center'}
value={'center'}
onChange={handleSetupLocation}
disabled={isMultiModule}
/>
<label htmlFor="ra03">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.center')}</label>
</div>
@ -212,6 +220,7 @@ const Placement = forwardRef((props, refs) => {
checked={setupLocation === 'ridge'}
value={'ridge'}
onChange={handleSetupLocation}
disabled={isMultiModule}
/>
<label htmlFor="ra05">{getMessage('modal.module.basic.setting.module.placement.arrangement.standard.ridge')}</label>
</div>

View File

@ -2076,7 +2076,7 @@ export const useTrestle = () => {
mixMatlNo: module.mixMatlNo,
raftBaseCd: addRoof.raft,
inclCd: addRoof.pitch,
roofPitch: addRoof.roofPchBase,
roofPitch: !addRoof.roofPchBase ? addRoof.roofPchBase : Number(addRoof.roofPchBase),
exposedLowerBottomTotCnt: result.exposedBottom, // 노출 최하면 갯수
exposedHalfBottomTotCnt: result.exposedHalfBottom, // 노출 반하면 갯수
exposedTopTotCnt: result.exposedTop, // 노출 상면 총 수
@ -2443,25 +2443,25 @@ export const useTrestle = () => {
(centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY,
)
}
if (leftModule) {
if (!leftModule) {
leftPoint = { x: x - width, y: y }
leftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY,
)
}
if (rightModule) {
if (!rightModule) {
rightPoint = { x: x + width, y: y }
rightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY,
)
}
if (bottomLeftModule) {
if (!bottomLeftModule) {
bottomLeftPoint = { x: x - width, y: y + h }
bottomLeftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY,
)
}
if (bottomRightModule) {
if (!bottomRightModule) {
bottomRightPoint = { x: x + width, y: y + h }
bottomRightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY,
@ -2504,25 +2504,25 @@ export const useTrestle = () => {
(centerPoint) => Math.abs(centerPoint.x - halfTopRightPoint.x) < maxX && Math.abs(centerPoint.y - halfTopRightPoint.y) < maxY,
)
}
if (leftModule) {
if (!leftModule) {
leftPoint = { x: x + width, y: y }
leftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - leftPoint.x) < maxX && Math.abs(centerPoint.y - leftPoint.y) < maxY,
)
}
if (rightModule) {
if (!rightModule) {
rightPoint = { x: x - width, y: y }
rightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - rightPoint.x) < maxX && Math.abs(centerPoint.y - rightPoint.y) < maxY,
)
}
if (bottomLeftModule) {
if (!bottomLeftModule) {
bottomLeftPoint = { x: x + width, y: y - h }
bottomLeftModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomLeftPoint.x) < maxX && Math.abs(centerPoint.y - bottomLeftPoint.y) < maxY,
)
}
if (bottomRightModule) {
if (!bottomRightModule) {
bottomRightPoint = { x: x - width, y: y - h }
bottomRightModule = centerPoints.find(
(centerPoint) => Math.abs(centerPoint.x - bottomRightPoint.x) < maxX && Math.abs(centerPoint.y - bottomRightPoint.y) < maxY,

View File

@ -333,7 +333,7 @@ export function usePlan(params = {}) {
*/
const handleAddPlan = async (userId, objectNo) => {
if (currentCanvasPlan?.id) {
await saveCanvas(true)
await saveCanvas(false)
}
JSON.parse(currentCanvasData()).objects.length > 0
? swalFire({