Merge branch 'dev' into dev-yj
This commit is contained in:
commit
1e372f925b
@ -44,6 +44,7 @@ import JA from '@/locales/ja.json'
|
|||||||
import { MENU } from '@/common/common'
|
import { MENU } from '@/common/common'
|
||||||
|
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
export default function CanvasMenu(props) {
|
export default function CanvasMenu(props) {
|
||||||
const { menuNumber, setMenuNumber } = props
|
const { menuNumber, setMenuNumber } = props
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
@ -101,6 +102,8 @@ export default function CanvasMenu(props) {
|
|||||||
|
|
||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
|
|
||||||
|
//임시
|
||||||
|
const { selectedPlan } = usePlan()
|
||||||
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
|
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
|
||||||
const url = '/api/estimate/excel-download'
|
const url = '/api/estimate/excel-download'
|
||||||
|
|
||||||
@ -168,14 +171,14 @@ export default function CanvasMenu(props) {
|
|||||||
break
|
break
|
||||||
case 5:
|
case 5:
|
||||||
// let pid = urlParams.get('pid')
|
// let pid = urlParams.get('pid')
|
||||||
promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => {
|
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.docNo) {
|
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||||
setMenuNumber(menu.index)
|
setMenuNumber(menu.index)
|
||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||||
router.push(`/floor-plan/estimate/5?pid=${pid}&objectNo=${objectNo}`)
|
router.push(`/floor-plan/estimate/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`)
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
}
|
}
|
||||||
@ -183,13 +186,13 @@ export default function CanvasMenu(props) {
|
|||||||
})
|
})
|
||||||
break
|
break
|
||||||
case 6:
|
case 6:
|
||||||
promiseGet({ url: `/api/estimate/${objectNo}/${pid}/detail` }).then((res) => {
|
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.ordering}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (estimateDetail.docNo) {
|
if (estimateDetail.tempFlg === '0') {
|
||||||
setMenuNumber(menu.index)
|
setMenuNumber(menu.index)
|
||||||
setCurrentMenu(menu.title)
|
setCurrentMenu(menu.title)
|
||||||
router.push(`/floor-plan/simulator/${menu.index}?pid=${pid}&objectNo=${objectNo}`)
|
router.push(`/floor-plan/simulator/${menu.index}?pid=${selectedPlan.ordering}&objectNo=${objectNo}`)
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||||
}
|
}
|
||||||
|
|||||||
@ -79,7 +79,8 @@ export default function ContextRoofAllocationSetting(props) {
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-option-wrap">
|
<div className="grid-option-wrap">
|
||||||
{currentRoofList.map((roof, index) => {
|
{currentRoofList.length > 0 &&
|
||||||
|
currentRoofList.map((roof, index) => {
|
||||||
return (
|
return (
|
||||||
<div className="grid-option-box" key={index}>
|
<div className="grid-option-box" key={index}>
|
||||||
<div className="d-check-radio pop no-text">
|
<div className="d-check-radio pop no-text">
|
||||||
|
|||||||
@ -219,6 +219,10 @@ export default function Stuff() {
|
|||||||
pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100,
|
pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!params.saleStoreId) {
|
||||||
|
params.saleStoreId = session.storeId
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
||||||
await get({
|
await get({
|
||||||
@ -271,6 +275,10 @@ export default function Stuff() {
|
|||||||
stuffSearchParams.schSortType = defaultSortType
|
stuffSearchParams.schSortType = defaultSortType
|
||||||
stuffSearchParams.pageNo = stuffSearchParams.pageNo
|
stuffSearchParams.pageNo = stuffSearchParams.pageNo
|
||||||
|
|
||||||
|
if (!stuffSearchParams.saleStoreId) {
|
||||||
|
stuffSearchParams.saleStoreId = session.storeId
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
||||||
await get({ url: apiUrl }).then((res) => {
|
await get({ url: apiUrl }).then((res) => {
|
||||||
@ -301,6 +309,9 @@ export default function Stuff() {
|
|||||||
stuffSearchParams.schSortType = defaultSortType
|
stuffSearchParams.schSortType = defaultSortType
|
||||||
setPageNo(1)
|
setPageNo(1)
|
||||||
|
|
||||||
|
if (!params.saleStoreId) {
|
||||||
|
stuffSearchParams.saleStoreId = session.storeId
|
||||||
|
}
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
||||||
await get({ url: apiUrl }).then((res) => {
|
await get({ url: apiUrl }).then((res) => {
|
||||||
|
|||||||
@ -16,26 +16,18 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
|||||||
|
|
||||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||||
import { usePlan } from '@/hooks/usePlan'
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup, closeAll } from '@/hooks/usePopup'
|
||||||
// import { useSearchParams } from 'next/navigation'
|
|
||||||
|
|
||||||
export default function Simulator() {
|
export default function Simulator() {
|
||||||
const { floorPlanState } = useContext(FloorPlanContext)
|
const { floorPlanState } = useContext(FloorPlanContext)
|
||||||
const { objectNo, pid } = floorPlanState
|
const { objectNo, pid } = floorPlanState
|
||||||
|
|
||||||
// const searchParams = useSearchParams()
|
|
||||||
// const objectNo = searchParams.get('objectNo')
|
|
||||||
// const pid = searchParams.get('pid')
|
|
||||||
const { selectedPlan } = usePlan()
|
const { selectedPlan } = usePlan()
|
||||||
|
|
||||||
const chartRef = useRef(null)
|
const chartRef = useRef(null)
|
||||||
|
|
||||||
// 캔버스 메뉴 넘버 셋팅
|
// 캔버스 메뉴 넘버 셋팅
|
||||||
const { setMenuNumber } = useCanvasMenu()
|
const { setMenuNumber } = useCanvasMenu()
|
||||||
|
const { closeAll } = usePopup()
|
||||||
useEffect(() => {
|
|
||||||
setMenuNumber(6)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const { get } = useAxios()
|
const { get } = useAxios()
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -43,12 +35,6 @@ export default function Simulator() {
|
|||||||
// 차트 관련
|
// 차트 관련
|
||||||
const [chartData, setChartData] = useState([])
|
const [chartData, setChartData] = useState([])
|
||||||
|
|
||||||
const { closeAll } = usePopup()
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
closeAll()
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const data = {
|
const data = {
|
||||||
labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||||
datasets: [
|
datasets: [
|
||||||
@ -114,7 +100,6 @@ export default function Simulator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('🚀 ~ useEffect ~ selectedPlan:', selectedPlan)
|
|
||||||
/* 초기화 작업 */
|
/* 초기화 작업 */
|
||||||
setChartData([])
|
setChartData([])
|
||||||
setObjectDetail({})
|
setObjectDetail({})
|
||||||
@ -125,11 +110,13 @@ export default function Simulator() {
|
|||||||
setHatsudenryouPeakcutAll([])
|
setHatsudenryouPeakcutAll([])
|
||||||
setHatsudenryouPeakcutAllSnow([])
|
setHatsudenryouPeakcutAllSnow([])
|
||||||
|
|
||||||
if (objectNo) {
|
if (objectNo && pid && selectedPlan) {
|
||||||
fetchObjectDetail(objectNo)
|
fetchObjectDetail(objectNo, selectedPlan.ordering)
|
||||||
fetchSimulatorNotice()
|
fetchSimulatorNotice()
|
||||||
setPwrGnrSimType('D')
|
setPwrGnrSimType('D')
|
||||||
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
||||||
|
setMenuNumber(6)
|
||||||
|
closeAll()
|
||||||
}
|
}
|
||||||
}, [objectNo, pid, selectedPlan])
|
}, [objectNo, pid, selectedPlan])
|
||||||
|
|
||||||
@ -148,8 +135,8 @@ export default function Simulator() {
|
|||||||
const [hatsudenryouPeakcutAll, setHatsudenryouPeakcutAll] = useState([])
|
const [hatsudenryouPeakcutAll, setHatsudenryouPeakcutAll] = useState([])
|
||||||
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
||||||
|
|
||||||
const fetchObjectDetail = async (objectNo) => {
|
const fetchObjectDetail = async (objectNo, currentPid) => {
|
||||||
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${pid}`
|
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}`
|
||||||
|
|
||||||
const resultData = await get({ url: apiUrl })
|
const resultData = await get({ url: apiUrl })
|
||||||
if (resultData) {
|
if (resultData) {
|
||||||
@ -257,7 +244,7 @@ export default function Simulator() {
|
|||||||
{/* 적설조건 */}
|
{/* 적설조건 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('simulator.title.sub7')}</div>
|
<div className="estimate-tit">{getMessage('simulator.title.sub7')}</div>
|
||||||
<div className="estimate-name">{objectDetail.snowfall} cm</div>
|
<div className="estimate-name">{objectDetail.snowfall ? `${objectDetail.snowfall}cm` : ''} </div>
|
||||||
</div>
|
</div>
|
||||||
{/* 풍속조건 */}
|
{/* 풍속조건 */}
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
@ -356,7 +343,10 @@ export default function Simulator() {
|
|||||||
{/* 지붕면 */}
|
{/* 지붕면 */}
|
||||||
<td>{moduleInfo.roofSurface}</td>
|
<td>{moduleInfo.roofSurface}</td>
|
||||||
{/* 경사각 */}
|
{/* 경사각 */}
|
||||||
<td>{convertNumberToPriceDecimal(moduleInfo.slopeAngle)}{moduleInfo.classType == 0 ? "寸":"º"}</td>
|
<td>
|
||||||
|
{convertNumberToPriceDecimal(moduleInfo.slopeAngle)}
|
||||||
|
{moduleInfo.classType == 0 ? '寸' : 'º'}
|
||||||
|
</td>
|
||||||
{/* 방위각(도) */}
|
{/* 방위각(도) */}
|
||||||
<td>{convertNumberToPriceDecimal(moduleInfo.azimuth)}</td>
|
<td>{convertNumberToPriceDecimal(moduleInfo.azimuth)}</td>
|
||||||
{/* 태양전지모듈 */}
|
{/* 태양전지모듈 */}
|
||||||
|
|||||||
@ -22,8 +22,8 @@ export function useRoofFn() {
|
|||||||
const ratio = window.devicePixelRatio || 1
|
const ratio = window.devicePixelRatio || 1
|
||||||
const layout = roofMaterial.layout
|
const layout = roofMaterial.layout
|
||||||
|
|
||||||
let width = (roofMaterial.width ?? 226) / 10
|
let width = (roofMaterial.width || 226) / 10
|
||||||
let height = (roofMaterial.length ?? 158) / 10
|
let height = (roofMaterial.length || 158) / 10
|
||||||
const index = roofMaterial.index ?? 0
|
const index = roofMaterial.index ?? 0
|
||||||
let roofStyle = 2
|
let roofStyle = 2
|
||||||
const inputPatternSize = { width: width, height: height } //임시 사이즈
|
const inputPatternSize = { width: width, height: height } //임시 사이즈
|
||||||
|
|||||||
@ -42,7 +42,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(roofMaterials[0]) // 팝업 내 기준 지붕재
|
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(roofMaterials[0]) // 팝업 내 기준 지붕재
|
||||||
const [roofList, setRoofList] = useRecoilState(addedRoofsState) // 배치면 초기설정에서 선택한 지붕재 배열
|
const [roofList, setRoofList] = useRecoilState(addedRoofsState) // 배치면 초기설정에서 선택한 지붕재 배열
|
||||||
const [editingLines, setEditingLines] = useState([])
|
const [editingLines, setEditingLines] = useState([])
|
||||||
const [currentRoofList, setCurrentRoofList] = useState(null)
|
const [currentRoofList, setCurrentRoofList] = useState([])
|
||||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const [basicInfo, setBasicInfo] = useState(null)
|
const [basicInfo, setBasicInfo] = useState(null)
|
||||||
|
|||||||
@ -215,7 +215,6 @@ export function usePlan(params = {}) {
|
|||||||
const estimateDetail = res.data
|
const estimateDetail = res.data
|
||||||
if (pathname === '/floor-plan/estimate/5') {
|
if (pathname === '/floor-plan/estimate/5') {
|
||||||
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||||
console.log('이동')
|
|
||||||
res.data.resetFlag = 'N'
|
res.data.resetFlag = 'N'
|
||||||
|
|
||||||
if (res.data.itemList.length > 0) {
|
if (res.data.itemList.length > 0) {
|
||||||
@ -238,9 +237,12 @@ export function usePlan(params = {}) {
|
|||||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
//발전시뮬레이션
|
// 발전시뮬레이션
|
||||||
// 클릭한 플랜 탭으로 이동
|
if (estimateDetail.tempFlg === '0') {
|
||||||
// updateCurrentPlan(newCurrentId)
|
updateCurrentPlan(newCurrentId)
|
||||||
|
} else {
|
||||||
|
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user