From bdd7de6fff9d6fc2e3f914ec17098707dbe84a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Wed, 15 Jan 2025 18:51:53 +0900 Subject: [PATCH 001/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C.=20=EA=B0=80?= =?UTF-8?q?=EB=8C=80=20=EC=84=A4=EC=A0=95=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 120 +++++++++++++----- .../step/PowerConditionalSelect.jsx | 56 ++++++-- .../modal/circuitTrestle/step/StepUp.jsx | 59 ++++++++- .../step/type/PassivityCircuitAllocation.jsx | 39 +++++- src/hooks/common/useMasterController.js | 34 ++++- src/store/circuitTrestleAtom.js | 5 + 6 files changed, 257 insertions(+), 56 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index b14bfa31..41bc9183 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -12,12 +12,15 @@ import { get } from 'react-hook-form' import { correntObjectNoState } from '@/store/settingAtom' import { useRecoilValue } from 'recoil' import { GlobalDataContext } from '@/app/GlobalDataProvider' + import { useRecoilState } from 'recoil' -import { powerConditionalState } from '@/store/circuitTrestleAtom' +import { modelState, pcsCheckState, powerConditionalState } from '@/store/circuitTrestleAtom' import { POLYGON_TYPE } from '@/common/common' import { useSwal } from '@/hooks/useSwal' import { canvasState } from '@/store/canvasAtom' +import { selectedModuleState } from '@/store/selectedModuleOptions' + const ALLOCATION_TYPE = { AUTO: 'auto', PASSIVITY: 'passivity', @@ -29,36 +32,21 @@ export default function CircuitTrestleSetting({ id }) { // 탭 번호 2: 회로 할당 const [tabNum, setTabNum] = useState(1) const [allocationType, setAllocationType] = useState(ALLOCATION_TYPE.AUTO) + + const [makers, setMakers] = useState([]) + const [series, setSeries] = useState([]) + const [model, setModel] = useRecoilState(modelState) + const [selectedModels, setSelectedModels] = useState(model.selectedModels) + const [models, setModels] = useState(model.models) + const [selectedMaker, setSelectedMaker] = useState(null) + const [selectedSeries, setSelectedSeries] = useState(null) + const correntObjectNo = useRecoilValue(correntObjectNoState) + const { getPcsMakerList } = useMasterController() + const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) + const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const canvas = useRecoilValue(canvasState) + const { apply } = useTrestle() const { swalFire } = useSwal() - - const apply = () => { - closePopup(id) - } - - useEffect(() => { - // console.log(canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)) - // if (canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE).length === 0) { - // swalFire({ - // title: '모듈을 배치해주세요.', - // type: 'alert', - // confirmFn: () => { - // closePopup(id) - // }, - // }) - // } - }, []) - - // useEffect(() => { - // console.log('🚀 ~ CircuitTrestleSetting ~ series:', series) - // const selectedSeries = series.filter((s) => s.selectd).map((s) => s.pcsSerCd) - // if (selectedSeries.length > 0) { - // getPcsMakerList(selectedSeries).then((res) => { - // setModels(res.data) - // }) - // } - // }, [series]) - // 회로 할당 유형 const [circuitAllocationType, setCircuitAllocationType] = useState(1) const powerConditionalSelectProps = { @@ -72,6 +60,76 @@ export default function CircuitTrestleSetting({ id }) { setCircuitAllocationType, } + useEffect(() => { + console.log('🚀 ~ CircuitTrestleSetting ~ model:', model) + setSelectedModels(model.selectedModels) + }, [model]) + + const onAutoAllocation = () => { + let moduleStdQty = 0 + let moduleMaxQty = 0 + + if (selectedModels.length === 0) { + moduleStdQty = models.reduce((acc, model) => { + return acc + parseInt(model.moduleStdQty) + }, 0) + + moduleMaxQty = models.reduce((acc, model) => { + return acc + parseInt(model.moduleMaxQty) + }, 0) + } else { + moduleStdQty = selectedModels.reduce((acc, model) => { + return acc + parseInt(model.moduleStdQty) + }, 0) + moduleMaxQty = selectedModels.reduce((acc, model) => { + return acc + parseInt(model.moduleMaxQty) + }, 0) + } + const target = pcsCheck.max ? moduleMaxQty : moduleStdQty + const placementModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE) + + if (placementModules.length > target) { + swalFire({ + title: '배치가능 매수를 초과합니다. 파워컨디셔너를 다시 선택해 주세요.', + type: 'alert', + }) + return + } + + setAllocationType(ALLOCATION_TYPE.AUTO) + } + + const onPassivityAllocation = () => { + console.log('🚀 ~ onPassivityAllocation ~ selectedModels:', model) + if (selectedModels.length === 0) { + swalFire({ + title: '파워 컨디셔너를 추가해 주세요.', + type: 'alert', + }) + return + } else if (pcsCheck.max) { + const moduleStdQty = selectedModels.reduce((acc, model) => { + return acc + parseInt(model.moduleStdQty) + }, 0) + const moduleMaxQty = selectedModels.reduce((acc, model) => { + return acc + parseInt(model.moduleMaxQty) + }, 0) + + const target = pcsCheck.max ? moduleMaxQty : moduleStdQty + const placementModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE) + + if (placementModules.length > target) { + swalFire({ + title: '배치가능 매수를 초과합니다. 파워컨디셔너를 다시 선택해 주세요.', + type: 'alert', + }) + return + } + } + + setAllocationType(ALLOCATION_TYPE.PASSIVITY) + } + return (
@@ -94,10 +152,10 @@ export default function CircuitTrestleSetting({ id }) { {tabNum === 2 && } {tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && (
- -
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx index 420a2e35..a58abfc3 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx @@ -3,7 +3,8 @@ import QSelectBox from '@/components/common/select/QSelectBox' import { useMasterController } from '@/hooks/common/useMasterController' import { useEvent } from '@/hooks/useEvent' import { useMessage } from '@/hooks/useMessage' -import { makerState, modelState, seriesState } from '@/store/circuitTrestleAtom' +import { useSwal } from '@/hooks/useSwal' +import { makerState, modelState, pcsCheckState, seriesState } from '@/store/circuitTrestleAtom' import { globalLocaleStore } from '@/store/localeAtom' import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' import { useContext, useEffect, useState } from 'react' @@ -11,8 +12,6 @@ import { useRecoilState } from 'recoil' import { useRecoilValue } from 'recoil' import { v4 as uuidv4 } from 'uuid' -const SelectOption01 = [{ name: '0' }, { name: '0' }, { name: '0' }, { name: '0' }] - export default function PowerConditionalSelect(props) { let { tabNum, setTabNum } = props const [makerData, setMakerData] = useRecoilState(makerState) @@ -21,15 +20,17 @@ export default function PowerConditionalSelect(props) { const [series, setSeries] = useRecoilState(seriesState) const [seriesList, setSeriesList] = useState(series.series) const [selectedSeries, setSelectedSeries] = useState(series.selectedSeries) - const model = useRecoilValue(modelState) + const [model, setModel] = useRecoilState(modelState) const [models, setModels] = useState(model.models) const [selectedModels, setSelectedModels] = useState(model.selectedModels) + const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const { getMessage } = useMessage() const [selectedRow, setSelectedRow] = useState(null) const globalLocale = useRecoilValue(globalLocaleStore) const { getPcsMakerList, getPcsModelList } = useMasterController() const selectedModules = useRecoilValue(selectedModuleState) + const { swalFire } = useSwal() const modelHeader = [ { name: getMessage('명칭'), width: '15%', prop: 'itemNm', type: 'color-box' }, { @@ -60,20 +61,26 @@ export default function PowerConditionalSelect(props) { setMakers(res.data) }) } + console.log('🚀 ~ useEffect ~ selectedModules:', selectedModules) if (!managementState) { - console.log('🚀 ~ useEffect ~ managementState:', managementState) setManagementState(managementStateLoaded) } // promiseGet({ url: `/api/object/${correntObjectNo}/detail` }).then((res) => { // console.log('🚀 ~ useEffect ~ /api/object/${correntObjectNo}/detail:', res) // // coldRegionFlg-한랭지사양, conType// 계약조건(잉여~,전량) // }) + return () => { + setMakerData({ makers, selectedMaker }) + setSeries({ series: seriesList, selectedSeries }) + setModel({ models, selectedModels }) + } }, []) useEffect(() => { console.log('🚀 ~ PowerConditionalSelect ~ selectedMaker:', selectedMaker) if (selectedMaker) { setSelectedModels([]) + setModels([]) getPcsMakerList(selectedMaker).then((res) => { setSeriesList( res.data.map((series) => { @@ -85,7 +92,6 @@ export default function PowerConditionalSelect(props) { }, [selectedMaker]) useEffect(() => { - console.log('🚀 ~ useEffect ~ seriesList:', seriesList) if (seriesList.filter((series) => series.selected).length === 0) return const pcsMkrCd = seriesList.filter((series) => series.selected)[0]?.pcsMkrCd const pcsSerList = seriesList @@ -99,7 +105,6 @@ export default function PowerConditionalSelect(props) { mixMatlNo: module.mixMatlNo, } }) - console.log('🚀 ~ useEffect ~ moduleItemList:', selectedModules) getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList }).then((res) => { if (res?.result.code === 200) { console.log('🚀 ~ useEffect ~ res:', res.data) @@ -107,6 +112,8 @@ export default function PowerConditionalSelect(props) { res.data.map((model) => { return { ...model, + moduleStdQty: parseInt(model.moduleStdQty), + moduleMaxQty: parseInt(model.moduleMaxQty), code: uuidv4(), selected: false, } @@ -116,26 +123,49 @@ export default function PowerConditionalSelect(props) { }) }, [seriesList]) + useEffect(() => { + console.log('🚀 ~ useEffect ~ models:', models) + }, [models]) + + useEffect(() => { + console.log('🚀 ~ useEffect ~ pcsCheck:', pcsCheck) + }, [pcsCheck]) + const onCheckSeries = (series) => { setSeriesList((prev) => prev.map((s) => ({ ...s, selected: s.pcsSerCd === series.pcsSerCd ? !s.selected : s.selected }))) } const onAddSelectedModel = () => { + if (selectedRow === null) return + if (selectedModels.length === 3) { + swalFire({ + title: '최대 3개까지 선택할 수 있습니다.', + icon: 'warning', + }) + + return + } setSelectedModels([...selectedModels, selectedRow]) setSelectedRow(null) } + const onRemoveSelectedModel = (model) => { + setSelectedModels(selectedModels.filter((m) => m.code !== model.code)) + } + useEffect(() => { - const selectedModelsIds = selectedModels.map((model) => model.itemId) + console.log('🚀 ~ useEffect ~ selectedModels:', selectedModels) + const selectedModelsIds = selectedModels.map((model) => model.code) setModels( models.map((model) => { return { ...model, - selected: selectedModelsIds.includes(model.itemId) === selectedRow.itemId ? true : false, + selected: selectedModelsIds.includes(model.code), } }), ) + setModel({ ...model, selectedModels: selectedModels }) }, [selectedModels]) return ( <> @@ -154,7 +184,7 @@ export default function PowerConditionalSelect(props) { onChange={(option) => setSelectedMaker(option)} />
- {managementState?.conType === '1' && ( + {managementState?.coldRegionFlg === '1' && ( {getMessage('modal.circuit.trestle.setting.power.conditional.select.cold.region')} )} @@ -206,7 +236,7 @@ export default function PowerConditionalSelect(props) {
{selectedModels?.map((model) => ( - {model.itemNm} + {model.itemNm} ))}
@@ -214,11 +244,11 @@ export default function PowerConditionalSelect(props) {
- + setPcsCheck({ ...pcsCheck, division: !pcsCheck.division })} />
- + setPcsCheck({ ...pcsCheck, max: !pcsCheck.max })} /> diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 287d9ff8..27efaae7 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -1,6 +1,11 @@ +import { GlobalDataContext } from '@/app/GlobalDataProvider' import QSelectBox from '@/components/common/select/QSelectBox' import { useMessage } from '@/hooks/useMessage' -import { useState } from 'react' +import { canvasState } from '@/store/canvasAtom' +import { modelState, pcsCheckState } from '@/store/circuitTrestleAtom' +import { selectedModuleState } from '@/store/selectedModuleOptions' +import { useContext, useState } from 'react' +import { useRecoilState } from 'recoil' const SelectOption01 = [{ name: '0' }, { name: '0' }, { name: '0' }, { name: '0' }] @@ -8,6 +13,58 @@ export default function StepUp({}) { const { getMessage } = useMessage() const [moduleTab, setModuleTab] = useState(1) const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수 + const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) + const model = useRecoilValue(modelState) + const { getPcsAutoRecommendList } = useMasterController() + const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) + const canvas = useRecoilValue(canvasState) + const selectedModules = useRecoilValue(selectedModuleState) + useEffect(() => { + if (!managementState) { + console.log('🚀 ~ useEffect ~ managementState:', managementState) + setManagementState(managementStateLoaded) + } + + const useModuleItemList = model.selectedModels.map((model) => { + return { itemId: model.itemId, mixMatlNo: model.mixMatlNo } + }) + // [{ roofSurfaceId: '', roofSurface: '', roofSurfaceIncl: '', moduleList: [{ itemId: '' }] }], + const roofSurfaceList = canvas + .getObjects() + .filter((obj) => ['roofSurface', 'moduleSetupSurface'].includes(obj.name)) + .map((obj) => { + return { + roofSurfaceId: obj.id, + roofSurface: obj.name, + roofSurfaceIncl: obj.angle, + moduleList: selectedModules.itemList?.map((module) => { + return { + itemId: module.itemId, + mixMatlNo: module.mixMatlNo, + } + }), + } + }) + // [{ itemId: '', pcsMkrCd: '', pcsSerCd: '' }], + const pscItemList = model.selectedModels.map((model) => { + return { + itemId: model.itemId, + pcsMkrCd: model.pcsMkrCd, + pcsSerCd: model.pcsSerCd, + } + }) + + const params = { + maxConnYn: pcsCheck.max, + smpCirYn: pcsCheck.division, + coldZoneYn: managementState.coldRegionFlg, + useModuleItemList: useModuleItemList, + roofSurfaceList: roofSurfaceList, + pscItemList: pscItemList, + } + getPcsAutoRecommendList(params) + }, []) + return ( <>
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index 7c01cd6c..5ace632a 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -1,15 +1,22 @@ import { useMessage } from '@/hooks/useMessage' +import { modelState } from '@/store/circuitTrestleAtom' +import { selectedModuleState } from '@/store/selectedModuleOptions' +import { useEffect, useState } from 'react' +import { useRecoilValue } from 'recoil' export default function PassivityCircuitAllocation() { const { getMessage } = useMessage() + const selectedModules = useRecoilValue(selectedModuleState) const moduleData = { header: [ { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'roofShape' }, - { name: getMessage('modal.circuit.trestle.setting.circuit'), prop: 'circuit' }, - { - name: getMessage('Q.TRON M-G2'), - prop: 'moduleName', - }, + { name: getMessage('modal.circuit.trestle.setting.circuilt'), prop: 'circuit' }, + ...selectedModules.itemList.map((module) => { + return { + name: module.itemNm, + prop: 'moduleName', + } + }), { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'powerGeneration', @@ -30,6 +37,12 @@ export default function PassivityCircuitAllocation() { }, ], } + const model = useRecoilValue(modelState) + const [selectedModels, setSelectedModels] = useState(model.selectedModels) + const [selectedPcs, setSelectedPcs] = useState(selectedModels[0]) + useEffect(() => { + console.log('🚀 ~ useEffect ~ selectedPcs:', selectedPcs) + }, [selectedPcs]) return ( <>
@@ -69,7 +82,19 @@ export default function PassivityCircuitAllocation() {
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional')}
-
+ {selectedModels.map((model, index) => ( +
+ setSelectedPcs(model)} + /> + +
+ ))} + {/*
@@ -80,7 +105,7 @@ export default function PassivityCircuitAllocation() {
-
+
*/}
diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index f6dacdff..0e90fcdb 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -4,6 +4,8 @@ import { useSwal } from '@/hooks/useSwal' import { getQueryString } from '@/util/common-utils' import { trestleRequest, constructionRequest, trestleDetailRequest } from '@/models/apiModels' import { POST } from '@/app/api/image-upload/route' +import { canvasState } from '@/store/canvasAtom' +import { useRecoilValue } from 'recoil' /** * 마스터 컨트롤러 훅 @@ -130,21 +132,44 @@ export function useMasterController() { } /** - * PCS 메이커, 시리즈 목록 조회 - * @param {PCS 메이커코드} pcsMkrCd - * @param {혼합모듈번호} mixMatlNo + * 모듈 타입별 아이템 목록 조회 + * @param {PCS 메이커코드} pcsMkrCd + * @param {PCS시리즈코드 목록} pcsSerList + * @param {모듈아이템 ID 목록} moduleItemList * @returns */ const getPcsModelList = async (params = null) => { const test = { pcsMkrCd: 'MKR003', pcsSerList: [{ pcsSerCd: 'SER007' }, { pcsSerCd: 'SER009' }, { pcsSerCd: 'SER010' }], - moduleItemList: [{ itemId: '107015', mixMatlNo: '' }, { itemId: '107077' }, { itemId: '107015' }], + moduleItemList: [ + { itemId: '107015', mixMatlNo: null }, + { itemId: '107077', mixMatlNo: null }, + { itemId: '107015', mixMatlNo: null }, + ], } + return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: test }).then((res) => { return res }) } + /** + * 시리즈중 자동으로 추천 PCS 정보 조회 + * @param {Max접속(과적)여부} maxConnYn + * @param {동일회로도여부} smpCirYn + * @param {한랭지여부} coldZoneYn + * @param {사용된 모듈 아이템 List} useModuleItemList + * @param {지붕면별 목록} roofSurfaceList + * @param {PCS 제품 목록} pcsItemList + * @returns + */ + const getPcsAutoRecommendList = async (params = null) => { + const paramString = getQueryString(params) + return await post({ url: '/api/master/pcsAutoRecommendList', data: params }).then((res) => { + console.log('🚀🚀 ~ getPcsAutoRecommendList ~ res:', res) + return res + }) + } return { getRoofMaterialList, @@ -154,5 +179,6 @@ export function useMasterController() { getTrestleDetailList, getPcsMakerList, getPcsModelList, + getPcsAutoRecommendList, } } diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index bac7ee7a..3fbb0b3e 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -15,3 +15,8 @@ export const modelState = atom({ key: 'modelState', default: { models: [], selectedModels: [] }, }) + +export const pcsCheckState = atom({ + key: 'divisionCircuitState', + default: { division: true, max: false }, +}) From 63387325c308fff4db1d4553f8627fe026b12a54 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 16 Jan 2025 16:42:33 +0900 Subject: [PATCH 002/130] =?UTF-8?q?customProperties=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/common.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/common/common.js b/src/common/common.js index 903f6fd7..71a075db 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -170,6 +170,9 @@ export const SAVE_KEY = [ 'supFitIntvlPct', 'rackLen', 'trestleDetail', + 'turfPoints', + 'tempIndex', + 'surfaceId', ] export const OBJECT_PROTOTYPE = [fabric.Line.prototype, fabric.Polygon.prototype, fabric.Triangle.prototype] From d648e11996c391e2979b99e68bdf48923bd53a73 Mon Sep 17 00:00:00 2001 From: lelalela Date: Thu, 16 Jan 2025 16:49:40 +0900 Subject: [PATCH 003/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Module.jsx | 16 +++++++--- .../modal/basic/step/ModuleTabContents.jsx | 4 ++- .../floor-plan/modal/basic/step/Placement.jsx | 32 +++++++++++-------- src/hooks/module/useModuleBasicSetting.js | 19 +++++------ src/hooks/module/useModulePlace.js | 4 --- src/store/selectedModuleOptions.js | 6 ++++ 6 files changed, 50 insertions(+), 31 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 78189124..06bf2b8f 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -1,13 +1,13 @@ import { useEffect, useState, useReducer } from 'react' import { useRecoilValue, useRecoilState } from 'recoil' import { addedRoofsState } from '@/store/settingAtom' -import { canvasSettingState, pitchSelector } from '@/store/canvasAtom' +import { canvasSettingState, currentCanvasPlanState, pitchSelector } from '@/store/canvasAtom' import { useMessage } from '@/hooks/useMessage' import QSelectBox from '@/components/common/select/QSelectBox' import { useModuleSelection } from '@/hooks/module/useModuleSelection' import ModuleTabContents from './ModuleTabContents' import { useDebounceCallback, useDebounceValue } from 'usehooks-ts' -import { moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { moduleSelectionDataPlanListState, moduleSelectionDataState } from '@/store/selectedModuleOptions' export default function Module({ setTabNum }) { const { getMessage } = useMessage() @@ -38,6 +38,9 @@ export default function Module({ setTabNum }) { const [debouncedVerticalSnowCover] = useDebounceValue(inputVerticalSnowCover, 500) const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터 + const [moduleSelectionDataPlanList, setModuleSelectionDataPlanList] = useRecoilState(moduleSelectionDataPlanListState) + + const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState) const [tempModuleSelectionData, setTempModuleSelectionData] = useReducer((prevState, nextState) => { return { ...prevState, ...nextState } @@ -69,11 +72,15 @@ export default function Module({ setTabNum }) { rows: [], } + useEffect(() => { + console.log('currentCanvasPlan', currentCanvasPlan) + }, []) + useEffect(() => {}, [roofTab]) useEffect(() => { - console.log('moduleSelectionData', moduleSelectionData) - }, []) + setModuleSelectionDataPlanList({ ...moduleSelectionDataPlanList, [currentCanvasPlan.id]: moduleSelectionData }) + }, [moduleSelectionData]) const handleRoofTab = (tab) => { setRoofTab(tab) @@ -239,6 +246,7 @@ export default function Module({ setTabNum }) { setModuleSelectionData={setModuleSelectionData} tempModuleSelectionData={tempModuleSelectionData} setTempModuleSelectionData={setTempModuleSelectionData} + selectedModule={selectedModules} />
))} diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 7fcbc0bb..3fee925e 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -15,6 +15,7 @@ export default function ModuleTabContents({ setModuleSelectionData, tempModuleSelectionData, setTempModuleSelectionData, + selectedModule, }) { const { getMessage } = useMessage() const [roofMaterial, setRoofMaterial] = useState(addRoof) //지붕재` @@ -242,6 +243,7 @@ export default function ModuleTabContents({ setConstructionList([]) if (isObjectNotEmpty(moduleConstructionSelectionData)) { + //기존에 데이터가 있으면 setConstructionParams({ ...moduleConstructionSelectionData.trestle, constMthdCd: '', roofBaseCd: '' }) setRoofBaseParams({ ...moduleConstructionSelectionData.trestle, roofBaseCd: '' }) setCvrChecked(moduleConstructionSelectionData.construction.setupCover) @@ -251,7 +253,7 @@ export default function ModuleTabContents({ } } - setTempModuleSelectionData({ common: moduleSelectionInitParams }) + setTempModuleSelectionData({ common: moduleSelectionInitParams, module: selectedModule }) }, [moduleSelectionInitParams]) useEffect(() => { diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index 8e48a42c..d400881a 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -8,7 +8,9 @@ import { useModulePlace } from '@/hooks/module/useModulePlace' const Placement = forwardRef((props, refs) => { const { getMessage } = useMessage() - const [isChidori, setIsChidori] = useState('false') + const [isChidori, setIsChidori] = useState(false) + const [isChidoriNotAble, setIsChidoriNotAble] = useState(false) + const [setupLocation, setSetupLocation] = useState('center') const [isMaxSetup, setIsMaxSetup] = useState('false') const [selectedItems, setSelectedItems] = useState({}) @@ -21,9 +23,13 @@ const Placement = forwardRef((props, refs) => { //모듈 배치면 생성 useEffect(() => { - console.log('🚀 ~ Placement ~ moduleSelectionData:', moduleSelectionData) - console.log('🚀 ~ Placement ~ selectedModules:', selectedModules) makeModuleInstArea() + + //1개라도 치도리 불가가 있으면 치도리 불가 + const isChidroriValue = moduleSelectionData.roofConstructions.some((item) => item.construction.plvrYn === 'N') + if (isChidroriValue) { + setIsChidoriNotAble(true) + } }, []) //체크된 모듈 데이터 @@ -127,19 +133,19 @@ const Placement = forwardRef((props, refs) => {
- +
- +
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index eff37226..965a1045 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -479,7 +479,8 @@ export function useModuleBasicSetting() { //안겹치면 넣는다 // tempModule.setCoords() moduleOptions.surfaceId = trestlePolygon.id - let manualModule = new QPolygon(tempModule.points, { ...moduleOptions }) + + let manualModule = new QPolygon(tempModule.points, { ...moduleOptions, moduleInfo: checkedModule[0] }) canvas?.add(manualModule) manualDrawModules.push(manualModule) } else { @@ -747,7 +748,7 @@ export function useModuleBasicSetting() { leftMargin = i === 0 ? 0 : intvHor * i chidoriLength = 0 if (isChidori) { - chidoriLength = j % 2 === 0 ? 0 : width / 2 + chidoriLength = j % 2 === 0 ? 0 : width / 2 - intvHor } square = [ @@ -762,7 +763,7 @@ export function useModuleBasicSetting() { let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1) let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] })) - moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id } + moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module } let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon }) let disjointFromTrestle = checkModuleDisjointSurface(squarePolygon, polygonToTurfPolygon(moduleSetupSurface, true)) @@ -848,7 +849,7 @@ export function useModuleBasicSetting() { leftMargin = j === 0 ? 0 : intvVer * j chidoriLength = 0 if (isChidori) { - chidoriLength = i % 2 === 0 ? 0 : height / 2 + chidoriLength = i % 2 === 0 ? 0 : height / 2 - intvHor } square = [ @@ -864,7 +865,7 @@ export function useModuleBasicSetting() { let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] })) // if (disjointFromTrestle && isDisjoint) { - moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id } + moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module } let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon }) let disjointFromTrestle = checkModuleDisjointSurface(squarePolygon, polygonToTurfPolygon(moduleSetupSurface, true)) let isDisjoint = checkModuleDisjointObjects(squarePolygon, containsBatchObjects) @@ -959,7 +960,7 @@ export function useModuleBasicSetting() { leftMargin = i === 0 ? 0 : intvHor * i chidoriLength = 0 if (isChidori) { - chidoriLength = j % 2 === 0 ? 0 : width / 2 + chidoriLength = j % 2 === 0 ? 0 : width / 2 - intvHor } square = [ @@ -975,7 +976,7 @@ export function useModuleBasicSetting() { let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] })) // if (disjointFromTrestle && isDisjoint) { - moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id } + moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module } let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon }) let disjointFromTrestle = checkModuleDisjointSurface(squarePolygon, polygonToTurfPolygon(moduleSetupSurface, true)) @@ -1059,7 +1060,7 @@ export function useModuleBasicSetting() { chidoriLength = 0 if (isChidori) { - chidoriLength = i % 2 === 0 ? 0 : height / 2 + chidoriLength = i % 2 === 0 ? 0 : height / 2 - intvHor } square = [ @@ -1075,7 +1076,7 @@ export function useModuleBasicSetting() { let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] })) // if (disjointFromTrestle && isDisjoint) { - moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id } + moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module } let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon }) let disjointFromTrestle = checkModuleDisjointSurface(squarePolygon, polygonToTurfPolygon(moduleSetupSurface, true)) let isDisjoint = checkModuleDisjointObjects(squarePolygon, containsBatchObjects) diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index 856c7abb..d46f789f 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -12,10 +12,6 @@ export function useModulePlace() { const selectedModules = useRecoilValue(selectedModuleState) const { getTrestleDetailList } = useMasterController() - useEffect(() => { - console.log('🚀 ~ useModulePlace ~ moduleSelectionData:', moduleSelectionData) - }, []) - useEffect(() => { const common = moduleSelectionData.common const roofConstructions = moduleSelectionData.roofConstructions diff --git a/src/store/selectedModuleOptions.js b/src/store/selectedModuleOptions.js index faa979fd..b09c9294 100644 --- a/src/store/selectedModuleOptions.js +++ b/src/store/selectedModuleOptions.js @@ -85,3 +85,9 @@ export const moduleSelectionDataState = atom({ }, dangerouslyAllowMutability: true, }) + +export const moduleSelectionDataPlanListState = atom({ + key: 'moduleSelectionDataPlanListState', + default: {}, + dangerouslyAllowMutability: true, +}) From 67a0dae2e2b7ac09915cdb3742066a143af4da43 Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 16 Jan 2025 16:55:54 +0900 Subject: [PATCH 004/130] =?UTF-8?q?swalFire=20confirm=20=EC=B0=BD=20?= =?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EC=9E=85=EB=A0=A5=EB=B0=9B=EC=9D=84=20?= =?UTF-8?q?=EC=88=98=20=EC=9E=88=EB=8F=84=EB=A1=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 8 +-- src/hooks/usePlan.js | 74 ++++++++++++++---------- src/hooks/useSwal.js | 20 +++++-- src/locales/ja.json | 4 +- src/locales/ko.json | 6 +- 5 files changed, 69 insertions(+), 43 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 3b3e0003..6d33d474 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -203,9 +203,7 @@ export default function CanvasMenu(props) { setCurrentMenu(menu.title) } - if (pathname !== '/floor-plan' && pathname !== '/floor-plan/estimate/5' && pathname !== '/floor-plan/simulator/6') { - router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`) - } + if (pathname !== '/floor-plan') router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`) } const changeSelectedRoofMaterial = (e) => { @@ -368,7 +366,9 @@ export default function CanvasMenu(props) { */ const handleEstimateLockController = (estimateRecoilState) => { swalFire({ - text: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'), + // text: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'), + html: estimateRecoilState.lockFlg === '0' ? getMessage('estimate.detail.lock.alertMsg') : getMessage('estimate.detail.unlock.alertMsg'), + confirmButtonText: estimateRecoilState.lockFlg === '1' ? getMessage('estimate.detail.unlock.confirmBtnName') : '', type: 'confirm', confirmFn: async () => { setIsGlobalLoading(true) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index db170dc7..86b6aee3 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -206,42 +206,52 @@ export function usePlan(params = {}) { const handleCurrentPlan = async (newCurrentId) => { const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering const objectNo = floorPlanState.objectNo - await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` }) - .then((res) => { - if (res.status === 200) { - const estimateDetail = res.data - if (estimateDetail.docNo) { - res.data.resetFlag = 'N' + //견적서 or 발전시뮬 + if (pathname !== '/floor-plan') { + await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` }) + .then((res) => { + if (res.status === 200) { + const estimateDetail = res.data + if (estimateDetail.docNo) { + res.data.resetFlag = 'N' - if (res.data.itemList.length > 0) { - res.data.itemList.map((item) => { - item.delFlg = '0' - }) - } - if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) { - res.data.pkgAsp = '0.00' - } else { - const number = parseFloat(res.data.pkgAsp) - const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2) - - res.data.pkgAsp = roundedNumber.toString() - } - setEstimateContextState(res.data) - - if (pathname === '/floor-plan') { - if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { - saveCanvas() + if (res.data.itemList.length > 0) { + res.data.itemList.map((item) => { + item.delFlg = '0' + }) } + if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) { + res.data.pkgAsp = '0.00' + } else { + const number = parseFloat(res.data.pkgAsp) + const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2) + + res.data.pkgAsp = roundedNumber.toString() + } + setEstimateContextState(res.data) + + if (pathname === '/floor-plan') { + if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { + saveCanvas() + } + } + updateCurrentPlan(newCurrentId) + } else { + swalFire({ text: getMessage('estimate.menu.move.valid1') }) } - updateCurrentPlan(newCurrentId) - } else { - swalFire({ text: getMessage('estimate.menu.move.valid1') }) } - } - }) - .catch((error) => { - swalFire({ text: getMessage('estimate.menu.move.valid1') }) - }) + }) + .catch((error) => { + swalFire({ text: getMessage('estimate.menu.move.valid1') }) + }) + } else { + // if (pathname === '/floor-plan') { + if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { + saveCanvas() + } + // } + updateCurrentPlan(newCurrentId) + } } const updateCurrentPlan = (newCurrentId) => { diff --git a/src/hooks/useSwal.js b/src/hooks/useSwal.js index 018d8f32..f904091d 100644 --- a/src/hooks/useSwal.js +++ b/src/hooks/useSwal.js @@ -1,5 +1,6 @@ import Swal from 'sweetalert2' import withReactContent from 'sweetalert2-react-content' +import { useMessage } from '@/hooks/useMessage' /** * title: 제목 @@ -13,14 +14,25 @@ import withReactContent from 'sweetalert2-react-content' */ export const useSwal = () => { const MySwal = withReactContent(Swal) + const { getMessage } = useMessage() - const swalFire = ({ title = '', text = '', html = '', type = 'alert', icon = '', confirmFn = () => {}, denyFn = () => {} }) => { + const swalFire = ({ + title = '', + text = '', + html = '', + type = 'alert', + icon = '', + confirmButtonText = '', + cancelButtonText = '', + confirmFn = () => {}, + denyFn = () => {}, + }) => { if (type === 'alert') { MySwal.fire({ title, text, icon: icon === '' ? 'success' : icon, - confirmButtonText: '확인', + confirmButtonText: getMessage('common.ok'), }).then(() => { confirmFn() }) @@ -32,8 +44,8 @@ export const useSwal = () => { icon: icon === '' ? 'question' : icon, showCloseButton: true, showCancelButton: true, - confirmButtonText: '확인', - cancelButtonText: '취소', + confirmButtonText: confirmButtonText === '' ? getMessage('common.ok') : confirmButtonText, + cancelButtonText: cancelButtonText === '' ? getMessage('common.cancel') : cancelButtonText, }).then((result) => { if (result.isConfirmed) { confirmFn() diff --git a/src/locales/ja.json b/src/locales/ja.json index a96ff061..900165c5 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -498,6 +498,7 @@ "common.require": "必須", "common.finish": "完了", "common.ok": "確認", + "common.cancel": "キャンセル", "commons.west": "立つ", "commons.east": "ドン", "commons.south": "南", @@ -935,7 +936,8 @@ "estimate.detail.reset.alertMsg": "初期化されました.", "estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?", "estimate.detail.lock.alertMsg": "見積書を[ロック]すると、変更できません。見積もりを編集するには、ロックを解除してください.", - "estimate.detail.unlock.alertMsg": "見積書を修正して保存", + "estimate.detail.unlock.alertMsg": "[ロック解除]すると、見積書を編集できます.\n 解除しますか?", + "estimate.detail.unlock.confirmBtnName": "解放", "estimate.detail.alert.delFile": "添付ファイルを完全に削除するには[保存]ボタンをクリックしてください", "estimate.detail.alert.selectDelItem": "削除する商品を選択してください.", "estimate.menu.move.valid1": "回路を分割していないため、見積もりを呼び出すことはできません.", diff --git a/src/locales/ko.json b/src/locales/ko.json index 2d049d61..c5ba4658 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -507,6 +507,7 @@ "common.require": "필수", "common.finish": "완료", "common.ok": "확인", + "common.cancel": "취소", "commons.west": "서", "commons.east": "동", "commons.south": "남", @@ -943,8 +944,9 @@ "estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.", "estimate.detail.reset.alertMsg": "초기화 되었습니다.", "estimate.detail.reset.confirmMsg": "수기 변경(저장)한 견적 정보가 초기화되고, 최근 저장된 도면정보가 반영됩니다. 정말로 초기화하시겠습니까?", - "estimate.detail.lock.alertMsg": "견적서를 [잠금]하면, 수정할 수 없습니다. 견적서를 수정하려면 잠금해제를 하십시오", - "estimate.detail.unlock.alertMsg": "견적서를 수정하고, 저장하십시오", + "estimate.detail.lock.alertMsg": "견적서를 [잠금]하면, 수정할 수 없습니다.
견적서를 수정하려면 잠금해제를 하십시오.", + "estimate.detail.unlock.alertMsg": "[잠금해제]하면 견적서를 수정할 수 있습니다.
해제하시겠습니까?", + "estimate.detail.unlock.confirmBtnName": "해제", "estimate.detail.alert.delFile": "첨부파일을 완전히 삭제하려면 [저장]버튼을 클릭하십시오.", "estimate.detail.alert.selectDelItem": "삭제할 제품을 선택하세요.", "estimate.menu.move.valid1": "회로를 나누지 않았기 때문에 견적서를 호출할 수 없습니다.", From 1d89b1f35558c12abb28ed97aa11b1cc8ad2f351 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Thu, 16 Jan 2025 17:29:28 +0900 Subject: [PATCH 005/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C.=20=EA=B0=80?= =?UTF-8?q?=EB=8C=80=20=EC=84=A4=EC=A0=95=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 3 +- .../modal/circuitTrestle/step/StepUp.jsx | 15 ++---- .../step/type/PassivityCircuitAllocation.jsx | 53 ++++++++++++++++--- src/locales/ja.json | 2 + src/locales/ko.json | 2 + 5 files changed, 58 insertions(+), 17 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 555ec619..75dba1a3 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -95,7 +95,8 @@ export default function CircuitTrestleSetting({ id }) { return } - setAllocationType(ALLOCATION_TYPE.AUTO) + // setAllocationType(ALLOCATION_TYPE.AUTO) + setTabNum(2) } const onPassivityAllocation = () => { diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 0898de1c..a3f69548 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -4,16 +4,11 @@ import { useMessage } from '@/hooks/useMessage' import { canvasState } from '@/store/canvasAtom' import { modelState, pcsCheckState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' -import { useContext, useState } from 'react' -import { useRecoilState } from 'recoil' -import { useState } from 'react' -import { useRecoilValue } from 'recoil' +import { useContext, useEffect, useState } from 'react' +import { useRecoilState, useRecoilValue } from 'recoil' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' import { canvasPopupStatusStore } from '@/store/canvasPopupStatusAtom' -import { useMessage } from '@/hooks/useMessage' -import QSelectBox from '@/components/common/select/QSelectBox' - -const SelectOption01 = [{ name: '0' }, { name: '0' }, { name: '0' }, { name: '0' }] +import { useMasterController } from '@/hooks/common/useMasterController' export default function StepUp({}) { const { getMessage } = useMessage() @@ -25,6 +20,7 @@ export default function StepUp({}) { const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) + useEffect(() => { if (!managementState) { console.log('🚀 ~ useEffect ~ managementState:', managementState) @@ -71,7 +67,6 @@ export default function StepUp({}) { getPcsAutoRecommendList(params) }, []) - useCanvasPopupStatusController(6) const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore) if (Object.keys(canvasPopupStatusState[6]).length !== 0) { @@ -186,7 +181,7 @@ export default function StepUp({}) { {getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
- +
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index 5ace632a..cd2e4469 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -1,16 +1,27 @@ +import { GlobalDataContext } from '@/app/GlobalDataProvider' import { useMessage } from '@/hooks/useMessage' +import { canvasState } from '@/store/canvasAtom' import { modelState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' -import { useEffect, useState } from 'react' +import { useContext, useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' +const DIRECTION = { + north: '北', + south: '南', + west: '西', + east: '東', +} + export default function PassivityCircuitAllocation() { const { getMessage } = useMessage() + const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) + const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const moduleData = { header: [ { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'roofShape' }, - { name: getMessage('modal.circuit.trestle.setting.circuilt'), prop: 'circuit' }, + { name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' }, ...selectedModules.itemList.map((module) => { return { name: module.itemNm, @@ -40,9 +51,25 @@ export default function PassivityCircuitAllocation() { const model = useRecoilValue(modelState) const [selectedModels, setSelectedModels] = useState(model.selectedModels) const [selectedPcs, setSelectedPcs] = useState(selectedModels[0]) + const [totalWpout, setTotalWpout] = useState(0) + useEffect(() => { - console.log('🚀 ~ useEffect ~ selectedPcs:', selectedPcs) - }, [selectedPcs]) + setSurfaceInfo() + if (!managementState) { + setManagementState(managementStateLoaded) + } + }, []) + + const setSurfaceInfo = () => { + const surfaces = canvas.getObjects().filter((obj) => ['roofSurface', 'moduleSetupSurface'].includes(obj.name)) + const modules = canvas.getObjects().filter((obj) => obj.name === 'module') + surfaces.forEach((surface) => { + surface.moduleList = modules.filter((obj) => obj.surfaceId === surface.id) + }) + // 지붕면 리스트 -> 지붕면에 있는 모듈 리스트 -> 발전량 총합 계산 + // wpOut + console.log('🚀 ~ setSurfaceInfo ~ modules:', surfaces) + } return ( <>
@@ -62,7 +89,7 @@ export default function PassivityCircuitAllocation() { {moduleData.rows.map((row, index) => ( - + {moduleData.header.map((header) => ( {row[header.prop].name} @@ -70,6 +97,13 @@ export default function PassivityCircuitAllocation() { ))} ))} + + 총합 + {Array.from({ length: moduleData.header.length - 2 }).map((_, index) => { + return + })} + {totalWpout.toLocaleString('ko-KR', { maximumFractionDigits: 4 })} +
@@ -91,7 +125,14 @@ export default function PassivityCircuitAllocation() { checked={selectedPcs === model} onChange={() => setSelectedPcs(model)} /> - + ))} {/*
diff --git a/src/locales/ja.json b/src/locales/ja.json index a96ff061..ff6018f6 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -141,9 +141,11 @@ "modal.circuit.trestle.setting.circuit.allocation": "回路割り当て", "modal.circuit.trestle.setting.circuit.allocation.auto": "自動回路割り当て", "modal.circuit.trestle.setting.circuit.allocation.passivity": "手動回路割当", + "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit": "回路", "modal.circuit.trestle.setting.circuit.allocation.passivity.info": "同じ回路のモジュールを選択状態にした後、 [番号確認]ボタンを押すと番号が割り当てられます。", "modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional": "選択したパワーコンディショナー", "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.num": "設定する回路番号 (1~)", + "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.info": "標準回路{0}枚~{1}枚", "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": "番号確定", diff --git a/src/locales/ko.json b/src/locales/ko.json index 2d049d61..d23f1813 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -145,9 +145,11 @@ "modal.circuit.trestle.setting.circuit.allocation": "회로 할당", "modal.circuit.trestle.setting.circuit.allocation.auto": "자동 회로 할당", "modal.circuit.trestle.setting.circuit.allocation.passivity": "수동 회로 할당", + "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit": "회로", "modal.circuit.trestle.setting.circuit.allocation.passivity.info": "동일한 회로의 모듈을 선택 상태로 만든 후 [번호 확정] 버튼을 누르면 번호가 할당됩니다.", "modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional": "선택된 파워컨디셔너", "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.num": "설정할 회로번호(1~)", + "modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.info": "표준회로{0}장~{1}장", "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": "번호 확정", From 7c355d6cc43b0ed537ac53a15ca20496e63e7e5b Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 16 Jan 2025 17:54:56 +0900 Subject: [PATCH 006/130] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=ED=99=94?= =?UTF-8?q?=EB=A9=B4=20=EC=83=81=EB=8B=A8=20=EB=A9=94=EB=89=B4=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EA=B4=80=EB=A0=A8=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 6 +++- src/components/management/StuffDetail.jsx | 1 + src/components/management/StuffSubHeader.jsx | 4 +-- .../management/popup/PlanRequestPop.jsx | 35 ++++--------------- .../management/popup/PlanRequestPopQGrid.jsx | 5 +-- .../estimate/useEstimateController.js | 1 + 6 files changed, 19 insertions(+), 33 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 6d33d474..c5fb9194 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -203,7 +203,11 @@ export default function CanvasMenu(props) { setCurrentMenu(menu.title) } - if (pathname !== '/floor-plan') router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`) + if (pathname !== '/floor-plan') { + if (menu.index !== 0) { + router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`) + } + } } const changeSelectedRoofMaterial = (e) => { diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 15ea41fc..7741b59c 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -304,6 +304,7 @@ export default function StuffDetail() { //mid:5(견적서), /pid:플랜번호 setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo }) setIsGlobalLoading(true) + setMenuNumber(5) router.push(`/floor-plan/estimate/5?pid=${params.data.planNo}&objectNo=${params.data.objectNo}`) }} > diff --git a/src/components/management/StuffSubHeader.jsx b/src/components/management/StuffSubHeader.jsx index 6dc316cb..18bd5969 100644 --- a/src/components/management/StuffSubHeader.jsx +++ b/src/components/management/StuffSubHeader.jsx @@ -40,8 +40,8 @@ export default function StuffSubHeader({ type }) { if (isObjectNotEmpty(managementState)) { if (managementState.createUser === 'T01') { if (session.userId !== 'T01') { - //도면 작성은 이동 할 수 있도록 변경 #457 - // setButtonStyle('none') + //도면 작성은 이동 할 수 있도록 변경 #457 다시 못하도록 변경#474 + setButtonStyle('none') } } } diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index 23a041be..38df870f 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -8,19 +8,12 @@ import SingleDatePicker from '@/components/common/datepicker/SingleDatePicker' import dayjs from 'dayjs' import PlanRequestPopQGrid from './PlanRequestPopQGrid' import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils' -import { useCommonCode } from '@/hooks/common/useCommonCode' -import Select from 'react-select' import QPagination from '@/components/common/pagination/QPagination' export default function PlanRequestPop(props) { const [pageNo, setPageNo] = useState(1) //현재 페이지 번호 const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수 const [totalCount, setTotalCount] = useState(0) //총 갯수 - //공통코드 - const { commonCode, findCommonCode } = useCommonCode() - - // const [planStatCdList, setPlanStatCdList] = useState([]) - const globalLocaleState = useRecoilValue(globalLocaleStore) const [planReqObject, setPlanReqObject] = useState({}) @@ -71,16 +64,6 @@ export default function PlanRequestPop(props) { } } - // 상태 검색조건 변경 - const onSelectionChange = (key) => { - if (isObjectNotEmpty(key)) { - setSchPlanStatCd(key.clCode) - } else { - //X누름 - setSchPlanStatCd('') - } - } - // 조회 const onSubmit = (page, type) => { const params = { @@ -194,7 +177,8 @@ export default function PlanRequestPop(props) { { field: 'title', headerName: getMessage('stuff.planReqPopup.gridHeader.title'), - minWidth: 150, + minWidth: 250, + cellStyle: { textAlign: 'left' }, }, { field: 'address1', @@ -234,13 +218,6 @@ export default function PlanRequestPop(props) { } } - // useEffect(() => { - // const code1 = findCommonCode(115800) //상태 - // if (code1 != null) { - // setPlanStatCdList(code1) - // } - // }, [commonCode]) - useEffect(() => { onSubmit(pageNo, 'S') }, []) @@ -431,9 +408,11 @@ export default function PlanRequestPop(props) {
- -
- +
+ +
+ +
diff --git a/src/components/management/popup/PlanRequestPopQGrid.jsx b/src/components/management/popup/PlanRequestPopQGrid.jsx index f7dbba0f..0e5117e3 100644 --- a/src/components/management/popup/PlanRequestPopQGrid.jsx +++ b/src/components/management/popup/PlanRequestPopQGrid.jsx @@ -22,8 +22,8 @@ export default function PlanRequestPopQGrid(props) { flex: 1, minWidth: 100, sortable: false, - suppressMovable: false, - resizable: false, + suppressMovable: true, + resizable: true, suppressSizeToFit: false, } }, []) @@ -58,6 +58,7 @@ export default function PlanRequestPopQGrid(props) { defaultColDef={defaultColDef} pagination={isPageable} onSelectionChanged={onSelectionChanged} + autoSizeAllColumns={true} overlayNoRowsTemplate={`${getMessage('stuff.grid.noData')}`} /> diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 66b0974c..066393cf 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -80,6 +80,7 @@ export const useEstimateController = (planNo) => { res.data.pkgAsp = roundedNumber.toString() } + setEstimateContextState(res.data) } } From e8078177f4ecf3e5b777f15201ad9199385ccb4e Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 16 Jan 2025 17:57:23 +0900 Subject: [PATCH 007/130] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20objectNo?= =?UTF-8?q?=20,=20=ED=8C=9D=EC=97=85=EC=B0=BD=20=EB=8B=AB=EB=8A=94=20?= =?UTF-8?q?=EC=88=9C=EC=84=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 5ef2c9da..d0512fd7 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -99,7 +99,9 @@ export default function Estimate({}) { const initEstimate = (currPid = currentPid) => { console.log('🚀 ~ initEstimate ~ currPid:', currPid) + closeAll() setMenuNumber(5) + setObjectNo(objectRecoil.floorPlanObjectNo) setPlanNo(currPid) @@ -137,7 +139,6 @@ export default function Estimate({}) { }, [selectedPlan]) useEffect(() => { - closeAll() initEstimate() }, []) @@ -619,7 +620,7 @@ export default function Estimate({}) { updates.partAdd = '0' updates.saleTotPrice = (Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].salePrice.replaceAll(',', '')).toLocaleString() updates.showSaleTotPrice = ( - Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].showSalePrice?.replaceAll(',', '') + Number(amount.replaceAll(',', '')) * estimateContextState.itemList[index].salePrice?.replaceAll(',', '') ).toLocaleString() updateList = estimateContextState.itemList.map((item) => { @@ -681,7 +682,6 @@ export default function Estimate({}) { let updateList = [] let updates = {} get({ url: apiUrl }).then((res) => { - // console.log('아이템디테일::::::::', res) updates.objectNo = objectNo updates.planNo = planNo updates.itemId = res.itemId @@ -706,7 +706,6 @@ export default function Estimate({}) { updates.openFlg = res.openFlg if (estimateContextState.estimateType === 'YJSS') { - // console.log('YJSS:::,', res.pkgMaterialFlg) if (res.pkgMaterialFlg === '0') { updates.showSalePrice = '0' updates.showSaleTotPrice = '0' @@ -721,7 +720,6 @@ export default function Estimate({}) { //104671 let bomList = res.itemBomList - // console.log('updates::', updates) updateList = estimateContextState.itemList.map((item) => { if (item.dispOrder === dispOrder) { if (item?.addFlg) { @@ -729,6 +727,12 @@ export default function Estimate({}) { } else { if (estimateContextState.estimateType === 'YJSS') { return { ...item, ...updates, salePrice: '', saleTotPrice: '' } + //확인 + // if (updates.pkgMaterialFlg === '1') { + // return { ...item, ...updates, showSalePrice: updates.salePrice } + // } else { + // return { ...item, ...updates, salePrice: '', saleTotPrice: '' } + // } } else { return { ...item, ...updates } } @@ -739,7 +743,6 @@ export default function Estimate({}) { return item } }) - //paDispOrder if (bomList) { bomList.map((bomItem, index) => { @@ -879,7 +882,6 @@ export default function Estimate({}) { } const calculateYJSSTotals = (itemList) => { - // console.log(':::itemList::', itemList) itemList.sort((a, b) => a.dispOrder - b.dispOrder) makeUniqueSpecialNoteCd(itemList) itemList.forEach((item) => { @@ -918,7 +920,6 @@ export default function Estimate({}) { } } }) - // console.log('itemList::', itemList) let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0 totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000 @@ -1006,7 +1007,7 @@ export default function Estimate({}) {
{getMessage('estimate.detail.objectNo')}
{/* {objectNo} (Plan No: {estimateContextState.planNo}) */} - {objectNo} (Plan No: {planNo}) + {currentObjectNo} (Plan No: {planNo})
From d73daf10246c84df2c439c668c8faf5af785911b Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Thu, 16 Jan 2025 18:14:52 +0900 Subject: [PATCH 008/130] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EC=84=A4=EC=A0=95=20=EC=84=9C=EA=B9=8C=EB=9E=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../placementShape/PlacementShapeSetting.jsx | 59 ++++++++++--------- src/hooks/option/useCanvasSetting.js | 15 +++-- 2 files changed, 41 insertions(+), 33 deletions(-) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index a9619c2f..66fa021e 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -56,20 +56,25 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set ] // 데이터를 최초 한 번만 조회 - useEffect(() => { - if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return - const raftCodeList = findCommonCode('203800') - setRaftCodes(raftCodeList) - - if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) { - setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet }) - } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) { - setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet }) - } - }, []) + // useEffect(() => { + // if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return + // const raftCodeList = findCommonCode('203800') + // setRaftCodes(raftCodeList) + // console.log('🚀 ~ useEffect ~ >>>>>>>>>>>>> raftCodeList 11 :', raftCodeList) + + + // if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) { + // setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet }) + // } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) { + // setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet }) + // } + // }, []) useEffect(() => { if (addedRoofs.length > 0) { + const raftCodeList = findCommonCode('203800') + setRaftCodes(raftCodeList) + setCurrentRoof({ ...addedRoofs[0] }) } }, [addedRoofs]) @@ -155,20 +160,20 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set ...roofInfo, }, //roofs: addedRoofs, - roofsData: { - roofApply: true, - roofSeq: 0, - roofMatlCd: currentRoof.roofMatlCd, - roofWidth: currentRoof.width, - roofHeight: currentRoof.length, - roofHajebichi: currentRoof.hajebichi, - roofGap: currentRoof.raft, - roofLayout: currentRoof.layout, - roofSizeSet: currentRoof.roofSizeSet, - roofAngleSet: currentRoof.roofAngleSet, - roofPitch: currentRoof.pitch, - roofAngle: currentRoof.angle, - }, + // roofsData: { + // roofApply: true, + // roofSeq: 0, + // roofMatlCd: currentRoof.roofMatlCd, + // roofWidth: currentRoof.width, + // roofHeight: currentRoof.length, + // roofHajebichi: currentRoof.hajebichi, + // roofGap: currentRoof.raft, + // roofLayout: currentRoof.layout, + // roofSizeSet: currentRoof.roofSizeSet, + // roofAngleSet: currentRoof.roofAngleSet, + // roofPitch: currentRoof.pitch, + // roofAngle: currentRoof.angle, + // }, }) basicSettingSave() @@ -338,13 +343,13 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set {currentRoof && ['C', 'R'].includes(currentRoof.raftAuth) && (
{getMessage('modal.placement.initial.setting.rafter')} - {raftCodes.length > 0 && ( + {raftCodes?.length > 0 && (
r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)).clCodeNm + raftCodes?.find((r) => r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)).clCodeNm } value={currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft} onChange={(e) => handleRafterChange(e.clCode)} diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 951d9801..ed9dec8c 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -48,7 +48,7 @@ const defaultDotLineGridSetting = { LINE: false, } -let previousRoofMaterialsYn = 'N' // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행 +//let previousRoofMaterialsYn = 'N' // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행 export function useCanvasSetting() { const canvas = useRecoilValue(canvasState) @@ -159,21 +159,23 @@ export function useCanvasSetting() { setBasicSettings({ ...basicSetting, selectedRoofMaterial: selectedRoofMaterial }) } + const previousObjectNoRef = useRef(null) const previousRoofMaterialsRef = useRef(null) useEffect(() => { // 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음 - if (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) { - // 지붕재 select 정보 비교 후 변경된 것이 없으면 1회만 실행 - if (roofMaterials && previousRoofMaterialsYn === 'N') { + if (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo + || roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) { + + if (roofMaterials) { fetchBasicSettings() - previousRoofMaterialsYn = 'Y' } // 이전 값을 업데이트 + previousObjectNoRef.current = correntObjectNo previousRoofMaterialsRef.current = roofMaterials } - }, [roofMaterials]) + }, [roofMaterials, correntObjectNo]) useEffect(() => { if (!canvas) { @@ -328,6 +330,7 @@ export function useCanvasSetting() { roofGap: 'HEI_455', roofLayout: 'P', roofPitch: 4, + roofAngle: 21.8, }, ] } From 7db2553074b0f8a6dcca379a96c4b112d367d9b2 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 00:08:32 +0900 Subject: [PATCH 009/130] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=ED=9B=84=20=EC=95=84=EC=9D=B4=ED=85=9C=20=EC=B2=B4?= =?UTF-8?q?=ED=81=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 156 +++++++++++++++--- .../estimate/useEstimateController.js | 4 +- 2 files changed, 134 insertions(+), 26 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index d0512fd7..0dc86adb 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -950,30 +950,138 @@ export default function Estimate({}) { setItemChangeYn(false) } else { - estimateContextState.itemList.forEach((item) => { - if (estimateContextState.estimateType === 'YJSS' && !item.paDispOrder && item.pkgMaterialFlg === '0') { - item.showSalePrice = '0' - item.showSaleTotPrice = '0' - } - if (estimateContextState.estimateType === 'YJSS' && item.openFlg === '1') { - item.showSalePrice = '0' - item.showSaleTotPrice = '0' - } - if (estimateContextState.estimateType === 'YJSS' && item.paDispOrder) { - item.showSalePrice = '0' - item.showSaleTotPrice = '0' - } - }) - estimateContextState.itemList.forEach((item) => { - if (estimateContextState.estimateType === 'YJOD' && item.openFlg === '1') { - item.showSalePrice = '0' - item.showSaleTotPrice = '0' - } - if (estimateContextState.estimateType === 'YJOD' && item.paDispOrder) { - item.showSalePrice = '0' - item.showSaleTotPrice = '0' - } - }) + let totals = { + totAmount: 0, + totVolKw: 0, + supplyPrice: 0, + vatPrice: 0, + totPrice: 0, + addSupplyPrice: 0, + pkgTotPrice: 0, + } + estimateContextState.itemList.sort((a, b) => a.dispOrder - b.dispOrder) + makeUniqueSpecialNoteCd(estimateContextState.itemList) + + if (estimateContextState.estimateType === 'YJSS') { + estimateContextState.itemList.forEach((item) => { + if (estimateContextState.estimateType === 'YJSS' && !item.paDispOrder && item.pkgMaterialFlg === '0') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + if (estimateContextState.estimateType === 'YJSS' && item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + if (estimateContextState.estimateType === 'YJSS' && item.paDispOrder) { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + }) + + estimateContextState.itemList.forEach((item) => { + if (item.delFlg === '0') { + let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 + let salePrice + if (item.moduleFlg === '1') { + const volKw = (item.pnowW * amount) / 1000 + totals.totVolKw += volKw + } + if (amount === 0) { + salePrice = 0 + } else { + salePrice = Number(item.salePrice?.replaceAll(',', '')) || 0 + } + + totals.totAmount += amount + if (item.pkgMaterialFlg === '1') { + const saleTotPrice = amount * salePrice + totals.addSupplyPrice += saleTotPrice + } + + if (!item.paDispOrder) { + if (item.pkgMaterialFlg === '0') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + } else { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + + if (item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + } + }) + let pkgAsp = estimateContextState.pkgAsp ? Number(estimateContextState.pkgAsp.replaceAll(',', '')) : 0 + + totals.pkgTotPrice = pkgAsp * totals.totVolKw * 1000 + totals.supplyPrice = totals.addSupplyPrice + totals.pkgTotPrice + totals.vatPrice = totals.supplyPrice * 0.1 + totals.totPrice = totals.supplyPrice + totals.vatPrice + + setEstimateContextState({ + pkgTotPrice: totals.pkgTotPrice, + totAmount: totals.totAmount, + totVolKw: totals.totVolKw.toFixed(2), + supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림 + vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림 + totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림 + }) + } else { + estimateContextState.itemList.forEach((item) => { + if (estimateContextState.estimateType === 'YJOD' && item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + if (estimateContextState.estimateType === 'YJOD' && item.paDispOrder) { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + }) + + estimateContextState.itemList.forEach((item) => { + delete item.showSalePrice + delete item.showSaleTotPrice + if (item.delFlg === '0') { + let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', '')) || 0 + let price + if (amount === 0) { + price = 0 + } else { + price = Number(item.saleTotPrice?.replaceAll(',', '')) || 0 + } + + if (item.moduleFlg === '1') { + const volKw = (item.pnowW * amount) / 1000 + totals.totVolKw += volKw + } + totals.supplyPrice += price + totals.totAmount += amount + + if (item.paDispOrder) { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + if (item.openFlg === '1') { + item.showSalePrice = '0' + item.showSaleTotPrice = '0' + } + } + }) + + totals.vatPrice = totals.supplyPrice * 0.1 + totals.totPrice = totals.supplyPrice + totals.vatPrice + + setEstimateContextState({ + totAmount: totals.totAmount, + totVolKw: totals.totVolKw.toFixed(2), + supplyPrice: totals.supplyPrice.toFixed(0), //소수첫자리에서 반올림 + vatPrice: totals.vatPrice.toFixed(0), //소수첫자리에서 반올림 + totPrice: totals.totPrice.toFixed(0), //소수첫자리에서 반올림 + }) + } } }, [itemChangeYn, estimateContextState.itemList]) diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js index 066393cf..ebd1ad88 100644 --- a/src/hooks/floorPlan/estimate/useEstimateController.js +++ b/src/hooks/floorPlan/estimate/useEstimateController.js @@ -385,7 +385,7 @@ export const useEstimateController = (planNo) => { if (res.status === 201) { estimateData.newFileList = [] swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' }) - fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo) + fetchSetting(estimateData.objectNo, estimateData.planNo) } }) } catch (e) { @@ -410,7 +410,7 @@ export const useEstimateController = (planNo) => { const params = { saleStoreId: session.storeId, sapSalesStoreCd: session.custCd, - objectNo: objectRecoil.floorPlanObjectNo, + objectNo: estimateData.objectNo, planNo: sendPlanNo, copySaleStoreId: otherSaleStoreId ? otherSaleStoreId : saleStoreId, copyReceiveUser: copyReceiveUser, From d862ab359e6b17dac9569f4947531c1f860ec7b1 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 00:30:15 +0900 Subject: [PATCH 010/130] =?UTF-8?q?=20=EA=B2=AC=EC=A0=81=EC=84=9C=20?= =?UTF-8?q?=EC=95=84=EC=9D=B4=ED=85=9C=20=EA=B4=80=EB=A0=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 0dc86adb..39766b12 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -726,13 +726,13 @@ export default function Estimate({}) { return { ...item, ...updates, saleTotPrice: '' } } else { if (estimateContextState.estimateType === 'YJSS') { - return { ...item, ...updates, salePrice: '', saleTotPrice: '' } + // return { ...item, ...updates, salePrice: '', saleTotPrice: '' } //확인 - // if (updates.pkgMaterialFlg === '1') { - // return { ...item, ...updates, showSalePrice: updates.salePrice } - // } else { - // return { ...item, ...updates, salePrice: '', saleTotPrice: '' } - // } + if (updates.pkgMaterialFlg === '1') { + return { ...item, ...updates, showSalePrice: updates.salePrice } + } else { + return { ...item, ...updates, salePrice: '', saleTotPrice: '' } + } } else { return { ...item, ...updates } } From 3aa20d6cf1956c5eabe77ebf3643e552e56bf2ed Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Fri, 17 Jan 2025 09:34:50 +0900 Subject: [PATCH 011/130] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=EC=B2=B4=ED=81=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index ed9dec8c..6afced52 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -299,7 +299,7 @@ export function useCanvasSetting() { }) roofsArray = res.map((item) => { return { - roofApply: true, + roofApply: item.roofApply, roofSeq: 0, roofMatlCd: item.roofMatlCd, roofWidth: item.roofWidth, From 28b0a5a65ac44d79343fd11d582b326dc74e65c2 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 09:50:42 +0900 Subject: [PATCH 012/130] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=203-4=EB=93=B1=20?= =?UTF-8?q?=ED=95=98=EC=9C=84=20=EC=9E=88=EB=8A=94=202=EC=B0=A8=EC=A0=90?= =?UTF-8?q?=20=EB=A1=9C=EA=B7=B8=EC=9D=B8=ED=95=B4=EC=84=9C=20=EB=AC=BC?= =?UTF-8?q?=EA=B1=B4=20=EC=9E=84=EC=8B=9C=EC=A0=80=EC=9E=A5=20/=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5=EC=8B=9C=202=EC=B0=A8=EC=A0=90=20=EC=97=86?= =?UTF-8?q?=EC=9C=BC=EB=A9=B4=20=EC=95=8C=EB=9F=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/estimate/Estimate.jsx | 2 -- src/components/management/StuffDetail.jsx | 9 ++++++++- src/locales/ja.json | 1 + src/locales/ko.json | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 39766b12..21e87620 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -1185,7 +1185,6 @@ export default function Estimate({}) {
- {/* */}
- {/* */} 10) { diff --git a/src/locales/ja.json b/src/locales/ja.json index 900165c5..3c36a2cc 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -673,6 +673,7 @@ "stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください", "stuff.detail.tempSave.message1": "一時保存されました。商品番号を取得するには、必須項目をすべて入力してください。", "stuff.detail.tempSave.message2": "担当者は10桁以下で入力してください.", + "stuff.detail.tempSave.message3": "二次販売店を選択してください.", "stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?", "stuff.detail.delete.message1": "仕様が確定したものは削除できません。", "stuff.detail.planList.title": "プランリスト", diff --git a/src/locales/ko.json b/src/locales/ko.json index c5ba4658..c928a2f1 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -682,6 +682,7 @@ "stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 메뉴얼을 확인해주십시오", "stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.", "stuff.detail.tempSave.message2": "담당자는 10자리 이하로 입력해 주십시오.", + "stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.", "stuff.detail.confirm.message1": "판매점 정보를 변경하면, 설계의뢰 문서번호가 삭제됩니다. 변경하시겠습니까?", "stuff.detail.delete.message1": "사양이 확정된 물건은 삭제할 수 없습니다.", "stuff.detail.planList.title": "플랜리스트", From 3ae8ef5dea87f3e487eae72810dbc7a34bdf751c Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 10:12:07 +0900 Subject: [PATCH 013/130] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20&=20?= =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC=EB=A0=88=EC=9D=B4=EC=85=98?= =?UTF-8?q?=20=ED=83=AD=EC=97=90=EC=84=9C=20=ED=94=8C=EB=9E=9C=20=ED=81=B4?= =?UTF-8?q?=EB=A6=AD=EC=8B=9C=20=EC=B2=B4=ED=81=AC=20=EB=B6=84=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePlan.js | 55 ++++++++++++++++++++++++-------------------- 1 file changed, 30 insertions(+), 25 deletions(-) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 86b6aee3..fb743828 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -207,49 +207,54 @@ export function usePlan(params = {}) { const orderingNo = plans?.find((obj) => obj.id === newCurrentId).ordering const objectNo = floorPlanState.objectNo //견적서 or 발전시뮬 + if (pathname !== '/floor-plan') { await promiseGet({ url: `/api/estimate/${objectNo}/${orderingNo}/detail` }) .then((res) => { if (res.status === 200) { const estimateDetail = res.data - if (estimateDetail.docNo) { - res.data.resetFlag = 'N' + if (pathname === '/floor-plan/estimate/5') { + if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { + console.log('이동') + res.data.resetFlag = 'N' - if (res.data.itemList.length > 0) { - res.data.itemList.map((item) => { - item.delFlg = '0' - }) - } - if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) { - res.data.pkgAsp = '0.00' - } else { - const number = parseFloat(res.data.pkgAsp) - const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2) - - res.data.pkgAsp = roundedNumber.toString() - } - setEstimateContextState(res.data) - - if (pathname === '/floor-plan') { - if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { - saveCanvas() + if (res.data.itemList.length > 0) { + res.data.itemList.map((item) => { + item.delFlg = '0' + }) } + if (res.data.pkgAsp === null || res.data.pkgAsp == undefined) { + res.data.pkgAsp = '0.00' + } else { + const number = parseFloat(res.data.pkgAsp) + const roundedNumber = isNaN(number) ? '0.00' : number.toFixed(2) + + res.data.pkgAsp = roundedNumber.toString() + } + setEstimateContextState(res.data) + // 클릭한 플랜 탭으로 이동 + updateCurrentPlan(newCurrentId) + } else { + swalFire({ text: getMessage('estimate.menu.move.valid1') }) } - updateCurrentPlan(newCurrentId) } else { - swalFire({ text: getMessage('estimate.menu.move.valid1') }) + //발전시뮬레이션 + // 클릭한 플랜 탭으로 이동 + // updateCurrentPlan(newCurrentId) } } }) .catch((error) => { - swalFire({ text: getMessage('estimate.menu.move.valid1') }) + if (pathname === '/floor-plan/estimate/5') { + swalFire({ text: getMessage('estimate.menu.move.valid1') }) + } else { + swalFire({ text: getMessage('simulator.menu.move.valid1') }) + } }) } else { - // if (pathname === '/floor-plan') { if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { saveCanvas() } - // } updateCurrentPlan(newCurrentId) } } From 87b480dba48e61c7a0f733209f0d5b9d6e8a7791 Mon Sep 17 00:00:00 2001 From: lelalela Date: Fri, 17 Jan 2025 10:13:00 +0900 Subject: [PATCH 014/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=ED=83=AD=20?= =?UTF-8?q?=EC=BB=A8=ED=85=90=ED=8A=B8=20=EC=98=81=EC=97=AD=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Module.jsx | 23 ++++----- .../modal/basic/step/ModuleTabContents.jsx | 17 +++++-- .../floor-plan/modal/basic/step/Placement.jsx | 19 ++++---- src/hooks/common/useMasterController.js | 8 ++-- src/hooks/module/useModule.js | 10 +++- src/hooks/module/useModuleBasicSetting.js | 1 + src/hooks/module/useModulePlace.js | 48 ++++++++++--------- src/hooks/useContextMenu.js | 4 +- 8 files changed, 73 insertions(+), 57 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 06bf2b8f..9f98e83b 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -40,12 +40,18 @@ export default function Module({ setTabNum }) { const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터 const [moduleSelectionDataPlanList, setModuleSelectionDataPlanList] = useRecoilState(moduleSelectionDataPlanListState) - const [currentCanvasPlan, setCurrentCanvasPlan] = useRecoilState(currentCanvasPlanState) + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const [tempModuleSelectionData, setTempModuleSelectionData] = useReducer((prevState, nextState) => { return { ...prevState, ...nextState } }, moduleSelectionData) + useEffect(() => { + if (moduleSelectionDataPlanList) { + setModuleSelectionData(moduleSelectionDataPlanList[currentCanvasPlan.id]) + } + }, []) + useEffect(() => { handleChangeInstallHeight(debouncedInstallHeight) }, [debouncedInstallHeight]) @@ -72,16 +78,6 @@ export default function Module({ setTabNum }) { rows: [], } - useEffect(() => { - console.log('currentCanvasPlan', currentCanvasPlan) - }, []) - - useEffect(() => {}, [roofTab]) - - useEffect(() => { - setModuleSelectionDataPlanList({ ...moduleSelectionDataPlanList, [currentCanvasPlan.id]: moduleSelectionData }) - }, [moduleSelectionData]) - const handleRoofTab = (tab) => { setRoofTab(tab) } @@ -242,11 +238,12 @@ export default function Module({ setTabNum }) { index={index} addRoof={roof} roofTab={index} - moduleConstructionSelectionData={moduleSelectionData.roofConstructions[index]} - setModuleSelectionData={setModuleSelectionData} + moduleConstructionSelectionData={moduleSelectionData?.roofConstructions[index]} tempModuleSelectionData={tempModuleSelectionData} setTempModuleSelectionData={setTempModuleSelectionData} selectedModule={selectedModules} + moduleSelectionDataPlanList={moduleSelectionDataPlanList} + setModuleSelectionDataPlanList={setModuleSelectionDataPlanList} />
))} diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 3fee925e..9d835389 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -1,6 +1,6 @@ import { useEffect, useState, useRef } from 'react' import { useRecoilValue } from 'recoil' -import { pitchTextSelector } from '@/store/canvasAtom' +import { currentCanvasPlanState, pitchTextSelector } from '@/store/canvasAtom' import { useMessage } from '@/hooks/useMessage' import { useMasterController } from '@/hooks/common/useMasterController' import { useCommonCode } from '@/hooks/common/useCommonCode' @@ -12,14 +12,16 @@ export default function ModuleTabContents({ addRoof, roofTab, moduleConstructionSelectionData, - setModuleSelectionData, tempModuleSelectionData, setTempModuleSelectionData, selectedModule, + moduleSelectionDataPlanList, + setModuleSelectionDataPlanList, }) { const { getMessage } = useMessage() const [roofMaterial, setRoofMaterial] = useState(addRoof) //지붕재` const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트 + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const { findCommonCode } = useCommonCode() const [raftCodes, setRaftCodes] = useState([]) //가대 목록 @@ -162,6 +164,8 @@ export default function ModuleTabContents({ } useEffect(() => { + console.log('tempModuleSelectionData', tempModuleSelectionData) + if (isObjectNotEmpty(selectedRoofBase) && isObjectNotEmpty(selectedConstruction)) { const newRoofConstructions = { roofIndex: roofTab, @@ -169,6 +173,7 @@ export default function ModuleTabContents({ trestle: selectedRoofBase, construction: selectedConstruction, } + const index = tempModuleSelectionData.roofConstructions.findIndex((obj) => obj.roofIndex === roofTab) if (index > -1) { @@ -241,6 +246,7 @@ export default function ModuleTabContents({ if (isModuleLoaded) { setTrestleParams({ moduleTpCd: moduleSelectionInitParams.moduleTpCd, roofMatlCd: addRoof.roofMatlCd, raftBaseCd: addRoof.raftBaseCd }) setConstructionList([]) + setTempModuleSelectionData({ common: moduleSelectionInitParams, module: selectedModule }) if (isObjectNotEmpty(moduleConstructionSelectionData)) { //기존에 데이터가 있으면 @@ -249,11 +255,11 @@ export default function ModuleTabContents({ setCvrChecked(moduleConstructionSelectionData.construction.setupCover) setSnowGdChecked(moduleConstructionSelectionData.construction.setupSnowCover) setIsExistData(true) + + setTempModuleSelectionData({ roofConstructions: [{ ...moduleConstructionSelectionData }] }) } } } - - setTempModuleSelectionData({ common: moduleSelectionInitParams, module: selectedModule }) }, [moduleSelectionInitParams]) useEffect(() => { @@ -282,7 +288,8 @@ export default function ModuleTabContents({ useEffect(() => { if (isObjectNotEmpty(tempModuleSelectionData)) { - setModuleSelectionData(tempModuleSelectionData) + setModuleSelectionDataPlanList({ ...moduleSelectionDataPlanList, [currentCanvasPlan.id]: tempModuleSelectionData }) + // setModuleSelectionData(tempModuleSelectionData) } }, [tempModuleSelectionData]) diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index d400881a..de23ec82 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -1,15 +1,16 @@ import { forwardRef, useEffect, useState } from 'react' import { useMessage } from '@/hooks/useMessage' import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' -import { checkedModuleState } from '@/store/canvasAtom' -import { useRecoilValue, useRecoilState, useSetRecoilState } from 'recoil' -import { selectedModuleState, moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { checkedModuleState, currentCanvasPlanState } from '@/store/canvasAtom' +import { useRecoilValue, useSetRecoilState } from 'recoil' +import { moduleSelectionDataPlanListState } from '@/store/selectedModuleOptions' import { useModulePlace } from '@/hooks/module/useModulePlace' const Placement = forwardRef((props, refs) => { const { getMessage } = useMessage() const [isChidori, setIsChidori] = useState(false) const [isChidoriNotAble, setIsChidoriNotAble] = useState(false) + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const [setupLocation, setSetupLocation] = useState('center') const [isMaxSetup, setIsMaxSetup] = useState('false') @@ -19,16 +20,18 @@ const Placement = forwardRef((props, refs) => { const { selectedModules } = useModulePlace() const setCheckedModules = useSetRecoilState(checkedModuleState) - const moduleSelectionData = useRecoilValue(moduleSelectionDataState) + const moduleSelectionDataPlanList = useRecoilValue(moduleSelectionDataPlanListState) //모듈 배치면 생성 useEffect(() => { makeModuleInstArea() - //1개라도 치도리 불가가 있으면 치도리 불가 - const isChidroriValue = moduleSelectionData.roofConstructions.some((item) => item.construction.plvrYn === 'N') - if (isChidroriValue) { - setIsChidoriNotAble(true) + if (moduleSelectionDataPlanList) { + //1개라도 치도리 불가가 있으면 치도리 불가 + const isChidroriValue = moduleSelectionDataPlanList[currentCanvasPlan.id].roofConstructions.some((item) => item.construction.plvrYn === 'N') + if (isChidroriValue) { + setIsChidoriNotAble(true) + } } }, []) diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index 29a17464..6332b8d2 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -54,9 +54,9 @@ export function useMasterController() { */ const getTrestleList = async (params) => { const paramString = getQueryString(params) - console.log('🚀🚀 ~ getTrestleList ~ paramString:', paramString) + // console.log('🚀🚀 ~ getTrestleList ~ paramString:', paramString) return await get({ url: '/api/v1/master/getTrestleList' + paramString }).then((res) => { - console.log('🚀🚀 ~ getTrestleList ~ res:', res) + // console.log('🚀🚀 ~ getTrestleList ~ res:', res) return res }) } @@ -80,9 +80,9 @@ export function useMasterController() { */ const getConstructionList = async (params) => { const paramString = getQueryString(params) - console.log('🚀🚀 ~ getConstructionList ~ paramString:', paramString) + // console.log('🚀🚀 ~ getConstructionList ~ paramString:', paramString) return await get({ url: '/api/v1/master/getConstructionList' + paramString }).then((res) => { - console.log('🚀🚀 ~ getConstructionList ~ res:', res) + // console.log('🚀🚀 ~ getConstructionList ~ res:', res) return res }) } diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js index a71744c6..de64c404 100644 --- a/src/hooks/module/useModule.js +++ b/src/hooks/module/useModule.js @@ -389,6 +389,7 @@ export function useModule() { .filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.id === activeModule.surfaceId)[0] let isWarning = false canvas.discardActiveObject() + moduleSetupSurface.set({ modules: otherModules }) canvas.remove(...columnModules) canvas.renderAll() @@ -503,6 +504,7 @@ export function useModule() { let isWarning = false canvas.discardActiveObject() + moduleSetupSurface.set({ modules: otherModules }) canvas.remove(...rowModules) canvas.renderAll() @@ -852,8 +854,12 @@ export function useModule() { const modulesRemove = () => { const activeModule = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0] - const modules = canvas.getObjects().filter((obj) => obj.surfaceId === activeModule.surfaceId && obj.name === POLYGON_TYPE.MODULE) - canvas.remove(...modules) + const modules = canvas + .getObjects() + .filter((obj) => obj.surfaceId === activeModule.surfaceId && obj.name === POLYGON_TYPE.MODULE && activeModule.id !== obj.id) + const surface = canvas.getObjects().filter((obj) => obj.id === activeModule.surfaceId && obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)[0] + surface.set({ modules: modules }) + canvas.remove(activeModule) canvas.renderAll() } diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 965a1045..11c2ce8d 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -698,6 +698,7 @@ export function useModuleBasicSetting() { checkedModule.forEach((module, index) => { const { width, height } = getModuleWidthHeight(maxLengthLine, moduleSetupSurface, module) + const flowLines = getFlowLines(moduleSetupSurface, module) //육지붕이 아닐때만 넣는다 육지붕일땐 클릭 이벤트에 별도로 넣어놓음 let startPoint = flowLines.bottom diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index d46f789f..4398b938 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -1,39 +1,41 @@ import { useEffect, useState } from 'react' import { useRecoilState, useRecoilValue } from 'recoil' -import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' +import { moduleSelectionDataPlanListState, selectedModuleState } from '@/store/selectedModuleOptions' import { useMasterController } from '@/hooks/common/useMasterController' -import { canvasState } from '@/store/canvasAtom' +import { canvasState, currentCanvasPlanState } from '@/store/canvasAtom' export function useModulePlace() { const canvas = useRecoilValue(canvasState) - const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터 + const moduleSelectionDataPlanList = useRecoilValue(moduleSelectionDataPlanListState) //다음으로 넘어가는 최종 데이터 + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const [trestleDetailParams, setTrestleDetailParams] = useState([]) const [trestleDetailList, setTrestleDetailList] = useState([]) const selectedModules = useRecoilValue(selectedModuleState) const { getTrestleDetailList } = useMasterController() useEffect(() => { - const common = moduleSelectionData.common - const roofConstructions = moduleSelectionData.roofConstructions + if (moduleSelectionDataPlanList) { + const common = moduleSelectionDataPlanList[currentCanvasPlan.id].common + const roofConstructions = moduleSelectionDataPlanList[currentCanvasPlan.id].roofConstructions - const listParams = roofConstructions.map((item) => { - return { - ...common, - moduleTpCd: selectedModules.itemTp, - roofMatlCd: item.trestle.roofMatlCd, - trestleMkrCd: item.trestle.trestleMkrCd, - constMthdCd: item.trestle.constMthdCd, - roofBaseCd: item.trestle.roofBaseCd, - constTp: item.construction.constTp, - mixMatlNo: selectedModules.mixMatlNo, - roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null, - inclCd: String(item.addRoof.pitch), - roofIndex: item.addRoof.index, - } - }) - - setTrestleDetailParams(listParams) - }, [moduleSelectionData]) + const listParams = roofConstructions.map((item) => { + return { + ...common, + moduleTpCd: selectedModules.itemTp, + roofMatlCd: item.trestle.roofMatlCd, + trestleMkrCd: item.trestle.trestleMkrCd, + constMthdCd: item.trestle.constMthdCd, + roofBaseCd: item.trestle.roofBaseCd, + constTp: item.construction.constTp, + mixMatlNo: selectedModules.mixMatlNo, + roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null, + inclCd: String(item.addRoof.pitch), + roofIndex: item.addRoof.index, + } + }) + setTrestleDetailParams(listParams) + } + }, [moduleSelectionDataPlanList]) const getTrestleDetailListData = async () => { const trestleDetailList = await getTrestleDetailList(trestleDetailParams) diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js index 3f2db9f0..8f90424d 100644 --- a/src/hooks/useContextMenu.js +++ b/src/hooks/useContextMenu.js @@ -67,7 +67,7 @@ export function useContextMenu() { const commonTextFont = useRecoilValue(fontSelector('commonText')) const { settingsData, setSettingsDataSave } = useCanvasSetting() const { swalFire } = useSwal() - const { alignModule } = useModule() + const { alignModule, modulesRemove } = useModule() const { removeRoofMaterial, removeAllRoofMaterial } = useRoofFn() const currentMenuSetting = () => { @@ -656,7 +656,7 @@ export function useContextMenu() { { id: 'remove', name: getMessage('contextmenu.remove'), - fn: () => deleteObject(), + fn: () => modulesRemove(), }, { id: 'move', From eac19c76203c1ba4574c3a1a34761943f517bf0a Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 10:36:27 +0900 Subject: [PATCH 015/130] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20&=20?= =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC=EB=A0=88=EC=9D=B4=EC=85=98?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99=20=EA=B4=80=EB=A0=A8=20pid=20=EC=85=8B?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 14 +++++++++----- src/hooks/usePlan.js | 1 - 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index c5fb9194..19db2fde 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -44,6 +44,7 @@ import JA from '@/locales/ja.json' import { MENU } from '@/common/common' import { QcastContext } from '@/app/QcastProvider' + export default function CanvasMenu(props) { const { menuNumber, setMenuNumber } = props const pathname = usePathname() @@ -101,6 +102,8 @@ export default function CanvasMenu(props) { const { setIsGlobalLoading } = useContext(QcastContext) + //임시 + const { selectedPlan } = usePlan() const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => { const url = '/api/estimate/excel-download' @@ -168,14 +171,14 @@ export default function CanvasMenu(props) { break case 5: // let pid = urlParams.get('pid') - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data - if (estimateDetail.docNo) { + if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { setMenuNumber(menu.index) setCurrentMenu(menu.title) setFloorPlanObjectNo({ floorPlanObjectNo: objectNo }) - router.push(`/floor-plan/estimate/5?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } @@ -183,13 +186,14 @@ export default function CanvasMenu(props) { }) break case 6: - promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => { + promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data + //docno tempFlg0 if (estimateDetail.docNo) { setMenuNumber(menu.index) setCurrentMenu(menu.title) - router.push(`/floor-plan/simulator/${menu.index}?pid=${pid}&objectNo=${objectNo}`) + router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) } else { swalFire({ text: getMessage('simulator.menu.move.valid1') }) } diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index fb743828..10c1dc2d 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -215,7 +215,6 @@ export function usePlan(params = {}) { const estimateDetail = res.data if (pathname === '/floor-plan/estimate/5') { if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) { - console.log('이동') res.data.resetFlag = 'N' if (res.data.itemList.length > 0) { From 6021fa537c257178b6c2e193450a3225f4f241c6 Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Fri, 17 Jan 2025 10:46:52 +0900 Subject: [PATCH 016/130] =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AE=AC?= =?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20=EB=A9=94=EB=89=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 3 +- src/components/simulator/Simulator.jsx | 38 +++++++++--------------- src/hooks/usePlan.js | 9 ++++-- 3 files changed, 21 insertions(+), 29 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 19db2fde..012b62e9 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -189,8 +189,7 @@ export default function CanvasMenu(props) { promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => { if (res.status === 200) { const estimateDetail = res.data - //docno tempFlg0 - if (estimateDetail.docNo) { + if (estimateDetail.tempFlg === '0') { setMenuNumber(menu.index) setCurrentMenu(menu.title) router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`) diff --git a/src/components/simulator/Simulator.jsx b/src/components/simulator/Simulator.jsx index ef752582..249398c4 100644 --- a/src/components/simulator/Simulator.jsx +++ b/src/components/simulator/Simulator.jsx @@ -16,26 +16,18 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { convertNumberToPriceDecimal } from '@/util/common-utils' import { usePlan } from '@/hooks/usePlan' -import { usePopup } from '@/hooks/usePopup' -// import { useSearchParams } from 'next/navigation' +import { usePopup, closeAll } from '@/hooks/usePopup' export default function Simulator() { const { floorPlanState } = useContext(FloorPlanContext) const { objectNo, pid } = floorPlanState - - // const searchParams = useSearchParams() - // const objectNo = searchParams.get('objectNo') - // const pid = searchParams.get('pid') const { selectedPlan } = usePlan() const chartRef = useRef(null) // 캔버스 메뉴 넘버 셋팅 const { setMenuNumber } = useCanvasMenu() - - useEffect(() => { - setMenuNumber(6) - }, []) + const { closeAll } = usePopup() const { get } = useAxios() const { getMessage } = useMessage() @@ -43,12 +35,6 @@ export default function Simulator() { // 차트 관련 const [chartData, setChartData] = useState([]) - const { closeAll } = usePopup() - - useEffect(() => { - closeAll() - }, []) - const data = { labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'], datasets: [ @@ -114,7 +100,6 @@ export default function Simulator() { } useEffect(() => { - console.log('🚀 ~ useEffect ~ selectedPlan:', selectedPlan) /* 초기화 작업 */ setChartData([]) setObjectDetail({}) @@ -125,11 +110,13 @@ export default function Simulator() { setHatsudenryouPeakcutAll([]) setHatsudenryouPeakcutAllSnow([]) - if (objectNo) { - fetchObjectDetail(objectNo) + if (objectNo && pid && selectedPlan) { + fetchObjectDetail(objectNo, selectedPlan.ordering) fetchSimulatorNotice() setPwrGnrSimType('D') setPwrRecoil({ ...pwrRecoil, type: 'D' }) + setMenuNumber(6) + closeAll() } }, [objectNo, pid, selectedPlan]) @@ -148,8 +135,8 @@ export default function Simulator() { const [hatsudenryouPeakcutAll, setHatsudenryouPeakcutAll] = useState([]) const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([]) - const fetchObjectDetail = async (objectNo) => { - const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${pid}` + const fetchObjectDetail = async (objectNo, currentPid) => { + const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}` const resultData = await get({ url: apiUrl }) if (resultData) { @@ -234,7 +221,7 @@ export default function Simulator() {
{/* 시스템용량 */}
-
{getMessage('simulator.title.sub3')}
+
{getMessage('simulator.title.sub3')}
{objectDetail.capacity ? `${convertNumberToPriceDecimal(objectDetail.capacity)} kW` : ''}
{/* 연간예측발전량 */} @@ -257,7 +244,7 @@ export default function Simulator() { {/* 적설조건 */}
{getMessage('simulator.title.sub7')}
-
{objectDetail.snowfall} cm
+
{objectDetail.snowfall ? `${objectDetail.snowfall}cm` : ''}
{/* 풍속조건 */}
@@ -356,7 +343,10 @@ export default function Simulator() { {/* 지붕면 */} {moduleInfo.roofSurface} {/* 경사각 */} - {convertNumberToPriceDecimal(moduleInfo.slopeAngle)}{moduleInfo.classType == 0 ? "寸":"º"} + + {convertNumberToPriceDecimal(moduleInfo.slopeAngle)} + {moduleInfo.classType == 0 ? '寸' : 'º'} + {/* 방위각(도) */} {convertNumberToPriceDecimal(moduleInfo.azimuth)} {/* 태양전지모듈 */} diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 10c1dc2d..a0733e57 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -237,9 +237,12 @@ export function usePlan(params = {}) { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } } else { - //발전시뮬레이션 - // 클릭한 플랜 탭으로 이동 - // updateCurrentPlan(newCurrentId) + // 발전시뮬레이션 + if (estimateDetail.tempFlg === '0') { + updateCurrentPlan(newCurrentId) + } else { + swalFire({ text: getMessage('simulator.menu.move.valid1') }) + } } } }) From b47ae97dd1174b1db30d7919c69a57268c9365e8 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 17 Jan 2025 11:01:41 +0900 Subject: [PATCH 017/130] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EC=A1=B0=ED=9A=8C?= =?UTF-8?q?=20=ED=81=B4=EB=A6=AD=EC=8B=9C=20saleStoreId=20=EC=85=8B?= =?UTF-8?q?=ED=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/Stuff.jsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index f55815fb..987be2f1 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -219,6 +219,10 @@ export default function Stuff() { pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100, } + if (!params.saleStoreId) { + params.saleStoreId = session.storeId + } + async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(params)}` await get({ @@ -271,6 +275,10 @@ export default function Stuff() { stuffSearchParams.schSortType = defaultSortType stuffSearchParams.pageNo = stuffSearchParams.pageNo + if (!stuffSearchParams.saleStoreId) { + stuffSearchParams.saleStoreId = session.storeId + } + async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}` await get({ url: apiUrl }).then((res) => { @@ -301,6 +309,9 @@ export default function Stuff() { stuffSearchParams.schSortType = defaultSortType setPageNo(1) + if (!params.saleStoreId) { + stuffSearchParams.saleStoreId = session.storeId + } async function fetchData() { const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}` await get({ url: apiUrl }).then((res) => { From 558594e450ba19345a0c211aa419d1036bbae999 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 17 Jan 2025 11:11:47 +0900 Subject: [PATCH 018/130] =?UTF-8?q?currentRoofList=20=EC=98=A4=EB=A5=98=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ContextRoofAllocationSetting.jsx | 231 +++++++++--------- .../roofcover/useRoofAllocationSetting.js | 2 +- 2 files changed, 117 insertions(+), 116 deletions(-) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index e8942948..1d5bc188 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -79,133 +79,134 @@ export default function ContextRoofAllocationSetting(props) {
- {currentRoofList.map((roof, index) => { - return ( -
-
- - -
-
-
-
-
- handleChangeRoofMaterial(e, index)} - /> -
- {index === 0 && {getMessage('modal.roof.alloc.default.roof.material')}} - {index !== 0 && } -
+ {currentRoofList.length > 0 && + currentRoofList.map((roof, index) => { + return ( +
+
+ +
-
-
- {getMessage('slope')} -
- { - handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) - }} - defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} - /> +
+
+
+
+ handleChangeRoofMaterial(e, index)} + /> +
+ {index === 0 && {getMessage('modal.roof.alloc.default.roof.material')}} + {index !== 0 && }
- {pitchText}
-
- {(roof.widAuth || roof.lenAuth) && (
- {roof.widAuth && ( -
- W -
- -
+
+ {getMessage('slope')} +
+ { + handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index) + }} + defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle} + />
- )} - {roof.lenAuth && ( -
- L -
- -
-
- )} + {pitchText} +
- )} - {(roof.raftAuth || roof.roofPchAuth) && ( -
- {roof.raftAuth && ( -
+ {(roof.widAuth || roof.lenAuth) && ( +
+ {roof.widAuth && (
- {getMessage('modal.placement.initial.setting.rafter')} - {raftCodes.length > 0 && ( -
- -
- )} -
-
- )} - {roof.roofPchAuth && ( -
-
- {getMessage('hajebichi')} -
- + W +
+
-
- )} -
- )} -
-
- - + )} + {roof.lenAuth && ( +
+ L +
+ +
+
+ )} +
+ )} + {(roof.raftAuth || roof.roofPchAuth) && ( +
+ {roof.raftAuth && ( +
+
+ {getMessage('modal.placement.initial.setting.rafter')} + {raftCodes.length > 0 && ( +
+ +
+ )} +
+
+ )} + {roof.roofPchAuth && ( +
+
+ {getMessage('hajebichi')} +
+ +
+
+
+ )} +
+ )} +
+
+ + +
-
- ) - })} + ) + })}
+
) diff --git a/src/components/common/draggable/WithDraggable.jsx b/src/components/common/draggable/WithDraggable.jsx index 76656837..732d8ff7 100644 --- a/src/components/common/draggable/WithDraggable.jsx +++ b/src/components/common/draggable/WithDraggable.jsx @@ -20,7 +20,7 @@ export default function WithDraggable({ isShow, children, pos = { x: 0, y: 0 }, handleOnDrag(e, data)} - handle={handle === '' ? '.modal-head' : handle} + handle={handle === '' ? '.modal-handle' : handle} > {children} diff --git a/src/components/common/font/FontSetting.jsx b/src/components/common/font/FontSetting.jsx index 15f1146a..26d07ea7 100644 --- a/src/components/common/font/FontSetting.jsx +++ b/src/components/common/font/FontSetting.jsx @@ -67,9 +67,9 @@ export default function FontSetting(props) { } return ( - +
-
+

{getMessage('modal.font')}

+
) diff --git a/src/components/floor-plan/modal/Slope.jsx b/src/components/floor-plan/modal/Slope.jsx index 42b8be64..58ccec4d 100644 --- a/src/components/floor-plan/modal/Slope.jsx +++ b/src/components/floor-plan/modal/Slope.jsx @@ -15,7 +15,7 @@ export default function Slope({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('plan.menu.placement.surface.slope.setting')}

+
) diff --git a/src/components/floor-plan/modal/auxiliary/AuxiliaryDrawing.jsx b/src/components/floor-plan/modal/auxiliary/AuxiliaryDrawing.jsx index 609ff975..b85d76c6 100644 --- a/src/components/floor-plan/modal/auxiliary/AuxiliaryDrawing.jsx +++ b/src/components/floor-plan/modal/auxiliary/AuxiliaryDrawing.jsx @@ -126,7 +126,7 @@ export default function AuxiliaryDrawing({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('modal.auxiliary.drawing')}

+
) diff --git a/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx b/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx index 07fc9e46..e0f3522b 100644 --- a/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx +++ b/src/components/floor-plan/modal/auxiliary/AuxiliaryEdit.jsx @@ -46,7 +46,7 @@ export default function AuxiliaryEdit(props) { return (
-
+

{getMessage(type === 'copy' ? 'modal.auxiliary.copy' : 'modal.auxiliary.move')}

+
) diff --git a/src/components/floor-plan/modal/auxiliary/AuxiliarySize.jsx b/src/components/floor-plan/modal/auxiliary/AuxiliarySize.jsx index e984be57..1afdd7ec 100644 --- a/src/components/floor-plan/modal/auxiliary/AuxiliarySize.jsx +++ b/src/components/floor-plan/modal/auxiliary/AuxiliarySize.jsx @@ -14,7 +14,7 @@ export default function AuxiliarySize(props) { return (
-
+

{getMessage('modal.auxiliary.size.edit')}

+
) diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx index 392c1eda..49aabd0d 100644 --- a/src/components/floor-plan/modal/basic/BasicSetting.jsx +++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx @@ -51,7 +51,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('plan.menu.module.circuit.setting.default')}

+
) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 38ae2e89..a30e506b 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -83,7 +83,7 @@ export default function CircuitTrestleSetting({ id }) { return (
-
+

{getMessage('modal.circuit.trestle.setting')}

)}
+
) diff --git a/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx b/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx index 59c0ead4..1ec3684e 100644 --- a/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx +++ b/src/components/floor-plan/modal/dimensionLine/DimensionLineSetting.jsx @@ -85,7 +85,7 @@ export default function DimensionLineSetting(props) { return (
-
+

{getMessage('contextmenu.display.edit')}

+
) diff --git a/src/components/floor-plan/modal/distance/Distance.jsx b/src/components/floor-plan/modal/distance/Distance.jsx index ac65c1e5..d37302b6 100644 --- a/src/components/floor-plan/modal/distance/Distance.jsx +++ b/src/components/floor-plan/modal/distance/Distance.jsx @@ -18,7 +18,7 @@ export default function Distance(props) { return (
-
+

{getMessage('modal.distance')}

+
) diff --git a/src/components/floor-plan/modal/eavesGable/EavesGableEdit.jsx b/src/components/floor-plan/modal/eavesGable/EavesGableEdit.jsx index 2b5a7079..56e88ba8 100644 --- a/src/components/floor-plan/modal/eavesGable/EavesGableEdit.jsx +++ b/src/components/floor-plan/modal/eavesGable/EavesGableEdit.jsx @@ -40,7 +40,7 @@ export default function EavesGableEdit({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('modal.eaves.gable.edit')}

+
) diff --git a/src/components/floor-plan/modal/flowDirection/FlowDirectionSetting.jsx b/src/components/floor-plan/modal/flowDirection/FlowDirectionSetting.jsx index 18eef849..14c40310 100644 --- a/src/components/floor-plan/modal/flowDirection/FlowDirectionSetting.jsx +++ b/src/components/floor-plan/modal/flowDirection/FlowDirectionSetting.jsx @@ -65,7 +65,7 @@ export default function FlowDirectionSetting(props) { return (
-
+

{getMessage('modal.shape.flow.direction.setting')}

+
) diff --git a/src/components/floor-plan/modal/grid/DotLineGrid.jsx b/src/components/floor-plan/modal/grid/DotLineGrid.jsx index da41fdcf..c19f4c26 100644 --- a/src/components/floor-plan/modal/grid/DotLineGrid.jsx +++ b/src/components/floor-plan/modal/grid/DotLineGrid.jsx @@ -179,7 +179,7 @@ export default function DotLineGrid(props) { return (
-
+

{getMessage('modal.canvas.setting.grid.dot.line.setting')}

+
) } diff --git a/src/components/floor-plan/modal/grid/GridCopy.jsx b/src/components/floor-plan/modal/grid/GridCopy.jsx index 2f768406..0d34b3d4 100644 --- a/src/components/floor-plan/modal/grid/GridCopy.jsx +++ b/src/components/floor-plan/modal/grid/GridCopy.jsx @@ -22,7 +22,7 @@ export default function GridCopy(props) { return (
-
+

{getMessage('modal.grid.copy')}

+
) diff --git a/src/components/floor-plan/modal/grid/GridMove.jsx b/src/components/floor-plan/modal/grid/GridMove.jsx index f853f135..e28d8564 100644 --- a/src/components/floor-plan/modal/grid/GridMove.jsx +++ b/src/components/floor-plan/modal/grid/GridMove.jsx @@ -75,7 +75,7 @@ export default function GridMove(props) { return (
-
+

{getMessage('modal.grid.move')}

+
) diff --git a/src/components/floor-plan/modal/lineProperty/LinePropertySetting.jsx b/src/components/floor-plan/modal/lineProperty/LinePropertySetting.jsx index 13a00b06..1ad351eb 100644 --- a/src/components/floor-plan/modal/lineProperty/LinePropertySetting.jsx +++ b/src/components/floor-plan/modal/lineProperty/LinePropertySetting.jsx @@ -52,7 +52,7 @@ export default function LinePropertySetting(props) { return (
-
+

{getMessage('contextmenu.line.property.edit')}

+
) diff --git a/src/components/floor-plan/modal/module/CircuitNumberEdit.jsx b/src/components/floor-plan/modal/module/CircuitNumberEdit.jsx index 3157fe51..62a0baaf 100644 --- a/src/components/floor-plan/modal/module/CircuitNumberEdit.jsx +++ b/src/components/floor-plan/modal/module/CircuitNumberEdit.jsx @@ -16,7 +16,7 @@ export default function CircuitNumberEdit(props) { return (
-
+

{getMessage('modal.module.circuit.number.edit')}

+
) diff --git a/src/components/floor-plan/modal/module/PanelEdit.jsx b/src/components/floor-plan/modal/module/PanelEdit.jsx index a6d1d4f9..8e1f9fac 100644 --- a/src/components/floor-plan/modal/module/PanelEdit.jsx +++ b/src/components/floor-plan/modal/module/PanelEdit.jsx @@ -84,7 +84,7 @@ export default function PanelEdit(props) { return (
-
+

{getMessage([PANEL_EDIT_TYPE.MOVE, PANEL_EDIT_TYPE.COLUMN_MOVE].includes(type) ? 'modal.move.setting' : 'modal.copy.setting')}{' '}

@@ -139,6 +139,7 @@ export default function PanelEdit(props) {
+
) diff --git a/src/components/floor-plan/modal/module/column/ColumnInsert.jsx b/src/components/floor-plan/modal/module/column/ColumnInsert.jsx index 56f9a66c..03b5b4e0 100644 --- a/src/components/floor-plan/modal/module/column/ColumnInsert.jsx +++ b/src/components/floor-plan/modal/module/column/ColumnInsert.jsx @@ -26,7 +26,7 @@ export default function ColumnInsert(props) { return (
-
+

{getMessage('modal.panel.column.insert')}

+
) diff --git a/src/components/floor-plan/modal/module/column/ColumnRemove.jsx b/src/components/floor-plan/modal/module/column/ColumnRemove.jsx index a18d7982..95cdd942 100644 --- a/src/components/floor-plan/modal/module/column/ColumnRemove.jsx +++ b/src/components/floor-plan/modal/module/column/ColumnRemove.jsx @@ -29,7 +29,7 @@ export default function ColumnRemove(props) { return (
-
+

{getMessage('modal.panel.column.remove')}

+
) diff --git a/src/components/floor-plan/modal/module/row/RowInsert.jsx b/src/components/floor-plan/modal/module/row/RowInsert.jsx index 613fb180..fa3c2fff 100644 --- a/src/components/floor-plan/modal/module/row/RowInsert.jsx +++ b/src/components/floor-plan/modal/module/row/RowInsert.jsx @@ -26,7 +26,7 @@ export default function RowInsert(props) { return (
-
+

{getMessage('modal.row.insert')}

+
) diff --git a/src/components/floor-plan/modal/module/row/RowRemove.jsx b/src/components/floor-plan/modal/module/row/RowRemove.jsx index bb1f41cf..70c57c24 100644 --- a/src/components/floor-plan/modal/module/row/RowRemove.jsx +++ b/src/components/floor-plan/modal/module/row/RowRemove.jsx @@ -29,7 +29,7 @@ export default function RowRemove(props) { return (
-
+

{getMessage('modal.row.remove')}

+
) diff --git a/src/components/floor-plan/modal/movement/MovementSetting.jsx b/src/components/floor-plan/modal/movement/MovementSetting.jsx index 416afba8..a4dcf3fc 100644 --- a/src/components/floor-plan/modal/movement/MovementSetting.jsx +++ b/src/components/floor-plan/modal/movement/MovementSetting.jsx @@ -18,7 +18,7 @@ export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('plan.menu.roof.cover.movement.shape.updown')}

+
) diff --git a/src/components/floor-plan/modal/object/DormerOffset.jsx b/src/components/floor-plan/modal/object/DormerOffset.jsx index 191a94ea..a1534891 100644 --- a/src/components/floor-plan/modal/object/DormerOffset.jsx +++ b/src/components/floor-plan/modal/object/DormerOffset.jsx @@ -42,7 +42,7 @@ export default function DormerOffset(props) { return (
-
+

{title}

+
) diff --git a/src/components/floor-plan/modal/object/ObjectSetting.jsx b/src/components/floor-plan/modal/object/ObjectSetting.jsx index ee6ab256..97cd02f8 100644 --- a/src/components/floor-plan/modal/object/ObjectSetting.jsx +++ b/src/components/floor-plan/modal/object/ObjectSetting.jsx @@ -77,7 +77,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('plan.menu.placement.surface.object')}

+
) diff --git a/src/components/floor-plan/modal/object/RoofMaterialSetting.jsx b/src/components/floor-plan/modal/object/RoofMaterialSetting.jsx index 015ace3e..815175ce 100644 --- a/src/components/floor-plan/modal/object/RoofMaterialSetting.jsx +++ b/src/components/floor-plan/modal/object/RoofMaterialSetting.jsx @@ -23,7 +23,7 @@ export default function RoofMaterialSetting(props) { return (
-
+

{getMessage('modal.roof.material.edit')}

+
) diff --git a/src/components/floor-plan/modal/object/SizeSetting.jsx b/src/components/floor-plan/modal/object/SizeSetting.jsx index 3466e2ed..ebb925a6 100644 --- a/src/components/floor-plan/modal/object/SizeSetting.jsx +++ b/src/components/floor-plan/modal/object/SizeSetting.jsx @@ -47,7 +47,7 @@ export default function SizeSetting(props) { return (
-
+

{getMessage('modal.size.setting')}

+
) diff --git a/src/components/floor-plan/modal/outerlinesetting/PropertiesSetting.jsx b/src/components/floor-plan/modal/outerlinesetting/PropertiesSetting.jsx index 6c2c8d3f..86724267 100644 --- a/src/components/floor-plan/modal/outerlinesetting/PropertiesSetting.jsx +++ b/src/components/floor-plan/modal/outerlinesetting/PropertiesSetting.jsx @@ -10,7 +10,7 @@ export default function PropertiesSetting(props) { return (
-
+

{getMessage('modal.canvas.setting.wallline.properties.setting')}

+
) diff --git a/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx b/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx index 70ff2150..84107dae 100644 --- a/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx +++ b/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx @@ -116,7 +116,7 @@ export default function WallLineSetting(props) { return (
-
+

{getMessage('modal.cover.outline.drawing')}

@@ -184,6 +184,7 @@ export default function WallLineSetting(props) {
+
) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx index 304d0169..fd435b8b 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx @@ -123,7 +123,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('plan.menu.placement.surface.drawing')}

+
) diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 66fa021e..844cb87e 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -56,25 +56,24 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set ] // 데이터를 최초 한 번만 조회 - // useEffect(() => { + // useEffect(() => { // if (!basicSetting || !currentRoof || Object.keys(currentRoof).length === 0 || Object.keys(basicSetting).length === 0) return - // const raftCodeList = findCommonCode('203800') + // const raftCodeList = findCommonCode('203800') // setRaftCodes(raftCodeList) // console.log('🚀 ~ useEffect ~ >>>>>>>>>>>>> raftCodeList 11 :', raftCodeList) - - + // if (addedRoofs[0].roofAngleSet && addedRoofs[0].roofAngleSet?.length > 0) { // setCurrentRoof({ ...currentRoof, roofSizeSet: String(addedRoofs[0].roofSizeSet), roofAngleSet: addedRoofs[0].roofAngleSet }) // } else if (basicSetting.roofAngleSet && basicSetting.roofAngleSet?.length > 0) { // setCurrentRoof({ ...currentRoof, roofSizeSet: String(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet }) - // } + // } // }, []) useEffect(() => { if (addedRoofs.length > 0) { const raftCodeList = findCommonCode('203800') setRaftCodes(raftCodeList) - + setCurrentRoof({ ...addedRoofs[0] }) } }, [addedRoofs]) @@ -182,7 +181,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set return (
-
+

{getMessage('plan.menu.placement.surface.initial.setting')}

{showSizeGuideModal && } {showMaterialGuideModal && } +
) diff --git a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx index 431e0f85..7fc56d57 100644 --- a/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx +++ b/src/components/floor-plan/modal/placementSurface/PlacementSurfaceSetting.jsx @@ -242,7 +242,7 @@ export default function PlacementSurfaceSetting({ id, pos = { x: 50, y: 230 } }) return (
-
+

{getMessage('plan.menu.placement.surface.arrangement')}

+
) diff --git a/src/components/floor-plan/modal/roofAllocation/ActualSizeSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ActualSizeSetting.jsx index edca1208..d9456bbd 100644 --- a/src/components/floor-plan/modal/roofAllocation/ActualSizeSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ActualSizeSetting.jsx @@ -63,7 +63,7 @@ export default function ActualSizeSetting(props) { return (
-
+

{getMessage('modal.actual.size.setting')}

+
) diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx index 1d5bc188..5bfad3e4 100644 --- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx @@ -45,7 +45,7 @@ export default function ContextRoofAllocationSetting(props) { return (
-
+

{getMessage('plan.menu.estimate.roof.alloc')}

+
) diff --git a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx index 4118db79..0142a329 100644 --- a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx +++ b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx @@ -49,7 +49,7 @@ export default function RoofAllocationSetting(props) {
{currentRoofList && ( <> -
+

{getMessage('plan.menu.estimate.roof.alloc')}

)} +
) diff --git a/src/components/floor-plan/modal/roofShape/RoofShapePassivitySetting.jsx b/src/components/floor-plan/modal/roofShape/RoofShapePassivitySetting.jsx index 090eec0a..b47d2356 100644 --- a/src/components/floor-plan/modal/roofShape/RoofShapePassivitySetting.jsx +++ b/src/components/floor-plan/modal/roofShape/RoofShapePassivitySetting.jsx @@ -31,7 +31,7 @@ export default function RoofShapePassivitySetting({ id, pos = { x: 50, y: 230 } return (
-
+

{getMessage('plan.menu.roof.cover.roof.shape.passivity.setting')}

+
) diff --git a/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx b/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx index b43bdd18..1efbb767 100644 --- a/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx +++ b/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx @@ -90,7 +90,7 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('modal.roof.shape.setting')}

+
) diff --git a/src/components/floor-plan/modal/setting01/SettingModal01.jsx b/src/components/floor-plan/modal/setting01/SettingModal01.jsx index f5e6e3ca..0ccd337a 100644 --- a/src/components/floor-plan/modal/setting01/SettingModal01.jsx +++ b/src/components/floor-plan/modal/setting01/SettingModal01.jsx @@ -75,7 +75,7 @@ export default function SettingModal01(props) { <>
-
+

{getMessage('modal.canvas.setting')}

+
diff --git a/src/components/floor-plan/modal/setting01/dimensionLine/DimensionLineSetting.jsx b/src/components/floor-plan/modal/setting01/dimensionLine/DimensionLineSetting.jsx index 571741ed..9aae056b 100644 --- a/src/components/floor-plan/modal/setting01/dimensionLine/DimensionLineSetting.jsx +++ b/src/components/floor-plan/modal/setting01/dimensionLine/DimensionLineSetting.jsx @@ -192,7 +192,7 @@ export default function DimensionLineSetting(props) { return (
-
+

{getMessage('modal.canvas.setting.font.plan.absorption.dimension.line')}

+
) diff --git a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx index 0691046d..708897c0 100644 --- a/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx +++ b/src/components/floor-plan/modal/setting01/planSize/PlanSizeSetting.jsx @@ -57,7 +57,7 @@ export default function PlanSizeSetting(props) { return (
-
+

{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}

+
) diff --git a/src/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting.jsx b/src/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting.jsx index 0edafff9..5e01918d 100644 --- a/src/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting.jsx +++ b/src/components/floor-plan/modal/wallLineOffset/WallLineOffsetSetting.jsx @@ -41,7 +41,7 @@ export default function WallLineOffsetSetting({ id, pos = { x: 50, y: 230 } }) { return (
-
+

{getMessage('modal.wallline.offset.setting')}

+
) diff --git a/src/hooks/useAxios.js b/src/hooks/useAxios.js index 35c90a87..b4b9652d 100644 --- a/src/hooks/useAxios.js +++ b/src/hooks/useAxios.js @@ -97,13 +97,11 @@ export function useAxios(lang = '') { const getFetcher = async (url) => { const res = await get({ url }) - console.log('🚀 ~ getFetcher ~ res:', res) return res } - const postFetcher = async (url, { arg }) => { + const postFetcher = async (url, arg) => { const res = await post({ url, data: arg }) - console.log('🚀 ~ postFetcher ~ res:', res) return res } diff --git a/src/styles/_modal.scss b/src/styles/_modal.scss index 0e767ee7..57ce2c5a 100644 --- a/src/styles/_modal.scss +++ b/src/styles/_modal.scss @@ -4,477 +4,505 @@ $pop-bold-weight: 500; $pop-normal-size: 12px; $alert-color: #101010; -@keyframes mountpop{ - from{opacity: 0; scale: 0.95;} - to{opacity: 1; scale: 1;} +@keyframes mountpop { + from { + opacity: 0; + scale: 0.95; + } + to { + opacity: 1; + scale: 1; + } } -@keyframes unmountpop{ - from{opacity: 1; scale: 1;} - to{opacity: 0; scale: 0.95;} +@keyframes unmountpop { + from { + opacity: 1; + scale: 1; + } + to { + opacity: 0; + scale: 0.95; + } } -.normal-font{ - font-size: 12px; - font-weight: 400; - color: #fff; +.normal-font { + font-size: 12px; + font-weight: 400; + color: #fff; } -.bold-font{ - font-size: 12px; - font-weight: 500; - color: #fff; +.bold-font { + font-size: 12px; + font-weight: 500; + color: #fff; } -.modal-pop-wrap{ - position: fixed; - top: 0; - left: 0; - width: 100%; - height: -webkit-fit-content; - height: -moz-fit-content; - height: fit-content; - border: 1px solid #000; - border-radius: 4px; - background-color: #272727; - z-index: 100000; - &.xsm{ - width: 200px; +.modal-pop-wrap { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: -webkit-fit-content; + height: -moz-fit-content; + height: fit-content; + border: 1px solid #000; + border-radius: 4px; + background-color: #272727; + z-index: 100000; + &.xsm { + width: 200px; + } + &.xxxm { + width: 240px; + } + &.xxm { + width: 270px; + } + &.xm { + width: 300px; + } + &.ssm { + width: 380px; + } + &.sm { + width: 580px; + } + &.r { + width: 400px; + } + &.lr { + width: 440px; + } + &.lr-2 { + width: 450px; + } + &.lrr { + width: 480px; + } + &.ml { + width: 530px; + } + &.l-2 { + width: 640px; + } + &.lx-2 { + width: 740px; + } + &.lx { + width: 770px; + } + &.l { + width: 800px; + } + &.ll { + width: 900px; + } + &.mount { + animation: mountpop 0.17s ease-in-out forwards; + } + &.unmount { + animation: unmountpop 0.17s ease-in-out forwards; + } + &.alert { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: transparent; + border: none; + .modal-head { + background-color: transparent; + padding: 0 0 8px; + .modal-close { + width: 20px; + height: 20px; + background: url(../../public/static/images/canvas/alert_close.svg) no-repeat center; + } } - &.xxxm{ - width: 240px; - } - &.xxm{ - width: 270px; - } - &.xm{ - width: 300px; - } - &.ssm{ - width: 380px; - } - &.sm{ - width: 580px; - } - &.r{ - width: 400px; - } - &.lr{ - width: 440px; - } - &.lr-2{ - width: 450px; - } - &.lrr{ - width: 480px; - } - &.ml{ - width: 530px; - } - &.l-2{ - width: 640px; - } - &.lx-2{ - width: 740px; - } - &.lx{ - width: 770px; - } - &.l{ - width: 800px; - } - &.ll{ - width: 900px; - } - &.mount{ - animation: mountpop .17s ease-in-out forwards; - } - &.unmount{ - animation: unmountpop .17s ease-in-out forwards; - } - &.alert{ - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: transparent; - border: none; - .modal-head{ - background-color: transparent; - padding: 0 0 8px; - .modal-close{ - width: 20px; - height: 20px; - background: url(../../public/static/images/canvas/alert_close.svg)no-repeat center; - } - } - .modal-body{ - background-color: #fff; - padding: 22px; - border-radius: 4px; - border: 1px solid #101010; - color: $alert-color; - .alert-title{ - font-size: 13px; - font-weight: 700; - color: $alert-color; - margin-bottom: 15px; - } - } - } -} -.modal-head{ - display: flex; - align-items: center; - padding: 10px 24px; - background-color: #000; - // overflow: hidden; - h1.title{ + .modal-body { + background-color: #fff; + padding: 22px; + border-radius: 4px; + border: 1px solid #101010; + color: $alert-color; + .alert-title { font-size: 13px; - color: $pop-color; font-weight: 700; - } - .modal-close{ - margin-left: auto; - color: transparent; - font-size: 0; - width: 10px; - height: 10px; - background: url(../../public/static/images/canvas/modal_close.svg)no-repeat center; - } -} -.modal-body{ - padding: 24px; - .modal-btn-wrap{ - display: flex; - align-items: center; - gap: 5px; - button{ - flex: 1; - } - &.sub{ - button{ - flex: 1 1 auto; - padding: 0; - } - margin-bottom: 14px; - } - } - .modal-check-btn-wrap{ - margin-top: 15px; - .check-wrap-title{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: 600; - &.light{ - font-weight: $pop-normal-weight; - } - } - .flex-check-box{ - display: flex; - flex-wrap: wrap; - gap: 10px; - margin-top: 15px; - &.for2{ - justify-content: flex-end; - button{ - width: calc(50% - 5px); - } - &.btn{ - gap: 5px; - button{ - width: calc(50% - 2.5px); - } - } - } - &.for-line{ - button{ - flex: 1; - } - } - } - } - .outer-line-wrap{ - border-top: 1px solid #3C3C3C; - margin-top: 10px; - padding-top: 15px; - margin-bottom: 15px; - > div{ - margin-bottom: 15px; - &:last-child{ - margin-bottom: 0; - } - } - } - .modal-guide{ - display: block; - font-size: $pop-normal-size; color: $alert-color; - font-weight: $pop-normal-weight; + margin-bottom: 15px; + } } + } } - -.adsorption-point{ +.modal-head { + display: flex; + align-items: center; + padding: 10px 24px; + background-color: #000; + // overflow: hidden; + cursor: pointer; + h1.title { + font-size: 13px; + color: $pop-color; + font-weight: 700; + } + .modal-close { + margin-left: auto; + color: transparent; + font-size: 0; + width: 10px; + height: 10px; + background: url(../../public/static/images/canvas/modal_close.svg) no-repeat center; + } +} +.modal-body { + padding: 24px; + .modal-btn-wrap { display: flex; align-items: center; - background-color: #3A3A3A; - border-radius: 3px; - padding-left: 11px; - overflow: hidden; - transition: all 0.17s ease-in-out; - span{ - font-size: $pop-normal-size; - color: #898989; + gap: 5px; + button { + flex: 1; } - i{ - display: flex; - align-items: center; - padding: 0 7px; - margin-left: auto; - height: 100%; - font-size: 13px; - color: #898989; + &.sub { + button { + flex: 1 1 auto; + padding: 0; + } + margin-bottom: 14px; } - &.act{ - i{ - color: $pop-color; - background-color: #1083E3; + } + .modal-check-btn-wrap { + margin-top: 15px; + .check-wrap-title { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: 600; + &.light { + font-weight: $pop-normal-weight; + } + } + .flex-check-box { + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-top: 15px; + &.for2 { + justify-content: flex-end; + button { + width: calc(50% - 5px); } + &.btn { + gap: 5px; + button { + width: calc(50% - 2.5px); + } + } + } + &.for-line { + button { + flex: 1; + } + } } + } + .outer-line-wrap { + border-top: 1px solid #3c3c3c; + margin-top: 10px; + padding-top: 15px; + margin-bottom: 15px; + > div { + margin-bottom: 15px; + &:last-child { + margin-bottom: 0; + } + } + } + .modal-guide { + display: block; + font-size: $pop-normal-size; + color: $alert-color; + font-weight: $pop-normal-weight; + } +} +.modal-foot { + display: block; + width: 100%; + padding: 5px 0; + background-color: #000; + cursor: pointer; +} + +.adsorption-point { + display: flex; + align-items: center; + background-color: #3a3a3a; + border-radius: 3px; + padding-left: 11px; + overflow: hidden; + transition: all 0.17s ease-in-out; + span { + font-size: $pop-normal-size; + color: #898989; + } + i { + display: flex; + align-items: center; + padding: 0 7px; + margin-left: auto; + height: 100%; + font-size: 13px; + color: #898989; + } + &.act { + i { + color: $pop-color; + background-color: #1083e3; + } + } } // grid-option -.grid-check-form{ +.grid-check-form { + display: flex; + align-items: center; + gap: 15px; + padding-bottom: 15px; + &.border { + border-bottom: 1px solid #424242; + } +} +.grid-option-overflow { + max-height: 350px; + overflow-y: auto; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } +} +.grid-option-wrap { + .grid-option-box { display: flex; align-items: center; - gap: 15px; - padding-bottom: 15px; - &.border{ - border-bottom: 1px solid #424242; - } -} -.grid-option-overflow{ - max-height: 350px; - overflow-y: auto; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #D9D9D9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } -} -.grid-option-wrap{ - .grid-option-box{ - display: flex; - align-items: center; - background-color: transparent; - border: 1px solid #3D3D3D; - border-radius: 2px; - padding: 15px 10px; - gap: 20px; - margin-bottom: 10px; - .grid-input-form{ - display: flex; - align-items: center; - span{ - flex: none; - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - } - .input-grid{ - width: 54px; - input{ - width: 100%; - } - } - } - &:last-child{ - margin-bottom: 0; - } - } - .grid-option-block-form{ - flex: 1; - } -} -.select-form{ - .sort-select{width: 100%;} -} -.grid-select{ - flex: 1; - &.no-flx{ - flex: unset; - } - .sort-select{ - width: 100%; - background-color: #313131; - min-width: auto; - font-size: 12px; - border: none; - p{ - font-size: 12px; - } - > ul{ - border: none; - } - } - &.right{ - p{ - text-align: right; - } - ul{ - li{ - justify-content: flex-end; - } - } - } -} -.grid-btn-wrap{ - padding-top: 15px; - text-align: right; - button{ - padding: 0 10px; - } -} - -// grid copy -.grid-option-tit{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - padding-bottom: 15px; - -} -.grid-direction{ - display: flex; - align-items: center; - gap: 5px; - flex: 1; -} -.direction{ - width: 22px; - height: 22px; - background-color: #757575; - background-image: url(../../public/static/images/canvas/grid_option_arr.svg); - background-repeat: no-repeat; - background-position: center; - background-size: 16px 15px; - border-radius: 50%; - transition: all .15s ease-in-out; - opacity: 0.6; - &.down{transform: rotate(180deg);} - &.left{transform: rotate(-90deg);} - &.right{transform: rotate(90deg);} - &:hover, - &.act{ - opacity: 1; - } -} - -// grid-move -.move-form{ - width: 100%; - p{ + background-color: transparent; + border: 1px solid #3d3d3d; + border-radius: 2px; + padding: 15px 10px; + gap: 20px; + margin-bottom: 10px; + .grid-input-form { + display: flex; + align-items: center; + span { + flex: none; font-size: $pop-normal-size; color: $pop-color; font-weight: $pop-bold-weight; - } -} -.input-move-wrap{ - display: flex; - align-items: center; - gap: 5px; - span{ - color: $pop-color; - font-size: $pop-normal-size; - } - .input-move{ - width: 130px; - input{ - width: 100%; + } + .input-grid { + width: 54px; + input { + width: 100%; } + } } + &:last-child { + margin-bottom: 0; + } + } + .grid-option-block-form { + flex: 1; + } } -.direction-move-wrap{ - flex: none; - display: grid; - grid-template-columns: 1fr 1fr; - gap: 5px; - margin-left: auto; +.select-form { + .sort-select { + width: 100%; + } +} +.grid-select { + flex: 1; + &.no-flx { + flex: unset; + } + .sort-select { + width: 100%; + background-color: #313131; + min-width: auto; + font-size: 12px; + border: none; + p { + font-size: 12px; + } + > ul { + border: none; + } + } + &.right { + p { + text-align: right; + } + ul { + li { + justify-content: flex-end; + } + } + } +} +.grid-btn-wrap { + padding-top: 15px; + text-align: right; + button { + padding: 0 10px; + } +} + +// grid copy +.grid-option-tit { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + padding-bottom: 15px; +} +.grid-direction { + display: flex; + align-items: center; + gap: 5px; + flex: 1; +} +.direction { + width: 22px; + height: 22px; + background-color: #757575; + background-image: url(../../public/static/images/canvas/grid_option_arr.svg); + background-repeat: no-repeat; + background-position: center; + background-size: 16px 15px; + border-radius: 50%; + transition: all 0.15s ease-in-out; + opacity: 0.6; + &.down { + transform: rotate(180deg); + } + &.left { + transform: rotate(-90deg); + } + &.right { + transform: rotate(90deg); + } + &:hover, + &.act { + opacity: 1; + } +} + +// grid-move +.move-form { + width: 100%; + p { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + } +} +.input-move-wrap { + display: flex; + align-items: center; + gap: 5px; + span { + color: $pop-color; + font-size: $pop-normal-size; + } + .input-move { + width: 130px; + input { + width: 100%; + } + } +} +.direction-move-wrap { + flex: none; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 5px; + margin-left: auto; } // 배치면 초기 설정 -.placement-table{ - table{ - table-layout: fixed; - tr{ - th{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - padding: 18px 0; - border-bottom: 1px solid #424242; - vertical-align: middle; - .tip-wrap{ - display: flex; - align-items: center; - } - } - td{ - font-size: $pop-normal-size; - color: $pop-color; - border-bottom: 1px solid #424242; - padding: 18px 0 18px 20px; - vertical-align: middle; - .flex-box{ - display: flex; - align-items: center; - } - } - &:first-child{ - td, - th{ - padding-top: 0; - } - } +.placement-table { + table { + table-layout: fixed; + tr { + th { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + padding: 18px 0; + border-bottom: 1px solid #424242; + vertical-align: middle; + .tip-wrap { + display: flex; + align-items: center; } + } + td { + font-size: $pop-normal-size; + color: $pop-color; + border-bottom: 1px solid #424242; + padding: 18px 0 18px 20px; + vertical-align: middle; + .flex-box { + display: flex; + align-items: center; + } + } + &:first-child { + td, + th { + padding-top: 0; + } + } } - .tooltip{ - position: relative; - display: block; - width: 15px; - height: 15px; - margin-left: 5px; - background: url(../../public/static/images/canvas/pop_tip.svg)no-repeat center; - background-size: cover; + } + .tooltip { + position: relative; + display: block; + width: 15px; + height: 15px; + margin-left: 5px; + background: url(../../public/static/images/canvas/pop_tip.svg) no-repeat center; + background-size: cover; + } + &.light { + padding: 0; + th, + td { + color: $alert-color; + border-bottom: none; + border-top: 1px solid #efefef; } - &.light{ - padding: 0; - th,td{ - color: $alert-color; - border-bottom: none; - border-top: 1px solid #EFEFEF; - } - th{ - padding: 14px 0; - } - tr{ - &:first-child{ - td, - th{ - padding-top: 14px; - } - } - &:last-child{ - td, - th{ - padding-bottom: 0px; - } - } - } + th { + padding: 14px 0; } + tr { + &:first-child { + td, + th { + padding-top: 14px; + } + } + &:last-child { + td, + th { + padding-bottom: 0px; + } + } + } + } } // 2024-12-11 @@ -485,1612 +513,1793 @@ $alert-color: #101010; // max-width: 250px; // } -.pop-form-radio{ - display: flex; - align-items: center; - gap: 10px; +.pop-form-radio { + display: flex; + align-items: center; + gap: 10px; } -.placement-option{ - display: flex; - align-items: center; - gap: 20px; +.placement-option { + display: flex; + align-items: center; + gap: 20px; } -.select-wrap{ - .sort-select{ - width: 100%; - } -} -.flex-ment{ - display: flex; - align-items: center; - gap: 5px; - span{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - } - -} - -.img-edit-wrap{ - flex: none; - .img-edit-btn{ - display: flex; - align-items: center; - height: 30px; - padding: 0 10px; - font-size: 12px; - font-weight: 400; - color: #101010; - background-color: #fff; - border-radius: 2px; - cursor: pointer; - transition: all .15s ease-in-out; - .img-edit{ - width: 16px; - height: 16px; - background: url(../../public/static/images/canvas/img_edit_ico.svg)no-repeat center; - background-size: cover; - margin-right: 5px; - } - &:hover{ - background-color: #ebebeb; - } - } -} -.img-name-wrap{ - display: flex; - align-items: center; +.select-wrap { + .sort-select { width: 100%; - margin-left: 10px; - input{ - flex: 1; - - } - .img-check{ - flex: none; - width: 18px; - height: 18px; - margin-left: 5px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - background-image: url(../../public/static/images/canvas/img_check_fail.svg); - } + } +} +.flex-ment { + display: flex; + align-items: center; + gap: 5px; + span { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + } } -.for-address{ - input{ - flex: 1; +.img-edit-wrap { + flex: none; + .img-edit-btn { + display: flex; + align-items: center; + height: 30px; + padding: 0 10px; + font-size: 12px; + font-weight: 400; + color: #101010; + background-color: #fff; + border-radius: 2px; + cursor: pointer; + transition: all 0.15s ease-in-out; + .img-edit { + width: 16px; + height: 16px; + background: url(../../public/static/images/canvas/img_edit_ico.svg) no-repeat center; + background-size: cover; + margin-right: 5px; } - .check-address{ - flex: none; - width: 18px; - height: 18px; - margin-left: 5px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - &.fail{background-image: url(../../public/static/images/canvas/img_check_fail.svg);} - &.success{background-image: url(../../public/static/images/canvas/img_check_success.svg);} + &:hover { + background-color: #ebebeb; } + } +} +.img-name-wrap { + display: flex; + align-items: center; + width: 100%; + margin-left: 10px; + input { + flex: 1; + } + .img-check { + flex: none; + width: 18px; + height: 18px; + margin-left: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + background-image: url(../../public/static/images/canvas/img_check_fail.svg); + } +} + +.for-address { + input { + flex: 1; + } + .check-address { + flex: none; + width: 18px; + height: 18px; + margin-left: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + &.fail { + background-image: url(../../public/static/images/canvas/img_check_fail.svg); + } + &.success { + background-image: url(../../public/static/images/canvas/img_check_success.svg); + } + } } // 외벽선 그리기 -.outline-wrap{ - padding: 24px 0; - border-top: 1px solid #424242; - - .outline-inner{ - display: flex; - align-items: center; - margin-bottom: 14px; - &:last-child{ - margin-bottom: 0; - } - .outline-form{ - // width: 50%; - margin-right: 15px; - } - } - &:last-child{ - border-bottom: 1px solid #424242; - } -} -.outline-form{ +.outline-wrap { + padding: 24px 0; + border-top: 1px solid #424242; + + .outline-inner { display: flex; align-items: center; - - span{ - width: 60px; - flex: none; - font-size: $pop-normal-size; - font-weight: $pop-bold-weight; - color: $pop-color; - margin-right: 10px; - &.thin{ - width: auto; - font-weight: $pop-normal-weight; - margin-right: 0; - } + margin-bottom: 14px; + &:last-child { + margin-bottom: 0; } + .outline-form { + // width: 50%; + margin-right: 15px; + } + } + &:last-child { + border-bottom: 1px solid #424242; + } +} +.outline-form { + display: flex; + align-items: center; - .reset-btn{ - flex: none; - width: 30px; - height: 30px; - background: transparent; - border: 1px solid #484848; - border-radius: 2px; - margin-left: 5px; - background-image: url(../../public/static/images/canvas/reset_ico.svg); - background-repeat: no-repeat; - background-size: 12px 12px; - background-position: center; - } - &:last-child{ - margin-right: 0; + span { + width: 60px; + flex: none; + font-size: $pop-normal-size; + font-weight: $pop-bold-weight; + color: $pop-color; + margin-right: 10px; + &.thin { + width: auto; + font-weight: $pop-normal-weight; + margin-right: 0; } + } + + .reset-btn { + flex: none; + width: 30px; + height: 30px; + background: transparent; + border: 1px solid #484848; + border-radius: 2px; + margin-left: 5px; + background-image: url(../../public/static/images/canvas/reset_ico.svg); + background-repeat: no-repeat; + background-size: 12px 12px; + background-position: center; + } + &:last-child { + margin-right: 0; + } } -.cul-wrap{ +.cul-wrap { + display: flex; + .outline-box { + width: 50%; + margin-right: 15px; + .outline-form { + width: 100%; + margin-bottom: 14px; + margin-right: 0; + &:last-child { + margin-bottom: 0; + } + } + } + .cul-box { display: flex; - .outline-box{ - width: 50%; - margin-right: 15px; - .outline-form{ - width: 100%; - margin-bottom: 14px; - margin-right: 0; - &:last-child{ - margin-bottom: 0; - } - } - } - .cul-box{ - display: flex; - align-items: center; - justify-content: center; - width: 50%; - background-color: #3D3D3D; - border-radius: 2px ; - } + align-items: center; + justify-content: center; + width: 50%; + background-color: #3d3d3d; + border-radius: 2px; + } } // 외벽선 속성 설정 -.properties-guide{ - font-size: $pop-normal-size; - color: #AAA; - font-weight: $pop-normal-weight; - margin-bottom: 14px; +.properties-guide { + font-size: $pop-normal-size; + color: #aaa; + font-weight: $pop-normal-weight; + margin-bottom: 14px; } -.setting-tit{ - font-size: 13px; - color: $pop-color; - font-weight: $pop-bold-weight; - margin-bottom: 10px; +.setting-tit { + font-size: 13px; + color: $pop-color; + font-weight: $pop-bold-weight; + margin-bottom: 10px; } -.properties-setting-wrap{ - &.outer{ - margin-top: 24px; - } - .setting-btn-wrap{ - display: flex; - align-items: center; - padding: 14px 0; - border-top: 1px solid #424242; - border-bottom: 1px solid #424242; - .setting-btn{ - display: block; - width: 100%; - height: 40px; - font-size: 13px; - color: #fff; - font-weight: 700; - border-radius: 2px; - transition: all .15s ease-in-out; - &.green{ - background-color: #305941; - border: 1px solid #45CD7D; - &:hover{ - background-color: #3a6b4e; - } - } - &.blue{ - background-color: #2E5360; - border: 1px solid #3FBAE6; - &:hover{ - background-color: #365f6e; - } - } - } - } -} - -// 지붕형상 설정 -.roof-shape-menu{ - display: grid; - grid-template-columns: 1fr 1fr 1fr 1fr; - grid-template-rows: 1fr 1fr; - gap: 24px 10px; - margin-bottom: 24px; - .shape-box{ - display: flex; - align-items: center; - justify-content: center; - width: 100%; - padding: 13px; - background-color: #3D3D3D; - transition: background .15s ease-in-out; - img{ - max-width: 100%; - } - } - .shape-title{ - font-size: $pop-normal-size; - font-weight: $pop-bold-weight; - color: $pop-color; - margin-top: 10px; - text-align: center; - transition: color .15s ease-in-out; - } - .shape-menu-box{ - &.act, - &:hover{ - .shape-box{background-color: #008BFF;} - .shape-title{color: #008BFF;} - } - } -} - -.setting-box{ +.properties-setting-wrap { + &.outer { + margin-top: 24px; + } + .setting-btn-wrap { + display: flex; + align-items: center; padding: 14px 0; border-top: 1px solid #424242; border-bottom: 1px solid #424242; -} -.padding-form{ - padding-left: 23px; -} -.discrimination-box{ - padding: 16px 12px; - border: 1px solid #3D3D3D; - border-radius: 2px; + .setting-btn { + display: block; + width: 100%; + height: 40px; + font-size: 13px; + color: #fff; + font-weight: 700; + border-radius: 2px; + transition: all 0.15s ease-in-out; + &.green { + background-color: #305941; + border: 1px solid #45cd7d; + &:hover { + background-color: #3a6b4e; + } + } + &.blue { + background-color: #2e5360; + border: 1px solid #3fbae6; + &:hover { + background-color: #365f6e; + } + } + } + } } -.modal-bottom-border-bx{ - margin-top: 24px; - padding-bottom: 14px; - border-bottom: 1px solid #424242; +// 지붕형상 설정 +.roof-shape-menu { + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + grid-template-rows: 1fr 1fr; + gap: 24px 10px; + margin-bottom: 24px; + .shape-box { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + padding: 13px; + background-color: #3d3d3d; + transition: background 0.15s ease-in-out; + img { + max-width: 100%; + } + } + .shape-title { + font-size: $pop-normal-size; + font-weight: $pop-bold-weight; + color: $pop-color; + margin-top: 10px; + text-align: center; + transition: color 0.15s ease-in-out; + } + .shape-menu-box { + &.act, + &:hover { + .shape-box { + background-color: #008bff; + } + .shape-title { + color: #008bff; + } + } + } +} + +.setting-box { + padding: 14px 0; + border-top: 1px solid #424242; + border-bottom: 1px solid #424242; +} +.padding-form { + padding-left: 23px; +} +.discrimination-box { + padding: 16px 12px; + border: 1px solid #3d3d3d; + border-radius: 2px; +} + +.modal-bottom-border-bx { + margin-top: 24px; + padding-bottom: 14px; + border-bottom: 1px solid #424242; } // 처마∙케라바 변경 -.eaves-keraba-table{ - display: table; - border-collapse: collapse; - .eaves-keraba-item{ - display: table-row; - .eaves-keraba-th, - .eaves-keraba-td{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - display: table-cell; - vertical-align: middle; - padding-bottom: 14px; - } - .eaves-keraba-td{ - padding-left: 10px; - } - .eaves-keraba-ico{ - display: flex; - align-items: center; - justify-content: center; - padding: 5px; - background-color: #3D3D3D; - border: 1px solid #3D3D3D; - border-radius: 2px; - cursor: pointer; - &.act{ - border: 1px solid #ED0004; - } - } - &:last-child{ - .eaves-keraba-th, - .eaves-keraba-td{ - padding-bottom: 0; - } - } +.eaves-keraba-table { + display: table; + border-collapse: collapse; + .eaves-keraba-item { + display: table-row; + .eaves-keraba-th, + .eaves-keraba-td { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + display: table-cell; + vertical-align: middle; + padding-bottom: 14px; } + .eaves-keraba-td { + padding-left: 10px; + } + .eaves-keraba-ico { + display: flex; + align-items: center; + justify-content: center; + padding: 5px; + background-color: #3d3d3d; + border: 1px solid #3d3d3d; + border-radius: 2px; + cursor: pointer; + &.act { + border: 1px solid #ed0004; + } + } + &:last-child { + .eaves-keraba-th, + .eaves-keraba-td { + padding-bottom: 0; + } + } + } } -.guide{ - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: $pop-color; - margin-bottom: 24px; - &.sm{ - margin-bottom: 15px; - } - span{ - display: block; - } +.guide { + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: $pop-color; + margin-bottom: 24px; + &.sm { + margin-bottom: 15px; + } + span { + display: block; + } } // 지붕면 할당 -.allocation-select-wrap{ +.allocation-select-wrap { + display: flex; + align-items: center; + padding-bottom: 14px; + border-bottom: 1px solid #424242; + margin-bottom: 14px; + span { + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + margin-right: 10px; + } + .allocation-edit { display: flex; align-items: center; - padding-bottom: 14px; - border-bottom: 1px solid #424242; - margin-bottom: 14px; - span{ - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - margin-right: 10px; - } - .allocation-edit{ - display: flex; - align-items: center; - height: 30px; - padding: 0 10px; - margin-left: 5px; - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - border: 1px solid #484848; - background-color: #323234; - i{ - display: block; - width: 12px; - height: 12px; - margin-right: 5px; - background: url(../../public/static/images/canvas/allocation_edit.svg)no-repeat center; - background-size: cover; - } + height: 30px; + padding: 0 10px; + margin-left: 5px; + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + border: 1px solid #484848; + background-color: #323234; + i { + display: block; + width: 12px; + height: 12px; + margin-right: 5px; + background: url(../../public/static/images/canvas/allocation_edit.svg) no-repeat center; + background-size: cover; } + } } -.block-box{ - display: flex; - align-items: center; +.block-box { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 10px; + .flex-ment { gap: 10px; - margin-bottom: 10px; - .flex-ment{ - gap: 10px; - .dec{ - text-decoration: underline; - } - .delete{ - display: block; - width: 15px; - height: 15px; - background: url(../../public/static/images/canvas/allocation_delete.svg)no-repeat center; - background-size: cover; - } + .dec { + text-decoration: underline; } - &:last-child{ - margin-bottom: 0; + .delete { + display: block; + width: 15px; + height: 15px; + background: url(../../public/static/images/canvas/allocation_delete.svg) no-repeat center; + background-size: cover; } + } + &:last-child { + margin-bottom: 0; + } } -.icon-btn-wrap{ - flex: 1; +.icon-btn-wrap { + flex: 1; + display: flex; + align-items: center; + gap: 5px; + button { display: flex; align-items: center; - gap: 5px; - button{ - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 30px; - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: $pop-color; - border: 1px solid #646464; - border-radius: 2px; - padding: 0 10px; - transition: all .15s ease-in-out; - i{ - height: 15px; - display: block; - margin-left: 10px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - transition: all .15s ease-in-out; - &.allocation01{ - background-image: url(../../public/static/images/canvas/allocation_icon01_white.svg); - width: 15px; - } - &.allocation02{ - background-image: url(../../public/static/images/canvas/allocation_icon02_white.svg); - width: 18px; - } - } - &.act, - &:hover{ - color: #101010; - border: 1px solid #101010; - background-color: #fff; - i{ - &.allocation01{ - background-image: url(../../public/static/images/canvas/allocation_icon01_black.svg); - } - &.allocation02{ - background-image: url(../../public/static/images/canvas/allocation_icon02_black.svg); - } - } - } - } -} - -// 경사설정 -.slope-wrap{ - padding-bottom: 24px; - border-bottom: 1px solid #424242; -} - -// 면형상 배치 -.plane-frame-wrap{ - display: flex; - gap: 10px; - .plane-shape-wrap{ - flex: none; - width: 73px; - } -} - -.plane-shape-menu{ - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 5px; - .shape-menu-box{ - border-radius: 2px; - width: 34px; - height: 34px; - background-color: #373737; - border: 1px solid #676767; - transition: background .15s ease-in-out, border .15s ease-in-out; - .shape-box{ - display: flex; - justify-content: center; - align-items: center; - position: relative; - width: 100%; - height: 100%; - border-radius: 2px; - } - &.act, - &:hover{ - border-color: #008BFF; - background-color: #008BFF; - } - } -} - -.shape-library{ - display: flex; - flex-direction: column; - align-items: center; justify-content: center; - gap: 5px; - padding-top: 5px; - .library-btn{ - width: 100%; - height: 34px; - border: 1px solid #6C6C6C; - border-radius: 2px; - background-color: #373737; - background-repeat: no-repeat; - background-position: center; - transition: all .15s ease-in-out; - &.ico01{background-image: url(../../public/static/images/canvas/shape_labrary01.svg); background-size: 19px 18px;} - &.ico02{background-image: url(../../public/static/images/canvas/shape_labrary02.svg); background-size: 15px 20px;} - &.ico03{background-image: url(../../public/static/images/canvas/shape_labrary03.svg); background-size: 19px 16px;} - &:hover{ - border-color: #1083E3; - background-color: #1083E3; - } - } -} - -.plane-detail-wrap{ - display: flex; - flex-direction: column; - flex: 1; -} -.plane-shape-wrapper{ - flex: 1; - display: flex; - flex-direction: column; - gap: 10px; - .plane-box{ - width: 100%; - padding: 10px 18px; - border-radius: 2px; - background-color: #313131; - border: 1px solid #484848; - .plane-box-tit{ - font-size: $pop-normal-size; - font-weight: 600; - color: $pop-color; - margin-bottom: 10px; - } - &.shape-box{ - .shape-box-inner{ - display: flex; - gap:15px; - min-height: 140px; - .shape-img{ - position: relative; - flex: none; - width: 150px; - background-color: #fff; - border-radius: 2px; - img{ - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } - .shape-data{ - flex: 1; - .eaves-keraba-table{ - .eaves-keraba-item{ - .eaves-keraba-th, - .eaves-keraba-td{ - padding-bottom: 10px; - } - &:last-child{ - .eaves-keraba-th, - .eaves-keraba-td{ - padding-bottom: 0px; - } - } - } - } - } - } - } - &.direction-box{ - flex: 1; - display: flex; - flex-direction: column; - .plane-direction-box{ - flex: 1; - display: flex; - align-items: center; - justify-content: center; - width: 100%; - } - } - } -} -.plane-direction{ - width: 150px; - position: relative; - height: 120px; - span{ - position: absolute; - font-size: 12px; - font-weight: 500; - color: #B1B1B1; - &.top{top: 0; left: 50%; transform: translateX(-50%);} - &.right{top: 50%; right: 0; transform: translateY(-50%);} - &.bottom{bottom: 0; left: 50%; transform: translateX(-50%);} - &.left{top: 50%; left: 0; transform: translateY(-50%);} - } - .plane-btn{ - position: absolute; - width: 28px; - height: 28px; - background-color: #777777; - background-image: url(../../public/static/images/canvas/plane_arr.svg); - background-size: 12px 13px; - background-repeat: no-repeat; - background-position: center; - border-radius: 50%; - transition: all .15s ease-in-out; - &.up{top: 22px; left: 50%; transform: translateX(-50%);} - &.right{top: 50%; right: 32px; transform: translateY(-50%) rotate(90deg);} - &.down{bottom: 22px; left: 50%; transform: translateX(-50%) rotate(180deg);} - &.left{top: 50%; left: 32px; transform: translateY(-50%) rotate(270deg);} - &:hover, - &.act{ - background-color: #fff; - background-image: url(../../public/static/images/canvas/plane_arr_act.svg); - } - } -} - -.plane-tab-guide{ + width: 100%; + height: 30px; font-size: $pop-normal-size; font-weight: $pop-normal-weight; color: $pop-color; - margin-top: 10px; -} -.plane-shape-btn{ - padding-top: 10px; - margin-top: auto; - button{ - display: block; - width: 100%; + border: 1px solid #646464; + border-radius: 2px; + padding: 0 10px; + transition: all 0.15s ease-in-out; + i { + height: 15px; + display: block; + margin-left: 10px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + transition: all 0.15s ease-in-out; + &.allocation01 { + background-image: url(../../public/static/images/canvas/allocation_icon01_white.svg); + width: 15px; + } + &.allocation02 { + background-image: url(../../public/static/images/canvas/allocation_icon02_white.svg); + width: 18px; + } } + &.act, + &:hover { + color: #101010; + border: 1px solid #101010; + background-color: #fff; + i { + &.allocation01 { + background-image: url(../../public/static/images/canvas/allocation_icon01_black.svg); + } + &.allocation02 { + background-image: url(../../public/static/images/canvas/allocation_icon02_black.svg); + } + } + } + } } -// 오브젝트 배치 -.mb-box{ - margin-bottom: 24px; +// 경사설정 +.slope-wrap { + padding-bottom: 24px; + border-bottom: 1px solid #424242; } -.object-direction-wrap{ - display: flex; - align-items: center; - justify-content: center; -} -.discrimination-tit{ - font-size: 13px; - color: #fff; - font-weight: 500; +// 면형상 배치 +.plane-frame-wrap { + display: flex; + gap: 10px; + .plane-shape-wrap { + flex: none; + width: 73px; + } } -.object-size-wrap{ - display: flex; - min-height: 206px; - gap: 24px; - margin-top: 14px; - .object-size-img{ - position: relative; - flex: none; - width: 200px; - background-color: #fff; - img{ +.plane-shape-menu { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 5px; + .shape-menu-box { + border-radius: 2px; + width: 34px; + height: 34px; + background-color: #373737; + border: 1px solid #676767; + transition: + background 0.15s ease-in-out, + border 0.15s ease-in-out; + .shape-box { + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: 100%; + height: 100%; + border-radius: 2px; + } + &.act, + &:hover { + border-color: #008bff; + background-color: #008bff; + } + } +} + +.shape-library { + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 5px; + padding-top: 5px; + .library-btn { + width: 100%; + height: 34px; + border: 1px solid #6c6c6c; + border-radius: 2px; + background-color: #373737; + background-repeat: no-repeat; + background-position: center; + transition: all 0.15s ease-in-out; + &.ico01 { + background-image: url(../../public/static/images/canvas/shape_labrary01.svg); + background-size: 19px 18px; + } + &.ico02 { + background-image: url(../../public/static/images/canvas/shape_labrary02.svg); + background-size: 15px 20px; + } + &.ico03 { + background-image: url(../../public/static/images/canvas/shape_labrary03.svg); + background-size: 19px 16px; + } + &:hover { + border-color: #1083e3; + background-color: #1083e3; + } + } +} + +.plane-detail-wrap { + display: flex; + flex-direction: column; + flex: 1; +} +.plane-shape-wrapper { + flex: 1; + display: flex; + flex-direction: column; + gap: 10px; + .plane-box { + width: 100%; + padding: 10px 18px; + border-radius: 2px; + background-color: #313131; + border: 1px solid #484848; + .plane-box-tit { + font-size: $pop-normal-size; + font-weight: 600; + color: $pop-color; + margin-bottom: 10px; + } + &.shape-box { + .shape-box-inner { + display: flex; + gap: 15px; + min-height: 140px; + .shape-img { + position: relative; + flex: none; + width: 150px; + background-color: #fff; + border-radius: 2px; + img { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); + } } - } -} - -// 표시변경 -.display-change-wrap{ - margin: 24px 0; -} -.warning{ - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: #FFAFAF; -} - -// 각 변 속성 변경 -.radio-grid-wrap{ - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 24px 15px; -} - -// 면 흐름 설정 -.drawing-flow-wrap{ - display: flex; - gap: 10px; - .discrimination-box{ - flex: 1; - display: flex; - flex-direction: column; - .object-direction-wrap{ - flex: 1; - } - &:first-child{ - flex: none; - width: 195px; - } - } -} - -.compas-box{ - display: flex; - align-items: center; - justify-content: center; -} -.compas-box-inner { - position: relative; - width: 200px; - height: 200px; - border-radius: 50%; - - .circle { - position: absolute; - width: 12px; - height: 12px; - border: 1px solid #fff; - border-radius: 50%; - top: 95%; - left: 50%; - transform-origin: 0 -90px; /* 중심에서 반지름 거리만큼 떨어져 위치 */ - cursor:pointer; - z-index: 3; - /* 0번을 180도 위치(아래)에, 13번을 0도 위치(위)에 배치 */ - i{ - position: absolute; - top: 12.5px; - left: 50%; - font-size: 11px; - color: #8B8B8B; - font-weight: 500; - -webkit-user-select: none; - -moz-user-select: none; - -ms-use-select: none; - user-select: none; - } - &:nth-child(1) { transform: rotate(180deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(180deg);}} - &:nth-child(2) { transform: rotate(195deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(165deg);}} - &:nth-child(3) { transform: rotate(210deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(150deg);}} - &:nth-child(4) { transform: rotate(225deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(135deg);}} - &:nth-child(5) { transform: rotate(240deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(120deg);}} - &:nth-child(6) { transform: rotate(255deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(105deg);}} - &:nth-child(7) { transform: rotate(270deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(90deg);}} - &:nth-child(8) { transform: rotate(285deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(75deg);}} - &:nth-child(9) { transform: rotate(300deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(60deg);}} - &:nth-child(10) { transform: rotate(315deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(45deg);}} - &:nth-child(11) { transform: rotate(330deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(30deg);}} - &:nth-child(12) { transform: rotate(345deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(15deg);}} - &:nth-child(13) { transform: rotate(0deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(0deg);}} - &:nth-child(14) { transform: rotate(15deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-15deg);}} - &:nth-child(15) { transform: rotate(30deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-30deg);}} - &:nth-child(16) { transform: rotate(45deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-45deg);}} - &:nth-child(17) { transform: rotate(60deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-60deg);}} - &:nth-child(18) { transform: rotate(75deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-75deg);}} - &:nth-child(19) { transform: rotate(90deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-90deg);}} - &:nth-child(20) { transform: rotate(105deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-105deg);}} - &:nth-child(21) { transform: rotate(120deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-120deg);}} - &:nth-child(22) { transform: rotate(135deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-135deg);}} - &:nth-child(23) { transform: rotate(150deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-150deg);}} - &:nth-child(24) { transform: rotate(165deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-165deg);}} - &.act{ - &::after{ - content: ''; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 5px; - height: 5px; - background-color: #fff; - border-radius: 50%; - } - i{ - color: #fff; - } - } - } - .compas{ - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 148px; - height: 148px; - border: 4px solid #fff; - border-radius: 50%; - .compas-arr{ - width: 100%; - height: 100%; - background: url(../../public/static/images/canvas/compas.svg)no-repeat center; - background-size: 122px 122px; - } - } -} - -.draw-flow-wrap{ - margin: 10px 0; -} - -// 지붕모듈선택 -.roof-module-tab{ - display: flex; - align-items: center; - gap: 10px; - margin-bottom: 14px; - .module-tab-bx{ - flex: 1; - height: 34px; - line-height: 31px; - border: 1px solid #484848; - border-radius: 2px; - background-color: transparent; - font-size: 12px; - color: #AAA; - text-align: center; - cursor: default; - transition: all .15s ease-in-out; - &.act{ - background-color: #1083E3; - border: 1px solid #1083E3; - color: #fff; - font-weight: 500; - } - } - .tab-arr{ - display: block; - width: 9px; - height: 14px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - background-image: url(../../public/static/images/canvas/module_tab_arr.svg); - transition: all .15s ease-in-out; - &.act{ - background-image: url(../../public/static/images/canvas/module_tab_arr_white.svg); - } - } -} - -.roof-module-compas{ - margin-bottom: 24px; - .compas-box-inner{ - width: 280px; - height: 253px; - .circle{ - top: 86%; - // &:nth-child(1), - // &:nth-child(7), - // &:nth-child(13), - // &:nth-child(19){ - // &::before{ - // content: ''; - // position: absolute; - // top: 20px; - // left: 50%; - // transform: translateX(-50%); - // width: 1px; - // height: 6px; - // background-color: #8B8B8B; - // } - // } - i{ - top: 22px; - } - &.act{ - i{color: #8B8B8B;} - } - } - } -} -.center-wrap{ - display: flex; - flex-direction: column; - align-items: center; - gap: 20px; -} - -.module-table-flex-wrap{ - display: flex; - gap: 10px; - .outline-form{ - flex: 1; - } -} - -.module-box-tab{ - display: flex; - .module-btn{ - flex: 1; - border-top: 1px solid #505050; - border-bottom: 1px solid #505050; - border-right: 1px solid #505050; - background-color: #454545; - color: #fff; - height: 30px; - font-size: 12px; - font-weight: 400; - transition: all .15s ease-in-out; - &:first-child{ - border-left: 1px solid #505050; - } - &.act{ - border-color: #fff; - background-color: #fff; - color: #101010; - } - } -} - -.module-table-box{ - flex: 1; - background-color: #3D3D3D; - border-radius: 2px; - .module-table-inner{ - padding: 10px; - .outline-form{ - span{ - width: auto; - } - } - .module-table-tit{ - padding: 10px 0; - font-size: 12px; - color: #fff; - border-bottom: 1px solid #4D4D4D; - } - .eaves-keraba-table{ - width: 100%; - margin-top: 15px; - .eaves-keraba-th{ - width: 72px; - } - .eaves-keraba-th, - .eaves-keraba-td{ - padding-bottom: 5px; - } - } - .self-table-tit{ - font-size: 12px; - font-weight: 500; - color: #fff; - padding-bottom: 15px; - } - } - .warning-guide{ - padding: 20px; - .warning{ - color: #FFCACA; - max-height: 55px; - overflow-y: auto; - padding-right: 30px; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #D9D9D9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - } - } -} - -.module-self-table{ - display: table; - border-top: 1px solid #4D4D4D; - border-collapse: collapse; - width: 100%; - .self-table-item{ - display: table-row; - .self-item-td, - .self-item-th{ - display: table-cell; - vertical-align: middle; - border-bottom: 1px solid #4D4D4D; - } - .self-item-th{ - width: 60px; - font-size: 12px; - font-weight: 500; - color: #fff; - } - .self-item-td{ - font-size: 12px; - font-weight: 400; - color: #fff; - padding: 15px 20px; - } - } -} - -.self-table-flx{ - display: flex; - align-items: center; - margin-top: 15px; - button{ - margin-left: auto; - } -} -.hexagonal-wrap{ - .hexagonal-item{ - padding: 15px 0; - border-bottom: 1px solid #4D4D4D; - &:first-child{ - padding-top: 0; - } - &:last-child{ - padding-bottom: 0; - border: none; - } - .hexagonal-flx-auto{ - display: flex; - justify-content: space-between; - } - .hexagonal-flx{ - display: flex; - align-items: center; - button{ - margin-left: auto; - } - } - } -} - -// 회로 및 가대설정 -.circuit-check-inner{ - padding: 5px 0; - &.overflow{ - overflow-y: auto; - max-height: 100px; - min-height: 60px; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #D9D9D9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - } - .d-check-box{ - margin-bottom: 15px; - &:last-child{ - margin-bottom: 0; - } - } -} - -.x-scroll-table{ - overflow: auto; - padding-bottom: 5px; - background-color: transparent; - max-height: 170px; - .roof-module-table{ - min-width: 1200px; - } - &::-webkit-scrollbar { - width: 4px; - height: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #b4b4b4; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - &::-webkit-scrollbar-corner{ - background-color: transparent; - } -} - -.circuit-right-wrap{ - display: flex; - justify-content: flex-end; -} - -.circuit-data-form{ - display: flex; - flex-direction: column; - gap: 5px; - min-height: 60px; - padding: 12px; - border: 1px solid rgba(255, 255, 255, 0.20); - span{ - display: inline-flex; - align-items: center; - .del{ - display: block; - margin-left: 10px; - width: 15px; - height: 15px; - background: url(../../public/static/images/canvas/circuit_del.svg)no-repeat center; - background-size: cover; - } - } -} -.circuit-table-tit{ - color: #fff; - font-size: 12px; - font-weight: 600; - padding: 11px 10px; - background-color: #474747; - border: 1px solid #505050; - border-bottom: none; -} - -.circuit-overflow{ - overflow-x: auto; - margin-bottom: 25px; - &::-webkit-scrollbar { - height: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #D9D9D9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - .module-table-box{ - display: flex; - &.by-max{ - min-width: 886px; - } - } -} - -.circuit-table-flx-wrap{ - display: flex; - gap: 10px; - margin-bottom: 10px; - .circuit-table-flx-box{ - flex: 1; - display: flex; - flex-direction: column; - .bottom-wrap{ - margin-top: auto; - } - .roof-module-table{ - table{ - table-layout: fixed; - } - } - } -} - -.circuit-count-input{ - display: flex; - align-items: center; - gap: 10px; -} - -// 모듈부가기능 -.additional-radio-wrap{ - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 15px 0; - margin-bottom: 24px; -} -.additional-wrap{ - padding: 24px 0; - border-top: 1px solid #424242; -} - -.additional-color-wrap{ - display: flex; - align-items: center; - padding: 5px 0; - gap: 15px; - .additional-color-box{ - display: flex; - align-items: center; - gap: 8px; - .additional-color{ - display: block; - width: 16px; - height: 16px; - &.pink{ - border: 2px solid #ce1c9c; - background-color: #16417D; - } - &.white{ - border: 2px solid #FFF; - background-color: #001027; - } - } - } -} - -// color setting -.color-setting-wrap{ - padding-bottom: 15px; - border-bottom: 1px solid #424242; - .color-tit{ - font-size: 13px; - font-weight: 500; - color: #ffffff; - margin-bottom: 10px; - } - .color-picker{ - .react-colorful{ - width: 100%; - height: auto; - gap: 20px; - .react-colorful__pointer{ - width: 15px; - height: 15px; - border: 4px solid #Fff; - } - .react-colorful__saturation{ - border-radius: 2px; - height: 200px; - border-bottom: 5px solid #000; - } - .react-colorful__last-control{ - border-radius: 2px; - height: 10px; - } - } - .hex-color-box{ - display: flex; - align-items: center; - margin-top: 15px; - .color-box-tit{ - font-size: 12px; - color: #fff; - font-weight: 500; - margin-right: 10px; - } - .color-hex-input{ - width: 150px; - margin-right: 5px; - input{ - width: 100%; - } - } - .color-box{ - display: block; - width: 30px; - height: 30px; - border-radius: 4px; - } - } - .default-color-wrap{ - margin-top: 25px; - .default-tit{ - font-size: 12px; - font-weight: 500; - color: #fff; - margin-bottom: 10px; - } - .color-button-wrap{ - display: grid; - grid-template-columns: repeat(8, 1fr); - gap: 21px; - .default-color{ - display: block; - width: 100%; - height: 30px; - border-radius: 4px; + .shape-data { + flex: 1; + .eaves-keraba-table { + .eaves-keraba-item { + .eaves-keraba-th, + .eaves-keraba-td { + padding-bottom: 10px; + } + &:last-child { + .eaves-keraba-th, + .eaves-keraba-td { + padding-bottom: 0px; } + } } + } } + } } -} - -// 글꼴 설정 팝업 -.font-option-warp{ - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 15px 5px; - margin-bottom: 15px; - .font-option-item{ - .option-item-tit{ - font-size: 12px; - font-weight: 500; - color: #fff; - margin-bottom: 10px; - } - } -} -.font-ex-wrap{ - margin-bottom: 15px; - .font-ex-tit{ - font-size: 12px; - font-weight: 500; - color: #fff; - margin-bottom: 10px; - } - .font-ex-box{ + &.direction-box { + flex: 1; + display: flex; + flex-direction: column; + .plane-direction-box { + flex: 1; display: flex; align-items: center; justify-content: center; width: 100%; - min-height: 80px; - background-color: #fff; + } } - + } } - -// 치수선 설정 -.font-btn-wrap{ - margin-bottom: 15px; - button{ - width: 100%; - height: 30px; - line-height: 28px; +.plane-direction { + width: 150px; + position: relative; + height: 120px; + span { + position: absolute; + font-size: 12px; + font-weight: 500; + color: #b1b1b1; + &.top { + top: 0; + left: 50%; + transform: translateX(-50%); } -} - -.line-color-wrap{ - margin-bottom: 15px; - .color-btn{ - display: block; - width: 100%; - height: 30px; - border-radius: 2px; + &.right { + top: 50%; + right: 0; + transform: translateY(-50%); } -} - -.form-box{ - width: 100%; - background-color: #fff; - padding: 10px 15px 20px; - .line-form{ - position: relative; - display: flex; - flex-direction: column; - justify-content: flex-end; - min-width: 102px; - min-height: 40px; - margin: 0 auto; - - &::before{ - content: ''; - position: absolute; - bottom: 0px; - left: 0; - width: 100%; - height: 40px; - border-left: 1px dashed #101010; - border-right: 1px dashed #101010; - } - .line-font-box{ - .font{ - display: block; - padding-bottom: 15px; - color: #101010; - text-align: center; - line-height: 1; - } - .line{ - position: relative; - display: block; - width: 100%; - height: 1px; - border-radius: 30px; - &::before{ - content: ''; - position: absolute; - top: 50%; - transform: translateY(-50%) rotate(45deg); - left: 1px; - width: 9px; - height:+ 9px; - border: 1px solid; - border-color: inherit; - border-top: none; - border-right: none; - } - &::after{ - content: ''; - position: absolute; - top: 50%; - transform: translateY(-50%) rotate(45deg); - right: 1px; - width: 9px; - height: 9px; - border: 1px solid; - border-color: inherit; - border-bottom: none; - border-left: none; - } - } - } + &.bottom { + bottom: 0; + left: 50%; + transform: translateX(-50%); } + &.left { + top: 50%; + left: 0; + transform: translateY(-50%); + } + } + .plane-btn { + position: absolute; + width: 28px; + height: 28px; + background-color: #777777; + background-image: url(../../public/static/images/canvas/plane_arr.svg); + background-size: 12px 13px; + background-repeat: no-repeat; + background-position: center; + border-radius: 50%; + transition: all 0.15s ease-in-out; + &.up { + top: 22px; + left: 50%; + transform: translateX(-50%); + } + &.right { + top: 50%; + right: 32px; + transform: translateY(-50%) rotate(90deg); + } + &.down { + bottom: 22px; + left: 50%; + transform: translateX(-50%) rotate(180deg); + } + &.left { + top: 50%; + left: 32px; + transform: translateY(-50%) rotate(270deg); + } + &:hover, + &.act { + background-color: #fff; + background-image: url(../../public/static/images/canvas/plane_arr_act.svg); + } + } } -// 사이즈 변경 -.size-inner-warp{ - position: relative; +.plane-tab-guide { + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: $pop-color; + margin-top: 10px; } -.size-check-wrap{ - position: relative; +.plane-shape-btn { + padding-top: 10px; + margin-top: auto; + button { display: block; - width: 132px; - height: 132px; - margin: 0 auto; - .size-btn{ - position: absolute; - width: 16px; - height: 16px; - border: 1px solid #fff; - border-radius: 50%; - &.act{ - &::after{ - content: ''; - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 8px; - height: 8px; - background-color: #fff; - border-radius: 50%; - } - } - &:nth-child(1){ top: 0; left: 0; } - &:nth-child(2){ top: 0; right: 0; } - &:nth-child(3){ bottom: 0; left: 0; } - &:nth-child(4){ bottom: 0; right: 0; } + width: 100%; + } +} + +// 오브젝트 배치 +.mb-box { + margin-bottom: 24px; +} + +.object-direction-wrap { + display: flex; + align-items: center; + justify-content: center; +} +.discrimination-tit { + font-size: 13px; + color: #fff; + font-weight: 500; +} + +.object-size-wrap { + display: flex; + min-height: 206px; + gap: 24px; + margin-top: 14px; + .object-size-img { + position: relative; + flex: none; + width: 200px; + background-color: #fff; + img { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); } - .size-box{ + } +} + +// 표시변경 +.display-change-wrap { + margin: 24px 0; +} +.warning { + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: #ffafaf; +} + +// 각 변 속성 변경 +.radio-grid-wrap { + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 24px 15px; +} + +// 면 흐름 설정 +.drawing-flow-wrap { + display: flex; + gap: 10px; + .discrimination-box { + flex: 1; + display: flex; + flex-direction: column; + .object-direction-wrap { + flex: 1; + } + &:first-child { + flex: none; + width: 195px; + } + } +} + +.compas-box { + display: flex; + align-items: center; + justify-content: center; +} +.compas-box-inner { + position: relative; + width: 200px; + height: 200px; + border-radius: 50%; + + .circle { + position: absolute; + width: 12px; + height: 12px; + border: 1px solid #fff; + border-radius: 50%; + top: 95%; + left: 50%; + transform-origin: 0 -90px; /* 중심에서 반지름 거리만큼 떨어져 위치 */ + cursor: pointer; + z-index: 3; + /* 0번을 180도 위치(아래)에, 13번을 0도 위치(위)에 배치 */ + i { + position: absolute; + top: 12.5px; + left: 50%; + font-size: 11px; + color: #8b8b8b; + font-weight: 500; + -webkit-user-select: none; + -moz-user-select: none; + -ms-use-select: none; + user-select: none; + } + &:nth-child(1) { + transform: rotate(180deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(180deg); + } + } + &:nth-child(2) { + transform: rotate(195deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(165deg); + } + } + &:nth-child(3) { + transform: rotate(210deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(150deg); + } + } + &:nth-child(4) { + transform: rotate(225deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(135deg); + } + } + &:nth-child(5) { + transform: rotate(240deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(120deg); + } + } + &:nth-child(6) { + transform: rotate(255deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(105deg); + } + } + &:nth-child(7) { + transform: rotate(270deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(90deg); + } + } + &:nth-child(8) { + transform: rotate(285deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(75deg); + } + } + &:nth-child(9) { + transform: rotate(300deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(60deg); + } + } + &:nth-child(10) { + transform: rotate(315deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(45deg); + } + } + &:nth-child(11) { + transform: rotate(330deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(30deg); + } + } + &:nth-child(12) { + transform: rotate(345deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(15deg); + } + } + &:nth-child(13) { + transform: rotate(0deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(0deg); + } + } + &:nth-child(14) { + transform: rotate(15deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-15deg); + } + } + &:nth-child(15) { + transform: rotate(30deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-30deg); + } + } + &:nth-child(16) { + transform: rotate(45deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-45deg); + } + } + &:nth-child(17) { + transform: rotate(60deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-60deg); + } + } + &:nth-child(18) { + transform: rotate(75deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-75deg); + } + } + &:nth-child(19) { + transform: rotate(90deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-90deg); + } + } + &:nth-child(20) { + transform: rotate(105deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-105deg); + } + } + &:nth-child(21) { + transform: rotate(120deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-120deg); + } + } + &:nth-child(22) { + transform: rotate(135deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-135deg); + } + } + &:nth-child(23) { + transform: rotate(150deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-150deg); + } + } + &:nth-child(24) { + transform: rotate(165deg) translate(-50%, -50%); + i { + transform: translateX(-50%) rotate(-165deg); + } + } + &.act { + &::after { + content: ''; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); - width: 100px; - height: 100px; + width: 5px; + height: 5px; background-color: #fff; + border-radius: 50%; + } + i { + color: #fff; + } } -} - -.size-option-top{ - margin-bottom: 15px; -} -.size-option-side{ + } + .compas { position: absolute; top: 50%; - left: 0; - transform: translateY(-50%); -} -.size-option-wrap{ - width: 88px; - margin: 0 auto; - .size-option{ - display: flex; - align-items: center; - input{ - width: 100%; - flex: 1; - } - span{ - flex: none; - } + left: 50%; + transform: translate(-50%, -50%); + width: 148px; + height: 148px; + border: 4px solid #fff; + border-radius: 50%; + .compas-arr { + width: 100%; + height: 100%; + background: url(../../public/static/images/canvas/compas.svg) no-repeat center; + background-size: 122px 122px; } + } +} + +.draw-flow-wrap { + margin: 10px 0; +} + +// 지붕모듈선택 +.roof-module-tab { + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 14px; + .module-tab-bx { + flex: 1; + height: 34px; + line-height: 31px; + border: 1px solid #484848; + border-radius: 2px; + background-color: transparent; + font-size: 12px; + color: #aaa; + text-align: center; + cursor: default; + transition: all 0.15s ease-in-out; + &.act { + background-color: #1083e3; + border: 1px solid #1083e3; + color: #fff; + font-weight: 500; + } + } + .tab-arr { + display: block; + width: 9px; + height: 14px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + background-image: url(../../public/static/images/canvas/module_tab_arr.svg); + transition: all 0.15s ease-in-out; + &.act { + background-image: url(../../public/static/images/canvas/module_tab_arr_white.svg); + } + } +} + +.roof-module-compas { + margin-bottom: 24px; + .compas-box-inner { + width: 280px; + height: 253px; + .circle { + top: 86%; + // &:nth-child(1), + // &:nth-child(7), + // &:nth-child(13), + // &:nth-child(19){ + // &::before{ + // content: ''; + // position: absolute; + // top: 20px; + // left: 50%; + // transform: translateX(-50%); + // width: 1px; + // height: 6px; + // background-color: #8B8B8B; + // } + // } + i { + top: 22px; + } + &.act { + i { + color: #8b8b8b; + } + } + } + } +} +.center-wrap { + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; +} + +.module-table-flex-wrap { + display: flex; + gap: 10px; + .outline-form { + flex: 1; + } +} + +.module-box-tab { + display: flex; + .module-btn { + flex: 1; + border-top: 1px solid #505050; + border-bottom: 1px solid #505050; + border-right: 1px solid #505050; + background-color: #454545; + color: #fff; + height: 30px; + font-size: 12px; + font-weight: 400; + transition: all 0.15s ease-in-out; + &:first-child { + border-left: 1px solid #505050; + } + &.act { + border-color: #fff; + background-color: #fff; + color: #101010; + } + } +} + +.module-table-box { + flex: 1; + background-color: #3d3d3d; + border-radius: 2px; + .module-table-inner { + padding: 10px; + .outline-form { + span { + width: auto; + } + } + .module-table-tit { + padding: 10px 0; + font-size: 12px; + color: #fff; + border-bottom: 1px solid #4d4d4d; + } + .eaves-keraba-table { + width: 100%; + margin-top: 15px; + .eaves-keraba-th { + width: 72px; + } + .eaves-keraba-th, + .eaves-keraba-td { + padding-bottom: 5px; + } + } + .self-table-tit { + font-size: 12px; + font-weight: 500; + color: #fff; + padding-bottom: 15px; + } + } + .warning-guide { + padding: 20px; + .warning { + color: #ffcaca; + max-height: 55px; + overflow-y: auto; + padding-right: 30px; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + } + } +} + +.module-self-table { + display: table; + border-top: 1px solid #4d4d4d; + border-collapse: collapse; + width: 100%; + .self-table-item { + display: table-row; + .self-item-td, + .self-item-th { + display: table-cell; + vertical-align: middle; + border-bottom: 1px solid #4d4d4d; + } + .self-item-th { + width: 60px; + font-size: 12px; + font-weight: 500; + color: #fff; + } + .self-item-td { + font-size: 12px; + font-weight: 400; + color: #fff; + padding: 15px 20px; + } + } +} + +.self-table-flx { + display: flex; + align-items: center; + margin-top: 15px; + button { + margin-left: auto; + } +} +.hexagonal-wrap { + .hexagonal-item { + padding: 15px 0; + border-bottom: 1px solid #4d4d4d; + &:first-child { + padding-top: 0; + } + &:last-child { + padding-bottom: 0; + border: none; + } + .hexagonal-flx-auto { + display: flex; + justify-content: space-between; + } + .hexagonal-flx { + display: flex; + align-items: center; + button { + margin-left: auto; + } + } + } +} + +// 회로 및 가대설정 +.circuit-check-inner { + padding: 5px 0; + &.overflow { + overflow-y: auto; + max-height: 100px; + min-height: 60px; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + } + .d-check-box { + margin-bottom: 15px; + &:last-child { + margin-bottom: 0; + } + } +} + +.x-scroll-table { + overflow: auto; + padding-bottom: 5px; + background-color: transparent; + max-height: 170px; + .roof-module-table { + min-width: 1200px; + } + &::-webkit-scrollbar { + width: 4px; + height: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #b4b4b4; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + &::-webkit-scrollbar-corner { + background-color: transparent; + } +} + +.circuit-right-wrap { + display: flex; + justify-content: flex-end; +} + +.circuit-data-form { + display: flex; + flex-direction: column; + gap: 5px; + min-height: 60px; + padding: 12px; + border: 1px solid rgba(255, 255, 255, 0.2); + span { + display: inline-flex; + align-items: center; + .del { + display: block; + margin-left: 10px; + width: 15px; + height: 15px; + background: url(../../public/static/images/canvas/circuit_del.svg) no-repeat center; + background-size: cover; + } + } +} +.circuit-table-tit { + color: #fff; + font-size: 12px; + font-weight: 600; + padding: 11px 10px; + background-color: #474747; + border: 1px solid #505050; + border-bottom: none; +} + +.circuit-overflow { + overflow-x: auto; + margin-bottom: 25px; + &::-webkit-scrollbar { + height: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + .module-table-box { + display: flex; + &.by-max { + min-width: 886px; + } + } +} + +.circuit-table-flx-wrap { + display: flex; + gap: 10px; + margin-bottom: 10px; + .circuit-table-flx-box { + flex: 1; + display: flex; + flex-direction: column; + .bottom-wrap { + margin-top: auto; + } + .roof-module-table { + table { + table-layout: fixed; + } + } + } +} + +.circuit-count-input { + display: flex; + align-items: center; + gap: 10px; +} + +// 모듈부가기능 +.additional-radio-wrap { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px 0; + margin-bottom: 24px; +} +.additional-wrap { + padding: 24px 0; + border-top: 1px solid #424242; +} + +.additional-color-wrap { + display: flex; + align-items: center; + padding: 5px 0; + gap: 15px; + .additional-color-box { + display: flex; + align-items: center; + gap: 8px; + .additional-color { + display: block; + width: 16px; + height: 16px; + &.pink { + border: 2px solid #ce1c9c; + background-color: #16417d; + } + &.white { + border: 2px solid #fff; + background-color: #001027; + } + } + } +} + +// color setting +.color-setting-wrap { + padding-bottom: 15px; + border-bottom: 1px solid #424242; + .color-tit { + font-size: 13px; + font-weight: 500; + color: #ffffff; + margin-bottom: 10px; + } + .color-picker { + .react-colorful { + width: 100%; + height: auto; + gap: 20px; + .react-colorful__pointer { + width: 15px; + height: 15px; + border: 4px solid #fff; + } + .react-colorful__saturation { + border-radius: 2px; + height: 200px; + border-bottom: 5px solid #000; + } + .react-colorful__last-control { + border-radius: 2px; + height: 10px; + } + } + .hex-color-box { + display: flex; + align-items: center; + margin-top: 15px; + .color-box-tit { + font-size: 12px; + color: #fff; + font-weight: 500; + margin-right: 10px; + } + .color-hex-input { + width: 150px; + margin-right: 5px; + input { + width: 100%; + } + } + .color-box { + display: block; + width: 30px; + height: 30px; + border-radius: 4px; + } + } + .default-color-wrap { + margin-top: 25px; + .default-tit { + font-size: 12px; + font-weight: 500; + color: #fff; + margin-bottom: 10px; + } + .color-button-wrap { + display: grid; + grid-template-columns: repeat(8, 1fr); + gap: 21px; + .default-color { + display: block; + width: 100%; + height: 30px; + border-radius: 4px; + } + } + } + } +} + +// 글꼴 설정 팝업 +.font-option-warp { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px 5px; + margin-bottom: 15px; + .font-option-item { + .option-item-tit { + font-size: 12px; + font-weight: 500; + color: #fff; + margin-bottom: 10px; + } + } +} +.font-ex-wrap { + margin-bottom: 15px; + .font-ex-tit { + font-size: 12px; + font-weight: 500; + color: #fff; + margin-bottom: 10px; + } + .font-ex-box { + display: flex; + align-items: center; + justify-content: center; + width: 100%; + min-height: 80px; + background-color: #fff; + } +} + +// 치수선 설정 +.font-btn-wrap { + margin-bottom: 15px; + button { + width: 100%; + height: 30px; + line-height: 28px; + } +} + +.line-color-wrap { + margin-bottom: 15px; + .color-btn { + display: block; + width: 100%; + height: 30px; + border-radius: 2px; + } +} + +.form-box { + width: 100%; + background-color: #fff; + padding: 10px 15px 20px; + .line-form { + position: relative; + display: flex; + flex-direction: column; + justify-content: flex-end; + min-width: 102px; + min-height: 40px; + margin: 0 auto; + + &::before { + content: ''; + position: absolute; + bottom: 0px; + left: 0; + width: 100%; + height: 40px; + border-left: 1px dashed #101010; + border-right: 1px dashed #101010; + } + .line-font-box { + .font { + display: block; + padding-bottom: 15px; + color: #101010; + text-align: center; + line-height: 1; + } + .line { + position: relative; + display: block; + width: 100%; + height: 1px; + border-radius: 30px; + &::before { + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%) rotate(45deg); + left: 1px; + width: 9px; + height: +9px; + border: 1px solid; + border-color: inherit; + border-top: none; + border-right: none; + } + &::after { + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%) rotate(45deg); + right: 1px; + width: 9px; + height: 9px; + border: 1px solid; + border-color: inherit; + border-bottom: none; + border-left: none; + } + } + } + } +} + +// 사이즈 변경 +.size-inner-warp { + position: relative; +} +.size-check-wrap { + position: relative; + display: block; + width: 132px; + height: 132px; + margin: 0 auto; + .size-btn { + position: absolute; + width: 16px; + height: 16px; + border: 1px solid #fff; + border-radius: 50%; + &.act { + &::after { + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 8px; + height: 8px; + background-color: #fff; + border-radius: 50%; + } + } + &:nth-child(1) { + top: 0; + left: 0; + } + &:nth-child(2) { + top: 0; + right: 0; + } + &:nth-child(3) { + bottom: 0; + left: 0; + } + &:nth-child(4) { + bottom: 0; + right: 0; + } + } + .size-box { + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 100px; + height: 100px; + background-color: #fff; + } +} + +.size-option-top { + margin-bottom: 15px; +} +.size-option-side { + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); +} +.size-option-wrap { + width: 88px; + margin: 0 auto; + .size-option { + display: flex; + align-items: center; + input { + width: 100%; + flex: 1; + } + span { + flex: none; + } + } } //이미지 크기 설정 -.range-wrap{ - display: flex; - align-items: center; - input{ - flex: 1; - margin-right: 10px; - } - label{ - flex: none; - text-align: right; - width: 38px; - font-size: 13px; - color: #fff; - font-weight: 500; - } +.range-wrap { + display: flex; + align-items: center; + input { + flex: 1; + margin-right: 10px; + } + label { + flex: none; + text-align: right; + width: 38px; + font-size: 13px; + color: #fff; + font-weight: 500; + } } // 이미지 불러오기 -.img-flex-box{ - display: flex; - align-items: center; +.img-flex-box { + display: flex; + align-items: center; } -.img-load-from{ - margin-top: 20px; - .img-load-item{ - border-top: 1px solid #424242; - padding: 18px 0; - .d-check-radio{ - margin-bottom: 20px; - } +.img-load-from { + margin-top: 20px; + .img-load-item { + border-top: 1px solid #424242; + padding: 18px 0; + .d-check-radio { + margin-bottom: 20px; } - border-bottom: 1px solid #424242; + } + border-bottom: 1px solid #424242; } // 지붕모듈선택 변경 -.module-table-box{ - &.none-flex{ +.module-table-box { + &.none-flex { + flex: none; + width: 230px; + .outline-form { + .grid-select { flex: none; - width: 230px; - .outline-form{ - .grid-select{ - flex: none; - width: 95.77px; - } - .thin{ - margin-left: auto; - } - } - } -} -.roof-module-tab2-overflow{ - max-height: 500px; - overflow-y: auto; - padding-bottom: 15px; - border-bottom: 1px solid #4D4D4D; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #D9D9D9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } -} -.module-table-flex-wrap{ - &.tab2{ - margin-top: 10px; - gap: 15px; - - } - .module-flex-item{ - flex: 1; - .module-flex-item-tit{ - font-size: 12px; - font-weight: 500; - color: #fff; - padding-bottom: 10px; - border-bottom: 1px solid #4D4D4D; - } - .flex-item-btn-wrap{ - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 8px; - margin-bottom: 24px; - } - &.non-flex{ - display: flex; - flex-direction: column; - justify-content: flex-start; - flex: none; - padding-top: 27.5px; - width: 260px; - } - } -} - -.module-table-box{ - .module-table-inner{ - .module-table-flex-wrap{ - &.tab2{ - .eaves-keraba-table{ - .eaves-keraba-th{ - width: 90px; - } - .eaves-keraba-td{ - padding-left: 0; - padding-bottom: 5px; - } - } - } - } - } -} -.keraba-flex{ - display: flex; - align-items: center; - .grid-select{ - flex: none; - width: 110px; - } - .outline-form{ - justify-content: flex-end; - } -} - -.reset-word-wrap{ - display: flex; - align-items: center; - .grid-btn-wrap{ + width: 95.77px; + } + .thin { margin-left: auto; + } } + } } -.reset-word{ - font-size: 12px; - color: #FFCACA; - font-weight: 400; +.roof-module-tab2-overflow { + max-height: 500px; + overflow-y: auto; + padding-bottom: 15px; + border-bottom: 1px solid #4d4d4d; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #d9d9d9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } +} +.module-table-flex-wrap { + &.tab2 { margin-top: 10px; -} \ No newline at end of file + gap: 15px; + } + .module-flex-item { + flex: 1; + .module-flex-item-tit { + font-size: 12px; + font-weight: 500; + color: #fff; + padding-bottom: 10px; + border-bottom: 1px solid #4d4d4d; + } + .flex-item-btn-wrap { + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 8px; + margin-bottom: 24px; + } + &.non-flex { + display: flex; + flex-direction: column; + justify-content: flex-start; + flex: none; + padding-top: 27.5px; + width: 260px; + } + } +} + +.module-table-box { + .module-table-inner { + .module-table-flex-wrap { + &.tab2 { + .eaves-keraba-table { + .eaves-keraba-th { + width: 90px; + } + .eaves-keraba-td { + padding-left: 0; + padding-bottom: 5px; + } + } + } + } + } +} +.keraba-flex { + display: flex; + align-items: center; + .grid-select { + flex: none; + width: 110px; + } + .outline-form { + justify-content: flex-end; + } +} + +.reset-word-wrap { + display: flex; + align-items: center; + .grid-btn-wrap { + margin-left: auto; + } +} +.reset-word { + font-size: 12px; + color: #ffcaca; + font-weight: 400; + margin-top: 10px; +} diff --git a/src/util/common-utils.js b/src/util/common-utils.js index 47498464..b77cf62d 100644 --- a/src/util/common-utils.js +++ b/src/util/common-utils.js @@ -134,3 +134,18 @@ export const getQueryString = (o) => { .join('&') return `?${queryString}` } + +export const unescapeString = (str) => { + const regex = /&(amp|lt|gt|quot|#39);/g + const chars = { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + ''': "'", + } + + if (regex.test(str)) { + return str.replace(regex, (matched) => chars[matched] || matched) + } +} From 7ac16fbf5dee5996b412bda5300211f82c374dc9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 17 Jan 2025 13:43:24 +0900 Subject: [PATCH 022/130] =?UTF-8?q?directionText=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 4a8ecfdc..9c690a6b 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -427,6 +427,12 @@ export const usePolygon = () => { text = '西西南' } + const sameDirectionCnt = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF && obj.directionText === text) + + text = text + (sameDirectionCnt.length + 1) + + polygon.set('directionText', text) + const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, { fontFamily: flowFontOptions.fontFamily.value, fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', From 00aaea8b9c28d25351079e28d3f232f417de1a55 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 17 Jan 2025 13:54:57 +0900 Subject: [PATCH 023/130] =?UTF-8?q?=EB=B0=A9=ED=96=A5=ED=85=8D=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=EB=A7=8C=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 9c690a6b..3e24920c 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -427,12 +427,13 @@ export const usePolygon = () => { text = '西西南' } - const sameDirectionCnt = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF && obj.directionText === text) + const sameDirectionCnt = canvas.getObjects().filter((obj) => { + const onlyStrDirection = obj.directionText?.replace(/[0-9]/g, '') + return obj.name === POLYGON_TYPE.ROOF && onlyStrDirection === text + }) text = text + (sameDirectionCnt.length + 1) - polygon.set('directionText', text) - const textObj = new fabric.Text(`${text} (${currentAngleType === ANGLE_TYPE.SLOPE ? arrow.pitch : getDegreeByChon(arrow.pitch)}${pitchText})`, { fontFamily: flowFontOptions.fontFamily.value, fontWeight: flowFontOptions.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal', From a81a330b3d5977d4ba211028a73c510544ad82f0 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Fri, 17 Jan 2025 16:40:51 +0900 Subject: [PATCH 024/130] =?UTF-8?q?floor-plan=20=EC=9D=B8=EC=9E=85=20?= =?UTF-8?q?=EC=8B=9C=20FloorPlanProvider=20Warning=20=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/floor-plan/FloorPlanProvider.js | 4 ++-- .../floor-plan/modal/placementShape/PlacementShapeSetting.jsx | 4 ++-- src/hooks/option/useCanvasSetting.js | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index efed75e6..fbfbea41 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -48,14 +48,14 @@ const FloorPlanProvider = ({ children }) => { const objectNo = searchParams.get('objectNo') const pid = searchParams.get('pid') - useEffect(() => { // 오류 발생으로 useEffect 사용 + //useEffect(() => { // 오류 발생으로 useEffect 사용 if (pathname === '/floor-plan') { if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { notFound() } setCurrentObjectNo(objectNo) } - }, [pid, objectNo]) + //}, [pid, objectNo]) const [floorPlanState, setFloorPlanState] = useState({ // 플랜 파일 업로드 모달 오픈 제어 diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx index 844cb87e..1a5ea92a 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx @@ -260,7 +260,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set title={ currentRoof?.roofSizeSet === '3' ? getMessage('modal.placement.initial.setting.size.none.pitch') : currentRoof?.roofMatlNm } - ref={roofRef.roofCd} + //ref={roofRef.roofCd} options={roofMaterials.map((roof) => { return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp } })} @@ -346,7 +346,7 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
r.clCode === (currentRoof?.raft === undefined ? currentRoof?.raftBaseCd : currentRoof?.raft)) .clCodeNm diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 6afced52..413be59d 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -290,7 +290,7 @@ export function useCanvasSetting() { let roofsRow = {} let roofsArray = {} - if (res.length > 0) { + if (res) { roofsRow = res.map((item) => { return { roofSizeSet: String(item.roofSizeSet), From 0e736ee4794ff2c25cb400272bcea44e55626c9d Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Fri, 17 Jan 2025 16:44:14 +0900 Subject: [PATCH 025/130] =?UTF-8?q?fix:=20provider=20=EC=A4=91=EC=B2=A9?= =?UTF-8?q?=EC=8B=9C=20suspense=20=EC=82=AC=EC=9A=A9=20=EC=8B=9C=20?= =?UTF-8?q?=EB=AC=B8=EC=A0=9C=20=ED=95=B4=EA=B2=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/layout.js | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/app/layout.js b/src/app/layout.js index 0a514711..fd9f08bd 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -66,24 +66,22 @@ export default async function RootLayout({ children }) { - }> - {headerPathname === '/login' || headerPathname === '/join' ? ( - {children} - ) : ( - -
-
-
- - {children} -
-
+ {headerPathname === '/login' || headerPathname === '/join' ? ( + {children} + ) : ( + +
+
+
+ + {children}
- - )} - - - +
+
+
+ )} + + From 3622065ded48d7e758495f6f7cd75fa56c020bfa Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Fri, 17 Jan 2025 16:49:44 +0900 Subject: [PATCH 026/130] =?UTF-8?q?Canvas=EC=84=A4=EC=A0=95=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EC=8B=9C=20=EC=A0=80=EC=9E=A5=ED=99=95=EC=9D=B8=20?= =?UTF-8?q?=ED=8C=9D=EC=97=85=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 413be59d..6a0adb06 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -674,7 +674,7 @@ export function useCanvasSetting() { // HTTP POST 요청 보내기 await post({ url: `/api/canvas-management/canvas-settings`, data: patternData }) .then((res) => { - // swalFire({ text: getMessage(res.returnMessage) }) + swalFire({ text: getMessage(res.returnMessage) }) // Canvas 디스플레이 설정 시 해당 옵션 적용 frontSettings() @@ -682,7 +682,8 @@ export function useCanvasSetting() { fetchSettings() }) .catch((error) => { - swalFire({ text: getMessage(res.returnMessage), icon: 'error' }) + //swalFire({ text: getMessage(res.returnMessage), icon: 'error' }) + swalFire({ text: error.message, icon: 'error' }) }) //setAdsorptionRange(item.range) From 35000622587a6e121a3679653a71746f7b5245fd Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Fri, 17 Jan 2025 16:57:46 +0900 Subject: [PATCH 027/130] =?UTF-8?q?refactor:=20planNo=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - canvas_status 추가/삭제 시 plan추가/삭제 api 호출 추가 - planNo 추가, ordering 제거 및 planNo로 변경 --- src/components/estimate/Estimate.jsx | 2 +- src/components/floor-plan/CanvasLayout.jsx | 10 +-- src/components/floor-plan/CanvasMenu.jsx | 8 +-- src/components/simulator/Simulator.jsx | 2 +- src/hooks/usePlan.js | 82 +++++++++++++--------- 5 files changed, 58 insertions(+), 46 deletions(-) diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index 21e87620..a97cb4cb 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -135,7 +135,7 @@ export default function Estimate({}) { useEffect(() => { console.log('🚀 ~ Estimate ~ selectedPlan:', selectedPlan) - if (selectedPlan) initEstimate(selectedPlan.ordering) + if (selectedPlan) initEstimate(selectedPlan.planNo) }, [selectedPlan]) useEffect(() => { diff --git a/src/components/floor-plan/CanvasLayout.jsx b/src/components/floor-plan/CanvasLayout.jsx index ba2994c0..bc1a4007 100644 --- a/src/components/floor-plan/CanvasLayout.jsx +++ b/src/components/floor-plan/CanvasLayout.jsx @@ -30,22 +30,22 @@ export default function CanvasLayout({ children }) {
- {plans.map((plan) => ( + {plans.map((plan, index) => (
diff --git a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx index addc4cf8..fa4f82f6 100644 --- a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx +++ b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx @@ -3,6 +3,8 @@ import { useState } from 'react' import { useMessage } from '@/hooks/useMessage' import WithDraggable from '@/components/common/draggable/WithDraggable' +import { moduleStatisticsState } from '@/store/circuitTrestleAtom' +import { useRecoilValue } from 'recoil' export default function PanelBatchStatistics() { const { getMessage } = useMessage() @@ -11,6 +13,7 @@ export default function PanelBatchStatistics() { x: 0, y: 30, }) + const { header, rows, footer } = useRecoilValue(moduleStatisticsState) return ( @@ -21,14 +24,25 @@ export default function PanelBatchStatistics() { - - + {header.map((item) => ( + + ))} + {rows.map((row) => ( + + {header.map((item) => ( + // + + ))} + + ))} - - + {footer.map((item) => ( + + // + ))}
{getMessage('modal.panel.batch.statistic.roof.shape')}{getMessage('modal.panel.batch.statistic.power.generation.amount')} (kW){item.name}
{item.prop === 'name' ? item.name : item.prop === 'powerGeneration' ? item.powerGeneration : item.amount}{row[item.prop]}
{getMessage('modal.panel.batch.statistic.total')}0.000{item}{item.amount}
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 11c2ce8d..256d51c6 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -16,6 +16,7 @@ import { QLine } from '@/components/fabric/QLine' import { useRoofFn } from '@/hooks/common/useRoofFn' import { useEffect } from 'react' import { useMessage } from '@/hooks/useMessage' +import { moduleStatisticsState } from '@/store/circuitTrestleAtom' export function useModuleBasicSetting() { const canvas = useRecoilValue(canvasState) @@ -31,6 +32,7 @@ export function useModuleBasicSetting() { const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState) const checkedModule = useRecoilValue(checkedModuleState) const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState) + const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState) useEffect(() => { // console.log('basicSetting', basicSetting) @@ -1206,7 +1208,7 @@ export function useModuleBasicSetting() { }) moduleSetupSurface.set({ modules: moduleSetupArray }) - + getModuleStatistics() // const moduleArray = [...moduleIsSetup] // moduleArray.push({ // surfaceId: moduleSetupSurface.surfaceId, @@ -2279,6 +2281,64 @@ export function useModuleBasicSetting() { return isDisjoint } + const getModuleStatistics = () => { + const surfaces = canvas.getObjects().filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name) + console.log('🚀 ~ getModuleStatistics ~ surfaces:', surfaces) + let totalWpout = 0 + let moduleInfo = {} + const rows = surfaces.map((surface) => { + let wpOut = 0 + + surface.modules.forEach((module) => { + wpOut += +module.moduleInfo.wpOut + if (!moduleInfo[module.moduleInfo.itemId]) { + moduleInfo[module.moduleInfo.itemId] = 0 + } + + moduleInfo[module.moduleInfo.itemId]++ + }) + totalWpout += wpOut + console.log('🚀 ~ moduleData.rows=surfaces.map ~ module:', module) + return { + name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, + // powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }), + amount: wpOut, + ...moduleInfo, + } + }) + + console.log('🚀 ~ getModuleStatistics ~ moduleInfo:', moduleInfo) + const header = [ + { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' }, + ...Object.keys(moduleInfo).map((key) => { + return { name: moduleInfo[key], prop: key } + }), + { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'amount' }, + ] + let footer = ['합계'] + let footerData = {} + rows.forEach((row) => { + Object.keys(moduleInfo).map((key) => { + if (!footerData[key]) footerData[key] = 0 + footerData[key] += row[key] + }) + }) + Object.keys(footerData).forEach((key) => { + footer.push(footerData[key]) + }) + footer.push(totalWpout) + // const footer = [ + // '합계', + // ...Object.keys(moduleInfo).map((key) => { + // return { name: moduleInfo[key].name, prop: moduleInfo[key] } + // }), + // totalWpout, + // ] + // const footer = [] + console.log('@@@@@@@@@@', header, rows, footer) + setModuleStatistics({ header: header, rows, footer: footer }) + } + return { makeModuleInstArea, manualModuleSetup, diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 510b7874..a92aca69 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -368,6 +368,7 @@ export function usePlan(params = {}) { * plan 조회 */ const loadCanvasPlanData = async (userId, objectNo, planNo) => { + console.log('🚀 ~ loadCanvasPlanData ~ userId, objectNo, planNo:', userId, objectNo, planNo) await getCanvasByObjectNo(userId, objectNo).then((res) => { if (res.length > 0) { setPlans(res) diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 3fbb0b3e..2ba3963b 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -20,3 +20,8 @@ export const pcsCheckState = atom({ key: 'divisionCircuitState', default: { division: true, max: false }, }) + +export const moduleStatisticsState = atom({ + key: 'moduleStatisticsState', + default: { header: [], rows: [], footer: [] }, +}) From cb610d098dd15fd9dfa96b7586ad4cdcfba4b3e6 Mon Sep 17 00:00:00 2001 From: Minsiki Date: Sat, 18 Jan 2025 19:14:16 +0900 Subject: [PATCH 031/130] =?UTF-8?q?=EC=A7=91=EA=B3=84=ED=91=9C=20=EA=B0=9C?= =?UTF-8?q?=EB=B0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useModuleBasicSetting.js | 22 +++++++++++++--------- src/store/circuitTrestleAtom.js | 13 ++++++++++++- 2 files changed, 25 insertions(+), 10 deletions(-) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 256d51c6..08a06320 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -2288,22 +2288,26 @@ export function useModuleBasicSetting() { let moduleInfo = {} const rows = surfaces.map((surface) => { let wpOut = 0 - + moduleInfo = {} surface.modules.forEach((module) => { - wpOut += +module.moduleInfo.wpOut if (!moduleInfo[module.moduleInfo.itemId]) { - moduleInfo[module.moduleInfo.itemId] = 0 + moduleInfo[module.moduleInfo.itemId] = { name: module.moduleInfo.itemNm, amount: 0, id: module.moduleInfo.itemId } } + wpOut += +module.moduleInfo.wpOut - moduleInfo[module.moduleInfo.itemId]++ + moduleInfo[module.moduleInfo.itemId].amount++ }) totalWpout += wpOut console.log('🚀 ~ moduleData.rows=surfaces.map ~ module:', module) + const rowObject = {} + Object.keys(moduleInfo).forEach((key) => { + rowObject[key] = moduleInfo[key].amount + }) return { - name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, + ...rowObject, // 총 발전량 = 발전량 * 모듈 개수 + name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, // 지붕면 // powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }), - amount: wpOut, - ...moduleInfo, + wpOut: wpOut, } }) @@ -2311,9 +2315,9 @@ export function useModuleBasicSetting() { const header = [ { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' }, ...Object.keys(moduleInfo).map((key) => { - return { name: moduleInfo[key], prop: key } + return { name: moduleInfo[key].name, prop: key } }), - { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'amount' }, + { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' }, ] let footer = ['합계'] let footerData = {} diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 2ba3963b..86836b48 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -1,3 +1,4 @@ +import { useMessage } from '@/hooks/useMessage' import { atom } from 'recoil' export const makerState = atom({ @@ -23,5 +24,15 @@ export const pcsCheckState = atom({ export const moduleStatisticsState = atom({ key: 'moduleStatisticsState', - default: { header: [], rows: [], footer: [] }, + default: { + header: [ + { name: '지붕면', prop: 'name' }, + { name: `발전량(kW)`, prop: 'amount' }, + ], + rows: [], + footer: [ + { name: '합계', prop: 'name' }, + { name: `발전량(kW)`, prop: 'amount' }, + ], + }, }) From 36c9357e8baa165355e28a12d17c9813aa179200 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 20 Jan 2025 09:46:48 +0900 Subject: [PATCH 032/130] =?UTF-8?q?=EB=B0=A9=EC=9C=84=20=EA=B8=80=EC=9E=90?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80=20=EC=8B=9C=20=EA=B2=80=EC=82=AC=20?= =?UTF-8?q?=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 3e24920c..61a3f672 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -429,7 +429,7 @@ export const usePolygon = () => { const sameDirectionCnt = canvas.getObjects().filter((obj) => { const onlyStrDirection = obj.directionText?.replace(/[0-9]/g, '') - return obj.name === POLYGON_TYPE.ROOF && onlyStrDirection === text + return obj.name === POLYGON_TYPE.ROOF && obj.visible && obj !== polygon && onlyStrDirection === text }) text = text + (sameDirectionCnt.length + 1) From 4edef1c87d871c6d4bba68b50eb313c01c4e5840 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Mon, 20 Jan 2025 11:18:54 +0900 Subject: [PATCH 033/130] =?UTF-8?q?fix:=20plan=20=EC=B4=88=EA=B8=B0=20?= =?UTF-8?q?=EC=83=9D=EC=84=B1=20=EC=8B=9C=20=EC=9D=B4=EC=A0=84=20=EB=AC=BC?= =?UTF-8?q?=EA=B1=B4=20=20plan=EC=9D=B4=20=EA=B0=99=EC=9D=B4=20=EB=B3=B4?= =?UTF-8?q?=EC=9D=B4=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePlan.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 510b7874..6a25fd50 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -14,6 +14,7 @@ import { SAVE_KEY } from '@/common/common' import { readImage, removeImage } from '@/lib/fileAction' import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController' + export function usePlan(params = {}) { const { floorPlanState } = useContext(FloorPlanContext) @@ -159,7 +160,7 @@ export function usePlan(params = {}) { /** * 신규 canvas 데이터를 저장 */ - const postCanvasStatus = async (userId, objectNo, canvasStatus) => { + const postCanvasStatus = async (userId, objectNo, canvasStatus, isInitPlan = false) => { const planNo = await postObjectPlan(userId, objectNo) if (!planNo) return @@ -173,7 +174,12 @@ export function usePlan(params = {}) { } await promisePost({ url: '/api/canvas-management/canvas-statuses', data: planData }) .then((res) => { - setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) + if (isInitPlan) { + // 초기 플랜 생성인 경우 플랜 목록 초기화 + setPlans([{ id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) + } else { + setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) + } updateCurrentPlan(res.data) }) .catch((error) => { @@ -313,13 +319,13 @@ export function usePlan(params = {}) { text: `Plan ${currentCanvasPlan.planNo} ` + getMessage('plan.message.confirm.copy'), type: 'confirm', confirmFn: async () => { - await postCanvasStatus(userId, objectNo, currentCanvasData()) + await postCanvasStatus(userId, objectNo, currentCanvasData(), false) }, denyFn: async () => { - await postCanvasStatus(userId, objectNo, '') + await postCanvasStatus(userId, objectNo, '', false) }, }) - : await postCanvasStatus(userId, objectNo, '') + : await postCanvasStatus(userId, objectNo, '', false) } /** @@ -373,7 +379,7 @@ export function usePlan(params = {}) { setPlans(res) updateCurrentPlan(res.find((plan) => plan.planNo === planNo).id) } else { - postCanvasStatus(userId, objectNo, '') + postCanvasStatus(userId, objectNo, '', true) } }) } From e460f7daaee0330d78c9518f3046e190b5720526 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Mon, 20 Jan 2025 11:27:26 +0900 Subject: [PATCH 034/130] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=EC=84=A4=EC=A0=95=20=EB=B0=8F=20Canvas=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=B4=88=EA=B8=B0=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20?= =?UTF-8?q?=EC=84=A4=EC=A0=95=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/FloorPlan.jsx | 5 ++-- src/hooks/option/useCanvasSetting.js | 31 +++++++++++++------------ 2 files changed, 19 insertions(+), 17 deletions(-) diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index 0769af0a..a2e92bf2 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -15,7 +15,7 @@ export default function FloorPlan({ children }) { //const [correntObjectNo, setCorrentObjectNo] = useRecoilState(correntObjectNoState) const { closeAll } = usePopup() const { menuNumber, setMenuNumber } = useCanvasMenu() - const { fetchSettings } = useCanvasSetting() + const { fetchSettings, fetchBasicSettings } = useCanvasSetting() const modalProps = { menuNumber, @@ -26,7 +26,8 @@ export default function FloorPlan({ children }) { ///setCorrentObjectNo(floorPlanState.objectNo) //console.log('FloorPlan objectNo ', floorPlanState.objectNo, correntObjectNo) setMenuNumber(1) - fetchSettings() + fetchSettings() // Canvas 설정 정보 조회 + fetchBasicSettings() // 기본 설정 정보 조회 return () => { closeAll() } diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index c8139893..a1a3eebc 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -165,9 +165,10 @@ export function useCanvasSetting() { useEffect(() => { //console.log('🚀 ~ useEffect ~ roofMaterials 22 :', previousRoofMaterialsYn, roofMaterials.length , JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) // 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음 - if (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo - || roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) { - + if ( + (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo) || + (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) + ) { // 1회만 실행 if (roofMaterials && previousRoofMaterialsYn === 'N') { fetchBasicSettings() @@ -290,10 +291,12 @@ export function useCanvasSetting() { const fetchBasicSettings = async () => { try { await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}` }).then((res) => { + console.log('🚀 ~ fetchBasicSettings ~ res >>>>>>>>>> :', res) + let roofsRow = {} let roofsArray = {} - if (res) { + if (res.length > 0) { roofsRow = res.map((item) => { return { roofSizeSet: String(item.roofSizeSet), @@ -444,7 +447,7 @@ export function useCanvasSetting() { const res = await get({ url: `/api/canvas-management/canvas-settings/by-object/${correntObjectNo}` }) console.log('res', res) - if (res.length > 0) { + if (Object.keys(res).length > 0) { const optionData1 = settingModalFirstOptions.option1.map((item) => ({ ...item, selected: res[item.column] })) const optionData2 = settingModalFirstOptions.option2.map((item) => ({ ...item, selected: res[item.column] })) const optionData3 = settingModalSecondOptions.option3.map((item) => ({ ...item })) @@ -539,20 +542,17 @@ export function useCanvasSetting() { setAdsorptionPointMode({ ...adsorptionPointMode, adsorptionPoint: false }) //치수선 설정 - setDimensionLineSettings({ ...dimensionLineSettings }) + setDimensionLineSettings({ ...dimensionLineSettings, ...dimensionLineSettingsState.default }) //도면크기 설정 - setPlanSizeSettingMode({ ...planSizeSettingMode }) + setPlanSizeSettingMode({ ...planSizeSettingMode, ...planSizeSettingModeState.default }) // 데이터 설정 - setSettingModalFirstOptions({ - ...settingModalFirstOptions, - }) - setSettingModalSecondOptions({ - ...settingModalSecondOptions, - }) + setSettingModalFirstOptions(...settingModalFirstOptions, ...settingModalFirstOptionsState.default) - setGlobalFont({ ...globalFont }) + setSettingModalSecondOptions(...settingModalSecondOptions, ...settingModalSecondOptionsState.default) + + setGlobalFont({ ...globalFont, ...globalFontState.default }) //점/선 그리드 setDotLineGridSettingState({ ...defaultDotLineGridSetting }) @@ -677,7 +677,7 @@ export function useCanvasSetting() { // HTTP POST 요청 보내기 await post({ url: `/api/canvas-management/canvas-settings`, data: patternData }) .then((res) => { - swalFire({ text: getMessage(res.returnMessage) }) + //swalFire({ text: getMessage(res.returnMessage) }) // Canvas 디스플레이 설정 시 해당 옵션 적용 frontSettings() @@ -777,6 +777,7 @@ export function useCanvasSetting() { adsorptionRange, setAdsorptionRange, fetchSettings, + fetchBasicSettings, frontSettings, globalFont, setGlobalFont, From 358f1fbe4ad5ff0b811d4d0bf150f1191756b3d6 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 20 Jan 2025 13:14:28 +0900 Subject: [PATCH 035/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20->=20=ED=83=AD=20=EC=98=81=EC=97=AD=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/select/QSelectBox.jsx | 2 - .../floor-plan/modal/basic/step/Module.jsx | 21 ++- .../modal/basic/step/ModuleTabContents.jsx | 127 ++++++++++-------- .../floor-plan/modal/basic/step/Placement.jsx | 6 +- src/hooks/module/useModulePlace.js | 6 +- src/hooks/module/useModuleSelection.js | 21 ++- src/hooks/option/useCanvasSetting.js | 12 +- src/store/selectedModuleOptions.js | 6 - 8 files changed, 98 insertions(+), 103 deletions(-) diff --git a/src/components/common/select/QSelectBox.jsx b/src/components/common/select/QSelectBox.jsx index 75a17bc1..bd888ac3 100644 --- a/src/components/common/select/QSelectBox.jsx +++ b/src/components/common/select/QSelectBox.jsx @@ -59,8 +59,6 @@ export default function QSelectBox({ const ref = useRef(null) const handleClickSelectOption = (option) => { - console.log('🚀 ~ handleClickSelectOption ~ option:', option) - setSelected(showKey !== '' ? option[showKey] : option.name) onChange?.(option, params) } diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 73ee88b9..0d5a552c 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -1,13 +1,13 @@ import { useEffect, useState, useReducer } from 'react' import { useRecoilValue, useRecoilState } from 'recoil' import { addedRoofsState } from '@/store/settingAtom' -import { canvasSettingState, currentCanvasPlanState, pitchSelector } from '@/store/canvasAtom' +import { currentCanvasPlanState } from '@/store/canvasAtom' import { useMessage } from '@/hooks/useMessage' import QSelectBox from '@/components/common/select/QSelectBox' import { useModuleSelection } from '@/hooks/module/useModuleSelection' import ModuleTabContents from './ModuleTabContents' -import { useDebounceCallback, useDebounceValue } from 'usehooks-ts' -import { moduleSelectionDataPlanListState, moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { useDebounceValue } from 'usehooks-ts' +import { moduleSelectionDataState } from '@/store/selectedModuleOptions' export default function Module({ setTabNum }) { const { getMessage } = useMessage() @@ -18,7 +18,6 @@ export default function Module({ setTabNum }) { const { moduleSelectionInitParams, selectedModules, - raftCodes, roughnessCodes, windSpeedCodes, managementState, @@ -39,12 +38,14 @@ export default function Module({ setTabNum }) { const [debouncedVerticalSnowCover] = useDebounceValue(inputVerticalSnowCover, 500) const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터 - const [moduleSelectionDataPlanList, setModuleSelectionDataPlanList] = useRecoilState(moduleSelectionDataPlanListState) - const [tempModuleSelectionData, setTempModuleSelectionData] = useReducer((prevState, nextState) => { return { ...prevState, ...nextState } }, moduleSelectionData) + useEffect(() => { + setModuleSelectionData(tempModuleSelectionData) + }, [tempModuleSelectionData]) + useEffect(() => { handleChangeInstallHeight(debouncedInstallHeight) }, [debouncedInstallHeight]) @@ -53,11 +54,6 @@ export default function Module({ setTabNum }) { handleChangeVerticalSnowCover(debouncedVerticalSnowCover) }, [debouncedVerticalSnowCover]) - useEffect(() => { - setInputInstallHeight(installHeight) - setInputVerticalSnowCover(verticalSnowCover) - }, [installHeight, verticalSnowCover]) - const moduleData = { header: [ { name: getMessage('module'), width: 150, prop: 'module', type: 'color-box' }, @@ -231,10 +227,9 @@ export default function Module({ setTabNum }) { index={index} addRoof={roof} roofTab={index} - moduleConstructionSelectionData={moduleSelectionData?.roofConstructions[index]} tempModuleSelectionData={tempModuleSelectionData} setTempModuleSelectionData={setTempModuleSelectionData} - selectedModule={selectedModules} + moduleSelectionData={moduleSelectionData} setModuleSelectionData={setModuleSelectionData} />
diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 90982086..28b32d5b 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -1,20 +1,19 @@ -import { useEffect, useState, useRef } from 'react' -import { useRecoilValue } from 'recoil' +import { useEffect, useState, useRef, useReducer } from 'react' +import { useRecoilValue, useRecoilState } from 'recoil' import { currentCanvasPlanState, pitchTextSelector } from '@/store/canvasAtom' import { useMessage } from '@/hooks/useMessage' import { useMasterController } from '@/hooks/common/useMasterController' import { useCommonCode } from '@/hooks/common/useCommonCode' -import { moduleSelectionInitParamsState } from '@/store/selectedModuleOptions' +import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions' import { isObjectNotEmpty } from '@/util/common-utils' import QSelectBox from '@/components/common/select/QSelectBox' export default function ModuleTabContents({ addRoof, roofTab, - moduleConstructionSelectionData, tempModuleSelectionData, setTempModuleSelectionData, - selectedModule, + moduleSelectionData, setModuleSelectionData, }) { const { getMessage } = useMessage() @@ -24,6 +23,7 @@ export default function ModuleTabContents({ const { findCommonCode } = useCommonCode() const [raftCodes, setRaftCodes] = useState([]) //가대 목록 + const [trestleList, setTrestleList] = useState([]) const [constMthdList, setConstMthdList] = useState([]) const [roofBaseList, setRoofBaseList] = useState([]) @@ -53,12 +53,17 @@ export default function ModuleTabContents({ const [isExistData, setIsExistData] = useState(false) + const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 + const [moduleConstructionSelectionData, setModuleConstructionSelectionData] = useState() + + useEffect(() => { + setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab]) + }, [moduleSelectionData]) + //서까래간격 변경 const handleChangeRaftBase = (option) => { setSelectedRaftBase(option) - setTrestleParams({ ...trestleParams, raftBaseCd: option.clCode }) - - setTrestleList([]) //가대메이커 + setTrestleParams({ ...trestleParams, raftBaseCd: option.clCode }) //가대메이커 setConstMthdList([]) //공법 초기화 setRoofBaseList([]) //지붕밑바탕 초기화 setConstructionList([]) //공법 초기화 @@ -77,6 +82,7 @@ export default function ModuleTabContents({ const handleChangeConstMthd = (option) => { setSelectedConstMthd(option) //선택된값 저장 setRoofBaseParams({ ...trestleParams, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: option.constMthdCd, roofBaseCd: '' }) + setRoofBaseList([]) //지붕밑바탕 초기화 setConstructionList([]) //공법 초기화 } @@ -92,45 +98,6 @@ export default function ModuleTabContents({ setSelectedRoofBase(option) } - const getModuleOptionsListData = async (params) => { - const optionsList = await getTrestleList(params) - - if (optionsList.data.length > 0) { - if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd === null) { - setTrestleList(optionsList.data) - if (isExistData) { - setSelectedTrestle({ ...moduleConstructionSelectionData.trestle }) - } else { - setConstMthdList([]) - setRoofBaseList([]) - } - } - - if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd && optionsList.data[0].roofBaseCd === null) { - setConstMthdList(optionsList.data) - if (isExistData) { - setSelectedConstMthd({ ...moduleConstructionSelectionData.trestle }) - } else { - setRoofBaseList([]) - } - } - - if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd && optionsList.data[0].roofBaseCd) { - setRoofBaseList(optionsList.data) - if (isExistData) { - setSelectedRoofBase({ ...moduleConstructionSelectionData.trestle }) - } - } - } - } - - const getConstructionListData = async (params) => { - if (params.trestleMkrCd && params.constMthdCd && params.roofBaseCd) { - const optionsList = await getConstructionList(params) - setConstructionList(optionsList.data) - } - } - const handleConstruction = (index) => { if (index > -1) { const isPossibleIndex = constructionRef.current @@ -162,6 +129,53 @@ export default function ModuleTabContents({ } } + const handleCvrChecked = () => { + setCvrChecked(!cvrChecked) + } + + const handleSnowGdChecked = () => { + setSnowGdChecked(!snowGdChecked) + } + + const getModuleOptionsListData = async (params) => { + const optionsList = await getTrestleList(params) + + if (optionsList.data.length > 0) { + if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd === null) { + setTrestleList(optionsList.data) + if (isExistData) { + setSelectedTrestle({ ...moduleConstructionSelectionData?.trestle }) + } else { + setConstMthdList([]) + setRoofBaseList([]) + } + } + + if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd && optionsList.data[0].roofBaseCd === null) { + setConstMthdList(optionsList.data) + if (isExistData) { + setSelectedConstMthd({ ...moduleConstructionSelectionData?.trestle }) + } else { + setRoofBaseList([]) + } + } + + if (optionsList.data[0].trestleMkrCd && optionsList.data[0].constMthdCd && optionsList.data[0].roofBaseCd) { + setRoofBaseList(optionsList.data) + if (isExistData) { + setSelectedRoofBase({ ...moduleConstructionSelectionData?.trestle }) + } + } + } + } + + const getConstructionListData = async (params) => { + if (params.trestleMkrCd && params.constMthdCd && params.roofBaseCd) { + const optionsList = await getConstructionList(params) + setConstructionList(optionsList.data) + } + } + useEffect(() => { if (isObjectNotEmpty(selectedRoofBase) && isObjectNotEmpty(selectedConstruction)) { const newRoofConstructions = { @@ -186,14 +200,6 @@ export default function ModuleTabContents({ } }, [selectedConstruction]) - const handleCvrChecked = () => { - setCvrChecked(!cvrChecked) - } - - const handleSnowGdChecked = () => { - setSnowGdChecked(!snowGdChecked) - } - useEffect(() => { setSelectedConstruction({ ...selectedConstruction, setupCover: cvrChecked }) }, [cvrChecked]) @@ -216,7 +222,13 @@ export default function ModuleTabContents({ useEffect(() => { if (isExistData && constructionList.length > 0) { const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex - handleConstruction(selectedIndex) + const construction = constructionList[selectedIndex] + + console.log('construction', construction) + + if (construction.constPossYn === 'Y') { + handleConstruction(selectedIndex) + } } }, [constructionList]) @@ -255,7 +267,7 @@ export default function ModuleTabContents({ } } - setTempModuleSelectionData({ common: moduleSelectionInitParams, module: selectedModule }) + setTempModuleSelectionData({ common: moduleSelectionInitParams, module: selectedModules }) }, [moduleSelectionInitParams]) useEffect(() => { @@ -284,7 +296,6 @@ export default function ModuleTabContents({ useEffect(() => { if (isObjectNotEmpty(tempModuleSelectionData)) { - // setModuleSelectionDataPlanList({ ...moduleSelectionDataPlanList, [currentCanvasPlan.id]: tempModuleSelectionData }) setModuleSelectionData(tempModuleSelectionData) } }, [tempModuleSelectionData]) diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index 613e96eb..ff1eeb35 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -3,7 +3,7 @@ import { useMessage } from '@/hooks/useMessage' import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' import { checkedModuleState, currentCanvasPlanState } from '@/store/canvasAtom' import { useRecoilValue, useSetRecoilState } from 'recoil' -import { moduleSelectionDataPlanListState, moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { useModulePlace } from '@/hooks/module/useModulePlace' const Placement = forwardRef((props, refs) => { @@ -20,14 +20,12 @@ const Placement = forwardRef((props, refs) => { const { selectedModules } = useModulePlace() const setCheckedModules = useSetRecoilState(checkedModuleState) - const moduleSelectionDataPlanList = useRecoilValue(moduleSelectionDataPlanListState) const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //모듈 배치면 생성 useEffect(() => { makeModuleInstArea() - - if (moduleSelectionDataPlanList) { + if (moduleSelectionData) { //1개라도 치도리 불가가 있으면 치도리 불가 const isChidroriValue = moduleSelectionData.roofConstructions.some((item) => item.construction.plvrYn === 'N') if (isChidroriValue) { diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index bfbf76fb..b519f063 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -1,12 +1,11 @@ import { useEffect, useState } from 'react' import { useRecoilState, useRecoilValue } from 'recoil' -import { moduleSelectionDataPlanListState, moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' +import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' import { useMasterController } from '@/hooks/common/useMasterController' import { canvasState, currentCanvasPlanState } from '@/store/canvasAtom' export function useModulePlace() { const canvas = useRecoilValue(canvasState) - const moduleSelectionDataPlanList = useRecoilValue(moduleSelectionDataPlanListState) //다음으로 넘어가는 최종 데이터 const moduleSelectionData = useRecoilValue(moduleSelectionDataState) const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const [trestleDetailParams, setTrestleDetailParams] = useState([]) @@ -32,6 +31,7 @@ export function useModulePlace() { roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null, inclCd: String(item.addRoof.pitch), roofIndex: item.addRoof.index, + workingWidth: item.addRoof.lenBase, } }) setTrestleDetailParams(listParams) @@ -70,8 +70,6 @@ export function useModulePlace() { }) } }) - - console.log('roof', roof) }) }, [trestleDetailList]) diff --git a/src/hooks/module/useModuleSelection.js b/src/hooks/module/useModuleSelection.js index b28e3d97..1b775fc6 100644 --- a/src/hooks/module/useModuleSelection.js +++ b/src/hooks/module/useModuleSelection.js @@ -5,11 +5,9 @@ import { useMasterController } from '@/hooks/common/useMasterController' import { useCommonCode } from '@/hooks/common/useCommonCode' import { selectedModuleState, moduleSelectionInitParamsState } from '@/store/selectedModuleOptions' -import { pitchSelector } from '@/store/canvasAtom' export function useModuleSelection(props) { const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) - const globalPitch = useRecoilValue(pitchSelector) //피치 const [roughnessCodes, setRoughnessCodes] = useState([]) //면조도 목록 const [windSpeedCodes, setWindSpeedCodes] = useState([]) //기준풍속 목록 @@ -17,9 +15,9 @@ export function useModuleSelection(props) { const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도 - const [installHeight, setInstallHeight] = useState('0') //설치 높이 + const [installHeight, setInstallHeight] = useState(managementState?.installHeight) //설치 높이 const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속 - const [verticalSnowCover, setVerticalSnowCover] = useState('0') //수직적설량 + const [verticalSnowCover, setVerticalSnowCover] = useState(managementState?.verticalSnowCover) //수직적설량 const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등 const { getModuleTypeItemList } = useMasterController() @@ -76,12 +74,14 @@ export function useModuleSelection(props) { const getModuleData = async (roofsIds) => { const list = await getModuleTypeItemList(roofsIds) - //selectbox에 이름을 넣는다 - list.data.forEach((item) => { - item.name = item.itemNm - }) - //셀렉트박스 데이터 초기화 - setModuleList(list.data) + if (list.data.length > 0) { + //selectbox에 이름을 넣는다 + list.data.forEach((item) => { + item.name = item.itemNm + }) + //셀렉트박스 데이터 초기화 + setModuleList(list.data) + } } const handleChangeModule = (option) => { @@ -112,7 +112,6 @@ export function useModuleSelection(props) { const handleChangeInstallHeight = (option) => { setInstallHeight(option) - setModuleSelectionInitParams({ ...moduleSelectionInitParams, instHt: option, diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index c8139893..f56fd3bd 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -120,6 +120,8 @@ export function useCanvasSetting() { const { closeAll } = usePopup() useEffect(() => { + console.log('correntObjectNo', correntObjectNo) + setFetchRoofMaterials(!fetchRoofMaterials) if (fetchRoofMaterials) { addRoofMaterials() @@ -165,11 +167,11 @@ export function useCanvasSetting() { useEffect(() => { //console.log('🚀 ~ useEffect ~ roofMaterials 22 :', previousRoofMaterialsYn, roofMaterials.length , JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) // 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음 - if (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo - || roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) { - - // 1회만 실행 - if (roofMaterials && previousRoofMaterialsYn === 'N') { + if ( + (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo) || + (roofMaterials.length !== 0 && JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) + ) { + if (roofMaterials) { fetchBasicSettings() previousRoofMaterialsYn = 'Y' } diff --git a/src/store/selectedModuleOptions.js b/src/store/selectedModuleOptions.js index b09c9294..faa979fd 100644 --- a/src/store/selectedModuleOptions.js +++ b/src/store/selectedModuleOptions.js @@ -85,9 +85,3 @@ export const moduleSelectionDataState = atom({ }, dangerouslyAllowMutability: true, }) - -export const moduleSelectionDataPlanListState = atom({ - key: 'moduleSelectionDataPlanListState', - default: {}, - dangerouslyAllowMutability: true, -}) From 46ac1f85137ede41ea122c41978d875e6b020ea3 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 20 Jan 2025 13:34:59 +0900 Subject: [PATCH 036/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EB=A6=AC=EC=BD=94=EC=9D=BC=20?= =?UTF-8?q?=EC=A0=80=EC=9E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Module.jsx | 2 -- .../modal/basic/step/ModuleTabContents.jsx | 14 +++----------- 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 0d5a552c..03f798c5 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -229,8 +229,6 @@ export default function Module({ setTabNum }) { roofTab={index} tempModuleSelectionData={tempModuleSelectionData} setTempModuleSelectionData={setTempModuleSelectionData} - moduleSelectionData={moduleSelectionData} - setModuleSelectionData={setModuleSelectionData} />
))} diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 28b32d5b..e0747096 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -8,14 +8,7 @@ import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModul import { isObjectNotEmpty } from '@/util/common-utils' import QSelectBox from '@/components/common/select/QSelectBox' -export default function ModuleTabContents({ - addRoof, - roofTab, - tempModuleSelectionData, - setTempModuleSelectionData, - moduleSelectionData, - setModuleSelectionData, -}) { +export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) { const { getMessage } = useMessage() const [roofMaterial, setRoofMaterial] = useState(addRoof) //지붕재` const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트 @@ -56,6 +49,8 @@ export default function ModuleTabContents({ const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 const [moduleConstructionSelectionData, setModuleConstructionSelectionData] = useState() + const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터 + useEffect(() => { setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab]) }, [moduleSelectionData]) @@ -223,9 +218,6 @@ export default function ModuleTabContents({ if (isExistData && constructionList.length > 0) { const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex const construction = constructionList[selectedIndex] - - console.log('construction', construction) - if (construction.constPossYn === 'Y') { handleConstruction(selectedIndex) } From 645bd21f308e6b586237f97990ce1b9ac499384c Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 20 Jan 2025 13:53:03 +0900 Subject: [PATCH 037/130] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=9B=90=EB=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Module.jsx | 24 +++++++++---------- .../modal/basic/step/ModuleTabContents.jsx | 2 +- src/hooks/surface/useSurfaceShapeBatch.js | 4 ++-- src/locales/ko.json | 3 ++- 4 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 03f798c5..b3dbb0d3 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -108,19 +108,17 @@ export default function Module({ setTabNum }) { {selectedModules.itemList && selectedModules.itemList.map((row, index) => ( - <> - - -
- - {row.itemNm} -
- - {Number(row.shortAxis).toFixed(0)} - {Number(row.longAxis).toFixed(0)} - {Number(row.wpOut).toFixed(0)} - - + + +
+ + {row.itemNm} +
+ + {Number(row.shortAxis).toFixed(0)} + {Number(row.longAxis).toFixed(0)} + {Number(row.wpOut).toFixed(0)} + ))} diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index e0747096..30691d4e 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -249,7 +249,7 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio setConstructionList([]) if (isObjectNotEmpty(moduleConstructionSelectionData)) { - //기존에 데이터가 있으면 + //기존에 데이터가 있으면 파라메터를 넣는다 setConstructionParams({ ...moduleConstructionSelectionData.trestle, constMthdCd: '', roofBaseCd: '' }) setRoofBaseParams({ ...moduleConstructionSelectionData.trestle, roofBaseCd: '' }) setCvrChecked(moduleConstructionSelectionData.construction.setupCover) diff --git a/src/hooks/surface/useSurfaceShapeBatch.js b/src/hooks/surface/useSurfaceShapeBatch.js index 99eed453..89f88607 100644 --- a/src/hooks/surface/useSurfaceShapeBatch.js +++ b/src/hooks/surface/useSurfaceShapeBatch.js @@ -649,11 +649,11 @@ export function useSurfaceShapeBatch() { const deleteAllSurfacesAndObjects = () => { swalFire({ - text: '배치면 내용을 전부 삭제하시겠습니까?', + text: getMessage('batch.canvas.delete.all'), type: 'confirm', confirmFn: () => { canvas.clear() - swalFire({ text: '삭제 완료 되었습니다.' }) + swalFire({ text: getMessage('plan.message.delete') }) }, // denyFn: () => { // swalFire({ text: '취소되었습니다.', icon: 'error' }) diff --git a/src/locales/ko.json b/src/locales/ko.json index c928a2f1..6f9e789c 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -984,5 +984,6 @@ "module.place.out": "설치면 밖으로 모듈을 설치 할 수 없습니다.", "module.place.no.surface": "선택된 모듈 설치면이 없습니다.", "module.place.select.module": "모듈을 선택해주세요.", - "module.place.select.one.module": "모듈은 하나만 선택해주세요." + "module.place.select.one.module": "모듈은 하나만 선택해주세요.", + "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?" } From 370617ff63585dd196cbb241676d2a7decb86db2 Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Mon, 20 Jan 2025 13:56:14 +0900 Subject: [PATCH 038/130] =?UTF-8?q?=EC=BB=A4=EB=AE=A4=EB=8B=88=ED=8B=B0=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/community/ArchiveTable.jsx | 27 +------------------ src/components/community/Table.jsx | 1 + .../community/modal/BoardDetailModal.jsx | 2 +- src/util/board-utils.js | 16 ++++++++--- 4 files changed, 16 insertions(+), 30 deletions(-) diff --git a/src/components/community/ArchiveTable.jsx b/src/components/community/ArchiveTable.jsx index 51664c8a..ec7783d8 100644 --- a/src/components/community/ArchiveTable.jsx +++ b/src/components/community/ArchiveTable.jsx @@ -54,31 +54,6 @@ export default function ArchiveTable({ clsCode }) { fetchData() }, [search.searchValue, search.searchFlag]) - // 상세 파일 목록 조회 - const handleDetailFileListDown = async (noticeNo) => { - const url = `/api/board/detail` - const params = new URLSearchParams({ - noticeNo: noticeNo, - }) - const apiUrl = `${url}?${params.toString()}` - - const resultData = await get({ url: apiUrl }) - - if (resultData) { - if (resultData.result.code === 200) { - const boardDetailFileList = resultData.data.listFile - - if (boardDetailFileList && Array.isArray(boardDetailFileList)) { - boardDetailFileList.forEach((boardFile) => { - handleFileDown(boardFile) - }) - } - } else { - alert(resultData.result.message) - } - } - } - return ( <> {boardList.length > 0 ? ( @@ -101,7 +76,7 @@ export default function ArchiveTable({ clsCode }) {
{/* 첨부파일 */} - +
))} diff --git a/src/components/community/Table.jsx b/src/components/community/Table.jsx index e7a06d53..d18eefa2 100644 --- a/src/components/community/Table.jsx +++ b/src/components/community/Table.jsx @@ -41,6 +41,7 @@ export default function Table({ clsCode }) { schTitle: search.searchValue ? search.searchValue : '', startRow: startRow, endRow: endRow, + schMainYn: 'N', }) const apiUrl = `${url}?${params.toString()}` diff --git a/src/components/community/modal/BoardDetailModal.jsx b/src/components/community/modal/BoardDetailModal.jsx index aafb0d8f..f9a0d333 100644 --- a/src/components/community/modal/BoardDetailModal.jsx +++ b/src/components/community/modal/BoardDetailModal.jsx @@ -61,7 +61,7 @@ export default function BoardDetailModal({ noticeNo, setOpen }) {
{getMessage('board.sub.fileList')}
{boardDetail.listFile.map((boardFile) => (
-
diff --git a/src/util/board-utils.js b/src/util/board-utils.js index c41ba22a..9a6b622c 100644 --- a/src/util/board-utils.js +++ b/src/util/board-utils.js @@ -1,12 +1,13 @@ import { useAxios } from '@/hooks/useAxios' // 파일 다운로드 -export const handleFileDown = async (file) => { +export const handleFileDown = async (keyNo, zipYn) => { const { promiseGet } = useAxios() const url = `/api/board/file/download` const params = new URLSearchParams({ - encodeFileNo: file.encodeFileNo, + keyNo: keyNo, + zipYn: zipYn, }) const options = { responseType: 'blob' } const apiUrl = `${url}?${params.toString()}` @@ -18,8 +19,17 @@ export const handleFileDown = async (file) => { const fileUrl = window.URL.createObjectURL(blob) const link = document.createElement('a') + const contentDisposition = resultData.headers.get('content-disposition') + let filename = 'filename' + if (contentDisposition) { + const matches = contentDisposition.match(/filename="?([^"]+)"?/) + if (matches && matches[1]) { + filename = matches[1] + } + } + + link.download = decodeURIComponent(filename) link.href = fileUrl - link.download = file.srcFileNm document.body.appendChild(link) link.click() link.remove() From d53191b793c112321d5881c3a6bbf13ad1b5bf1f Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Mon, 20 Jan 2025 14:24:54 +0900 Subject: [PATCH 039/130] =?UTF-8?q?=F0=9F=93=8Cfeat:=20Add=20popup=20statu?= =?UTF-8?q?s=20save=20hooks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/GlobalDataProvider.js | 11 +- src/components/Playground.jsx | 326 +++++++++++++++++- .../modal/basic/step/Orientation.jsx | 6 +- .../common/useCanvasPopupStatusController.js | 63 +++- 4 files changed, 378 insertions(+), 28 deletions(-) diff --git a/src/app/GlobalDataProvider.js b/src/app/GlobalDataProvider.js index d930bbed..f7cce530 100644 --- a/src/app/GlobalDataProvider.js +++ b/src/app/GlobalDataProvider.js @@ -3,11 +3,12 @@ import { createContext, useEffect, useState } from 'react' import { useLocalStorage } from 'usehooks-ts' -export const GlobalDataContext = createContext({ - managementState: {}, - setManagementState: () => {}, - managementStateLoaded: null, -}) +// export const GlobalDataContext = createContext({ +// managementState: {}, +// setManagementState: () => {}, +// managementStateLoaded: null, +// }) +export const GlobalDataContext = createContext(null) const GlobalDataProvider = ({ children }) => { const [managementState, setManagementState] = useState(null) diff --git a/src/components/Playground.jsx b/src/components/Playground.jsx index a55f4e46..b2e64edc 100644 --- a/src/components/Playground.jsx +++ b/src/components/Playground.jsx @@ -27,6 +27,7 @@ import useSWR from 'swr' import useSWRMutation from 'swr/mutation' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' import { canvasPopupStatusStore } from '@/store/canvasPopupStatusAtom' +import { moduleSelectionDataPlanListState } from '@/store/selectedModuleOptions' export default function Playground() { const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState) @@ -256,25 +257,25 @@ export default function Playground() { }) } - const [callFlag, setCallFlag] = useState(false) + // const [callFlag, setCallFlag] = useState(false) // const { data: tutoData, error, isLoading } = useSWR('http://localhost:8080/api/tutorial', getFetcher) - const { data: tutoData, error, isLoading } = useSWR(callFlag ? 'http://localhost:8080/api/tutorial' : null, getFetcher) - const { trigger, isMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher) + // const { data: tutoData, error, isLoading } = useSWR(callFlag ? 'http://localhost:8080/api/tutorial' : null, getFetcher) + // const { trigger, isMutating } = useSWRMutation('http://localhost:8080/api/tutorial', postFetcher) - if (isLoading) { - return
Loading...
- } + // if (isLoading) { + // return
Loading...
+ // } - if (error) { - return
Error...
- } + // if (error) { + // return
Error...
+ // } - useCanvasPopupStatusController(1) + // const [moduleSelectionDataPlanListStore, setModuleSelectionDataPlanListStore] = useRecoilState(moduleSelectionDataPlanListState) + // useEffect(() => { + // console.log('🚀 ~ Playground ~ moduleSelectionDataPlanListStore:', moduleSelectionDataPlanListStore) + // }, [moduleSelectionDataPlanListStore]) + // const { trigger: canvasPopupStatusTrigger } = useCanvasPopupStatusController({ objectNo: 'R201T01241120001', planNo: 2, popupType: 2 }) - const [canvasPopupStatusState, setCanvasPopupStatusState] = useRecoilState(canvasPopupStatusStore) - useEffect(() => { - console.log('🚀 ~ Playground ~ canvasPopupStatusState:', canvasPopupStatusState) - }, [canvasPopupStatusState]) return ( <>
@@ -579,7 +580,7 @@ export default function Playground() { Sweetalert - alert
-
+ {/*
{tutoData && tutoData.map((item) => (
@@ -594,6 +595,301 @@ export default function Playground() { +
*/} +
+
diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index 4b100514..a64210f4 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -1,8 +1,9 @@ -import { forwardRef, useImperativeHandle, useState } from 'react' +import { forwardRef, useContext, useImperativeHandle, useState } from 'react' import { useMessage } from '@/hooks/useMessage' import { useOrientation } from '@/hooks/module/useOrientation' import { getDegreeInOrientation } from '@/util/canvas-util' import { numberCheck } from '@/util/common-utils' +import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' export const Orientation = forwardRef(({ tabNum }, ref) => { const { getMessage } = useMessage() @@ -17,6 +18,7 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { const handleNextStep = () => { nextStep() + canvasPopupStatusTrigger(compasDeg) } const checkDegree = (e) => { @@ -27,6 +29,8 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { } } + const { trigger: canvasPopupStatusTrigger } = useCanvasPopupStatusController(1) + return ( <>
diff --git a/src/hooks/common/useCanvasPopupStatusController.js b/src/hooks/common/useCanvasPopupStatusController.js index 88b2207a..4138c239 100644 --- a/src/hooks/common/useCanvasPopupStatusController.js +++ b/src/hooks/common/useCanvasPopupStatusController.js @@ -1,28 +1,77 @@ 'use client' import { useEffect } from 'react' +import { useRecoilState, useRecoilValue } from 'recoil' import useSWR from 'swr' import useSWRMutation from 'swr/mutation' import { useAxios } from '../useAxios' -import { useRecoilState } from 'recoil' -import { canvasPopupStatusStore } from '@/store/canvasPopupStatusAtom' +import { unescapeString } from '@/util/common-utils' +import { moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { compasDegAtom } from '@/store/orientationAtom' +import { currentCanvasPlanState } from '@/store/canvasAtom' -export function useCanvasPopupStatusController(popupType) { - const [canvasPopupStatusState, setCanvasPopupStatusState] = useRecoilState(canvasPopupStatusStore) +export function useCanvasPopupStatusController(param = 1) { + const popupType = param + + const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom) + const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState) const { getFetcher, postFetcher } = useAxios() + + const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) + console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan) + const { data: popupStatus, error, isLoading, - } = useSWR(popupType ? 'canvas-popup-status--data' : null, () => getFetcher(`http://localhost:8080/api/tutorial?popupType=${popupType}`)) + } = useSWR( + popupType ? `/api/v1/canvas-popup-status?objectNo=${currentCanvasPlan.objectNo}&planNo=${currentCanvasPlan.planNo}&popupType=${popupType}` : null, + getFetcher, + ) useEffect(() => { + console.log('🚀 ~ useEffect ~ popupStatus:', popupStatus) if (popupStatus) { - setCanvasPopupStatusState({ ...canvasPopupStatusState, [popupType]: popupStatus }) + switch (parseInt(popupStatus?.popupType)) { + case 1: + setCompasDeg(popupStatus.popupStatus) + break + case 2: + setModuleSelectionDataStore(JSON.parse(unescapeString(popupStatus.popupStatus))) + break + case 3: + break + case 4: + break + default: + } + } else { + switch (popupType) { + case 1: + setCompasDeg(0) + break + case 2: + setModuleSelectionDataStore({ + common: {}, + roofConstructions: [], + }) + break + } } }, [popupStatus]) - const { trigger, isMutating } = useSWRMutation('canvas-popup-status-update', postFetcher) + const { trigger, isMutating } = useSWRMutation( + `/api/v1/canvas-popup-status?objectNo=${currentCanvasPlan.objectNo}&planNo=${currentCanvasPlan.planNo}&popupType=${popupType}`, + (url, { arg }) => { + const params = { + objectNo: currentCanvasPlan.objectNo, + planNo: parseInt(currentCanvasPlan.planNo), + popupType: popupType.toString(), + popupStatus: JSON.stringify(arg).replace(/"/g, '\"'), + } + postFetcher(`/api/v1/canvas-popup-status`, params) + }, + ) return { trigger } } From 57f449336a3a8acf98edf726e37ad15b74e7b2bc Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Mon, 20 Jan 2025 14:34:05 +0900 Subject: [PATCH 040/130] =?UTF-8?q?=F0=9F=93=8Cchore:=20Remove=20unused=20?= =?UTF-8?q?provider?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/management/ManagementProvider.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/management/ManagementProvider.js b/src/app/management/ManagementProvider.js index fb57e948..80da8a62 100644 --- a/src/app/management/ManagementProvider.js +++ b/src/app/management/ManagementProvider.js @@ -12,7 +12,8 @@ const ManagementProvider = ({ children }) => { // }, [managementState]) // return {children} - return {children} + // return {children} + return <>{children} } export default ManagementProvider From f2740ac32fe3bff98d7403ccd1f9723fbcd8800d Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Mon, 20 Jan 2025 14:42:30 +0900 Subject: [PATCH 041/130] =?UTF-8?q?=F0=9F=93=8Cchore:=20Remove=20unused=20?= =?UTF-8?q?context?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/floor-plan/FloorPlanProvider.js | 28 ++++++++++++------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index fbfbea41..13c3dd5a 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -27,12 +27,12 @@ const defaultEstimateData = { * 모듈,회로 구성 상태 데이터 * 각 설정 팝업 상태를 저장하는 데이터 */ -const defaultProcessStep = { - gnbStep: 0, - processStep: 0, - moduleCofigureData: {}, - pcsConfigureData: {}, -} +// const defaultProcessStep = { +// gnbStep: 0, +// processStep: 0, +// moduleCofigureData: {}, +// pcsConfigureData: {}, +// } export const FloorPlanContext = createContext({ floorPlanState: {}, @@ -49,12 +49,12 @@ const FloorPlanProvider = ({ children }) => { const pid = searchParams.get('pid') //useEffect(() => { // 오류 발생으로 useEffect 사용 - if (pathname === '/floor-plan') { - if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { - notFound() - } - setCurrentObjectNo(objectNo) + if (pathname === '/floor-plan') { + if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + notFound() } + setCurrentObjectNo(objectNo) + } //}, [pid, objectNo]) const [floorPlanState, setFloorPlanState] = useState({ @@ -70,12 +70,10 @@ const FloorPlanProvider = ({ children }) => { const [estimateContextState, setEstimateContextState] = useReducer(reducer, defaultEstimateData) - const [processStepState, setProcessStepState] = useReducer(reducer, defaultProcessStep) + // const [processStepState, setProcessStepState] = useReducer(reducer, defaultProcessStep) return ( - + {children} ) From 29da8b764055e362cf9e57aa283bf0a830aac1e3 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Mon, 20 Jan 2025 14:47:59 +0900 Subject: [PATCH 042/130] =?UTF-8?q?Canvas=EC=84=A4=EC=A0=95=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EC=B4=88=EA=B8=B0=ED=99=94(reset=ED=95=A8?= =?UTF-8?q?=EC=88=98=EC=82=AC=EC=9A=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 015fbf1c..11d5d207 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -58,17 +58,22 @@ export function useCanvasSetting() { const [settingModalFirstOptions, setSettingModalFirstOptions] = useRecoilState(settingModalFirstOptionsState) const [settingModalSecondOptions, setSettingModalSecondOptions] = useRecoilState(settingModalSecondOptionsState) + const resetSettingModalFirstOptions = useResetRecoilState(settingModalFirstOptionsState) + const resetSettingModalSecondOptions = useResetRecoilState(settingModalSecondOptionsState) const [selectedFont, setSelectedFont] = useState() const [selectedFontWeight, setSelectedFontWeight] = useState() const [selectedFontSize, setSelectedFontSize] = useState() const [selectedFontColor, setSelectedFontColor] = useState() const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom) + const resetGlobalFont = useResetRecoilState(globalFontAtom) const [adsorptionPointMode, setAdsorptionPointMode] = useRecoilState(adsorptionPointModeState) const [adsorptionRange, setAdsorptionRange] = useRecoilState(adsorptionRangeState) const [planSizeSettingMode, setPlanSizeSettingMode] = useRecoilState(planSizeSettingState) + const resetPlanSizeSettingMode = useResetRecoilState(planSizeSettingState) const [dimensionLineSettings, setDimensionLineSettings] = useRecoilState(dimensionLineSettingsState) + const resetDimensionLineSettings = useResetRecoilState(dimensionLineSettingsState) const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState) const [dotLineGridSetting, setDotLineGridSettingState] = useRecoilState(dotLineGridSettingState) @@ -538,23 +543,27 @@ export function useCanvasSetting() { //그리드 색 설정 setGridColor(res.gridColor) } else { - //조회된 글꼴 데이터가 없는 경우 + //조회된 글꼴 데이터가 없는 경우 (데이터 초기화) //흡착점 ON/OFF setAdsorptionPointMode({ ...adsorptionPointMode, adsorptionPoint: false }) //치수선 설정 - setDimensionLineSettings({ ...dimensionLineSettings, ...dimensionLineSettingsState.default }) + // setDimensionLineSettings({ ...dimensionLineSettings, ...dimensionLineSettingsState.default }) + resetDimensionLineSettings() //도면크기 설정 - setPlanSizeSettingMode({ ...planSizeSettingMode, ...planSizeSettingModeState.default }) + // setPlanSizeSettingMode({ ...planSizeSettingMode, ...planSizeSettingState.default }) + resetPlanSizeSettingMode() // 데이터 설정 - setSettingModalFirstOptions(...settingModalFirstOptions, ...settingModalFirstOptionsState.default) + // setSettingModalFirstOptions({ ...settingModalFirstOptions, ...settingModalFirstOptionsState.default }) + resetSettingModalFirstOptions() + //setSettingModalSecondOptions({ ...settingModalSecondOptions, ...settingModalSecondOptionsState.default }) + resetSettingModalSecondOptions() - setSettingModalSecondOptions(...settingModalSecondOptions, ...settingModalSecondOptionsState.default) - - setGlobalFont({ ...globalFont, ...globalFontState.default }) + // setGlobalFont({ ...globalFont, ...globalFontAtom.default }) + resetGlobalFont() //점/선 그리드 setDotLineGridSettingState({ ...defaultDotLineGridSetting }) From 471745419d92ae2d9cc583133f12e2abdfada4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:17:04 +0900 Subject: [PATCH 043/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=88=98=EB=8F=99?= =?UTF-8?q?,=20=EC=9E=90=EB=8F=99=20=EB=B0=B0=EC=B9=98=EC=8B=9C=20?= =?UTF-8?q?=EC=A7=91=EA=B3=84=ED=91=9C=20=EB=B0=98=EC=98=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../step/type/PassivityCircuitAllocation.jsx | 9 +++++---- .../modal/panelBatch/PanelBatchStatistics.jsx | 18 +++++++++--------- src/hooks/module/useModuleBasicSetting.js | 9 ++++++--- src/store/circuitTrestleAtom.js | 5 +---- 4 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index e9da38b3..61869db0 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -2,7 +2,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import { POLYGON_TYPE } from '@/common/common' import { useMessage } from '@/hooks/useMessage' import { canvasState } from '@/store/canvasAtom' -import { modelState } from '@/store/circuitTrestleAtom' +import { modelState, moduleStatisticsState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' import { useContext, useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' @@ -19,15 +19,16 @@ export default function PassivityCircuitAllocation() { const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) + const { header, rows, footer } = useRecoilValue(moduleStatisticsState) const [moduleData, setModuleData] = useState({ - header: [], - rows: [], + header: header, + rows: rows, + footer: footer, }) const model = useRecoilValue(modelState) const [selectedModels, setSelectedModels] = useState(model.selectedModels) const [selectedPcs, setSelectedPcs] = useState(selectedModels[0]) const [totalWpout, setTotalWpout] = useState(0) - useEffect(() => { setSurfaceInfo() if (!managementState) { diff --git a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx index fa4f82f6..aff0926b 100644 --- a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx +++ b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx @@ -4,7 +4,7 @@ import { useState } from 'react' import { useMessage } from '@/hooks/useMessage' import WithDraggable from '@/components/common/draggable/WithDraggable' import { moduleStatisticsState } from '@/store/circuitTrestleAtom' -import { useRecoilValue } from 'recoil' +import { useRecoilValue, useResetRecoilState } from 'recoil' export default function PanelBatchStatistics() { const { getMessage } = useMessage() @@ -24,23 +24,23 @@ export default function PanelBatchStatistics() { - {header.map((item) => ( - + {header.map((item, index) => ( + ))} - {rows.map((row) => ( - - {header.map((item) => ( + {rows.map((row, index) => ( + + {header.map((item, i) => ( // - + ))} ))} - {footer.map((item) => ( - + {footer.map((item, index) => ( + // ))} diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 08a06320..9935b450 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -1,4 +1,4 @@ -import { useRecoilState, useRecoilValue } from 'recoil' +import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { canvasState, checkedModuleState, isManualModuleSetupState, selectedModuleState } from '@/store/canvasAtom' import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util' import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom' @@ -32,7 +32,7 @@ export function useModuleBasicSetting() { const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState) const checkedModule = useRecoilValue(checkedModuleState) const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState) - const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState) + const setModuleStatistics = useSetRecoilState(moduleStatisticsState) useEffect(() => { // console.log('basicSetting', basicSetting) @@ -485,6 +485,7 @@ export function useModuleBasicSetting() { let manualModule = new QPolygon(tempModule.points, { ...moduleOptions, moduleInfo: checkedModule[0] }) canvas?.add(manualModule) manualDrawModules.push(manualModule) + getModuleStatistics() } else { swalFire({ text: getMessage('module.place.overlab') }) } @@ -1843,6 +1844,8 @@ export function useModuleBasicSetting() { } }) } + + getModuleStatistics() } const autoFlatroofModuleSetup = (placementFlatRef) => { @@ -2233,7 +2236,7 @@ export function useModuleBasicSetting() { }) moduleSetupSurface.set({ modules: setupedModules }) - + getModuleStatistics() // console.log('moduleSetupSurface', moduleSetupSurface) // console.log('setupedModules', setupedModules) diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 86836b48..fe9c6e35 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -30,9 +30,6 @@ export const moduleStatisticsState = atom({ { name: `발전량(kW)`, prop: 'amount' }, ], rows: [], - footer: [ - { name: '합계', prop: 'name' }, - { name: `발전량(kW)`, prop: 'amount' }, - ], + footer: ['합계', '0'], }, }) From 1219b6546bac9eda5087ce9e33f421e85be90115 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:17:13 +0900 Subject: [PATCH 044/130] =?UTF-8?q?=F0=9F=9A=A8chore:=20Sync=20Sass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/_canvasside.scss | 5 +- src/styles/_modal.scss | 3957 +++++++++++++++++------------------ 2 files changed, 1882 insertions(+), 2080 deletions(-) diff --git a/src/styles/_canvasside.scss b/src/styles/_canvasside.scss index efb79f02..ca9dee61 100644 --- a/src/styles/_canvasside.scss +++ b/src/styles/_canvasside.scss @@ -37,7 +37,7 @@ border: 1px solid #3D3D3D; padding: 20px; .penal-table{ - table-layout: fixed; + table-layout: auto; border-collapse: collapse; thead{ th{ @@ -45,8 +45,11 @@ background-color:rgba(255, 255, 255, 0.05); font-size: 12px; font-weight: 500; + min-width: 140px; + padding: 0 15px; color: #fff; border: 1px solid #505050; + white-space: nowrap; } } tbody{ diff --git a/src/styles/_modal.scss b/src/styles/_modal.scss index 57ce2c5a..61f631cd 100644 --- a/src/styles/_modal.scss +++ b/src/styles/_modal.scss @@ -4,505 +4,485 @@ $pop-bold-weight: 500; $pop-normal-size: 12px; $alert-color: #101010; -@keyframes mountpop { - from { - opacity: 0; - scale: 0.95; - } - to { - opacity: 1; - scale: 1; - } +@keyframes mountpop{ + from{opacity: 0; scale: 0.95;} + to{opacity: 1; scale: 1;} } -@keyframes unmountpop { - from { - opacity: 1; - scale: 1; - } - to { - opacity: 0; - scale: 0.95; - } +@keyframes unmountpop{ + from{opacity: 1; scale: 1;} + to{opacity: 0; scale: 0.95;} } -.normal-font { - font-size: 12px; - font-weight: 400; - color: #fff; +.normal-font{ + font-size: 12px; + font-weight: 400; + color: #fff; } -.bold-font { - font-size: 12px; - font-weight: 500; - color: #fff; +.bold-font{ + font-size: 12px; + font-weight: 500; + color: #fff; } -.modal-pop-wrap { - position: fixed; - top: 0; - left: 0; - width: 100%; - height: -webkit-fit-content; - height: -moz-fit-content; - height: fit-content; - border: 1px solid #000; - border-radius: 4px; - background-color: #272727; - z-index: 100000; - &.xsm { - width: 200px; - } - &.xxxm { - width: 240px; - } - &.xxm { - width: 270px; - } - &.xm { - width: 300px; - } - &.ssm { - width: 380px; - } - &.sm { - width: 580px; - } - &.r { - width: 400px; - } - &.lr { - width: 440px; - } - &.lr-2 { - width: 450px; - } - &.lrr { - width: 480px; - } - &.ml { - width: 530px; - } - &.l-2 { - width: 640px; - } - &.lx-2 { - width: 740px; - } - &.lx { - width: 770px; - } - &.l { - width: 800px; - } - &.ll { - width: 900px; - } - &.mount { - animation: mountpop 0.17s ease-in-out forwards; - } - &.unmount { - animation: unmountpop 0.17s ease-in-out forwards; - } - &.alert { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - background-color: transparent; - border: none; - .modal-head { - background-color: transparent; - padding: 0 0 8px; - .modal-close { - width: 20px; - height: 20px; - background: url(../../public/static/images/canvas/alert_close.svg) no-repeat center; - } +.modal-pop-wrap{ + position: fixed; + top: 0; + left: 0; + width: 100%; + height: -webkit-fit-content; + height: -moz-fit-content; + height: fit-content; + border: 1px solid #000; + border-radius: 4px; + background-color: #272727; + z-index: 100000; + &.xsm{ + width: 200px; } - .modal-body { - background-color: #fff; - padding: 22px; - border-radius: 4px; - border: 1px solid #101010; - color: $alert-color; - .alert-title { + &.xxxm{ + width: 240px; + } + &.xxm{ + width: 270px; + } + &.xm{ + width: 300px; + } + &.ssm{ + width: 380px; + } + &.sm{ + width: 580px; + } + &.r{ + width: 400px; + } + &.lr{ + width: 440px; + } + &.lr-2{ + width: 450px; + } + &.lrr{ + width: 480px; + } + &.ml{ + width: 530px; + } + &.l-2{ + width: 640px; + } + &.lx-2{ + width: 740px; + } + &.lx{ + width: 770px; + } + &.l{ + width: 800px; + } + &.ll{ + width: 900px; + } + &.mount{ + animation: mountpop .17s ease-in-out forwards; + } + &.unmount{ + animation: unmountpop .17s ease-in-out forwards; + } + &.alert{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + background-color: transparent; + border: none; + .modal-head{ + background-color: transparent; + padding: 0 0 8px; + .modal-close{ + width: 20px; + height: 20px; + background: url(../../public/static/images/canvas/alert_close.svg)no-repeat center; + } + } + .modal-body{ + background-color: #fff; + padding: 22px; + border-radius: 4px; + border: 1px solid #101010; + color: $alert-color; + .alert-title{ + font-size: 13px; + font-weight: 700; + color: $alert-color; + margin-bottom: 15px; + } + } + } +} +.modal-head{ + display: flex; + align-items: center; + padding: 10px 24px; + background-color: #000; + // overflow: hidden; + cursor: pointer; + h1.title{ font-size: 13px; + color: $pop-color; font-weight: 700; - color: $alert-color; + } + .modal-close{ + margin-left: auto; + color: transparent; + font-size: 0; + width: 10px; + height: 10px; + background: url(../../public/static/images/canvas/modal_close.svg)no-repeat center; + } +} +.modal-body{ + padding: 24px; + .modal-btn-wrap{ + display: flex; + align-items: center; + gap: 5px; + button{ + flex: 1; + } + &.sub{ + button{ + flex: 1 1 auto; + padding: 0; + } + margin-bottom: 14px; + } + } + .modal-check-btn-wrap{ + margin-top: 15px; + .check-wrap-title{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: 600; + &.light{ + font-weight: $pop-normal-weight; + } + } + .flex-check-box{ + display: flex; + flex-wrap: wrap; + gap: 10px; + margin-top: 15px; + &.for2{ + justify-content: flex-end; + button{ + width: calc(50% - 5px); + } + &.btn{ + gap: 5px; + button{ + width: calc(50% - 2.5px); + } + } + } + &.for-line{ + button{ + flex: 1; + } + } + } + } + .outer-line-wrap{ + border-top: 1px solid #3C3C3C; + margin-top: 10px; + padding-top: 15px; margin-bottom: 15px; - } + > div{ + margin-bottom: 15px; + &:last-child{ + margin-bottom: 0; + } + } } - } -} -.modal-head { - display: flex; - align-items: center; - padding: 10px 24px; - background-color: #000; - // overflow: hidden; - cursor: pointer; - h1.title { - font-size: 13px; - color: $pop-color; - font-weight: 700; - } - .modal-close { - margin-left: auto; - color: transparent; - font-size: 0; - width: 10px; - height: 10px; - background: url(../../public/static/images/canvas/modal_close.svg) no-repeat center; - } -} -.modal-body { - padding: 24px; - .modal-btn-wrap { - display: flex; - align-items: center; - gap: 5px; - button { - flex: 1; - } - &.sub { - button { - flex: 1 1 auto; - padding: 0; - } - margin-bottom: 14px; - } - } - .modal-check-btn-wrap { - margin-top: 15px; - .check-wrap-title { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: 600; - &.light { + .modal-guide{ + display: block; + font-size: $pop-normal-size; + color: $alert-color; font-weight: $pop-normal-weight; - } } - .flex-check-box { - display: flex; - flex-wrap: wrap; - gap: 10px; - margin-top: 15px; - &.for2 { - justify-content: flex-end; - button { - width: calc(50% - 5px); - } - &.btn { - gap: 5px; - button { - width: calc(50% - 2.5px); - } - } - } - &.for-line { - button { - flex: 1; - } - } - } - } - .outer-line-wrap { - border-top: 1px solid #3c3c3c; - margin-top: 10px; - padding-top: 15px; - margin-bottom: 15px; - > div { - margin-bottom: 15px; - &:last-child { - margin-bottom: 0; - } - } - } - .modal-guide { - display: block; - font-size: $pop-normal-size; - color: $alert-color; - font-weight: $pop-normal-weight; - } } -.modal-foot { - display: block; - width: 100%; - padding: 5px 0; - background-color: #000; - cursor: pointer; +.modal-foot{ + display: block; + width: 100%; + padding: 5px 0; + background-color: #000; + cursor: pointer; } -.adsorption-point { - display: flex; - align-items: center; - background-color: #3a3a3a; - border-radius: 3px; - padding-left: 11px; - overflow: hidden; - transition: all 0.17s ease-in-out; - span { - font-size: $pop-normal-size; - color: #898989; - } - i { +.adsorption-point{ display: flex; align-items: center; - padding: 0 7px; - margin-left: auto; - height: 100%; - font-size: 13px; - color: #898989; - } - &.act { - i { - color: $pop-color; - background-color: #1083e3; + background-color: #3A3A3A; + border-radius: 3px; + padding-left: 11px; + overflow: hidden; + transition: all 0.17s ease-in-out; + span{ + font-size: $pop-normal-size; + color: #898989; + } + i{ + display: flex; + align-items: center; + padding: 0 7px; + margin-left: auto; + height: 100%; + font-size: 13px; + color: #898989; + } + &.act{ + i{ + color: $pop-color; + background-color: #1083E3; + } } - } } // grid-option -.grid-check-form { - display: flex; - align-items: center; - gap: 15px; - padding-bottom: 15px; - &.border { - border-bottom: 1px solid #424242; - } -} -.grid-option-overflow { - max-height: 350px; - overflow-y: auto; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #d9d9d9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } -} -.grid-option-wrap { - .grid-option-box { +.grid-check-form{ display: flex; align-items: center; - background-color: transparent; - border: 1px solid #3d3d3d; - border-radius: 2px; - padding: 15px 10px; - gap: 20px; - margin-bottom: 10px; - .grid-input-form { - display: flex; - align-items: center; - span { - flex: none; - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - } - .input-grid { - width: 54px; - input { - width: 100%; + gap: 15px; + padding-bottom: 15px; + &.border{ + border-bottom: 1px solid #424242; + } +} +.grid-option-overflow{ + max-height: 350px; + overflow-y: auto; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #D9D9D9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } +} +.grid-option-wrap{ + .grid-option-box{ + display: flex; + align-items: center; + background-color: transparent; + border: 1px solid #3D3D3D; + border-radius: 2px; + padding: 15px 10px; + gap: 20px; + margin-bottom: 10px; + .grid-input-form{ + display: flex; + align-items: center; + span{ + flex: none; + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + } + .input-grid{ + width: 54px; + input{ + width: 100%; + } + } + } + &:last-child{ + margin-bottom: 0; } - } } - &:last-child { - margin-bottom: 0; + .grid-option-block-form{ + flex: 1; } - } - .grid-option-block-form { +} +.select-form{ + .sort-select{width: 100%;} +} +.grid-select{ flex: 1; - } + &.no-flx{ + flex: unset; + } + .sort-select{ + width: 100%; + background-color: #313131; + min-width: auto; + font-size: 12px; + border: none; + p{ + font-size: 12px; + } + > ul{ + border: none; + } + } + &.right{ + p{ + text-align: right; + } + ul{ + li{ + justify-content: flex-end; + } + } + } } -.select-form { - .sort-select { - width: 100%; - } -} -.grid-select { - flex: 1; - &.no-flx { - flex: unset; - } - .sort-select { - width: 100%; - background-color: #313131; - min-width: auto; - font-size: 12px; - border: none; - p { - font-size: 12px; +.grid-btn-wrap{ + padding-top: 15px; + text-align: right; + button{ + padding: 0 10px; } - > ul { - border: none; - } - } - &.right { - p { - text-align: right; - } - ul { - li { - justify-content: flex-end; - } - } - } -} -.grid-btn-wrap { - padding-top: 15px; - text-align: right; - button { - padding: 0 10px; - } } // grid copy -.grid-option-tit { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - padding-bottom: 15px; +.grid-option-tit{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + padding-bottom: 15px; + } -.grid-direction { - display: flex; - align-items: center; - gap: 5px; - flex: 1; +.grid-direction{ + display: flex; + align-items: center; + gap: 5px; + flex: 1; } -.direction { - width: 22px; - height: 22px; - background-color: #757575; - background-image: url(../../public/static/images/canvas/grid_option_arr.svg); - background-repeat: no-repeat; - background-position: center; - background-size: 16px 15px; - border-radius: 50%; - transition: all 0.15s ease-in-out; - opacity: 0.6; - &.down { - transform: rotate(180deg); - } - &.left { - transform: rotate(-90deg); - } - &.right { - transform: rotate(90deg); - } - &:hover, - &.act { - opacity: 1; - } +.direction{ + width: 22px; + height: 22px; + background-color: #757575; + background-image: url(../../public/static/images/canvas/grid_option_arr.svg); + background-repeat: no-repeat; + background-position: center; + background-size: 16px 15px; + border-radius: 50%; + transition: all .15s ease-in-out; + opacity: 0.6; + &.down{transform: rotate(180deg);} + &.left{transform: rotate(-90deg);} + &.right{transform: rotate(90deg);} + &:hover, + &.act{ + opacity: 1; + } } // grid-move -.move-form { - width: 100%; - p { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - } -} -.input-move-wrap { - display: flex; - align-items: center; - gap: 5px; - span { - color: $pop-color; - font-size: $pop-normal-size; - } - .input-move { - width: 130px; - input { - width: 100%; - } - } -} -.direction-move-wrap { - flex: none; - display: grid; - grid-template-columns: 1fr 1fr; - gap: 5px; - margin-left: auto; -} - -// 배치면 초기 설정 -.placement-table { - table { - table-layout: fixed; - tr { - th { +.move-form{ + width: 100%; + p{ font-size: $pop-normal-size; color: $pop-color; font-weight: $pop-bold-weight; - padding: 18px 0; - border-bottom: 1px solid #424242; - vertical-align: middle; - .tip-wrap { - display: flex; - align-items: center; - } - } - td { - font-size: $pop-normal-size; + } +} +.input-move-wrap{ + display: flex; + align-items: center; + gap: 5px; + span{ color: $pop-color; - border-bottom: 1px solid #424242; - padding: 18px 0 18px 20px; - vertical-align: middle; - .flex-box { - display: flex; - align-items: center; - } - } - &:first-child { - td, - th { - padding-top: 0; - } - } + font-size: $pop-normal-size; } - } - .tooltip { - position: relative; - display: block; - width: 15px; - height: 15px; - margin-left: 5px; - background: url(../../public/static/images/canvas/pop_tip.svg) no-repeat center; - background-size: cover; - } - &.light { - padding: 0; - th, - td { - color: $alert-color; - border-bottom: none; - border-top: 1px solid #efefef; - } - th { - padding: 14px 0; - } - tr { - &:first-child { - td, - th { - padding-top: 14px; + .input-move{ + width: 130px; + input{ + width: 100%; + } + } +} +.direction-move-wrap{ + flex: none; + display: grid; + grid-template-columns: 1fr 1fr; + gap: 5px; + margin-left: auto; +} + +// 배치면 초기 설정 +.placement-table{ + table{ + table-layout: fixed; + tr{ + th{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + padding: 18px 0; + border-bottom: 1px solid #424242; + vertical-align: middle; + .tip-wrap{ + display: flex; + align-items: center; + } + } + td{ + font-size: $pop-normal-size; + color: $pop-color; + border-bottom: 1px solid #424242; + padding: 18px 0 18px 20px; + vertical-align: middle; + .flex-box{ + display: flex; + align-items: center; + } + } + &:first-child{ + td, + th{ + padding-top: 0; + } + } + } + } + .tooltip{ + position: relative; + display: block; + width: 15px; + height: 15px; + margin-left: 5px; + background: url(../../public/static/images/canvas/pop_tip.svg)no-repeat center; + background-size: cover; + } + &.light{ + padding: 0; + th,td{ + color: $alert-color; + border-bottom: none; + border-top: 1px solid #EFEFEF; + } + th{ + padding: 14px 0; + } + tr{ + &:first-child{ + td, + th{ + padding-top: 14px; + } + } + &:last-child{ + td, + th{ + padding-bottom: 0px; + } + } } - } - &:last-child { - td, - th { - padding-bottom: 0px; - } - } } - } } // 2024-12-11 @@ -513,1793 +493,1612 @@ $alert-color: #101010; // max-width: 250px; // } -.pop-form-radio { - display: flex; - align-items: center; - gap: 10px; -} -.placement-option { - display: flex; - align-items: center; - gap: 20px; -} -.select-wrap { - .sort-select { - width: 100%; - } -} -.flex-ment { - display: flex; - align-items: center; - gap: 5px; - span { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - } -} - -.img-edit-wrap { - flex: none; - .img-edit-btn { +.pop-form-radio{ display: flex; align-items: center; - height: 30px; - padding: 0 10px; - font-size: 12px; - font-weight: 400; - color: #101010; - background-color: #fff; - border-radius: 2px; - cursor: pointer; - transition: all 0.15s ease-in-out; - .img-edit { - width: 16px; - height: 16px; - background: url(../../public/static/images/canvas/img_edit_ico.svg) no-repeat center; - background-size: cover; - margin-right: 5px; - } - &:hover { - background-color: #ebebeb; - } - } + gap: 10px; } -.img-name-wrap { - display: flex; - align-items: center; - width: 100%; - margin-left: 10px; - input { - flex: 1; - } - .img-check { - flex: none; - width: 18px; - height: 18px; - margin-left: 5px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - background-image: url(../../public/static/images/canvas/img_check_fail.svg); - } +.placement-option{ + display: flex; + align-items: center; + gap: 20px; +} +.select-wrap{ + .sort-select{ + width: 100%; + } +} +.flex-ment{ + display: flex; + align-items: center; + gap: 5px; + span{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + } + } -.for-address { - input { - flex: 1; - } - .check-address { +.img-edit-wrap{ flex: none; - width: 18px; - height: 18px; - margin-left: 5px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - &.fail { - background-image: url(../../public/static/images/canvas/img_check_fail.svg); + .img-edit-btn{ + display: flex; + align-items: center; + height: 30px; + padding: 0 10px; + font-size: 12px; + font-weight: 400; + color: #101010; + background-color: #fff; + border-radius: 2px; + cursor: pointer; + transition: all .15s ease-in-out; + .img-edit{ + width: 16px; + height: 16px; + background: url(../../public/static/images/canvas/img_edit_ico.svg)no-repeat center; + background-size: cover; + margin-right: 5px; + } + &:hover{ + background-color: #ebebeb; + } } - &.success { - background-image: url(../../public/static/images/canvas/img_check_success.svg); +} +.img-name-wrap{ + display: flex; + align-items: center; + width: 100%; + margin-left: 10px; + input{ + flex: 1; + + } + .img-check{ + flex: none; + width: 18px; + height: 18px; + margin-left: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + background-image: url(../../public/static/images/canvas/img_check_fail.svg); + } +} + +.for-address{ + input{ + flex: 1; + } + .check-address{ + flex: none; + width: 18px; + height: 18px; + margin-left: 5px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + &.fail{background-image: url(../../public/static/images/canvas/img_check_fail.svg);} + &.success{background-image: url(../../public/static/images/canvas/img_check_success.svg);} } - } } // 외벽선 그리기 -.outline-wrap { - padding: 24px 0; - border-top: 1px solid #424242; - - .outline-inner { +.outline-wrap{ + padding: 24px 0; + border-top: 1px solid #424242; + + .outline-inner{ + display: flex; + align-items: center; + margin-bottom: 14px; + &:last-child{ + margin-bottom: 0; + } + .outline-form{ + // width: 50%; + margin-right: 15px; + } + } + &:last-child{ + border-bottom: 1px solid #424242; + } +} +.outline-form{ display: flex; align-items: center; - margin-bottom: 14px; - &:last-child { - margin-bottom: 0; + + span{ + width: 60px; + flex: none; + font-size: $pop-normal-size; + font-weight: $pop-bold-weight; + color: $pop-color; + margin-right: 10px; + &.thin{ + width: auto; + font-weight: $pop-normal-weight; + margin-right: 0; + } } - .outline-form { - // width: 50%; - margin-right: 15px; - } - } - &:last-child { - border-bottom: 1px solid #424242; - } -} -.outline-form { - display: flex; - align-items: center; - span { - width: 60px; - flex: none; - font-size: $pop-normal-size; - font-weight: $pop-bold-weight; - color: $pop-color; - margin-right: 10px; - &.thin { - width: auto; - font-weight: $pop-normal-weight; - margin-right: 0; + .reset-btn{ + flex: none; + width: 30px; + height: 30px; + background: transparent; + border: 1px solid #484848; + border-radius: 2px; + margin-left: 5px; + background-image: url(../../public/static/images/canvas/reset_ico.svg); + background-repeat: no-repeat; + background-size: 12px 12px; + background-position: center; + } + &:last-child{ + margin-right: 0; } - } - - .reset-btn { - flex: none; - width: 30px; - height: 30px; - background: transparent; - border: 1px solid #484848; - border-radius: 2px; - margin-left: 5px; - background-image: url(../../public/static/images/canvas/reset_ico.svg); - background-repeat: no-repeat; - background-size: 12px 12px; - background-position: center; - } - &:last-child { - margin-right: 0; - } } -.cul-wrap { - display: flex; - .outline-box { - width: 50%; - margin-right: 15px; - .outline-form { - width: 100%; - margin-bottom: 14px; - margin-right: 0; - &:last-child { - margin-bottom: 0; - } - } - } - .cul-box { +.cul-wrap{ display: flex; - align-items: center; - justify-content: center; - width: 50%; - background-color: #3d3d3d; - border-radius: 2px; - } + .outline-box{ + width: 50%; + margin-right: 15px; + .outline-form{ + width: 100%; + margin-bottom: 14px; + margin-right: 0; + &:last-child{ + margin-bottom: 0; + } + } + } + .cul-box{ + display: flex; + align-items: center; + justify-content: center; + width: 50%; + background-color: #3D3D3D; + border-radius: 2px ; + } } // 외벽선 속성 설정 -.properties-guide { - font-size: $pop-normal-size; - color: #aaa; - font-weight: $pop-normal-weight; - margin-bottom: 14px; +.properties-guide{ + font-size: $pop-normal-size; + color: #AAA; + font-weight: $pop-normal-weight; + margin-bottom: 14px; } -.setting-tit { - font-size: 13px; - color: $pop-color; - font-weight: $pop-bold-weight; - margin-bottom: 10px; +.setting-tit{ + font-size: 13px; + color: $pop-color; + font-weight: $pop-bold-weight; + margin-bottom: 10px; } -.properties-setting-wrap { - &.outer { - margin-top: 24px; - } - .setting-btn-wrap { - display: flex; - align-items: center; - padding: 14px 0; - border-top: 1px solid #424242; - border-bottom: 1px solid #424242; - .setting-btn { - display: block; - width: 100%; - height: 40px; - font-size: 13px; - color: #fff; - font-weight: 700; - border-radius: 2px; - transition: all 0.15s ease-in-out; - &.green { - background-color: #305941; - border: 1px solid #45cd7d; - &:hover { - background-color: #3a6b4e; - } - } - &.blue { - background-color: #2e5360; - border: 1px solid #3fbae6; - &:hover { - background-color: #365f6e; - } - } +.properties-setting-wrap{ + &.outer{ + margin-top: 24px; + } + .setting-btn-wrap{ + display: flex; + align-items: center; + padding: 14px 0; + border-top: 1px solid #424242; + border-bottom: 1px solid #424242; + .setting-btn{ + display: block; + width: 100%; + height: 40px; + font-size: 13px; + color: #fff; + font-weight: 700; + border-radius: 2px; + transition: all .15s ease-in-out; + &.green{ + background-color: #305941; + border: 1px solid #45CD7D; + &:hover{ + background-color: #3a6b4e; + } + } + &.blue{ + background-color: #2E5360; + border: 1px solid #3FBAE6; + &:hover{ + background-color: #365f6e; + } + } + } } - } } // 지붕형상 설정 -.roof-shape-menu { - display: grid; - grid-template-columns: 1fr 1fr 1fr 1fr; - grid-template-rows: 1fr 1fr; - gap: 24px 10px; - margin-bottom: 24px; - .shape-box { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - padding: 13px; - background-color: #3d3d3d; - transition: background 0.15s ease-in-out; - img { - max-width: 100%; - } - } - .shape-title { - font-size: $pop-normal-size; - font-weight: $pop-bold-weight; - color: $pop-color; - margin-top: 10px; - text-align: center; - transition: color 0.15s ease-in-out; - } - .shape-menu-box { - &.act, - &:hover { - .shape-box { - background-color: #008bff; - } - .shape-title { - color: #008bff; - } - } - } -} - -.setting-box { - padding: 14px 0; - border-top: 1px solid #424242; - border-bottom: 1px solid #424242; -} -.padding-form { - padding-left: 23px; -} -.discrimination-box { - padding: 16px 12px; - border: 1px solid #3d3d3d; - border-radius: 2px; -} - -.modal-bottom-border-bx { - margin-top: 24px; - padding-bottom: 14px; - border-bottom: 1px solid #424242; -} - -// 처마∙케라바 변경 -.eaves-keraba-table { - display: table; - border-collapse: collapse; - .eaves-keraba-item { - display: table-row; - .eaves-keraba-th, - .eaves-keraba-td { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - display: table-cell; - vertical-align: middle; - padding-bottom: 14px; - } - .eaves-keraba-td { - padding-left: 10px; - } - .eaves-keraba-ico { - display: flex; - align-items: center; - justify-content: center; - padding: 5px; - background-color: #3d3d3d; - border: 1px solid #3d3d3d; - border-radius: 2px; - cursor: pointer; - &.act { - border: 1px solid #ed0004; - } - } - &:last-child { - .eaves-keraba-th, - .eaves-keraba-td { - padding-bottom: 0; - } - } - } -} -.guide { - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: $pop-color; - margin-bottom: 24px; - &.sm { - margin-bottom: 15px; - } - span { - display: block; - } -} - -// 지붕면 할당 -.allocation-select-wrap { - display: flex; - align-items: center; - padding-bottom: 14px; - border-bottom: 1px solid #424242; - margin-bottom: 14px; - span { - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-bold-weight; - margin-right: 10px; - } - .allocation-edit { - display: flex; - align-items: center; - height: 30px; - padding: 0 10px; - margin-left: 5px; - font-size: $pop-normal-size; - color: $pop-color; - font-weight: $pop-normal-weight; - border: 1px solid #484848; - background-color: #323234; - i { - display: block; - width: 12px; - height: 12px; - margin-right: 5px; - background: url(../../public/static/images/canvas/allocation_edit.svg) no-repeat center; - background-size: cover; - } - } -} - -.block-box { - display: flex; - align-items: center; - gap: 10px; - margin-bottom: 10px; - .flex-ment { - gap: 10px; - .dec { - text-decoration: underline; - } - .delete { - display: block; - width: 15px; - height: 15px; - background: url(../../public/static/images/canvas/allocation_delete.svg) no-repeat center; - background-size: cover; - } - } - &:last-child { - margin-bottom: 0; - } -} - -.icon-btn-wrap { - flex: 1; - display: flex; - align-items: center; - gap: 5px; - button { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - height: 30px; - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: $pop-color; - border: 1px solid #646464; - border-radius: 2px; - padding: 0 10px; - transition: all 0.15s ease-in-out; - i { - height: 15px; - display: block; - margin-left: 10px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - transition: all 0.15s ease-in-out; - &.allocation01 { - background-image: url(../../public/static/images/canvas/allocation_icon01_white.svg); - width: 15px; - } - &.allocation02 { - background-image: url(../../public/static/images/canvas/allocation_icon02_white.svg); - width: 18px; - } - } - &.act, - &:hover { - color: #101010; - border: 1px solid #101010; - background-color: #fff; - i { - &.allocation01 { - background-image: url(../../public/static/images/canvas/allocation_icon01_black.svg); - } - &.allocation02 { - background-image: url(../../public/static/images/canvas/allocation_icon02_black.svg); - } - } - } - } -} - -// 경사설정 -.slope-wrap { - padding-bottom: 24px; - border-bottom: 1px solid #424242; -} - -// 면형상 배치 -.plane-frame-wrap { - display: flex; - gap: 10px; - .plane-shape-wrap { - flex: none; - width: 73px; - } -} - -.plane-shape-menu { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 5px; - .shape-menu-box { - border-radius: 2px; - width: 34px; - height: 34px; - background-color: #373737; - border: 1px solid #676767; - transition: - background 0.15s ease-in-out, - border 0.15s ease-in-out; - .shape-box { - display: flex; - justify-content: center; - align-items: center; - position: relative; - width: 100%; - height: 100%; - border-radius: 2px; - } - &.act, - &:hover { - border-color: #008bff; - background-color: #008bff; - } - } -} - -.shape-library { - display: flex; - flex-direction: column; - align-items: center; - justify-content: center; - gap: 5px; - padding-top: 5px; - .library-btn { - width: 100%; - height: 34px; - border: 1px solid #6c6c6c; - border-radius: 2px; - background-color: #373737; - background-repeat: no-repeat; - background-position: center; - transition: all 0.15s ease-in-out; - &.ico01 { - background-image: url(../../public/static/images/canvas/shape_labrary01.svg); - background-size: 19px 18px; - } - &.ico02 { - background-image: url(../../public/static/images/canvas/shape_labrary02.svg); - background-size: 15px 20px; - } - &.ico03 { - background-image: url(../../public/static/images/canvas/shape_labrary03.svg); - background-size: 19px 16px; - } - &:hover { - border-color: #1083e3; - background-color: #1083e3; - } - } -} - -.plane-detail-wrap { - display: flex; - flex-direction: column; - flex: 1; -} -.plane-shape-wrapper { - flex: 1; - display: flex; - flex-direction: column; - gap: 10px; - .plane-box { - width: 100%; - padding: 10px 18px; - border-radius: 2px; - background-color: #313131; - border: 1px solid #484848; - .plane-box-tit { - font-size: $pop-normal-size; - font-weight: 600; - color: $pop-color; - margin-bottom: 10px; - } - &.shape-box { - .shape-box-inner { - display: flex; - gap: 15px; - min-height: 140px; - .shape-img { - position: relative; - flex: none; - width: 150px; - background-color: #fff; - border-radius: 2px; - img { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - } - } - .shape-data { - flex: 1; - .eaves-keraba-table { - .eaves-keraba-item { - .eaves-keraba-th, - .eaves-keraba-td { - padding-bottom: 10px; - } - &:last-child { - .eaves-keraba-th, - .eaves-keraba-td { - padding-bottom: 0px; - } - } - } - } - } - } - } - &.direction-box { - flex: 1; - display: flex; - flex-direction: column; - .plane-direction-box { - flex: 1; +.roof-shape-menu{ + display: grid; + grid-template-columns: 1fr 1fr 1fr 1fr; + grid-template-rows: 1fr 1fr; + gap: 24px 10px; + margin-bottom: 24px; + .shape-box{ display: flex; align-items: center; justify-content: center; width: 100%; - } + padding: 13px; + background-color: #3D3D3D; + transition: background .15s ease-in-out; + img{ + max-width: 100%; + } } - } -} -.plane-direction { - width: 150px; - position: relative; - height: 120px; - span { - position: absolute; - font-size: 12px; - font-weight: 500; - color: #b1b1b1; - &.top { - top: 0; - left: 50%; - transform: translateX(-50%); + .shape-title{ + font-size: $pop-normal-size; + font-weight: $pop-bold-weight; + color: $pop-color; + margin-top: 10px; + text-align: center; + transition: color .15s ease-in-out; } - &.right { - top: 50%; - right: 0; - transform: translateY(-50%); + .shape-menu-box{ + &.act, + &:hover{ + .shape-box{background-color: #008BFF;} + .shape-title{color: #008BFF;} + } } - &.bottom { - bottom: 0; - left: 50%; - transform: translateX(-50%); - } - &.left { - top: 50%; - left: 0; - transform: translateY(-50%); - } - } - .plane-btn { - position: absolute; - width: 28px; - height: 28px; - background-color: #777777; - background-image: url(../../public/static/images/canvas/plane_arr.svg); - background-size: 12px 13px; - background-repeat: no-repeat; - background-position: center; - border-radius: 50%; - transition: all 0.15s ease-in-out; - &.up { - top: 22px; - left: 50%; - transform: translateX(-50%); - } - &.right { - top: 50%; - right: 32px; - transform: translateY(-50%) rotate(90deg); - } - &.down { - bottom: 22px; - left: 50%; - transform: translateX(-50%) rotate(180deg); - } - &.left { - top: 50%; - left: 32px; - transform: translateY(-50%) rotate(270deg); - } - &:hover, - &.act { - background-color: #fff; - background-image: url(../../public/static/images/canvas/plane_arr_act.svg); - } - } } -.plane-tab-guide { - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: $pop-color; - margin-top: 10px; +.setting-box{ + padding: 14px 0; + border-top: 1px solid #424242; + border-bottom: 1px solid #424242; } -.plane-shape-btn { - padding-top: 10px; - margin-top: auto; - button { - display: block; - width: 100%; - } +.padding-form{ + padding-left: 23px; +} +.discrimination-box{ + padding: 16px 12px; + border: 1px solid #3D3D3D; + border-radius: 2px; } -// 오브젝트 배치 -.mb-box { - margin-bottom: 24px; +.modal-bottom-border-bx{ + margin-top: 24px; + padding-bottom: 14px; + border-bottom: 1px solid #424242; } -.object-direction-wrap { - display: flex; - align-items: center; - justify-content: center; -} -.discrimination-tit { - font-size: 13px; - color: #fff; - font-weight: 500; -} - -.object-size-wrap { - display: flex; - min-height: 206px; - gap: 24px; - margin-top: 14px; - .object-size-img { - position: relative; - flex: none; - width: 200px; - background-color: #fff; - img { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); +// 처마∙케라바 변경 +.eaves-keraba-table{ + display: table; + border-collapse: collapse; + .eaves-keraba-item{ + display: table-row; + .eaves-keraba-th, + .eaves-keraba-td{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + display: table-cell; + vertical-align: middle; + padding-bottom: 14px; + } + .eaves-keraba-td{ + padding-left: 10px; + } + .eaves-keraba-ico{ + display: flex; + align-items: center; + justify-content: center; + padding: 5px; + background-color: #3D3D3D; + border: 1px solid #3D3D3D; + border-radius: 2px; + cursor: pointer; + &.act{ + border: 1px solid #ED0004; + } + } + &:last-child{ + .eaves-keraba-th, + .eaves-keraba-td{ + padding-bottom: 0; + } + } + } +} +.guide{ + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: $pop-color; + margin-bottom: 24px; + &.sm{ + margin-bottom: 15px; + } + span{ + display: block; } - } } -// 표시변경 -.display-change-wrap { - margin: 24px 0; -} -.warning { - font-size: $pop-normal-size; - font-weight: $pop-normal-weight; - color: #ffafaf; +// 지붕면 할당 +.allocation-select-wrap{ + display: flex; + align-items: center; + padding-bottom: 14px; + border-bottom: 1px solid #424242; + margin-bottom: 14px; + span{ + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-bold-weight; + margin-right: 10px; + } + .allocation-edit{ + display: flex; + align-items: center; + height: 30px; + padding: 0 10px; + margin-left: 5px; + font-size: $pop-normal-size; + color: $pop-color; + font-weight: $pop-normal-weight; + border: 1px solid #484848; + background-color: #323234; + i{ + display: block; + width: 12px; + height: 12px; + margin-right: 5px; + background: url(../../public/static/images/canvas/allocation_edit.svg)no-repeat center; + background-size: cover; + } + } } -// 각 변 속성 변경 -.radio-grid-wrap { - display: grid; - grid-template-columns: repeat(3, 1fr); - gap: 24px 15px; +.block-box{ + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 10px; + .flex-ment{ + gap: 10px; + .dec{ + text-decoration: underline; + } + .delete{ + display: block; + width: 15px; + height: 15px; + background: url(../../public/static/images/canvas/allocation_delete.svg)no-repeat center; + background-size: cover; + } + } + &:last-child{ + margin-bottom: 0; + } } -// 면 흐름 설정 -.drawing-flow-wrap { - display: flex; - gap: 10px; - .discrimination-box { +.icon-btn-wrap{ + flex: 1; + display: flex; + align-items: center; + gap: 5px; + button{ + display: flex; + align-items: center; + justify-content: center; + width: 100%; + height: 30px; + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: $pop-color; + border: 1px solid #646464; + border-radius: 2px; + padding: 0 10px; + transition: all .15s ease-in-out; + i{ + height: 15px; + display: block; + margin-left: 10px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + transition: all .15s ease-in-out; + &.allocation01{ + background-image: url(../../public/static/images/canvas/allocation_icon01_white.svg); + width: 15px; + } + &.allocation02{ + background-image: url(../../public/static/images/canvas/allocation_icon02_white.svg); + width: 18px; + } + } + &.act, + &:hover{ + color: #101010; + border: 1px solid #101010; + background-color: #fff; + i{ + &.allocation01{ + background-image: url(../../public/static/images/canvas/allocation_icon01_black.svg); + } + &.allocation02{ + background-image: url(../../public/static/images/canvas/allocation_icon02_black.svg); + } + } + } + } +} + +// 경사설정 +.slope-wrap{ + padding-bottom: 24px; + border-bottom: 1px solid #424242; +} + +// 면형상 배치 +.plane-frame-wrap{ + display: flex; + gap: 10px; + .plane-shape-wrap{ + flex: none; + width: 73px; + } +} + +.plane-shape-menu{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 5px; + .shape-menu-box{ + border-radius: 2px; + width: 34px; + height: 34px; + background-color: #373737; + border: 1px solid #676767; + transition: background .15s ease-in-out, border .15s ease-in-out; + .shape-box{ + display: flex; + justify-content: center; + align-items: center; + position: relative; + width: 100%; + height: 100%; + border-radius: 2px; + } + &.act, + &:hover{ + border-color: #008BFF; + background-color: #008BFF; + } + } +} + +.shape-library{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + gap: 5px; + padding-top: 5px; + .library-btn{ + width: 100%; + height: 34px; + border: 1px solid #6C6C6C; + border-radius: 2px; + background-color: #373737; + background-repeat: no-repeat; + background-position: center; + transition: all .15s ease-in-out; + &.ico01{background-image: url(../../public/static/images/canvas/shape_labrary01.svg); background-size: 19px 18px;} + &.ico02{background-image: url(../../public/static/images/canvas/shape_labrary02.svg); background-size: 15px 20px;} + &.ico03{background-image: url(../../public/static/images/canvas/shape_labrary03.svg); background-size: 19px 16px;} + &:hover{ + border-color: #1083E3; + background-color: #1083E3; + } + } +} + +.plane-detail-wrap{ + display: flex; + flex-direction: column; + flex: 1; +} +.plane-shape-wrapper{ flex: 1; display: flex; flex-direction: column; - .object-direction-wrap { - flex: 1; + gap: 10px; + .plane-box{ + width: 100%; + padding: 10px 18px; + border-radius: 2px; + background-color: #313131; + border: 1px solid #484848; + .plane-box-tit{ + font-size: $pop-normal-size; + font-weight: 600; + color: $pop-color; + margin-bottom: 10px; + } + &.shape-box{ + .shape-box-inner{ + display: flex; + gap:15px; + min-height: 140px; + .shape-img{ + position: relative; + flex: none; + width: 150px; + background-color: #fff; + border-radius: 2px; + img{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + } + .shape-data{ + flex: 1; + .eaves-keraba-table{ + .eaves-keraba-item{ + .eaves-keraba-th, + .eaves-keraba-td{ + padding-bottom: 10px; + } + &:last-child{ + .eaves-keraba-th, + .eaves-keraba-td{ + padding-bottom: 0px; + } + } + } + } + } + } + } + &.direction-box{ + flex: 1; + display: flex; + flex-direction: column; + .plane-direction-box{ + flex: 1; + display: flex; + align-items: center; + justify-content: center; + width: 100%; + } + } } - &:first-child { - flex: none; - width: 195px; +} +.plane-direction{ + width: 150px; + position: relative; + height: 120px; + span{ + position: absolute; + font-size: 12px; + font-weight: 500; + color: #B1B1B1; + &.top{top: 0; left: 50%; transform: translateX(-50%);} + &.right{top: 50%; right: 0; transform: translateY(-50%);} + &.bottom{bottom: 0; left: 50%; transform: translateX(-50%);} + &.left{top: 50%; left: 0; transform: translateY(-50%);} + } + .plane-btn{ + position: absolute; + width: 28px; + height: 28px; + background-color: #777777; + background-image: url(../../public/static/images/canvas/plane_arr.svg); + background-size: 12px 13px; + background-repeat: no-repeat; + background-position: center; + border-radius: 50%; + transition: all .15s ease-in-out; + &.up{top: 22px; left: 50%; transform: translateX(-50%);} + &.right{top: 50%; right: 32px; transform: translateY(-50%) rotate(90deg);} + &.down{bottom: 22px; left: 50%; transform: translateX(-50%) rotate(180deg);} + &.left{top: 50%; left: 32px; transform: translateY(-50%) rotate(270deg);} + &:hover, + &.act{ + background-color: #fff; + background-image: url(../../public/static/images/canvas/plane_arr_act.svg); + } } - } } -.compas-box { - display: flex; - align-items: center; - justify-content: center; +.plane-tab-guide{ + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: $pop-color; + margin-top: 10px; +} +.plane-shape-btn{ + padding-top: 10px; + margin-top: auto; + button{ + display: block; + width: 100%; + } +} + +// 오브젝트 배치 +.mb-box{ + margin-bottom: 24px; +} + +.object-direction-wrap{ + display: flex; + align-items: center; + justify-content: center; +} +.discrimination-tit{ + font-size: 13px; + color: #fff; + font-weight: 500; +} + +.object-size-wrap{ + display: flex; + min-height: 206px; + gap: 24px; + margin-top: 14px; + .object-size-img{ + position: relative; + flex: none; + width: 200px; + background-color: #fff; + img{ + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + } + } +} + +// 표시변경 +.display-change-wrap{ + margin: 24px 0; +} +.warning{ + font-size: $pop-normal-size; + font-weight: $pop-normal-weight; + color: #FFAFAF; +} + +// 각 변 속성 변경 +.radio-grid-wrap{ + display: grid; + grid-template-columns: repeat(3, 1fr); + gap: 24px 15px; +} + +// 면 흐름 설정 +.drawing-flow-wrap{ + display: flex; + gap: 10px; + .discrimination-box{ + flex: 1; + display: flex; + flex-direction: column; + .object-direction-wrap{ + flex: 1; + } + &:first-child{ + flex: none; + width: 195px; + } + } +} + +.compas-box{ + display: flex; + align-items: center; + justify-content: center; } .compas-box-inner { - position: relative; - width: 200px; - height: 200px; - border-radius: 50%; - - .circle { - position: absolute; - width: 12px; - height: 12px; - border: 1px solid #fff; + position: relative; + width: 200px; + height: 200px; border-radius: 50%; - top: 95%; - left: 50%; - transform-origin: 0 -90px; /* 중심에서 반지름 거리만큼 떨어져 위치 */ - cursor: pointer; - z-index: 3; - /* 0번을 180도 위치(아래)에, 13번을 0도 위치(위)에 배치 */ - i { - position: absolute; - top: 12.5px; - left: 50%; - font-size: 11px; - color: #8b8b8b; - font-weight: 500; - -webkit-user-select: none; - -moz-user-select: none; - -ms-use-select: none; - user-select: none; + + .circle { + position: absolute; + width: 12px; + height: 12px; + border: 1px solid #fff; + border-radius: 50%; + top: 95%; + left: 50%; + transform-origin: 0 -90px; /* 중심에서 반지름 거리만큼 떨어져 위치 */ + cursor:pointer; + z-index: 3; + /* 0번을 180도 위치(아래)에, 13번을 0도 위치(위)에 배치 */ + i{ + position: absolute; + top: 12.5px; + left: 50%; + font-size: 11px; + color: #8B8B8B; + font-weight: 500; + -webkit-user-select: none; + -moz-user-select: none; + -ms-use-select: none; + user-select: none; + } + &:nth-child(1) { transform: rotate(180deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(180deg);}} + &:nth-child(2) { transform: rotate(195deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(165deg);}} + &:nth-child(3) { transform: rotate(210deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(150deg);}} + &:nth-child(4) { transform: rotate(225deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(135deg);}} + &:nth-child(5) { transform: rotate(240deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(120deg);}} + &:nth-child(6) { transform: rotate(255deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(105deg);}} + &:nth-child(7) { transform: rotate(270deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(90deg);}} + &:nth-child(8) { transform: rotate(285deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(75deg);}} + &:nth-child(9) { transform: rotate(300deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(60deg);}} + &:nth-child(10) { transform: rotate(315deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(45deg);}} + &:nth-child(11) { transform: rotate(330deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(30deg);}} + &:nth-child(12) { transform: rotate(345deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(15deg);}} + &:nth-child(13) { transform: rotate(0deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(0deg);}} + &:nth-child(14) { transform: rotate(15deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-15deg);}} + &:nth-child(15) { transform: rotate(30deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-30deg);}} + &:nth-child(16) { transform: rotate(45deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-45deg);}} + &:nth-child(17) { transform: rotate(60deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-60deg);}} + &:nth-child(18) { transform: rotate(75deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-75deg);}} + &:nth-child(19) { transform: rotate(90deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-90deg);}} + &:nth-child(20) { transform: rotate(105deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-105deg);}} + &:nth-child(21) { transform: rotate(120deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-120deg);}} + &:nth-child(22) { transform: rotate(135deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-135deg);}} + &:nth-child(23) { transform: rotate(150deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-150deg);}} + &:nth-child(24) { transform: rotate(165deg) translate(-50%, -50%); i{transform: translateX(-50%) rotate(-165deg);}} + &.act{ + &::after{ + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 5px; + height: 5px; + background-color: #fff; + border-radius: 50%; + } + i{ + color: #fff; + } + } } - &:nth-child(1) { - transform: rotate(180deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(180deg); - } - } - &:nth-child(2) { - transform: rotate(195deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(165deg); - } - } - &:nth-child(3) { - transform: rotate(210deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(150deg); - } - } - &:nth-child(4) { - transform: rotate(225deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(135deg); - } - } - &:nth-child(5) { - transform: rotate(240deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(120deg); - } - } - &:nth-child(6) { - transform: rotate(255deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(105deg); - } - } - &:nth-child(7) { - transform: rotate(270deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(90deg); - } - } - &:nth-child(8) { - transform: rotate(285deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(75deg); - } - } - &:nth-child(9) { - transform: rotate(300deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(60deg); - } - } - &:nth-child(10) { - transform: rotate(315deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(45deg); - } - } - &:nth-child(11) { - transform: rotate(330deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(30deg); - } - } - &:nth-child(12) { - transform: rotate(345deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(15deg); - } - } - &:nth-child(13) { - transform: rotate(0deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(0deg); - } - } - &:nth-child(14) { - transform: rotate(15deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-15deg); - } - } - &:nth-child(15) { - transform: rotate(30deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-30deg); - } - } - &:nth-child(16) { - transform: rotate(45deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-45deg); - } - } - &:nth-child(17) { - transform: rotate(60deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-60deg); - } - } - &:nth-child(18) { - transform: rotate(75deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-75deg); - } - } - &:nth-child(19) { - transform: rotate(90deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-90deg); - } - } - &:nth-child(20) { - transform: rotate(105deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-105deg); - } - } - &:nth-child(21) { - transform: rotate(120deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-120deg); - } - } - &:nth-child(22) { - transform: rotate(135deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-135deg); - } - } - &:nth-child(23) { - transform: rotate(150deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-150deg); - } - } - &:nth-child(24) { - transform: rotate(165deg) translate(-50%, -50%); - i { - transform: translateX(-50%) rotate(-165deg); - } - } - &.act { - &::after { - content: ''; + .compas{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); - width: 5px; - height: 5px; - background-color: #fff; + width: 148px; + height: 148px; + border: 4px solid #fff; border-radius: 50%; - } - i { - color: #fff; - } + .compas-arr{ + width: 100%; + height: 100%; + background: url(../../public/static/images/canvas/compas.svg)no-repeat center; + background-size: 122px 122px; + } } - } - .compas { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 148px; - height: 148px; - border: 4px solid #fff; - border-radius: 50%; - .compas-arr { - width: 100%; - height: 100%; - background: url(../../public/static/images/canvas/compas.svg) no-repeat center; - background-size: 122px 122px; - } - } } -.draw-flow-wrap { - margin: 10px 0; +.draw-flow-wrap{ + margin: 10px 0; } // 지붕모듈선택 -.roof-module-tab { - display: flex; - align-items: center; - gap: 10px; - margin-bottom: 14px; - .module-tab-bx { - flex: 1; - height: 34px; - line-height: 31px; - border: 1px solid #484848; - border-radius: 2px; - background-color: transparent; - font-size: 12px; - color: #aaa; - text-align: center; - cursor: default; - transition: all 0.15s ease-in-out; - &.act { - background-color: #1083e3; - border: 1px solid #1083e3; - color: #fff; - font-weight: 500; - } - } - .tab-arr { - display: block; - width: 9px; - height: 14px; - background-repeat: no-repeat; - background-position: center; - background-size: cover; - background-image: url(../../public/static/images/canvas/module_tab_arr.svg); - transition: all 0.15s ease-in-out; - &.act { - background-image: url(../../public/static/images/canvas/module_tab_arr_white.svg); - } - } -} - -.roof-module-compas { - margin-bottom: 24px; - .compas-box-inner { - width: 280px; - height: 253px; - .circle { - top: 86%; - // &:nth-child(1), - // &:nth-child(7), - // &:nth-child(13), - // &:nth-child(19){ - // &::before{ - // content: ''; - // position: absolute; - // top: 20px; - // left: 50%; - // transform: translateX(-50%); - // width: 1px; - // height: 6px; - // background-color: #8B8B8B; - // } - // } - i { - top: 22px; - } - &.act { - i { - color: #8b8b8b; +.roof-module-tab{ + display: flex; + align-items: center; + gap: 10px; + margin-bottom: 14px; + .module-tab-bx{ + flex: 1; + height: 34px; + line-height: 31px; + border: 1px solid #484848; + border-radius: 2px; + background-color: transparent; + font-size: 12px; + color: #AAA; + text-align: center; + cursor: default; + transition: all .15s ease-in-out; + &.act{ + background-color: #1083E3; + border: 1px solid #1083E3; + color: #fff; + font-weight: 500; + } + } + .tab-arr{ + display: block; + width: 9px; + height: 14px; + background-repeat: no-repeat; + background-position: center; + background-size: cover; + background-image: url(../../public/static/images/canvas/module_tab_arr.svg); + transition: all .15s ease-in-out; + &.act{ + background-image: url(../../public/static/images/canvas/module_tab_arr_white.svg); } - } } - } -} -.center-wrap { - display: flex; - flex-direction: column; - align-items: center; - gap: 20px; } -.module-table-flex-wrap { - display: flex; - gap: 10px; - .outline-form { +.roof-module-compas{ + margin-bottom: 24px; + .compas-box-inner{ + width: 280px; + height: 253px; + .circle{ + top: 86%; + // &:nth-child(1), + // &:nth-child(7), + // &:nth-child(13), + // &:nth-child(19){ + // &::before{ + // content: ''; + // position: absolute; + // top: 20px; + // left: 50%; + // transform: translateX(-50%); + // width: 1px; + // height: 6px; + // background-color: #8B8B8B; + // } + // } + i{ + top: 22px; + } + &.act{ + i{color: #8B8B8B;} + } + } + } +} +.center-wrap{ + display: flex; + flex-direction: column; + align-items: center; + gap: 20px; +} + +.module-table-flex-wrap{ + display: flex; + gap: 10px; + .outline-form{ + flex: 1; + } +} + +.module-box-tab{ + display: flex; + .module-btn{ + flex: 1; + border-top: 1px solid #505050; + border-bottom: 1px solid #505050; + border-right: 1px solid #505050; + background-color: #454545; + color: #fff; + height: 30px; + font-size: 12px; + font-weight: 400; + transition: all .15s ease-in-out; + &:first-child{ + border-left: 1px solid #505050; + } + &.act{ + border-color: #fff; + background-color: #fff; + color: #101010; + } + } +} + +.module-table-box{ flex: 1; - } + background-color: #3D3D3D; + border-radius: 2px; + .module-table-inner{ + padding: 10px; + .outline-form{ + span{ + width: auto; + } + } + .module-table-tit{ + padding: 10px 0; + font-size: 12px; + color: #fff; + border-bottom: 1px solid #4D4D4D; + } + .eaves-keraba-table{ + width: 100%; + margin-top: 15px; + .eaves-keraba-th{ + width: 72px; + } + .eaves-keraba-th, + .eaves-keraba-td{ + padding-bottom: 5px; + } + } + .self-table-tit{ + font-size: 12px; + font-weight: 500; + color: #fff; + padding-bottom: 15px; + } + } + .warning-guide{ + padding: 20px; + .warning{ + color: #FFCACA; + max-height: 55px; + overflow-y: auto; + padding-right: 30px; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #D9D9D9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + } + } } -.module-box-tab { - display: flex; - .module-btn { - flex: 1; - border-top: 1px solid #505050; - border-bottom: 1px solid #505050; - border-right: 1px solid #505050; - background-color: #454545; - color: #fff; - height: 30px; - font-size: 12px; - font-weight: 400; - transition: all 0.15s ease-in-out; - &:first-child { - border-left: 1px solid #505050; +.module-self-table{ + display: table; + border-top: 1px solid #4D4D4D; + border-collapse: collapse; + width: 100%; + .self-table-item{ + display: table-row; + .self-item-td, + .self-item-th{ + display: table-cell; + vertical-align: middle; + border-bottom: 1px solid #4D4D4D; + } + .self-item-th{ + width: 60px; + font-size: 12px; + font-weight: 500; + color: #fff; + } + .self-item-td{ + font-size: 12px; + font-weight: 400; + color: #fff; + padding: 15px 20px; + } } - &.act { - border-color: #fff; - background-color: #fff; - color: #101010; - } - } } -.module-table-box { - flex: 1; - background-color: #3d3d3d; - border-radius: 2px; - .module-table-inner { - padding: 10px; - .outline-form { - span { - width: auto; - } - } - .module-table-tit { - padding: 10px 0; - font-size: 12px; - color: #fff; - border-bottom: 1px solid #4d4d4d; - } - .eaves-keraba-table { - width: 100%; - margin-top: 15px; - .eaves-keraba-th { - width: 72px; - } - .eaves-keraba-th, - .eaves-keraba-td { - padding-bottom: 5px; - } - } - .self-table-tit { - font-size: 12px; - font-weight: 500; - color: #fff; - padding-bottom: 15px; - } - } - .warning-guide { - padding: 20px; - .warning { - color: #ffcaca; - max-height: 55px; - overflow-y: auto; - padding-right: 30px; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #d9d9d9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - } - } -} - -.module-self-table { - display: table; - border-top: 1px solid #4d4d4d; - border-collapse: collapse; - width: 100%; - .self-table-item { - display: table-row; - .self-item-td, - .self-item-th { - display: table-cell; - vertical-align: middle; - border-bottom: 1px solid #4d4d4d; - } - .self-item-th { - width: 60px; - font-size: 12px; - font-weight: 500; - color: #fff; - } - .self-item-td { - font-size: 12px; - font-weight: 400; - color: #fff; - padding: 15px 20px; - } - } -} - -.self-table-flx { - display: flex; - align-items: center; - margin-top: 15px; - button { - margin-left: auto; - } -} -.hexagonal-wrap { - .hexagonal-item { - padding: 15px 0; - border-bottom: 1px solid #4d4d4d; - &:first-child { - padding-top: 0; - } - &:last-child { - padding-bottom: 0; - border: none; - } - .hexagonal-flx-auto { - display: flex; - justify-content: space-between; - } - .hexagonal-flx { - display: flex; - align-items: center; - button { +.self-table-flx{ + display: flex; + align-items: center; + margin-top: 15px; + button{ margin-left: auto; - } } - } +} +.hexagonal-wrap{ + .hexagonal-item{ + padding: 15px 0; + border-bottom: 1px solid #4D4D4D; + &:first-child{ + padding-top: 0; + } + &:last-child{ + padding-bottom: 0; + border: none; + } + .hexagonal-flx-auto{ + display: flex; + justify-content: space-between; + } + .hexagonal-flx{ + display: flex; + align-items: center; + button{ + margin-left: auto; + } + } + } } // 회로 및 가대설정 -.circuit-check-inner { - padding: 5px 0; - &.overflow { - overflow-y: auto; - max-height: 100px; - min-height: 60px; +.circuit-check-inner{ + padding: 5px 0; + &.overflow{ + overflow-y: auto; + max-height: 100px; + min-height: 60px; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #D9D9D9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + } + .d-check-box{ + margin-bottom: 15px; + &:last-child{ + margin-bottom: 0; + } + } +} + +.x-scroll-table{ + overflow: auto; + padding-bottom: 5px; + background-color: transparent; + max-height: 170px; + .roof-module-table{ + min-width: 1200px; + } &::-webkit-scrollbar { - width: 4px; - background-color: transparent; + width: 4px; + height: 4px; + background-color: transparent; } &::-webkit-scrollbar-thumb { - background-color: #d9d9d9; + background-color: #b4b4b4; } &::-webkit-scrollbar-track { - background-color: transparent; + background-color: transparent; } - } - .d-check-box { - margin-bottom: 15px; - &:last-child { - margin-bottom: 0; + &::-webkit-scrollbar-corner{ + background-color: transparent; } - } } -.x-scroll-table { - overflow: auto; - padding-bottom: 5px; - background-color: transparent; - max-height: 170px; - .roof-module-table { - min-width: 1200px; - } - &::-webkit-scrollbar { - width: 4px; - height: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #b4b4b4; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - &::-webkit-scrollbar-corner { - background-color: transparent; - } -} - -.circuit-right-wrap { - display: flex; - justify-content: flex-end; -} - -.circuit-data-form { - display: flex; - flex-direction: column; - gap: 5px; - min-height: 60px; - padding: 12px; - border: 1px solid rgba(255, 255, 255, 0.2); - span { - display: inline-flex; - align-items: center; - .del { - display: block; - margin-left: 10px; - width: 15px; - height: 15px; - background: url(../../public/static/images/canvas/circuit_del.svg) no-repeat center; - background-size: cover; - } - } -} -.circuit-table-tit { - color: #fff; - font-size: 12px; - font-weight: 600; - padding: 11px 10px; - background-color: #474747; - border: 1px solid #505050; - border-bottom: none; -} - -.circuit-overflow { - overflow-x: auto; - margin-bottom: 25px; - &::-webkit-scrollbar { - height: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #d9d9d9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } - .module-table-box { +.circuit-right-wrap{ display: flex; - &.by-max { - min-width: 886px; - } - } + justify-content: flex-end; } -.circuit-table-flx-wrap { - display: flex; - gap: 10px; - margin-bottom: 10px; - .circuit-table-flx-box { - flex: 1; +.circuit-data-form{ display: flex; flex-direction: column; - .bottom-wrap { - margin-top: auto; + gap: 5px; + min-height: 60px; + padding: 12px; + border: 1px solid rgba(255, 255, 255, 0.20); + span{ + display: inline-flex; + align-items: center; + .del{ + display: block; + margin-left: 10px; + width: 15px; + height: 15px; + background: url(../../public/static/images/canvas/circuit_del.svg)no-repeat center; + background-size: cover; + } } - .roof-module-table { - table { - table-layout: fixed; - } - } - } +} +.circuit-table-tit{ + color: #fff; + font-size: 12px; + font-weight: 600; + padding: 11px 10px; + background-color: #474747; + border: 1px solid #505050; + border-bottom: none; } -.circuit-count-input { - display: flex; - align-items: center; - gap: 10px; +.circuit-overflow{ + overflow-x: auto; + margin-bottom: 25px; + &::-webkit-scrollbar { + height: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #D9D9D9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } + .module-table-box{ + display: flex; + &.by-max{ + min-width: 886px; + } + } +} + +.circuit-table-flx-wrap{ + display: flex; + gap: 10px; + margin-bottom: 10px; + .circuit-table-flx-box{ + flex: 1; + display: flex; + flex-direction: column; + .bottom-wrap{ + margin-top: auto; + } + .roof-module-table{ + table{ + table-layout: fixed; + } + } + } +} + +.circuit-count-input{ + display: flex; + align-items: center; + gap: 10px; } // 모듈부가기능 -.additional-radio-wrap { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 15px 0; - margin-bottom: 24px; +.additional-radio-wrap{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px 0; + margin-bottom: 24px; } -.additional-wrap { - padding: 24px 0; - border-top: 1px solid #424242; +.additional-wrap{ + padding: 24px 0; + border-top: 1px solid #424242; } -.additional-color-wrap { - display: flex; - align-items: center; - padding: 5px 0; - gap: 15px; - .additional-color-box { +.additional-color-wrap{ display: flex; align-items: center; - gap: 8px; - .additional-color { - display: block; - width: 16px; - height: 16px; - &.pink { - border: 2px solid #ce1c9c; - background-color: #16417d; - } - &.white { - border: 2px solid #fff; - background-color: #001027; - } + padding: 5px 0; + gap: 15px; + .additional-color-box{ + display: flex; + align-items: center; + gap: 8px; + .additional-color{ + display: block; + width: 16px; + height: 16px; + &.pink{ + border: 2px solid #ce1c9c; + background-color: #16417D; + } + &.white{ + border: 2px solid #FFF; + background-color: #001027; + } + } } - } } // color setting -.color-setting-wrap { - padding-bottom: 15px; - border-bottom: 1px solid #424242; - .color-tit { - font-size: 13px; - font-weight: 500; - color: #ffffff; - margin-bottom: 10px; - } - .color-picker { - .react-colorful { - width: 100%; - height: auto; - gap: 20px; - .react-colorful__pointer { - width: 15px; - height: 15px; - border: 4px solid #fff; - } - .react-colorful__saturation { - border-radius: 2px; - height: 200px; - border-bottom: 5px solid #000; - } - .react-colorful__last-control { - border-radius: 2px; - height: 10px; - } - } - .hex-color-box { - display: flex; - align-items: center; - margin-top: 15px; - .color-box-tit { - font-size: 12px; - color: #fff; +.color-setting-wrap{ + padding-bottom: 15px; + border-bottom: 1px solid #424242; + .color-tit{ + font-size: 13px; font-weight: 500; - margin-right: 10px; - } - .color-hex-input { - width: 150px; - margin-right: 5px; - input { - width: 100%; - } - } - .color-box { - display: block; - width: 30px; - height: 30px; - border-radius: 4px; - } + color: #ffffff; + margin-bottom: 10px; } - .default-color-wrap { - margin-top: 25px; - .default-tit { + .color-picker{ + .react-colorful{ + width: 100%; + height: auto; + gap: 20px; + .react-colorful__pointer{ + width: 15px; + height: 15px; + border: 4px solid #Fff; + } + .react-colorful__saturation{ + border-radius: 2px; + height: 200px; + border-bottom: 5px solid #000; + } + .react-colorful__last-control{ + border-radius: 2px; + height: 10px; + } + } + .hex-color-box{ + display: flex; + align-items: center; + margin-top: 15px; + .color-box-tit{ + font-size: 12px; + color: #fff; + font-weight: 500; + margin-right: 10px; + } + .color-hex-input{ + width: 150px; + margin-right: 5px; + input{ + width: 100%; + } + } + .color-box{ + display: block; + width: 30px; + height: 30px; + border-radius: 4px; + } + } + .default-color-wrap{ + margin-top: 25px; + .default-tit{ + font-size: 12px; + font-weight: 500; + color: #fff; + margin-bottom: 10px; + } + .color-button-wrap{ + display: grid; + grid-template-columns: repeat(8, 1fr); + gap: 21px; + .default-color{ + display: block; + width: 100%; + height: 30px; + border-radius: 4px; + } + } + } + } +} + +// 글꼴 설정 팝업 +.font-option-warp{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 15px 5px; + margin-bottom: 15px; + .font-option-item{ + .option-item-tit{ + font-size: 12px; + font-weight: 500; + color: #fff; + margin-bottom: 10px; + } + } +} +.font-ex-wrap{ + margin-bottom: 15px; + .font-ex-tit{ font-size: 12px; font-weight: 500; color: #fff; margin-bottom: 10px; - } - .color-button-wrap { - display: grid; - grid-template-columns: repeat(8, 1fr); - gap: 21px; - .default-color { - display: block; - width: 100%; - height: 30px; - border-radius: 4px; - } - } } - } -} - -// 글꼴 설정 팝업 -.font-option-warp { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 15px 5px; - margin-bottom: 15px; - .font-option-item { - .option-item-tit { - font-size: 12px; - font-weight: 500; - color: #fff; - margin-bottom: 10px; + .font-ex-box{ + display: flex; + align-items: center; + justify-content: center; + width: 100%; + min-height: 80px; + background-color: #fff; } - } -} -.font-ex-wrap { - margin-bottom: 15px; - .font-ex-tit { - font-size: 12px; - font-weight: 500; - color: #fff; - margin-bottom: 10px; - } - .font-ex-box { - display: flex; - align-items: center; - justify-content: center; - width: 100%; - min-height: 80px; - background-color: #fff; - } + } // 치수선 설정 -.font-btn-wrap { - margin-bottom: 15px; - button { - width: 100%; - height: 30px; - line-height: 28px; - } -} - -.line-color-wrap { - margin-bottom: 15px; - .color-btn { - display: block; - width: 100%; - height: 30px; - border-radius: 2px; - } -} - -.form-box { - width: 100%; - background-color: #fff; - padding: 10px 15px 20px; - .line-form { - position: relative; - display: flex; - flex-direction: column; - justify-content: flex-end; - min-width: 102px; - min-height: 40px; - margin: 0 auto; - - &::before { - content: ''; - position: absolute; - bottom: 0px; - left: 0; - width: 100%; - height: 40px; - border-left: 1px dashed #101010; - border-right: 1px dashed #101010; +.font-btn-wrap{ + margin-bottom: 15px; + button{ + width: 100%; + height: 30px; + line-height: 28px; } - .line-font-box { - .font { - display: block; - padding-bottom: 15px; - color: #101010; - text-align: center; - line-height: 1; - } - .line { - position: relative; +} + +.line-color-wrap{ + margin-bottom: 15px; + .color-btn{ display: block; width: 100%; - height: 1px; - border-radius: 30px; - &::before { - content: ''; - position: absolute; - top: 50%; - transform: translateY(-50%) rotate(45deg); - left: 1px; - width: 9px; - height: +9px; - border: 1px solid; - border-color: inherit; - border-top: none; - border-right: none; - } - &::after { - content: ''; - position: absolute; - top: 50%; - transform: translateY(-50%) rotate(45deg); - right: 1px; - width: 9px; - height: 9px; - border: 1px solid; - border-color: inherit; - border-bottom: none; - border-left: none; - } - } + height: 30px; + border-radius: 2px; + } +} + +.form-box{ + width: 100%; + background-color: #fff; + padding: 10px 15px 20px; + .line-form{ + position: relative; + display: flex; + flex-direction: column; + justify-content: flex-end; + min-width: 102px; + min-height: 40px; + margin: 0 auto; + + &::before{ + content: ''; + position: absolute; + bottom: 0px; + left: 0; + width: 100%; + height: 40px; + border-left: 1px dashed #101010; + border-right: 1px dashed #101010; + } + .line-font-box{ + .font{ + display: block; + padding-bottom: 15px; + color: #101010; + text-align: center; + line-height: 1; + } + .line{ + position: relative; + display: block; + width: 100%; + height: 1px; + border-radius: 30px; + &::before{ + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%) rotate(45deg); + left: 1px; + width: 9px; + height:+ 9px; + border: 1px solid; + border-color: inherit; + border-top: none; + border-right: none; + } + &::after{ + content: ''; + position: absolute; + top: 50%; + transform: translateY(-50%) rotate(45deg); + right: 1px; + width: 9px; + height: 9px; + border: 1px solid; + border-color: inherit; + border-bottom: none; + border-left: none; + } + } + } } - } } // 사이즈 변경 -.size-inner-warp { - position: relative; +.size-inner-warp{ + position: relative; } -.size-check-wrap { - position: relative; - display: block; - width: 132px; - height: 132px; - margin: 0 auto; - .size-btn { - position: absolute; - width: 16px; - height: 16px; - border: 1px solid #fff; - border-radius: 50%; - &.act { - &::after { - content: ''; +.size-check-wrap{ + position: relative; + display: block; + width: 132px; + height: 132px; + margin: 0 auto; + .size-btn{ + position: absolute; + width: 16px; + height: 16px; + border: 1px solid #fff; + border-radius: 50%; + &.act{ + &::after{ + content: ''; + position: absolute; + top: 50%; + left: 50%; + transform: translate(-50%, -50%); + width: 8px; + height: 8px; + background-color: #fff; + border-radius: 50%; + } + } + &:nth-child(1){ top: 0; left: 0; } + &:nth-child(2){ top: 0; right: 0; } + &:nth-child(3){ bottom: 0; left: 0; } + &:nth-child(4){ bottom: 0; right: 0; } + } + .size-box{ position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); - width: 8px; - height: 8px; + width: 100px; + height: 100px; background-color: #fff; - border-radius: 50%; - } } - &:nth-child(1) { - top: 0; - left: 0; - } - &:nth-child(2) { - top: 0; - right: 0; - } - &:nth-child(3) { - bottom: 0; - left: 0; - } - &:nth-child(4) { - bottom: 0; - right: 0; - } - } - .size-box { - position: absolute; - top: 50%; - left: 50%; - transform: translate(-50%, -50%); - width: 100px; - height: 100px; - background-color: #fff; - } } -.size-option-top { - margin-bottom: 15px; +.size-option-top{ + margin-bottom: 15px; } -.size-option-side { - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); +.size-option-side{ + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); } -.size-option-wrap { - width: 88px; - margin: 0 auto; - .size-option { - display: flex; - align-items: center; - input { - width: 100%; - flex: 1; +.size-option-wrap{ + width: 88px; + margin: 0 auto; + .size-option{ + display: flex; + align-items: center; + input{ + width: 100%; + flex: 1; + } + span{ + flex: none; + } } - span { - flex: none; - } - } } //이미지 크기 설정 -.range-wrap { - display: flex; - align-items: center; - input { - flex: 1; - margin-right: 10px; - } - label { - flex: none; - text-align: right; - width: 38px; - font-size: 13px; - color: #fff; - font-weight: 500; - } +.range-wrap{ + display: flex; + align-items: center; + input{ + flex: 1; + margin-right: 10px; + } + label{ + flex: none; + text-align: right; + width: 38px; + font-size: 13px; + color: #fff; + font-weight: 500; + } } // 이미지 불러오기 -.img-flex-box { - display: flex; - align-items: center; +.img-flex-box{ + display: flex; + align-items: center; } -.img-load-from { - margin-top: 20px; - .img-load-item { - border-top: 1px solid #424242; - padding: 18px 0; - .d-check-radio { - margin-bottom: 20px; +.img-load-from{ + margin-top: 20px; + .img-load-item{ + border-top: 1px solid #424242; + padding: 18px 0; + .d-check-radio{ + margin-bottom: 20px; + } } - } - border-bottom: 1px solid #424242; + border-bottom: 1px solid #424242; } // 지붕모듈선택 변경 -.module-table-box { - &.none-flex { - flex: none; - width: 230px; - .outline-form { - .grid-select { +.module-table-box{ + &.none-flex{ flex: none; - width: 95.77px; - } - .thin { - margin-left: auto; - } - } - } -} -.roof-module-tab2-overflow { - max-height: 500px; - overflow-y: auto; - padding-bottom: 15px; - border-bottom: 1px solid #4d4d4d; - &::-webkit-scrollbar { - width: 4px; - background-color: transparent; - } - &::-webkit-scrollbar-thumb { - background-color: #d9d9d9; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } -} -.module-table-flex-wrap { - &.tab2 { - margin-top: 10px; - gap: 15px; - } - .module-flex-item { - flex: 1; - .module-flex-item-tit { - font-size: 12px; - font-weight: 500; - color: #fff; - padding-bottom: 10px; - border-bottom: 1px solid #4d4d4d; - } - .flex-item-btn-wrap { - display: grid; - grid-template-columns: repeat(2, 1fr); - gap: 8px; - margin-bottom: 24px; - } - &.non-flex { - display: flex; - flex-direction: column; - justify-content: flex-start; - flex: none; - padding-top: 27.5px; - width: 260px; - } - } -} - -.module-table-box { - .module-table-inner { - .module-table-flex-wrap { - &.tab2 { - .eaves-keraba-table { - .eaves-keraba-th { - width: 90px; - } - .eaves-keraba-td { - padding-left: 0; - padding-bottom: 5px; - } + width: 230px; + .outline-form{ + .grid-select{ + flex: none; + width: 95.77px; + } + .thin{ + margin-left: auto; + } } - } } - } } -.keraba-flex { - display: flex; - align-items: center; - .grid-select { - flex: none; - width: 110px; - } - .outline-form { - justify-content: flex-end; - } +.roof-module-tab2-overflow{ + max-height: 500px; + overflow-y: auto; + padding-bottom: 15px; + border-bottom: 1px solid #4D4D4D; + &::-webkit-scrollbar { + width: 4px; + background-color: transparent; + } + &::-webkit-scrollbar-thumb { + background-color: #D9D9D9; + } + &::-webkit-scrollbar-track { + background-color: transparent; + } +} +.module-table-flex-wrap{ + &.tab2{ + margin-top: 10px; + gap: 15px; + + } + .module-flex-item{ + flex: 1; + .module-flex-item-tit{ + font-size: 12px; + font-weight: 500; + color: #fff; + padding-bottom: 10px; + border-bottom: 1px solid #4D4D4D; + } + .flex-item-btn-wrap{ + display: grid; + grid-template-columns: repeat(2, 1fr); + gap: 8px; + margin-bottom: 24px; + } + &.non-flex{ + display: flex; + flex-direction: column; + justify-content: flex-start; + flex: none; + padding-top: 27.5px; + width: 260px; + } + } } -.reset-word-wrap { - display: flex; - align-items: center; - .grid-btn-wrap { - margin-left: auto; - } +.module-table-box{ + .module-table-inner{ + .module-table-flex-wrap{ + &.tab2{ + .eaves-keraba-table{ + .eaves-keraba-th{ + width: 90px; + } + .eaves-keraba-td{ + padding-left: 0; + padding-bottom: 5px; + } + } + } + } + } +} +.keraba-flex{ + display: flex; + align-items: center; + .grid-select{ + flex: none; + width: 110px; + } + .outline-form{ + justify-content: flex-end; + } } -.reset-word { - font-size: 12px; - color: #ffcaca; - font-weight: 400; - margin-top: 10px; + +.reset-word-wrap{ + display: flex; + align-items: center; + .grid-btn-wrap{ + margin-left: auto; + } } +.reset-word{ + font-size: 12px; + color: #FFCACA; + font-weight: 400; + margin-top: 10px; +} \ No newline at end of file From d4aa611b65a1a2ac9f74c6b595e1fe61d185fb7e Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 20 Jan 2025 16:37:31 +0900 Subject: [PATCH 045/130] =?UTF-8?q?input=200=EC=9D=BC=20=EA=B2=BD=EC=9A=B0?= =?UTF-8?q?=EC=97=90=EB=A7=8C=20=EB=B9=84=EC=9B=8C=EC=A3=BC=EA=B8=B0=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx b/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx index 439e0748..b54d9bf4 100644 --- a/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx +++ b/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx @@ -18,7 +18,11 @@ export default function OuterLineWall({ props }) { className="input-origin block" value={length1} ref={length1Ref} - onFocus={(e) => (length1Ref.current.value = '')} + onFocus={(e) => { + if (length1Ref.current.value === '0') { + length1Ref.current.value = '' + } + }} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> From f56e9397c33d08f1b64246c5764790a625c075ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Mon, 20 Jan 2025 16:45:52 +0900 Subject: [PATCH 046/130] =?UTF-8?q?=EC=A7=91=EA=B3=84=ED=91=9C=20recoil=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/circuitTrestleAtom.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 86836b48..84809e02 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -30,9 +30,6 @@ export const moduleStatisticsState = atom({ { name: `발전량(kW)`, prop: 'amount' }, ], rows: [], - footer: [ - { name: '합계', prop: 'name' }, - { name: `발전량(kW)`, prop: 'amount' }, - ], + footer: ['합계', 0], }, }) From 3e003a794b1e8e2acc9968c5ad585e4d21654d93 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Mon, 20 Jan 2025 17:03:55 +0900 Subject: [PATCH 047/130] =?UTF-8?q?=EA=B8=80=EC=9E=90=20=ED=91=9C=EC=8B=9C?= =?UTF-8?q?=20=EC=97=86=EC=95=A4=20=ED=9B=84=20=EB=8B=A4=EC=8B=9C=20?= =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EA=B8=B0=EB=A1=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 11d5d207..cad8c57a 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -194,6 +194,9 @@ export function useCanvasSetting() { } const { column } = corridorDimension const lengthTexts = canvas.getObjects().filter((obj) => obj.name === 'lengthText') + lengthTexts.forEach((obj) => { + obj.set({ text: '' }) + }) switch (column) { case 'corridorDimension': lengthTexts.forEach((obj) => { From e14f1458d949bea8fa01a8a7cab26f94f43a97fa Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Mon, 20 Jan 2025 18:19:20 +0900 Subject: [PATCH 048/130] =?UTF-8?q?=F0=9F=98=8Efix:=20=ED=8C=9D=EC=97=85?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EA=B0=92=20=EC=A4=91=EC=97=90=20?= =?UTF-8?q?=EB=B0=A9=EC=9C=84=EC=84=A4=EC=A0=95=20=EA=B0=92=EC=9D=80=20?= =?UTF-8?q?=EA=B7=B8=EB=8C=80=EB=A1=9C=20=EC=A0=80=EC=9E=A5=EB=90=98?= =?UTF-8?q?=EA=B2=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/common/useCanvasPopupStatusController.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hooks/common/useCanvasPopupStatusController.js b/src/hooks/common/useCanvasPopupStatusController.js index 4138c239..8db71567 100644 --- a/src/hooks/common/useCanvasPopupStatusController.js +++ b/src/hooks/common/useCanvasPopupStatusController.js @@ -11,7 +11,7 @@ import { compasDegAtom } from '@/store/orientationAtom' import { currentCanvasPlanState } from '@/store/canvasAtom' export function useCanvasPopupStatusController(param = 1) { - const popupType = param + const popupType = parseInt(param) const [compasDeg, setCompasDeg] = useRecoilState(compasDegAtom) const [moduleSelectionDataStore, setModuleSelectionDataStore] = useRecoilState(moduleSelectionDataState) @@ -67,7 +67,7 @@ export function useCanvasPopupStatusController(param = 1) { objectNo: currentCanvasPlan.objectNo, planNo: parseInt(currentCanvasPlan.planNo), popupType: popupType.toString(), - popupStatus: JSON.stringify(arg).replace(/"/g, '\"'), + popupStatus: popupType === 1 ? arg : JSON.stringify(arg).replace(/"/g, '\"'), } postFetcher(`/api/v1/canvas-popup-status`, params) }, From 7e396d6e63026b227351a9ec664cb57e42f46c96 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Mon, 20 Jan 2025 18:40:21 +0900 Subject: [PATCH 049/130] =?UTF-8?q?=EC=84=A4=EC=A0=95=20title=20=EC=82=AD?= =?UTF-8?q?=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/basic/step/Orientation.jsx | 1 - src/components/floor-plan/modal/movement/MovementSetting.jsx | 1 - src/components/floor-plan/modal/object/ObjectSetting.jsx | 1 - .../floor-plan/modal/outerlinesetting/WallLineSetting.jsx | 1 - .../floor-plan/modal/placementShape/PlacementShapeDrawing.jsx | 3 +-- src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx | 1 - 6 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index a64210f4..23f388f7 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -34,7 +34,6 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { return ( <>
-
{getMessage('modal.module.basic.setting.orientation.setting')}
{getMessage('modal.module.basic.setting.orientation.setting.info')}
diff --git a/src/components/floor-plan/modal/movement/MovementSetting.jsx b/src/components/floor-plan/modal/movement/MovementSetting.jsx index a4dcf3fc..057d7d37 100644 --- a/src/components/floor-plan/modal/movement/MovementSetting.jsx +++ b/src/components/floor-plan/modal/movement/MovementSetting.jsx @@ -33,7 +33,6 @@ export default function MovementSetting({ id, pos = { x: 50, y: 230 } }) { ))}
-
{getMessage('setting')}
{type === TYPE.FLOW_LINE && } {type === TYPE.UP_DOWN && }
diff --git a/src/components/floor-plan/modal/object/ObjectSetting.jsx b/src/components/floor-plan/modal/object/ObjectSetting.jsx index 97cd02f8..69c4232c 100644 --- a/src/components/floor-plan/modal/object/ObjectSetting.jsx +++ b/src/components/floor-plan/modal/object/ObjectSetting.jsx @@ -92,7 +92,6 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) { ))}
-
{getMessage('setting')}
{buttonAct === 1 && } {buttonAct === 2 && } {buttonAct === 3 && } diff --git a/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx b/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx index 84107dae..c95c7c5a 100644 --- a/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx +++ b/src/components/floor-plan/modal/outerlinesetting/WallLineSetting.jsx @@ -152,7 +152,6 @@ export default function WallLineSetting(props) {
-
{getMessage('modal.cover.outline.setting')}
{type === OUTER_LINE_TYPE.OUTER_LINE ? ( ) : type === OUTER_LINE_TYPE.RIGHT_ANGLE ? ( diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx index fd435b8b..71bed775 100644 --- a/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx +++ b/src/components/floor-plan/modal/placementShape/PlacementShapeDrawing.jsx @@ -142,7 +142,6 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { ))}
-
{getMessage('setting')}
{buttonAct === 1 && } {buttonAct === 2 && } {buttonAct === 3 && } @@ -155,7 +154,7 @@ export default function PlacementShapeDrawing({ id, pos = { x: 50, y: 230 } }) { {getMessage('modal.cover.outline.rollback')}
diff --git a/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx b/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx index 1efbb767..2a59cc91 100644 --- a/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx +++ b/src/components/floor-plan/modal/roofShape/RoofShapeSetting.jsx @@ -108,7 +108,6 @@ export default function RoofShapeSetting({ id, pos = { x: 50, y: 230 } }) { ))}
-
{getMessage('setting')}
{shapeNum === 1 && } {(shapeNum === 2 || shapeNum === 3) && } {shapeNum === 4 && } From 2226cfd5090b2c4120d27b79d43573a5586e559d Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Mon, 20 Jan 2025 19:34:46 +0900 Subject: [PATCH 050/130] =?UTF-8?q?=F0=9F=98=8Efix:=20=EC=B9=98=EC=88=98?= =?UTF-8?q?=20=EC=9E=85=EB=A0=A5=EB=B0=A9=EB=B2=95=EC=97=90=20=EC=9D=98?= =?UTF-8?q?=ED=95=B4=EC=84=9C=20=EB=A9=94=EB=89=B4=20validation=20check=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 0f32da9b..bdb612a8 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -41,7 +41,7 @@ import { isObjectNotEmpty } from '@/util/common-utils' import KO from '@/locales/ko.json' import JA from '@/locales/ja.json' -import { MENU } from '@/common/common' +import { MENU, POLYGON_TYPE } from '@/common/common' import { QcastContext } from '@/app/QcastProvider' @@ -167,7 +167,12 @@ export default function CanvasMenu(props) { setType('surface') break case 4: - setType('module') + if (!checkMenuAndCanvasState()) { + swalFire({ text: getMessage('estimate.menu.move.valid1') }) + return + } else { + setType('module') + } break case 5: // let pid = urlParams.get('pid') @@ -328,6 +333,14 @@ export default function CanvasMenu(props) { return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && menu.index === 2) } + const checkMenuAndCanvasState = () => { + const roofs = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF) + // 지붕면 할당이 끝난 지붕이 하나라도 있는지 체크 + const isExist = roofs?.some((roof) => roof.roofMaterial) + console.log('🚀 ~ checkMenuAndCanvasState ~ isExist:', isExist) + return isExist + } + useEffect(() => { if (isObjectNotEmpty(estimateRecoilState)) { if (estimateRecoilState?.createUser === 'T01') { From 2fe47eb6f04a6e374a305cb95cdb87132114ebe2 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Mon, 20 Jan 2025 19:55:13 +0900 Subject: [PATCH 051/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=ED=83=AD=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/BasicSetting.jsx | 23 +++++++++ .../floor-plan/modal/basic/step/Module.jsx | 33 +++++++++++-- .../modal/basic/step/ModuleTabContents.jsx | 4 +- .../common/useCanvasPopupStatusController.js | 4 +- src/hooks/module/useModuleBasicSetting.js | 28 +++++------ src/hooks/module/useModuleSelection.js | 47 ++++++++++++++++--- src/locales/ko.json | 4 +- 7 files changed, 112 insertions(+), 31 deletions(-) diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx index 49aabd0d..3200ac05 100644 --- a/src/components/floor-plan/modal/basic/BasicSetting.jsx +++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx @@ -11,6 +11,10 @@ import { usePopup } from '@/hooks/usePopup' import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation' import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting' import { useEvent } from '@/hooks/useEvent' +import { moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { addedRoofsState } from '@/store/settingAtom' +import { isObjectNotEmpty } from '@/util/common-utils' +import Swal from 'sweetalert2' export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { const { getMessage } = useMessage() @@ -20,13 +24,32 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) { const orientationRef = useRef(null) const { initEvent } = useEvent() const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState) + const moduleSelectionData = useRecoilValue(moduleSelectionDataState) + const addedRoofs = useRecoilValue(addedRoofsState) // const { initEvent } = useContext(EventContext) const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting() const handleBtnNextStep = () => { if (tabNum === 1) { orientationRef.current.handleNextStep() + } else if (tabNum === 2) { + if (!isObjectNotEmpty(moduleSelectionData.module)) { + Swal.fire({ + title: getMessage('module.not.found'), + icon: 'warning', + }) + return + } + + if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) { + Swal.fire({ + title: getMessage('construction.length.difference'), + icon: 'warning', + }) + return + } } + setTabNum(tabNum + 1) } diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index b3dbb0d3..811b21d3 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -8,6 +8,7 @@ import { useModuleSelection } from '@/hooks/module/useModuleSelection' import ModuleTabContents from './ModuleTabContents' import { useDebounceValue } from 'usehooks-ts' import { moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' export default function Module({ setTabNum }) { const { getMessage } = useMessage() @@ -31,8 +32,8 @@ export default function Module({ setTabNum }) { handleChangeVerticalSnowCover, } = useModuleSelection({ addedRoofs }) - const [inputInstallHeight, setInputInstallHeight] = useState(installHeight) - const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState(verticalSnowCover) + const [inputInstallHeight, setInputInstallHeight] = useState()`` + const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState() const [debouncedInstallHeight] = useDebounceValue(inputInstallHeight, 500) const [debouncedVerticalSnowCover] = useDebounceValue(inputVerticalSnowCover, 500) @@ -43,15 +44,31 @@ export default function Module({ setTabNum }) { }, moduleSelectionData) useEffect(() => { - setModuleSelectionData(tempModuleSelectionData) + if (installHeight) { + setInputInstallHeight(installHeight) + } + if (verticalSnowCover) { + setInputVerticalSnowCover(verticalSnowCover) + } + }, [installHeight, verticalSnowCover]) + + useEffect(() => { + if (tempModuleSelectionData) { + setModuleSelectionData(tempModuleSelectionData) + moduleSelectedDataTrigger(tempModuleSelectionData) + } }, [tempModuleSelectionData]) useEffect(() => { - handleChangeInstallHeight(debouncedInstallHeight) + if (debouncedInstallHeight) { + handleChangeInstallHeight(debouncedInstallHeight) + } }, [debouncedInstallHeight]) useEffect(() => { - handleChangeVerticalSnowCover(debouncedVerticalSnowCover) + if (debouncedVerticalSnowCover) { + handleChangeVerticalSnowCover(debouncedVerticalSnowCover) + } }, [debouncedVerticalSnowCover]) const moduleData = { @@ -71,6 +88,12 @@ export default function Module({ setTabNum }) { setRoofTab(tab) } + const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2) + + useEffect(() => { + console.log('moduleSelectionData', moduleSelectionData) + }, []) + return ( <>
diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 30691d4e..9d644984 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -464,7 +464,7 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio type="checkbox" id={`ch01_${roofTab}`} disabled={cvrYn === 'N' ? true : false} - defaultChecked={cvrChecked} + checked={cvrChecked} onChange={handleCvrChecked} /> @@ -474,7 +474,7 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio type="checkbox" id={`ch02_${roofTab}`} disabled={snowGdPossYn === 'N' ? true : false} - defaultChecked={snowGdChecked} + checked={snowGdChecked} onChange={handleSnowGdChecked} /> diff --git a/src/hooks/common/useCanvasPopupStatusController.js b/src/hooks/common/useCanvasPopupStatusController.js index 4138c239..feddf30d 100644 --- a/src/hooks/common/useCanvasPopupStatusController.js +++ b/src/hooks/common/useCanvasPopupStatusController.js @@ -18,7 +18,7 @@ export function useCanvasPopupStatusController(param = 1) { const { getFetcher, postFetcher } = useAxios() const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) - console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan) + // console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan) const { data: popupStatus, @@ -30,7 +30,7 @@ export function useCanvasPopupStatusController(param = 1) { ) useEffect(() => { - console.log('🚀 ~ useEffect ~ popupStatus:', popupStatus) + // console.log('🚀 ~ useEffect ~ popupStatus:', popupStatus) if (popupStatus) { switch (parseInt(popupStatus?.popupType)) { case 1: diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 098ae26a..305dcda0 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -1308,13 +1308,13 @@ export function useModuleBasicSetting() { const pointX2 = coords[2].x + ((coords[2].y - top) / (coords[2].y - coords[1].y)) * (coords[1].x - coords[2].x) const pointY2 = top - const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { - stroke: 'red', - strokeWidth: 1, - selectable: true, - }) - canvas?.add(finalLine) - canvas?.renderAll() + // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { + // stroke: 'red', + // strokeWidth: 1, + // selectable: true, + // }) + // canvas?.add(finalLine) + // canvas?.renderAll() let rtnObj //평평하면 @@ -1431,13 +1431,13 @@ export function useModuleBasicSetting() { const pointX2 = top const pointY2 = coords[2].y + ((coords[2].x - top) / (coords[2].x - coords[1].x)) * (coords[1].y - coords[2].y) - const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { - stroke: 'red', - strokeWidth: 1, - selectable: true, - }) - canvas?.add(finalLine) - canvas?.renderAll() + // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], { + // stroke: 'red', + // strokeWidth: 1, + // selectable: true, + // }) + // canvas?.add(finalLine) + // canvas?.renderAll() let rtnObj //평평하면 diff --git a/src/hooks/module/useModuleSelection.js b/src/hooks/module/useModuleSelection.js index 1b775fc6..6bd8ca3b 100644 --- a/src/hooks/module/useModuleSelection.js +++ b/src/hooks/module/useModuleSelection.js @@ -15,28 +15,37 @@ export function useModuleSelection(props) { const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도 - const [installHeight, setInstallHeight] = useState(managementState?.installHeight) //설치 높이 + const [installHeight, setInstallHeight] = useState() //설치 높이 const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속 - const [verticalSnowCover, setVerticalSnowCover] = useState(managementState?.verticalSnowCover) //수직적설량 + const [verticalSnowCover, setVerticalSnowCover] = useState() //수직적설량 const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등 const { getModuleTypeItemList } = useMasterController() const { findCommonCode } = useCommonCode() - //탭별 파라메터 초기화 - useEffect(() => { + const bindInitData = () => { setInstallHeight(managementState?.installHeight) setStandardWindSpeed(managementState?.standardWindSpeedId) setVerticalSnowCover(managementState?.verticalSnowCover) setSelectedSurfaceType(managementState?.surfaceType) + } + //탭별 파라메터 초기화 + useEffect(() => { + bindInitData() const initParams = { illuminationTp: managementState?.surfaceTypeValue, //면조도 instHt: managementState?.installHeight, //설치높이 stdWindSpeed: managementState?.standardWindSpeedId, //기준풍속 stdSnowLd: managementState?.verticalSnowCover, //기준적설량 } + + if (selectedModules) { + initParams.moduleTpCd = selectedModules.itemTp + initParams.moduleItemId = selectedModules.itemId + } + setModuleSelectionInitParams(initParams) }, [managementState]) @@ -64,9 +73,13 @@ export function useModuleSelection(props) { return } + console.log('managementState', managementState) + //새로고침시 데이터 날아가는거 방지 - if (!managementState) { + if (managementState === null) { setManagementState(managementStateLoaded) + } else { + bindInitData() } getModuleData(roofsIds) @@ -101,12 +114,23 @@ export function useModuleSelection(props) { ...moduleSelectionInitParams, illuminationTp: option.clCode, }) + + setManagementState({ + ...managementState, + surfaceType: option.clCodeNm, + surfaceTypeValue: option.clCode, + }) } const handleChangeWindSpeed = (option) => { setModuleSelectionInitParams({ ...moduleSelectionInitParams, - surfaceType: option.clCode, + stdWindSpeed: option.clCode, + }) + + setManagementState({ + ...managementState, + standardWindSpeedId: option.clCode, }) } @@ -116,15 +140,24 @@ export function useModuleSelection(props) { ...moduleSelectionInitParams, instHt: option, }) + + setManagementState({ + ...managementState, + installHeight: option, + }) } const handleChangeVerticalSnowCover = (option) => { setVerticalSnowCover(option) - setModuleSelectionInitParams({ ...moduleSelectionInitParams, stdSnowLd: option, }) + + setManagementState({ + ...managementState, + verticalSnowCover: option, + }) } useEffect(() => { diff --git a/src/locales/ko.json b/src/locales/ko.json index d2113d2e..3cf57205 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -987,5 +987,7 @@ "module.place.no.surface": "선택된 모듈 설치면이 없습니다.", "module.place.select.module": "모듈을 선택해주세요.", "module.place.select.one.module": "모듈은 하나만 선택해주세요.", - "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?" + "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?", + "module.not.found": "설치 모듈을 선택하세요.", + "construction.length.difference": "지붕면 공법을 전부 선택해주세요." } From 01353924f4f9d70eb8e9fa94d41118484117d975 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 21 Jan 2025 08:51:04 +0900 Subject: [PATCH 052/130] =?UTF-8?q?=EB=A9=94=EC=9D=B8=ED=99=94=EB=A9=B4=20?= =?UTF-8?q?=EC=B5=9C=EA=B7=BC=EB=AC=BC=EA=B1=B4=20=EC=83=81=EC=84=B8=20?= =?UTF-8?q?=EC=9D=B4=EB=8F=99=EC=8B=9C=20=EB=A1=9C=EB=94=A9=EB=B0=94=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/MainContents.jsx | 4 +- src/components/management/StuffDetail.jsx | 84 ++++++++++++++++--- .../management/StuffSearchCondition.jsx | 18 +++- .../management/popup/FindAddressPop.jsx | 27 +++++- .../management/popup/FindAddressPopQGrid.jsx | 6 ++ .../management/popup/PlanRequestPop.jsx | 9 +- .../management/popup/PlanRequestPopQGrid.jsx | 6 ++ 7 files changed, 131 insertions(+), 23 deletions(-) diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx index 766d7efc..3c9379d8 100644 --- a/src/components/main/MainContents.jsx +++ b/src/components/main/MainContents.jsx @@ -10,7 +10,6 @@ import { useRecoilValue } from 'recoil' import { useRouter } from 'next/navigation' import { globalLocaleStore } from '@/store/localeAtom' import { queryStringFormatter } from '@/util/common-utils' -import MainSkeleton from '../ui/MainSkeleton' import { useMainContentsController } from '@/hooks/main/useMainContentsController' import { QcastContext } from '@/app/QcastProvider' import { useSwal } from '@/hooks/useSwal' @@ -31,7 +30,7 @@ export default function MainContents() { //FAQ const [recentFaqList, setRecentFaqList] = useState([]) - const { qcastState } = useContext(QcastContext) + const { qcastState, setIsGlobalLoading } = useContext(QcastContext) const { fetchObjectList, initObjectList } = useMainContentsController() useEffect(() => { @@ -105,6 +104,7 @@ export default function MainContents() { key={row.objectNo} className="recently-item" onClick={() => { + setIsGlobalLoading(true) if (row.tempFlg === '0') { router.push(`/management/stuff/detail?objectNo=${row.objectNo.toString()}`, { scroll: false }) } else { diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 6b57e111..9e2f0d04 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -1631,11 +1631,21 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.save')} )} - + {/* - + */} +
@@ -2131,11 +2141,21 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.save')} )} - + {/* - + */} +
@@ -2150,11 +2170,21 @@ export default function StuffDetail() { {managementState?.tempFlg === '0' ? ( <>
- + {/* - + */} + @@ -2175,11 +2205,21 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.save')} )} - + {/* - + */} +
)} @@ -2729,11 +2769,21 @@ export default function StuffDetail() { {/* 진짜R 플랜끝 */}
- + {/* - + */} + @@ -2754,11 +2804,21 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.save')} )} - + {/* - + */} +
)} diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index ad265c55..ba16334e 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -10,7 +10,7 @@ import JA from '@/locales/ja.json' import { stuffSearchState } from '@/store/stuffAtom' import { isEmptyArray } from '@/util/common-utils' import dayjs from 'dayjs' -import Link from 'next/link' +import { useRouter } from 'next/navigation' import SingleDatePicker from '../common/datepicker/SingleDatePicker' import { useMessage } from '@/hooks/useMessage' import { isObjectNotEmpty } from '@/util/common-utils' @@ -20,6 +20,7 @@ import { SessionContext } from '@/app/SessionProvider' import { QcastContext } from '@/app/QcastProvider' export default function StuffSearchCondition() { + const router = useRouter() const { session } = useContext(SessionContext) const setAppMessageState = useSetRecoilState(appMessageStore) const globalLocaleState = useRecoilValue(globalLocaleStore) @@ -822,12 +823,21 @@ export default function StuffSearchCondition() {

{getMessage('stuff.search.title')}

- - {/* */} + {/* - + */} + diff --git a/src/components/management/popup/FindAddressPop.jsx b/src/components/management/popup/FindAddressPop.jsx index 960fd2e3..55770d12 100644 --- a/src/components/management/popup/FindAddressPop.jsx +++ b/src/components/management/popup/FindAddressPop.jsx @@ -56,9 +56,6 @@ export default function FindAddressPop(props) { //우편번호 검색 const searchPostNum = () => { - // //7830060 - // //9302226 - // //0790177 3개짜리 const params = { zipcode: watch('zipNo'), } @@ -122,6 +119,28 @@ export default function FindAddressPop(props) { } } + //그리드 더블클릭 + const getCellDoubleClicked = (event) => { + setAddress1(event.data.address1) + setAddress2(event.data.address2) + setAddress3(event.data.address3) + setPrefId(event.data.prefcode) + setZipNo(event.data.zipcode) + + if (event.data.prefcode == null) { + return alert(getMessage('stuff.addressPopup.error.message2')) + } else { + props.zipInfo({ + zipNo: event.data.zipcode, + address1: event.data.address1, + address2: event.data.address2, + address3: event.data.address3, + prefId: event.data.prefcode, + }) + } + props.setShowAddressButtonValid(false) + } + return (
@@ -146,7 +165,7 @@ export default function FindAddressPop(props) {
- +
diff --git a/src/components/management/popup/FindAddressPopQGrid.jsx b/src/components/management/popup/FindAddressPopQGrid.jsx index 6447dd48..4de93e9c 100644 --- a/src/components/management/popup/FindAddressPopQGrid.jsx +++ b/src/components/management/popup/FindAddressPopQGrid.jsx @@ -48,6 +48,11 @@ export default function FindAddressPopGrid(props) { props.getSelectedRowdata(selectedData) } + //더블클릭 + const onCellDoubleClicked = useCallback((event) => { + props.getCellDoubleClicked(event) + }, []) + return (
${getMessage('stuff.grid.noData')}`} />
diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index 38df870f..033c71de 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -243,6 +243,13 @@ export default function PlanRequestPop(props) { } } + // 더블클릭 + const getCellDoubleClicked = (event) => { + setPlanReqObject(event.data) + props.planReqInfo(event.data) + props.setShowDesignRequestButtonValid(false) + } + return (
@@ -409,7 +416,7 @@ export default function PlanRequestPop(props) {
- +
diff --git a/src/components/management/popup/PlanRequestPopQGrid.jsx b/src/components/management/popup/PlanRequestPopQGrid.jsx index 0e5117e3..5f78f7a3 100644 --- a/src/components/management/popup/PlanRequestPopQGrid.jsx +++ b/src/components/management/popup/PlanRequestPopQGrid.jsx @@ -48,6 +48,11 @@ export default function PlanRequestPopQGrid(props) { props.getSelectedRowdata(selectedData) } + // 그리드 더블클릭 + const onCellDoubleClicked = useCallback((event) => { + props.getCellDoubleClicked(event) + }, []) + return (
${getMessage('stuff.grid.noData')}`} /> From b34c30fbba1f82c77900db7899b3726b620039a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 21 Jan 2025 09:52:09 +0900 Subject: [PATCH 053/130] =?UTF-8?q?=F0=9F=9A=A8chore:=20Sync=20Sass?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/_reset.scss | 9 +++++++++ src/styles/spinner.scss | 6 +++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/styles/_reset.scss b/src/styles/_reset.scss index ceb5aff3..a77b35e2 100644 --- a/src/styles/_reset.scss +++ b/src/styles/_reset.scss @@ -414,6 +414,15 @@ button{ transform: translateY(-50%) rotate(-180deg); } } + &.disabled{ + cursor: default; + p{ + color: #aaa; + } + &::after{ + opacity: 0.7; + } + } } .select-light{ diff --git a/src/styles/spinner.scss b/src/styles/spinner.scss index b6398e94..45e124ae 100644 --- a/src/styles/spinner.scss +++ b/src/styles/spinner.scss @@ -1,10 +1,14 @@ .spinner-wrap{ + position: fixed; + top: 0; + left: 0; width: 100%; height: 100vh; display: flex; align-items: center; justify-content: center; - background-color: #fff; + background-color: rgba($color: #101010, $alpha: 0.2); + z-index: 2000000; .loader { font-size: 10px; width: 1.2em; From cccb5b88ea6901258fdef0f380c0e37033c3dcb7 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Tue, 21 Jan 2025 10:43:00 +0900 Subject: [PATCH 054/130] =?UTF-8?q?fix:=20=EB=AC=BC=EA=B1=B4=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EC=A0=84=EC=9D=98=20=EC=BA=94=EB=B2=84=EC=8A=A4=20?= =?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=EA=B0=80=20=EB=B3=B5=EC=82=AC?= =?UTF-8?q?=EB=90=98=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasFrame.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index cf2e0d56..5757b379 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -1,6 +1,6 @@ 'use client' -import { useEffect, useRef } from 'react' +import { useContext, useEffect, useRef } from 'react' import { useRecoilValue } from 'recoil' @@ -14,12 +14,14 @@ import { useCanvasConfigInitialize } from '@/hooks/common/useCanvasConfigInitial import { currentMenuState } from '@/store/canvasAtom' import { totalDisplaySelector } from '@/store/settingAtom' import { MENU } from '@/common/common' +import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' export default function CanvasFrame() { const canvasRef = useRef(null) const { canvas } = useCanvas('canvas') const { canvasLoadInit, gridInit } = useCanvasConfigInitialize() const currentMenu = useRecoilValue(currentMenuState) + const { floorPlanState } = useContext(FloorPlanContext) const { contextMenu, handleClick } = useContextMenu() const { selectedPlan } = usePlan() const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부 @@ -27,7 +29,7 @@ export default function CanvasFrame() { const loadCanvas = () => { if (canvas) { canvas?.clear() // 캔버스를 초기화합니다. - if (selectedPlan?.canvasStatus) { + if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo) { canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () { canvasLoadInit() //config된 상태로 캔버스 객체를 그린다 canvas?.renderAll() // 캔버스를 다시 그립니다. From fd8045aa8fd4f17cc51d0bd5ddbefc0a7b7c433c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 21 Jan 2025 11:07:47 +0900 Subject: [PATCH 055/130] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=9A=8C=EB=A1=9C?= =?UTF-8?q?=ED=95=A0=EB=8B=B9=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 50 ++++---- .../step/PowerConditionalSelect.jsx | 111 +++++++++--------- .../step/type/PassivityCircuitAllocation.jsx | 9 +- src/hooks/common/useMasterController.js | 2 +- src/store/circuitTrestleAtom.js | 22 +++- 5 files changed, 98 insertions(+), 96 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 450d15b9..4c566d9a 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -6,14 +6,12 @@ import StepUp from '@/components/floor-plan/modal/circuitTrestle/step/StepUp' import { useMessage } from '@/hooks/useMessage' import { usePopup } from '@/hooks/usePopup' import PassivityCircuitAllocation from './step/type/PassivityCircuitAllocation' -import { useAxios } from '@/hooks/useAxios' import { useMasterController } from '@/hooks/common/useMasterController' -import { get } from 'react-hook-form' import { correntObjectNoState } from '@/store/settingAtom' import { useRecoilValue } from 'recoil' import { GlobalDataContext } from '@/app/GlobalDataProvider' import { useRecoilState } from 'recoil' -import { modelState, pcsCheckState, powerConditionalState } from '@/store/circuitTrestleAtom' +import { makersState, modelsState, modelState, pcsCheckState, selectedMakerState, seriesState } from '@/store/circuitTrestleAtom' import { POLYGON_TYPE } from '@/common/common' import { useSwal } from '@/hooks/useSwal' import { canvasState } from '@/store/canvasAtom' @@ -27,30 +25,31 @@ const ALLOCATION_TYPE = { export default function CircuitTrestleSetting({ id }) { const { getMessage } = useMessage() const { closePopup } = usePopup() - // 탭 번호 1: 파워 컨디셔너 선택(+수동 설정) - // 탭 번호 2: 회로 할당 - const [tabNum, setTabNum] = useState(1) - const [allocationType, setAllocationType] = useState(ALLOCATION_TYPE.AUTO) - - const [makers, setMakers] = useState([]) - const [series, setSeries] = useState([]) - const [model, setModel] = useRecoilState(modelState) - const [selectedModels, setSelectedModels] = useState(model.selectedModels) - const [models, setModels] = useState(model.models) - const [selectedMaker, setSelectedMaker] = useState(null) - const [selectedSeries, setSelectedSeries] = useState(null) - const correntObjectNo = useRecoilValue(correntObjectNoState) - const { getPcsMakerList } = useMasterController() - const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) - const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) - const canvas = useRecoilValue(canvasState) const { apply } = useTrestle() const { swalFire } = useSwal() + const canvas = useRecoilValue(canvasState) + + const [makers, setMakers] = useRecoilState(makersState) + const [selectedMaker, setSelectedMaker] = useRecoilState(selectedMakerState) + const [series, setSeries] = useRecoilState(seriesState) + const [models, setModels] = useRecoilState(modelsState) + const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) + + const [tabNum, setTabNum] = useState(1) + const [allocationType, setAllocationType] = useState(ALLOCATION_TYPE.AUTO) const [circuitAllocationType, setCircuitAllocationType] = useState(1) const powerConditionalSelectProps = { tabNum, setTabNum, + makers, + setMakers, + selectedMaker, + setSelectedMaker, + series, + setSeries, + models, + setModels, } const circuitProps = { tabNum, @@ -59,11 +58,6 @@ export default function CircuitTrestleSetting({ id }) { setCircuitAllocationType, } - useEffect(() => { - console.log('🚀 ~ CircuitTrestleSetting ~ model:', model) - setSelectedModels(model.selectedModels) - }, [model]) - const onAutoAllocation = () => { let moduleStdQty = 0 let moduleMaxQty = 0 @@ -100,14 +94,16 @@ export default function CircuitTrestleSetting({ id }) { } const onPassivityAllocation = () => { - console.log('🚀 ~ onPassivityAllocation ~ selectedModels:', model) - if (selectedModels.length === 0) { + console.log('🚀 ~ onPassivityAllocation ~ selectedModels:', models) + + if (models.filter((m) => m.selected).length === 0) { swalFire({ title: '파워 컨디셔너를 추가해 주세요.', type: 'alert', }) return } else if (pcsCheck.max) { + const selectedModels = models.filter((m) => m.selected) const moduleStdQty = selectedModels.reduce((acc, model) => { return acc + parseInt(model.moduleStdQty) }, 0) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx index a58abfc3..384c4867 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx @@ -1,28 +1,18 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import QSelectBox from '@/components/common/select/QSelectBox' import { useMasterController } from '@/hooks/common/useMasterController' -import { useEvent } from '@/hooks/useEvent' import { useMessage } from '@/hooks/useMessage' import { useSwal } from '@/hooks/useSwal' -import { makerState, modelState, pcsCheckState, seriesState } from '@/store/circuitTrestleAtom' +import { pcsCheckState } from '@/store/circuitTrestleAtom' import { globalLocaleStore } from '@/store/localeAtom' -import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' +import { selectedModuleState } from '@/store/selectedModuleOptions' import { useContext, useEffect, useState } from 'react' import { useRecoilState } from 'recoil' import { useRecoilValue } from 'recoil' import { v4 as uuidv4 } from 'uuid' export default function PowerConditionalSelect(props) { - let { tabNum, setTabNum } = props - const [makerData, setMakerData] = useRecoilState(makerState) - const [makers, setMakers] = useState(makerData.makers) - const [selectedMaker, setSelectedMaker] = useState(makerData.selectedMaker) - const [series, setSeries] = useRecoilState(seriesState) - const [seriesList, setSeriesList] = useState(series.series) - const [selectedSeries, setSelectedSeries] = useState(series.selectedSeries) - const [model, setModel] = useRecoilState(modelState) - const [models, setModels] = useState(model.models) - const [selectedModels, setSelectedModels] = useState(model.selectedModels) + let { tabNum, setTabNum, makers, setMakers, selectedMaker, setSelectedMaker, series, setSeries, models, setModels } = props const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const { getMessage } = useMessage() @@ -69,20 +59,20 @@ export default function PowerConditionalSelect(props) { // console.log('🚀 ~ useEffect ~ /api/object/${correntObjectNo}/detail:', res) // // coldRegionFlg-한랭지사양, conType// 계약조건(잉여~,전량) // }) - return () => { - setMakerData({ makers, selectedMaker }) - setSeries({ series: seriesList, selectedSeries }) - setModel({ models, selectedModels }) - } + // return () => { + // console.log('🚀 ~ useEffect ~ PowerConditionalSelect unmount:', makers, selectedMaker) + // setMakerData({ makers, selectedMaker }) + // setSeries({ series: seriesList, selectedSeries }) + // setModels({ models, selectedModels }) + // } }, []) useEffect(() => { console.log('🚀 ~ PowerConditionalSelect ~ selectedMaker:', selectedMaker) if (selectedMaker) { - setSelectedModels([]) - setModels([]) + setModels(null) getPcsMakerList(selectedMaker).then((res) => { - setSeriesList( + setSeries( res.data.map((series) => { return { ...series, selected: false } }), @@ -92,9 +82,9 @@ export default function PowerConditionalSelect(props) { }, [selectedMaker]) useEffect(() => { - if (seriesList.filter((series) => series.selected).length === 0) return - const pcsMkrCd = seriesList.filter((series) => series.selected)[0]?.pcsMkrCd - const pcsSerList = seriesList + if (series.filter((s) => s.selected).length === 0) return + const pcsMkrCd = series.filter((s) => s.selected)[0]?.pcsMkrCd + const pcsSerList = series .filter((series) => series.selected) .map((series) => { return { pcsSerCd: series.pcsSerCd } @@ -106,7 +96,7 @@ export default function PowerConditionalSelect(props) { } }) getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList }).then((res) => { - if (res?.result.code === 200) { + if (res?.result.code === 200 && res?.data) { console.log('🚀 ~ useEffect ~ res:', res.data) setModels( res.data.map((model) => { @@ -121,23 +111,15 @@ export default function PowerConditionalSelect(props) { ) } }) - }, [seriesList]) - - useEffect(() => { - console.log('🚀 ~ useEffect ~ models:', models) - }, [models]) - - useEffect(() => { - console.log('🚀 ~ useEffect ~ pcsCheck:', pcsCheck) - }, [pcsCheck]) + }, [series]) const onCheckSeries = (series) => { - setSeriesList((prev) => prev.map((s) => ({ ...s, selected: s.pcsSerCd === series.pcsSerCd ? !s.selected : s.selected }))) + setSeries((prev) => prev.map((s) => ({ ...s, selected: s.pcsSerCd === series.pcsSerCd ? !s.selected : s.selected }))) } const onAddSelectedModel = () => { if (selectedRow === null) return - if (selectedModels.length === 3) { + if (models.filter((m) => m.selected).length === 3) { swalFire({ title: '최대 3개까지 선택할 수 있습니다.', icon: 'warning', @@ -145,28 +127,41 @@ export default function PowerConditionalSelect(props) { return } - setSelectedModels([...selectedModels, selectedRow]) + setModels( + models.map((model) => { + if (model.code === selectedRow.code) { + return { + ...model, + selected: true, + } + } + return { + ...model, + } + }), + ) setSelectedRow(null) } const onRemoveSelectedModel = (model) => { - setSelectedModels(selectedModels.filter((m) => m.code !== model.code)) + // setSelectedModels(selectedModels.filter((m) => m.code !== model.code)) + setModels(models.map((m) => ({ ...m, selected: m.code !== model.code ? m.selected : false }))) } - useEffect(() => { - console.log('🚀 ~ useEffect ~ selectedModels:', selectedModels) - const selectedModelsIds = selectedModels.map((model) => model.code) + // useEffect(() => { + // console.log('🚀 ~ useEffect ~ selectedModels:', selectedModels) + // const selectedModelsIds = selectedModels.map((model) => model.code) - setModels( - models.map((model) => { - return { - ...model, - selected: selectedModelsIds.includes(model.code), - } - }), - ) - setModel({ ...model, selectedModels: selectedModels }) - }, [selectedModels]) + // setModels( + // models.map((model) => { + // return { + // ...model, + // selected: selectedModelsIds.includes(model.code), + // } + // }), + // ) + // setModel({ ...model, selectedModels: selectedModels }) + // }, [selectedModels]) return ( <>
@@ -191,7 +186,7 @@ export default function PowerConditionalSelect(props) {
- {seriesList?.map((series, index) => ( + {series?.map((series, index) => (
onCheckSeries(series)} checked={series.selected} /> @@ -234,11 +229,13 @@ export default function PowerConditionalSelect(props) {
- {selectedModels?.map((model) => ( - - {model.itemNm} - - ))} + {models + ?.filter((m) => m.selected) + ?.map((model) => ( + + {model.itemNm} + + ))}
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index 61869db0..e9da38b3 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -2,7 +2,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import { POLYGON_TYPE } from '@/common/common' import { useMessage } from '@/hooks/useMessage' import { canvasState } from '@/store/canvasAtom' -import { modelState, moduleStatisticsState } from '@/store/circuitTrestleAtom' +import { modelState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' import { useContext, useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' @@ -19,16 +19,15 @@ export default function PassivityCircuitAllocation() { const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) - const { header, rows, footer } = useRecoilValue(moduleStatisticsState) const [moduleData, setModuleData] = useState({ - header: header, - rows: rows, - footer: footer, + header: [], + rows: [], }) const model = useRecoilValue(modelState) const [selectedModels, setSelectedModels] = useState(model.selectedModels) const [selectedPcs, setSelectedPcs] = useState(selectedModels[0]) const [totalWpout, setTotalWpout] = useState(0) + useEffect(() => { setSurfaceInfo() if (!managementState) { diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index d9b1cec0..013c7870 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -147,7 +147,7 @@ export function useMasterController() { ], } - return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: test }).then((res) => { + return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: params }).then((res) => { return res }) } diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index fe9c6e35..05a11760 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -1,20 +1,30 @@ import { useMessage } from '@/hooks/useMessage' import { atom } from 'recoil' -export const makerState = atom({ - key: 'makerState', - default: { makers: [], selectedMaker: null }, +export const makersState = atom({ + key: 'makersState', + default: [], dangerouslyAllowMutability: true, }) +export const selectedMakerState = atom({ + key: 'selectedMakerState', + default: null, +}) + export const seriesState = atom({ key: 'seriesState', - default: { series: [], selectedSeries: [] }, + default: [], }) -export const modelState = atom({ +export const selectedSeriesState = atom({ + key: 'selectedSeriesState', + default: null, +}) + +export const modelsState = atom({ key: 'modelState', - default: { models: [], selectedModels: [] }, + default: [], }) export const pcsCheckState = atom({ From 16708b3ef36cb69f47dc62058d535da2a459bd8a Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Tue, 21 Jan 2025 11:14:27 +0900 Subject: [PATCH 056/130] =?UTF-8?q?GlobalLoading=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/GlobalLoadingProvider.js | 11 ++ src/app/QcastProvider.js | 8 +- src/app/layout.js | 6 +- src/components/header/Header.jsx | 2 +- src/components/management/StuffSubHeader.jsx | 160 +++++++++---------- 5 files changed, 94 insertions(+), 93 deletions(-) create mode 100644 src/app/GlobalLoadingProvider.js diff --git a/src/app/GlobalLoadingProvider.js b/src/app/GlobalLoadingProvider.js new file mode 100644 index 00000000..5f56e1a7 --- /dev/null +++ b/src/app/GlobalLoadingProvider.js @@ -0,0 +1,11 @@ +'use client' + +import { useContext } from 'react' +import { QcastContext } from './QcastProvider' +import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' + +export default function GlobalLoadingProvider({ children }) { + const { isGlobalLoading } = useContext(QcastContext) + + return {isGlobalLoading && } +} diff --git a/src/app/QcastProvider.js b/src/app/QcastProvider.js index 43404308..73911177 100644 --- a/src/app/QcastProvider.js +++ b/src/app/QcastProvider.js @@ -6,7 +6,6 @@ import { useCommonCode } from '@/hooks/common/useCommonCode' import ServerError from './error' import '@/styles/common.scss' -import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' export const QcastContext = createContext({ qcastState: {}, @@ -17,7 +16,7 @@ export const QcastContext = createContext({ export const QcastProvider = ({ children }) => { const [planSave, setPlanSave] = useState(false) - const [isGlobalLoading, setIsGlobalLoading] = useState(false) + const [isGlobalLoading, setIsGlobalLoading] = useState(true) const { commonCode, findCommonCode } = useCommonCode() const [qcastState, setQcastState] = useState({ @@ -35,11 +34,6 @@ export const QcastProvider = ({ children }) => { return ( <> - {isGlobalLoading && ( -
- -
- )} }>{children} diff --git a/src/app/layout.js b/src/app/layout.js index fd9f08bd..1118b0d9 100644 --- a/src/app/layout.js +++ b/src/app/layout.js @@ -8,15 +8,13 @@ import SessionProvider from './SessionProvider' import GlobalDataProvider from './GlobalDataProvider' import Header from '@/components/header/Header' import QModal from '@/components/common/modal/QModal' -import Dimmed from '@/components/ui/Dimmed' import PopupManager from '@/components/common/popupManager/PopupManager' import './globals.css' import '../styles/style.scss' import '../styles/contents.scss' import Footer from '@/components/footer/Footer' -import { Suspense } from 'react' -import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' +import GlobalLoadingProvider from './GlobalLoadingProvider' export const metadata = { title: 'Create Next App', @@ -70,10 +68,10 @@ export default async function RootLayout({ children }) { {children} ) : ( +
- {children}
diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx index 1a39e9e1..ab6b74b7 100644 --- a/src/components/header/Header.jsx +++ b/src/components/header/Header.jsx @@ -221,7 +221,7 @@ export default function Header(props) { return ( <> - {!isGlobalLoading && !(pathName.includes('login') || pathName.includes('join') || sessionState.pwdInitYn === 'N') && ( + {!(pathName.includes('login') || pathName.includes('join') || sessionState.pwdInitYn === 'N') && (
diff --git a/src/components/management/StuffSubHeader.jsx b/src/components/management/StuffSubHeader.jsx index 18bd5969..8e61e259 100644 --- a/src/components/management/StuffSubHeader.jsx +++ b/src/components/management/StuffSubHeader.jsx @@ -66,87 +66,85 @@ export default function StuffSubHeader({ type }) { } return ( - !isGlobalLoading && ( - <> -
-
- {type === 'list' && ( - <> - -

{getMessage('header.menus.management')}

- -
    -
  • - - - -
  • -
  • - {getMessage('header.menus.management')} -
  • -
  • - {getMessage('header.menus.management.stuffList')} -
  • -
- - )} - {type === 'temp' && ( - <> -
    -
  • - - {getMessage('stuff.temp.subTitle')} - -
  • -
-
    -
  • - - - -
  • -
  • - {getMessage('header.menus.management')} -
  • -
  • - {getMessage('header.menus.management.newStuff')} -
  • -
- - )} - {type === 'detail' && ( - <> - -
    -
  • - - - -
  • -
  • - {getMessage('header.menus.management')} -
  • -
  • - {getMessage('header.menus.management.detail')} -
  • -
- - )} -
+ <> +
+
+ {type === 'list' && ( + <> + +

{getMessage('header.menus.management')}

+ +
    +
  • + + + +
  • +
  • + {getMessage('header.menus.management')} +
  • +
  • + {getMessage('header.menus.management.stuffList')} +
  • +
+ + )} + {type === 'temp' && ( + <> +
    +
  • + + {getMessage('stuff.temp.subTitle')} + +
  • +
+
    +
  • + + + +
  • +
  • + {getMessage('header.menus.management')} +
  • +
  • + {getMessage('header.menus.management.newStuff')} +
  • +
+ + )} + {type === 'detail' && ( + <> + +
    +
  • + + + +
  • +
  • + {getMessage('header.menus.management')} +
  • +
  • + {getMessage('header.menus.management.detail')} +
  • +
+ + )}
- - ) +
+ ) } From ebaa0f5fba933b602940b613d68c33e0535faf7f Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 11:24:38 +0900 Subject: [PATCH 057/130] =?UTF-8?q?=F0=9F=98=8Efix:=20=EB=B0=A9=EC=9C=84?= =?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=ED=8C=9D=EC=97=85=20=EB=82=B4=EC=9A=A9?= =?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=EC=BD=94=EB=93=9C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 각도 데이터 뿐만 아니라 나침반 클릭 포인트에 class도 유지 되게 변경 --- .../floor-plan/modal/basic/step/Orientation.jsx | 14 +++++++++----- src/hooks/common/useCanvasPopupStatusController.js | 13 +++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx index 23f388f7..590c9d46 100644 --- a/src/components/floor-plan/modal/basic/step/Orientation.jsx +++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx @@ -1,4 +1,4 @@ -import { forwardRef, useContext, useImperativeHandle, useState } from 'react' +import { forwardRef, useContext, useEffect, useImperativeHandle, useState } from 'react' import { useMessage } from '@/hooks/useMessage' import { useOrientation } from '@/hooks/module/useOrientation' import { getDegreeInOrientation } from '@/util/canvas-util' @@ -8,6 +8,8 @@ import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupSta export const Orientation = forwardRef(({ tabNum }, ref) => { const { getMessage } = useMessage() + const { trigger: canvasPopupStatusTrigger } = useCanvasPopupStatusController(1) + const { nextStep, compasDeg, setCompasDeg } = useOrientation() const [hasAnglePassivity, setHasAnglePassivity] = useState(false) @@ -21,6 +23,10 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { canvasPopupStatusTrigger(compasDeg) } + useEffect(() => { + checkDegree(compasDeg) + }, [compasDeg]) + const checkDegree = (e) => { if (numberCheck(Number(e)) && Number(e) >= -180 && Number(e) <= 180) { setCompasDeg(Number(e)) @@ -29,8 +35,6 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { } } - const { trigger: canvasPopupStatusTrigger } = useCanvasPopupStatusController(1) - return ( <>
@@ -67,7 +71,7 @@ export const Orientation = forwardRef(({ tabNum }, ref) => {
- setHasAnglePassivity(!hasAnglePassivity)} /> + setHasAnglePassivity(!hasAnglePassivity)} />
@@ -76,7 +80,7 @@ export const Orientation = forwardRef(({ tabNum }, ref) => { type="text" className="input-origin block" value={compasDeg} - readOnly={hasAnglePassivity} + readOnly={!hasAnglePassivity} placeholder={0} onChange={ (e) => checkDegree(e.target.value) diff --git a/src/hooks/common/useCanvasPopupStatusController.js b/src/hooks/common/useCanvasPopupStatusController.js index 8db71567..58ef8a88 100644 --- a/src/hooks/common/useCanvasPopupStatusController.js +++ b/src/hooks/common/useCanvasPopupStatusController.js @@ -43,6 +43,10 @@ export function useCanvasPopupStatusController(param = 1) { break case 4: break + case 5: + break + case 6: + break default: } } else { @@ -56,6 +60,15 @@ export function useCanvasPopupStatusController(param = 1) { roofConstructions: [], }) break + case 3: + break + case 4: + break + case 5: + break + case 6: + break + default: } } }, [popupStatus]) From c596ef2d9f95f875695c907d341a359b2ba433f3 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 13:08:06 +0900 Subject: [PATCH 058/130] =?UTF-8?q?=F0=9F=98=8Efix:=20canvas=20loading=20b?= =?UTF-8?q?ar=20=EC=A0=9C=EC=96=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasFrame.jsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index 5757b379..6722fea8 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -15,6 +15,7 @@ import { currentMenuState } from '@/store/canvasAtom' import { totalDisplaySelector } from '@/store/settingAtom' import { MENU } from '@/common/common' import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' +import { QcastContext } from '@/app/QcastProvider' export default function CanvasFrame() { const canvasRef = useRef(null) @@ -25,6 +26,7 @@ export default function CanvasFrame() { const { contextMenu, handleClick } = useContextMenu() const { selectedPlan } = usePlan() const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부 + const { setIsGlobalLoading } = useContext(QcastContext) const loadCanvas = () => { if (canvas) { @@ -43,6 +45,10 @@ export default function CanvasFrame() { loadCanvas() }, [selectedPlan, canvas]) + useEffect(() => { + setIsGlobalLoading(false) + }, []) + return (
From 37e82a03467f7eec4682afbfa6a9aa22e368f287 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 14:32:48 +0900 Subject: [PATCH 059/130] =?UTF-8?q?=F0=9F=98=80fix:=20=EB=A9=94=EB=89=B4?= =?UTF-8?q?=20=EC=9D=B4=EB=8F=99=EC=8B=9C=20validation=20=EB=AC=B8?= =?UTF-8?q?=EA=B5=AC=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 2 +- src/locales/ja.json | 3 ++- src/locales/ko.json | 3 ++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index bdb612a8..cb2ab1e1 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -168,7 +168,7 @@ export default function CanvasMenu(props) { break case 4: if (!checkMenuAndCanvasState()) { - swalFire({ text: getMessage('estimate.menu.move.valid1') }) + swalFire({ text: getMessage('menu.validation.canvas.roof') }) return } else { setType('module') diff --git a/src/locales/ja.json b/src/locales/ja.json index 72addabb..e36e19b6 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -970,5 +970,6 @@ "can.not.copy.module": "모듈을 복사할 수 없습니다.(JA)", "can.not.remove.module": "모듈을 삭제할 수 없습니다.(JA)", "can.not.insert.module": "모듈을 삽입할 수 없습니다.(JA)", - "can.not.align.module": "모듈을 정렬할 수 없습니다.(JA)" + "can.not.align.module": "모듈을 정렬할 수 없습니다.(JA)", + "menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다." } diff --git a/src/locales/ko.json b/src/locales/ko.json index d2113d2e..2043cdab 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -987,5 +987,6 @@ "module.place.no.surface": "선택된 모듈 설치면이 없습니다.", "module.place.select.module": "모듈을 선택해주세요.", "module.place.select.one.module": "모듈은 하나만 선택해주세요.", - "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?" + "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?", + "menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다." } From 8d6a934717bf18b429a711e139dd6195811d74f8 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Tue, 21 Jan 2025 14:41:58 +0900 Subject: [PATCH 060/130] =?UTF-8?q?refactor:=20=EC=BA=94=EB=B2=84=EC=8A=A4?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20render=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasFrame.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index 6722fea8..e0c9191f 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -31,7 +31,7 @@ export default function CanvasFrame() { const loadCanvas = () => { if (canvas) { canvas?.clear() // 캔버스를 초기화합니다. - if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo) { + if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo && floorPlanState.pid === selectedPlan.planNo) { canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () { canvasLoadInit() //config된 상태로 캔버스 객체를 그린다 canvas?.renderAll() // 캔버스를 다시 그립니다. From 71abfe469db66fb60190e8a2fa210d923d338ed6 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Tue, 21 Jan 2025 14:48:14 +0900 Subject: [PATCH 061/130] =?UTF-8?q?=EB=A9=94=EB=89=B4=20=EC=9A=B0=EC=83=81?= =?UTF-8?q?=EB=8B=A8=20=EC=A7=80=EB=B6=95=EC=9E=AC=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EB=85=B8=EC=B6=9C=20=EC=98=A4=EB=A5=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/circuitTrestle/step/StepUp.jsx | 4 +- src/hooks/common/useMasterController.js | 79 ++++++++++++++++++- src/hooks/option/useCanvasSetting.js | 10 +-- .../roofcover/useRoofAllocationSetting.js | 3 +- 4 files changed, 87 insertions(+), 9 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index a3f69548..4597999c 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -16,7 +16,7 @@ export default function StepUp({}) { const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수 const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const model = useRecoilValue(modelState) - const { getPcsAutoRecommendList } = useMasterController() + const { getPcsVoltageStepUpList } = useMasterController() const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) @@ -64,7 +64,7 @@ export default function StepUp({}) { roofSurfaceList: roofSurfaceList, pscItemList: pscItemList, } - getPcsAutoRecommendList(params) + getPcsVoltageStepUpList(null) }, []) useCanvasPopupStatusController(6) diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index 013c7870..62558d8a 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -147,7 +147,7 @@ export function useMasterController() { ], } - return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: params }).then((res) => { + return await post({ url: '/api/v1/master/getPcsSeriesItemList', data: test }).then((res) => { return res }) } @@ -169,6 +169,82 @@ export function useMasterController() { }) } + /** + * PCS 승압설정 정보 조회 + * @param {Max접속(과적)여부} maxConnYn + * @param {동일회로도여부} smpCirYn + * @param {한랭지여부} coldZoneYn + * @param {사용된 모듈아이템 목록} useModuleItemList + * @param {지붕면 목록} roofSurfaceList + * @param {PCS 아이템 목록} pcsItemList + + * @returns + */ + const getPcsVoltageStepUpList = async (params2 = null) => { + const params = { + maxConnYn: 'N', + smpCirYn: 'Y', + coldZoneYn: 'N', + useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }], + roofSurfaceList: [ + { + roofSurfaceId: '1', + roofSurface: '남서', + roofSurfaceIncl: '5', + moduleList: [ + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + ], + }, + { + roofSurfaceId: '2', + roofSurface: '남서', + roofSurfaceIncl: '5', + moduleList: [ + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + ], + }, + { + roofSurfaceId: '3', + roofSurface: '남', + roofSurfaceIncl: '3', + moduleList: [ + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + { itemId: '107077' }, + ], + }, + ], + pcsItemList: [ + { itemId: '106857', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' }, + { itemId: '106856', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' }, + ], + } + + return await post({ url: '/api/v1/master/getPcsVoltageStepUpList', data: params }).then((res) => { + console.log('🚀🚀 ~ getPcsVoltageStepUpList ~ res:', res) + return res + }) + } + return { getRoofMaterialList, getModuleTypeItemList, @@ -178,5 +254,6 @@ export function useMasterController() { getPcsMakerList, getPcsModelList, getPcsAutoRecommendList, + getPcsVoltageStepUpList, } } diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index cad8c57a..080c78c4 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -316,7 +316,7 @@ export function useCanvasSetting() { roofsArray = res.map((item) => { return { roofApply: item.roofApply, - roofSeq: 0, + roofSeq: item.roofSeq, roofMatlCd: item.roofMatlCd, roofWidth: item.roofWidth, roofHeight: item.roofHeight, @@ -381,16 +381,16 @@ export function useCanvasSetting() { roofSizeSet: roofsRow[0].roofSizeSet, roofAngleSet: roofsRow[0].roofAngleSet, roofsData: roofsArray, - selectedRoofMaterial: addRoofs[0], + selectedRoofMaterial: addRoofs.find((roof) => roof.selected), }) }) } catch (error) { console.error('Data fetching error:', error) } - if (!(Object.keys(canvasSetting).length === 0 && canvasSetting.constructor === Object)) { - setBasicSettings({ ...canvasSetting }) - } + // if (!(Object.keys(canvasSetting).length === 0 && canvasSetting.constructor === Object)) { + // setBasicSettings({ ...canvasSetting }) + // } setCanvasSetting({ ...basicSetting }) } diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 1488fb26..824e4b4a 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -169,6 +169,7 @@ export function useRoofAllocationSetting(id) { roofSizeSet: res[0].roofSizeSet, roofAngleSet: res[0].roofAngleSet, roofsData: roofsArray, + selectedRoofMaterial: selectRoofs.find((roof) => roof.selected), }) setBasicInfo({ roofSizeSet: '' + res[0].roofSizeSet, @@ -188,7 +189,7 @@ export function useRoofAllocationSetting(id) { roofSizeSet: Number(basicSetting.roofSizeSet), roofAngleSet: basicSetting.roofAngleSet, roofAllocationList: currentRoofList.map((item, index) => ({ - roofApply: item.selected === null || item.selected === undefined ? 'true' : item.selected, + roofApply: item.selected, roofSeq: index, roofMatlCd: item.roofMatlCd === null || item.roofMatlCd === undefined ? 'ROOF_ID_WA_53A' : item.roofMatlCd, roofWidth: item.width === null || item.width === undefined ? 0 : Number(item.width), From becd53d3e22cc414735492c87fb4bb4795787408 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 15:34:50 +0900 Subject: [PATCH 062/130] =?UTF-8?q?=F0=9F=98=80fix:=20canvas=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EB=B2=84=ED=8A=BC/=20=EB=82=98=EA=B0=80=EA=B8=B0?= =?UTF-8?q?=20=EB=B2=84=ED=8A=BC=20=EB=AC=B8=EA=B5=AC=20=EB=B0=8F=20?= =?UTF-8?q?=EC=9D=B4=EB=B2=A4=ED=8A=B8=20=EC=A0=95=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasMenu.jsx | 19 ++++++++++++++++++- src/hooks/usePlan.js | 2 ++ src/locales/ja.json | 3 +++ src/locales/ko.json | 3 +++ 4 files changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index cb2ab1e1..495bc781 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -245,6 +245,23 @@ export default function CanvasMenu(props) { await saveCanvas() } + // 나가기 버튼 클릭 + const handleLeaveCanvas = () => { + swalFire({ + text: getMessage('plan.message.leave'), + type: 'confirm', + confirmButtonText: getMessage('plan.message.corfirm.yes'), + cancelButtonText: getMessage('plan.message.confirm.no'), + confirmFn: async () => { + await handleSaveCanvas() + router.push(`/management/stuff/detail?objectNo=${objectNo}`) + }, + denyFn: () => { + router.push(`/management/stuff/detail?objectNo=${objectNo}`) + }, + }) + } + const [placementInitialId, setPlacementInitialId] = useState(uuidv4()) const placementInitialProps = { id: placementInitialId, @@ -531,7 +548,7 @@ export default function CanvasMenu(props) {
- +
)} diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index e44753d7..36d619c8 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -181,6 +181,7 @@ export function usePlan(params = {}) { setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) } updateCurrentPlan(res.data) + swalFire({ text: getMessage('plan.message.save') }) }) .catch((error) => { swalFire({ text: error.message, icon: 'error' }) @@ -200,6 +201,7 @@ export function usePlan(params = {}) { await promisePut({ url: '/api/canvas-management/canvas-statuses', data: planData }) .then((res) => { setPlans((plans) => plans.map((plan) => (plan.id === currentCanvasPlan.id ? { ...plan, canvasStatus: canvasStatus } : plan))) + swalFire({ text: getMessage('plan.message.save') }) }) .catch((error) => { swalFire({ text: error.message, icon: 'error' }) diff --git a/src/locales/ja.json b/src/locales/ja.json index e36e19b6..a70c8c41 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -305,6 +305,9 @@ "plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?", "plan.message.save": "저장되었습니다.", "plan.message.delete": "삭제되었습니다.", + "plan.message.leave": "작성한 물건을 저장하시겠습니까? [아니오]를 선택한 경우, 저장하지 않고 물건현황 목록으로 이동합니다.", + "plan.message.confirm.yes": "예", + "plan.message.confirm.no": "아니오", "setting": "設定", "delete": "삭제(JA)", "delete.all": "전체 삭제(JA)", diff --git a/src/locales/ko.json b/src/locales/ko.json index 2043cdab..f5b5eb1f 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -310,6 +310,9 @@ "plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?", "plan.message.save": "저장되었습니다.", "plan.message.delete": "삭제되었습니다.", + "plan.message.leave": "작성한 물건을 저장하시겠습니까? [아니오]를 선택한 경우, 저장하지 않고 물건현황 목록으로 이동합니다.", + "plan.message.corfirm.yes": "예", + "plan.message.confirm.no": "아니오", "setting": "설정", "delete": "삭제", "delete.all": "전체 삭제", From ebd77687cac9aba5da451aa8ebeaf6dec4643753 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 15:35:19 +0900 Subject: [PATCH 063/130] =?UTF-8?q?=F0=9F=98=8Efix:=20=EA=B3=B5=ED=86=B5?= =?UTF-8?q?=20=EA=B8=80=EB=A1=9C=EB=B2=8C=20=EC=8A=A4=ED=94=BC=EB=84=88=20?= =?UTF-8?q?=EB=A7=88=ED=81=AC=EC=97=85=20=EC=9C=84=EC=B9=98=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/GlobalLoadingProvider.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/GlobalLoadingProvider.js b/src/app/GlobalLoadingProvider.js index 5f56e1a7..92a6c65e 100644 --- a/src/app/GlobalLoadingProvider.js +++ b/src/app/GlobalLoadingProvider.js @@ -4,8 +4,8 @@ import { useContext } from 'react' import { QcastContext } from './QcastProvider' import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' -export default function GlobalLoadingProvider({ children }) { +export default function GlobalLoadingProvider() { const { isGlobalLoading } = useContext(QcastContext) - return {isGlobalLoading && } + return <>{isGlobalLoading && } } From b8b45f29b174292923dcc3cee513094e8309dc9c Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Tue, 21 Jan 2025 16:12:38 +0900 Subject: [PATCH 064/130] =?UTF-8?q?=F0=9F=98=B1fix:=20currentObjectNo=20se?= =?UTF-8?q?t=20=EA=B5=AC=EB=AC=B8=20=EC=9C=84=EC=B9=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - FloorPlanProvider -> FloorPlan --- src/app/floor-plan/FloorPlanProvider.js | 14 ++++++-------- src/app/floor-plan/layout.js | 21 ++++++--------------- src/components/floor-plan/FloorPlan.jsx | 20 +++++++++++++++----- 3 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index 13c3dd5a..cd9364eb 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -42,19 +42,17 @@ export const FloorPlanContext = createContext({ }) const FloorPlanProvider = ({ children }) => { - const pathname = usePathname() - const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) const searchParams = useSearchParams() const objectNo = searchParams.get('objectNo') const pid = searchParams.get('pid') //useEffect(() => { // 오류 발생으로 useEffect 사용 - if (pathname === '/floor-plan') { - if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { - notFound() - } - setCurrentObjectNo(objectNo) - } + // if (pathname === '/floor-plan') { + // if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + // notFound() + // } + // setCurrentObjectNo(objectNo) + // } //}, [pid, objectNo]) const [floorPlanState, setFloorPlanState] = useState({ diff --git a/src/app/floor-plan/layout.js b/src/app/floor-plan/layout.js index 74fe0632..e4ecbee3 100644 --- a/src/app/floor-plan/layout.js +++ b/src/app/floor-plan/layout.js @@ -1,31 +1,22 @@ 'use client' -import { usePathname } from 'next/navigation' import FloorPlanProvider from './FloorPlanProvider' import FloorPlan from '@/components/floor-plan/FloorPlan' import CanvasLayout from '@/components/floor-plan/CanvasLayout' -import { Suspense } from 'react' -import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' export default function FloorPlanLayout({ children }) { - console.log('🚀 ~ FloorPlanLayout ~ FloorPlanLayout:') - const pathname = usePathname() - console.log('🚀 ~ FloorPlanLayout ~ pathname:', pathname) - return ( <> - }> - - - {/* {pathname.includes('estimate') || pathname.includes('simulator') ? ( + + + {/* {pathname.includes('estimate') || pathname.includes('simulator') ? (
{children}
) : ( {children} )} */} - {children} -
-
-
+ {children} + + ) } diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index a2e92bf2..0358369c 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -1,18 +1,28 @@ 'use client' import { useEffect } from 'react' -//import { useRecoilState } from 'recoil' import CanvasMenu from '@/components/floor-plan/CanvasMenu' import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useCanvasSetting } from '@/hooks/option/useCanvasSetting' import { usePopup } from '@/hooks/usePopup' -//import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' -//import { correntObjectNoState } from '@/store/settingAtom' import '@/styles/contents.scss' +import { notFound, usePathname, useSearchParams } from 'next/navigation' +import { useSetRecoilState } from 'recoil' +import { correntObjectNoState } from '@/store/settingAtom' export default function FloorPlan({ children }) { - //const { floorPlanState, setFloorPlanState } = useContext(FloorPlanContext) - //const [correntObjectNo, setCorrentObjectNo] = useRecoilState(correntObjectNoState) + const pathname = usePathname() + const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) + const searchParams = useSearchParams() + const objectNo = searchParams.get('objectNo') + const pid = searchParams.get('pid') + if (pathname === '/floor-plan') { + if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + notFound() + } + setCurrentObjectNo(objectNo) + } + const { closeAll } = usePopup() const { menuNumber, setMenuNumber } = useCanvasMenu() const { fetchSettings, fetchBasicSettings } = useCanvasSetting() From 43093302902af2fe70bbee337c5249cafb6f5e8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:29:35 +0900 Subject: [PATCH 065/130] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=9A=8C=EB=A1=9C?= =?UTF-8?q?=ED=95=A0=EB=8B=B9=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/common/select/QSelectBox.jsx | 6 +- .../circuitTrestle/CircuitTrestleSetting.jsx | 16 +- .../step/PowerConditionalSelect.jsx | 20 +- .../modal/circuitTrestle/step/StepUp.jsx | 28 ++- .../step/type/PassivityCircuitAllocation.jsx | 208 ++++++++++-------- .../modal/panelBatch/PanelBatchStatistics.jsx | 5 +- src/hooks/module/useModuleBasicSetting.js | 12 +- src/hooks/module/useModulePlace.js | 1 + src/locales/ja.json | 6 + src/locales/ko.json | 1 + src/store/circuitTrestleAtom.js | 1 + src/util/common-utils.js | 4 + 12 files changed, 186 insertions(+), 122 deletions(-) diff --git a/src/components/common/select/QSelectBox.jsx b/src/components/common/select/QSelectBox.jsx index bd888ac3..12c72b5e 100644 --- a/src/components/common/select/QSelectBox.jsx +++ b/src/components/common/select/QSelectBox.jsx @@ -75,7 +75,11 @@ export default function QSelectBox({ useOnClickOutside(ref, handleClose) return ( -
{} : () => setOpenSelect(!openSelect)}> +
{} : () => setOpenSelect(!openSelect)} + >

{selected}

    {options?.length > 0 && diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 4c566d9a..2901f952 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -51,9 +51,18 @@ export default function CircuitTrestleSetting({ id }) { models, setModels, } - const circuitProps = { + + const passivityProps = { tabNum, setTabNum, + models, + setModels, + } + const stepUpProps = { + tabNum, + setTabNum, + models, + setModels, circuitAllocationType, setCircuitAllocationType, } @@ -61,6 +70,7 @@ export default function CircuitTrestleSetting({ id }) { const onAutoAllocation = () => { let moduleStdQty = 0 let moduleMaxQty = 0 + const selectedModels = models.filter((m) => m.selected) if (selectedModels.length === 0) { moduleStdQty = models.reduce((acc, model) => { @@ -144,8 +154,8 @@ export default function CircuitTrestleSetting({ id }) {
{tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && } - {tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && } - {tabNum === 2 && } + {tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && } + {tabNum === 2 && } {tabNum === 1 && allocationType === ALLOCATION_TYPE.AUTO && (
{item.name}{item.name}
{item.prop === 'name' ? item.name : item.prop === 'powerGeneration' ? item.powerGeneration : item.amount}{row[item.prop]}{row[item.prop]}
{item}{typeof item === 'number' ? item.toLocaleString('ko-KR', { maximumFractionDigits: 4 }) : item}{item.amount}
- {moduleData.header.map((header) => ( - + {headers.map((header) => ( + ))} - {moduleData.rows.map((row, index) => ( - - {moduleData.header.map((header) => ( - + {rows.map((row, index) => ( + + {headers.map((header) => ( + ))} ))} - - - {Array.from({ length: moduleData.header.length - 3 }).map((_, index) => { - return - })} - - + + {footer.map((footer) => ( + + ))}
{header.name}{header.name}
- {row[header.prop]} -
{row[header.prop]}
총합{totalWpout.toLocaleString('ko-KR', { maximumFractionDigits: 4 })}{totalWpout.toLocaleString('ko-KR', { maximumFractionDigits: 4 })}
{footer}
@@ -127,25 +157,27 @@ export default function PassivityCircuitAllocation() {
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional')}
- {selectedModels.map((model, index) => ( -
- setSelectedPcs(model)} - /> - -
- ))} + {models + .filter((model) => model.selected) + .map((model, index) => ( +
+ setSelectedPcs(model)} + /> + +
+ ))} {/*
diff --git a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx index aff0926b..2fbe78e9 100644 --- a/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx +++ b/src/components/floor-plan/modal/panelBatch/PanelBatchStatistics.jsx @@ -33,8 +33,9 @@ export default function PanelBatchStatistics() { {rows.map((row, index) => ( {header.map((item, i) => ( - // {item.prop === 'name' ? item.name : item.prop === 'powerGeneration' ? item.powerGeneration : item.amount} - {row[item.prop]} + + {typeof row[item.prop] === 'number' ? row[item.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 }) : row[item.prop]} + ))} ))} diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 53607ef5..4c28b481 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -2308,12 +2308,14 @@ export function useModuleBasicSetting() { }) return { ...rowObject, // 총 발전량 = 발전량 * 모듈 개수 + ...surface, name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, // 지붕면 // powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }), wpOut: wpOut, } }) + console.log('🚀 ~ getModuleStatistics ~ rows:', rows) console.log('🚀 ~ getModuleStatistics ~ moduleInfo:', moduleInfo) const header = [ { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'name' }, @@ -2334,15 +2336,7 @@ export function useModuleBasicSetting() { footer.push(footerData[key]) }) footer.push(totalWpout) - // const footer = [ - // '합계', - // ...Object.keys(moduleInfo).map((key) => { - // return { name: moduleInfo[key].name, prop: moduleInfo[key] } - // }), - // totalWpout, - // ] - // const footer = [] - console.log('@@@@@@@@@@', header, rows, footer) + console.log({ header: header, rows, footer: footer }) setModuleStatistics({ header: header, rows, footer: footer }) } diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index b519f063..13767b83 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -51,6 +51,7 @@ export function useModulePlace() { useEffect(() => { //지붕을 가져옴 + console.log('🚀 ~ trestleDetailList.forEach ~ trestleDetailList:', trestleDetailList) canvas .getObjects() .filter((roof) => roof.name === 'roof') diff --git a/src/locales/ja.json b/src/locales/ja.json index 72addabb..3ce7f729 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -281,6 +281,12 @@ "modal.object.setting.direction.select": "方向の選択", "modal.placement.surface.setting.info": "ⓘ ①の長さ入力後に対角線の長さを入力すると、②の長さを自動計算します。", "modal.placement.surface.setting.diagonal.length": "斜めの長さ", + "modal.placement.surface.drawing.straight.line": "직선(JA)", + "modal.placement.surface.drawing.right.angle": "직각(JA)", + "modal.placement.surface.drawing.double.pitch": "이구배(JA)", + "modal.placement.surface.drawing.angle": "각도(JA)", + "modal.placement.surface.drawing.diagonal": "대각선(JA)", + "modal.placement.surface.drawing.fix": "배치면 확정(JA)", "modal.color.picker.title": "色の設定", "modal.color.picker.default.color": "基本色", "modal.size.setting": "サイズ変更", diff --git a/src/locales/ko.json b/src/locales/ko.json index d2113d2e..ecb685c0 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -80,6 +80,7 @@ "modal.placement.surface.drawing.double.pitch": "이구배", "modal.placement.surface.drawing.angle": "각도", "modal.placement.surface.drawing.diagonal": "대각선", + "modal.placement.surface.drawing.fix": "배치면 확정", "plan.menu.placement.surface.arrangement": "면형상 배치", "plan.menu.placement.surface.object": "오브젝트 배치", "plan.menu.placement.surface.all.remove": "배치면 전체 삭제", diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 05a11760..46f62676 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -42,4 +42,5 @@ export const moduleStatisticsState = atom({ rows: [], footer: ['합계', '0'], }, + dangerouslyAllowMutability: true, }) diff --git a/src/util/common-utils.js b/src/util/common-utils.js index b77cf62d..bb875e5b 100644 --- a/src/util/common-utils.js +++ b/src/util/common-utils.js @@ -149,3 +149,7 @@ export const unescapeString = (str) => { return str.replace(regex, (matched) => chars[matched] || matched) } } + +export const isNullOrUndefined = (value) => { + return value === null || value === undefined +} From 673c99a674bdbe89c0bbf8234f7050737fadea5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Tue, 21 Jan 2025 16:33:55 +0900 Subject: [PATCH 066/130] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=9A=8C=EB=A1=9C?= =?UTF-8?q?=ED=95=A0=EB=8B=B9=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index ac0829fc..34eb4acb 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -16,7 +16,7 @@ export default function StepUp(props) { const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수 const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const { models } = props - const { getPcsAutoRecommendList } = useMasterController() + const { getPcsVoltageStepUpList, getPcsAutoRecommendList } = useMasterController() const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const canvas = useRecoilValue(canvasState) const selectedModules = useRecoilValue(selectedModuleState) From 23e681254278a936139583a51eb28ed075d5cef9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 21 Jan 2025 17:14:59 +0900 Subject: [PATCH 067/130] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=EC=8B=9C=20=EB=85=B9=EC=83=89=20=EC=84=A0=20=EC=83=9D?= =?UTF-8?q?=EA=B8=B0=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 61a3f672..1bc2dffa 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -429,7 +429,7 @@ export const usePolygon = () => { const sameDirectionCnt = canvas.getObjects().filter((obj) => { const onlyStrDirection = obj.directionText?.replace(/[0-9]/g, '') - return obj.name === POLYGON_TYPE.ROOF && obj.visible && obj !== polygon && onlyStrDirection === text + return obj.name === POLYGON_TYPE.ROOF && obj !== polygon && onlyStrDirection === text }) text = text + (sameDirectionCnt.length + 1) @@ -860,9 +860,9 @@ export const usePolygon = () => { }) polygonLines.forEach((line) => { - line.set({ strokeWidth: 5, stroke: 'green' }) + /*line.set({ strokeWidth: 5, stroke: 'green' }) canvas.add(line) - canvas.renderAll() + canvas.renderAll()*/ const startPoint = line.startPoint // 시작점 let arrivalPoint = line.endPoint // 도착점 From a0eb6cf3fa49d0eb20238e4eda00ba333f9faef5 Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Tue, 21 Jan 2025 17:16:34 +0900 Subject: [PATCH 068/130] =?UTF-8?q?refactor:=20=EC=BA=94=EB=B2=84=EC=8A=A4?= =?UTF-8?q?=20=EB=8D=B0=EC=9D=B4=ED=84=B0=20render=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=EC=9E=84=EC=8B=9C=20=EC=88=98=EC=A0=95=20(=EC=A0=9C=EA=B1=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasFrame.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index e0c9191f..6722fea8 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -31,7 +31,7 @@ export default function CanvasFrame() { const loadCanvas = () => { if (canvas) { canvas?.clear() // 캔버스를 초기화합니다. - if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo && floorPlanState.pid === selectedPlan.planNo) { + if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo) { canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () { canvasLoadInit() //config된 상태로 캔버스 객체를 그린다 canvas?.renderAll() // 캔버스를 다시 그립니다. From a4f39df52146ffc1c777c0423059c6915de46b45 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 21 Jan 2025 17:39:15 +0900 Subject: [PATCH 069/130] =?UTF-8?q?=EC=9A=B0=ED=8E=B8=EB=B2=88=ED=98=B8,?= =?UTF-8?q?=20=EC=84=A4=EA=B3=84=EC=9D=98=EB=A2=B0=20=ED=8C=9D=EC=97=85=20?= =?UTF-8?q?=EB=8D=94=EB=B8=94=ED=81=B4=EB=A6=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/MainContents.jsx | 41 +++++- src/components/management/Stuff.jsx | 15 ++- src/components/management/StuffDetail.jsx | 56 +++++--- .../management/StuffSearchCondition.jsx | 121 ++++++++++++++---- 4 files changed, 188 insertions(+), 45 deletions(-) diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx index 3c9379d8..b47fe720 100644 --- a/src/components/main/MainContents.jsx +++ b/src/components/main/MainContents.jsx @@ -15,6 +15,7 @@ import { QcastContext } from '@/app/QcastProvider' import { useSwal } from '@/hooks/useSwal' import BoardDetailModal from '../community/modal/BoardDetailModal' +import { handleFileDown } from '@/util/board-utils' export default function MainContents() { const { swalFire } = useSwal() @@ -22,8 +23,7 @@ export default function MainContents() { const { getMessage } = useMessage() const router = useRouter() const globalLocaleState = useRecoilValue(globalLocaleStore) - const { promiseGet } = useAxios(globalLocaleState) - + const { promiseGet, get } = useAxios(globalLocaleState) //공지사항 const [recentNoticeList, setRecentNoticeList] = useState([]) @@ -92,6 +92,33 @@ export default function MainContents() { const [open, setOpen] = useState(false) const [modalNoticeNo, setModalNoticeNo] = useState('') + // 메인 파일 다운로드 + const handleDetailFileListDown = async (noticeNo) => { + //396, 395테스트 + const url = `/api/board/detail` + const params = new URLSearchParams({ + noticeNo: noticeNo, + }) + + const apiUrl = `${url}?${params.toString()}` + + const resultData = await get({ url: apiUrl }) + + if (resultData) { + if (resultData.result.code === 200) { + const boardDetailFileList = resultData.data.listFile + + if (boardDetailFileList && Array.isArray(boardDetailFileList)) { + boardDetailFileList.forEach((boardFile) => { + handleFileDown(boardFile) + }) + } + } else { + swalFire({ type: 'alert', text: resultData.result.message, icon: 'error' }) + } + } + } + return (
@@ -114,7 +141,7 @@ export default function MainContents() { >
{dayjs(row.lastEditDatetime).format('YYYY.MM.DD HH:mm:ss')} - {row.tempFlg === '0' ? row.objectNo : getMessage('stuff.gridData.tempObjectNo')} + {row.tempFlg === '0' ? row.objectNo : getMessage('stuff.gridData.tempObjectNo')} {row.objectName ? row.objectName : '-'} {row.saleStoreName}
@@ -184,7 +211,13 @@ export default function MainContents() {
-
+
{roofMaterial && ['C', 'R'].includes(roofMaterial.raftAuth) && ( <>
{getMessage('modal.module.basic.setting.module.rafter.margin')}
@@ -343,22 +398,21 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
)} +
+
{roofMaterial && ['C', 'R'].includes(roofMaterial.roofPchAuth) && ( <> -
{getMessage('modal.module.basic.setting.module.rafter.margin')}
+
{getMessage('modal.module.basic.setting.module.hajebichi')}
-
-
- 垂木の間隔 -
- -
-
+
+ setHajebichi(e.target.value)} + value={hajebichi} + ref={hajebichiRef} + />
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 305dcda0..af187a0a 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -73,6 +73,7 @@ export function useModuleBasicSetting() { const makeModuleInstArea = () => { //지붕 객체 반환 + const roofs = canvas.getObjects().filter((obj) => obj.name === 'roof') let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : -20 @@ -80,6 +81,50 @@ export function useModuleBasicSetting() { return } + const batchObjects = canvas + ?.getObjects() + .filter( + (obj) => + obj.name === BATCH_TYPE.OPENING || + obj.name === BATCH_TYPE.SHADOW || + obj.name === BATCH_TYPE.TRIANGLE_DORMER || + obj.name === BATCH_TYPE.PENTAGON_DORMER, + ) //도머s 객체 + + //도머도 외곽을 따야한다 + + const batchObjectOptions = { + stroke: 'red', + fill: 'transparent', + strokeDashArray: [10, 4], + strokeWidth: 1, + lockMovementX: true, + lockMovementY: true, + lockRotation: true, + lockScalingX: true, + lockScalingY: true, + selectable: true, + name: POLYGON_TYPE.OBJECT_SURFACE, + originX: 'center', + originY: 'center', + } + + batchObjects.forEach((obj) => { + if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) { + const groupPoints = obj.groupPoints + const offsetObjects = offsetPolygon(groupPoints, 10) + const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions) + dormerOffset.setViewLengthText(false) + canvas.add(dormerOffset) //모듈설치면 만들기 + } else { + const points = obj.points + const offsetObjects = offsetPolygon(points, 10) + const offset = new QPolygon(offsetObjects, batchObjectOptions) + offset.setViewLengthText(false) + canvas.add(offset) //모듈설치면 만들기 + } + }) + roofs.forEach((roof) => { const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id) if (isExistSurface) { @@ -190,15 +235,7 @@ export function useModuleBasicSetting() { } const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴 - const batchObjects = canvas - ?.getObjects() - .filter( - (obj) => - obj.name === BATCH_TYPE.OPENING || - obj.name === BATCH_TYPE.TRIANGLE_DORMER || - obj.name === BATCH_TYPE.PENTAGON_DORMER || - obj.name === BATCH_TYPE.SHADOW, - ) //도머s 객체 + const batchObjects = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.OBJECT_SURFACE) //도머s 객체 const moduleOptions = { fill: checkedModule[0].color, @@ -449,17 +486,7 @@ export function useModuleBasicSetting() { //도머 객체를 가져옴 if (batchObjects) { batchObjects.forEach((object) => { - let dormerTurfPolygon - - if (object.type === 'group') { - //도머는 그룹형태임 - dormerTurfPolygon = batchObjectGroupToTurfPolygon(object) - } else { - //개구, 그림자 - object.set({ points: rectToPolygon(object) }) - dormerTurfPolygon = polygonToTurfPolygon(object) - } - + let dormerTurfPolygon = polygonToTurfPolygon(object, true) const intersection = turf.intersect(turf.featureCollection([dormerTurfPolygon, tempTurfModule])) //겹치는지 확인 //겹치면 안됨 if (intersection) { @@ -1220,6 +1247,7 @@ export function useModuleBasicSetting() { } const coordToTurfPolygon = (points) => { + console.log('points', points) const coordinates = points.map((point) => [point.x, point.y]) coordinates.push(coordinates[0]) return turf.polygon([coordinates]) diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index b519f063..1716c1c2 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -28,7 +28,7 @@ export function useModulePlace() { roofBaseCd: item.trestle.roofBaseCd, constTp: item.construction.constTp, mixMatlNo: selectedModules.mixMatlNo, - roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null, + roofPitch: item.addRoof.roofPchBase ? item.addRoof.roofPchBase : null, inclCd: String(item.addRoof.pitch), roofIndex: item.addRoof.index, workingWidth: item.addRoof.lenBase, diff --git a/src/hooks/module/useModuleSelection.js b/src/hooks/module/useModuleSelection.js index 6bd8ca3b..2cf6e509 100644 --- a/src/hooks/module/useModuleSelection.js +++ b/src/hooks/module/useModuleSelection.js @@ -4,7 +4,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import { useMasterController } from '@/hooks/common/useMasterController' import { useCommonCode } from '@/hooks/common/useCommonCode' -import { selectedModuleState, moduleSelectionInitParamsState } from '@/store/selectedModuleOptions' +import { selectedModuleState, moduleSelectionInitParamsState, moduleSelectionDataState } from '@/store/selectedModuleOptions' export function useModuleSelection(props) { const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) @@ -13,15 +13,14 @@ export function useModuleSelection(props) { const [windSpeedCodes, setWindSpeedCodes] = useState([]) //기준풍속 목록 const [moduleList, setModuleList] = useState([{}]) //모듈 목록 - const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도 const [installHeight, setInstallHeight] = useState() //설치 높이 const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속 const [verticalSnowCover, setVerticalSnowCover] = useState() //수직적설량 + + const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈 const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등 - const { getModuleTypeItemList } = useMasterController() - const { findCommonCode } = useCommonCode() const bindInitData = () => { @@ -73,8 +72,6 @@ export function useModuleSelection(props) { return } - console.log('managementState', managementState) - //새로고침시 데이터 날아가는거 방지 if (managementState === null) { setManagementState(managementStateLoaded) diff --git a/src/hooks/object/useObjectBatch.js b/src/hooks/object/useObjectBatch.js index 27676eab..fb33c8f0 100644 --- a/src/hooks/object/useObjectBatch.js +++ b/src/hooks/object/useObjectBatch.js @@ -169,7 +169,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { } isDown = false - rect.set({ name: objName, parentId: selectedSurface.id }) + rect.set({ name: objName, parentId: selectedSurface.id, points: rectToPolygon(rect) }) rect.setCoords() initEvent() @@ -251,7 +251,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { } isDown = false - rect.set({ name: objName, parentId: selectedSurface.id }) + rect.set({ name: objName, parentId: selectedSurface.id, points: rectToPolygon(rect) }) rect.setCoords() initEvent() if (setIsHidden) setIsHidden(false) @@ -377,9 +377,6 @@ export function useObjectBatch({ isHidden, setIsHidden }) { const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) - console.log('trianglePolygon', trianglePolygon) - console.log('selectedSurfacePolygon', selectedSurfacePolygon) - //지붕 밖으로 그렸을때 if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { swalFire({ text: '도머를 배치할 수 없습니다.', icon: 'error' }) @@ -406,6 +403,8 @@ export function useObjectBatch({ isHidden, setIsHidden }) { direction = 'north' } + const groupPoints = offsetRef > 0 ? triangleToPolygon(dormerOffset) : triangleToPolygon(dormer) + let splitedTriangle = offsetRef > 0 ? splitDormerTriangle(dormerOffset, directionRef) : splitDormerTriangle(dormer, directionRef) canvas?.remove(offsetRef > 0 ? dormerOffset : dormer) @@ -499,6 +498,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { parentId: selectedSurface.id, originX: 'center', originY: 'center', + groupPoints: groupPoints, }) canvas?.add(objectGroup) @@ -708,6 +708,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { } const groupPolygon = offsetPolygon ? [leftPentagon, rightPentagon, offsetPolygon] : [leftPentagon, rightPentagon] + const groupPoints = offsetRef > 0 ? pentagonOffsetPoints : pentagonPoints const objectGroup = new fabric.Group(groupPolygon, { subTargetCheck: true, @@ -717,6 +718,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { groupYn: true, originX: 'center', originY: 'center', + groupPoints: groupPoints, }) canvas?.add(objectGroup) diff --git a/src/locales/ko.json b/src/locales/ko.json index 3cf57205..88f611c2 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -94,6 +94,7 @@ "modal.module.basic.setting.module.construction.method": "공법", "modal.module.basic.setting.module.under.roof": "지붕밑바탕", "modal.module.basic.setting.module.setting": "모듈 선택", + "modal.module.basic.setting.module.hajebichi": "망둥어 피치", "modal.module.basic.setting.module.setting.info1": "※ 구배의 범위에는 제한이 있습니다. 지붕경사가 2.5치 미만, 10치를 초과하는 경우에는 시공이 가능한지 시공 매뉴얼을 확인해주십시오.", "modal.module.basic.setting.module.setting.info2": "※ 모듈 배치 시에는 시공 매뉴얼에 기재된 <모듈 배치 조건>을 반드시 확인해주십시오.", "modal.module.basic.setting.module.stuff.info": "물건정보", diff --git a/src/store/selectedModuleOptions.js b/src/store/selectedModuleOptions.js index faa979fd..c312c694 100644 --- a/src/store/selectedModuleOptions.js +++ b/src/store/selectedModuleOptions.js @@ -81,6 +81,7 @@ export const moduleSelectionDataState = atom({ key: 'moduleSelectionDataState', default: { common: {}, + module: {}, roofConstructions: [], }, dangerouslyAllowMutability: true, From fd904bb21fa29f7d693e83b815d9f90d707ca3dc Mon Sep 17 00:00:00 2001 From: yjnoh Date: Wed, 22 Jan 2025 13:06:15 +0900 Subject: [PATCH 077/130] =?UTF-8?q?=EB=B0=B0=EC=B9=98=20=EC=98=A4=EB=B8=8C?= =?UTF-8?q?=EC=A0=9D=ED=8A=B8=20=EC=98=A4=ED=94=84=EC=85=8B=20=EC=9E=91?= =?UTF-8?q?=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useModuleBasicSetting.js | 24 ++--------------------- src/hooks/object/useObjectBatch.js | 14 ++++++------- src/locales/ko.json | 4 +++- 3 files changed, 12 insertions(+), 30 deletions(-) diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index 72ff90d8..f9b8a7fe 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -547,15 +547,7 @@ export function useModuleBasicSetting() { ?.getObjects() .filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && !moduleSetupSurfaces.includes(obj)) //설치면이 아닌것 - const batchObjects = canvas - ?.getObjects() - .filter( - (obj) => - obj.name === BATCH_TYPE.OPENING || - obj.name === BATCH_TYPE.TRIANGLE_DORMER || - obj.name === BATCH_TYPE.PENTAGON_DORMER || - obj.name === BATCH_TYPE.SHADOW, - ) //도머s 객체 + const batchObjects = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.OBJECT_SURFACE) //도머s 객체 if (moduleSetupSurfaces.length === 0) { swalFire({ text: getMessage('module.place.no.surface') }) @@ -609,18 +601,7 @@ export function useModuleBasicSetting() { const objectsIncludeSurface = (turfModuleSetupSurface) => { let containsBatchObjects = [] containsBatchObjects = batchObjects.filter((batchObject) => { - let convertBatchObject - - if (batchObject.type === 'group') { - //도머는 그룹형태임 - convertBatchObject = batchObjectGroupToTurfPolygon(batchObject) - } else { - //개구, 그림자 - batchObject.set({ points: rectToPolygon(batchObject) }) - canvas?.renderAll() // set된걸 바로 적용하기 위해 - convertBatchObject = polygonToTurfPolygon(batchObject) //rect를 폴리곤으로 변환 -> turf 폴리곤으로 변환 - } - + let convertBatchObject = polygonToTurfPolygon(batchObject) // 폴리곤 안에 도머 폴리곤이 포함되어있는지 확인해서 반환하는 로직 return turf.booleanContains(turfModuleSetupSurface, convertBatchObject) || turf.booleanWithin(convertBatchObject, turfModuleSetupSurface) }) @@ -1248,7 +1229,6 @@ export function useModuleBasicSetting() { } const coordToTurfPolygon = (points) => { - console.log('points', points) const coordinates = points.map((point) => [point.x, point.y]) coordinates.push(coordinates[0]) return turf.polygon([coordinates]) diff --git a/src/hooks/object/useObjectBatch.js b/src/hooks/object/useObjectBatch.js index fb33c8f0..b7c5d248 100644 --- a/src/hooks/object/useObjectBatch.js +++ b/src/hooks/object/useObjectBatch.js @@ -93,7 +93,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { }) if (!selectedSurface) { - swalFire({ text: '지붕안에 그려야해요', icon: 'error' }) + swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' }) initEvent() //이벤트 초기화 if (setIsHidden) setIsHidden(false) return @@ -150,7 +150,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { //지붕 밖으로 그렸을때 if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) { - swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) + swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' }) //일단 지워 deleteTempObjects() return @@ -162,7 +162,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon)) if (isCross) { - swalFire({ text: '겹치기 불가요...', icon: 'error' }) + swalFire({ text: getMessage('batch.object.notinstall.cross'), icon: 'error' }) deleteTempObjects() return } @@ -232,7 +232,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { //지붕 밖으로 그렸을때 if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) { - swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) + swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' }) //일단 지워 deleteTempObjects() return @@ -244,7 +244,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon)) if (isCross) { - swalFire({ text: '겹치기 불가요...', icon: 'error' }) + swalFire({ text: getMessage('batch.object.notinstall.cross'), icon: 'error' }) deleteTempObjects() return } @@ -379,7 +379,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { //지붕 밖으로 그렸을때 if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { - swalFire({ text: '도머를 배치할 수 없습니다.', icon: 'error' }) + swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' }) //일단 지워 deleteTempObjects() return @@ -604,7 +604,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) { //지붕 밖으로 그렸을때 if (!turf.booleanWithin(pentagonPolygon, selectedSurfacePolygon)) { - swalFire({ text: '도머를 배치할 수 없습니다.', icon: 'error' }) + swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' }) //일단 지워 deleteTempObjects() return diff --git a/src/locales/ko.json b/src/locales/ko.json index c5c45576..d02746ea 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -995,5 +995,7 @@ "batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?", "module.not.found": "설치 모듈을 선택하세요.", "construction.length.difference": "지붕면 공법을 전부 선택해주세요.", - "menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다." + "menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다.", + "batch.object.outside.roof": "오브젝트는 지붕내에 설치해야 합니다.", + "batch.object.notinstall.cross": "오브젝트는 겹쳐서 설치 할 수 없습니다." } From 17954098cf6105a0dfebcb4df3c474863e7e6b85 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 22 Jan 2025 14:21:35 +0900 Subject: [PATCH 078/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20fetch=20parameter=20?= =?UTF-8?q?=EA=B0=80=EC=A0=B8=EC=98=A4=EB=8A=94=20=EB=B0=A9=EB=B2=95=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/floor-plan/FloorPlanProvider.js | 7 ++++--- src/hooks/option/useCanvasSetting.js | 10 +++++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index cb47d702..d46a4038 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -43,18 +43,19 @@ export const FloorPlanContext = createContext({ const FloorPlanProvider = ({ children }) => { const pathname = usePathname() - const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) + const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) const searchParams = useSearchParams() const objectNo = searchParams.get('objectNo') const pid = searchParams.get('pid') useEffect(() => { + console.log('🚀 ~ useEffect ~ objectNo:') if (pathname === '/floor-plan') { if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { notFound() } - setCurrentObjectNo(objectNo) + setCorrentObjectNo(objectNo) } - }, [pathname]) + }, []) //useEffect(() => { // 오류 발생으로 useEffect 사용 // if (pathname === '/floor-plan') { diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 080c78c4..74a3bfc5 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -1,4 +1,4 @@ -import { useEffect, useState, useRef } from 'react' +import { useEffect, useState, useRef, useContext } from 'react' import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil' import { adsorptionPointModeState, @@ -35,6 +35,7 @@ import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementSha import { useCanvasMenu } from '../common/useCanvasMenu' import { menuTypeState } from '@/store/menuAtom' import { usePopup } from '../usePopup' +import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider' const defaultDotLineGridSetting = { INTERVAL: { @@ -122,6 +123,8 @@ export function useCanvasSetting() { const selectedRoofMaterial = useRecoilValue(selectedRoofMaterialSelector) + const { floorPlanState } = useContext(FloorPlanContext) + const { closeAll } = usePopup() useEffect(() => { @@ -300,7 +303,8 @@ export function useCanvasSetting() { // 기본설정(PlacementShapeSetting) 조회 및 초기화 const fetchBasicSettings = async () => { try { - await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}` }).then((res) => { + console.log('🚀 ~ fetchBasicSettings ~ floorPlanState:', floorPlanState) + await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${floorPlanState.objectNo}` }).then((res) => { console.log('🚀 ~ fetchBasicSettings ~ res >>>>>>>>>> :', res) let roofsRow = {} @@ -454,7 +458,7 @@ export function useCanvasSetting() { // CanvasSetting 조회 및 초기화 const fetchSettings = async () => { try { - const res = await get({ url: `/api/canvas-management/canvas-settings/by-object/${correntObjectNo}` }) + const res = await get({ url: `/api/canvas-management/canvas-settings/by-object/${floorPlanState.objectNo}` }) console.log('res', res) if (Object.keys(res).length > 0) { From 87fba297174a1bcf0f4f96228cd09efe1cd5a96e Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 22 Jan 2025 14:22:20 +0900 Subject: [PATCH 079/130] =?UTF-8?q?=F0=9F=93=8Cchore:=20remove=20log?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/option/useCanvasSetting.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 74a3bfc5..056f3c64 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -173,7 +173,6 @@ export function useCanvasSetting() { const previousRoofMaterialsRef = useRef(null) useEffect(() => { - //console.log('🚀 ~ useEffect ~ roofMaterials 22 :', previousRoofMaterialsYn, roofMaterials.length , JSON.stringify(previousRoofMaterialsRef.current) !== JSON.stringify(roofMaterials)) // 지붕재 select 정보가 존재해야 배치면초기설정 DB 정보 비교 후 지붕재 정보를 가져올 수 있음 if ( (!previousObjectNoRef.current && !correntObjectNo && previousObjectNoRef.current !== correntObjectNo) || @@ -225,7 +224,6 @@ export function useCanvasSetting() { }, [corridorDimension]) useEffect(() => { - console.log('🚀 ~ useEffect ~ settingsDataSave:', settingsDataSave) if (settingsDataSave !== undefined) onClickOption2() }, [settingsData]) @@ -303,10 +301,7 @@ export function useCanvasSetting() { // 기본설정(PlacementShapeSetting) 조회 및 초기화 const fetchBasicSettings = async () => { try { - console.log('🚀 ~ fetchBasicSettings ~ floorPlanState:', floorPlanState) await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${floorPlanState.objectNo}` }).then((res) => { - console.log('🚀 ~ fetchBasicSettings ~ res >>>>>>>>>> :', res) - let roofsRow = {} let roofsArray = {} @@ -377,7 +372,6 @@ export function useCanvasSetting() { } }) } - console.log('🚀 ~ fetchBasicSettings ~ addRoofs:', addRoofs) setAddedRoofs(addRoofs) setBasicSettings({ ...basicSetting, From a08df8a32e6126eca6b9cdce91fb6e1199e5f5ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Wed, 22 Jan 2025 15:11:52 +0900 Subject: [PATCH 080/130] =?UTF-8?q?=EC=9E=90=EB=8F=99=20=ED=9A=8C=EB=A1=9C?= =?UTF-8?q?=ED=95=A0=EB=8B=B9=20=EA=B0=9C=EB=B0=9C=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 84 +++++++- .../step/PowerConditionalSelect.jsx | 179 +++++++++--------- src/hooks/common/useMasterController.js | 3 +- src/store/circuitTrestleAtom.js | 10 +- 4 files changed, 166 insertions(+), 110 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 2901f952..fc0be1f6 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -11,12 +11,13 @@ import { correntObjectNoState } from '@/store/settingAtom' import { useRecoilValue } from 'recoil' import { GlobalDataContext } from '@/app/GlobalDataProvider' import { useRecoilState } from 'recoil' -import { makersState, modelsState, modelState, pcsCheckState, selectedMakerState, seriesState } from '@/store/circuitTrestleAtom' +import { makersState, modelsState, modelState, pcsCheckState, selectedMakerState, selectedModelsState, seriesState } from '@/store/circuitTrestleAtom' import { POLYGON_TYPE } from '@/common/common' import { useSwal } from '@/hooks/useSwal' import { canvasState } from '@/store/canvasAtom' import { useTrestle } from '@/hooks/module/useTrestle' +import { selectedModuleState } from '@/store/selectedModuleOptions' const ALLOCATION_TYPE = { AUTO: 'auto', @@ -33,12 +34,15 @@ export default function CircuitTrestleSetting({ id }) { const [selectedMaker, setSelectedMaker] = useRecoilState(selectedMakerState) const [series, setSeries] = useRecoilState(seriesState) const [models, setModels] = useRecoilState(modelsState) + const [selectedModels, setSelectedModels] = useRecoilState(selectedModelsState) const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const [tabNum, setTabNum] = useState(1) const [allocationType, setAllocationType] = useState(ALLOCATION_TYPE.AUTO) const [circuitAllocationType, setCircuitAllocationType] = useState(1) - + const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) + const selectedModules = useRecoilValue(selectedModuleState) + const { getPcsAutoRecommendList } = useMasterController() const powerConditionalSelectProps = { tabNum, setTabNum, @@ -50,6 +54,9 @@ export default function CircuitTrestleSetting({ id }) { setSeries, models, setModels, + selectedModels, + setSelectedModels, + managementState, } const passivityProps = { @@ -67,19 +74,78 @@ export default function CircuitTrestleSetting({ id }) { setCircuitAllocationType, } + useEffect(() => { + if (!managementState) { + setManagementState(managementStateLoaded) + } + }, []) + + const onAutoRecommend = () => { + if (series.filter((s) => s.selected).length === 0) { + swalFire({ + title: '시리즈를 선택해 주세요.', + type: 'alert', + }) + return + } + const roofSurfaceList = canvas + .getObjects() + .filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) + .map((obj) => { + return { + roofSurfaceId: obj.id, + roofSurface: canvas + .getObjects() + .filter((o) => o.id === obj.parentId)[0] + .directionText.replace(/[0-9]/g, ''), + roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch, + moduleList: obj.modules.map((module) => { + return { + itemId: module.moduleInfo.itemId, + } + }), + } + }) + + const params = { + maxConnYn: pcsCheck.max ? 'Y' : 'N', + smpCirYn: pcsCheck.division ? 'Y' : 'N', + coldZoneYn: managementState?.coldRegionFlg === '1' ? 'Y' : 'N', + useModuleItemList: selectedModules.itemList.map((m) => { + return { + itemId: m.itemId, + mixMatlNo: m.mixMatlNo, + } + }), + roofSurfaceList: roofSurfaceList, + pcsItemList: models.map((model) => { + return { + itemId: model.itemId, + pcsMkrCd: model.pcsMkrCd, + pcsSerCd: model.pcsSerCd, + } + }), + } + getPcsAutoRecommendList(params).then((res) => { + if (res.data?.pcsItemList) { + setModels(res.data.pcsItemList) + setTabNum(2) + } else { + swalFire({ + title: '파워컨디셔너를 추가해 주세요.', + type: 'alert', + }) + } + }) + } + const onAutoAllocation = () => { let moduleStdQty = 0 let moduleMaxQty = 0 const selectedModels = models.filter((m) => m.selected) if (selectedModels.length === 0) { - moduleStdQty = models.reduce((acc, model) => { - return acc + parseInt(model.moduleStdQty) - }, 0) - - moduleMaxQty = models.reduce((acc, model) => { - return acc + parseInt(model.moduleMaxQty) - }, 0) + onAutoRecommend() } else { moduleStdQty = selectedModels.reduce((acc, model) => { return acc + parseInt(model.moduleStdQty) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx index bc67679d..bf362856 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx @@ -13,9 +13,23 @@ import { useRecoilValue } from 'recoil' import { v4 as uuidv4 } from 'uuid' export default function PowerConditionalSelect(props) { - let { tabNum, setTabNum, makers, setMakers, selectedMaker, setSelectedMaker, series, setSeries, models, setModels } = props + let { + tabNum, + setTabNum, + makers, + setMakers, + selectedMaker, + setSelectedMaker, + series, + setSeries, + models, + setModels, + selectedModels, + setSelectedModels, + managementState, + } = props const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) - const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) + const { getMessage } = useMessage() const [selectedRow, setSelectedRow] = useState(null) const globalLocale = useRecoilValue(globalLocaleStore) @@ -47,54 +61,49 @@ export default function PowerConditionalSelect(props) { ] useEffect(() => { - console.log('series', series) - console.log('models', models) if (makers.length === 0) { getPcsMakerList().then((res) => { setMakers(res.data) }) } - console.log('🚀 ~ useEffect ~ selectedModules:', selectedModules) - if (!managementState) { - setManagementState(managementStateLoaded) - } - // promiseGet({ url: `/api/object/${correntObjectNo}/detail` }).then((res) => { - // console.log('🚀 ~ useEffect ~ /api/object/${correntObjectNo}/detail:', res) - // // coldRegionFlg-한랭지사양, conType// 계약조건(잉여~,전량) - // }) - // return () => { - // console.log('🚀 ~ useEffect ~ PowerConditionalSelect unmount:', makers, selectedMaker) - // setMakerData({ makers, selectedMaker }) - // setSeries({ series: seriesList, selectedSeries }) - // setModels({ models, selectedModels }) - // } }, []) - useEffect(() => { - console.log('🚀 ~ PowerConditionalSelect ~ selectedMaker:', selectedMaker) - if (selectedMaker) { - setModels(null) - if (series.length === 0) - getPcsMakerList(selectedMaker).then((res) => { - setSeries( - res.data.map((series) => { - // return { ...series, selected: isNullOrUndefined(series.selected) ? false : series.selected } - return { ...series, selected: false } - }), - ) - }) - } - }, [selectedMaker]) - - useEffect(() => { - console.log('🚀 ~ useEffect ~ series:', series) - if (series.filter((s) => s.selected).length === 0) return - const pcsMkrCd = series.filter((s) => s.selected)[0]?.pcsMkrCd - const pcsSerList = series - .filter((series) => series.selected) - .map((series) => { - return { pcsSerCd: series.pcsSerCd } + const checkValidation = () => { + const checkedSeries = series.filter((s) => s.selected) + if (checkedSeries.length === 0) { + swalFire({ + title: 'PCS 시리즈를 선택해 주세요.', + icon: 'warning', }) + return false + } else if (checkedSeries.length === 1) { + if (checkedSeries[0].pcsMkrMultiType === 'SINGLE-P' && checkedSeries[0].pcsSerParallelYn === 'Y') { + swalFire({ + title: '병설은 단독으로 안 됨', + icon: 'warning', + }) + } + return false + } + return true + } + + const onCheckSeries = (data) => { + const copySeries = series.map((s) => { + return { + ...s, + selected: s.pcsSerCd === data.pcsSerCd ? !s.selected : s.selected, + } + }) + setSeries(copySeries) + handleSetmodels(copySeries.filter((s) => s.selected)) + } + + const handleSetmodels = (series) => { + const pcsMkrCd = series[0]?.pcsMkrCd + const pcsSerList = series.map((series) => { + return { pcsSerCd: series.pcsSerCd } + }) const moduleItemList = selectedModules.itemList?.map((module) => { return { itemId: module.itemId, @@ -103,7 +112,6 @@ export default function PowerConditionalSelect(props) { }) getPcsModelList({ pcsMkrCd, pcsSerList, moduleItemList }).then((res) => { if (res?.result.code === 200 && res?.data) { - console.log('🚀 ~ useEffect ~ res:', res.data) setModels( res.data.map((model) => { return { @@ -111,21 +119,20 @@ export default function PowerConditionalSelect(props) { moduleStdQty: parseInt(model.moduleStdQty), moduleMaxQty: parseInt(model.moduleMaxQty), code: uuidv4(), - selected: false, } }), ) + return } - }) - }, [series]) - const onCheckSeries = (series) => { - setSeries((prev) => prev.map((s) => ({ ...s, selected: s.pcsSerCd === series.pcsSerCd ? !s.selected : s.selected }))) + setModels([]) + setSelectedModels([]) + }) } const onAddSelectedModel = () => { if (selectedRow === null) return - if (models.filter((m) => m.selected).length === 3) { + if (selectedModels.length === 3) { swalFire({ title: '최대 3개까지 선택할 수 있습니다.', icon: 'warning', @@ -133,41 +140,29 @@ export default function PowerConditionalSelect(props) { return } - setModels( - models.map((model) => { - if (model.code === selectedRow.code) { - return { - ...model, - selected: true, - } - } - return { - ...model, - } - }), - ) + setSelectedModels([...selectedModels, selectedRow]) setSelectedRow(null) } const onRemoveSelectedModel = (model) => { - // setSelectedModels(selectedModels.filter((m) => m.code !== model.code)) setModels(models.map((m) => ({ ...m, selected: m.code !== model.code ? m.selected : false }))) } - // useEffect(() => { - // console.log('🚀 ~ useEffect ~ selectedModels:', selectedModels) - // const selectedModelsIds = selectedModels.map((model) => model.code) + const onChangeMaker = (option) => { + if (option) { + setModels(null) + setSelectedMaker(option) + + getPcsMakerList(option).then((res) => { + setSeries( + res.data.map((series) => { + return { ...series, selected: false } + }), + ) + }) + } + } - // setModels( - // models.map((model) => { - // return { - // ...model, - // selected: selectedModelsIds.includes(model.code), - // } - // }), - // ) - // setModel({ ...model, selectedModels: selectedModels }) - // }, [selectedModels]) return ( <>
@@ -182,7 +177,7 @@ export default function PowerConditionalSelect(props) { sourceKey="pcsMkrCd" targetKey="pcsMkrCd" value={selectedMaker} - onChange={(option) => setSelectedMaker(option)} + onChange={(option) => onChangeMaker(option)} />
{managementState?.coldRegionFlg === '1' && ( @@ -194,7 +189,7 @@ export default function PowerConditionalSelect(props) {
{series?.map((series, index) => (
- onCheckSeries(series)} checked={series.selected} /> + onCheckSeries(series)} checked={series.selected} />
))} @@ -216,15 +211,13 @@ export default function PowerConditionalSelect(props) { - {models - ?.filter((model) => !model.selected) - .map((model, index) => ( - setSelectedRow(model)} className={model === selectedRow ? 'on' : ''}> - {modelHeader.map((header) => ( - {model[header.prop]} - ))} - - ))} + {models?.map((model, index) => ( + setSelectedRow(model)} className={model === selectedRow ? 'on' : ''}> + {modelHeader.map((header) => ( + {model[header.prop]} + ))} + + ))}
@@ -235,13 +228,11 @@ export default function PowerConditionalSelect(props) {
- {models - ?.filter((m) => m.selected) - ?.map((model) => ( - - {model.itemNm} - - ))} + {selectedModels?.map((model) => ( + + {model.itemNm} + + ))}
diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index 013c7870..b289baf4 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -162,8 +162,7 @@ export function useMasterController() { * @returns */ const getPcsAutoRecommendList = async (params = null) => { - const paramString = getQueryString(params) - return await post({ url: '/api/master/pcsAutoRecommendList', data: params }).then((res) => { + return await post({ url: '/api/v1/master/getPcsAutoRecommendList', data: params }).then((res) => { console.log('🚀🚀 ~ getPcsAutoRecommendList ~ res:', res) return res }) diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js index 46f62676..ad77c778 100644 --- a/src/store/circuitTrestleAtom.js +++ b/src/store/circuitTrestleAtom.js @@ -17,16 +17,16 @@ export const seriesState = atom({ default: [], }) -export const selectedSeriesState = atom({ - key: 'selectedSeriesState', - default: null, -}) - export const modelsState = atom({ key: 'modelState', default: [], }) +export const selectedModelsState = atom({ + key: 'selectedModelsState', + default: [], +}) + export const pcsCheckState = atom({ key: 'divisionCircuitState', default: { division: true, max: false }, From dd45849c75dfd6e777d4db1d46b2d22eee2d6a0a Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 22 Jan 2025 15:49:21 +0900 Subject: [PATCH 081/130] =?UTF-8?q?=F0=9F=93=8Cchore:=20setCorrentObjectNo?= =?UTF-8?q?=20=EC=9C=84=EC=B9=98=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/GlobalDataProvider.js | 17 ++++++++++++++++ src/app/floor-plan/FloorPlanProvider.js | 26 ++++++++++++------------- 2 files changed, 30 insertions(+), 13 deletions(-) diff --git a/src/app/GlobalDataProvider.js b/src/app/GlobalDataProvider.js index f7cce530..c4441d2c 100644 --- a/src/app/GlobalDataProvider.js +++ b/src/app/GlobalDataProvider.js @@ -1,6 +1,9 @@ 'use client' +import { correntObjectNoState } from '@/store/settingAtom' +import { usePathname, useSearchParams } from 'next/navigation' import { createContext, useEffect, useState } from 'react' +import { useSetRecoilState } from 'recoil' import { useLocalStorage } from 'usehooks-ts' // export const GlobalDataContext = createContext({ @@ -15,6 +18,20 @@ const GlobalDataProvider = ({ children }) => { // TODO: 임시 조치이며 개발 완료시 삭제 예정 -> 잊지말기... const [managementStateLoaded, setManagementStateLoaded] = useLocalStorage('managementStateLoaded', null) + const pathname = usePathname() + const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) + const searchParams = useSearchParams() + const objectNo = searchParams.get('objectNo') + const pid = searchParams.get('pid') + useEffect(() => { + if (pathname === '/floor-plan') { + if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + notFound() + } + setCorrentObjectNo(objectNo) + } + }, []) + useEffect(() => { if (managementState !== null) { setManagementStateLoaded(managementState) diff --git a/src/app/floor-plan/FloorPlanProvider.js b/src/app/floor-plan/FloorPlanProvider.js index d46a4038..5019e8a4 100644 --- a/src/app/floor-plan/FloorPlanProvider.js +++ b/src/app/floor-plan/FloorPlanProvider.js @@ -1,9 +1,9 @@ 'ues client' -import { correntObjectNoState } from '@/store/settingAtom' +// import { correntObjectNoState } from '@/store/settingAtom' import { notFound, usePathname, useSearchParams } from 'next/navigation' import { createContext, useReducer, useState, useEffect } from 'react' -import { useSetRecoilState } from 'recoil' +// import { useSetRecoilState } from 'recoil' const reducer = (prevState, nextState) => { return { ...prevState, ...nextState } @@ -42,20 +42,20 @@ export const FloorPlanContext = createContext({ }) const FloorPlanProvider = ({ children }) => { - const pathname = usePathname() - const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) + // const pathname = usePathname() + // const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) const searchParams = useSearchParams() const objectNo = searchParams.get('objectNo') const pid = searchParams.get('pid') - useEffect(() => { - console.log('🚀 ~ useEffect ~ objectNo:') - if (pathname === '/floor-plan') { - if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { - notFound() - } - setCorrentObjectNo(objectNo) - } - }, []) + // useEffect(() => { + // console.log('🚀 ~ useEffect ~ objectNo:') + // if (pathname === '/floor-plan') { + // if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + // notFound() + // } + // setCorrentObjectNo(objectNo) + // } + // }, []) //useEffect(() => { // 오류 발생으로 useEffect 사용 // if (pathname === '/floor-plan') { From ebfa44ee6b75ed7f7a5a6d839ac774196dca9cce Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 22 Jan 2025 16:21:27 +0900 Subject: [PATCH 082/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20floorPlan=20?= =?UTF-8?q?=EB=A6=AC=ED=8C=A9=ED=86=A0=EB=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/GlobalDataProvider.js | 29 +++++++------- src/components/floor-plan/FloorPlan.jsx | 51 +++++++++++++------------ src/hooks/option/useCanvasSetting.js | 4 +- 3 files changed, 41 insertions(+), 43 deletions(-) diff --git a/src/app/GlobalDataProvider.js b/src/app/GlobalDataProvider.js index c4441d2c..4f6eabca 100644 --- a/src/app/GlobalDataProvider.js +++ b/src/app/GlobalDataProvider.js @@ -1,9 +1,6 @@ 'use client' -import { correntObjectNoState } from '@/store/settingAtom' -import { usePathname, useSearchParams } from 'next/navigation' import { createContext, useEffect, useState } from 'react' -import { useSetRecoilState } from 'recoil' import { useLocalStorage } from 'usehooks-ts' // export const GlobalDataContext = createContext({ @@ -18,19 +15,19 @@ const GlobalDataProvider = ({ children }) => { // TODO: 임시 조치이며 개발 완료시 삭제 예정 -> 잊지말기... const [managementStateLoaded, setManagementStateLoaded] = useLocalStorage('managementStateLoaded', null) - const pathname = usePathname() - const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) - const searchParams = useSearchParams() - const objectNo = searchParams.get('objectNo') - const pid = searchParams.get('pid') - useEffect(() => { - if (pathname === '/floor-plan') { - if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { - notFound() - } - setCorrentObjectNo(objectNo) - } - }, []) + // const pathname = usePathname() + // const setCorrentObjectNo = useSetRecoilState(correntObjectNoState) + // const searchParams = useSearchParams() + // const objectNo = searchParams.get('objectNo') + // const pid = searchParams.get('pid') + // useEffect(() => { + // if (pathname === '/floor-plan') { + // if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { + // notFound() + // } + // setCorrentObjectNo(objectNo) + // } + // }, [pathname]) useEffect(() => { if (managementState !== null) { diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index 8cd320f0..0c1e0ba6 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -7,44 +7,45 @@ import { useCanvasSetting } from '@/hooks/option/useCanvasSetting' import { usePopup } from '@/hooks/usePopup' import '@/styles/contents.scss' import { notFound, usePathname, useSearchParams } from 'next/navigation' -import { useSetRecoilState } from 'recoil' +import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { correntObjectNoState } from '@/store/settingAtom' export default function FloorPlan({ children }) { - // const pathname = usePathname() - // const setCurrentObjectNo = useSetRecoilState(correntObjectNoState) - // const searchParams = useSearchParams() - // const objectNo = searchParams.get('objectNo') - // const pid = searchParams.get('pid') - // useEffect(() => { - // if (pathname === '/floor-plan') { - // if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) { - // notFound() - // } - // setCurrentObjectNo(objectNo) - // } - // }, [pathname]) + const [correntObjectNo, setCurrentObjectNo] = useRecoilState(correntObjectNoState) + const searchParams = useSearchParams() + const objectNo = searchParams.get('objectNo') + const pid = searchParams.get('pid') const { closeAll } = usePopup() const { menuNumber, setMenuNumber } = useCanvasMenu() const { fetchSettings, fetchBasicSettings } = useCanvasSetting() + // URL 파라미터에서 objectNo 설정 + useEffect(() => { + if (!objectNo) { + notFound() + } + setCurrentObjectNo(objectNo) + }, [objectNo, setCurrentObjectNo]) + + // 설정 데이터 fetch + useEffect(() => { + if (!correntObjectNo) return // correntObjectNo가 없으면 실행하지 않음 + + setMenuNumber(1) + fetchSettings() + fetchBasicSettings() + + return () => { + closeAll() + } + }, [correntObjectNo]) + const modalProps = { menuNumber, setMenuNumber, } - useEffect(() => { - ///setCorrentObjectNo(floorPlanState.objectNo) - //console.log('FloorPlan objectNo ', floorPlanState.objectNo, correntObjectNo) - setMenuNumber(1) - fetchSettings() // Canvas 설정 정보 조회 - fetchBasicSettings() // 기본 설정 정보 조회 - return () => { - closeAll() - } - }, []) - return ( <>
diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index 056f3c64..b91d8991 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -301,7 +301,7 @@ export function useCanvasSetting() { // 기본설정(PlacementShapeSetting) 조회 및 초기화 const fetchBasicSettings = async () => { try { - await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${floorPlanState.objectNo}` }).then((res) => { + await get({ url: `/api/canvas-management/canvas-basic-settings/by-object/${correntObjectNo}` }).then((res) => { let roofsRow = {} let roofsArray = {} @@ -452,7 +452,7 @@ export function useCanvasSetting() { // CanvasSetting 조회 및 초기화 const fetchSettings = async () => { try { - const res = await get({ url: `/api/canvas-management/canvas-settings/by-object/${floorPlanState.objectNo}` }) + const res = await get({ url: `/api/canvas-management/canvas-settings/by-object/${correntObjectNo}` }) console.log('res', res) if (Object.keys(res).length > 0) { From 3d8af5ecf8b9dee4b43edbfd5f304ab83f476ed9 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Wed, 22 Jan 2025 17:03:14 +0900 Subject: [PATCH 083/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20=EB=82=98=EA=B0=80?= =?UTF-8?q?=EA=B8=B0=20=EB=B2=84=ED=8A=BC=20=EA=B4=80=EB=A0=A8=20=EC=9D=BC?= =?UTF-8?q?=EB=B3=B8=EC=96=B4=20=EB=B2=88=EC=97=AD=EB=B3=B8=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/locales/ja.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/locales/ja.json b/src/locales/ja.json index 62454519..42509426 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -311,9 +311,9 @@ "plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?", "plan.message.save": "저장되었습니다.", "plan.message.delete": "삭제되었습니다.", - "plan.message.leave": "물건현황(목록)으로 이동하시겠습니까? [예]를 선택한 경우, 저장하고 이동합니다.", - "plan.message.confirm.yes": "예", - "plan.message.confirm.no": "아니오", + "plan.message.leave": "物件状況(リスト)に移動しますか? [はい]を選択した場合は、保存して移動します。", + "plan.message.confirm.yes": "はい", + "plan.message.confirm.no": "いいえ", "setting": "設定", "delete": "삭제(JA)", "delete.all": "전체 삭제(JA)", From d16929e6fa3449fb83fb57641b620082b9f0a477 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Wed, 22 Jan 2025 17:37:17 +0900 Subject: [PATCH 084/130] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=EC=84=A4=EC=A0=95=20=EC=98=A4=EB=A5=98=20correntObjec?= =?UTF-8?q?tNo=20=EC=88=98=EC=A0=95=20=EB=B0=8F=20=ED=9A=8C=EB=A1=9C?= =?UTF-8?q?=EB=B0=8F=EA=B0=80=EB=8C=80=EC=84=A4=EC=A0=95(=EC=8A=B9?= =?UTF-8?q?=EC=95=95=EC=84=A4=EC=A0=95)=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../modal/circuitTrestle/step/StepUp.jsx | 36 +++++++++++++------ src/hooks/option/useCanvasSetting.js | 6 ++-- 2 files changed, 30 insertions(+), 12 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index d1b3d3dd..19a701dc 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -13,6 +13,7 @@ import { useMasterController } from '@/hooks/common/useMasterController' export default function StepUp(props) { const { getMessage } = useMessage() const [moduleTab, setModuleTab] = useState(1) + const [moduleTabs, setModuleTabs] = useState({}) const [arrayLength, setArrayLength] = useState(3) //module-table-inner의 반복 개수 const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState) const { models } = props @@ -104,15 +105,24 @@ export default function StepUp(props) { })) console.log('🚀 ~ useEffect ~ getPcsVoltageStepUpList ~ stepUpListData:', stepUpListData) setStepUpListData(stepUpListData) + + setOptCodes(res.data.optionList.map((opt) => ({ ...opt, code: opt.pcsOptCd, name: opt.pcsOptNm, nameJp: opt.pcsOptNmJp }))) } }) - - //setOptCodes(stepUpListData.optionList.map((opt) => ({ ...opt, code: opt.pcsOptCd, name: opt.pcsOptNm, nameJp: opt.pcsOptNmJp }))) }, []) useCanvasPopupStatusController(6) const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore) if (Object.keys(canvasPopupStatusState[6]).length !== 0) { + console.log('🚀 ~ useEffect ~ canvasPopupStatusState :', canvasPopupStatusState) + } + + // 각 모듈의 탭을 변경하는 함수 + const handleTabChange = (stepUpId, idx, tabNumber) => { + setModuleTabs((prev) => ({ + ...prev, + [`${stepUpId}_${idx}`]: tabNumber, + })) } return ( @@ -122,7 +132,7 @@ export default function StepUp(props) { {/* 3개일때 className = by-max */} {stepUpListData.map((stepUp, index) => (
- {Array.from({ length: stepUp.pcsItemList.length }).map((_, idx) => ( + {stepUp?.pcsItemList.map((_, idx) => (
{stepUp.pcsItemList[idx].goodsNo}
@@ -134,7 +144,7 @@ export default function StepUp(props) { {getMessage('modal.circuit.trestle.setting.step.up.allocation.total.amount')} - + {stepUp.pcsItemList[idx].serQtyList.map((item) => { return ( @@ -148,15 +158,21 @@ export default function StepUp(props) {
- -
- {moduleTab === 1 && ( + {(moduleTabs[`${stepUp.id}_${idx}`] || 1) === 1 && (
@@ -178,7 +194,7 @@ export default function StepUp(props) { )} - {moduleTab === 2 && ( + {(moduleTabs[`${stepUp.id}_${idx}`] || 1) === 2 && (
@@ -211,8 +227,8 @@ export default function StepUp(props) { {optCodes.length > 0 && (
- - {/* */} + {/* */} +
)} diff --git a/src/hooks/option/useCanvasSetting.js b/src/hooks/option/useCanvasSetting.js index b91d8991..29287689 100644 --- a/src/hooks/option/useCanvasSetting.js +++ b/src/hooks/option/useCanvasSetting.js @@ -180,8 +180,10 @@ export function useCanvasSetting() { ) { // 1회만 실행 if (roofMaterials && previousRoofMaterialsYn === 'N') { - fetchBasicSettings() - previousRoofMaterialsYn = 'Y' + if (correntObjectNo) { + fetchBasicSettings() + previousRoofMaterialsYn = 'Y' + } } // 이전 값을 업데이트 From 70477b12f1f9e26e9ce5c4aeebb71e6214494298 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 22 Jan 2025 19:00:44 +0900 Subject: [PATCH 085/130] =?UTF-8?q?=EC=83=81=EC=84=B8=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=AC=B8=EA=B5=AC=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index eee1a91e..57aac290 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -1405,6 +1405,7 @@ export default function StuffDetail() { .then((res) => { setIsGlobalLoading(true) + // console.log('수정했어!!', managementState) if (res.status === 201) { setIsGlobalLoading(false) setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo }) @@ -1412,6 +1413,7 @@ export default function StuffDetail() { text: getMessage('stuff.detail.save'), type: 'alert', confirmFn: () => { + // setManagementState({ ...managementState, params }) router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false }) }, }) @@ -2484,7 +2486,6 @@ export default function StuffDetail() {
- 상세 - {headers.map((header) => ( - + {headers.map((header, index) => ( + ))} {rows.map((row, index) => ( - {headers.map((header) => ( - + {headers.map((header, i) => ( + ))} ))} - {footer.map((footer) => ( - + {footer.map((footer, index) => ( + ))} @@ -157,27 +223,25 @@ export default function PassivityCircuitAllocation(props) {
{getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional')}
- {models - .filter((model) => model.selected) - .map((model, index) => ( -
- setSelectedPcs(model)} - /> - -
- ))} + {selectedModels.map((model, index) => ( +
+ setSelectedPcs(model)} + /> + +
+ ))} {/*
@@ -201,9 +265,18 @@ export default function PassivityCircuitAllocation(props) { {getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit.num')}
- + setCircuitNumber(e.target.value)} + />
- +
diff --git a/src/hooks/useCanvasEvent.js b/src/hooks/useCanvasEvent.js index 7ea3e03c..9076bbc8 100644 --- a/src/hooks/useCanvasEvent.js +++ b/src/hooks/useCanvasEvent.js @@ -198,7 +198,7 @@ export function useCanvasEvent() { if (selected?.length > 0) { selected.forEach((obj) => { - if (obj.type === 'QPolygon') { + if (obj.type === 'QPolygon' && obj.name !== 'module') { obj.set({ stroke: 'red' }) } }) @@ -235,7 +235,7 @@ export function useCanvasEvent() { if (selected?.length > 0) { selected.forEach((obj) => { - if (obj.type === 'QPolygon') { + if (obj.type === 'QPolygon' && obj.name !== 'module') { obj.set({ stroke: 'red' }) } }) From 9faba60fd64a96ae43ab0a766a712db7095757b3 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Thu, 23 Jan 2025 11:01:07 +0900 Subject: [PATCH 088/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EB=B0=B0=EC=B9=98?= =?UTF-8?q?=EB=A9=B4=20=EC=B2=98=EB=A7=88=EB=A9=B4=20=EC=9D=B8=ED=84=B0?= =?UTF-8?q?=EB=B2=8C=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Placement.jsx | 1 - src/hooks/module/useModuleBasicSetting.js | 157 +------------- src/hooks/module/useModulePlace.js | 201 +++++++++++++++--- 3 files changed, 183 insertions(+), 176 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index ff1eeb35..9a53a1c0 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -24,7 +24,6 @@ const Placement = forwardRef((props, refs) => { //모듈 배치면 생성 useEffect(() => { - makeModuleInstArea() if (moduleSelectionData) { //1개라도 치도리 불가가 있으면 치도리 불가 const isChidroriValue = moduleSelectionData.roofConstructions.some((item) => item.construction.plvrYn === 'N') diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js index f9b8a7fe..bc0569d3 100644 --- a/src/hooks/module/useModuleBasicSetting.js +++ b/src/hooks/module/useModuleBasicSetting.js @@ -1,5 +1,5 @@ import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' -import { canvasState, checkedModuleState, isManualModuleSetupState, selectedModuleState } from '@/store/canvasAtom' +import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState, selectedModuleState } from '@/store/canvasAtom' import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util' import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom' import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils' @@ -8,9 +8,7 @@ import { moduleSetupSurfaceState, moduleIsSetupState } from '@/store/canvasAtom' import { useEvent } from '@/hooks/useEvent' import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common' import * as turf from '@turf/turf' -import { v4 as uuidv4 } from 'uuid' import { useSwal } from '@/hooks/useSwal' -import { canvasSettingState } from '@/store/canvasAtom' import { compasDegAtom } from '@/store/orientationAtom' import { QLine } from '@/components/fabric/QLine' import { useRoofFn } from '@/hooks/common/useRoofFn' @@ -24,9 +22,9 @@ export function useModuleBasicSetting() { const roofDisplay = useRecoilValue(roofDisplaySelector) const [moduleSetupSurface, setModuleSetupSurface] = useRecoilState(moduleSetupSurfaceState) const [moduleIsSetup, setModuleIsSetup] = useRecoilState(moduleIsSetupState) - const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent, removeMouseEvent } = useEvent() + const { addCanvasMouseEventListener, initEvent, removeMouseEvent } = useEvent() const { swalFire } = useSwal() - const canvasSetting = useRecoilValue(canvasSettingState) + const compasDeg = useRecoilValue(compasDegAtom) const { setSurfaceShapePattern } = useRoofFn() const [basicSetting, setBasicSettings] = useRecoilState(basicSettingState) @@ -34,6 +32,8 @@ export function useModuleBasicSetting() { const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState) const setModuleStatistics = useSetRecoilState(moduleStatisticsState) + const canvasSetting = useRecoilValue(canvasSettingState) + useEffect(() => { // console.log('basicSetting', basicSetting) if (canvas) { @@ -46,7 +46,6 @@ export function useModuleBasicSetting() { }, []) // const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent } = useContext(EventContext) - let selectedModuleInstSurfaceArray = [] //모듈,회로에서 다른메뉴 -> 배치면으로 갈 경수 초기화 const restoreModuleInstArea = () => { @@ -71,149 +70,6 @@ export function useModuleBasicSetting() { }) } - const makeModuleInstArea = () => { - //지붕 객체 반환 - - const roofs = canvas.getObjects().filter((obj) => obj.name === 'roof') - let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : -20 - - if (!roofs) { - return - } - - const batchObjects = canvas - ?.getObjects() - .filter( - (obj) => - obj.name === BATCH_TYPE.OPENING || - obj.name === BATCH_TYPE.SHADOW || - obj.name === BATCH_TYPE.TRIANGLE_DORMER || - obj.name === BATCH_TYPE.PENTAGON_DORMER, - ) //도머s 객체 - - //도머도 외곽을 따야한다 - - const batchObjectOptions = { - stroke: 'red', - fill: 'transparent', - strokeDashArray: [10, 4], - strokeWidth: 1, - lockMovementX: true, - lockMovementY: true, - lockRotation: true, - lockScalingX: true, - lockScalingY: true, - selectable: true, - name: POLYGON_TYPE.OBJECT_SURFACE, - originX: 'center', - originY: 'center', - } - - batchObjects.forEach((obj) => { - if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) { - const groupPoints = obj.groupPoints - const offsetObjects = offsetPolygon(groupPoints, 10) - const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions) - dormerOffset.setViewLengthText(false) - canvas.add(dormerOffset) //모듈설치면 만들기 - } else { - const points = obj.points - const offsetObjects = offsetPolygon(points, 10) - const offset = new QPolygon(offsetObjects, batchObjectOptions) - offset.setViewLengthText(false) - canvas.add(offset) //모듈설치면 만들기 - } - }) - - roofs.forEach((roof) => { - const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id) - if (isExistSurface) { - return - } - - setSurfaceShapePattern(roof, roofDisplay.column, true) //패턴 변경 - const offsetPoints = offsetPolygon(roof.points, offsetLength) //안쪽 offset - //모듈설치영역?? 생성 - - const surfaceId = uuidv4() - - let setupSurface = new QPolygon(offsetPoints, { - stroke: 'red', - fill: 'transparent', - strokeDashArray: [10, 4], - strokeWidth: 1, - lockMovementX: true, - lockMovementY: true, - lockRotation: true, - lockScalingX: true, - lockScalingY: true, - selectable: true, - parentId: roof.id, //가대 폴리곤의 임시 인덱스를 넣어줌 - name: POLYGON_TYPE.MODULE_SETUP_SURFACE, - flowDirection: roof.direction, - direction: roof.direction, - flipX: roof.flipX, - flipY: roof.flipY, - surfaceId: surfaceId, - originX: 'center', - originY: 'center', - modules: [], - roofMaterial: roof.roofMaterial, - // angle: -compasDeg, - }) - - setupSurface.setViewLengthText(false) - canvas.add(setupSurface) //모듈설치면 만들기 - - //지붕면 선택 금지 - roof.set({ - selectable: false, - }) - - //모듈설치면 클릭이벤트 - addTargetMouseEventListener('mousedown', setupSurface, function () { - toggleSelection(setupSurface) - }) - }) - } - - //설치 범위 지정 클릭 이벤트 - const toggleSelection = (setupSurface) => { - const isExist = selectedModuleInstSurfaceArray.some((obj) => obj.parentId === setupSurface.parentId) - //최초 선택일때 - if (!isExist) { - //기본 선택이랑 스트로크 굵기가 같으면 선택 안됨으로 봄 - setupSurface.set({ - ...setupSurface, - strokeWidth: 3, - strokeDashArray: [0], - fill: 'transparent', - }) - canvas.discardActiveObject() // 객체의 활성 상태 해제 - //중복으로 들어가는걸 방지하기 위한 코드 - - canvas?.renderAll() - selectedModuleInstSurfaceArray.push(setupSurface) - } else { - //선택후 재선택하면 선택안됨으로 변경 - setupSurface.set({ - ...setupSurface, - fill: 'transparent', - strokeDashArray: [10, 4], - strokeWidth: 1, - }) - canvas.discardActiveObject() // 객체의 활성 상태 해제 - - //폴리곤에 커스텀 인덱스를 가지고 해당 배열 인덱스를 찾아 삭제함 - const removeIndex = setupSurface.parentId - const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex) - selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1) - } - - canvas?.renderAll() - setModuleSetupSurface([...selectedModuleInstSurfaceArray]) - } - /** * trestle에서 영역을 가져와 mouse:move 이벤트로 해당 영역에 진입했을때 booleanPointInPolygon 로 진입여부를 확인 * 확인 후 셀을 이동시킴 @@ -1131,6 +987,8 @@ export function useModuleBasicSetting() { const flowDirection = moduleSetupSurface.flowDirection + console.log('moduleSetupSurface', moduleSetupSurface) + let intvHor = flowDirection === 'south' || flowDirection === 'north' ? moduleSetupSurface.trestleDetail.moduleIntvlHor @@ -2349,7 +2207,6 @@ export function useModuleBasicSetting() { } return { - makeModuleInstArea, manualModuleSetup, autoModuleSetup, restoreModuleInstArea, diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js index 5a25a50a..0af46cf9 100644 --- a/src/hooks/module/useModulePlace.js +++ b/src/hooks/module/useModulePlace.js @@ -1,17 +1,28 @@ import { useEffect, useState } from 'react' -import { useRecoilState, useRecoilValue } from 'recoil' +import { useRecoilValue, useSetRecoilState } from 'recoil' import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions' import { useMasterController } from '@/hooks/common/useMasterController' -import { canvasState, currentCanvasPlanState } from '@/store/canvasAtom' +import { canvasSettingState, canvasState, currentCanvasPlanState, moduleSetupSurfaceState } from '@/store/canvasAtom' +import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common' +import { useRoofFn } from '@/hooks/common/useRoofFn' +import { roofDisplaySelector } from '@/store/settingAtom' +import offsetPolygon from '@/util/qpolygon-utils' +import { v4 as uuidv4 } from 'uuid' +import { QPolygon } from '@/components/fabric/QPolygon' +import { useEvent } from '@/hooks/useEvent' export function useModulePlace() { const canvas = useRecoilValue(canvasState) const moduleSelectionData = useRecoilValue(moduleSelectionDataState) - const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) const [trestleDetailParams, setTrestleDetailParams] = useState([]) const [trestleDetailList, setTrestleDetailList] = useState([]) const selectedModules = useRecoilValue(selectedModuleState) const { getTrestleDetailList } = useMasterController() + const canvasSetting = useRecoilValue(canvasSettingState) + const { setSurfaceShapePattern } = useRoofFn() + const roofDisplay = useRecoilValue(roofDisplaySelector) + const { addTargetMouseEventListener } = useEvent() + const setModuleSetupSurface = useSetRecoilState(moduleSetupSurfaceState) useEffect(() => { if (moduleSelectionData) { @@ -40,7 +51,9 @@ export function useModulePlace() { const getTrestleDetailListData = async () => { const trestleDetailList = await getTrestleDetailList(trestleDetailParams) - setTrestleDetailList(trestleDetailList) + if (trestleDetailList.length > 0) { + setTrestleDetailList(trestleDetailList) + } } useEffect(() => { @@ -50,30 +63,168 @@ export function useModulePlace() { }, [trestleDetailParams]) useEffect(() => { - //지붕을 가져옴 - console.log('🚀 ~ trestleDetailList.forEach ~ trestleDetailList:', trestleDetailList) - canvas - .getObjects() - .filter((roof) => roof.name === 'roof') - .forEach((roof) => { - const roofIndex = roof.roofMaterial.index //지붕의 지붕재의 순번 - trestleDetailList.forEach((detail) => { - if (Number(detail.data.roofIndex) === roofIndex) { - //roof에 상세 데이터 추가 - roof.set({ trestleDetail: detail.data }) - - //surface에 상세 데이터 추가 - canvas - .getObjects() - .filter((surface) => surface.name === 'moduleSetupSurface' && surface.parentId === roof.id) - .forEach((surface) => { - surface.set({ trestleDetail: detail.data, roofMaterial: roof.roofMaterial }) - }) - } + if (trestleDetailList.length > 0) { + //지붕을 가져옴 + canvas + .getObjects() + .filter((roof) => roof.name === 'roof') + .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에 상세 데이터 추가 + } + }) }) - }) + } }, [trestleDetailList]) + const makeModuleInstArea = (roof, trestleDetail) => { + //지붕 객체 반환 + + if (!roof) { + return + } + + const batchObjects = canvas + ?.getObjects() + .filter( + (obj) => + obj.name === BATCH_TYPE.OPENING || + obj.name === BATCH_TYPE.SHADOW || + obj.name === BATCH_TYPE.TRIANGLE_DORMER || + obj.name === BATCH_TYPE.PENTAGON_DORMER, + ) //도머s 객체 + + //도머도 외곽을 따야한다 + + const batchObjectOptions = { + stroke: 'red', + fill: 'transparent', + strokeDashArray: [10, 4], + strokeWidth: 1, + lockMovementX: true, + lockMovementY: true, + lockRotation: true, + lockScalingX: true, + lockScalingY: true, + selectable: true, + name: POLYGON_TYPE.OBJECT_SURFACE, + originX: 'center', + originY: 'center', + } + + batchObjects.forEach((obj) => { + if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) { + const groupPoints = obj.groupPoints + const offsetObjects = offsetPolygon(groupPoints, 10) + const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions) + dormerOffset.setViewLengthText(false) + canvas.add(dormerOffset) //모듈설치면 만들기 + } else { + const points = obj.points + const offsetObjects = offsetPolygon(points, 10) + const offset = new QPolygon(offsetObjects, batchObjectOptions) + offset.setViewLengthText(false) + canvas.add(offset) //모듈설치면 만들기 + } + }) + + const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id) + if (isExistSurface) { + return + } + + let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : (trestleDetail.eaveIntvl / 10) * -1 + setSurfaceShapePattern(roof, roofDisplay.column, true) //패턴 변경 + const offsetPoints = offsetPolygon(roof.points, offsetLength) //안쪽 offset + //모듈설치영역?? 생성 + + const surfaceId = uuidv4() + + let setupSurface = new QPolygon(offsetPoints, { + stroke: 'red', + fill: 'transparent', + strokeDashArray: [10, 4], + strokeWidth: 1, + lockMovementX: true, + lockMovementY: true, + lockRotation: true, + lockScalingX: true, + lockScalingY: true, + selectable: true, + parentId: roof.id, //가대 폴리곤의 임시 인덱스를 넣어줌 + name: POLYGON_TYPE.MODULE_SETUP_SURFACE, + flowDirection: roof.direction, + direction: roof.direction, + flipX: roof.flipX, + flipY: roof.flipY, + surfaceId: surfaceId, + originX: 'center', + originY: 'center', + modules: [], + roofMaterial: roof.roofMaterial, + trestleDetail: trestleDetail, + // angle: -compasDeg, + }) + + setupSurface.setViewLengthText(false) + canvas.add(setupSurface) //모듈설치면 만들기 + + //지붕면 선택 금지 + roof.set({ + selectable: false, + }) + + //모듈설치면 클릭이벤트 + addTargetMouseEventListener('mousedown', setupSurface, function () { + toggleSelection(setupSurface) + }) + } + + let selectedModuleInstSurfaceArray = [] + + //설치 범위 지정 클릭 이벤트 + const toggleSelection = (setupSurface) => { + const isExist = selectedModuleInstSurfaceArray.some((obj) => obj.parentId === setupSurface.parentId) + //최초 선택일때 + if (!isExist) { + //기본 선택이랑 스트로크 굵기가 같으면 선택 안됨으로 봄 + setupSurface.set({ + ...setupSurface, + strokeWidth: 3, + strokeDashArray: [0], + fill: 'transparent', + }) + canvas.discardActiveObject() // 객체의 활성 상태 해제 + //중복으로 들어가는걸 방지하기 위한 코드 + + canvas?.renderAll() + selectedModuleInstSurfaceArray.push(setupSurface) + } else { + //선택후 재선택하면 선택안됨으로 변경 + setupSurface.set({ + ...setupSurface, + fill: 'transparent', + strokeDashArray: [10, 4], + strokeWidth: 1, + }) + canvas.discardActiveObject() // 객체의 활성 상태 해제 + + //폴리곤에 커스텀 인덱스를 가지고 해당 배열 인덱스를 찾아 삭제함 + const removeIndex = setupSurface.parentId + const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex) + selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1) + } + + canvas?.renderAll() + setModuleSetupSurface([...selectedModuleInstSurfaceArray]) + } + return { selectedModules, } From b3568a9bccc7783d2dbf95d28b4b0caed8944243 Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 23 Jan 2025 12:14:25 +0900 Subject: [PATCH 089/130] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=ED=8C=8C=EC=9D=BC?= =?UTF-8?q?=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=EC=97=90=20key=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/MainContents.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx index b390adcd..d00e57d8 100644 --- a/src/components/main/MainContents.jsx +++ b/src/components/main/MainContents.jsx @@ -213,7 +213,7 @@ export default function MainContents() { {boardList.length > 0 ? (
{boardList?.map((board) => ( - ))} From afa6d87621e4111bdc3170fb19c8a568f75eece8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Thu, 23 Jan 2025 13:47:01 +0900 Subject: [PATCH 090/130] =?UTF-8?q?=EC=88=98=EB=8F=99=20=EB=B2=88=ED=98=B8?= =?UTF-8?q?=20=ED=99=95=EC=A0=95=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 1 + .../step/PowerConditionalSelect.jsx | 2 +- .../step/type/PassivityCircuitAllocation.jsx | 769 +++++++++++++++++- src/hooks/common/useMasterController.js | 7 + 4 files changed, 774 insertions(+), 5 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index fa4abd4c..1d6ac400 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -62,6 +62,7 @@ export default function CircuitTrestleSetting({ id }) { const passivityProps = { tabNum, setTabNum, + pcsCheck, selectedModels, setSelectedModels, } diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx index fbaef41a..3c581e6f 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx @@ -141,7 +141,7 @@ export default function PowerConditionalSelect(props) { return } - setSelectedModels([...selectedModels, selectedRow]) + setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }]) setSelectedRow(null) } diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index 62e54ec1..e1c2b29b 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -1,5 +1,6 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import { POLYGON_TYPE } from '@/common/common' +import { useMasterController } from '@/hooks/common/useMasterController' import { useMessage } from '@/hooks/useMessage' import { canvasState } from '@/store/canvasAtom' import { moduleStatisticsState } from '@/store/circuitTrestleAtom' @@ -8,7 +9,7 @@ import { useContext, useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' export default function PassivityCircuitAllocation(props) { - const { tabNum, setTabNum, selectedModels } = props + const { tabNum, setTabNum, selectedModels, pcsCheck } = props const { getMessage } = useMessage() const canvas = useRecoilValue(canvasState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) @@ -22,6 +23,7 @@ export default function PassivityCircuitAllocation(props) { const [footer, setFooter] = useState(['합계']) const [circuitNumber, setCircuitNumber] = useState(1) const [targetModules, setTargetModules] = useState([]) + const { pcsMaualConfChk } = useMasterController() useEffect(() => { console.log('🚀 ~ PassivityCircuitAllocation ~ targetModules:', targetModules) @@ -145,15 +147,752 @@ export default function PassivityCircuitAllocation(props) { const handleCircuitNumberFix = () => { console.log('🚀 ~ handleCircuitNumberFix ~ circuitNumber:', circuitNumber) + console.log('🚀 ~ handleCircuitNumberFix ~ selectedPcs:', selectedPcs) + // const params = { + // maxConnYn: pcsCheck.max ? 'Y' : 'N', + // smpCirYn: 'Y', + // coldZoneYn: 'Y', + // useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }], + // pcsItemList: [ + // { + // pcsMkrCd: 'MKR001', + // pcsSerCd: 'SER001', + // itemId: '106857', + // itemNm: 'HQJP-KA55-5 パワーコンディショナ5.5kW屋内', + // goodsNo: 'HQJP-KA55-5', + // serQtyList: [ + // { + // serQty: 5, + // paralQty: 3, + // rmdYn: 'Y', + // usePossYn: 'Y', + // roofSurfaceList: [ + // { + // roofSurfaceId: '1', + // roofSurface: '남서', + // roofSurfaceIncl: '5', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // ], + // cirLastIdx: 5, + // isCirLastDupCircuit: true, + // roofSurfacePossibleModuleCnt: 0, + // totCirModuleWpOut: 0, + // roofSurfaceCirModuleWpOut: 3960, + // }, + // { + // roofSurfaceId: '2', + // roofSurface: '남서', + // roofSurfaceIncl: '5', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: null, + // pcsItemId: null, + // }, + // ], + // cirLastIdx: 3, + // isCirLastDupCircuit: true, + // roofSurfacePossibleModuleCnt: 1, + // totCirModuleWpOut: 0, + // roofSurfaceCirModuleWpOut: 2200, + // }, + // { + // roofSurfaceId: '3', + // roofSurface: '남', + // roofSurfaceIncl: '3', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // ], + // cirLastIdx: 6, + // isCirLastDupCircuit: true, + // roofSurfacePossibleModuleCnt: 0, + // totCirModuleWpOut: 0, + // roofSurfaceCirModuleWpOut: 3960, + // }, + // ], + // }, + // ], + // }, + // { + // pcsMkrCd: 'MKR001', + // pcsSerCd: 'SER001', + // itemId: '106856', + // itemNm: 'HQJP-KA40-5 パワーコンディショナ4.0kW屋内', + // goodsNo: 'HQJP-KA40-5', + // circuitCfg: '4, 4', + // serQtyList: [ + // { + // pcsTpCd: 'INDFCS', + // serQty: 4, + // paralQty: 2, + // rmdYn: 'Y', + // usePossYn: 'Y', + // cirModuleWpOutSum: 3520, + // roofSurfaceList: [ + // { + // roofSurfaceId: '1', + // roofSurface: '남서', + // roofSurfaceIncl: '5', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-1', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-4', + // pcsItemId: '106856', + // }, + // ], + // cirLastIdx: 5, + // isCirLastDupCircuit: true, + // roofSurfacePossibleModuleCnt: 0, + // totCirModuleWpOut: 0, + // roofSurfaceCirModuleWpOut: 3960, + // }, + // { + // roofSurfaceId: '2', + // roofSurface: '남서', + // roofSurfaceIncl: '5', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-2', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: null, + // pcsItemId: null, + // }, + // ], + // }, + // { + // roofSurfaceId: '3', + // roofSurface: '남', + // roofSurfaceIncl: '3', + // moduleList: [ + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '1-3', + // pcsItemId: '106857', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // { + // pcsMkrCd: null, + // pcsSerCd: null, + // applySerQty: null, + // itemId: '107077', + // itemTp: null, + // wpOut: 440, + // moduleStdVol: 42, + // moduleColdZoneVol: null, + // mixMatlNo: null, + // circuit: '2-5', + // pcsItemId: '106856', + // }, + // ], + // }, + // ], + // }, + // ], + // }, + // ], + // } + // pcsMaualConfChk() + canvas.discardActiveObject() canvas .getObjects() .filter((obj) => targetModules.includes(obj.id)) .forEach((obj) => { obj.set({ circuit: circuitNumber, + strokeWidth: 0.3, }) + obj.pscId = selectedPcs.id + obj.pscIndex = selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1 canvas.add( - new fabric.Text(`(${circuitNumber})`, { + new fabric.Text(getCircuitNumber(), { left: obj.left + obj.width / 2, top: obj.top + obj.height / 2, fill: 'red', @@ -171,7 +910,29 @@ export default function PassivityCircuitAllocation(props) { console.log(obj) }) setTargetModules([]) - setCircuitNumber(circuitNumber + 1) + setCircuitNumber(+circuitNumber + 1) + canvas.renderAll() + } + + const getCircuitNumber = () => { + if (selectedModels.length === 1) { + return `(${circuitNumber})` + } else { + return `(${selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1}-${circuitNumber})` + } + } + + const initSelectedPcsCircuitNumber = () => { + const modules = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber' && obj.pscId === selectedPcs.id) + canvas.remove(...modules) + canvas + .getObjects() + .filter((obj) => obj.pscIndex === selectedPcs.id) + .forEach((obj) => { + obj.pscId = null + obj.pscIndex = null + }) + canvas.renderAll() } @@ -280,7 +1041,7 @@ export default function PassivityCircuitAllocation(props) {
-
From 9c35b1e437d98920ab71f3a0ed4a9b252a74738f Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Thu, 23 Jan 2025 15:25:02 +0900 Subject: [PATCH 094/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C=EB=B0=8F=EA=B0=80?= =?UTF-8?q?=EB=8C=80=EC=84=A4=EC=A0=95=20=EB=AA=A8=EB=93=88=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=EB=B3=84=20=ED=95=A8=EC=88=98=20=EC=B2=98?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 105 ++++++++++------ .../modal/circuitTrestle/step/StepUp.jsx | 117 ++++++++++++------ 2 files changed, 146 insertions(+), 76 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 1d6ac400..2881ec2c 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -66,14 +66,6 @@ export default function CircuitTrestleSetting({ id }) { selectedModels, setSelectedModels, } - const stepUpProps = { - tabNum, - setTabNum, - models, - setModels, - circuitAllocationType, - setCircuitAllocationType, - } useEffect(() => { if (!managementState) { @@ -89,7 +81,58 @@ export default function CircuitTrestleSetting({ id }) { }) return } - const roofSurfaceList = canvas + + console.log('🚀 ~ onAutoRecommend ~ selectedModules:', selectedModules) + + const params = { + ...getApiProps(), + useModuleItemList: getSelectedModuleList(), + roofSurfaceList: getRoofSurfaceList(), + pcsItemList: getModelList(), + } + + getPcsAutoRecommendList(params).then((res) => { + if (res.data?.pcsItemList) { + setModels(res.data.pcsItemList) + setTabNum(2) + } else { + swalFire({ + title: '파워컨디셔너를 추가해 주세요.', + type: 'alert', + }) + } + }) + } + + const getApiProps = () => { + return { + maxConnYn: pcsCheck.max ? 'Y' : 'N', + smpCirYn: pcsCheck.division ? 'Y' : 'N', + coldZoneYn: managementState?.coldRegionFlg === '1' ? 'Y' : 'N', + } + } + + const getModelList = () => { + return models.map((model) => { + return { + itemId: model.itemId, + pcsMkrCd: model.pcsMkrCd, + pcsSerCd: model.pcsSerCd, + } + }) + } + + const getSelectedModuleList = () => { + return selectedModules.itemList.map((m) => { + return { + itemId: m.itemId, + mixMatlNo: m.mixMatlNo, + } + }) + } + + const getRoofSurfaceList = () => { + return canvas .getObjects() .filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) .map((obj) => { @@ -107,37 +150,6 @@ export default function CircuitTrestleSetting({ id }) { }), } }) - - const params = { - maxConnYn: pcsCheck.max ? 'Y' : 'N', - smpCirYn: pcsCheck.division ? 'Y' : 'N', - coldZoneYn: managementState?.coldRegionFlg === '1' ? 'Y' : 'N', - useModuleItemList: selectedModules.itemList.map((m) => { - return { - itemId: m.itemId, - mixMatlNo: m.mixMatlNo, - } - }), - roofSurfaceList: roofSurfaceList, - pcsItemList: models.map((model) => { - return { - itemId: model.itemId, - pcsMkrCd: model.pcsMkrCd, - pcsSerCd: model.pcsSerCd, - } - }), - } - getPcsAutoRecommendList(params).then((res) => { - if (res.data?.pcsItemList) { - setModels(res.data.pcsItemList) - setTabNum(2) - } else { - swalFire({ - title: '파워컨디셔너를 추가해 주세요.', - type: 'alert', - }) - } - }) } const onAutoAllocation = () => { @@ -200,6 +212,19 @@ export default function CircuitTrestleSetting({ id }) { setAllocationType(ALLOCATION_TYPE.PASSIVITY) } + const stepUpProps = { + tabNum, + setTabNum, + models, + setModels, + circuitAllocationType, + setCircuitAllocationType, + getApiProps, + getSelectedModuleList, + getRoofSurfaceList, + getModelList, + } + return (
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 19a701dc..721e6dff 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -24,9 +24,16 @@ export default function StepUp(props) { const [stepUpListData, setStepUpListData] = useState([]) const [optCodes, setOptCodes] = useState([]) + useCanvasPopupStatusController(6) + const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore) + if (Object.keys(canvasPopupStatusState[6]).length !== 0) { + console.log('🚀 ~ useEffect ~ canvasPopupStatusState :', canvasPopupStatusState) + } + useEffect(() => { + console.log('🚀 ~ useEffect ~ >>>>>>>>>>>> props:', props) + if (!managementState) { - console.log('🚀 ~ useEffect ~ managementState:', managementState) setManagementState(managementStateLoaded) } @@ -73,48 +80,86 @@ export default function StepUp(props) { } //getPcsVoltageStepUpList(null) - getPcsVoltageStepUpList().then((res) => { + // PCS 승압설정 정보 조회 + fetchStepUpData() + }, []) + + const fetchStepUpData = async () => { + try { + const res = await getPcsVoltageStepUpList() if (res?.result.code === 200 && res?.data) { const dataArray = Array.isArray(res.data) ? res.data : [res.data] - const stepUpListData = dataArray.map((stepUps) => ({ - ...stepUps, - optionList: (stepUps.optionList || []).map((option) => ({ - pcsOptCd: option.pcsOptCd, - pcsOptNm: option.pcsOptNm, - pcsOptNmJp: option.pcsOptNmJp, - })), - pcsItemList: (stepUps.pcsItemList || []).map((item) => ({ - goodsNo: item.goodsNo, - itemId: item.itemId, - itemNm: item.itemNm, - pcsMkrCd: item.pcsMkrCd, - pcsSerCd: item.pcsSerCd, - connList: (item.connList || []).map((conn) => ({ - connAllowCur: conn.connAllowCur, - connMaxParalCnt: conn.connMaxParalCnt, - goodsNo: conn.goodsNo, - itemId: conn.itemId, - itemNm: conn.itemNm, - vstuParalCnt: conn.vstuParalCnt, - })), - serQtyList: (item.serQtyList || []).map((qty) => ({ - serQty: qty.serQty, - paralQty: qty.paralQty, - })), - })), - })) + const stepUpListData = formatStepUpListData(dataArray) console.log('🚀 ~ useEffect ~ getPcsVoltageStepUpList ~ stepUpListData:', stepUpListData) setStepUpListData(stepUpListData) - setOptCodes(res.data.optionList.map((opt) => ({ ...opt, code: opt.pcsOptCd, name: opt.pcsOptNm, nameJp: opt.pcsOptNmJp }))) + // PCS 옵션 조회 + const formattedOptCodes = formatOptionCodes(res.data.optionList) + setOptCodes(formattedOptCodes) } - }) - }, []) + } catch (error) { + console.error('Error fetching step up data:', error) + } + } - useCanvasPopupStatusController(6) - const canvasPopupStatusState = useRecoilValue(canvasPopupStatusStore) - if (Object.keys(canvasPopupStatusState[6]).length !== 0) { - console.log('🚀 ~ useEffect ~ canvasPopupStatusState :', canvasPopupStatusState) + // PCS 옵션 조회 + const formatOptionCodes = (optionList = []) => { + return optionList.map((opt) => ({ + code: opt.pcsOptCd, + name: opt.pcsOptNm, + nameJp: opt.pcsOptNmJp, + })) + } + + // PCS 승압설정 정보 포맷 + const formatStepUpListData = (dataArray = []) => { + return dataArray.map((stepUps) => ({ + ...stepUps, + optionList: formatOptionList(stepUps.optionList), + pcsItemList: formatPcsItemList(stepUps.pcsItemList), + })) + } + + // PCS 옵션 포맷 + const formatOptionList = (optionList = []) => { + return optionList.map((option) => ({ + pcsOptCd: option.pcsOptCd, + pcsOptNm: option.pcsOptNm, + pcsOptNmJp: option.pcsOptNmJp, + })) + } + + // PCS 아이템 포맷 + const formatPcsItemList = (pcsItemList = []) => { + return pcsItemList.map((item) => ({ + goodsNo: item.goodsNo, + itemId: item.itemId, + itemNm: item.itemNm, + pcsMkrCd: item.pcsMkrCd, + pcsSerCd: item.pcsSerCd, + connList: formatConnList(item.connList), + serQtyList: formatSerQtyList(item.serQtyList), + })) + } + + // PCS 연결 포맷 + const formatConnList = (connList = []) => { + return connList.map((conn) => ({ + connAllowCur: conn.connAllowCur, + connMaxParalCnt: conn.connMaxParalCnt, + goodsNo: conn.goodsNo, + itemId: conn.itemId, + itemNm: conn.itemNm, + vstuParalCnt: conn.vstuParalCnt, + })) + } + + // PCS 시리즈 포맷 + const formatSerQtyList = (serQtyList = []) => { + return serQtyList.map((qty) => ({ + serQty: qty.serQty, + paralQty: qty.paralQty, + })) } // 각 모듈의 탭을 변경하는 함수 From adc0edbab37a71c6ac12aeeaca2c3d6efad188e9 Mon Sep 17 00:00:00 2001 From: yjnoh Date: Thu, 23 Jan 2025 15:37:27 +0900 Subject: [PATCH 095/130] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=84=A0=ED=83=9D?= =?UTF-8?q?=20=EA=B3=B5=EB=B2=95=20=EC=84=A0=ED=83=9D=20=ED=99=94=EB=A9=B4?= =?UTF-8?q?=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/basic/step/Module.jsx | 12 ++++++++++-- .../modal/basic/step/ModuleTabContents.jsx | 16 +++++++++++++--- .../floor-plan/modal/basic/step/Placement.jsx | 15 ++++++++++----- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx index 2ea37896..789a1a0c 100644 --- a/src/components/floor-plan/modal/basic/step/Module.jsx +++ b/src/components/floor-plan/modal/basic/step/Module.jsx @@ -9,6 +9,7 @@ import ModuleTabContents from './ModuleTabContents' import { useDebounceValue } from 'usehooks-ts' import { moduleSelectionDataState } from '@/store/selectedModuleOptions' import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController' +import { isObjectNotEmpty } from '@/util/common-utils' export default function Module({ setTabNum }) { const { getMessage } = useMessage() @@ -56,7 +57,14 @@ export default function Module({ setTabNum }) { useEffect(() => { if (tempModuleSelectionData) { setModuleSelectionData(tempModuleSelectionData) - // moduleSelectedDataTrigger(tempModuleSelectionData) + + if ( + tempModuleSelectionData.common.moduleItemId && + isObjectNotEmpty(tempModuleSelectionData.module) && + tempModuleSelectionData.roofConstructions.length > 0 + ) { + moduleSelectedDataTrigger(tempModuleSelectionData) + } } }, [tempModuleSelectionData]) @@ -89,7 +97,7 @@ export default function Module({ setTabNum }) { setRoofTab(tab) } - // const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2) + const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2) return ( <> diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx index 64a93ccd..22554a11 100644 --- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx +++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx @@ -90,7 +90,9 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem }, [hajebichi]) useEffect(() => { - setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab]) + if (moduleSelectionData.roofConstructions.length > 0) { + setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab]) + } }, [moduleSelectionData]) //서까래간격 변경 @@ -261,11 +263,13 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem }, [selectedRoofBase]) useEffect(() => { + console.log('moduleConstructionSelectionData', moduleConstructionSelectionData) + if ( isExistData && constructionList.length > 0 && - isObjectNotEmpty(moduleConstructionSelectionData.construction) && - moduleConstructionSelectionData.construction.hasOwnProperty('constPossYn') ///키가 있으면 + isObjectNotEmpty(moduleConstructionSelectionData?.construction) && + moduleConstructionSelectionData?.construction.hasOwnProperty('constPossYn') ///키가 있으면 ) { const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex const construction = constructionList[selectedIndex] @@ -275,6 +279,12 @@ export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tem } }, [constructionList]) + useEffect(() => { + if (isObjectNotEmpty(moduleSelectionData) && isObjectNotEmpty(moduleSelectionData.module)) { + setSelectedModules(moduleSelectionData.module) + } + }, [moduleSelectionData]) + useEffect(() => { // 202600 경사도 const raftCodeList = findCommonCode('203800') diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx index 9a53a1c0..972229a7 100644 --- a/src/components/floor-plan/modal/basic/step/Placement.jsx +++ b/src/components/floor-plan/modal/basic/step/Placement.jsx @@ -8,7 +8,7 @@ import { useModulePlace } from '@/hooks/module/useModulePlace' const Placement = forwardRef((props, refs) => { const { getMessage } = useMessage() - const [isChidori, setIsChidori] = useState(false) + const [isChidori, setIsChidori] = useState('false') const [isChidoriNotAble, setIsChidoriNotAble] = useState(false) const currentCanvasPlan = useRecoilValue(currentCanvasPlanState) @@ -52,10 +52,15 @@ const Placement = forwardRef((props, refs) => { } const handleChangeChidori = (e) => { - setIsChidori(e.target.value) + const bool = e.target.value === 'true' ? true : false + setIsChidori(bool) 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 @@ -140,13 +145,13 @@ const Placement = forwardRef((props, refs) => { id="ra01" checked={isChidori} disabled={isChidoriNotAble} - value={true} - onChange={handleChangeChidori} + value={'true'} + onChange={(e) => handleChangeChidori(e)} />
- + handleChangeChidori(e)} />
From b75b1556466ec311f6279690827456fbaaf32ff0 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Thu, 23 Jan 2025 15:44:07 +0900 Subject: [PATCH 096/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20swal=20z-index=20?= =?UTF-8?q?=EC=A1=B0=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/_reset.scss | 1895 +++++++++++++++++++++------------------- 1 file changed, 1017 insertions(+), 878 deletions(-) diff --git a/src/styles/_reset.scss b/src/styles/_reset.scss index 106a50e7..866e226f 100644 --- a/src/styles/_reset.scss +++ b/src/styles/_reset.scss @@ -1,999 +1,1138 @@ * { - -webkit-text-size-adjust:none; - -moz-text-size-adjust:none; - -ms-text-size-adjust:none; - text-size-adjust: none; - box-sizing: content-box + -webkit-text-size-adjust: none; + -moz-text-size-adjust: none; + -ms-text-size-adjust: none; + text-size-adjust: none; + box-sizing: content-box; } -*, ::after, ::before { - box-sizing: border-box; +*, +::after, +::before { + box-sizing: border-box; } -html, body{ - font-size: 16px; +html, +body { + font-size: 16px; } -html, body, div, span, applet, object, iframe, -h1, h2, h3, h4, h5, h6, p, blockquote, pre, -a, abbr, acronym, address, big, cite, code, -del, dfn, em, img, ins, kbd, q, s, samp, -small, strike, strong, sub, sup, tt, var, -b, u, i, center, -dl, dt, dd, ol, ul, li, -fieldset, form, label, legend, -table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, embed, -figure, figcaption, footer, header, hgroup, -menu, nav, output, ruby, section, summary, -time, mark, audio, video { - margin: 0; - padding: 0; - border: 0; - font: inherit; - vertical-align: baseline; - font-family: 'Noto Sans JP', sans-serif; - -webkit-font-smoothing: antialiased; - -moz-osx-font-smoothing: grayscale; - font-smooth: never; +html, +body, +div, +span, +applet, +object, +iframe, +h1, +h2, +h3, +h4, +h5, +h6, +p, +blockquote, +pre, +a, +abbr, +acronym, +address, +big, +cite, +code, +del, +dfn, +em, +img, +ins, +kbd, +q, +s, +samp, +small, +strike, +strong, +sub, +sup, +tt, +var, +b, +u, +i, +center, +dl, +dt, +dd, +ol, +ul, +li, +fieldset, +form, +label, +legend, +table, +caption, +tbody, +tfoot, +thead, +tr, +th, +td, +article, +aside, +canvas, +details, +embed, +figure, +figcaption, +footer, +header, +hgroup, +menu, +nav, +output, +ruby, +section, +summary, +time, +mark, +audio, +video { + margin: 0; + padding: 0; + border: 0; + font: inherit; + vertical-align: baseline; + font-family: 'Noto Sans JP', sans-serif; + -webkit-font-smoothing: antialiased; + -moz-osx-font-smoothing: grayscale; + font-smooth: never; } /* HTML5 display-role reset for older browsers */ -article, aside, details, figcaption, figure, -footer, header, hgroup, menu, nav, section { - display: block; +article, +aside, +details, +figcaption, +figure, +footer, +header, +hgroup, +menu, +nav, +section { + display: block; } body { - line-height: 1.4; + line-height: 1.4; +} +body:first-of-type caption { + display: none; } -body:first-of-type caption { display:none;} -ol, ul { - list-style: none; +ol, +ul { + list-style: none; } -blockquote, q { - quotes: none; +blockquote, +q { + quotes: none; } -blockquote:before, blockquote:after, -q:before, q:after { - content: ''; - content: none; +blockquote:before, +blockquote:after, +q:before, +q:after { + content: ''; + content: none; } table { - width: 100%; - border-collapse: separate; - border-spacing:0; - border:0 none; + width: 100%; + border-collapse: separate; + border-spacing: 0; + border: 0 none; } -caption, th, td { - text-align:left; - font-weight: normal; - border:0; +caption, +th, +td { + text-align: left; + font-weight: normal; + border: 0; } -a { - cursor:pointer; - color:#000; +a { + cursor: pointer; + color: #000; } -a, a:hover, a:active { - text-decoration:none; - -webkit-tap-highlight-color: transparent; +a, +a:hover, +a:active { + text-decoration: none; + -webkit-tap-highlight-color: transparent; } /*form_style*/ -input, select, textarea, button, a, label { - -webkit-tap-highlight-color:rgba(0,0,0,0); +input, +select, +textarea, +button, +a, +label { + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); } -button,input[type=text], input[type=button] { - -webkit-appearance: none; - -webkit-border-radius: 0; - -webkit-appearance:none; - appearance: none; - border-radius: 0 +button, +input[type='text'], +input[type='button'] { + -webkit-appearance: none; + -webkit-border-radius: 0; + -webkit-appearance: none; + appearance: none; + border-radius: 0; } -input[type=checkbox], input[type=radio] { - box-sizing: border-box; - padding: 0; +input[type='checkbox'], +input[type='radio'] { + box-sizing: border-box; + padding: 0; } -input, select, button { - border:0 none; - outline:none; - margin:0; +input, +select, +button { + border: 0 none; + outline: none; + margin: 0; } select { - -webkit-appearance: none; - -moz-appearance: none; - appearance: none; + -webkit-appearance: none; + -moz-appearance: none; + appearance: none; } select::-ms-expand { - display: none; + display: none; } ::-webkit-input-placeholder { - line-height:1; - font-weight:300; - font-size:0.938rem; - letter-spacing:-0.6px; - color:#8b8b8b; + line-height: 1; + font-weight: 300; + font-size: 0.938rem; + letter-spacing: -0.6px; + color: #8b8b8b; } -.log-box ::-webkit-input-placeholder{ - color:#8b8b8b; +.log-box ::-webkit-input-placeholder { + color: #8b8b8b; } -button{ - background: transparent; - font-family: 'Noto Sans JP', sans-serif; - border: none; - padding: 0; - margin: 0; - line-height: 1.4; - color: inherit; - outline: none; - cursor: pointer; +button { + background: transparent; + font-family: 'Noto Sans JP', sans-serif; + border: none; + padding: 0; + margin: 0; + line-height: 1.4; + color: inherit; + outline: none; + cursor: pointer; } -.pre{ - font-family: 'Pretendard', sans-serif !important; +.pre { + font-family: 'Pretendard', sans-serif !important; } -.no-click{ - cursor: no-drop !important; +.no-click { + cursor: no-drop !important; } // margin -.mt5{margin-top: 5px !important;} -.mt10{margin-top: 10px !important;} -.mt15{margin-top: 15px !important;} -.mb5{margin-bottom: 5px !important;} -.mb10{margin-bottom: 10px !important;} -.mb15{margin-bottom: 15px !important;} -.mr5{margin-right: 5px !important;} -.mr10{margin-right: 10px !important;} -.mr15{margin-right: 15px !important;} -.ml5{margin-left: 5px !important;} -.ml10{margin-left: 10px !important;} -.ml15{margin-left: 15px !important;} - -// align -.al-l{text-align: left !important;} -.al-r{text-align: right !important;} -.al-c{text-align: center !important;} - - -// button -.btn-frame{ - display: inline-block; - padding: 0 7px; - height: 34px; - line-height: 34px; - border-radius: 2px; - color: #fff; - font-size: 12px; - font-weight: 400; - border: 1px solid #000; - text-align: center; - font-family: 'Pretendard', sans-serif; - transition: all .17s ease-in-out; - cursor: pointer; - &.block{ - width: 100%; - } - &.small{ - font-family: 'Noto Sans JP', sans-serif; - height: 30px; - line-height: 30px; - font-size: 13px; - } - - &.deepgray{ - background-color: #2C2C2C; - border: 1px solid #484848; - } - &.gray{ - background-color: #3C3C3C; - border: 1px solid #545454; - } - &.dark{ - background-color: #1C1C1C; - border: 1px solid #484848; - } - &.modal{ - font-family: 'Noto Sans JP', sans-serif; - background-color: #272727; - border: 1px solid #484848; - color: #aaa; - &:hover{ - background-color: #1083E3; - border: 1px solid #1083E3; - color: #fff; - font-weight: 500; - } - } - &.sub-tab{ - height: 30px; - padding: 0 10px; - line-height: 28px; - font-family: 'Noto Sans JP', sans-serif; - background-color: #2D2D2D; - border: 1px solid #393939; - color: #aaa; - &.act, - &:hover{ - background-color: #414E6C; - border: 1px solid #414E6C; - color: #fff; - font-weight: 500; - } - } - &.roof{ - height: 30px; - padding: 0 10px; - line-height: 28px; - font-family: 'Noto Sans JP', sans-serif; - background-color: transparent; - border: 1px solid #484848; - color: #fff; - &.blue{ - background-color: #4C6FBF; - border: 1px solid #4C6FBF; - &:hover{ - background-color: #414E6C; - border: 1px solid #414E6C; - } - } - &.white{ - background-color: #fff; - border: 1px solid #fff; - color: #101010; - &:hover{ - background-color: #fff; - border: 1px solid #fff; - color: #101010; - } - } - &:hover{ - font-weight: 400; - background-color: transparent; - border: 1px solid #484848; - color: #fff; - } - } - &.self{ - height: 30px; - padding: 0 10px; - line-height: 28px; - font-family: 'Noto Sans JP', sans-serif; - background-color: transparent; - border: 1px solid #676767; - color: #AAAAAA; - &:hover{ - background-color: #272727; - border-color: #676767; - font-weight: 400; - } - } - &:hover, - &.act{ - background-color: #1083E3; - border: 1px solid #1083E3; - color: #fff; - font-weight: 500; - } - &.block{ - display: block; - width: 100%; - } - &.ico-flx{ - display: flex; - align-items: center; - .ico{ - margin-right: 10px; - } - &:hover, - &.act{ - font-weight: 400; - } - } +.mt5 { + margin-top: 5px !important; +} +.mt10 { + margin-top: 10px !important; +} +.mt15 { + margin-top: 15px !important; +} +.mb5 { + margin-bottom: 5px !important; +} +.mb10 { + margin-bottom: 10px !important; +} +.mb15 { + margin-bottom: 15px !important; +} +.mr5 { + margin-right: 5px !important; +} +.mr10 { + margin-right: 10px !important; +} +.mr15 { + margin-right: 15px !important; +} +.ml5 { + margin-left: 5px !important; +} +.ml10 { + margin-left: 10px !important; +} +.ml15 { + margin-left: 15px !important; } -.btn-origin{ - display: inline-block; +// align +.al-l { + text-align: left !important; +} +.al-r { + text-align: right !important; +} +.al-c { + text-align: center !important; +} + +// button +.btn-frame { + display: inline-block; + padding: 0 7px; + height: 34px; + line-height: 34px; + border-radius: 2px; + color: #fff; + font-size: 12px; + font-weight: 400; + border: 1px solid #000; + text-align: center; + font-family: 'Pretendard', sans-serif; + transition: all 0.17s ease-in-out; + cursor: pointer; + &.block { + width: 100%; + } + &.small { + font-family: 'Noto Sans JP', sans-serif; + height: 30px; + line-height: 30px; + font-size: 13px; + } + + &.deepgray { + background-color: #2c2c2c; + border: 1px solid #484848; + } + &.gray { + background-color: #3c3c3c; + border: 1px solid #545454; + } + &.dark { + background-color: #1c1c1c; + border: 1px solid #484848; + } + &.modal { + font-family: 'Noto Sans JP', sans-serif; + background-color: #272727; + border: 1px solid #484848; + color: #aaa; + &:hover { + background-color: #1083e3; + border: 1px solid #1083e3; + color: #fff; + font-weight: 500; + } + } + &.sub-tab { height: 30px; padding: 0 10px; - border-radius: 2px; - background-color: #101010; + line-height: 28px; + font-family: 'Noto Sans JP', sans-serif; + background-color: #2d2d2d; + border: 1px solid #393939; + color: #aaa; + &.act, + &:hover { + background-color: #414e6c; + border: 1px solid #414e6c; + color: #fff; + font-weight: 500; + } + } + &.roof { + height: 30px; + padding: 0 10px; + line-height: 28px; + font-family: 'Noto Sans JP', sans-serif; + background-color: transparent; + border: 1px solid #484848; color: #fff; - font-size: 13px; - font-weight: 400; - transition: all .15s ease-in-out; - &.navy{ - background-color: #304961; - &:hover{ - background-color: #233546; - } + &.blue { + background-color: #4c6fbf; + border: 1px solid #4c6fbf; + &:hover { + background-color: #414e6c; + border: 1px solid #414e6c; + } } - &.grey{ - background-color: #94A0AD; - &:hover{ - background-color: #607F9A; - } - } - &.green{ - background-color: #A6BBA8; - &:hover{ - background-color: #98af9b; - } - } - &.white{ - border: 1px solid #94A0AD; + &.white { + background-color: #fff; + border: 1px solid #fff; + color: #101010; + &:hover { background-color: #fff; - color: #94A0AD; - &:hover{ - background-color: #fff; - } + border: 1px solid #fff; + color: #101010; + } } + &:hover { + font-weight: 400; + background-color: transparent; + border: 1px solid #484848; + color: #fff; + } + } + &.self { + height: 30px; + padding: 0 10px; + line-height: 28px; + font-family: 'Noto Sans JP', sans-serif; + background-color: transparent; + border: 1px solid #676767; + color: #aaaaaa; + &:hover { + background-color: #272727; + border-color: #676767; + font-weight: 400; + } + } + &:hover, + &.act { + background-color: #1083e3; + border: 1px solid #1083e3; + color: #fff; + font-weight: 500; + } + &.block { + display: block; + width: 100%; + } + &.ico-flx { + display: flex; + align-items: center; + .ico { + margin-right: 10px; + } + &:hover, + &.act { + font-weight: 400; + } + } +} + +.btn-origin { + display: inline-block; + height: 30px; + padding: 0 10px; + border-radius: 2px; + background-color: #101010; + color: #fff; + font-size: 13px; + font-weight: 400; + transition: all 0.15s ease-in-out; + &.navy { + background-color: #304961; + &:hover { + background-color: #233546; + } + } + &.grey { + background-color: #94a0ad; + &:hover { + background-color: #607f9a; + } + } + &.green { + background-color: #a6bba8; + &:hover { + background-color: #98af9b; + } + } + &.white { + border: 1px solid #94a0ad; + background-color: #fff; + color: #94a0ad; + &:hover { + background-color: #fff; + } + } } // select -.sort-select{ - position: relative; - display: inline-block; - min-width: 100px; - height: 30px; - line-height: 30px; - padding: 0 25px 0 10px; - background-color: #373737; - border: 1px solid #3F3F3F; - border-radius: 2px; - border-top-left-radius: 2px; +.sort-select { + position: relative; + display: inline-block; + min-width: 100px; + height: 30px; + line-height: 30px; + padding: 0 25px 0 10px; + background-color: #373737; + border: 1px solid #3f3f3f; + border-radius: 2px; + border-top-left-radius: 2px; + color: #fff; + cursor: pointer; + p { + font-size: 13px; color: #fff; - cursor: pointer; - p{ - font-size: 13px; + height: 100%; + overflow: hidden; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 1; + -webkit-box-orient: vertical; + } + .select-item-wrap { + position: absolute; + top: 100%; + left: -1px; + clip-path: inset(0 0 100% 0); + width: calc(100% + 2px); + padding: 8px 0; + max-height: 116px; + overflow-y: auto; + background-color: #373737; + border: 1px solid #3f3f3f; + border-radius: 2px; + transition: all 0.17s ease-in-out; + visibility: hidden; + z-index: 999; + .select-item { + display: flex; + align-items: center; + padding: 8px 20px; + line-height: 1.4; + transition: all 0.17s ease-in-out; + button { + font-size: 12px; color: #fff; - height: 100%; - overflow: hidden; - text-overflow: ellipsis; - display: -webkit-box; - -webkit-line-clamp: 1; - -webkit-box-orient: vertical; + line-height: 1.4; + } + &:hover { + background-color: #2c2c2c; + } } - .select-item-wrap{ - position: absolute; - top: 100%; - left: -1px; - clip-path:inset(0 0 100% 0); - width: calc(100% + 2px); - padding: 8px 0; - max-height: 116px; - overflow-y: auto; - background-color: #373737; - border: 1px solid #3F3F3F; - border-radius: 2px; - transition: all 0.17s ease-in-out; - visibility: hidden; - z-index: 999; - .select-item{ - display: flex; - align-items: center; - padding: 8px 20px; - line-height: 1.4; - transition: all .17s ease-in-out; - button{ - font-size: 12px; - color: #fff; - line-height: 1.4; - } - &:hover{ - background-color: #2C2C2C; - } - } - &::-webkit-scrollbar { - width: 2px; - background-color: transparent; - - } - &::-webkit-scrollbar-thumb { - background-color: #5a5a5a; - border-radius: 10px; - } - &::-webkit-scrollbar-track { - background-color: transparent; - } + &::-webkit-scrollbar { + width: 2px; + background-color: transparent; } - &::after{ - content: ''; - position: absolute; - top: 50%; - right: 7px; - transform: translateY(-50%); - width: 10px; - height: 6px; - background: url(/static/images/common/select-arr.svg) no-repeat center; - background-size: cover; - transition: all .17s ease-in-out; + &::-webkit-scrollbar-thumb { + background-color: #5a5a5a; + border-radius: 10px; } - &.active{ - .select-item-wrap{ - clip-path: inset(0 0 0 0); - visibility: visible; - } - &:after{ - transform: translateY(-50%) rotate(-180deg); - } + &::-webkit-scrollbar-track { + background-color: transparent; } - &.disabled{ - cursor: default; - p{ - color: #aaa; - } - &::after{ - opacity: 0.7; - } + } + &::after { + content: ''; + position: absolute; + top: 50%; + right: 7px; + transform: translateY(-50%); + width: 10px; + height: 6px; + background: url(/static/images/common/select-arr.svg) no-repeat center; + background-size: cover; + transition: all 0.17s ease-in-out; + } + &.active { + .select-item-wrap { + clip-path: inset(0 0 0 0); + visibility: visible; } + &:after { + transform: translateY(-50%) rotate(-180deg); + } + } + &.disabled { + cursor: default; + p { + color: #aaa; + } + &::after { + opacity: 0.7; + } + } } -.select-light{ - position: relative; +.select-light { + position: relative; + display: block; + width: 100%; + height: 30px; + background: #fff url(../../public/static/images/common/select_light_arr.svg) calc(100% - 11px) center no-repeat; + background-size: 10px 6px; + border: 1px solid #eee; + padding: 0 30px 0 10px; + font-size: 13px; + color: #45576f; + font-family: 'Noto Sans JP', sans-serif; + cursor: pointer; + &:disabled { + opacity: 1; + background-color: #fafafa; + color: #999; + cursor: default; + } + &.black { + color: #101010; + } + &.dark { + background: #323234 url(../../public/static/images/common/select_dark_arr.svg) calc(100% - 11px) center no-repeat; + color: #898989; + font-size: 12px; + border-radius: 2px; + border: none; + } +} + +// input +.form-input { + label { + display: block; + color: #aaa; + font-size: 12px; + font-weight: 500; + margin-bottom: 10px; + } +} +input[type='password'], +input[type='number'], +input[type='text'] { + &.input-origin { + display: inline-block; + height: 30px; + line-height: 30px; + border-radius: 2px; + background-color: #323234; + border: 1px solid #323234; + color: #fff; + font-size: 12px; + font-weight: 500; + font-family: 'Pretendard', sans-serif; + padding: 0 10px; + letter-spacing: 0px; + text-align: right; + transition: border 0.15s ease-in-out; + &:focus { + border: 1px solid #1083e3; + } + &::placeholder { + font-family: 'Noto Sans JP', sans-serif; + opacity: 1; + font-size: 12px; + letter-spacing: 0px; + } + &.block { + width: 100%; + } + &:read-only { + color: #aaa; + &:focus { + border: 1px solid #323234; + } + } + &.plane { + font-family: 'Noto Sans JP', sans-serif; + border: 1px solid #525252; + background-color: transparent; + } + } + &.input-light { display: block; width: 100%; height: 30px; - background: #FFF url(../../public/static/images/common/select_light_arr.svg) calc(100% - 11px) center no-repeat; - background-size: 10px 6px; + padding: 0 10px; border: 1px solid #eee; - padding: 0 30px 0 10px; - font-size: 13px; - color: #45576F; + border-radius: 2px; + background-color: #fff; font-family: 'Noto Sans JP', sans-serif; - cursor: pointer; - &:disabled{ - opacity: 1; - background-color: #FAFAFA; - color: #999; - cursor: default; + font-size: 13px; + color: #45576f; + font-weight: normal; + transition: border-color 0.17s ease-in-out; + text-align: left; + &:focus { + border-color: #94a0ad; } - &.black{ - color: #101010; - } - &.dark{ - background: #323234 url(../../public/static/images/common/select_dark_arr.svg) calc(100% - 11px) center no-repeat; - color: #898989; - font-size: 12px; - border-radius: 2px; - border: none; + &:read-only { + background-color: #fafafa; + color: #999999; + &:focus { + border-color: #eee; + } } + } } - -// input -.form-input{ - label{ - display: block; - color: #aaa; - font-size: 12px; - font-weight: 500; - margin-bottom: 10px; - } -} -input[type=password], -input[type=number], -input[type=text]{ - &.input-origin{ - display: inline-block; - height: 30px; - line-height: 30px; - border-radius: 2px; - background-color: #323234; - border: 1px solid #323234; - color: #fff; - font-size: 12px; - font-weight: 500; - font-family: 'Pretendard', sans-serif; - padding: 0 10px; - letter-spacing: 0px; - text-align: right; - transition: border .15s ease-in-out; - &:focus{ - border: 1px solid #1083E3; - } - &::placeholder{ - font-family: 'Noto Sans JP', sans-serif; - opacity: 1; - font-size: 12px; - letter-spacing: 0px; - } - &.block{ - width: 100%; - } - &:read-only{ - color: #AAA; - &:focus{ - border: 1px solid #323234; - } - } - &.plane{ - font-family: 'Noto Sans JP', sans-serif; - border: 1px solid #525252; - background-color: transparent; - } - } - &.input-light{ - display: block; - width: 100%; - height: 30px; - padding: 0 10px; - border: 1px solid #eee; - border-radius: 2px; - background-color: #fff; - font-family: 'Noto Sans JP', sans-serif; - font-size: 13px; - color: #45576F; - font-weight: normal; - transition: border-color .17s ease-in-out; - text-align: left; - &:focus{ - border-color: #94A0AD; - } - &:read-only{ - background-color: #FAFAFA; - color: #999999; - &:focus{ - border-color: #eee; - } - } - } -} - - - // check-btn -.check-btn{ - display: flex; - align-items: center; - height: 30px; - background-color: #3A3A3A; - border-radius: 3px; - transition: all .17s ease-in-out; - .check-area{ - flex: none; - width: 30px; - height: 100%; - border-right: 1px solid #272727; - background: url(../../public/static/images/canvas/check-grey.svg)no-repeat center; - background-size: 11px 9px; +.check-btn { + display: flex; + align-items: center; + height: 30px; + background-color: #3a3a3a; + border-radius: 3px; + transition: all 0.17s ease-in-out; + .check-area { + flex: none; + width: 30px; + height: 100%; + border-right: 1px solid #272727; + background: url(../../public/static/images/canvas/check-grey.svg) no-repeat center; + background-size: 11px 9px; + } + .title-area { + padding: 0 10px; + font-size: 12px; + color: #898989; + font-weight: 400; + } + &.block { + width: 100%; + } + &:hover, + &.act { + background-color: #fff; + .check-area { + border-right: 1px solid #101010; + background: url(../../public/static/images/canvas/check-black.svg) no-repeat center; } - .title-area{ - padding: 0 10px; - font-size: 12px; - color: #898989; - font-weight: 400; - } - &.block{ - width: 100%; - } - &:hover, - &.act{ - background-color: #fff; - .check-area{ - border-right: 1px solid #101010; - background: url(../../public/static/images/canvas/check-black.svg)no-repeat center; - } - .title-area{ - color: #101010; - font-weight: 600; - } + .title-area { + color: #101010; + font-weight: 600; } + } } // arr-btn -.arr-btn{ - display: block; - height: 30px; - border-radius: 3px; - background-color: #3A3A3A; - padding: 0 11px; - text-align: left; - transition: all .17s ease-in-out; - span{ - position: relative; - font-size: 12px; - color: #898989; - font-weight: 400; - padding-right: 15px; - &:after{ - content: ''; - position: absolute; - top: 50%; - right: 0; - transform: translateY(-50%); - width: 5px; - height: 8px; - background: url(../../public/static/images/canvas/arr_btn_ico.svg)no-repeat center; - } +.arr-btn { + display: block; + height: 30px; + border-radius: 3px; + background-color: #3a3a3a; + padding: 0 11px; + text-align: left; + transition: all 0.17s ease-in-out; + span { + position: relative; + font-size: 12px; + color: #898989; + font-weight: 400; + padding-right: 15px; + &:after { + content: ''; + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + width: 5px; + height: 8px; + background: url(../../public/static/images/canvas/arr_btn_ico.svg) no-repeat center; + } + } + &:hover, + &.act { + background-color: #fff; + span { + color: #101010; + font-weight: 500; + &:after { + background: url(../../public/static/images/canvas/arr_btn_ico_black.svg) no-repeat center; + } + } + } + &.dark { + text-align: center; + background-color: #272727; + border: 1px solid #484848; + span { + color: #fff; + &:after { + background: url(../../public/static/images/canvas/arr_btn_ico_white.svg) no-repeat center; + } } &:hover, - &.act{ - background-color: #fff; - span{ - color: #101010; - font-weight: 500; - &:after{ - background: url(../../public/static/images/canvas/arr_btn_ico_black.svg)no-repeat center; - } - } - } - &.dark{ - text-align: center; - background-color: #272727; - border: 1px solid #484848; - span{ - color: #Fff; - &:after{ - background: url(../../public/static/images/canvas/arr_btn_ico_white.svg)no-repeat center; - } - } - &:hover, - &.act{ - background-color: #1083E3; - border: 1px solid #1083E3; - } + &.act { + background-color: #1083e3; + border: 1px solid #1083e3; } + } } // radio .d-check-radio, -.d-check-box{ - line-height: 1.1; +.d-check-box { + line-height: 1.1; + cursor: pointer; + input[type='checkbox'], + input[type='radio'] { + position: static; + margin-left: 0; cursor: pointer; - input[type=checkbox], - input[type=radio]{ - position: static; - margin-left: 0; - cursor: pointer; - opacity: 0; - z-index: 1; - flex: 0 0 auto; + opacity: 0; + z-index: 1; + flex: 0 0 auto; + } + label { + position: relative; + padding-left: 10px; + margin-bottom: 0; + word-break: break-all; + line-height: 1.2; + display: inline; + vertical-align: top; + color: #fff; + font-size: 13px; + font-weight: 400; + cursor: pointer; + } + &.light { + label { + color: #45576f; } - label{ - position: relative; - padding-left: 10px; - margin-bottom: 0; - word-break: break-all; - line-height: 1.2; - display: inline; - vertical-align: top; - color: #fff; - font-size: 13px; - font-weight: 400; - cursor: pointer; - } - &.light{ - label{ - color: #45576F; - } - } - &.no-text{ - label{ - padding-left: 0; - } + } + &.no-text { + label { + padding-left: 0; } + } } .d-check-radio { - label{ - &::before{ - cursor: pointer; - content: ""; - display: inline-block; - position: absolute; - width: 17px; - height: 17px; - top:2px; - left: 0; - margin-left: -12px; - border: 1px solid #999999; - border-radius: 100%; - background-color: transparent; - text-align:center; - font-size:13px; - line-height:1.4; - transition: border 0.15s ease-in-out, color 0.15s ease-in-out; - } - &::after{ - cursor: pointer; - content: ""; - display: inline-block; - position: absolute; - width: 9px; - height: 9px; - top:6px; - left: 4px; - margin-left: -12px; - border: none; - border-radius: 100%; - background-color: #fff; - text-align:center; - font-size:13px; - line-height:1.4; - opacity: 0; - visibility: hidden; - transition: opacity 0.15s ease-in-out, color 0.15s ease-in-out; - } + label { + &::before { + cursor: pointer; + content: ''; + display: inline-block; + position: absolute; + width: 17px; + height: 17px; + top: 2px; + left: 0; + margin-left: -12px; + border: 1px solid #999999; + border-radius: 100%; + background-color: transparent; + text-align: center; + font-size: 13px; + line-height: 1.4; + transition: + border 0.15s ease-in-out, + color 0.15s ease-in-out; } - &.light{ - label{ - &:before{ - border-color: #D6D6D7; - } - &:after{ - background-color: #697C8F; - } - } + &::after { + cursor: pointer; + content: ''; + display: inline-block; + position: absolute; + width: 9px; + height: 9px; + top: 6px; + left: 4px; + margin-left: -12px; + border: none; + border-radius: 100%; + background-color: #fff; + text-align: center; + font-size: 13px; + line-height: 1.4; + opacity: 0; + visibility: hidden; + transition: + opacity 0.15s ease-in-out, + color 0.15s ease-in-out; } - input[type=radio]:checked + label::after{ - opacity: 1; - visibility: visible; + } + &.light { + label { + &:before { + border-color: #d6d6d7; + } + &:after { + background-color: #697c8f; + } } - &.pop{ - label{ - font-size: 12px; - &:before{ - width: 16px; - height: 16px; - border-color: #fff; - } - &:after{ - width: 8px; - height: 8px; - background-color: #fff; - } - } + } + input[type='radio']:checked + label::after { + opacity: 1; + visibility: visible; + } + &.pop { + label { + font-size: 12px; + &:before { + width: 16px; + height: 16px; + border-color: #fff; + } + &:after { + width: 8px; + height: 8px; + background-color: #fff; + } } + } } // check-box -.d-check-box{ - label{ - &.red{color: #FFCACA;} - &::before{ - cursor: pointer; - content: ""; - display: inline-block; - position: absolute; - width: 17px; - height: 17px; - top: 2px; - left: 0; - margin-left: -12px; - border: 1px solid #D6D6D7; - background-color: #fff; - transition: border 0.15s ease-in-out, color 0.15s ease-in-out; - } - &:after{ - cursor: pointer; - content: ""; - display: inline-block; - position: absolute; - width: 16px; - height: 16px; - top:0; - left: 0; - margin-left: -.8rem; - transition: border 0.05s ease-in-out, color 0.05s ease-in-out; - } +.d-check-box { + label { + &.red { + color: #ffcaca; } - input[type=checkbox]:checked + label::after{ - content: ""; - display: inline-block; - position: absolute; - top: 1px; - left: -1px; - width: 5px; - height: 8px; - border: 2px solid #697C8F; - border-left: none; - border-top: none; - transform: translate(7.75px,4.5px) rotate(45deg); - -ms-transform: translate(7.75px,4.5px) rotate(45deg); + &::before { + cursor: pointer; + content: ''; + display: inline-block; + position: absolute; + width: 17px; + height: 17px; + top: 2px; + left: 0; + margin-left: -12px; + border: 1px solid #d6d6d7; + background-color: #fff; + transition: + border 0.15s ease-in-out, + color 0.15s ease-in-out; } - input[type=checkbox]:disabled + label::before{ - background-color: #FAFAFA; + &:after { + cursor: pointer; + content: ''; + display: inline-block; + position: absolute; + width: 16px; + height: 16px; + top: 0; + left: 0; + margin-left: -0.8rem; + transition: + border 0.05s ease-in-out, + color 0.05s ease-in-out; } - input[type=checkbox]:disabled + label::after{ - border-color: #999; + } + input[type='checkbox']:checked + label::after { + content: ''; + display: inline-block; + position: absolute; + top: 1px; + left: -1px; + width: 5px; + height: 8px; + border: 2px solid #697c8f; + border-left: none; + border-top: none; + transform: translate(7.75px, 4.5px) rotate(45deg); + -ms-transform: translate(7.75px, 4.5px) rotate(45deg); + } + input[type='checkbox']:disabled + label::before { + background-color: #fafafa; + } + input[type='checkbox']:disabled + label::after { + border-color: #999; + } + &.pop { + label { + &:before { + background-color: transparent; + } } - &.pop{ - label{ - &:before{ - background-color: transparent; - } - } - input[type=checkbox]:checked + label::after{ - border-color: #fff; - } - &.no-text{ - label{ - padding-left: 0; - } - } + input[type='checkbox']:checked + label::after { + border-color: #fff; } - &.sel{ - input[type=checkbox]:checked + label{ - color: #D7C863; - } - input[type=checkbox]:checked + label::before, - input[type=checkbox]:checked + label::after{ - border-color: #D7C863; - } + &.no-text { + label { + padding-left: 0; + } } + } + &.sel { + input[type='checkbox']:checked + label { + color: #d7c863; + } + input[type='checkbox']:checked + label::before, + input[type='checkbox']:checked + label::after { + border-color: #d7c863; + } + } } // date-picker -.date-picker{ - svg{display: none;} - .react-datepicker-wrapper{ - width: 100%; - } - input[type=text]{ - display: block; - width: 100%; - height: 30px; - padding: 0 34px 0 10px; - border-radius: 2px; - border: 1px solid #eee; - font-size: 13px; - color: #45576F; - font-weight: normal; - font-family: 'Noto Sans JP', sans-serif; - background: #fff url(../../public/static/images/common/datepicker.svg) calc(100% - 11px) center no-repeat; - background-size: 14px 15px; - cursor: pointer; - } +.date-picker { + svg { + display: none; + } + .react-datepicker-wrapper { + width: 100%; + } + input[type='text'] { + display: block; + width: 100%; + height: 30px; + padding: 0 34px 0 10px; + border-radius: 2px; + border: 1px solid #eee; + font-size: 13px; + color: #45576f; + font-weight: normal; + font-family: 'Noto Sans JP', sans-serif; + background: #fff url(../../public/static/images/common/datepicker.svg) calc(100% - 11px) center no-repeat; + background-size: 14px 15px; + cursor: pointer; + } } // react select -.react-select-custom{ - width: 100%; - .custom__control{ - height: 30px; - min-height: unset; - border-radius: 2px; - border-color: #EEE; - background-color: #fff; - &:hover{ - border-color: #EEE; - } +.react-select-custom { + width: 100%; + .custom__control { + height: 30px; + min-height: unset; + border-radius: 2px; + border-color: #eee; + background-color: #fff; + &:hover { + border-color: #eee; } - .custom__control--is-focused{ - border-color: #EEE; - box-shadow: unset; - &:hover{ - border-color: #EEE; + } + .custom__control--is-focused { + border-color: #eee; + box-shadow: unset; + &:hover { + border-color: #eee; + } + } + .custom__value-container { + height: 100%; + padding: 0 10px; + } + .custom__placeholder, + .custom__single-value { + margin: 0; + } + .custom__single-value { + font-size: 13px; + color: #45576f; + font-weight: 400; + } + .custom__placeholder { + font-size: 13px; + color: #bbbbbb; + font-weight: 400; + } + .custom__indicator { + padding: 0; + svg { + display: none; + } + } + .custom__clear-indicator { + width: 30px; + height: 100%; + background: url(../../public/static/images/common/select_del.svg) no-repeat center; + background-size: 8px 8px; + } + .custom__dropdown-indicator { + width: 30px; + height: 100%; + background: url(../../public/static/images/common/select_light_arr.svg) no-repeat center; + } - } + .custom__menu { + margin: 1px 0; + border-radius: 2px; + overflow: hidden; + } + .custom__menu-list { + padding: 0; + } + .custom__option { + font-size: 13px; + padding: 7px 10px; + color: #45576f; + } + .custom__option--is-selected { + background-color: #2684ff; + color: #fff !important; + &.custom__option--is-focused { + background-color: #2684ff; + color: #fff; } - .custom__value-container { - height: 100%; - padding: 0 10px; + } + .custom__option--is-focused { + background-color: #deebff; + color: #45576f; + } + .special-option { + color: #2684ff; + } + // disable + &.custom--is-disabled { + .custom__control { + background-color: #fafafa; } - .custom__placeholder, - .custom__single-value{ - margin: 0; + .custom__single-value { + color: #999999; } - .custom__single-value{ - font-size: 13px; - color: #45576F; - font-weight: 400; - } - .custom__placeholder{ - font-size: 13px; - color: #bbbbbb; - font-weight: 400; - } - .custom__indicator{ - padding: 0; - svg{ - display: none; - } - } - .custom__clear-indicator{ - width: 30px; - height: 100%; - background: url(../../public/static/images/common/select_del.svg) no-repeat center; - background-size: 8px 8px; - } - .custom__dropdown-indicator{ - width: 30px; - height: 100%; - background: url(../../public/static/images/common/select_light_arr.svg) no-repeat center; - } - - .custom__menu { - margin: 1px 0; - border-radius: 2px; - overflow: hidden; - } - .custom__menu-list { - padding: 0; - } - .custom__option{ - font-size: 13px; - padding: 7px 10px; - color: #45576F; - - } - .custom__option--is-selected{ - background-color: #2684FF; - color: #fff !important; - &.custom__option--is-focused{ - background-color: #2684FF; - color: #fff; - } - } - .custom__option--is-focused{ - background-color: #DEEBFF; - color: #45576F; - } - .special-option{ - color: red; - } - // disable - &.custom--is-disabled{ - .custom__control{ - background-color: #FAFAFA ; - } - .custom__single-value{ - color: #999999; - } - } - + } } // toggle .toggle-btn { - position: relative; - display: inline-block; - width: 55px; - height: 20px; - input { - display: none; - } + position: relative; + display: inline-block; + width: 55px; + height: 20px; + input { + display: none; + } } .slider { + position: absolute; + cursor: pointer; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: #454545; + transition: 0.4s; + border-radius: 10px; + text-align: center; + line-height: 20px; + color: white; + font-size: 12px; + font-weight: 400; + &:after { + content: 'OFF'; position: absolute; - cursor: pointer; - top: 0; - left: 0; - right: 0; - bottom: 0; - background-color: #454545; - transition: .4s; - border-radius: 10px; - text-align: center; - line-height: 20px; + right: 7px; color: white; font-size: 12px; font-weight: 400; - &:after { - content: 'OFF'; - position: absolute; - right: 7px; - color: white; - font-size: 12px; - font-weight: 400; - } - &:before { - position: absolute; - content: ""; - height: 16px; - width: 16px; - left: 2px; - bottom: 2px; - background-color: white; - transition: .4s; - border-radius: 50%; - } + } + &:before { + position: absolute; + content: ''; + height: 16px; + width: 16px; + left: 2px; + bottom: 2px; + background-color: white; + transition: 0.4s; + border-radius: 50%; + } } input:checked + .slider { - background-color: #2563EB; - &:after { - content: 'ON'; - left: 10px; - right: auto; - } - &:before { - transform: translateX(35px); - } -} \ No newline at end of file + background-color: #2563eb; + &:after { + content: 'ON'; + left: 10px; + right: auto; + } + &:before { + transform: translateX(35px); + } +} + +// alert z-index +.swal2-container { + z-index: 100000; +} From 90b52abb7f267c97853ce807d05d14d4b4ea1d5a Mon Sep 17 00:00:00 2001 From: Daseul Kim Date: Thu, 23 Jan 2025 17:54:02 +0900 Subject: [PATCH 097/130] =?UTF-8?q?refactor:=20current=20plan=20=EC=9D=B4?= =?UTF-8?q?=EB=8F=99=20=EC=8B=9C=20useEffect=20=ED=98=B8=EC=B6=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0,=20=EC=B4=88=EA=B8=B0=20plan=20=EC=A0=80?= =?UTF-8?q?=EC=9E=A5=20=EC=8B=9C=20=ED=8C=9D=EC=97=85=20=EB=AF=B8=ED=91=9C?= =?UTF-8?q?=EC=B6=9C=ED=95=98=EB=8F=84=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/CanvasFrame.jsx | 8 ++-- src/hooks/usePlan.js | 45 +++++++++++------------ 2 files changed, 25 insertions(+), 28 deletions(-) diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index 6722fea8..eb8e7bea 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -24,15 +24,15 @@ export default function CanvasFrame() { const currentMenu = useRecoilValue(currentMenuState) const { floorPlanState } = useContext(FloorPlanContext) const { contextMenu, handleClick } = useContextMenu() - const { selectedPlan } = usePlan() + const { currentCanvasPlan } = usePlan() const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부 const { setIsGlobalLoading } = useContext(QcastContext) const loadCanvas = () => { if (canvas) { canvas?.clear() // 캔버스를 초기화합니다. - if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo) { - canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () { + if (currentCanvasPlan?.canvasStatus && floorPlanState.objectNo === currentCanvasPlan.objectNo) { + canvas?.loadFromJSON(JSON.parse(currentCanvasPlan.canvasStatus), function () { canvasLoadInit() //config된 상태로 캔버스 객체를 그린다 canvas?.renderAll() // 캔버스를 다시 그립니다. }) @@ -43,7 +43,7 @@ export default function CanvasFrame() { useEffect(() => { loadCanvas() - }, [selectedPlan, canvas]) + }, [currentCanvasPlan, canvas]) useEffect(() => { setIsGlobalLoading(false) diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js index 36d619c8..6b468405 100644 --- a/src/hooks/usePlan.js +++ b/src/hooks/usePlan.js @@ -128,7 +128,7 @@ export function usePlan(params = {}) { /** * objectNo에 해당하는 canvas 목록을 조회 */ - const getCanvasByObjectNo = async (userId, objectNo) => { + const getCanvasByObjectNo = async (userId, objectNo, planNo) => { return await get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) => res.map((item) => ({ id: item.id, @@ -136,7 +136,7 @@ export function usePlan(params = {}) { planNo: item.planNo, userId: item.userId, canvasStatus: dbToCanvasFormat(item.canvasStatus), - isCurrent: false, + isCurrent: planNo === item.planNo, bgImageName: item.bgImageName, mapPositionAddress: item.mapPositionAddress, })), @@ -174,14 +174,15 @@ export function usePlan(params = {}) { } await promisePost({ url: '/api/canvas-management/canvas-statuses', data: planData }) .then((res) => { + const newPlan = { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus, isCurrent: true } + setCurrentCanvasPlan(newPlan) if (isInitPlan) { // 초기 플랜 생성인 경우 플랜 목록 초기화 - setPlans([{ id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) + setPlans([newPlan]) } else { - setPlans((plans) => [...plans, { id: res.data, objectNo: objectNo, planNo: planNo, userId: userId, canvasStatus: canvasStatus }]) + setPlans((plans) => [...plans.map((plan) => ({ ...plan, isCurrent: false })), newPlan]) + swalFire({ text: getMessage('plan.message.save') }) } - updateCurrentPlan(res.data) - swalFire({ text: getMessage('plan.message.save') }) }) .catch((error) => { swalFire({ text: error.message, icon: 'error' }) @@ -255,14 +256,16 @@ export function usePlan(params = {}) { } setEstimateContextState(res.data) // 클릭한 플랜 탭으로 이동 - updateCurrentPlan(newCurrentId) + setCurrentCanvasPlan(plans.find((plan) => plan.id === newCurrentId)) + setPlans((plans) => plans.map((plan) => ({ ...plan, isCurrent: plan.id === newCurrentId }))) } else { swalFire({ text: getMessage('estimate.menu.move.valid1') }) } } else { // 발전시뮬레이션 if (estimateDetail.tempFlg === '0') { - updateCurrentPlan(newCurrentId) + setCurrentCanvasPlan(plans.find((plan) => plan.id === newCurrentId)) + setPlans((plans) => plans.map((plan) => ({ ...plan, isCurrent: plan.id === newCurrentId }))) } else { swalFire({ text: getMessage('simulator.menu.move.valid1') }) } @@ -278,26 +281,18 @@ export function usePlan(params = {}) { }) } else { if (!currentCanvasPlan || currentCanvasPlan.id !== newCurrentId) { - saveCanvas() + await saveCanvas() } - updateCurrentPlan(newCurrentId) + setCurrentCanvasPlan(plans.find((plan) => plan.id === newCurrentId)) + setPlans((plans) => plans.map((plan) => ({ ...plan, isCurrent: plan.id === newCurrentId }))) } } - const updateCurrentPlan = (newCurrentId) => { - setPlans((plans) => - plans.map((plan) => { - return { ...plan, isCurrent: plan.id === newCurrentId } - }), - ) - } - useEffect(() => { - setCurrentCanvasPlan(plans.find((plan) => plan.isCurrent) || null) - setSelectedPlan(plans.find((plan) => plan.isCurrent)) + setSelectedPlan(currentCanvasPlan) handleCurrentPlanUrl() // setBgImage() - }, [plans]) + }, [currentCanvasPlan]) const handleCurrentPlanUrl = () => { const currentPlan = plans.find((plan) => plan.isCurrent) @@ -368,7 +363,8 @@ export function usePlan(params = {}) { if (!lastPlan) { setCurrentCanvasPlan(null) } else if (targetPlan.id !== lastPlan.id) { - updateCurrentPlan(lastPlan.id) + setCurrentCanvasPlan(lastPlan) + setPlans((plans) => plans.map((plan) => ({ ...plan, isCurrent: plan.id === lastPlan.id }))) } } @@ -377,10 +373,10 @@ export function usePlan(params = {}) { */ const loadCanvasPlanData = async (userId, objectNo, planNo) => { console.log('🚀 ~ loadCanvasPlanData ~ userId, objectNo, planNo:', userId, objectNo, planNo) - await getCanvasByObjectNo(userId, objectNo).then((res) => { + await getCanvasByObjectNo(userId, objectNo, planNo).then((res) => { if (res.length > 0) { + setCurrentCanvasPlan(res.find((plan) => plan.planNo === planNo)) setPlans(res) - updateCurrentPlan(res.find((plan) => plan.planNo === planNo).id) } else { postCanvasStatus(userId, objectNo, '', true) } @@ -397,6 +393,7 @@ export function usePlan(params = {}) { return { canvas, plans, + currentCanvasPlan, selectedPlan, saveCanvas, handleCurrentPlan, From 326b3464966866d47bdb8186302cee22fdc4a223 Mon Sep 17 00:00:00 2001 From: LEEYONGJAE Date: Thu, 23 Jan 2025 18:03:12 +0900 Subject: [PATCH 098/130] =?UTF-8?q?=EB=82=B4=EC=A0=95=EB=B3=B4=20=ED=8C=9D?= =?UTF-8?q?=EC=97=85=20=EC=88=98=EC=A0=95=20-=20=EB=B9=84=EB=B0=80?= =?UTF-8?q?=EB=B2=88=ED=98=B8=20=EC=A0=9C=EA=B1=B0,=20=EB=B6=80=EC=84=9C?= =?UTF-8?q?=EB=AA=85=20=ED=95=84=EB=93=9C=EA=B0=92=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/myInfo/UserInfoModal.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/components/myInfo/UserInfoModal.jsx b/src/components/myInfo/UserInfoModal.jsx index 0d2d1898..2883bf3b 100644 --- a/src/components/myInfo/UserInfoModal.jsx +++ b/src/components/myInfo/UserInfoModal.jsx @@ -39,7 +39,6 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal if (resultData) { setInfo(resultData) - setPassword(resultData.password) } else { alert(getMessage('common.message.no.data')) } @@ -236,7 +235,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal From 910d5c57040d767b2399aafe99e4be682b64efeb Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 23 Jan 2025 18:37:59 +0900 Subject: [PATCH 099/130] =?UTF-8?q?=EA=B0=80=EB=8C=80=20=EC=84=A4=EC=B9=98?= =?UTF-8?q?=20=EC=9E=91=EC=97=85=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/module/useTrestle.js | 43 ++++++++++++++++----- src/hooks/roofcover/usePropertiesSetting.js | 7 +++- src/util/canvas-util.js | 5 +++ 3 files changed, 44 insertions(+), 11 deletions(-) diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js index 5c1d7927..c41ab251 100644 --- a/src/hooks/module/useTrestle.js +++ b/src/hooks/module/useTrestle.js @@ -2,6 +2,7 @@ import { useRecoilValue } from 'recoil' import { canvasState } from '@/store/canvasAtom' import { POLYGON_TYPE } from '@/common/common' import { moduleSelectionDataState } from '@/store/selectedModuleOptions' +import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util' // 회로 및 가대설정 export const useTrestle = () => { @@ -60,6 +61,7 @@ export const useTrestle = () => { const leftExposedHalfTopModules = [] // 왼쪽 면만 노출되어 있는 경우 const rightExposedHalfTopPoints = [] // 오른쪽 면만 노출되어 있는 경우 const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE) + modules.forEach((module) => { const { x, y } = module.getCenterPoint() const isExposedBottom = result.exposedBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2) @@ -525,7 +527,10 @@ export const useTrestle = () => { } const drawRacks = (rackInfos, rackQty, rackIntvlPct, module, direction, l, rackYn) => { - const { width, height, left, top, lastX, lastY } = module + const { width, height, left, top, lastX, lastY, surfaceId } = module + const surface = canvas.getObjects().find((obj) => obj.id === surfaceId) + const roof = canvas.getObjects().find((obj) => obj.id === surface.parentId) + const degree = getDegreeByChon(roof.roofMaterial.pitch) const moduleLeft = lastX ?? left const moduleTop = lastY ?? top @@ -609,7 +614,7 @@ export const useTrestle = () => { rackInfos.forEach((rackInfo) => { const { rackLen, itemId, supFitQty, supFitIntvlPct } = rackInfo - const rackLength = rackLen / 10 + const rackLength = getTrestleLength(rackLen, degree) / 10 const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY - rackLength], { name: 'rack', @@ -634,7 +639,7 @@ export const useTrestle = () => { canvas.add(rack) canvas.renderAll() - startPointY -= rackLength + 3 + startPointY -= rackLength + 8 }) break @@ -643,7 +648,7 @@ export const useTrestle = () => { rackInfos.forEach((rackInfo) => { const { rackLen, itemId, supFitQty, supFitIntvlPct } = rackInfo - const rackLength = rackLen / 10 + const rackLength = getTrestleLength(rackLen, degree) / 10 const rack = new fabric.Line([startPointX, startPointY, startPointX - rackLength, startPointY], { name: 'rack', @@ -668,7 +673,7 @@ export const useTrestle = () => { canvas.add(rack) canvas.renderAll() - startPointX -= rackLength + 3 + startPointX -= rackLength + 8 }) break } @@ -677,7 +682,7 @@ export const useTrestle = () => { rackInfos.forEach((rackInfo) => { const { rackLen, itemId, supFitQty, supFitIntvlPct } = rackInfo - const rackLength = rackLen / 10 + const rackLength = getTrestleLength(rackLen, degree) / 10 const rack = new fabric.Line([startPointX, startPointY, startPointX + rackLength, startPointY], { name: 'rack', @@ -701,7 +706,7 @@ export const useTrestle = () => { canvas.add(rack) canvas.renderAll() - startPointX += rackLength + 3 + startPointX += rackLength + 8 }) break } @@ -709,7 +714,7 @@ export const useTrestle = () => { rackInfos.forEach((rackInfo) => { const { rackLen, itemId, supFitQty, supFitIntvlPct } = rackInfo - const rackLength = rackLen / 10 + const rackLength = getTrestleLength(rackLen, degree) / 10 const rack = new fabric.Line([startPointX, startPointY, startPointX, startPointY + rackLength], { name: 'rack', @@ -733,7 +738,7 @@ export const useTrestle = () => { canvas.add(rack) canvas.renderAll() - startPointY += rackLength + 3 + startPointY += rackLength + 8 }) break } @@ -841,6 +846,7 @@ export const useTrestle = () => { //랙 없음 인 경우 지지금구 설치 const installBracketWithOutRack = (surface, exposedBottomModules, leftExposedHalfBottomModules, rightExposedHalfBottomPoints, isChidory) => { let { rackQty, rackIntvlPct, moduleIntvlHor, moduleIntvlVer } = surface.trestleDetail + const direction = surface.direction rackQty = 3 canvas.renderAll() @@ -861,7 +867,7 @@ export const useTrestle = () => { drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) } - if (rackQty === 5) { + if (!isChidory && rackQty === 5) { drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'C', surface.direction, moduleIntvlHor, moduleIntvlVer) @@ -870,6 +876,10 @@ export const useTrestle = () => { leftExposedHalfBottomModules.forEach((module) => { drawBracketWithOutRack(module, rackIntvlPct, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) + if (rackQty === 3 && findSamePointInBottom(exposedBottomModules, module)) { + // 해당 모듈과 같은 위치 맨 아래에 모듈이 있는 경우 하나 더 설치 필요 + drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) + } if (rackQty === 4) { drawBracketWithOutRack(module, rackIntvlPct / 3, module.leftRows + 1, 'L', surface.direction, moduleIntvlHor, moduleIntvlVer) } @@ -877,12 +887,25 @@ export const useTrestle = () => { rightExposedHalfBottomPoints.forEach((module) => { drawBracketWithOutRack(module, rackIntvlPct, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) + if (rackQty === 3 && !findSamePointInBottom(exposedBottomModules, module)) { + // 해당 모듈과 같은 위치 맨 아래에 모듈이 없는 경우 하나 더 설치 필요 + drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) + } if (rackQty === 4) { drawBracketWithOutRack(module, rackIntvlPct / 3, module.rightRows + 1, 'R', surface.direction, moduleIntvlHor, moduleIntvlVer) } }) } + // 방향에 따라 가장 아래모듈중 같은 좌표가 있는지 확인 + const findSamePointInBottom = (exposedBottomModules, module) => { + const { x, y } = module.getCenterPoint() + return exposedBottomModules.find((exposedBottomModule) => { + const { x: exposedX, y: exposedY } = exposedBottomModule.getCenterPoint() + return Math.abs(x - exposedX) < 2 || Math.abs(y - exposedY) < 2 + }) + } + const drawBracketWithOutRack = (module, rackIntvlPct, count, l, direction, moduleIntvlHor, moduleIntvlVer) => { let { width, height, left, top } = module let startPointX diff --git a/src/hooks/roofcover/usePropertiesSetting.js b/src/hooks/roofcover/usePropertiesSetting.js index 73a72e5a..550bc5c0 100644 --- a/src/hooks/roofcover/usePropertiesSetting.js +++ b/src/hooks/roofcover/usePropertiesSetting.js @@ -120,9 +120,14 @@ export function usePropertiesSetting(id) { } const handleFix = () => { - if (!confirm('외벽선 속성 설정을 완료하시겠습니까?')) { + const isClose = confirm('외벽선 속성 설정을 완료하시겠습니까?') + if (isClose) { + closePopup(id) + return + } else { return } + const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') const notSetAttributes = lines.filter((line) => !line.attributes?.type) diff --git a/src/util/canvas-util.js b/src/util/canvas-util.js index b4d5e42f..5df32879 100644 --- a/src/util/canvas-util.js +++ b/src/util/canvas-util.js @@ -1031,3 +1031,8 @@ export function calculateVisibleModuleHeight(sourceWidth, sourceHeight, angle, d height: Number(visibleHeight.toFixed(1)), // 소수점 두 자리로 고정 } } + +export function getTrestleLength(length, degree) { + const radians = (degree * Math.PI) / 180 + return length * Math.cos(radians) +} From 4ff5ceb2b7849dbbb79e624f7f70a6c8cb46621d Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Thu, 23 Jan 2025 19:09:01 +0900 Subject: [PATCH 100/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C=EB=B0=8F=EA=B0=80?= =?UTF-8?q?=EB=8C=80=EC=84=A4=EC=A0=95=20=EC=8A=B9=EC=95=95=EC=84=A4?= =?UTF-8?q?=EC=A0=95=20=EC=A1=B0=ED=9A=8C=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 26 ++-- .../modal/circuitTrestle/step/StepUp.jsx | 129 +++++++----------- src/hooks/common/useMasterController.js | 64 ++------- 3 files changed, 70 insertions(+), 149 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 2881ec2c..51ca0318 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -82,13 +82,11 @@ export default function CircuitTrestleSetting({ id }) { return } - console.log('🚀 ~ onAutoRecommend ~ selectedModules:', selectedModules) - const params = { - ...getApiProps(), - useModuleItemList: getSelectedModuleList(), + ...getOptYn(), + useModuleItemList: getUseModuleItemList(), roofSurfaceList: getRoofSurfaceList(), - pcsItemList: getModelList(), + pcsItemList: getPcsItemList(), } getPcsAutoRecommendList(params).then((res) => { @@ -104,7 +102,7 @@ export default function CircuitTrestleSetting({ id }) { }) } - const getApiProps = () => { + const getOptYn = () => { return { maxConnYn: pcsCheck.max ? 'Y' : 'N', smpCirYn: pcsCheck.division ? 'Y' : 'N', @@ -112,7 +110,7 @@ export default function CircuitTrestleSetting({ id }) { } } - const getModelList = () => { + const getPcsItemList = () => { return models.map((model) => { return { itemId: model.itemId, @@ -122,11 +120,11 @@ export default function CircuitTrestleSetting({ id }) { }) } - const getSelectedModuleList = () => { + const getUseModuleItemList = () => { return selectedModules.itemList.map((m) => { return { itemId: m.itemId, - mixMatlNo: m.mixMatlNo, + //mixMatlNo: m.mixMatlNo, } }) } @@ -219,12 +217,14 @@ export default function CircuitTrestleSetting({ id }) { setModels, circuitAllocationType, setCircuitAllocationType, - getApiProps, - getSelectedModuleList, - getRoofSurfaceList, - getModelList, + getOptYn, // 옵션 Y/N + getUseModuleItemList, // 사용된 모듈아이템 List + getRoofSurfaceList, // 지붕면 목록 + getPcsItemList, // PCS 아이템 목록 } + console.log('🚀 ~ stepUpProps ~ stepUpProps:', stepUpProps) + return (
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx index 721e6dff..1d436a13 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx @@ -33,60 +33,23 @@ export default function StepUp(props) { useEffect(() => { console.log('🚀 ~ useEffect ~ >>>>>>>>>>>> props:', props) - if (!managementState) { - setManagementState(managementStateLoaded) - } - - const useModuleItemList = models - .filter((m) => m.selected) - .map((model) => { - return { itemId: model.itemId, mixMatlNo: model.mixMatlNo } - }) - // [{ roofSurfaceId: '', roofSurface: '', roofSurfaceIncl: '', moduleList: [{ itemId: '' }] }], - const roofSurfaceList = canvas - .getObjects() - .filter((obj) => ['roofSurface', 'moduleSetupSurface'].includes(obj.name)) - .map((obj) => { - return { - roofSurfaceId: obj.id, - roofSurface: obj.name, - roofSurfaceIncl: obj.angle, - moduleList: selectedModules.itemList?.map((module) => { - return { - itemId: module.itemId, - mixMatlNo: module.mixMatlNo, - } - }), - } - }) - // [{ itemId: '', pcsMkrCd: '', pcsSerCd: '' }], - const pscItemList = models - .filter((m) => m.selected) - .map((model) => { - return { - itemId: model.itemId, - pcsMkrCd: model.pcsMkrCd, - pcsSerCd: model.pcsSerCd, - } - }) - - const params = { - maxConnYn: pcsCheck.max, - smpCirYn: pcsCheck.division, - coldZoneYn: managementState.coldRegionFlg, - useModuleItemList: useModuleItemList, - roofSurfaceList: roofSurfaceList, - pscItemList: pscItemList, - } - //getPcsVoltageStepUpList(null) - // PCS 승압설정 정보 조회 fetchStepUpData() }, []) const fetchStepUpData = async () => { try { - const res = await getPcsVoltageStepUpList() + const params = { + useYn: props.getOptYn(), // 옵션 Y/N + useModuleItemList: props.getUseModuleItemList(), // 사용된 모듈아이템 List + roofSurfaceList: props.getRoofSurfaceList(), // 지붕면 목록 + pcsItemList: props.getPcsItemList(), // PCS 아이템 목록 + } + + console.log('🚀 ~ fetchStepUpData ~ params:', params) + + const res = await getPcsVoltageStepUpList(params) + console.log('🚀 ~ fetchStepUpData ~ res:', res) if (res?.result.code === 200 && res?.data) { const dataArray = Array.isArray(res.data) ? res.data : [res.data] const stepUpListData = formatStepUpListData(dataArray) @@ -104,16 +67,16 @@ export default function StepUp(props) { // PCS 옵션 조회 const formatOptionCodes = (optionList = []) => { - return optionList.map((opt) => ({ - code: opt.pcsOptCd, - name: opt.pcsOptNm, - nameJp: opt.pcsOptNmJp, + return optionList?.map((opt) => ({ + code: opt.pcsOptCd ? opt.pcsOptCd : '', + name: opt.pcsOptNm ? opt.pcsOptNm : '', + nameJp: opt.pcsOptNmJp ? opt.pcsOptNmJp : '', })) } // PCS 승압설정 정보 포맷 const formatStepUpListData = (dataArray = []) => { - return dataArray.map((stepUps) => ({ + return dataArray?.map((stepUps) => ({ ...stepUps, optionList: formatOptionList(stepUps.optionList), pcsItemList: formatPcsItemList(stepUps.pcsItemList), @@ -122,21 +85,21 @@ export default function StepUp(props) { // PCS 옵션 포맷 const formatOptionList = (optionList = []) => { - return optionList.map((option) => ({ - pcsOptCd: option.pcsOptCd, - pcsOptNm: option.pcsOptNm, - pcsOptNmJp: option.pcsOptNmJp, + return optionList?.map((option) => ({ + pcsOptCd: option.pcsOptCd ? option.pcsOptCd : '', + pcsOptNm: option.pcsOptNm ? option.pcsOptNm : '', + pcsOptNmJp: option.pcsOptNmJp ? option.pcsOptNmJp : '', })) } // PCS 아이템 포맷 const formatPcsItemList = (pcsItemList = []) => { - return pcsItemList.map((item) => ({ - goodsNo: item.goodsNo, - itemId: item.itemId, - itemNm: item.itemNm, - pcsMkrCd: item.pcsMkrCd, - pcsSerCd: item.pcsSerCd, + return pcsItemList?.map((item) => ({ + goodsNo: item.goodsNo ? item.goodsNo : '', + itemId: item.itemId ? item.itemId : '', + itemNm: item.itemNm ? item.itemNm : '', + pcsMkrCd: item.pcsMkrCd ? item.pcsMkrCd : '', + pcsSerCd: item.pcsSerCd ? item.pcsSerCd : '', connList: formatConnList(item.connList), serQtyList: formatSerQtyList(item.serQtyList), })) @@ -144,21 +107,21 @@ export default function StepUp(props) { // PCS 연결 포맷 const formatConnList = (connList = []) => { - return connList.map((conn) => ({ - connAllowCur: conn.connAllowCur, - connMaxParalCnt: conn.connMaxParalCnt, - goodsNo: conn.goodsNo, - itemId: conn.itemId, - itemNm: conn.itemNm, - vstuParalCnt: conn.vstuParalCnt, + 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, })) } // PCS 시리즈 포맷 const formatSerQtyList = (serQtyList = []) => { - return serQtyList.map((qty) => ({ - serQty: qty.serQty, - paralQty: qty.paralQty, + return serQtyList?.map((qty) => ({ + serQty: qty.serQty ? qty.serQty : 0, + paralQty: qty.paralQty ? qty.paralQty : 0, })) } @@ -180,7 +143,9 @@ export default function StepUp(props) { {stepUp?.pcsItemList.map((_, idx) => (
-
{stepUp.pcsItemList[idx].goodsNo}
+
+ {stepUp.pcsItemList[idx].goodsNo} +
{header.name}{header.name}
{row[header.prop]} + {row[header.prop]} +
{footer} + {footer} +
{getMessage('myinfo.info.category')}
- +
@@ -189,7 +154,7 @@ export default function StepUp(props) { - + {stepUp.pcsItemList[idx].serQtyList.map((item) => { return ( @@ -230,9 +195,9 @@ export default function StepUp(props) { - - - + + +
{getMessage('modal.circuit.trestle.setting.step.up.allocation.total.amount')}
{stepUp.pcsItemList[idx].connList[0].goodsNo}{stepUp.pcsItemList[idx].connList[0].connMaxParalCnt}{stepUp.pcsItemList[idx].connList[0].vstuParalCnt}{stepUp.pcsItemList[idx].connList?.goodsNo}{stepUp.pcsItemList[idx].connList?.connMaxParalCnt}{stepUp.pcsItemList[idx].connList?.vstuParalCnt}
@@ -245,8 +210,10 @@ export default function StepUp(props) { - - + {/* + */} + + @@ -273,7 +240,7 @@ export default function StepUp(props) { {optCodes.length > 0 && (
{/* */} - +
)} diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js index e12ac4a5..c2cc65dc 100644 --- a/src/hooks/common/useMasterController.js +++ b/src/hooks/common/useMasterController.js @@ -187,63 +187,17 @@ export function useMasterController() { */ const getPcsVoltageStepUpList = async (params2 = null) => { const params = { - maxConnYn: 'N', - smpCirYn: 'Y', - coldZoneYn: 'N', - useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }], - roofSurfaceList: [ - { - roofSurfaceId: '1', - roofSurface: '남서', - roofSurfaceIncl: '5', - moduleList: [ - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - ], - }, - { - roofSurfaceId: '2', - roofSurface: '남서', - roofSurfaceIncl: '5', - moduleList: [ - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - ], - }, - { - roofSurfaceId: '3', - roofSurface: '남', - roofSurfaceIncl: '3', - moduleList: [ - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - { itemId: '107077' }, - ], - }, - ], - pcsItemList: [ - { itemId: '106857', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' }, - { itemId: '106856', pcsMkrCd: 'MKR001', pcsSerCd: 'SER001' }, - ], + ...params2, + maxConnYn: params2.useYn.maxConnYn, + smpCirYn: params2.useYn.smpCirYn, + coldZoneYn: params2.useYn.coldZoneYn, + useModuleItemList: params2.useModuleItemList, + roofSurfaceList: params2.roofSurfaceList, + pcsItemList: params2.pcsItemList, } + console.log('🚀 ~ getPcsVoltageStepUpList ~ params >>>>> :', params) + return await post({ url: '/api/v1/master/getPcsVoltageStepUpList', data: params }).then((res) => { console.log('🚀🚀 ~ getPcsVoltageStepUpList ~ res:', res) return res From 4301ea97bad50e74f95d510d03d617a66cf7cc1a Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 24 Jan 2025 08:22:54 +0900 Subject: [PATCH 101/130] =?UTF-8?q?=EB=A9=94=EC=9D=B8=20=EC=9E=90=EB=A3=8C?= =?UTF-8?q?=20=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=EC=A1=B0=EA=B1=B4=20?= =?UTF-8?q?=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/main/MainContents.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx index d00e57d8..3c1e184b 100644 --- a/src/components/main/MainContents.jsx +++ b/src/components/main/MainContents.jsx @@ -55,6 +55,7 @@ export default function MainContents() { schNoticeClsCd: 'DOWN', startRow: 1, endRow: 2, + schMainYn: 'Y', }) const apiUrl = `${url}?${params.toString()}` From 7141c3ab87ab5c02e06272be3b01c857a500f9f8 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 24 Jan 2025 10:54:30 +0900 Subject: [PATCH 102/130] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?= =?UTF-8?q?=EB=8B=B9=20=EC=8B=9C=20=EC=97=90=EB=9F=AC=20=EC=9E=91=EC=97=85?= =?UTF-8?q?=EC=A4=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/usePolygon.js | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js index 1bc2dffa..e1f127a5 100644 --- a/src/hooks/usePolygon.js +++ b/src/hooks/usePolygon.js @@ -859,6 +859,7 @@ export const usePolygon = () => { line.endPoint = endPoint }) + // polygon line에서 각각 출발한다. polygonLines.forEach((line) => { /*line.set({ strokeWidth: 5, stroke: 'green' }) canvas.add(line) @@ -872,9 +873,11 @@ export const usePolygon = () => { const startLine = line const visitPoints = [startPoint] const visitLines = [startLine] + let notVisitedLines = [] let cnt = 0 while (!isSamePoint(currentPoint, arrivalPoint)) { + //현재 점으로 부터 갈 수 있는 다른 라인을 찾는다. let nextLines = allLines.filter( (line2) => (isSamePoint(line2.startPoint, currentPoint) || isSamePoint(line2.endPoint, currentPoint)) && @@ -892,8 +895,13 @@ export const usePolygon = () => { ) } - if (!nextLines) { - break + if (nextLines.length === 0) { + //아직 안갔던 line중 0번째를 선택한다. + if (notVisitedLines.length === 0) { + break + } else { + // nextLines = [...notVisitedLines.shift().line] + } } let comparisonPoints = [] @@ -919,6 +927,14 @@ export const usePolygon = () => { nextLines.forEach((nextLine) => { if (isSamePoint(nextLine.startPoint, minDistancePoint) || isSamePoint(nextLine.endPoint, minDistancePoint)) { visitLines.push(nextLine) + } else { + notVisitedLines.push({ + line: nextLine, + endPoint: nextLine.endPoint, + startPoint: nextLine.startPoint, + currentPoint: { ...currentPoint }, + roofPoints: [...roofPoints], + }) } }) From 078f259deb344642271eb8f2450656408a6354ac Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Fri, 24 Jan 2025 11:03:05 +0900 Subject: [PATCH 103/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20setMenunumber=20effe?= =?UTF-8?q?ct=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/FloorPlan.jsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index 0c1e0ba6..58572f4c 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -6,8 +6,8 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu' import { useCanvasSetting } from '@/hooks/option/useCanvasSetting' import { usePopup } from '@/hooks/usePopup' import '@/styles/contents.scss' -import { notFound, usePathname, useSearchParams } from 'next/navigation' -import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' +import { notFound, useSearchParams } from 'next/navigation' +import { useRecoilState } from 'recoil' import { correntObjectNoState } from '@/store/settingAtom' export default function FloorPlan({ children }) { @@ -39,7 +39,7 @@ export default function FloorPlan({ children }) { return () => { closeAll() } - }, [correntObjectNo]) + }, []) const modalProps = { menuNumber, From 50bd18c2f67f326ae161d4a7c81bd0dcdf7124a2 Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Fri, 24 Jan 2025 11:38:12 +0900 Subject: [PATCH 104/130] =?UTF-8?q?=F0=9F=93=8Cfix:=20setMenunumber=20effe?= =?UTF-8?q?ct=20=EC=A1=B0=EA=B1=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/FloorPlan.jsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/floor-plan/FloorPlan.jsx b/src/components/floor-plan/FloorPlan.jsx index 58572f4c..eb9f3047 100644 --- a/src/components/floor-plan/FloorPlan.jsx +++ b/src/components/floor-plan/FloorPlan.jsx @@ -32,14 +32,16 @@ export default function FloorPlan({ children }) { useEffect(() => { if (!correntObjectNo) return // correntObjectNo가 없으면 실행하지 않음 - setMenuNumber(1) + if(menuNumber === null) { + setMenuNumber(1) + } fetchSettings() fetchBasicSettings() return () => { closeAll() } - }, []) + }, [correntObjectNo]) const modalProps = { menuNumber, From a24789d34f44e08c70dbef26aa5fa714bbb29b53 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 24 Jan 2025 13:15:36 +0900 Subject: [PATCH 105/130] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=20=EC=A0=84?= =?UTF-8?q?=EC=B2=B4=20=EC=82=AD=EC=A0=9C=20=EC=8B=9C=20=EC=A7=80=EB=B6=95?= =?UTF-8?q?=20=EB=82=A8=EC=95=84=EC=9E=88=EB=8A=94=20=ED=98=84=EC=83=81=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/surface/useSurfaceShapeBatch.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/hooks/surface/useSurfaceShapeBatch.js b/src/hooks/surface/useSurfaceShapeBatch.js index 89f88607..4cb3586f 100644 --- a/src/hooks/surface/useSurfaceShapeBatch.js +++ b/src/hooks/surface/useSurfaceShapeBatch.js @@ -1,6 +1,6 @@ 'use client' -import { useRecoilValue } from 'recoil' +import { useRecoilState, useRecoilValue } from 'recoil' import { canvasState, globalPitchState } from '@/store/canvasAtom' import { MENU, POLYGON_TYPE } from '@/common/common' import { getIntersectionPoint } from '@/util/canvas-util' @@ -16,11 +16,13 @@ import { fontSelector } from '@/store/fontAtom' import { slopeSelector } from '@/store/commonAtom' import { QLine } from '@/components/fabric/QLine' import { useRoofFn } from '@/hooks/common/useRoofFn' +import { outerLinePointsState } from '@/store/outerLineAtom' export function useSurfaceShapeBatch() { const { getMessage } = useMessage() const { drawDirectionArrow } = usePolygon() const lengthTextFont = useRecoilValue(fontSelector('lengthText')) + const [points, setPoints] = useRecoilState(outerLinePointsState) const canvas = useRecoilValue(canvasState) const globalPitch = useRecoilValue(globalPitchState) @@ -653,6 +655,7 @@ export function useSurfaceShapeBatch() { type: 'confirm', confirmFn: () => { canvas.clear() + setPoints([]) swalFire({ text: getMessage('plan.message.delete') }) }, // denyFn: () => { From 43ce1a1853cf6df902eadb41213d61fa487c551a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Fri, 24 Jan 2025 13:18:51 +0900 Subject: [PATCH 106/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 86 +- .../step/type/PassivityCircuitAllocation.jsx | 899 +++--------------- src/hooks/common/useMasterController.js | 7 +- 3 files changed, 182 insertions(+), 810 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 2881ec2c..17414c4a 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -43,29 +43,6 @@ export default function CircuitTrestleSetting({ id }) { const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) const selectedModules = useRecoilValue(selectedModuleState) const { getPcsAutoRecommendList } = useMasterController() - const powerConditionalSelectProps = { - tabNum, - setTabNum, - makers, - setMakers, - selectedMaker, - setSelectedMaker, - series, - setSeries, - models, - setModels, - selectedModels, - setSelectedModels, - managementState, - } - - const passivityProps = { - tabNum, - setTabNum, - pcsCheck, - selectedModels, - setSelectedModels, - } useEffect(() => { if (!managementState) { @@ -122,6 +99,40 @@ export default function CircuitTrestleSetting({ id }) { }) } + const getSelectModelList = () => { + return selectedModels.map((model) => { + return { + pcsMkrCd: model.pcsMkrCd, + pcsSerCd: model.pcsSerCd, + itemId: model.itemId, + itemNm: model.itemNm, + goodsNo: model.goodsNo, + serQtyList: [ + { + serQty: 0, + paralQty: 0, + rmdYn: 'Y', + usePossYn: 'Y', + roofSurfaceList: [ + { + roofSurfaceId: '', + roofSurface: '', + roofSurfaceIncl: '', + moduleList: [ + { + itemId: '', + circuit: '', + pcsItemId: '', + }, + ], + }, + ], + }, + ], + } + }) + } + const getSelectedModuleList = () => { return selectedModules.itemList.map((m) => { return { @@ -212,6 +223,35 @@ export default function CircuitTrestleSetting({ id }) { setAllocationType(ALLOCATION_TYPE.PASSIVITY) } + const powerConditionalSelectProps = { + tabNum, + setTabNum, + makers, + setMakers, + selectedMaker, + setSelectedMaker, + series, + setSeries, + models, + setModels, + selectedModels, + setSelectedModels, + managementState, + } + + const passivityProps = { + tabNum, + setTabNum, + pcsCheck, + selectedModels, + setSelectedModels, + getApiProps, + getSelectedModuleList, + getSelectModelList, + getRoofSurfaceList, + getModelList, + } + const stepUpProps = { tabNum, setTabNum, diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx index e1c2b29b..c9da1682 100644 --- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx @@ -2,6 +2,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider' import { POLYGON_TYPE } from '@/common/common' import { useMasterController } from '@/hooks/common/useMasterController' import { useMessage } from '@/hooks/useMessage' +import { useSwal } from '@/hooks/useSwal' import { canvasState } from '@/store/canvasAtom' import { moduleStatisticsState } from '@/store/circuitTrestleAtom' import { selectedModuleState } from '@/store/selectedModuleOptions' @@ -9,7 +10,8 @@ import { useContext, useEffect, useState } from 'react' import { useRecoilValue } from 'recoil' export default function PassivityCircuitAllocation(props) { - const { tabNum, setTabNum, selectedModels, pcsCheck } = props + const { tabNum, setTabNum, selectedModels, getApiProps, getSelectedModuleList, getSelectModelList, getRoofSurfaceList, getModelList } = props + const { swalFire } = useSwal() const { getMessage } = useMessage() const canvas = useRecoilValue(canvasState) const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext) @@ -23,11 +25,15 @@ export default function PassivityCircuitAllocation(props) { const [footer, setFooter] = useState(['합계']) const [circuitNumber, setCircuitNumber] = useState(1) const [targetModules, setTargetModules] = useState([]) - const { pcsMaualConfChk } = useMasterController() + const { getPcsManualConfChk } = useMasterController() useEffect(() => { - console.log('🚀 ~ PassivityCircuitAllocation ~ targetModules:', targetModules) - }, [targetModules]) + console.log('🚀 ~ PassivityCircuitAllocation ~ selectedModels:', selectedModels) + }, []) + + useEffect(() => { + console.log('🚀 ~ PassivityCircuitAllocation ~ selectedPcs:', selectedPcs) + }, [selectedPcs]) const handleTargetModules = (obj) => { if (!Array.isArray(targetModules)) { @@ -146,794 +152,120 @@ export default function PassivityCircuitAllocation(props) { } const handleCircuitNumberFix = () => { - console.log('🚀 ~ handleCircuitNumberFix ~ circuitNumber:', circuitNumber) - console.log('🚀 ~ handleCircuitNumberFix ~ selectedPcs:', selectedPcs) - // const params = { - // maxConnYn: pcsCheck.max ? 'Y' : 'N', - // smpCirYn: 'Y', - // coldZoneYn: 'Y', - // useModuleItemList: [{ itemId: '107077', mixMatlNo: '0' }], - // pcsItemList: [ - // { - // pcsMkrCd: 'MKR001', - // pcsSerCd: 'SER001', - // itemId: '106857', - // itemNm: 'HQJP-KA55-5 パワーコンディショナ5.5kW屋内', - // goodsNo: 'HQJP-KA55-5', - // serQtyList: [ - // { - // serQty: 5, - // paralQty: 3, - // rmdYn: 'Y', - // usePossYn: 'Y', - // roofSurfaceList: [ - // { - // roofSurfaceId: '1', - // roofSurface: '남서', - // roofSurfaceIncl: '5', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // ], - // cirLastIdx: 5, - // isCirLastDupCircuit: true, - // roofSurfacePossibleModuleCnt: 0, - // totCirModuleWpOut: 0, - // roofSurfaceCirModuleWpOut: 3960, - // }, - // { - // roofSurfaceId: '2', - // roofSurface: '남서', - // roofSurfaceIncl: '5', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: null, - // pcsItemId: null, - // }, - // ], - // cirLastIdx: 3, - // isCirLastDupCircuit: true, - // roofSurfacePossibleModuleCnt: 1, - // totCirModuleWpOut: 0, - // roofSurfaceCirModuleWpOut: 2200, - // }, - // { - // roofSurfaceId: '3', - // roofSurface: '남', - // roofSurfaceIncl: '3', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // ], - // cirLastIdx: 6, - // isCirLastDupCircuit: true, - // roofSurfacePossibleModuleCnt: 0, - // totCirModuleWpOut: 0, - // roofSurfaceCirModuleWpOut: 3960, - // }, - // ], - // }, - // ], - // }, - // { - // pcsMkrCd: 'MKR001', - // pcsSerCd: 'SER001', - // itemId: '106856', - // itemNm: 'HQJP-KA40-5 パワーコンディショナ4.0kW屋内', - // goodsNo: 'HQJP-KA40-5', - // circuitCfg: '4, 4', - // serQtyList: [ - // { - // pcsTpCd: 'INDFCS', - // serQty: 4, - // paralQty: 2, - // rmdYn: 'Y', - // usePossYn: 'Y', - // cirModuleWpOutSum: 3520, - // roofSurfaceList: [ - // { - // roofSurfaceId: '1', - // roofSurface: '남서', - // roofSurfaceIncl: '5', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-1', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-4', - // pcsItemId: '106856', - // }, - // ], - // cirLastIdx: 5, - // isCirLastDupCircuit: true, - // roofSurfacePossibleModuleCnt: 0, - // totCirModuleWpOut: 0, - // roofSurfaceCirModuleWpOut: 3960, - // }, - // { - // roofSurfaceId: '2', - // roofSurface: '남서', - // roofSurfaceIncl: '5', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-2', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: null, - // pcsItemId: null, - // }, - // ], - // }, - // { - // roofSurfaceId: '3', - // roofSurface: '남', - // roofSurfaceIncl: '3', - // moduleList: [ - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '1-3', - // pcsItemId: '106857', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // { - // pcsMkrCd: null, - // pcsSerCd: null, - // applySerQty: null, - // itemId: '107077', - // itemTp: null, - // wpOut: 440, - // moduleStdVol: 42, - // moduleColdZoneVol: null, - // mixMatlNo: null, - // circuit: '2-5', - // pcsItemId: '106856', - // }, - // ], - // }, - // ], - // }, - // ], - // }, - // ], - // } - // pcsMaualConfChk() - canvas.discardActiveObject() - canvas - .getObjects() - .filter((obj) => targetModules.includes(obj.id)) - .forEach((obj) => { - obj.set({ - circuit: circuitNumber, - strokeWidth: 0.3, - }) - obj.pscId = selectedPcs.id - obj.pscIndex = selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1 - canvas.add( - new fabric.Text(getCircuitNumber(), { - left: obj.left + obj.width / 2, - top: obj.top + obj.height / 2, - fill: 'red', - fontSize: 20, - width: obj.width, - height: obj.height, - textAlign: 'center', - originX: 'center', - originY: 'center', - name: 'circuitNumber', - parentId: obj.id, - }), - ) - canvas.renderAll() - console.log(obj) + if (!circuitNumber || circuitNumber === 0) { + swalFire({ + text: '회로번호를 1 이상입력해주세요.', + type: 'warning', + icon: 'warning', }) - setTargetModules([]) - setCircuitNumber(+circuitNumber + 1) - canvas.renderAll() + return + } else if (targetModules.length === 0) { + swalFire({ + text: '모듈을 선택해주세요.', + type: 'warning', + icon: 'warning', + }) + return + } + const params = { + ...getApiProps(), + useModuleItemList: getSelectedModuleList(), + pcsItemList: getSelectModelList(), + } + console.log(params) + // getPcsManualConfChk(params).then((res) => { + // console.log(res) + // + // }) + + // canvas.discardActiveObject() + // + // canvas + // .getObjects() + // .filter((obj) => targetModules.includes(obj.id)) + // .forEach((obj) => { + // const moduleCircuitText = new fabric.Text(getCircuitNumber(), { + // left: obj.left + obj.width / 2, + // top: obj.top + obj.height / 2, + // fill: 'black', + // fontSize: 20, + // width: obj.width, + // height: obj.height, + // textAlign: 'center', + // originX: 'center', + // originY: 'center', + // name: 'circuitNumber', + // parentId: obj.id, + // circuitInfo: selectedPcs, + // }) + // obj.set({ + // strokeWidth: 0.3, + // }) + // obj.pcsItemId = selectedPcs.itemId + + // obj.circuit = moduleCircuitText + // canvas.add(moduleCircuitText) + // canvas.renderAll() + // console.log(obj) + // }) + // setTargetModules([]) + // setCircuitNumber(+circuitNumber + 1) + // canvas.renderAll() } const getCircuitNumber = () => { if (selectedModels.length === 1) { return `(${circuitNumber})` } else { - return `(${selectedModels.findIndex((model) => model.itemId === selectedPcs.itemId) + 1}-${circuitNumber})` + return `(${selectedModels.findIndex((model) => model.id === selectedPcs.id) + 1}-${circuitNumber})` } } const initSelectedPcsCircuitNumber = () => { - const modules = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber' && obj.pscId === selectedPcs.id) - canvas.remove(...modules) - canvas - .getObjects() - .filter((obj) => obj.pscIndex === selectedPcs.id) - .forEach((obj) => { - obj.pscId = null - obj.pscIndex = null - }) + console.log( + 'module', + canvas.getObjects().filter((obj) => obj.name === 'module'), + ) + console.log('selectedPcs', selectedPcs) + swalFire({ + title: '선택된 파워 컨디셔너의 회로할당을 초기화합니다.', + type: 'confirm', + icon: 'warning', + confirmFn: () => { + const circuitModules = canvas.getObjects().filter((obj) => obj.name === 'module' && obj.circuit?.circuitInfo?.id === selectedPcs.id) + canvas.remove(...circuitModules.map((module) => module.circuit)) + circuitModules.forEach((obj) => { + obj.circuit = null + obj.pcsItemId = null + }) + setTargetModules([]) - canvas.renderAll() + canvas.renderAll() + canvas.discardActiveObject() + }, + }) + } + + const initAllPcsCircuitNumber = () => { + canvas.discardActiveObject() + swalFire({ + title: '회로 할당의 설정을 초기화합니다.', + type: 'confirm', + icon: 'warning', + confirmFn: () => { + const circuitModules = canvas + .getObjects() + .filter((obj) => obj.name === 'module' && selectedModels.map((model) => model.id).includes(obj.circuit?.circuitInfo?.id)) + canvas.remove(...circuitModules.map((module) => module.circuit)) + circuitModules.forEach((obj) => { + obj.circuit = null + obj.pcsItemId = null + }) + setTargetModules([]) + + canvas.renderAll() + }, + }) } return ( @@ -990,10 +322,11 @@ export default function PassivityCircuitAllocation(props) { type="radio" name="radio01" id={`ra0${index + 1}`} - checked={selectedPcs === model} + value={model} + checked={selectedPcs.id === model.id} onChange={() => setSelectedPcs(model)} /> -
名称昇圧回路数名称昇圧回路数{getMessage('modal.circuit.trestle.setting.power.conditional.select.name')}{getMessage('modal.circuit.trestle.setting.step.up.allocation.circuit.amount')}
@@ -155,9 +193,21 @@ export default function StepUp(props) { - {stepUp.pcsItemList[idx].serQtyList.map((item) => { + {stepUp.pcsItemList[idx].serQtyList.map((item, serQtyIdx) => { + const rowKey = `${stepUp.id}_${idx}_${serQtyIdx}` + const pcsKey = `${stepUp.id}_${idx}` return ( - + handleRowClick(stepUp.id, idx, serQtyIdx)} + style={{ cursor: 'pointer' }} + > @@ -195,9 +245,17 @@ export default function StepUp(props) { - - - + + +
{item.serQty} {item.paralQty}
{stepUp.pcsItemList[idx].connList?.goodsNo}{stepUp.pcsItemList[idx].connList?.connMaxParalCnt}{stepUp.pcsItemList[idx].connList?.vstuParalCnt} + {stepUp.pcsItemList[idx].connList?.[0]?.goodsNo ? stepUp.pcsItemList[idx].connList?.[0]?.goodsNo : '-'} + + {stepUp.pcsItemList[idx].connList?.[0]?.connMaxParalCnt + ? (stepUp.pcsItemList[idx].connList?.[0]?.connMaxParalCnt ?? '-') + : '-'} + + {stepUp.pcsItemList[idx].connList?.[0]?.vstuParalCnt ? stepUp.pcsItemList[idx].connList?.[0]?.vstuParalCnt : '-'} +
From 0bd76a3fcc7c7ef9ff378a42500a2f9071c6c3e3 Mon Sep 17 00:00:00 2001 From: changkyu choi Date: Fri, 24 Jan 2025 17:56:23 +0900 Subject: [PATCH 111/130] =?UTF-8?q?mixMatlNo=20=EB=88=84=EB=9D=BD=20?= =?UTF-8?q?=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 613441be..35774e8a 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -132,7 +132,7 @@ export default function CircuitTrestleSetting({ id }) { return selectedModules.itemList.map((m) => { return { itemId: m.itemId, - //mixMatlNo: m.mixMatlNo, + mixMatlNo: m.mixMatlNo, } }) } From fa57be3c299ac3bb2a0e67ff98fef077bed76077 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?= <43837214+Minsiki@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:07:10 +0900 Subject: [PATCH 112/130] =?UTF-8?q?=ED=9A=8C=EB=A1=9C=EB=B2=88=ED=98=B8=20?= =?UTF-8?q?=EC=B4=88=EA=B8=B0=ED=99=94=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EB=B0=8F=20=EB=AF=B8=ED=95=A0=EB=8B=B9=20=EB=AA=A8?= =?UTF-8?q?=EB=93=88=20=EC=82=AD=EC=A0=9C=20=EB=B2=88=ED=98=B8=20=ED=99=95?= =?UTF-8?q?=EC=A0=95=EC=8B=9C=20validation=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../circuitTrestle/CircuitTrestleSetting.jsx | 75 +++-- .../step/PowerConditionalSelect.jsx | 2 +- .../step/type/PassivityCircuitAllocation.jsx | 274 +++++++++++++----- 3 files changed, 238 insertions(+), 113 deletions(-) diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx index 17414c4a..4dba2fc3 100644 --- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx +++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx @@ -50,6 +50,14 @@ export default function CircuitTrestleSetting({ id }) { } }, []) + useEffect(() => { + if (allocationType === ALLOCATION_TYPE.PASSIVITY && tabNum === 2) { + const notAllocationModules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE && !obj.circuit) + canvas.remove(...notAllocationModules) + canvas.renderAll() + } + }, [tabNum]) + const onAutoRecommend = () => { if (series.filter((s) => s.selected).length === 0) { swalFire({ @@ -59,13 +67,11 @@ export default function CircuitTrestleSetting({ id }) { return } - console.log('🚀 ~ onAutoRecommend ~ selectedModules:', selectedModules) - const params = { - ...getApiProps(), - useModuleItemList: getSelectedModuleList(), + ...getOptYn(), + useModuleItemList: getUseModuleItemList(), roofSurfaceList: getRoofSurfaceList(), - pcsItemList: getModelList(), + pcsItemList: getPcsItemList(), } getPcsAutoRecommendList(params).then((res) => { @@ -81,7 +87,7 @@ export default function CircuitTrestleSetting({ id }) { }) } - const getApiProps = () => { + const getOptYn = () => { return { maxConnYn: pcsCheck.max ? 'Y' : 'N', smpCirYn: pcsCheck.division ? 'Y' : 'N', @@ -89,7 +95,7 @@ export default function CircuitTrestleSetting({ id }) { } } - const getModelList = () => { + const getPcsItemList = () => { return models.map((model) => { return { itemId: model.itemId, @@ -113,27 +119,14 @@ export default function CircuitTrestleSetting({ id }) { paralQty: 0, rmdYn: 'Y', usePossYn: 'Y', - roofSurfaceList: [ - { - roofSurfaceId: '', - roofSurface: '', - roofSurfaceIncl: '', - moduleList: [ - { - itemId: '', - circuit: '', - pcsItemId: '', - }, - ], - }, - ], + roofSurfaceList: getRoofSurfaceList(), }, ], } }) } - const getSelectedModuleList = () => { + const getUseModuleItemList = () => { return selectedModules.itemList.map((m) => { return { itemId: m.itemId, @@ -157,6 +150,8 @@ export default function CircuitTrestleSetting({ id }) { moduleList: obj.modules.map((module) => { return { itemId: module.moduleInfo.itemId, + circuit: module.circuitNumber ? module.circuitNumber : null, + pcsItemId: module.circuit ? module.circuit?.pcsItemId : null, } }), } @@ -223,6 +218,25 @@ export default function CircuitTrestleSetting({ id }) { setAllocationType(ALLOCATION_TYPE.PASSIVITY) } + const onClickPrev = () => { + setAllocationType(ALLOCATION_TYPE.AUTO) + swalFire({ + text: '할당한 회로 번호가 초기화됩니다.', + type: 'alert', + icon: 'warning', + confirmFn: () => { + const circuitModules = canvas + .getObjects() + .filter((obj) => obj.name === 'module' && selectedModels.map((model) => model.id).includes(obj.circuit?.circuitInfo?.id)) + canvas.remove(...circuitModules.map((module) => module.circuit)) + circuitModules.forEach((obj) => { + obj.circuit = null + obj.pcsItemId = null + }) + }, + }) + } + const powerConditionalSelectProps = { tabNum, setTabNum, @@ -245,11 +259,10 @@ export default function CircuitTrestleSetting({ id }) { pcsCheck, selectedModels, setSelectedModels, - getApiProps, - getSelectedModuleList, + getOptYn, + getUseModuleItemList, getSelectModelList, getRoofSurfaceList, - getModelList, } const stepUpProps = { @@ -257,12 +270,10 @@ export default function CircuitTrestleSetting({ id }) { setTabNum, models, setModels, - circuitAllocationType, - setCircuitAllocationType, - getApiProps, - getSelectedModuleList, - getRoofSurfaceList, - getModelList, + getOptYn, // 옵션 Y/N + getUseModuleItemList, // 사용된 모듈아이템 List + getRoofSurfaceList, // 지붕면 목록 + getPcsItemList, // PCS 아이템 목록 } return ( @@ -297,7 +308,7 @@ export default function CircuitTrestleSetting({ id }) { )} {tabNum === 1 && allocationType === ALLOCATION_TYPE.PASSIVITY && (
-
-
- - - - - - - {/* 담당자명 */} - - - - - {/* 담당자명 후리가나 */} - - - - - {/* 신청 ID */} - - - - - {/* 이메일 주소 */} - - - - - {/* 전화번호 */} - - - - - {/* FAX 번호 */} - - - - - {/* 부서명 */} - - - - - -
- {getMessage('join.sub2.userNm')} * - -
- -
-
{getMessage('join.sub2.userNmKana')} -
- -
-
- {getMessage('join.sub2.userId')} * - -
- -
-
- {getMessage('join.sub2.email')} * - -
- -
-
- {getMessage('join.sub2.telNo')} * - -
- -
-
- {getMessage('join.sub2.fax')} * - -
- -
-
{getMessage('join.sub2.category')} -
- -
-
+
+
+
+

+ {getMessage('join.sub2.title')} (*{getMessage('common.require')}) +

+
+
+
+ + + + + + + {/* 담당자명 */} + + + + + {/* 담당자명 후리가나 */} + + + + + {/* 신청 ID */} + + + + + {/* 이메일 주소 */} + + + + + {/* 전화번호 */} + + + + + {/* FAX 번호 */} + + + + + {/* 부서명 */} + + + + + +
+ {getMessage('join.sub2.userNm')} * + +
+ +
+
{getMessage('join.sub2.userNmKana')} +
+ +
+
+ {getMessage('join.sub2.userId')} * + +
+ +
+
+ {getMessage('join.sub2.email')} * + +
+ +
+
+ {getMessage('join.sub2.telNo')} * + +
+ +
+
+ {getMessage('join.sub2.fax')} * + +
+ +
+
{getMessage('join.sub2.category')} +
+ +
+
+
-
-
- - -
- +
+ + +
+ +
- + ) }