Merge branch 'dev' into feature/jaeyoung
This commit is contained in:
commit
b10c91909a
@ -1,6 +1,8 @@
|
||||
'use client'
|
||||
|
||||
import { createContext, useState } from 'react'
|
||||
import { loginUserStore } from '@/store/commonAtom'
|
||||
import { createContext, useEffect, useState } from 'react'
|
||||
import { useRecoilState } from 'recoil'
|
||||
|
||||
export const SessionContext = createContext({
|
||||
session: {},
|
||||
@ -8,5 +10,11 @@ export const SessionContext = createContext({
|
||||
|
||||
export default function SessionProvider({ useSession, children }) {
|
||||
const [session, setSession] = useState(useSession)
|
||||
const [loginUserState, setLoginUserState] = useRecoilState(loginUserStore)
|
||||
|
||||
useEffect(() => {
|
||||
setLoginUserState(session)
|
||||
}, [session])
|
||||
|
||||
return <SessionContext.Provider value={{ session }}>{children}</SessionContext.Provider>
|
||||
}
|
||||
|
||||
@ -55,10 +55,6 @@ export default async function RootLayout({ children }) {
|
||||
redirect('/login')
|
||||
}
|
||||
|
||||
if (headerPathname === '/login' && session.isLoggedIn) {
|
||||
redirect('/')
|
||||
}
|
||||
|
||||
return (
|
||||
<RecoilRootWrapper>
|
||||
<GlobalDataProvider>
|
||||
|
||||
@ -177,6 +177,8 @@ export const SAVE_KEY = [
|
||||
'moduleRowsTotCnt',
|
||||
'seq',
|
||||
'smartRackId',
|
||||
'quotationParam',
|
||||
'pcses',
|
||||
]
|
||||
|
||||
export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype]
|
||||
|
||||
@ -5,7 +5,7 @@ import Image from 'next/image'
|
||||
import Link from 'next/link'
|
||||
import { useRecoilState } from 'recoil'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { setSession, login } from '@/lib/authActions'
|
||||
import { setSession, login, checkSession } from '@/lib/authActions'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { sessionStore } from '@/store/commonAtom'
|
||||
@ -21,11 +21,19 @@ export default function Login() {
|
||||
// 자동 로그인
|
||||
const initParams = useSearchParams()
|
||||
const autoLoginParam = initParams.get('autoLoginParam1')
|
||||
|
||||
useEffect(() => {
|
||||
if (autoLoginParam) {
|
||||
autoLoginProcess(autoLoginParam)
|
||||
}
|
||||
|
||||
checkSession().then((res) => {
|
||||
if (res) {
|
||||
login()
|
||||
}
|
||||
})
|
||||
}, [])
|
||||
|
||||
const autoLoginProcess = async (autoLoginParam) => {
|
||||
await promisePost({ url: '/api/login/v1.0/user/login/autoLoginDecryptData', data: { loginId: autoLoginParam } })
|
||||
.then((res) => {
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
|
||||
import { useContext, useEffect, useRef } from 'react'
|
||||
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { useRecoilState, useRecoilValue, useResetRecoilState } from 'recoil'
|
||||
|
||||
import QContextMenu from '@/components/common/context-menu/QContextMenu'
|
||||
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
||||
@ -16,6 +16,7 @@ import { totalDisplaySelector } from '@/store/settingAtom'
|
||||
import { MENU } from '@/common/common'
|
||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||
import { QcastContext } from '@/app/QcastProvider'
|
||||
import { moduleStatisticsState } from '@/store/circuitTrestleAtom'
|
||||
|
||||
export default function CanvasFrame() {
|
||||
const canvasRef = useRef(null)
|
||||
@ -27,7 +28,8 @@ export default function CanvasFrame() {
|
||||
const { currentCanvasPlan } = usePlan()
|
||||
const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState)
|
||||
const reset = useResetRecoilState(moduleStatisticsState)
|
||||
const loadCanvas = () => {
|
||||
if (canvas) {
|
||||
canvas?.clear() // 캔버스를 초기화합니다.
|
||||
@ -43,6 +45,7 @@ export default function CanvasFrame() {
|
||||
|
||||
useEffect(() => {
|
||||
loadCanvas()
|
||||
reset()
|
||||
}, [currentCanvasPlan, canvas])
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { useContext, useEffect, useRef, useState } from 'react'
|
||||
import Module from '@/components/floor-plan/modal/basic/step/Module'
|
||||
import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchModule'
|
||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||
@ -16,6 +16,9 @@ import { addedRoofsState } from '@/store/settingAtom'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import Swal from 'sweetalert2'
|
||||
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
import { loginUserStore } from '@/store/commonAtom'
|
||||
import { currentCanvasPlanState } from '@/store/canvasAtom'
|
||||
|
||||
export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const { getMessage } = useMessage()
|
||||
@ -27,9 +30,12 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||
const addedRoofs = useRecoilValue(addedRoofsState)
|
||||
const loginUserState = useRecoilValue(loginUserStore)
|
||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting()
|
||||
const { updateObjectDate } = useMasterController()
|
||||
const handleBtnNextStep = () => {
|
||||
if (tabNum === 1) {
|
||||
orientationRef.current.handleNextStep()
|
||||
@ -49,6 +55,16 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
//물건정보 갱신일 수정
|
||||
updateObjectDataApi({
|
||||
objectNo: currentCanvasPlan.objectNo, //오브젝트_no
|
||||
standardWindSpeedId: moduleSelectionData.common.stdWindSpeed, //기준풍속코드
|
||||
verticalSnowCover: moduleSelectionData.common.stdSnowLd, //적설량
|
||||
surfaceType: moduleSelectionData.common.illuminationTpNm, //면조도구분
|
||||
installHeight: moduleSelectionData.common.instHt, //설치높이
|
||||
userId: loginUserState.userId, //작성자아아디
|
||||
})
|
||||
}
|
||||
|
||||
setTabNum(tabNum + 1)
|
||||
@ -72,6 +88,10 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||
manualModuleSetup()
|
||||
}, [isManualModuleSetup])
|
||||
|
||||
const updateObjectDataApi = async (params) => {
|
||||
const res = await updateObjectDate(params)
|
||||
}
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos}>
|
||||
<div className={`modal-pop-wrap lx-2`}>
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { useState } from 'react'
|
||||
import { useState, useEffect } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||
@ -15,6 +15,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
|
||||
roofBaseList,
|
||||
constructionList,
|
||||
globalPitchText,
|
||||
selectedRaftBase,
|
||||
selectedTrestle,
|
||||
selectedConstMthd,
|
||||
selectedRoofBase,
|
||||
@ -27,8 +28,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
|
||||
hajebichi,
|
||||
lengthRef,
|
||||
hajebichiRef,
|
||||
setLengthBase,
|
||||
setHajebichi,
|
||||
handleHajebichiAndLength,
|
||||
handleChangeRaftBase,
|
||||
handleChangeTrestle,
|
||||
handleChangeConstMthd,
|
||||
@ -59,7 +59,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={lengthBase}
|
||||
onChange={(e) => setLengthBase(e.target.value)}
|
||||
onChange={(e) => handleHajebichiAndLength(e, 'length')}
|
||||
disabled={roofMaterial.lenAuth === 'R' ? true : false}
|
||||
ref={lengthRef}
|
||||
/>
|
||||
@ -77,9 +77,9 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
|
||||
{raftCodes.length > 0 && (
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
value={addRoof}
|
||||
value={selectedRaftBase}
|
||||
sourceKey={'clCode'}
|
||||
targetKey={'raftBaseCd'}
|
||||
targetKey={'clCode'}
|
||||
showKey={'clCodeNm'}
|
||||
disabled={roofMaterial.raftAuth === 'R' ? true : false}
|
||||
onChange={handleChangeRaftBase}
|
||||
@ -100,7 +100,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
disabled={roofMaterial.roofPchAuth === 'R' ? true : false}
|
||||
onChange={(e) => setHajebichi(e.target.value)}
|
||||
onChange={(e) => handleHajebichiAndLength(e, 'hajebichi')}
|
||||
value={hajebichi}
|
||||
ref={hajebichiRef}
|
||||
/>
|
||||
|
||||
@ -57,10 +57,6 @@ const Placement = forwardRef((props, refs) => {
|
||||
refs.isChidori.current = e.target.value
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('isChidori', isChidori)
|
||||
}, [isChidori])
|
||||
|
||||
const handleSetupLocation = (e) => {
|
||||
setSetupLocation(e.target.value)
|
||||
refs.setupLocation.current = e.target.value
|
||||
@ -81,6 +77,20 @@ const Placement = forwardRef((props, refs) => {
|
||||
setSelectedItems({ ...selectedItems, [e.target.name]: e.target.checked })
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
if (moduleSelectionData && moduleSelectionData.module.itemList.length > 0) {
|
||||
let initCheckedModule = {}
|
||||
moduleSelectionData.module.itemList.forEach((obj, index) => {
|
||||
if (index === 0) {
|
||||
initCheckedModule = { [obj.itemId]: true }
|
||||
} else {
|
||||
initCheckedModule = { ...initCheckedModule, [obj.itemId]: true }
|
||||
}
|
||||
})
|
||||
setSelectedItems(initCheckedModule)
|
||||
}
|
||||
}, [])
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="module-table-flex-wrap mb10">
|
||||
@ -111,7 +121,13 @@ const Placement = forwardRef((props, refs) => {
|
||||
<tr key={index}>
|
||||
<td className="al-c">
|
||||
<div className="d-check-box no-text pop">
|
||||
<input type="checkbox" id={item.itemId} name={item.itemId} onChange={handleSelectedItem} />
|
||||
<input
|
||||
type="checkbox"
|
||||
id={item.itemId}
|
||||
name={item.itemId}
|
||||
checked={selectedItems[item.itemId]}
|
||||
onChange={handleSelectedItem}
|
||||
/>
|
||||
<label htmlFor={item.itemId}></label>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
@ -163,7 +163,6 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
.map((obj) => {
|
||||
getModuleList(obj)
|
||||
return {
|
||||
roofSurfaceId: obj.id,
|
||||
roofSurface: canvas
|
||||
@ -176,6 +175,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
itemId: module.moduleInfo.itemId,
|
||||
circuit: module.circuitNumber ? module.circuitNumber : null,
|
||||
pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
|
||||
uniqueId: module.id ? module.id : null,
|
||||
}
|
||||
}),
|
||||
}
|
||||
@ -429,6 +429,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
obj.circuit = null
|
||||
obj.pcsItemId = null
|
||||
})
|
||||
setAllocationType(ALLOCATION_TYPE.AUTO)
|
||||
canvas.renderAll()
|
||||
},
|
||||
})
|
||||
}
|
||||
@ -506,7 +508,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
)}
|
||||
{tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal mr5" onClick={() => setAllocationType(ALLOCATION_TYPE.AUTO)}>
|
||||
<button className="btn-frame modal mr5" onClick={() => onClickPrev()}>
|
||||
{getMessage('modal.common.prev')}
|
||||
</button>
|
||||
<button className="btn-frame modal act" onClick={() => setTabNum(2)}>
|
||||
|
||||
@ -177,6 +177,26 @@ export default function StepUp(props) {
|
||||
paralQty: qty.paralQty ? qty.paralQty : 0,
|
||||
rmdYn: qty.rmdYn ? qty.rmdYn : 'N',
|
||||
usePossYn: qty.usePossYn ? qty.usePossYn : 'Y',
|
||||
roofSurfaceList: formatRoofSurfaceList(qty.roofSurfaceList),
|
||||
}))
|
||||
}
|
||||
|
||||
// PCS RoofSurface 포맷
|
||||
const formatRoofSurfaceList = (roofSurfaceList = []) => {
|
||||
return roofSurfaceList?.map((rsf) => ({
|
||||
moduleList: formatModuleList(rsf.moduleList),
|
||||
roofSurface: rsf.roofSurface ? rsf.roofSurface : '',
|
||||
roofSurfaceId: rsf.roofSurfaceId ? rsf.roofSurfaceId : '',
|
||||
roofSurfaceIncl: rsf.roofSurfaceIncl ? rsf.roofSurfaceIncl : '',
|
||||
}))
|
||||
}
|
||||
// PCS MatModule 포맷
|
||||
const formatModuleList = (moduleList = []) => {
|
||||
return moduleList?.map((module) => ({
|
||||
circuit: module.circuit ? module.circuit : '',
|
||||
itemId: module.itemId ? module.itemId : '',
|
||||
pcsItemId: module.pcsItemId ? module.pcsItemId : '',
|
||||
uniqueId: module.uniqueId ? module.uniqueId : '',
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
@ -7,7 +7,7 @@ import { canvasState } from '@/store/canvasAtom'
|
||||
import { moduleStatisticsState } from '@/store/circuitTrestleAtom'
|
||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
||||
import { useContext, useEffect, useState } from 'react'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
|
||||
export default function PassivityCircuitAllocation(props) {
|
||||
const {
|
||||
@ -25,7 +25,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
||||
const selectedModules = useRecoilValue(selectedModuleState)
|
||||
const moduleStatistics = useRecoilValue(moduleStatisticsState)
|
||||
const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState)
|
||||
// const [totalWpout, setTotalWpout] = useState(0)
|
||||
const [selectedPcs, setSelectedPcs] = useState(selectedModels[0])
|
||||
// const { header, rows: row } = moduleStatistics
|
||||
@ -157,6 +157,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
}
|
||||
|
||||
const handleCircuitNumberFix = () => {
|
||||
let uniqueCircuitNumbers = null
|
||||
if (!circuitNumber || circuitNumber === 0) {
|
||||
swalFire({
|
||||
text: '회로번호를 1 이상입력해주세요.',
|
||||
@ -172,7 +173,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
})
|
||||
return
|
||||
} else if (selectedModels.length > 1) {
|
||||
const uniqueCircuitNumbers = [
|
||||
uniqueCircuitNumbers = [
|
||||
...new Set(
|
||||
canvas
|
||||
.getObjects()
|
||||
@ -255,7 +256,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
goodsNo: model.goodsNo,
|
||||
serQtyList: [
|
||||
{
|
||||
serQty: 0,
|
||||
serQty: targetModules.length,
|
||||
paralQty: 0,
|
||||
rmdYn: 'Y',
|
||||
usePossYn: 'Y',
|
||||
@ -311,15 +312,15 @@ export default function PassivityCircuitAllocation(props) {
|
||||
|
||||
const setTableData = () => {
|
||||
const tempHeader = [
|
||||
{ name: '지붕면', prop: 'name' },
|
||||
{ name: '회로', prop: 'circuit' },
|
||||
{ name: getMessage('simulator.table.sub1'), prop: 'name' },
|
||||
{ name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' },
|
||||
...selectedModules.itemList.map((module) => {
|
||||
return {
|
||||
name: module.itemNm,
|
||||
prop: module.itemId,
|
||||
}
|
||||
}),
|
||||
{ name: '발전량(kW)', prop: 'wpOut' },
|
||||
{ name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
|
||||
]
|
||||
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
@ -396,15 +397,16 @@ export default function PassivityCircuitAllocation(props) {
|
||||
selectedModules.itemList.forEach((module) => {
|
||||
tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + row[module.itemId], 0)
|
||||
})
|
||||
console.log('tempHeader, tempRows, tempFooter', tempHeader, tempRows, tempFooter)
|
||||
|
||||
setHeader(tempHeader)
|
||||
setRows(tempRows.filter((row) => row.wpOut !== 0))
|
||||
setFooter(tempFooter)
|
||||
setModuleStatistics({ header: tempHeader, rows: tempRows.filter((row) => row.wpOut !== 0), footer: tempFooter })
|
||||
}
|
||||
|
||||
const initSelectedPcsCircuitNumber = () => {
|
||||
swalFire({
|
||||
title: '선택된 파워 컨디셔너의 회로할당을 초기화합니다.',
|
||||
title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.init.info'),
|
||||
type: 'confirm',
|
||||
icon: 'warning',
|
||||
confirmFn: () => {
|
||||
@ -425,7 +427,7 @@ export default function PassivityCircuitAllocation(props) {
|
||||
const initAllPcsCircuitNumber = () => {
|
||||
canvas.discardActiveObject()
|
||||
swalFire({
|
||||
title: '회로 할당의 설정을 초기화합니다.',
|
||||
title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.init.setting.info'),
|
||||
type: 'confirm',
|
||||
icon: 'warning',
|
||||
confirmFn: () => {
|
||||
@ -467,7 +469,9 @@ export default function PassivityCircuitAllocation(props) {
|
||||
<tr key={'row' + index}>
|
||||
{header.map((header, i) => (
|
||||
<td className="al-c" key={'rowcell' + i}>
|
||||
{row[header.prop]}
|
||||
{typeof row[header.prop] === 'number'
|
||||
? row[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 })
|
||||
: row[header.prop]}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
@ -475,7 +479,9 @@ export default function PassivityCircuitAllocation(props) {
|
||||
<tr>
|
||||
{header.map((header, i) => (
|
||||
<td className="al-c" key={'footer' + i}>
|
||||
{footer[header.prop]}
|
||||
{typeof footer[header.prop] === 'number'
|
||||
? footer[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 })
|
||||
: footer[header.prop]}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
|
||||
@ -292,8 +292,8 @@ export default function DotLineGrid(props) {
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div className="modal-foot modal-handle"></div>
|
||||
</div>
|
||||
<div className="modal-foot modal-handle"></div>
|
||||
</WithDraggable>
|
||||
)
|
||||
}
|
||||
|
||||
@ -13,7 +13,7 @@ export default function LinePropertySetting(props) {
|
||||
const { id, pos = contextPopupPosition, target } = props
|
||||
const { getMessage } = useMessage()
|
||||
const { closePopup } = usePopup()
|
||||
const { changeSurfaceLinePropertyEvent, changeSurfaceLineProperty, changeSurfaceLinePropertyReset } = useSurfaceShapeBatch()
|
||||
const { changeSurfaceLinePropertyEvent, changeSurfaceLineProperty, changeSurfaceLinePropertyReset } = useSurfaceShapeBatch({})
|
||||
const { initEvent } = useEvent()
|
||||
// const { initEvent } = useContext(EventContext)
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@ export default function SizeSetting(props) {
|
||||
const { getMessage } = useMessage()
|
||||
const { closePopup } = usePopup()
|
||||
const { resizeObjectBatch } = useObjectBatch({})
|
||||
const { resizeSurfaceShapeBatch } = useSurfaceShapeBatch()
|
||||
const { resizeSurfaceShapeBatch } = useSurfaceShapeBatch({})
|
||||
const widthRef = useRef(null)
|
||||
const heightRef = useRef(null)
|
||||
|
||||
|
||||
@ -25,24 +25,27 @@ export default function PanelBatchStatistics() {
|
||||
<thead>
|
||||
<tr>
|
||||
{header.map((item, index) => (
|
||||
<th key={index}>{item.name}</th>
|
||||
<th key={`statistic-hd-${index}`}>{item.name}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{rows.map((row, index) => (
|
||||
<tr key={index}>
|
||||
<tr key={`statistic-row-${index}`}>
|
||||
{header.map((item, i) => (
|
||||
<td key={index}>
|
||||
<td key={`statistic-col-${i}`}>
|
||||
{typeof row[item.prop] === 'number' ? row[item.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 }) : row[item.prop]}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
))}
|
||||
<tr>
|
||||
{footer.map((item, index) => (
|
||||
<td key={index}>{typeof item === 'number' ? item.toLocaleString('ko-KR', { maximumFractionDigits: 4 }) : item}</td>
|
||||
// <td className="al-r">{item.amount}</td>
|
||||
{header.map((header, index) => (
|
||||
<td key={`statistic-ft-${index}`}>
|
||||
{typeof footer[header.prop] === 'number'
|
||||
? footer[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 })
|
||||
: footer[header.prop]}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
@ -1,3 +1,4 @@
|
||||
'use client'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
@ -17,7 +18,9 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
|
||||
const [yInversion, setYInversion] = useState(false)
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { closePopup } = usePopup()
|
||||
const { applySurfaceShape } = useSurfaceShapeBatch()
|
||||
const [isHidden, setIsHidden] = useState(false)
|
||||
|
||||
const { applySurfaceShape } = useSurfaceShapeBatch({ isHidden, setIsHidden })
|
||||
|
||||
const surfaceShapePolygons = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
|
||||
@ -232,6 +235,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
|
||||
surfaceRefs.xInversion = xInversion //좌우반전
|
||||
surfaceRefs.yInversion = yInversion //상하반전
|
||||
surfaceRefs.rotate = rotate * 90 //앵글
|
||||
setIsHidden(true)
|
||||
applySurfaceShape(surfaceRefs, selectedType, id)
|
||||
}
|
||||
|
||||
@ -241,7 +245,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } })
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={true} pos={pos}>
|
||||
<div className={`modal-pop-wrap lr-2`}>
|
||||
<div className={`modal-pop-wrap lr-2`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
||||
<div className="modal-head modal-handle">
|
||||
<h1 className="title">{getMessage('plan.menu.placement.surface.arrangement')} </h1>
|
||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||
|
||||
@ -42,7 +42,6 @@ export default function Stuff() {
|
||||
//그리드 내부 복사버튼
|
||||
const copyNo = async (value) => {
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
console.log('trttt')
|
||||
await navigator.clipboard
|
||||
.writeText(value)
|
||||
.then(() => {
|
||||
@ -51,9 +50,11 @@ export default function Stuff() {
|
||||
type: 'alert',
|
||||
})
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(e)
|
||||
alert(getMessage('stuff.detail.header.failCopy'))
|
||||
.catch(() => {
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.header.failCopy'),
|
||||
type: 'alert',
|
||||
})
|
||||
})
|
||||
} else {
|
||||
// Use the 'out of viewport hidden text area' trick
|
||||
@ -213,8 +214,11 @@ export default function Stuff() {
|
||||
schToDt: dayjs(new Date()).format('YYYY-MM-DD'),
|
||||
startRow: (stuffSearch.pageNo - 1) * stuffSearchParams.pageSize + 1,
|
||||
endRow: stuffSearchParams?.endRow,
|
||||
schSelSaleStoreId: stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : '',
|
||||
schOtherSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : '',
|
||||
schSaleStoreId: stuffSearchParams?.schMyDataCheck ? stuffSearchParams.schSaleStoreId : '',
|
||||
// schSelSaleStoreId: stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : '',
|
||||
// schOtherSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : '',
|
||||
schSelSaleStoreId: stuffSearchParams?.schMyDataCheck ? '' : stuffSearchParams.schSelSaleStoreId,
|
||||
schOtherSelSaleStoreId: stuffSearchParams?.schMyDataCheck ? '' : stuffSearchParams.schOtherSelSaleStoreId,
|
||||
schSortType: stuffSearchParams.schSortType,
|
||||
pageNo: stuffSearchParams?.pageNo ? stuffSearchParams.pageNo : 1,
|
||||
pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100,
|
||||
@ -223,6 +227,7 @@ export default function Stuff() {
|
||||
if (!params.saleStoreId) {
|
||||
params.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
||||
await get({
|
||||
@ -279,11 +284,15 @@ export default function Stuff() {
|
||||
stuffSearchParams.saleStoreId = session.storeId
|
||||
}
|
||||
if (stuffSearchParams.schMyDataCheck) {
|
||||
if (session.storeLvl === '1') {
|
||||
//schOtherSelSaleStoreId 초기화 schSelSaleStoreId 에 saleStoreId 담아서 보내기
|
||||
stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||
stuffSearchParams.schSelSaleStoreId = session.storeId
|
||||
}
|
||||
//0203 내물건보기 체크시 schSaleStoreId에 storeId셋팅 schSelSaleStoreId, schOtherSelSaleStoreId 비우기
|
||||
stuffSearchParams.schSaleStoreId = session.storeId
|
||||
stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||
stuffSearchParams.schSelSaleStoreId = ''
|
||||
// if (session.storeLvl === '1') {
|
||||
// stuffSearchParams.schSaleStoreId = session.storeId
|
||||
// stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||
// stuffSearchParams.schSelSaleStoreId = ''
|
||||
// }
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
|
||||
@ -87,6 +87,7 @@ export default function StuffSearchCondition() {
|
||||
}
|
||||
|
||||
setIsGlobalLoading(true)
|
||||
|
||||
if (stuffSearch.code === 'S') {
|
||||
if (stuffSearch.pageNo !== 1) {
|
||||
setStuffSearch({
|
||||
@ -95,8 +96,11 @@ export default function StuffSearchCondition() {
|
||||
schAddress: address ? address.trim() : '',
|
||||
schObjectName: objectName ? objectName.trim() : '',
|
||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||
schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
||||
schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
||||
// schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
||||
schSaleStoreId: stuffSearch?.schMyDataCheck ? stuffSearch?.schSaleStoreId : '',
|
||||
schSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schSelSaleStoreId,
|
||||
schOtherSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schOtherSelSaleStoreId,
|
||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||
schDateType: dateType,
|
||||
schTempFlg: tempFlg, //임시저장물건
|
||||
@ -307,6 +311,7 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.schDateType = 'U'
|
||||
stuffSearch.schTempFlg = ''
|
||||
stuffSearch.schMyDataCheck = false
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
setObjectNo('')
|
||||
setAddress('')
|
||||
setobjectName('')
|
||||
@ -332,6 +337,7 @@ export default function StuffSearchCondition() {
|
||||
schDispCompanyName: '',
|
||||
schSelSaleStoreId: '',
|
||||
schOtherSelSaleStoreId: '',
|
||||
schSaleStoreId: '',
|
||||
schDateType: 'U',
|
||||
schTempFlg: '',
|
||||
schMyDataCheck: false,
|
||||
@ -346,6 +352,7 @@ export default function StuffSearchCondition() {
|
||||
if (otherSaleStoreList.length === 1) {
|
||||
setOtherSaleStoreId(session.storeId)
|
||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schObjectNo = ''
|
||||
stuffSearch.schAddress = ''
|
||||
stuffSearch.schObjectName = ''
|
||||
@ -364,6 +371,7 @@ export default function StuffSearchCondition() {
|
||||
} else if (otherSaleStoreList.length > 1) {
|
||||
setOtherSaleStoreId('')
|
||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schObjectNo = ''
|
||||
stuffSearch.schAddress = ''
|
||||
stuffSearch.schObjectName = ''
|
||||
@ -394,11 +402,13 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.schSortType = 'U'
|
||||
stuffSearch.pageNo = 1
|
||||
stuffSearch.pageSize = 100
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
}
|
||||
} else if (session?.storeLvl === '1') {
|
||||
if (otherSaleStoreList.length > 0) {
|
||||
handleClear2()
|
||||
setOtherSaleStoreId('')
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schObjectNo = ''
|
||||
stuffSearch.schAddress = ''
|
||||
stuffSearch.schObjectName = ''
|
||||
@ -414,6 +424,7 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.pageNo = 1
|
||||
stuffSearch.pageSize = 100
|
||||
} else {
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schObjectNo = ''
|
||||
stuffSearch.schAddress = ''
|
||||
stuffSearch.schObjectName = ''
|
||||
@ -583,8 +594,8 @@ export default function StuffSearchCondition() {
|
||||
//판매대리점 자동완성 변경
|
||||
const onSelectionChange = (key) => {
|
||||
//내 물건보기 체크 풀어주기
|
||||
setMyDataCheck(false)
|
||||
stuffSearch.schMyDataCheck = false
|
||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||
// stuffSearch.schMyDataCheck = false
|
||||
|
||||
if (isObjectNotEmpty(key)) {
|
||||
setOtherSaleStoreId('')
|
||||
@ -695,6 +706,7 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.endRow = 100
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schSortType = 'U'
|
||||
stuffSearch.pageNo = 1
|
||||
stuffSearch.pageSize = 100
|
||||
@ -729,6 +741,7 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.endRow = 100
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schSortType = 'U'
|
||||
stuffSearch.pageNo = 1
|
||||
stuffSearch.pageSize = 100
|
||||
@ -759,7 +772,6 @@ export default function StuffSearchCondition() {
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
setOtherSaleStoreId('')
|
||||
}
|
||||
|
||||
setObjectNo('')
|
||||
setSaleStoreName('')
|
||||
setAddress('')
|
||||
@ -841,47 +853,59 @@ export default function StuffSearchCondition() {
|
||||
|
||||
// 내 물건 보기
|
||||
const checkMyData = (e) => {
|
||||
//0203 내물건보기 체크시 공통 schSaleStoreId에 storeId담아 전송 schSelSaleStoreId, schOtherSelSaleStoreId 비우기
|
||||
if (session?.storeId === 'T01') {
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.value
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
setOtherSaleStoreId('') //2차점 비우기
|
||||
setSchSelSaleStoreId('T01')
|
||||
stuffSearch.schSelSaleStoreId = 'T01'
|
||||
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
const key = { saleStoreId: session.storeId }
|
||||
onSelectionChange(key)
|
||||
} else {
|
||||
stuffSearch.schMyDataCheck = e.target.value
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setSchSelSaleStoreId('')
|
||||
setMyDataCheck(false)
|
||||
onSelectionChange(null)
|
||||
}
|
||||
} else if (session?.storeLvl === '1') {
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.value
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
//schOtherSelSaleStoreId 초기화
|
||||
//schSelSaleStoreId에 saleStoreId담아서보내기
|
||||
setOtherSaleStoreId('') //2차점 비우기
|
||||
setSchSelSaleStoreId(schSelSaleStoreId)
|
||||
stuffSearch.schSelSaleStoreId = schSelSaleStoreId
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
} else {
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
setMyDataCheck(false)
|
||||
}
|
||||
} else {
|
||||
//2차점인제 3,4가 없으면 상관없음
|
||||
//3,4등등이 있는경우 처리필요
|
||||
if (e.target.checked) {
|
||||
stuffSearch.schMyDataCheck = e.target.value
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
setMyDataCheck(true)
|
||||
if (otherSaleStoreList.length > 1) {
|
||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
setOtherSaleStoreId(session.storeId)
|
||||
} else {
|
||||
stuffSearch.schSaleStoreId = session.storeId
|
||||
stuffSearch.schSelSaleStoreId = ''
|
||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||
stuffSearch.schOtherSelSaleStoreId = ''
|
||||
}
|
||||
} else {
|
||||
setMyDataCheck(false)
|
||||
stuffSearch.schMyDataCheck = e.target.value
|
||||
stuffSearch.schMyDataCheck = e.target.checked
|
||||
stuffSearch.schSaleStoreId = ''
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,6 +301,8 @@ export function useCommonUtils() {
|
||||
...commonUtilsState,
|
||||
dimension: false,
|
||||
})
|
||||
|
||||
initEvent()
|
||||
}
|
||||
|
||||
// 캔버스 다시 그리기
|
||||
@ -655,6 +657,7 @@ export function useCommonUtils() {
|
||||
const closeDistancePopup = () => {
|
||||
const obj = canvas?.getObjects().filter((obj) => obj.name === 'distance')
|
||||
if (obj) canvas.remove(...obj)
|
||||
initEvent()
|
||||
}
|
||||
|
||||
//선택된 그룹객체 restore 하고 item으로 다시 그리고 그 그린 객체 가지고 수정해서 재그룹화 시킨다
|
||||
|
||||
@ -12,7 +12,7 @@ import { useRecoilValue } from 'recoil'
|
||||
* @returns
|
||||
*/
|
||||
export function useMasterController() {
|
||||
const { get, post } = useAxios()
|
||||
const { get, post, put } = useAxios()
|
||||
const { getMessage } = useMessage()
|
||||
const { swalFire } = useSwal()
|
||||
|
||||
@ -216,6 +216,24 @@ export function useMasterController() {
|
||||
})
|
||||
}
|
||||
|
||||
const getQuotationItem = async (params) => {
|
||||
return await post({ url: '/api/v1/master/getQuotationItem', data: params }).then((res) => {
|
||||
return res
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 물건 정보 업데이트 api 호출
|
||||
* @param {objectNo standardWindSpeedId verticalSnowCover surfaceType installHeight userId} params
|
||||
* @param {물건번호 기준풍속코드 적설량 면조도구분 설치높이 작성자아아디 } params
|
||||
* @returns
|
||||
*/
|
||||
const updateObjectDate = async (params = null) => {
|
||||
return await put({ url: '/api/object/update-object-date', data: params }).then((res) => {
|
||||
console.log('updateObjectDate', res)
|
||||
})
|
||||
}
|
||||
|
||||
return {
|
||||
getRoofMaterialList,
|
||||
getModuleTypeItemList,
|
||||
@ -228,5 +246,7 @@ export function useMasterController() {
|
||||
getPcsVoltageChk,
|
||||
getPcsManualConfChk,
|
||||
getPcsVoltageStepUpList,
|
||||
updateObjectDate,
|
||||
getQuotationItem,
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,7 +25,7 @@ export default function useMenu() {
|
||||
const currentMenu = useRecoilValue(currentMenuState)
|
||||
const [popupId, setPopupId] = useState(uuidv4())
|
||||
const { addPopup } = usePopup()
|
||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch()
|
||||
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
|
||||
const handleMenu = (type) => {
|
||||
if (type === 'outline') {
|
||||
switch (currentMenu) {
|
||||
|
||||
@ -394,6 +394,8 @@ export function useModuleBasicSetting() {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('placementRef', placementRef)
|
||||
|
||||
const isChidori = placementRef.isChidori.current === 'true' ? true : false
|
||||
const setupLocation = placementRef.setupLocation.current
|
||||
const isMaxSetup = placementRef.isMaxSetup.current === 'true' ? true : false
|
||||
|
||||
@ -71,12 +71,16 @@ export function useModulePlace() {
|
||||
.forEach((roof) => {
|
||||
const roofIndex = roof.roofMaterial.index //지붕의 지붕재의 순번
|
||||
trestleDetailList.forEach((detail) => {
|
||||
if (Number(detail.data.roofIndex) === roofIndex) {
|
||||
//roof에 상세 데이터 추가
|
||||
roof.set({ trestleDetail: detail.data })
|
||||
//배치면 설치 영역
|
||||
makeModuleInstArea(roof, detail.data)
|
||||
//surface에 상세 데이터 추가
|
||||
if (detail.data !== null) {
|
||||
if (Number(detail.data.roofIndex) === roofIndex) {
|
||||
//roof에 상세 데이터 추가
|
||||
roof.set({ trestleDetail: detail.data })
|
||||
//배치면 설치 영역
|
||||
makeModuleInstArea(roof, detail.data)
|
||||
//surface에 상세 데이터 추가
|
||||
} else {
|
||||
console.log('가대 데이터가 없네요...')
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
@ -37,6 +37,7 @@ export function useModuleSelection(props) {
|
||||
bindInitData()
|
||||
const initParams = {
|
||||
illuminationTp: managementState?.surfaceTypeValue, //면조도
|
||||
illuminationTpNm: managementState?.surfaceType, //면조도명
|
||||
instHt: managementState?.installHeight, //설치높이
|
||||
stdWindSpeed: managementState?.standardWindSpeedId, //기준풍속
|
||||
stdSnowLd: managementState?.verticalSnowCover, //기준적설량
|
||||
@ -119,6 +120,7 @@ export function useModuleSelection(props) {
|
||||
setModuleSelectionInitParams({
|
||||
...moduleSelectionInitParams,
|
||||
illuminationTp: option.clCode,
|
||||
illuminationTpNm: option.clCodeNm,
|
||||
})
|
||||
|
||||
setManagementState({
|
||||
|
||||
@ -59,9 +59,10 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
const handleChangeRaftBase = (option) => {
|
||||
setSelectedRaftBase(option)
|
||||
setTrestleParams({ ...trestleParams, raftBaseCd: option.clCode }) //가대메이커
|
||||
setConstMthdList([]) //공법 초기화
|
||||
setRoofBaseList([]) //지붕밑바탕 초기화
|
||||
setConstructionList([]) //공법 초기화
|
||||
// setConstMthdList([]) //공법 초기화
|
||||
// setRoofBaseList([]) //지붕밑바탕 초기화
|
||||
// setConstructionList([]) //공법 초기화
|
||||
resetSelected()
|
||||
}
|
||||
|
||||
//처마력바 체크
|
||||
@ -85,7 +86,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
|
||||
useEffect(() => {
|
||||
setHajebichi(addRoof.hajebichi)
|
||||
setLengthBase(addRoof.lenBase)
|
||||
setLengthBase(addRoof.length)
|
||||
|
||||
// 202600 경사도
|
||||
const raftCodeList = findCommonCode('203800')
|
||||
@ -96,7 +97,13 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
})
|
||||
setRaftCodes(raftCodeList)
|
||||
|
||||
console.log('moduleSelectionData', moduleSelectionData)
|
||||
if (addRoof.raft) {
|
||||
setSelectedRaftBase({
|
||||
...selectedRaftBase,
|
||||
raftBaseCd: addRoof.raft,
|
||||
clCode: addRoof.raft,
|
||||
})
|
||||
}
|
||||
}, [])
|
||||
|
||||
//리코일에 데이터가 담기는 시점에 시작
|
||||
@ -116,38 +123,18 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
}
|
||||
}, [moduleConstructionSelectionData])
|
||||
|
||||
//높이를 변경하면 addRoofs에 적용
|
||||
// useEffect(() => {
|
||||
// const copyAddRoof = { ...addRoof }
|
||||
// copyAddRoof.length = Number(lengthBase)
|
||||
// copyAddRoof.lenBase = lengthBase
|
||||
// const index = addRoof.index
|
||||
// const newArray = [...addRoofsArray.slice(0, index), copyAddRoof, ...addRoofsArray.slice(index + 1)]
|
||||
// setAddedRoofs(newArray)
|
||||
// }, [lengthBase])
|
||||
|
||||
// //망둥어 피치를 변경하면 addRoof 변경
|
||||
// useEffect(() => {
|
||||
// const copyAddRoof = { ...addRoof }
|
||||
// copyAddRoof.hajebichi = Number(hajebichi)
|
||||
// copyAddRoof.roofPchBase = hajebichi
|
||||
// const index = addRoof.index
|
||||
// const newArray = [...addRoofsArray.slice(0, index), copyAddRoof, ...addRoofsArray.slice(index + 1)]
|
||||
// setAddedRoofs(newArray)
|
||||
// }, [hajebichi])
|
||||
|
||||
useEffect(() => {
|
||||
if (isExistData) {
|
||||
setConstructionListParams({
|
||||
...moduleSelectionInitParams,
|
||||
...roofBaseParams,
|
||||
roofBaseCd: selectedRoofBase.roofBaseCd,
|
||||
inclCd: addRoof.pitch,
|
||||
roofPitch: hajebichiRef.current ? hajebichiRef.current.value : 0,
|
||||
raftBaseCd: addRoof.raftBaseCd,
|
||||
})
|
||||
}
|
||||
}, [selectedRoofBase])
|
||||
// if (isExistData) {
|
||||
// setConstructionListParams({
|
||||
// ...moduleSelectionInitParams,
|
||||
// ...roofBaseParams,
|
||||
// roofBaseCd: selectedRoofBase.roofBaseCd,
|
||||
// inclCd: addRoof.pitch,
|
||||
// roofPitch: hajebichiRef.current ? hajebichiRef.current.value : 0,
|
||||
// raftBaseCd: selectedRaftBase.raftBaseCd ? selectedRaftBase.raftBaseCd : '',
|
||||
// })
|
||||
// }
|
||||
// }, [selectedRoofBase])
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
@ -172,7 +159,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
setTrestleParams({
|
||||
moduleTpCd: selectedModules.itemTp,
|
||||
roofMatlCd: addRoof.roofMatlCd,
|
||||
raftBaseCd: addRoof.raftBaseCd,
|
||||
raftBaseCd: selectedRaftBase.raftBaseCd ? selectedRaftBase.raftBaseCd : '',
|
||||
workingWidth: lengthBase,
|
||||
})
|
||||
}
|
||||
@ -222,7 +209,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
roofBaseCd: option.roofBaseCd,
|
||||
inclCd: addRoof.pitch,
|
||||
roofPitch: hajebichiRef.current ? hajebichiRef.current.value : 0,
|
||||
raftBaseCd: addRoof.raftBaseCd,
|
||||
raftBaseCd: selectedRaftBase.clCode ? selectedRaftBase.clCode : '',
|
||||
roofMatlCd: addRoof.roofMatlCd,
|
||||
})
|
||||
setSelectedRoofBase(option)
|
||||
@ -309,29 +296,36 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
}
|
||||
}, [selectedConstruction])
|
||||
|
||||
//거대메이커, 공법, 지붕밑바탕 api 조회
|
||||
const getModuleOptionsListData = async (params, type) => {
|
||||
const optionsList = await getTrestleList(params)
|
||||
|
||||
if (optionsList.data.length > 0) {
|
||||
if (type === 'trestle') {
|
||||
setTrestleList(optionsList.data)
|
||||
//가대 메이커일때
|
||||
setTrestleList(optionsList.data) //가대 목록
|
||||
if (isExistData) {
|
||||
//데이터가 있으면 선택된 가대 메이커를 선택한다
|
||||
handleChangeTrestle(moduleConstructionSelectionData?.trestle)
|
||||
} else {
|
||||
setConstMthdList([])
|
||||
setRoofBaseList([])
|
||||
setConstMthdList([]) //공법 목록 초기화
|
||||
setRoofBaseList([]) //지붕밑바탕 목록 초기화
|
||||
}
|
||||
} else if (type === 'construction') {
|
||||
setConstMthdList(optionsList.data)
|
||||
//공법일때
|
||||
setConstMthdList(optionsList.data) //공법 목록
|
||||
if (isExistData) {
|
||||
//데이터가 있으면 선택된 공법을 선택한다
|
||||
handleChangeConstMthd(moduleConstructionSelectionData?.trestle)
|
||||
} else {
|
||||
setRoofBaseList([])
|
||||
setRoofBaseList([]) //지붕밑바탕 목록 초기화
|
||||
}
|
||||
} else if (type === 'roofBase') {
|
||||
setRoofBaseList(optionsList.data)
|
||||
//지붕밑바탕일때
|
||||
setRoofBaseList(optionsList.data) //지붕밑바탕 목록
|
||||
if (isExistData) {
|
||||
handleChangeRoofBase(moduleConstructionSelectionData?.trestle)
|
||||
//데이터가 있으면 선택된 지붕밑바탕을 선택한다
|
||||
handleChangeRoofBase(moduleConstructionSelectionData?.trestle) //선택된 지붕밑바탕을 선택한다
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -342,51 +336,64 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
if (moduleSelectionInitOriginData.current.moduleItemId && moduleSelectionInitOriginData.current.moduleTpCd) {
|
||||
//초기에 들어온 데이터가 수정된 데이터가 값이 다르다면`
|
||||
if (!isEqualObjects(moduleSelectionInitOriginData.current, moduleSelectionInitParams)) {
|
||||
//가대 선택 초기화
|
||||
setSelectedTrestle({})
|
||||
|
||||
//공법 선택 초기화
|
||||
setSelectedConstMthd({})
|
||||
|
||||
//지붕밑바탕 선택 초기화
|
||||
setSelectedRoofBase({})
|
||||
|
||||
//공법 리스트 초기화
|
||||
setConstructionList([])
|
||||
|
||||
// 기본 정보 초기화
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: [],
|
||||
})
|
||||
|
||||
// 선택 데이터 초 기화
|
||||
setModuleConstructionSelectionData({
|
||||
addRoof: addRoof,
|
||||
trestle: {},
|
||||
construction: {},
|
||||
})
|
||||
|
||||
//임시 데이터 초기화
|
||||
setTempModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: [],
|
||||
})
|
||||
|
||||
//처마커버 해제
|
||||
setCvrChecked(false)
|
||||
//눈막이금구 해제
|
||||
setSnowGdChecked(false)
|
||||
|
||||
// 데이터 없음으로 변경
|
||||
setIsExistData(false)
|
||||
|
||||
//변경된 데이터를 ref에 저장
|
||||
moduleSelectionInitOriginData.current = moduleSelectionInitParams
|
||||
resetSelected()
|
||||
}
|
||||
}
|
||||
}, [moduleSelectionInitParams])
|
||||
|
||||
const handleHajebichiAndLength = (e, type) => {
|
||||
if (type === 'length') {
|
||||
setLengthBase(e.target.value)
|
||||
} else {
|
||||
setHajebichi(e.target.value)
|
||||
}
|
||||
resetSelected()
|
||||
}
|
||||
|
||||
const resetSelected = () => {
|
||||
//가대 선택 초기화
|
||||
setSelectedTrestle({})
|
||||
|
||||
//공법 선택 초기화
|
||||
setSelectedConstMthd({})
|
||||
|
||||
//지붕밑바탕 선택 초기화
|
||||
setSelectedRoofBase({})
|
||||
|
||||
//공법 리스트 초기화
|
||||
setConstructionList([])
|
||||
|
||||
// 기본 정보 초기화
|
||||
setModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: [],
|
||||
})
|
||||
|
||||
// 선택 데이터 초 기화
|
||||
setModuleConstructionSelectionData({
|
||||
addRoof: addRoof,
|
||||
trestle: {},
|
||||
construction: {},
|
||||
})
|
||||
|
||||
//임시 데이터 초기화
|
||||
setTempModuleSelectionData({
|
||||
...moduleSelectionData,
|
||||
roofConstructions: [],
|
||||
})
|
||||
|
||||
//처마커버 해제
|
||||
setCvrChecked(false)
|
||||
//눈막이금구 해제
|
||||
setSnowGdChecked(false)
|
||||
|
||||
// 데이터 없음으로 변경
|
||||
setIsExistData(false)
|
||||
|
||||
//변경된 데이터를 ref에 저장
|
||||
moduleSelectionInitOriginData.current = moduleSelectionInitParams
|
||||
}
|
||||
|
||||
return {
|
||||
raftCodes,
|
||||
trestleList,
|
||||
@ -394,6 +401,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
roofBaseList,
|
||||
constructionList,
|
||||
globalPitchText,
|
||||
selectedRaftBase,
|
||||
selectedTrestle,
|
||||
selectedConstMthd,
|
||||
selectedRoofBase,
|
||||
@ -406,8 +414,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
|
||||
hajebichi,
|
||||
lengthRef,
|
||||
hajebichiRef,
|
||||
setLengthBase,
|
||||
setHajebichi,
|
||||
handleHajebichiAndLength,
|
||||
handleChangeRaftBase,
|
||||
handleChangeTrestle,
|
||||
handleChangeConstMthd,
|
||||
|
||||
@ -4,11 +4,13 @@ import { POLYGON_TYPE } from '@/common/common'
|
||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||
import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||
|
||||
// 회로 및 가대설정
|
||||
export const useTrestle = () => {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
||||
const { getQuotationItem } = useMasterController()
|
||||
|
||||
const apply = () => {
|
||||
//처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함.
|
||||
@ -17,7 +19,7 @@ export const useTrestle = () => {
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
// 기존 eaveBar를 삭제
|
||||
canvas.getObjects().forEach((obj) => {
|
||||
if (obj.name === 'eaveBar' || obj.name === 'rack') {
|
||||
if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack') {
|
||||
canvas.remove(obj)
|
||||
}
|
||||
})
|
||||
@ -96,7 +98,7 @@ export const useTrestle = () => {
|
||||
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => ['eaveBar', 'halfEaveBar'].includes(obj.name) && obj.parent === surface)
|
||||
.filter((obj) => ['eaveBar', 'halfEaveBar'].includes(obj.name) && obj.parentId === surface.id)
|
||||
.forEach((obj) => {
|
||||
canvas.remove(obj)
|
||||
})
|
||||
@ -435,7 +437,18 @@ export const useTrestle = () => {
|
||||
installBracket(surface)
|
||||
}
|
||||
|
||||
console.log(getTrestleParams(surface))
|
||||
const quotationParam = getTrestleParams(surface)
|
||||
|
||||
surface.set({ quotationParam })
|
||||
getQuoationItems()
|
||||
})
|
||||
}
|
||||
|
||||
const getQuoationItems = () => {
|
||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
const params = { trestles: surfaces.map((surface) => surface.quotationParam) }
|
||||
getQuotationItem(params).then((res) => {
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
|
||||
@ -633,9 +646,9 @@ export const useTrestle = () => {
|
||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], {
|
||||
name: 'smartRack',
|
||||
stroke: 'blue',
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
shadow: {
|
||||
@ -706,7 +719,7 @@ export const useTrestle = () => {
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], {
|
||||
name: 'smartRack',
|
||||
stroke: 'blue',
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
shadow: {
|
||||
@ -775,7 +788,7 @@ export const useTrestle = () => {
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||
name: 'smartRack',
|
||||
stroke: 'blue',
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
shadow: {
|
||||
@ -840,9 +853,9 @@ export const useTrestle = () => {
|
||||
smartRack.forEach(({ seq, setRackTpCd, setRackTpLen, supFitQty }) => {
|
||||
rackLength = getTrestleLength(setRackTpLen, degree) / 10
|
||||
if (setRackTpCd === 'RACK') {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], {
|
||||
const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], {
|
||||
name: 'smartRack',
|
||||
stroke: 'blue',
|
||||
stroke: 'red',
|
||||
strokeWidth: 4,
|
||||
selectable: false,
|
||||
shadow: {
|
||||
@ -906,7 +919,7 @@ export const useTrestle = () => {
|
||||
modules.forEach((module) => {
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === 'rack')
|
||||
.filter((obj) => obj.name === 'rack' || obj.name === 'smartRack')
|
||||
.forEach((rack) => {
|
||||
if (rack.parentId === module.id) {
|
||||
canvas.remove(canvas.getObjects().filter((obj) => obj.name === 'bracket' && obj.parentId === rack.id))
|
||||
@ -1171,7 +1184,7 @@ export const useTrestle = () => {
|
||||
|
||||
const getBracketPoints = (n, percent) => {
|
||||
if (n < 2) {
|
||||
throw new Error('Number of points must be at least 2')
|
||||
return []
|
||||
}
|
||||
|
||||
const points = []
|
||||
@ -1479,6 +1492,7 @@ export const useTrestle = () => {
|
||||
return groups
|
||||
}
|
||||
|
||||
// 견적서 아이템 조회 api parameter 생성
|
||||
const getTrestleParams = (surface) => {
|
||||
const result = calculateForApi(surface)
|
||||
|
||||
@ -1505,8 +1519,24 @@ export const useTrestle = () => {
|
||||
rackRows: rack.rackRowsCd,
|
||||
}
|
||||
})
|
||||
const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
|
||||
const roofMaterialIndex = parent.roofMaterial.index
|
||||
const moduleSelection = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex)
|
||||
const { common, module } = moduleSelectionData
|
||||
|
||||
// const { constTp } = construction
|
||||
let { cvrPlvrYn } = surface.trestleDetail
|
||||
const { trestleMkrCd, constMthdCd, roofBaseCd } = moduleSelection.trestle
|
||||
const { illuminationTp, instHt, stdSnowLd, stdWindSpeed } = common
|
||||
const { constTp } = moduleSelection.construction
|
||||
const { addRoof } = moduleSelection
|
||||
|
||||
return {
|
||||
moduleTpCd: module.itemTp,
|
||||
roofMatlCd: parent.roofMaterial.roofMatlCd,
|
||||
mixMatlNo: module.mixMatlNo,
|
||||
raftBaseCd: addRoof.raft,
|
||||
roofPitch: addRoof.roofPchBase,
|
||||
exposedLowerBottomTotCnt: result.exposedBottom, // 노출 최하면 갯수
|
||||
exposedHalfBottomTotCnt: result.exposedHalfBottom, // 노출 반하면 갯수
|
||||
exposedTopTotCnt: result.exposedTop, // 노출 상면 총 수
|
||||
@ -1521,9 +1551,56 @@ export const useTrestle = () => {
|
||||
rackTotCnt: rackList.length ?? 0 + smartRackGroup.length ?? 0,
|
||||
rackFittingCnt: bracketList.length,
|
||||
moduleRows: getMostLeftModules(surface),
|
||||
cvrYn: moduleSelection.construction.setupCover ? 'Y' : 'N',
|
||||
snowGuardYn: moduleSelection.construction.setupSnowCover ? 'Y' : 'N',
|
||||
plvrYn: cvrPlvrYn,
|
||||
modules: getModules(surface),
|
||||
pcses: surface.pcses ?? [],
|
||||
trestleMkrCd,
|
||||
constMthdCd,
|
||||
roofBaseCd,
|
||||
illuminationTp,
|
||||
instHt,
|
||||
stdSnowLd,
|
||||
stdWindSpeed,
|
||||
constTp,
|
||||
}
|
||||
}
|
||||
|
||||
const getModules = (surface) => {
|
||||
const { modules } = surface
|
||||
|
||||
const params = modules.map((module, index) => {
|
||||
return {
|
||||
moduleTpCd: module.moduleInfo.itemTp,
|
||||
moduleItemId: module.moduleInfo.itemId,
|
||||
}
|
||||
})
|
||||
|
||||
//params를 moduleTpCd, moduleItemId로 그룹화 하면서 cnt를 계산
|
||||
const groupedParams = params.reduce((acc, cur) => {
|
||||
const key = `${cur.moduleTpCd}-${cur.moduleItemId}`
|
||||
if (!acc[key]) {
|
||||
acc[key] = {
|
||||
moduleTpCd: cur.moduleTpCd,
|
||||
moduleItemId: cur.moduleItemId,
|
||||
cnt: 0,
|
||||
}
|
||||
}
|
||||
acc[key].cnt++
|
||||
return acc
|
||||
}, {})
|
||||
|
||||
// map 형태의 데이터를 배열로 변환
|
||||
return Object.values(groupedParams).map((groupedParam, index) => {
|
||||
return {
|
||||
moduleTpCd: groupedParam.moduleTpCd,
|
||||
moduleItemId: groupedParam.moduleItemId,
|
||||
moduleCnt: groupedParam.cnt,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
// 가장 왼쪽에 있는 모듈을 기준으로 같은 단에 있는 모듈들 파라미터 생성
|
||||
const getMostLeftModules = (surface) => {
|
||||
const { direction, modules } = surface
|
||||
|
||||
@ -196,33 +196,33 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
surfaceShapePolygons.forEach((surface) => {
|
||||
if (surface.inPolygon({ x: pointer.x, y: pointer.y })) {
|
||||
selectedSurface = surface
|
||||
|
||||
rect = new fabric.Rect({
|
||||
fill: 'white',
|
||||
stroke: 'black',
|
||||
strokeWidth: 1,
|
||||
width: width,
|
||||
height: height,
|
||||
left: pointer.x - width / 2,
|
||||
top: pointer.y - height / 2,
|
||||
selectable: true,
|
||||
lockMovementX: true,
|
||||
lockMovementY: true,
|
||||
lockRotation: true,
|
||||
lockScalingX: true,
|
||||
lockScalingY: true,
|
||||
parentId: selectedSurface.id,
|
||||
})
|
||||
|
||||
//개구냐 그림자냐에 따라 변경
|
||||
rect.set({
|
||||
fill: buttonAct === 1 ? 'white' : 'rgba(0, 0, 0, 0.4)',
|
||||
name: objTempName,
|
||||
})
|
||||
|
||||
canvas?.add(rect)
|
||||
}
|
||||
})
|
||||
|
||||
rect = new fabric.Rect({
|
||||
fill: 'white',
|
||||
stroke: 'black',
|
||||
strokeWidth: 1,
|
||||
width: width,
|
||||
height: height,
|
||||
left: pointer.x - width / 2,
|
||||
top: pointer.y - height / 2,
|
||||
selectable: true,
|
||||
lockMovementX: true,
|
||||
lockMovementY: true,
|
||||
lockRotation: true,
|
||||
lockScalingX: true,
|
||||
lockScalingY: true,
|
||||
parentId: selectedSurface.id,
|
||||
})
|
||||
|
||||
//개구냐 그림자냐에 따라 변경
|
||||
rect.set({
|
||||
fill: buttonAct === 1 ? 'white' : 'rgba(0, 0, 0, 0.4)',
|
||||
name: objTempName,
|
||||
})
|
||||
|
||||
canvas?.add(rect)
|
||||
})
|
||||
|
||||
addCanvasMouseEventListener('mouse:up', (e) => {
|
||||
@ -726,7 +726,6 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||
initEvent()
|
||||
|
||||
dbClickEvent()
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@ -487,6 +487,7 @@ export function useRoofShapeSetting(id) {
|
||||
offset: eavesOffset / 10,
|
||||
pitch: pitchRef.current,
|
||||
type: LINE_TYPE.WALLLINE.EAVES,
|
||||
onlyOffset: false,
|
||||
}
|
||||
// hideLine(line)
|
||||
})
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect } from 'react'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { canvasState, globalPitchState } from '@/store/canvasAtom'
|
||||
import { MENU, POLYGON_TYPE } from '@/common/common'
|
||||
@ -18,7 +19,7 @@ import { QLine } from '@/components/fabric/QLine'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { outerLinePointsState } from '@/store/outerLineAtom'
|
||||
|
||||
export function useSurfaceShapeBatch() {
|
||||
export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { getMessage } = useMessage()
|
||||
const { drawDirectionArrow } = usePolygon()
|
||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||
@ -72,6 +73,9 @@ export function useSurfaceShapeBatch() {
|
||||
let isDrawing = true
|
||||
let obj = null
|
||||
let points = []
|
||||
|
||||
//일단 팝업을 가린다
|
||||
|
||||
if (checkSurfaceShape(surfaceId, { length1, length2, length3, length4, length5 })) {
|
||||
addCanvasMouseEventListener('mouse:move', (e) => {
|
||||
if (!isDrawing) {
|
||||
@ -106,9 +110,7 @@ export function useSurfaceShapeBatch() {
|
||||
obj.setCoords() //좌표 변경 적용
|
||||
|
||||
canvas?.add(obj)
|
||||
|
||||
canvas?.renderAll()
|
||||
closePopup(id)
|
||||
})
|
||||
|
||||
addCanvasMouseEventListener('mouse:down', (e) => {
|
||||
@ -156,9 +158,14 @@ export function useSurfaceShapeBatch() {
|
||||
canvas?.add(batchSurface)
|
||||
setSurfaceShapePattern(batchSurface, roofDisplay.column)
|
||||
drawDirectionArrow(batchSurface)
|
||||
closePopup(id)
|
||||
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
|
||||
// closePopup(id)
|
||||
initEvent()
|
||||
})
|
||||
} else {
|
||||
if (setIsHidden) setIsHidden(false)
|
||||
}
|
||||
}
|
||||
|
||||
@ -200,12 +207,15 @@ export function useSurfaceShapeBatch() {
|
||||
}
|
||||
}
|
||||
if (surfaceId === 18) {
|
||||
if (length1 >= length2) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to2'), icon: 'error' })
|
||||
if (length2 >= length3) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.3to2'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
if (length4 >= length3) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.3to4'), icon: 'error' })
|
||||
}
|
||||
|
||||
if (surfaceId === 6) {
|
||||
if (length2 >= length3) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.3to2'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
}
|
||||
@ -226,7 +236,7 @@ export function useSurfaceShapeBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceId === 12 || surfaceId === 13 || surfaceId === 16 || surfaceId === 17) {
|
||||
if (surfaceId === 12 || surfaceId === 13 || surfaceId === 16) {
|
||||
if (length2 >= length1) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to2'), icon: 'error' })
|
||||
check = false
|
||||
@ -237,12 +247,24 @@ export function useSurfaceShapeBatch() {
|
||||
check = false
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceId === 17) {
|
||||
if (length2 >= length1) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to2'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
|
||||
if (length3 >= length4) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.4to3'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
}
|
||||
} else if ([7, 9, 10, 11, 14].includes(surfaceId)) {
|
||||
if (length1 === 0 || length2 === 0 || length3 === 0 || length4 === 0 || length5 === 0) {
|
||||
swalFire({ text: getMessage('common.canvas.validate.size'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
if (surfaceId === 9 || surfaceId === 10 || surfaceId === 11) {
|
||||
if (surfaceId === 9 || surfaceId === 10) {
|
||||
if (length2 + length3 >= length1) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to23'), icon: 'error' })
|
||||
check = false
|
||||
@ -253,6 +275,17 @@ export function useSurfaceShapeBatch() {
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceId === 11) {
|
||||
if (length1 > length2 + length3) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to23low'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
if (length5 >= length4) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.4to5'), icon: 'error' })
|
||||
check = false
|
||||
}
|
||||
}
|
||||
|
||||
if (surfaceId === 14) {
|
||||
if (length2 + length3 >= length1) {
|
||||
swalFire({ text: getMessage('surface.shape.validate.size.1to23'), icon: 'error' })
|
||||
|
||||
@ -59,7 +59,7 @@ export function useContextMenu() {
|
||||
const [column, setColumn] = useState(null)
|
||||
const { handleZoomClear } = useCanvasEvent()
|
||||
const { moveObjectBatch } = useObjectBatch({})
|
||||
const { moveSurfaceShapeBatch } = useSurfaceShapeBatch()
|
||||
const { moveSurfaceShapeBatch } = useSurfaceShapeBatch({})
|
||||
const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom)
|
||||
const { addLine, removeLine } = useLine()
|
||||
const { removeGrid } = useGrid()
|
||||
|
||||
@ -95,8 +95,8 @@ export const useLine = () => {
|
||||
|
||||
const textStr =
|
||||
currentAngleType === ANGLE_TYPE.SLOPE
|
||||
? `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${onlyOffset && attributes.pitch ? '-∠' + attributes.pitch + angleUnit : ''}`
|
||||
: `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${onlyOffset && attributes.pitch ? '-∠' + getDegreeByChon(attributes.pitch) + angleUnit : ''}`
|
||||
? `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + attributes.pitch + angleUnit : ''}`
|
||||
: `${attributes.offset ? attributes.offset * 10 : attributes.width * 10}${!onlyOffset && attributes.pitch ? '-∠' + getDegreeByChon(attributes.pitch) + angleUnit : ''}`
|
||||
|
||||
if (direction === 'top') {
|
||||
left = (startPoint.x + endPoint.x) / 2
|
||||
|
||||
@ -149,6 +149,8 @@
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional.reset": "選択されたパワーコンディショナーの回路番号の初期化",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.reset": "すべての回路番号の初期化",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.num.fix": "番号確定",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.init.info": "선택된 파워 컨디셔너의 회로할당을 초기화합니다.(JA)",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.init.setting.info": "회로 할당의 설정을 초기화합니다.(JA)",
|
||||
"modal.circuit.trestle.setting.step.up.allocation": "昇圧設定",
|
||||
"modal.circuit.trestle.setting.step.up.allocation.serial.amount": "シリアル枚数",
|
||||
"modal.circuit.trestle.setting.step.up.allocation.total.amount": "総回路数",
|
||||
@ -851,6 +853,7 @@
|
||||
"surface.shape.validate.size.1to2": "①길이는 ②보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to3": "①길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23": "①길이는 ②+③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23low": "①길이는 ②+③보다 클 수 없습니다..",
|
||||
"surface.shape.validate.size.2to3": "②길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.3to4": "③길이는 ④보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.4to5": "④길이는 ⑤보다 큰 값을 넣어주세요.",
|
||||
|
||||
@ -155,6 +155,8 @@
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional.reset": "선택된 파워컨디셔너의 회로번호 초기화",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.reset": "모든 회로번호 초기화",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.num.fix": "번호 확정",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.init.info": "선택된 파워 컨디셔너의 회로할당을 초기화합니다.",
|
||||
"modal.circuit.trestle.setting.circuit.allocation.passivity.init.setting.info": "회로 할당의 설정을 초기화합니다.",
|
||||
"modal.circuit.trestle.setting.step.up.allocation": "승압 설정",
|
||||
"modal.circuit.trestle.setting.step.up.allocation.serial.amount": "직렬매수",
|
||||
"modal.circuit.trestle.setting.step.up.allocation.total.amount": "총 회로수",
|
||||
@ -856,8 +858,11 @@
|
||||
"surface.shape.validate.size.1to2": "①길이는 ②보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to3": "①길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23": "①길이는 ②+③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.1to23low": "②+③길이는 ①보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.2to3": "②길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.3to2": "③길이는 ②보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.3to4": "③길이는 ④보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.4to3": "④길이는 ③보다 큰 값을 넣어주세요.",
|
||||
"surface.shape.validate.size.4to5": "④길이는 ⑤보다 큰 값을 넣어주세요.",
|
||||
"estimate.detail.header.title": "기본정보",
|
||||
"estimate.detail.objectNo": "물건번호",
|
||||
|
||||
@ -32,3 +32,8 @@ export const slopeSelector = selectorFamily({
|
||||
return defaultSlope[degree]
|
||||
},
|
||||
})
|
||||
|
||||
export const loginUserStore = atom({
|
||||
key: 'loginUserState',
|
||||
default: {},
|
||||
})
|
||||
|
||||
@ -4,16 +4,16 @@ export const settingModalFirstOptionsState = atom({
|
||||
key: 'settingModalFirstOptions',
|
||||
default: {
|
||||
option1: [
|
||||
{ id: 1, column: 'allocDisplay', name: 'modal.canvas.setting.first.option.alloc', selected: false },
|
||||
{ id: 1, column: 'allocDisplay', name: 'modal.canvas.setting.first.option.alloc', selected: true },
|
||||
{ id: 2, column: 'outlineDisplay', name: 'modal.canvas.setting.first.option.outline', selected: true },
|
||||
{ id: 3, column: 'gridDisplay', name: 'modal.canvas.setting.first.option.grid', selected: false },
|
||||
{ id: 4, column: 'lineDisplay', name: 'modal.canvas.setting.first.option.roof.line', selected: false },
|
||||
{ id: 5, column: 'wordDisplay', name: 'modal.canvas.setting.first.option.word', selected: false },
|
||||
{ id: 6, column: 'circuitNumDisplay', name: 'modal.canvas.setting.first.option.circuit.num', selected: false },
|
||||
{ id: 7, column: 'flowDisplay', name: 'modal.canvas.setting.first.option.flow', selected: false },
|
||||
{ id: 8, column: 'trestleDisplay', name: 'modal.canvas.setting.first.option.trestle', selected: false },
|
||||
{ id: 3, column: 'gridDisplay', name: 'modal.canvas.setting.first.option.grid', selected: true },
|
||||
{ id: 4, column: 'lineDisplay', name: 'modal.canvas.setting.first.option.roof.line', selected: true },
|
||||
{ id: 5, column: 'wordDisplay', name: 'modal.canvas.setting.first.option.word', selected: true },
|
||||
{ id: 6, column: 'circuitNumDisplay', name: 'modal.canvas.setting.first.option.circuit.num', selected: true },
|
||||
{ id: 7, column: 'flowDisplay', name: 'modal.canvas.setting.first.option.flow', selected: true },
|
||||
{ id: 8, column: 'trestleDisplay', name: 'modal.canvas.setting.first.option.trestle', selected: true },
|
||||
{ id: 9, column: 'imageDisplay', name: 'modal.canvas.setting.first.option.image', selected: false },
|
||||
{ id: 10, column: 'totalDisplay', name: 'modal.canvas.setting.first.option.total', selected: false },
|
||||
{ id: 10, column: 'totalDisplay', name: 'modal.canvas.setting.first.option.total', selected: true },
|
||||
],
|
||||
dimensionDisplay: [
|
||||
{
|
||||
|
||||
@ -13,6 +13,7 @@ export const stuffSearchState = atom({
|
||||
schFromDt: dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'), //시작일
|
||||
schToDt: dayjs(new Date()).format('YYYY-MM-DD'), //종료일
|
||||
code: 'S',
|
||||
schSaleStoreId: '', //내물건보기 체크용
|
||||
schSelSaleStoreId: '', //1차판매대리점 선택
|
||||
schOtherSelSaleStoreId: '', //1차 이외 판매대리점 선택
|
||||
startRow: 1,
|
||||
|
||||
@ -244,6 +244,9 @@ table{
|
||||
&.on{
|
||||
background-color: #272727;
|
||||
}
|
||||
&.wrong{
|
||||
background-color: #7E3434;
|
||||
}
|
||||
}
|
||||
td{
|
||||
height: 40px;
|
||||
|
||||
@ -1,84 +1,84 @@
|
||||
.test {
|
||||
background-color: #797979;
|
||||
font: 30px sans-serif;
|
||||
font-style: italic;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.grid-container2 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr); /* 2개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container3 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr); /* 3개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container4 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr); /* 4개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container5 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr); /* 5개의 열 */
|
||||
grid-template-rows: repeat(5, 30px); /* 5개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 0px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid black; /* 그리드 외각선 */
|
||||
text-align: center; /* 그리드 내 가운데 정렬 */
|
||||
}
|
||||
|
||||
.grid-item2 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.grid-item3 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border: 1px solid #000;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.grid-item.Y {
|
||||
background-color: #d3d0d0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.N {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.selected {
|
||||
background-color: #d3d0d0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.unselected {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
.test {
|
||||
background-color: #797979;
|
||||
font: 30px sans-serif;
|
||||
font-style: italic;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.grid-container2 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr); /* 2개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container3 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr); /* 3개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container4 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(4, 1fr); /* 4개의 열 */
|
||||
grid-template-rows: repeat(6, 30px); /* 6개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 5px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-container5 {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, 1fr); /* 5개의 열 */
|
||||
grid-template-rows: repeat(5, 30px); /* 5개의 행 */
|
||||
justify-items: center; /* 각 그리드 아이템을 수평 가운데 정렬 */
|
||||
align-items: center; /* 각 그리드 아이템을 수직 가운데 정렬 */
|
||||
gap: 0px; /* 그리드 아이템 사이의 간격 */
|
||||
}
|
||||
|
||||
.grid-item {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border: 1px solid black; /* 그리드 외각선 */
|
||||
text-align: center; /* 그리드 내 가운데 정렬 */
|
||||
}
|
||||
|
||||
.grid-item2 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border: 1px solid #000;
|
||||
}
|
||||
|
||||
.grid-item3 {
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
border: 1px solid #000;
|
||||
transition: background-color 0.3s ease;
|
||||
}
|
||||
|
||||
.grid-item.Y {
|
||||
background-color: #d3d0d0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.N {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.selected {
|
||||
background-color: #d3d0d0;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.grid-item.unselected {
|
||||
background-color: white;
|
||||
color: black;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user