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 { QcastContext } from '@/app/QcastProvider'
|
||||
|
||||
export default function CanvasMenu(props) {
|
||||
const { menuNumber, setMenuNumber } = props
|
||||
const pathname = usePathname()
|
||||
@ -101,6 +102,8 @@ export default function CanvasMenu(props) {
|
||||
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
|
||||
//임시
|
||||
const { selectedPlan } = usePlan()
|
||||
const handleExcelPdfFileDown = async (donwloadType, drawingFlg) => {
|
||||
const url = '/api/estimate/excel-download'
|
||||
|
||||
@ -168,14 +171,14 @@ export default function CanvasMenu(props) {
|
||||
break
|
||||
case 5:
|
||||
// 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) {
|
||||
const estimateDetail = res.data
|
||||
if (estimateDetail.docNo) {
|
||||
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||
setMenuNumber(menu.index)
|
||||
setCurrentMenu(menu.title)
|
||||
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 {
|
||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||
}
|
||||
@ -183,13 +186,13 @@ export default function CanvasMenu(props) {
|
||||
})
|
||||
break
|
||||
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) {
|
||||
const estimateDetail = res.data
|
||||
if (estimateDetail.docNo) {
|
||||
if (estimateDetail.tempFlg === '0') {
|
||||
setMenuNumber(menu.index)
|
||||
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 {
|
||||
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||
}
|
||||
|
||||
@ -79,133 +79,134 @@ export default function ContextRoofAllocationSetting(props) {
|
||||
</button>
|
||||
</div>
|
||||
<div className="grid-option-wrap">
|
||||
{currentRoofList.map((roof, index) => {
|
||||
return (
|
||||
<div className="grid-option-box" key={index}>
|
||||
<div className="d-check-radio pop no-text">
|
||||
<input type="radio" name="radio01" checked={roof.selected && 'checked'} readOnly={true} />
|
||||
<label
|
||||
htmlFor="ra01"
|
||||
onClick={(e) => {
|
||||
handleDefaultRoofMaterial(index)
|
||||
}}
|
||||
></label>
|
||||
</div>
|
||||
<div className="grid-option-block-form">
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<div className="grid-select" style={{ width: '248px' }}>
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
value={roof}
|
||||
showKey={'roofMatlNm'}
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
onChange={(e) => handleChangeRoofMaterial(e, index)}
|
||||
/>
|
||||
</div>
|
||||
{index === 0 && <span className="dec">{getMessage('modal.roof.alloc.default.roof.material')}</span>}
|
||||
{index !== 0 && <button className="delete" onClick={() => onDeleteRoofMaterial(index)}></button>}
|
||||
</div>
|
||||
{currentRoofList.length > 0 &&
|
||||
currentRoofList.map((roof, index) => {
|
||||
return (
|
||||
<div className="grid-option-box" key={index}>
|
||||
<div className="d-check-radio pop no-text">
|
||||
<input type="radio" name="radio01" checked={roof.selected && 'checked'} readOnly={true} />
|
||||
<label
|
||||
htmlFor="ra01"
|
||||
onClick={(e) => {
|
||||
handleDefaultRoofMaterial(index)
|
||||
}}
|
||||
></label>
|
||||
</div>
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('slope')}</span>
|
||||
<div className="input-grid" style={{ width: '214px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
onChange={(e) => {
|
||||
handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
|
||||
}}
|
||||
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
||||
/>
|
||||
<div className="grid-option-block-form">
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<div className="grid-select" style={{ width: '248px' }}>
|
||||
<QSelectBox
|
||||
options={roofMaterials}
|
||||
value={roof}
|
||||
showKey={'roofMatlNm'}
|
||||
sourceKey={'roofMatlCd'}
|
||||
targetKey={'roofMatlCd'}
|
||||
onChange={(e) => handleChangeRoofMaterial(e, index)}
|
||||
/>
|
||||
</div>
|
||||
{index === 0 && <span className="dec">{getMessage('modal.roof.alloc.default.roof.material')}</span>}
|
||||
{index !== 0 && <button className="delete" onClick={() => onDeleteRoofMaterial(index)}></button>}
|
||||
</div>
|
||||
<span>{pitchText}</span>
|
||||
</div>
|
||||
</div>
|
||||
{(roof.widAuth || roof.lenAuth) && (
|
||||
<div className="block-box">
|
||||
{roof.widAuth && (
|
||||
<div className="flex-ment">
|
||||
<span>W</span>
|
||||
<div className="input-grid" style={{ width: '100px' }}>
|
||||
<input type="text" className="input-origin block" defaultValue={roof.width} readOnly={roof.widAuth === 'R'} />
|
||||
</div>
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('slope')}</span>
|
||||
<div className="input-grid" style={{ width: '214px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
onChange={(e) => {
|
||||
handleChangeInput(e, currentAngleType === 'slope' ? 'pitch' : 'angle', index)
|
||||
}}
|
||||
defaultValue={currentAngleType === 'slope' ? roof.pitch : roof.angle}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
{roof.lenAuth && (
|
||||
<div className="flex-ment">
|
||||
<span>L</span>
|
||||
<div className="input-grid" style={{ width: '100px' }}>
|
||||
<input type="text" className="input-origin block" defaultValue={roof.length} readOnly={roof.lenAuth === 'R'} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<span>{pitchText}</span>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{(roof.raftAuth || roof.roofPchAuth) && (
|
||||
<div className="block-box">
|
||||
{roof.raftAuth && (
|
||||
<div className="block-box">
|
||||
{(roof.widAuth || roof.lenAuth) && (
|
||||
<div className="block-box">
|
||||
{roof.widAuth && (
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
||||
{raftCodes.length > 0 && (
|
||||
<div className="grid-select" style={{ width: '160px' }}>
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
value={roof}
|
||||
showKey={'clCodeNm'}
|
||||
sourceKey={'clCode'}
|
||||
targetKey={roof.raft ? 'raft' : 'raftBaseCd'}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{roof.roofPchAuth && (
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('hajebichi')}</span>
|
||||
<div className="input-grid" style={{ width: '84px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={parseInt(roof.hajebichi)}
|
||||
readOnly={roof.roofPchAuth === 'R'}
|
||||
/>
|
||||
<span>W</span>
|
||||
<div className="input-grid" style={{ width: '100px' }}>
|
||||
<input type="text" className="input-origin block" defaultValue={roof.width} readOnly={roof.widAuth === 'R'} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="block-box">
|
||||
<div className="icon-btn-wrap">
|
||||
<button
|
||||
className={roof.layout === ROOF_MATERIAL_LAYOUT.PARALLEL ? 'act' : ''}
|
||||
onClick={() => {
|
||||
handleChangeLayout(ROOF_MATERIAL_LAYOUT.PARALLEL, index)
|
||||
}}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.parallel')}
|
||||
<i className="allocation01"></i>
|
||||
</button>
|
||||
<button
|
||||
className={roof.layout === ROOF_MATERIAL_LAYOUT.STAIRS ? 'act' : ''}
|
||||
onClick={() => {
|
||||
handleChangeLayout(ROOF_MATERIAL_LAYOUT.STAIRS, index)
|
||||
}}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
|
||||
</button>
|
||||
)}
|
||||
{roof.lenAuth && (
|
||||
<div className="flex-ment">
|
||||
<span>L</span>
|
||||
<div className="input-grid" style={{ width: '100px' }}>
|
||||
<input type="text" className="input-origin block" defaultValue={roof.length} readOnly={roof.lenAuth === 'R'} />
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
{(roof.raftAuth || roof.roofPchAuth) && (
|
||||
<div className="block-box">
|
||||
{roof.raftAuth && (
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('modal.placement.initial.setting.rafter')}</span>
|
||||
{raftCodes.length > 0 && (
|
||||
<div className="grid-select" style={{ width: '160px' }}>
|
||||
<QSelectBox
|
||||
options={raftCodes}
|
||||
value={roof}
|
||||
showKey={'clCodeNm'}
|
||||
sourceKey={'clCode'}
|
||||
targetKey={roof.raft ? 'raft' : 'raftBaseCd'}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
{roof.roofPchAuth && (
|
||||
<div className="block-box">
|
||||
<div className="flex-ment">
|
||||
<span>{getMessage('hajebichi')}</span>
|
||||
<div className="input-grid" style={{ width: '84px' }}>
|
||||
<input
|
||||
type="text"
|
||||
className="input-origin block"
|
||||
value={parseInt(roof.hajebichi)}
|
||||
readOnly={roof.roofPchAuth === 'R'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
<div className="block-box">
|
||||
<div className="icon-btn-wrap">
|
||||
<button
|
||||
className={roof.layout === ROOF_MATERIAL_LAYOUT.PARALLEL ? 'act' : ''}
|
||||
onClick={() => {
|
||||
handleChangeLayout(ROOF_MATERIAL_LAYOUT.PARALLEL, index)
|
||||
}}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.parallel')}
|
||||
<i className="allocation01"></i>
|
||||
</button>
|
||||
<button
|
||||
className={roof.layout === ROOF_MATERIAL_LAYOUT.STAIRS ? 'act' : ''}
|
||||
onClick={() => {
|
||||
handleChangeLayout(ROOF_MATERIAL_LAYOUT.STAIRS, index)
|
||||
}}
|
||||
>
|
||||
{getMessage('modal.roof.alloc.select.stairs')} <i className="allocation02"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})}
|
||||
)
|
||||
})}
|
||||
</div>
|
||||
<div className="grid-btn-wrap">
|
||||
<button className="btn-frame modal act" onClick={handleSaveContext}>
|
||||
|
||||
@ -219,6 +219,10 @@ export default function Stuff() {
|
||||
pageSize: stuffSearchParams?.pageSize ? stuffSearchParams.pageSize : 100,
|
||||
}
|
||||
|
||||
if (!params.saleStoreId) {
|
||||
params.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
||||
await get({
|
||||
@ -271,6 +275,10 @@ export default function Stuff() {
|
||||
stuffSearchParams.schSortType = defaultSortType
|
||||
stuffSearchParams.pageNo = stuffSearchParams.pageNo
|
||||
|
||||
if (!stuffSearchParams.saleStoreId) {
|
||||
stuffSearchParams.saleStoreId = session.storeId
|
||||
}
|
||||
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
||||
await get({ url: apiUrl }).then((res) => {
|
||||
@ -301,6 +309,9 @@ export default function Stuff() {
|
||||
stuffSearchParams.schSortType = defaultSortType
|
||||
setPageNo(1)
|
||||
|
||||
if (!params.saleStoreId) {
|
||||
stuffSearchParams.saleStoreId = session.storeId
|
||||
}
|
||||
async function fetchData() {
|
||||
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
||||
await get({ url: apiUrl }).then((res) => {
|
||||
|
||||
@ -16,26 +16,18 @@ import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||
|
||||
import { convertNumberToPriceDecimal } from '@/util/common-utils'
|
||||
import { usePlan } from '@/hooks/usePlan'
|
||||
import { usePopup } from '@/hooks/usePopup'
|
||||
// import { useSearchParams } from 'next/navigation'
|
||||
import { usePopup, closeAll } from '@/hooks/usePopup'
|
||||
|
||||
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 { selectedPlan } = usePlan()
|
||||
|
||||
const chartRef = useRef(null)
|
||||
|
||||
// 캔버스 메뉴 넘버 셋팅
|
||||
const { setMenuNumber } = useCanvasMenu()
|
||||
|
||||
useEffect(() => {
|
||||
setMenuNumber(6)
|
||||
}, [])
|
||||
const { closeAll } = usePopup()
|
||||
|
||||
const { get } = useAxios()
|
||||
const { getMessage } = useMessage()
|
||||
@ -43,12 +35,6 @@ export default function Simulator() {
|
||||
// 차트 관련
|
||||
const [chartData, setChartData] = useState([])
|
||||
|
||||
const { closeAll } = usePopup()
|
||||
|
||||
useEffect(() => {
|
||||
closeAll()
|
||||
}, [])
|
||||
|
||||
const data = {
|
||||
labels: ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'],
|
||||
datasets: [
|
||||
@ -114,7 +100,6 @@ export default function Simulator() {
|
||||
}
|
||||
|
||||
useEffect(() => {
|
||||
console.log('🚀 ~ useEffect ~ selectedPlan:', selectedPlan)
|
||||
/* 초기화 작업 */
|
||||
setChartData([])
|
||||
setObjectDetail({})
|
||||
@ -125,11 +110,13 @@ export default function Simulator() {
|
||||
setHatsudenryouPeakcutAll([])
|
||||
setHatsudenryouPeakcutAllSnow([])
|
||||
|
||||
if (objectNo) {
|
||||
fetchObjectDetail(objectNo)
|
||||
if (objectNo && pid && selectedPlan) {
|
||||
fetchObjectDetail(objectNo, selectedPlan.ordering)
|
||||
fetchSimulatorNotice()
|
||||
setPwrGnrSimType('D')
|
||||
setPwrRecoil({ ...pwrRecoil, type: 'D' })
|
||||
setMenuNumber(6)
|
||||
closeAll()
|
||||
}
|
||||
}, [objectNo, pid, selectedPlan])
|
||||
|
||||
@ -148,8 +135,8 @@ export default function Simulator() {
|
||||
const [hatsudenryouPeakcutAll, setHatsudenryouPeakcutAll] = useState([])
|
||||
const [hatsudenryouPeakcutAllSnow, setHatsudenryouPeakcutAllSnow] = useState([])
|
||||
|
||||
const fetchObjectDetail = async (objectNo) => {
|
||||
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${pid}`
|
||||
const fetchObjectDetail = async (objectNo, currentPid) => {
|
||||
const apiUrl = `/api/pwrGnrSimulation/calculations?objectNo=${objectNo}&planNo=${currentPid}`
|
||||
|
||||
const resultData = await get({ url: apiUrl })
|
||||
if (resultData) {
|
||||
@ -234,7 +221,7 @@ export default function Simulator() {
|
||||
</div>
|
||||
{/* 시스템용량 */}
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('simulator.title.sub3')}</div>
|
||||
<div className="estimate-tit">{getMessage('simulator.title.sub3')}</div>
|
||||
<div className="estimate-name">{objectDetail.capacity ? `${convertNumberToPriceDecimal(objectDetail.capacity)} kW` : ''}</div>
|
||||
</div>
|
||||
{/* 연간예측발전량 */}
|
||||
@ -257,7 +244,7 @@ export default function Simulator() {
|
||||
{/* 적설조건 */}
|
||||
<div className="estimate-box">
|
||||
<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 className="estimate-box">
|
||||
@ -356,7 +343,10 @@ export default function Simulator() {
|
||||
{/* 지붕면 */}
|
||||
<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>
|
||||
{/* 태양전지모듈 */}
|
||||
|
||||
@ -22,8 +22,8 @@ export function useRoofFn() {
|
||||
const ratio = window.devicePixelRatio || 1
|
||||
const layout = roofMaterial.layout
|
||||
|
||||
let width = (roofMaterial.width ?? 226) / 10
|
||||
let height = (roofMaterial.length ?? 158) / 10
|
||||
let width = (roofMaterial.width || 226) / 10
|
||||
let height = (roofMaterial.length || 158) / 10
|
||||
const index = roofMaterial.index ?? 0
|
||||
let roofStyle = 2
|
||||
const inputPatternSize = { width: width, height: height } //임시 사이즈
|
||||
|
||||
@ -42,7 +42,7 @@ export function useRoofAllocationSetting(id) {
|
||||
const [currentRoofMaterial, setCurrentRoofMaterial] = useState(roofMaterials[0]) // 팝업 내 기준 지붕재
|
||||
const [roofList, setRoofList] = useRecoilState(addedRoofsState) // 배치면 초기설정에서 선택한 지붕재 배열
|
||||
const [editingLines, setEditingLines] = useState([])
|
||||
const [currentRoofList, setCurrentRoofList] = useState(null)
|
||||
const [currentRoofList, setCurrentRoofList] = useState([])
|
||||
const currentAngleType = useRecoilValue(currentAngleTypeSelector)
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
const [basicInfo, setBasicInfo] = useState(null)
|
||||
|
||||
@ -215,7 +215,6 @@ export function usePlan(params = {}) {
|
||||
const estimateDetail = res.data
|
||||
if (pathname === '/floor-plan/estimate/5') {
|
||||
if (estimateDetail.tempFlg === '0' && estimateDetail.estimateDate !== null) {
|
||||
console.log('이동')
|
||||
res.data.resetFlag = 'N'
|
||||
|
||||
if (res.data.itemList.length > 0) {
|
||||
@ -238,9 +237,12 @@ export function usePlan(params = {}) {
|
||||
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||
}
|
||||
} else {
|
||||
//발전시뮬레이션
|
||||
// 클릭한 플랜 탭으로 이동
|
||||
// updateCurrentPlan(newCurrentId)
|
||||
// 발전시뮬레이션
|
||||
if (estimateDetail.tempFlg === '0') {
|
||||
updateCurrentPlan(newCurrentId)
|
||||
} else {
|
||||
swalFire({ text: getMessage('simulator.menu.move.valid1') })
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user