Merge branch 'dev' into dev-yj
This commit is contained in:
commit
304d0840e3
@ -12,10 +12,12 @@ export default function QPagination(props) {
|
||||
return (
|
||||
<ol className="pagination">
|
||||
<li className="page-item first">
|
||||
<button onClick={() => handlePage(1)}></button>
|
||||
<button type="button" disabled={currentPage === 1} onClick={() => handlePage(1)}></button>
|
||||
</li>
|
||||
<li className="page-item prev">
|
||||
<button
|
||||
type="button"
|
||||
disabled={currentPage <= 1}
|
||||
onClick={() => {
|
||||
if (currentPage === 1) return
|
||||
handlePage(Math.max(1, (pageGroup - 2) * pagePerBlock + 1))
|
||||
@ -24,11 +26,15 @@ export default function QPagination(props) {
|
||||
</li>
|
||||
{pageRange.map((page) => (
|
||||
<li className={page === currentPage ? `page-item on` : `page-item`} key={page}>
|
||||
<button onClick={() => handlePage(page)}>{page}</button>
|
||||
<button type="button" onClick={() => handlePage(page)}>
|
||||
{page}
|
||||
</button>
|
||||
</li>
|
||||
))}
|
||||
<li className="page-item next">
|
||||
<button
|
||||
type="button"
|
||||
disabled={currentPage >= totalPages}
|
||||
onClick={() => {
|
||||
if (currentPage === totalPages) return
|
||||
if (pageGroup * pagePerBlock + 1 <= totalPages) handlePage(Math.max(1, pageGroup * pagePerBlock + 1))
|
||||
@ -36,7 +42,7 @@ export default function QPagination(props) {
|
||||
></button>
|
||||
</li>
|
||||
<li className="page-item last">
|
||||
<button onClick={() => handlePage(totalPages)}></button>
|
||||
<button type="button" disabled={currentPage === totalPages} onClick={() => handlePage(totalPages)}></button>
|
||||
</li>
|
||||
</ol>
|
||||
)
|
||||
|
||||
@ -73,7 +73,7 @@ const PentagonDormer = forwardRef((props, refs) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('slope')}</div>
|
||||
<div className="eaves-keraba-th">{getMessage('modal.object.setting.offset.slope')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="outline-form">
|
||||
<div className="input-grid mr5" style={{ width: '60px' }}>
|
||||
|
||||
@ -48,7 +48,7 @@ const TriangleDormer = forwardRef((props, refs) => {
|
||||
</div>
|
||||
</div>
|
||||
<div className="eaves-keraba-item">
|
||||
<div className="eaves-keraba-th">{getMessage('slope')}</div>
|
||||
<div className="eaves-keraba-th">{getMessage('modal.object.setting.offset.slope')}</div>
|
||||
<div className="eaves-keraba-td">
|
||||
<div className="outline-form">
|
||||
<div className="input-grid mr5" style={{ width: '60px' }}>
|
||||
|
||||
@ -536,7 +536,6 @@ export function useModule() {
|
||||
|
||||
const moduleRowRemove = (type) => {
|
||||
const activeModule = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
|
||||
c
|
||||
const rowModules = getRowModules(activeModule)
|
||||
const otherModules = getOtherModules(rowModules)
|
||||
const objects = getObjects()
|
||||
|
||||
@ -239,7 +239,7 @@ export function useRoofAllocationSetting(id) {
|
||||
*/
|
||||
const onAddRoofMaterial = () => {
|
||||
if (currentRoofList.length >= 4) {
|
||||
swalFire({ type: 'alert', icon: 'error', text: getMessage('지붕재는 4개까지 선택 가능합니다.') })
|
||||
swalFire({ type: 'alert', icon: 'error', text: getMessage('roof.exceed.count') })
|
||||
return
|
||||
}
|
||||
setCurrentRoofList([
|
||||
@ -289,7 +289,7 @@ export function useRoofAllocationSetting(id) {
|
||||
const handleSaveContext = () => {
|
||||
basicSettingSave()
|
||||
const newRoofList = currentRoofList.map((roof, idx) => {
|
||||
return { ...roof, index: idx }
|
||||
return { ...roof, index: idx, raft: roof.raft ? roof.raft : roof.raftBaseCd }
|
||||
})
|
||||
setBasicSetting((prev) => {
|
||||
return {
|
||||
@ -379,7 +379,7 @@ export function useRoofAllocationSetting(id) {
|
||||
|
||||
/** 데이터 설정 */
|
||||
const newRoofList = currentRoofList.map((roof, idx) => {
|
||||
return { ...roof, index: idx, ...basicInfo }
|
||||
return { ...roof, index: idx, ...basicInfo, raft: roof.raft ? roof.raft : roof.raftBaseCd }
|
||||
})
|
||||
|
||||
setBasicSetting((prev) => {
|
||||
|
||||
@ -42,6 +42,7 @@ import { useAdsorptionPoint } from './useAdsorptionPoint'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { MODULE_ALIGN_TYPE, useModule } from './module/useModule'
|
||||
import PlacementSurfaceLineProperty from '@/components/floor-plan/modal/placementShape/PlacementSurfaceLineProperty'
|
||||
import { selectedMenuState } from '@/store/menuAtom'
|
||||
|
||||
export function useContextMenu() {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
@ -71,10 +72,11 @@ export function useContextMenu() {
|
||||
const { swalFire } = useSwal()
|
||||
const { alignModule, modulesRemove, moduleRoofRemove } = useModule()
|
||||
const { removeRoofMaterial, removeAllRoofMaterial, moveRoofMaterial, removeOuterLines } = useRoofFn()
|
||||
const selectedMenu = useRecoilValue(selectedMenuState)
|
||||
|
||||
const currentMenuSetting = () => {
|
||||
switch (currentMenu) {
|
||||
case MENU.PLAN_DRAWING:
|
||||
switch (selectedMenu) {
|
||||
case 'placement':
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
@ -115,16 +117,154 @@ export function useContextMenu() {
|
||||
],
|
||||
])
|
||||
break
|
||||
case MENU.ROOF_COVERING.EXTERIOR_WALL_LINE:
|
||||
case MENU.ROOF_COVERING.ROOF_SHAPE_SETTINGS:
|
||||
case MENU.ROOF_COVERING.ROOF_SHAPE_PASSIVITY_SETTINGS:
|
||||
case MENU.ROOF_COVERING.ROOF_SHAPE_EDITING:
|
||||
case MENU.ROOF_COVERING.HELP_LINE_DRAWING:
|
||||
case MENU.ROOF_COVERING.EAVES_KERAVA_EDIT:
|
||||
case MENU.ROOF_COVERING.MOVEMENT_SHAPE_UPDOWN:
|
||||
case MENU.ROOF_COVERING.OUTLINE_EDIT_OFFSET:
|
||||
case MENU.ROOF_COVERING.ROOF_SHAPE_ALLOC:
|
||||
case MENU.ROOF_COVERING.DEFAULT:
|
||||
case 'outline':
|
||||
if (['roof', 'auxiliaryLine'].includes(currentObject?.name)) {
|
||||
}
|
||||
break
|
||||
default:
|
||||
setContextMenu([])
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const handleClick = (e, menu) => {
|
||||
if (menu?.fn) {
|
||||
menu.fn(qContextMenu.currentMousePos)
|
||||
}
|
||||
|
||||
setContextPopupPosition({
|
||||
x: window.innerWidth / 2,
|
||||
y: 180,
|
||||
})
|
||||
setCurrentContextMenu(menu)
|
||||
currentMenuSetting()
|
||||
setQContextMenu({ ...qContextMenu, visible: false })
|
||||
}
|
||||
|
||||
const handleKeyup = (e) => {
|
||||
let menu = null
|
||||
for (let i = 0; i < contextMenu.length; i++) {
|
||||
const temp = contextMenu[i].filter((menu) => {
|
||||
return menu.shortcut?.includes(e.key)
|
||||
})
|
||||
|
||||
if (temp.length > 0) menu = temp[0]
|
||||
}
|
||||
|
||||
if (menu) handleClick(null, menu)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
currentMenuSetting()
|
||||
}, [gridColor, currentMenu])
|
||||
|
||||
useEffect(() => {
|
||||
if (currentContextMenu?.component) addPopup(popupId, 1, currentContextMenu?.component)
|
||||
}, [currentContextMenu])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('currentObject', currentObject)
|
||||
if (currentObject?.name) {
|
||||
switch (currentObject.name) {
|
||||
case 'triangleDormer':
|
||||
case 'pentagonDormer':
|
||||
if (selectedMenu === 'surface') {
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
id: 'sizeEdit',
|
||||
name: getMessage('contextmenu.size.edit'),
|
||||
component: <SizeSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'dormerRemove',
|
||||
shortcut: ['d', 'D'],
|
||||
name: `${getMessage('contextmenu.remove')}(D)`,
|
||||
fn: () => deleteObject(),
|
||||
},
|
||||
{
|
||||
id: 'dormerMove',
|
||||
shortcut: ['m', 'M'],
|
||||
name: `${getMessage('contextmenu.move')}(M)`,
|
||||
fn: () => moveObjectBatch(),
|
||||
},
|
||||
{
|
||||
id: 'dormerCopy',
|
||||
shortcut: ['c', 'C'],
|
||||
name: `${getMessage('contextmenu.copy')}(C)`,
|
||||
fn: () => copyObject(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialEdit',
|
||||
name: getMessage('contextmenu.roof.material.edit'),
|
||||
component: <RoofMaterialSetting id={popupId} />,
|
||||
},
|
||||
{
|
||||
id: 'dormerOffset',
|
||||
name: getMessage('contextmenu.dormer.offset'),
|
||||
component: <DormerOffset id={popupId} title={getMessage('contextmenu.dormer.offset')} />,
|
||||
},
|
||||
],
|
||||
])
|
||||
}
|
||||
break
|
||||
case 'roof':
|
||||
case 'auxiliaryLine':
|
||||
case 'hip':
|
||||
case 'ridge':
|
||||
if (selectedMenu === 'surface') {
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
id: 'sizeEdit',
|
||||
name: getMessage('contextmenu.size.edit'),
|
||||
component: <SizeSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialRemove',
|
||||
shortcut: ['d', 'D'],
|
||||
name: `${getMessage('contextmenu.remove')}(D)`,
|
||||
fn: () => deleteObject(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialMove',
|
||||
shortcut: ['m', 'M'],
|
||||
name: `${getMessage('contextmenu.move')}(M)`,
|
||||
fn: () => moveSurfaceShapeBatch(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialCopy',
|
||||
shortcut: ['c', 'C'],
|
||||
name: `${getMessage('contextmenu.copy')}(C)`,
|
||||
fn: () => copyObject(),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
id: 'roofMaterialEdit',
|
||||
name: getMessage('contextmenu.roof.material.edit'),
|
||||
component: <ContextRoofAllocationSetting id={popupId} />,
|
||||
},
|
||||
{
|
||||
id: 'linePropertyEdit',
|
||||
name: getMessage('contextmenu.line.property.edit'),
|
||||
fn: () => {
|
||||
if (+canvasSetting.roofSizeSet === 3) {
|
||||
swalFire({ text: getMessage('contextmenu.line.property.edit.roof.size.3') })
|
||||
} else {
|
||||
addPopup(popupId, 1, <PlacementSurfaceLineProperty id={popupId} roof={currentObject} />)
|
||||
}
|
||||
},
|
||||
// component: <LinePropertySetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'flowDirectionEdit',
|
||||
name: getMessage('contextmenu.flow.direction.edit'),
|
||||
component: <FlowDirectionSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
],
|
||||
])
|
||||
} else if (selectedMenu === 'outline') {
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
@ -264,144 +404,8 @@ export function useContextMenu() {
|
||||
},
|
||||
],
|
||||
])
|
||||
break
|
||||
default:
|
||||
setContextMenu([])
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
const handleClick = (e, menu) => {
|
||||
if (menu?.fn) {
|
||||
menu.fn(qContextMenu.currentMousePos)
|
||||
}
|
||||
|
||||
setContextPopupPosition({
|
||||
x: window.innerWidth / 2,
|
||||
y: 180,
|
||||
})
|
||||
setCurrentContextMenu(menu)
|
||||
currentMenuSetting()
|
||||
setQContextMenu({ ...qContextMenu, visible: false })
|
||||
}
|
||||
|
||||
const handleKeyup = (e) => {
|
||||
let menu = null
|
||||
for (let i = 0; i < contextMenu.length; i++) {
|
||||
const temp = contextMenu[i].filter((menu) => {
|
||||
return menu.shortcut?.includes(e.key)
|
||||
})
|
||||
|
||||
if (temp.length > 0) menu = temp[0]
|
||||
}
|
||||
|
||||
if (menu) handleClick(null, menu)
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
currentMenuSetting()
|
||||
}, [gridColor, currentMenu])
|
||||
|
||||
useEffect(() => {
|
||||
if (currentContextMenu?.component) addPopup(popupId, 1, currentContextMenu?.component)
|
||||
}, [currentContextMenu])
|
||||
|
||||
useEffect(() => {
|
||||
console.log('currentObject', currentObject)
|
||||
if (currentObject?.name) {
|
||||
switch (currentObject.name) {
|
||||
case 'triangleDormer':
|
||||
case 'pentagonDormer':
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
id: 'sizeEdit',
|
||||
name: getMessage('contextmenu.size.edit'),
|
||||
component: <SizeSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'dormerRemove',
|
||||
shortcut: ['d', 'D'],
|
||||
name: `${getMessage('contextmenu.remove')}(D)`,
|
||||
fn: () => deleteObject(),
|
||||
},
|
||||
{
|
||||
id: 'dormerMove',
|
||||
shortcut: ['m', 'M'],
|
||||
name: `${getMessage('contextmenu.move')}(M)`,
|
||||
fn: () => moveObjectBatch(),
|
||||
},
|
||||
{
|
||||
id: 'dormerCopy',
|
||||
shortcut: ['c', 'C'],
|
||||
name: `${getMessage('contextmenu.copy')}(C)`,
|
||||
fn: () => copyObject(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialEdit',
|
||||
name: getMessage('contextmenu.roof.material.edit'),
|
||||
component: <RoofMaterialSetting id={popupId} />,
|
||||
},
|
||||
{
|
||||
id: 'dormerOffset',
|
||||
name: getMessage('contextmenu.dormer.offset'),
|
||||
component: <DormerOffset id={popupId} title={getMessage('contextmenu.dormer.offset')} />,
|
||||
},
|
||||
],
|
||||
])
|
||||
break
|
||||
case 'roof':
|
||||
setContextMenu([
|
||||
[
|
||||
{
|
||||
id: 'sizeEdit',
|
||||
name: getMessage('contextmenu.size.edit'),
|
||||
component: <SizeSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialRemove',
|
||||
shortcut: ['d', 'D'],
|
||||
name: `${getMessage('contextmenu.remove')}(D)`,
|
||||
fn: () => deleteObject(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialMove',
|
||||
shortcut: ['m', 'M'],
|
||||
name: `${getMessage('contextmenu.move')}(M)`,
|
||||
fn: () => moveSurfaceShapeBatch(),
|
||||
},
|
||||
{
|
||||
id: 'roofMaterialCopy',
|
||||
shortcut: ['c', 'C'],
|
||||
name: `${getMessage('contextmenu.copy')}(C)`,
|
||||
fn: () => copyObject(),
|
||||
},
|
||||
],
|
||||
[
|
||||
{
|
||||
id: 'roofMaterialEdit',
|
||||
name: getMessage('contextmenu.roof.material.edit'),
|
||||
component: <ContextRoofAllocationSetting id={popupId} />,
|
||||
},
|
||||
{
|
||||
id: 'linePropertyEdit',
|
||||
name: getMessage('contextmenu.line.property.edit'),
|
||||
fn: () => {
|
||||
if (+canvasSetting.roofSizeSet === 3) {
|
||||
swalFire({ text: getMessage('contextmenu.line.property.edit.roof.size.3') })
|
||||
} else {
|
||||
addPopup(popupId, 1, <PlacementSurfaceLineProperty id={popupId} roof={currentObject} />)
|
||||
}
|
||||
},
|
||||
// component: <LinePropertySetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
{
|
||||
id: 'flowDirectionEdit',
|
||||
name: getMessage('contextmenu.flow.direction.edit'),
|
||||
component: <FlowDirectionSetting id={popupId} target={currentObject} />,
|
||||
},
|
||||
],
|
||||
])
|
||||
break
|
||||
case 'opening':
|
||||
setContextMenu([
|
||||
|
||||
@ -294,9 +294,9 @@
|
||||
"modal.object.setting.size.setting": "サイズ設定",
|
||||
"modal.object.setting.agreement.depth": "棟の長さ・深さ",
|
||||
"modal.object.setting.offset.depth": "出幅(深さ)",
|
||||
"modal.object.setting.size.width": "",
|
||||
"modal.object.setting.size.width": "幅",
|
||||
"modal.object.setting.offset.width": "出幅(幅)",
|
||||
"modal.object.setting.offset.slope": "",
|
||||
"modal.object.setting.offset.slope": "勾配",
|
||||
"modal.object.setting.direction.select": "方向の選択",
|
||||
"modal.placement.surface.setting.info": "ⓘ①の長さ入力後、対角線長を入力すると②の長さを自動計算します。",
|
||||
"modal.placement.surface.setting.diagonal.length": "斜めの長さ",
|
||||
@ -1015,8 +1015,8 @@
|
||||
"module.place.select.one.module": "モジュールは1つだけ選択してください。",
|
||||
"batch.canvas.delete.all": "配置面の内容をすべて削除しますか?",
|
||||
"module.not.found": "インストールモジュールを選択してください。",
|
||||
"module.circuit.minimun.error": "",
|
||||
"module.already.exist.error": "",
|
||||
"module.circuit.minimun.error": "회로번호는 1 이상입력해주세요.(JA)",
|
||||
"module.already.exist.error": "회로번호가 같은 다른 파워 컨디셔너 모듈이 있습니다. 다른 회로번호를 설정하십시오.(JA)",
|
||||
"construction.length.difference": "屋根面工法をすべて選択してください。",
|
||||
"menu.validation.canvas.roof": "パネルを配置するには、屋根面を入力する必要があります。",
|
||||
"batch.object.outside.roof": "オブジェクトは屋根に設置する必要があります。",
|
||||
@ -1028,5 +1028,6 @@
|
||||
"not.allocation.exist.module": "回路を割り当てていないモジュールがあります。",
|
||||
"roof.is.not.selected": "屋根の選択をお願いします。",
|
||||
"length.direction.is.required": "長さと方向を入力します。",
|
||||
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。"
|
||||
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。",
|
||||
"roof.exceed.count": "屋根材は4つまで選択可能です。"
|
||||
}
|
||||
|
||||
@ -1028,5 +1028,6 @@
|
||||
"not.allocation.exist.module": "회로를 할당하지 않은 모듈이 있습니다.",
|
||||
"roof.is.not.selected": "지붕을 선택해주세요.",
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요.",
|
||||
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다."
|
||||
"canvas.infomation.text": "숫자는 [반각] 입력만 가능합니다.",
|
||||
"roof.exceed.count": "지붕재는 4개까지 선택 가능합니다."
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user