- {stepUp?.pcsItemList.map((_, idx) => (
+ {stepUp?.pcsItemList.map((pcsItem, idx) => (
{stepUp.pcsItemList[idx].goodsNo}
@@ -323,19 +374,12 @@ export default function StepUp(props) {
- {stepUp.pcsItemList[idx].serQtyList.map((item, serQtyIdx) => {
- const rowKey = `${stepUp.pcsItemList[idx].goodsNo}_${idx}_${serQtyIdx}`
- const pcsKey = `${stepUp.pcsItemList[idx].goodsNo}_${idx}`
+ {pcsItem.serQtyList.map((item, serQtyIdx) => {
return (
handleRowClick(stepUp.pcsItemList[idx].goodsNo, idx, serQtyIdx, item.serQty, item.paralQty)}
+ key={`row-${serQtyIdx}`}
+ className={`${item.selected ? 'on' : ''}`}
+ onClick={() => handleRowClick(idx, serQtyIdx)}
style={{ cursor: 'pointer' }}
>
| {item.serQty} |
From c7c614b02e58a4cb7b2c38dc2e5418f364857a4b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Mon, 3 Feb 2025 19:30:01 +0900
Subject: [PATCH 002/213] =?UTF-8?q?=F0=9F=9A=A8chore:=20Sync=20Sass?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/styles/_main.scss | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/styles/_main.scss b/src/styles/_main.scss
index 4322b535..e3ccabeb 100644
--- a/src/styles/_main.scss
+++ b/src/styles/_main.scss
@@ -254,7 +254,7 @@
font-weight: 600;
margin-bottom: 25px;
line-height: 24px;
- word-break: keep-all;
+ word-break: break-all;
}
.notice-contents{
font-size: 12px;
From 950e502e893e06d8ffcd2b33f894b957aad21136 Mon Sep 17 00:00:00 2001
From: basssy
Date: Mon, 3 Feb 2025 19:31:30 +0900
Subject: [PATCH 003/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EB=AA=A9=EB=A1=9D?=
=?UTF-8?q?=20=ED=99=94=EB=A9=B4=20=EB=AC=BC=EA=B1=B4=EC=A3=BC=EC=86=8C=20?=
=?UTF-8?q?=ED=95=84=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/management/Stuff.jsx | 17 ++++++++++++++++-
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx
index 2155331c..4e095cea 100644
--- a/src/components/management/Stuff.jsx
+++ b/src/components/management/Stuff.jsx
@@ -149,7 +149,22 @@ export default function Stuff() {
cellStyle: { textAlign: 'left' },
},
{ field: 'saleStoreName', minWidth: 300, headerName: getMessage('stuff.gridHeader.saleStoreName'), cellStyle: { textAlign: 'left' } },
- { field: 'address', headerName: getMessage('stuff.gridHeader.address'), cellStyle: { textAlign: 'left' } },
+ {
+ field: 'address',
+ headerName: getMessage('stuff.gridHeader.address'),
+ cellStyle: { textAlign: 'left' },
+ cellRenderer: (params) => {
+ let prefName = params?.data?.prefName
+ let address = params?.data?.address
+ let showAddress
+ if (params?.data?.prefName && params?.data?.address) {
+ showAddress = prefName + ' ' + address
+ } else {
+ showAddress = null
+ }
+ return showAddress
+ },
+ },
{ field: 'dispCompanyName', headerName: getMessage('stuff.gridHeader.dispCompanyName'), cellStyle: { textAlign: 'left' } },
{ field: 'receiveUser', headerName: getMessage('stuff.gridHeader.receiveUser'), cellStyle: { textAlign: 'left' } },
{
From c7c6ac7e98de80aec31c1b7e49ba56625c0aa423 Mon Sep 17 00:00:00 2001
From: basssy
Date: Mon, 3 Feb 2025 19:36:55 +0900
Subject: [PATCH 004/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=83=81=EC=84=B8=20?=
=?UTF-8?q?=EB=B2=84=ED=8A=BC=20=EB=85=B8=EC=B6=9C=20=EC=A1=B0=EA=B1=B4=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/StuffDetail.jsx | 46 ++++++----
.../management/StuffSearchCondition.jsx | 92 +++++++++++++------
src/components/management/StuffSubHeader.jsx | 13 ++-
3 files changed, 99 insertions(+), 52 deletions(-)
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index e4ef732c..bb820b7c 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -347,13 +347,15 @@ export default function StuffDetail() {
}
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
if (res.status === 200) {
- if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
- //createUser๊ฐ T01์ธ๋ฐ ๋ก๊ทธ์ธ์ฌ์ฉ์๊ฐ T01์ด ์๋๋ฉด ๋ฒํผ์จ๊ธฐ๊ธฐ
+ // if (res?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
+ // setShowButton('none')
+ // } else {
+ // if (session.storeId !== res?.data?.createSaleStoreId) {
+ // setShowButton('none')
+ // }
+ // }
+ if (res?.data?.createSaleStoreId !== session?.storeId) {
setShowButton('none')
- } else {
- if (session.userId !== res?.data?.createUser) {
- setShowButton('none')
- }
}
if (isObjectNotEmpty(res.data)) {
let surfaceTypeValue
@@ -362,7 +364,7 @@ export default function StuffDetail() {
} else if (res.data.surfaceType === 'โ
ก') {
surfaceTypeValue = '2'
}
- setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue, firstFlag: 'Y' })
+ setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
} else {
setManagementState({})
swalFire({
@@ -1420,7 +1422,8 @@ export default function StuffDetail() {
text: getMessage('stuff.detail.save'),
type: 'alert',
confirmFn: () => {
- callDetailApi(objectNo)
+ setManagementState(res?.data)
+ // callDetailApi(objectNo)
},
})
}
@@ -1434,13 +1437,18 @@ export default function StuffDetail() {
const callDetailApi = async (objectNo) => {
await promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
- if (res?.data?.createUser === 'T01' && session?.userId !== 'T01') {
+ // if (res?.data?.createSaleStoreId === 'T01' && session?.storeId !== 'T01') {
+ // setShowButton('none')
+ // } else {
+ // if (session.storeId !== res?.data?.createSaleStoreId) {
+ // setShowButton('none')
+ // }
+ // }
+
+ if (res?.data?.createSaleStoreId !== session?.storeId) {
setShowButton('none')
- } else {
- if (session.userId !== res?.data?.createUser) {
- setShowButton('none')
- }
}
+
let surfaceTypeValue
if (res.data.surfaceType === 'โ
ขใปโ
ฃ') {
surfaceTypeValue = '3'
@@ -1638,10 +1646,14 @@ export default function StuffDetail() {
// ๊ทธ๋ฆฌ๋ ๋๋ธ ํด๋ฆญ ํด๋นํ๋์ ๋๋ฉด์์ฑ ํ๋ฉด์ผ๋ก ์ด๋
const getCellDoubleClicked = (params) => {
//#474์ ์ฑ
- if (managementState.createUser === 'T01') {
- if (session.userId !== 'T01') {
- return false
- }
+ // if (managementState.createUser === 'T01') {
+ // if (session.userId !== 'T01') {
+ // return false
+ // }
+ // }
+
+ if (managementState?.createSaleStoreId !== session?.storeId) {
+ return false
}
if (params?.column?.colId !== 'estimateDate') {
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx
index 19c26521..133eb30e 100644
--- a/src/components/management/StuffSearchCondition.jsx
+++ b/src/components/management/StuffSearchCondition.jsx
@@ -122,8 +122,10 @@ export default function StuffSearchCondition() {
schAddress: address ? address.trim() : '',
schObjectName: objectName ? objectName.trim() : '',
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
- schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? '' : stuffSearch.schSelSaleStoreId,
- schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ // schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? '' : stuffSearch.schSelSaleStoreId,
+ // schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
+ schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
@@ -144,8 +146,10 @@ export default function StuffSearchCondition() {
schAddress: address ? address.trim() : '',
schObjectName: objectName ? objectName.trim() : '',
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
- schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
- schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ // schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
+ // schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
+ schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
@@ -183,27 +187,53 @@ export default function StuffSearchCondition() {
})
} else if (stuffSearch.code === 'E') {
if (session.storeId !== 'T01' && session.storeLvl === '1') {
- setStuffSearch({
- schObjectNo: stuffSearch?.schObjectNo ? stuffSearch.schObjectNo.trim() : objectNo.trim(),
- schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName.trim() : saleStoreName.trim(),
- schAddress: stuffSearch?.schAddress ? stuffSearch.schAddress.trim() : address.trim(),
- schObjectName: stuffSearch?.schObjectName ? stuffSearch.schObjectName.trim() : objectName.trim(),
- schDispCompanyName: stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName.trim() : dispCompanyName.trim(),
- schSelSaleStoreId: myDataCheck ? schSelSaleStoreId : otherSaleStoreId ? schSelSaleStoreId : '',
- schOtherSelSaleStoreId: myDataCheck ? '' : otherSaleStoreId,
- schReceiveUser: stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser.trim() : receiveUser.trim(),
- schDateType: dateType,
- schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
- schMyDataCheck: myDataCheck,
- schFromDt: startDate ? dayjs(startDate).format('YYYY-MM-DD') : '',
- schToDt: endDate ? dayjs(endDate).format('YYYY-MM-DD') : '',
- code: 'E',
- startRow: stuffSearch?.startRow ? stuffSearch.startRow : 1,
- endRow: stuffSearch?.endRow ? stuffSearch.endRow : 100,
- schSortType: stuffSearch?.schSortType ? stuffSearch.schSortType : 'U',
- pageNo: stuffSearch?.pageNo,
- pageSize: stuffSearch?.pageSize,
- })
+ if (stuffSearch.pageNo !== 1) {
+ setStuffSearch({
+ schObjectNo: objectNo ? objectNo.trim() : stuffSearch.schObjectNo.trim(),
+ schSaleStoreName: saleStoreName ? saleStoreName.trim() : '',
+ schAddress: address ? address.trim() : '',
+ schObjectName: objectName ? objectName.trim() : '',
+ schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
+ // schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
+ // schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
+ schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
+ schReceiveUser: receiveUser ? receiveUser.trim() : '',
+ schDateType: dateType,
+ schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
+ schMyDataCheck: myDataCheck,
+ schFromDt: startDate ? dayjs(startDate).format('YYYY-MM-DD') : '',
+ schToDt: endDate ? dayjs(endDate).format('YYYY-MM-DD') : '',
+ code: 'E',
+ startRow: 1,
+ endRow: 1 * stuffSearch?.pageSize,
+ schSortType: 'U',
+ pageNo: 1,
+ pageSize: stuffSearch?.pageSize,
+ })
+ } else {
+ setStuffSearch({
+ schObjectNo: stuffSearch?.schObjectNo ? stuffSearch.schObjectNo.trim() : objectNo.trim(),
+ schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName.trim() : saleStoreName.trim(),
+ schAddress: stuffSearch?.schAddress ? stuffSearch.schAddress.trim() : address.trim(),
+ schObjectName: stuffSearch?.schObjectName ? stuffSearch.schObjectName.trim() : objectName.trim(),
+ schDispCompanyName: stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName.trim() : dispCompanyName.trim(),
+ schSelSaleStoreId: myDataCheck ? schSelSaleStoreId : otherSaleStoreId ? schSelSaleStoreId : '',
+ schOtherSelSaleStoreId: myDataCheck ? '' : otherSaleStoreId,
+ schReceiveUser: stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser.trim() : receiveUser.trim(),
+ schDateType: dateType,
+ schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
+ schMyDataCheck: myDataCheck,
+ schFromDt: startDate ? dayjs(startDate).format('YYYY-MM-DD') : '',
+ schToDt: endDate ? dayjs(endDate).format('YYYY-MM-DD') : '',
+ code: 'E',
+ startRow: stuffSearch?.startRow ? stuffSearch.startRow : 1,
+ endRow: stuffSearch?.endRow ? stuffSearch.endRow : 100,
+ schSortType: stuffSearch?.schSortType ? stuffSearch.schSortType : 'U',
+ pageNo: stuffSearch?.pageNo,
+ pageSize: stuffSearch?.pageSize,
+ })
+ }
} else if (session.storeId === 'T01') {
if (stuffSearch.pageNo !== 1) {
setStuffSearch({
@@ -212,8 +242,10 @@ export default function StuffSearchCondition() {
schAddress: address ? address.trim() : '',
schObjectName: objectName ? objectName.trim() : '',
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
- schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
- schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ // schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
+ // schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
+ schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
+ schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
@@ -600,7 +632,7 @@ export default function StuffSearchCondition() {
if (isObjectNotEmpty(key)) {
setOtherSaleStoreId('')
setSchSelSaleStoreId(key.saleStoreId)
- stuffSearch.schSelSaleStoreId = key.saleStoreId
+ // stuffSearch.schSelSaleStoreId = key.saleStoreId
//๊ณ ๋ฅธ 1์ฐจ์ ์ saleStoreId๋ก 2์ฐจ์ APIํธ์ถํ๊ธฐ
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
let otherList
@@ -645,11 +677,11 @@ export default function StuffSearchCondition() {
stuffSearch.schMyDataCheck = false
if (isObjectNotEmpty(key)) {
setOtherSaleStoreId(key.saleStoreId)
- stuffSearch.schOtherSelSaleStoreId = key.saleStoreId
+ // stuffSearch.schOtherSelSaleStoreId = key.saleStoreId
//2์ฐจ์ ๊ณจ๋์๋ 1์ฐจ์ ๊ฐ
if (session.storeId === 'T01') {
- stuffSearch.schSelSaleStoreId = schSelSaleStoreId
+ // stuffSearch.schSelSaleStoreId = schSelSaleStoreId
} else {
stuffSearch.schSelSaleStoreId = ''
}
diff --git a/src/components/management/StuffSubHeader.jsx b/src/components/management/StuffSubHeader.jsx
index 8e61e259..d6c0f480 100644
--- a/src/components/management/StuffSubHeader.jsx
+++ b/src/components/management/StuffSubHeader.jsx
@@ -38,11 +38,14 @@ export default function StuffSubHeader({ type }) {
useEffect(() => {
if (isObjectNotEmpty(managementState)) {
- if (managementState.createUser === 'T01') {
- if (session.userId !== 'T01') {
- //๋๋ฉด ์์ฑ์ ์ด๋ ํ ์ ์๋๋ก ๋ณ๊ฒฝ #457 ๋ค์ ๋ชปํ๋๋ก ๋ณ๊ฒฝ#474
- setButtonStyle('none')
- }
+ // if (managementState.createUser === 'T01') {
+ // if (session.userId !== 'T01') {
+ // //๋๋ฉด ์์ฑ์ ์ด๋ ํ ์ ์๋๋ก ๋ณ๊ฒฝ #457 ๋ค์ ๋ชปํ๋๋ก ๋ณ๊ฒฝ#474
+ // setButtonStyle('none')
+ // }
+ // }
+ if (managementState.createSaleStoreId !== session?.storeId) {
+ setButtonStyle('none')
}
}
}, [managementState])
From d0c8b10ec62648f8ac1effae252cda56270680fc Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Mon, 3 Feb 2025 19:54:18 +0900
Subject: [PATCH 005/213] =?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EC=83=9D?=
=?UTF-8?q?=EC=84=B1=20=ED=9B=84=20=EB=8F=84=EB=A9=B4=20=ED=81=AC=EA=B8=B0?=
=?UTF-8?q?=20=EC=B6=95=EC=86=8C=20=ED=96=88=EC=9D=84=20=EC=8B=9C,=20?=
=?UTF-8?q?=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EC=9E=91=EC=95=84=EC=A7=80?=
=?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/common/useGrid.js | 26 ++++++++++++++++++--------
1 file changed, 18 insertions(+), 8 deletions(-)
diff --git a/src/hooks/common/useGrid.js b/src/hooks/common/useGrid.js
index abd2a6e0..29a5edea 100644
--- a/src/hooks/common/useGrid.js
+++ b/src/hooks/common/useGrid.js
@@ -71,10 +71,10 @@ export function useGrid() {
const backgroundPolygon = new fabric.Polygon(
[
- { x: 0, y: 0 },
- { x: canvas.width, y: 0 },
- { x: canvas.width, y: canvas.height },
- { x: 0, y: canvas.height },
+ { x: -1500, y: -1500 },
+ { x: 2500, y: -1500 },
+ { x: 2500, y: 2500 },
+ { x: -1500, y: 2500 },
],
{
fill: pattern,
@@ -90,9 +90,14 @@ export function useGrid() {
}
if (patternData.lineGridDisplay) {
- for (let i = 0; i < canvas.height / patternData.gridVertical + 1; i++) {
+ for (let i = 0; i < 5000 / patternData.gridVertical + 1; i++) {
const horizontalLine = new fabric.Line(
- [0, i * patternData.gridVertical - patternData.gridVertical / 2, canvas.width, i * patternData.gridVertical - patternData.gridVertical / 2],
+ [
+ -1500,
+ -1500 + i * patternData.gridVertical - patternData.gridVertical / 2,
+ 3000,
+ -1500 + i * patternData.gridVertical - patternData.gridVertical / 2,
+ ],
{
stroke: gridColor,
strokeWidth: 1,
@@ -113,9 +118,14 @@ export function useGrid() {
canvas.add(horizontalLine)
}
- for (let i = 0; i < canvas.width / patternData.gridHorizon + 1; i++) {
+ for (let i = 0; i < 5000 / patternData.gridHorizon + 1; i++) {
const verticalLine = new fabric.Line(
- [i * patternData.gridHorizon - patternData.gridHorizon / 2, 0, i * patternData.gridHorizon - patternData.gridHorizon / 2, canvas.height],
+ [
+ -1500 + i * patternData.gridHorizon - patternData.gridHorizon / 2,
+ -1500,
+ -1500 + i * patternData.gridHorizon - patternData.gridHorizon / 2,
+ 3000,
+ ],
{
stroke: gridColor,
strokeWidth: 1,
From a2237de250225f325b36d4dc43ba326ab74760d2 Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Mon, 3 Feb 2025 20:23:08 +0900
Subject: [PATCH 006/213] =?UTF-8?q?=EA=B0=80=EB=8C=80=20=EB=94=94=ED=85=8C?=
=?UTF-8?q?=EC=9D=BC=20=EC=A1=B0=ED=9A=8C=20=EC=98=A4=EB=A5=98=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/common/useCommonUtils.js | 12 ++++++++++++
src/hooks/module/useModulePlace.js | 2 +-
src/hooks/module/useModuleTabContents.js | 4 ++--
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/hooks/common/useCommonUtils.js b/src/hooks/common/useCommonUtils.js
index 22694c4d..c790da89 100644
--- a/src/hooks/common/useCommonUtils.js
+++ b/src/hooks/common/useCommonUtils.js
@@ -9,6 +9,7 @@ import { canvasState } from '@/store/canvasAtom'
import { v4 as uuidv4 } from 'uuid'
import { usePopup } from '@/hooks/usePopup'
import Distance from '@/components/floor-plan/modal/distance/Distance'
+import { usePolygon } from '@/hooks/usePolygon'
export function useCommonUtils() {
const canvas = useRecoilValue(canvasState)
@@ -20,6 +21,7 @@ export function useCommonUtils() {
const commonTextFont = useRecoilValue(fontSelector('commonText'))
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
const { addPopup } = usePopup()
+ const { drawDirectionArrow } = usePolygon()
useEffect(() => {
// initEvent()
@@ -609,6 +611,16 @@ export function useCommonUtils() {
if (clonedObj.type === 'group') clonedObj.set({ groupId: uuidv4() })
initEvent()
+
+ //๋ฐฐ์น๋ฉด์ผ ๊ฒฝ์ฐ
+ if (obj.name === 'roof') {
+ clonedObj.setCoords()
+ clonedObj.fire('polygonMoved')
+ clonedObj.set({ direction: obj.direction, directionText: obj.directionText })
+ clonedObj.addLengthText()
+ canvas.renderAll()
+ drawDirectionArrow(clonedObj)
+ }
})
}
}
diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js
index 8b1940f9..bc9913f6 100644
--- a/src/hooks/module/useModulePlace.js
+++ b/src/hooks/module/useModulePlace.js
@@ -39,7 +39,7 @@ export function useModulePlace() {
roofBaseCd: item.trestle.roofBaseCd,
constTp: item.construction.constTp,
mixMatlNo: selectedModules.mixMatlNo,
- roofPitch: item.addRoof.roofPchBase ? item.addRoof.roofPchBase : null,
+ roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
inclCd: String(item.addRoof.pitch),
roofIndex: item.addRoof.index,
workingWidth: item.addRoof.lenBase,
diff --git a/src/hooks/module/useModuleTabContents.js b/src/hooks/module/useModuleTabContents.js
index f15e643f..95317cdd 100644
--- a/src/hooks/module/useModuleTabContents.js
+++ b/src/hooks/module/useModuleTabContents.js
@@ -343,9 +343,9 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
const handleHajebichiAndLength = (e, type) => {
if (type === 'length') {
- setLengthBase(e.target.value)
+ setLengthBase(Number(e.target.value))
} else {
- setHajebichi(e.target.value)
+ setHajebichi(Number(e.target.value))
}
resetSelected()
}
From 679d9f8a3290542c41bcdf0d7944fee5030b5e88 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Mon, 3 Feb 2025 20:34:36 +0900
Subject: [PATCH 007/213] =?UTF-8?q?=EA=B0=80=EB=8C=80=20=EC=84=A4=EC=B9=98?=
=?UTF-8?q?=20=ED=9B=84=20=EB=B9=BD=20=ED=95=A0=20=EA=B2=BD=EC=9A=B0=20?=
=?UTF-8?q?=EA=B8=B0=EC=A1=B4=20=EA=B0=80=EB=8C=80=EA=B4=80=EB=A0=A8=20?=
=?UTF-8?q?=EB=8D=B0=EC=9D=B4=ED=84=B0=20=EC=A7=80=EC=9A=B0=EA=B8=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/common/common.js | 1 +
.../floor-plan/modal/basic/step/Orientation.jsx | 10 ++++++----
src/hooks/common/useMenu.js | 3 +++
src/hooks/module/useTrestle.js | 10 +++++++++-
src/hooks/useTempGrid.js | 4 ++--
src/util/canvas-util.js | 2 +-
6 files changed, 22 insertions(+), 8 deletions(-)
diff --git a/src/common/common.js b/src/common/common.js
index a35dc8c4..2578e138 100644
--- a/src/common/common.js
+++ b/src/common/common.js
@@ -177,6 +177,7 @@ export const SAVE_KEY = [
'moduleRowsTotCnt',
'seq',
'smartRackId',
+ 'directionText',
'quotationParam',
'pcses',
]
diff --git a/src/components/floor-plan/modal/basic/step/Orientation.jsx b/src/components/floor-plan/modal/basic/step/Orientation.jsx
index 590c9d46..d06b6b39 100644
--- a/src/components/floor-plan/modal/basic/step/Orientation.jsx
+++ b/src/components/floor-plan/modal/basic/step/Orientation.jsx
@@ -28,8 +28,10 @@ export const Orientation = forwardRef(({ tabNum }, ref) => {
}, [compasDeg])
const checkDegree = (e) => {
- if (numberCheck(Number(e)) && Number(e) >= -180 && Number(e) <= 180) {
- setCompasDeg(Number(e))
+ if (Number(e) >= -180 && Number(e) <= 180) {
+ if (numberCheck(Number(e))) {
+ setCompasDeg(Number(e))
+ }
} else {
setCompasDeg(compasDeg)
}
@@ -46,8 +48,8 @@ export const Orientation = forwardRef(({ tabNum }, ref) => {
{Array.from({ length: 180 / 15 }).map((dot, index) => (
setCompasDeg(15 * (12 + index))}
+ className={`circle ${getDegreeInOrientation(compasDeg) === -1 * (-15 * index + 180) ? 'act' : ''}`}
+ onClick={() => setCompasDeg(-1 * (-15 * index + 180))}
>
{index === 0 &&
180ยฐ}
{index === 6 &&
-90ยฐ}
diff --git a/src/hooks/common/useMenu.js b/src/hooks/common/useMenu.js
index c0a4e1d5..5eadcf18 100644
--- a/src/hooks/common/useMenu.js
+++ b/src/hooks/common/useMenu.js
@@ -19,6 +19,7 @@ import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
import { useRecoilValue } from 'recoil'
import { currentMenuState } from '@/store/canvasAtom'
import { MENU } from '@/common/common'
+import { useTrestle } from '@/hooks/module/useTrestle'
export default function useMenu() {
const menus = []
@@ -26,6 +27,7 @@ export default function useMenu() {
const [popupId, setPopupId] = useState(uuidv4())
const { addPopup } = usePopup()
const { deleteAllSurfacesAndObjects } = useSurfaceShapeBatch({})
+ const { clear: trestleClear } = useTrestle()
const handleMenu = (type) => {
if (type === 'outline') {
switch (currentMenu) {
@@ -79,6 +81,7 @@ export default function useMenu() {
if (type === 'module') {
switch (currentMenu) {
case MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING:
+ trestleClear()
addPopup(popupId, 1, )
break
case MENU.MODULE_CIRCUIT_SETTING.CIRCUIT_TRESTLE_SETTING:
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index 2fd95ba2..f9aa1de0 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -1882,5 +1882,13 @@ export const useTrestle = () => {
}
}
- return { apply, getTrestleParams }
+ const clear = () => {
+ canvas.getObjects().forEach((obj) => {
+ if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack') {
+ canvas.remove(obj)
+ }
+ })
+ }
+
+ return { apply, getTrestleParams, clear }
}
diff --git a/src/hooks/useTempGrid.js b/src/hooks/useTempGrid.js
index 7bfcf263..d43a19c0 100644
--- a/src/hooks/useTempGrid.js
+++ b/src/hooks/useTempGrid.js
@@ -13,7 +13,7 @@ export function useTempGrid() {
//์์ ๊ทธ๋ฆฌ๋ ๋ชจ๋์ผ ๊ฒฝ์ฐ
let pointer = canvas.getPointer(e.e)
- const tempGrid = new fabric.Line([pointer.x, 0, pointer.x, canvas.height], {
+ const tempGrid = new fabric.Line([pointer.x, -1500, pointer.x, 2500], {
stroke: gridColor,
strokeWidth: 1,
selectable: true,
@@ -41,7 +41,7 @@ export function useTempGrid() {
//์์ ๊ทธ๋ฆฌ๋ ๋ชจ๋์ผ ๊ฒฝ์ฐ
let pointer = { x: e.offsetX, y: e.offsetY }
- const tempGrid = new fabric.Line([0, pointer.y, canvas.width, pointer.y], {
+ const tempGrid = new fabric.Line([-1500, pointer.y, 2500, pointer.y], {
stroke: gridColor,
strokeWidth: 1,
selectable: true,
diff --git a/src/util/canvas-util.js b/src/util/canvas-util.js
index 5df32879..2204eaec 100644
--- a/src/util/canvas-util.js
+++ b/src/util/canvas-util.js
@@ -957,7 +957,7 @@ export const getAllRelatedObjects = (id, canvas) => {
// ๋ชจ๋,ํ๋ก ๊ตฌ์ฑ์์ ์ฌ์ฉํ๋ degree ๋ฒ์ ๋ณ ๊ฐ
export const getDegreeInOrientation = (degree) => {
- if (degree >= 352) {
+ if (degree >= 180 || degree < -180) {
return 0
}
if (degree % 15 === 0) return degree
From 6ad459e4cac7379e6ed0f2b03ba80cf98d1f8b06 Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Mon, 3 Feb 2025 20:40:49 +0900
Subject: [PATCH 008/213] =?UTF-8?q?=EB=B0=B0=EC=B9=98=EB=A9=B4=20=EB=B3=B5?=
=?UTF-8?q?=EC=82=AC=20=EC=9E=91=EC=97=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/common/useCommonUtils.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/hooks/common/useCommonUtils.js b/src/hooks/common/useCommonUtils.js
index c790da89..baaa7dfe 100644
--- a/src/hooks/common/useCommonUtils.js
+++ b/src/hooks/common/useCommonUtils.js
@@ -21,7 +21,7 @@ export function useCommonUtils() {
const commonTextFont = useRecoilValue(fontSelector('commonText'))
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
const { addPopup } = usePopup()
- const { drawDirectionArrow } = usePolygon()
+ const { drawDirectionArrow, addLengthText } = usePolygon()
useEffect(() => {
// initEvent()
@@ -610,17 +610,17 @@ export function useCommonUtils() {
//๊ฐ์ฒด๊ฐ ๊ทธ๋ฃน์ผ ๊ฒฝ์ฐ์๋ ๊ทธ๋ฃน ์์ด๋๋ฅผ ๋ฐ๋ก ๋ฃ์ด์ค๋ค
if (clonedObj.type === 'group') clonedObj.set({ groupId: uuidv4() })
- initEvent()
-
//๋ฐฐ์น๋ฉด์ผ ๊ฒฝ์ฐ
if (obj.name === 'roof') {
clonedObj.setCoords()
clonedObj.fire('polygonMoved')
clonedObj.set({ direction: obj.direction, directionText: obj.directionText })
- clonedObj.addLengthText()
canvas.renderAll()
- drawDirectionArrow(clonedObj)
+ addLengthText(clonedObj) //์์น ์ถ๊ฐ
+ drawDirectionArrow(clonedObj) //๋ฐฉํฅ ํ์ดํ ์ถ๊ฐ
}
+
+ initEvent()
})
}
}
From 12e615717a0911f99ab7bc6aabed69eebfb8a1f2 Mon Sep 17 00:00:00 2001
From: basssy
Date: Mon, 3 Feb 2025 20:45:50 +0900
Subject: [PATCH 009/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=20=EB=B2=84=ED=8A=BC?=
=?UTF-8?q?=20=EB=85=B8=EC=B6=9C=20&=20=EC=A0=80=EC=9E=A5=EC=8B=9C=20?=
=?UTF-8?q?=ED=97=A4=EB=8D=94=20=EA=B4=80=EB=A0=A8=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/StuffDetail.jsx | 68 ++++++--------------
src/components/management/StuffHeader.jsx | 2 +-
src/components/management/StuffSubHeader.jsx | 12 ++--
3 files changed, 25 insertions(+), 57 deletions(-)
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index bb820b7c..c352b9a5 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -283,15 +283,19 @@ export default function StuffDetail() {
cellStyle: { justifyContent: 'center' },
cellRenderer: (params) => {
let buttonStyle
+ let buttonStyle2
if (params.value == null) {
buttonStyle = {
display: 'none',
}
- }
- if (managementState?.createUser === 'T01') {
- if (session.userId !== 'T01') {
- // #474
- buttonStyle = { display: 'none' }
+ buttonStyle2 = {
+ display: 'none',
+ }
+ } else {
+ if (managementState?.createSaleStoreId === 'T01') {
+ if (session?.storeId !== 'T01') {
+ buttonStyle = { display: 'none' }
+ }
}
}
return (
@@ -312,7 +316,7 @@ export default function StuffDetail() {
{getMessage('stuff.detail.planGrid.btn1')}
-
+
>
)) || (
diff --git a/src/components/main/MainContents.jsx b/src/components/main/MainContents.jsx
index 3c1e184b..2985484e 100644
--- a/src/components/main/MainContents.jsx
+++ b/src/components/main/MainContents.jsx
@@ -14,10 +14,9 @@ import { useMainContentsController } from '@/hooks/main/useMainContentsControlle
import { QcastContext } from '@/app/QcastProvider'
import { useSwal } from '@/hooks/useSwal'
-import BoardDetailModal from '../community/modal/BoardDetailModal'
import { handleFileDown } from '@/util/board-utils'
-export default function MainContents() {
+export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
const { swalFire } = useSwal()
const { getMessage } = useMessage()
@@ -116,10 +115,6 @@ export default function MainContents() {
}
}
- // FAQ ํ์
๊ด๋ จ
- const [open, setOpen] = useState(false)
- const [modalNoticeNo, setModalNoticeNo] = useState('')
-
return (
@@ -178,7 +173,6 @@ export default function MainContents() {
- {open &&
}
{recentFaqList.length > 0 ? (
@@ -192,8 +186,8 @@ export default function MainContents() {
className="faq-title pre"
style={{ cursor: 'pointer' }}
onClick={() => {
- setOpen(true)
- setModalNoticeNo(row.noticeNo)
+ setFaqOpen(true)
+ setFaqModalNoticeNo(row.noticeNo)
}}
>
{row.title}
From d0126343b9e2d37aeeed7c0fc814f75ccdbf0929 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Tue, 4 Feb 2025 10:26:15 +0900
Subject: [PATCH 018/213] =?UTF-8?q?=EA=B2=AC=EC=A0=81=EC=84=9C=20=EB=8D=B0?=
=?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EB=A7=8C=EB=93=A4=EA=B8=B0=20=EC=9E=91?=
=?UTF-8?q?=EC=97=85=EC=A4=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 52 ++++++++++++++++++++++++++++++----
src/store/estimateAtom.js | 23 +++++++++++++++
2 files changed, 69 insertions(+), 6 deletions(-)
create mode 100644 src/store/estimateAtom.js
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index 8f1ed94c..eb7ecbc2 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -1,16 +1,18 @@
-import { useRecoilValue } from 'recoil'
+import { useRecoilState, useRecoilValue } from 'recoil'
import { canvasState } from '@/store/canvasAtom'
import { POLYGON_TYPE } from '@/common/common'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
import { v4 as uuidv4 } from 'uuid'
import { useMasterController } from '@/hooks/common/useMasterController'
+import { estimateParamAtom } from '@/store/estimateAtom'
// ํ๋ก ๋ฐ ๊ฐ๋์ค์
export const useTrestle = () => {
const canvas = useRecoilValue(canvasState)
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //๋ค์์ผ๋ก ๋์ด๊ฐ๋ ์ต์ข
๋ฐ์ดํฐ
const { getQuotationItem } = useMasterController()
+ const [estimateParam, setEstimateParam] = useRecoilState(estimateParamAtom)
const apply = () => {
//์ฒ๋ง๋ ฅ๋ฐ๊ฐ ์ฒดํฌ๋์ด ์๋ ๊ฒฝ์ฐ exposedBottomPoints๋ฅผ ์ด์ฉํด ์ฒ๋ง๋ ฅ๋ฐ ๊ทธ๋ ค์ค์ผํจ.
@@ -54,6 +56,10 @@ export const useTrestle = () => {
})
const result = calculateForApi(surface)
+
+ if (!result) {
+ return
+ }
const centerPoints = result.centerPoints
const exposedBottomModules = [] // ์๋ ๋๋ฉด์ด ๋ชจ๋ ๋
ธ์ถ ๋์ด์๋ ๊ฒฝ์ฐ
@@ -439,16 +445,50 @@ export const useTrestle = () => {
const quotationParam = getTrestleParams(surface)
surface.set({ quotationParam })
- getQuoationItems()
+ })
+ setQuoationItem()
+ }
+
+ // itemList ์กฐํ ํ estimateParam์ ์ ์ฅ
+ const setQuoationItem = () => {
+ const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ //surfaces.pcses๋ค์ ๋ฐฐ์ด๋ก ๋ฌถ๋๋ค
+ const pcses = surfaces[0].pcses
+ surfaces.forEach((surface, index) => {
+ if (index !== 0) {
+ pcses.concat(surface.pcses)
+ }
+ })
+ const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
+ //๊ฒฌ์ ์ itemList ์กฐํ
+ getQuotationItem(params).then((res) => {
+ if (!res.data) {
+ return
+ }
+ const itemList = res.data
+ //northArrangement ๋ถ๋ฉด ์ค์น ์ฌ๋ถ
+ const northArrangement = getNorthArrangement()
+
+ setEstimateParam({ ...estimateParam, itemList, northArrangement })
})
}
- const getQuoationItems = () => {
+ const getNorthArrangement = () => {
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
- const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses: surfaces[0].pcses ?? [] }
- getQuotationItem(params).then((res) => {
- console.log('res', res)
+ let northArrangement = '0'
+
+ surfaces.forEach((surface) => {
+ const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
+ const directionText = parent.directionText
+ // ['่ฅฟๅ่ฅฟ','ๆฑๅๆฑ'] ์ ๊ฒฝ์ฐ๋ฅผ ์ ์ธํ๊ณ ๋ ๅ์ด ๋ค์ด๊ฐ ๊ฒฝ์ฐ ์ ๋ถ ๋ถ๋ฉด์ผ๋ก ๊ฐ์ฃผ
+ if (directionText.includes('ๅ') && !directionText.includes('่ฅฟๅ่ฅฟ') && !directionText.includes('ๆฑๅๆฑ')) {
+ if (surface.modules.length > 0) {
+ northArrangement = '1'
+ }
+ }
})
+
+ return northArrangement
}
const findNextModule = (currentPoint, centerPoints, direction) => {
diff --git a/src/store/estimateAtom.js b/src/store/estimateAtom.js
new file mode 100644
index 00000000..20cdaa7c
--- /dev/null
+++ b/src/store/estimateAtom.js
@@ -0,0 +1,23 @@
+import { atom } from 'recoil'
+
+export const estimateParamAtom = atom({
+ // ๊ฒฌ์ ์ post parameter
+ key: 'estimateParamAtom',
+ default: {
+ saleStoreId: '',
+ objectNo: '',
+ planNo: '',
+ slope: '',
+ angle: '',
+ surfaceType: '',
+ setupHeight: '',
+ standardWindSpeedId: '',
+ snowfall: '',
+ northArrangement: '',
+ drawingFlg: '',
+ userId: '',
+ roofSurfaceList: [],
+ circuitItemList: [],
+ itemList: [],
+ },
+})
From eca01e68966801670d8038761dd98167297e1703 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Tue, 4 Feb 2025 11:01:14 +0900
Subject: [PATCH 019/213] =?UTF-8?q?=F0=9F=93=8Cfix:=20=ED=95=9C=EA=B5=AD?=
=?UTF-8?q?=EC=96=B4=20=EB=AC=B8=EA=B5=AC=20=EC=98=A4=ED=83=80=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/locales/ko.json | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 35b62925..f389807c 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -50,8 +50,8 @@
"modal.movement.flow.line.updown.up": "์๋ฆฟ์๋ฅผ ์ฌ๋ฆฌ๋ค",
"modal.movement.flow.line.updown.down": "์๋ฆฟ์๋ฅผ ๋ฎ์ถ๋ค",
"modal.movement.flow.line.info": "๋์ ์ ์ ํํ๊ณ ์ด๋ ํญ์ ์ง์ ํ์ญ์์ค",
- "modal.movement.flow.line.bottom.left": "\"๋์ด๋ณ๊ฒฝ : ์๋\": \"์ผ์ชฝ\"",
- "modal.movement.flow.line.top.right": "\"๋์ด๋ณ๊ฒฝ : ์\": \"์ค๋ฅธ์ชฝ\"",
+ "modal.movement.flow.line.bottom.left": "๋์ด ๋ณ๊ฒฝ: ์๋, ์ผ์ชฝ",
+ "modal.movement.flow.line.top.right": "๋์ด ๋ณ๊ฒฝ: ์, ์ค๋ฅธ์ชฝ",
"plan.menu.roof.cover.outline.edit.offset": "์ธ๋ฒฝ์ ํธ์ง ๋ฐ ์คํ์
",
"plan.menu.roof.cover.roof.surface.alloc": "์ง๋ถ๋ฉด ํ ๋น",
"plan.menu.roof.cover.roof.shape.edit": "์ง๋ถํ์ ํธ์ง",
@@ -84,8 +84,8 @@
"plan.menu.placement.surface.arrangement": "๋ฉดํ์ ๋ฐฐ์น",
"plan.menu.placement.surface.object": "์ค๋ธ์ ํธ ๋ฐฐ์น",
"plan.menu.placement.surface.all.remove": "๋ฐฐ์น๋ฉด ์ ์ฒด ์ญ์ ",
- "plan.menu.module.circuit.setting": "\"๋ชจ๋\": \"ํ๋ก ๊ตฌ์ฑ\"",
- "plan.menu.module.circuit.setting.default": "๋ชจ๋/๊ฐ๋์ค์ ",
+ "plan.menu.module.circuit.setting": "๋ชจ๋ยทํ๋ก ๊ตฌ์ฑ",
+ "plan.menu.module.circuit.setting.default": "๋ชจ๋ยท๊ฐ๋์ค์ ",
"modal.module.basic.setting.orientation.setting": "๋ฐฉ์ ์ค์ ",
"modal.module.basic.setting.orientation.setting.info": "โป์๋ฎฌ๋ ์ด์
๊ณ์ฐ์ฉ ๋ฐฉ์๋ฅผ ์ง์ ํฉ๋๋ค. ๋จ์ชฝ์ ๋ฐฉ์๋ฅผ ์ค์ ํด์ฃผ์ธ์.",
"modal.module.basic.setting.orientation.setting.angle.passivity": "๊ฐ๋๋ฅผ ์ง์ ์
๋ ฅ",
From df05a7d12969b823f3189f98c4378083b9542081 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Tue, 4 Feb 2025 11:32:48 +0900
Subject: [PATCH 020/213] =?UTF-8?q?-=20=EB=AA=A8=EB=93=88=EC=97=90=20pcsIt?=
=?UTF-8?q?emId=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../floor-plan/modal/circuitTrestle/step/StepUp.jsx | 1 +
.../circuitTrestle/step/type/PassivityCircuitAllocation.jsx | 6 +++---
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
index 9f558f16..7d2da472 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
@@ -248,6 +248,7 @@ export default function StepUp(props) {
circuitInfo: module.pcsItemId,
})
targetModule.circuit = moduleCircuitText
+ targetModule.pcsItemId = module.pcsItemId
targetModule.circuitNumber = module.circuit
canvas.add(moduleCircuitText)
})
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
index 77404733..ded6c61f 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
@@ -249,8 +249,8 @@ export default function PassivityCircuitAllocation(props) {
}),
}
})
-
- const pcsItemList = selectedModels.map((model) => {
+ console.log('uniqueCircuitNumbers', uniqueCircuitNumbers)
+ const pcsItemList = selectedModels.map((model, index) => {
return {
pcsMkrCd: model.pcsMkrCd,
pcsSerCd: model.pcsSerCd,
@@ -260,7 +260,7 @@ export default function PassivityCircuitAllocation(props) {
serQtyList: [
{
serQty: targetModules.length,
- paralQty: 0,
+ paralQty: uniqueCircuitNumbers.length,
rmdYn: 'Y',
usePossYn: 'Y',
roofSurfaceList: roofSurfaceList,
From ed25bc6b533d5a6cd3e29f3327a9ab81c10d8185 Mon Sep 17 00:00:00 2001
From: basssy
Date: Tue, 4 Feb 2025 11:53:44 +0900
Subject: [PATCH 021/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EB=AA=A9=EB=A1=9D=20?=
=?UTF-8?q?=EC=A1=B0=ED=9A=8C?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/Stuff.jsx | 2 -
.../management/StuffSearchCondition.jsx | 37 ++++++++++---------
2 files changed, 19 insertions(+), 20 deletions(-)
diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx
index 9b5bc193..51154e92 100644
--- a/src/components/management/Stuff.jsx
+++ b/src/components/management/Stuff.jsx
@@ -230,8 +230,6 @@ export default function Stuff() {
startRow: (stuffSearch.pageNo - 1) * stuffSearchParams.pageSize + 1,
endRow: stuffSearchParams?.endRow,
schSaleStoreId: stuffSearchParams?.schMyDataCheck ? stuffSearchParams.schSaleStoreId : '',
- // schSelSaleStoreId: stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : '',
- // schOtherSelSaleStoreId: stuffSearchParams?.schOtherSelSaleStoreId ? stuffSearchParams.schOtherSelSaleStoreId : '',
schSelSaleStoreId: stuffSearchParams?.schMyDataCheck ? '' : stuffSearchParams.schSelSaleStoreId,
schOtherSelSaleStoreId: stuffSearchParams?.schMyDataCheck ? '' : stuffSearchParams.schOtherSelSaleStoreId,
schSortType: stuffSearchParams.schSortType,
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx
index d9aaba6e..62b75483 100644
--- a/src/components/management/StuffSearchCondition.jsx
+++ b/src/components/management/StuffSearchCondition.jsx
@@ -204,14 +204,14 @@ export default function StuffSearchCondition() {
})
} else {
setStuffSearch({
- schObjectNo: stuffSearch?.schObjectNo ? stuffSearch.schObjectNo.trim() : objectNo.trim(),
- schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName.trim() : saleStoreName.trim(),
- schAddress: stuffSearch?.schAddress ? stuffSearch.schAddress.trim() : address.trim(),
- schObjectName: stuffSearch?.schObjectName ? stuffSearch.schObjectName.trim() : objectName.trim(),
- schDispCompanyName: stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName.trim() : dispCompanyName.trim(),
+ schObjectNo: objectNo ? objectNo.trim() : '',
+ schSaleStoreName: saleStoreName ? saleStoreName.trim() : '',
+ schAddress: address ? address.trim() : '',
+ schObjectName: objectName ? objectName.trim() : '',
+ schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
schSelSaleStoreId: myDataCheck ? schSelSaleStoreId : otherSaleStoreId ? schSelSaleStoreId : '',
schOtherSelSaleStoreId: myDataCheck ? '' : otherSaleStoreId,
- schReceiveUser: stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser.trim() : receiveUser.trim(),
+ schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
schMyDataCheck: myDataCheck,
@@ -250,14 +250,14 @@ export default function StuffSearchCondition() {
})
} else {
setStuffSearch({
- schObjectNo: stuffSearch?.schObjectNo ? stuffSearch.schObjectNo.trim() : objectNo.trim(),
- schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName.trim() : saleStoreName.trim(),
- schAddress: stuffSearch?.schAddress ? stuffSearch.schAddress.trim() : address.trim(),
- schObjectName: stuffSearch?.schObjectName ? stuffSearch.schObjectName.trim() : objectName.trim(),
- schDispCompanyName: stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName.trim() : dispCompanyName.trim(),
+ schObjectNo: objectNo ? objectNo.trim() : '',
+ schSaleStoreName: saleStoreName ? saleStoreName.trim() : '',
+ schAddress: address ? address.trim() : '',
+ schObjectName: objectName ? objectName.trim() : '',
+ schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
schSelSaleStoreId: schSelSaleStoreId,
schOtherSelSaleStoreId: otherSaleStoreId,
- schReceiveUser: stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser.trim() : receiveUser.trim(),
+ schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
schMyDataCheck: myDataCheck,
@@ -273,14 +273,15 @@ export default function StuffSearchCondition() {
}
} else {
setStuffSearch({
- schObjectNo: stuffSearch?.schObjectNo ? stuffSearch.schObjectNo.trim() : objectNo.trim(),
- schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName.trim() : saleStoreName.trim(),
- schAddress: stuffSearch?.schAddress ? stuffSearch.schAddress.trim() : address.trim(),
- schObjectName: stuffSearch?.schObjectName ? stuffSearch.schObjectName.trim() : objectName.trim(),
- schDispCompanyName: stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName.trim() : dispCompanyName.trim(),
+ schObjectNo: objectNo ? objectNo.trim() : '',
+ schSaleStoreName: saleStoreName ? saleStoreName.trim() : '',
+ schAddress: address ? address.trim() : '',
+ schObjectName: objectName ? objectName.trim() : '',
+ schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
schSelSaleStoreId: schSelSaleStoreId,
schOtherSelSaleStoreId: otherSaleStoreId,
- schReceiveUser: stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser.trim() : receiveUser.trim(),
+ schReceiveUser: receiveUser ? receiveUser.trim() : '',
+
schDateType: dateType,
schTempFlg: tempFlg, //์์์ ์ฅ๋ฌผ๊ฑด
schMyDataCheck: myDataCheck,
From 20b6d8db979d66b84e3bf937b73dbe7b8376fc72 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Tue, 4 Feb 2025 12:32:38 +0900
Subject: [PATCH 022/213] =?UTF-8?q?=EB=8F=84=EB=A9=B4=20=EA=B2=AC=EC=A0=81?=
=?UTF-8?q?=EC=84=9C=20=EC=A0=80=EC=9E=A5=20param=20=EC=83=9D=EC=84=B1=20?=
=?UTF-8?q?=EC=9E=91=EC=97=85=EC=A4=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../circuitTrestle/CircuitTrestleSetting.jsx | 5 +-
src/hooks/module/useTrestle.js | 790 ++++++++++--------
src/store/estimateAtom.js | 2 +-
3 files changed, 432 insertions(+), 365 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
index 109da999..7301f0d7 100644
--- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
@@ -356,7 +356,7 @@ export default function CircuitTrestleSetting({ id }) {
}
// ํ๋กํ ๋น(์น์์ค์ ) ์ ์ฅ ๋ฒํผ ํด๋ฆญ ์
- const onApply = () => {
+ const onApply = async () => {
canvas
.getObjects()
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
@@ -364,8 +364,7 @@ export default function CircuitTrestleSetting({ id }) {
obj.pcses = getStepUpListData()
})
- console.log(canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE))
- apply()
+ const result = await apply()
}
const onClickPrev = () => {
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index eb7ecbc2..98113f08 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -1,5 +1,5 @@
import { useRecoilState, useRecoilValue } from 'recoil'
-import { canvasState } from '@/store/canvasAtom'
+import { canvasState, currentAngleTypeSelector } from '@/store/canvasAtom'
import { POLYGON_TYPE } from '@/common/common'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
@@ -13,220 +13,207 @@ export const useTrestle = () => {
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //๋ค์์ผ๋ก ๋์ด๊ฐ๋ ์ต์ข
๋ฐ์ดํฐ
const { getQuotationItem } = useMasterController()
const [estimateParam, setEstimateParam] = useRecoilState(estimateParamAtom)
+ const currentAngleType = useRecoilValue(currentAngleTypeSelector)
const apply = () => {
- //์ฒ๋ง๋ ฅ๋ฐ๊ฐ ์ฒดํฌ๋์ด ์๋ ๊ฒฝ์ฐ exposedBottomPoints๋ฅผ ์ด์ฉํด ์ฒ๋ง๋ ฅ๋ฐ ๊ทธ๋ ค์ค์ผํจ.
- // exposedBottomPoints๋ ๋
ธ์ถ ์ตํ๋ฉด ๋ค์ centerPoint ๋ฐฐ์ด.
+ try {
+ //์ฒ๋ง๋ ฅ๋ฐ๊ฐ ์ฒดํฌ๋์ด ์๋ ๊ฒฝ์ฐ exposedBottomPoints๋ฅผ ์ด์ฉํด ์ฒ๋ง๋ ฅ๋ฐ ๊ทธ๋ ค์ค์ผํจ.
+ // exposedBottomPoints๋ ๋
ธ์ถ ์ตํ๋ฉด ๋ค์ centerPoint ๋ฐฐ์ด.
- const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
- // ๊ธฐ์กด eaveBar๋ฅผ ์ญ์
- canvas.getObjects().forEach((obj) => {
- if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack') {
- canvas.remove(obj)
- }
- })
- canvas.getObjects().forEach((obj) => {
- if (obj.name === 'bracket') {
- canvas.remove(obj)
- }
- })
- surfaces.forEach((surface) => {
- const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
- const roofMaterialIndex = parent.roofMaterial.index
- const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction
- if (!construction) {
- alert('์์์ ์
ํ
์๋จ')
- return
- }
-
- let moduleRowsTotCnt = 0
- let isEaveBar = construction.setupCover
- let isSnowGuard = construction.setupSnowCover
- const direction = parent.direction
- const rack = surface.trestleDetail.rack
- let { rackQty, rackIntvlPct, rackYn, cvrPlvrYn } = surface.trestleDetail
-
- if (!rack) {
- //25/01/16 ๊ธฐ์ค ๋์ด ์๋ ๊ฒฝ์ฐ๋ ๊ทธ๋ฅ ์๊ทธ๋ ค์ค๋ค.
- return
- }
-
- const rackInfos = Object.keys(rack).map((key) => {
- return { key, value: rack[key] }
- })
-
- const result = calculateForApi(surface)
-
- if (!result) {
- return
- }
- const centerPoints = result.centerPoints
-
- const exposedBottomModules = [] // ์๋ ๋๋ฉด์ด ๋ชจ๋ ๋
ธ์ถ ๋์ด์๋ ๊ฒฝ์ฐ
- const leftExposedHalfBottomModules = [] // ์ผ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด์๋ ๊ฒฝ์ฐ
- const rightExposedHalfBottomPoints = [] // ์ค๋ฅธ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
- const leftExposedHalfTopModules = [] // ์ผ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
- const rightExposedHalfTopPoints = [] // ์ค๋ฅธ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
- const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
-
- modules.forEach((module) => {
- const { x, y } = module.getCenterPoint()
- const isExposedBottom = result.exposedBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
- const isLeftExposedHalfBottom = result.leftExposedHalfBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
- const isRightExposedHalfBottom = result.rightExposedHalfBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
- const isRightExposedHalfTop = result.rightExposedHalfTopPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
- const isLeftExposedHalfTop = result.leftExposedHalfTopPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
- if (isExposedBottom) {
- exposedBottomModules.push(module)
- }
- if (isLeftExposedHalfBottom) {
- leftExposedHalfBottomModules.push(module)
- }
- if (isRightExposedHalfBottom) {
- rightExposedHalfBottomPoints.push(module)
- }
- if (isRightExposedHalfTop) {
- leftExposedHalfTopModules.push(module)
- }
- if (isLeftExposedHalfTop) {
- rightExposedHalfTopPoints.push(module)
- }
- })
-
- // 4๊ฐ์ค ํ๊ฐ๋ผ๋ ์๋ ๊ฒฝ์ฐ ์น์กฐ๋ฐฐ์น๋ก ๊ฐ์ฃผํ๋ค.
- const isChidory =
- leftExposedHalfBottomModules.length > 0 ||
- rightExposedHalfBottomPoints.length > 0 ||
- leftExposedHalfTopModules.length > 0 ||
- rightExposedHalfTopPoints.length > 0
-
- surface.set({ isChidory: isChidory })
-
- canvas
- .getObjects()
- .filter((obj) => ['eaveBar', 'halfEaveBar'].includes(obj.name) && obj.parentId === surface.id)
- .forEach((obj) => {
+ const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ // ๊ธฐ์กด eaveBar๋ฅผ ์ญ์
+ canvas.getObjects().forEach((obj) => {
+ if (obj.name === 'eaveBar' || obj.name === 'rack' || obj.name === 'halfEaveBar' || obj.name === 'smartRack') {
canvas.remove(obj)
+ }
+ })
+ canvas.getObjects().forEach((obj) => {
+ if (obj.name === 'bracket') {
+ canvas.remove(obj)
+ }
+ })
+ surfaces.forEach((surface) => {
+ const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
+ const roofMaterialIndex = parent.roofMaterial.index
+ const construction = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex).construction
+ if (!construction) {
+ alert('์์์ ์
ํ
์๋จ')
+ return
+ }
+
+ let moduleRowsTotCnt = 0
+ let isEaveBar = construction.setupCover
+ let isSnowGuard = construction.setupSnowCover
+ const direction = parent.direction
+ const rack = surface.trestleDetail.rack
+ let { rackQty, rackIntvlPct, rackYn, cvrPlvrYn } = surface.trestleDetail
+
+ if (!rack) {
+ //25/01/16 ๊ธฐ์ค ๋์ด ์๋ ๊ฒฝ์ฐ๋ ๊ทธ๋ฅ ์๊ทธ๋ ค์ค๋ค.
+ return
+ }
+
+ const rackInfos = Object.keys(rack).map((key) => {
+ return { key, value: rack[key] }
})
- if (isEaveBar) {
- // ์ฒ๋ง๋ ฅ๋ฐ์ค์น true์ธ ๊ฒฝ์ฐ ์ค์น
- exposedBottomModules.forEach((module) => {
- //TODO : ๋ฐฉํฅ๋ณ๋ก ์ฒ๋ง๋ ฅ๋ฐ ์ค์นํด์ผํจ
- const bottomPoints = findTopTwoPoints([...module.points], direction)
- if (!bottomPoints) return
- const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], {
- parent: surface,
- name: 'eaveBar',
- stroke: 'blue',
- strokeWidth: 4,
- selectable: false,
- surfaceId: surface.id,
- parentId: module.id,
+ const result = calculateForApi(surface)
+
+ if (!result) {
+ return
+ }
+ const centerPoints = result.centerPoints
+
+ const exposedBottomModules = [] // ์๋ ๋๋ฉด์ด ๋ชจ๋ ๋
ธ์ถ ๋์ด์๋ ๊ฒฝ์ฐ
+ const leftExposedHalfBottomModules = [] // ์ผ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด์๋ ๊ฒฝ์ฐ
+ const rightExposedHalfBottomPoints = [] // ์ค๋ฅธ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
+ const leftExposedHalfTopModules = [] // ์ผ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
+ const rightExposedHalfTopPoints = [] // ์ค๋ฅธ์ชฝ ๋ฉด๋ง ๋
ธ์ถ๋์ด ์๋ ๊ฒฝ์ฐ
+ const modules = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE)
+
+ modules.forEach((module) => {
+ const { x, y } = module.getCenterPoint()
+ const isExposedBottom = result.exposedBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
+ const isLeftExposedHalfBottom = result.leftExposedHalfBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
+ const isRightExposedHalfBottom = result.rightExposedHalfBottomPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
+ const isRightExposedHalfTop = result.rightExposedHalfTopPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
+ const isLeftExposedHalfTop = result.leftExposedHalfTopPoints.some((point) => Math.abs(point.x - x) < 2 && Math.abs(point.y - y) < 2)
+ if (isExposedBottom) {
+ exposedBottomModules.push(module)
+ }
+ if (isLeftExposedHalfBottom) {
+ leftExposedHalfBottomModules.push(module)
+ }
+ if (isRightExposedHalfBottom) {
+ rightExposedHalfBottomPoints.push(module)
+ }
+ if (isRightExposedHalfTop) {
+ leftExposedHalfTopModules.push(module)
+ }
+ if (isLeftExposedHalfTop) {
+ rightExposedHalfTopPoints.push(module)
+ }
+ })
+
+ // 4๊ฐ์ค ํ๊ฐ๋ผ๋ ์๋ ๊ฒฝ์ฐ ์น์กฐ๋ฐฐ์น๋ก ๊ฐ์ฃผํ๋ค.
+ const isChidory =
+ leftExposedHalfBottomModules.length > 0 ||
+ rightExposedHalfBottomPoints.length > 0 ||
+ leftExposedHalfTopModules.length > 0 ||
+ rightExposedHalfTopPoints.length > 0
+
+ surface.set({ isChidory: isChidory })
+
+ canvas
+ .getObjects()
+ .filter((obj) => ['eaveBar', 'halfEaveBar'].includes(obj.name) && obj.parentId === surface.id)
+ .forEach((obj) => {
+ canvas.remove(obj)
})
- canvas.add(eaveBar)
- canvas.renderAll()
- })
- if (isChidory && cvrPlvrYn === 'Y') {
- leftExposedHalfBottomModules.forEach((module) => {
+ if (isEaveBar) {
+ // ์ฒ๋ง๋ ฅ๋ฐ์ค์น true์ธ ๊ฒฝ์ฐ ์ค์น
+ exposedBottomModules.forEach((module) => {
+ //TODO : ๋ฐฉํฅ๋ณ๋ก ์ฒ๋ง๋ ฅ๋ฐ ์ค์นํด์ผํจ
const bottomPoints = findTopTwoPoints([...module.points], direction)
- let barPoints = []
- //์ค์นํด์ผํ ๋ฐ์ฒ๋ง์ปค๋ฒ ํฌ์ธํธ๋ฅผ ๋ฐฉํฅ์ ๋ฐ๋ผ ์ค์
-
- if (direction === 'south') {
- barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x - module.width / 2, bottomPoints[1].y]
- } else if (direction === 'north') {
- barPoints = [bottomPoints[0].x + module.width / 2, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y]
- } else if (direction === 'east') {
- barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[0].y - module.height / 2]
- } else if (direction === 'west') {
- barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y - module.height / 2]
- }
-
if (!bottomPoints) return
- const halfEaveBar = new fabric.Line(barPoints, {
+ const eaveBar = new fabric.Line([bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y], {
parent: surface,
- name: 'halfEaveBar',
+ name: 'eaveBar',
stroke: 'blue',
strokeWidth: 4,
selectable: false,
surfaceId: surface.id,
parentId: module.id,
})
- canvas.add(halfEaveBar)
+ canvas.add(eaveBar)
canvas.renderAll()
})
- rightExposedHalfBottomPoints.forEach((module) => {
- const bottomPoints = findTopTwoPoints([...module.points], direction)
- let barPoints = []
- //์ค์นํด์ผํ ๋ฐ์ฒ๋ง์ปค๋ฒ ํฌ์ธํธ๋ฅผ ๋ฐฉํฅ์ ๋ฐ๋ผ ์ค์
+ if (isChidory && cvrPlvrYn === 'Y') {
+ leftExposedHalfBottomModules.forEach((module) => {
+ const bottomPoints = findTopTwoPoints([...module.points], direction)
+ let barPoints = []
+ //์ค์นํด์ผํ ๋ฐ์ฒ๋ง์ปค๋ฒ ํฌ์ธํธ๋ฅผ ๋ฐฉํฅ์ ๋ฐ๋ผ ์ค์
- if (direction === 'south') {
- barPoints = [bottomPoints[0].x + module.width / 2, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y]
- } else if (direction === 'north') {
- barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[0].x + module.width / 2, bottomPoints[1].y]
- } else if (direction === 'east') {
- barPoints = [bottomPoints[0].x, bottomPoints[1].y + module.height / 2, bottomPoints[1].x, bottomPoints[1].y]
- } else if (direction === 'west') {
- barPoints = [bottomPoints[0].x, bottomPoints[1].y - module.height / 2, bottomPoints[1].x, bottomPoints[1].y]
- }
+ if (direction === 'south') {
+ barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x - module.width / 2, bottomPoints[1].y]
+ } else if (direction === 'north') {
+ barPoints = [bottomPoints[0].x + module.width / 2, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y]
+ } else if (direction === 'east') {
+ barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[0].y - module.height / 2]
+ } else if (direction === 'west') {
+ barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y - module.height / 2]
+ }
- if (!bottomPoints) return
- const halfEaveBar = new fabric.Line(barPoints, {
- parent: surface,
- name: 'halfEaveBar',
- stroke: 'blue',
- strokeWidth: 4,
- selectable: false,
- parentId: module.id,
+ if (!bottomPoints) return
+ const halfEaveBar = new fabric.Line(barPoints, {
+ parent: surface,
+ name: 'halfEaveBar',
+ stroke: 'blue',
+ strokeWidth: 4,
+ selectable: false,
+ surfaceId: surface.id,
+ parentId: module.id,
+ })
+ canvas.add(halfEaveBar)
+ canvas.renderAll()
})
- canvas.add(halfEaveBar)
- canvas.renderAll()
- })
+
+ rightExposedHalfBottomPoints.forEach((module) => {
+ const bottomPoints = findTopTwoPoints([...module.points], direction)
+ let barPoints = []
+ //์ค์นํด์ผํ ๋ฐ์ฒ๋ง์ปค๋ฒ ํฌ์ธํธ๋ฅผ ๋ฐฉํฅ์ ๋ฐ๋ผ ์ค์
+
+ if (direction === 'south') {
+ barPoints = [bottomPoints[0].x + module.width / 2, bottomPoints[0].y, bottomPoints[1].x, bottomPoints[1].y]
+ } else if (direction === 'north') {
+ barPoints = [bottomPoints[0].x, bottomPoints[0].y, bottomPoints[0].x + module.width / 2, bottomPoints[1].y]
+ } else if (direction === 'east') {
+ barPoints = [bottomPoints[0].x, bottomPoints[1].y + module.height / 2, bottomPoints[1].x, bottomPoints[1].y]
+ } else if (direction === 'west') {
+ barPoints = [bottomPoints[0].x, bottomPoints[1].y - module.height / 2, bottomPoints[1].x, bottomPoints[1].y]
+ }
+
+ if (!bottomPoints) return
+ const halfEaveBar = new fabric.Line(barPoints, {
+ parent: surface,
+ name: 'halfEaveBar',
+ stroke: 'blue',
+ strokeWidth: 4,
+ selectable: false,
+ parentId: module.id,
+ })
+ canvas.add(halfEaveBar)
+ canvas.renderAll()
+ })
+ }
}
- }
- const horizontal = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlHor : surface.trestleDetail.moduleIntvlVer
+ const horizontal = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlHor : surface.trestleDetail.moduleIntvlVer
- const vertical = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlVer : surface.trestleDetail.moduleIntvlHor
+ const vertical = ['south', 'north'].includes(direction) ? surface.trestleDetail.moduleIntvlVer : surface.trestleDetail.moduleIntvlHor
- let mostRowsModule = 0 // ๋ชจ๋ ์ต๋ ๋จ ์
- // ๊ฐ๋ ์ค์น๋ฅผ ์ํ ๊ฐ์ฅ ์๋ ๋ชจ๋๋ก๋ถํฐ ์๋ก ๋ช๋จ์ธ์ง ๊ณ์ฐ
- // ์ค๋ฅธ์ชฝ,์ผ์ชฝ ๋ ๋ค ์๋์ ์๋ฌด๊ฒ๋ ์๋, ์ฒ๋ง ์ปค๋ฒ๋ฅผ ํ์๋ก ํ๋ ๋ชจ๋
- exposedBottomModules.forEach((module) => {
- let { width, height } = { ...module }
- width = Math.floor(width)
- height = Math.floor(height)
- let { x: startX, y: startY } = { ...module.getCenterPoint() }
- let { x, y } = { ...module.getCenterPoint() }
+ let mostRowsModule = 0 // ๋ชจ๋ ์ต๋ ๋จ ์
+ // ๊ฐ๋ ์ค์น๋ฅผ ์ํ ๊ฐ์ฅ ์๋ ๋ชจ๋๋ก๋ถํฐ ์๋ก ๋ช๋จ์ธ์ง ๊ณ์ฐ
+ // ์ค๋ฅธ์ชฝ,์ผ์ชฝ ๋ ๋ค ์๋์ ์๋ฌด๊ฒ๋ ์๋, ์ฒ๋ง ์ปค๋ฒ๋ฅผ ํ์๋ก ํ๋ ๋ชจ๋
+ exposedBottomModules.forEach((module) => {
+ let { width, height } = { ...module }
+ width = Math.floor(width)
+ height = Math.floor(height)
+ let { x: startX, y: startY } = { ...module.getCenterPoint() }
+ let { x, y } = { ...module.getCenterPoint() }
- let leftRows = 1
- let rightRows = 1
- let centerRows = 1
- let hasNextModule = true
- let findLeft = true
- let findRight = true
+ let leftRows = 1
+ let rightRows = 1
+ let centerRows = 1
+ let hasNextModule = true
+ let findLeft = true
+ let findRight = true
- //์ฐ์ ์ ๋ฐ์ ๋๋ ๋ค ์ผ์ชฝ๋ถํฐ ์ฐพ๋๋ค.
- while (hasNextModule) {
- //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
- let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
-
- if (nextModule) {
- // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
- leftRows++
- x = nextModule.x
- y = nextModule.y
- } else {
- // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
- if (findLeft) {
- nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findLeft = false
- } else {
- nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findLeft = true
- }
+ //์ฐ์ ์ ๋ฐ์ ๋๋ ๋ค ์ผ์ชฝ๋ถํฐ ์ฐพ๋๋ค.
+ while (hasNextModule) {
+ //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
+ let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
if (nextModule) {
// ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
@@ -234,126 +221,126 @@ export const useTrestle = () => {
x = nextModule.x
y = nextModule.y
} else {
- hasNextModule = false
+ // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
+ if (findLeft) {
+ nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findLeft = false
+ } else {
+ nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findLeft = true
+ }
+
+ if (nextModule) {
+ // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
+ leftRows++
+ x = nextModule.x
+ y = nextModule.y
+ } else {
+ hasNextModule = false
+ }
}
}
- }
- hasNextModule = true
- x = startX
- y = startY
+ hasNextModule = true
+ x = startX
+ y = startY
- // ์ค๋ฅธ์ชฝ ์ฐพ๋๋ค.
- while (hasNextModule) {
- //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
- let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
-
- if (nextModule) {
- // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
- rightRows++
- x = nextModule.x
- y = nextModule.y
- } else {
- // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
- if (findRight) {
- nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findRight = false
- } else {
- nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findRight = true
- }
+ // ์ค๋ฅธ์ชฝ ์ฐพ๋๋ค.
+ while (hasNextModule) {
+ //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
+ let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
if (nextModule) {
// ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
rightRows++
x = nextModule.x
y = nextModule.y
+ } else {
+ // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
+ if (findRight) {
+ nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findRight = false
+ } else {
+ nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findRight = true
+ }
+
+ if (nextModule) {
+ // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
+ rightRows++
+ x = nextModule.x
+ y = nextModule.y
+ } else {
+ hasNextModule = false
+ }
+ }
+ }
+
+ hasNextModule = true
+ x = startX
+ y = startY
+
+ // ์ผํฐ ์ฐพ๋๋ค.
+ while (hasNextModule) {
+ //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
+ let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+
+ if (nextModule) {
+ // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
+ centerRows++
+ x = nextModule.x
+ y = nextModule.y
} else {
hasNextModule = false
}
}
- }
- hasNextModule = true
- x = startX
- y = startY
+ // ๋ชจ๋์ ์ผ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
+ const leftRacks = rackInfos.find((rack) => {
+ return rack.value.moduleRows === leftRows
+ })?.value.racks
- // ์ผํฐ ์ฐพ๋๋ค.
- while (hasNextModule) {
- //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
- let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ // ๋ชจ๋์ ์ค๋ฅธ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
+ const rightRacks = rackInfos.find((rack) => {
+ return rack.value.moduleRows === rightRows
+ })?.value.racks
+ // ํด๋น rack์ผ๋ก ๊ทธ๋ ค์ค๋ค.
- if (nextModule) {
- // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
- centerRows++
- x = nextModule.x
- y = nextModule.y
- } else {
- hasNextModule = false
- }
- }
+ const centerRacks = rackInfos.find((rack) => {
+ return rack.value.moduleRows === centerRows
+ })?.value.racks
- // ๋ชจ๋์ ์ผ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
- const leftRacks = rackInfos.find((rack) => {
- return rack.value.moduleRows === leftRows
- })?.value.racks
+ mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule)
- // ๋ชจ๋์ ์ค๋ฅธ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
- const rightRacks = rackInfos.find((rack) => {
- return rack.value.moduleRows === rightRows
- })?.value.racks
- // ํด๋น rack์ผ๋ก ๊ทธ๋ ค์ค๋ค.
+ if (rackYn === 'Y') {
+ drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
+ drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn)
- const centerRacks = rackInfos.find((rack) => {
- return rack.value.moduleRows === centerRows
- })?.value.racks
-
- mostRowsModule = Math.max(leftRows, rightRows, centerRows, mostRowsModule)
-
- if (rackYn === 'Y') {
- drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
- drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn)
-
- if (rackQty === 3) {
- //rack ๊ฐฏ์๊ฐ 3๊ฐ์ธ ๊ฒฝ์ฐ๋ ์ค๊ฐ๋ ๋ ์ถ๊ฐํด์ค์ผํจ
- drawRacks(centerRacks, rackQty, rackIntvlPct, module, direction, 'C', rackYn)
- } else if (rackQty === 4) {
- drawRacks(leftRacks, rackQty, rackIntvlPct / 3, module, direction, 'L', rackYn)
- drawRacks(rightRacks, rackQty, rackIntvlPct / 3, module, direction, 'R', rackYn)
- }
- }
- module.set({ leftRows, rightRows, centerRows })
- })
- // ์ผ์ชฝ์๋์ ๋ชจ๋์ด ์๋ ๋ชจ๋๋ค
- leftExposedHalfBottomModules.forEach((module) => {
- const { width, height } = module
- let { x: startX, y: startY } = { ...module.getCenterPoint() }
- let { x, y } = { ...module.getCenterPoint() }
- //TODO : ๋ฐฉํฅ๋ณ๋ก ๊ฐ๋ ์ค์นํด์ผํจ
-
- let leftRows = 1
- let hasNextModule = true
- let findLeft = true
-
- //์ฐ์ ์ ๋ฐ์ ๋๋ ๋ค ์ผ์ชฝ๋ถํฐ ์ฐพ๋๋ค.
- while (hasNextModule) {
- //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
- let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
-
- if (nextModule) {
- // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
- leftRows++
- x = nextModule.x
- y = nextModule.y
- } else {
- // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
- if (findLeft) {
- nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findLeft = false
- } else {
- nextModule = nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findLeft = true
+ if (rackQty === 3) {
+ //rack ๊ฐฏ์๊ฐ 3๊ฐ์ธ ๊ฒฝ์ฐ๋ ์ค๊ฐ๋ ๋ ์ถ๊ฐํด์ค์ผํจ
+ drawRacks(centerRacks, rackQty, rackIntvlPct, module, direction, 'C', rackYn)
+ } else if (rackQty === 4) {
+ drawRacks(leftRacks, rackQty, rackIntvlPct / 3, module, direction, 'L', rackYn)
+ drawRacks(rightRacks, rackQty, rackIntvlPct / 3, module, direction, 'R', rackYn)
}
+ }
+ module.set({ leftRows, rightRows, centerRows })
+ })
+ // ์ผ์ชฝ์๋์ ๋ชจ๋์ด ์๋ ๋ชจ๋๋ค
+ leftExposedHalfBottomModules.forEach((module) => {
+ const { width, height } = module
+ let { x: startX, y: startY } = { ...module.getCenterPoint() }
+ let { x, y } = { ...module.getCenterPoint() }
+ //TODO : ๋ฐฉํฅ๋ณ๋ก ๊ฐ๋ ์ค์นํด์ผํจ
+
+ let leftRows = 1
+ let hasNextModule = true
+ let findLeft = true
+
+ //์ฐ์ ์ ๋ฐ์ ๋๋ ๋ค ์ผ์ชฝ๋ถํฐ ์ฐพ๋๋ค.
+ while (hasNextModule) {
+ //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
+ let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
if (nextModule) {
// ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
@@ -361,52 +348,63 @@ export const useTrestle = () => {
x = nextModule.x
y = nextModule.y
} else {
- hasNextModule = false
+ // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
+ if (findLeft) {
+ nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findLeft = false
+ } else {
+ nextModule = nextModule = findNextRightModule(
+ {
+ x,
+ y,
+ width,
+ height,
+ horizontal,
+ vertical,
+ },
+ centerPoints,
+ direction,
+ )
+ findLeft = true
+ }
+
+ if (nextModule) {
+ // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
+ leftRows++
+ x = nextModule.x
+ y = nextModule.y
+ } else {
+ hasNextModule = false
+ }
}
}
- }
- // ๋ชจ๋์ ์ผ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
- const leftRacks = rackInfos.find((rack) => {
- return rack.value.moduleRows === leftRows
- })?.value.racks
- mostRowsModule = Math.max(leftRows, mostRowsModule)
- if (rackYn === 'Y') {
- drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
- }
+ // ๋ชจ๋์ ์ผ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
+ const leftRacks = rackInfos.find((rack) => {
+ return rack.value.moduleRows === leftRows
+ })?.value.racks
+ mostRowsModule = Math.max(leftRows, mostRowsModule)
+ if (rackYn === 'Y') {
+ drawRacks(leftRacks, rackQty, rackIntvlPct, module, direction, 'L', rackYn)
+ }
- module.set({ leftRows })
- })
- // ์ค๋ฅธ์ชฝ ์๋์ ๋ชจ๋์ด ์๋ ๋ชจ๋๋ค
- rightExposedHalfBottomPoints.forEach((module) => {
- const { width, height } = module
- let { x: startX, y: startY } = { ...module.getCenterPoint() }
- let { x, y } = { ...module.getCenterPoint() }
- //TODO : ๋ฐฉํฅ๋ณ๋ก ๊ฐ๋ ์ค์นํด์ผํจ
+ module.set({ leftRows })
+ })
+ // ์ค๋ฅธ์ชฝ ์๋์ ๋ชจ๋์ด ์๋ ๋ชจ๋๋ค
+ rightExposedHalfBottomPoints.forEach((module) => {
+ const { width, height } = module
+ let { x: startX, y: startY } = { ...module.getCenterPoint() }
+ let { x, y } = { ...module.getCenterPoint() }
+ //TODO : ๋ฐฉํฅ๋ณ๋ก ๊ฐ๋ ์ค์นํด์ผํจ
- let rightRows = 1
- let hasNextModule = true
- let findRight = true
+ let rightRows = 1
+ let hasNextModule = true
+ let findRight = true
- // ์ค๋ฅธ์ชฝ ์ฐพ๋๋ค.
- while (hasNextModule) {
- //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
- let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
-
- if (nextModule) {
- // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
- rightRows++
- x = nextModule.x
- y = nextModule.y
- } else {
- // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
- if (findRight) {
- nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findRight = false
- } else {
- nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
- findRight = true
- }
+ // ์ค๋ฅธ์ชฝ ์ฐพ๋๋ค.
+ while (hasNextModule) {
+ //๋ฐ๋ก ์์ ์๋์ง ํ์ธํ๋ค.
+ let nextModule = findNextModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
if (nextModule) {
// ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
@@ -414,43 +412,62 @@ export const useTrestle = () => {
x = nextModule.x
y = nextModule.y
} else {
- hasNextModule = false
+ // ๋ฐ๋ก ์๊ฐ ์์ ๊ฒฝ์ฐ ๋จผ์ ์ผ์ชฝ์๊ฐ ์๋์ง ํ์ธ ํ๋ค.
+ if (findRight) {
+ nextModule = findNextRightModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findRight = false
+ } else {
+ nextModule = findNextLeftModule({ x, y, width, height, horizontal, vertical }, centerPoints, direction)
+ findRight = true
+ }
+
+ if (nextModule) {
+ // ๋ฐ๋ก ์ ๋ชจ๋์ ์ฐพ๋๋ค.
+ rightRows++
+ x = nextModule.x
+ y = nextModule.y
+ } else {
+ hasNextModule = false
+ }
}
}
+
+ // ๋ชจ๋์ ์ค๋ฅธ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
+ const rightRacks = rackInfos.find((rack) => {
+ return rack.value.moduleRows === rightRows
+ })?.value.racks
+
+ mostRowsModule = Math.max(rightRows, mostRowsModule)
+ // ํด๋น rack์ผ๋ก ๊ทธ๋ ค์ค๋ค.
+ if (rackYn === 'Y') {
+ drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn)
+ }
+
+ module.set({ rightRows })
+ })
+
+ surface.set({ moduleRowsTotCnt: mostRowsModule })
+
+ if (rackYn === 'N') {
+ // rack์ด ์์๊ฒฝ์ฐ
+ installBracketWithOutRack(surface, exposedBottomModules, leftExposedHalfBottomModules, rightExposedHalfBottomPoints, isChidory)
+ } else if (rackYn === 'Y') {
+ installBracket(surface)
}
- // ๋ชจ๋์ ์ค๋ฅธ์ชฝ ๋ถํฐ ๊ทธ๋ฆด ๋ ์ ๋ณด๋ฅผ ๊ฐ์ ธ์จ๋ค.
- const rightRacks = rackInfos.find((rack) => {
- return rack.value.moduleRows === rightRows
- })?.value.racks
+ const quotationParam = getTrestleParams(surface)
- mostRowsModule = Math.max(rightRows, mostRowsModule)
- // ํด๋น rack์ผ๋ก ๊ทธ๋ ค์ค๋ค.
- if (rackYn === 'Y') {
- drawRacks(rightRacks, rackQty, rackIntvlPct, module, direction, 'R', rackYn)
- }
-
- module.set({ rightRows })
+ surface.set({ quotationParam })
})
- surface.set({ moduleRowsTotCnt: mostRowsModule })
-
- if (rackYn === 'N') {
- // rack์ด ์์๊ฒฝ์ฐ
- installBracketWithOutRack(surface, exposedBottomModules, leftExposedHalfBottomModules, rightExposedHalfBottomPoints, isChidory)
- } else if (rackYn === 'Y') {
- installBracket(surface)
- }
-
- const quotationParam = getTrestleParams(surface)
-
- surface.set({ quotationParam })
- })
- setQuoationItem()
+ return setEstimateData()
+ } catch (e) {
+ return false
+ }
}
// itemList ์กฐํ ํ estimateParam์ ์ ์ฅ
- const setQuoationItem = () => {
+ const setEstimateData = async () => {
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
//surfaces.pcses๋ค์ ๋ฐฐ์ด๋ก ๋ฌถ๋๋ค
const pcses = surfaces[0].pcses
@@ -461,16 +478,67 @@ export const useTrestle = () => {
})
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
//๊ฒฌ์ ์ itemList ์กฐํ
- getQuotationItem(params).then((res) => {
- if (!res.data) {
- return
- }
- const itemList = res.data
- //northArrangement ๋ถ๋ฉด ์ค์น ์ฌ๋ถ
- const northArrangement = getNorthArrangement()
+ const res = await getQuotationItem(params)
+ if (!res.data) {
+ return false
+ }
+ const itemList = res.data
+ //northArrangement ๋ถ๋ฉด ์ค์น ์ฌ๋ถ
+ const northArrangement = getNorthArrangement()
+ // circuitItemList์ ๊ฒฝ์ฐ๋ moduleList์์ circuitId๋ง groupByํ๋ค.
+ let circuitItemList = []
- setEstimateParam({ ...estimateParam, itemList, northArrangement })
+ // roofSurfaceList ์์ฑ
+ const roofSurfaceList = surfaces.map((surface) => {
+ const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
+ const { directionText, roofMaterial, pitch: slope, moduleCompass, surfaceCompass } = parent
+ const roofMaterialIndex = parent.roofMaterial.index
+ const { nameJp: roofMaterialIdMulti } = roofMaterial
+ const moduleSelection = moduleSelectionData?.roofConstructions?.find((construction) => construction.roofIndex === roofMaterialIndex)
+ const { constTp: constructSpecification, constTpJp: constructSpecificationMulti } = moduleSelection.construction
+ const {
+ trestleMkrCd,
+ constMthdCd: supportMethodId,
+ roofBaseCd,
+ trestleMkrCdJp: supportMeaker,
+ constMthdCdJp: supportMethodIdMulti,
+ } = moduleSelection.trestle
+
+ const modules = surface.modules
+ const moduleList = modules.map((module) => {
+ circuitItemList.push(module.pcsItemId)
+ return {
+ itemId: module.moduleInfo.itemId,
+ circuit: module.circuitNumber,
+ pcItemId: module.pcsItemId,
+ }
+ })
+
+ return {
+ roofSurfaceId: surface.id,
+ roofSurface: directionText.replace(/[^0-9]/g, ''),
+ roofMaterialId: roofMaterial.roofMatlCd,
+ supportMethodId,
+ constructSpecification,
+ constructSpecificationMulti,
+ roofMaterialIdMulti,
+ supportMethodIdMulti,
+ supportMeaker,
+ slope,
+ classType: currentAngleType === 'slope' ? '0' : '1',
+ angle: getDegreeByChon(slope),
+ azimuth: surfaceCompass ?? moduleCompass ?? 0,
+ moduleList,
+ }
})
+
+ // circuitItemList ์ค๋ณต์ ๊ฑฐ
+ circuitItemList = circuitItemList.filter((item, index) => circuitItemList.indexOf(item) === index)
+
+ setEstimateParam({ ...estimateParam, itemList, northArrangement, roofSurfaceList, circuitItemList })
+
+ // ์ ์์ ์ผ๋ก ์๋ฃ ๋๋ฉด true ๋ฐํ
+ return true
}
const getNorthArrangement = () => {
diff --git a/src/store/estimateAtom.js b/src/store/estimateAtom.js
index 20cdaa7c..410921fc 100644
--- a/src/store/estimateAtom.js
+++ b/src/store/estimateAtom.js
@@ -14,7 +14,7 @@ export const estimateParamAtom = atom({
standardWindSpeedId: '',
snowfall: '',
northArrangement: '',
- drawingFlg: '',
+ drawingFlg: '1',
userId: '',
roofSurfaceList: [],
circuitItemList: [],
From d52367107488d54ae7eabf5a1a43942a5d075a9e Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Tue, 4 Feb 2025 13:21:25 +0900
Subject: [PATCH 023/213] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?=
=?UTF-8?q?=EB=8B=B9=20=EC=95=88=EB=90=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/roofcover/useRoofAllocationSetting.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js
index ee865d65..88af737b 100644
--- a/src/hooks/roofcover/useRoofAllocationSetting.js
+++ b/src/hooks/roofcover/useRoofAllocationSetting.js
@@ -273,7 +273,7 @@ export function useRoofAllocationSetting(id) {
setRoofList(newRoofList)
const selectedRoofMaterial = newRoofList.find((roof) => roof.selected)
- setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial)
+ setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial, true)
modifyModuleSelectionData()
closeAll()
}
From 2ba2a67f3fde1c5fe025bff6ec5c780a05e60012 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Tue, 4 Feb 2025 13:22:22 +0900
Subject: [PATCH 024/213] =?UTF-8?q?=F0=9F=9A=A8fix:=20canvas=20=EC=A1=B0?=
=?UTF-8?q?=ED=9A=8C=20=ED=8C=8C=EB=9D=BC=EB=AF=B8=ED=84=B0=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/hooks/usePlan.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js
index 6b468405..b904611d 100644
--- a/src/hooks/usePlan.js
+++ b/src/hooks/usePlan.js
@@ -129,7 +129,7 @@ export function usePlan(params = {}) {
* objectNo์ ํด๋นํ๋ canvas ๋ชฉ๋ก์ ์กฐํ
*/
const getCanvasByObjectNo = async (userId, objectNo, planNo) => {
- return await get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) =>
+ return await get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}` }).then((res) =>
res.map((item) => ({
id: item.id,
objectNo: item.objectNo,
From 2cffd3540f02790ceab859dc25a4b3570968bdab Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Tue, 4 Feb 2025 13:23:05 +0900
Subject: [PATCH 025/213] =?UTF-8?q?=EC=B4=8C=EC=88=98=20=EB=B3=80=EA=B2=BD?=
=?UTF-8?q?=20=EC=95=88=EB=90=98=EB=8A=94=20=EA=B2=BD=EC=9A=B0=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/hooks/roofcover/useRoofAllocationSetting.js | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js
index 88af737b..6471f644 100644
--- a/src/hooks/roofcover/useRoofAllocationSetting.js
+++ b/src/hooks/roofcover/useRoofAllocationSetting.js
@@ -274,6 +274,7 @@ export function useRoofAllocationSetting(id) {
setRoofList(newRoofList)
const selectedRoofMaterial = newRoofList.find((roof) => roof.selected)
setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial, true)
+ drawDirectionArrow(currentObject)
modifyModuleSelectionData()
closeAll()
}
From eace9074123c4083b580c6bcc81417e99fea11fb Mon Sep 17 00:00:00 2001
From: changkyu choi
Date: Tue, 4 Feb 2025 13:38:14 +0900
Subject: [PATCH 026/213] =?UTF-8?q?=EB=8F=99,=EC=84=9C,=EB=82=A8,=EB=B6=81?=
=?UTF-8?q?=20=EC=9D=BC=EB=B3=B8=EC=96=B4=20=EB=B2=88=EC=97=AD=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/locales/ja.json | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 0d13f153..067b92a6 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -515,9 +515,9 @@
"common.finish": "ๅฎไบ",
"common.ok": "็ขบ่ช",
"common.cancel": "ใญใฃใณใปใซ",
- "commons.west": "็ซใค",
- "commons.east": "ใใณ",
- "commons.south": "M",
+ "commons.west": "่ฅฟ",
+ "commons.east": "ๆฑ",
+ "commons.south": "ๅ",
"commons.north": "ๅ",
"commons.none": "้ธๆใใชใ",
"common.type": "ๅ้ก",
From 9a074b9c43cabd5a4c6c1951829c3ce9884523db Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Tue, 4 Feb 2025 14:00:42 +0900
Subject: [PATCH 027/213] =?UTF-8?q?key=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index 98113f08..083c24c3 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -534,6 +534,11 @@ export const useTrestle = () => {
// circuitItemList ์ค๋ณต์ ๊ฑฐ
circuitItemList = circuitItemList.filter((item, index) => circuitItemList.indexOf(item) === index)
+ circuitItemList = circuitItemList.map((circuitId) => {
+ return {
+ itemId: circuitId,
+ }
+ })
setEstimateParam({ ...estimateParam, itemList, northArrangement, roofSurfaceList, circuitItemList })
From 016a432eab5f3cc683a78a53c748aa611260052e Mon Sep 17 00:00:00 2001
From: changkyu choi
Date: Tue, 4 Feb 2025 14:18:11 +0900
Subject: [PATCH 028/213] =?UTF-8?q?QSelectBox=20=ED=95=9C/=EC=9D=BC=20?=
=?UTF-8?q?=EC=96=B8=EC=96=B4=20=EC=B2=98=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/floor-plan/CanvasMenu.jsx | 8 ++++++--
.../modal/placementShape/PlacementShapeSetting.jsx | 6 +++++-
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index 52afaf8e..5611f296 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -508,8 +508,12 @@ export default function CanvasMenu(props) {
{
{
+ return { ...roof, name: globalLocale === 'ko' ? roof.roofMatlNm : roof.roofMatlNmJp }
+ })}
+ //showKey={'roofMatlNm'}
+ showKey={'name'}
value={selectedRoofMaterial}
onChange={changeSelectedRoofMaterial}
sourceKey={'index'}
diff --git a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx
index 1a5ea92a..5439b303 100644
--- a/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx
+++ b/src/components/floor-plan/modal/placementShape/PlacementShapeSetting.jsx
@@ -258,7 +258,11 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
{
From b2a17d21f8b30d6380837542fecf20c5e65e7adf Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Tue, 4 Feb 2025 14:46:14 +0900
Subject: [PATCH 029/213] =?UTF-8?q?=EB=B6=81=EB=A9=B4=20=EC=84=A4=EC=B9=98?=
=?UTF-8?q?=20=EB=B6=88=EA=B0=80=20=EC=9E=91=EC=97=85?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/select/QSelectBox.jsx | 9 +-
src/components/floor-plan/CanvasMenu.jsx | 23 +-
.../floor-plan/modal/basic/BasicSetting.jsx | 2 +-
.../modal/basic/step/ModuleTabContents.jsx | 6 +-
.../floor-plan/modal/basic/step/Placement.jsx | 5 +-
src/hooks/common/useMasterController.js | 4 +-
src/hooks/module/useModuleBasicSetting.js | 284 +++++++++++++++++-
src/hooks/module/useModulePlace.js | 210 +------------
src/hooks/module/useModuleSelection.js | 15 +
src/hooks/module/useModuleTabContents.js | 1 +
src/locales/ko.json | 3 +-
11 files changed, 332 insertions(+), 230 deletions(-)
diff --git a/src/components/common/select/QSelectBox.jsx b/src/components/common/select/QSelectBox.jsx
index 12c72b5e..f1041da3 100644
--- a/src/components/common/select/QSelectBox.jsx
+++ b/src/components/common/select/QSelectBox.jsx
@@ -1,6 +1,7 @@
'use client'
import { useEffect, useRef, useState } from 'react'
import { useOnClickOutside } from 'usehooks-ts'
+import { useMessage } from '@/hooks/useMessage'
/**
*
@@ -26,13 +27,15 @@ export default function QSelectBox({
showKey = '',
params = {},
}) {
+ const { getMessage } = useMessage()
+
/**
* ์ด๊ธฐ ์ํ ์ฒ๋ฆฌ
* useState ์ด๊ธฐ ๊ฐ์ผ๋ก ์ฌ์ฉํด์ผ ํด์ useState ๋ณด๋ค ์์ ์์ฑ
* @returns {string} ์ด๊ธฐ ์ํ
*/
const handleInitState = () => {
- if (options.length === 0) return title !== '' ? title : '์ ํํ์ธ์.'
+ if (options.length === 0) return title !== '' ? title : getMessage('selectbox.title')
if (showKey !== '' && !value) {
//value๊ฐ ์์ผ๋ฉด showKey๊ฐ ์์ผ๋ฉด ์ฐ์ ๋ณด์ฌ์ค๋ค
// return options[0][showKey]
@@ -44,13 +47,13 @@ export default function QSelectBox({
return option[sourceKey] === value[targetKey]
})
if (!option) {
- return title !== '' ? title : '์ ํํ์ธ์.'
+ return title !== '' ? title : getMessage('selectbox.title')
} else {
return option[showKey]
}
} else {
//์ผ์นํ๋ ์กฐ๊ฑด์ด ์์ผ๋ฉด ๊ธฐ๋ณธ๊ฐ์ ๋ณด์ฌ์ค๋ค.
- return title !== '' ? title : '์ ํํ์ธ์.'
+ return title !== '' ? title : getMessage('selectbox.title')
}
}
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index 52afaf8e..4dd46ea3 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -25,26 +25,29 @@ import { useCommonUtils } from '@/hooks/common/useCommonUtils'
import useMenu from '@/hooks/common/useMenu'
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
import { useAxios } from '@/hooks/useAxios'
-import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
import { canvasSettingState, canvasState, canvasZoomState, currentMenuState, verticalHorizontalModeState } from '@/store/canvasAtom'
import { sessionStore } from '@/store/commonAtom'
import { outerLinePointsState } from '@/store/outerLineAtom'
import { appMessageStore, globalLocaleStore } from '@/store/localeAtom'
-import { addedRoofsState, basicSettingState, selectedRoofMaterialSelector, settingModalFirstOptionsState } from '@/store/settingAtom'
+import {
+ addedRoofsState,
+ basicSettingState,
+ corridorDimensionSelector,
+ selectedRoofMaterialSelector,
+ settingModalFirstOptionsState,
+} from '@/store/settingAtom'
import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom'
import { commonUtilsState } from '@/store/commonUtilsAtom'
import { menusState, menuTypeState } from '@/store/menuAtom'
import { estimateState, floorPlanObjectState } from '@/store/floorPlanObjectAtom'
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
import { isObjectNotEmpty } from '@/util/common-utils'
+import { POLYGON_TYPE } from '@/common/common'
import KO from '@/locales/ko.json'
import JA from '@/locales/ja.json'
-import { MENU, POLYGON_TYPE } from '@/common/common'
-
import { QcastContext } from '@/app/QcastProvider'
-
export default function CanvasMenu(props) {
const { menuNumber, setMenuNumber } = props
const pathname = usePathname()
@@ -238,6 +241,16 @@ export default function CanvasMenu(props) {
if (menuNumber === 1) {
onClickPlacementInitialMenu()
}
+ if (menuNumber === 3) {
+ const moduleSurfacesArray = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ if (moduleSurfacesArray.length > 0) {
+ moduleSurfacesArray.forEach((moduleSurface) => {
+ moduleSurface.modules = []
+ canvas.remove(moduleSurface)
+ })
+ canvas.renderAll()
+ }
+ }
}, [menuNumber, type])
// ์ ์ฅ๋ฒํผ(btn08) ํด๋ฆญ ์ ํธ์ถ๋๋ ํจ์
diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx
index f4fc830d..67e2faa1 100644
--- a/src/components/floor-plan/modal/basic/BasicSetting.jsx
+++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx
@@ -34,7 +34,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
// const { initEvent } = useContext(EventContext)
- const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting()
+ const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting(1)
const { updateObjectDate } = useMasterController()
const handleBtnNextStep = () => {
if (tabNum === 1) {
diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
index 706fad9f..149ffbd9 100644
--- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
+++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
@@ -120,7 +120,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
value={selectedTrestle}
sourceKey={'trestleMkrCd'}
targetKey={'trestleMkrCd'}
- showKey={'trestleMkrCdNm'}
+ showKey={'trestleMkrCdJp'}
onChange={handleChangeTrestle}
/>
)}
@@ -138,7 +138,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
value={selectedConstMthd}
sourceKey={'constMthdCd'}
targetKey={'constMthdCd'}
- showKey={'constMthdCdNm'}
+ showKey={'constMthdCdJp'}
onChange={handleChangeConstMthd}
/>
)}
@@ -156,7 +156,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
value={selectedRoofBase}
sourceKey={'roofBaseCd'}
targetKey={'roofBaseCd'}
- showKey={'roofBaseCdNm'}
+ showKey={'roofBaseCdJp'}
onChange={handleChangeRoofBase}
/>
)}
diff --git a/src/components/floor-plan/modal/basic/step/Placement.jsx b/src/components/floor-plan/modal/basic/step/Placement.jsx
index eff568cd..d7d31ffa 100644
--- a/src/components/floor-plan/modal/basic/step/Placement.jsx
+++ b/src/components/floor-plan/modal/basic/step/Placement.jsx
@@ -4,20 +4,17 @@ import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
import { checkedModuleState, currentCanvasPlanState } from '@/store/canvasAtom'
import { useRecoilValue, useSetRecoilState } from 'recoil'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
-import { useModulePlace } from '@/hooks/module/useModulePlace'
const Placement = forwardRef((props, refs) => {
const { getMessage } = useMessage()
const [isChidori, setIsChidori] = useState(false)
const [isChidoriNotAble, setIsChidoriNotAble] = useState(false)
- const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
const [setupLocation, setSetupLocation] = useState('center')
const [isMaxSetup, setIsMaxSetup] = useState('false')
const [selectedItems, setSelectedItems] = useState({})
- const { makeModuleInstArea } = useModuleBasicSetting()
- const { selectedModules } = useModulePlace()
+ const { selectedModules } = useModuleBasicSetting(3)
const setCheckedModules = useSetRecoilState(checkedModuleState)
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
diff --git a/src/hooks/common/useMasterController.js b/src/hooks/common/useMasterController.js
index b090df81..f2ca3adf 100644
--- a/src/hooks/common/useMasterController.js
+++ b/src/hooks/common/useMasterController.js
@@ -229,9 +229,7 @@ export function useMasterController() {
* @returns
*/
const updateObjectDate = async (params = null) => {
- return await put({ url: '/api/object/update-object-date', data: params }).then((res) => {
- console.log('updateObjectDate', res)
- })
+ return await put({ url: '/api/object/update-object-date', data: params })
}
return {
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index f003982c..20575fd7 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -1,5 +1,6 @@
+import { useState } from 'react'
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
-import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState, selectedModuleState } from '@/store/canvasAtom'
+import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util'
import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils'
@@ -15,14 +16,17 @@ import { useRoofFn } from '@/hooks/common/useRoofFn'
import { useEffect } from 'react'
import { useMessage } from '@/hooks/useMessage'
import { moduleStatisticsState } from '@/store/circuitTrestleAtom'
+import { moduleSelectionDataState, selectedModuleState } from '@/store/selectedModuleOptions'
+import { useMasterController } from '@/hooks/common/useMasterController'
+import { v4 as uuidv4 } from 'uuid'
-export function useModuleBasicSetting() {
+export function useModuleBasicSetting(tabNum) {
const canvas = useRecoilValue(canvasState)
const { getMessage } = useMessage()
const roofDisplay = useRecoilValue(roofDisplaySelector)
const [moduleSetupSurface, setModuleSetupSurface] = useRecoilState(moduleSetupSurfaceState)
const [moduleIsSetup, setModuleIsSetup] = useRecoilState(moduleIsSetupState)
- const { addCanvasMouseEventListener, initEvent, removeMouseEvent } = useEvent()
+ const { addCanvasMouseEventListener, initEvent, removeMouseEvent, addTargetMouseEventListener } = useEvent()
const { swalFire } = useSwal()
const compasDeg = useRecoilValue(compasDegAtom)
@@ -34,6 +38,13 @@ export function useModuleBasicSetting() {
const canvasSetting = useRecoilValue(canvasSettingState)
+ const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
+ const [trestleDetailParams, setTrestleDetailParams] = useState([])
+ const [trestleDetailList, setTrestleDetailList] = useState([])
+ const selectedModules = useRecoilValue(selectedModuleState)
+ const { getTrestleDetailList } = useMasterController()
+ const [saleStoreNorthFlg, setSaleStoreNorthFlg] = useState(false)
+
useEffect(() => {
// console.log('basicSetting', basicSetting)
if (canvas) {
@@ -47,6 +58,247 @@ export function useModuleBasicSetting() {
// const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent } = useContext(EventContext)
+ //๋ชจ๋ ์ ํ์์ ์ ํ๋ ๊ฐ๋ค ๋์ด์ด
+ useEffect(() => {
+ if (moduleSelectionData && tabNum === 3) {
+ const common = moduleSelectionData.common
+
+ const roofConstructions = moduleSelectionData.roofConstructions
+
+ const listParams = roofConstructions.map((item) => {
+ return {
+ ...common,
+ moduleTpCd: selectedModules.itemTp,
+ roofMatlCd: item.trestle.roofMatlCd,
+ trestleMkrCd: item.trestle.trestleMkrCd,
+ constMthdCd: item.trestle.constMthdCd,
+ roofBaseCd: item.trestle.roofBaseCd,
+ constTp: item.construction.constTp,
+ mixMatlNo: selectedModules.mixMatlNo,
+ roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
+ inclCd: String(item.addRoof.pitch),
+ roofIndex: item.addRoof.index,
+ workingWidth: item.addRoof.lenBase,
+ }
+ })
+ setTrestleDetailParams(listParams)
+
+ //๋ถ๋ฉด ์ค์น ๊ฐ๋ฅ ํ๋งค์
+ if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
+ setSaleStoreNorthFlg(true)
+ }
+ }
+ }, [moduleSelectionData])
+
+ //๊ฐ๋ ์์ธ ๋ฐ์ดํฐ ์กฐํ
+ const getTrestleDetailListData = async () => {
+ const trestleDetailList = await getTrestleDetailList(trestleDetailParams)
+ if (trestleDetailList.length > 0) {
+ setTrestleDetailList(trestleDetailList)
+ }
+ }
+
+ //๊ฐ๋ ์์ธ ๋ฐ์ดํฐ ํ๋ผ๋ฉํฐ ๋ด๊ธฐ๋ฉด ์คํ
+ useEffect(() => {
+ if (trestleDetailParams.length > 0) {
+ getTrestleDetailListData(trestleDetailParams)
+ }
+ }, [trestleDetailParams])
+
+ //๊ฐ๋ ์์ธ ๋ฐ์ดํฐ ๋ค์ด์ค๋ฉด ์คํ
+ useEffect(() => {
+ if (trestleDetailList.length > 0) {
+ //์ง๋ถ์ ๊ฐ์ ธ์ด
+ canvas
+ .getObjects()
+ .filter((roof) => roof.name === 'roof')
+ .forEach((roof) => {
+ const roofIndex = roof.roofMaterial.index //์ง๋ถ์ ์ง๋ถ์ฌ์ ์๋ฒ
+ trestleDetailList.forEach((detail) => {
+ if (detail.data !== null) {
+ if (Number(detail.data.roofIndex) === roofIndex) {
+ //roof์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
+ roof.set({ trestleDetail: detail.data })
+ //๋ฐฐ์น๋ฉด ์ค์น ์์ญ
+ makeModuleInstArea(roof, detail.data)
+ //surface์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
+ } else {
+ console.log('๊ฐ๋ ๋ฐ์ดํฐ๊ฐ ์๋ค์...')
+ }
+ }
+ })
+ })
+ }
+ }, [trestleDetailList])
+
+ //๊ฐ๋ ์์ธ ๋ฐ์ดํฐ ๊ธฐ์ค์ผ๋ก ๋ชจ๋ ์ค์น ๋ฐฐ์น๋ฉด ์์ฑ
+ const makeModuleInstArea = (roof, trestleDetail) => {
+ //์ง๋ถ ๊ฐ์ฒด ๋ฐํ
+
+ if (!roof) {
+ return
+ }
+
+ //๋๋จธ๋ฑ ์ค๋ธ์ ํธ ๊ฐ์ฒด๊ฐ ์์ผ๋ฉด ์์๋ผ์ธ ๋ธ๋ค
+ const batchObjects = canvas
+ ?.getObjects()
+ .filter(
+ (obj) =>
+ obj.name === BATCH_TYPE.OPENING ||
+ obj.name === BATCH_TYPE.SHADOW ||
+ obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
+ obj.name === BATCH_TYPE.PENTAGON_DORMER,
+ ) //๋๋จธs ๊ฐ์ฒด
+
+ //๋๋จธ๋ ์ธ๊ณฝ์ ๋ฐ์ผํ๋ค
+ const batchObjectOptions = {
+ stroke: 'red',
+ fill: 'transparent',
+ strokeDashArray: [10, 4],
+ strokeWidth: 1,
+ lockMovementX: true,
+ lockMovementY: true,
+ lockRotation: true,
+ lockScalingX: true,
+ lockScalingY: true,
+ selectable: true,
+ name: POLYGON_TYPE.OBJECT_SURFACE,
+ originX: 'center',
+ originY: 'center',
+ }
+
+ //๋๋จธ๋ฑ ์ค๋ธ์ ํธ ๊ฐ์ฒด๊ฐ ์์ผ๋ฉด ์์๋ผ์ธ ๋ธ๋ค
+ batchObjects.forEach((obj) => {
+ //๋๋จธ์ผ๋
+ if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) {
+ const groupPoints = obj.groupPoints
+ const offsetObjects = offsetPolygon(groupPoints, 10)
+ const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions)
+ dormerOffset.setViewLengthText(false)
+ canvas.add(dormerOffset) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
+ } else {
+ //๊ฐ๊ตฌ, ๊ทธ๋ฆผ์์ผ๋
+ const points = obj.points
+ const offsetObjects = offsetPolygon(points, 10)
+ const offset = new QPolygon(offsetObjects, batchObjectOptions)
+ offset.setViewLengthText(false)
+ canvas.add(offset) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
+ }
+ })
+
+ const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id)
+ if (isExistSurface) {
+ return
+ }
+
+ let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : (trestleDetail.eaveIntvl / 10) * -1
+ setSurfaceShapePattern(roof, roofDisplay.column, true) //ํจํด ๋ณ๊ฒฝ
+ const offsetPoints = offsetPolygon(roof.points, offsetLength) //์์ชฝ offset
+ //๋ชจ๋์ค์น์์ญ?? ์์ฑ
+
+ const surfaceId = uuidv4()
+
+ let isNorth = false
+
+ //๋ถ๋ฉด์ด ์์ง๋ง
+ if (roof.directionText && roof.directionText.indexOf('ๅ') > -1) {
+ //๋ถ์ชฝ์ผ๋ ํด๋น ์๋ถ์, ๋๋ถ๋์ ์ ์ธํ๋ค๊ณ ํ๋ค
+ if (!(roof.directionText.indexOf('่ฅฟๅ่ฅฟ') > -1 || roof.directionText.indexOf('ๆฑๅๆฑ') > -1)) {
+ isNorth = true
+ }
+ }
+
+ //๋ชจ๋์ค์น๋ฉด ์์ฑ
+ let setupSurface = new QPolygon(offsetPoints, {
+ stroke: 'red',
+ fill: 'rgba(255,255,255,0.1)',
+ strokeDashArray: [10, 4],
+ strokeWidth: 1,
+ lockMovementX: true,
+ lockMovementY: true,
+ lockRotation: true,
+ lockScalingX: true,
+ lockScalingY: true,
+ selectable: true,
+ parentId: roof.id, //๊ฐ๋ ํด๋ฆฌ๊ณค์ ์์ ์ธ๋ฑ์ค๋ฅผ ๋ฃ์ด์ค
+ name: POLYGON_TYPE.MODULE_SETUP_SURFACE,
+ flowDirection: roof.direction,
+ direction: roof.direction,
+ flipX: roof.flipX,
+ flipY: roof.flipY,
+ surfaceId: surfaceId,
+ originX: 'center',
+ originY: 'center',
+ modules: [],
+ roofMaterial: roof.roofMaterial,
+ trestleDetail: trestleDetail,
+ isNorth: isNorth,
+ perPixelTargetFind: true,
+ // angle: -compasDeg,
+ })
+
+ setupSurface.setViewLengthText(false)
+ canvas.add(setupSurface) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
+
+ //์ง๋ถ๋ฉด ์ ํ ๊ธ์ง
+ roof.set({
+ selectable: false, //์ ํ ๊ธ์ง
+ evented: false, //ํด๋ฆญ ์ด๋ฒคํธ๋ ๊ธ์ง
+ })
+
+ canvas.renderAll()
+
+ //๋ชจ๋์ค์น๋ฉด ํด๋ฆญ์ด๋ฒคํธ
+ addTargetMouseEventListener('mousedown', setupSurface, function () {
+ toggleSelection(setupSurface)
+ })
+ }
+
+ let selectedModuleInstSurfaceArray = []
+
+ //์ค์น ๋ฒ์ ์ง์ ํด๋ฆญ ์ด๋ฒคํธ
+ const toggleSelection = (setupSurface) => {
+ const isExist = selectedModuleInstSurfaceArray.some((obj) => obj.parentId === setupSurface.parentId)
+ //์ต์ด ์ ํ์ผ๋
+ if (!isExist) {
+ //์ค์น๋ฉด์ด ๋ถ๋ฉด์ด๊ณ ๋ถ๋ฉด์ค์น ํ์ฉ์ ์ด ์๋๋ฉด
+ if (setupSurface.isNorth && !saleStoreNorthFlg) {
+ swalFire({ text: getMessage('module.not.batch.north'), icon: 'warning' })
+ return
+ }
+
+ //๊ธฐ๋ณธ ์ ํ์ด๋ ์คํธ๋กํฌ ๊ตต๊ธฐ๊ฐ ๊ฐ์ผ๋ฉด ์ ํ ์๋จ์ผ๋ก ๋ด
+ setupSurface.set({
+ ...setupSurface,
+ strokeWidth: 3,
+ strokeDashArray: [0],
+ fill: 'rgba(255,255,255,0.1)',
+ })
+ canvas.discardActiveObject() // ๊ฐ์ฒด์ ํ์ฑ ์ํ ํด์
+ //์ค๋ณต์ผ๋ก ๋ค์ด๊ฐ๋๊ฑธ ๋ฐฉ์งํ๊ธฐ ์ํ ์ฝ๋
+
+ canvas?.renderAll()
+ selectedModuleInstSurfaceArray.push(setupSurface)
+ } else {
+ //์ ํํ ์ฌ์ ํํ๋ฉด ์ ํ์๋จ์ผ๋ก ๋ณ๊ฒฝ
+ setupSurface.set({
+ ...setupSurface,
+ fill: 'rgba(255,255,255,0.1)',
+ strokeDashArray: [10, 4],
+ strokeWidth: 1,
+ })
+ canvas.discardActiveObject() // ๊ฐ์ฒด์ ํ์ฑ ์ํ ํด์
+
+ //ํด๋ฆฌ๊ณค์ ์ปค์คํ
์ธ๋ฑ์ค๋ฅผ ๊ฐ์ง๊ณ ํด๋น ๋ฐฐ์ด ์ธ๋ฑ์ค๋ฅผ ์ฐพ์ ์ญ์ ํจ
+ const removeIndex = setupSurface.parentId
+ const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex)
+ selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1)
+ }
+
+ canvas?.renderAll()
+ setModuleSetupSurface([...selectedModuleInstSurfaceArray])
+ }
+
//๋ชจ๋,ํ๋ก์์ ๋ค๋ฅธ๋ฉ๋ด -> ๋ฐฐ์น๋ฉด์ผ๋ก ๊ฐ ๊ฒฝ์ ์ด๊ธฐํ
const restoreModuleInstArea = () => {
//์ค์น๋ฉด ์ญ์
@@ -76,6 +328,7 @@ export function useModuleBasicSetting() {
*/
const manualModuleSetup = () => {
// console.log('isManualModuleSetup', isManualModuleSetup)
+ const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //๋ชจ๋์ค์น๋ฉด๋ฅผ ๊ฐ์ ธ์ด
if (isManualModuleSetup) {
if (checkedModule.length === 0) {
@@ -90,8 +343,14 @@ export function useModuleBasicSetting() {
return
}
- const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //๋ชจ๋์ค์น๋ฉด๋ฅผ ๊ฐ์ ธ์ด
const batchObjects = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.OBJECT_SURFACE) //๋๋จธs ๊ฐ์ฒด
+ //์๋๋ชจ๋ ๋ชจ๋ ์ค์น๋ฉด ์ ํ ์ ๊ธ
+ moduleSetupSurfaces.forEach((obj) => {
+ obj.set({
+ selectable: false,
+ evented: false,
+ })
+ })
const moduleOptions = {
fill: checkedModule[0].color,
@@ -168,7 +427,12 @@ export function useModuleBasicSetting() {
parentId: moduleSetupSurfaces[i].parentId,
})
- canvas?.add(tempModule) //์์ง์ฌ๊ฐ๋ฉด์ ์ถ๊ฐ๋จ
+ //๋ถ๋ฉด์ด๊ณ ๋ถ๋ฉด์ค์น์์ ์ด ์๋๋ฉด ๊ทธ๋ฅ return
+ if (trestlePolygon.isNorth && !saleStoreNorthFlg) {
+ return
+ } else {
+ canvas?.add(tempModule) //์์ง์ฌ๊ฐ๋ฉด์ ์ถ๊ฐ๋จ
+ }
/**
* ์ค๋
๊ธฐ๋ฅ
@@ -361,6 +625,7 @@ export function useModuleBasicSetting() {
const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //๊ฒน์น๋์ง ํ์ธ
if (!isOverlap) {
canvas?.remove(tempModule)
+
//์๊ฒน์น๋ฉด ๋ฃ๋๋ค
// tempModule.setCoords()
moduleOptions.surfaceId = trestlePolygon.id
@@ -379,6 +644,14 @@ export function useModuleBasicSetting() {
})
}
} else {
+ //์๋๋ชจ๋ ํด์ ์ ๋ชจ๋ ์ค์น๋ฉด ์ ํ ์ ๊ธ
+ moduleSetupSurfaces.forEach((obj) => {
+ obj.set({
+ selectable: true,
+ evented: true,
+ })
+ })
+
removeMouseEvent('mouse:up')
removeMouseEvent('mouse:move')
canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule')) //์์ง์ผ๋ ์ผ๋จ ์ง์๊ฐ๋ฉด์ ์์ง์
@@ -2209,6 +2482,7 @@ export function useModuleBasicSetting() {
}
return {
+ selectedModules,
manualModuleSetup,
autoModuleSetup,
restoreModuleInstArea,
diff --git a/src/hooks/module/useModulePlace.js b/src/hooks/module/useModulePlace.js
index bc9913f6..38e628a0 100644
--- a/src/hooks/module/useModulePlace.js
+++ b/src/hooks/module/useModulePlace.js
@@ -10,6 +10,8 @@ import offsetPolygon from '@/util/qpolygon-utils'
import { v4 as uuidv4 } from 'uuid'
import { QPolygon } from '@/components/fabric/QPolygon'
import { useEvent } from '@/hooks/useEvent'
+import { useSwal } from '@/hooks/useSwal'
+import { useMessage } from '@/hooks/useMessage'
export function useModulePlace() {
const canvas = useRecoilValue(canvasState)
@@ -23,211 +25,9 @@ export function useModulePlace() {
const roofDisplay = useRecoilValue(roofDisplaySelector)
const { addTargetMouseEventListener } = useEvent()
const setModuleSetupSurface = useSetRecoilState(moduleSetupSurfaceState)
-
- useEffect(() => {
- if (moduleSelectionData) {
- const common = moduleSelectionData.common
- const roofConstructions = moduleSelectionData.roofConstructions
-
- const listParams = roofConstructions.map((item) => {
- return {
- ...common,
- moduleTpCd: selectedModules.itemTp,
- roofMatlCd: item.trestle.roofMatlCd,
- trestleMkrCd: item.trestle.trestleMkrCd,
- constMthdCd: item.trestle.constMthdCd,
- roofBaseCd: item.trestle.roofBaseCd,
- constTp: item.construction.constTp,
- mixMatlNo: selectedModules.mixMatlNo,
- roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
- inclCd: String(item.addRoof.pitch),
- roofIndex: item.addRoof.index,
- workingWidth: item.addRoof.lenBase,
- }
- })
- setTrestleDetailParams(listParams)
- }
- }, [moduleSelectionData])
-
- const getTrestleDetailListData = async () => {
- const trestleDetailList = await getTrestleDetailList(trestleDetailParams)
- if (trestleDetailList.length > 0) {
- setTrestleDetailList(trestleDetailList)
- }
- }
-
- useEffect(() => {
- if (trestleDetailParams.length > 0) {
- getTrestleDetailListData(trestleDetailParams)
- }
- }, [trestleDetailParams])
-
- useEffect(() => {
- if (trestleDetailList.length > 0) {
- //์ง๋ถ์ ๊ฐ์ ธ์ด
- canvas
- .getObjects()
- .filter((roof) => roof.name === 'roof')
- .forEach((roof) => {
- const roofIndex = roof.roofMaterial.index //์ง๋ถ์ ์ง๋ถ์ฌ์ ์๋ฒ
- trestleDetailList.forEach((detail) => {
- if (detail.data !== null) {
- if (Number(detail.data.roofIndex) === roofIndex) {
- //roof์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
- roof.set({ trestleDetail: detail.data })
- //๋ฐฐ์น๋ฉด ์ค์น ์์ญ
- makeModuleInstArea(roof, detail.data)
- //surface์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
- } else {
- console.log('๊ฐ๋ ๋ฐ์ดํฐ๊ฐ ์๋ค์...')
- }
- }
- })
- })
- }
- }, [trestleDetailList])
-
- const makeModuleInstArea = (roof, trestleDetail) => {
- //์ง๋ถ ๊ฐ์ฒด ๋ฐํ
-
- if (!roof) {
- return
- }
-
- const batchObjects = canvas
- ?.getObjects()
- .filter(
- (obj) =>
- obj.name === BATCH_TYPE.OPENING ||
- obj.name === BATCH_TYPE.SHADOW ||
- obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
- obj.name === BATCH_TYPE.PENTAGON_DORMER,
- ) //๋๋จธs ๊ฐ์ฒด
-
- //๋๋จธ๋ ์ธ๊ณฝ์ ๋ฐ์ผํ๋ค
-
- const batchObjectOptions = {
- stroke: 'red',
- fill: 'transparent',
- strokeDashArray: [10, 4],
- strokeWidth: 1,
- lockMovementX: true,
- lockMovementY: true,
- lockRotation: true,
- lockScalingX: true,
- lockScalingY: true,
- selectable: true,
- name: POLYGON_TYPE.OBJECT_SURFACE,
- originX: 'center',
- originY: 'center',
- }
-
- batchObjects.forEach((obj) => {
- if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) {
- const groupPoints = obj.groupPoints
- const offsetObjects = offsetPolygon(groupPoints, 10)
- const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions)
- dormerOffset.setViewLengthText(false)
- canvas.add(dormerOffset) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
- } else {
- const points = obj.points
- const offsetObjects = offsetPolygon(points, 10)
- const offset = new QPolygon(offsetObjects, batchObjectOptions)
- offset.setViewLengthText(false)
- canvas.add(offset) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
- }
- })
-
- const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id)
- if (isExistSurface) {
- return
- }
-
- let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : (trestleDetail.eaveIntvl / 10) * -1
- setSurfaceShapePattern(roof, roofDisplay.column, true) //ํจํด ๋ณ๊ฒฝ
- const offsetPoints = offsetPolygon(roof.points, offsetLength) //์์ชฝ offset
- //๋ชจ๋์ค์น์์ญ?? ์์ฑ
-
- const surfaceId = uuidv4()
-
- let setupSurface = new QPolygon(offsetPoints, {
- stroke: 'red',
- fill: 'transparent',
- strokeDashArray: [10, 4],
- strokeWidth: 1,
- lockMovementX: true,
- lockMovementY: true,
- lockRotation: true,
- lockScalingX: true,
- lockScalingY: true,
- selectable: true,
- parentId: roof.id, //๊ฐ๋ ํด๋ฆฌ๊ณค์ ์์ ์ธ๋ฑ์ค๋ฅผ ๋ฃ์ด์ค
- name: POLYGON_TYPE.MODULE_SETUP_SURFACE,
- flowDirection: roof.direction,
- direction: roof.direction,
- flipX: roof.flipX,
- flipY: roof.flipY,
- surfaceId: surfaceId,
- originX: 'center',
- originY: 'center',
- modules: [],
- roofMaterial: roof.roofMaterial,
- trestleDetail: trestleDetail,
- // angle: -compasDeg,
- })
-
- setupSurface.setViewLengthText(false)
- canvas.add(setupSurface) //๋ชจ๋์ค์น๋ฉด ๋ง๋ค๊ธฐ
-
- //์ง๋ถ๋ฉด ์ ํ ๊ธ์ง
- roof.set({
- selectable: false,
- })
-
- //๋ชจ๋์ค์น๋ฉด ํด๋ฆญ์ด๋ฒคํธ
- addTargetMouseEventListener('mousedown', setupSurface, function () {
- toggleSelection(setupSurface)
- })
- }
-
- let selectedModuleInstSurfaceArray = []
-
- //์ค์น ๋ฒ์ ์ง์ ํด๋ฆญ ์ด๋ฒคํธ
- const toggleSelection = (setupSurface) => {
- const isExist = selectedModuleInstSurfaceArray.some((obj) => obj.parentId === setupSurface.parentId)
- //์ต์ด ์ ํ์ผ๋
- if (!isExist) {
- //๊ธฐ๋ณธ ์ ํ์ด๋ ์คํธ๋กํฌ ๊ตต๊ธฐ๊ฐ ๊ฐ์ผ๋ฉด ์ ํ ์๋จ์ผ๋ก ๋ด
- setupSurface.set({
- ...setupSurface,
- strokeWidth: 3,
- strokeDashArray: [0],
- fill: 'transparent',
- })
- canvas.discardActiveObject() // ๊ฐ์ฒด์ ํ์ฑ ์ํ ํด์
- //์ค๋ณต์ผ๋ก ๋ค์ด๊ฐ๋๊ฑธ ๋ฐฉ์งํ๊ธฐ ์ํ ์ฝ๋
-
- canvas?.renderAll()
- selectedModuleInstSurfaceArray.push(setupSurface)
- } else {
- //์ ํํ ์ฌ์ ํํ๋ฉด ์ ํ์๋จ์ผ๋ก ๋ณ๊ฒฝ
- setupSurface.set({
- ...setupSurface,
- fill: 'transparent',
- strokeDashArray: [10, 4],
- strokeWidth: 1,
- })
- canvas.discardActiveObject() // ๊ฐ์ฒด์ ํ์ฑ ์ํ ํด์
-
- //ํด๋ฆฌ๊ณค์ ์ปค์คํ
์ธ๋ฑ์ค๋ฅผ ๊ฐ์ง๊ณ ํด๋น ๋ฐฐ์ด ์ธ๋ฑ์ค๋ฅผ ์ฐพ์ ์ญ์ ํจ
- const removeIndex = setupSurface.parentId
- const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex)
- selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1)
- }
-
- canvas?.renderAll()
- setModuleSetupSurface([...selectedModuleInstSurfaceArray])
- }
+ const [saleStoreNorthFlg, setSaleStoreNorthFlg] = useState(false)
+ const { swalFire } = useSwal()
+ const { getMessage } = useMessage()
return {
selectedModules,
diff --git a/src/hooks/module/useModuleSelection.js b/src/hooks/module/useModuleSelection.js
index 0321abaa..d0b812e5 100644
--- a/src/hooks/module/useModuleSelection.js
+++ b/src/hooks/module/useModuleSelection.js
@@ -5,8 +5,11 @@ import { useMasterController } from '@/hooks/common/useMasterController'
import { useCommonCode } from '@/hooks/common/useCommonCode'
import { selectedModuleState, moduleSelectionInitParamsState, moduleSelectionDataState } from '@/store/selectedModuleOptions'
import { isObjectNotEmpty } from '@/util/common-utils'
+import { canvasState } from '@/store/canvasAtom'
+import { POLYGON_TYPE } from '@/common/common'
export function useModuleSelection(props) {
+ const canvas = useRecoilValue(canvasState)
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
const [roughnessCodes, setRoughnessCodes] = useState([]) //๋ฉด์กฐ๋ ๋ชฉ๋ก
@@ -41,6 +44,7 @@ export function useModuleSelection(props) {
instHt: managementState?.installHeight, //์ค์น๋์ด
stdWindSpeed: managementState?.standardWindSpeedId, //๊ธฐ์คํ์
stdSnowLd: managementState?.verticalSnowCover, //๊ธฐ์ค์ ์ค๋
+ saleStoreNorthFlg: managementState?.saleStoreNorthFlg, //๋ถ์ชฝ ์ค์น ์ฌ๋ถ
}
if (selectedModules) {
@@ -62,6 +66,7 @@ export function useModuleSelection(props) {
// 202000 ํ์
const windCodeList = findCommonCode('202000')
+
windCodeList.forEach((obj) => {
obj.name = obj.clCodeNm
obj.id = obj.clCode
@@ -83,6 +88,16 @@ export function useModuleSelection(props) {
}
getModuleData(roofsIds)
+
+ //๋ฉ๋ด ์ด๋์ ๋ฐฐ์น๋ฉด ์ญ์
+ const moduleSurfacesArray = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ if (moduleSurfacesArray.length > 0) {
+ moduleSurfacesArray.forEach((moduleSurface) => {
+ moduleSurface.module = []
+ canvas.remove(moduleSurface)
+ })
+ canvas.renderAll()
+ }
}, [])
const getModuleData = async (roofsIds) => {
diff --git a/src/hooks/module/useModuleTabContents.js b/src/hooks/module/useModuleTabContents.js
index 95317cdd..63ab7722 100644
--- a/src/hooks/module/useModuleTabContents.js
+++ b/src/hooks/module/useModuleTabContents.js
@@ -299,6 +299,7 @@ export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab
//๊ฑฐ๋๋ฉ์ด์ปค, ๊ณต๋ฒ, ์ง๋ถ๋ฐ๋ฐํ api ์กฐํ
const getModuleOptionsListData = async (params, type) => {
const optionsList = await getTrestleList(params)
+ console.log('optionsList', optionsList)
if (optionsList.data.length > 0) {
if (type === 'trestle') {
diff --git a/src/locales/ko.json b/src/locales/ko.json
index f389807c..5552dbb0 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -997,5 +997,6 @@
"construction.length.difference": "์ง๋ถ๋ฉด ๊ณต๋ฒ์ ์ ๋ถ ์ ํํด์ฃผ์ธ์.",
"menu.validation.canvas.roof": "ํจ๋์ ๋ฐฐ์นํ๋ ค๋ฉด ์ง๋ถ๋ฉด์ ์
๋ ฅํด์ผ ํฉ๋๋ค.",
"batch.object.outside.roof": "์ค๋ธ์ ํธ๋ ์ง๋ถ๋ด์ ์ค์นํด์ผ ํฉ๋๋ค.",
- "batch.object.notinstall.cross": "์ค๋ธ์ ํธ๋ ๊ฒน์ณ์ ์ค์น ํ ์ ์์ต๋๋ค."
+ "batch.object.notinstall.cross": "์ค๋ธ์ ํธ๋ ๊ฒน์ณ์ ์ค์น ํ ์ ์์ต๋๋ค.",
+ "module.not.batch.north": "๋ถ์ชฝ์๋ ๋ชจ๋์ ๋ฐฐ์นํ ์ ์์ต๋๋ค."
}
From 77157e34df4ffec2af294d65871db0a1f1555dda Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Tue, 4 Feb 2025 15:49:22 +0900
Subject: [PATCH 030/213] =?UTF-8?q?-=20=F0=9F=9A=A8chore:=20Sync=20Sass?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/styles/_modal.scss | 42 +++++++++++++++++++++++++++---------------
1 file changed, 27 insertions(+), 15 deletions(-)
diff --git a/src/styles/_modal.scss b/src/styles/_modal.scss
index 61f631cd..7c959e83 100644
--- a/src/styles/_modal.scss
+++ b/src/styles/_modal.scss
@@ -259,6 +259,12 @@ $alert-color: #101010;
border-bottom: 1px solid #424242;
}
}
+.grid-check-form-block{
+ display: block;
+ > div{
+ margin-bottom: 10px;
+ }
+}
.grid-option-overflow{
max-height: 350px;
overflow-y: auto;
@@ -305,6 +311,25 @@ $alert-color: #101010;
}
.grid-option-block-form{
flex: 1;
+ .flex-ment{
+ position: relative;
+ padding-right: 70px;
+ flex: 1 1 auto;
+ span{
+ width: 70px;
+ &.absol{
+ width: fit-content;
+ position: absolute;
+ top: 50%;
+ right: 0;
+ transform: translateY(-50%);
+
+ }
+ }
+ .input-grid{
+ flex: 1;
+ }
+ }
}
}
.select-form{
@@ -312,6 +337,7 @@ $alert-color: #101010;
}
.grid-select{
flex: 1;
+ height: 30px;
&.no-flx{
flex: unset;
}
@@ -2013,7 +2039,7 @@ $alert-color: #101010;
}
}
.roof-module-tab2-overflow{
- max-height: 500px;
+ max-height: 650px;
overflow-y: auto;
padding-bottom: 15px;
border-bottom: 1px solid #4D4D4D;
@@ -2088,17 +2114,3 @@ $alert-color: #101010;
justify-content: flex-end;
}
}
-
-.reset-word-wrap{
- display: flex;
- align-items: center;
- .grid-btn-wrap{
- margin-left: auto;
- }
-}
-.reset-word{
- font-size: 12px;
- color: #FFCACA;
- font-weight: 400;
- margin-top: 10px;
-}
\ No newline at end of file
From 0491c14fb45f766bf9dbc41f44ea3dd151dce7f4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Tue, 4 Feb 2025 15:49:48 +0900
Subject: [PATCH 031/213] =?UTF-8?q?-=EB=8B=A8=EC=9C=84=ED=85=8C=EC=8A=A4?=
=?UTF-8?q?=ED=8A=B8(Unit=20Test)=20#554=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../floor-plan/modal/basic/step/Module.jsx | 2 -
.../modal/basic/step/ModuleTabContents.jsx | 2 +-
.../roofAllocation/RoofAllocationSetting.jsx | 70 +++++++++++--------
.../modal/roofShape/type/option/Wall.jsx | 1 -
4 files changed, 40 insertions(+), 35 deletions(-)
diff --git a/src/components/floor-plan/modal/basic/step/Module.jsx b/src/components/floor-plan/modal/basic/step/Module.jsx
index eb4f0177..4823ab6e 100644
--- a/src/components/floor-plan/modal/basic/step/Module.jsx
+++ b/src/components/floor-plan/modal/basic/step/Module.jsx
@@ -156,7 +156,6 @@ export default function Module({ setTabNum }) {
-
{getMessage('modal.module.basic.setting.module.stuff.info')}
{getMessage('modal.module.basic.setting.module.surface.type')}
@@ -271,7 +270,6 @@ export default function Module({ setTabNum }) {
{/* ์ค์ ์ค๋ฅ์ ๋
ธ์ถ */}
-
โป ๆฝๅทฅๆนๆณใ้ธๆใงใใพใใใ ๅบๆบ้ขจ้ใพใใฏๅบๆบ็ฉ้ช้ใ็ขบ่ชใใฆใใ ใใใ
>
diff --git a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
index 706fad9f..24845bbf 100644
--- a/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
+++ b/src/components/floor-plan/modal/basic/step/ModuleTabContents.jsx
@@ -203,7 +203,7 @@ export default function ModuleTabContents({ tabIndex, addRoof, setAddedRoofs, ro
ๅผทๅๆฝๅทฅ
-
+
-
+
handleChangeRoofMaterial(e, index)}
/>
- {index === 0 &&
{getMessage('modal.roof.alloc.default.roof.material')}}
- {index !== 0 &&
onDeleteRoofMaterial(index)}>}
+ {index === 0 &&
{getMessage('modal.roof.alloc.default.roof.material')}}
+ {index !== 0 && (
+
+ onDeleteRoofMaterial(index)}>
+
+ )}
{getMessage('slope')}
-
+
-
{pitchText}
+
{pitchText}
{(roof.widAuth || roof.lenAuth) && (
-
+ <>
{roof.widAuth && (
-
-
W
-
-
handleChangeInput(e, 'width', index)}
- readOnly={roof.widAuth === 'R'}
- />
+
+
+
W
+
+ handleChangeInput(e, 'width', index)}
+ readOnly={roof.widAuth === 'R'}
+ />
+
)}
{roof.lenAuth && (
-
-
L
-
-
handleChangeInput(e, 'length', index)}
- readOnly={roof.lenAuth === 'R'}
- />
+
+
+
L
+
+ handleChangeInput(e, 'length', index)}
+ readOnly={roof.lenAuth === 'R'}
+ />
+
)}
-
+ >
)}
{(roof.raftAuth || roof.roofPchAuth) && (
-
+ <>
{roof.raftAuth && (
{getMessage('modal.placement.initial.setting.rafter')}
{raftCodes.length > 0 && (
-
+
{getMessage('hajebichi')}
-
+ >
)}
diff --git a/src/components/floor-plan/modal/roofShape/type/option/Wall.jsx b/src/components/floor-plan/modal/roofShape/type/option/Wall.jsx
index c7b04b2d..f78fe95d 100644
--- a/src/components/floor-plan/modal/roofShape/type/option/Wall.jsx
+++ b/src/components/floor-plan/modal/roofShape/type/option/Wall.jsx
@@ -6,7 +6,6 @@ export default function Wall({ sleeveOffset, setSleeveOffset, hasSleeve, setHasS
const { getMessage } = useMessage()
return (
<>
- {hasSleeve}
From bc06d35bcf8b9d7a0f9aabd4e2824972a15b02e9 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Tue, 4 Feb 2025 15:51:38 +0900
Subject: [PATCH 032/213] =?UTF-8?q?-=EB=8B=A8=EC=9C=84=ED=85=8C=EC=8A=A4?=
=?UTF-8?q?=ED=8A=B8(Unit=20Test)=20#557=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../step/PowerConditionalSelect.jsx | 4 +-
.../step/type/PassivityCircuitAllocation.jsx | 74 ++++++++++++++-----
2 files changed, 56 insertions(+), 22 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
index 407c5e34..5496a0d5 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
@@ -38,7 +38,7 @@ export default function PowerConditionalSelect(props) {
const { swalFire } = useSwal()
const modelHeader = [
{ name: getMessage('์๋ฆฌ์ฆ'), width: '15%', prop: 'pcsSerNm', type: 'color-box' },
- { name: getMessage('๋ช
์นญ'), width: '15%', prop: 'itemNm', type: 'color-box' },
+ { name: getMessage('๋ช
์นญ'), width: '15%', prop: 'goodsNo', type: 'color-box' },
{
name: `${getMessage('modal.circuit.trestle.setting.power.conditional.select.rated.output')} (kW)`,
width: '10%',
@@ -240,7 +240,7 @@ export default function PowerConditionalSelect(props) {
{selectedModels?.map((model) => (
- {model.itemNm} onRemoveSelectedModel(model)}>
+ {model.goodsNo} onRemoveSelectedModel(model)}>
))}
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
index ded6c61f..7cbca2da 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
@@ -14,6 +14,7 @@ export default function PassivityCircuitAllocation(props) {
tabNum,
setTabNum,
selectedModels,
+ setSelectedModels,
getOptYn: getApiProps,
getUseModuleItemList: getSelectedModuleList,
getSelectModelList: getSelectModelList,
@@ -201,6 +202,7 @@ export default function PassivityCircuitAllocation(props) {
}
}
+ let tempSelectedPcs = { ...selectedPcs }
canvas.discardActiveObject()
canvas
.getObjects()
@@ -229,6 +231,8 @@ export default function PassivityCircuitAllocation(props) {
obj.pcsItemId = selectedPcs.itemId
obj.circuit = moduleCircuitText
obj.circuitNumber = getCircuitNumber()
+ tempSelectedPcs.used = true
+ setSelectedPcs(tempSelectedPcs)
canvas.add(moduleCircuitText)
})
@@ -249,25 +253,47 @@ export default function PassivityCircuitAllocation(props) {
}),
}
})
+
console.log('uniqueCircuitNumbers', uniqueCircuitNumbers)
- const pcsItemList = selectedModels.map((model, index) => {
- return {
- pcsMkrCd: model.pcsMkrCd,
- pcsSerCd: model.pcsSerCd,
- itemId: model.itemId,
- itemNm: model.itemNm,
- goodsNo: model.goodsNo,
- serQtyList: [
- {
- serQty: targetModules.length,
- paralQty: uniqueCircuitNumbers.length,
- rmdYn: 'Y',
- usePossYn: 'Y',
- roofSurfaceList: roofSurfaceList,
- },
- ],
- }
- })
+ const usedPcses = selectedModels.filter((model) => model.isUsed)
+ const pcsItemList =
+ usedPcses.length === 0
+ ? [
+ {
+ pcsMkrCd: selectedPcs.pcsMkrCd,
+ pcsSerCd: selectedPcs.pcsSerCd,
+ itemId: selectedPcs.itemId,
+ itemNm: selectedPcs.itemNm,
+ goodsNo: selectedPcs.goodsNo,
+ serQtyList: [
+ {
+ serQty: targetModules.length,
+ paralQty: uniqueCircuitNumbers.length,
+ rmdYn: 'Y',
+ usePossYn: 'Y',
+ roofSurfaceList: roofSurfaceList,
+ },
+ ],
+ },
+ ]
+ : selectedModels.map((model, index) => {
+ return {
+ pcsMkrCd: model.pcsMkrCd,
+ pcsSerCd: model.pcsSerCd,
+ itemId: model.itemId,
+ itemNm: model.itemNm,
+ goodsNo: model.goodsNo,
+ serQtyList: [
+ {
+ serQty: targetModules.length,
+ paralQty: uniqueCircuitNumbers.length,
+ rmdYn: 'Y',
+ usePossYn: 'Y',
+ roofSurfaceList: roofSurfaceList,
+ },
+ ],
+ }
+ })
const params = {
...getApiProps(),
@@ -276,6 +302,7 @@ export default function PassivityCircuitAllocation(props) {
}
getPcsManualConfChk(params).then((res) => {
+ console.log('targetModules', targetModules)
if (res.resultCode === 'E') {
swalFire({
text: res.resultMsg,
@@ -295,10 +322,17 @@ export default function PassivityCircuitAllocation(props) {
canvas.renderAll()
},
})
-
+ setSelectedPcs({ ...selectedPcs, used: false })
+ setTargetModules([])
return
}
+ setSelectedModels(
+ selectedModels.map((model) => {
+ return { ...model, isUsed: model.id === selectedPcs.id ? true : model.isUsed }
+ }),
+ )
+
setTargetModules([])
setCircuitNumber(+circuitNumber + 1)
setTableData()
@@ -512,7 +546,7 @@ export default function PassivityCircuitAllocation(props) {
onChange={() => setSelectedPcs(model)}
/>
@@ -226,7 +226,7 @@ export default function Module({ setTabNum }) {
onChange={(e) => setInputVerticalSnowCover(e.target.value)}
/>
-
mm
+
cm
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index 67a5e467..bf4d4a86 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -324,6 +324,18 @@ export function useModuleBasicSetting(tabNum) {
})
}
+ useEffect(() => {
+ console.log('๋ฆฌ์ฝ์ผ ๋ฐ๋๋??')
+ console.log('isManualModuleSetup', isManualModuleSetup)
+ console.log('saleStoreNorthFlg', saleStoreNorthFlg)
+
+ if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
+ setSaleStoreNorthFlg(true)
+ }
+
+ manualModuleSetup()
+ }, [isManualModuleSetup])
+
/**
* trestle์์ ์์ญ์ ๊ฐ์ ธ์ mouse:move ์ด๋ฒคํธ๋ก ํด๋น ์์ญ์ ์ง์
ํ์๋ booleanPointInPolygon ๋ก ์ง์
์ฌ๋ถ๋ฅผ ํ์ธ
* ํ์ธ ํ ์
์ ์ด๋์ํด
@@ -364,7 +376,7 @@ export function useModuleBasicSetting(tabNum) {
lockRotation: true, // ํ์ ์ ๊ธ
lockScalingX: true, // X ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
lockScalingY: true, // Y ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
- name: 'module',
+ name: POLYGON_TYPE.MODULE,
}
if (moduleSetupSurfaces.length !== 0) {
@@ -429,6 +441,10 @@ export function useModuleBasicSetting(tabNum) {
parentId: moduleSetupSurfaces[i].parentId,
})
+ console.log('trestlePolygon', trestlePolygon)
+ console.log('saleStoreNorthFlg', saleStoreNorthFlg)
+ console.log('trestlePolygon.isNorth', trestlePolygon.isNorth)
+
//๋ถ๋ฉด์ด๊ณ ๋ถ๋ฉด์ค์น์์ ์ด ์๋๋ฉด ๊ทธ๋ฅ return
if (trestlePolygon.isNorth && !saleStoreNorthFlg) {
return
@@ -646,13 +662,15 @@ export function useModuleBasicSetting(tabNum) {
})
}
} else {
- //์๋๋ชจ๋ ํด์ ์ ๋ชจ๋ ์ค์น๋ฉด ์ ํ ์ ๊ธ
- moduleSetupSurfaces.forEach((obj) => {
- obj.set({
- selectable: true,
- evented: true,
+ if (moduleSetupSurfaces) {
+ //์๋๋ชจ๋ ํด์ ์ ๋ชจ๋ ์ค์น๋ฉด ์ ํ ์ ๊ธ
+ moduleSetupSurfaces.forEach((obj) => {
+ obj.set({
+ selectable: true,
+ evented: true,
+ })
})
- })
+ }
removeMouseEvent('mouse:up')
removeMouseEvent('mouse:move')
@@ -1693,7 +1711,7 @@ export function useModuleBasicSetting(tabNum) {
lockScalingY: true, // Y ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
parentId: moduleSetupSurface.parentId,
surfaceId: moduleSetupSurface.id,
- name: 'module',
+ name: POLYGON_TYPE.MODULE,
}
if (moduleSetupSurfaces.length !== 0) {
@@ -2102,7 +2120,7 @@ export function useModuleBasicSetting(tabNum) {
lockScalingY: true, // Y ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
parentId: moduleSetupSurface.parentId,
surfaceId: moduleSetupSurface.id,
- name: 'module',
+ name: POLYGON_TYPE.MODULE,
}
let leftMargin, bottomMargin, square
diff --git a/src/hooks/module/useModuleSelection.js b/src/hooks/module/useModuleSelection.js
index d0b812e5..3208a71a 100644
--- a/src/hooks/module/useModuleSelection.js
+++ b/src/hooks/module/useModuleSelection.js
@@ -89,11 +89,12 @@ export function useModuleSelection(props) {
getModuleData(roofsIds)
- //๋ฉ๋ด ์ด๋์ ๋ฐฐ์น๋ฉด ์ญ์
- const moduleSurfacesArray = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ //ํด๋น ๋ฉ๋ด ์ด๋์ ๋ฐฐ์น๋ฉด ์ญ์
+ const moduleSurfacesArray = canvas
+ .getObjects()
+ .filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE || obj.name === POLYGON_TYPE.MODULE)
if (moduleSurfacesArray.length > 0) {
moduleSurfacesArray.forEach((moduleSurface) => {
- moduleSurface.module = []
canvas.remove(moduleSurface)
})
canvas.renderAll()
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 38723da7..47257675 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -999,5 +999,6 @@
"construction.length.difference": "ๅฑๆ น้ขๅทฅๆณใใในใฆ้ธๆใใฆใใ ใใใ",
"menu.validation.canvas.roof": "ใใใซใ้
็ฝฎใใใซใฏใๅฑๆ น้ขใๅ
ฅๅใใๅฟ
่ฆใใใใพใใ",
"batch.object.outside.roof": "ใชใใธใงใฏใใฏๅฑๆ นใซ่จญ็ฝฎใใๅฟ
่ฆใใใใพใใ",
- "batch.object.notinstall.cross": "ใชใใธใงใฏใใฏ้่คใใฆใคใณในใใผใซใงใใพใใใ"
+ "batch.object.notinstall.cross": "ใชใใธใงใฏใใฏ้่คใใฆใคใณในใใผใซใงใใพใใใ",
+ "module.not.batch.north": "๋ถ์ชฝ์๋ ๋ชจ๋์ ๋ฐฐ์นํ ์ ์์ต๋๋ค."
}
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 5c7c17d6..7249b0f5 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -90,7 +90,7 @@
"modal.module.basic.setting.orientation.setting.info": "โป์๋ฎฌ๋ ์ด์
๊ณ์ฐ์ฉ ๋ฐฉ์๋ฅผ ์ง์ ํฉ๋๋ค. ๋จ์ชฝ์ ๋ฐฉ์๋ฅผ ์ค์ ํด์ฃผ์ธ์.",
"modal.module.basic.setting.orientation.setting.angle.passivity": "๊ฐ๋๋ฅผ ์ง์ ์
๋ ฅ",
"modal.module.basic.setting.module.roof.material": "์ง๋ถ์ฌ",
- "modal.module.basic.setting.module.trestle.maker": "๊ฐ๋๋ฉ์ด๊ฑฐ",
+ "modal.module.basic.setting.module.trestle.maker": "๊ฐ๋๋ฉ์ด์ปค",
"modal.module.basic.setting.module.rafter.margin": "์๊น๋ ๊ฐ๊ฒฉ",
"modal.module.basic.setting.module.construction.method": "๊ณต๋ฒ",
"modal.module.basic.setting.module.under.roof": "์ง๋ถ๋ฐ๋ฐํ",
From bb85d2ed6b39562e963c6ba204278e520dc13c3b Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 09:11:18 +0900
Subject: [PATCH 044/213] =?UTF-8?q?=EB=B6=81=EB=A9=B4=EC=84=A4=EC=B9=98=20?=
=?UTF-8?q?=ED=94=8C=EB=9E=98=EA=B7=B8=20=EA=B4=80=EB=A0=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/estimate/Estimate.jsx | 3 ++
src/components/management/StuffDetail.jsx | 22 +++++++------
.../management/StuffSearchCondition.jsx | 13 ++++----
.../estimate/useEstimateController.js | 31 ++++++++++++-------
4 files changed, 41 insertions(+), 28 deletions(-)
diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx
index a97cb4cb..b5d8bce0 100644
--- a/src/components/estimate/Estimate.jsx
+++ b/src/components/estimate/Estimate.jsx
@@ -1366,6 +1366,9 @@ export default function Estimate({}) {
{getMessage('estimate.detail.fileFlg')}
+ {estimateContextState?.northArrangement === '1' && (
+ {getMessage('estimate.detail.dragFileGuide')}
+ )}
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index 191b3156..fe8fea47 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -411,11 +411,12 @@ export default function StuffDetail() {
if (session?.storeId === 'T01') {
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- if (session.storeLvl === '1') {
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- } else {
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- }
+ // if (session.storeLvl === '1') {
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // } else {
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // }
+ url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
get({ url: url }).then((res) => {
@@ -523,11 +524,12 @@ export default function StuffDetail() {
if (session?.storeId === 'T01') {
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- if (session.storeLvl === '1') {
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- } else {
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- }
+ // if (session.storeLvl === '1') {
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // } else {
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // }
+ url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
get({ url: url }).then((res) => {
if (!isEmptyArray(res)) {
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx
index 62b75483..5021548d 100644
--- a/src/components/management/StuffSearchCondition.jsx
+++ b/src/components/management/StuffSearchCondition.jsx
@@ -474,12 +474,13 @@ export default function StuffSearchCondition() {
//T01์ผ๋
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- if (session.storeLvl === '1') {
- //T01์๋ 1์ฐจ์ ์ผ๋
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- } else {
- url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- }
+ // if (session.storeLvl === '1') {
+ // //T01์๋ 1์ฐจ์ ์ผ๋
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // } else {
+ // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
+ // }
+ url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
get({ url: url }).then((res) => {
diff --git a/src/hooks/floorPlan/estimate/useEstimateController.js b/src/hooks/floorPlan/estimate/useEstimateController.js
index ebd1ad88..7654f3ba 100644
--- a/src/hooks/floorPlan/estimate/useEstimateController.js
+++ b/src/hooks/floorPlan/estimate/useEstimateController.js
@@ -80,7 +80,6 @@ export const useEstimateController = (planNo) => {
res.data.pkgAsp = roundedNumber.toString()
}
-
setEstimateContextState(res.data)
}
}
@@ -155,7 +154,7 @@ export const useEstimateController = (planNo) => {
})
.catch((error) => {
console.log('::FileDownLoad Error::', error)
- alert('File does not exist.')
+ return swalFire({ text: getMessage('File does not exist'), type: 'alert' })
})
}
@@ -169,19 +168,19 @@ export const useEstimateController = (planNo) => {
if (estimateData?.charger === null || estimateData?.charger?.trim().length === 0) {
flag = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredCharger'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredCharger'), type: 'alert' })
}
if (estimateData?.objectName === null || estimateData?.objectName?.trim().length === 0) {
flag = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredObjectName'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredObjectName'), type: 'alert' })
}
if (isNaN(Date.parse(estimateData.estimateDate))) {
flag = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateDate'), type: 'alert' })
}
if (estimateData.estimateType === 'YJSS') {
@@ -189,7 +188,7 @@ export const useEstimateController = (planNo) => {
if (pkgAsp === '0') {
flag = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredPkgAsp'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredPkgAsp'), type: 'alert' })
}
}
@@ -209,6 +208,14 @@ export const useEstimateController = (planNo) => {
//๊ธฐ์กด์ ์ฒจ๋ถ๋ ํ์ผ์ด ์์ผ๋ฉด
if (isEmptyArray(estimateData.newFileList)) {
//์๋ก ์ฒจ๋ถํ ํ์ผ์ด ์์ผ๋ฉด
+
+ //๋ถ๋ฉด ๋จผ์ ์ฒดํฌ
+ if (estimateData?.northArrangement === '1') {
+ fileFlg = false
+ setIsGlobalLoading(false)
+ return swalFire({ text: getMessage('estimate.detail.save.requiredNorthArrangementFileUpload'), type: 'alert' })
+ }
+
if (estimateData.itemList.length > 1) {
estimateData.itemList.map((row) => {
if (row.delFlg === '0') {
@@ -217,7 +224,7 @@ export const useEstimateController = (planNo) => {
if (estimateData.fileFlg === '0') {
fileFlg = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredFileUpload'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredFileUpload'), type: 'alert' })
}
}
}
@@ -235,7 +242,7 @@ export const useEstimateController = (planNo) => {
if (item.itemId === '') {
itemFlg = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredItemId'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredItemId'), type: 'alert' })
}
}
@@ -251,7 +258,7 @@ export const useEstimateController = (planNo) => {
if (item.amount < 1) {
itemFlg = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredAmount'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredAmount'), type: 'alert' })
}
if (estimateData.estimateType !== 'YJSS') {
@@ -263,7 +270,7 @@ export const useEstimateController = (planNo) => {
if (item.salePrice < 1) {
itemFlg = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredSalePrice'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert' })
}
}
@@ -274,7 +281,7 @@ export const useEstimateController = (planNo) => {
if (isNaN(item.salePrice)) {
itemFlg = false
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredSalePrice'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredSalePrice'), type: 'alert' })
}
}
}
@@ -292,7 +299,7 @@ export const useEstimateController = (planNo) => {
})
if (delCnt === estimateData.itemList.length) {
setIsGlobalLoading(false)
- return alert(getMessage('estimate.detail.save.requiredItem'))
+ return swalFire({ text: getMessage('estimate.detail.save.requiredItem'), type: 'alert' })
}
}
From d92493b4e869719098b9e988cec02e982ebab759 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 09:54:08 +0900
Subject: [PATCH 045/213] =?UTF-8?q?=ED=8D=BC=EB=B8=94=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ContextRoofAllocationSetting.jsx | 325 +++++++++---------
1 file changed, 169 insertions(+), 156 deletions(-)
diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
index 5bfad3e4..88188887 100644
--- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
@@ -45,175 +45,188 @@ export default function ContextRoofAllocationSetting(props) {
return (
-
-
{getMessage('plan.menu.estimate.roof.alloc')}
- closePopup(id)}>
- ๋ซ๊ธฐ
-
-
-
-
{getMessage('modal.roof.alloc.info')}
-
-
{getMessage('modal.roof.alloc.select.roof.material')}
-
-
{
- // const selected = roofMaterials.find((roofMaterial) => roofMaterial.roofMatlCd === e.id)
- setCurrentRoofMaterial(e)
- }}
- showKey={'roofMatlNm'}
- sourceKey={'roofMatlCd'}
- targetKey={'roofMatlCd'}
- />
+ {currentRoofList && (
+ <>
+
+
{getMessage('plan.menu.estimate.roof.alloc')}
+ closePopup(id)}>
+ ๋ซ๊ธฐ
+
- {
- onAddRoofMaterial()
- }}
- >
-
- {getMessage('modal.common.add')}
-
-
-
- {currentRoofList.length > 0 &&
- currentRoofList.map((roof, index) => {
- return (
-
-
-
-
-
-
-
-
-
- handleChangeRoofMaterial(e, index)}
- />
-
- {index === 0 &&
{getMessage('modal.roof.alloc.default.roof.material')}}
- {index !== 0 &&
onDeleteRoofMaterial(index)}>}
+
+
{getMessage('modal.roof.alloc.info')}
+
+
{getMessage('modal.roof.alloc.select.roof.material')}
+
+ {
+ // const selected = roofMaterials.find((roofMaterial) => roofMaterial.roofMatlCd === e.id)
+ setCurrentRoofMaterial(e)
+ }}
+ showKey={'roofMatlNm'}
+ sourceKey={'roofMatlCd'}
+ targetKey={'roofMatlCd'}
+ />
+
+
{
+ onAddRoofMaterial()
+ }}
+ >
+
+ {getMessage('modal.common.add')}
+
+
+
+
+ {currentRoofList.map((roof, index) => {
+ return (
+
+
+
+
-
-
-
-
{getMessage('slope')}
-
- {
- handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
- }}
- defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
- />
-
-
{pitchText}
-
-
- {(roof.widAuth || roof.lenAuth) && (
-
- {roof.widAuth && (
+
+
-
W
-
-
+
+ handleChangeRoofMaterial(e, index)}
+ />
+ {index === 0 &&
{getMessage('modal.roof.alloc.default.roof.material')}}
+ {index !== 0 && (
+
+ onDeleteRoofMaterial(index)}>
+
+ )}
- )}
- {roof.lenAuth && (
+
+
- )}
- {(roof.raftAuth || roof.roofPchAuth) && (
-
- {roof.raftAuth && (
-
-
-
{getMessage('modal.placement.initial.setting.rafter')}
- {raftCodes.length > 0 && (
-
-
+
+ {(roof.widAuth || roof.lenAuth) && (
+ <>
+ {roof.widAuth && (
+
-
- )}
- {roof.roofPchAuth && (
-
-
-
{getMessage('hajebichi')}
-
-
-
-
+ )}
+ {roof.lenAuth && (
+
+ )}
+ >
)}
-
- )}
-
-
-
{
- handleChangeLayout(ROOF_MATERIAL_LAYOUT.PARALLEL, index)
- }}
- >
- {getMessage('modal.roof.alloc.select.parallel')}
-
-
-
{
- handleChangeLayout(ROOF_MATERIAL_LAYOUT.STAIRS, index)
- }}
- >
- {getMessage('modal.roof.alloc.select.stairs')}
-
+ {(roof.raftAuth || roof.roofPchAuth) && (
+ <>
+ {roof.raftAuth && (
+
+
+
{getMessage('modal.placement.initial.setting.rafter')}
+ {raftCodes.length > 0 && (
+
+
+
+ )}
+
+
+ )}
+ {roof.roofPchAuth && (
+
+
+
{getMessage('hajebichi')}
+
+
+
+
+
+ )}
+ >
+ )}
+
+
+ {
+ handleChangeLayout(ROOF_MATERIAL_LAYOUT.PARALLEL, index)
+ }}
+ >
+ {getMessage('modal.roof.alloc.select.parallel')}
+
+
+ {
+ handleChangeLayout(ROOF_MATERIAL_LAYOUT.STAIRS, index)
+ }}
+ >
+ {getMessage('modal.roof.alloc.select.stairs')}
+
+
+
-
-
- )
- })}
-
-
-
- {getMessage('modal.roof.alloc.apply')}
-
-
-
+ )
+ })}
+
+
+
+
+ {getMessage('modal.roof.alloc.apply')}
+
+
+
+ >
+ )}
From 14d6c91f37343c501dfa40253d2b77061f454b00 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 09:55:12 +0900
Subject: [PATCH 046/213] =?UTF-8?q?=EC=A7=91=EA=B3=84=ED=91=9C=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95,=20W=EB=8B=A8=EC=9C=84=20->=20kW?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/floor-plan/CanvasFrame.jsx | 1 -
.../circuitTrestle/CircuitTrestleSetting.jsx | 18 ++-
.../step/type/PassivityCircuitAllocation.jsx | 133 ++----------------
src/hooks/module/useModule.js | 93 +++++++++++-
src/hooks/module/useModuleBasicSetting.js | 6 +-
src/store/circuitTrestleAtom.js | 5 +-
6 files changed, 125 insertions(+), 131 deletions(-)
diff --git a/src/components/floor-plan/CanvasFrame.jsx b/src/components/floor-plan/CanvasFrame.jsx
index 31698b1a..85315a23 100644
--- a/src/components/floor-plan/CanvasFrame.jsx
+++ b/src/components/floor-plan/CanvasFrame.jsx
@@ -28,7 +28,6 @@ export default function CanvasFrame() {
const { currentCanvasPlan } = usePlan()
const totalDisplay = useRecoilValue(totalDisplaySelector) // ์ง๊ณํ ํ์ ์ฌ๋ถ
const { setIsGlobalLoading } = useContext(QcastContext)
- const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState)
const reset = useResetRecoilState(moduleStatisticsState)
const loadCanvas = () => {
if (canvas) {
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
index adeb0300..2c5927fe 100644
--- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
@@ -273,22 +273,28 @@ export default function CircuitTrestleSetting({ id }) {
id: uuidv4(),
}
})
- const PcsVoltageChkParams = {
+ const pcsVoltageChkParams = {
...getOptYn(),
useModuleItemList: getUseModuleItemList(),
roofSurfaceList: getRoofSurfaceList(),
pcsItemList: getPcsItemList(),
}
setSelectedModels(selectedModels)
- getPcsVoltageChk(PcsVoltageChkParams).then((res) => {})
+ getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
+ setAllocationType(ALLOCATION_TYPE.PASSIVITY)
+ })
} else {
swalFire({
- title: 'ํ์์ปจ๋์
๋๋ฅผ ์ถ๊ฐํด ์ฃผ์ธ์.',
+ title: res.result.resultMsg,
type: 'alert',
+ confirmFn: () => {
+ return
+ },
})
+ return
}
})
- } else if (pcsCheck.max) {
+ } else {
const moduleStdQty = selectedModels.reduce((acc, model) => {
return acc + parseInt(model.moduleStdQty)
}, 0)
@@ -306,9 +312,9 @@ export default function CircuitTrestleSetting({ id }) {
})
return
}
- }
- setAllocationType(ALLOCATION_TYPE.PASSIVITY)
+ setAllocationType(ALLOCATION_TYPE.PASSIVITY)
+ }
}
// StepUp์์ ์ ํ๋ ๊ฐ๋ค์ ์ฒ๋ฆฌํ๋ ํจ์ ์์
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
index 7cbca2da..aa151d9c 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
@@ -1,6 +1,7 @@
import { GlobalDataContext } from '@/app/GlobalDataProvider'
import { POLYGON_TYPE } from '@/common/common'
import { useMasterController } from '@/hooks/common/useMasterController'
+import { useModule } from '@/hooks/module/useModule'
import { useMessage } from '@/hooks/useMessage'
import { useSwal } from '@/hooks/useSwal'
import { canvasState } from '@/store/canvasAtom'
@@ -11,37 +12,29 @@ import { useRecoilState, useRecoilValue } from 'recoil'
export default function PassivityCircuitAllocation(props) {
const {
- tabNum,
- setTabNum,
selectedModels,
setSelectedModels,
getOptYn: getApiProps,
getUseModuleItemList: getSelectedModuleList,
getSelectModelList: getSelectModelList,
- getRoofSurfaceList,
- getModelList,
} = props
const { swalFire } = useSwal()
const { getMessage } = useMessage()
const canvas = useRecoilValue(canvasState)
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
const selectedModules = useRecoilValue(selectedModuleState)
- const [moduleStatistics, setModuleStatistics] = useRecoilState(moduleStatisticsState)
- // const [totalWpout, setTotalWpout] = useState(0)
const [selectedPcs, setSelectedPcs] = useState(selectedModels[0])
- // const { header, rows: row } = moduleStatistics
- const [header, setHeader] = useState(moduleStatistics.header)
- const [rows, setRows] = useState(moduleStatistics.rows)
- const [footer, setFooter] = useState(['ํฉ๊ณ'])
+ const { header, rows, footer } = useRecoilValue(moduleStatisticsState)
const [circuitNumber, setCircuitNumber] = useState(1)
const [targetModules, setTargetModules] = useState([])
+ const { setModuleStatisticsData } = useModule()
const { getPcsManualConfChk } = useMasterController()
useEffect(() => {
console.log('header, rows', header, rows)
console.log('selectedModels', selectedModels)
// setSurfaceInfo()
- setTableData()
+ setModuleStatisticsData()
if (!managementState) {
setManagementState(managementStateLoaded)
}
@@ -158,7 +151,14 @@ export default function PassivityCircuitAllocation(props) {
}
const handleCircuitNumberFix = () => {
- let uniqueCircuitNumbers = null
+ let uniqueCircuitNumbers = [
+ ...new Set(
+ canvas
+ .getObjects()
+ .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuitNumber)
+ .map((obj) => obj.circuitNumber),
+ ),
+ ]
if (!circuitNumber || circuitNumber === 0) {
swalFire({
text: 'ํ๋ก๋ฒํธ๋ฅผ 1 ์ด์์
๋ ฅํด์ฃผ์ธ์.',
@@ -174,15 +174,6 @@ export default function PassivityCircuitAllocation(props) {
})
return
} else if (selectedModels.length > 1) {
- uniqueCircuitNumbers = [
- ...new Set(
- canvas
- .getObjects()
- .filter((obj) => obj.name === POLYGON_TYPE.MODULE && obj.circuitNumber)
- .map((obj) => obj.circuitNumber),
- ),
- ]
-
let result = false
uniqueCircuitNumbers.forEach((number) => {
if (
@@ -335,7 +326,7 @@ export default function PassivityCircuitAllocation(props) {
setTargetModules([])
setCircuitNumber(+circuitNumber + 1)
- setTableData()
+ setModuleStatisticsData()
})
}
@@ -347,100 +338,6 @@ export default function PassivityCircuitAllocation(props) {
}
}
- const setTableData = () => {
- const tempHeader = [
- { name: getMessage('simulator.table.sub1'), prop: 'name' },
- { name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' },
- ...selectedModules.itemList.map((module) => {
- return {
- name: module.itemNm,
- prop: module.itemId,
- }
- }),
- { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
- ]
-
- const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
- const surfaceIds = surfaces.map((surface) => surface.parentId)
- const surfaceObjects = {}
- const rows = surfaces.map((surface) => {
- const moduleObject = {}
- surfaceObjects[surface.id] = {
- roofSurface: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText,
- circuit: '-',
- amount: 0,
- wpOut: 0,
- circuits: {},
- }
-
- surface.modules.forEach((module) => {
- if (!surfaceObjects[surface.id][module.moduleInfo.itemId]) {
- // ์ง๋ถ๋ฉด์ ๋ชจ๋ ์กด์ฌ ์ฌ๋ถ
- surfaceObjects[surface.id][module.moduleInfo.itemId] = 0 // ๋ชจ๋ ์ด๊ธฐํ
- }
-
- surfaceObjects[surface.id][module.moduleInfo.itemId]++
- surfaceObjects[surface.id].wpOut += +module.moduleInfo.wpOut
- if (module.circuit) {
- if (!surfaceObjects[surface.id].circuits[module.circuitNumber]) {
- surfaceObjects[surface.id].circuits[module.circuitNumber] = {
- circuit: module.circuitNumber,
- wpOut: 0,
- circuits: { wpOut: 0 },
- }
-
- if (!surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]) {
- surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId] = 0
- }
- }
- surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]++
- surfaceObjects[surface.id].circuits[module.circuitNumber].circuits.wpOut += +module.moduleInfo.wpOut
- surfaceObjects[surface.id].wpOut -= +module.moduleInfo.wpOut
- surfaceObjects[surface.id][module.moduleInfo.itemId]--
- }
- })
- })
- console.log('rows', rows)
- console.log('surfaceObjects', surfaceObjects)
- let tempRows = []
- Object.keys(surfaceObjects).forEach((key) => {
- let tempRow = {
- name: surfaceObjects[key].roofSurface,
- circuit: surfaceObjects[key].circuit,
- wpOut: surfaceObjects[key].wpOut,
- }
- selectedModules.itemList.forEach((module) => {
- tempRow[module.itemId] = surfaceObjects[key][module.itemId]
- })
- tempRows.push(tempRow)
-
- Object.keys(surfaceObjects[key].circuits).forEach((circuit) => {
- let row = {
- name: surfaceObjects[key].roofSurface,
- circuit: surfaceObjects[key].circuits[circuit].circuit,
- wpOut: surfaceObjects[key].circuits[circuit].circuits.wpOut,
- }
- selectedModules.itemList.forEach((module) => {
- row[module.itemId] = surfaceObjects[key].circuits[circuit].circuits[module.itemId]
- })
- tempRows.push(row)
- })
- })
- const tempFooter = {
- name: '์ดํฉ',
- circuit: '-',
- wpOut: tempRows.reduce((acc, row) => acc + row.wpOut, 0),
- }
- selectedModules.itemList.forEach((module) => {
- tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + row[module.itemId], 0)
- })
-
- setHeader(tempHeader)
- setRows(tempRows.filter((row) => row.wpOut !== 0))
- setFooter(tempFooter)
- setModuleStatistics({ header: tempHeader, rows: tempRows.filter((row) => row.wpOut !== 0), footer: tempFooter })
- }
-
const initSelectedPcsCircuitNumber = () => {
swalFire({
title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.init.info'),
@@ -516,9 +413,7 @@ export default function PassivityCircuitAllocation(props) {
{header.map((header, i) => (
|
- {typeof footer[header.prop] === 'number'
- ? footer[header.prop].toLocaleString('ko-KR', { maximumFractionDigits: 4 })
- : footer[header.prop]}
+ {footer[header.prop]}
|
))}
diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js
index de64c404..80aa17d7 100644
--- a/src/hooks/module/useModule.js
+++ b/src/hooks/module/useModule.js
@@ -1,12 +1,14 @@
import { BATCH_TYPE, POLYGON_TYPE } from '@/common/common'
import { canvasState } from '@/store/canvasAtom'
import { isOverlap, polygonToTurfPolygon, rectToPolygon } from '@/util/canvas-util'
-import { useRecoilValue } from 'recoil'
+import { useRecoilValue, useSetRecoilState } from 'recoil'
import { v4 as uuidv4 } from 'uuid'
import * as turf from '@turf/turf'
import { useSwal } from '../useSwal'
import { useModuleBasicSetting } from './useModuleBasicSetting'
import { useMessage } from '../useMessage'
+import { selectedModuleState } from '@/store/selectedModuleOptions'
+import { moduleStatisticsState } from '@/store/circuitTrestleAtom'
export const MODULE_REMOVE_TYPE = {
LEFT: 'left',
@@ -35,6 +37,8 @@ export function useModule() {
const { swalFire } = useSwal()
const { getMessage } = useMessage()
const { checkModuleDisjointObjects } = useModuleBasicSetting()
+ const selectedModules = useRecoilValue(selectedModuleState)
+ const setModuleStatistics = useSetRecoilState(moduleStatisticsState)
const moduleMove = (length, direction) => {
const selectedObj = canvas.getActiveObjects() //์ ํ๋ ๊ฐ์ฒด๋ค์ ๊ฐ์ ธ์ด
@@ -929,6 +933,92 @@ export function useModule() {
.filter((obj) => [BATCH_TYPE.OPENING, BATCH_TYPE.TRIANGLE_DORMER, BATCH_TYPE.PENTAGON_DORMER, BATCH_TYPE.SHADOW].includes(obj.name))
}
+ const setModuleStatisticsData = () => {
+ const tempHeader = [
+ { name: getMessage('simulator.table.sub1'), prop: 'name' },
+ { name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' },
+ ...selectedModules.itemList.map((module) => {
+ return {
+ name: module.itemNm,
+ prop: module.itemId,
+ }
+ }),
+ { name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
+ ]
+ const surfaceObjects = {}
+ const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
+ const rows = surfaces.map((surface) => {
+ surfaceObjects[surface.id] = {
+ roofSurface: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText,
+ circuit: '-',
+ amount: 0,
+ wpOut: 0,
+ circuits: {},
+ }
+
+ surface.modules.forEach((module) => {
+ if (!surfaceObjects[surface.id][module.moduleInfo.itemId]) {
+ // ์ง๋ถ๋ฉด์ ๋ชจ๋ ์กด์ฌ ์ฌ๋ถ
+ surfaceObjects[surface.id][module.moduleInfo.itemId] = 0 // ๋ชจ๋ ์ด๊ธฐํ
+ }
+
+ surfaceObjects[surface.id][module.moduleInfo.itemId]++
+ surfaceObjects[surface.id].wpOut += +module.moduleInfo.wpOut
+ if (module.circuit) {
+ if (!surfaceObjects[surface.id].circuits[module.circuitNumber]) {
+ surfaceObjects[surface.id].circuits[module.circuitNumber] = {
+ circuit: module.circuitNumber,
+ wpOut: 0,
+ circuits: { wpOut: 0 },
+ }
+
+ if (!surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]) {
+ surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId] = 0
+ }
+ }
+ surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]++
+ surfaceObjects[surface.id].circuits[module.circuitNumber].circuits.wpOut += +module.moduleInfo.wpOut
+ surfaceObjects[surface.id].wpOut -= +module.moduleInfo.wpOut
+ surfaceObjects[surface.id][module.moduleInfo.itemId]--
+ }
+ })
+ })
+ let tempRows = []
+ Object.keys(surfaceObjects).forEach((key) => {
+ let tempRow = {
+ name: surfaceObjects[key].roofSurface,
+ circuit: surfaceObjects[key].circuit,
+ wpOut: parseInt((surfaceObjects[key].wpOut / 1000).toFixed(3)),
+ }
+ selectedModules.itemList.forEach((module) => {
+ tempRow[module.itemId] = surfaceObjects[key][module.itemId]
+ })
+ tempRows.push(tempRow)
+
+ Object.keys(surfaceObjects[key].circuits).forEach((circuit) => {
+ let row = {
+ name: surfaceObjects[key].roofSurface,
+ circuit: surfaceObjects[key].circuits[circuit].circuit,
+ wpOut: parseInt((surfaceObjects[key].circuits[circuit].circuits.wpOut / 1000).toFixed(3)),
+ }
+ selectedModules.itemList.forEach((module) => {
+ row[module.itemId] = surfaceObjects[key].circuits[circuit].circuits[module.itemId]
+ })
+ tempRows.push(row)
+ })
+ })
+
+ const tempFooter = {
+ name: getMessage('modal.panel.batch.statistic.total'),
+ circuit: '-',
+ wpOut: tempRows.reduce((acc, row) => acc + row.wpOut, 0),
+ }
+ selectedModules.itemList.forEach((module) => {
+ tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + row[module.itemId], 0)
+ })
+ setModuleStatistics({ header: tempHeader, rows: tempRows.filter((row) => row.wpOut !== 0), footer: tempFooter })
+ }
+
return {
moduleMove,
moduleMultiMove,
@@ -942,5 +1032,6 @@ export function useModule() {
muduleRowInsert,
modulesRemove,
alignModule,
+ setModuleStatisticsData,
}
}
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index 20575fd7..9665955e 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -2452,7 +2452,7 @@ export function useModuleBasicSetting(tabNum) {
...surface,
name: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText, // ์ง๋ถ๋ฉด
// powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }),
- wpOut: wpOut,
+ wpOut: (wpOut / 1000).toFixed(3),
}
})
@@ -2465,7 +2465,7 @@ export function useModuleBasicSetting(tabNum) {
}),
{ name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`, prop: 'wpOut' },
]
- let footer = ['ํฉ๊ณ']
+ let footer = [getMessage('modal.panel.batch.statistic.total')]
let footerData = {}
rows.forEach((row) => {
Object.keys(moduleInfo).map((key) => {
@@ -2476,7 +2476,7 @@ export function useModuleBasicSetting(tabNum) {
Object.keys(footerData).forEach((key) => {
footer.push(footerData[key])
})
- footer.push(totalWpout)
+ footer.push((totalWpout / 1000).toFixed(3))
console.log({ header: header, rows, footer: footer })
setModuleStatistics({ header: header, rows, footer: footer })
}
diff --git a/src/store/circuitTrestleAtom.js b/src/store/circuitTrestleAtom.js
index ea54835a..d1477e13 100644
--- a/src/store/circuitTrestleAtom.js
+++ b/src/store/circuitTrestleAtom.js
@@ -40,7 +40,10 @@ export const moduleStatisticsState = atom({
{ name: `๋ฐ์ ๋(kW)`, prop: 'amount' },
],
rows: [],
- footer: ['ํฉ๊ณ', '0'],
+ footer: [
+ { name: '-', prop: 'name' },
+ { name: 0, prop: 'amount' },
+ ],
},
dangerouslyAllowMutability: true,
})
From 870a39d74d1edaac0e913d8d6bda7871ca211537 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 09:58:05 +0900
Subject: [PATCH 047/213] =?UTF-8?q?=F0=9F=93=83test:=20=EA=B2=AC=EC=A0=81?=
=?UTF-8?q?=EC=84=9C=20=EC=9D=B4=EB=8F=99=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20?=
=?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/Playground.jsx | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/src/components/Playground.jsx b/src/components/Playground.jsx
index b2e64edc..8a365646 100644
--- a/src/components/Playground.jsx
+++ b/src/components/Playground.jsx
@@ -28,6 +28,8 @@ import useSWRMutation from 'swr/mutation'
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
import { canvasPopupStatusStore } from '@/store/canvasPopupStatusAtom'
import { moduleSelectionDataPlanListState } from '@/store/selectedModuleOptions'
+import { useRouter } from 'next/navigation'
+import { QcastContext } from '@/app/QcastProvider'
export default function Playground() {
const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState)
@@ -56,6 +58,13 @@ export default function Playground() {
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
+ const router = useRouter()
+ const { setIsGlobalLoading } = useContext(QcastContext)
+
+ useEffect(() => {
+ setIsGlobalLoading(false)
+ }, [])
+
useEffect(() => {
console.log('textInput:', textInput)
}, [textInput])
@@ -891,6 +900,19 @@ export default function Playground() {
Test Data insert
+
+ {
+ const params = {
+ pid: 1,
+ objectNo: 'RT01250131002',
+ }
+ router.push(`/floor-plan/estimate/5?pid=${params.pid}&objectNo=${params.objectNo}`)
+ }}
+ >
+ ๊ฒฌ์ ์ ํ์ด์ง ์ด๋
+
+
>
)
From 10f77a4acdea7df168ecfb5672a72caf5c492594 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 10:08:26 +0900
Subject: [PATCH 048/213] =?UTF-8?q?=EB=B3=B5=EC=8B=9C=EB=8F=84=20=EC=9E=85?=
=?UTF-8?q?=EB=A0=A5=EC=9D=B4=20=EC=95=84=EB=8B=8C=20=EA=B2=BD=EC=9A=B0?=
=?UTF-8?q?=EB=8A=94=20=EA=B0=81=EB=8F=84=20=EA=B3=84=EC=82=B0=20=ED=95=84?=
=?UTF-8?q?=EC=9A=94=20x?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 14 +++++++++++++-
src/util/canvas-util.js | 5 -----
2 files changed, 13 insertions(+), 6 deletions(-)
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index 9c580971..fffe27c9 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -2,9 +2,10 @@ import { useRecoilValue } from 'recoil'
import { canvasState, currentAngleTypeSelector } from '@/store/canvasAtom'
import { POLYGON_TYPE } from '@/common/common'
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
-import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
+import { getDegreeByChon } from '@/util/canvas-util'
import { v4 as uuidv4 } from 'uuid'
import { useMasterController } from '@/hooks/common/useMasterController'
+import { basicSettingState } from '@/store/settingAtom'
// ํ๋ก ๋ฐ ๊ฐ๋์ค์
export const useTrestle = () => {
@@ -12,6 +13,7 @@ export const useTrestle = () => {
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //๋ค์์ผ๋ก ๋์ด๊ฐ๋ ์ต์ข
๋ฐ์ดํฐ
const { getQuotationItem } = useMasterController()
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
+ const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
const apply = () => {
try {
@@ -1787,6 +1789,16 @@ export const useTrestle = () => {
return groups
}
+ // ๊ฐ๋์ ๋ฐ๋ฅธ ๊ธธ์ด ๋ฐํ
+ function getTrestleLength(length, degree) {
+ if (roofSizeSet !== 1) {
+ // ๋ณต์๋ ์
๋ ฅ์ด ์๋๊ฒฝ์ฐ ๊ทธ๋ฅ ๊ธธ์ด return
+ return length
+ }
+ const radians = (degree * Math.PI) / 180
+ return length * Math.cos(radians)
+ }
+
// ๊ฒฌ์ ์ ์์ดํ
์กฐํ api parameter ์์ฑ
const getTrestleParams = (surface) => {
const result = calculateForApi(surface)
diff --git a/src/util/canvas-util.js b/src/util/canvas-util.js
index 2204eaec..a0442d9f 100644
--- a/src/util/canvas-util.js
+++ b/src/util/canvas-util.js
@@ -1031,8 +1031,3 @@ export function calculateVisibleModuleHeight(sourceWidth, sourceHeight, angle, d
height: Number(visibleHeight.toFixed(1)), // ์์์ ๋ ์๋ฆฌ๋ก ๊ณ ์
}
}
-
-export function getTrestleLength(length, degree) {
- const radians = (degree * Math.PI) / 180
- return length * Math.cos(radians)
-}
From cbdaaba2cef5a02b23344fec1d8be5d6d9ca765a Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 10:23:22 +0900
Subject: [PATCH 049/213] =?UTF-8?q?=F0=9F=93=8Cfix:=20=EC=88=98=EC=A0=95?=
=?UTF-8?q?=20=EB=B2=88=EC=97=AD=ED=8C=8C=EC=9D=BC=20=EB=B0=98=EC=98=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/locales/ja.json | 190 ++++++++++++++++++++++----------------------
src/locales/ko.json | 14 ++--
2 files changed, 100 insertions(+), 104 deletions(-)
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 47257675..0514e960 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -5,11 +5,11 @@
"header.menus.management": "ใชใใธใงใฏใใจๅณ้ขใฎ็ฎก็",
"header.menus.management.newStuff": "ๆฐ่ฆ็ฉไปถ็ป้ฒ",
"header.menus.management.detail": "็ฉไปถ่ฉณ็ดฐ",
- "header.menus.management.stuffList": "็ฉไปถใฎ็พ็ถ",
+ "header.menus.management.stuffList": "่ฆ็ฉ็ถๆณ",
"header.menus.community": "ใณใใฅใใใฃ",
"header.menus.community.notice": "ใ็ฅใใ",
"header.menus.community.faq": "FAQ",
- "header.menus.community.archive": "ใใญใฅใกใณใใใฆใณใญใผใ",
+ "header.menus.community.archive": "ๆๆธใใฆใณใญใผใ",
"header.logout": "ใญใฐใขใฆใ",
"header.go": "็งปๅ",
"header.online.warranty.system": "ใชใณใฉใคใณไฟ่จผใทในใใ ",
@@ -17,23 +17,23 @@
"plan.menu.plan.drawing": "็ฉไปถๆ
ๅ ฑ",
"plan.menu.placement.surface.initial.setting": "้
็ฝฎ้ขๅๆ่จญๅฎ",
"modal.placement.initial.setting.plan.drawing": "ๅณ้ขใฎไฝๆๆนๆณ",
- "modal.placement.initial.setting.plan.drawing.size.stuff": "ๅฏธๆณๅ
ฅๅใซใใๅ็ฎไฝๆ",
+ "modal.placement.initial.setting.plan.drawing.size.stuff": "ๅฏธๆณๅ
ฅๅใซใใ็ฉไปถไฝๆ",
"modal.placement.initial.setting.size": "ๅฏธๆณๅ
ฅๅๆนๆณ",
"modal.placement.initial.setting.size.info": "ๅฏธๆณๅ
ฅๅๆนๆณๆกๅ
",
- "modal.placement.initial.setting.size.roof": "่ค่ฆๅณๅ
ฅๅ",
+ "modal.placement.initial.setting.size.roof": "ไผๅณๅ
ฅๅ",
"modal.placement.initial.setting.size.roof.info": "ๅนณ้ขใฎๅคๅฃ็ทใจ็ซ้ขใฎๅฑๆ นๅพ้
ใซๅบใฅใใฆไฝ็ปใใๅ ดๅ้ธๆ",
"modal.placement.initial.setting.size.actual": "ๅฎๆธฌๅคๅ
ฅๅ",
- "modal.placement.initial.setting.size.actual.info": "็พๅฐๅฑๆ นใฎๅคๅจๅฏธๆณใๅ
ฅๅใใฆไฝ็ปใใๅ ดๅ้ธๆ",
- "modal.placement.initial.setting.size.none.pitch": "้ธไธๅฑๆ น",
+ "modal.placement.initial.setting.size.actual.info": "ๅฑๆ นใฎๅคๅจๅฏธๆณใๅ
ฅๅใใฆไฝ็ปใใๅ ดๅ้ธๆ",
+ "modal.placement.initial.setting.size.none.pitch": "้ธๅฑๆ น",
"modal.placement.initial.setting.size.none.pitch.info": "ๅพๆใฎใชใๅนณ้ขๅฝข็ถใฎๅฑๆ นใซใใใซใ้
็ฝฎใใๅ ดๅใซ้ธๆ",
- "modal.placement.initial.setting.roof.angle.setting": "ๅฑๆ น่งๅบฆ่จญๅฎ",
+ "modal.placement.initial.setting.roof.angle.setting": "่งๅบฆ่จญๅฎ",
"modal.placement.initial.setting.roof.pitch": "ๅพๆ",
"modal.placement.initial.setting.roof.angle": "่งๅบฆ",
"modal.placement.initial.setting.roof.material": "ๅฑๆ นๆ้ธๆ๏ผๅไฝmm๏ผ",
"modal.placement.initial.setting.roof.material.info": "ๅฏพๅฟๅฏ่ฝใชๅฑๆ นๆใ่ถณๅ ดใฏ้ๅฎใใใพใใฎใงใๅฟ
ใไบๅใใใฅใขใซใใ็ขบ่ชใใ ใใใ",
"modal.placement.initial.setting.rafter": "ๅๆจ",
"modal.roof.shape.setting": "ๅฑๆ นๅฝข็ถใฎ่จญๅฎ",
- "modal.roof.shape.setting.ridge": "้พไธธ",
+ "modal.roof.shape.setting.ridge": "ๆฃ",
"modal.roof.shape.setting.patten.a": "Aใใฟใผใณ",
"modal.roof.shape.setting.patten.b": "Bใใฟใผใณ",
"modal.roof.shape.setting.side": "ๅฅใซ่จญๅฎ",
@@ -42,14 +42,14 @@
"plan.menu.roof.cover.roof.shape.setting": "ๅฑๆ นๅฝข็ถใฎ่จญๅฎ",
"plan.menu.roof.cover.roof.shape.passivity.setting": "ๅฑๆ นๅฝข็ถใฎๆๅ่จญๅฎ",
"plan.menu.roof.cover.eaves.kerava.edit": "่ปใปใฑใฉใๅคๆด",
- "plan.menu.roof.cover.movement.shape.updown": "้
็ท็งปๅใปๅไธใไธใ",
- "modal.movement.flow.line.move": "้
็ทใฎ็งปๅ",
+ "plan.menu.roof.cover.movement.shape.updown": "่ป็ท็งปๅใปๆกไธใไธใ",
+ "modal.movement.flow.line.move": "่ป็ทใฎ็งปๅ",
"modal.movement.flow.line.move.alert": "็งปๅใใๆฐใชใใ",
- "modal.movement.flow.line.updown": "ๅไธใใปไธใ",
+ "modal.movement.flow.line.updown": "ๆกไธใใปไธใ",
"modal.movement.flow.line.updown.info": "ๆกใฎ็ฐใชใ่พบใ้ธๆใใๅน
ใๆๅฎใใพใใ",
"modal.movement.flow.line.updown.up": "ๆกใไธใใ",
"modal.movement.flow.line.updown.down": "ๆกๆฐใไธใใ",
- "modal.movement.flow.line.info": "้
็ทใ้ธๆใใฆ็งปๅๅน
ใๆๅฎใใพใ",
+ "modal.movement.flow.line.info": "่ป็ทใ้ธๆใใฆ็งปๅๅน
ใๆๅฎใใพใ",
"modal.movement.flow.line.bottom.left": "้ซใๅคๆด๏ผไธใๅทฆ",
"modal.movement.flow.line.top.right": "้ซใๅคๆด๏ผไธใๅณ",
"plan.menu.roof.cover.outline.edit.offset": "ๅคๅฃใฎ็ทจ้ใจใชใใปใใ",
@@ -59,17 +59,17 @@
"modal.cover.outline.drawing": "ๅคๅฃ็ทใฎไฝๆ",
"modal.cover.outline": "ๅคๅฃ็ท",
"modal.cover.outline.right.angle": "็ด่ง",
- "modal.cover.outline2": "ใคใปใฐใ",
+ "modal.cover.outline2": "็ฐๅพ้
",
"modal.cover.outline.angle": "่งๅบฆ",
"modal.cover.outline.diagonal": "ๅฏพ่ง็ท",
"modal.cover.outline.setting": "่จญๅฎ",
"modal.cover.outline.length": "้ทใ(mm)",
"modal.cover.outline.arrow": "ๆนๅ๏ผ็ขๅฐ)",
"modal.cover.outline.fix": "ๅคๅฃ็ท็ขบๅฎ",
- "modal.cover.outline.rollback": "ไธๅคๆฆใซๆปใ",
+ "modal.cover.outline.rollback": "ๅใซๆปใ",
"modal.cover.outline.finish": "่จญๅฎๅฎไบ",
"common.setting.finish": "่จญๅฎๅฎไบ",
- "common.setting.rollback": "ไธๅคๆฆใซๆปใ",
+ "common.setting.rollback": "ๅใซๆปใ",
"modal.cover.outline.remove": "ๅคๅฃใฎๅใๅคใ",
"modal.cover.outline.select.move": "ๅคๅฃ้ธๆใฎ็งปๅ",
"plan.menu.placement.surface": "้
็ฝฎ้ข",
@@ -77,29 +77,29 @@
"plan.menu.placement.surface.drawing": "้
็ฝฎ้ขใฎๆ็ป",
"modal.placement.surface.drawing.straight.line": "็ด็ท",
"modal.placement.surface.drawing.right.angle": "็ด่ง",
- "modal.placement.surface.drawing.double.pitch": "ใคใปใฐใ",
+ "modal.placement.surface.drawing.double.pitch": "็ฐๅพ้
",
"modal.placement.surface.drawing.angle": "่งๅบฆ",
"modal.placement.surface.drawing.diagonal": "ๅฏพ่ง็ท",
"modal.placement.surface.drawing.fix": "้
็ฝฎ้ข็ขบๅฎ",
"plan.menu.placement.surface.arrangement": "้ขๅฝข็ถใฎ้
็ฝฎ",
- "plan.menu.placement.surface.object": "ใชใใธใงใฏใใฎ้
็ฝฎ",
+ "plan.menu.placement.surface.object": "ใขใธใฅใผใซ้
็ฝฎ",
"plan.menu.placement.surface.all.remove": "้
็ฝฎ้ขๅ
จไฝใๅ้ค",
"plan.menu.module.circuit.setting": "ใขใธใฅใผใซใๅ่ทฏๆงๆ",
"plan.menu.module.circuit.setting.default": "ใขใธใฅใผใซ/ๆถๅฐ่จญๅฎ",
"modal.module.basic.setting.orientation.setting": "ๆนไฝ่จญๅฎ",
"modal.module.basic.setting.orientation.setting.info": "โปใทใใฅใฌใผใทใงใณ่จ็ฎ็จๆนไฝใๆๅฎใใพใใๅใฎๆนไฝใ่จญๅฎใใฆใใ ใใใ",
- "modal.module.basic.setting.orientation.setting.angle.passivity": "่งๅบฆใ็ดๆฅๅ
ฅๅ",
+ "modal.module.basic.setting.orientation.setting.angle.passivity": "ๅพ้
ใ็ดๆฅๅ
ฅๅ",
"modal.module.basic.setting.module.roof.material": "ๅฑๆ นๆ",
- "modal.module.basic.setting.module.trestle.maker": "ใซใใกใผใฌใผ",
+ "modal.module.basic.setting.module.trestle.maker": "ๆถๅฐใกใผใซใผ",
"modal.module.basic.setting.module.rafter.margin": "ๅๆจใฎ้้",
"modal.module.basic.setting.module.construction.method": "ๅทฅๆณ",
"modal.module.basic.setting.module.under.roof": "ๅฑๆ นใฎไธ",
"modal.module.basic.setting.module.setting": "ใขใธใฅใผใซใฎ้ธๆ",
- "modal.module.basic.setting.module.hajebichi": "ใใณใใณใใใ",
+ "modal.module.basic.setting.module.hajebichi": "ใใผใใใ",
"modal.module.basic.setting.module.setting.info1": "โปๅพ้
ใฎ็ฏๅฒใซใฏๅถ้ใใใใพใใๅฑๆ นๅพๆใ2.5ๅคๆชๆบ10ๅคใ่ถ
ใใๅ ดๅใฏใๆฝๅทฅใๅฏ่ฝใใฉใใๆฝๅทฅใใใฅใขใซใ็ขบ่ชใใฆใใ ใใใ",
"modal.module.basic.setting.module.setting.info2": "โปใขใธใฅใผใซ้
็ฝฎๆใฏใๆฝๅทฅใใใฅใขใซใซ่จ่ผใใใฆใใ๏ผใขใธใฅใผใซ้
็ฝฎๆกไปถ๏ผใๅฟ
ใใ็ขบ่ชใใ ใใใ",
"modal.module.basic.setting.module.stuff.info": "็ฉไปถๆ
ๅ ฑ",
- "modal.module.basic.setting.module.surface.type": "้ข็
งๅบฆ",
+ "modal.module.basic.setting.module.surface.type": "้ข็ฒๅบฆๅบๅ",
"modal.module.basic.setting.module.fitting.height": "่จญ็ฝฎ้ซใ",
"modal.module.basic.setting.module.standard.wind.speed": "ๅบๆบ้ขจ้",
"modal.module.basic.setting.module.standard.snowfall.amount": "็ฉ้ช้",
@@ -107,33 +107,33 @@
"modal.module.basic.setting.module.enforce.construction": "ๅผทๅๆฝๅทฅ",
"modal.module.basic.setting.module.multiple.construction": "ๅค่จญๆฝๅทฅ",
"modal.module.basic.setting.module.eaves.bar.fitting": "่ปใซใใผใฎ่จญ็ฝฎ",
- "modal.module.basic.setting.module.blind.metal.fitting": "็ฉ้ช้ฒๆญขไปใใใคใณในใใผใซ",
+ "modal.module.basic.setting.module.blind.metal.fitting": "็ฉ้ช้ฒๆญข้ๅ
ท่จญ็ฝฎ",
"modal.module.basic.setting.module.select": "ใขใธใฅใผใซ/ๆถๅฐ้ธๆ",
"modal.module.basic.setting.module.placement": "ใขใธใฅใผใซใฎ้
็ฝฎ",
"modal.module.basic.setting.module.placement.select.fitting.type": "่จญ็ฝฎๅฝขๆ
ใ้ธๆใใฆใใ ใใใ",
- "modal.module.basic.setting.module.placement.waterfowl.arrangement": "ๆฐด้ณฅใฎ้
็ฝฎ",
+ "modal.module.basic.setting.module.placement.waterfowl.arrangement": "ๅ้ณฅ้
็ฝฎ",
"modal.module.basic.setting.module.placement.do": "ใใ",
"modal.module.basic.setting.module.placement.do.not": "ใใชใ",
"modal.module.basic.setting.module.placement.arrangement.standard": "้
็ฝฎๅบๆบ",
"modal.module.basic.setting.module.placement.arrangement.standard.center": "ไธญๅคฎ",
"modal.module.basic.setting.module.placement.arrangement.standard.eaves": "่ป",
- "modal.module.basic.setting.module.placement.arrangement.standard.ridge": "้พไธธ",
+ "modal.module.basic.setting.module.placement.arrangement.standard.ridge": "ๆฃ",
"modal.module.basic.setting.module.placement.maximum": "ๆๅคง้
็ฝฎ",
"modal.module.basic.setting.pitch.module.placement.standard.setting": "้
็ฝฎๅบๆบ่จญๅฎ",
"modal.module.basic.setting.pitch.module.placement.standard.setting.south": "ๅๅใ่จญ็ฝฎ",
- "modal.module.basic.setting.pitch.module.placement.standard.setting.select": "ๆๅฎใใ่พบใใใผในใงใคใณในใใผใซ",
+ "modal.module.basic.setting.pitch.module.placement.standard.setting.select": "ๆๅฎใใ่พบใๅบๆบใซ่จญ็ฝฎ",
"modal.module.basic.setting.pitch.module.allocation.setting": "ๅฒใๅฝใฆ่จญๅฎ",
- "modal.module.basic.setting.pitch.module.allocation.setting.info": "โป้
็ฝฎใใใซ็จฎ้ก1็จฎ้กๅ ดๅใฎใฟไฝฟ็จใใๆฐใใใพใใ",
+ "modal.module.basic.setting.pitch.module.allocation.setting.info": "โป้
็ฝฎใใใซใฎ็จฎ้กใ1็จฎ้กใฎๅ ดๅใฎใฟไฝฟ็จใงใใพใใ",
"modal.module.basic.setting.pitch.module.row.amount": "ๅๆฐ",
"modal.module.basic.setting.pitch.module.row.margin": "ไธไธ้้",
- "modal.module.basic.setting.pitch.module.column.amount": "็ฑๆฐด",
+ "modal.module.basic.setting.pitch.module.column.amount": "ๅๆฐ",
"modal.module.basic.setting.pitch.module.column.margin": "ๅทฆๅณ้้",
- "modal.module.basic.setting.prev": "ไปฅๅ",
+ "modal.module.basic.setting.prev": "็งป่ปข",
"modal.module.basic.setting.passivity.placement": "ๆๅ้
็ฝฎ",
"modal.module.basic.setting.auto.placement": "่จญๅฎๅคใซ่ชๅ้
็ฝฎ",
"plan.menu.module.circuit.setting.circuit.trestle.setting": "ๅ่ทฏ่จญๅฎ",
"modal.circuit.trestle.setting": "ๅ่ทฏ่จญๅฎ",
- "modal.circuit.trestle.setting.alloc.trestle": "ไปฎไปฃๅฒๅฝ",
+ "modal.circuit.trestle.setting.alloc.trestle": "ๆถๅฐ้
็ฝฎ",
"modal.circuit.trestle.setting.power.conditional.select": "ใใฏใผใณใณใใฃใทใงใใผใฎ้ธๆ",
"modal.circuit.trestle.setting.power.conditional.select.cold.region": "ๅฏๅทๅฐไปๆง",
"modal.circuit.trestle.setting.power.conditional.select.name": "ๅ็งฐ",
@@ -169,7 +169,7 @@
"modal.roof.alloc.default.roof.material": "ๅบๆฌๅฑๆ นๆ",
"modal.roof.alloc.select.roof.material": "ๅฑๆ นๆใฎ้ธๆ",
"modal.roof.alloc.select.parallel": "ไธฆๅๅผ",
- "modal.roof.alloc.select.stairs": "ใซในใฑใผใ",
+ "modal.roof.alloc.select.stairs": "้ๆฎตๅผ",
"modal.roof.alloc.apply": "้ธๆใใๅฑๆ นๆใจใใฆๅฒใๅฝใฆ",
"plan.menu.estimate.docDown": "ๆๆธใฎใใฆใณใญใผใ",
"plan.menu.estimate.save": "ไฟๅญ",
@@ -191,7 +191,7 @@
"common.vertical": "็ธฆ",
"modal.font.setting.display": "่ฆใ",
"modal.font.setting.info": "ใใใฏOpen Typeใใฉใณใใงใใใใชใณใฟใ็ป้ขใงใๅใใใฉใณใใไฝฟ็จใใฆใใ ใใใ",
- "modal.canvas.setting": "Canvasใฎ่จญๅฎ",
+ "modal.canvas.setting": "ไฝๅณใฎ่จญๅฎ",
"modal.canvas.setting.display": "ใใฃในใใฌใค่จญๅฎ",
"modal.canvas.setting.font.plan": "ใใฉใณใใจๅณ้ขใตใคใบใฎ่จญๅฎ",
"modal.canvas.setting.grid": "ใฐใชใใ",
@@ -252,7 +252,7 @@
"modal.canvas.setting.first.option.image": "็ปๅ่กจ็คบ",
"modal.canvas.setting.first.option.total": "้่จ่กจใ่กจ็คบ",
"modal.canvas.setting.first.option.dimension": "ๅฏธๆณ่กจ็คบ",
- "modal.canvas.setting.first.option.corridor.dimension": "ๅปไธๅฏธๆณ่กจ็คบ",
+ "modal.canvas.setting.first.option.corridor.dimension": "ไผใๅณๅฏธๆณ่กจ็คบ",
"modal.canvas.setting.first.option.real.dimension": "ๅฎๅฏธ่กจ็คบ",
"modal.canvas.setting.first.option.none.dimension": "ๅฏธๆณ่กจ็คบใชใ",
"modal.canvas.setting.first.option.display": "็ป้ข่กจ็คบ",
@@ -269,7 +269,7 @@
"modal.wallline.offset.setting": "ๅคๅฃใฎ็ทจ้ใจใชใใปใใ",
"modal.wallline.offset.setting.wallline.edit": "ๅคๅฃใฎ็ทจ้",
"modal.wallline.offset.setting.wallline.edit.info": "่พบใจๅง็นใ้ธๆใใฆ้ทใใจๆนๅใๆๅฎใใฆใใ ใใใ",
- "modal.wallline.offset.setting.wallline.edit.position": "ๆฏๅบ",
+ "modal.wallline.offset.setting.wallline.edit.position": "ๅง็น",
"modal.wallline.offset.setting.offset": "ใชใใปใใ",
"modal.wallline.offset.setting.offset.info": "ใชใใปใใใใใๅคๅฃ็ทใ้ธๆใใฆใใ ใใใ",
"modal.object.setting.type.open.space.placement": "้ๅฃ้จใฎ้
็ฝฎ",
@@ -282,7 +282,7 @@
"modal.object.setting.height": "็ธฆ้ท",
"modal.object.setting.area.cross": "ใจใชใขไบคๅทฎ",
"modal.object.setting.size.setting": "ใตใคใบ่จญๅฎ",
- "modal.object.setting.agreement.depth": "ๅๆใฎๆทฑใ",
+ "modal.object.setting.agreement.depth": "ๆฃใฎ้ทใใปๆทฑใ",
"modal.object.setting.offset.depth": "ๅบๅน
๏ผๆทฑใ๏ผ",
"modal.object.setting.offset.width": "ๅบๅน
๏ผๅน
๏ผ",
"modal.object.setting.direction.select": "ๆนๅใฎ้ธๆ",
@@ -330,7 +330,7 @@
"contextmenu.wallline.remove": "ๅคๅฃใฎๅ้ค",
"contextmenu.size.edit": "ใตใคใบๅคๆด",
"modal.auxiliary.size.edit": "่ฃๅฉ็ทใตใคใบๅคๆด",
- "modal.auxiliary.size.edit.point": "ๆฏๅบ",
+ "modal.auxiliary.size.edit.point": "ๅง็น",
"contextmenu.auxiliary.move": "่ฃๅฉ็ทใฎ็งปๅ",
"modal.auxiliary.move": "่ฃๅฉ็ทใฎ็งปๅ",
"modal.auxiliary.move.info": "็งปๅใใๆนๅใๅ
ฅๅใใฆใใ ใใใ",
@@ -361,12 +361,12 @@
"modal.panel.column.insert.type.left": "ๅทฆๆฟๅ
ฅ",
"modal.panel.column.insert.type.right": "ๅณๆฟๅ
ฅ",
"modal.image.load.size.rotate": "ใตใคใบๅคๆดใจๅ่ปข",
- "contextmenu.row.move": "ใใ ใ็งปๅ",
- "contextmenu.row.copy": "ๅใณใใผ",
- "contextmenu.row.remove": "ใใ ใๅ้ค",
- "modal.row.remove": "ใใ ใๅ้ค",
+ "contextmenu.row.move": "ๆฎต็งปๅ",
+ "contextmenu.row.copy": "ๆฎตใณใใผ",
+ "contextmenu.row.remove": "ๆฎตๅ้ค",
+ "modal.row.remove": "ๆฎตๅ้ค",
"modal.row.remove.info": "ๅ้คในใใผใธใใฉใฎใใใซใใพใใ๏ผ",
- "modal.row.remove.type.up": "้่ถณใซๆธใ",
+ "modal.row.remove.type.up": "ไธใซๆธใใ",
"modal.row.remove.type.down": "ไธๅใใซๆธใใ",
"modal.row.remove.type.side": "ไธกๅดใซๆธใ",
"modal.row.remove.type.none": "ๆธใใใชใ",
@@ -374,7 +374,7 @@
"modal.row.insert": "ๆฎตๆฟๅ
ฅ",
"modal.row.insert.info": "ๆฟๅ
ฅใใๆนๅใ้ธๆใใฆใใ ใใใ",
"modal.row.insert.type.up": "ไธ้จๆฟๅ
ฅ",
- "modal.row.insert.type.down": "ไธใฎๆฟๅ
ฅ",
+ "modal.row.insert.type.down": "ไธ้จๆฟๅ
ฅ",
"modal.move.setting": "็งปๅ่จญๅฎ",
"modal.move.setting.info": "้้ใ่จญๅฎใใ็งปๅๆนๅใ้ธๆใใพใใ",
"modal.copy.setting": "ใณใใผ่จญๅฎ",
@@ -389,7 +389,7 @@
"modal.display.edit.info": "ๅฏธๆณ็ทใซ่กจ็คบใใๆฐๅคใๅ
ฅๅใใฆใใ ใใใ",
"modal.display.edit.before.length": "ๆขๅญใฎ้ทใ",
"modal.display.edit.after.length": "ๅคๆดใฎ้ทใ",
- "modal.display.edit.corner.valley": "ใณใผใใผใปใดใผใซใฑใผใน",
+ "modal.display.edit.corner.valley": "้
ยท่ฐทใฎๅ ดๅ",
"modal.display.edit.input.slope": "ๅพใใๅ
ฅๅใใฆใใ ใใใ",
"modal.display.edit.input.slope.info": "ๅพใ่จญๅฎใใใฆใใๅ ดๅใๅ
ฅๅใใๆฐๅคใซๅพใ่จ็ฎใใใๆฐๅคใ่กจ็คบใใใพใใ",
"modal.distance": "่ท้ขๆธฌๅฎ",
@@ -466,7 +466,7 @@
"common.message.confirm.confirm": "ๆฟ่ชใใพใใ?",
"common.message.confirm.request": "ๆฟ่ชใใชใฏใจในใใใพใใ?",
"common.message.confirm.delete": "ๅ้คใใพใใ?",
- "common.message.confirm.close": "้ใใใ๏ผ",
+ "common.message.confirm.close": "้ใใพใใ๏ผ",
"common.message.confirm.unclose": "ใฏใญใผใบใใญใฃใณใปใซใใพใใ?",
"common.message.confirm.cancel": "ใญใฃใณใปใซใใพใใ๏ผ",
"common.message.confirm.uncancel": "ใญใฃใณใปใซใใญใฃใณใปใซใใพใใ๏ผ",
@@ -497,7 +497,7 @@
"common.message.approved ": "ๆฟ่ชใใใพใใใ",
"common.message.errorFieldExist": "ใจใฉใผใใฃใผใซใใๅญๅจใใพใ",
"common.message.storeIdExist ": "ใใงใซไฝฟ็จใใฆใใ่ฒฉๅฃฒๅบIDใงใใ",
- "common.message.userIdExist ": "ใใงใซไฝฟ็จใใฆใใใฆใผใถใผIDใ",
+ "common.message.userIdExist ": "ใใงใซไฝฟ็จใใฆใใใฆใผใถใผIDใงใใ",
"common.message.noExists ": "ๅ้คใใใๆ็จฟใงใใ",
"common.message.emailReqTo": "Email To is required",
"common.message.downloadPeriod": "Please select the download search period within {0} days.",
@@ -506,9 +506,9 @@
"common.message.writeToConfirm": "ไฝๆ่งฃ้คใๅฎ่กใใพใใ๏ผ",
"common.message.password.init.success": "ใในใฏใผใ[{0}]ใซๅๆๅใใใพใใใ",
"common.message.no.edit.save": "ใใฎใใญใฅใกใณใใฏๅคๆดใงใใพใใใ",
- "common.load": "่ชญใฟ่พผใ",
+ "common.load": "่ชญ่พผ",
"common.input.file": "ใใกใคใซใ่ชญใฟ่พผใ",
- "common.input.file.load": "่ชญใฟ่พผใ",
+ "common.input.file.load": "่ชญ่พผ",
"common.input.image.load": "็ปๅใ่ชญใฟ่พผใ",
"common.input.address.load": "ใขใใฌในใ่ชญใฟ่พผใ",
"common.require": "ๅฟ
้ ",
@@ -534,7 +534,7 @@
"color.pink": "ใใณใฏ",
"color.gold": "้ป้่ฒ",
"color.darkblue": "่่ฒ",
- "site.name": "Q.CAST III",
+ "site.name": "HANASYS่จญ่จ",
"site.sub_name": "ๅคช้ฝๅ
็บ้ปใทในใใ ๅณ้ข็ฎก็ใตใคใ",
"site.header.link1": "้ธๆใใฆใใ ใใใ",
"site.header.link2": "ใชใณใฉใคใณไฟ่จผใทในใใ ",
@@ -542,7 +542,7 @@
"board.notice.sub.title": "ใ็ฅใใไธ่ฆง",
"board.faq.title": "FAQ",
"board.faq.sub.title": "FAQใชในใ",
- "board.archive.title": "็ด ๆใฎใใฆใณใญใผใ",
+ "board.archive.title": "่ณๆใฎใใฆใณใญใผใ",
"board.archive.sub.title": "ๆๆธไธ่ฆง",
"board.list.header.rownum": "็ชๅท",
"board.list.header.title": "ใฟใคใใซ",
@@ -554,7 +554,7 @@
"board.sub.fileList": "ๆทปไปใใกใคใซไธ่ฆง",
"board.sub.updDt": "ๆดๆฐ",
"board.sub.btn.close": "้ใใ",
- "myinfo.title": "็งใฎๆ
ๅ ฑ",
+ "myinfo.title": "็คพๅกๆ
ๅ ฑ",
"myinfo.info.userId": "ใฆใผใถใผID",
"myinfo.info.nameKana": "ๆ
ๅฝ่
ๅๆฅๆฌ่ช",
"myinfo.info.name": "ๆ
ๅฝ่
ๅ",
@@ -578,7 +578,7 @@
"myinfo.message.password.error": "ใในใฏใผใใ้้ใฃใฆใใพใใ",
"login": "ใญใฐใคใณ",
"login.auto.page.text": "่ชๅใญใฐใคใณไธญใงใใ",
- "login.id.save": "IDใปใผใ",
+ "login.id.save": "IDไฟๅญ",
"login.id.placeholder": "IDใๅ
ฅๅใใฆใใ ใใใ",
"login.password.placeholder": "ใในใฏใผใใๅ
ฅๅใใฆใใ ใใใ",
"login.guide.text": "ๅฝใตใคใใใๅฉ็จใฎ้ใฏไบๅ็ณ่ซใๅฟ
่ฆใงใใ",
@@ -592,11 +592,11 @@
"login.init_password.complete_message": "ใในใฏใผใใๅๆๅใใใพใใใๅๆๅใใใใในใฏใผใใฏIDใจๅใใงใใ",
"login.init_password.id.placeholder": "IDใๅ
ฅๅใใฆใใ ใใใ",
"login.init_password.email.placeholder": "ใกใผใซใๅ
ฅๅใใฆใใ ใใใ",
- "join.title": "Q.CAST3 ใญใฐใคใณID็บ่ก็ณ่ซ",
+ "join.title": "HANASYS่จญ่จใญใฐใคใณID็บ่ก็ณ่ซ",
"join.sub1.title": "่ฒฉๅฃฒไปฃ็ๅบๆ
ๅ ฑ",
- "join.sub1.comment": "โป็ป้ฒใใใใชใปใฉใผใฎไผ็คพๅใๅ
ฅๅใใฆใใ ใใใ ๏ผ2ๆฌกๅบใฏใโโ่ฒฉๅฃฒๆ ชๅผไผ็คพ๏ผ2ๆฌกๅบ๏ผรร่จญๅๆ ชๅผไผ็คพ๏ผใใงใ่จๅ
ฅใใ ใใใ๏ผ",
+ "join.sub1.comment": "โป็ป้ฒใใใ่ฒฉๅฃฒๅบใฎไผ็คพๅใๅ
ฅๅใใฆใใ ใใใ ๏ผ2ๆฌกๅบใฏใโโ่ฒฉๅฃฒๆ ชๅผไผ็คพ๏ผ2ๆฌกๅบ๏ผรร่จญๅๆ ชๅผไผ็คพ๏ผใใงใ่จๅ
ฅใใ ใใใ๏ผ",
"join.sub1.storeQcastNm": "่ฒฉๅฃฒไปฃ็ๅบๅ",
- "join.sub1.storeQcastNm_placeholder": "ๆ ชๅผไผ็คพใจใใซใฎใผใฎใขใฝใชใฅใผใทใงใณใขใณใตใผใใน(2ๆฌก็น๏ผๅฑฑๅฃๅจๆ่ฒฉๅฃฒๆ้ๅ
ฌๅธ๏ผ",
+ "join.sub1.storeQcastNm_placeholder": "ๆ ชๅผไผ็คพใจใใซใฎใผใฎใขใฝใชใฅใผใทใงใณใขใณใตใผใใน(2ๆฌก็น๏ผๅฑฑๅฃๅจๆ่ฒฉๅฃฒๆ้ไผ็คพ๏ผ",
"join.sub1.storeQcastNmKana": "่ฒฉๅฃฒไปฃ็ๅบๅใใชใฌใ",
"join.sub1.storeQcastNmKana_placeholder": "ๆ ชๅผไผ็คพใจใใซใฎใผใฎใขใฝใชใฅใผใทใงใณ",
"join.sub1.postCd": "้ตไพฟ็ชๅท",
@@ -611,7 +611,7 @@
"join.sub2.title": "ๆ
ๅฝ่
ๆ
ๅ ฑ",
"join.sub2.userNm": "ๆ
ๅฝ่
ๅ",
"join.sub2.userNmKana": "ๆ
ๅฝ่
ๅใตใใใช",
- "join.sub2.userId": "ใขใใชใฑใผใทใงใณID",
+ "join.sub2.userId": "็ณ่ซID",
"join.sub2.email": "ใกใผใซใขใใฌใน",
"join.sub2.telNo": "้ป่ฉฑ็ชๅท",
"join.sub2.telNo_placeholder": "00-0000-0000",
@@ -620,18 +620,18 @@
"join.sub2.category": "้จ็ฝฒๅ",
"join.btn.login_page": "ใญใฐใคใณ็ป้ขใซ็งปๅ",
"join.btn.approval_request": "IDๆฟ่ช่ฆๆฑ",
- "join.complete.title": "Q.CAST3ใญใฐใคใณID็บ่ก็ณ่ซๅฎไบ",
+ "join.complete.title": "HANASYS่จญ่จใญใฐใคใณID็บ่ก็ณ่ซๅฎไบ",
"join.complete.contents": "โป็ณ่ซใใIDใๆฟ่ชใใใใจใๆ
ๅฝ่
ๆ
ๅ ฑใซๅ
ฅๅใใEใกใผใซใขใใฌในใซใญใฐใคใณ้ข้ฃๆกๅ
ใกใผใซใ้ไฟกใใใพใใ",
"join.complete.email_comment": "ๆ
ๅฝ่
ใฎใกใผใซใขใใฌใน",
"join.validation.check1": "{0}ๅฝขๅผใ็ขบ่ชใใฆใใ ใใใ",
- "join.complete.save.confirm": "Hanwha Japanใฎๆ
ๅฝ่
ใซIDๆฟ่ชใ่ฆๆฑใใใๅ ดๅใใใไปฅไธๆ
ๅ ฑใไฟฎๆญฃใใใใจใฏใงใใพใใใๆฌๅฝใซใ้กใใใพใใ๏ผ",
+ "join.complete.save.confirm": "ใใณใใกใธใฃใใณใฎๆ
ๅฝ่
ใซIDๆฟ่ชใ่ฆๆฑใใใๅ ดๅใใใไปฅไธๆ
ๅ ฑใไฟฎๆญฃใใใใจใฏใงใใพใใใ็ณ่ซใใพใใ๏ผ",
"stuff.gridHeader.lastEditDatetime": "ๆดๆฐๆฅๆ",
- "stuff.gridHeader.objectNo": "ๅ็ช",
+ "stuff.gridHeader.objectNo": "็ฉไปถ็ชๅท",
"stuff.gridHeader.planTotCnt": "ใใฉใณๆฐ",
"stuff.gridHeader.objectName": "ๅๅๅ",
"stuff.gridHeader.saleStoreId": "ไปฃ็ๅบID",
"stuff.gridHeader.saleStoreName": "ไปฃ็ๅบๅ",
- "stuff.gridHeader.address": "ๅๅใขใใฌใน",
+ "stuff.gridHeader.address": "็ฉไปถไฝๆ",
"stuff.gridHeader.dispCompanyName": "่ฆ็ฉใใ",
"stuff.gridHeader.receiveUser": "ๆ
ๅฝ่
",
"stuff.gridHeader.specificationConfirmDate": "ไปๆง็ขบ่ชๆฅ",
@@ -651,9 +651,9 @@
"stuff.temp.subTitle": "ๅๅๆ
ๅ ฑ",
"stuff.temp.subTitle2": "ไฝๅณ",
"stuff.detail.header.notExistObjectNo": "ๅญๅจใใชใใใฎใงใใ",
- "stuff.detail.header.successCopy": "ๅๅ็ชๅทใใณใใผใใใพใใใ",
- "stuff.detail.header.failCopy": "ๅๅ็ชๅทใฎใณใใผใซๅคฑๆใใพใใใ",
- "stuff.detail.header.objectNo": "ๅ็ช",
+ "stuff.detail.header.successCopy": "็ฉไปถ็ชๅทใใณใใผใใใพใใใ",
+ "stuff.detail.header.failCopy": "็ฉไปถ็ชๅทใฎใณใใผใซๅคฑๆใใพใใใ",
+ "stuff.detail.header.objectNo": "็ฉไปถ็ชๅท",
"stuff.detail.header.specificationConfirmDate": "ไปๆง็ขบ่ชๆฅ",
"stuff.detail.header.lastEditDatetime": "ๆดๆฐๆฅๆ",
"stuff.detail.header.createDatetime": "็ป้ฒๆฅ",
@@ -662,9 +662,9 @@
"stuff.detail.receiveUser": "ๆ
ๅฝ่
",
"stuff.detail.objectStatusId": "็ฉๅๅบๅ/็ฉไปถๅ",
"stuff.detail.objectStatus0": "ๆฐ็ฏ",
- "stuff.detail.objectStatus1": "ๅบ่ปธ",
+ "stuff.detail.objectStatus1": "ๆข็ฏ",
"stuff.detail.objectNameOmit": "ๆฌ็งฐ",
- "stuff.detail.objectNameKana": "็ฉๅใใชใฌใ",
+ "stuff.detail.objectNameKana": "ใใชใฌใ",
"stuff.detail.saleStoreId": "ไธๆฌก่ฒฉๅฃฒๅบๅ/ID",
"stuff.detail.otherSaleStoreId": "ไบๆฌก่ฒฉๅฃฒๅบๅ/ID",
"stuff.detail.zipNo": "้ตไพฟ็ชๅท",
@@ -676,9 +676,9 @@
"stuff.detail.standardWindSpeedId": "ๅบๆบ้ขจ้",
"stuff.detail.standardWindSpeedIdSpan": "m/sไปฅไธ",
"stuff.detail.btn.windSpeedPop": "้ขจ้้ธๆ",
- "stuff.detail.verticalSnowCover": "ๅ็ด่ชฌ่ชฌ",
+ "stuff.detail.verticalSnowCover": "ๅ็ด็ฉ้ช้",
"stuff.detail.coldRegionFlg": "ๅฏๅทๅฐๅฏพ็ญๆฝ่ก",
- "stuff.detail.surfaceType": "็ถฟ่ชฟ้",
+ "stuff.detail.surfaceType": "้ข็ฒๅบฆ",
"stuff.detail.saltAreaFlg": "ๅกฉๅฎณๅฐๅ็จใขใคใใ ใฎไฝฟ็จ",
"stuff.detail.installHeight": "่จญ็ฝฎ้ซใ",
"stuff.detail.conType": "ๅฅ็ดๆกไปถ",
@@ -687,7 +687,7 @@
"stuff.detail.remarks": "ใกใข",
"stuff.detail.tooltip.saleStoreId": "่ฒฉๅฃฒไปฃ็ๅบใพใใฏ่ฒฉๅฃฒไปฃ็ๅบIDใ1ๆๅญไปฅไธๅ
ฅๅใใฆใใ ใใ",
"stuff.detail.tooltip.surfaceType": "ๅกฉๅฎณๅฐๅใฎๅฎ็พฉใฏๅใกใผใซใผใฎ่จญ็ฝฎใใใฅใขใซใใ็ขบ่ชใใ ใใ",
- "stuff.detail.tempSave.message1": "ไธๆไฟๅญใใใพใใใๅๅ็ชๅทใๅๅพใใใซใฏใๅฟ
้ ้
็ฎใใในใฆๅ
ฅๅใใฆใใ ใใใ",
+ "stuff.detail.tempSave.message1": "ไธๆไฟๅญใใใพใใใ็ฉไปถ็ชๅทใๅๅพใใใซใฏใๅฟ
้ ้
็ฎใใในใฆๅ
ฅๅใใฆใใ ใใใ",
"stuff.detail.tempSave.message2": "ๆ
ๅฝ่
ๅใฏ10ๆกไปฅไธใงๅ
ฅๅใใฆใใ ใใใ",
"stuff.detail.tempSave.message3": "ไบๆฌก่ฒฉๅฃฒๅบใ้ธๆใใฆใใ ใใใ",
"stuff.detail.confirm.message1": "่ฒฉๅฃฒๅบๆ
ๅ ฑใๅคๆดใใใจใ่จญ่จไพ้ ผๆๆธ็ชๅทใๅ้คใใใพใใๅคๆดใใพใใ๏ผ",
@@ -695,7 +695,7 @@
"stuff.detail.planList.title": "ใใฉใณใชในใ",
"stuff.detail.planList.cnt": "ๅ
จไฝ",
"stuff.detail.planList.help": "ใใซใ",
- "stuff.detail.planList.guide1": "1.็บๆณจใฏๅไธๅ็ชๅบๆบ1ไปถใฎใฟๅฏ่ฝใงใใ",
+ "stuff.detail.planList.guide1": "1.็บๆณจใฏๅไธ็ฉไปถ็ชๅทๅบๆบ1ไปถใฎใฟๅฏ่ฝใงใใ",
"stuff.detail.planList.guide2": "2. [Excelใใฆใณใญใผใ]ใฏ่ฆ็ฉๆธๅณ้ขใทใใฅใฌใผใทใงใณ็ตๆใExcelใใกใคใซใจใใฆไธๅบฆใซใใฆใณใญใผใใใพใใ",
"stuff.detail.planList.guide3": "3. ใใฉใณๆ
ๅ ฑใใใใซใฏใชใใฏใใใจๅณ้ขไฝๆ็ป้ขใซ็งปๅใใพใใ",
"stuff.detail.btn.delete": "็ฉใฎๅ้ค",
@@ -705,7 +705,7 @@
"stuff.detail.save": "ไฟๅญใใพใใ",
"stuff.detail.tempSave": "ไธๆไฟๅญใใใพใใ",
"stuff.detail.noChgData": "ๅคๆดๅ
ๅฎนใฏใใใพใใ",
- "stuff.detail.save.valierror1": "ๅ็ด่ชฌ่ชฌใฏ0ใใๅคงใใๅคใๅ
ฅๅใใฆใใ ใใ",
+ "stuff.detail.save.valierror1": "ๅ็ด็ฉ้ช้ใฏ0ใใๅคงใใๅคใๅ
ฅๅใใฆใใ ใใ",
"stuff.detail.save.valierror2": "่จญ็ฝฎ้ซใ0ใใๅคงใใๅคใๅ
ฅๅใใฆใใ ใใ",
"stuff.detail.save.valierror3": "{0} ๅฟ
้ ๅ
ฅๅ้
็ฎใงใใ",
"stuff.detail.save.valierror4": "ไบๆฌก่ฒฉๅฃฒๅบๅใฏๅฟ
้ ใชใใทใงใณใงใใ",
@@ -739,7 +739,7 @@
"stuff.search.btn.register": "ๆฐ่ฆ็ฉไปถ็ป้ฒ",
"stuff.search.btn.search": "็
งไผ",
"stuff.search.btn.reset": "ๅๆๅ",
- "stuff.search.schObjectNo": "ๅ็ช",
+ "stuff.search.schObjectNo": "็ฉไปถ็ชๅท",
"stuff.search.schSaleStoreName": "่ฒฉๅฃฒไปฃ็ๅบๅ",
"stuff.search.schAddress": "ๅๅใขใใฌใน",
"stuff.search.schObjectName": "ๅๅๅ",
@@ -784,7 +784,7 @@
"output": "ๅบๅ",
"slope": "ๅพๆ",
"eaves.offset": "่ปใฎๅน
",
- "gable.offset": "ใฑใฉใๅบ็",
+ "gable.offset": "ใฑใฉใ",
"offset": "ๅบๅน
",
"width": "ๅน
",
"size": "ๅฏธๆณ",
@@ -794,9 +794,9 @@
"gable": "ใฑใฉใ",
"gable.left": "ใฑใฉใๅทฆ",
"gable.right": "ใฑใฉใๅณ",
- "ridge": "้พไธธ",
- "oneside.flow.ridge": "็ๅดใฎๆตใ",
- "yosemune": "ใจใปใ ใ",
+ "ridge": "ๆฃ",
+ "oneside.flow.ridge": "็ๆตใใฎๆฃๅด",
+ "yosemune": "ๅฏๆฃ",
"valley": "่ฐท",
"l.abandon.valley": "Lใฎๆจใฆๆธ่ฐท",
"mansard": "ใกใณใตใผใ",
@@ -807,30 +807,30 @@
"wall.merge.flow.left": "ๅฃๅใ๏ผๆตใๅทฆ๏ผ",
"wall.merge.flow.right": "ๅฃๅใ๏ผๆตใๅณ๏ผ",
"no.setting": "่จญๅฎใชใ",
- "hajebichi": "ใใผใใผใ",
+ "hajebichi": "ใใผใใใ",
"straight.line": "็ด็ท",
"right.angle": "็ด่ง",
- "double.pitch": "ใคใปใฐใ",
+ "double.pitch": "็ฐๅพ้
",
"angle": "่งๅบฆ",
"diagonal": "ๅฏพ่ง็ท",
- "hipandgable": "ๅ
ซไฝๅฑๆ น",
- "hipandgable.width": "ๅ
ซไฝๅฑๆ นใฎๅน
",
- "jerkinhead": "ๅๆ",
+ "hipandgable": "ๅ
ฅๆฏๅฑ้ ",
+ "hipandgable.width": "ๅ
ฅๆฏๅฑ้ ใฎๅน
",
+ "jerkinhead": "ๅๅๅฆป",
"shed": "็ๅดใฎๆตใ",
"apply": "้ฉ็จ",
"module": "ใขใธใฅใผใซ",
"legend": "ๅกไพ",
"has.sleeve": "่ขใใ",
"has.not.sleeve": "่ขใชใ",
- "jerkinhead.width": "ๅๆๅ
ๅน
",
- "jerkinhead.slope": "ๅๆๅ
ๅพๆ",
+ "jerkinhead.width": "ๅๅๅฆปๅน
",
+ "jerkinhead.slope": "ๅๅๅฆปๅพๆ",
"shed.width": "็ๆตๅน
",
- "windage": "ๆผๆต",
- "windage.width": "ๆผๆตใฎๅบๅน
",
+ "windage": "็ๆตใ",
+ "windage.width": "็ๆตใใฎๅบๅน
",
"write": "ไฝๆ",
"main.storeId": "่ฒฉๅฃฒๅบID",
"main.storeName": "่ฒฉๅฃฒๅบๅ",
- "main.objectNo": "ๅ็ช",
+ "main.objectNo": "็ฉไปถ็ชๅท",
"main.faq": "FAQ",
"main.content.objectList.noData1": "็ป้ฒใใใๅๅๆ
ๅ ฑใฏใใใพใใใ",
"main.content.objectList.noData2": "ไธใฎใใฟใณใใฏใชใใฏใใฆๅๅๆ
ๅ ฑใ็ป้ฒใใฆใใ ใใใ",
@@ -839,7 +839,7 @@
"main.content.download1": "ๆไฝใใใฅใขใซ",
"main.content.download2": "ๅฑๆ นใฎ่ชฌๆๆธ",
"main.content.noBusiness": "Hanwha Japanใซใๅใๅใใใใ ใใ",
- "main.content.alert.noFile": "่ณๆใๆบๅไธญใงใ",
+ "main.content.alert.noFile": "่ณๆๆบๅไธญใงใ",
"main.popup.login.popupTitle": "ใในใฏใผใๅคๆด",
"main.popup.login.newPassword1": "ๆฐใใใในใฏใผใใๅ
ฅๅ",
"main.popup.login.newPassword2": "ๆฐใใใในใฏใผใใฎๅๅ
ฅๅ",
@@ -860,7 +860,7 @@
"surface.shape.validate.size.3to4": "โข้ทใใฏโฃใใๅคงใใๅคใๅ
ฅใใฆใใ ใใใ",
"surface.shape.validate.size.4to5": "โฃ้ทใใฏโคใใๅคงใใๅคใๅ
ฅใใฆใใ ใใใ",
"estimate.detail.header.title": "ๅบๆฌๆ
ๅ ฑ",
- "estimate.detail.objectNo": "ๅ็ช",
+ "estimate.detail.objectNo": "็ฉไปถ็ชๅท",
"estimate.detail.docNo": "่ฆ็ฉๆธ็ชๅท",
"estimate.detail.drawingEstimateCreateDate": "็ป้ฒๆฅ",
"estimate.detail.lastEditDatetime": "ๅคๆดๆฅๆ",
@@ -877,7 +877,6 @@
"estimate.detail.roofCns": "ๅฑๆ นๆใปไปๆงๆฝๅทฅ",
"estimate.detail.remarks": "ๅ่",
"estimate.detail.fileFlg": "ๅพๆฅ่ณๆๆๅบ",
- "estimate.detail.dragFileGuide": "(โปๅ้ข่จญ็ฝฎใฎๅ ดๅใใใกใคใซๆทปไปใๅฟ
้ ใงใ.)",
"estimate.detail.header.fileList1": "ใใกใคใซๆทปไป",
"estimate.detail.fileList.btn": "ใใกใคใซ้ธๆ",
"estimate.detail.fileList.extCheck": "็ปๅใใกใคใซใฎใฟๆทปไปๅฏ่ฝใงใใ",
@@ -905,17 +904,17 @@
"estimate.detail.showPrice.delItem": "่ฃฝๅใฎๅ้ค",
"estimate.detail.itemTableHeader.dispOrder": "No.",
"estimate.detail.itemTableHeader.itemId": "ๅ็ช",
- "estimate.detail.itemTableHeader.itemNo": "ๅ
ๅผ",
+ "estimate.detail.itemTableHeader.itemNo": "ๅๅ",
"estimate.detail.itemTableHeader.amount": "ๆฐ้",
"estimate.detail.itemTableHeader.unit": "ๅไฝ",
"estimate.detail.itemTableHeader.salePrice": "ๅไพก",
- "estimate.detail.itemTableHeader.saleTotPrice": "้้ก๏ผ็จๅฅๅฅ๏ผ",
- "estimate.detail.docPopup.title": "ใใญใฅใกใณใใใฆใณใญใผใใชใใทใงใณใฎ่จญๅฎ",
+ "estimate.detail.itemTableHeader.saleTotPrice": "้้ก๏ผ็จๅฅ๏ผ",
+ "estimate.detail.docPopup.title": "ๆ็ซ ใใฆใณใญใผใใชใใทใงใณใฎ่จญๅฎ",
"estimate.detail.docPopup.explane": "ใใฆใณใญใผใใใๆๆธใชใใทใงใณใ้ธๆใใ[ๆๆธใฎใใฆใณใญใผใ]ใใฟใณใใฏใชใใฏใใพใใ",
"estimate.detail.docPopup.schUnitPriceFlg": "ใใฆใณใญใผใใใกใคใซ",
- "estimate.detail.docPopup.schUnitPriceFlg.excelFlg0": "่ฆ็ฉใใExcel",
+ "estimate.detail.docPopup.schUnitPriceFlg.excelFlg0": "ไปๅ็จExcel",
"estimate.detail.docPopup.schUnitPriceFlg.excelFlg1": "ๅฎไพก็จExcel",
- "estimate.detail.docPopup.schUnitPriceFlg.pdfFlg0": "่ฆ็ฉใใPDF",
+ "estimate.detail.docPopup.schUnitPriceFlg.pdfFlg0": "ไปๅ็จPDF",
"estimate.detail.docPopup.schUnitPriceFlg.pdfFlg1": "ๅฎไพก็จPDF",
"estimate.detail.docPopup.schDisplayFlg": "่ฆ็ฉๆๅบๆธใฎ่กจ็คบๅ",
"estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0": "่ฒฉๅฃฒๅบๅ",
@@ -928,13 +927,13 @@
"estimate.detail.docPopup.schDrawingFlg.schDrawingFlg0": "ๅซใพใชใ",
"estimate.detail.docPopup.close": "้ใใ",
"estimate.detail.docPopup.docDownload": "ๆๆธใฎใใฆใณใญใผใ",
- "estimate.detail.estimateCopyPopup.title": "่ฆ็ฉใใ",
+ "estimate.detail.estimateCopyPopup.title": "่ฆ็ฉใณใใผ",
"estimate.detail.estimateCopyPopup.explane": "่ฆ็ฉๆธใใณใใผใใ่ฒฉๅฃฒๅบใ่จญๅฎใใพใใ่ฆ็ฉๆธใฏๅฎไพกใงใณใใผใใใพใใ",
"estimate.detail.estimateCopyPopup.label.saleStoreId": "ไธๆฌก่ฒฉๅฃฒๅบๅ/ID",
"estimate.detail.estimateCopyPopup.label.otherSaleStoreId": "ไบๆฌก่ฒฉๅฃฒๅบๅ/ID",
"estimate.detail.estimateCopyPopup.label.receiveUser": "ๆ
ๅฝ่
",
"estimate.detail.estimateCopyPopup.close": "้ใใ",
- "estimate.detail.estimateCopyPopup.copyBtn": "่ฆ็ฉใใ",
+ "estimate.detail.estimateCopyPopup.copyBtn": "่ฆ็ฉใณใใผ",
"estimate.detail.estimateCopyPopup.copy.alertMessage": "่ฆ็ฉๆธใใณใใผใใใพใใใใณใใผใใๅๅๆ
ๅ ฑใซ็งปๅใใพใใ",
"estimate.detail.productFeaturesPopup.title": "่ฃฝๅ็น็ฐไบ้
",
"estimate.detail.productFeaturesPopup.close": "้ใใ",
@@ -943,7 +942,6 @@
"estimate.detail.save.alertMsg": "ไฟๅญใใใพใใใ่ฆ็ฉๆธใง่ฃฝๅใๅคๆดใใใจใๅณ้ขใๅ่ทฏใซใฏๅๆ ใใใพใใใ",
"estimate.detail.copy.alertMsg": "ใณใใผใใใพใใใ",
"estimate.detail.save.requiredFileUpload": "ใใกใคใซๆทปไปใๅฟ
้ ใฎใขใคใใ ใใใใพใใใใกใคใซใๆทปไปใใใใๅพๆฅๆทปไปใใใงใใฏใใฆใใ ใใใ",
- "estimate.detail.save.requiredNorthArrangementFileUpload": "ๅ้ขใซใขใธใฅใผใซใ้
็ฝฎใใๅ ดๅใๅ้ข้
็ฝฎ่จฑๅฏๆธใๅฟ
ใๆทปไปใใๅฟ
่ฆใใใใพใ.",
"estimate.detail.save.requiredItem": "่ฃฝๅใฏ1ใคไปฅไธ็ป้ฒใใๅฟ
่ฆใใใใพใใ",
"estimate.detail.save.requiredCharger": "ๆ
ๅฝ่
ใฏๅฟ
้ ใงใใ",
"estimate.detail.save.requiredObjectName": "ๆกไปถๅใฏๅฟ
้ ใงใใ",
@@ -953,14 +951,14 @@
"estimate.detail.save.requiredAmount": "ๆฐ้ใฏ0ใใๅคงใใๅคใๅ
ฅๅใใฆใใ ใใใ",
"estimate.detail.save.requiredSalePrice": "ๅไพกใฏ0ใใๅคงใใๅคใๅ
ฅๅใใฆใใ ใใใ",
"estimate.detail.reset.alertMsg": "ๅๆๅใใใพใใใ",
- "estimate.detail.reset.confirmMsg": "ๆๆธใๅคๆด๏ผไฟๅญ๏ผใใ่ฆ็ฉๆ
ๅ ฑใๅๆๅใใใๆ่ฟไฟๅญใใใๅณ้ขๆ
ๅ ฑใๅๆ ใใใพใใๆฌๅฝใซๅๆๅใใพใใ๏ผ",
+ "estimate.detail.reset.confirmMsg": "ไฟๅญใใ่ฆ็ฉๆ
ๅ ฑใๅๆๅใใใๆ่ฟไฟๅญใใใๅณ้ขๆ
ๅ ฑใๅๆ ใใใพใใๆฌๅฝใซๅๆๅใใพใใ๏ผ",
"estimate.detail.lock.alertMsg": "่ฆ็ฉใใใ[ใญใใฏ]ใใใจๅคๆดใงใใพใใใ
่ฆ็ฉใใใไฟฎๆญฃใใใซใฏใใญใใฏใ่งฃ้คใใฆใใ ใใใ",
"estimate.detail.unlock.alertMsg": "[ใญใใฏ่งฃ้ค]ใใใจใ่ฆ็ฉๆธใ็ทจ้ใงใใพใใ
่งฃ้คใใพใใ๏ผ",
"estimate.detail.unlock.confirmBtnName": "่งฃๆพ",
"estimate.detail.alert.delFile": "ๆทปไปใใกใคใซใๅฎๅ
จใซๅ้คใใใซใฏใ[ไฟๅญ]ใใฟใณใใฏใชใใฏใใฆใใ ใใใ",
"estimate.detail.alert.selectDelItem": "ๅ้คใใๅๅใ้ธๆใใฆใใ ใใใ",
"estimate.menu.move.valid1": "ๅ่ทฏใๅๅฒใใฆใใชใใใใ่ฆ็ฉใใใๅผใณๅบใใใจใฏใงใใพใใใ",
- "simulator.title.sub1": "ๅ็ช",
+ "simulator.title.sub1": "็ฉไปถ็ชๅท",
"simulator.title.sub2": "ไฝๆๆฅ",
"simulator.title.sub3": "ใทในใใ ๅฎน้",
"simulator.title.sub4": "ๅนด้ไบๆธฌ็บ้ป้",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 7249b0f5..507f5415 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -50,8 +50,8 @@
"modal.movement.flow.line.updown.up": "์๋ฆฟ์๋ฅผ ์ฌ๋ฆฌ๋ค",
"modal.movement.flow.line.updown.down": "์๋ฆฟ์๋ฅผ ๋ฎ์ถ๋ค",
"modal.movement.flow.line.info": "๋์ ์ ์ ํํ๊ณ ์ด๋ ํญ์ ์ง์ ํ์ญ์์ค",
- "modal.movement.flow.line.bottom.left": "๋์ด ๋ณ๊ฒฝ: ์๋, ์ผ์ชฝ",
- "modal.movement.flow.line.top.right": "๋์ด ๋ณ๊ฒฝ: ์, ์ค๋ฅธ์ชฝ",
+ "modal.movement.flow.line.bottom.left": "๋์ด๋ณ๊ฒฝ : ์๋, ์ผ์ชฝ",
+ "modal.movement.flow.line.top.right": "๋์ด๋ณ๊ฒฝ : ์, ์ค๋ฅธ์ชฝ",
"plan.menu.roof.cover.outline.edit.offset": "์ธ๋ฒฝ์ ํธ์ง ๋ฐ ์คํ์
",
"plan.menu.roof.cover.roof.surface.alloc": "์ง๋ถ๋ฉด ํ ๋น",
"plan.menu.roof.cover.roof.shape.edit": "์ง๋ถํ์ ํธ์ง",
@@ -84,13 +84,13 @@
"plan.menu.placement.surface.arrangement": "๋ฉดํ์ ๋ฐฐ์น",
"plan.menu.placement.surface.object": "์ค๋ธ์ ํธ ๋ฐฐ์น",
"plan.menu.placement.surface.all.remove": "๋ฐฐ์น๋ฉด ์ ์ฒด ์ญ์ ",
- "plan.menu.module.circuit.setting": "๋ชจ๋ยทํ๋ก ๊ตฌ์ฑ",
- "plan.menu.module.circuit.setting.default": "๋ชจ๋ยท๊ฐ๋์ค์ ",
+ "plan.menu.module.circuit.setting": "๋ชจ๋, ํ๋ก ๊ตฌ์ฑ",
+ "plan.menu.module.circuit.setting.default": "๋ชจ๋/๊ฐ๋์ค์ ",
"modal.module.basic.setting.orientation.setting": "๋ฐฉ์ ์ค์ ",
"modal.module.basic.setting.orientation.setting.info": "โป์๋ฎฌ๋ ์ด์
๊ณ์ฐ์ฉ ๋ฐฉ์๋ฅผ ์ง์ ํฉ๋๋ค. ๋จ์ชฝ์ ๋ฐฉ์๋ฅผ ์ค์ ํด์ฃผ์ธ์.",
"modal.module.basic.setting.orientation.setting.angle.passivity": "๊ฐ๋๋ฅผ ์ง์ ์
๋ ฅ",
"modal.module.basic.setting.module.roof.material": "์ง๋ถ์ฌ",
- "modal.module.basic.setting.module.trestle.maker": "๊ฐ๋๋ฉ์ด์ปค",
+ "modal.module.basic.setting.module.trestle.maker": "๊ฐ๋๋ฉ์ด๊ฑฐ",
"modal.module.basic.setting.module.rafter.margin": "์๊น๋ ๊ฐ๊ฒฉ",
"modal.module.basic.setting.module.construction.method": "๊ณต๋ฒ",
"modal.module.basic.setting.module.under.roof": "์ง๋ถ๋ฐ๋ฐํ",
@@ -634,7 +634,7 @@
"stuff.gridHeader.address": "๋ฌผ๊ฑด์ฃผ์",
"stuff.gridHeader.dispCompanyName": "๊ฒฌ์ ์ฒ",
"stuff.gridHeader.receiveUser": "๋ด๋น์",
- "stuff.gridHeader.specificationConfirmDate": "์ฌ์ํ์ ์ผ",
+ "stuff.gridHeader.specificationConfirmDate": "์ฌ์ํ์ธ์ผ",
"stuff.gridHeader.createDatetime": "๋ฑ๋ก์ผ",
"stuff.gridData.tempObjectNo": "์์์ ์ฅ๋ฌผ๊ฑด",
"stuff.message.periodError": "์ต๋1๋
์กฐํ ๊ฐ๋ฅํฉ๋๋ค.",
@@ -877,7 +877,6 @@
"estimate.detail.roofCns": "์ง๋ถ์ฌใป์ฌ์์๊ณต",
"estimate.detail.remarks": "๋น๊ณ ",
"estimate.detail.fileFlg": "ํ์ผ์๋ฃ์ ์ถ",
- "estimate.detail.dragFileGuide": "(โป ๋ถ๋ฉด์ค์น์ธ ๊ฒฝ์ฐ, ํ์ผ ์ฒจ๋ถ๊ฐ ํ์์
๋๋ค.)",
"estimate.detail.header.fileList1": "ํ์ผ์ฒจ๋ถ",
"estimate.detail.fileList.btn": "ํ์ผ์ ํ",
"estimate.detail.fileList.extCheck": "์ด๋ฏธ์ง ํ์ผ๋ง ์ฒจ๋ถ ๊ฐ๋ฅํฉ๋๋ค.",
@@ -943,7 +942,6 @@
"estimate.detail.save.alertMsg": "์ ์ฅ๋์์ต๋๋ค. ๊ฒฌ์ ์์์ ์ ํ์ ๋ณ๊ฒฝํ ๊ฒฝ์ฐ ๋๋ฉด ๋ฐ ํ๋ก์ ๋ฐ์๋์ง ์์ต๋๋ค.",
"estimate.detail.copy.alertMsg": "๋ณต์ฌ๋์์ต๋๋ค.",
"estimate.detail.save.requiredFileUpload": "ํ์ผ์ฒจ๋ถ๊ฐ ํ์์ธ ์์ดํ
์ด ์์ต๋๋ค. ํ์ผ์ ์ฒจ๋ถํ๊ฑฐ๋ ํ์ผ์ฒจ๋ถ๋ฅผ ์ฒดํฌํด์ฃผ์ญ์์ค.",
- "estimate.detail.save.requiredNorthArrangementFileUpload": "๋ถ๋ฉด์ ๋ชจ๋์ ๋ฐฐ์นํ ๊ฒฝ์ฐ, ๋ถ๋ฉด๋ฐฐ์นํ๊ฐ์๋ฅผ ๋ฐ๋์ ์ฒจ๋ถํด์ผ ํฉ๋๋ค.",
"estimate.detail.save.requiredItem": "์ ํ์ 1๊ฐ์ด์ ๋ฑ๋กํด์ผ ๋ฉ๋๋ค.",
"estimate.detail.save.requiredCharger": "๋ด๋น์๋ ํ์๊ฐ ์
๋๋ค.",
"estimate.detail.save.requiredObjectName": "์๊ฑด๋ช
์ ํ์๊ฐ ์
๋๋ค.",
From 3c8dbf634df047ed3e630301c9f3c4347848ab43 Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Wed, 5 Feb 2025 10:23:29 +0900
Subject: [PATCH 050/213] =?UTF-8?q?=EB=B3=B5=EC=8B=9C=EB=8F=84,=20?=
=?UTF-8?q?=EC=8B=A4=EC=B8=A1=EC=B9=98=20=EB=AA=A8=EB=93=88=20=ED=81=AC?=
=?UTF-8?q?=EA=B8=B0=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../floor-plan/modal/basic/BasicSetting.jsx | 2 +-
src/hooks/module/useModuleBasicSetting.js | 36 +++++++++----------
src/hooks/module/useModuleTabContents.js | 2 --
3 files changed, 17 insertions(+), 23 deletions(-)
diff --git a/src/components/floor-plan/modal/basic/BasicSetting.jsx b/src/components/floor-plan/modal/basic/BasicSetting.jsx
index 58cf29b5..51620935 100644
--- a/src/components/floor-plan/modal/basic/BasicSetting.jsx
+++ b/src/components/floor-plan/modal/basic/BasicSetting.jsx
@@ -72,7 +72,7 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
const placementRef = {
isChidori: useRef('false'),
- setupLocation: useRef('center'),
+ setupLocation: useRef('eaves'),
isMaxSetup: useRef('false'),
}
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index bf4d4a86..37101307 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -2,7 +2,7 @@ import { useState } from 'react'
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util'
-import { basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
+import { addedRoofsState, basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils'
import { QPolygon } from '@/components/fabric/QPolygon'
import { moduleSetupSurfaceState, moduleIsSetupState } from '@/store/canvasAtom'
@@ -48,11 +48,9 @@ export function useModuleBasicSetting(tabNum) {
useEffect(() => {
// console.log('basicSetting', basicSetting)
if (canvas) {
- canvas.selection = true
- canvas.selectionFullyContained = true
- // canvas.on('selection:created', (e) => {
- // console.log('selection:created', e.selected)
- // })
+ //๋๋๊ทธ ์ฌ๋ถ
+ // canvas.selection = true
+ // canvas.selectionFullyContained = true
}
}, [])
@@ -191,7 +189,7 @@ export function useModuleBasicSetting(tabNum) {
return
}
- let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : (trestleDetail.eaveIntvl / 10) * -1
+ let offsetLength = canvasSetting.roofSizeSet === '3' ? -90 : (trestleDetail.eaveIntvl / 10) * -1
setSurfaceShapePattern(roof, roofDisplay.column, true) //ํจํด ๋ณ๊ฒฝ
const offsetPoints = offsetPolygon(roof.points, offsetLength) //์์ชฝ offset
//๋ชจ๋์ค์น์์ญ?? ์์ฑ
@@ -401,12 +399,11 @@ export function useModuleBasicSetting(tabNum) {
const moduleHeight = Number(checkedModule[0].shortAxis) / 10
let tmpWidth = flowDirection === 'south' || flowDirection === 'north' ? moduleWidth : moduleHeight
let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
- let { width, height } = calculateVisibleModuleHeight(
- tmpWidth,
- tmpHeight,
- getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch),
- flowDirection,
- ) //๊ฐ๋ ์ ์ฉ
+
+ let { width, height } =
+ canvasSetting.roofSizeSet === '1'
+ ? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
+ : { width: tmpWidth, height: tmpHeight }
const points = [
{ x: mousePoint.x - width / 2, y: mousePoint.y - height / 2 },
@@ -823,17 +820,16 @@ export function useModuleBasicSetting(tabNum) {
: Number(module.longAxis)) / 10
}
- return calculateVisibleModuleHeight(
- tmpWidth,
- tmpHeight,
- getDegreeByChon(moduleSetupSurface.roofMaterial.pitch),
- moduleSetupSurface.flowDirection,
- ) //๊ฐ๋ ์
+ console.log(canvasSetting)
+
+ return canvasSetting.roofSizeSet === '1'
+ ? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.flowDirection)
+ : { width: tmpWidth, height: tmpHeight }
}
const getFlowLines = (moduleSetupSurface, module) => {
let flowLines = {}
- if (canvasSetting.roofSizeSet !== 3) {
+ if (canvasSetting.roofSizeSet !== '3') {
flowLines = {
bottom: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'bottom'),
top: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'top'),
diff --git a/src/hooks/module/useModuleTabContents.js b/src/hooks/module/useModuleTabContents.js
index 63ab7722..2c3e16d4 100644
--- a/src/hooks/module/useModuleTabContents.js
+++ b/src/hooks/module/useModuleTabContents.js
@@ -5,10 +5,8 @@ import { useMasterController } from '@/hooks/common/useMasterController'
import { useCommonCode } from '@/hooks/common/useCommonCode'
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
import { isObjectNotEmpty, isEqualObjects } from '@/util/common-utils'
-import { addedRoofsState } from '@/store/settingAtom'
export function useModuleTabContents({ tabIndex, addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
- const addRoofsArray = useRecoilValue(addedRoofsState)
const globalPitchText = useRecoilValue(pitchTextSelector) //ํผ์น ํ
์คํธ
const { findCommonCode } = useCommonCode()
From c471703e8815f50bd40009662d9447e46cfc1c5b Mon Sep 17 00:00:00 2001
From: Daseul Kim
Date: Wed, 5 Feb 2025 10:33:07 +0900
Subject: [PATCH 051/213] =?UTF-8?q?feat:=20=EA=B2=AC=EC=A0=81=EC=84=9C=20?=
=?UTF-8?q?=EC=A0=80=EC=9E=A5=20=ED=9B=84=20=EA=B2=AC=EC=A0=81=EC=84=9C=20?=
=?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=EB=A1=9C=20=EC=9D=B4=EB=8F=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/useEstimate.js | 17 +++++++++++++----
1 file changed, 13 insertions(+), 4 deletions(-)
diff --git a/src/hooks/useEstimate.js b/src/hooks/useEstimate.js
index 7fa4ff60..7a056c72 100644
--- a/src/hooks/useEstimate.js
+++ b/src/hooks/useEstimate.js
@@ -1,4 +1,5 @@
import { useContext } from 'react'
+import { useRouter } from 'next/navigation'
import { useRecoilValue } from 'recoil'
@@ -10,7 +11,7 @@ import { loginUserStore } from '@/store/commonAtom'
export function useEstimate() {
const { managementStateLoaded } = useContext(GlobalDataContext)
-
+ const router = useRouter()
const loginUserState = useRecoilValue(loginUserStore)
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
@@ -48,9 +49,17 @@ export function useEstimate() {
drawingFlg: drawingFlg,
}
- await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData }).catch((error) => {
- swalFire({ text: error.message, icon: 'error' })
- })
+ await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData })
+ .then(() => {
+ moveEstimate(planNo, objectNo)
+ })
+ .catch((error) => {
+ swalFire({ text: error.message, icon: 'error' })
+ })
+ }
+
+ const moveEstimate = (planNo, objectNo) => {
+ router.push(`/floor-plan/estimate/5?pid=${planNo}&objectNo=${objectNo}`)
}
return {
From d7fb15c2e938e347759f6e7d69fe72d1947a0d58 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 10:46:34 +0900
Subject: [PATCH 052/213] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=20=ED=95=A0?=
=?UTF-8?q?=EB=8B=B9=20=EA=B0=81=EB=8F=84=20=EC=98=A4=EB=A5=98=20=EC=88=98?=
=?UTF-8?q?=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modal/roofAllocation/ContextRoofAllocationSetting.jsx | 3 ++-
.../floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx | 3 ++-
src/hooks/roofcover/useRoofAllocationSetting.js | 1 -
3 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
index 88188887..dde3e468 100644
--- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
@@ -31,6 +31,7 @@ export default function ContextRoofAllocationSetting(props) {
handleSaveContext,
currentRoofList,
handleChangeInput,
+ handleChangePitch,
} = useRoofAllocationSetting(id)
const { findCommonCode } = useCommonCode()
@@ -123,7 +124,7 @@ export default function ContextRoofAllocationSetting(props) {
type="text"
className="input-origin block"
onChange={(e) => {
- handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
+ handleChangePitch(e, index)
}}
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
/>
diff --git a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
index 1d58a93d..7a2519b0 100644
--- a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
@@ -33,6 +33,7 @@ export default function RoofAllocationSetting(props) {
handleChangeLayout,
currentRoofList,
handleChangeInput,
+ handleChangePitch,
} = useRoofAllocationSetting(id)
const pitchText = useRecoilValue(pitchTextSelector)
const { findCommonCode } = useCommonCode()
@@ -125,7 +126,7 @@ export default function RoofAllocationSetting(props) {
type="text"
className="input-origin block"
onChange={(e) => {
- handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
+ handleChangePitch(e, index)
}}
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
/>
diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js
index 6471f644..550ce5f5 100644
--- a/src/hooks/roofcover/useRoofAllocationSetting.js
+++ b/src/hooks/roofcover/useRoofAllocationSetting.js
@@ -341,7 +341,6 @@ export function useRoofAllocationSetting(id) {
const newRoofList = currentRoofList.map((roof, idx) => {
return { ...roof, index: idx, ...basicInfo }
})
- console.log('basicInfo', newRoofList)
setBasicSetting((prev) => {
return {
From 0e006174b013bfa2c7993133eb88d11eac2ec560 Mon Sep 17 00:00:00 2001
From: Daseul Kim
Date: Wed, 5 Feb 2025 11:01:14 +0900
Subject: [PATCH 053/213] =?UTF-8?q?refactor:=20=EA=B2=AC=EC=A0=81=EC=84=9C?=
=?UTF-8?q?=20=EC=A0=80=EC=9E=A5=20=ED=9B=84=20=EC=BA=94=EB=B2=84=EC=8A=A4?=
=?UTF-8?q?=20=EC=A0=80=EC=9E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/useEstimate.js | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/src/hooks/useEstimate.js b/src/hooks/useEstimate.js
index 7a056c72..3d64d66c 100644
--- a/src/hooks/useEstimate.js
+++ b/src/hooks/useEstimate.js
@@ -5,6 +5,7 @@ import { useRecoilValue } from 'recoil'
import { useAxios } from '@/hooks/useAxios'
import { useSwal } from '@/hooks/useSwal'
+import { usePlan } from '@/hooks/usePlan'
import { GlobalDataContext } from '@/app/GlobalDataProvider'
import { currentCanvasPlanState } from '@/store/canvasAtom'
import { loginUserStore } from '@/store/commonAtom'
@@ -15,8 +16,9 @@ export function useEstimate() {
const loginUserState = useRecoilValue(loginUserStore)
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
- const { swalFire } = useSwal()
const { promisePost } = useAxios()
+ const { swalFire } = useSwal()
+ const { saveCanvas } = usePlan()
/**
* ๋๋ฉด ๊ฒฌ์ ์ ์ ์ฅ
@@ -50,7 +52,9 @@ export function useEstimate() {
}
await promisePost({ url: '/api/estimate/save-estimate', data: saveEstimateData })
- .then(() => {
+ .then(async () => {
+ // ๊ฒฌ์ ์ ์ ์ฅ์ด ์๋ฃ๋๋ฉด ์บ๋ฒ์ค ์ ์ฅ ํ ๊ฒฌ์ ์ ํ์ด์ง๋ก ์ด๋
+ await saveCanvas()
moveEstimate(planNo, objectNo)
})
.catch((error) => {
@@ -58,11 +62,15 @@ export function useEstimate() {
})
}
+ /**
+ * ๊ฒฌ์ ์ ํ์ด์ง๋ก ์ด๋
+ */
const moveEstimate = (planNo, objectNo) => {
router.push(`/floor-plan/estimate/5?pid=${planNo}&objectNo=${objectNo}`)
}
return {
saveEstimate,
+ moveEstimate,
}
}
From cdac61a47824aae7fefa41ec07e52938a021cc2c Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 11:21:46 +0900
Subject: [PATCH 054/213] =?UTF-8?q?rackLen=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index fffe27c9..a2634256 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -1021,7 +1021,7 @@ export const useTrestle = () => {
selectable: false,
supFitQty,
supFitIntvlPct,
- rackLen: rackLength,
+ rackLen,
rackYn,
rackRowsCd,
rackId: itemId,
From ae54f4d6a44193d7ebe149b523d9b72ee97bccc2 Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 12:19:35 +0900
Subject: [PATCH 055/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EB=AA=A9=EB=A1=9D=20?=
=?UTF-8?q?2=EC=B0=A8=20=ED=8C=90=EB=A7=A4=EC=A0=90=20=EA=B4=80=EB=A0=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/StuffDetail.jsx | 13 +++----------
src/components/management/StuffSearchCondition.jsx | 11 ++++-------
2 files changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index fe8fea47..8be25f9a 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -411,11 +411,6 @@ export default function StuffDetail() {
if (session?.storeId === 'T01') {
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- // if (session.storeLvl === '1') {
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // } else {
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // }
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
@@ -524,11 +519,6 @@ export default function StuffDetail() {
if (session?.storeId === 'T01') {
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- // if (session.storeLvl === '1') {
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // } else {
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // }
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
get({ url: url }).then((res) => {
@@ -1671,6 +1661,9 @@ export default function StuffDetail() {
)
}
+ console.log('๋ฌผ๊ฑด๋ฑ๋ก๊ณ ํ๋ฉด::', otherSaleStoreList)
+ console.log('๋ฌผ๊ฑด๋ฑ๋ก๊ณ ํ๋ฉด::', otherSaleStoreList.length)
+ //"201X584"
return (
<>
{(editMode === 'NEW' && (
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx
index 5021548d..82b5e42e 100644
--- a/src/components/management/StuffSearchCondition.jsx
+++ b/src/components/management/StuffSearchCondition.jsx
@@ -474,12 +474,6 @@ export default function StuffSearchCondition() {
//T01์ผ๋
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
} else {
- // if (session.storeLvl === '1') {
- // //T01์๋ 1์ฐจ์ ์ผ๋
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // } else {
- // url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
- // }
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
}
@@ -1302,7 +1296,10 @@ export default function StuffSearchCondition() {
onChange={onSelectionChange2}
getOptionLabel={(x) => x.saleStoreName}
getOptionValue={(x) => x.saleStoreId}
- isDisabled={otherSaleStoreList != null && otherSaleStoreList.length === 1 ? true : false}
+ // isDisabled={otherSaleStoreList != null && otherSaleStoreList.length === 1 ? true : false}
+ isDisabled={
+ session?.storeLvl === '1' ? (otherSaleStoreList.length > 0 ? false : true) : otherSaleStoreList.length === 1 ? true : false
+ }
isClearable={true}
value={otherSaleStoreList.filter(function (option) {
return option.saleStoreId === otherSaleStoreId
From ab613bc967a53378f2bc682336a97acb312307f2 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 12:52:09 +0900
Subject: [PATCH 056/213] =?UTF-8?q?=ED=8F=B0=ED=8A=B8=20=EC=95=88=EB=90=98?=
=?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/common/font/FontSetting.jsx | 43 +++++++++++++++++--
.../modal/setting01/SecondOption.jsx | 8 +---
2 files changed, 41 insertions(+), 10 deletions(-)
diff --git a/src/components/common/font/FontSetting.jsx b/src/components/common/font/FontSetting.jsx
index 26d07ea7..ddddefca 100644
--- a/src/components/common/font/FontSetting.jsx
+++ b/src/components/common/font/FontSetting.jsx
@@ -87,25 +87,60 @@ export default function FontSetting(props) {
{getMessage('modal.font')}(F)
- setSelectedFont(e)} />
+ {
+ setSelectedFont(e)
+ }}
+ showKey={'name'}
+ sourceKey={'value'}
+ targetKey={'value'}
+ />
{getMessage('modal.font.style')}(Y)
- setSelectedFontWeight(e)} />
+ {
+ setSelectedFontWeight(e)
+ }}
+ showKey={'name'}
+ targetKey={'id'}
+ sourceKey={'id'}
+ />
{getMessage('modal.font.size')}(S)
- setSelectedFontSize(e)} />
+ setSelectedFontSize(e)}
+ showKey={'name'}
+ sourceKey={'value'}
+ targetKey={'value'}
+ />
{getMessage('modal.font.color')}
- setSelectedFontColor(e)} />
+ {
+ setSelectedFontColor(e)
+ }}
+ />
diff --git a/src/components/floor-plan/modal/setting01/SecondOption.jsx b/src/components/floor-plan/modal/setting01/SecondOption.jsx
index 941c2d3e..f264edb2 100644
--- a/src/components/floor-plan/modal/setting01/SecondOption.jsx
+++ b/src/components/floor-plan/modal/setting01/SecondOption.jsx
@@ -21,6 +21,7 @@ export default function SecondOption(props) {
const flowFont = useRecoilValue(fontSelector('flowText'))
const lengthFont = useRecoilValue(fontSelector('lengthText'))
const circuitNumberTextFont = useRecoilValue(fontSelector('circuitNumberText'))
+ const dimensionLineTextFont = useRecoilValue(fontSelector('dimensionLineText'))
const [dimensionId, setDimensionId] = useState(uuidv4())
const [fontId, setFontId] = useState(uuidv4())
const [planSizeId, setPlanSizeId] = useState(uuidv4())
@@ -103,12 +104,7 @@ export default function SecondOption(props) {
//์น์์ ์ค์
if (!showDimensionLineSettingModal) {
setShowDimensionLineSettingModal(true)
- fontProps.font = {
- fontFamily: '',
- fontWeight: '',
- fontSize: '',
- fontColor: '',
- }
+ fontProps.font = dimensionLineTextFont
addPopup(dimensionId, 2,
, true)
} else {
setShowDimensionLineSettingModal(false)
From 2e402738bf30fce3cb7af136d6458a19d2398089 Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 13:47:02 +0900
Subject: [PATCH 057/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EB=AA=A9=EB=A1=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/StuffSearchCondition.jsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/components/management/StuffSearchCondition.jsx b/src/components/management/StuffSearchCondition.jsx
index 82b5e42e..c5862641 100644
--- a/src/components/management/StuffSearchCondition.jsx
+++ b/src/components/management/StuffSearchCondition.jsx
@@ -87,6 +87,7 @@ export default function StuffSearchCondition() {
}
setIsGlobalLoading(true)
+
if (stuffSearch.code === 'S') {
if (stuffSearch.pageNo !== 1) {
setStuffSearch({
@@ -119,7 +120,7 @@ export default function StuffSearchCondition() {
schAddress: address ? address.trim() : '',
schObjectName: objectName ? objectName.trim() : '',
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
- schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
+ schSelSaleStoreId: '',
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
@@ -209,7 +210,7 @@ export default function StuffSearchCondition() {
schAddress: address ? address.trim() : '',
schObjectName: objectName ? objectName.trim() : '',
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
- schSelSaleStoreId: myDataCheck ? schSelSaleStoreId : otherSaleStoreId ? schSelSaleStoreId : '',
+ schSelSaleStoreId: myDataCheck ? '' : otherSaleStoreId ? '' : '',
schOtherSelSaleStoreId: myDataCheck ? '' : otherSaleStoreId,
schReceiveUser: receiveUser ? receiveUser.trim() : '',
schDateType: dateType,
From 77c9a2b1b300e8ff28782d8e01eb6dea060020bc Mon Sep 17 00:00:00 2001
From: changkyu choi
Date: Wed, 5 Feb 2025 14:01:29 +0900
Subject: [PATCH 058/213] =?UTF-8?q?connList=20null=20=EC=9D=B8=20=EA=B2=BD?=
=?UTF-8?q?=EC=9A=B0=20=EC=B2=98=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../circuitTrestle/CircuitTrestleSetting.jsx | 29 +++++--------------
1 file changed, 7 insertions(+), 22 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
index 240bc554..98d96ace 100644
--- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
@@ -522,11 +522,13 @@ export default function CircuitTrestleSetting({ id }) {
pcsItemId: item.itemId,
pscOptCd: seletedOption.code,
paralQty: serQty.paralQty,
- connections: [
- {
- connItemId: item.connList[0].itemId,
- },
- ],
+ connections: item.connList?.length
+ ? [
+ {
+ connItemId: item.connList[0].itemId,
+ },
+ ]
+ : [],
}
})[0]
})
@@ -534,23 +536,6 @@ export default function CircuitTrestleSetting({ id }) {
// ๋ซ๊ธฐ ๋ฒํผ ํด๋ฆญ ์ ์ฒ๋ฆฌํ๋ ํจ์ ์ถ๊ฐ
const handleClose = () => {
- // // ํ๋ก ๋ฒํธ ํ
์คํธ ์ ๊ฑฐ
- // const circuitTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
- // canvas.remove(...circuitTexts)
-
- // // ๋ชจ๋์ ํ๋ก ์ ๋ณด ์ด๊ธฐํ
- // canvas
- // .getObjects()
- // .filter((obj) => obj.name === POLYGON_TYPE.MODULE)
- // .forEach((obj) => {
- // obj.circuit = null
- // obj.pcsItemId = null
- // obj.circuitNumber = null
- // })
-
- // canvas.renderAll()
- // closePopup(id)
-
swalFire({
title: '๋ณ๊ฒฝ์ฌํญ์ ์ ์ฅํ์๊ฒ ์ต๋๊น?',
//text: '์ ์ฅํ์ง ์์ ๋ณ๊ฒฝ์ฌํญ์ ๋ชจ๋ ์ฌ๋ผ์ง๋๋ค.',
From 9757f4b5bf552b6d063122c31581985622d3bc1f Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 14:12:40 +0900
Subject: [PATCH 059/213] =?UTF-8?q?=ED=99=95=EC=9D=B8=EC=9A=A9=20=EC=BD=98?=
=?UTF-8?q?=EC=86=94=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/management/StuffDetail.jsx | 4 ----
1 file changed, 4 deletions(-)
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index 8be25f9a..1f65e88f 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -1538,7 +1538,6 @@ export default function StuffDetail() {
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
.then(() => {
- console.log('ํธ๋ฃจ555')
setIsGlobalLoading(true)
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
if (session.storeId === 'T01') {
@@ -1661,9 +1660,6 @@ export default function StuffDetail() {
)
}
- console.log('๋ฌผ๊ฑด๋ฑ๋ก๊ณ ํ๋ฉด::', otherSaleStoreList)
- console.log('๋ฌผ๊ฑด๋ฑ๋ก๊ณ ํ๋ฉด::', otherSaleStoreList.length)
- //"201X584"
return (
<>
{(editMode === 'NEW' && (
From 170eca10edc2858b98dda411e013ffcf25638ebb Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 14:31:09 +0900
Subject: [PATCH 060/213] =?UTF-8?q?pcs=20=EC=97=86=EB=8A=94=20=EA=B2=BD?=
=?UTF-8?q?=EC=9A=B0=20=EC=A0=9C=EA=B1=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index a2634256..c9a0184b 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -605,10 +605,13 @@ export const useTrestle = () => {
const setEstimateData = async () => {
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
//surfaces.pcses๋ค์ ๋ฐฐ์ด๋ก ๋ฌถ๋๋ค
- const pcses = surfaces[0].pcses
+ const pcses = surfaces[0].pcses.filter((pcs) => pcs !== null && pcs !== undefined)
+
surfaces.forEach((surface, index) => {
if (index !== 0) {
- pcses.concat(surface.pcses)
+ if (surface.pcses) {
+ pcses.concat(surface.pcses)
+ }
}
})
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
From 6dc9d0c717ed9d232f7a93fedea9d3696c47ef0a Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Wed, 5 Feb 2025 14:48:53 +0900
Subject: [PATCH 061/213] =?UTF-8?q?=EB=AA=A8=EB=93=88=20=EC=9D=BC=EA=B4=84?=
=?UTF-8?q?=20=EC=A0=95=EB=A0=AC,=20=EC=9D=BC=EA=B4=84=20=EC=82=AD?=
=?UTF-8?q?=EC=A0=9C=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useModule.js | 113 +++++++++++++---------
src/hooks/module/useModuleBasicSetting.js | 8 +-
src/hooks/useContextMenu.js | 18 ++--
3 files changed, 81 insertions(+), 58 deletions(-)
diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js
index 80aa17d7..7f7c981c 100644
--- a/src/hooks/module/useModule.js
+++ b/src/hooks/module/useModule.js
@@ -800,60 +800,65 @@ export function useModule() {
}
}
- const alignModule = (type) => {
- const moduleSetupSurface = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
- const modules = canvas.getObjects().filter((obj) => obj.surfaceId === moduleSetupSurface.id && obj.name === POLYGON_TYPE.MODULE)
- const objects = getObjects()
- let [top, bottom, left, right] = [0, 0, 0, 0]
+ const alignModule = (type, surfaceArray) => {
+ surfaceArray.forEach((surface) => {
+ const modules = canvas
+ .getObjects()
+ .filter((module) => module.name === POLYGON_TYPE.MODULE)
+ .filter((module) => module.surfaceId === surface.id)
- top = Math.min(...modules.map((module) => module.top))
- bottom = Math.max(...modules.map((module) => module.top + module.height))
- left = Math.min(...modules.map((module) => module.left))
- right = Math.max(...modules.map((module) => module.left + module.width))
- const moduleSurfacePos = {
- top: Math.min(...moduleSetupSurface.points.map((point) => point.y)),
- left: Math.min(...moduleSetupSurface.points.map((point) => point.x)),
- }
- const [height, width] = [bottom - top, right - left]
- const verticalCenterLength = moduleSurfacePos.top + moduleSetupSurface.height / 2 - (top + height / 2)
- const horizontalCenterLength = moduleSurfacePos.left + moduleSetupSurface.width / 2 - (left + width / 2)
- let isWarning = false
+ const objects = getObjects()
+ let [top, bottom, left, right] = [0, 0, 0, 0]
- canvas.discardActiveObject()
- modules.forEach((module) => {
- module.originPos = {
- left: module.left,
- top: module.top,
- fill: module.fill,
- }
- if (type === MODULE_ALIGN_TYPE.VERTICAL) {
- module.set({ top: module.top + verticalCenterLength })
- } else if (type === MODULE_ALIGN_TYPE.HORIZONTAL) {
- module.set({ left: module.left + horizontalCenterLength })
+ top = Math.min(...modules.map((module) => module.top))
+ bottom = Math.max(...modules.map((module) => module.top + module.height))
+ left = Math.min(...modules.map((module) => module.left))
+ right = Math.max(...modules.map((module) => module.left + module.width))
+ const moduleSurfacePos = {
+ top: Math.min(...surface.points.map((point) => point.y)),
+ left: Math.min(...surface.points.map((point) => point.x)),
}
+ const [height, width] = [bottom - top, right - left]
+ const verticalCenterLength = moduleSurfacePos.top + surface.height / 2 - (top + height / 2)
+ const horizontalCenterLength = moduleSurfacePos.left + surface.width / 2 - (left + width / 2)
+ let isWarning = false
+ canvas.discardActiveObject()
+ modules.forEach((module) => {
+ module.originPos = {
+ left: module.left,
+ top: module.top,
+ fill: module.fill,
+ }
+ if (type === MODULE_ALIGN_TYPE.VERTICAL) {
+ module.set({ top: module.top + verticalCenterLength })
+ } else if (type === MODULE_ALIGN_TYPE.HORIZONTAL) {
+ module.set({ left: module.left + horizontalCenterLength })
+ }
+
+ canvas.renderAll()
+ module.setCoords()
+ if (isOverlapObjects(module, objects) || isOutsideSurface(module, surface)) {
+ isWarning = true
+ module.set({ fill: 'red' })
+ }
+ })
canvas.renderAll()
- module.setCoords()
- if (isOverlapObjects(module, objects) || isOutsideSurface(module, moduleSetupSurface)) {
- isWarning = true
- module.set({ fill: 'red' })
+ if (isWarning) {
+ swalFire({
+ title: getMessage('can.not.align.module'),
+ icon: 'error',
+ type: 'alert',
+ confirmFn: () => {
+ modules.forEach((module) => {
+ module.set({ top: module.originPos.top, left: module.originPos.left, fill: module.originPos.fill })
+ module.setCoords()
+ })
+ canvas.renderAll()
+ },
+ })
}
})
- canvas.renderAll()
- if (isWarning) {
- swalFire({
- title: getMessage('can.not.align.module'),
- icon: 'error',
- type: 'alert',
- confirmFn: () => {
- modules.forEach((module) => {
- module.set({ top: module.originPos.top, left: module.originPos.left, fill: module.originPos.fill })
- module.setCoords()
- })
- canvas.renderAll()
- },
- })
- }
}
const modulesRemove = () => {
@@ -867,6 +872,19 @@ export function useModule() {
canvas.renderAll()
}
+ const moduleRoofRemove = (surfaceArray) => {
+ surfaceArray.forEach((surface) => {
+ surface.modules = []
+ canvas
+ .getObjects()
+ .filter((module) => module.name === POLYGON_TYPE.MODULE && module.surfaceId === surface.id)
+ .forEach((module) => {
+ canvas.remove(module)
+ })
+ })
+ setModuleStatisticsData()
+ }
+
const isOverlapOtherModules = (module, otherModules) => {
return otherModules.some(
(otherModule) =>
@@ -1031,6 +1049,7 @@ export function useModule() {
moduleColumnInsert,
muduleRowInsert,
modulesRemove,
+ moduleRoofRemove,
alignModule,
setModuleStatisticsData,
}
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index cd8ef6a7..29f7f308 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -1,6 +1,6 @@
import { useState } from 'react'
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
-import { canvasSettingState, canvasState, checkedModuleState, isManualModuleSetupState } from '@/store/canvasAtom'
+import { canvasSettingState, canvasState, checkedModuleState, currentObjectState, isManualModuleSetupState } from '@/store/canvasAtom'
import { rectToPolygon, polygonToTurfPolygon, calculateVisibleModuleHeight, getDegreeByChon } from '@/util/canvas-util'
import { addedRoofsState, basicSettingState, roofDisplaySelector } from '@/store/settingAtom'
import offsetPolygon, { calculateAngle } from '@/util/qpolygon-utils'
@@ -45,6 +45,8 @@ export function useModuleBasicSetting(tabNum) {
const { getTrestleDetailList } = useMasterController()
const [saleStoreNorthFlg, setSaleStoreNorthFlg] = useState(false)
+ const [currentObject, setCurrentObject] = useRecoilState(currentObjectState)
+
useEffect(() => {
// console.log('basicSetting', basicSetting)
if (canvas) {
@@ -256,8 +258,6 @@ export function useModuleBasicSetting(tabNum) {
//์ค์น ๋ฒ์ ์ง์ ํด๋ฆญ ์ด๋ฒคํธ
const toggleSelection = (setupSurface) => {
- console.log('setupSurface', setupSurface)
-
const isExist = selectedModuleInstSurfaceArray.some((obj) => obj.parentId === setupSurface.parentId)
//์ต์ด ์ ํ์ผ๋
if (!isExist) {
@@ -279,6 +279,7 @@ export function useModuleBasicSetting(tabNum) {
canvas?.renderAll()
selectedModuleInstSurfaceArray.push(setupSurface)
+ setCurrentObject({ name: 'moduleSetupSurface', arrayData: [...selectedModuleInstSurfaceArray] })
} else {
//์ ํํ ์ฌ์ ํํ๋ฉด ์ ํ์๋จ์ผ๋ก ๋ณ๊ฒฝ
setupSurface.set({
@@ -293,6 +294,7 @@ export function useModuleBasicSetting(tabNum) {
const removeIndex = setupSurface.parentId
const removeArrayIndex = selectedModuleInstSurfaceArray.findIndex((obj) => obj.parentId === removeIndex)
selectedModuleInstSurfaceArray.splice(removeArrayIndex, 1)
+ setCurrentObject({ name: 'moduleSetupSurface', arrayData: [...selectedModuleInstSurfaceArray] })
}
canvas?.renderAll()
diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js
index a0b42438..4235d8db 100644
--- a/src/hooks/useContextMenu.js
+++ b/src/hooks/useContextMenu.js
@@ -67,7 +67,7 @@ export function useContextMenu() {
const commonTextFont = useRecoilValue(fontSelector('commonText'))
const { settingsData, setSettingsDataSave } = useCanvasSetting()
const { swalFire } = useSwal()
- const { alignModule, modulesRemove } = useModule()
+ const { alignModule, modulesRemove, moduleRoofRemove } = useModule()
const { removeRoofMaterial, removeAllRoofMaterial, moveRoofMaterial } = useRoofFn()
const currentMenuSetting = () => {
@@ -332,8 +332,8 @@ export function useContextMenu() {
}, [currentContextMenu])
useEffect(() => {
+ console.log('currentObject', currentObject)
if (currentObject?.name) {
- console.log('object', currentObject)
switch (currentObject.name) {
case 'triangleDormer':
case 'pentagonDormer':
@@ -725,21 +725,23 @@ export function useContextMenu() {
{
id: 'moduleVerticalCenterAlign',
name: getMessage('contextmenu.module.vertical.align'),
- fn: () => alignModule(MODULE_ALIGN_TYPE.VERTICAL),
+ fn: () => alignModule(MODULE_ALIGN_TYPE.VERTICAL, currentObject.arrayData),
},
{
id: 'moduleHorizonCenterAlign',
name: getMessage('contextmenu.module.horizon.align'),
- fn: () => alignModule(MODULE_ALIGN_TYPE.HORIZONTAL),
+ fn: () => alignModule(MODULE_ALIGN_TYPE.HORIZONTAL, currentObject.arrayData),
},
{
id: 'moduleRemove',
name: getMessage('contextmenu.module.remove'),
fn: () => {
- const moduleSetupSurface = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
- const modules = canvas.getObjects().filter((obj) => obj.surfaceId === moduleSetupSurface.id && obj.name === POLYGON_TYPE.MODULE)
- canvas.remove(...modules)
- canvas.renderAll()
+ moduleRoofRemove(currentObject.arrayData)
+
+ // const moduleSetupSurface = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
+ // const modules = canvas.getObjects().filter((obj) => obj.surfaceId === moduleSetupSurface.id && obj.name === POLYGON_TYPE.MODULE)
+ // canvas.remove(...modules)
+ // canvas.renderAll()
},
},
{
From 5bf483eb8b79bccf6f5fefb1220e6edfdb814c88 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 15:09:02 +0900
Subject: [PATCH 062/213] =?UTF-8?q?=F0=9F=93=8Cfix:=20QcastProvider=20?=
=?UTF-8?q?=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/app/layout.js | 40 +++++++++++++++++++++-------------------
1 file changed, 21 insertions(+), 19 deletions(-)
diff --git a/src/app/layout.js b/src/app/layout.js
index 8c78f6c7..c68f8127 100644
--- a/src/app/layout.js
+++ b/src/app/layout.js
@@ -58,26 +58,28 @@ export default async function RootLayout({ children }) {
return (
-
-
- {headerPathname === '/login' || headerPathname === '/join' ? (
- {children}
- ) : (
-
-
-
-
-
-
{children}
+
+
+
+ {headerPathname === '/login' || headerPathname === '/join' ? (
+ { children }
+ ) : (
+ <>
+
+
-
-
-
- )}
-
-
-
-
+ >
+ )}
+
+
+
+
+
)
From fbb4183e25b4e8968ed34b3c930ddabfc7dc6367 Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 15:19:37 +0900
Subject: [PATCH 063/213] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EC=83=81=EC=84=B8&?=
=?UTF-8?q?=20=EA=B2=AC=EC=A0=81=EC=84=9C=EC=83=81=EC=84=B8=20=EB=AC=B8?=
=?UTF-8?q?=EC=84=9C=EB=8B=A4=EC=9A=B4=EB=A1=9C=EB=93=9C=20=ED=8C=9D?=
=?UTF-8?q?=EC=97=85=20=EB=A6=AC=EC=BD=94=EC=9D=BC=20=EA=B4=80=EB=A0=A8=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/estimate/popup/DocDownOptionPop.jsx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx
index 50dfd018..25461dc6 100644
--- a/src/components/estimate/popup/DocDownOptionPop.jsx
+++ b/src/components/estimate/popup/DocDownOptionPop.jsx
@@ -4,13 +4,14 @@ import { useMessage } from '@/hooks/useMessage'
import { useAxios } from '@/hooks/useAxios'
import { useRecoilValue } from 'recoil'
import { floorPlanObjectState, estimateState } from '@/store/floorPlanObjectAtom'
-import { usePathname } from 'next/navigation'
+import { usePathname, useSearchParams } from 'next/navigation'
export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDownPopLockFlg }) {
const { getMessage } = useMessage()
const { promisePost } = useAxios()
const pathName = usePathname()
+ const searchParams = useSearchParams()
//EXCEL, PDF ๊ตฌ๋ถ
const [schDownload, setSchDownload] = useState('EXCEL')
@@ -53,8 +54,9 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
defaultSchDrawingFlg = defaultSchDrawingFlg.concat('|', '2', '|', '3')
}
+ //objectRecoil.floorPlanObjectNo๊ฐ ๋น์์ง๋ ๊ฒฝ์ฐ๊ฐ ์์ด์ ์์ผ๋ฉด url์์ ๋บด์ค๋๋ก ์ถ๊ฐ
const params = {
- objectNo: objectRecoil.floorPlanObjectNo,
+ objectNo: objectRecoil?.floorPlanObjectNo ? objectRecoil.floorPlanObjectNo : searchParams.get('objectNo'),
planNo: planNo,
schDownload: schDownload,
schUnitPriceFlg: sendUnitPriceFlg,
From f30a2f7c30341a6bf50fdb65dc21b44a1727f567 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 15:23:58 +0900
Subject: [PATCH 064/213] =?UTF-8?q?=F0=9F=9A=A8fix:=20=ED=9A=8C=EB=A1=9C?=
=?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EB=A9=94=EB=89=B4=20=EC=A7=84=EC=9E=85?=
=?UTF-8?q?=EC=8B=9C=20objectNo=20=EC=9E=83=EC=96=B4=EB=B2=84=EB=A6=AC?=
=?UTF-8?q?=EB=8A=94=20=ED=98=84=EC=83=81=20=ED=95=B4=EA=B2=B0?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/usePlan.js | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js
index 3691035e..f3b89fe3 100644
--- a/src/hooks/usePlan.js
+++ b/src/hooks/usePlan.js
@@ -296,7 +296,10 @@ export function usePlan(params = {}) {
const handleCurrentPlanUrl = () => {
const currentPlan = plans.find((plan) => plan.isCurrent)
- if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
+ // if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
+ if (currentPlan !== currentCanvasPlan) {
+ router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${currentPlan.objectNo}`)
+ }
}
const setBgImage = () => {
From 9754fb6049701aa234f25e3be95486468ac63851 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 15:33:31 +0900
Subject: [PATCH 065/213] =?UTF-8?q?=F0=9F=9A=A8fix:=20handleCurrentPlanUrl?=
=?UTF-8?q?=20=EC=A3=BC=EC=84=9D?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/usePlan.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/hooks/usePlan.js b/src/hooks/usePlan.js
index f3b89fe3..dd3c2739 100644
--- a/src/hooks/usePlan.js
+++ b/src/hooks/usePlan.js
@@ -298,7 +298,9 @@ export function usePlan(params = {}) {
const currentPlan = plans.find((plan) => plan.isCurrent)
// if (currentPlan) router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${floorPlanState?.objectNo}`)
if (currentPlan !== currentCanvasPlan) {
- router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${currentPlan.objectNo}`)
+ // todo: [์ ์์ฑ] ํ์ฌ ํ๋๊ณผ ํ์ฌ ์บ๋ฒ์ค ํ๋์ด ๋ค๋ฅธ ๊ฒฝ์ฐ ํ๋ ์ด๋
+ // ์ฐ์ ์ฃผ์์ฒ๋ฆฌ
+ // router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${currentPlan.objectNo}`)
}
}
From bd31ce079135ca09b7d68df4084fac4af671fff9 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Wed, 5 Feb 2025 16:00:23 +0900
Subject: [PATCH 066/213] =?UTF-8?q?api=20error=20=EC=B2=98=EB=A6=AC=20?=
=?UTF-8?q?=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/module/useTrestle.js | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/hooks/module/useTrestle.js b/src/hooks/module/useTrestle.js
index c9a0184b..c04bb3ce 100644
--- a/src/hooks/module/useTrestle.js
+++ b/src/hooks/module/useTrestle.js
@@ -6,6 +6,7 @@ import { getDegreeByChon } from '@/util/canvas-util'
import { v4 as uuidv4 } from 'uuid'
import { useMasterController } from '@/hooks/common/useMasterController'
import { basicSettingState } from '@/store/settingAtom'
+import { useSwal } from '@/hooks/useSwal'
// ํ๋ก ๋ฐ ๊ฐ๋์ค์
export const useTrestle = () => {
@@ -14,7 +15,7 @@ export const useTrestle = () => {
const { getQuotationItem } = useMasterController()
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
const roofSizeSet = useRecoilValue(basicSettingState).roofSizeSet
-
+ const { swalFire } = useSwal()
const apply = () => {
try {
//์ฒ๋ง๋ ฅ๋ฐ๊ฐ ์ฒดํฌ๋์ด ์๋ ๊ฒฝ์ฐ exposedBottomPoints๋ฅผ ์ด์ฉํด ์ฒ๋ง๋ ฅ๋ฐ ๊ทธ๋ ค์ค์ผํจ.
@@ -616,11 +617,13 @@ export const useTrestle = () => {
})
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
//๊ฒฌ์ ์ itemList ์กฐํ
- const res = await getQuotationItem(params)
- if (!res.data) {
+ const { data: itemList, data2, result } = await getQuotationItem(params)
+
+ if (result.resultCode === 'E') {
+ swalFire({ text: result.resultMsg, icon: 'error' })
return null
}
- const itemList = res.data
+
//northArrangement ๋ถ๋ฉด ์ค์น ์ฌ๋ถ
const northArrangement = getNorthArrangement()
// circuitItemList์ ๊ฒฝ์ฐ๋ moduleList์์ circuitId๋ง groupByํ๋ค.
@@ -678,10 +681,7 @@ export const useTrestle = () => {
}
})
- const estimateParam = { itemList, northArrangement, roofSurfaceList, circuitItemList }
-
- // ์ ์์ ์ผ๋ก ์๋ฃ ๋๋ฉด true ๋ฐํ
- return estimateParam
+ return { itemList, northArrangement, roofSurfaceList, circuitItemList }
}
const getNorthArrangement = () => {
From 936b6c0458f958f4d8a4560e976217789f280d75 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 16:17:10 +0900
Subject: [PATCH 067/213] =?UTF-8?q?=F0=9F=93=8Cfix:=20addPlan=20=EB=B2=84?=
=?UTF-8?q?=ED=8A=BC=20=EC=A1=B0=EA=B1=B4=EB=B6=80=20=EB=A0=8C=EB=8D=94?=
=?UTF-8?q?=EB=A7=81=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/floor-plan/CanvasLayout.jsx | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/components/floor-plan/CanvasLayout.jsx b/src/components/floor-plan/CanvasLayout.jsx
index bc1a4007..499fac57 100644
--- a/src/components/floor-plan/CanvasLayout.jsx
+++ b/src/components/floor-plan/CanvasLayout.jsx
@@ -1,6 +1,7 @@
'use client'
import { useContext, useEffect } from 'react'
+import { usePathname } from 'next/navigation'
import { useRecoilValue } from 'recoil'
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
import { SessionContext } from '@/app/SessionProvider'
@@ -12,6 +13,7 @@ import { globalLocaleStore } from '@/store/localeAtom'
export default function CanvasLayout({ children }) {
// const { menuNumber } = props
+ const pathname = usePathname()
const { menuNumber } = useCanvasMenu()
const { session } = useContext(SessionContext)
const { floorPlanState } = useContext(FloorPlanContext)
@@ -54,7 +56,7 @@ export default function CanvasLayout({ children }) {
))}
- {plans.length < 10 && (
+ {plans.length < 10 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
{
From 36b8c75a475f84c05c7ce808120185737777d13c Mon Sep 17 00:00:00 2001
From: LEEYONGJAE
Date: Wed, 5 Feb 2025 16:44:08 +0900
Subject: [PATCH 068/213] =?UTF-8?q?=EB=B0=9C=EC=A0=84=EC=8B=9C=EB=AC=BC?=
=?UTF-8?q?=EB=A0=88=EC=9D=B4=EC=85=98=20Excel/PDF=20=EB=8B=A4=EC=9A=B4=20?=
=?UTF-8?q?=EB=A1=9C=EB=94=A9=EB=B0=94=20=EC=B6=94=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/floor-plan/CanvasMenu.jsx | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index af57a32b..44c22d4b 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -119,6 +119,7 @@ export default function CanvasMenu(props) {
}
const options = { responseType: 'blob' }
+ setIsGlobalLoading(true)
await promisePost({ url: url, data: params, option: options })
.then((resultData) => {
if (resultData) {
@@ -145,6 +146,7 @@ export default function CanvasMenu(props) {
.catch((error) => {
alert('File does not exist.')
})
+ setIsGlobalLoading(false)
}
const onClickNav = (menu) => {
From ae2541164f120f413e9736dcf01bc94d5e0f0fe6 Mon Sep 17 00:00:00 2001
From: yoosangwook
Date: Wed, 5 Feb 2025 16:45:21 +0900
Subject: [PATCH 069/213] =?UTF-8?q?=F0=9F=9A=A8fix:=20QCastProvider=20?=
=?UTF-8?q?=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/app/layout.js | 40 +++++++++++++++++++---------------------
1 file changed, 19 insertions(+), 21 deletions(-)
diff --git a/src/app/layout.js b/src/app/layout.js
index c68f8127..8c78f6c7 100644
--- a/src/app/layout.js
+++ b/src/app/layout.js
@@ -58,28 +58,26 @@ export default async function RootLayout({ children }) {
return (
-
-
-
- {headerPathname === '/login' || headerPathname === '/join' ? (
- { children }
- ) : (
- <>
-
-
-
-
- {children}
-
-
+
+
+ {headerPathname === '/login' || headerPathname === '/join' ? (
+
{children}
+ ) : (
+
+
+
+
+
+ {children}
- >
- )}
-
-
-
-
-
+
+
+
+ )}
+
+
+
+
)
From 4bd65f72073c868ce011962b7ede3672f8b13679 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 16:54:18 +0900
Subject: [PATCH 070/213] =?UTF-8?q?=EC=A7=80=EB=B6=95=EC=9E=AC=ED=95=A0?=
=?UTF-8?q?=EB=8B=B9=20=ED=8D=BC=EB=B8=94=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ContextRoofAllocationSetting.jsx | 95 ++++++++---------
.../roofAllocation/RoofAllocationSetting.jsx | 100 +++++++++---------
2 files changed, 95 insertions(+), 100 deletions(-)
diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
index 88188887..7bbad312 100644
--- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
@@ -115,22 +115,25 @@ export default function ContextRoofAllocationSetting(props) {
)}
-
-
-
{getMessage('slope')}
-
-
{
- handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
- }}
- defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
- />
+ {roof.raftAuth && (
+
+
+
{getMessage('modal.placement.initial.setting.rafter')}
+ {raftCodes.length > 0 && (
+
+
+
+ )}
-
{pitchText}
-
+ )}
+
{(roof.widAuth || roof.lenAuth) && (
<>
{roof.widAuth && (
@@ -155,43 +158,37 @@ export default function ContextRoofAllocationSetting(props) {
)}
>
)}
- {(roof.raftAuth || roof.roofPchAuth) && (
- <>
- {roof.raftAuth && (
-
-
-
{getMessage('modal.placement.initial.setting.rafter')}
- {raftCodes.length > 0 && (
-
-
-
- )}
-
+ {roof.roofPchAuth && (
+
+
+
{getMessage('hajebichi')}
+
+
- )}
- {roof.roofPchAuth && (
-
-
-
{getMessage('hajebichi')}
-
-
-
-
-
- )}
- >
+
+
)}
+
+
+
{getMessage('slope')}
+
+ {
+ handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
+ }}
+ defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
+ />
+
+
{pitchText}
+
+
-
-
-
{getMessage('slope')}
-
-
{
- handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
- }}
- defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
- />
+
+ {roof.raftAuth && (
+
+
+
{getMessage('modal.placement.initial.setting.rafter')}
+ {raftCodes.length > 0 && (
+
+ handleChangeRaft(e, index)}
+ />
+
+ )}
-
{pitchText}
-
+ )}
+
{(roof.widAuth || roof.lenAuth) && (
<>
{roof.widAuth && (
@@ -169,45 +174,38 @@ export default function RoofAllocationSetting(props) {
)}
>
)}
- {(roof.raftAuth || roof.roofPchAuth) && (
- <>
- {roof.raftAuth && (
-
-
-
{getMessage('modal.placement.initial.setting.rafter')}
- {raftCodes.length > 0 && (
-
- handleChangeRaft(e, index)}
- />
-
- )}
-
+ {roof.roofPchAuth && (
+
+
+
{getMessage('hajebichi')}
+
+ handleChangeInput(e, 'hajebichi', index)}
+ value={parseInt(roof.hajebichi)}
+ readOnly={roof.roofPchAuth === 'R'}
+ />
- )}
- {roof.roofPchAuth && (
-
-
-
{getMessage('hajebichi')}
-
- handleChangeInput(e, 'hajebichi', index)}
- value={parseInt(roof.hajebichi)}
- readOnly={roof.roofPchAuth === 'R'}
- />
-
-
-
- )}
- >
+
+
)}
+
+
+
{getMessage('slope')}
+
+ {
+ handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
+ }}
+ defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
+ />
+
+
{pitchText}
+
+
Date: Wed, 5 Feb 2025 16:54:40 +0900
Subject: [PATCH 071/213] =?UTF-8?q?=EB=AA=A8=EB=93=88,=20=ED=9A=8C?=
=?UTF-8?q?=EB=A1=9C=EA=B5=AC=EC=84=B1=EC=97=90=EC=84=9C=20=EB=B0=B0?=
=?UTF-8?q?=EC=B9=98=EB=A9=B4=20=EC=B4=88=EA=B8=B0=EC=84=A4=EC=A0=95=20?=
=?UTF-8?q?=EB=A9=94=EB=89=B4=EB=A1=9C=20=EC=9D=B4=EB=8F=99=EC=95=88?=
=?UTF-8?q?=EB=90=98=EA=B2=8C=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/floor-plan/CanvasMenu.jsx | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index af57a32b..d698aecf 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -357,7 +357,7 @@ export default function CanvasMenu(props) {
}, [basicSetting])*/
const checkMenuState = (menu) => {
- return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && menu.index === 2)
+ return (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) || (menuNumber === 4 && [1, 2].includes(menu.index))
}
const checkMenuAndCanvasState = () => {
@@ -491,7 +491,7 @@ export default function CanvasMenu(props) {
className={`canvas-menu-item ${menuNumber === menu.index ? 'active' : ''}`}
onClick={() => {
if (['2', '3'].includes(canvasSetting?.roofSizeSet) && menu.index === 2) return
- if (menuNumber === 4 && menu.index === 2) return
+ if (menuNumber === 4 && [1, 2].includes(menu.index)) return
onClickNav(menu)
}}
>
From ccbceb020ed4d27ed773317857dca2af7e0da8c1 Mon Sep 17 00:00:00 2001
From: basssy
Date: Wed, 5 Feb 2025 16:54:50 +0900
Subject: [PATCH 072/213] =?UTF-8?q?=EC=86=8C=EC=8A=A4=20=EC=A0=95=EB=A6=AC?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/estimate/popup/DocDownOptionPop.jsx | 6 +++---
src/components/estimate/popup/EstimateCopyPop.jsx | 2 +-
src/components/estimate/popup/ProductFeaturesPop.jsx | 6 +++---
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx
index 25461dc6..13477b63 100644
--- a/src/components/estimate/popup/DocDownOptionPop.jsx
+++ b/src/components/estimate/popup/DocDownOptionPop.jsx
@@ -18,7 +18,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
//๋ค์ด๋ก๋ ํ์ผ EXCEL
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
//๊ฒฌ์ ์ ์ถ์ ํ์๋ช
- const [schDisplayFlg, setSchSchDisplayFlg] = useState('0')
+ const [schDisplayFlg, setSchDisplayFlg] = useState('0')
//๊ฐ๋ ์ค๋ํ ํฌํจ(ํฌํจ:1 ๋ฏธํฌํจ : 0)
const [schWeightFlg, setSchWeightFlg] = useState('1')
//๋๋ฉด/์๋ฎฌ๋ ์ด์
ํ์ผ ํฌํจ
@@ -208,7 +208,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
value={'0'}
checked={schDisplayFlg === '0'}
onChange={(e) => {
- setSchSchDisplayFlg(e.target.value)
+ setSchDisplayFlg(e.target.value)
}}
/>
@@ -221,7 +221,7 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen, docDown
value={'1'}
checked={schDisplayFlg === '1'}
onChange={(e) => {
- setSchSchDisplayFlg(e.target.value)
+ setSchDisplayFlg(e.target.value)
}}
/>
diff --git a/src/components/estimate/popup/EstimateCopyPop.jsx b/src/components/estimate/popup/EstimateCopyPop.jsx
index 001de6e9..35d8d54b 100644
--- a/src/components/estimate/popup/EstimateCopyPop.jsx
+++ b/src/components/estimate/popup/EstimateCopyPop.jsx
@@ -69,7 +69,7 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) {
get({ url: url }).then((res) => {
if (!isEmptyArray(res)) {
res.map((row) => {
- row.value == row.saleStoreId
+ row.value = row.saleStoreId
row.label = row.saleStoreName
})
otherList = res
diff --git a/src/components/estimate/popup/ProductFeaturesPop.jsx b/src/components/estimate/popup/ProductFeaturesPop.jsx
index f2d98800..b6b02c64 100644
--- a/src/components/estimate/popup/ProductFeaturesPop.jsx
+++ b/src/components/estimate/popup/ProductFeaturesPop.jsx
@@ -7,16 +7,16 @@ export default function ProductFeaturesPop({ popShowSpecialNoteList, showProduct
useEffect(() => {
let pushData = []
- popShowSpecialNoteList.map((row) => {
+ popShowSpecialNoteList.forEach((row) => {
let option = showProductFeatureData.split('ใ')
- option.map((row2) => {
+ option.forEach((row2) => {
if (row.code === row2) {
pushData.push(row)
}
})
})
setShowSpecialNoteList(pushData)
- }, [popShowSpecialNoteList])
+ }, [popShowSpecialNoteList, showProductFeatureData])
return (
From ec0a8a552319613cffbb2cbe1c8cf8730d1f1140 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 16:55:03 +0900
Subject: [PATCH 073/213] =?UTF-8?q?=EC=88=98=EB=8F=99=20=ED=9A=8C=EB=A1=9C?=
=?UTF-8?q?=20=EC=84=A4=EC=A0=95=20=EB=B0=8F=20=EC=A7=91=EA=B3=84=ED=91=9C?=
=?UTF-8?q?=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../circuitTrestle/CircuitTrestleSetting.jsx | 173 ++++++++++--------
.../step/PowerConditionalSelect.jsx | 6 +-
.../step/type/PassivityCircuitAllocation.jsx | 139 +++++++-------
src/hooks/module/useModule.js | 22 ++-
4 files changed, 176 insertions(+), 164 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
index 240bc554..fb9d49ac 100644
--- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
@@ -94,16 +94,27 @@ export default function CircuitTrestleSetting({ id }) {
// ์๋ฆฌ์ฆ์ค ์๋์ผ๋ก ์ถ์ฒ PCS ์ ๋ณด ์กฐํ
getPcsAutoRecommendList(params).then((res) => {
if (res.data?.pcsItemList) {
- const itemList = models.filter((model) => {
- return res.data?.pcsItemList.map((item) => item.itemId).includes(model.itemId)
- })
- const selectedModels = itemList.map((model) => {
- return {
- ...model,
- id: uuidv4(),
- isUsed: false,
+ let pcsItemList = []
+ res.data?.pcsItemList.forEach((item) => {
+ if (models.map((model) => model.itemId).includes(item.itemId)) {
+ pcsItemList.push({
+ ...item,
+ id: uuidv4(),
+ isUsed: false,
+ })
}
})
+ // const selectedModels = pcsItemList
+ // const itemList = models.filter((model) => {
+ // return res.data?.pcsItemList.map((item) => item.itemId).includes(model.itemId)
+ // })
+ // const selectedModels = itemList.map((model) => {
+ // return {
+ // ...model,
+ // id: uuidv4(),
+ // isUsed: false,
+ // }
+ // })
// ํ๋ก ๊ตฌ์ฑ ๊ฐ๋ฅ ์ฌ๋ถ ์ฒดํฌ ์์ฒญ ํ๋ผ๋ฏธํฐ
const pcsVoltageChkParams = {
...getOptYn(),
@@ -112,7 +123,7 @@ export default function CircuitTrestleSetting({ id }) {
pcsItemList: getPcsItemList(),
}
// ์ถ์ฒ ๋ชฉ๋ก ์ ํ
- setSelectedModels(selectedModels)
+ setSelectedModels(pcsItemList)
// ํ๋ก ๊ตฌ์ฑ ๊ฐ๋ฅ ์ฌ๋ถ ์ฒดํฌ
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
if (res.resultCode === 'S') {
@@ -205,24 +216,26 @@ export default function CircuitTrestleSetting({ id }) {
const getRoofSurfaceList = () => {
const roofSurfaceList = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
roofSurfaceList.sort((a, b) => a.left - b.left || b.top - a.top)
- return roofSurfaceList.map((obj) => {
- return {
- roofSurfaceId: obj.id,
- roofSurface: canvas
- .getObjects()
- .filter((o) => o.id === obj.parentId)[0]
- .directionText.replace(/[0-9]/g, ''),
- roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch,
- moduleList: getModuleList(obj).map((module) => {
- return {
- itemId: module.moduleInfo.itemId,
- circuit: module.circuitNumber ? module.circuitNumber : null,
- pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
- uniqueId: module.id ? module.id : null,
- }
- }),
- }
- })
+ return roofSurfaceList
+ .map((obj) => {
+ return {
+ roofSurfaceId: obj.id,
+ roofSurface: canvas
+ .getObjects()
+ .filter((o) => o.id === obj.parentId)[0]
+ .directionText.replace(/[0-9]/g, ''),
+ roofSurfaceIncl: canvas.getObjects().filter((o) => o.id === obj.parentId)[0].roofMaterial.pitch,
+ moduleList: getModuleList(obj).map((module) => {
+ return {
+ itemId: module.moduleInfo.itemId,
+ circuit: module.circuitNumber ? module.circuitNumber : null,
+ pcsItemId: module.circuit ? module.circuit?.pcsItemId : null,
+ uniqueId: module.id ? module.id : null,
+ }
+ }),
+ }
+ })
+ .filter((surface) => surface.moduleList.length > 0)
}
// ๋ชจ๋ ๋ชฉ๋ก
@@ -338,7 +351,18 @@ export default function CircuitTrestleSetting({ id }) {
const params = {
...getOptYn(),
useModuleItemList: getUseModuleItemList(),
- roofSurfaceList: getRoofSurfaceList(),
+ roofSurfaceList: getRoofSurfaceList().map((surface) => {
+ console.log(surface.moduleList)
+ return {
+ ...surface,
+ moduleList: surface.moduleList.map((module) => {
+ return {
+ itemId: module.itemId,
+ uniqueId: module.uniqueId,
+ }
+ }),
+ }
+ }),
pcsItemList: getPcsItemList(),
}
@@ -348,19 +372,41 @@ export default function CircuitTrestleSetting({ id }) {
const itemList = models.filter((model) => {
return res.data?.pcsItemList.map((item) => item.itemId).includes(model.itemId)
})
- const selectedModels = itemList.map((model) => {
- return {
- ...model,
- id: uuidv4(),
+
+ let pcsItemList = []
+ let pcsObj = {}
+ models.forEach((model) => {
+ pcsObj[model.itemId] = model
+ })
+ res.data?.pcsItemList.forEach((item) => {
+ if (pcsObj[item.itemId]) {
+ pcsItemList.push({
+ ...pcsObj[item.itemId],
+ isUsed: false,
+ id: uuidv4(),
+ })
}
})
+
+ // const selectedModels = itemList.map((model) => {
+ // return {
+ // ...model,
+ // id: uuidv4(),
+ // }
+ // })
const pcsVoltageChkParams = {
...getOptYn(),
useModuleItemList: getUseModuleItemList(),
roofSurfaceList: getRoofSurfaceList(),
- pcsItemList: getPcsItemList(),
+ pcsItemList: pcsItemList.map((item) => {
+ return {
+ itemId: item.itemId,
+ pcsMkrCd: item.pcsMkrCd,
+ pcsSerCd: item.pcsSerCd,
+ }
+ }),
}
- setSelectedModels(selectedModels)
+ setSelectedModels(pcsItemList)
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
})
@@ -535,53 +581,20 @@ export default function CircuitTrestleSetting({ id }) {
// ๋ซ๊ธฐ ๋ฒํผ ํด๋ฆญ ์ ์ฒ๋ฆฌํ๋ ํจ์ ์ถ๊ฐ
const handleClose = () => {
// // ํ๋ก ๋ฒํธ ํ
์คํธ ์ ๊ฑฐ
- // const circuitTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
- // canvas.remove(...circuitTexts)
+ const circuitTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
+ canvas.remove(...circuitTexts)
+ // ๋ชจ๋์ ํ๋ก ์ ๋ณด ์ด๊ธฐํ
+ canvas
+ .getObjects()
+ .filter((obj) => obj.name === POLYGON_TYPE.MODULE)
+ .forEach((obj) => {
+ obj.circuit = null
+ obj.pcsItemId = null
+ obj.circuitNumber = null
+ })
- // // ๋ชจ๋์ ํ๋ก ์ ๋ณด ์ด๊ธฐํ
- // canvas
- // .getObjects()
- // .filter((obj) => obj.name === POLYGON_TYPE.MODULE)
- // .forEach((obj) => {
- // obj.circuit = null
- // obj.pcsItemId = null
- // obj.circuitNumber = null
- // })
-
- // canvas.renderAll()
- // closePopup(id)
-
- swalFire({
- title: '๋ณ๊ฒฝ์ฌํญ์ ์ ์ฅํ์๊ฒ ์ต๋๊น?',
- //text: '์ ์ฅํ์ง ์์ ๋ณ๊ฒฝ์ฌํญ์ ๋ชจ๋ ์ฌ๋ผ์ง๋๋ค.',
- type: 'confirm',
- confirmButtonText: '์ ์ฅ',
- cancelButtonText: '์ทจ์',
- icon: 'warning',
- confirmFn: async () => {
- // ์ ์ฅ ๋ก์ง ์คํ
- await onApply()
- closePopup(id)
- },
- denyFn: () => {
- // ํ๋ก ๋ฒํธ ํ
์คํธ ์ ๊ฑฐ
- const circuitTexts = canvas.getObjects().filter((obj) => obj.name === 'circuitNumber')
- canvas.remove(...circuitTexts)
-
- // ๋ชจ๋์ ํ๋ก ์ ๋ณด ์ด๊ธฐํ
- canvas
- .getObjects()
- .filter((obj) => obj.name === POLYGON_TYPE.MODULE)
- .forEach((obj) => {
- obj.circuit = null
- obj.pcsItemId = null
- obj.circuitNumber = null
- })
-
- canvas.renderAll()
- closePopup(id)
- },
- })
+ canvas.renderAll()
+ closePopup(id)
}
return (
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
index 5496a0d5..ee56d4c4 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
@@ -91,7 +91,6 @@ export default function PowerConditionalSelect(props) {
}
const onCheckSeries = (data) => {
- console.log('data', data)
const copySeries = series.map((s) => {
return {
...s,
@@ -99,12 +98,10 @@ export default function PowerConditionalSelect(props) {
}
})
setSeries(copySeries)
- console.log('copySeries', copySeries)
handleSetmodels(copySeries.filter((s) => s.selected))
}
const handleSetmodels = (selectedSeries) => {
- console.log('series', selectedSeries)
if (selectedSeries.length === 0) {
setModels([])
setSelectedModels([])
@@ -149,7 +146,7 @@ export default function PowerConditionalSelect(props) {
return
}
- setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4() }])
+ setSelectedModels([...selectedModels, { ...selectedRow, id: uuidv4(), isUsed: false }])
setSelectedRow(null)
}
@@ -163,7 +160,6 @@ export default function PowerConditionalSelect(props) {
setSelectedMaker(option)
getPcsMakerList(option).then((res) => {
- console.log('getPcsMakerList(series)', res.data)
setSeries(
res.data.map((series) => {
return { ...series, selected: false }
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
index aa151d9c..ff1e7cb8 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
@@ -79,36 +79,36 @@ export default function PassivityCircuitAllocation(props) {
const setSurfaceInfo = () => {
const surfaces = canvas.getObjects().filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name)
// setHeaders([header[0], { name: 'ํ๋ก', prop: 'circuit' }, ...header.slice(1)])
- setRows(
- rows.map((row) => {
- return {
- ...row,
- circuit: '',
- }
- }),
- )
- let totals = {}
+ // setRows(
+ // rows.map((row) => {
+ // return {
+ // ...row,
+ // circuit: '',
+ // }
+ // }),
+ // )
+ // let totals = {}
- rows.forEach((row) => {
- if (header.length === 4) {
- if (!totals[header[2].prop]) totals[header[2].prop] = 0
- totals[header[2].prop] += +row[header[2].prop]
- } else if (header.length === 5) {
- if (!totals[header[2].prop]) totals[header[2].prop] = 0
- totals[header[2].prop] += +row[header[2].prop]
- if (!totals[header[3].prop]) totals[header[3].prop] = 0
- totals[header[3]] += +row[header[3]]
- }
- })
- setFooter([
- ...['ํฉ๊ณ', ''],
- ...Object.keys(totals).map((key) => {
- return totals[key]
- }),
- Object.keys(totals).reduce((acc, key) => {
- return acc + totals[key]
- }, 0),
- ])
+ // rows.forEach((row) => {
+ // if (header.length === 4) {
+ // if (!totals[header[2].prop]) totals[header[2].prop] = 0
+ // totals[header[2].prop] += +row[header[2].prop]
+ // } else if (header.length === 5) {
+ // if (!totals[header[2].prop]) totals[header[2].prop] = 0
+ // totals[header[2].prop] += +row[header[2].prop]
+ // if (!totals[header[3].prop]) totals[header[3].prop] = 0
+ // totals[header[3]] += +row[header[3]]
+ // }
+ // })
+ // setFooter([
+ // ...['ํฉ๊ณ', ''],
+ // ...Object.keys(totals).map((key) => {
+ // return totals[key]
+ // }),
+ // Object.keys(totals).reduce((acc, key) => {
+ // return acc + totals[key]
+ // }, 0),
+ // ])
// let totalWpout = 0
// const rows = surfaces.map((surface) => {
// let wpOut = 0
@@ -226,10 +226,23 @@ export default function PassivityCircuitAllocation(props) {
setSelectedPcs(tempSelectedPcs)
canvas.add(moduleCircuitText)
})
+ console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
+
+ // let pcsList = [...selectedModels.map((model) => ({ ...model }))]
+ let pcsList = JSON.parse(JSON.stringify(selectedModels))
+ pcsList = pcsList.map((model) => {
+ console.log('๐ ~ handleCircuitNumberFix ~ pcsList:', pcsList)
+ if (model.id === selectedPcs.id) {
+ model.isUsed = true
+ }
+ return model
+ })
+
+ console.log('๐ ~ handleCircuitNumberFix ~ pcsList:', pcsList)
const roofSurfaceList = canvas
.getObjects()
- .filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name)
+ .filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name && obj?.modules.length > 0)
.map((surface) => {
return {
roofSurfaceId: surface.id,
@@ -246,45 +259,25 @@ export default function PassivityCircuitAllocation(props) {
})
console.log('uniqueCircuitNumbers', uniqueCircuitNumbers)
- const usedPcses = selectedModels.filter((model) => model.isUsed)
- const pcsItemList =
- usedPcses.length === 0
- ? [
- {
- pcsMkrCd: selectedPcs.pcsMkrCd,
- pcsSerCd: selectedPcs.pcsSerCd,
- itemId: selectedPcs.itemId,
- itemNm: selectedPcs.itemNm,
- goodsNo: selectedPcs.goodsNo,
- serQtyList: [
- {
- serQty: targetModules.length,
- paralQty: uniqueCircuitNumbers.length,
- rmdYn: 'Y',
- usePossYn: 'Y',
- roofSurfaceList: roofSurfaceList,
- },
- ],
- },
- ]
- : selectedModels.map((model, index) => {
- return {
- pcsMkrCd: model.pcsMkrCd,
- pcsSerCd: model.pcsSerCd,
- itemId: model.itemId,
- itemNm: model.itemNm,
- goodsNo: model.goodsNo,
- serQtyList: [
- {
- serQty: targetModules.length,
- paralQty: uniqueCircuitNumbers.length,
- rmdYn: 'Y',
- usePossYn: 'Y',
- roofSurfaceList: roofSurfaceList,
- },
- ],
- }
- })
+ const usedPcses = pcsList.filter((model) => model.isUsed)
+ const pcsItemList = usedPcses.map((model, index) => {
+ return {
+ pcsMkrCd: model.pcsMkrCd,
+ pcsSerCd: model.pcsSerCd,
+ itemId: model.itemId,
+ itemNm: model.itemNm,
+ goodsNo: model.goodsNo,
+ serQtyList: [
+ {
+ serQty: targetModules.length,
+ paralQty: uniqueCircuitNumbers.length,
+ rmdYn: 'Y',
+ usePossYn: 'Y',
+ roofSurfaceList: roofSurfaceList,
+ },
+ ],
+ }
+ })
const params = {
...getApiProps(),
@@ -318,17 +311,15 @@ export default function PassivityCircuitAllocation(props) {
return
}
- setSelectedModels(
- selectedModels.map((model) => {
- return { ...model, isUsed: model.id === selectedPcs.id ? true : model.isUsed }
- }),
- )
+ setSelectedModels(pcsList)
setTargetModules([])
setCircuitNumber(+circuitNumber + 1)
setModuleStatisticsData()
})
}
+ console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
+ console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
const getCircuitNumber = () => {
if (selectedModels.length === 1) {
diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js
index 80aa17d7..50280efc 100644
--- a/src/hooks/module/useModule.js
+++ b/src/hooks/module/useModule.js
@@ -243,6 +243,7 @@ export function useModule() {
},
})
}
+ setModuleStatisticsData()
}
const moduleCopy = (length, direction) => {
@@ -303,6 +304,7 @@ export function useModule() {
},
})
}
+ setModuleStatisticsData()
}
const moduleMultiCopy = (type, length, direction) => {
@@ -377,6 +379,7 @@ export function useModule() {
},
})
}
+ setModuleStatisticsData()
}
const moduleColumnRemove = (type) => {
@@ -491,6 +494,7 @@ export function useModule() {
},
})
}
+ setModuleStatisticsData()
}
const moduleRowRemove = (type) => {
@@ -606,6 +610,7 @@ export function useModule() {
},
})
}
+ setModuleStatisticsData()
}
const moduleColumnInsert = (type) => {
@@ -701,6 +706,8 @@ export function useModule() {
},
})
}
+ moduleSetupSurface.set({ modules: [...moduleSetupSurface.modules, ...copyModules] })
+ setModuleStatisticsData()
}
const muduleRowInsert = (type) => {
@@ -798,6 +805,9 @@ export function useModule() {
},
})
}
+
+ moduleSetupSurface.set({ modules: [...moduleSetupSurface.modules, ...copyModules] })
+ setModuleStatisticsData()
}
const alignModule = (type) => {
@@ -865,6 +875,7 @@ export function useModule() {
surface.set({ modules: modules })
canvas.remove(activeModule)
canvas.renderAll()
+ setModuleStatisticsData()
}
const isOverlapOtherModules = (module, otherModules) => {
@@ -947,7 +958,7 @@ export function useModule() {
]
const surfaceObjects = {}
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
- const rows = surfaces.map((surface) => {
+ surfaces.forEach((surface) => {
surfaceObjects[surface.id] = {
roofSurface: canvas.getObjects().filter((obj) => obj.id === surface.parentId)[0].directionText,
circuit: '-',
@@ -984,11 +995,12 @@ export function useModule() {
})
})
let tempRows = []
+ console.log('surfaceObjects', surfaceObjects)
Object.keys(surfaceObjects).forEach((key) => {
let tempRow = {
name: surfaceObjects[key].roofSurface,
circuit: surfaceObjects[key].circuit,
- wpOut: parseInt((surfaceObjects[key].wpOut / 1000).toFixed(3)),
+ wpOut: parseFloat(surfaceObjects[key].wpOut / 1000),
}
selectedModules.itemList.forEach((module) => {
tempRow[module.itemId] = surfaceObjects[key][module.itemId]
@@ -999,7 +1011,7 @@ export function useModule() {
let row = {
name: surfaceObjects[key].roofSurface,
circuit: surfaceObjects[key].circuits[circuit].circuit,
- wpOut: parseInt((surfaceObjects[key].circuits[circuit].circuits.wpOut / 1000).toFixed(3)),
+ wpOut: parseFloat(surfaceObjects[key].circuits[circuit].circuits.wpOut / 1000),
}
selectedModules.itemList.forEach((module) => {
row[module.itemId] = surfaceObjects[key].circuits[circuit].circuits[module.itemId]
@@ -1007,14 +1019,14 @@ export function useModule() {
tempRows.push(row)
})
})
-
+ console.log('tempRows', tempRows)
const tempFooter = {
name: getMessage('modal.panel.batch.statistic.total'),
circuit: '-',
wpOut: tempRows.reduce((acc, row) => acc + row.wpOut, 0),
}
selectedModules.itemList.forEach((module) => {
- tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + row[module.itemId], 0)
+ tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + (row[module.itemId] ? parseFloat(row[module.itemId]) : 0), 0)
})
setModuleStatistics({ header: tempHeader, rows: tempRows.filter((row) => row.wpOut !== 0), footer: tempFooter })
}
From 65fd3d348f23b33d39f9c4a65566b185f02a9f19 Mon Sep 17 00:00:00 2001
From: yjnoh
Date: Wed, 5 Feb 2025 16:57:45 +0900
Subject: [PATCH 074/213] =?UTF-8?q?=EC=9D=BC=EA=B4=84=20=EB=B3=B5=EC=82=AC?=
=?UTF-8?q?,=20=EC=9D=B4=EB=8F=99=20=EA=B8=B0=EB=8A=A5=20=EC=B6=94?=
=?UTF-8?q?=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../floor-plan/modal/module/PanelEdit.jsx | 4 +-
src/hooks/module/useModule.js | 181 +++++++++---------
src/hooks/module/useModuleBasicSetting.js | 2 +-
src/hooks/useContextMenu.js | 14 +-
src/locales/ko.json | 3 +-
5 files changed, 107 insertions(+), 97 deletions(-)
diff --git a/src/components/floor-plan/modal/module/PanelEdit.jsx b/src/components/floor-plan/modal/module/PanelEdit.jsx
index 8e1f9fac..c324fab8 100644
--- a/src/components/floor-plan/modal/module/PanelEdit.jsx
+++ b/src/components/floor-plan/modal/module/PanelEdit.jsx
@@ -57,13 +57,13 @@ export default function PanelEdit(props) {
moduleMove(length, direction)
break
case PANEL_EDIT_TYPE.MOVE_ALL:
- moduleMoveAll(length, direction)
+ moduleMoveAll(length, direction, props.arrayData)
break
case PANEL_EDIT_TYPE.COPY:
moduleCopy(length, direction)
break
case PANEL_EDIT_TYPE.COPY_ALL:
- moduleCopyAll(length, direction)
+ moduleCopyAll(length, direction, props.arrayData)
break
case PANEL_EDIT_TYPE.COLUMN_MOVE:
moduleMultiMove('column', length, direction)
diff --git a/src/hooks/module/useModule.js b/src/hooks/module/useModule.js
index 7f7c981c..53d3b897 100644
--- a/src/hooks/module/useModule.js
+++ b/src/hooks/module/useModule.js
@@ -145,104 +145,113 @@ export function useModule() {
}
}
- const moduleMoveAll = (length, direction) => {
- const moduleSetupSurface = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
- const modules = canvas.getObjects().filter((obj) => obj.surfaceId === moduleSetupSurface.id && obj.name === POLYGON_TYPE.MODULE)
- const objects = getObjects()
+ const moduleMoveAll = (length, direction, surfaceArray) => {
+ surfaceArray.forEach((surface) => {
+ const modules = canvas
+ .getObjects()
+ .filter((module) => module.name === POLYGON_TYPE.MODULE)
+ .filter((module) => module.surfaceId === surface.id)
+ const objects = getObjects()
- let isWarning = false
+ let isWarning = false
- modules.forEach((module) => {
- const { top, left } = getPosotion(module, direction, length, false)
- module.originPos = {
- top: module.top,
- left: module.left,
- fill: module.fill,
- }
+ modules.forEach((module) => {
+ const { top, left } = getPosotion(module, direction, length, false)
+ module.originPos = {
+ top: module.top,
+ left: module.left,
+ fill: module.fill,
+ }
+
+ module.set({ top, left })
+ module.setCoords()
+ canvas.renderAll()
+
+ if (isOverlapObjects(module, objects) || isOutsideSurface(module, surface)) {
+ isWarning = true
+ module.set({ fill: 'red' })
+ }
+ })
- module.set({ top, left })
- module.setCoords()
canvas.renderAll()
-
- if (isOverlapObjects(module, objects) || isOutsideSurface(module, moduleSetupSurface)) {
- isWarning = true
- module.set({ fill: 'red' })
+ if (isWarning) {
+ swalFire({
+ title: getMessage('can.not.move.module'),
+ icon: 'error',
+ type: 'alert',
+ confirmFn: () => {
+ modules.forEach((module) => {
+ module.set({ top: module.originPos.top, left: module.originPos.left, fill: module.originPos.fill })
+ module.setCoords()
+ })
+ canvas.renderAll()
+ },
+ })
}
})
-
- canvas.renderAll()
- if (isWarning) {
- swalFire({
- title: getMessage('can.not.move.module'),
- icon: 'error',
- type: 'alert',
- confirmFn: () => {
- modules.forEach((module) => {
- module.set({ top: module.originPos.top, left: module.originPos.left, fill: module.originPos.fill })
- module.setCoords()
- })
- canvas.renderAll()
- },
- })
- }
}
- const moduleCopyAll = (length, direction) => {
- const moduleSetupSurface = canvas.getObjects().filter((obj) => canvas.getActiveObjects()[0].id === obj.id)[0]
- const modules = canvas.getObjects().filter((obj) => obj.surfaceId === moduleSetupSurface.id && obj.name === POLYGON_TYPE.MODULE)
- const objects = getObjects()
- const copyModules = []
- let copyModule = null
- let isWarning = false
- let moduleLength = 0
- if (['up', 'down'].includes(direction)) {
- modules.sort((a, b) => a.top - b.top)
- moduleLength = Number(modules[modules.length - 1].top) + Number(modules[modules.length - 1].height) - Number(modules[0].top)
- } else if (['left', 'right'].includes(direction)) {
- modules.sort((a, b) => a.left - b.left)
- moduleLength = Number(modules[modules.length - 1].left) + Number(modules[modules.length - 1].width) - Number(modules[0].left)
- }
+ const moduleCopyAll = (length, direction, surfaceArray) => {
+ surfaceArray.forEach((surface) => {
+ const modules = canvas
+ .getObjects()
+ .filter((module) => module.name === POLYGON_TYPE.MODULE)
+ .filter((module) => module.surfaceId === surface.id)
+ const objects = getObjects()
+ const copyModules = []
- modules.forEach((module) => {
- const { top, left } = getPosotion(module, direction, Number(length) + Number(moduleLength), false)
- module.clone((obj) => {
- obj.set({
- parentId: module.parentId,
- initOptions: module.initOptions,
- direction: module.direction,
- arrow: module.arrow,
- name: module.name,
- type: module.type,
- length: module.length,
- points: module.points,
- surfaceId: module.surfaceId,
- left,
- top,
- id: uuidv4(),
- })
- copyModule = obj
- canvas.add(obj)
- copyModules.push(obj)
- obj.setCoords()
- })
- if (isOverlapObjects(copyModule, objects) || isOutsideSurface(copyModule, moduleSetupSurface)) {
- isWarning = true
- copyModule.set({ fill: 'red' })
+ let copyModule = null
+ let isWarning = false
+ let moduleLength = 0
+ if (['up', 'down'].includes(direction)) {
+ modules.sort((a, b) => a.top - b.top)
+ moduleLength = Number(modules[modules.length - 1].top) + Number(modules[modules.length - 1].height) - Number(modules[0].top)
+ } else if (['left', 'right'].includes(direction)) {
+ modules.sort((a, b) => a.left - b.left)
+ moduleLength = Number(modules[modules.length - 1].left) + Number(modules[modules.length - 1].width) - Number(modules[0].left)
}
- canvas.renderAll()
- })
- if (isWarning) {
- swalFire({
- title: getMessage('can.not.copy.module'),
- icon: 'error',
- type: 'alert',
- confirmFn: () => {
- canvas.remove(...copyModules)
- canvas.renderAll()
- },
+ modules.forEach((module) => {
+ const { top, left } = getPosotion(module, direction, Number(length) + Number(moduleLength), false)
+ module.clone((obj) => {
+ obj.set({
+ parentId: module.parentId,
+ initOptions: module.initOptions,
+ direction: module.direction,
+ arrow: module.arrow,
+ name: module.name,
+ type: module.type,
+ length: module.length,
+ points: module.points,
+ surfaceId: module.surfaceId,
+ left,
+ top,
+ id: uuidv4(),
+ })
+ copyModule = obj
+ canvas.add(obj)
+ copyModules.push(obj)
+ obj.setCoords()
+ })
+ if (isOverlapObjects(copyModule, objects) || isOutsideSurface(copyModule, surface)) {
+ isWarning = true
+ copyModule.set({ fill: 'red' })
+ }
+ canvas.renderAll()
})
- }
+
+ if (isWarning) {
+ swalFire({
+ title: getMessage('can.not.copy.module'),
+ icon: 'error',
+ type: 'alert',
+ confirmFn: () => {
+ canvas.remove(...copyModules)
+ canvas.renderAll()
+ },
+ })
+ }
+ })
}
const moduleCopy = (length, direction) => {
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index 29f7f308..b6e0dad3 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -123,7 +123,7 @@ export function useModuleBasicSetting(tabNum) {
makeModuleInstArea(roof, detail.data)
//surface์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
} else {
- console.log('๊ฐ๋ ๋ฐ์ดํฐ๊ฐ ์๋ค์...')
+ swalFire({ text: getMessage('module.roof.not.exist'), icon: 'warning' })
}
}
})
diff --git a/src/hooks/useContextMenu.js b/src/hooks/useContextMenu.js
index 4235d8db..9892788a 100644
--- a/src/hooks/useContextMenu.js
+++ b/src/hooks/useContextMenu.js
@@ -747,18 +747,18 @@ export function useContextMenu() {
{
id: 'moduleMove',
name: getMessage('contextmenu.module.move'),
- component: ,
+ component: ,
},
{
id: 'moduleCopy',
name: getMessage('contextmenu.module.copy'),
- component: ,
- },
- {
- id: 'moduleCircuitNumberEdit',
- name: getMessage('contextmenu.module.circuit.number.edit'),
- component: ,
+ component: ,
},
+ // {
+ // id: 'moduleCircuitNumberEdit',
+ // name: getMessage('contextmenu.module.circuit.number.edit'),
+ // component: ,
+ // },
],
])
break
diff --git a/src/locales/ko.json b/src/locales/ko.json
index 507f5415..e6d5290a 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -998,5 +998,6 @@
"menu.validation.canvas.roof": "ํจ๋์ ๋ฐฐ์นํ๋ ค๋ฉด ์ง๋ถ๋ฉด์ ์
๋ ฅํด์ผ ํฉ๋๋ค.",
"batch.object.outside.roof": "์ค๋ธ์ ํธ๋ ์ง๋ถ๋ด์ ์ค์นํด์ผ ํฉ๋๋ค.",
"batch.object.notinstall.cross": "์ค๋ธ์ ํธ๋ ๊ฒน์ณ์ ์ค์น ํ ์ ์์ต๋๋ค.",
- "module.not.batch.north": "๋ถ์ชฝ์๋ ๋ชจ๋์ ๋ฐฐ์นํ ์ ์์ต๋๋ค."
+ "module.not.batch.north": "๋ถ์ชฝ์๋ ๋ชจ๋์ ๋ฐฐ์นํ ์ ์์ต๋๋ค.",
+ "module.trestleDetail.not.exist": "๊ฐ๋ ์์ธ ์ ๋ณด๊ฐ ์์ต๋๋ค."
}
From c7ab2c2c33a7dcfb22237ccbecba6242ad20772c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 17:01:35 +0900
Subject: [PATCH 075/213] =?UTF-8?q?=EC=A7=80=EB=B6=95=EB=A9=B4=ED=95=A0?=
=?UTF-8?q?=EB=8B=B9=20=ED=8D=BC=EB=B8=94=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modal/roofAllocation/ContextRoofAllocationSetting.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
index bcd3dfe4..7d909db5 100644
--- a/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/ContextRoofAllocationSetting.jsx
@@ -183,6 +183,7 @@ export default function ContextRoofAllocationSetting(props) {
className="input-origin block"
onChange={(e) => {
handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
+ handleChangePitch(e, index)
}}
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
/>
From 1d76b0fb2f86ce75fa26a2c6f6c3c5f369775cd4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Wed, 5 Feb 2025 17:10:37 +0900
Subject: [PATCH 076/213] =?UTF-8?q?-=EB=8B=A8=EC=9C=84=ED=85=8C=EC=8A=A4?=
=?UTF-8?q?=ED=8A=B8(Unit=20Test)=20#564=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../modal/circuitTrestle/step/PowerConditionalSelect.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
index ee56d4c4..6b049002 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
@@ -157,6 +157,7 @@ export default function PowerConditionalSelect(props) {
const onChangeMaker = (option) => {
if (option) {
setModels([])
+ setSelectedModels([])
setSelectedMaker(option)
getPcsMakerList(option).then((res) => {
From b3481b4fce30b44a40b53b17541a4582f890f81d Mon Sep 17 00:00:00 2001
From: LEEYONGJAE
Date: Wed, 5 Feb 2025 17:44:58 +0900
Subject: [PATCH 077/213] =?UTF-8?q?=EB=A1=9C=EA=B7=B8=EC=9D=B8=20=ED=8E=98?=
=?UTF-8?q?=EC=9D=B4=EC=A7=80=20=EB=A1=9C=EB=94=A9=EB=B0=94=20=EC=B6=94?=
=?UTF-8?q?=EA=B0=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/auth/AutoLogin.jsx | 24 ++-
src/components/auth/Login.jsx | 299 ++++++++++++++++--------------
2 files changed, 174 insertions(+), 149 deletions(-)
diff --git a/src/components/auth/AutoLogin.jsx b/src/components/auth/AutoLogin.jsx
index 0d539cbb..d400f2c4 100644
--- a/src/components/auth/AutoLogin.jsx
+++ b/src/components/auth/AutoLogin.jsx
@@ -1,21 +1,27 @@
'use client'
+import { useState } from 'react'
import { useMessage } from '@/hooks/useMessage'
+import GlobalSpinner from '@/components/common/spinner/GlobalSpinner'
export default function AutoLoginPage() {
+ const [isLoading, setIsLoading] = useState(true)
const { getMessage } = useMessage()
return (
-
-
- {getMessage('site.name')}
- {getMessage('site.sub_name')}
-
-
-
- {getMessage('login.auto.page.text')}
+ <>
+ {isLoading &&
}
+
+
+ {getMessage('site.name')}
+ {getMessage('site.sub_name')}
+
+
+
+ {getMessage('login.auto.page.text')}
+
-
+ >
)
}
diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx
index eca80361..b23f9c53 100644
--- a/src/components/auth/Login.jsx
+++ b/src/components/auth/Login.jsx
@@ -10,14 +10,15 @@ import { useMessage } from '@/hooks/useMessage'
import { globalLocaleStore } from '@/store/localeAtom'
import { sessionStore } from '@/store/commonAtom'
import { useRouter } from 'next/navigation'
-
-import Cookies from 'js-cookie'
-
import { useSearchParams } from 'next/navigation'
+import GlobalSpinner from '@/components/common/spinner/GlobalSpinner'
+import Cookies from 'js-cookie'
import AutoLogin from './AutoLogin'
export default function Login() {
+ const [isLoading, setIsLoading] = useState(false)
+
// ์๋ ๋ก๊ทธ์ธ
const initParams = useSearchParams()
const autoLoginParam = initParams.get('autoLoginParam1')
@@ -35,11 +36,13 @@ export default function Login() {
}, [])
const autoLoginProcess = async (autoLoginParam) => {
+ setIsLoading(true)
await promisePost({ url: '/api/login/v1.0/user/login/autoLoginDecryptData', data: { loginId: autoLoginParam } })
.then((res) => {
if (res) {
if (res.data) {
post({ url: '/api/login/v1.0/user', data: { loginId: res.data } }).then((response) => {
+ setIsLoading(false)
if (response) {
const result = { ...response, storeLvl: response.groupId === '60000' ? '1' : '2', pwdInitYn: 'Y' }
setSession(result)
@@ -53,6 +56,7 @@ export default function Login() {
}
})
.catch((error) => {
+ setIsLoading(false)
router.push('/login')
})
}
@@ -93,9 +97,11 @@ export default function Login() {
loginId: formData.get('id'),
pwd: formData.get('password'),
}
+ setIsLoading(true)
await promisePost({ url: '/api/login/v1.0/login', data: param })
.then((res) => {
if (res) {
+ setIsLoading(false)
if (res.data.result.resultCode === 'S') {
setSession(res.data.data)
setSessionState(res.data.data)
@@ -105,7 +111,6 @@ export default function Login() {
} else {
Cookies.remove('chkLoginId')
}
- // router.push('/')
login()
} else {
alert(res.data.result.resultMsg)
@@ -113,6 +118,7 @@ export default function Login() {
}
})
.catch((error) => {
+ setIsLoading(false)
alert(error.response.data.message)
})
}
@@ -123,12 +129,14 @@ export default function Login() {
loginId: checkId,
email: checkEmail,
}
+ setIsLoading(true)
await promisePatch({
url: '/api/login/v1.0/user/init-password',
data: param,
})
.then((res) => {
if (res) {
+ setIsLoading(false)
if (res.data.result.resultCode == 'S') {
alert(getMessage('login.init_password.complete_message'))
setCheckId('')
@@ -140,36 +148,135 @@ export default function Login() {
}
})
.catch((error) => {
+ setIsLoading(false)
alert(error.response.data.message)
})
}
return (
-
-
-
-
-
- {!autoLoginParam && passwordReset === 1 && (
- <>
-
- {moduleData.rows.map((row) => (
- <>
-
- {moduleData.header.map((header) => (
- <>
- {header.type === 'color-box' && (
- |
-
-
- {row[header.prop].name}
-
- |
- )}
- {!header.type && header.type !== 'color-box' && {row[header.prop].name} | }
- >
- ))}
+ {selectedModules &&
+ selectedModules.itemList &&
+ selectedModules.itemList.map((row, index) => (
+
+ |
+
+
+ {row.itemNm}
+
+ |
+ {Number(row.shortAxis).toFixed(0)} |
+ {Number(row.longAxis).toFixed(0)} |
+ {Number(row.wpOut).toFixed(0)} |
- >
- ))}
- {Array.from({ length: 3 - moduleData.rows.length }).map((_, i) => (
-
- |
- |
- |
- |
-
- ))}
+ ))}
diff --git a/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx b/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx
index a292ed2d..660d3717 100644
--- a/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx
+++ b/src/components/floor-plan/modal/basic/step/pitch/PitchPlacement.jsx
@@ -1,49 +1,48 @@
import { forwardRef, useState, useEffect } from 'react'
import { useMessage } from '@/hooks/useMessage'
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
-import { canvasState } from '@/store/canvasAtom'
-import { useRecoilValue } from 'recoil'
+import { canvasState, checkedModuleState } from '@/store/canvasAtom'
+import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
import { POLYGON_TYPE } from '@/common/common'
import { useEvent } from '@/hooks/useEvent'
+import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
const PitchPlacement = forwardRef((props, refs) => {
const { getMessage } = useMessage()
const [setupLocation, setSetupLocation] = useState('south')
- const { makeModuleInstArea } = useModuleBasicSetting()
const canvas = useRecoilValue(canvasState)
const { initEvent } = useEvent()
- useEffect(() => {
- makeModuleInstArea()
- }, [])
+ const { selectedModules } = useModuleBasicSetting(3)
+ const setCheckedModules = useSetRecoilState(checkedModuleState)
+ const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //๋ค์์ผ๋ก ๋์ด๊ฐ๋ ์ต์ข
๋ฐ์ดํฐ
+ const [selectedItems, setSelectedItems] = useState({})
useEffect(() => {
handleChangeSetupLocation()
}, [setupLocation])
+ const handleSelectedItem = (e) => {
+ setSelectedItems({ ...selectedItems, [e.target.name]: e.target.checked })
+ }
+
const moduleData = {
header: [
{ type: 'check', name: '', prop: 'check', width: 70 },
{ type: 'color-box', name: getMessage('module'), prop: 'module' },
{ type: 'text', name: `${getMessage('output')} (W)`, prop: 'output', width: 70 },
],
- rows: [
- {
- check: false,
- module: { name: 'Re.RISE-G3 440', color: '#AA6768' },
- output: { name: '440' },
- },
- {
- check: false,
- module: {
- name: 'Re.RISE MS-G3 290',
- color: '#67A2AA',
- },
- output: { name: '240' },
- },
- ],
}
+ //์ฒดํฌ๋ ๋ชจ๋ ๋ฐ์ดํฐ
+ useEffect(() => {
+ const checkedModuleIds = Object.keys(selectedItems).filter((key) => selectedItems[key])
+ const moduleArray = selectedModules.itemList.filter((item) => {
+ return checkedModuleIds.includes(item.itemId)
+ })
+ setCheckedModules(moduleArray)
+ }, [selectedItems])
+
const handleSetupLocation = (e) => {
initEvent()
refs.setupLocation.current = e.target
@@ -81,6 +80,20 @@ const PitchPlacement = forwardRef((props, refs) => {
}
}
+ useEffect(() => {
+ if (moduleSelectionData && moduleSelectionData.flatModule.itemList.length > 0) {
+ let initCheckedModule = {}
+ moduleSelectionData.flatModule.itemList.forEach((obj, index) => {
+ if (index === 0) {
+ initCheckedModule = { [obj.itemId]: true }
+ } else {
+ initCheckedModule = { ...initCheckedModule, [obj.itemId]: true }
+ }
+ })
+ setSelectedItems(initCheckedModule)
+ }
+ }, [])
+
return (
<>
@@ -150,8 +160,7 @@ const PitchPlacement = forwardRef((props, refs) => {
name="radio01"
id="ra01"
value={'south'}
- checked={setupLocation === 'south'}
- defaultChecked
+ defaultChecked={setupLocation === 'south'}
onClick={handleSetupLocation}
/>
@@ -162,7 +171,7 @@ const PitchPlacement = forwardRef((props, refs) => {
name="radio01"
id="ra02"
value={'excreta'}
- checked={setupLocation === 'excreta'}
+ defaultChecked={setupLocation === 'excreta'}
onClick={handleSetupLocation}
/>
diff --git a/src/hooks/module/useModuleBasicSetting.js b/src/hooks/module/useModuleBasicSetting.js
index b6e0dad3..e8a07394 100644
--- a/src/hooks/module/useModuleBasicSetting.js
+++ b/src/hooks/module/useModuleBasicSetting.js
@@ -61,31 +61,42 @@ export function useModuleBasicSetting(tabNum) {
//๋ชจ๋ ์ ํ์์ ์ ํ๋ ๊ฐ๋ค ๋์ด์ด
useEffect(() => {
if (moduleSelectionData && tabNum === 3) {
- const common = moduleSelectionData.common
+ if (canvasSetting.roofSizeSet !== '3') {
+ const common = moduleSelectionData.common
- const roofConstructions = moduleSelectionData.roofConstructions
+ const roofConstructions = moduleSelectionData.roofConstructions
- const listParams = roofConstructions.map((item) => {
- return {
- ...common,
- moduleTpCd: selectedModules.itemTp,
- roofMatlCd: item.trestle.roofMatlCd,
- trestleMkrCd: item.trestle.trestleMkrCd,
- constMthdCd: item.trestle.constMthdCd,
- roofBaseCd: item.trestle.roofBaseCd,
- constTp: item.construction.constTp,
- mixMatlNo: selectedModules.mixMatlNo,
- roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
- inclCd: String(item.addRoof.pitch),
- roofIndex: item.addRoof.index,
- workingWidth: item.addRoof.lenBase,
+ const listParams = roofConstructions.map((item) => {
+ return {
+ ...common,
+ moduleTpCd: selectedModules.itemTp,
+ roofMatlCd: item.trestle.roofMatlCd,
+ trestleMkrCd: item.trestle.trestleMkrCd,
+ constMthdCd: item.trestle.constMthdCd,
+ roofBaseCd: item.trestle.roofBaseCd,
+ constTp: item.construction.constTp,
+ mixMatlNo: selectedModules.mixMatlNo,
+ roofPitch: item.addRoof.hajebichi ? item.addRoof.hajebichi : 0,
+ inclCd: String(item.addRoof.pitch),
+ roofIndex: item.addRoof.index,
+ workingWidth: item.addRoof.lenBase,
+ }
+ })
+ setTrestleDetailParams(listParams)
+
+ //๋ถ๋ฉด ์ค์น ๊ฐ๋ฅ ํ๋งค์
+ if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
+ setSaleStoreNorthFlg(true)
}
- })
- setTrestleDetailParams(listParams)
-
- //๋ถ๋ฉด ์ค์น ๊ฐ๋ฅ ํ๋งค์
- if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
- setSaleStoreNorthFlg(true)
+ } else {
+ //์ก์ง๋ถ ์ผ๊ฒฝ์ฐ์๋ ๋ฐ๋ก ๋ฐฐ์น๋ฉด ์ค์นLL
+ const roofs = canvas.getObjects().filter((roof) => roof.name === 'roof')
+ canvas
+ .getObjects()
+ .filter((roof) => roof.name === 'roof')
+ .forEach((roof) => {
+ makeModuleInstArea(roof, null)
+ })
}
}
}, [moduleSelectionData])
@@ -122,8 +133,6 @@ export function useModuleBasicSetting(tabNum) {
//๋ฐฐ์น๋ฉด ์ค์น ์์ญ
makeModuleInstArea(roof, detail.data)
//surface์ ์์ธ ๋ฐ์ดํฐ ์ถ๊ฐ
- } else {
- swalFire({ text: getMessage('module.roof.not.exist'), icon: 'warning' })
}
}
})
@@ -191,23 +200,23 @@ export function useModuleBasicSetting(tabNum) {
return
}
- let offsetLength = canvasSetting.roofSizeSet === '3' ? -90 : (trestleDetail.eaveIntvl / 10) * -1
+ let offsetLength = canvasSetting.roofSizeSet === '3' ? -30 : (trestleDetail.eaveIntvl / 10) * -1
setSurfaceShapePattern(roof, roofDisplay.column, true) //ํจํด ๋ณ๊ฒฝ
const offsetPoints = offsetPolygon(roof.points, offsetLength) //์์ชฝ offset
//๋ชจ๋์ค์น์์ญ?? ์์ฑ
const surfaceId = uuidv4()
-
let isNorth = false
- //๋ถ๋ฉด์ด ์์ง๋ง
- if (roof.directionText && roof.directionText.indexOf('ๅ') > -1) {
- //๋ถ์ชฝ์ผ๋ ํด๋น ์๋ถ์, ๋๋ถ๋์ ์ ์ธํ๋ค๊ณ ํ๋ค
- if (!(roof.directionText.indexOf('่ฅฟๅ่ฅฟ') > -1 || roof.directionText.indexOf('ๆฑๅๆฑ') > -1)) {
- isNorth = true
+ if (canvasSetting.roofSizeSet !== '3') {
+ //๋ถ๋ฉด์ด ์์ง๋ง
+ if (roof.directionText && roof.directionText.indexOf('ๅ') > -1) {
+ //๋ถ์ชฝ์ผ๋ ํด๋น ์๋ถ์, ๋๋ถ๋์ ์ ์ธํ๋ค๊ณ ํ๋ค
+ if (!(roof.directionText.indexOf('่ฅฟๅ่ฅฟ') > -1 || roof.directionText.indexOf('ๆฑๅๆฑ') > -1)) {
+ isNorth = true
+ }
}
}
-
//๋ชจ๋์ค์น๋ฉด ์์ฑ
let setupSurface = new QPolygon(offsetPoints, {
stroke: 'red',
@@ -243,7 +252,7 @@ export function useModuleBasicSetting(tabNum) {
//์ง๋ถ๋ฉด ์ ํ ๊ธ์ง
roof.set({
selectable: false, //์ ํ ๊ธ์ง
- evented: false, //ํด๋ฆญ ์ด๋ฒคํธ๋ ๊ธ์ง
+ // evented: false, //ํด๋ฆญ ์ด๋ฒคํธ๋ ๊ธ์ง
})
canvas.renderAll()
@@ -325,15 +334,9 @@ export function useModuleBasicSetting(tabNum) {
}
useEffect(() => {
- console.log('๋ฆฌ์ฝ์ผ ๋ฐ๋๋??')
- console.log('isManualModuleSetup', isManualModuleSetup)
- console.log('saleStoreNorthFlg', saleStoreNorthFlg)
-
if (moduleSelectionData.common.saleStoreNorthFlg === '1') {
setSaleStoreNorthFlg(true)
}
-
- manualModuleSetup()
}, [isManualModuleSetup])
/**
@@ -440,10 +443,6 @@ export function useModuleBasicSetting(tabNum) {
parentId: moduleSetupSurfaces[i].parentId,
})
- console.log('trestlePolygon', trestlePolygon)
- console.log('saleStoreNorthFlg', saleStoreNorthFlg)
- console.log('trestlePolygon.isNorth', trestlePolygon.isNorth)
-
//๋ถ๋ฉด์ด๊ณ ๋ถ๋ฉด์ค์น์์ ์ด ์๋๋ฉด ๊ทธ๋ฅ return
if (trestlePolygon.isNorth && !saleStoreNorthFlg) {
return
@@ -797,51 +796,6 @@ export function useModuleBasicSetting(tabNum) {
return turf.booleanContains(turfModuleSetupSurface, squarePolygon) || turf.booleanWithin(squarePolygon, turfModuleSetupSurface)
}
- /**
- * ๋ชจ๋์ ๋๋น์ ๋์ด๋ฅผ ๊ณ์ฐํ๋ ํจ์
- * @param {object} maxLengthLine ์ต๋ ๊ธธ์ด ๋ผ์ธ
- * @param {object} moduleSetupSurface ๋ชจ๋ ์ค์น๋ฉด
- * @param {object} module ๋ชจ๋
- * @returns {object} ๋ชจ๋์ ๋๋น์ ๋์ด
- */
- const getModuleWidthHeight = (maxLengthLine, moduleSetupSurface, module) => {
- let tmpWidth =
- (maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? Number(module.longAxis) : Number(module.shortAxis)) / 10
- let tmpHeight =
- (maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? Number(module.shortAxis) : Number(module.longAxis)) / 10
-
- //๋ฐฐ์น๋ฉด๋๋ ๋ฐฉํฅ์ชฝ์ผ๋ก ํจ๋์ด ๋๊ฒ ๋์์ ธ์ผํจ
- if (moduleSetupSurface.flowDirection !== undefined) {
- tmpWidth =
- (moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north'
- ? Number(module.longAxis)
- : Number(module.shortAxis)) / 10
- tmpHeight =
- (moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north'
- ? Number(module.shortAxis)
- : Number(module.longAxis)) / 10
- }
-
- console.log(canvasSetting)
-
- return canvasSetting.roofSizeSet === '1'
- ? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.flowDirection)
- : { width: tmpWidth, height: tmpHeight }
- }
-
- const getFlowLines = (moduleSetupSurface, module) => {
- let flowLines = {}
- if (canvasSetting.roofSizeSet !== '3') {
- flowLines = {
- bottom: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'bottom'),
- top: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'top'),
- left: leftRightFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'left'),
- right: leftRightFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'right'),
- }
- }
- return flowLines
- }
-
const downFlowSetupModule = (
surfaceMaxLines,
maxLengthLine,
@@ -859,7 +813,7 @@ export function useModuleBasicSetting(tabNum) {
const flowLines = getFlowLines(moduleSetupSurface, module)
//์ก์ง๋ถ์ด ์๋๋๋ง ๋ฃ๋๋ค ์ก์ง๋ถ์ผ๋ ํด๋ฆญ ์ด๋ฒคํธ์ ๋ณ๋๋ก ๋ฃ์ด๋์
- let startPoint = flowLines.bottom
+ let startPoint = flowLines.left
const moduleArray = []
if (isCenter) {
@@ -947,6 +901,7 @@ export function useModuleBasicSetting(tabNum) {
}
} else {
tempModule.set({ fill: 'rgba(255,190,41, 0.4)', stroke: 'black', strokeWidth: 1 })
+ canvas?.add(tempModule)
}
}
}
@@ -1464,13 +1419,13 @@ export function useModuleBasicSetting(tabNum) {
const pointX2 = coords[2].x + ((coords[2].y - top) / (coords[2].y - coords[1].y)) * (coords[1].x - coords[2].x)
const pointY2 = top
- // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
- // stroke: 'red',
- // strokeWidth: 1,
- // selectable: true,
- // })
- // canvas?.add(finalLine)
- // canvas?.renderAll()
+ const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
+ stroke: 'red',
+ strokeWidth: 1,
+ selectable: true,
+ })
+ canvas?.add(finalLine)
+ canvas?.renderAll()
let rtnObj
//ํํํ๋ฉด
@@ -1587,13 +1542,13 @@ export function useModuleBasicSetting(tabNum) {
const pointX2 = top
const pointY2 = coords[2].y + ((coords[2].x - top) / (coords[2].x - coords[1].x)) * (coords[1].y - coords[2].y)
- // const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
- // stroke: 'red',
- // strokeWidth: 1,
- // selectable: true,
- // })
- // canvas?.add(finalLine)
- // canvas?.renderAll()
+ const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
+ stroke: 'red',
+ strokeWidth: 1,
+ selectable: true,
+ })
+ canvas?.add(finalLine)
+ canvas?.renderAll()
let rtnObj
//ํํํ๋ฉด
@@ -1685,322 +1640,361 @@ export function useModuleBasicSetting(tabNum) {
const manualFlatroofModuleSetup = (placementFlatRef) => {
let moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //๋ชจ๋์ค์น๋ฉด๋ฅผ ๊ฐ์ ธ์ด
- let flatBatchType = placementFlatRef.setupLocation.current.value
-
- const batchObjects = canvas
- ?.getObjects()
- .filter(
- (obj) =>
- obj.name === BATCH_TYPE.OPENING ||
- obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
- obj.name === BATCH_TYPE.PENTAGON_DORMER ||
- obj.name === BATCH_TYPE.SHADOW,
- ) //๋๋จธs ๊ฐ์ฒด
-
- const moduleOptions = {
- fill: '#BFFD9F',
- stroke: 'black',
- strokeWidth: 0.1,
- selectable: true, // ์ ํ ๊ฐ๋ฅํ๊ฒ ์ค์
- lockMovementX: true, // X ์ถ ์ด๋ ์ ๊ธ
- lockMovementY: true, // Y ์ถ ์ด๋ ์ ๊ธ
- lockRotation: true, // ํ์ ์ ๊ธ
- lockScalingX: true, // X ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
- lockScalingY: true, // Y ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
- parentId: moduleSetupSurface.parentId,
- surfaceId: moduleSetupSurface.id,
- name: POLYGON_TYPE.MODULE,
- }
-
- if (moduleSetupSurfaces.length !== 0) {
- let tempModule
- let manualDrawModules = []
- let inside = false
- let turfPolygon
- let flowDirection
- let trestlePolygon
-
- //๋จ์ชฝ ์ ํ
- if (flatBatchType === 'excreta') {
- //๋ณ๋ณ๋ก ์ ํ
- const excretaLines = canvas.getObjects().filter((obj) => obj.name === 'flatExcretaLine')
- excretaLines.forEach((obj) => {
- if (obj.isSelected === true) {
- const points1 = { x: obj.x1, y: obj.y1 }
- const points2 = { x: obj.x2, y: obj.y2 }
- const angle = calculateAngle(points1, points2)
-
- //๋ณ๋ณ๋ก ์ ํ์ผ๋ก ๋์ด์์๋ ๋ชจ๋๋ฉด์ ํ์ ์ํค๊ธฐ
- const targetdSurface = moduleSetupSurfaces.filter((surface) => surface.surfaceId === obj.surfaceId)[0]
- targetdSurface.angle = -angle
- //๋ณ๋ณ๋ก ์ ํ๋์ด์๋ ์ง๋ถ๋ ํ์ ์ํค๊ธฐ
- const targetRoof = canvas.getObjects().filter((roof) => roof.name === POLYGON_TYPE.ROOF && roof.id === targetdSurface.parentId)[0]
- targetRoof.angle = -angle
-
- targetRoof.fire('modified')
- targetdSurface.fire('modified')
- }
- canvas.remove(obj)
- })
- } else {
- moduleSetupSurfaces.forEach((surface) => {
- const targetRoof = canvas.getObjects().filter((roof) => roof.name === POLYGON_TYPE.ROOF && roof.id === surface.parentId)[0]
- if (targetRoof) targetRoof.angle = -compasDeg
- surface.angle = -compasDeg
- })
+ if (isManualModuleSetup) {
+ if (checkedModule.length === 0) {
+ swalFire({ text: getMessage('module.place.select.module') })
+ setIsManualModuleSetup(!isManualModuleSetup)
+ return
}
- canvas.renderAll()
- addCanvasMouseEventListener('mouse:move', (e) => {
- //๋ง์ฐ์ค ์ด๋ฒคํธ ์ญ์ ํ ์ฌ์ถ๊ฐ
- const mousePoint = canvas.getPointer(e.e)
+ if (checkedModule.length > 1) {
+ swalFire({ text: getMessage('module.place.select.one.module') })
+ setIsManualModuleSetup(!isManualModuleSetup)
+ return
+ }
- for (let i = 0; i < moduleSetupSurfaces.length; i++) {
- turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
- trestlePolygon = moduleSetupSurfaces[i]
- manualDrawModules = moduleSetupSurfaces[i].modules // ์์์ ์๋์ผ๋ก ํ์๋ ์ถ๊ฐ๋จ
- flowDirection = moduleSetupSurfaces[i].flowDirection //๋ํ์ ๋ฐฉํฅ
- let width = flowDirection === 'south' || flowDirection === 'north' ? 172 : 113
- let height = flowDirection === 'south' || flowDirection === 'north' ? 113 : 172
+ let flatBatchType = placementFlatRef.setupLocation.current.value
- const points = [
- { x: mousePoint.x - width / 2, y: mousePoint.y - height / 2 },
- { x: mousePoint.x + width / 2, y: mousePoint.y - height / 2 },
- { x: mousePoint.x + width / 2, y: mousePoint.y + height / 2 },
- { x: mousePoint.x - width / 2, y: mousePoint.y + height / 2 },
- ]
+ const batchObjects = canvas
+ ?.getObjects()
+ .filter(
+ (obj) =>
+ obj.name === BATCH_TYPE.OPENING ||
+ obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
+ obj.name === BATCH_TYPE.PENTAGON_DORMER ||
+ obj.name === BATCH_TYPE.SHADOW,
+ ) //๋๋จธs ๊ฐ์ฒด
- const turfPoints = coordToTurfPolygon(points)
+ let moduleOptions = {
+ fill: '#BFFD9F',
+ stroke: 'black',
+ strokeWidth: 0.1,
+ selectable: true, // ์ ํ ๊ฐ๋ฅํ๊ฒ ์ค์
+ lockMovementX: true, // X ์ถ ์ด๋ ์ ๊ธ
+ lockMovementY: true, // Y ์ถ ์ด๋ ์ ๊ธ
+ lockRotation: true, // ํ์ ์ ๊ธ
+ lockScalingX: true, // X ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
+ lockScalingY: true, // Y ์ถ ํฌ๊ธฐ ์กฐ์ ์ ๊ธ
+ parentId: moduleSetupSurface.parentId,
+ surfaceId: moduleSetupSurface.id,
+ name: POLYGON_TYPE.MODULE,
+ }
- if (turf.booleanWithin(turfPoints, turfPolygon)) {
- let isDrawing = false
+ if (moduleSetupSurfaces.length !== 0) {
+ let tempModule
+ let manualDrawModules = []
+ let inside = false
+ let turfPolygon
+ let flowDirection
+ let trestlePolygon
- if (isDrawing) return
- canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule')) //์์ง์ผ๋ ์ผ๋จ ์ง์๊ฐ๋ฉด์ ์์ง์
+ //๋จ์ชฝ ์ ํ
+ if (flatBatchType === 'excreta') {
+ //๋ณ๋ณ๋ก ์ ํ
+ const excretaLines = canvas.getObjects().filter((obj) => obj.name === 'flatExcretaLine')
+ excretaLines.forEach((obj) => {
+ if (obj.isSelected === true) {
+ const points1 = { x: obj.x1, y: obj.y1 }
+ const points2 = { x: obj.x2, y: obj.y2 }
+ const angle = calculateAngle(points1, points2)
- tempModule = new fabric.Rect({
- fill: 'white',
- stroke: 'black',
- strokeWidth: 0.3,
- width: width,
- height: height,
- left: mousePoint.x - width / 2,
- top: mousePoint.y - height / 2,
- selectable: false,
- lockMovementX: true,
- lockMovementY: true,
- lockRotation: true,
- lockScalingX: true,
- lockScalingY: true,
- name: 'tempModule',
- parentId: moduleSetupSurfaces[i].parentId,
- })
+ //๋ณ๋ณ๋ก ์ ํ์ผ๋ก ๋์ด์์๋ ๋ชจ๋๋ฉด์ ํ์ ์ํค๊ธฐ
+ const targetdSurface = moduleSetupSurfaces.filter((surface) => surface.surfaceId === obj.surfaceId)[0]
+ targetdSurface.angle = -angle
+ //๋ณ๋ณ๋ก ์ ํ๋์ด์๋ ์ง๋ถ๋ ํ์ ์ํค๊ธฐ
+ const targetRoof = canvas.getObjects().filter((roof) => roof.name === POLYGON_TYPE.ROOF && roof.id === targetdSurface.parentId)[0]
+ targetRoof.angle = -angle
- canvas?.add(tempModule) //์์ง์ฌ๊ฐ๋ฉด์ ์ถ๊ฐ๋จ
+ targetRoof.fire('modified')
+ targetdSurface.fire('modified')
+ }
+ canvas.remove(obj)
+ })
+ } else {
+ moduleSetupSurfaces.forEach((surface) => {
+ const targetRoof = canvas.getObjects().filter((roof) => roof.name === POLYGON_TYPE.ROOF && roof.id === surface.parentId)[0]
+ if (targetRoof) targetRoof.angle = -compasDeg
+ surface.angle = -compasDeg
+ })
+ }
+ canvas.renderAll()
- /**
- * ์ค๋
๊ธฐ๋ฅ
- */
- let snapDistance = 10
- let cellSnapDistance = 20
+ addCanvasMouseEventListener('mouse:move', (e) => {
+ //๋ง์ฐ์ค ์ด๋ฒคํธ ์ญ์ ํ ์ฌ์ถ๊ฐ
+ const mousePoint = canvas.getPointer(e.e)
- const trestleLeft = moduleSetupSurfaces[i].left
- const trestleTop = moduleSetupSurfaces[i].top
- const trestleRight = trestleLeft + moduleSetupSurfaces[i].width * moduleSetupSurfaces[i].scaleX
- const trestleBottom = trestleTop + moduleSetupSurfaces[i].height * moduleSetupSurfaces[i].scaleY
- const bigCenterY = (trestleTop + trestleTop + moduleSetupSurfaces[i].height) / 2
+ for (let i = 0; i < moduleSetupSurfaces.length; i++) {
+ turfPolygon = polygonToTurfPolygon(moduleSetupSurfaces[i], true)
+ trestlePolygon = moduleSetupSurfaces[i]
+ manualDrawModules = moduleSetupSurfaces[i].modules // ์์์ ์๋์ผ๋ก ํ์๋ ์ถ๊ฐ๋จ
+ flowDirection = moduleSetupSurfaces[i].flowDirection //๋ํ์ ๋ฐฉํฅ
- // ์์ ํด๋ฆฌ๊ณค์ ๊ฒฝ๊ณ ์ขํ ๊ณ์ฐ
- const smallLeft = tempModule.left
- const smallTop = tempModule.top
- const smallRight = smallLeft + tempModule.width * tempModule.scaleX
- const smallBottom = smallTop + tempModule.height * tempModule.scaleY
- const smallCenterX = smallLeft + (tempModule.width * tempModule.scaleX) / 2
- const smallCenterY = smallTop + (tempModule.height * tempModule.scaleX) / 2
+ const moduleWidth = Number(checkedModule[0].longAxis) / 10
+ const moduleHeight = Number(checkedModule[0].shortAxis) / 10
- /**
- * ๋ฏธ๋ฆฌ ๊น์๋์ ์
์ด ์์๋ ์
์ ํก์ฐฉ๋จ
- */
- if (manualDrawModules) {
- manualDrawModules.forEach((cell) => {
- const holdCellLeft = cell.left
- const holdCellTop = cell.top
- const holdCellRight = holdCellLeft + cell.width * cell.scaleX
- const holdCellBottom = holdCellTop + cell.height * cell.scaleY
- const holdCellCenterX = holdCellLeft + (cell.width * cell.scaleX) / 2
- const holdCellCenterY = holdCellTop + (cell.height * cell.scaleY) / 2
+ let tmpWidth = flowDirection === 'south' || flowDirection === 'north' ? moduleWidth : moduleHeight
+ let tmpHeight = flowDirection === 'south' || flowDirection === 'north' ? moduleHeight : moduleWidth
- //์ค์น๋ ์
์ ์ข์ธก์ ์ค๋
- if (Math.abs(smallRight - holdCellLeft) < snapDistance) {
- tempModule.left = holdCellLeft - width - 1
+ let { width, height } =
+ canvasSetting.roofSizeSet === '1'
+ ? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurfaces[i].roofMaterial.pitch), flowDirection)
+ : { width: tmpWidth, height: tmpHeight }
+
+ const points = [
+ { x: mousePoint.x - width / 2, y: mousePoint.y - height / 2 },
+ { x: mousePoint.x + width / 2, y: mousePoint.y - height / 2 },
+ { x: mousePoint.x + width / 2, y: mousePoint.y + height / 2 },
+ { x: mousePoint.x - width / 2, y: mousePoint.y + height / 2 },
+ ]
+
+ const turfPoints = coordToTurfPolygon(points)
+
+ if (turf.booleanWithin(turfPoints, turfPolygon)) {
+ let isDrawing = false
+
+ if (isDrawing) return
+ canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule')) //์์ง์ผ๋ ์ผ๋จ ์ง์๊ฐ๋ฉด์ ์์ง์
+
+ tempModule = new fabric.Rect({
+ fill: 'white',
+ stroke: 'black',
+ strokeWidth: 0.3,
+ width: width,
+ height: height,
+ left: mousePoint.x - width / 2,
+ top: mousePoint.y - height / 2,
+ selectable: false,
+ lockMovementX: true,
+ lockMovementY: true,
+ lockRotation: true,
+ lockScalingX: true,
+ lockScalingY: true,
+ name: 'tempModule',
+ parentId: moduleSetupSurfaces[i].parentId,
+ })
+
+ canvas?.add(tempModule) //์์ง์ฌ๊ฐ๋ฉด์ ์ถ๊ฐ๋จ
+
+ /**
+ * ์ค๋
๊ธฐ๋ฅ
+ */
+ let snapDistance = 10
+ let cellSnapDistance = 20
+
+ let intvHor = flowDirection === 'south' || flowDirection === 'north' ? 1 : 3
+ let intvVer = flowDirection === 'south' || flowDirection === 'north' ? 3 : 1
+
+ const trestleLeft = moduleSetupSurfaces[i].left
+ const trestleTop = moduleSetupSurfaces[i].top
+ const trestleRight = trestleLeft + moduleSetupSurfaces[i].width * moduleSetupSurfaces[i].scaleX
+ const trestleBottom = trestleTop + moduleSetupSurfaces[i].height * moduleSetupSurfaces[i].scaleY
+ const bigCenterY = (trestleTop + trestleTop + moduleSetupSurfaces[i].height) / 2
+
+ // ์์ ํด๋ฆฌ๊ณค์ ๊ฒฝ๊ณ ์ขํ ๊ณ์ฐ
+ const smallLeft = tempModule.left
+ const smallTop = tempModule.top
+ const smallRight = smallLeft + tempModule.width * tempModule.scaleX
+ const smallBottom = smallTop + tempModule.height * tempModule.scaleY
+ const smallCenterX = smallLeft + (tempModule.width * tempModule.scaleX) / 2
+ const smallCenterY = smallTop + (tempModule.height * tempModule.scaleX) / 2
+
+ /**
+ * ๋ฏธ๋ฆฌ ๊น์๋์ ์
์ด ์์๋ ์
์ ํก์ฐฉ๋จ
+ */
+ if (manualDrawModules) {
+ manualDrawModules.forEach((cell) => {
+ const holdCellLeft = cell.left
+ const holdCellTop = cell.top
+ const holdCellRight = holdCellLeft + cell.width * cell.scaleX
+ const holdCellBottom = holdCellTop + cell.height * cell.scaleY
+ const holdCellCenterX = holdCellLeft + (cell.width * cell.scaleX) / 2
+ const holdCellCenterY = holdCellTop + (cell.height * cell.scaleY) / 2
+
+ //์ค์น๋ ์
์ ์ข์ธก์ ์ค๋
+ if (Math.abs(smallRight - holdCellLeft) < snapDistance) {
+ tempModule.left = holdCellLeft - width - intvHor
+ }
+
+ //์ค์น๋ ์
์ ์ฐ์ธก์ ์ค๋
+ if (Math.abs(smallLeft - holdCellRight) < snapDistance) {
+ tempModule.left = holdCellRight + intvHor
+ }
+
+ //์ค์น๋ ์
์ ์์ชฝ์ ์ค๋
+ if (Math.abs(smallBottom - holdCellTop) < snapDistance) {
+ tempModule.top = holdCellTop - height - intvVer
+ }
+
+ //์ค์น๋ ์
์ ๋ฐ์ชฝ์ ์ค๋
+ if (Math.abs(smallTop - holdCellBottom) < snapDistance) {
+ tempModule.top = holdCellBottom + intvVer
+ }
+ //๊ฐ์ด๋ฐ -> ๊ฐ์ด๋ฐ
+ if (Math.abs(smallCenterX - holdCellCenterX) < cellSnapDistance) {
+ tempModule.left = holdCellCenterX - width / 2
+ }
+ //์ผ์ชฝ -> ๊ฐ์ด๋ฐ
+ if (Math.abs(smallLeft - holdCellCenterX) < cellSnapDistance) {
+ tempModule.left = holdCellCenterX
+ }
+ // ์ค๋ฅธ์ชฝ -> ๊ฐ์ด๋ฐ
+ if (Math.abs(smallRight - holdCellCenterX) < cellSnapDistance) {
+ tempModule.left = holdCellCenterX - width
+ }
+ //์ธ๋ก ๊ฐ์ด๋ฐ -> ๊ฐ์ด๋ฐ
+ if (Math.abs(smallCenterY - holdCellCenterY) < cellSnapDistance) {
+ tempModule.top = holdCellCenterY - height / 2
+ }
+ // //์์ชฝ -> ๊ฐ์ด๋ฐ
+ // if (Math.abs(smallTop - holdCellCenterY) < cellSnapDistance) {
+ // tempModule.top = holdCellCenterY
+ // }
+ // //์๋ซ์ชฝ -> ๊ฐ์ด๋ฐ
+ // if (Math.abs(smallBottom - holdCellCenterY) < cellSnapDistance) {
+ // tempModule.top = holdCellCenterY - height
+ // }
+ })
+ }
+
+ // ์์ชฝ ๋ณ์ ์ค๋
+ if (Math.abs(smallTop - trestleTop) < snapDistance) {
+ tempModule.top = trestleTop
+ }
+
+ // ์๋์ชฝ ๋ณ์ ์ค๋
+ if (Math.abs(smallTop + tempModule.height * tempModule.scaleY - (trestleTop + moduleSetupSurfaces[i].height)) < snapDistance) {
+ tempModule.top = trestleTop + moduleSetupSurfaces[i].height - tempModule.height * tempModule.scaleY
+ }
+
+ // ์ผ์ชฝ๋ณ์ ์ค๋
+ if (Math.abs(smallLeft - trestleLeft) < snapDistance) {
+ tempModule.left = trestleLeft
+ }
+ //์ค๋ฅธ์ชฝ ๋ณ์ ์ค๋
+ if (Math.abs(smallRight - trestleRight) < snapDistance) {
+ tempModule.left = trestleRight - tempModule.width * tempModule.scaleX
+ }
+
+ if (flowDirection === 'south' || flowDirection === 'north') {
+ // ๋ชจ๋์ผ์ชฝ์ด ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
+ if (Math.abs(smallLeft - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
+ tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2
}
- //์ค์น๋ ์
์ ์ฐ์ธก์ ์ค๋
- if (Math.abs(smallLeft - holdCellRight) < snapDistance) {
- tempModule.left = holdCellRight + 1
+ // ๋ชจ๋์ด ๊ฐ์ด๋ฐ๊ฐ ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
+ if (Math.abs(smallCenterX - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
+ tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - (tempModule.width * tempModule.scaleX) / 2
}
- //์ค์น๋ ์
์ ์์ชฝ์ ์ค๋
- if (Math.abs(smallBottom - holdCellTop) < snapDistance) {
- tempModule.top = holdCellTop - height - 1
+ // ๋ชจ๋์ค๋ฅธ์ชฝ์ด ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
+ if (Math.abs(smallRight - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
+ tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - tempModule.width * tempModule.scaleX
+ }
+ } else {
+ // ๋ชจ๋์ด ๊ฐ๋ก์ค์์ ์ ์ค๋
+ if (Math.abs(smallTop + tempModule.height / 2 - bigCenterY) < snapDistance) {
+ tempModule.top = bigCenterY - tempModule.height / 2
}
- //์ค์น๋ ์
์ ๋ฐ์ชฝ์ ์ค๋
- if (Math.abs(smallTop - holdCellBottom) < snapDistance) {
- tempModule.top = holdCellBottom + 1
+ if (Math.abs(smallTop - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
+ tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2
}
- //๊ฐ์ด๋ฐ -> ๊ฐ์ด๋ฐ
- if (Math.abs(smallCenterX - holdCellCenterX) < cellSnapDistance) {
- tempModule.left = holdCellCenterX - width / 2
+ // ๋ชจ๋ ๋ฐ๋ฉด์ด ๊ฐ๋ก์ค์์ ์ ์ค๋
+ if (Math.abs(smallBottom - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
+ tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2 - tempModule.height * tempModule.scaleY
}
- //์ผ์ชฝ -> ๊ฐ์ด๋ฐ
- if (Math.abs(smallLeft - holdCellCenterX) < cellSnapDistance) {
- tempModule.left = holdCellCenterX
+ }
+
+ tempModule.setCoords()
+ canvas?.renderAll()
+ inside = true
+ break
+ } else {
+ inside = false
+ }
+ }
+
+ if (!inside) {
+ // tempModule.set({ fill: 'red' })
+ canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule'))
+ canvas?.renderAll()
+ }
+ })
+
+ addCanvasMouseEventListener('mouse:up', (e) => {
+ let isIntersection = true
+ if (!inside) return
+ if (tempModule) {
+ const rectPoints = [
+ { x: tempModule.left, y: tempModule.top },
+ { x: tempModule.left + tempModule.width * tempModule.scaleX, y: tempModule.top },
+ {
+ x: tempModule.left + tempModule.width * tempModule.scaleX,
+ y: tempModule.top + tempModule.height * tempModule.scaleY,
+ },
+ { x: tempModule.left, y: tempModule.top + tempModule.height * tempModule.scaleY },
+ ]
+
+ tempModule.set({ points: rectPoints })
+ const tempTurfModule = polygonToTurfPolygon(tempModule)
+
+ //๋๋จธ ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ด
+ if (batchObjects) {
+ batchObjects.forEach((object) => {
+ let dormerTurfPolygon
+
+ if (object.type === 'group') {
+ //๋๋จธ๋ ๊ทธ๋ฃนํํ์
+ dormerTurfPolygon = batchObjectGroupToTurfPolygon(object)
+ } else {
+ //๊ฐ๊ตฌ, ๊ทธ๋ฆผ์
+ dormerTurfPolygon = polygonToTurfPolygon(rectToPolygon(object))
}
- // ์ค๋ฅธ์ชฝ -> ๊ฐ์ด๋ฐ
- if (Math.abs(smallRight - holdCellCenterX) < cellSnapDistance) {
- tempModule.left = holdCellCenterX - width
+
+ const intersection = turf.intersect(turf.featureCollection([dormerTurfPolygon, tempTurfModule])) //๊ฒน์น๋์ง ํ์ธ
+ //๊ฒน์น๋ฉด ์๋จ
+ if (intersection) {
+ swalFire({ text: getMessage('module.place.overobject') })
+ isIntersection = false
}
- //์ธ๋ก ๊ฐ์ด๋ฐ -> ๊ฐ์ด๋ฐ
- if (Math.abs(smallCenterY - holdCellCenterY) < cellSnapDistance) {
- tempModule.top = holdCellCenterY - height / 2
- }
- // //์์ชฝ -> ๊ฐ์ด๋ฐ
- // if (Math.abs(smallTop - holdCellCenterY) < cellSnapDistance) {
- // tempModule.top = holdCellCenterY
- // }
- // //์๋ซ์ชฝ -> ๊ฐ์ด๋ฐ
- // if (Math.abs(smallBottom - holdCellCenterY) < cellSnapDistance) {
- // tempModule.top = holdCellCenterY - height
- // }
})
}
- // ์์ชฝ ๋ณ์ ์ค๋
- if (Math.abs(smallTop - trestleTop) < snapDistance) {
- tempModule.top = trestleTop
- }
+ if (!isIntersection) return
- // ์๋์ชฝ ๋ณ์ ์ค๋
- if (Math.abs(smallTop + tempModule.height * tempModule.scaleY - (trestleTop + moduleSetupSurfaces[i].height)) < snapDistance) {
- tempModule.top = trestleTop + moduleSetupSurfaces[i].height - tempModule.height * tempModule.scaleY
- }
-
- // ์ผ์ชฝ๋ณ์ ์ค๋
- if (Math.abs(smallLeft - trestleLeft) < snapDistance) {
- tempModule.left = trestleLeft
- }
- //์ค๋ฅธ์ชฝ ๋ณ์ ์ค๋
- if (Math.abs(smallRight - trestleRight) < snapDistance) {
- tempModule.left = trestleRight - tempModule.width * tempModule.scaleX
- }
-
- if (flowDirection === 'south' || flowDirection === 'north') {
- // ๋ชจ๋์ผ์ชฝ์ด ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
- if (Math.abs(smallLeft - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
- tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2
- }
-
- // ๋ชจ๋์ด ๊ฐ์ด๋ฐ๊ฐ ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
- if (Math.abs(smallCenterX - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
- tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - (tempModule.width * tempModule.scaleX) / 2
- }
-
- // ๋ชจ๋์ค๋ฅธ์ชฝ์ด ์ธ๋ก์ค์์ ์ ๋ถ๊ฒ ์ค๋
- if (Math.abs(smallRight - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
- tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - tempModule.width * tempModule.scaleX
- }
- } else {
- // ๋ชจ๋์ด ๊ฐ๋ก์ค์์ ์ ์ค๋
- if (Math.abs(smallTop + tempModule.height / 2 - bigCenterY) < snapDistance) {
- tempModule.top = bigCenterY - tempModule.height / 2
- }
-
- if (Math.abs(smallTop - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
- tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2
- }
- // ๋ชจ๋ ๋ฐ๋ฉด์ด ๊ฐ๋ก์ค์์ ์ ์ค๋
- if (Math.abs(smallBottom - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
- tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2 - tempModule.height * tempModule.scaleY
- }
- }
-
- tempModule.setCoords()
- canvas?.renderAll()
- inside = true
- break
- } else {
- inside = false
- }
- }
-
- if (!inside) {
- // tempModule.set({ fill: 'red' })
- canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule'))
- canvas?.renderAll()
- }
- })
-
- addCanvasMouseEventListener('mouse:up', (e) => {
- let isIntersection = true
- if (!inside) return
- if (tempModule) {
- const rectPoints = [
- { x: tempModule.left, y: tempModule.top },
- { x: tempModule.left + tempModule.width * tempModule.scaleX, y: tempModule.top },
- {
- x: tempModule.left + tempModule.width * tempModule.scaleX,
- y: tempModule.top + tempModule.height * tempModule.scaleY,
- },
- { x: tempModule.left, y: tempModule.top + tempModule.height * tempModule.scaleY },
- ]
-
- tempModule.set({ points: rectPoints })
- const tempTurfModule = polygonToTurfPolygon(tempModule)
-
- //๋๋จธ ๊ฐ์ฒด๋ฅผ ๊ฐ์ ธ์ด
- if (batchObjects) {
- batchObjects.forEach((object) => {
- let dormerTurfPolygon
-
- if (object.type === 'group') {
- //๋๋จธ๋ ๊ทธ๋ฃนํํ์
- dormerTurfPolygon = batchObjectGroupToTurfPolygon(object)
+ if (turf.booleanWithin(tempTurfModule, turfPolygon)) {
+ //๋ง์ฐ์ค ํด๋ฆญ์ set์ผ๋ก ํด๋น ์์น์ ์
์ ๋ฃ์
+ const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //๊ฒน์น๋์ง ํ์ธ
+ if (!isOverlap) {
+ moduleOptions.surfaceId = trestlePolygon.id
+ let manualModule = new QPolygon(tempModule.points, { ...moduleOptions, moduleInfo: checkedModule[0] })
+ canvas?.add(manualModule)
+ manualDrawModules.push(tempModule)
} else {
- //๊ฐ๊ตฌ, ๊ทธ๋ฆผ์
- dormerTurfPolygon = polygonToTurfPolygon(rectToPolygon(object))
+ swalFire({ text: getMessage('module.place.overlab') })
}
-
- const intersection = turf.intersect(turf.featureCollection([dormerTurfPolygon, tempTurfModule])) //๊ฒน์น๋์ง ํ์ธ
- //๊ฒน์น๋ฉด ์๋จ
- if (intersection) {
- swalFire({ text: getMessage('module.place.overobject') })
- isIntersection = false
- }
- })
- }
-
- if (!isIntersection) return
-
- if (turf.booleanWithin(tempTurfModule, turfPolygon)) {
- //๋ง์ฐ์ค ํด๋ฆญ์ set์ผ๋ก ํด๋น ์์น์ ์
์ ๋ฃ์
- const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //๊ฒน์น๋์ง ํ์ธ
- if (!isOverlap) {
- moduleOptions.surfaceId = trestlePolygon.id
- let manualModule = new QPolygon(tempModule.points, { ...moduleOptions })
- canvas?.add(manualModule)
- manualDrawModules.push(tempModule)
} else {
- swalFire({ text: getMessage('module.place.overlab') })
+ swalFire({ text: getMessage('module.place.out') })
}
- } else {
- swalFire({ text: getMessage('module.place.out') })
}
- }
- })
- }
+ })
+ }
+ getModuleStatistics()
+ } else {
+ if (moduleSetupSurfaces) {
+ //์๋๋ชจ๋ ํด์ ์ ๋ชจ๋ ์ค์น๋ฉด ์ ํ ์ ๊ธ
+ moduleSetupSurfaces.forEach((obj) => {
+ obj.set({
+ selectable: true,
+ evented: true,
+ })
+ })
+ }
- getModuleStatistics()
+ removeMouseEvent('mouse:up')
+ removeMouseEvent('mouse:move')
+ canvas?.remove(...canvas?.getObjects().filter((obj) => obj.name === 'tempModule')) //์์ง์ผ๋ ์ผ๋จ ์ง์๊ฐ๋ฉด์ ์์ง์
+ }
}
const autoFlatroofModuleSetup = (placementFlatRef) => {
@@ -2096,17 +2090,17 @@ export function useModuleBasicSetting(tabNum) {
targetLine.y2 = lines[index].y2
})
- const flowLines = {
- bottom: bottomTopFlowLine(surface).find((obj) => obj.target === 'bottom'),
- top: bottomTopFlowLine(surface).find((obj) => obj.target === 'top'),
- left: leftRightFlowLine(surface).find((obj) => obj.target === 'left'),
- right: leftRightFlowLine(surface).find((obj) => obj.target === 'right'),
- }
+ // const flowLines = {
+ // bottom: bottomTopFlowLine(surface).find((obj) => obj.target === 'bottom'),
+ // top: bottomTopFlowLine(surface).find((obj) => obj.target === 'top'),
+ // left: leftRightFlowLine(surface).find((obj) => obj.target === 'left'),
+ // right: leftRightFlowLine(surface).find((obj) => obj.target === 'right'),
+ // }
- surface.set({ flowLines: flowLines })
+ // surface.set({ flowLines: flowLines })
})
- const moduleOptions = {
+ let moduleOptions = {
fill: '#BFFD9F',
stroke: 'black',
strokeWidth: 0.1,
@@ -2158,169 +2152,188 @@ export function useModuleBasicSetting(tabNum) {
let moduleGroup = []
- const flatRoofDownFlowSetupModule = (surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
- let startPoint = moduleSetupSurface.flowLines.bottom
+ const flatRoofDownFlowSetupModule = (surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
+ checkedModule.forEach((module, index) => {
+ const { width, height } = getModuleWidthHeight(maxLengthLine, moduleSetupSurface, module)
- const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
- const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
- const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
+ const flowLines = getFlowLines(moduleSetupSurface, module)
- let totalLeftEndPoint = maxLeftEndPoint - startPoint.x1
- let totalTopEndPoint = maxTopEndPoint - startPoint.y1
- let totalWidth = Math.ceil(Math.abs(maxRightEndPoint - maxLeftEndPoint) / width)
- let diffLeftEndPoint = Math.abs(totalLeftEndPoint / width)
- let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
- let startColPoint = Math.abs(width * Math.ceil(diffLeftEndPoint) - startPoint.x1)
- let tempMaxWidth = width //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
+ let startPoint = flowLines.bottom
+
+ const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
+ const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
+ const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
+
+ let totalLeftEndPoint = maxLeftEndPoint - startPoint.x1
+ let totalTopEndPoint = maxTopEndPoint - startPoint.y1
+ let totalWidth = Math.ceil(Math.abs(maxRightEndPoint - maxLeftEndPoint) / width)
+ let diffLeftEndPoint = Math.abs(totalLeftEndPoint / width)
+ let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
+ let startColPoint = Math.abs(width * Math.ceil(diffLeftEndPoint) - startPoint.x1)
+ let tempMaxWidth = width //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
+
+ for (let j = 0; j < diffTopEndPoint; j++) {
+ bottomMargin = marginHeight * j
+ for (let i = 0; i <= totalWidth; i++) {
+ leftMargin = marginWidth * i
+
+ square = [
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - bottomMargin],
+ [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 - height * j - bottomMargin],
+ [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 - height * j - height - bottomMargin],
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - height - bottomMargin],
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - bottomMargin],
+ ]
+
+ let squarePolygon = turf.polygon([square])
+ let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
+ let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
+
+ moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module }
+ let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
+ canvas?.add(tempModule)
+ moduleSetupArray.push(tempModule)
+ moduleGroup.push(tempModule)
+ }
+ }
+ })
+ }
+
+ const flatRoofLeftFlowSetupModule = (surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
+ checkedModule.forEach((module, index) => {
+ const { width, height } = getModuleWidthHeight(maxLengthLine, moduleSetupSurface, module)
+ const flowLines = getFlowLines(moduleSetupSurface, module)
+ let startPoint = flowLines.left
+
+ const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
+ const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
+ const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
+
+ let totalTopEndPoint = Math.abs(maxTopEndPoint - startPoint.y1) //์ ์ฒด ๋์ด์์ ํ์ฌ ๋์ด๋ฅผ ๋บ
+ let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
+ let totalHeight = Math.ceil(Math.abs(maxBottomEndPoint - maxTopEndPoint) / height)
+ let totalWidth = Math.abs(startPoint.x1 - maxRightEndPoint) / width
+ let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint)
+ let tempMaxHeight = height //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
- for (let j = 0; j < diffTopEndPoint; j++) {
- bottomMargin = marginHeight * j
for (let i = 0; i <= totalWidth; i++) {
- leftMargin = marginWidth * i
+ bottomMargin = marginHeight * i
+ for (let j = 0; j < totalHeight; j++) {
+ leftMargin = marginWidth * j
- square = [
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - bottomMargin],
- [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 - height * j - bottomMargin],
- [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 - height * j - height - bottomMargin],
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - height - bottomMargin],
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 - height * j - bottomMargin],
- ]
+ square = [
+ [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ [startPoint.x1 + width * i + width + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ [startPoint.x1 + width * i + width + leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
+ [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
+ [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ ]
- let squarePolygon = turf.polygon([square])
- let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
- let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
+ let squarePolygon = turf.polygon([square])
+ let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
+ let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
- moduleOptions.surfaceId = moduleSetupSurface.id
- let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
- canvas?.add(tempModule)
- moduleSetupArray.push(tempModule)
- moduleGroup.push(tempModule)
+ // if (disjointFromTrestle && isDisjoint) {
+ moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module }
+ let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
+ canvas?.add(tempModule)
+ moduleSetupArray.push(tempModule)
+ moduleGroup.push(tempModule)
+ }
}
- }
+ })
}
- const flatRoofLeftFlowSetupModule = (surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
- let startPoint = moduleSetupSurface.flowLines.left
- const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
- const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
- const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
+ const flatRoofTopFlowSetupModule = (surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
+ checkedModule.forEach((module, index) => {
+ const { width, height } = getModuleWidthHeight(maxLengthLine, moduleSetupSurface, module)
+ const flowLines = getFlowLines(moduleSetupSurface, module)
+ let startPoint = flowLines.top
- let totalTopEndPoint = Math.abs(maxTopEndPoint - startPoint.y1) //์ ์ฒด ๋์ด์์ ํ์ฌ ๋์ด๋ฅผ ๋บ
- let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
- let totalHeight = Math.ceil(Math.abs(maxBottomEndPoint - maxTopEndPoint) / height)
- let totalWidth = Math.abs(startPoint.x1 - maxRightEndPoint) / width
- let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint)
- let tempMaxHeight = height //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
+ const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
+ const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
+ const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
- for (let i = 0; i <= totalWidth; i++) {
- bottomMargin = marginHeight * i
- for (let j = 0; j < totalHeight; j++) {
- leftMargin = marginWidth * j
+ let totalLeftEndPoint = maxLeftEndPoint - startPoint.x1
+ let totalRightEndPoint = maxLeftEndPoint - maxRightEndPoint
+ let totalBottomEndPoint = maxBottomEndPoint - startPoint.y1
+ let diffLeftEndPoint = Math.abs(totalLeftEndPoint / width)
+ let diffRightEndPoint = Math.ceil(Math.abs(totalRightEndPoint / width))
+ let diffBottomEndPoint = Math.ceil(Math.abs(totalBottomEndPoint / height))
+ let startColPoint = Math.abs(width * Math.ceil(diffLeftEndPoint) - startPoint.x1)
+ let tempMaxWidth = width //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
- square = [
- [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- [startPoint.x1 + width * i + width + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- [startPoint.x1 + width * i + width + leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
- [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
- [startPoint.x1 + width * i + leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- ]
+ for (let j = 0; j < diffBottomEndPoint; j++) {
+ bottomMargin = marginHeight * j
+ for (let i = 0; i < diffRightEndPoint; i++) {
+ leftMargin = marginWidth * i
- let squarePolygon = turf.polygon([square])
- let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
- let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
+ square = [
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + bottomMargin],
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + height + bottomMargin],
+ [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 + height * j + height + bottomMargin],
+ [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 + height * j + bottomMargin],
+ [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + bottomMargin],
+ ]
- // if (disjointFromTrestle && isDisjoint) {
- moduleOptions.surfaceId = moduleSetupSurface.id
- let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
- canvas?.add(tempModule)
- moduleSetupArray.push(tempModule)
- moduleGroup.push(tempModule)
+ let squarePolygon = turf.polygon([square])
+ let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
+ let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
+
+ // if (disjointFromTrestle && isDisjoint) {
+ moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module }
+ let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
+ canvas?.add(tempModule)
+ moduleSetupArray.push(tempModule)
+ moduleGroup.push(tempModule)
+ }
}
- }
+ })
}
- const flatRoofTopFlowSetupModule = (surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
- let startPoint = moduleSetupSurface.flowLines.top
+ const flatRoofRightFlowSetupModule = (surfaceMaxLines, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
+ checkedModule.forEach((module, index) => {
+ const { width, height } = getModuleWidthHeight(maxLengthLine, moduleSetupSurface, module)
+ const flowLines = getFlowLines(moduleSetupSurface, module)
+ let startPoint = flowLines.right
- const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
- const maxRightEndPoint = surfaceMaxLines.right.x1 //์ต ์ฐ์ธก
- const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
+ const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
+ const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
+ const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
- let totalLeftEndPoint = maxLeftEndPoint - startPoint.x1
- let totalRightEndPoint = maxLeftEndPoint - maxRightEndPoint
- let totalBottomEndPoint = maxBottomEndPoint - startPoint.y1
- let diffLeftEndPoint = Math.abs(totalLeftEndPoint / width)
- let diffRightEndPoint = Math.ceil(Math.abs(totalRightEndPoint / width))
- let diffBottomEndPoint = Math.ceil(Math.abs(totalBottomEndPoint / height))
- let startColPoint = Math.abs(width * Math.ceil(diffLeftEndPoint) - startPoint.x1)
- let tempMaxWidth = width //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
+ let totalTopEndPoint = Math.abs(maxTopEndPoint - startPoint.y1) //์ ์ฒด ๋์ด์์ ํ์ฌ ๋์ด๋ฅผ ๋บ
+ let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
+ let totalHeight = Math.ceil(Math.abs(maxBottomEndPoint - maxTopEndPoint) / height)
+ let totalWidth = Math.abs(startPoint.x1 - maxLeftEndPoint) / width
+ let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint) - 3 // -3์ผ๋ก ์์น์ด์ง ๋ณด์
+ let tempMaxHeight = height //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
- for (let j = 0; j < diffBottomEndPoint; j++) {
- bottomMargin = marginHeight * j
- for (let i = 0; i < diffRightEndPoint; i++) {
- leftMargin = marginWidth * i
+ for (let i = 0; i <= totalWidth; i++) {
+ bottomMargin = marginHeight * i
+ for (let j = 0; j < totalHeight; j++) {
+ leftMargin = marginWidth * j
- square = [
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + bottomMargin],
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + height + bottomMargin],
- [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 + height * j + height + bottomMargin],
- [startColPoint + tempMaxWidth * i + width + leftMargin, startPoint.y1 + height * j + bottomMargin],
- [startColPoint + tempMaxWidth * i + leftMargin, startPoint.y1 + height * j + bottomMargin],
- ]
+ square = [
+ [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ [startPoint.x1 - width * i - width - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ [startPoint.x1 - width * i - width - leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
+ [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
+ [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
+ ]
- let squarePolygon = turf.polygon([square])
- let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
- let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
+ let squarePolygon = turf.polygon([square])
+ let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
+ let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
- // if (disjointFromTrestle && isDisjoint) {
- moduleOptions.surfaceId = moduleSetupSurface.id
- let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
- canvas?.add(tempModule)
- moduleSetupArray.push(tempModule)
- moduleGroup.push(tempModule)
+ // if (disjointFromTrestle && isDisjoint) {
+ moduleOptions = { ...moduleOptions, fill: module.color, surfaceId: moduleSetupSurface.id, moduleInfo: module }
+ let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
+ canvas?.add(tempModule)
+ moduleSetupArray.push(tempModule)
+ moduleGroup.push(tempModule)
+ }
}
- }
- }
-
- const flatRoofRightFlowSetupModule = (surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight) => {
- let startPoint = moduleSetupSurface.flowLines.right
-
- const maxLeftEndPoint = surfaceMaxLines.left.x1 //์ต ์ข์ธก
- const maxTopEndPoint = surfaceMaxLines.top.y1 //์ต ์๋จ
- const maxBottomEndPoint = surfaceMaxLines.bottom.y1 //์ตํ๋จ
-
- let totalTopEndPoint = Math.abs(maxTopEndPoint - startPoint.y1) //์ ์ฒด ๋์ด์์ ํ์ฌ ๋์ด๋ฅผ ๋บ
- let diffTopEndPoint = Math.abs(totalTopEndPoint / height)
- let totalHeight = Math.ceil(Math.abs(maxBottomEndPoint - maxTopEndPoint) / height)
- let totalWidth = Math.abs(startPoint.x1 - maxLeftEndPoint) / width
- let startRowPoint = startPoint.y1 - height * Math.ceil(diffTopEndPoint) - 3 // -3์ผ๋ก ์์น์ด์ง ๋ณด์
- let tempMaxHeight = height //์ต๋๋ฐฐ์น์ธ์ง ํ์ธํ๋ ค๊ณ ๋ฃ์
-
- for (let i = 0; i <= totalWidth; i++) {
- bottomMargin = marginHeight * i
- for (let j = 0; j < totalHeight; j++) {
- leftMargin = marginWidth * j
-
- square = [
- [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- [startPoint.x1 - width * i - width - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- [startPoint.x1 - width * i - width - leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
- [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + height + bottomMargin],
- [startPoint.x1 - width * i - leftMargin, startRowPoint + tempMaxHeight * j + bottomMargin],
- ]
-
- let squarePolygon = turf.polygon([square])
- let turfCoordnates = squarePolygon.geometry.coordinates[0].slice(0, -1)
- let points = turfCoordnates.map((coord) => ({ x: coord[0], y: coord[1] }))
-
- // if (disjointFromTrestle && isDisjoint) {
- moduleOptions.surfaceId = moduleSetupSurface.id
- let tempModule = new QPolygon(points, { ...moduleOptions, turfPoints: squarePolygon })
- canvas?.add(tempModule)
- moduleSetupArray.push(tempModule)
- moduleGroup.push(tempModule)
- }
- }
+ })
}
moduleSetupSurfaces.forEach((moduleSetupSurface, index) => {
@@ -2334,29 +2347,20 @@ export function useModuleBasicSetting(tabNum) {
const turfModuleSetupSurface = polygonToTurfPolygon(moduleSetupSurface, true) //ํด๋ฆฌ๊ณค์ turf ๊ฐ์ฒด๋ก ๋ณํ
const containsBatchObjects = objectsIncludeSurface(turfModuleSetupSurface) //๋ฐฐ์น๋ฉด์ ์ค๋ธ์ ํธ(๋๋จธ, ๊ฐ๊ตฌ๋ฑ)์ด ์๋์ง ํ์ธํ๋ ๋ก์ง
- let width = maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? 172.2 : 113.4
- let height = maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? 113.4 : 172.2
-
- //๋ฐฐ์น๋ฉด๋๋ ๋ฐฉํฅ์ชฝ์ผ๋ก ํจ๋์ด ๋๊ฒ ๋์์ ธ์ผํจ
- if (moduleSetupSurface.flowDirection !== undefined) {
- width = moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north' ? 172.2 : 113.4
- height = moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north' ? 113.4 : 172.2
- }
-
const surfaceMaxLines = findSetupSurfaceMaxLines(moduleSetupSurface)
const marginWidth = 1
- const marginHeight = 1
+ const marginHeight = 3
canvas.renderAll()
if (compasDeg >= 0 && compasDeg < 90) {
- flatRoofDownFlowSetupModule(surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
+ flatRoofDownFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
} else if (compasDeg >= 90 && compasDeg < 180) {
- flatRoofLeftFlowSetupModule(surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
+ flatRoofLeftFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
} else if (compasDeg >= 180 && compasDeg < 270) {
- flatRoofRightFlowSetupModule(surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
+ flatRoofRightFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
} else {
- flatRoofTopFlowSetupModule(surfaceMaxLines, width, height, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
+ flatRoofTopFlowSetupModule(surfaceMaxLines, maxLengthLine, moduleSetupArray, moduleSetupSurface, marginWidth, marginHeight)
}
const setupedModules = moduleSetupArray.filter((module, index) => {
@@ -2495,8 +2499,51 @@ export function useModuleBasicSetting(tabNum) {
setModuleStatistics({ header: header, rows, footer: footer })
}
+ /**
+ * ๋ชจ๋์ ๋๋น์ ๋์ด๋ฅผ ๊ณ์ฐํ๋ ํจ์
+ * @param {object} maxLengthLine ์ต๋ ๊ธธ์ด ๋ผ์ธ
+ * @param {object} moduleSetupSurface ๋ชจ๋ ์ค์น๋ฉด
+ * @param {object} module ๋ชจ๋
+ * @returns {object} ๋ชจ๋์ ๋๋น์ ๋์ด
+ */
+ const getModuleWidthHeight = (maxLengthLine, moduleSetupSurface, module) => {
+ let tmpWidth =
+ (maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? Number(module.longAxis) : Number(module.shortAxis)) / 10
+ let tmpHeight =
+ (maxLengthLine.flowDirection === 'east' || maxLengthLine.flowDirection === 'west' ? Number(module.shortAxis) : Number(module.longAxis)) / 10
+
+ //๋ฐฐ์น๋ฉด๋๋ ๋ฐฉํฅ์ชฝ์ผ๋ก ํจ๋์ด ๋๊ฒ ๋์์ ธ์ผํจ
+ if (moduleSetupSurface.flowDirection !== undefined) {
+ tmpWidth =
+ (moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north'
+ ? Number(module.longAxis)
+ : Number(module.shortAxis)) / 10
+ tmpHeight =
+ (moduleSetupSurface.flowDirection === 'south' || moduleSetupSurface.flowDirection === 'north'
+ ? Number(module.shortAxis)
+ : Number(module.longAxis)) / 10
+ }
+
+ return canvasSetting.roofSizeSet === '1'
+ ? calculateVisibleModuleHeight(tmpWidth, tmpHeight, getDegreeByChon(moduleSetupSurface.roofMaterial.pitch), moduleSetupSurface.flowDirection)
+ : { width: tmpWidth, height: tmpHeight }
+ }
+
+ const getFlowLines = (moduleSetupSurface, module) => {
+ let flowLines = {}
+
+ flowLines = {
+ bottom: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'bottom'),
+ top: bottomTopFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'top'),
+ left: leftRightFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'left'),
+ right: leftRightFlowLine(moduleSetupSurface, module).find((obj) => obj.target === 'right'),
+ }
+ return flowLines
+ }
+
return {
selectedModules,
+ makeModuleInstArea,
manualModuleSetup,
autoModuleSetup,
restoreModuleInstArea,
From d923b8acffdf6abbcac9acaecec66eee9088998f Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Thu, 6 Feb 2025 17:45:01 +0900
Subject: [PATCH 113/213] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=20=EA=B7=B8?=
=?UTF-8?q?=EB=A6=B0=20=ED=9B=84,=20=EC=A7=80=EB=B6=95=ED=98=95=EC=83=81?=
=?UTF-8?q?=20=EC=88=98=EB=8F=99=20=EC=84=A4=EC=A0=95=20=EC=8B=9C=20?=
=?UTF-8?q?=EC=98=A4=EB=A5=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/roofcover/useRoofAllocationSetting.js | 6 +++---
.../roofcover/useRoofShapePassivitySetting.js | 14 ++++++++++++++
2 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js
index 550ce5f5..6fda1692 100644
--- a/src/hooks/roofcover/useRoofAllocationSetting.js
+++ b/src/hooks/roofcover/useRoofAllocationSetting.js
@@ -445,9 +445,9 @@ export function useRoofAllocationSetting(id) {
setCurrentRoofList(newRoofList)
}
- const handleChangeInput = (e, type, index) => {
+ const handleChangeInput = (e, type = '', index) => {
const value = e.target.value
- if (type === 'pitch') {
+ /*if (type === 'pitch') {
// type์ด pitch์ธ ๊ฒฝ์ฐ ์์์ 1์๋ฆฌ๊น์ง๋ง ์
๋ ฅ ๊ฐ๋ฅ
const reg = /^[0-9]+(\.[0-9]{0,1})?$/
@@ -481,7 +481,7 @@ export function useRoofAllocationSetting(id) {
}
return
- }
+ }*/
const newRoofList = currentRoofList.map((roof, idx) => {
if (idx === index) {
diff --git a/src/hooks/roofcover/useRoofShapePassivitySetting.js b/src/hooks/roofcover/useRoofShapePassivitySetting.js
index c51da066..33d5d953 100644
--- a/src/hooks/roofcover/useRoofShapePassivitySetting.js
+++ b/src/hooks/roofcover/useRoofShapePassivitySetting.js
@@ -203,6 +203,20 @@ export function useRoofShapePassivitySetting(id) {
const roofBases = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
const exceptObjs = canvas.getObjects().filter((obj) => obj.name !== 'outerLine' && obj.parent?.name !== 'outerLine')
const lines = canvas.getObjects().filter((obj) => obj.name === 'outerLine')
+
+ let checkedAllSetting = true
+
+ lines.forEach((line) => {
+ if (!line.attributes) {
+ checkedAllSetting = false
+ }
+ })
+
+ if (!checkedAllSetting) {
+ swalFire({ text: '์ค์ ์ด ์๋ฃ๋์ง ์์ ์ธ๋ฒฝ์ ์ด ์์ต๋๋ค.', icon: 'warning' })
+ return
+ }
+
exceptObjs.forEach((obj) => {
canvas.remove(obj)
})
From 871ac6bc2c7bc657e79bc33cdc807a51778a3b15 Mon Sep 17 00:00:00 2001
From: "hyojun.choi"
Date: Thu, 6 Feb 2025 17:48:01 +0900
Subject: [PATCH 114/213] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=20=EC=97=86?=
=?UTF-8?q?=EB=8A=94=EA=B2=BD=EC=9A=B0=20=EC=A7=80=EB=B6=95=ED=98=95?=
=?UTF-8?q?=EC=83=81=20=EC=84=A4=EC=A0=95=20=EC=95=88=EB=90=98=EA=B2=8C=20?=
=?UTF-8?q?=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/hooks/roofcover/useRoofShapeSetting.js | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/src/hooks/roofcover/useRoofShapeSetting.js b/src/hooks/roofcover/useRoofShapeSetting.js
index 3bd89625..8ccd4b07 100644
--- a/src/hooks/roofcover/useRoofShapeSetting.js
+++ b/src/hooks/roofcover/useRoofShapeSetting.js
@@ -167,9 +167,14 @@ export function useRoofShapeSetting(id) {
]
const handleSave = () => {
- let outerLines
+ let outerLines = canvas.getObjects().filter((obj) => obj.name === 'outerLine' && obj.visible)
let direction
+ if (outerLines.length < 2) {
+ swalFire({ text: '์ธ๋ฒฝ์ ์ด ์์ต๋๋ค.', icon: 'error' })
+ return
+ }
+
switch (shapeNum) {
case 1: {
outerLines = saveRidge()
From 8f1710e3dc9e30a254e420c28f83f9af9a32fe04 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=EA=B9=80=EB=AF=BC=EC=8B=9D?=
<43837214+Minsiki@users.noreply.github.com>
Date: Thu, 6 Feb 2025 17:53:58 +0900
Subject: [PATCH 115/213] =?UTF-8?q?=EB=A9=80=ED=8B=B0=20=EB=AA=A8=EB=93=88?=
=?UTF-8?q?=20=EC=A7=91=EA=B3=84=ED=91=9C=20=EC=88=98=EC=A0=95?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../circuitTrestle/CircuitTrestleSetting.jsx | 1 +
.../step/PowerConditionalSelect.jsx | 9 +-
.../modal/circuitTrestle/step/StepUp.jsx | 7 ++
.../step/type/PassivityCircuitAllocation.jsx | 106 +-----------------
src/hooks/module/useModule.js | 10 +-
5 files changed, 25 insertions(+), 108 deletions(-)
diff --git a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
index 31f3aaa4..427631c0 100644
--- a/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/CircuitTrestleSetting.jsx
@@ -500,6 +500,7 @@ export default function CircuitTrestleSetting({ id }) {
selectedModels,
setSelectedModels,
managementState,
+ getUseModuleItemList,
}
// ์๋ํ ๋น ์ปดํฌ๋ํธ ์์ฑ
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
index 6b049002..715d3884 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/PowerConditionalSelect.jsx
@@ -27,6 +27,7 @@ export default function PowerConditionalSelect(props) {
selectedModels,
setSelectedModels,
managementState,
+ getUseModuleItemList,
} = props
const [pcsCheck, setPcsCheck] = useRecoilState(pcsCheckState)
@@ -159,8 +160,14 @@ export default function PowerConditionalSelect(props) {
setModels([])
setSelectedModels([])
setSelectedMaker(option)
+ console.log('option', option)
+ getUseModuleItemList
+ const param = {
+ pcsMkrCd: option.pcsMkrCd,
+ mixMatlNo: getUseModuleItemList()[0].mixMatlNo,
+ }
- getPcsMakerList(option).then((res) => {
+ getPcsMakerList(param).then((res) => {
setSeries(
res.data.map((series) => {
return { ...series, selected: false }
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
index a7e8932e..ec5f554f 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/StepUp.jsx
@@ -350,6 +350,12 @@ export default function StepUp(props) {
return module.id
})
+ targetSurface.modules.map((module) => {
+ module.circuit = null
+ module.circuitNumber = null
+ module.pcsItemId = null
+ })
+
// ๋ชจ๋ ๋ชฉ๋ก ์ญ์
canvas
.getObjects()
@@ -363,6 +369,7 @@ export default function StepUp(props) {
roofSurface.moduleList.forEach((module) => {
const targetModule = canvas.getObjects().filter((obj) => obj.id === module.uniqueId)[0]
+ if (module.circuit === '') return
const moduleCircuitText = new fabric.Text(module.circuit, {
left: targetModule.left + targetModule.width / 2,
top: targetModule.top + targetModule.height / 2,
diff --git a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
index 1c5595a6..c20c995b 100644
--- a/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
+++ b/src/components/floor-plan/modal/circuitTrestle/step/type/PassivityCircuitAllocation.jsx
@@ -33,9 +33,6 @@ export default function PassivityCircuitAllocation(props) {
const isDisplayCircuitNumber = useRecoilValue(circuitNumDisplaySelector)
useEffect(() => {
- console.log('header, rows', header, rows)
- console.log('selectedModels', selectedModels)
- // setSurfaceInfo()
setModuleStatisticsData()
if (!managementState) {
setManagementState(managementStateLoaded)
@@ -78,80 +75,6 @@ export default function PassivityCircuitAllocation(props) {
canvas.renderAll()
}
- const setSurfaceInfo = () => {
- const surfaces = canvas.getObjects().filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name)
- // setHeaders([header[0], { name: 'ํ๋ก', prop: 'circuit' }, ...header.slice(1)])
- // setRows(
- // rows.map((row) => {
- // return {
- // ...row,
- // circuit: '',
- // }
- // }),
- // )
- // let totals = {}
-
- // rows.forEach((row) => {
- // if (header.length === 4) {
- // if (!totals[header[2].prop]) totals[header[2].prop] = 0
- // totals[header[2].prop] += +row[header[2].prop]
- // } else if (header.length === 5) {
- // if (!totals[header[2].prop]) totals[header[2].prop] = 0
- // totals[header[2].prop] += +row[header[2].prop]
- // if (!totals[header[3].prop]) totals[header[3].prop] = 0
- // totals[header[3]] += +row[header[3]]
- // }
- // })
- // setFooter([
- // ...['ํฉ๊ณ', ''],
- // ...Object.keys(totals).map((key) => {
- // return totals[key]
- // }),
- // Object.keys(totals).reduce((acc, key) => {
- // return acc + totals[key]
- // }, 0),
- // ])
- // let totalWpout = 0
- // const rows = surfaces.map((surface) => {
- // let wpOut = 0
- // let moduleInfo = {}
- // surface.modules.forEach((module) => {
- // wpOut += +module.moduleInfo.wpOut
- // if (!moduleInfo[module.moduleInfo.itemId]) moduleInfo[module.moduleInfo.itemId] = 0
- // moduleInfo[module.moduleInfo.itemId]++
- // })
- // totalWpout += wpOut
- // console.log('๐ ~ moduleData.rows=surfaces.map ~ module:', module)
- // return {
- // roofShape: DIRECTION[surface.direction],
- // powerGeneration: wpOut.toLocaleString('ko-KR', { maximumFractionDigits: 4 }),
- // ...moduleInfo,
- // }
- // })
-
- // setTotalWpout(totalWpout)
- // ์ง๋ถ๋ฉด ๋ฆฌ์คํธ -> ์ง๋ถ๋ฉด์ ์๋ ๋ชจ๋ ๋ฆฌ์คํธ -> ๋ฐ์ ๋ ์ดํฉ ๊ณ์ฐ
- // wpOut
-
- // setModuleData({
- // header: [
- // { name: getMessage('modal.panel.batch.statistic.roof.shape'), prop: 'roofShape' },
- // { name: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.circuit'), prop: 'circuit' },
- // ...selectedModules.itemList.map((module) => {
- // return {
- // name: module.itemNm,
- // prop: module.itemId,
- // }
- // }),
- // {
- // name: `${getMessage('modal.panel.batch.statistic.power.generation.amount')}(kW)`,
- // prop: 'powerGeneration',
- // },
- // ],
- // rows: rows,
- // })
- }
-
const handleCircuitNumberFix = () => {
let uniqueCircuitNumbers = [
...new Set(
@@ -177,6 +100,7 @@ export default function PassivityCircuitAllocation(props) {
return
} else if (selectedModels.length > 1) {
let result = false
+
uniqueCircuitNumbers.forEach((number) => {
if (
number.split('-')[1] === circuitNumber + ')' &&
@@ -229,20 +153,14 @@ export default function PassivityCircuitAllocation(props) {
setSelectedPcs(tempSelectedPcs)
canvas.add(moduleCircuitText)
})
- console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
- // let pcsList = [...selectedModels.map((model) => ({ ...model }))]
- let pcsList = JSON.parse(JSON.stringify(selectedModels))
- pcsList = pcsList.map((model) => {
- console.log('๐ ~ handleCircuitNumberFix ~ pcsList:', pcsList)
+ let pcsList = JSON.parse(JSON.stringify(selectedModels)).map((model) => {
if (model.id === selectedPcs.id) {
model.isUsed = true
}
return model
})
- console.log('๐ ~ handleCircuitNumberFix ~ pcsList:', pcsList)
-
const roofSurfaceList = canvas
.getObjects()
.filter((obj) => POLYGON_TYPE.MODULE_SETUP_SURFACE === obj.name && obj?.modules.length > 0)
@@ -261,7 +179,6 @@ export default function PassivityCircuitAllocation(props) {
}
})
- console.log('uniqueCircuitNumbers', uniqueCircuitNumbers)
const usedPcses = pcsList.filter((model) => model.isUsed)
const pcsItemList = usedPcses.map((model, index) => {
return {
@@ -289,7 +206,6 @@ export default function PassivityCircuitAllocation(props) {
}
getPcsManualConfChk(params).then((res) => {
- console.log('targetModules', targetModules)
if (res.resultCode === 'E') {
swalFire({
text: res.resultMsg,
@@ -321,8 +237,6 @@ export default function PassivityCircuitAllocation(props) {
setModuleStatisticsData()
})
}
- console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
- console.log('๐ ~ handleCircuitNumberFix ~ selectedModels:', selectedModels)
const getCircuitNumber = () => {
if (selectedModels.length === 1) {
@@ -334,7 +248,7 @@ export default function PassivityCircuitAllocation(props) {
const initSelectedPcsCircuitNumber = () => {
swalFire({
- title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.init.info'),
+ title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.selected.power.conditional.reset.info'),
type: 'confirm',
icon: 'warning',
confirmFn: () => {
@@ -355,7 +269,7 @@ export default function PassivityCircuitAllocation(props) {
const initAllPcsCircuitNumber = () => {
canvas.discardActiveObject()
swalFire({
- title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.init.setting.info'),
+ title: getMessage('modal.circuit.trestle.setting.circuit.allocation.passivity.all.power.conditional.reset.info'),
type: 'confirm',
icon: 'warning',
confirmFn: () => {
@@ -444,18 +358,6 @@ export default function PassivityCircuitAllocation(props) {