From 24b4556db7f20c6dbf441b9b95cb2a19e0dcd13a Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Thu, 17 Oct 2024 14:17:12 +0900 Subject: [PATCH 01/28] =?UTF-8?q?line,=20polygon=20=EB=B3=80=ED=99=98=20?= =?UTF-8?q?=EC=8B=9C=20=EA=B8=B8=EC=9D=B4=20=EC=95=88=EB=A7=9E=EB=8A=94=20?= =?UTF-8?q?=EA=B2=83=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QLine.js | 4 +-- src/components/fabric/QPolygon.js | 4 +-- src/components/floor-plan/CanvasFrame.jsx | 4 --- src/components/floor-plan/CanvasMenu.jsx | 7 ++-- src/hooks/roofcover/useAuxiliaryDrawing.js | 32 ++++++++++++----- .../roofcover/useRoofAllocationSetting.js | 6 +++- .../roofcover/useRoofShapePassivitySetting.js | 35 ++++++++++++++++--- src/hooks/roofcover/useRoofShapeSetting.js | 9 +++-- src/hooks/useEvent.js | 1 - 9 files changed, 75 insertions(+), 27 deletions(-) diff --git a/src/components/fabric/QLine.js b/src/components/fabric/QLine.js index ae3c6c62..616143fe 100644 --- a/src/components/fabric/QLine.js +++ b/src/components/fabric/QLine.js @@ -75,7 +75,7 @@ export const QLine = fabric.util.createClass(fabric.Line, { const y2 = this.top + this.height * scaleY const dx = x2 - x1 const dy = y2 - y1 - this.length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(0)) + this.length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(1)) }, addLengthText() { @@ -150,7 +150,7 @@ export const QLine = fabric.util.createClass(fabric.Line, { getLength() { //10배 곱해진 값 return - return Number(this.length.toFixed(1) * 10) + return Number(this.length.toFixed(0) * 10) }, setViewLengthText(bool) { diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index 7c027c2f..64c897c6 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -199,7 +199,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { const end = points[(i + 1) % points.length] const dx = end.x - start.x const dy = end.y - start.y - const length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(1)) * 10 + const length = Number(Math.sqrt(dx * dx + dy * dy).toFixed(0)) * 10 let midPoint @@ -224,7 +224,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { const degree = (Math.atan2(dy, dx) * 180) / Math.PI // Create new text object if it doesn't exist - const text = new fabric.Text(length.toFixed(0), { + const text = new fabric.Text(length.toString(), { left: midPoint.x, top: midPoint.y, fontSize: this.fontSize, diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx index f34d1cb6..d6a4e179 100644 --- a/src/components/floor-plan/CanvasFrame.jsx +++ b/src/components/floor-plan/CanvasFrame.jsx @@ -13,11 +13,7 @@ export default function CanvasFrame({ plan }) { const canvasRef = useRef(null) const { canvas } = useCanvas('canvas') const { contextMenu, currentContextMenu, setCurrentContextMenu } = useContextMenu() - const currentObject = useRecoilValue(currentObjectState) - useEffect(() => { - console.log(currentObject) - }, [currentObject]) useEvent() const loadCanvas = () => { diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index ae8cc79d..96115d98 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -19,6 +19,7 @@ import { MENU } from '@/common/common' import KO from '@/locales/ko.json' import JA from '@/locales/ja.json' import { settingModalFirstOptionsState } from '@/store/settingAtom' +import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom' const canvasMenus = [ { index: 0, name: 'plan.menu.plan.drawing', icon: 'con00', title: MENU.PLAN_DRAWING }, @@ -58,7 +59,8 @@ export default function CanvasMenu(props) { const [verticalHorizontalMode, setVerticalHorizontalMode] = useRecoilState(verticalHorizontalModeState) const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore) const setCurrentMenu = useSetRecoilState(currentMenuState) - const setPoints = useSetRecoilState(outerLinePointsState) + const setOuterLinePoints = useSetRecoilState(outerLinePointsState) + const setPlacementPoints = useSetRecoilState(placementShapeDrawingPointsState) const [canvasZoom, setCanvasZoom] = useRecoilState(canvasZoomState) const [currentCanvasPlan, setcurrentCanvasPlan] = useRecoilState(currentCanvasPlanState) @@ -140,7 +142,8 @@ export default function CanvasMenu(props) { } const handleClear = () => { - setPoints([]) + setOuterLinePoints([]) + setPlacementPoints([]) canvas?.clear() } diff --git a/src/hooks/roofcover/useAuxiliaryDrawing.js b/src/hooks/roofcover/useAuxiliaryDrawing.js index cb33f407..94a7e989 100644 --- a/src/hooks/roofcover/useAuxiliaryDrawing.js +++ b/src/hooks/roofcover/useAuxiliaryDrawing.js @@ -23,10 +23,11 @@ import { outerLineLength2State, outerLineTypeState, } from '@/store/outerLineAtom' -import { calculateDistance, calculateIntersection, distanceBetweenPoints, findClosestPoint } from '@/util/canvas-util' +import { calculateDistance, calculateIntersection, distanceBetweenPoints, findClosestPoint, polygonToTurfPolygon } from '@/util/canvas-util' import { fabric } from 'fabric' import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint' import { useSwal } from '@/hooks/useSwal' +import { booleanPointInPolygon } from '@turf/turf' // 보조선 작성 export function useAuxiliaryDrawing(setShowAuxiliaryModal) { @@ -76,6 +77,8 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { useEffect(() => { typeRef.current = type + clear() + addDocumentEventListener('keydown', document, keydown[type]) }, [type]) useEffect(() => { @@ -103,12 +106,8 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { } }, []) - useEffect(() => { - clear() - addDocumentEventListener('keydown', document, keydown[type]) - }, [type]) - const clear = () => { + addCanvasMouseEventListener('mouse:move', mouseMove) setLength1(0) setLength2(0) @@ -459,8 +458,9 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { } const mouseDown = (e) => { - addCanvasMouseEventListener('mouse:move', mouseMove) + canvas.renderAll() const pointer = getIntersectMousePoint(e) + console.log(pointer) mousePointerArr.current.push(pointer) if (mousePointerArr.current.length === 2) { @@ -621,10 +621,24 @@ export function useAuxiliaryDrawing(setShowAuxiliaryModal) { return } - const roofBases = canvas.getObjects().find((obj) => obj.name === 'roofBase') + const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase') const innerLines = [...lineHistory.current] - roofBases.innerLines = [...innerLines] + roofBases.forEach((roofBase) => { + const roofInnerLines = innerLines.filter((line) => { + const turfPolygon = polygonToTurfPolygon(roofBase) + + // innerLines의 두 점이 모두 polygon 안에 있는지 확인 + const inPolygon1 = booleanPointInPolygon([line.x1, line.y1], turfPolygon) + const inPolygon2 = booleanPointInPolygon([line.x2, line.y2], turfPolygon) + + if (inPolygon1 && inPolygon2) { + return true + } + }) + + roofBase.innerLines = [...roofInnerLines] + }) setShowAuxiliaryModal(false) } diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js index 6533fe79..bc55c921 100644 --- a/src/hooks/roofcover/useRoofAllocationSetting.js +++ b/src/hooks/roofcover/useRoofAllocationSetting.js @@ -95,7 +95,11 @@ export function useRoofAllocationSetting(setShowRoofAllocationSettingModal) { const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase') const wallLines = canvas.getObjects().filter((obj) => obj.name === 'wallLine') roofBases.forEach((roofBase) => { - splitPolygonWithLines(roofBase) + try { + splitPolygonWithLines(roofBase) + } catch (e) { + return + } roofBase.innerLines.forEach((line) => { canvas.remove(line) diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js index 217e71bc..83ecf7ed 100644 --- a/src/hooks/roofcover/useRoofShapePassivitySetting.js +++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js @@ -33,6 +33,9 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod const [type, setType] = useState(TYPES.EAVES) + const isFix = useRef(false) + const initLines = useRef([]) + const buttons = [ { id: 1, name: getMessage('eaves'), type: TYPES.EAVES }, { id: 2, name: getMessage('gable'), type: TYPES.GABLE }, @@ -52,9 +55,11 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod useEffect(() => { addCanvasMouseEventListener('mouse:down', mouseDown) const wallLines = canvas.getObjects().filter((obj) => obj.name === 'wallLine') - canvas.remove(wallLines) + + canvas?.remove(...wallLines) const outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') + initLines.current = outerLines.map((line) => ({ ...line })) outerLines.forEach((outerLine, idx) => { if (idx === 0) { currentLineRef.current = outerLine @@ -66,6 +71,7 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod canvas?.renderAll() return () => { + handleLineToPolygon() canvas?.discardActiveObject() initEvent() } @@ -166,6 +172,14 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod } const handleSave = () => { + isFix.current = true + handleLineToPolygon() + + setShowRoofShapePassivitySettingModal(false) + } + + const handleLineToPolygon = () => { + const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase') const exceptObjs = canvas.getObjects().filter((obj) => obj.name !== 'outerLine' && obj.parent?.name !== 'outerLine') const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine') exceptObjs.forEach((obj) => { @@ -176,13 +190,26 @@ export function useRoofShapePassivitySetting(setShowRoofShapePassivitySettingMod hideLine(line) }) - const wall = addPolygonByLines(lines, { name: 'wallLine', fill: 'transparent', stroke: 'black' }) + let wall + + if (isFix.current) { + wall = addPolygonByLines(lines, { name: 'wallLine', fill: 'transparent', stroke: 'black' }) + } else { + // 그냥 닫을 경우 처리 + wall = addPolygonByLines([...initLines.current], { name: 'wallLine', fill: 'transparent', stroke: 'black' }) + lines.forEach((line, idx) => { + line.attributes = initLines.current[idx].attributes + }) + } wall.lines = [...lines] - + // 기존 그려진 지붕이 없다면 + if (roofBases.length === 0) { + return + } const roof = drawRoofPolygon(wall) canvas.renderAll() - setShowRoofShapePassivitySettingModal(false) } + return { handleSave, handleConfirm, buttons, type, setType, TYPES, offsetRef, pitchRef, handleRollback } } diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js index 1722e287..016cd365 100644 --- a/src/hooks/roofcover/useRoofShapeSetting.js +++ b/src/hooks/roofcover/useRoofShapeSetting.js @@ -244,8 +244,13 @@ export function useRoofShapeSetting(setShowRoofShapeSettingModal) { } } - // 기존 wallLine 제거 - canvas?.remove(canvas.getObjects().filter((obj) => obj.name === 'wallLine')) + // 기존 wallLine, roofBase 제거 + canvas + .getObjects() + .filter((obj) => obj.name === 'wallLine' || obj.name === 'roofBase') + .forEach((line) => { + canvas.remove(line) + }) const polygon = addPolygonByLines(outerLines, { name: 'wallLine' }) polygon.lines = [...outerLines] diff --git a/src/hooks/useEvent.js b/src/hooks/useEvent.js index 639b61b3..d14fa7e5 100644 --- a/src/hooks/useEvent.js +++ b/src/hooks/useEvent.js @@ -43,7 +43,6 @@ export function useEvent() { //default Event 추가 addCanvasMouseEventListener('mouse:move', defaultMouseMoveEvent) addCanvasMouseEventListener('mouse:out', defaultMouseOutEvent) - addDocumentEventListener('keydown', document, defaultKeyboardEvent) addDocumentEventListener('contextmenu', document, defaultContextMenuEvent) if (adsorptionPointAddMode) { addCanvasMouseEventListener('mouse:down', adsorptionPointAddModeStateEvent) From 7f8a862dc8c9cc38db9adb3f7be68dcf409fe837 Mon Sep 17 00:00:00 2001 From: basssy Date: Thu, 17 Oct 2024 14:48:51 +0900 Subject: [PATCH 02/28] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/Stuff.jsx | 10 +- .../management/StuffSearchCondition.jsx | 6 -- .../management/popup/PlanRequestPop.jsx | 96 ++++++++++++++++--- src/locales/ja.json | 5 + src/locales/ko.json | 5 + 5 files changed, 97 insertions(+), 25 deletions(-) diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index cedf1975..30fab787 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -406,14 +406,14 @@ export default function Stuff() {
-

물건목록

+

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

  • - 전체 + {getMessage('stuff.search.grid.all')} {convertNumberToPriceDecimal(totalCount)}
  • - 선택 + {getMessage('stuff.search.grid.selected')} {convertNumberToPriceDecimal(selectedRowDataCount)}
@@ -421,8 +421,8 @@ export default function Stuff() {
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index a8f86718..cf310719 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -99,7 +99,6 @@ export default function StuffSearchCondition() { useEffect(() => { if (isObjectNotEmpty(sessionState)) { - // console.log('판매대리점 리스트 가져오기 위한 세션정보::::::::', sessionState) // storeId가 T01 이거나 1차점일때만 판매대리점 선택 활성화 // get({ url: `/api/object/saleStore/201TES01/list` }).then((res) => { get({ url: `/api/object/saleStore/${sessionState?.storeId}/list` }).then((res) => { @@ -190,7 +189,6 @@ export default function StuffSearchCondition() { { setObjectNo(e.target.value) @@ -205,7 +203,6 @@ export default function StuffSearchCondition() { { setSaleStoreName(e.target.value) @@ -220,7 +217,6 @@ export default function StuffSearchCondition() { { setAddress(e.target.value) @@ -237,7 +233,6 @@ export default function StuffSearchCondition() { { setobjectName(e.target.value) @@ -252,7 +247,6 @@ export default function StuffSearchCondition() { { setDispCompanyName(e.target.value) diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index 224519d0..46afad46 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -12,6 +12,9 @@ import dayjs from 'dayjs' import PlanRequestPopQGrid from './PlanRequestPopQGrid' import { sessionStore } from '@/store/commonAtom' import { planReqSearchState } from '@/store/planReqAtom' +import { isObjectNotEmpty } from '@/util/common-utils' + +import Select from 'react-select' export default function PlanRequestPop(props) { const sessionState = useRecoilValue(sessionStore) @@ -20,6 +23,7 @@ export default function PlanRequestPop(props) { const { get } = useAxios(globalLocaleState) const { getMessage } = useMessage() + const ref = useRef() // 검색조건 달력 셋팅 const [startDate, setStartDate] = useState(dayjs(new Date()).add(-3, 'month').format('YYYY-MM-DD')) const [endDate, setEndDate] = useState(dayjs(new Date()).format('YYYY-MM-DD')) @@ -34,7 +38,6 @@ export default function PlanRequestPop(props) { setStartDate: setEndDate, } - const ref = useRef() const resetPlanReqRecoil = useResetRecoilState(planReqSearchState) const [planReqSearch, setPlanReqSearch] = useRecoilState(planReqSearchState) @@ -47,14 +50,42 @@ export default function PlanRequestPop(props) { const [schDateGbn, setSchDateGbn] = useState('S') //기간구분코드(S/R) //초기화 - const resetRecoil = () => {} + const resetRecoil = () => { + console.log('초기화') + setSchPlanReqNo('') + setSchTitle('') + setSchAddress('') + setSchSaleStoreName('') + setSchPlanReqName('') + setSchDateGbn('S') + setStartDate(dayjs(new Date()).add(-3, 'month').format('YYYY-MM-DD')) + setEndDate(dayjs(new Date()).format('YYYY-MM-DD')) + setSchPlanStatCd('') + handleClear() //셀렉트 자동완성 초기화 + resetPlanReqRecoil() + } - //초기화 눌렀을 때 자동완성도.. + //셀렉트 자동완성 초기화 const handleClear = () => { - if (ref.current.state.dropDown) { - ref.current.methods.dropDown() + if (ref.current) { + ref.current.clearValue() + } + } + + // 상태 검색조건 변경 + const onSelectionChange = (key) => { + //임시작업 + console.log('E::::::::', key) + if (isObjectNotEmpty(key)) { + setSchPlanStatCd(key.value) + setPlanReqSearch({ + ...planReqSearch, + schPlanStatCd: key.value, + }) } else { - ref.current.state.values = [] + //X누름 + setSchPlanStatCd('') + setPlanReqSearch({ ...planReqSearch, schPlanStatCd: '' }) } } @@ -63,6 +94,11 @@ export default function PlanRequestPop(props) { setEndDate(planReqSearch?.schEndDt ? planReqSearch.schEndDt : dayjs(new Date()).format('YYYY-MM-DD')) }, [planReqSearch]) + // 조회 + const onSubmit = () => { + console.log('조회!!!!', planReqSearch) + } + const [gridProps, setGridProps] = useState({ gridData: [], isPageable: false, @@ -117,6 +153,25 @@ export default function PlanRequestPop(props) { ], }) + const tempList = [ + { + label: '완료', + value: 'C', + }, + { + label: '저장', + value: 'I', + }, + { + label: '접수', + value: 'R', + }, + { + label: '제출', + value: 'S', + }, + ] + return (
@@ -132,8 +187,12 @@ export default function PlanRequestPop(props) {

{getMessage('stuff.planReqPopup.popTitle')}

- - + +
@@ -223,13 +282,22 @@ export default function PlanRequestPop(props) { {getMessage('stuff.planReqPopup.search.planStatName')} -
- - - - - + + + + + */} + { setReceiveUser(e.target.value) diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx index 46afad46..dbd979eb 100644 --- a/src/components/management/popup/PlanRequestPop.jsx +++ b/src/components/management/popup/PlanRequestPop.jsx @@ -1,6 +1,5 @@ import React, { useState, useRef, useEffect } from 'react' import { useForm } from 'react-hook-form' -import { queryStringFormatter } from '@/util/common-utils' import { useAxios } from '@/hooks/useAxios' import { globalLocaleStore } from '@/store/localeAtom' import { useRecoilState, useRecoilValue, useResetRecoilState } from 'recoil' @@ -12,17 +11,23 @@ import dayjs from 'dayjs' import PlanRequestPopQGrid from './PlanRequestPopQGrid' import { sessionStore } from '@/store/commonAtom' import { planReqSearchState } from '@/store/planReqAtom' -import { isObjectNotEmpty } from '@/util/common-utils' +import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils' 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 sessionState = useRecoilValue(sessionStore) const globalLocaleState = useRecoilValue(globalLocaleStore) - const { get } = useAxios(globalLocaleState) + const { get, promiseGet } = useAxios(globalLocaleState) const { getMessage } = useMessage() + //Select ref const ref = useRef() // 검색조건 달력 셋팅 const [startDate, setStartDate] = useState(dayjs(new Date()).add(-3, 'month').format('YYYY-MM-DD')) @@ -51,7 +56,6 @@ export default function PlanRequestPop(props) { //초기화 const resetRecoil = () => { - console.log('초기화') setSchPlanReqNo('') setSchTitle('') setSchAddress('') @@ -75,7 +79,7 @@ export default function PlanRequestPop(props) { // 상태 검색조건 변경 const onSelectionChange = (key) => { //임시작업 - console.log('E::::::::', key) + // console.log('E::::::::', key) if (isObjectNotEmpty(key)) { setSchPlanStatCd(key.value) setPlanReqSearch({ @@ -95,8 +99,56 @@ export default function PlanRequestPop(props) { }, [planReqSearch]) // 조회 - const onSubmit = () => { - console.log('조회!!!!', planReqSearch) + const onSubmit = (page, type) => { + const params = { + saleStoreId: 'T100', + saleStoreLevel: '1', + // saleStoreId: sessionState?.storeId, + // saleStoreLevel: sessionState?.storeLvl, + schPlanReqNo: planReqSearch?.schPlanReqNo ? planReqSearch.schPlanReqNo : schPlanReqNo, + schTitle: planReqSearch?.schTitle ? planReqSearch.schTitle : schTitle, + schAddress: planReqSearch?.schAddress ? planReqSearch.schAddress : schAddress, + schSaleStoreName: planReqSearch?.schSaleStoreName ? planReqSearch.schSaleStoreName : schSaleStoreName, + schPlanReqName: planReqSearch?.schPlanReqName ? planReqSearch.schPlanReqName : schPlanReqName, + schPlanStatCd: planReqSearch?.schPlanStatCd ? planReqSearch.schPlanStatCd : schPlanStatCd, + schDateGbn: planReqSearch?.schDateGbn ? planReqSearch.schDateGbn : schDateGbn, + // schStartDt: dayjs(startDate).format('YYYY-MM-DD'), + // schEndDt: dayjs(endDate).format('YYYY-MM-DD'), + startRow: type === 'S' ? (1 - 1) * pageSize + 1 : (page - 1) * pageSize + 1, + endRow: type === 'S' ? 1 * pageSize : page * pageSize, + } + if (type === 'S') { + setPageNo(1) + } else { + setPageNo(page) + } + + const apiUrl = `/api/object/planReq/list?${queryStringFormatter(params)}` + promiseGet({ url: apiUrl }).then((res) => { + if (res.status === 200) { + if (isNotEmptyArray(res.data.data)) { + setGridProps({ ...gridProps, gridData: res.data.data, gridCount: res.data.data[0].totCnt }) + setTotalCount(res.data.data[0].totCnt) + } else { + setGridProps({ ...gridProps, gridData: [], gridCount: 0 }) + setTotalCount(0) + } + } else { + setGridProps({ ...gridProps, gridData: [], gridCount: 0 }) + setTotalCount(0) + } + }) + } + // 페이징 현재페이지 변경 + const handleChangePage = (page) => { + setPlanReqSearch({ + ...planReqSearch, + startRow: (page - 1) * pageSize + 1, + endRow: page * pageSize, + }) + setPageNo(page) + + onSubmit(page, 'P') } const [gridProps, setGridProps] = useState({ @@ -187,7 +239,12 @@ export default function PlanRequestPop(props) {

{getMessage('stuff.planReqPopup.popTitle')}

- +
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 16/28] =?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 17/28] =?UTF-8?q?helpGuideLine=EC=9D=98=20=EA=B5=90?= =?UTF-8?q?=EC=B0=A8=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 18/28] =?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 698939b21fccede5b65a6c159790e2571d21cb20 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 18 Oct 2024 13:04:00 +0900 Subject: [PATCH 19/28] =?UTF-8?q?scroll=3D{false}=20=EC=9B=90=EB=B3=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/header/Header.jsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/components/header/Header.jsx b/src/components/header/Header.jsx index 900a39c8..c12d237e 100644 --- a/src/components/header/Header.jsx +++ b/src/components/header/Header.jsx @@ -132,7 +132,7 @@ export default function Header(props) { onMouseLeave={(e) => ToggleonMouse(e, 'remove', 'nav > ul')} > {menu.children.length === 0 ? ( - + {getMessage(menu.name)} ) : ( @@ -147,9 +147,7 @@ export default function Header(props) { onMouseEnter={(e) => ToggleonMouse(e, 'add', 'li > ul')} onMouseLeave={(e) => ToggleonMouse(e, 'remove', 'li > ul')} > - - {getMessage(m.name)} - + {getMessage(m.name)} ) })} From ddf984728801c6d46c98fe30c0bf66c1abede39b Mon Sep 17 00:00:00 2001 From: leeyongjae Date: Fri, 18 Oct 2024 13:33:23 +0900 Subject: [PATCH 20/28] =?UTF-8?q?Auto=20Login=20url=20=EA=B2=BD=EB=A1=9C(d?= =?UTF-8?q?ev,=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 From 8152b83b0600c1d38e50cf65acb74b022cf5f91b Mon Sep 17 00:00:00 2001 From: yjnoh Date: Fri, 18 Oct 2024 13:56:24 +0900 Subject: [PATCH 21/28] =?UTF-8?q?=EC=82=BC=EA=B0=81=ED=98=95,=20=EC=98=A4?= =?UTF-8?q?=EA=B0=81=ED=98=95=20=EB=8F=84=EB=A8=B8=20=EC=9E=91=EC=97=85=20?= =?UTF-8?q?=EC=A7=80=EB=B6=95=20=ED=8C=A8=ED=84=B4=20=EA=B0=80=EB=A1=9C=20?= =?UTF-8?q?=EC=84=B8=EB=A1=9C=20=EC=9E=91=EC=97=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/object/ObjectSetting.jsx | 1 + .../modal/object/type/PentagonDormer.jsx | 35 +- .../modal/object/type/TriangleDormer.jsx | 1 - src/hooks/object/useObjectBatch.js | 344 ++++++++++++++++-- src/util/canvas-util.js | 110 ++---- 5 files changed, 383 insertions(+), 108 deletions(-) diff --git a/src/components/floor-plan/modal/object/ObjectSetting.jsx b/src/components/floor-plan/modal/object/ObjectSetting.jsx index d5fe934e..764535e3 100644 --- a/src/components/floor-plan/modal/object/ObjectSetting.jsx +++ b/src/components/floor-plan/modal/object/ObjectSetting.jsx @@ -46,6 +46,7 @@ export default function ObjectSetting({ setShowObjectSettingModal }) { heightRef: useRef(null), pitchRef: useRef(null), offsetRef: useRef(null), + offsetWidthRef: useRef(null), directionRef: useRef(null), } diff --git a/src/components/floor-plan/modal/object/type/PentagonDormer.jsx b/src/components/floor-plan/modal/object/type/PentagonDormer.jsx index e2aeea15..73f9c5d8 100644 --- a/src/components/floor-plan/modal/object/type/PentagonDormer.jsx +++ b/src/components/floor-plan/modal/object/type/PentagonDormer.jsx @@ -1,8 +1,17 @@ import Image from 'next/image' import { useMessage } from '@/hooks/useMessage' +import { forwardRef, useState } from 'react' -export default function PentagonDormer() { +const PentagonDormer = forwardRef((props, refs) => { const { getMessage } = useMessage() + const [direction, setDirection] = useState('down') + refs.directionRef.current = direction + + const getDirection = (e) => { + setDirection(e.target.value) + refs.directionRef.current = e.target.value + } + return ( <>
@@ -18,7 +27,7 @@ export default function PentagonDormer() {
- +
mm
@@ -29,7 +38,7 @@ export default function PentagonDormer() {
- +
mm
@@ -40,18 +49,18 @@ export default function PentagonDormer() {
- +
mm
-
{getMessage('modal.object.setting.offset.depth')}
+
{getMessage('modal.object.setting.offset.width')}
- +
mm
@@ -62,7 +71,7 @@ export default function PentagonDormer() {
- +
@@ -80,13 +89,15 @@ export default function PentagonDormer() { {getMessage('commons.east')} {getMessage('commons.south')} {getMessage('commons.west')} - - - - + + + +
) -} +}) + +export default PentagonDormer diff --git a/src/components/floor-plan/modal/object/type/TriangleDormer.jsx b/src/components/floor-plan/modal/object/type/TriangleDormer.jsx index 9ab7712d..f2a8a1f0 100644 --- a/src/components/floor-plan/modal/object/type/TriangleDormer.jsx +++ b/src/components/floor-plan/modal/object/type/TriangleDormer.jsx @@ -5,7 +5,6 @@ import { forwardRef, useState } from 'react' const TriangleDormer = forwardRef((props, refs) => { const { getMessage } = useMessage() const [direction, setDirection] = useState('down') - refs.directionRef.current = direction const getDirection = (e) => { diff --git a/src/hooks/object/useObjectBatch.js b/src/hooks/object/useObjectBatch.js index 7229f470..9ad8af5d 100644 --- a/src/hooks/object/useObjectBatch.js +++ b/src/hooks/object/useObjectBatch.js @@ -4,14 +4,7 @@ import { useRecoilState, useRecoilValue } from 'recoil' import { canvasState } from '@/store/canvasAtom' import { INPUT_TYPE, BATCH_TYPE } from '@/common/common' import { useEvent } from '@/hooks/useEvent' -import { - polygonToTurfPolygon, - rectToPolygon, - triangleToPolygon, - pointsToTurfPolygon, - splitDormerTriangle, - setSurfaceShapePattern, -} from '@/util/canvas-util' +import { polygonToTurfPolygon, rectToPolygon, triangleToPolygon, pointsToTurfPolygon, setSurfaceShapePattern } from '@/util/canvas-util' import { useSwal } from '@/hooks/useSwal' import * as turf from '@turf/turf' import { QPolygon } from '@/components/fabric/QPolygon' @@ -211,11 +204,13 @@ export function useObjectBatch() { const dormerName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER : BATCH_TYPE.PENTAGON_DORMER const dormerTempName = buttonAct === 3 ? BATCH_TYPE.TRIANGLE_DORMER_TEMP : BATCH_TYPE.PENTAGON_DORMER_TEMP const height = dormerPlacement.heightRef.current.value / 10 + const width = dormerPlacement.widthRef.current.value / 10 const pitch = dormerPlacement.pitchRef.current.value - const directionRef = dormerPlacement.directionRef.current const offsetRef = dormerPlacement.offsetRef.current.value === '' ? 0 : parseInt(dormerPlacement.offsetRef.current.value) / 10 + const offsetWidthRef = dormerPlacement.offsetWidthRef.current.value === '' ? 0 : parseInt(dormerPlacement.offsetWidthRef.current.value) / 10 + const directionRef = dormerPlacement.directionRef.current - let dormer, dormerOffset, isDown, selectedSurface + let dormer, dormerOffset, isDown, selectedSurface, pentagonPoints, pentagonOffsetPoints console.log('dormerPlacement', dormerPlacement) @@ -229,8 +224,6 @@ export function useObjectBatch() { const bottomLength = height / (pitch * 0.25) const bottomOffsetLength = (height + offsetRef) / (pitch * 0.25) - console.log(bottomOffsetLength) - addCanvasMouseEventListener('mouse:move', (e) => { isDown = true if (!isDown) return @@ -305,16 +298,16 @@ export function useObjectBatch() { addCanvasMouseEventListener('mouse:up', (e) => { if (dormer) { - // const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) - // const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) + const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) + const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) - // //지붕 밖으로 그렸을때 - // if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { - // swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) - // //일단 지워 - // deleteTempObjects() - // return - // } + //지붕 밖으로 그렸을때 + if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { + swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) + //일단 지워 + deleteTempObjects() + return + } //각도 추가 let originAngle = 0 //기본 남쪽 @@ -387,6 +380,183 @@ export function useObjectBatch() { drawDirectionArrow(leftTriangle) drawDirectionArrow(rightTriangle) + isDown = false + initEvent() + } + }) + } else if (buttonAct === 4) { + const heightLength = height - (width / 2) * (pitch * 0.25) + //(동의길이 깊이)+출폭(깊이)-[(입력한 폭값)/2+출폭(폭)]*(0.25*입력한 寸) + const heightOffsetLength = height + offsetRef - (width / 2 + offsetWidthRef) * (pitch * 0.25) + + addCanvasMouseEventListener('mouse:move', (e) => { + isDown = true + if (!isDown) return + + canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === dormerTempName)) //움직일때 일단 지워가면서 움직임 + const pointer = canvas.getPointer(e.e) + + surfaceShapePolygons.forEach((surface) => { + if (surface.inPolygon({ x: pointer.x, y: pointer.y })) { + selectedSurface = surface + } + }) + + let angle = 0 + if (directionRef === 'left') { + //서 + angle = 90 + } else if (directionRef === 'right') { + //동 + angle = 270 + } else if (directionRef === 'up') { + //북 + angle = 180 + } + + pentagonPoints = [ + { x: pointer.x, y: pointer.y }, + { x: pointer.x - width / 2, y: pointer.y + (height - heightLength) }, + { x: pointer.x - width / 2, y: pointer.y + height }, + { x: pointer.x + width / 2, y: pointer.y + height }, + { x: pointer.x + width / 2, y: pointer.y + (height - heightLength) }, + ] + + pentagonOffsetPoints = [ + { x: pointer.x, y: pointer.y }, + { x: pointer.x - width / 2 - offsetWidthRef, y: pointer.y + height + offsetRef - heightOffsetLength }, + { x: pointer.x - width / 2 - offsetWidthRef, y: pointer.y + height + offsetRef }, + { x: pointer.x + width / 2 + offsetWidthRef, y: pointer.y + height + offsetRef }, + { x: pointer.x + width / 2 + offsetWidthRef, y: pointer.y + height + offsetRef - heightOffsetLength }, + ] + + dormer = new QPolygon(pentagonPoints, { + fill: 'white', + stroke: 'red', + strokeDashArray: [5, 5], + strokeWidth: 1, + selectable: true, + lockMovementX: true, + lockMovementY: true, + lockRotation: true, + lockScalingX: true, + lockScalingY: true, + name: dormerTempName, + originX: 'center', + originY: 'top', + angle: angle, + }) + canvas?.add(dormer) + + if (offsetRef > 0 || offsetWidthRef > 0) { + dormerOffset = new QPolygon(pentagonOffsetPoints, { + fill: 'gray', + stroke: 'red', + strokeDashArray: [5, 5], + strokeWidth: 1, + selectable: true, + lockMovementX: true, + lockMovementY: true, + lockRotation: true, + lockScalingX: true, + lockScalingY: true, + name: dormerTempName, + originX: 'center', + originY: 'top', + angle: angle, + }) + canvas?.add(dormerOffset) + } + }) + + addCanvasMouseEventListener('mouse:up', (e) => { + if (dormer) { + // const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer)) + // const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface) + + // //지붕 밖으로 그렸을때 + // if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) { + // swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' }) + // //일단 지워 + // deleteTempObjects() + // return + // } + + //각도 추가 + let originAngle = 0 //기본 남쪽 + let direction = 'south' + + if (directionRef === 'left') { + //서 + originAngle = 90 + direction = 'west' + } else if (directionRef === 'right') { + //동 + originAngle = 270 + direction = 'east' + } else if (directionRef === 'up') { + //북 + originAngle = 180 + direction = 'north' + } + + const offsetMode = offsetRef > 0 || offsetWidthRef > 0 ? 'offset' : 'normal' + let splitedPentagon = + offsetRef > 0 || offsetWidthRef > 0 + ? splitDormerPentagon(dormerOffset, directionRef, offsetMode) + : splitDormerPentagon(dormer, directionRef, offsetMode) + canvas?.remove(offsetRef > 0 || offsetWidthRef > 0 ? dormerOffset : dormer) + + if (offsetRef > 0) + dormer.set({ + name: dormerName, + stroke: 'black', + strokeWidth: 1, + strokeDashArray: [0], + }) //오프셋이 있을땐 같이 도머로 만든다 + + const leftPentagon = new QPolygon(splitedPentagon[0], { + fill: 'transparent', + stroke: 'red', + strokeWidth: 1, + selectable: true, + lockMovementX: true, // X 축 이동 잠금 + lockMovementY: true, // Y 축 이동 잠금 + lockRotation: true, // 회전 잠금 + viewLengthText: true, + fontSize: 14, + direction: direction, + originX: 'center', + originY: 'center', + name: dormerName, + }) + + const rightPentagon = new QPolygon(splitedPentagon[1], { + fill: 'transparent', + stroke: 'red', + strokeWidth: 1, + selectable: true, + lockMovementX: true, // X 축 이동 잠금 + lockMovementY: true, // Y 축 이동 잠금 + lockRotation: true, // 회전 잠금 + viewLengthText: true, + fontSize: 14, + direction: direction, + originX: 'center', + originY: 'center', + name: dormerName, + }) + + canvas?.add(leftPentagon) + canvas?.add(rightPentagon) + + //패턴 + setSurfaceShapePattern(leftPentagon) + setSurfaceShapePattern(rightPentagon) + //방향 + drawDirectionArrow(leftPentagon) + drawDirectionArrow(rightPentagon) + isDown = false initEvent() } @@ -408,8 +578,140 @@ export function useObjectBatch() { initEvent() //이벤트 초기화 } + const splitDormerTriangle = (triangle, direction) => { + const halfWidth = triangle.width / 2 + + let leftPoints = [] + let rightPoints = [] + + if (direction === 'down') { + leftPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left - halfWidth, y: triangle.top + triangle.height }, + { x: triangle.left, y: triangle.top + triangle.height }, + ] + + rightPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left, y: triangle.top + triangle.height }, + { x: triangle.left + halfWidth, y: triangle.top + triangle.height }, + ] + } else if (direction === 'up') { + leftPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left - halfWidth, y: triangle.top - triangle.height }, + { x: triangle.left, y: triangle.top - triangle.height }, + ] + + rightPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left, y: triangle.top - triangle.height }, + { x: triangle.left + halfWidth, y: triangle.top - triangle.height }, + ] + } else if (direction === 'left') { + leftPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left - triangle.height, y: triangle.top - halfWidth }, + { x: triangle.left - triangle.height, y: triangle.top }, + ] + + rightPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left - triangle.height, y: triangle.top }, + { x: triangle.left - triangle.height, y: triangle.top + halfWidth }, + ] + } else if (direction === 'right') { + leftPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left + triangle.height, y: triangle.top }, + { x: triangle.left + triangle.height, y: triangle.top + triangle.height }, + ] + + rightPoints = [ + { x: triangle.left, y: triangle.top }, + { x: triangle.left + triangle.height, y: triangle.top }, + { x: triangle.left + triangle.height, y: triangle.top - triangle.height }, + ] + } + + return [leftPoints, rightPoints] + } + + const splitDormerPentagon = (pentagon, direction, offsetMode) => { + const points = pentagon.points + + console.log(pentagon.points) + + let leftPoints = [] + let rightPoints = [] + + if (direction === 'down') { + leftPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[1].x, y: points[1].y }, + { x: points[2].x, y: points[2].y }, + { x: points[0].x, y: points[3].y }, + ] + + rightPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[0].x, y: points[2].y }, + { x: points[3].x, y: points[3].y }, + { x: points[4].x, y: points[4].y }, + ] + } else if (direction === 'up') { + leftPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[1].x, y: points[0].y - (points[1].y - points[0].y) }, + { x: points[2].x, y: points[0].y - (points[2].y - points[0].y) }, + { x: points[0].x, y: points[0].y - (points[2].y - points[0].y) }, + ] + + rightPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[3].x, y: points[0].y - (points[1].y - points[0].y) }, + { x: points[3].x, y: points[0].y - (points[2].y - points[0].y) }, + { x: points[0].x, y: points[0].y - (points[2].y - points[0].y) }, + ] + } else if (direction === 'left') { + leftPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[0].x - (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) }, + { x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y - (points[0].x - points[1].x) }, + { x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y }, + ] + + rightPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[0].x - (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) }, + { x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y + (points[0].x - points[1].x) }, + { x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y }, + ] + } else if (direction === 'right') { + leftPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[0].x + (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) }, + { x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y + (points[0].x - points[1].x) }, + { x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y }, + ] + + rightPoints = [ + { x: points[0].x, y: points[0].y }, + { x: points[0].x + (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) }, + { x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y - (points[0].x - points[1].x) }, + { x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y }, + ] + } + + console.log(leftPoints, rightPoints) + + return [leftPoints, rightPoints] + } + return { applyOpeningAndShadow, applyDormers, + splitDormerTriangle, + splitDormerPentagon, } } diff --git a/src/util/canvas-util.js b/src/util/canvas-util.js index 17c30f07..20b6ec66 100644 --- a/src/util/canvas-util.js +++ b/src/util/canvas-util.js @@ -744,67 +744,6 @@ export const polygonToTurfPolygon = (polygon) => { ) } -export const splitDormerTriangle = (triangle, direction) => { - const halfWidth = triangle.width / 2 - - let leftPoints = [] - let rightPoints = [] - let leftPointOffset = [] - let rightPointOffset = [] - - if (direction === 'down') { - leftPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left - halfWidth, y: triangle.top + triangle.height }, - { x: triangle.left, y: triangle.top + triangle.height }, - ] - - rightPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left, y: triangle.top + triangle.height }, - { x: triangle.left + halfWidth, y: triangle.top + triangle.height }, - ] - } else if (direction === 'up') { - leftPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left - halfWidth, y: triangle.top - triangle.height }, - { x: triangle.left, y: triangle.top - triangle.height }, - ] - - rightPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left, y: triangle.top - triangle.height }, - { x: triangle.left + halfWidth, y: triangle.top - triangle.height }, - ] - } else if (direction === 'left') { - leftPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left - triangle.height, y: triangle.top - halfWidth }, - { x: triangle.left - triangle.height, y: triangle.top }, - ] - - rightPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left - triangle.height, y: triangle.top }, - { x: triangle.left - triangle.height, y: triangle.top + halfWidth }, - ] - } else if (direction === 'right') { - leftPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left + triangle.height, y: triangle.top }, - { x: triangle.left + triangle.height, y: triangle.top + triangle.height }, - ] - - rightPoints = [ - { x: triangle.left, y: triangle.top }, - { x: triangle.left + triangle.height, y: triangle.top }, - { x: triangle.left + triangle.height, y: triangle.top - triangle.height }, - ] - } - - return [leftPoints, rightPoints] -} - export const triangleToPolygon = (triangle) => { const points = [] const halfWidth = triangle.width / 2 @@ -853,7 +792,7 @@ export function setSurfaceShapePattern(polygon) { patternSourceCanvas.width = polygon.width * ratio patternSourceCanvas.height = polygon.height * ratio const ctx = patternSourceCanvas.getContext('2d') - const offset = roofStyle === 1 ? 0 : patternSize.width / 2 + let offset = roofStyle === 1 ? 0 : patternSize.width / 2 const rows = Math.floor(patternSourceCanvas.height / patternSize.height) const cols = Math.floor(patternSourceCanvas.width / patternSize.width) @@ -861,23 +800,46 @@ export function setSurfaceShapePattern(polygon) { ctx.strokeStyle = 'green' ctx.lineWidth = 0.4 - for (let row = 0; row <= rows; row++) { - const y = row * patternSize.height - - ctx.beginPath() - ctx.moveTo(0, y) // 선 시작점 - ctx.lineTo(patternSourceCanvas.width, y) // 선 끝점 - ctx.stroke() - + if (polygon.direction === 'east' || polygon.direction === 'west') { + offset = roofStyle === 1 ? 0 : patternSize.height / 2 for (let col = 0; col <= cols; col++) { - const x = col * patternSize.width + (row % 2 === 0 ? 0 : offset) - const yStart = row * patternSize.height - const yEnd = yStart + patternSize.height - + const x = col * patternSize.width + const yStart = 0 + const yEnd = patternSourceCanvas.height ctx.beginPath() ctx.moveTo(x, yStart) // 선 시작점 ctx.lineTo(x, yEnd) // 선 끝점 ctx.stroke() + + for (let row = 0; row <= rows; row++) { + const y = row * patternSize.height + (col % 2 === 0 ? 0 : offset) + const xStart = col * patternSize.width + const xEnd = xStart + patternSize.width + ctx.beginPath() + ctx.moveTo(xStart, y) // 선 시작점 + ctx.lineTo(xEnd, y) // 선 끝점 + ctx.stroke() + } + } + } else { + for (let row = 0; row <= rows; row++) { + const y = row * patternSize.height + + ctx.beginPath() + ctx.moveTo(0, y) // 선 시작점 + ctx.lineTo(patternSourceCanvas.width, y) // 선 끝점 + ctx.stroke() + + for (let col = 0; col <= cols; col++) { + const x = col * patternSize.width + (row % 2 === 0 ? 0 : offset) + const yStart = row * patternSize.height + const yEnd = yStart + patternSize.height + + ctx.beginPath() + ctx.moveTo(x, yStart) // 선 시작점 + ctx.lineTo(x, yEnd) // 선 끝점 + ctx.stroke() + } } } From aa005b0c3e1ae31b9a529aa24787facd9123df1a Mon Sep 17 00:00:00 2001 From: yoosangwook Date: Fri, 18 Oct 2024 13:56:28 +0900 Subject: [PATCH 22/28] chore: modify .env variable --- .env | 12 ------------ .env.development | 6 ------ .env.production | 4 ---- 3 files changed, 22 deletions(-) diff --git a/.env b/.env index 50ab0d74..e69de29b 100644 --- a/.env +++ b/.env @@ -1,12 +0,0 @@ -# Environment variables declared in this file are automatically made available to Prisma. -# See the documentation for more detail: https://pris.ly/d/prisma-schema#accessing-environment-variables-from-the-schema - -# Prisma supports the native connection string format for PostgreSQL, MySQL, SQLite, SQL Server, MongoDB and CockroachDB. -# See the documentation for all the connection string options: https://pris.ly/d/connection-strings - -# DATABASE_URL="postgresql://johndoe:randompassword@localhost:5432/mydb?schema=public" -# DATABASE_URL="mongodb://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/sample_mflix?retryWrites=true&w=majority" -#DATABASE_URL = "mongodb%2Bsrv%3A%2F%2Fyoo32767%3AGuCtswjLGqUaNL0G%40cluster0.vsdtcnb.mongodb.net%2F%3FretryWrites%3Dtrue%26w%3Dmajority%26appName%3DCluster0" -# DATABASE_URL = "mongodb+srv://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/Cluster0?retryWrites=true&w=majority" -# DATABASE_URL="mongodb://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/sample_mflix?retryWrites=true&w=majority" -DATABASE_URL="mongodb+srv://yoo32767:GuCtswjLGqUaNL0G@cluster0.vsdtcnb.mongodb.net/mytest" \ No newline at end of file diff --git a/.env.development b/.env.development index 3447a6e5..f843c86b 100644 --- a/.env.development +++ b/.env.development @@ -1,10 +1,4 @@ -NEXT_PUBLIC_TEST="테스트변수입니다. development" - NEXT_PUBLIC_API_SERVER_PATH="http://1.248.227.176:38080" -# NEXT_PUBLIC_API_SERVER_PATH="http://localhost:8080" -# NEXT_PUBLIC_API_SERVER_PATH="http://172.30.1.60:8080" - -DATABASE_URL="sqlserver://mssql.devgrr.kr:1433;database=qcast;user=qcast;password=Qwertqaz12345;trustServerCertificate=true" SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" diff --git a/.env.production b/.env.production index 7b8b23ad..c4c7918d 100644 --- a/.env.production +++ b/.env.production @@ -1,9 +1,5 @@ -NEXT_PUBLIC_TEST="테스트변수입니다. production" - NEXT_PUBLIC_API_SERVER_PATH="http://1.248.227.176:38080" -DATABASE_URL="" - SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y=" NEXT_PUBLIC_CONVERTER_API_URL="https://v2.convertapi.com/convert/dwg/to/png?Secret=secret_bV5zuYMyyIYFlOb3" From 325cef14f0306eafc1390dafba14fda55ed40f7d Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 18 Oct 2024 14:15:00 +0900 Subject: [PATCH 23/28] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EC=88=98=EC=A0=95=20react-select=20=20scs?= =?UTF-8?q?s,=20svg=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/images/common/select_del.svg | 4 + src/components/management/Stuff.jsx | 17 ++-- src/components/management/StuffDetail.jsx | 86 ++++++++++--------- .../management/StuffSearchCondition.jsx | 2 + .../management/popup/PlanRequestPop.jsx | 17 ++-- src/styles/_reset.scss | 10 ++- 6 files changed, 73 insertions(+), 63 deletions(-) create mode 100644 public/static/images/common/select_del.svg diff --git a/public/static/images/common/select_del.svg b/public/static/images/common/select_del.svg new file mode 100644 index 00000000..2376f16b --- /dev/null +++ b/public/static/images/common/select_del.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index 9d6ff743..5ce7c8b3 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -245,9 +245,8 @@ export default function Stuff() { } async function fetchData() { - // const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(params)}` - const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(params)}` - + // const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(params)}` + const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(params)}` await get({ url: apiUrl, }).then((res) => { @@ -303,8 +302,8 @@ export default function Stuff() { setPageNo(1) async function fetchData() { - const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` - // const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` + // const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` + const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` await get({ url: apiUrl }).then((res) => { if (!isEmptyArray(res)) { setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt }) @@ -333,8 +332,8 @@ export default function Stuff() { }) setPageNo(1) - // const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` - const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` + // const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` + const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` get({ url: apiUrl }).then((res) => { if (!isEmptyArray(res)) { setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt }) @@ -364,8 +363,8 @@ export default function Stuff() { setPageNo(1) - const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` - // const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` + // const apiUrl = `/api/object/list?saleStoreId=T01&${queryStringFormatter(stuffSearchParams)}` + const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}` get({ url: apiUrl }).then((res) => { if (!isEmptyArray(res)) { setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt }) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index c480b055..3727555e 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -127,7 +127,7 @@ export default function StuffDetail() { } }) } - }, [objectNo]) + }, [objectNo, sessionState]) useEffect(() => { if (isObjectNotEmpty(detailData)) { @@ -303,7 +303,7 @@ export default function StuffDetail() { } // console.log('임시저장용::', errors) - setIsFormValid(Object.keys(errors).length === 0) + setIsFormValid(Object.keys(errors).length === 0 ? true : false) } else { console.log('상세일때 폼체크') } @@ -362,25 +362,14 @@ export default function StuffDetail() { form.setValue('areaId', e.target.value) } - // useEffect(() => { - // if (!isEmptyArray(areaIdList)) { - // let _prefName = form.watch('prefName') - // // console.log('기준풍속 가져오는 API', _prefName) - // get({ url: `/api/object/windSpeed/${_prefName}/list` }).then((res) => { - // // console.log('res::', res) - // if (!isEmptyArray(res)) { - // setWindSpeedList(res) - // } - // }) - // } - // }, [areaIdList]) - //필수값 다 입력했을때 - const onValid = (data) => { + const onValid = (data, e) => { + const formData = form.getValues() + console.log('필수값 통과:::', data, formData) + // console.log('필수값 formData:::', formData) // 수정모드일때는 PUT // console.log('필수값 다 있고 저장') // console.log('data::::::', data) - const formData = form.getValues() // console.log('formData::::', formData) // const _dispCompanyName = watch('dispCompanyName') // const _objectStatusId = watch('objectStatusId') @@ -408,6 +397,8 @@ export default function StuffDetail() { // 임시저장 const onTempSave = async () => { + console.log('임시저장:::::') + return const formData = form.getValues() // console.log('formData::', formData) const params = { @@ -487,9 +478,9 @@ export default function StuffDetail() {
- +
@@ -555,6 +546,8 @@ export default function StuffDetail() {
*/} {getMessage('stuff.detail.windSpeedSpan')} - +
@@ -790,18 +785,18 @@ export default function StuffDetail() {
{!isFormValid ? ( - + ) : ( - + )} - +
@@ -827,9 +822,9 @@ export default function StuffDetail() {
- +
@@ -916,32 +911,32 @@ export default function StuffDetail() { {objectNo.substring(0, 1) === 'R' ? ( <> - + - - + + ) : ( <> {!isFormValid ? ( - + ) : ( - + )} - + )} @@ -949,7 +944,14 @@ export default function StuffDetail() { )} {showAddressButtonValid && } {showDesignRequestButtonValid && ( - + )} {showWindSpeedButtonValid && ( diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx index 3717e43f..ed84073c 100644 --- a/src/components/management/StuffSearchCondition.jsx +++ b/src/components/management/StuffSearchCondition.jsx @@ -254,6 +254,8 @@ export default function StuffSearchCondition() {
{schSelSaleStoreList?.length > 0 && ( Date: Fri, 18 Oct 2024 14:30:56 +0900 Subject: [PATCH 24/28] =?UTF-8?q?[QCAST]=20=EB=82=B4=EC=A0=95=EB=B3=B4?= =?UTF-8?q?=ED=8C=9D=EC=97=85=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 | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/components/myInfo/UserInfoModal.jsx b/src/components/myInfo/UserInfoModal.jsx index 7643913c..64677518 100644 --- a/src/components/myInfo/UserInfoModal.jsx +++ b/src/components/myInfo/UserInfoModal.jsx @@ -150,7 +150,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.userId')}
- +
@@ -158,7 +158,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.nameKana')}
- +
@@ -166,7 +166,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.name')}
- +
@@ -235,7 +235,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.category')}
- +
@@ -243,7 +243,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.tel')}
- +
@@ -251,7 +251,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.fax')}
- +
@@ -259,7 +259,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal {getMessage('myinfo.info.mail')}
- +
From 6eb9535dfc2570b2ac19c3eee0d477f695eb6bca Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 18 Oct 2024 14:45:03 +0900 Subject: [PATCH 25/28] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=EB=B0=8F=EC=98=A4=ED=94=84=EC=85=8B=20active=20line?= =?UTF-8?q?=20=EC=83=89=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../roofcover/useWallLineOffsetSetting.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/hooks/roofcover/useWallLineOffsetSetting.js b/src/hooks/roofcover/useWallLineOffsetSetting.js index 6f65b58e..b84e9ef4 100644 --- a/src/hooks/roofcover/useWallLineOffsetSetting.js +++ b/src/hooks/roofcover/useWallLineOffsetSetting.js @@ -1,4 +1,4 @@ -import { canvasState } from '@/store/canvasAtom' +import { canvasState, currentObjectState } from '@/store/canvasAtom' import { useRecoilValue } from 'recoil' import { useEffect, useRef, useState } from 'react' import { useMessage } from '@/hooks/useMessage' @@ -21,6 +21,8 @@ export function useWallLineOffsetSetting(setShowWallLineOffsetSettingModal) { const arrow1Ref = useRef(null) const arrow2Ref = useRef(null) + const currentObject = useRecoilValue(currentObjectState) + const [isLoading, setIsLoading] = useState(false) const drawLine = (point1, point2, idx, direction = currentWallLineRef.current.direction) => { @@ -87,6 +89,7 @@ export function useWallLineOffsetSetting(setShowWallLineOffsetSettingModal) { if (!isLoading) { return } + canvas?.discardActiveObject() removeOuterLineEditCircle() addCanvasMouseEventListener('mouse:down', mouseDown) if (type === TYPES.WALL_LINE_EDIT) { @@ -94,6 +97,20 @@ export function useWallLineOffsetSetting(setShowWallLineOffsetSettingModal) { } }, [type]) + useEffect(() => { + canvas + .getObjects() + .filter((obj) => obj.name === 'outerLine') + .forEach((line) => { + line.set({ stroke: 'black' }) + }) + + if (currentObject?.name === 'outerLine') { + currentObject.set({ stroke: '#EA10AC' }) + canvas.renderAll() + } + }, [currentObject]) + const removeOuterLineEditCircle = () => { canvas.remove(...canvas.getObjects().filter((obj) => obj.name === 'outerLineEditCircleStart' || obj.name === 'outerLineEditCircleEnd')) } @@ -106,7 +123,6 @@ export function useWallLineOffsetSetting(setShowWallLineOffsetSettingModal) { } currentWallLineRef.current = e.target - console.log(currentWallLineRef.current.idx, currentWallLineRef.current.direction) if (type === TYPES.WALL_LINE_EDIT) { addCircleByLine(currentWallLineRef.current) } From 076ea3afbab219daefaf62a36ebfb8ccc2ca985d Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Fri, 18 Oct 2024 14:55:06 +0900 Subject: [PATCH 26/28] =?UTF-8?q?polygon=20LengthText=20=EC=83=9D=EC=84=B1?= =?UTF-8?q?=20=EC=9C=84=EC=B9=98=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/fabric/QPolygon.js | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index b708daa2..ad08e884 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -203,23 +203,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { let midPoint - switch (this.direction) { - case 'north': - midPoint = new fabric.Point((start.x + end.x) / 2, (start.y + end.y) / 2 - 30) - break - case 'west': - midPoint = new fabric.Point((start.x + end.x) / 2 - 30, (start.y + end.y) / 2) - break - case 'south': - midPoint = new fabric.Point((start.x + end.x) / 2, (start.y + end.y) / 2 + 30) - break - case 'east': - midPoint = new fabric.Point((start.x + end.x) / 2 + 30, (start.y + end.y) / 2) - break - default: - midPoint = new fabric.Point((start.x + end.x) / 2, (start.y + end.y) / 2) - break - } + midPoint = new fabric.Point((start.x + end.x) / 2, (start.y + end.y) / 2) const degree = (Math.atan2(dy, dx) * 180) / Math.PI From b6e6bdb005e3ba0547cc48137eaa9494459133d3 Mon Sep 17 00:00:00 2001 From: basssy Date: Fri, 18 Oct 2024 15:21:36 +0900 Subject: [PATCH 27/28] =?UTF-8?q?=5Fmain.scss=20=EC=A0=81=EC=9A=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/styles/_main.scss | 1237 +++++++++++++++++++++-------------------- 1 file changed, 636 insertions(+), 601 deletions(-) diff --git a/src/styles/_main.scss b/src/styles/_main.scss index 37170a8b..92c9f8c8 100644 --- a/src/styles/_main.scss +++ b/src/styles/_main.scss @@ -1,652 +1,687 @@ // background img -.background-bord{ - position: absolute; - top: 46px; - left: 0; - width: 100%; - height: 280px; - background: url(../../public/static/images/main/main_background.png)no-repeat center; - background-size: cover; - z-index: 0; +.background-bord { + position: absolute; + top: 46px; + left: 0; + width: 100%; + height: 280px; + background: url(../../public/static/images/main/main_background.png) no-repeat center; + background-size: cover; + z-index: 0; } // main-wrap -.main-contents{ - position: relative; - z-index: 1; - padding-bottom: 15px; +.main-contents { + position: relative; + z-index: 1; + padding-bottom: 15px; } // contents -.store-id-wrap{ - display: flex; - align-items: center; - justify-content: center; - gap: 12px; - padding: 33.5px 0; - border-bottom: 1px solid rgba(255, 255, 255, 0.08); - background-color: rgba(255, 255, 255, 0.05); - .store-id-title{ - position: relative; - padding-left: 32px; - font-size: 13px; - color: #fff; - &::before{ - content: ''; - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - width: 20px; - height: 20px; - background: url(../../public/static/images/main/id_icon.svg)no-repeat center; - } - } - .store-arr{ - display: block; - width: 7px; - height: 10px; - background: url(../../public/static/images/main/store-arr.svg) no-repeat center; - } - .store-id-name{ - font-size: 16px; - color: #fff; - font-weight: 600; +.store-id-wrap { + display: flex; + align-items: center; + justify-content: center; + gap: 12px; + padding: 33.5px 0; + border-bottom: 1px solid rgba(255, 255, 255, 0.08); + background-color: rgba(255, 255, 255, 0.05); + .store-id-title { + position: relative; + padding-left: 32px; + font-size: 13px; + color: #fff; + &::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); + width: 20px; + height: 20px; + background: url(../../public/static/images/main/id_icon.svg) no-repeat center; } + } + .store-arr { + display: block; + width: 7px; + height: 10px; + background: url(../../public/static/images/main/store-arr.svg) no-repeat center; + } + .store-id-name { + font-size: 16px; + color: #fff; + font-weight: 600; + } } // main-search-form -.main-search-wrap{ +.main-search-wrap { + display: flex; + align-items: center; + justify-content: center; + padding: 45px 0; + .search-raido-wrap { display: flex; align-items: center; - justify-content: center; - padding: 45px 0; - .search-raido-wrap{ - display: flex; - align-items: center; - gap: 16px; - margin-right: 30px; - } + gap: 16px; + margin-right: 30px; + } } -.search-input-box{ - display: flex; - align-items: center; - width: 580px; - height: 45px; - border-radius: 100px; - padding: 0 20px; - border: 1px solid rgba(255, 255, 255, 0.30); - background: rgba(31, 31, 31, 0.30); - .main-search{ - flex: 1; - height: 100%; - font-size: 13px; - color: #fff; - background-color: transparent; - outline: none; - border: none; - font-family: 'Noto Sans JP', sans-serif; - } - .search-icon{ - width: 20px; - height: 100%; - background-image: url(../../public/static/images/main/main_search.svg); - background-repeat: no-repeat; - background-position: center; - background-size: 21px 21px; - } +.search-input-box { + display: flex; + align-items: center; + width: 580px; + height: 45px; + border-radius: 100px; + padding: 0 20px; + border: 1px solid rgba(255, 255, 255, 0.3); + background: rgba(31, 31, 31, 0.3); + .main-search { + flex: 1; + height: 100%; + font-size: 13px; + color: #fff; + background-color: transparent; + outline: none; + border: none; + font-family: 'Noto Sans JP', sans-serif; + } + .search-icon { + width: 20px; + height: 100%; + background-image: url(../../public/static/images/main/main_search.svg); + background-repeat: no-repeat; + background-position: center; + background-size: 21px 21px; + } } // main-contents-inner -.main-product-list-wrap{ - max-width: 1400px; - margin: 0 auto; - .main-product-list{ +.main-product-list-wrap { + max-width: 1400px; + margin: 0 auto; + .main-product-list { + display: flex; + gap: 24px; + margin-bottom: 24px; + .product-item { + display: flex; + flex-direction: column; + padding: 40px; + border-radius: 6px; + background: #fff; + box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.02); + &.item01 { + flex: 1; + max-height: 400px; + } + &.item02 { + flex: none; + width: 451px; + max-height: 400px; + } + &.item03 { + flex: 1; + } + &.item04 { + flex: none; + width: 351px; + } + &.item05 { + flex: none; + width: 451px; + } + .product-item-title-wrap { display: flex; - gap: 24px; - margin-bottom: 24px; - .product-item{ + align-items: center; + .product-item-title { + display: flex; + align-items: center; + font-size: 16px; + color: #101010; + font-weight: 600; + .item-logo { + display: block; + width: 40px; + height: 40px; + border-radius: 50px; + background: #14324f; + margin-right: 12px; + background-repeat: no-repeat; + background-size: 22px 22px; + background-position: center; + &.ico01 { + background-image: url(../../public/static/images/main/product_ico01.svg); + } + &.ico02 { + background-image: url(../../public/static/images/main/product_ico02.svg); + } + &.ico03 { + background-image: url(../../public/static/images/main/product_ico03.svg); + } + &.ico04 { + background-image: url(../../public/static/images/main/product_ico04.svg); + } + &.ico05 { + background-image: url(../../public/static/images/main/product_ico05.svg); + } + } + } + .more-btn { + display: block; + width: 20px; + height: 20px; + margin-left: auto; + background: url(../../public/static/images/main/more_btn.svg) no-repeat center; + } + } + .product-item-content { + margin-top: 30px; + overflow: hidden; + .recently-list { + .recently-item { + border: 1px solid #f2f2f2; + background-color: transparent; + padding: 29.9px 20px; + margin-bottom: 5px; + cursor: pointer; + .item-inner { + display: flex; + align-items: center; + span { + position: relative; + display: block; + font-size: 13px; + color: #101010; + font-weight: 400; + padding: 0 10px; + &.time { + padding-left: 22px; + &::before { + content: ''; + position: absolute; + top: 50%; + left: 0; + transform: translateY(-50%); + width: 14px; + height: 14px; + background: url(../../public/static/images/main/clock.svg) no-repeat center; + background-size: cover; + } + } + &:after { + content: ''; + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + width: 1px; + height: 10px; + background-color: #bbb; + } + &:last-child { + &:after { + display: none; + } + } + } + } + &:last-child { + margin-bottom: 5px; + } + } + } + .notice-box { + height: 100%; + overflow-y: auto; + .notice-day { + font-size: 13px; + color: #666; + font-weight: 400; + margin-bottom: 7px; + } + .notice-title { + font-size: 14px; + color: #101010; + font-weight: 600; + margin-bottom: 25px; + line-height: 24px; + word-break: keep-all; + } + .notice-contents { + font-size: 12px; + color: #666; + font-weight: 400; + line-height: 22px; + span { + position: relative; + display: block; + padding-left: 10px; + &::before { + content: ''; + position: absolute; + top: 10px; + left: 3px; + width: 3px; + height: 3px; + border-radius: 100%; + background-color: #666; + } + } + } + &::-webkit-scrollbar { + width: 4px; /* 스크롤바의 너비 */ + } + &::-webkit-scrollbar-thumb { + background: #697c8f; /* 스크롤바의 색상 */ + } + &::-webkit-scrollbar-track { + background: transparent; /*스크롤바 뒷 배경 색상*/ + } + } + .faq-item { + position: relative; + margin-bottom: 10px; + cursor: pointer; + .faq-item-inner { display: flex; - flex-direction: column; - padding: 40px; - border-radius: 6px; - background: #FFF; - box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.02); - &.item01{flex: 1; max-height: 400px;} - &.item02{flex: none; width: 451px; max-height: 400px;} - &.item03{flex: 1;} - &.item04{flex: none; width: 351px;} - &.item05{flex: none; width: 451px;} - .product-item-title-wrap{ - display: flex; - align-items: center; - .product-item-title{ - display: flex; - align-items: center; - font-size: 16px; - color: #101010; - font-weight: 600; - .item-logo{ - display: block; - width: 40px; - height: 40px; - border-radius: 50px; - background: #14324F; - margin-right: 12px; - background-repeat: no-repeat; - background-size: 22px 22px; - background-position: center; - &.ico01{background-image: url(../../public/static/images/main/product_ico01.svg);} - &.ico02{background-image: url(../../public/static/images/main/product_ico02.svg);} - &.ico03{background-image: url(../../public/static/images/main/product_ico03.svg);} - &.ico04{background-image: url(../../public/static/images/main/product_ico04.svg);} - &.ico05{background-image: url(../../public/static/images/main/product_ico05.svg);} - } - } - .more-btn{ - display: block; - width: 20px; - height: 20px; - margin-left: auto; - background: url(../../public/static/images/main/more_btn.svg)no-repeat center; - } + align-items: center; + + .faq-num { + flex: none; + padding: 7px 12.5px; + font-size: 13px; + color: #101010; + font-weight: 600; + border-radius: 110px; + border: 1px solid rgba(242, 242, 242, 0.95); + margin-right: 20px; } - .product-item-content{ - margin-top: 30px; - overflow: hidden; - .recently-list{ - .recently-item{ - border: 1px solid #F2F2F2; - background-color: transparent; - padding: 29.9px 20px; - margin-bottom: 5px; - cursor: pointer; - .item-inner{ - display: flex; - align-items: center; - span{ - position: relative; - display: block; - font-size: 13px; - color: #101010; - font-weight: 400; - padding: 0 10px; - &.time{ - padding-left: 22px; - &::before{ - content: ''; - position: absolute; - top: 50%; - left: 0; - transform: translateY(-50%); - width: 14px; - height: 14px; - background:url(../../public/static/images/main/clock.svg)no-repeat center; - background-size: cover; - } - } - &:after{ - content: ''; - position: absolute; - top: 50%; - right: 0; - transform: translateY(-50%); - width: 1px; - height: 10px; - background-color: #BBB; - } - &:last-child{ - &:after{ - display: none; - } - } - } - } - &:last-child{ - margin-bottom: 5px; - } - } - } - .notice-box{ - height: 100%; - overflow-y: auto; - .notice-day{ - font-size: 13px; - color: #666; - font-weight: 400; - margin-bottom: 7px; - } - .notice-title{ - font-size: 14px; - color: #101010; - font-weight: 600; - margin-bottom: 25px; - line-height: 24px; - word-break: keep-all; - } - .notice-contents{ - font-size: 12px; - color: #666; - font-weight: 400; - line-height: 22px; - span{ - position: relative; - display: block; - padding-left: 10px; - &::before{ - content: ''; - position: absolute; - top: 10px; - left: 3px; - width: 3px; - height: 3px; - border-radius: 100%; - background-color: #666; - } - } - } - &::-webkit-scrollbar {width: 4px; /* 스크롤바의 너비 */} - &::-webkit-scrollbar-thumb {background: #697C8F; /* 스크롤바의 색상 */} - &::-webkit-scrollbar-track {background: transparent; /*스크롤바 뒷 배경 색상*/} - } - .faq-item{ - position: relative; - margin-bottom: 10px; - cursor: pointer; - .faq-item-inner{ - display: flex; - align-items: center; - - .faq-num{ - flex: none; - padding: 7px 12.5px; - font-size: 13px; - color: #101010; - font-weight: 600; - border-radius: 110px; - border: 1px solid rgba(242, 242, 242, 0.95); - margin-right: 20px; - } - .faq-title{ - width: 0; - flex: 1 1 auto; - font-size: 13px; - color: #101010; - font-weight: 500; - padding-right: 96px; - white-space: nowrap; - text-overflow: ellipsis; - overflow: hidden; - } - .faq-day{ - position: absolute; - top: 50%; - right: 0; - transform: translateY(-50%); - font-size: 13px; - color: #101010; - font-weight: 400; - } - } - &:last-child{ - margin-bottom: 0; - } - } - .data-download-wrap{ - width: 100%; - .data-down{ - display: block; - width: 100%; - padding: 20px; - text-align: left; - border-radius: 4px; - background-color: #697C8F; - margin-bottom: 5px; - transition: background .17s ease-in-out; - span{ - position: relative; - display: block; - padding-right: 30px; - font-size: 13px; - color: #fff; - font-weight: 400; - &:after{ - content: ''; - position: absolute; - top: 50%; - right: 0; - transform: translateY(-50%); - width: 18px; - height: 16px; - background: url(../../public/static/images/main/download.svg)no-repeat center; - background-size: cover; - } - } - &:last-child{ - margin-bottom: 0; - } - &:hover{ - background-color: #859eb6; - } - } - } - .contact-info-list{ - padding: 25px 30px; - border-radius: 4px; - background-color: #F4F4F7; - .info-item{ - display: flex; - align-items: center; - padding: 15px 0; - border-bottom: 1px solid #fff; - &:first-child{padding-top: 0;} - &:last-child{padding-bottom: 0; border: none;} - .icon-box{ - display: flex; - margin-right: 12px; - } - .infor-data{ - font-size: 13px; - color: #101010; - font-weight: 500; - } - } - } + .faq-title { + width: 0; + flex: 1 1 auto; + font-size: 13px; + color: #101010; + font-weight: 500; + padding-right: 96px; + white-space: nowrap; + text-overflow: ellipsis; + overflow: hidden; } - } - &:last-child{ + .faq-day { + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + font-size: 13px; + color: #101010; + font-weight: 400; + } + } + &:last-child { margin-bottom: 0; + } } + .data-download-wrap { + width: 100%; + .data-down { + display: block; + width: 100%; + padding: 20px; + text-align: left; + border-radius: 4px; + background-color: #697c8f; + margin-bottom: 5px; + transition: background 0.17s ease-in-out; + span { + position: relative; + display: block; + padding-right: 30px; + font-size: 13px; + color: #fff; + font-weight: 400; + &:after { + content: ''; + position: absolute; + top: 50%; + right: 0; + transform: translateY(-50%); + width: 18px; + height: 16px; + background: url(../../public/static/images/main/download.svg) no-repeat center; + background-size: cover; + } + } + &:last-child { + margin-bottom: 0; + } + &:hover { + background-color: #859eb6; + } + } + } + .contact-info-list { + padding: 25px 30px; + border-radius: 4px; + background-color: #f4f4f7; + .info-item { + display: flex; + align-items: center; + padding: 15px 0; + border-bottom: 1px solid #fff; + &:first-child { + padding-top: 0; + } + &:last-child { + padding-bottom: 0; + border: none; + } + .icon-box { + display: flex; + margin-right: 12px; + } + .infor-data { + font-size: 13px; + color: #101010; + font-weight: 500; + } + } + } + } } + &:last-child { + margin-bottom: 0; + } + } } // loginpage -.login-wrap{ - position: relative; +.login-wrap { + position: relative; + width: 100%; + min-height: 100vh; + display: flex; + flex-direction: column; + justify-content: center; + background: url(../../public/static/images/main/login_bg.png) no-repeat center; + background-size: cover; + .login-inner { + max-width: 500px; width: 100%; - min-height: 100vh; - display: flex; - flex-direction: column; - justify-content: center; - background: url(../../public/static/images/main/login_bg.png) no-repeat center; - background-size: cover; - .login-inner{ - max-width: 500px; - width: 100%; - margin: 0 auto; - .login-logo{ - display: block; - margin-bottom: 25px; + margin: 0 auto; + .login-logo { + display: block; + margin-bottom: 25px; + } + .login-input-frame { + padding: 40px 50px; + border-radius: 6px; + background: rgba(255, 255, 255, 0.97); + box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.02); + .login-frame-tit { + font-size: 18px; + color: #364864; + font-weight: 400; + padding-bottom: 30px; + border-bottom: 1px solid #e5e9ef; + span { + display: block; + font-weight: 600; + margin-bottom: 5px; } - .login-input-frame{ - padding: 40px 50px; - border-radius: 6px; - background: rgba(255, 255, 255, 0.97); - box-shadow: 0px 3px 30px 0px rgba(0, 0, 0, 0.02); - .login-frame-tit{ - font-size: 18px; - color: #364864; - font-weight: 400; - padding-bottom: 30px; - border-bottom: 1px solid #E5E9EF; - span{ - display: block; - font-weight: 600; - margin-bottom: 5px; - } - &.pw-reset{ - font-size: 13px; - } - } - .login-input-wrap{ - margin-top: 30px; - .login-area{ - position: relative; - display: flex; - align-items: center; - border: 1px solid #E5E9EF; - height: 45px; - padding-left: 40px; - padding-right: 15px; - margin-bottom: 15px; - .login-input{ - flex: 1; - height: 100%; - background-color: transparent; - font-size: 13px; - font-weight: 400; - color: #6c819c; - &::placeholder{ - font-size: 13px; - font-weight: 400; - color: #D1D7E0; - } - } - &::before{ - content: ''; - position: absolute; - top: 50%; - left: 15px; - transform: translateY(-50%); - width: 10px; - height: 12px; - background-size: cover; - } - button{ - width: 20px; - height: 100%; - background-repeat: no-repeat; - background-position: center; - } - &.id{ - &::before{ - background: url(../../public/static/images/main/login_id.svg)no-repeat center; - } - .id-delete{ - background-image: url(../../public/static/images/main/id_delete.svg); - background-size: 17px 17px; - } - } - &.email{ - &::before{ - background: url(../../public/static/images/main/login_email.svg)no-repeat center; - width: 12px; - height: 9px; - } - .id-delete{ - background-image: url(../../public/static/images/main/id_delete.svg); - background-size: 17px 17px; - } - } - &.password{ - margin-bottom: 20px; - &::before{ - background: url(../../public/static/images/main/login_password.svg)no-repeat center; - } - .password-hidden{ - background-image: url(../../public/static/images/main/password_hidden.svg); - background-size: 19px 13px; - &.visible{ - background-image: url(../../public/static/images/main/password_visible.svg); - } - } - } - } - .login-btn{ - display: block; - width: 100%; - height: 45px; - background-color: #5C6773; - color: #fff; - font-size: 15px; - font-weight: 600; - border-radius: 4px; - transition: background .15s ease-in-out; - &:hover{ - background-color: #717e8d; - } - &.light{ - background-color: #fff; - border: 1px solid #5C6773; - color: #5C6773; - } - } - .login-btn-box{ - margin-bottom: 20px; - } - .pwreset-btn-box{ - display: flex; - } - .reset-password{ - width: 100%; - text-align: center; - button{ - position: relative; - font-size: 13px; - color: #364864; - font-weight: 400; - padding-right: 16px; - &::before{ - content: ''; - position: absolute; - top: calc(50% + 1px); - right: 0; - transform: translateY(-50%); - width: 6px; - height: 8px; - background: url(../../public/static/images/main/login-arr.svg)no-repeat center; - } - } - } - } + &.pw-reset { + font-size: 13px; } - .login-guide-wrap{ - position: relative; - margin-left: 10px; - margin-top: 30px; - padding-left: 15px; + } + .login-input-wrap { + margin-top: 30px; + .login-area { + position: relative; + display: flex; + align-items: center; + border: 1px solid #e5e9ef; + height: 45px; + padding-left: 40px; + padding-right: 15px; + margin-bottom: 15px; + .login-input { + flex: 1; + height: 100%; + background-color: transparent; font-size: 13px; - color: #fff; - line-height: 24px; - a{ - color: #fff; - font-weight: 600; - text-decoration: underline; + font-weight: 400; + color: #6c819c; + &::placeholder { + font-size: 13px; + font-weight: 400; + color: #d1d7e0; } - span{ - position: absolute; - top: 0; - left: 0; + } + &::before { + content: ''; + position: absolute; + top: 50%; + left: 15px; + transform: translateY(-50%); + width: 10px; + height: 12px; + background-size: cover; + } + button { + width: 20px; + height: 100%; + background-repeat: no-repeat; + background-position: center; + } + &.id { + &::before { + background: url(../../public/static/images/main/login_id.svg) no-repeat center; } + .id-delete { + background-image: url(../../public/static/images/main/id_delete.svg); + background-size: 17px 17px; + } + } + &.email { + &::before { + background: url(../../public/static/images/main/login_email.svg) no-repeat center; + width: 12px; + height: 9px; + } + .id-delete { + background-image: url(../../public/static/images/main/id_delete.svg); + background-size: 17px 17px; + } + } + &.password { + margin-bottom: 20px; + &::before { + background: url(../../public/static/images/main/login_password.svg) no-repeat center; + } + .password-hidden { + background-image: url(../../public/static/images/main/password_hidden.svg); + background-size: 19px 13px; + &.visible { + background-image: url(../../public/static/images/main/password_visible.svg); + } + } + } } + .login-btn { + display: block; + width: 100%; + height: 45px; + background-color: #5c6773; + color: #fff; + font-size: 15px; + font-weight: 600; + border-radius: 4px; + transition: background 0.15s ease-in-out; + &:hover { + background-color: #717e8d; + } + &.light { + background-color: #fff; + border: 1px solid #5c6773; + color: #5c6773; + } + } + .login-btn-box { + margin-bottom: 20px; + } + .pwreset-btn-box { + display: flex; + } + .reset-password { + width: 100%; + text-align: center; + button { + position: relative; + font-size: 13px; + color: #364864; + font-weight: 400; + padding-right: 16px; + &::before { + content: ''; + position: absolute; + top: calc(50% + 1px); + right: 0; + transform: translateY(-50%); + width: 6px; + height: 8px; + background: url(../../public/static/images/main/login-arr.svg) no-repeat center; + } + } + } + } } - .login-copyright{ - position: absolute; - bottom: 40px; - left: 50%; - transform: translateX(-50%); - font-size: 11px; + .login-guide-wrap { + position: relative; + margin-left: 10px; + margin-top: 30px; + padding-left: 15px; + font-size: 13px; + color: #fff; + line-height: 24px; + a { color: #fff; - font-weight: 500; + font-weight: 600; + text-decoration: underline; + } + span { + position: absolute; + top: 0; + left: 0; + } } + } + .login-copyright { + position: absolute; + bottom: 40px; + left: 50%; + transform: translateX(-50%); + font-size: 11px; + color: #fff; + font-weight: 500; + } } -.d-check-box{ - &.login{ - margin-bottom: 25px; - label{ - padding-left: 20px; - color: #364864; - &:before{ - width: 22px; - height: 22px; - top: -1px; - border-color: #A8B6C7; - border-radius: 3px; - transition: background .05s ease-in-out; - } - } +.d-check-box { + &.login { + margin-bottom: 25px; + label { + padding-left: 20px; + color: #364864; + &:before { + width: 22px; + height: 22px; + top: -1px; + border-color: #a8b6c7; + border-radius: 3px; + transition: background 0.05s ease-in-out; + } } - input[type=checkbox]:checked + label::before{ - border-color: #A8B6C7; - background-color: #A8B6C7; + input[type='checkbox']:checked + label::before { + border-color: #a8b6c7; + background-color: #a8b6c7; } - input[type=checkbox]:checked + label::after{ - border-color: #fff; - width: 7px; - height: 11px; - top: -2px; - left: 1px; + input[type='checkbox']:checked + label::after { + border-color: #fff; + width: 7px; + height: 11px; + top: -2px; + left: 1px; } + } } // 회원가입 -.center-page-wrap{ - display: flex; - flex-direction: column; - justify-content: center; +.center-page-wrap { + display: flex; + flex-direction: column; + justify-content: center; + width: 100%; + min-height: 100vh; + background-color: #f4f4f7; + overflow-x: hidden; + .center-page-inner { width: 100%; - min-height: 100vh; - background-color: #F4F4F7; - overflow-x: hidden; - .center-page-inner{ - width: 100%; - max-width: 1720px; - margin: 0 auto; - .center-page-tit{ - font-size: 18px; - font-weight: 600; - color: #101010; - margin-bottom: 24px; - } - .sub-table-box{ - &.signup{ - margin-bottom: 20px; - } - } - .sign-up-btn-wrap{ - display: flex; - justify-content: flex-end; - } - &.complete{ - max-width: 1000px; - } + max-width: 1720px; + margin: 0 auto; + .center-page-tit { + font-size: 18px; + font-weight: 600; + color: #101010; + margin-bottom: 24px; } - + .sub-table-box { + &.signup { + margin-bottom: 20px; + } + } + .sign-up-btn-wrap { + display: flex; + justify-content: flex-end; + } + &.complete { + max-width: 1000px; + } + } } // 회원가입 완료 -.complete-box-wrap{ - padding: 72px 80px; - .complete-tit{ - font-size: 18px; - font-weight: 600; - color: #101010; - margin-bottom: 17px; +.complete-box-wrap { + padding: 72px 80px; + .complete-tit { + font-size: 18px; + font-weight: 600; + color: #101010; + margin-bottom: 17px; + } + .complete-txt { + font-size: 13px; + font-weight: 400; + color: #101010; + margin-bottom: 27px; + } + .complete-email-wrap { + padding: 36px 30px; + border-radius: 2px; + background: #f4f4f7; + margin-bottom: 20px; + .email-info { + font-size: 13px; + font-weight: 400; + color: #000; + span { + color: #204af4; + font-weight: 500; + } } - .complete-txt{ - font-size: 13px; - font-weight: 400; - color: #101010; - margin-bottom: 27px; - } - .complete-email-wrap{ - padding: 36px 30px; - border-radius: 2px; - background: #F4F4F7; - margin-bottom: 20px; - .email-info{ - font-size: 13px; - font-weight: 400; - color: #000; - span{ - color: #204AF4; - font-weight: 500; - } - } - } - .complete-btn{ - display: flex; - justify-content: flex-end; - } -} \ No newline at end of file + } + .complete-btn { + display: flex; + justify-content: flex-end; + } +} From 7f56e632cefc6ad4f6a4dddd143a38be0a78f8e3 Mon Sep 17 00:00:00 2001 From: leeyongjae Date: Fri, 18 Oct 2024 16:39:58 +0900 Subject: [PATCH 28/28] =?UTF-8?q?=EC=9E=90=EB=A3=8C=EB=8B=A4=EC=9A=B4?= =?UTF-8?q?=EB=A1=9C=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 --- src/components/community/Archive.jsx | 2 +- src/components/community/ArchiveTable.jsx | 48 ++++++++++++----------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/src/components/community/Archive.jsx b/src/components/community/Archive.jsx index 768bc500..55de76f1 100644 --- a/src/components/community/Archive.jsx +++ b/src/components/community/Archive.jsx @@ -61,7 +61,7 @@ export default function Archive() {
- +
diff --git a/src/components/community/ArchiveTable.jsx b/src/components/community/ArchiveTable.jsx index ef6b303b..371ae454 100644 --- a/src/components/community/ArchiveTable.jsx +++ b/src/components/community/ArchiveTable.jsx @@ -45,7 +45,7 @@ export default function ArchiveTable({ clsCode }) { } fetchData() - }, [search.searchValue]) + }, [search.searchValue, search.searchFlag]) // 상세 파일 목록 조회 const handleDetailFileListDown = async (noticeNo) => { @@ -74,30 +74,34 @@ export default function ArchiveTable({ clsCode }) { return ( <> -
- {boardList?.map((board) => ( -
-
-
- {/* 번호 */} - {board.rowNumber} + {boardList.length > 0 ? ( +
+ {boardList?.map((board) => ( +
+
+
+ {/* 번호 */} + {board.rowNumber} +
+
+ {/* 제목 */} + {board.title} +
+
+ {/* 등록일 */} + {getMessage('board.sub.updDt')} : {board.uptDt ? board.uptDt : board.regDt} +
-
- {/* 제목 */} - {board.title} -
-
- {/* 등록일 */} - {getMessage('board.sub.updDt')} : {board.uptDt ? board.uptDt : board.regDt} +
+ {/* 첨부파일 */} +
-
- {/* 첨부파일 */} - -
-
- ))} -
+ ))} +
+ ) : ( +
{getMessage('common.message.no.data')}
+ )} ) }