diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx
index 4241f916..990f4007 100644
--- a/src/components/estimate/Estimate.jsx
+++ b/src/components/estimate/Estimate.jsx
@@ -993,7 +993,11 @@ export default function Estimate({}) {
{/* 2차 판매점명 */}
| {getMessage('estimate.detail.otherSaleStoreId')} |
- {estimateContextState?.agencySaleStoreName} |
+
+ {session?.storeLvl === '1' && estimateContextState?.saleStoreLevel === '1'
+ ? getMessage('estimate.detail.noOtherSaleStoreId')
+ : estimateContextState?.agencySaleStoreName}
+ |
{/* 담당자 */}
{getMessage('estimate.detail.receiveUser')} *
diff --git a/src/components/estimate/popup/DocDownOptionPop.jsx b/src/components/estimate/popup/DocDownOptionPop.jsx
index d6b22eb2..6fe73c53 100644
--- a/src/components/estimate/popup/DocDownOptionPop.jsx
+++ b/src/components/estimate/popup/DocDownOptionPop.jsx
@@ -290,18 +290,18 @@ export default function DocDownOptionPop({ planNo, setEstimatePopupOpen }) {
+
-
diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx
index d61c29c6..91173b89 100644
--- a/src/components/floor-plan/CanvasMenu.jsx
+++ b/src/components/floor-plan/CanvasMenu.jsx
@@ -135,6 +135,15 @@ export default function CanvasMenu(props) {
const onClickNav = (menu) => {
switch (menu.index) {
+ case 0:
+ swalFire({
+ text: getMessage('stuff.detail.move.confirmMsg'),
+ type: 'confirm',
+ confirmFn: () => {
+ router.push(`/management/stuff/detail?objectNo=${objectNo}`)
+ },
+ })
+ break
case 1:
setType('placementShape')
onClickPlacementInitialMenu()
@@ -153,6 +162,11 @@ export default function CanvasMenu(props) {
case 4:
setType('module')
break
+ case 5:
+ setMenuNumber(menu.index)
+ setCurrentMenu(menu.title)
+ router.push(`/floor-plan/estimate/5?pid=${pid}&objectNo=${objectNo}`)
+ break
case 6:
promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => {
if (res.status === 200) {
@@ -169,12 +183,14 @@ export default function CanvasMenu(props) {
break
}
- if (menu.index !== 6) {
+ if (menu.index !== 6 && menu.index !== 0) {
setMenuNumber(menu.index)
setCurrentMenu(menu.title)
}
- if (pathname !== '/floor-plan') router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
+ if (pathname !== '/floor-plan' && pathname !== '/floor-plan/estimate/5') {
+ router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
+ }
}
const changeSelectedRoofMaterial = (e) => {
@@ -236,6 +252,7 @@ export default function CanvasMenu(props) {
// 견적서 초기화 버튼
const handleEstimateReset = () => {
+ return alert('개발전입니다;;;')
// console.log('estimateRecoilState::', estimateRecoilState)
//objectNo, planNo
swalFire({
diff --git a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
index 0a46e18f..dbd4d992 100644
--- a/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
+++ b/src/components/floor-plan/modal/roofAllocation/RoofAllocationSetting.jsx
@@ -11,6 +11,9 @@ import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
import { useCommonCode } from '@/hooks/common/useCommonCode'
import { globalLocaleStore } from '@/store/localeAtom'
import { useRoofShapeSetting } from '@/hooks/roofcover/useRoofShapeSetting'
+import { currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
+import { getDegreeByChon } from '@/util/canvas-util'
+import { onlyNumberWithDotInputChange } from '@/util/input-utils'
export default function RoofAllocationSetting(props) {
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
@@ -29,11 +32,13 @@ export default function RoofAllocationSetting(props) {
handleChangeRaft,
handleChangeLayout,
currentRoofList,
+ handleChangeInput,
} = useRoofAllocationSetting(id)
- const { pitchText } = useRoofShapeSetting(id)
+ const pitchText = useRecoilValue(pitchTextSelector)
const { findCommonCode } = useCommonCode()
const [raftCodes, setRaftCodes] = useState([])
const globalLocale = useRecoilValue(globalLocaleStore)
+ const currentAngleType = useRecoilValue(currentAngleTypeSelector)
useEffect(() => {
const raftCodeList = findCommonCode('203800')
setRaftCodes(raftCodeList.map((raft) => ({ ...raft, name: raft.clCodeNm })))
@@ -110,7 +115,14 @@ export default function RoofAllocationSetting(props) {
@@ -121,7 +133,13 @@ export default function RoofAllocationSetting(props) {
)}
@@ -129,7 +147,13 @@ export default function RoofAllocationSetting(props) {
)}
@@ -164,6 +188,7 @@ export default function RoofAllocationSetting(props) {
handleChangeInput(e, 'hajebichi', index)}
value={parseInt(roof.hajebichi)}
readOnly={roof.roofPchAuth === 'R'}
/>
diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx
index 9912a180..506df945 100644
--- a/src/components/management/StuffDetail.jsx
+++ b/src/components/management/StuffDetail.jsx
@@ -331,7 +331,7 @@ export default function StuffDetail() {
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
setShowButton('none')
}
- console.log('상세::', res.data)
+ // console.log('상세::', res.data)
if (isObjectNotEmpty(res.data)) {
let surfaceTypeValue
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
diff --git a/src/components/management/StuffSubHeader.jsx b/src/components/management/StuffSubHeader.jsx
index c92b4616..6f186bf7 100644
--- a/src/components/management/StuffSubHeader.jsx
+++ b/src/components/management/StuffSubHeader.jsx
@@ -37,7 +37,8 @@ export default function StuffSubHeader({ type }) {
if (isObjectNotEmpty(managementState)) {
if (managementState.createUser === 'T01') {
if (session.userId !== 'T01') {
- setButtonStyle('none')
+ //도면 작성은 이동 할 수 있도록 변경 #457
+ // setButtonStyle('none')
}
}
}
diff --git a/src/components/management/popup/FindAddressPop.jsx b/src/components/management/popup/FindAddressPop.jsx
index 0c480a52..960fd2e3 100644
--- a/src/components/management/popup/FindAddressPop.jsx
+++ b/src/components/management/popup/FindAddressPop.jsx
@@ -150,12 +150,12 @@ export default function FindAddressPop(props) {
-
-
diff --git a/src/components/management/popup/PlanRequestPop.jsx b/src/components/management/popup/PlanRequestPop.jsx
index bbc290ef..2dafe914 100644
--- a/src/components/management/popup/PlanRequestPop.jsx
+++ b/src/components/management/popup/PlanRequestPop.jsx
@@ -19,7 +19,7 @@ export default function PlanRequestPop(props) {
//공통코드
const { commonCode, findCommonCode } = useCommonCode()
- const [planStatCdList, setPlanStatCdList] = useState([])
+ // const [planStatCdList, setPlanStatCdList] = useState([])
const globalLocaleState = useRecoilValue(globalLocaleStore)
@@ -169,13 +169,13 @@ export default function PlanRequestPop(props) {
gridData: [],
isPageable: false,
gridColumns: [
- {
- field: 'planStatName',
- headerName: getMessage('stuff.planReqPopup.gridHeader.planStatName'),
- minWidth: 150,
- checkboxSelection: true,
- showDisabledCheckboxes: true,
- },
+ // {
+ // field: 'planStatName',
+ // headerName: getMessage('stuff.planReqPopup.gridHeader.planStatName'),
+ // minWidth: 150,
+ // checkboxSelection: true,
+ // showDisabledCheckboxes: true,
+ // },
{
field: 'planReqNo',
headerName: getMessage('stuff.planReqPopup.gridHeader.planReqNo'),
@@ -234,12 +234,12 @@ export default function PlanRequestPop(props) {
}
}
- useEffect(() => {
- const code1 = findCommonCode(115800) //상태
- if (code1 != null) {
- setPlanStatCdList(code1)
- }
- }, [commonCode])
+ // useEffect(() => {
+ // const code1 = findCommonCode(115800) //상태
+ // if (code1 != null) {
+ // setPlanStatCdList(code1)
+ // }
+ // }, [commonCode])
useEffect(() => {
onSubmit(pageNo, 'S')
@@ -380,7 +380,7 @@ export default function PlanRequestPop(props) {
/>
- | {getMessage('stuff.planReqPopup.search.planStatName')} |
+ {/* {getMessage('stuff.planReqPopup.search.planStatName')} |
- |
+ */}
| {getMessage('stuff.planReqPopup.search.period')} |
@@ -438,12 +438,12 @@ export default function PlanRequestPop(props) {
- props.setShowDesignRequestButtonValid(false)}>
- {getMessage('stuff.planReqPopup.btn3')}
-
-
+
{getMessage('stuff.planReqPopup.btn4')}
+ props.setShowDesignRequestButtonValid(false)}>
+ {getMessage('stuff.planReqPopup.btn3')}
+
diff --git a/src/components/management/popup/WindSelectPop.jsx b/src/components/management/popup/WindSelectPop.jsx
index b135aa20..68d84558 100644
--- a/src/components/management/popup/WindSelectPop.jsx
+++ b/src/components/management/popup/WindSelectPop.jsx
@@ -105,12 +105,12 @@ export default function WindSelectPop(props) {
- props.setShowWindSpeedButtonValid(false)}>
- {getMessage('stuff.windSelectPopup.btn1')}
-
-
+
{getMessage('stuff.windSelectPopup.btn2')}
+ props.setShowWindSpeedButtonValid(false)}>
+ {getMessage('stuff.windSelectPopup.btn1')}
+
diff --git a/src/components/simulator/Simulator.jsx b/src/components/simulator/Simulator.jsx
index 54d2c808..603a5fde 100644
--- a/src/components/simulator/Simulator.jsx
+++ b/src/components/simulator/Simulator.jsx
@@ -3,6 +3,7 @@
import 'chart.js/auto'
import { Bar } from 'react-chartjs-2'
import dayjs from 'dayjs'
+import { v4 as uuidv4 } from 'uuid'
import { useEffect, useState, useRef, useContext } from 'react'
import { useRecoilState } from 'recoil'
@@ -14,11 +15,16 @@ import { useMessage } from '@/hooks/useMessage'
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
import { convertNumberToPriceDecimal } from '@/util/common-utils'
+// import { useSearchParams } from 'next/navigation'
export default function Simulator() {
const { floorPlanState } = useContext(FloorPlanContext)
const { objectNo, pid } = floorPlanState
+ // const searchParams = useSearchParams()
+ // const objectNo = searchParams.get('objectNo')
+ // const pid = searchParams.get('pid')
+
const chartRef = useRef(null)
// 캔버스 메뉴 넘버 셋팅
@@ -96,6 +102,16 @@ export default function Simulator() {
}
useEffect(() => {
+ /* 초기화 작업 */
+ setChartData([])
+ setObjectDetail({})
+ setModuleInfoList([])
+ setPcsInfoList([])
+ setHatsudenryouAll([])
+ setHatsudenryouAllSnow([])
+ setHatsudenryouPeakcutAll([])
+ setHatsudenryouPeakcutAllSnow([])
+
if (objectNo) {
fetchObjectDetail(objectNo)
fetchSimulatorNotice()
@@ -192,7 +208,8 @@ export default function Simulator() {
{getMessage('simulator.title.sub1')}
- {objectDetail.objectNo} (Plan No: {pid})
+ {objectDetail.objectNo}
+ {`${objectDetail.planNo ? `(Plan No: ${objectDetail.planNo})` : ''}`}
{/* 작성일 */}
@@ -291,7 +308,7 @@ export default function Simulator() {
{chartData.length > 0 ? (
{chartData.map((data) => (
- | {data} |
+ {data} |
))}
) : (
diff --git a/src/hooks/roofcover/useRoofAllocationSetting.js b/src/hooks/roofcover/useRoofAllocationSetting.js
index 70c421b9..638da76a 100644
--- a/src/hooks/roofcover/useRoofAllocationSetting.js
+++ b/src/hooks/roofcover/useRoofAllocationSetting.js
@@ -1,10 +1,17 @@
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
-import { canvasState, currentMenuState, currentObjectState } from '@/store/canvasAtom'
+import { canvasState, currentAngleTypeSelector, currentMenuState, currentObjectState } from '@/store/canvasAtom'
import { useEffect, useRef, useState } from 'react'
import { useAxios } from '@/hooks/useAxios'
import { useSwal } from '@/hooks/useSwal'
import { usePolygon } from '@/hooks/usePolygon'
-import { correntObjectNoState, addedRoofsState, basicSettingState, roofDisplaySelector, roofMaterialsSelector, selectedRoofMaterialSelector } from '@/store/settingAtom'
+import {
+ correntObjectNoState,
+ addedRoofsState,
+ basicSettingState,
+ roofDisplaySelector,
+ roofMaterialsSelector,
+ selectedRoofMaterialSelector,
+} from '@/store/settingAtom'
import { usePopup } from '@/hooks/usePopup'
import { POLYGON_TYPE } from '@/common/common'
import { v4 as uuidv4 } from 'uuid'
@@ -16,6 +23,7 @@ import { menuTypeState } from '@/store/menuAtom'
import { useRoofFn } from '@/hooks/common/useRoofFn'
import { ROOF_MATERIAL_LAYOUT } from '@/components/floor-plan/modal/placementShape/PlacementShapeSetting'
import { globalLocaleStore } from '@/store/localeAtom'
+import { getChonByDegree } from '@/util/canvas-util'
// 지붕면 할당
export function useRoofAllocationSetting(id) {
@@ -37,6 +45,7 @@ export function useRoofAllocationSetting(id) {
const [roofList, setRoofList] = useRecoilState(addedRoofsState) // 배치면 초기설정에서 선택한 지붕재 배열
const [editingLines, setEditingLines] = useState([])
const [currentRoofList, setCurrentRoofList] = useState(roofList)
+ const currentAngleType = useRecoilValue(currentAngleTypeSelector)
const globalLocaleState = useRecoilValue(globalLocaleStore)
const { get, post } = useAxios(globalLocaleState)
@@ -110,7 +119,6 @@ export function useRoofAllocationSetting(id) {
}
})
} else {
-
roofsArray = [
{
roofApply: true,
@@ -131,27 +139,28 @@ export function useRoofAllocationSetting(id) {
}
console.log('fetchBasicSettings roofsArray', roofsArray)
-
+
// 데이터 설정
const selectRoofs = []
- for (let i = 0; i < roofsArray.length; i++) {
- roofMaterials?.map((material) => {
+ for (let i = 0; i < roofsArray.length; i++) {
+ roofMaterials?.map((material) => {
if (material.roofMatlCd === roofsArray[i].roofMatlCd) {
- selectRoofs.push({ ...material
- , selected: roofsArray[i].roofApply
- , index: roofsArray[i].roofSeq
- , id: roofsArray[i].roofMatlCd
- , width: roofsArray[i].roofWidth
- , length: roofsArray[i].roofHeight
- , hajebichi: roofsArray[i].roofHajebichi
- , raft: roofsArray[i].roofGap
- , layout: roofsArray[i].roofLayout
- })
+ selectRoofs.push({
+ ...material,
+ selected: roofsArray[i].roofApply,
+ index: roofsArray[i].roofSeq,
+ id: roofsArray[i].roofMatlCd,
+ width: roofsArray[i].roofWidth,
+ length: roofsArray[i].roofHeight,
+ hajebichi: roofsArray[i].roofHajebichi,
+ raft: roofsArray[i].roofGap,
+ layout: roofsArray[i].roofLayout,
+ })
setCurrentRoofList(selectRoofs)
}
})
}
- setBasicSetting({ ...basicSetting, roofsData: roofsArray})
+ setBasicSetting({ ...basicSetting, roofsData: roofsArray })
})
} catch (error) {
console.error('Data fetching error:', error)
@@ -160,11 +169,10 @@ export function useRoofAllocationSetting(id) {
// 저장
const basicSettingSave = async () => {
-
const patternData = {
objectNo: correntObjectNo,
roofSizeSet: basicSetting.roofSizeSet,
- roofAngleSet: basicSetting.roofAngleSet,
+ roofAngleSet: basicSetting.roofAngleSet,
roofMaterialsAddList: currentRoofList.map((item) => ({
roofApply: item.selected === null || item.selected === undefined ? 'true' : item.selected,
roofSeq: item.index === null || item.index === undefined ? 0 : item.index,
@@ -174,24 +182,23 @@ export function useRoofAllocationSetting(id) {
roofHajebichi: item.hajebichi === null || item.hajebichi === undefined ? 0 : item.hajebichi,
roofGap: item.raft === null || item.raft === undefined ? 'HEI_455' : item.raft,
roofLayout: item.layout === null || item.layout === undefined ? 'P' : item.layout,
+ })),
+ }
+
+ console.log('🚀 ~ basicSettingSave ~ patternData >>>>>>>>>>>>> :', patternData)
+
+ // HTTP POST 요청 보내기
+ await post({ url: `/api/canvas-management/canvas-basic-settings`, data: patternData })
+ .then((res) => {
+ swalFire({ text: getMessage(res.returnMessage) })
+
+ //Recoil 설정
+ // setCanvasSetting({ ...basicSetting })
+ fetchBasicSettings()
+ })
+ .catch((error) => {
+ swalFire({ text: error.message, icon: 'error' })
})
- ),
- }
-
- console.log('🚀 ~ basicSettingSave ~ patternData >>>>>>>>>>>>> :', patternData)
-
- // HTTP POST 요청 보내기
- await post({ url: `/api/canvas-management/canvas-basic-settings`, data: patternData })
- .then((res) => {
- swalFire({ text: getMessage(res.returnMessage) })
-
- //Recoil 설정
- // setCanvasSetting({ ...basicSetting })
- fetchBasicSettings()
- })
- .catch((error) => {
- swalFire({ text: error.message, icon: 'error' })
- })
}
const onAddRoofMaterial = () => {
@@ -221,17 +228,15 @@ export function useRoofAllocationSetting(id) {
}
// 선택한 지붕재로 할당
- const handleSave = () => {
-
+ const handleSave = () => {
basicSettingSave()
// 모두 actualSize 있으면 바로 적용 없으면 actualSize 설정
- if (checkInnerLines()) {
+ if (checkInnerLines()) {
addPopup(popupId, 1, )
} else {
apply()
}
-
}
// 지붕재 오른쪽 마우스 클릭 후 단일로 지붕재 변경 필요한 경우
@@ -417,6 +422,65 @@ export function useRoofAllocationSetting(id) {
setCurrentRoofList(newRoofList)
}
+ const handleChangeInput = (e, type, index) => {
+ const value = e.target.value
+ if (type === 'pitch') {
+ // type이 pitch인 경우 소수점 1자리까지만 입력 가능
+ const reg = /^[0-9]+(\.[0-9]{0,1})?$/
+
+ if (!reg.test(value)) {
+ e.target.value = value.substring(0, value.length - 1)
+ const newRoofList = currentRoofList.map((roof, idx) => {
+ if (idx === index) {
+ return {
+ ...roof,
+ [type]: currentAngleType === 'slope' ? value.substring(0, value.length - 1) : getChonByDegree(value.substring(0, value.length - 1)),
+ }
+ }
+ return roof
+ })
+
+ setCurrentRoofList(newRoofList)
+
+ return
+ } else {
+ const newRoofList = currentRoofList.map((roof, idx) => {
+ if (idx === index) {
+ return {
+ ...roof,
+ [type]: currentAngleType === 'slope' ? value : getChonByDegree(value),
+ }
+ }
+ return roof
+ })
+
+ setCurrentRoofList(newRoofList)
+ }
+
+ return
+ }
+ const newRoofList = currentRoofList.map((roof, idx) => {
+ if (idx === index) {
+ return { ...roof, [type]: value }
+ }
+ return roof
+ })
+
+ setCurrentRoofList(newRoofList)
+ }
+
+ const handleChangePitch = (e, index) => {
+ const value = e.target.value
+ const newRoofList = currentRoofList.map((roof, idx) => {
+ if (idx === index) {
+ return { ...roof, pitch: value }
+ }
+ return roof
+ })
+
+ setCurrentRoofList(newRoofList)
+ }
+
return {
handleSave,
onAddRoofMaterial,
@@ -435,5 +499,7 @@ export function useRoofAllocationSetting(id) {
handleChangeLayout,
handleSaveContext,
currentRoofList,
+ handleChangeInput,
+ handleChangePitch,
}
}
diff --git a/src/hooks/usePolygon.js b/src/hooks/usePolygon.js
index a844dd6b..3a5c88f5 100644
--- a/src/hooks/usePolygon.js
+++ b/src/hooks/usePolygon.js
@@ -268,7 +268,7 @@ export const usePolygon = () => {
surfaceCompass: polygon.surfaceCompass,
moduleCompass: polygon.moduleCompass,
visible: isFlowDisplay,
- pitch: polygon.pitch,
+ pitch: polygon.roofMaterial.pitch ?? 4,
parentId: polygon.id,
})
diff --git a/src/locales/ja.json b/src/locales/ja.json
index 6cd6dee5..829c5e61 100644
--- a/src/locales/ja.json
+++ b/src/locales/ja.json
@@ -687,6 +687,7 @@
"stuff.detail.save.valierror2": "設置高さ0より大きい値を入力してください",
"stuff.detail.save.valierror3": "{0} 必須入力項目です.",
"stuff.detail.save.valierror4": "二次販売店名は必須オプションです.",
+ "stuff.detail.move.confirmMsg": "商品情報画面に移動します。 [保存]していない図面情報は削除されます。商品情報画面に移動しますか?",
"stuff.planReqPopup.popTitle": "設計依頼検索",
"stuff.planReqPopup.btn1": "検索",
"stuff.planReqPopup.btn2": "初期化",
@@ -844,6 +845,7 @@
"estimate.detail.saleStoreId": "一次販売店名",
"estimate.detail.estimateDate": "見積日",
"estimate.detail.otherSaleStoreId": "二次販売店名",
+ "estimate.detail.noOtherSaleStoreId": "二次点なし",
"estimate.detail.receiveUser": "担当者 ",
"estimate.detail.objectName": "案件名",
"estimate.detail.objectRemarks": "メモ",
diff --git a/src/locales/ko.json b/src/locales/ko.json
index dc1bc707..2f7b3df6 100644
--- a/src/locales/ko.json
+++ b/src/locales/ko.json
@@ -697,7 +697,8 @@
"stuff.detail.save.valierror2": "설치높이는 0보다 큰 값을 입력하세요",
"stuff.detail.save.valierror3": "{0} 필수 입력 항목입니다.",
"stuff.detail.save.valierror4": "2차 판매점명은 필수 선택사항입니다.",
- "stuff.planReqPopup.popTitle": "설계 요청 검색",
+ "stuff.detail.move.confirmMsg": "물건정보 화면으로 이동합니다. [저장]하지 않은 도면정보는 삭제됩니다. 물건정보 화면으로 이동하시겠습니까?",
+ "stuff.planReqPopup.popTitle": "설계 의뢰 검색",
"stuff.planReqPopup.btn1": "검색",
"stuff.planReqPopup.btn2": "초기화",
"stuff.planReqPopup.btn3": "닫기",
@@ -854,6 +855,7 @@
"estimate.detail.saleStoreId": "1차 판매점명",
"estimate.detail.estimateDate": "견적일",
"estimate.detail.otherSaleStoreId": "2차 판매점명",
+ "estimate.detail.noOtherSaleStoreId": "2차점 없음",
"estimate.detail.receiveUser": "담당자",
"estimate.detail.objectName": "안건명",
"estimate.detail.objectRemarks": "메모",