Merge branch 'dev' into dev-yj
This commit is contained in:
commit
df21e6c198
@ -79,7 +79,7 @@ export default function Table({ clsCode }) {
|
|||||||
>
|
>
|
||||||
<td className="al-c">
|
<td className="al-c">
|
||||||
{/* 번호 */}
|
{/* 번호 */}
|
||||||
{board.rowNumber}
|
{board.totCnt - board.rowNumber + 1}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
{/* 제목 */}
|
{/* 제목 */}
|
||||||
|
|||||||
@ -34,9 +34,10 @@ import { addedRoofsState, basicSettingState, selectedRoofMaterialSelector, setti
|
|||||||
import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom'
|
import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom'
|
||||||
import { commonUtilsState } from '@/store/commonUtilsAtom'
|
import { commonUtilsState } from '@/store/commonUtilsAtom'
|
||||||
import { menusState, menuTypeState } from '@/store/menuAtom'
|
import { menusState, menuTypeState } from '@/store/menuAtom'
|
||||||
import { estimateState, floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { estimateState } from '@/store/floorPlanObjectAtom'
|
||||||
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
||||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
|
import { useSearchParams } from 'next/navigation'
|
||||||
|
|
||||||
import KO from '@/locales/ko.json'
|
import KO from '@/locales/ko.json'
|
||||||
import JA from '@/locales/ja.json'
|
import JA from '@/locales/ja.json'
|
||||||
@ -86,14 +87,61 @@ export default function CanvasMenu(props) {
|
|||||||
//견적서버튼 노출용
|
//견적서버튼 노출용
|
||||||
const [buttonStyle, setButtonStyle] = useState('')
|
const [buttonStyle, setButtonStyle] = useState('')
|
||||||
|
|
||||||
const onClickNav = (menu) => {
|
// 발전시뮬레이션 메뉴 이동
|
||||||
setMenuNumber(menu.index)
|
const searchParams = useSearchParams()
|
||||||
setCurrentMenu(menu.title)
|
const objectNo = searchParams.get('objectNo')
|
||||||
|
const pid = searchParams.get('pid')
|
||||||
|
|
||||||
|
// 발전시물레이션 Excel/PDF 다운
|
||||||
|
const { promiseGet, promisePost } = useAxios(globalLocale)
|
||||||
|
const pwrGnrSimTypeRecoil = useRecoilValue(pwrGnrSimTypeState)
|
||||||
|
|
||||||
|
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
|
||||||
|
const url = '/api/estimate/excel-download'
|
||||||
|
|
||||||
|
const params = {
|
||||||
|
objectNo: objectNo,
|
||||||
|
planNo: pid,
|
||||||
|
schDownload: donwloadType,
|
||||||
|
schDrawingFlg: drawingFlg,
|
||||||
|
pwrGnrSimType: pwrGnrSimTypeRecoil.type,
|
||||||
|
}
|
||||||
|
|
||||||
|
const options = { responseType: 'blob' }
|
||||||
|
await promisePost({ url: url, data: params, option: options })
|
||||||
|
.then((resultData) => {
|
||||||
|
if (resultData) {
|
||||||
|
let fileName = 'unknow'
|
||||||
|
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
||||||
|
const fileUrl = window.URL.createObjectURL(blob)
|
||||||
|
|
||||||
|
const link = document.createElement('a')
|
||||||
|
link.href = fileUrl
|
||||||
|
|
||||||
|
//서버에서 내려오는 파일명
|
||||||
|
const contentDisposition = resultData.headers['content-disposition']
|
||||||
|
if (contentDisposition) {
|
||||||
|
fileName = contentDisposition.split('filename=')[1].replace(/['"]/g, '')
|
||||||
|
}
|
||||||
|
|
||||||
|
link.download = fileName
|
||||||
|
document.body.appendChild(link)
|
||||||
|
link.click()
|
||||||
|
link.remove()
|
||||||
|
window.URL.revokeObjectURL(fileUrl)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((error) => {
|
||||||
|
alert('File does not exist.')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
const onClickNav = (menu) => {
|
||||||
switch (menu.index) {
|
switch (menu.index) {
|
||||||
case 1:
|
case 1:
|
||||||
setType('placementShape')
|
setType('placementShape')
|
||||||
onClickPlacementInitialMenu()
|
onClickPlacementInitialMenu()
|
||||||
|
|
||||||
break
|
break
|
||||||
case 2:
|
case 2:
|
||||||
setType('outline')
|
setType('outline')
|
||||||
@ -109,11 +157,31 @@ export default function CanvasMenu(props) {
|
|||||||
setType('module')
|
setType('module')
|
||||||
break
|
break
|
||||||
case 6:
|
case 6:
|
||||||
router.push(`/floor-plan/simulator/${menu.index}`)
|
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||||
|
if (res.status === 200) {
|
||||||
|
const planList = res.data.planList
|
||||||
|
const objectPlanDetail = planList.filter((row) => row.objectNo === objectNo && row.planNo === pid)
|
||||||
|
|
||||||
|
if (objectPlanDetail) {
|
||||||
|
if (objectPlanDetail[0].estimateDate) {
|
||||||
|
router.push(`/floor-plan/simulator/${menu.index}?pid=${pid}&objectNo=${objectNo}`)
|
||||||
|
setMenuNumber(menu.index)
|
||||||
|
setCurrentMenu(menu.title)
|
||||||
|
} else {
|
||||||
|
alert(getMessage('simulator.menu.move.valid1'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pathname !== '/floor-plan') router.push('/floor-plan')
|
if (menu.index !== 6) {
|
||||||
|
setMenuNumber(menu.index)
|
||||||
|
setCurrentMenu(menu.title)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pathname !== '/floor-plan') router.push(`/floor-plan?pid=${pid}&objectNo=${objectNo}`)
|
||||||
}
|
}
|
||||||
|
|
||||||
const changeSelectedRoofMaterial = (e) => {
|
const changeSelectedRoofMaterial = (e) => {
|
||||||
@ -215,54 +283,6 @@ export default function CanvasMenu(props) {
|
|||||||
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 && menu.index === 2)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 발전시물레이션 Excel/PDF 다운
|
|
||||||
const { promisePost } = useAxios(globalLocale)
|
|
||||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
|
||||||
const pwrGnrSimTypeRecoil = useRecoilValue(pwrGnrSimTypeState)
|
|
||||||
|
|
||||||
const { plans } = usePlan()
|
|
||||||
const plan = plans.find((plan) => plan.isCurrent === true)
|
|
||||||
|
|
||||||
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
|
|
||||||
const url = '/api/estimate/excel-download'
|
|
||||||
|
|
||||||
const params = {
|
|
||||||
objectNo: objectRecoil.floorPlanObjectNo,
|
|
||||||
planNo: plan?.id,
|
|
||||||
schDownload: donwloadType,
|
|
||||||
schDrawingFlg: drawingFlg,
|
|
||||||
pwrGnrSimType: pwrGnrSimTypeRecoil.type,
|
|
||||||
}
|
|
||||||
|
|
||||||
const options = { responseType: 'blob' }
|
|
||||||
await promisePost({ url: url, data: params, option: options })
|
|
||||||
.then((resultData) => {
|
|
||||||
if (resultData) {
|
|
||||||
let fileName = 'unknow'
|
|
||||||
const blob = new Blob([resultData.data], { type: resultData.headers['content-type'] || 'application/octet-stream' })
|
|
||||||
const fileUrl = window.URL.createObjectURL(blob)
|
|
||||||
|
|
||||||
const link = document.createElement('a')
|
|
||||||
link.href = fileUrl
|
|
||||||
|
|
||||||
//서버에서 내려오는 파일명
|
|
||||||
const contentDisposition = resultData.headers['content-disposition']
|
|
||||||
if (contentDisposition) {
|
|
||||||
fileName = contentDisposition.split('filename=')[1].replace(/['"]/g, '')
|
|
||||||
}
|
|
||||||
|
|
||||||
link.download = fileName
|
|
||||||
document.body.appendChild(link)
|
|
||||||
link.click()
|
|
||||||
link.remove()
|
|
||||||
window.URL.revokeObjectURL(fileUrl)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.catch((error) => {
|
|
||||||
alert('File does not exist.')
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isObjectNotEmpty(estimateRecoilState)) {
|
if (isObjectNotEmpty(estimateRecoilState)) {
|
||||||
if (estimateRecoilState?.createUser === 'T01') {
|
if (estimateRecoilState?.createUser === 'T01') {
|
||||||
|
|||||||
@ -332,7 +332,7 @@ export default function StuffDetail() {
|
|||||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기
|
||||||
setShowButton('none')
|
setShowButton('none')
|
||||||
}
|
}
|
||||||
|
// console.log('상세::', res.data)
|
||||||
if (isObjectNotEmpty(res.data)) {
|
if (isObjectNotEmpty(res.data)) {
|
||||||
let surfaceTypeValue
|
let surfaceTypeValue
|
||||||
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
if (res.data.surfaceType === 'Ⅲ・Ⅳ') {
|
||||||
|
|||||||
@ -39,6 +39,7 @@ export default function UserInfoModal({ userId, userInfoModal, setUserInfoModal
|
|||||||
|
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
setInfo(resultData)
|
setInfo(resultData)
|
||||||
|
setPassword(resultData.password)
|
||||||
} else {
|
} else {
|
||||||
alert(getMessage('common.message.no.data'))
|
alert(getMessage('common.message.no.data'))
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,31 +5,23 @@ import { Bar } from 'react-chartjs-2'
|
|||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
|
|
||||||
import { useEffect, useState, useRef } from 'react'
|
import { useEffect, useState, useRef } from 'react'
|
||||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
import { useRecoilState } from 'recoil'
|
||||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { useSearchParams } from 'next/navigation'
|
||||||
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
||||||
|
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { usePlan } from '@/hooks/usePlan'
|
|
||||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
|
|
||||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||||
|
|
||||||
export default function Simulator() {
|
export default function Simulator() {
|
||||||
const { plans } = usePlan()
|
const searchParams = useSearchParams()
|
||||||
const plan = plans.find((plan) => plan.isCurrent === true)
|
const objectNo = searchParams.get('objectNo')
|
||||||
|
const pid = searchParams.get('pid')
|
||||||
|
|
||||||
const chartRef = useRef(null)
|
const chartRef = useRef(null)
|
||||||
|
|
||||||
// recoil 물건번호
|
|
||||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
|
||||||
const [objectNo, setObjectNo] = useState('')
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
|
||||||
}, [objectRecoil])
|
|
||||||
|
|
||||||
// 캔버스 메뉴 넘버 셋팅
|
// 캔버스 메뉴 넘버 셋팅
|
||||||
const { setMenuNumber } = useCanvasMenu()
|
const { setMenuNumber } = useCanvasMenu()
|
||||||
|
|
||||||
@ -111,7 +103,7 @@ export default function Simulator() {
|
|||||||
setPwrGnrSimType('D')
|
setPwrGnrSimType('D')
|
||||||
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
||||||
}
|
}
|
||||||
}, [objectNo, plan])
|
}, [objectNo, pid])
|
||||||
|
|
||||||
// 물건 상세 정보 조회
|
// 물건 상세 정보 조회
|
||||||
const [objectDetail, setObjectDetail] = useState({})
|
const [objectDetail, setObjectDetail] = useState({})
|
||||||
@ -129,7 +121,7 @@ export default function Simulator() {
|
|||||||
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
||||||
|
|
||||||
const fetchObjectDetail = async (objectNo) => {
|
const fetchObjectDetail = async (objectNo) => {
|
||||||
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${plan?.id}`
|
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${pid}`
|
||||||
|
|
||||||
const resultData = await get({ url: apiUrl })
|
const resultData = await get({ url: apiUrl })
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
@ -201,7 +193,7 @@ export default function Simulator() {
|
|||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('simulator.title.sub1')}</div>
|
<div className="estimate-tit">{getMessage('simulator.title.sub1')}</div>
|
||||||
<div className="estimate-name">
|
<div className="estimate-name">
|
||||||
{objectDetail.objectNo} (Plan No: {plan?.id})
|
{objectDetail.objectNo} (Plan No: {pid})
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* 작성일 */}
|
{/* 작성일 */}
|
||||||
|
|||||||
@ -9,7 +9,7 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
// Constants
|
// Constants
|
||||||
const ESTIMATE_API_ENDPOINT = '/api/estimate' // API 엔드포인트 정의
|
const ESTIMATE_API_ENDPOINT = '/api/estimate' // API 엔드포인트 정의
|
||||||
|
|
||||||
@ -19,6 +19,7 @@ const updateItemInList = (itemList, dispOrder, updates) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export const useEstimateController = (planNo) => {
|
export const useEstimateController = (planNo) => {
|
||||||
|
const { swalFire } = useSwal()
|
||||||
const [fileList, setFileList] = useState([])
|
const [fileList, setFileList] = useState([])
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
@ -353,7 +354,6 @@ export const useEstimateController = (planNo) => {
|
|||||||
estimateData.pkgAsp = estimateData.pkgAsp.replaceAll(',', '')
|
estimateData.pkgAsp = estimateData.pkgAsp.replaceAll(',', '')
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('최종저장::', estimateData)
|
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
// return
|
||||||
try {
|
try {
|
||||||
@ -361,8 +361,9 @@ export const useEstimateController = (planNo) => {
|
|||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
estimateData.newFileList = []
|
estimateData.newFileList = []
|
||||||
alert(getMessage('estimate.detail.save.alertMsg'))
|
//알럿창 변경
|
||||||
//어디로 보낼지
|
swalFire({ text: getMessage('estimate.detail.save.alertMsg'), type: 'alert' })
|
||||||
|
// alert(getMessage('estimate.detail.save.alertMsg'))
|
||||||
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
fetchSetting(objectRecoil.floorPlanObjectNo, estimateData.planNo)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -400,8 +401,14 @@ export const useEstimateController = (planNo) => {
|
|||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
if (isObjectNotEmpty(res.data)) {
|
if (isObjectNotEmpty(res.data)) {
|
||||||
let newObjectNo = res.data.objectNo
|
let newObjectNo = res.data.objectNo
|
||||||
alert(getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'))
|
console.log('newObjectNo::', newObjectNo)
|
||||||
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
|
swalFire({
|
||||||
|
text: getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -945,6 +945,7 @@
|
|||||||
"simulator.table.sub9": "予測発電量 (kWh)",
|
"simulator.table.sub9": "予測発電量 (kWh)",
|
||||||
"simulator.notice.sub1": "Hanwha Japan 年間発電量",
|
"simulator.notice.sub1": "Hanwha Japan 年間発電量",
|
||||||
"simulator.notice.sub2": "シミュレーション案内事項",
|
"simulator.notice.sub2": "シミュレーション案内事項",
|
||||||
|
"simulator.menu.move.valid1": "見積書を作成した後に、発電シミュレーションの結果を照会することができます。",
|
||||||
"master.moduletypeitem.message.error": "지붕재 코드를 입력하세요.",
|
"master.moduletypeitem.message.error": "지붕재 코드를 입력하세요.",
|
||||||
"can.not.move.module": "모듈을 이동할 수 없습니다.(JA)",
|
"can.not.move.module": "모듈을 이동할 수 없습니다.(JA)",
|
||||||
"can.not.copy.module": "모듈을 복사할 수 없습니다.(JA)",
|
"can.not.copy.module": "모듈을 복사할 수 없습니다.(JA)",
|
||||||
|
|||||||
@ -955,6 +955,7 @@
|
|||||||
"simulator.table.sub9": "예측발전량 (kWh)",
|
"simulator.table.sub9": "예측발전량 (kWh)",
|
||||||
"simulator.notice.sub1": "Hanwha Japan 연간 발전량",
|
"simulator.notice.sub1": "Hanwha Japan 연간 발전량",
|
||||||
"simulator.notice.sub2": "시뮬레이션 안내사항",
|
"simulator.notice.sub2": "시뮬레이션 안내사항",
|
||||||
|
"simulator.menu.move.valid1": "견적서를 생성한 후에, 발전시뮬레이션 결과를 조회할 수 있습니다.",
|
||||||
"master.moduletypeitem.message.error": "지붕재 코드를 입력하세요.",
|
"master.moduletypeitem.message.error": "지붕재 코드를 입력하세요.",
|
||||||
"can.not.move.module": "모듈을 이동할 수 없습니다.",
|
"can.not.move.module": "모듈을 이동할 수 없습니다.",
|
||||||
"can.not.copy.module": "모듈을 복사할 수 없습니다.",
|
"can.not.copy.module": "모듈을 복사할 수 없습니다.",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user