Merge branch 'dev' into dev-yj-layoutSetup
This commit is contained in:
commit
15ff2989f4
@ -2,9 +2,13 @@
|
||||
|
||||
import { useState } from 'react'
|
||||
import Draggable from 'react-draggable'
|
||||
import PopSpinner from '../spinner/PopSpinner'
|
||||
import { popSpinnerState } from '@/store/popupAtom'
|
||||
import { useRecoilState } from 'recoil'
|
||||
|
||||
export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handle = '', className = '', hasFooter = true, isHidden = false }) {
|
||||
const [position, setPosition] = useState(pos)
|
||||
const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
|
||||
|
||||
const handleOnDrag = (e, data) => {
|
||||
e.stopPropagation()
|
||||
@ -25,6 +29,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 },
|
||||
<div className={`modal-pop-wrap ${className}`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
||||
{children}
|
||||
{hasFooter && <WithDraggableFooter />}
|
||||
{popSpinnerStore && <PopSpinner />}
|
||||
</div>
|
||||
</Draggable>
|
||||
)}
|
||||
|
||||
@ -136,8 +136,20 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, {
|
||||
this.on('removed', () => {
|
||||
// const children = getAllRelatedObjects(this.id, this.canvas)
|
||||
const children = this.canvas.getObjects().filter((obj) => obj.parentId === this.id)
|
||||
|
||||
children.forEach((child) => {
|
||||
this.canvas.remove(child)
|
||||
|
||||
//그룹일때
|
||||
if (child.hasOwnProperty('_objects')) {
|
||||
child._objects.forEach((obj) => {
|
||||
if (obj.hasOwnProperty('texts')) {
|
||||
obj.texts.forEach((text) => {
|
||||
this.canvas?.remove(text)
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
@ -89,11 +89,11 @@ export default function CanvasMenu(props) {
|
||||
const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector)
|
||||
|
||||
//견적서버튼 노출용
|
||||
const [buttonStyle1, setButtonStyle1] = useState('') //문서 다운로드 버튼
|
||||
const [buttonStyle2, setButtonStyle2] = useState('') //저장 버튼
|
||||
const [buttonStyle3, setButtonStyle3] = useState('') //초기화 버튼
|
||||
const [buttonStyle4, setButtonStyle4] = useState('') //견적서 복사 버튼
|
||||
const [buttonStyle5, setButtonStyle5] = useState('') //잠금 버튼
|
||||
const [docDownButtonStyle, setDocDownButtonStyle] = useState('') //문서 다운로드 버튼
|
||||
const [saveButtonStyle, setSaveButtonStyle] = useState('') //저장 버튼
|
||||
const [resetButtonStyle, setResetButtonStyle] = useState('') //초기화 버튼
|
||||
const [copyButtonStyle, setCopyButtonStyle] = useState('') //견적서 복사 버튼
|
||||
const [lockButtonStyle, setLockButtonStyle] = useState('') //잠금 버튼
|
||||
|
||||
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
||||
|
||||
@ -442,28 +442,28 @@ export default function CanvasMenu(props) {
|
||||
}, [estimateContextState?.createUser, estimateContextState?.tempFlg, estimateContextState?.lockFlg, estimateContextState.docNo])
|
||||
|
||||
const setAllButtonStyles = (style) => {
|
||||
setButtonStyle1(style)
|
||||
setButtonStyle2(style)
|
||||
setButtonStyle3(style)
|
||||
setButtonStyle4(style)
|
||||
setButtonStyle5(style)
|
||||
setDocDownButtonStyle(style)
|
||||
setSaveButtonStyle(style)
|
||||
setResetButtonStyle(style)
|
||||
setCopyButtonStyle(style)
|
||||
setLockButtonStyle(style)
|
||||
}
|
||||
|
||||
const handleButtonStyles = (tempFlg, lockFlg, docNo) => {
|
||||
if (tempFlg === '1') {
|
||||
setAllButtonStyles('none')
|
||||
setButtonStyle2('')
|
||||
setSaveButtonStyle('')
|
||||
} else if (tempFlg === '0' && lockFlg === '0') {
|
||||
setAllButtonStyles('')
|
||||
} else {
|
||||
setButtonStyle1('')
|
||||
setButtonStyle2('none')
|
||||
setButtonStyle3('none')
|
||||
setButtonStyle4('')
|
||||
setButtonStyle5('')
|
||||
setDocDownButtonStyle('')
|
||||
setSaveButtonStyle('none')
|
||||
setResetButtonStyle('none')
|
||||
setCopyButtonStyle('')
|
||||
setLockButtonStyle('')
|
||||
}
|
||||
if (!docNo) {
|
||||
setButtonStyle1('none')
|
||||
setDocDownButtonStyle('none')
|
||||
}
|
||||
}
|
||||
|
||||
@ -513,11 +513,11 @@ export default function CanvasMenu(props) {
|
||||
|
||||
// 문서다운로드 팝업에서 다운로드 하면 문서 잠금
|
||||
const docDownPopLockFlg = () => {
|
||||
setButtonStyle1('')
|
||||
setButtonStyle2('none')
|
||||
setButtonStyle3('none')
|
||||
setButtonStyle4('')
|
||||
setButtonStyle5('')
|
||||
setDocDownButtonStyle('')
|
||||
setSaveButtonStyle('none')
|
||||
setResetButtonStyle('none')
|
||||
setCopyButtonStyle('')
|
||||
setLockButtonStyle('')
|
||||
}
|
||||
|
||||
return (
|
||||
@ -627,17 +627,22 @@ export default function CanvasMenu(props) {
|
||||
>
|
||||
<span className="name">{getMessage('stuff.search.btn.register')}</span>
|
||||
</button>
|
||||
<button type="button" style={{ display: buttonStyle1 }} className="btn-frame gray ico-flx" onClick={() => setEstimatePopupOpen(true)}>
|
||||
<button
|
||||
type="button"
|
||||
style={{ display: docDownButtonStyle }}
|
||||
className="btn-frame gray ico-flx"
|
||||
onClick={() => setEstimatePopupOpen(true)}
|
||||
>
|
||||
<span className="ico ico01"></span>
|
||||
<span className="name">{getMessage('plan.menu.estimate.docDown')}</span>
|
||||
</button>
|
||||
<button type="button" style={{ display: buttonStyle2 }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
|
||||
<button type="button" style={{ display: saveButtonStyle }} className="btn-frame gray ico-flx" onClick={handleEstimateSubmit}>
|
||||
<span className="ico ico02"></span>
|
||||
<span className="name">{getMessage('plan.menu.estimate.save')}</span>
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
style={{ display: buttonStyle3 }}
|
||||
style={{ display: resetButtonStyle }}
|
||||
className="btn-frame gray ico-flx"
|
||||
onClick={() => {
|
||||
handleEstimateReset()
|
||||
@ -650,7 +655,7 @@ export default function CanvasMenu(props) {
|
||||
{estimateRecoilState?.docNo !== null && (sessionState.storeId === 'T01' || sessionState.storeLvl === '1') && (
|
||||
<button
|
||||
type="button"
|
||||
style={{ display: buttonStyle4 }}
|
||||
style={{ display: copyButtonStyle }}
|
||||
className="btn-frame gray ico-flx"
|
||||
onClick={() => {
|
||||
setEstimateCopyPopupOpen(true)
|
||||
@ -662,7 +667,7 @@ export default function CanvasMenu(props) {
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
style={{ display: buttonStyle5 }}
|
||||
style={{ display: lockButtonStyle }}
|
||||
className="btn-frame gray ico-flx"
|
||||
onClick={() => {
|
||||
handleEstimateLockController(estimateRecoilState)
|
||||
|
||||
@ -51,7 +51,8 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
// const { trigger: setCircuitData } = useCanvasPopupStatusController(4)
|
||||
// const [stepUpListData, setStepUpListData] = useRecoilState(stepUpListDataState)
|
||||
const [stepUpListData, setStepUpListData] = useState([])
|
||||
const [seletedOption, setSeletedOption] = useState(null)
|
||||
const [seletedMainOption, setSeletedMainOption] = useState(null)
|
||||
const [seletedSubOption, setSeletedSubOption] = useState(null)
|
||||
const { setModuleStatisticsData } = useCircuitTrestle()
|
||||
const { handleCanvasToPng } = useImgLoader()
|
||||
|
||||
@ -78,6 +79,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
getRoofSurfaceList,
|
||||
getModuleList,
|
||||
removeNotAllocationModules,
|
||||
resetCircuits,
|
||||
} = useCircuitTrestle()
|
||||
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||
useEffect(() => {
|
||||
@ -92,6 +94,13 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
// selectedModels,
|
||||
// pcsCheck,
|
||||
// })
|
||||
|
||||
return () => {
|
||||
const moduleSetupSurfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
if (moduleSetupSurfaces.some((surface) => !surface.isComplete)) {
|
||||
resetCircuits()
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
|
||||
// 수동할당 시 모듈 삭제
|
||||
@ -445,6 +454,7 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
allocationType,
|
||||
circuitAllocationType,
|
||||
setCircuitAllocationType,
|
||||
selectedMaker,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
getSelectedPcsItemList,
|
||||
@ -455,23 +465,27 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
onValuesSelected: handleStepUpValuesSelected, // 선택된 값들을 처리하는 함수
|
||||
stepUpListData,
|
||||
setStepUpListData,
|
||||
seletedOption,
|
||||
setSeletedOption,
|
||||
seletedMainOption,
|
||||
setSeletedMainOption,
|
||||
seletedSubOption,
|
||||
setSeletedSubOption,
|
||||
getModuleList,
|
||||
setModuleStatisticsData,
|
||||
}
|
||||
|
||||
// 승압설정 목록 조회
|
||||
const getStepUpListData = () => {
|
||||
return stepUpListData[0].pcsItemList.map((item) => {
|
||||
const pcs = []
|
||||
console.log(stepUpListData)
|
||||
stepUpListData[0].pcsItemList.map((item, index) => {
|
||||
return item.serQtyList
|
||||
.filter((serQty) => serQty.selected)
|
||||
.map((serQty) => {
|
||||
return {
|
||||
.forEach((serQty) => {
|
||||
pcs.push({
|
||||
pcsMkrCd: item.pcsMkrCd,
|
||||
pcsSerCd: item.pcsSerCd,
|
||||
pcsItemId: item.itemId,
|
||||
pscOptCd: seletedOption.code,
|
||||
pscOptCd: getPcsOptCd(index),
|
||||
paralQty: serQty.paralQty,
|
||||
connections: item.connList?.length
|
||||
? [
|
||||
@ -480,9 +494,43 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
},
|
||||
]
|
||||
: [],
|
||||
}
|
||||
})[0]
|
||||
})
|
||||
// return {
|
||||
// pcsMkrCd: item.pcsMkrCd,
|
||||
// pcsSerCd: item.pcsSerCd,
|
||||
// pcsItemId: item.itemId,
|
||||
// pscOptCd: getPcsOptCd(index),
|
||||
// paralQty: serQty.paralQty,
|
||||
// connections: item.connList?.length
|
||||
// ? [
|
||||
// {
|
||||
// connItemId: item.connList[0].itemId,
|
||||
// },
|
||||
// ]
|
||||
// : [],
|
||||
// }
|
||||
})
|
||||
})
|
||||
return pcs
|
||||
}
|
||||
|
||||
const getPcsOptCd = (index) => {
|
||||
console.log(selectedModels)
|
||||
console.log(seletedMainOption)
|
||||
console.log(seletedSubOption)
|
||||
if (selectedModels.some((model) => model.pcsSerParallelYn === 'Y')) {
|
||||
if (selectedModels.length > 1) {
|
||||
if (index === 0) {
|
||||
return seletedMainOption.code
|
||||
} else {
|
||||
return seletedSubOption.code
|
||||
}
|
||||
} else {
|
||||
return seletedMainOption.code
|
||||
}
|
||||
} else {
|
||||
return seletedMainOption.code
|
||||
}
|
||||
}
|
||||
|
||||
const handleStepUp = () => {
|
||||
|
||||
@ -13,7 +13,7 @@ import { useRecoilState } from 'recoil'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { v4 as uuidv4 } from 'uuid'
|
||||
|
||||
const PCS_MKR_MULTI_TYPE = {
|
||||
export const PCS_MKR_MULTI_TYPE = {
|
||||
MULTI: 'MULTI',
|
||||
SINGLE_P: 'SINGLE-P',
|
||||
SINGLE_N: 'SINGLE-N',
|
||||
|
||||
@ -15,6 +15,7 @@ import { POLYGON_TYPE } from '@/common/common'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
import { circuitNumDisplaySelector } from '@/store/settingAtom'
|
||||
import { fontSelector } from '@/store/fontAtom'
|
||||
import { PCS_MKR_MULTI_TYPE } from './PowerConditionalSelect'
|
||||
|
||||
export default function StepUp(props) {
|
||||
const {
|
||||
@ -22,8 +23,11 @@ export default function StepUp(props) {
|
||||
allocationType,
|
||||
stepUpListData,
|
||||
setStepUpListData,
|
||||
seletedOption,
|
||||
setSeletedOption,
|
||||
seletedMainOption,
|
||||
setSeletedMainOption,
|
||||
seletedSubOption,
|
||||
setSeletedSubOption,
|
||||
selectedMaker,
|
||||
selectedModels,
|
||||
setSelectedModels,
|
||||
getSelectedPcsItemList,
|
||||
@ -42,17 +46,14 @@ export default function StepUp(props) {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const selectedModules = useRecoilValue(selectedModuleState)
|
||||
const [optCodes, setOptCodes] = useState([])
|
||||
const [mainOptions, setMainOptions] = useState([])
|
||||
const [subOptions, setSubOptions] = useState([])
|
||||
|
||||
const [selectedRows, setSelectedRows] = useState({})
|
||||
const [isManualSelection, setIsManualSelection] = useState({})
|
||||
|
||||
const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector)
|
||||
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
||||
// useCanvasPopupStatusController(6)
|
||||
// const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore)
|
||||
// if (Object.keys(canvasPopupStatusState[6]).length !== 0) {
|
||||
// console.log('🚀 ~ useEffect ~ canvasPopupStatusState :', canvasPopupStatusState)
|
||||
// }
|
||||
|
||||
useEffect(() => {
|
||||
if (allocationType === 'auto') {
|
||||
@ -79,6 +80,11 @@ export default function StepUp(props) {
|
||||
/**
|
||||
* PCS 자동 승압설정 정보 조회
|
||||
*/
|
||||
|
||||
const isMultiOptions = () => {
|
||||
return selectedModels.some((model) => model.pcsSerParallelYn === 'Y')
|
||||
}
|
||||
|
||||
const fetchAutoStepUpData = async () => {
|
||||
try {
|
||||
const params = {
|
||||
@ -87,7 +93,6 @@ export default function StepUp(props) {
|
||||
roofSurfaceList: props.getRoofSurfaceList() /** 지붕면 목록 */,
|
||||
pcsItemList: props.getSelectedPcsItemList() /** PCS 아이템 목록 */,
|
||||
}
|
||||
|
||||
/** 회로 구성 가능 여부 체크 통과 시 승압설정 정보 조회 */
|
||||
getPcsVoltageStepUpList(params).then((res) => {
|
||||
if (res?.result.resultCode === 'S' && res?.data) {
|
||||
@ -98,12 +103,29 @@ export default function StepUp(props) {
|
||||
setStepUpListData(stepUpListData)
|
||||
|
||||
/** PCS 옵션 조회 */
|
||||
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
setOptCodes(formattedOptCodes)
|
||||
setSeletedOption(formattedOptCodes[0])
|
||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
// setOptCodes(formattedOptCodes)
|
||||
// setSeletedOption(formattedOptCodes[0])
|
||||
|
||||
/** 캔버스에 회로 정보 적용 */
|
||||
stepUpListData[0].pcsItemList.forEach((pcsItem) => {
|
||||
// 병설일때 pcs 있으면 setSubOpsions, 없으면 setMainOptions
|
||||
console.log('stepUpListData', stepUpListData)
|
||||
stepUpListData[0].pcsItemList.forEach((pcsItem, index) => {
|
||||
const optionList = formatOptionCodes(pcsItem.optionList)
|
||||
if (isMultiOptions()) {
|
||||
if (index === 0) {
|
||||
setMainOptions(optionList)
|
||||
setSeletedMainOption(optionList[0])
|
||||
} else {
|
||||
setSubOptions(optionList)
|
||||
setSeletedSubOption(optionList[0])
|
||||
}
|
||||
} else {
|
||||
if (index === 0) {
|
||||
setMainOptions(optionList)
|
||||
setSeletedMainOption(optionList[0])
|
||||
}
|
||||
}
|
||||
const selectedSerQty = pcsItem.serQtyList.find((serQty) => serQty.selected)
|
||||
if (selectedSerQty) {
|
||||
selectedSerQty.roofSurfaceList.forEach((roofSurface) => {
|
||||
@ -165,12 +187,6 @@ export default function StepUp(props) {
|
||||
*/
|
||||
const fetchPassiStepUpData = async () => {
|
||||
try {
|
||||
// 1-1 2-2
|
||||
// canvas
|
||||
// .getObjects()
|
||||
// .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuit)
|
||||
// .map((module) => module.circuitNumber)
|
||||
|
||||
/** 모듈 데이터 가져오기 */
|
||||
const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
|
||||
@ -208,6 +224,21 @@ export default function StepUp(props) {
|
||||
const pcsItemListWithSerQty = res.data.pcsItemList.map((pcsItem, index) => {
|
||||
const pcsData = pcsSummary[selectedModels[index].id] || { circuits: {}, totalModules: 0 }
|
||||
const circuitCounts = Object.values(pcsData.circuits)
|
||||
const optionList = formatOptionCodes(pcsItem.optionList)
|
||||
if (isMultiOptions()) {
|
||||
if (index === 0) {
|
||||
setMainOptions(optionList)
|
||||
setSeletedMainOption(optionList[0])
|
||||
} else {
|
||||
setSubOptions(optionList)
|
||||
setSeletedSubOption(optionList[0])
|
||||
}
|
||||
} else {
|
||||
if (index === 0) {
|
||||
setMainOptions(optionList)
|
||||
setSeletedMainOption(optionList[0])
|
||||
}
|
||||
}
|
||||
return {
|
||||
...pcsItem,
|
||||
serQtyList: [
|
||||
@ -234,9 +265,9 @@ export default function StepUp(props) {
|
||||
setStepUpListData(stepUpListData)
|
||||
|
||||
/** PCS 옵션 조회 */
|
||||
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
setOptCodes(formattedOptCodes)
|
||||
setSeletedOption(formattedOptCodes[0])
|
||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
// setOptCodes(formattedOptCodes)
|
||||
// setSeletedOption(formattedOptCodes[0])
|
||||
}
|
||||
})
|
||||
} catch (error) {
|
||||
@ -249,9 +280,9 @@ export default function StepUp(props) {
|
||||
*/
|
||||
const formatOptionCodes = (optionList = []) => {
|
||||
return optionList?.map((opt) => ({
|
||||
code: opt.pcsOptCd ? opt.pcsOptCd : '',
|
||||
name: opt.pcsOptNm ? opt.pcsOptNm : '',
|
||||
nameJp: opt.pcsOptNmJp ? opt.pcsOptNmJp : '',
|
||||
code: opt.pcsOptCd ?? '',
|
||||
name: opt.pcsOptNm ?? '',
|
||||
nameJp: opt.pcsOptNmJp ?? '',
|
||||
}))
|
||||
}
|
||||
|
||||
@ -274,9 +305,9 @@ export default function StepUp(props) {
|
||||
*/
|
||||
const formatOptionList = (optionList = []) => {
|
||||
return optionList?.map((option) => ({
|
||||
pcsOptCd: option.pcsOptCd ? option.pcsOptCd : '',
|
||||
pcsOptNm: option.pcsOptNm ? option.pcsOptNm : '',
|
||||
pcsOptNmJp: option.pcsOptNmJp ? option.pcsOptNmJp : '',
|
||||
pcsOptCd: option.pcsOptCd ?? '',
|
||||
pcsOptNm: option.pcsOptNm ?? '',
|
||||
pcsOptNmJp: option.pcsOptNmJp ?? '',
|
||||
}))
|
||||
}
|
||||
|
||||
@ -293,6 +324,7 @@ export default function StepUp(props) {
|
||||
uniqueIndex: `${item.itemId}_${index}`, // 고유 식별자 추가(동일한 PCS를 구분)
|
||||
connList: formatConnList(item.connList),
|
||||
serQtyList: formatSerQtyList(item.serQtyList),
|
||||
optionList: item.optionList ?? [],
|
||||
}))
|
||||
}
|
||||
|
||||
@ -303,12 +335,12 @@ export default function StepUp(props) {
|
||||
if (!connList) return [] // null인 경우 빈 배열 반환
|
||||
|
||||
return connList?.map((conn) => ({
|
||||
connAllowCur: conn.connAllowCur ? conn.connAllowCur : 0,
|
||||
connMaxParalCnt: conn.connMaxParalCnt ? conn.connMaxParalCnt : 0,
|
||||
goodsNo: conn.goodsNo ? conn.goodsNo : '',
|
||||
itemId: conn.itemId ? conn.itemId : '',
|
||||
itemNm: conn.itemNm ? conn.itemNm : '',
|
||||
vstuParalCnt: conn.vstuParalCnt ? conn.vstuParalCnt : 0,
|
||||
connAllowCur: conn.connAllowCur ?? 0,
|
||||
connMaxParalCnt: conn.connMaxParalCnt ?? 0,
|
||||
goodsNo: conn.goodsNo ?? '',
|
||||
itemId: conn.itemId ?? '',
|
||||
itemNm: conn.itemNm ?? '',
|
||||
vstuParalCnt: conn.vstuParalCnt ?? 0,
|
||||
}))
|
||||
}
|
||||
|
||||
@ -318,10 +350,10 @@ export default function StepUp(props) {
|
||||
const formatSerQtyList = (serQtyList = []) => {
|
||||
return serQtyList?.map((qty) => ({
|
||||
code: uuidv4(),
|
||||
serQty: qty.serQty ? qty.serQty : 0,
|
||||
paralQty: qty.paralQty ? qty.paralQty : 0,
|
||||
rmdYn: qty.rmdYn ? qty.rmdYn : 'N',
|
||||
usePossYn: qty.usePossYn ? qty.usePossYn : 'Y',
|
||||
serQty: qty.serQty ?? 0,
|
||||
paralQty: qty.paralQty ?? 0,
|
||||
rmdYn: qty.rmdYn ?? 'N',
|
||||
usePossYn: qty.usePossYn ?? 'Y',
|
||||
roofSurfaceList: formatRoofSurfaceList(qty.roofSurfaceList),
|
||||
selected: qty.rmdYn === 'Y',
|
||||
}))
|
||||
@ -333,8 +365,8 @@ export default function StepUp(props) {
|
||||
const formatRoofSurfaceList = (roofSurfaceList = []) => {
|
||||
return roofSurfaceList?.map((rsf) => ({
|
||||
moduleList: formatModuleList(rsf.moduleList),
|
||||
roofSurface: rsf.roofSurface ? rsf.roofSurface : '',
|
||||
roofSurfaceId: rsf.roofSurfaceId ? rsf.roofSurfaceId : '',
|
||||
roofSurface: rsf.roofSurface ?? '',
|
||||
roofSurfaceId: rsf.roofSurfaceId ?? '',
|
||||
roofSurfaceIncl: rsf.roofSurfaceIncl ? +rsf.roofSurfaceIncl : '',
|
||||
}))
|
||||
}
|
||||
@ -344,10 +376,10 @@ export default function StepUp(props) {
|
||||
*/
|
||||
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 : '',
|
||||
circuit: module.circuit ?? '',
|
||||
itemId: module.itemId ?? '',
|
||||
pcsItemId: module.pcsItemId ?? '',
|
||||
uniqueId: module.uniqueId ?? '',
|
||||
}))
|
||||
}
|
||||
|
||||
@ -416,9 +448,9 @@ export default function StepUp(props) {
|
||||
setStepUpListData(stepUpListData)
|
||||
|
||||
/** PCS 옵션 조회 */
|
||||
const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
setOptCodes(formattedOptCodes)
|
||||
setSeletedOption(formattedOptCodes[0])
|
||||
// const formattedOptCodes = formatOptionCodes(res.data.optionList)
|
||||
// setOptCodes(formattedOptCodes)
|
||||
// setSeletedOption(formattedOptCodes[0])
|
||||
} else {
|
||||
swalFire({ text: getMessage('common.message.send.error') })
|
||||
}
|
||||
@ -532,7 +564,37 @@ export default function StepUp(props) {
|
||||
<>
|
||||
<div className="properties-setting-wrap outer">
|
||||
<div className="circuit-title-sel">
|
||||
<div className="outline-form">
|
||||
<p className="circuit-title">{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}</p>
|
||||
<div className="circuit-sel-wrap">
|
||||
<div className="grid-select mr10">
|
||||
{mainOptions.length > 0 && (
|
||||
<QSelectBox
|
||||
options={mainOptions}
|
||||
value={seletedMainOption}
|
||||
sourceKey="code"
|
||||
targetKey="code"
|
||||
showKey="name"
|
||||
onChange={(e) => setSeletedMainOption(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{isMultiOptions() && selectedModels.length === 2 && (
|
||||
<div className="grid-select ">
|
||||
{subOptions.length > 0 && (
|
||||
<QSelectBox
|
||||
options={subOptions}
|
||||
value={seletedSubOption}
|
||||
sourceKey="code"
|
||||
targetKey="code"
|
||||
showKey="name"
|
||||
onChange={(e) => setSeletedSubOption(e)}
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
{/* <div className="outline-form">
|
||||
<span className="mr10" style={{ width: 'auto' }}>
|
||||
{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
|
||||
</span>
|
||||
@ -551,7 +613,7 @@ export default function StepUp(props) {
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
|
||||
<div className="slope-wrap">
|
||||
|
||||
@ -46,6 +46,10 @@ export default function PlanSizeSetting(props) {
|
||||
const changeInput = (value, e) => {
|
||||
const { name } = e.target
|
||||
|
||||
if (Number(value) > 100000) {
|
||||
value = 100000
|
||||
}
|
||||
|
||||
setPlanSizeSettingMode((prev) => {
|
||||
return {
|
||||
...prev,
|
||||
|
||||
71
src/components/footer/PromisePopup.jsx
Normal file
71
src/components/footer/PromisePopup.jsx
Normal file
@ -0,0 +1,71 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { popSpinnerState, promisePopupState } from '@/store/popupAtom'
|
||||
import { useRecoilState } from 'recoil'
|
||||
import WithDraggable from '../common/draggable/WithDraggable'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
|
||||
export default function PromisePopup() {
|
||||
const { getMessage } = useMessage()
|
||||
const [promisePopupStore, setPromisePopupStore] = useRecoilState(promisePopupState)
|
||||
const [popSpinnerStore, setPopSpinnerStore] = useRecoilState(popSpinnerState)
|
||||
|
||||
const handleSpinner = () => {
|
||||
setPopSpinnerStore(true)
|
||||
setTimeout(() => {
|
||||
setPopSpinnerStore(false)
|
||||
}, 1000)
|
||||
}
|
||||
|
||||
return (
|
||||
<WithDraggable isShow={promisePopupStore} pos={{ x: 1000, y: 200 }} className="r">
|
||||
<WithDraggable.Header title={'popup promise test'} onClose={() => setPromisePopupStore(false)} />
|
||||
|
||||
<WithDraggable.Body>
|
||||
<div className="img-flex-box">
|
||||
<span className="normal-font mr10">{getMessage('modal.image.load.size.rotate')}</span>
|
||||
<label className="toggle-btn">
|
||||
<input type="checkbox" checked={true} value="1" />
|
||||
<span className="slider"></span>
|
||||
</label>
|
||||
</div>
|
||||
<div className="img-load-from">
|
||||
<div className="img-load-item">
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio03" id="ra06" value={'1'} />
|
||||
<label htmlFor="ra06">{getMessage('common.input.file')}</label>
|
||||
</div>
|
||||
<div className="img-flex-box">
|
||||
<div className="img-edit-wrap">
|
||||
<label className="img-edit-btn" htmlFor="img_file">
|
||||
<span className="img-edit"></span>
|
||||
{getMessage('common.load')}
|
||||
</label>
|
||||
<input type="file" id="img_file" style={{ display: 'none' }} />
|
||||
</div>
|
||||
<div className="img-name-wrap">
|
||||
<input type="text" className="input-origin al-l" value={'test'} readOnly />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="img-load-item">
|
||||
<div className="d-check-radio pop">
|
||||
<input type="radio" name="radio03" id="ra07" value={'2'} />
|
||||
<label htmlFor="ra07">{getMessage('common.input.address.load')}</label>
|
||||
</div>
|
||||
<div className="img-flex-box for-address">
|
||||
<input type="text" className="input-origin al-l mr10" placeholder={'住所入力'} value={'test'} />
|
||||
<div className="img-edit-wrap">
|
||||
<button className={`img-edit-btn`}>{getMessage('common.finish')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal act" onClick={handleSpinner}>
|
||||
{getMessage('common.finish')}
|
||||
</button>
|
||||
</div>
|
||||
</WithDraggable.Body>
|
||||
</WithDraggable>
|
||||
)
|
||||
}
|
||||
@ -283,17 +283,17 @@ export default function StuffDetail() {
|
||||
autoHeight: true,
|
||||
cellStyle: { justifyContent: 'center' },
|
||||
cellRenderer: (params) => {
|
||||
let buttonStyle = ''
|
||||
let buttonStyle2 = ''
|
||||
let estimateDetailButtonStyle = ''
|
||||
let docDownButtonStyle = ''
|
||||
if (params.value == null) {
|
||||
buttonStyle = 'none'
|
||||
buttonStyle2 = 'none'
|
||||
estimateDetailButtonStyle = 'none'
|
||||
docDownButtonStyle = 'none'
|
||||
} else {
|
||||
if (params?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
|
||||
buttonStyle = 'none'
|
||||
estimateDetailButtonStyle = 'none'
|
||||
}
|
||||
if (params?.data?.tempFlg === '1' || !params?.data?.docNo) {
|
||||
buttonStyle2 = 'none'
|
||||
docDownButtonStyle = 'none'
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ export default function StuffDetail() {
|
||||
<>
|
||||
<div className="grid-cell-btn">
|
||||
<button
|
||||
style={{ display: buttonStyle }}
|
||||
style={{ display: estimateDetailButtonStyle }}
|
||||
type="button"
|
||||
className="grid-btn"
|
||||
onClick={() => {
|
||||
@ -315,7 +315,7 @@ export default function StuffDetail() {
|
||||
{getMessage('stuff.detail.planGrid.btn1')}
|
||||
</button>
|
||||
<button
|
||||
style={{ display: buttonStyle2 }}
|
||||
style={{ display: docDownButtonStyle }}
|
||||
type="button"
|
||||
className="grid-btn"
|
||||
onClick={() => {
|
||||
|
||||
@ -640,13 +640,13 @@ export const useTrestle = () => {
|
||||
//surfaces.pcses들을 배열로 묶는다
|
||||
const pcses = surfaces[0].pcses.filter((pcs) => pcs !== null && pcs !== undefined)
|
||||
|
||||
surfaces.forEach((surface, index) => {
|
||||
if (index !== 0) {
|
||||
if (surface.pcses) {
|
||||
pcses.concat(surface.pcses)
|
||||
}
|
||||
}
|
||||
})
|
||||
// surfaces.forEach((surface, index) => {
|
||||
// if (index !== 0) {
|
||||
// if (surface.pcses) {
|
||||
// pcses.concat(surface.pcses)
|
||||
// }
|
||||
// }
|
||||
// })
|
||||
|
||||
const allModules = surfaces.map((surface) => surface.modules).flat()
|
||||
// 모듈 파라미터 생성
|
||||
|
||||
@ -64,9 +64,10 @@ export function useEstimate() {
|
||||
|
||||
// 캔버스 저장
|
||||
await saveCanvas(false)
|
||||
setIsGlobalLoading(false)
|
||||
|
||||
/* 견적서 저장이 완료되면 견적서 페이지로 이동 */
|
||||
moveEstimate(planNo, objectNo)
|
||||
// moveEstimate(planNo, objectNo)
|
||||
})
|
||||
.catch((error) => {
|
||||
setIsGlobalLoading(false)
|
||||
|
||||
@ -27,3 +27,15 @@ export const contextPopupPositionState = atom({
|
||||
},
|
||||
dangerouslyAllowMutability: true,
|
||||
})
|
||||
|
||||
/** 팝업 스피너 상태 */
|
||||
export const popSpinnerState = atom({
|
||||
key: 'popSpinnerStore',
|
||||
default: false,
|
||||
})
|
||||
|
||||
/** 프로미스 팝업 상태 - 테스트용(삭제 예정) */
|
||||
export const promisePopupState = atom({
|
||||
key: 'promisePopupStore',
|
||||
default: false,
|
||||
})
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user