From 381af987f60690f6e15507e1aaf939e38e0deec4 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 18 Oct 2024 10:40:25 +0900 Subject: [PATCH 1/5] =?UTF-8?q?=EB=B3=B4=EC=A1=B0=EC=84=A0=20=EC=88=98?= =?UTF-8?q?=EB=8F=99=20=EC=9E=91=EC=84=B1=20=EC=8B=9C=20roofId=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/components/floor-plan/modal/Slope.jsx | 17 +++++++++++++++-- src/hooks/roofcover/useAuxiliaryDrawing.js | 12 +++++++++--- src/hooks/roofcover/useOuterLineWall.js | 13 +++++++++++-- .../roofcover/useRoofShapePassivitySetting.js | 8 +++++--- src/store/canvasAtom.js | 5 +++++ 5 files changed, 45 insertions(+), 10 deletions(-) diff --git a/src/components/floor-plan/modal/Slope.jsx b/src/components/floor-plan/modal/Slope.jsx index 0ae32ab6..ba9ede2a 100644 --- a/src/components/floor-plan/modal/Slope.jsx +++ b/src/components/floor-plan/modal/Slope.jsx @@ -1,8 +1,13 @@ import { useMessage } from '@/hooks/useMessage' import WithDraggable from '@/components/common/draggable/WithDraggable' +import { globalPitchState } from '@/store/canvasAtom' +import { useRecoilState } from 'recoil' +import { useRef } from 'react' export default function Slope({ setShowSlopeSettingModal }) { const { getMessage } = useMessage() + const [globalPitch, setGlobalPitch] = useRecoilState(globalPitchState) + const inputRef = useRef() return (
@@ -19,13 +24,21 @@ export default function Slope({ setShowSlopeSettingModal }) { {getMessage('slope')}
- +
{getMessage('size.angle')}
- +
diff --git a/src/hooks/roofcover/useAuxiliaryDrawing.js b/src/hooks/roofcover/useAuxiliaryDrawing.js index f479a92e..e5e79740 100644 --- a/src/hooks/roofcover/useAuxiliaryDrawing.js +++ b/src/hooks/roofcover/useAuxiliaryDrawing.js @@ -607,10 +607,15 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { * 일변전으로 돌아가기 */ const handleRollback = () => { - const lastLine = lineHistory.current.pop() - mousePointerArr.current = [] - canvas.remove(...canvas.getObjects().filter((obj) => obj.name === 'innerPoint')) + const innerPoint = canvas.getObjects().find((obj) => obj.name === 'innerPoint') + if (innerPoint) { + mousePointerArr.current = [] + canvas.remove(innerPoint) + canvas.renderAll() + return + } + const lastLine = lineHistory.current.pop() if (lastLine) { roofAdsorptionPoints.current = roofAdsorptionPoints.current.filter( (point) => point.x !== lastLine.intersectionPoint?.x && point.y !== lastLine.intersectionPoint?.y, @@ -640,6 +645,7 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { const inPolygon2 = booleanPointInPolygon([line.x2, line.y2], turfPolygon) if (inPolygon1 && inPolygon2) { + line.attributes = { ...line.attributes, roofId: roofBase.id } return true } }) diff --git a/src/hooks/roofcover/useOuterLineWall.js b/src/hooks/roofcover/useOuterLineWall.js index 00405a3b..85c37015 100644 --- a/src/hooks/roofcover/useOuterLineWall.js +++ b/src/hooks/roofcover/useOuterLineWall.js @@ -34,8 +34,14 @@ import { QLine } from '@/components/fabric/QLine' //외벽선 그리기 export function useOuterLineWall(setShowOutlineModal) { const canvas = useRecoilValue(canvasState) - const { addCanvasMouseEventListener, addDocumentEventListener, removeAllMouseEventListeners, removeAllDocumentEventListeners, removeMouseEvent } = - useEvent() + const { + initEvent, + addCanvasMouseEventListener, + addDocumentEventListener, + removeAllMouseEventListeners, + removeAllDocumentEventListeners, + removeMouseEvent, + } = useEvent() const { getIntersectMousePoint } = useMouse() const { addLine, removeLine } = useLine() const { tempGridMode } = useTempGrid() @@ -76,6 +82,9 @@ export function useOuterLineWall(setShowOutlineModal) { addCanvasMouseEventListener('mouse:down', mouseDown) clear() + return () => { + initEvent() + } }, [verticalHorizontalMode, points, adsorptionPointAddMode, adsorptionPointMode, adsorptionRange, interval, tempGridMode]) useEffect(() => { diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js index bedbcd11..f7b8b9fd 100644 --- a/src/hooks/roofcover/useRoofShapePassivitySetting.js +++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js @@ -209,10 +209,12 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod wall.lines = [...lines] // 기존 그려진 지붕이 없다면 - if (roofBases.length === 0) { - return + + if (isFix.current) { + // 완료 한 경우에는 지붕까지 그려줌 + const roof = drawRoofPolygon(wall) } - const roof = drawRoofPolygon(wall) + canvas.renderAll() } diff --git a/src/store/canvasAtom.js b/src/store/canvasAtom.js index 7806b8f2..f3a81661 100644 --- a/src/store/canvasAtom.js +++ b/src/store/canvasAtom.js @@ -289,3 +289,8 @@ export const canGridOptionSeletor = selector({ return points.length === 0 || outerLineFix }, }) + +export const globalPitchState = atom({ + key: 'globalPitch', + default: 4, +}) From f001408b369e78d009af4d108df93c0301107faf Mon Sep 17 00:00:00 2001 From: Jaeyoung Lee Date: Fri, 18 Oct 2024 10:46:32 +0900 Subject: [PATCH 2/5] =?UTF-8?q?=EB=AA=85=EC=B9=AD=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 | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/common/common.js b/src/common/common.js index ebb394d3..cf9788be 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -66,8 +66,13 @@ export const LINE_TYPE = { }, SUBLINE: { /** - * + * 추녀 / 마루 / 박공 / 지붕골 / 박공단 */ + HIP: 'hip', + RIDGE: 'ridge', + GABLE: 'gable', + VALLEY: 'valley', + VERGE: 'verge', }, } From 195f2c4b660dc6da839a0330cd2878f8cd2d3000 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 18 Oct 2024 11:12:17 +0900 Subject: [PATCH 3/5] =?UTF-8?q?helpGuideLine=EC=9D=98=20=EA=B5=90=EC=B0=A8?= =?UTF-8?q?=EC=A0=90=20=ED=9D=A1=EC=B0=A9=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hooks/useEvent.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index d14fa7e5..ee41988d 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -2,7 +2,7 @@ import { useEffect, useRef } from 'react' import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil' import { canvasState, canvasZoomState, currentMenuState, textModeState } from '@/store/canvasAtom' import { fabric } from 'fabric' -import { calculateDistance, distanceBetweenPoints, findClosestPoint } from '@/util/canvas-util' +import { calculateDistance, calculateIntersection, distanceBetweenPoints, findClosestPoint, polygonToTurfPolygon } from '@/util/canvas-util' import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint' import { useDotLineGrid } from '@/hooks/useDotLineGrid' import { useTempGrid } from '@/hooks/useTempGrid' @@ -151,6 +151,17 @@ export function useEvent() { } } + try { + const helpGuideLines = canvas.getObjects().filter((obj) => obj.name === 'helpGuideLine') + if (helpGuideLines.length === 2) { + const guideIntersectionPoint = calculateIntersection(helpGuideLines[0], helpGuideLines[1]) + + if (guideIntersectionPoint && distanceBetweenPoints(guideIntersectionPoint, pointer) <= adsorptionRange) { + arrivalPoint = guideIntersectionPoint + } + } + } catch (e) {} + const horizontalLine = new fabric.Line([-1 * canvas.width, arrivalPoint.y, 2 * canvas.width, arrivalPoint.y], { stroke: 'red', strokeWidth: 1, From 779261308a3735185beea7f737c5926ef782badf Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 18 Oct 2024 12:57:43 +0900 Subject: [PATCH 4/5] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=EB=A6=AC=EC=8A=A4=ED=8A=B8=20=EC=83=81=EC=84=B8=20=EC=9E=90?= =?UTF-8?q?=EB=8F=99=EC=99=84=EC=84=B1=20=EC=85=8B=ED=8C=85=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 --- src/components/management/StuffDetail.jsx | 27 +++++++++++++++---- .../management/StuffSearchCondition.jsx | 24 +++++++++++------ src/store/stuffAtom.js | 4 --- 3 files changed, 38 insertions(+), 17 deletions(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 4e21c0f5..c480b055 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -16,6 +16,8 @@ import FindAddressPop from './popup/FindAddressPop' import PlanRequestPop from './popup/PlanRequestPop' import WindSelectPop from './popup/WindSelectPop' export default function StuffDetail() { + const [selOptions, setSelOptions] = useState('') + const sessionState = useRecoilValue(sessionStore) const router = useRouter() @@ -107,14 +109,18 @@ export default function StuffDetail() { // 임시 1차점 판매점코드 saleStoreId=201TES01 // T01 - //1차점 : X167 - get({ url: `/api/object/saleStore/T01/list` }).then((res) => { - // get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => { + //1차점 : X167 T01 + // get({ url: `/api/object/saleStore/TEMP02/list` }).then((res) => { + get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => { if (!isEmptyArray(res)) { const firstList = res.filter((row) => row.saleStoreLevel === '1') const otherList = res.filter((row) => row.saleStoreLevel !== '1') //1차점 셀렉트박스 setSaleStoreList(firstList) + setSelOptions(sessionState?.storeId) + form.setValue('saleStoreId', sessionState?.storeId) + form.setValue('saleStoreLevel', sessionState?.storeLvl) + //1차점 아닌 판매점 셀렉트박스 setOriginOtherSaleStoreList(otherList) setOtherSaleStoreList(otherList) @@ -125,8 +131,6 @@ export default function StuffDetail() { useEffect(() => { if (isObjectNotEmpty(detailData)) { - console.log('상세데이타:::::::', detailData) - // 도도부현API get({ url: '/api/object/prefecture/list' }).then((res) => { if (!isEmptyArray(res)) { @@ -151,6 +155,8 @@ export default function StuffDetail() { setOtherSaleStoreList(otherList) } }) + + console.log('상세데이타::세팅:::::', detailData) } }, [detailData]) @@ -161,12 +167,14 @@ export default function StuffDetail() { form.setValue('saleStoreId', key.saleStoreId) form.setValue('saleStoreName', key.saleStoreName) form.setValue('saleStoreLevel', key.saleStoreLevel) + setSelOptions(key.saleStoreId) //선택한 1차점 정보로 2차점 list 추리기 //長府工産株式会社 大阪支社 let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId) setOtherSaleStoreList(newOtherSaleStoreList) } else { //X누름 + setSelOptions('') form.setValue('saleStoreId', '') form.setValue('saleStoreName', '') form.setValue('saleStoreLevel', '') @@ -212,6 +220,12 @@ export default function StuffDetail() { //팝업에서 넘어온 설계의뢰 정보로 바꾸기 const setPlanReqInfo = (info) => { console.log('팝업에서 넘어온 설계의뢰 정보::: ', info) + //building : 신축 기축 + //planReqName : 물건명 + //zipNo : 우편번호 + //도도부현 :address1 주소 : address2 미세팅 + //기준풍속 팝업열려면 setPrefValue(info.prefId) 필요 + //기준풍속 : // form.setValue('dispCompanyName', info.planReqName) } @@ -549,6 +563,9 @@ export default function StuffDetail() { getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} isClearable={true} + value={saleStoreList.filter(function (option) { + return option.saleStoreId === selOptions + })} />
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index b33608cf..3717e43f 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -18,7 +18,6 @@ import { useMessage } from '@/hooks/useMessage' import { isObjectNotEmpty } from '@/util/common-utils' export default function StuffSearchCondition() { const sessionState = useRecoilValue(sessionStore) - const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore) const globalLocaleState = useRecoilValue(globalLocaleStore) const { getMessage } = useMessage() @@ -74,10 +73,6 @@ export default function StuffSearchCondition() { startRow: stuffSearch?.startRow ? stuffSearch.startRow : 1, endRow: stuffSearch?.endRow ? stuffSearch.endRow : 100, schSortType: stuffSearch?.schSortType ? stuffSearch.schSortType : 'R', - selObject: { - label: stuffSearch.selObject.label, - value: stuffSearch.selObject.value, - }, }) } @@ -100,7 +95,7 @@ export default function StuffSearchCondition() { useEffect(() => { if (isObjectNotEmpty(sessionState)) { // storeId가 T01 이거나 1차점일때만 판매대리점 선택 활성화 - // get({ url: `/api/object/saleStore/201TES01/list` }).then((res) => { + // get({ url: `/api/object/saleStore/TEMP02/list` }).then((res) => { get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => { if (!isEmptyArray(res)) { res.map((row) => { @@ -128,7 +123,6 @@ export default function StuffSearchCondition() { ...stuffSearch, code: 'S', schSelSaleStoreId: key.saleStoreId, - selObject: { value: key.saleStoreId, label: key.saleStoreName }, }) } else { setSchSelSaleStoreId('') @@ -268,7 +262,21 @@ export default function StuffSearchCondition() { onChange={onSelectionChange} getOptionLabel={(x) => x.saleStoreName} getOptionValue={(x) => x.saleStoreId} - defaultValue={stuffSearch?.selObject?.value ? stuffSearch?.selObject : null} + value={schSelSaleStoreList.filter(function (option) { + if (stuffSearch?.code === 'S' && schSelSaleStoreId === '') { + return false + } else if (stuffSearch?.code === 'S' && schSelSaleStoreId !== '') { + return option.saleStoreId === schSelSaleStoreId + } else if (stuffSearch?.code === 'E' && schSelSaleStoreId !== '') { + return option.saleStoreId === schSelSaleStoreId + } else { + if (stuffSearch?.schSelSaleStoreId !== '') { + return option.saleStoreId === stuffSearch.schSelSaleStoreId + } else { + return false + } + } + })} isDisabled={sessionState?.storeLvl === '1' ? false : true} isClearable={true} /> diff --git a/src/store/stuffAtom.js b/src/store/stuffAtom.js index ceb5def0..c47321ae 100644 --- a/src/store/stuffAtom.js +++ b/src/store/stuffAtom.js @@ -18,10 +18,6 @@ export const stuffSearchState = atom({ startRow: 1, endRow: 100, schSortType: 'R', //정렬조건 (R:최근등록일 U:최근수정일) - selObject: { - value: '', - label: '', - }, }, dangerouslyAllowMutability: true, }) From ddf984728801c6d46c98fe30c0bf66c1abede39b Mon Sep 17 00:00:00 2001 From: leeyongjae Date: Fri, 18 Oct 2024 13:33:23 +0900 Subject: [PATCH 5/5] =?UTF-8?q?Auto=20Login=20url=20=EA=B2=BD=EB=A1=9C(dev?= =?UTF-8?q?,=20prd)=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .env.development | 4 ++-- .env.production | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.env.development b/.env.development index 933db5d3..3447a6e5 100644 --- a/.env.development +++ b/.env.development @@ -10,5 +10,5 @@ SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" -NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-local.q-cells.jp:8120/eos/login/autoLogin" -NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-local.q-cells.jp:8120/qm/login/autoLogin" \ No newline at end of file +NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-qa.q-cells.jp:8120/eos/login/autoLogin" +NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-qa.q-cells.jp:8120/qm/login/autoLogin" \ No newline at end of file diff --git a/.env.production b/.env.production index 9bad1719..7b8b23ad 100644 --- a/.env.production +++ b/.env.production @@ -8,5 +8,5 @@ SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" -NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="http://q-order-local.q-cells.jp:8120/eos/login/autoLogin" -NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="http://q-musubi-local.q-cells.jp:8120/qm/login/autoLogin" \ No newline at end of file +NEXT_PUBLIC_Q_ORDER_AUTO_LOGIN_URL="https://q-order.q-cells.jp/eos/login/autoLogin" +NEXT_PUBLIC_Q_MUSUBI_AUTO_LOGIN_URL="https://q-musubi.q-cells.jp/qm/login/autoLogin" \ No newline at end of file