Merge branch 'dev' into feature/jaeyoung
# Conflicts: # src/hooks/common/useRoofFn.js
This commit is contained in:
commit
32bce54c1e
@ -74,7 +74,7 @@ export default function Estimate({}) {
|
||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
||||
const currentPid = searchParams.get('pid')
|
||||
//견적서 상세데이터
|
||||
const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid)
|
||||
const { estimateContextState, setEstimateContextState, addItem, handleEstimateFileDownload } = useEstimateController(currentPid, false)
|
||||
|
||||
const { selectedPlan } = usePlan()
|
||||
|
||||
@ -465,6 +465,10 @@ export default function Estimate({}) {
|
||||
|
||||
//Pricing 버튼
|
||||
const handlePricing = async (showPriceCd) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
const param = {
|
||||
saleStoreId: session.storeId,
|
||||
sapSalesStoreCd: session.custCd,
|
||||
@ -483,7 +487,7 @@ export default function Estimate({}) {
|
||||
})
|
||||
|
||||
if (!pass) {
|
||||
//Pricing이 누락된 아이템이 있습니다. Pricing을 진행해주세요.
|
||||
//Pricing이 누락된 아이템이 있습니다. 제품 선택 후 Pricing을 진행해주세요.
|
||||
return swalFire({
|
||||
text: getMessage('estimate.detail.showPrice.pricingBtn.noItemId'),
|
||||
type: 'alert',
|
||||
@ -581,7 +585,6 @@ export default function Estimate({}) {
|
||||
//주택PKG input 변경
|
||||
const onChangePkgAsp = (value) => {
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
// let newValue = value.replace(/[^0-9.]/g, '')
|
||||
let newValue = (value || '0').replace(/[^0-9.]/g, '')
|
||||
if (newValue.length > 1) {
|
||||
newValue = newValue.replace(/(^0+)/, '')
|
||||
@ -605,8 +608,6 @@ export default function Estimate({}) {
|
||||
let totVolKw = estimateContextState.totVolKw * 1000
|
||||
let pkgTotPrice = parseFloat(pkgAsp?.replaceAll(',', '')) * totVolKw * 1000
|
||||
|
||||
// pkgAsp = formatNumberWithComma(parseFloat(pkgAsp).toFixed(2))
|
||||
|
||||
setEstimateContextState({
|
||||
pkgAsp: pkgAsp,
|
||||
pkgTotPrice: pkgTotPrice.toFixed(2),
|
||||
@ -687,6 +688,10 @@ export default function Estimate({}) {
|
||||
|
||||
// 아이템 자동완성 검색시 아이템 추가/변경시
|
||||
const onChangeDisplayItem = (itemId, dispOrder, index) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
const param = {
|
||||
itemId: itemId,
|
||||
coldZoneFlg: estimateContextState?.coldRegionFlg,
|
||||
@ -740,8 +745,6 @@ export default function Estimate({}) {
|
||||
return { ...item, ...updates, saleTotPrice: '' }
|
||||
} else {
|
||||
if (estimateContextState.estimateType === 'YJSS') {
|
||||
// return { ...item, ...updates, salePrice: '', saleTotPrice: '' }
|
||||
//확인
|
||||
if (updates.pkgMaterialFlg === '1') {
|
||||
return { ...item, ...updates, showSalePrice: updates.salePrice }
|
||||
} else {
|
||||
@ -1272,7 +1275,7 @@ export default function Estimate({}) {
|
||||
</th>
|
||||
<td colSpan={3}>
|
||||
<div className="radio-wrap">
|
||||
<div className="d-check-radio light mr10">
|
||||
{/* <div className="d-check-radio light mr10">
|
||||
<input
|
||||
type="radio"
|
||||
name="estimateType"
|
||||
@ -1286,7 +1289,7 @@ export default function Estimate({}) {
|
||||
}}
|
||||
/>
|
||||
<label htmlFor="YJSS">{getMessage('estimate.detail.estimateType.yjss')}</label>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="d-check-radio light">
|
||||
<input
|
||||
type="radio"
|
||||
@ -1295,7 +1298,8 @@ export default function Estimate({}) {
|
||||
value={'YJOD'}
|
||||
checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
|
||||
onChange={(e) => {
|
||||
setHandlePricingFlag(true)
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 주석풀기
|
||||
// setHandlePricingFlag(true)
|
||||
setEstimateContextState({ estimateType: e.target.value })
|
||||
}}
|
||||
/>
|
||||
@ -1576,10 +1580,10 @@ export default function Estimate({}) {
|
||||
</div>
|
||||
<div className="esimate-wrap">
|
||||
<div className="estimate-list-wrap one">
|
||||
<div className="estimate-box">
|
||||
{/* <div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totAmount')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.totAmount)}</div>
|
||||
</div>
|
||||
</div> */}
|
||||
<div className="estimate-box">
|
||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totVolKw')}</div>
|
||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.totVolKw, 2)}</div>
|
||||
@ -1599,7 +1603,7 @@ export default function Estimate({}) {
|
||||
</div>
|
||||
</div>
|
||||
{/* YJOD면 아래영역 숨김 */}
|
||||
<div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
|
||||
{/* <div className="common-table bt-able" style={{ display: estimateContextState?.estimateType === 'YJSS' ? '' : 'none' }}>
|
||||
<table>
|
||||
<colgroup>
|
||||
<col style={{ width: '160px' }} />
|
||||
@ -1634,7 +1638,7 @@ export default function Estimate({}) {
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div> */}
|
||||
{/* 제품정보 끝 */}
|
||||
{/* 가격표시영역시작 */}
|
||||
<div className="estimate-product-option">
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
import { useEffect, useState, useContext, useRef } from 'react'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import Select, { components } from 'react-select'
|
||||
import Select from 'react-select'
|
||||
import { SessionContext } from '@/app/SessionProvider'
|
||||
import { isEmptyArray, isObjectNotEmpty } from '@/util/common-utils'
|
||||
import { useEstimateController } from '@/hooks/floorPlan/estimate/useEstimateController'
|
||||
@ -11,7 +11,7 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) {
|
||||
const { getMessage } = useMessage()
|
||||
const { get } = useAxios()
|
||||
|
||||
const { handleEstimateCopy, estimateContextState } = useEstimateController(planNo)
|
||||
const { handleEstimateCopy, estimateContextState } = useEstimateController(planNo, true)
|
||||
|
||||
const { session } = useContext(SessionContext)
|
||||
|
||||
@ -282,7 +282,6 @@ export default function EstimateCopyPop({ planNo, setEstimateCopyPopupOpen }) {
|
||||
type="text"
|
||||
className="input-light"
|
||||
required
|
||||
// defaultValue={estimateContextState?.charger}
|
||||
defaultValue={session?.userNm}
|
||||
onChange={(e) => {
|
||||
setCopyReceiveUser(e.target.value)
|
||||
|
||||
@ -354,6 +354,11 @@ export default function CanvasMenu(props) {
|
||||
|
||||
// 견적서 초기화 버튼
|
||||
const handleEstimateReset = () => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateRecoilState.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
swalFire({
|
||||
text: getMessage('estimate.detail.reset.confirmMsg'),
|
||||
type: 'confirm',
|
||||
@ -584,8 +589,6 @@ export default function CanvasMenu(props) {
|
||||
></button>
|
||||
{/*<button className="btn04" onClick={() => setShowCanvasSettingModal(true)}></button>*/}
|
||||
<button className="btn04" onClick={handlePopup}></button>
|
||||
<button className="btn05"></button>
|
||||
<button className="btn06"></button>
|
||||
</div>
|
||||
<div className="size-control">
|
||||
<button
|
||||
|
||||
@ -178,7 +178,11 @@ export default function CircuitTrestleSetting({ id }) {
|
||||
...params,
|
||||
pcsItemList: getSelectedPcsItemList(),
|
||||
}).then((res) => {
|
||||
setTabNum(2)
|
||||
if (res?.result.resultCode === 'S' && res?.data) {
|
||||
setTabNum(2)
|
||||
} else {
|
||||
swalFire({ text: getMessage('common.message.send.error') })
|
||||
}
|
||||
})
|
||||
} else {
|
||||
swalFire({
|
||||
|
||||
@ -56,9 +56,19 @@ export default function StepUp(props) {
|
||||
// }
|
||||
|
||||
useEffect(() => {
|
||||
console.log(allocationType)
|
||||
|
||||
if (allocationType === 'auto') {
|
||||
// 자동일 때 모듈의 회로 정보 초기화
|
||||
canvas
|
||||
.getObjects()
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE)
|
||||
.forEach((module) => {
|
||||
module.circuit = null
|
||||
module.circuitNumber = null
|
||||
module.pcsItemId = null
|
||||
})
|
||||
|
||||
canvas.renderAll()
|
||||
|
||||
// PCS 자동 승압설정 정보 조회
|
||||
fetchAutoStepUpData()
|
||||
} else {
|
||||
|
||||
@ -234,19 +234,38 @@ export default function PlacementShapeSetting({ id, pos = { x: 50, y: 180 }, set
|
||||
<tr>
|
||||
<th>{getMessage('modal.placement.initial.setting.roof.angle.setting')}</th>
|
||||
<td>
|
||||
<div className="pop-form-radio">
|
||||
<div className="pop-form-radio place">
|
||||
{currentRoof &&
|
||||
roofAngleSetArray.map((item) => (
|
||||
<div className="d-check-radio pop" key={item.id}>
|
||||
<input
|
||||
type="radio"
|
||||
id={item.id}
|
||||
name={item.name}
|
||||
value={item.value}
|
||||
checked={currentRoof?.roofAngleSet === item.value}
|
||||
onChange={(e) => setCurrentRoof({ ...currentRoof, roofAngleSet: e.target.value })}
|
||||
/>
|
||||
<label htmlFor={item.id}>{getMessage(item.message)}</label>
|
||||
roofAngleSetArray.map((item, index) => (
|
||||
<div className="outline-form">
|
||||
<span>
|
||||
<div className="d-check-radio pop" key={item.id}>
|
||||
<input
|
||||
type="radio"
|
||||
id={item.id}
|
||||
name={item.name}
|
||||
value={item.value}
|
||||
checked={currentRoof?.roofAngleSet === item.value}
|
||||
onChange={(e) => setCurrentRoof({ ...currentRoof, roofAngleSet: e.target.value })}
|
||||
/>
|
||||
<label htmlFor={item.id}>{getMessage(item.message)}</label>
|
||||
</div>
|
||||
</span>
|
||||
<div className="input-grid mr5">
|
||||
<input
|
||||
type="number"
|
||||
className="input-origin block"
|
||||
defaultValue={4}
|
||||
readOnly={currentRoof?.roofAngleSet !== item.value}
|
||||
value={index === 0 ? currentRoof?.pitch : currentRoof?.angle}
|
||||
onChange={(e) =>
|
||||
index === 0
|
||||
? setCurrentRoof({ ...currentRoof, pitch: e.target.value })
|
||||
: setCurrentRoof({ ...currentRoof, angle: e.target.value })
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
<span className="thin">{index === 0 ? '寸' : '度'}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
|
||||
@ -344,11 +344,9 @@ export default function StuffDetail() {
|
||||
if (objectNo) {
|
||||
setManagementState({})
|
||||
setEditMode('EDIT')
|
||||
if (objectNo.substring(0, 1) !== 'T') {
|
||||
//벨리데이션 체크용..
|
||||
setIsFormValid(true)
|
||||
}
|
||||
setIsGlobalLoading(true)
|
||||
promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => {
|
||||
setIsGlobalLoading(false)
|
||||
if (res.status === 200) {
|
||||
if (res?.data?.createSaleStoreId === 'T01') {
|
||||
if (session?.storeId !== 'T01') {
|
||||
@ -362,6 +360,10 @@ export default function StuffDetail() {
|
||||
} else if (res.data.surfaceType === 'Ⅱ') {
|
||||
surfaceTypeValue = '2'
|
||||
}
|
||||
//설치높이 0이면 빈값으로로 셋팅
|
||||
if (res.data.installHeight === '0') {
|
||||
res.data.installHeight = ''
|
||||
}
|
||||
setManagementState({ ...res.data, surfaceTypeValue: surfaceTypeValue })
|
||||
} else {
|
||||
setIsGlobalLoading(false)
|
||||
@ -1022,8 +1024,6 @@ export default function StuffDetail() {
|
||||
const _receiveUser = watch('receiveUser')
|
||||
//objectName: '', //물건명
|
||||
const _objectName = watch('objectName')
|
||||
// objectNameOmit: '', //경칭선택
|
||||
const _objectNameOmit = watch('objectNameOmit')
|
||||
// saleStoreId: '', //1차 판매점ID
|
||||
const _saleStoreId = watch('saleStoreId')
|
||||
// 2차 판매점명
|
||||
@ -1051,12 +1051,11 @@ export default function StuffDetail() {
|
||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||
errors.receiveUser = true
|
||||
}
|
||||
|
||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||
errors.objectName = true
|
||||
}
|
||||
if (!formData.objectNameOmit) {
|
||||
errors.objectNameOmit = true
|
||||
}
|
||||
|
||||
if (!formData.saleStoreId) {
|
||||
errors.saleStoreId = true
|
||||
}
|
||||
@ -1102,9 +1101,7 @@ export default function StuffDetail() {
|
||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||
errors.objectName = true
|
||||
}
|
||||
if (!formData.objectNameOmit) {
|
||||
errors.objectNameOmit = true
|
||||
}
|
||||
|
||||
if (!formData.saleStoreId) {
|
||||
errors.saleStoreId = true
|
||||
}
|
||||
@ -1144,7 +1141,6 @@ export default function StuffDetail() {
|
||||
}, [
|
||||
_receiveUser,
|
||||
_objectName,
|
||||
_objectNameOmit,
|
||||
_saleStoreId,
|
||||
_otherSaleStoreId,
|
||||
_zipNo,
|
||||
@ -1165,7 +1161,7 @@ export default function StuffDetail() {
|
||||
const onSearchDesignRequestPopOpen = () => {
|
||||
const saleStoreId = form.watch('saleStoreId')
|
||||
if (saleStoreId === '') {
|
||||
swalFire({ text: getMessage('stuff.planReqPopup.error.message2'), type: 'alert' })
|
||||
swalFire({ text: getMessage('stuff.planReqPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||
} else {
|
||||
setShowDesignRequestButtonValid(true)
|
||||
}
|
||||
@ -1175,7 +1171,7 @@ export default function StuffDetail() {
|
||||
const onSearchWindSpeedPopOpen = () => {
|
||||
const prefName = form.watch('prefName')
|
||||
if (prefName === '') {
|
||||
swalFire({ text: getMessage('stuff.windSelectPopup.error.message1'), type: 'alert' })
|
||||
swalFire({ text: getMessage('stuff.windSelectPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||
} else {
|
||||
setShowWindSpeedButtonValid(true)
|
||||
}
|
||||
@ -1203,54 +1199,10 @@ export default function StuffDetail() {
|
||||
const formData = form.getValues()
|
||||
let errors = {}
|
||||
let fieldNm
|
||||
//담당자
|
||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||
fieldNm = getMessage('stuff.detail.receiveUser')
|
||||
errors = fieldNm
|
||||
}
|
||||
//물건명
|
||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||
fieldNm = getMessage('stuff.detail.objectStatusId')
|
||||
errors = fieldNm
|
||||
}
|
||||
//경칭
|
||||
if (!formData.objectNameOmit) {
|
||||
fieldNm = getMessage('stuff.detail.objectNameOmit')
|
||||
errors = fieldNm
|
||||
}
|
||||
//1차판매점명
|
||||
if (!formData.saleStoreId) {
|
||||
fieldNm = getMessage('stuff.detail.saleStoreId')
|
||||
errors = fieldNm
|
||||
}
|
||||
//우편번호
|
||||
if (!formData.zipNo) {
|
||||
fieldNm = getMessage('stuff.detail.zipNo')
|
||||
errors = fieldNm
|
||||
}
|
||||
//주소
|
||||
if (!formData.address) {
|
||||
fieldNm = getMessage('stuff.detail.address')
|
||||
errors = fieldNm
|
||||
}
|
||||
//도도부현
|
||||
if (!formData.prefId || formData.prefId === '0') {
|
||||
fieldNm = getMessage('stuff.detail.prefId')
|
||||
errors = fieldNm
|
||||
}
|
||||
//발전시뮬레이션지역
|
||||
if (!formData.areaId) {
|
||||
fieldNm = getMessage('stuff.detail.areaId')
|
||||
errors = fieldNm
|
||||
}
|
||||
//기준풍속
|
||||
if (!formData.standardWindSpeedId) {
|
||||
fieldNm = getMessage('stuff.detail.standardWindSpeedId')
|
||||
errors = fieldNm
|
||||
}
|
||||
//수직적설량
|
||||
if (!formData.verticalSnowCover) {
|
||||
fieldNm = getMessage('stuff.detail.verticalSnowCover')
|
||||
|
||||
//설치높이
|
||||
if (!formData.installHeight) {
|
||||
fieldNm = getMessage('stuff.detail.installHeight')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
@ -1259,14 +1211,63 @@ export default function StuffDetail() {
|
||||
fieldNm = getMessage('stuff.detail.surfaceType')
|
||||
errors = fieldNm
|
||||
}
|
||||
//설치높이
|
||||
if (!formData.installHeight) {
|
||||
fieldNm = getMessage('stuff.detail.installHeight')
|
||||
|
||||
//수직적설량
|
||||
if (!formData.verticalSnowCover) {
|
||||
fieldNm = getMessage('stuff.detail.verticalSnowCover')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//기준풍속
|
||||
if (!formData.standardWindSpeedId) {
|
||||
fieldNm = getMessage('stuff.detail.standardWindSpeedId')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//발전시뮬레이션지역
|
||||
if (!formData.areaId) {
|
||||
fieldNm = getMessage('stuff.detail.areaId')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//주소
|
||||
if (!formData.address) {
|
||||
fieldNm = getMessage('stuff.detail.address')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//도도부현
|
||||
if (!formData.prefId || formData.prefId === '0') {
|
||||
fieldNm = getMessage('stuff.detail.prefId')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//우편번호
|
||||
if (!formData.zipNo) {
|
||||
fieldNm = getMessage('stuff.detail.zipNo')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//1차판매점명
|
||||
if (!formData.saleStoreId) {
|
||||
fieldNm = getMessage('stuff.detail.saleStoreId')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//물건명
|
||||
if (!formData.objectName || formData.objectName.trim().length === 0) {
|
||||
fieldNm = getMessage('stuff.detail.objectStatusId')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
//담당자
|
||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||
fieldNm = getMessage('stuff.detail.receiveUser')
|
||||
errors = fieldNm
|
||||
}
|
||||
|
||||
if (Object.keys(errors).length > 0) {
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror3', [errors]), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror3', [errors]), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
const apiUrl = '/api/object/save-object'
|
||||
@ -1306,10 +1307,10 @@ export default function StuffDetail() {
|
||||
let height = params.installHeight
|
||||
|
||||
if (snow === '0') {
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror1'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror1'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
if (height === '0') {
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror2'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.save.valierror2'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
if (managementState) {
|
||||
@ -1363,29 +1364,29 @@ export default function StuffDetail() {
|
||||
delete params_sort.workName
|
||||
|
||||
if (Object.entries(detail_sort).toString() === Object.entries(params_sort).toString()) {
|
||||
return swalFire({ text: getMessage('stuff.detail.noChgData'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.noChgData'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
if (params?.receiveUser !== '') {
|
||||
if (params?.receiveUser.trim().length > 10) {
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
//로그인이 2차점인데 otherSaleStoreId가 없으면 알럿
|
||||
if (session.storeLvl !== '1') {
|
||||
if (params.saleStoreLevel === '1') {
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
if (editMode === 'NEW') {
|
||||
setIsGlobalLoading(true)
|
||||
await promisePost({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
setIsGlobalLoading(true)
|
||||
//상세화면으로 전환
|
||||
setIsGlobalLoading(false)
|
||||
if (res.status === 201) {
|
||||
setIsGlobalLoading(false)
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: res?.data?.objectNo })
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.save'),
|
||||
@ -1397,17 +1398,16 @@ export default function StuffDetail() {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
setIsGlobalLoading(false)
|
||||
console.log('error::::::', error)
|
||||
})
|
||||
} else {
|
||||
// 수정모드일때는 PUT
|
||||
setIsGlobalLoading(true)
|
||||
await promisePut({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
setIsGlobalLoading(true)
|
||||
|
||||
setIsGlobalLoading(false)
|
||||
if (res.status === 201) {
|
||||
setIsGlobalLoading(false)
|
||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.save'),
|
||||
@ -1426,8 +1426,8 @@ export default function StuffDetail() {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
setIsGlobalLoading(false)
|
||||
console.log('error::::::', error)
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -1474,26 +1474,26 @@ export default function StuffDetail() {
|
||||
if (session.storeLvl !== '1') {
|
||||
//로그인이 1차점이 아닌데 2차점을 안골라서 saleStoreLevel = 1로 셋팅되어있으면 알럿
|
||||
if (params.saleStoreLevel === '1') {
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message3'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
// 담당자 자리수 체크
|
||||
if (params?.receiveUser !== '') {
|
||||
if (params?.receiveUser.trim().length > 10) {
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert' })
|
||||
return swalFire({ text: getMessage('stuff.detail.tempSave.message2'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
const apiUrl = '/api/object/save-object'
|
||||
if (objectNo) {
|
||||
setIsGlobalLoading(true)
|
||||
await promisePut({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
setIsGlobalLoading(true)
|
||||
setIsGlobalLoading(false)
|
||||
if (res.status === 201) {
|
||||
setIsGlobalLoading(false)
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.tempSave.message1'),
|
||||
text: getMessage('stuff.detail.tempSave.message0'),
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
@ -1506,13 +1506,13 @@ export default function StuffDetail() {
|
||||
console.log('error::::::', error)
|
||||
})
|
||||
} else {
|
||||
setIsGlobalLoading(true)
|
||||
await promisePost({ url: apiUrl, data: params })
|
||||
.then((res) => {
|
||||
setIsGlobalLoading(true)
|
||||
setIsGlobalLoading(false)
|
||||
if (res.status === 201) {
|
||||
setIsGlobalLoading(false)
|
||||
swalFire({
|
||||
text: getMessage('stuff.detail.tempSave.message1'),
|
||||
text: getMessage('stuff.detail.tempSave.message0'),
|
||||
type: 'alert',
|
||||
confirmFn: () => {
|
||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||
@ -1521,8 +1521,8 @@ export default function StuffDetail() {
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log('error::::::', error)
|
||||
setIsGlobalLoading(false)
|
||||
console.log('error::::::', error)
|
||||
})
|
||||
}
|
||||
}
|
||||
@ -1676,15 +1676,15 @@ export default function StuffDetail() {
|
||||
{getMessage('stuff.detail.required')}
|
||||
</div>
|
||||
<div className="left-unit-box">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
{/* {!isFormValid ? ( */}
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
{/* ) : ( */}
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
{/* )} */}
|
||||
<button
|
||||
type="button"
|
||||
className="btn-origin grey"
|
||||
@ -2184,15 +2184,15 @@ export default function StuffDetail() {
|
||||
</table>
|
||||
</div>
|
||||
<div className="sub-right-footer">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
{/* {!isFormValid ? ( */}
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
{/* ) : ( */}
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
{/* )} */}
|
||||
<button
|
||||
type="button"
|
||||
className="btn-origin grey"
|
||||
@ -2238,15 +2238,15 @@ export default function StuffDetail() {
|
||||
) : (
|
||||
<>
|
||||
<div className="left-unit-box">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
{/* {!isFormValid ? ( */}
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
{/* ) : ( */}
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
{/* )} */}
|
||||
<button
|
||||
type="button"
|
||||
className="btn-origin grey"
|
||||
@ -2833,15 +2833,15 @@ export default function StuffDetail() {
|
||||
) : (
|
||||
<>
|
||||
<div className="sub-right-footer">
|
||||
{!isFormValid ? (
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
) : (
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
)}
|
||||
{/* {!isFormValid ? ( */}
|
||||
<Button className="btn-origin grey mr5" onPress={onTempSave} style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.tempSave')}
|
||||
</Button>
|
||||
{/* ) : ( */}
|
||||
<Button type="submit" className="btn-origin navy mr5" style={{ display: showButton }}>
|
||||
{getMessage('stuff.detail.btn.save')}
|
||||
</Button>
|
||||
{/* )} */}
|
||||
<button
|
||||
type="button"
|
||||
className="btn-origin grey"
|
||||
|
||||
@ -7,6 +7,7 @@ import { useRecoilValue } from 'recoil'
|
||||
import FindAddressPopQGrid from './FindAddressPopQGrid'
|
||||
import { useMessage } from '@/hooks/useMessage'
|
||||
import { isNotEmptyArray } from '@/util/common-utils'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
export default function FindAddressPop(props) {
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
|
||||
@ -19,7 +20,7 @@ export default function FindAddressPop(props) {
|
||||
const [address1, setAddress1] = useState(null)
|
||||
const [address2, setAddress2] = useState(null)
|
||||
const [address3, setAddress3] = useState(null)
|
||||
|
||||
const { swalFire } = useSwal()
|
||||
const [gridProps, setGridProps] = useState({
|
||||
gridData: [],
|
||||
isPageable: false,
|
||||
@ -65,11 +66,11 @@ export default function FindAddressPop(props) {
|
||||
if (isNotEmptyArray(res.results)) {
|
||||
setGridProps({ ...gridProps, gridData: res.results })
|
||||
} else {
|
||||
alert(getMessage('stuff.addressPopup.error.message1'))
|
||||
swalFire({ text: getMessage('stuff.addressPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||
setGridProps({ ...gridProps, gridData: [] })
|
||||
}
|
||||
} else {
|
||||
alert(getMessage('stuff.addressPopup.error.message1'))
|
||||
swalFire({ text: getMessage('stuff.addressPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||
setGridProps({ ...gridProps, gridData: [] })
|
||||
}
|
||||
})
|
||||
@ -77,7 +78,7 @@ export default function FindAddressPop(props) {
|
||||
// 주소적용 클릭
|
||||
const applyAddress = () => {
|
||||
if (prefId == null) {
|
||||
alert(getMessage('stuff.addressPopup.error.message2'))
|
||||
swalFire({ text: getMessage('stuff.addressPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||
} else {
|
||||
props.zipInfo({
|
||||
zipNo: zipNo,
|
||||
@ -128,7 +129,7 @@ export default function FindAddressPop(props) {
|
||||
setZipNo(event.data.zipcode)
|
||||
|
||||
if (event.data.prefcode == null) {
|
||||
return alert(getMessage('stuff.addressPopup.error.message2'))
|
||||
return swalFire({ text: getMessage('stuff.addressPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||
} else {
|
||||
props.zipInfo({
|
||||
zipNo: event.data.zipcode,
|
||||
|
||||
@ -9,11 +9,12 @@ import dayjs from 'dayjs'
|
||||
import PlanRequestPopQGrid from './PlanRequestPopQGrid'
|
||||
import { isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||
import QPagination from '@/components/common/pagination/QPagination'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
export default function PlanRequestPop(props) {
|
||||
const [pageNo, setPageNo] = useState(1) //현재 페이지 번호
|
||||
const [pageSize, setPageSize] = useState(20) //페이지 당 게시물 개수
|
||||
const [totalCount, setTotalCount] = useState(0) //총 갯수
|
||||
|
||||
const { swalFire } = useSwal()
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
|
||||
const [planReqObject, setPlanReqObject] = useState({})
|
||||
@ -214,7 +215,7 @@ export default function PlanRequestPop(props) {
|
||||
// 팝업닫기
|
||||
props.setShowDesignRequestButtonValid(false)
|
||||
} else {
|
||||
alert(getMessage('stuff.planReqPopup.error.message1'))
|
||||
swalFire({ text: getMessage('stuff.planReqPopup.error.message1'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -3,14 +3,16 @@ import { useMessage } from '@/hooks/useMessage'
|
||||
import { useAxios } from '@/hooks/useAxios'
|
||||
import { globalLocaleStore } from '@/store/localeAtom'
|
||||
import { useRecoilValue } from 'recoil'
|
||||
import { isEmptyArray, isNotEmptyArray } from '@/util/common-utils'
|
||||
import { isEmptyArray } from '@/util/common-utils'
|
||||
import { useSwal } from '@/hooks/useSwal'
|
||||
|
||||
export default function WindSelectPop(props) {
|
||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||
const { promiseGet } = useAxios(globalLocaleState)
|
||||
const [windSpeedList, setWindSpeedList] = useState([])
|
||||
const [windSpeed, setWindSpeed] = useState(null)
|
||||
const { getMessage } = useMessage()
|
||||
|
||||
const { swalFire } = useSwal()
|
||||
//선택한 라디오 값 세팅
|
||||
const handleChangeRadio = (e) => {
|
||||
setWindSpeed(e.target.value)
|
||||
@ -19,7 +21,7 @@ export default function WindSelectPop(props) {
|
||||
//적용
|
||||
const applyWindSpeed = () => {
|
||||
if (windSpeed == null) {
|
||||
alert(getMessage('stuff.windSelectPopup.error.message2'))
|
||||
swalFire({ text: getMessage('stuff.windSelectPopup.error.message2'), type: 'alert', icon: 'warning' })
|
||||
} else {
|
||||
props.windSpeedInfo({ windSpeed: windSpeed })
|
||||
|
||||
|
||||
@ -10,10 +10,10 @@ export const useCanvasMenu = () => {
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const { drawDirectionArrow } = usePolygon()
|
||||
|
||||
useEffect(() => {
|
||||
/*
|
||||
/*useEffect(() => {
|
||||
/!*
|
||||
* 모듈,회로 구성을 벗어나면 방향 표시 초기화 필요
|
||||
* */
|
||||
* *!/
|
||||
if (!canvas) return
|
||||
if (![4, 5].includes(menuNumber)) {
|
||||
canvas
|
||||
@ -21,10 +21,10 @@ export const useCanvasMenu = () => {
|
||||
.filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||
.forEach((obj) => {
|
||||
obj.set('moduleCompass', null)
|
||||
drawDirectionArrow(obj)
|
||||
// drawDirectionArrow(obj)
|
||||
})
|
||||
}
|
||||
}, [menuNumber])
|
||||
}, [menuNumber])*/
|
||||
|
||||
return {
|
||||
menuNumber,
|
||||
|
||||
@ -333,9 +333,14 @@ export function useRoofFn() {
|
||||
(obj) => /*obj !== roof && obj !== wall &&*/ obj.attributes?.roofId === roof.id || obj.parentId === roof.id || obj.parentId === wall?.id,
|
||||
)
|
||||
|
||||
const auxilaryObject = canvas.getObjects().filter((obj) => obj.name === 'auxiliaryLine' && !obj.isAuxiliaryFixed)
|
||||
|
||||
allRoofObject.forEach((obj) => {
|
||||
canvas.remove(obj)
|
||||
})
|
||||
auxilaryObject.forEach((obj) => {
|
||||
canvas.remove(obj)
|
||||
})
|
||||
|
||||
canvas.renderAll()
|
||||
resetPoints()
|
||||
|
||||
@ -18,7 +18,7 @@ const updateItemInList = (itemList, dispOrder, updates) => {
|
||||
return itemList.map((item) => (item.dispOrder === dispOrder ? { ...item, ...updates } : item))
|
||||
}
|
||||
|
||||
export const useEstimateController = (planNo) => {
|
||||
export const useEstimateController = (planNo, flag) => {
|
||||
const { swalFire } = useSwal()
|
||||
const [fileList, setFileList] = useState([])
|
||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||
@ -42,7 +42,9 @@ export const useEstimateController = (planNo) => {
|
||||
let recoilObjectNo = objectRecoil.floorPlanObjectNo ? objectRecoil.floorPlanObjectNo : searchParams.get('objectNo')
|
||||
|
||||
if (recoilObjectNo && planNo) {
|
||||
fetchSetting(recoilObjectNo, planNo)
|
||||
if (!flag) {
|
||||
fetchSetting(recoilObjectNo, planNo)
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [])
|
||||
@ -160,6 +162,11 @@ export const useEstimateController = (planNo) => {
|
||||
|
||||
//견적서 저장
|
||||
const handleEstimateSubmit = async () => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateData.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
|
||||
//0. 필수체크
|
||||
let flag = true
|
||||
let originFileFlg = false
|
||||
@ -409,6 +416,10 @@ export const useEstimateController = (planNo) => {
|
||||
* T01관리자 계정 및 1차판매점에게만 제공
|
||||
*/
|
||||
const handleEstimateCopy = async (sendPlanNo, copyReceiveUser, saleStoreId, otherSaleStoreId) => {
|
||||
//todo: 추후 YJSS가 다시 나타날 경우 아래 swalFire 제거 필요
|
||||
if (estimateData.estimateType === 'YJSS') {
|
||||
return swalFire({ text: getMessage('estimate.detail.save.requiredEstimateType'), type: 'alert', icon: 'warning' })
|
||||
}
|
||||
if (saleStoreId === '') {
|
||||
return swalFire({
|
||||
text: getMessage('estimate.detail.productFeaturesPopup.requiredStoreId'),
|
||||
|
||||
@ -495,7 +495,7 @@ export function useModuleBasicSetting(tabNum) {
|
||||
/**
|
||||
* 스냅기능
|
||||
*/
|
||||
let snapDistance = 10
|
||||
let snapDistance = 80
|
||||
let cellSnapDistance = 20
|
||||
|
||||
let intvHor =
|
||||
@ -579,54 +579,54 @@ export function useModuleBasicSetting(tabNum) {
|
||||
})
|
||||
}
|
||||
|
||||
// 위쪽 변에 스냅
|
||||
if (Math.abs(smallTop - trestleTop) < snapDistance) {
|
||||
tempModule.top = trestleTop
|
||||
}
|
||||
// // 위쪽 변에 스냅
|
||||
// if (Math.abs(smallTop - trestleTop) < snapDistance) {
|
||||
// tempModule.top = trestleTop
|
||||
// }
|
||||
|
||||
// 아래쪽 변에 스냅
|
||||
if (Math.abs(smallTop + tempModule.height * tempModule.scaleY - (trestleTop + moduleSetupSurfaces[i].height)) < snapDistance) {
|
||||
tempModule.top = trestleTop + moduleSetupSurfaces[i].height - tempModule.height * tempModule.scaleY
|
||||
}
|
||||
// // 아래쪽 변에 스냅
|
||||
// if (Math.abs(smallTop + tempModule.height * tempModule.scaleY - (trestleTop + moduleSetupSurfaces[i].height)) < snapDistance) {
|
||||
// tempModule.top = trestleTop + moduleSetupSurfaces[i].height - tempModule.height * tempModule.scaleY
|
||||
// }
|
||||
|
||||
// 왼쪽변에 스냅
|
||||
if (Math.abs(smallLeft - trestleLeft) < snapDistance) {
|
||||
tempModule.left = trestleLeft
|
||||
}
|
||||
//오른쪽 변에 스냅
|
||||
if (Math.abs(smallRight - trestleRight) < snapDistance) {
|
||||
tempModule.left = trestleRight - tempModule.width * tempModule.scaleX
|
||||
}
|
||||
// // 왼쪽변에 스냅
|
||||
// if (Math.abs(smallLeft - trestleLeft) < snapDistance) {
|
||||
// tempModule.left = trestleLeft
|
||||
// }
|
||||
// //오른쪽 변에 스냅
|
||||
// if (Math.abs(smallRight - trestleRight) < snapDistance) {
|
||||
// tempModule.left = trestleRight - tempModule.width * tempModule.scaleX
|
||||
// }
|
||||
|
||||
if (flowDirection === 'south' || flowDirection === 'north') {
|
||||
// 모듈왼쪽이 세로중앙선에 붙게 스냅
|
||||
if (Math.abs(smallLeft - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2
|
||||
}
|
||||
// if (flowDirection === 'south' || flowDirection === 'north') {
|
||||
// // 모듈왼쪽이 세로중앙선에 붙게 스냅
|
||||
// if (Math.abs(smallLeft - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
// tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2
|
||||
// }
|
||||
|
||||
// 모듈이 가운데가 세로중앙선에 붙게 스냅
|
||||
if (Math.abs(smallCenterX - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - (tempModule.width * tempModule.scaleX) / 2
|
||||
}
|
||||
// // 모듈이 가운데가 세로중앙선에 붙게 스냅
|
||||
// if (Math.abs(smallCenterX - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
// tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - (tempModule.width * tempModule.scaleX) / 2
|
||||
// }
|
||||
|
||||
// 모듈오른쪽이 세로중앙선에 붙게 스냅
|
||||
if (Math.abs(smallRight - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - tempModule.width * tempModule.scaleX
|
||||
}
|
||||
} else {
|
||||
// 모듈이 가로중앙선에 스냅
|
||||
if (Math.abs(smallTop + tempModule.height / 2 - bigCenterY) < snapDistance) {
|
||||
tempModule.top = bigCenterY - tempModule.height / 2
|
||||
}
|
||||
// // 모듈오른쪽이 세로중앙선에 붙게 스냅
|
||||
// if (Math.abs(smallRight - (trestleLeft + moduleSetupSurfaces[i].width / 2)) < snapDistance) {
|
||||
// tempModule.left = trestleLeft + moduleSetupSurfaces[i].width / 2 - tempModule.width * tempModule.scaleX
|
||||
// }
|
||||
// } else {
|
||||
// // 모듈이 가로중앙선에 스냅
|
||||
// if (Math.abs(smallTop + tempModule.height / 2 - bigCenterY) < snapDistance) {
|
||||
// tempModule.top = bigCenterY - tempModule.height / 2
|
||||
// }
|
||||
|
||||
if (Math.abs(smallTop - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
|
||||
tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2
|
||||
}
|
||||
// 모듈 밑면이 가로중앙선에 스냅
|
||||
if (Math.abs(smallBottom - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
|
||||
tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2 - tempModule.height * tempModule.scaleY
|
||||
}
|
||||
}
|
||||
// if (Math.abs(smallTop - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
|
||||
// tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2
|
||||
// }
|
||||
// // 모듈 밑면이 가로중앙선에 스냅
|
||||
// if (Math.abs(smallBottom - (trestleTop + moduleSetupSurfaces[i].height / 2)) < snapDistance) {
|
||||
// tempModule.top = trestleTop + moduleSetupSurfaces[i].height / 2 - tempModule.height * tempModule.scaleY
|
||||
// }
|
||||
// }
|
||||
|
||||
tempModule.setCoords()
|
||||
canvas?.renderAll()
|
||||
@ -677,9 +677,6 @@ export function useModuleBasicSetting(tabNum) {
|
||||
if (!isIntersection) return
|
||||
|
||||
tempModule.setCoords() //좌표 재정렬
|
||||
|
||||
console.log('turf.booleanContains(turfPolygon, tempTurfModule)', turf.booleanContains(turfPolygon, tempTurfModule))
|
||||
console.log('turf.booleanWithin(tempTurfModule, turfPolygon)', turf.booleanWithin(tempTurfModule, turfPolygon))
|
||||
if (turf.booleanContains(turfPolygon, tempTurfModule) || turf.booleanWithin(tempTurfModule, turfPolygon)) {
|
||||
//마우스 클릭시 set으로 해당 위치에 셀을 넣음
|
||||
const isOverlap = manualDrawModules.some((module) => turf.booleanOverlap(tempTurfModule, polygonToTurfPolygon(module))) //겹치는지 확인
|
||||
@ -867,6 +864,8 @@ export function useModuleBasicSetting(tabNum) {
|
||||
let startPoint = flowLines.bottom
|
||||
const moduleArray = []
|
||||
|
||||
console.log('flowLines', flowLines)
|
||||
|
||||
if (isCenter) {
|
||||
//중앙배치일 경우에는 계산한다
|
||||
if (flowLines.bottom.type === 'flat' && flowLines.left.type === 'flat' && flowLines.right.type === 'flat') {
|
||||
@ -1517,16 +1516,16 @@ export function useModuleBasicSetting(tabNum) {
|
||||
const pointX2 = coords[2].x + ((coords[2].y - top) / (coords[2].y - coords[1].y)) * (coords[1].x - coords[2].x)
|
||||
const pointY2 = top
|
||||
|
||||
// const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||
// stroke: 'red',
|
||||
// strokeWidth: 1,
|
||||
// selectable: true,
|
||||
// })
|
||||
const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||
stroke: 'red',
|
||||
strokeWidth: 1,
|
||||
selectable: true,
|
||||
})
|
||||
|
||||
// console.log(`index ${index} : finalLine`, pointX1, pointY1, pointX2, pointY2)
|
||||
|
||||
// canvas?.add(finalLine)
|
||||
// canvas?.renderAll()
|
||||
canvas?.add(finalLine)
|
||||
canvas?.renderAll()
|
||||
|
||||
let rtnObj
|
||||
//평평하면
|
||||
@ -1643,13 +1642,13 @@ export function useModuleBasicSetting(tabNum) {
|
||||
const pointX2 = top
|
||||
const pointY2 = coords[2].y + ((coords[2].x - top) / (coords[2].x - coords[1].x)) * (coords[1].y - coords[2].y)
|
||||
|
||||
// const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||
// stroke: 'red',
|
||||
// strokeWidth: 1,
|
||||
// selectable: true,
|
||||
// })
|
||||
// canvas?.add(finalLine)
|
||||
// canvas?.renderAll()
|
||||
const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||
stroke: 'red',
|
||||
strokeWidth: 1,
|
||||
selectable: true,
|
||||
})
|
||||
canvas?.add(finalLine)
|
||||
canvas?.renderAll()
|
||||
|
||||
let rtnObj
|
||||
//평평하면
|
||||
|
||||
@ -89,6 +89,10 @@ export function usePlacementShapeDrawing(id) {
|
||||
clear()
|
||||
}, [verticalHorizontalMode, points, adsorptionPointAddMode, adsorptionPointMode, adsorptionRange, interval, tempGridMode])
|
||||
|
||||
useEffect(() => {
|
||||
setPoints([])
|
||||
}, [])
|
||||
|
||||
useEffect(() => {
|
||||
arrow1Ref.current = arrow1
|
||||
}, [arrow1])
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import { useEffect } from 'react'
|
||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||
import { useRecoilState, useRecoilValue, useResetRecoilState } from 'recoil'
|
||||
import { canvasState, globalPitchState } from '@/store/canvasAtom'
|
||||
import { MENU, POLYGON_TYPE } from '@/common/common'
|
||||
import { getIntersectionPoint } from '@/util/canvas-util'
|
||||
@ -18,12 +18,14 @@ import { slopeSelector } from '@/store/commonAtom'
|
||||
import { QLine } from '@/components/fabric/QLine'
|
||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||
import { outerLinePointsState } from '@/store/outerLineAtom'
|
||||
import { placementShapeDrawingPointsState } from '@/store/placementShapeDrawingAtom'
|
||||
|
||||
export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
const { getMessage } = useMessage()
|
||||
const { drawDirectionArrow } = usePolygon()
|
||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||
const [points, setPoints] = useRecoilState(outerLinePointsState)
|
||||
const resetOuterLinePoints = useResetRecoilState(outerLinePointsState)
|
||||
const resetPlacementShapeDrawingPoints = useResetRecoilState(placementShapeDrawingPointsState)
|
||||
|
||||
const canvas = useRecoilValue(canvasState)
|
||||
const globalPitch = useRecoilValue(globalPitchState)
|
||||
@ -692,7 +694,8 @@ export function useSurfaceShapeBatch({ isHidden, setIsHidden }) {
|
||||
type: 'confirm',
|
||||
confirmFn: () => {
|
||||
canvas.clear()
|
||||
setPoints([])
|
||||
resetOuterLinePoints()
|
||||
resetPlacementShapeDrawingPoints()
|
||||
swalFire({ text: getMessage('plan.message.delete') })
|
||||
},
|
||||
// denyFn: () => {
|
||||
|
||||
@ -15,6 +15,7 @@ import { useContext } from 'react'
|
||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||
import { useMessage } from './useMessage'
|
||||
import { useCanvasPopupStatusController } from './common/useCanvasPopupStatusController'
|
||||
import Big from 'big.js'
|
||||
|
||||
export function useCircuitTrestle() {
|
||||
const [makers, setMakers] = useRecoilState(makersState)
|
||||
@ -207,7 +208,7 @@ export function useCircuitTrestle() {
|
||||
surface.modules.forEach((module) => {
|
||||
if (!surfaceObjects[surface.id][module.moduleInfo.itemId]) {
|
||||
// 지붕면에 모듈 존재 여부
|
||||
surfaceObjects[surface.id][module.moduleInfo.itemId] = 0 // 모듈 초기화
|
||||
surfaceObjects[surface.id][module.moduleInfo.itemId] = new Big(0) // 모듈 초기화
|
||||
}
|
||||
|
||||
surfaceObjects[surface.id][module.moduleInfo.itemId]++
|
||||
@ -224,10 +225,18 @@ export function useCircuitTrestle() {
|
||||
if (!surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]) {
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId] = 0
|
||||
}
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId]++
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits.wpOut += +module.moduleInfo.wpOut
|
||||
surfaceObjects[surface.id].wpOut -= +module.moduleInfo.wpOut
|
||||
surfaceObjects[surface.id][module.moduleInfo.itemId]--
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId] = Big(
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits[module.moduleInfo.itemId],
|
||||
)
|
||||
.plus(1)
|
||||
.toNumber()
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits.wpOut = Big(
|
||||
surfaceObjects[surface.id].circuits[module.circuitNumber].circuits.wpOut,
|
||||
)
|
||||
.plus(+module.moduleInfo.wpOut)
|
||||
.toNumber()
|
||||
surfaceObjects[surface.id].wpOut = Big(surfaceObjects[surface.id].wpOut).minus(+module.moduleInfo.wpOut).toNumber()
|
||||
surfaceObjects[surface.id][module.moduleInfo.itemId] = Big(surfaceObjects[surface.id][module.moduleInfo.itemId]).minus(1).toNumber()
|
||||
}
|
||||
})
|
||||
})
|
||||
@ -236,7 +245,7 @@ export function useCircuitTrestle() {
|
||||
let tempRow = {
|
||||
name: surfaceObjects[key].roofSurface,
|
||||
circuit: surfaceObjects[key].circuit,
|
||||
wpOut: parseFloat(surfaceObjects[key].wpOut / 1000),
|
||||
wpOut: parseFloat(Big(surfaceObjects[key].wpOut).div(1000).toNumber()),
|
||||
}
|
||||
selectedModules.itemList.forEach((module) => {
|
||||
tempRow[module.itemId] = surfaceObjects[key][module.itemId]
|
||||
@ -247,7 +256,7 @@ export function useCircuitTrestle() {
|
||||
let row = {
|
||||
name: surfaceObjects[key].roofSurface,
|
||||
circuit: surfaceObjects[key].circuits[circuit].circuit,
|
||||
wpOut: parseFloat(surfaceObjects[key].circuits[circuit].circuits.wpOut / 1000),
|
||||
wpOut: parseFloat(Big(surfaceObjects[key].circuits[circuit].circuits.wpOut).div(1000).toNumber()),
|
||||
}
|
||||
selectedModules.itemList.forEach((module) => {
|
||||
row[module.itemId] = surfaceObjects[key].circuits[circuit].circuits[module.itemId]
|
||||
@ -255,14 +264,24 @@ export function useCircuitTrestle() {
|
||||
tempRows.push(row)
|
||||
})
|
||||
})
|
||||
let ftWpOut = 0
|
||||
tempRows.forEach((row) => {
|
||||
ftWpOut = Big(ftWpOut).plus(+row.wpOut).toNumber()
|
||||
})
|
||||
|
||||
const tempFooter = {
|
||||
name: getMessage('modal.panel.batch.statistic.total'),
|
||||
circuit: '-',
|
||||
wpOut: tempRows.reduce((acc, row) => acc + row.wpOut, 0),
|
||||
wpOut: ftWpOut,
|
||||
}
|
||||
selectedModules.itemList.forEach((module) => {
|
||||
tempFooter[module.itemId] = tempRows.reduce((acc, row) => acc + (row[module.itemId] ? row[module.itemId] : 0), 0)
|
||||
let wpOut = 0
|
||||
tempRows.forEach((row) => {
|
||||
wpOut = Big(wpOut)
|
||||
.plus(+row[module.itemId] ?? 0)
|
||||
.toNumber()
|
||||
})
|
||||
tempFooter[module.itemId] = wpOut
|
||||
})
|
||||
canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||
setModuleStatistics({ header: tempHeader, rows: tempRows.filter((row) => row.wpOut !== 0), footer: tempFooter })
|
||||
|
||||
@ -695,7 +695,8 @@
|
||||
"stuff.detail.remarks": "メモ",
|
||||
"stuff.detail.tooltip.saleStoreId": "販売代理店または販売代理店IDを1文字以上入力してください",
|
||||
"stuff.detail.tooltip.surfaceType": "塩害地域の定義は各メーカーの設置マニュアルをご確認ください",
|
||||
"stuff.detail.tempSave.message1": "一時保存されました。物件番号を取得するには、必須項目をすべて入力してください。",
|
||||
"stuff.detail.tempSave.message0": "一時保存されました. 商品番号を取得するには、保存ボタンを押してください.",
|
||||
"stuff.detail.tempSave.message1": "一時保存されました. 物件番号を取得するには、必須項目をすべて入力してください.",
|
||||
"stuff.detail.tempSave.message2": "担当者名は10桁以下で入力してください。",
|
||||
"stuff.detail.tempSave.message3": "二次販売店を選択してください。",
|
||||
"stuff.detail.confirm.message1": "販売店情報を変更すると、設計依頼文書番号が削除されます。変更しますか?",
|
||||
@ -951,20 +952,21 @@
|
||||
"estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です。",
|
||||
"estimate.detail.productFeaturesPopup.requiredReceiveUser": "担当者は必須です。",
|
||||
"estimate.detail.save.alertMsg": "保存されました。見積書で製品を変更すると、図面や回路には反映されません。",
|
||||
"estimate.detail.copy.alertMsg": "コピーされました。",
|
||||
"estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください。",
|
||||
"estimate.detail.copy.alertMsg": "コピーされました.",
|
||||
"estimate.detail.save.requiredFileUpload": "ファイル添付が必須のアイテムがあります。ファイルを添付するか、後日添付をチェックしてください.",
|
||||
"estimate.detail.save.requiredNorthArrangementFileUpload": "北面にモジュールを配置した場合、北面配置許可書を必ず添付する必要があります.",
|
||||
"estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります。",
|
||||
"estimate.detail.save.requiredCharger": "担当者は必須です。",
|
||||
"estimate.detail.save.requiredObjectName": "案件名は必須です。",
|
||||
"estimate.detail.save.requiredPkgAsp": "住宅pkg単価は0より大きい値を入力してください。",
|
||||
"estimate.detail.save.requiredEstimateDate": "見積日は必須です。",
|
||||
"estimate.detail.save.requiredItemId": "製品を選択してください。",
|
||||
"estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください。",
|
||||
"estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください。",
|
||||
"estimate.detail.reset.alertMsg": "初期化されました。",
|
||||
"estimate.detail.save.requiredItem": "製品は1つ以上登録する必要があります.",
|
||||
"estimate.detail.save.requiredCharger": "担当者は必須です.",
|
||||
"estimate.detail.save.requiredObjectName": "案件名は必須です.",
|
||||
"estimate.detail.save.requiredPkgAsp": "住宅pkg単価は0より大きい値を入力してください.",
|
||||
"estimate.detail.save.requiredEstimateDate": "見積日は必須です.",
|
||||
"estimate.detail.save.requiredItemId": "製品を選択してください.",
|
||||
"estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください.",
|
||||
"estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください.",
|
||||
"estimate.detail.save.requiredEstimateType": "注文分類を選択してください.",
|
||||
"estimate.detail.reset.alertMsg": "初期化されました.",
|
||||
"estimate.detail.reset.confirmMsg": "保存した見積情報が初期化され、最近保存された図面情報が反映されます。本当に初期化しますか?",
|
||||
"estimate.detail.lock.alertMsg": "見積もりを[ロック]すると変更できません。 <br />見積もりを修正するには、ロックを解除してください。",
|
||||
"estimate.detail.lock.alertMsg": "見積もりを[ロック]すると変更できません。 <br />見積もりを修正するには、ロックを解除してください.",
|
||||
"estimate.detail.unlock.alertMsg": "[ロック解除]すると、見積書を編集できます。 <br />解除しますか?",
|
||||
"estimate.detail.unlock.confirmBtnName": "解放",
|
||||
"estimate.detail.alert.delFile": "添付ファイルを完全に削除するには、[保存]ボタンをクリックしてください。",
|
||||
@ -1016,5 +1018,6 @@
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.(JA)",
|
||||
"roof.is.not.selected": "지붕을 선택해주세요.(JA)",
|
||||
"module.delete.confirm": "パネルを削除して面入力に戻ります。正しいですか?\nはい]を選択すると削除し、面入力に戻ります。\nいいえ」を選択すると、削除せずに現在の状態を維持します。",
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요.(JA)"
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요.(JA)",
|
||||
"canvas.infomation.text": "数字は [半角] 入力のみ可能です。"
|
||||
}
|
||||
|
||||
@ -647,7 +647,7 @@
|
||||
"stuff.gridData.tempObjectNo": "임시저장물건",
|
||||
"stuff.message.periodError": "최대1년 조회 가능합니다.",
|
||||
"stuff.addressPopup.title": "우편번호",
|
||||
"stuff.addressPopup.placeholder": "우편번호의 7자리를 입력하세요.",
|
||||
"stuff.addressPopup.placeholder": "우편번호 7자리를 입력하세요.",
|
||||
"stuff.addressPopup.error.message1": "등록된 우편번호에서 주소를 찾을 수 없습니다. 다시 입력해주세요.",
|
||||
"stuff.addressPopup.error.message2": "주소를 선택해주세요.",
|
||||
"stuff.addressPopup.gridHeader.address1": "도도부현",
|
||||
@ -695,6 +695,7 @@
|
||||
"stuff.detail.remarks": "메모",
|
||||
"stuff.detail.tooltip.saleStoreId": "판매대리점 또는 판매대리점ID를 1자 이상 입력하세요",
|
||||
"stuff.detail.tooltip.surfaceType": "염해지역 정의는 각 메이커의 설치 매뉴얼을 확인해주십시오",
|
||||
"stuff.detail.tempSave.message0": "임시저장 되었습니다. 물건번호를 획득하려면 저장버튼을 눌러주십시오.",
|
||||
"stuff.detail.tempSave.message1": "임시저장 되었습니다. 물건번호를 획득하려면 필수 항목을 모두 입력해 주십시오.",
|
||||
"stuff.detail.tempSave.message2": "담당자이름은 10자리 이하로 입력해 주십시오.",
|
||||
"stuff.detail.tempSave.message3": "2차 판매점을 선택해주세요.",
|
||||
@ -963,6 +964,7 @@
|
||||
"estimate.detail.save.requiredItemId": "제품을 선택해주세요.",
|
||||
"estimate.detail.save.requiredAmount": "수량은 0보다 큰값을 입력해주세요.",
|
||||
"estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.",
|
||||
"estimate.detail.save.requiredEstimateType": "주문분류를 선택해주세요.",
|
||||
"estimate.detail.reset.alertMsg": "초기화 되었습니다.",
|
||||
"estimate.detail.reset.confirmMsg": "수기 변경(저장)한 견적 정보가 초기화되고 최근 저장된 도면정보가 반영됩니다. 정말로 초기화하시겠습니까?",
|
||||
"estimate.detail.lock.alertMsg": "견적서를 [잠금]하면 수정할 수 없습니다. <br />견적서를 수정하려면 잠금해제를 하십시오.",
|
||||
@ -1017,5 +1019,6 @@
|
||||
"module.delete.confirm": "패널을 삭제하고 면입력으로 돌아갑니다. 맞습니까?\n[예]를 선택하면 삭제하고, 면 입력으로 돌아갑니다.\n[아니오]를 선택하면 삭제하지 않고 현재 상태를 유지합니다.",
|
||||
"not.allocation.exist.module": "할당하지 않은 모듈이 있습니다.",
|
||||
"roof.is.not.selected": "지붕을 선택해주세요.",
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요."
|
||||
"length.direction.is.required": "길이와 방향을 입력하세요.",
|
||||
"canvas.infomation.text": "숫자는 [반각]입력만 가능합니다."
|
||||
}
|
||||
|
||||
@ -523,6 +523,17 @@ $alert-color: #101010;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
&.place{
|
||||
gap: 15px;
|
||||
.outline-form{
|
||||
span{
|
||||
width: fit-content;
|
||||
}
|
||||
.input-grid{
|
||||
width: 80px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.placement-option{
|
||||
display: flex;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user