Compare commits
No commits in common. "61dd99f02ad364bf3d08762219c3b5c815aa53db" and "7e13cb20a30432e88851bf2e285c0e979729dd01" have entirely different histories.
61dd99f02a
...
7e13cb20a3
@ -1,10 +1,13 @@
|
|||||||
|
import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
||||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { pcsCheckState } from '@/store/circuitTrestleAtom'
|
import { modelState, pcsCheckState } from '@/store/circuitTrestleAtom'
|
||||||
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
import { selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
|
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||||
|
import { canvasPopupStatusStore } from '@/store/canvasPopupStatusAtom'
|
||||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
@ -12,6 +15,7 @@ import { POLYGON_TYPE } from '@/common/common'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { circuitNumDisplaySelector } from '@/store/settingAtom'
|
import { circuitNumDisplaySelector } from '@/store/settingAtom'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
|
import { PCS_MKR_MULTI_TYPE } from './PowerConditionalSelect'
|
||||||
|
|
||||||
export default function StepUp(props) {
|
export default function StepUp(props) {
|
||||||
const {
|
const {
|
||||||
@ -38,7 +42,6 @@ export default function StepUp(props) {
|
|||||||
const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수
|
const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수
|
||||||
const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState)
|
const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState)
|
||||||
const { getPcsVoltageStepUpList, getPcsAutoRecommendList, getPcsVoltageChk, getPcsConnOptionItemList } = useMasterController()
|
const { getPcsVoltageStepUpList, getPcsAutoRecommendList, getPcsVoltageChk, getPcsConnOptionItemList } = useMasterController()
|
||||||
const [originPcsVoltageStepUpList, setOriginPcsVoltageStepUpList] = useState([])
|
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const selectedModules = useRecoilValue(selectedModuleState)
|
const selectedModules = useRecoilValue(selectedModuleState)
|
||||||
const [optCodes, setOptCodes] = useState([])
|
const [optCodes, setOptCodes] = useState([])
|
||||||
@ -97,9 +100,6 @@ export default function StepUp(props) {
|
|||||||
|
|
||||||
/** PCS 승압설정 정보 SET */
|
/** PCS 승압설정 정보 SET */
|
||||||
setStepUpListData(stepUpListData)
|
setStepUpListData(stepUpListData)
|
||||||
if (originPcsVoltageStepUpList.length === 0) {
|
|
||||||
setOriginPcsVoltageStepUpList(stepUpListData)
|
|
||||||
}
|
|
||||||
|
|
||||||
/** PCS 옵션 조회 */
|
/** PCS 옵션 조회 */
|
||||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||||
@ -108,7 +108,8 @@ export default function StepUp(props) {
|
|||||||
|
|
||||||
/** 캔버스에 회로 정보 적용 */
|
/** 캔버스에 회로 정보 적용 */
|
||||||
// 병설일때 pcs 있으면 setSubOpsions, 없으면 setMainOptions
|
// 병설일때 pcs 있으면 setSubOpsions, 없으면 setMainOptions
|
||||||
let mChk = 0
|
console.log('stepUpListData', stepUpListData)
|
||||||
|
let mChk = 0;
|
||||||
stepUpListData[0].pcsItemList.forEach((pcsItem, index) => {
|
stepUpListData[0].pcsItemList.forEach((pcsItem, index) => {
|
||||||
const optionList = formatOptionCodes(pcsItem.optionList)
|
const optionList = formatOptionCodes(pcsItem.optionList)
|
||||||
if (isMultiOptions()) {
|
if (isMultiOptions()) {
|
||||||
@ -165,7 +166,7 @@ export default function StepUp(props) {
|
|||||||
targetModule.circuitNumber = module.circuit
|
targetModule.circuitNumber = module.circuit
|
||||||
canvas.add(moduleCircuitText)
|
canvas.add(moduleCircuitText)
|
||||||
} else {
|
} else {
|
||||||
mChk++
|
mChk++;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -398,14 +399,10 @@ export default function StepUp(props) {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeApplyParalQty = (mainIdx, subIdx, applyParalQty) => {
|
|
||||||
handleRowClick(mainIdx, subIdx, applyParalQty)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 행 선택 핸들러 함수 추가
|
* 행 선택 핸들러 함수 추가
|
||||||
*/
|
*/
|
||||||
const handleRowClick = (mainIdx, subIdx, applyParalQty = null) => {
|
const handleRowClick = (mainIdx, subIdx) => {
|
||||||
/** 자동 승압 설정인 경우만 실행 */
|
/** 자동 승압 설정인 경우만 실행 */
|
||||||
if (allocationType !== 'auto') return
|
if (allocationType !== 'auto') return
|
||||||
|
|
||||||
@ -437,13 +434,7 @@ export default function StepUp(props) {
|
|||||||
|
|
||||||
/** 선택된 serQty 찾기 */
|
/** 선택된 serQty 찾기 */
|
||||||
const selectedSerQty = matchingPcsItem?.serQtyList.find((serQty) => serQty.selected)?.serQty || 0
|
const selectedSerQty = matchingPcsItem?.serQtyList.find((serQty) => serQty.selected)?.serQty || 0
|
||||||
if (index === 0) {
|
|
||||||
return {
|
|
||||||
...pcsItem,
|
|
||||||
applySerQty: selectedSerQty,
|
|
||||||
applyParalQty: +applyParalQty,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return {
|
return {
|
||||||
...pcsItem,
|
...pcsItem,
|
||||||
applySerQty: selectedSerQty,
|
applySerQty: selectedSerQty,
|
||||||
@ -483,7 +474,7 @@ export default function StepUp(props) {
|
|||||||
module.pcsItemId = null
|
module.pcsItemId = null
|
||||||
})
|
})
|
||||||
|
|
||||||
/** 선택된 모듈 목록 추가 */
|
/** 선택된 모듈 목록 추가 */
|
||||||
selectedData.roofSurfaceList.forEach((roofSurface) => {
|
selectedData.roofSurfaceList.forEach((roofSurface) => {
|
||||||
const targetSurface = canvas.getObjects().filter((obj) => obj.id === roofSurface.roofSurfaceId)[0]
|
const targetSurface = canvas.getObjects().filter((obj) => obj.id === roofSurface.roofSurfaceId)[0]
|
||||||
const moduleIds = targetSurface.modules.map((module) => {
|
const moduleIds = targetSurface.modules.map((module) => {
|
||||||
@ -532,7 +523,7 @@ export default function StepUp(props) {
|
|||||||
|
|
||||||
canvas.renderAll()
|
canvas.renderAll()
|
||||||
setModuleStatisticsData()
|
setModuleStatisticsData()
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 현재 선택된 값들을 가져오는 함수 추가
|
* 현재 선택된 값들을 가져오는 함수 추가
|
||||||
@ -634,7 +625,7 @@ export default function StepUp(props) {
|
|||||||
<div className="slope-wrap">
|
<div className="slope-wrap">
|
||||||
<div className="circuit-overflow">
|
<div className="circuit-overflow">
|
||||||
{/* 3개일때 className = by-max */}
|
{/* 3개일때 className = by-max */}
|
||||||
{originPcsVoltageStepUpList.map((stepUp, index) => (
|
{stepUpListData.map((stepUp, index) => (
|
||||||
<div key={index} className={`module-table-box ${stepUp.pcsItemList.length === 3 ? 'by-max' : ''}`}>
|
<div key={index} className={`module-table-box ${stepUp.pcsItemList.length === 3 ? 'by-max' : ''}`}>
|
||||||
{stepUp?.pcsItemList.map((pcsItem, idx) => (
|
{stepUp?.pcsItemList.map((pcsItem, idx) => (
|
||||||
<div key={idx} className="module-table-inner">
|
<div key={idx} className="module-table-inner">
|
||||||
@ -654,42 +645,15 @@ export default function StepUp(props) {
|
|||||||
<tr
|
<tr
|
||||||
key={`row-${serQtyIdx}`}
|
key={`row-${serQtyIdx}`}
|
||||||
className={`${item.selected ? 'on' : ''}`}
|
className={`${item.selected ? 'on' : ''}`}
|
||||||
|
onClick={() => handleRowClick(idx, serQtyIdx)}
|
||||||
style={{ cursor: allocationType === 'auto' ? 'pointer' : 'default' }}
|
style={{ cursor: allocationType === 'auto' ? 'pointer' : 'default' }}
|
||||||
>
|
>
|
||||||
<td
|
<td className="al-r">{item.serQty}</td>
|
||||||
className="al-r"
|
|
||||||
onClick={() => {
|
|
||||||
handleRowClick(idx, serQtyIdx)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.serQty}
|
|
||||||
</td>
|
|
||||||
<td className="al-r">
|
<td className="al-r">
|
||||||
{/* 2025.12.04 select 추가 */}
|
{/* 2025.12.04 select 추가 */}
|
||||||
{idx === 0 ? (
|
<select className="select-light dark table-select" name="" id="">
|
||||||
<select
|
<option value="">{item.paralQty}</option>
|
||||||
className="select-light dark table-select"
|
</select>
|
||||||
defaultValue={item.paralQty}
|
|
||||||
name=""
|
|
||||||
id=""
|
|
||||||
onChange={(e) => {
|
|
||||||
handleChangeApplyParalQty(idx, serQtyIdx, e.target.value)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
{item.paralQty === 0 && (
|
|
||||||
<option key="0" value="0">
|
|
||||||
0
|
|
||||||
</option>
|
|
||||||
)}
|
|
||||||
{Array.from({ length: item.paralQty }, (_, i) => i + 1).map((num) => (
|
|
||||||
<option key={num} value={num}>
|
|
||||||
{num}
|
|
||||||
</option>
|
|
||||||
))}
|
|
||||||
</select>
|
|
||||||
) : (
|
|
||||||
<>{item.paralQty}</>
|
|
||||||
)}
|
|
||||||
</td>
|
</td>
|
||||||
{/* <td className="al-r">{item.paralQty}</td> */}
|
{/* <td className="al-r">{item.paralQty}</td> */}
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -267,14 +267,14 @@ export function useModuleBasicSetting(tabNum) {
|
|||||||
//도머일때
|
//도머일때
|
||||||
if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) {
|
if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) {
|
||||||
const groupPoints = obj.getCurrentPoints()
|
const groupPoints = obj.getCurrentPoints()
|
||||||
const offsetObjects = offsetPolygon(groupPoints, 30)
|
const offsetObjects = offsetPolygon(groupPoints, 10)
|
||||||
const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions)
|
const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions)
|
||||||
dormerOffset.setViewLengthText(false)
|
dormerOffset.setViewLengthText(false)
|
||||||
canvas.add(dormerOffset) //모듈설치면 만들기
|
canvas.add(dormerOffset) //모듈설치면 만들기
|
||||||
} else {
|
} else {
|
||||||
//개구, 그림자일때
|
//개구, 그림자일때
|
||||||
const points = obj.getCurrentPoints()
|
const points = obj.getCurrentPoints()
|
||||||
const offsetObjects = offsetPolygon(points, 30)
|
const offsetObjects = offsetPolygon(points, 10)
|
||||||
const offset = new QPolygon(offsetObjects, batchObjectOptions)
|
const offset = new QPolygon(offsetObjects, batchObjectOptions)
|
||||||
offset.setViewLengthText(false)
|
offset.setViewLengthText(false)
|
||||||
canvas.add(offset) //모듈설치면 만들기
|
canvas.add(offset) //모듈설치면 만들기
|
||||||
|
|||||||
@ -50,10 +50,6 @@ export function useCanvasEvent() {
|
|||||||
|
|
||||||
if (target) {
|
if (target) {
|
||||||
// settleDown(target)
|
// settleDown(target)
|
||||||
// roof 이동 후 좌표 재계산
|
|
||||||
if (target.name === POLYGON_TYPE.ROOF && target.type === 'QPolygon') {
|
|
||||||
target.fire('polygonMoved')
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addEvent: (e) => {
|
addEvent: (e) => {
|
||||||
|
|||||||
@ -1003,8 +1003,8 @@ const createInnerLinesFromSkeleton = (roofId, canvas, skeleton, textMode) => {
|
|||||||
if (isStartEnd.start) {
|
if (isStartEnd.start) {
|
||||||
//x1 inside
|
//x1 inside
|
||||||
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
const moveDist = Big(wallLine.x1).minus(wallBaseLine.x1).abs().toNumber()
|
||||||
const aStartY = Big(roofLine.y1).plus(moveDist).toNumber()
|
const aStartY = Big(roofLine.y1).plus(moveDist).abs().toNumber()
|
||||||
const bStartY = Big(wallLine.y1).plus(moveDist).toNumber()
|
const bStartY = Big(wallLine.y1).plus(moveDist).abs().toNumber()
|
||||||
const inLine = findLineContainingPoint(innerLines, { y: aStartY, x: roofLine.x1 })
|
const inLine = findLineContainingPoint(innerLines, { y: aStartY, x: roofLine.x1 })
|
||||||
console.log('startLines:::::::', inLine)
|
console.log('startLines:::::::', inLine)
|
||||||
const eLineY = Big(bStartY).minus(wallLine.y1).abs().toNumber()
|
const eLineY = Big(bStartY).minus(wallLine.y1).abs().toNumber()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user