Merge branch 'dev' into dev-yj

This commit is contained in:
yjnoh 2025-02-05 16:58:39 +09:00
commit 17378dc3ad
7 changed files with 30 additions and 19 deletions

View File

@ -4,20 +4,21 @@ 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')
// EXCEL
const [schUnitPriceFlg, setSchUnitPriceFlg] = useState('0')
//
const [schDisplayFlg, setSchSchDisplayFlg] = useState('0')
const [schDisplayFlg, setSchDisplayFlg] = useState('0')
// (:1 : 0)
const [schWeightFlg, setSchWeightFlg] = useState('1')
///
@ -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,
@ -206,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)
}}
/>
<label htmlFor="schDisplayFlg0">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg0')}</label>
@ -219,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)
}}
/>
<label htmlFor="schDisplayFlg1">{getMessage('estimate.detail.docPopup.schDisplayFlg.schDisplayFlg1')}</label>

View File

@ -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

View File

@ -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 (
<div className="modal-popup">

View File

@ -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 }) {
</button>
))}
</div>
{plans.length < 10 && (
{plans.length < 10 && !pathname.includes('/estimate') && !pathname.includes('/simulator') && (
<button
className="plane-add"
onClick={async () => {

View File

@ -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) => {

View File

@ -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 = () => {

View File

@ -296,7 +296,12 @@ 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) {
// todo: [유상욱] 현재 플랜과 현재 캔버스 플랜이 다른 경우 플랜 이동
// 우선 주석처리
// router.push(`${pathname}?pid=${currentPlan?.planNo}&objectNo=${currentPlan.objectNo}`)
}
}
const setBgImage = () => {