Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
c5aefaa457
@ -42,9 +42,19 @@ export const FloorPlanContext = createContext({
|
|||||||
})
|
})
|
||||||
|
|
||||||
const FloorPlanProvider = ({ children }) => {
|
const FloorPlanProvider = ({ children }) => {
|
||||||
|
const pathname = usePathname()
|
||||||
|
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
|
||||||
const searchParams = useSearchParams()
|
const searchParams = useSearchParams()
|
||||||
const objectNo = searchParams.get('objectNo')
|
const objectNo = searchParams.get('objectNo')
|
||||||
const pid = searchParams.get('pid')
|
const pid = searchParams.get('pid')
|
||||||
|
useEffect(() => {
|
||||||
|
if (pathname === '/floor-plan') {
|
||||||
|
if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) {
|
||||||
|
notFound()
|
||||||
|
}
|
||||||
|
setCurrentObjectNo(objectNo)
|
||||||
|
}
|
||||||
|
}, [pathname])
|
||||||
|
|
||||||
//useEffect(() => { // 오류 발생으로 useEffect 사용
|
//useEffect(() => { // 오류 발생으로 useEffect 사용
|
||||||
// if (pathname === '/floor-plan') {
|
// if (pathname === '/floor-plan') {
|
||||||
|
|||||||
@ -113,6 +113,7 @@ export const POLYGON_TYPE = {
|
|||||||
TRESTLE: 'trestle',
|
TRESTLE: 'trestle',
|
||||||
MODULE_SETUP_SURFACE: 'moduleSetupSurface',
|
MODULE_SETUP_SURFACE: 'moduleSetupSurface',
|
||||||
MODULE: 'module',
|
MODULE: 'module',
|
||||||
|
OBJECT_SURFACE: 'objectOffset',
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SAVE_KEY = [
|
export const SAVE_KEY = [
|
||||||
|
|||||||
@ -31,7 +31,7 @@ export default function CanvasFrame() {
|
|||||||
const loadCanvas = () => {
|
const loadCanvas = () => {
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
canvas?.clear() // 캔버스를 초기화합니다.
|
canvas?.clear() // 캔버스를 초기화합니다.
|
||||||
if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo && floorPlanState.pid === selectedPlan.planNo) {
|
if (selectedPlan?.canvasStatus && floorPlanState.objectNo === selectedPlan.objectNo) {
|
||||||
canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () {
|
canvas?.loadFromJSON(JSON.parse(selectedPlan.canvasStatus), function () {
|
||||||
canvasLoadInit() //config된 상태로 캔버스 객체를 그린다
|
canvasLoadInit() //config된 상태로 캔버스 객체를 그린다
|
||||||
canvas?.renderAll() // 캔버스를 다시 그립니다.
|
canvas?.renderAll() // 캔버스를 다시 그립니다.
|
||||||
|
|||||||
@ -254,10 +254,7 @@ export default function CanvasMenu(props) {
|
|||||||
cancelButtonText: getMessage('plan.message.confirm.no'),
|
cancelButtonText: getMessage('plan.message.confirm.no'),
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
await handleSaveCanvas()
|
await handleSaveCanvas()
|
||||||
router.push(`/management/stuff/detail?objectNo=${objectNo}`)
|
router.push(`/management/stuff`)
|
||||||
},
|
|
||||||
denyFn: () => {
|
|
||||||
router.push(`/management/stuff/detail?objectNo=${objectNo}`)
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,17 +11,19 @@ import { useSetRecoilState } from 'recoil'
|
|||||||
import { correntObjectNoState } from '@/store/settingAtom'
|
import { correntObjectNoState } from '@/store/settingAtom'
|
||||||
|
|
||||||
export default function FloorPlan({ children }) {
|
export default function FloorPlan({ children }) {
|
||||||
const pathname = usePathname()
|
// const pathname = usePathname()
|
||||||
const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
|
// const setCurrentObjectNo = useSetRecoilState(correntObjectNoState)
|
||||||
const searchParams = useSearchParams()
|
// const searchParams = useSearchParams()
|
||||||
const objectNo = searchParams.get('objectNo')
|
// const objectNo = searchParams.get('objectNo')
|
||||||
const pid = searchParams.get('pid')
|
// const pid = searchParams.get('pid')
|
||||||
if (pathname === '/floor-plan') {
|
// useEffect(() => {
|
||||||
if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) {
|
// if (pathname === '/floor-plan') {
|
||||||
notFound()
|
// if (pid === undefined || pid === '' || pid === null || objectNo === undefined || objectNo === '' || objectNo === null) {
|
||||||
}
|
// notFound()
|
||||||
setCurrentObjectNo(objectNo)
|
// }
|
||||||
}
|
// setCurrentObjectNo(objectNo)
|
||||||
|
// }
|
||||||
|
// }, [pathname])
|
||||||
|
|
||||||
const { closeAll } = usePopup()
|
const { closeAll } = usePopup()
|
||||||
const { menuNumber, setMenuNumber } = useCanvasMenu()
|
const { menuNumber, setMenuNumber } = useCanvasMenu()
|
||||||
|
|||||||
@ -11,6 +11,10 @@ import { usePopup } from '@/hooks/usePopup'
|
|||||||
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
import { Orientation } from '@/components/floor-plan/modal/basic/step/Orientation'
|
||||||
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
import { useModuleBasicSetting } from '@/hooks/module/useModuleBasicSetting'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
|
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||||
|
import { addedRoofsState } from '@/store/settingAtom'
|
||||||
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
|
import Swal from 'sweetalert2'
|
||||||
|
|
||||||
export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -20,13 +24,32 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
const orientationRef = useRef(null)
|
const orientationRef = useRef(null)
|
||||||
const { initEvent } = useEvent()
|
const { initEvent } = useEvent()
|
||||||
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
const [isManualModuleSetup, setIsManualModuleSetup] = useRecoilState(isManualModuleSetupState)
|
||||||
|
const moduleSelectionData = useRecoilValue(moduleSelectionDataState)
|
||||||
|
const addedRoofs = useRecoilValue(addedRoofsState)
|
||||||
|
|
||||||
// const { initEvent } = useContext(EventContext)
|
// const { initEvent } = useContext(EventContext)
|
||||||
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting()
|
const { manualModuleSetup, autoModuleSetup, manualFlatroofModuleSetup, autoFlatroofModuleSetup } = useModuleBasicSetting()
|
||||||
const handleBtnNextStep = () => {
|
const handleBtnNextStep = () => {
|
||||||
if (tabNum === 1) {
|
if (tabNum === 1) {
|
||||||
orientationRef.current.handleNextStep()
|
orientationRef.current.handleNextStep()
|
||||||
|
} else if (tabNum === 2) {
|
||||||
|
if (!isObjectNotEmpty(moduleSelectionData.module)) {
|
||||||
|
Swal.fire({
|
||||||
|
title: getMessage('module.not.found'),
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (addedRoofs.length !== moduleSelectionData.roofConstructions.length) {
|
||||||
|
Swal.fire({
|
||||||
|
title: getMessage('construction.length.difference'),
|
||||||
|
icon: 'warning',
|
||||||
|
})
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
setTabNum(tabNum + 1)
|
setTabNum(tabNum + 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -8,12 +8,12 @@ import { useModuleSelection } from '@/hooks/module/useModuleSelection'
|
|||||||
import ModuleTabContents from './ModuleTabContents'
|
import ModuleTabContents from './ModuleTabContents'
|
||||||
import { useDebounceValue } from 'usehooks-ts'
|
import { useDebounceValue } from 'usehooks-ts'
|
||||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||||
|
import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupStatusController'
|
||||||
|
|
||||||
export default function Module({ setTabNum }) {
|
export default function Module({ setTabNum }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const addedRoofs = useRecoilValue(addedRoofsState) //지붕재 선택
|
const [addedRoofs, setAddedRoofs] = useRecoilState(addedRoofsState) //지붕재 선택
|
||||||
const [roofTab, setRoofTab] = useState(0) //지붕재 탭
|
const [roofTab, setRoofTab] = useState(0) //지붕재 탭
|
||||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
|
||||||
|
|
||||||
const {
|
const {
|
||||||
moduleSelectionInitParams,
|
moduleSelectionInitParams,
|
||||||
@ -22,7 +22,9 @@ export default function Module({ setTabNum }) {
|
|||||||
windSpeedCodes,
|
windSpeedCodes,
|
||||||
managementState,
|
managementState,
|
||||||
moduleList,
|
moduleList,
|
||||||
|
selectedSurfaceType,
|
||||||
installHeight,
|
installHeight,
|
||||||
|
standardWindSpeed,
|
||||||
verticalSnowCover,
|
verticalSnowCover,
|
||||||
handleChangeModule,
|
handleChangeModule,
|
||||||
handleChangeSurfaceType,
|
handleChangeSurfaceType,
|
||||||
@ -31,8 +33,8 @@ export default function Module({ setTabNum }) {
|
|||||||
handleChangeVerticalSnowCover,
|
handleChangeVerticalSnowCover,
|
||||||
} = useModuleSelection({ addedRoofs })
|
} = useModuleSelection({ addedRoofs })
|
||||||
|
|
||||||
const [inputInstallHeight, setInputInstallHeight] = useState(installHeight)
|
const [inputInstallHeight, setInputInstallHeight] = useState()
|
||||||
const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState(verticalSnowCover)
|
const [inputVerticalSnowCover, setInputVerticalSnowCover] = useState()
|
||||||
|
|
||||||
const [debouncedInstallHeight] = useDebounceValue(inputInstallHeight, 500)
|
const [debouncedInstallHeight] = useDebounceValue(inputInstallHeight, 500)
|
||||||
const [debouncedVerticalSnowCover] = useDebounceValue(inputVerticalSnowCover, 500)
|
const [debouncedVerticalSnowCover] = useDebounceValue(inputVerticalSnowCover, 500)
|
||||||
@ -43,15 +45,31 @@ export default function Module({ setTabNum }) {
|
|||||||
}, moduleSelectionData)
|
}, moduleSelectionData)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (installHeight) {
|
||||||
|
setInputInstallHeight(installHeight)
|
||||||
|
}
|
||||||
|
if (verticalSnowCover) {
|
||||||
|
setInputVerticalSnowCover(verticalSnowCover)
|
||||||
|
}
|
||||||
|
}, [installHeight, verticalSnowCover])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (tempModuleSelectionData) {
|
||||||
setModuleSelectionData(tempModuleSelectionData)
|
setModuleSelectionData(tempModuleSelectionData)
|
||||||
|
// moduleSelectedDataTrigger(tempModuleSelectionData)
|
||||||
|
}
|
||||||
}, [tempModuleSelectionData])
|
}, [tempModuleSelectionData])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (debouncedInstallHeight) {
|
||||||
handleChangeInstallHeight(debouncedInstallHeight)
|
handleChangeInstallHeight(debouncedInstallHeight)
|
||||||
|
}
|
||||||
}, [debouncedInstallHeight])
|
}, [debouncedInstallHeight])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (debouncedVerticalSnowCover) {
|
||||||
handleChangeVerticalSnowCover(debouncedVerticalSnowCover)
|
handleChangeVerticalSnowCover(debouncedVerticalSnowCover)
|
||||||
|
}
|
||||||
}, [debouncedVerticalSnowCover])
|
}, [debouncedVerticalSnowCover])
|
||||||
|
|
||||||
const moduleData = {
|
const moduleData = {
|
||||||
@ -71,6 +89,8 @@ export default function Module({ setTabNum }) {
|
|||||||
setRoofTab(tab)
|
setRoofTab(tab)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// const { trigger: moduleSelectedDataTrigger } = useCanvasPopupStatusController(2)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="roof-module-tab2-overflow">
|
<div className="roof-module-tab2-overflow">
|
||||||
@ -224,6 +244,7 @@ export default function Module({ setTabNum }) {
|
|||||||
key={index}
|
key={index}
|
||||||
index={index}
|
index={index}
|
||||||
addRoof={roof}
|
addRoof={roof}
|
||||||
|
setAddedRoofs={setAddedRoofs}
|
||||||
roofTab={index}
|
roofTab={index}
|
||||||
tempModuleSelectionData={tempModuleSelectionData}
|
tempModuleSelectionData={tempModuleSelectionData}
|
||||||
setTempModuleSelectionData={setTempModuleSelectionData}
|
setTempModuleSelectionData={setTempModuleSelectionData}
|
||||||
|
|||||||
@ -7,10 +7,14 @@ import { useCommonCode } from '@/hooks/common/useCommonCode'
|
|||||||
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState, moduleSelectionInitParamsState, selectedModuleState } from '@/store/selectedModuleOptions'
|
||||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||||
|
import { addedRoofsState } from '@/store/settingAtom'
|
||||||
|
|
||||||
export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
export default function ModuleTabContents({ addRoof, setAddedRoofs, roofTab, tempModuleSelectionData, setTempModuleSelectionData }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [roofMaterial, setRoofMaterial] = useState(addRoof) //지붕재`
|
const [roofMaterial, setRoofMaterial] = useState(addRoof) //지붕재`
|
||||||
|
|
||||||
|
const addRoofsArray = useRecoilValue(addedRoofsState)
|
||||||
|
|
||||||
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
const globalPitchText = useRecoilValue(pitchTextSelector) //피치 텍스트
|
||||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||||
|
|
||||||
@ -51,6 +55,40 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
|
|
||||||
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
||||||
|
|
||||||
|
const [hajebichi, setHajebichi] = useState(0)
|
||||||
|
const [lengthBase, setLengthBase] = useState(0)
|
||||||
|
|
||||||
|
const hajebichiRef = useRef()
|
||||||
|
const lengthRef = useRef()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
setHajebichi(addRoof.hajebichi)
|
||||||
|
setLengthBase(addRoof.lenBase)
|
||||||
|
}, [])
|
||||||
|
|
||||||
|
//높이를 변경하면 addRoofs에 적용
|
||||||
|
useEffect(() => {
|
||||||
|
//가대 조회 api 파라메터
|
||||||
|
setTrestleParams({ ...trestleParams, workingWidth: lengthBase })
|
||||||
|
|
||||||
|
const copyAddRoof = { ...addRoof }
|
||||||
|
copyAddRoof.length = Number(lengthBase)
|
||||||
|
copyAddRoof.lenBase = lengthBase
|
||||||
|
const index = addRoof.index
|
||||||
|
const newArray = [...addRoofsArray.slice(0, index), copyAddRoof, ...addRoofsArray.slice(index + 1)]
|
||||||
|
setAddedRoofs(newArray)
|
||||||
|
}, [lengthBase])
|
||||||
|
|
||||||
|
//망둥어 피치를 변경하면 addRoof 변경
|
||||||
|
useEffect(() => {
|
||||||
|
const copyAddRoof = { ...addRoof }
|
||||||
|
copyAddRoof.hajebichi = Number(hajebichi)
|
||||||
|
copyAddRoof.roofPchBase = hajebichi
|
||||||
|
const index = addRoof.index
|
||||||
|
const newArray = [...addRoofsArray.slice(0, index), copyAddRoof, ...addRoofsArray.slice(index + 1)]
|
||||||
|
setAddedRoofs(newArray)
|
||||||
|
}, [hajebichi])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab])
|
setModuleConstructionSelectionData(moduleSelectionData.roofConstructions[roofTab])
|
||||||
}, [moduleSelectionData])
|
}, [moduleSelectionData])
|
||||||
@ -76,7 +114,13 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
//공법 변경
|
//공법 변경
|
||||||
const handleChangeConstMthd = (option) => {
|
const handleChangeConstMthd = (option) => {
|
||||||
setSelectedConstMthd(option) //선택된값 저장
|
setSelectedConstMthd(option) //선택된값 저장
|
||||||
setRoofBaseParams({ ...trestleParams, trestleMkrCd: selectedTrestle.trestleMkrCd, constMthdCd: option.constMthdCd, roofBaseCd: '' })
|
setRoofBaseParams({
|
||||||
|
...trestleParams,
|
||||||
|
trestleMkrCd: selectedTrestle.trestleMkrCd,
|
||||||
|
constMthdCd: option.constMthdCd,
|
||||||
|
roofBaseCd: '',
|
||||||
|
roofPitch: hajebichiRef.current ? hajebichiRef.current.value : '',
|
||||||
|
})
|
||||||
setRoofBaseList([]) //지붕밑바탕 초기화
|
setRoofBaseList([]) //지붕밑바탕 초기화
|
||||||
setConstructionList([]) //공법 초기화
|
setConstructionList([]) //공법 초기화
|
||||||
}
|
}
|
||||||
@ -114,6 +158,14 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
selectedConstruction.setupSnowCover = false //눈막이금구 설치 여부
|
||||||
selectedConstruction.selectedIndex = index
|
selectedConstruction.selectedIndex = index
|
||||||
|
|
||||||
|
//기존에 선택된 데이터가 있으면 체크한다
|
||||||
|
if (moduleConstructionSelectionData && moduleConstructionSelectionData.construction) {
|
||||||
|
selectedConstruction.setupCover = moduleConstructionSelectionData.construction.setupCover
|
||||||
|
selectedConstruction.setupSnowCover = moduleConstructionSelectionData.construction.setupSnowCover
|
||||||
|
setCvrChecked(selectedConstruction.setupCover)
|
||||||
|
setSnowGdChecked(selectedConstruction.setupSnowCover)
|
||||||
|
}
|
||||||
|
|
||||||
setCvrYn(selectedConstruction.cvrYn)
|
setCvrYn(selectedConstruction.cvrYn)
|
||||||
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
setSnowGdPossYn(selectedConstruction.snowGdPossYn)
|
||||||
setSelectedConstruction(selectedConstruction)
|
setSelectedConstruction(selectedConstruction)
|
||||||
@ -126,10 +178,12 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
|
|
||||||
const handleCvrChecked = () => {
|
const handleCvrChecked = () => {
|
||||||
setCvrChecked(!cvrChecked)
|
setCvrChecked(!cvrChecked)
|
||||||
|
setSelectedConstruction({ ...selectedConstruction, setupCover: !cvrChecked })
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleSnowGdChecked = () => {
|
const handleSnowGdChecked = () => {
|
||||||
setSnowGdChecked(!snowGdChecked)
|
setSnowGdChecked(!snowGdChecked)
|
||||||
|
setSelectedConstruction({ ...selectedConstruction, setupSnowCover: !snowGdChecked })
|
||||||
}
|
}
|
||||||
|
|
||||||
const getModuleOptionsListData = async (params) => {
|
const getModuleOptionsListData = async (params) => {
|
||||||
@ -195,14 +249,6 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
}
|
}
|
||||||
}, [selectedConstruction])
|
}, [selectedConstruction])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setSelectedConstruction({ ...selectedConstruction, setupCover: cvrChecked })
|
|
||||||
}, [cvrChecked])
|
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setSelectedConstruction({ ...selectedConstruction, setupSnowCover: snowGdChecked })
|
|
||||||
}, [snowGdChecked])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isExistData) {
|
if (isExistData) {
|
||||||
setConstructionListParams({
|
setConstructionListParams({
|
||||||
@ -215,7 +261,12 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
}, [selectedRoofBase])
|
}, [selectedRoofBase])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isExistData && constructionList.length > 0) {
|
if (
|
||||||
|
isExistData &&
|
||||||
|
constructionList.length > 0 &&
|
||||||
|
isObjectNotEmpty(moduleConstructionSelectionData.construction) &&
|
||||||
|
moduleConstructionSelectionData.construction.hasOwnProperty('constPossYn') ///키가 있으면
|
||||||
|
) {
|
||||||
const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex
|
const selectedIndex = moduleConstructionSelectionData.construction.selectedIndex
|
||||||
const construction = constructionList[selectedIndex]
|
const construction = constructionList[selectedIndex]
|
||||||
if (construction.constPossYn === 'Y') {
|
if (construction.constPossYn === 'Y') {
|
||||||
@ -245,15 +296,19 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
) {
|
) {
|
||||||
const isModuleLoaded = moduleSelectionInitParams.hasOwnProperty('moduleTpCd') //모듈컬럼이 있으면 모듈을 변경했다는 내용
|
const isModuleLoaded = moduleSelectionInitParams.hasOwnProperty('moduleTpCd') //모듈컬럼이 있으면 모듈을 변경했다는 내용
|
||||||
if (isModuleLoaded) {
|
if (isModuleLoaded) {
|
||||||
setTrestleParams({ moduleTpCd: moduleSelectionInitParams.moduleTpCd, roofMatlCd: addRoof.roofMatlCd, raftBaseCd: addRoof.raftBaseCd })
|
setTrestleParams({
|
||||||
|
moduleTpCd: moduleSelectionInitParams.moduleTpCd,
|
||||||
|
roofMatlCd: addRoof.roofMatlCd,
|
||||||
|
raftBaseCd: addRoof.raftBaseCd,
|
||||||
|
workingWidth: lengthBase,
|
||||||
|
})
|
||||||
setConstructionList([])
|
setConstructionList([])
|
||||||
|
|
||||||
if (isObjectNotEmpty(moduleConstructionSelectionData)) {
|
if (isObjectNotEmpty(moduleConstructionSelectionData)) {
|
||||||
//기존에 데이터가 있으면 파라메터를 넣는다
|
//기존에 데이터가 있으면 파라메터를 넣는다
|
||||||
setConstructionParams({ ...moduleConstructionSelectionData.trestle, constMthdCd: '', roofBaseCd: '' })
|
setConstructionParams({ ...moduleConstructionSelectionData.trestle, constMthdCd: '', roofBaseCd: '' })
|
||||||
setRoofBaseParams({ ...moduleConstructionSelectionData.trestle, roofBaseCd: '' })
|
setRoofBaseParams({ ...moduleConstructionSelectionData.trestle, roofBaseCd: '' })
|
||||||
setCvrChecked(moduleConstructionSelectionData.construction.setupCover)
|
|
||||||
setSnowGdChecked(moduleConstructionSelectionData.construction.setupSnowCover)
|
|
||||||
setIsExistData(true)
|
setIsExistData(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -286,11 +341,11 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
}
|
}
|
||||||
}, [constructionListParams])
|
}, [constructionListParams])
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
if (isObjectNotEmpty(tempModuleSelectionData)) {
|
// if (isObjectNotEmpty(tempModuleSelectionData)) {
|
||||||
setModuleSelectionData(tempModuleSelectionData)
|
// setModuleSelectionData(tempModuleSelectionData)
|
||||||
}
|
// }
|
||||||
}, [tempModuleSelectionData])
|
// }, [tempModuleSelectionData])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -308,21 +363,21 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
<>
|
<>
|
||||||
<div className="eaves-keraba-th">L</div>
|
<div className="eaves-keraba-th">L</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="keraba-flex">
|
|
||||||
<div className="outline-form">
|
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={roofMaterial.lenBase}
|
value={lengthBase}
|
||||||
|
onChange={(e) => setLengthBase(e.target.value)}
|
||||||
disabled={roofMaterial.lenAuth === 'R' ? true : false}
|
disabled={roofMaterial.lenAuth === 'R' ? true : false}
|
||||||
|
ref={lengthRef}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
{roofMaterial && ['C', 'R'].includes(roofMaterial.raftAuth) && (
|
{roofMaterial && ['C', 'R'].includes(roofMaterial.raftAuth) && (
|
||||||
<>
|
<>
|
||||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.rafter.margin')}</div>
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.rafter.margin')}</div>
|
||||||
@ -343,24 +398,23 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
{roofMaterial && ['C', 'R'].includes(roofMaterial.roofPchAuth) && (
|
{roofMaterial && ['C', 'R'].includes(roofMaterial.roofPchAuth) && (
|
||||||
<>
|
<>
|
||||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.rafter.margin')}</div>
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.hajebichi')}</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="keraba-flex">
|
|
||||||
<div className="outline-form">
|
|
||||||
<span>垂木の間隔</span>
|
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
value={roofMaterial.hajebichi}
|
|
||||||
disabled={roofMaterial.roofPchAuth === 'R' ? true : false}
|
disabled={roofMaterial.roofPchAuth === 'R' ? true : false}
|
||||||
|
onChange={(e) => setHajebichi(e.target.value)}
|
||||||
|
value={hajebichi}
|
||||||
|
ref={hajebichiRef}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
@ -464,7 +518,7 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={`ch01_${roofTab}`}
|
id={`ch01_${roofTab}`}
|
||||||
disabled={cvrYn === 'N' ? true : false}
|
disabled={cvrYn === 'N' ? true : false}
|
||||||
defaultChecked={cvrChecked}
|
checked={cvrChecked}
|
||||||
onChange={handleCvrChecked}
|
onChange={handleCvrChecked}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch01_${roofTab}`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
<label htmlFor={`ch01_${roofTab}`}>{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
||||||
@ -474,7 +528,7 @@ export default function ModuleTabContents({ addRoof, roofTab, tempModuleSelectio
|
|||||||
type="checkbox"
|
type="checkbox"
|
||||||
id={`ch02_${roofTab}`}
|
id={`ch02_${roofTab}`}
|
||||||
disabled={snowGdPossYn === 'N' ? true : false}
|
disabled={snowGdPossYn === 'N' ? true : false}
|
||||||
defaultChecked={snowGdChecked}
|
checked={snowGdChecked}
|
||||||
onChange={handleSnowGdChecked}
|
onChange={handleSnowGdChecked}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={`ch02_${roofTab}`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
<label htmlFor={`ch02_${roofTab}`}>{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
||||||
|
|||||||
@ -20,6 +20,8 @@ export default function StepUp(props) {
|
|||||||
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const selectedModules = useRecoilValue(selectedModuleState)
|
const selectedModules = useRecoilValue(selectedModuleState)
|
||||||
|
const [stepUpListData, setStepUpListData] = useState([])
|
||||||
|
const [optCodes, setOptCodes] = useState([])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!managementState) {
|
if (!managementState) {
|
||||||
@ -68,7 +70,44 @@ export default function StepUp(props) {
|
|||||||
roofSurfaceList: roofSurfaceList,
|
roofSurfaceList: roofSurfaceList,
|
||||||
pscItemList: pscItemList,
|
pscItemList: pscItemList,
|
||||||
}
|
}
|
||||||
getPcsVoltageStepUpList(null)
|
//getPcsVoltageStepUpList(null)
|
||||||
|
|
||||||
|
getPcsVoltageStepUpList().then((res) => {
|
||||||
|
if (res?.result.code === 200 && res?.data) {
|
||||||
|
const dataArray = Array.isArray(res.data) ? res.data : [res.data]
|
||||||
|
const stepUpListData = dataArray.map((stepUps) => ({
|
||||||
|
...stepUps,
|
||||||
|
optionList: (stepUps.optionList || []).map((option) => ({
|
||||||
|
pcsOptCd: option.pcsOptCd,
|
||||||
|
pcsOptNm: option.pcsOptNm,
|
||||||
|
pcsOptNmJp: option.pcsOptNmJp,
|
||||||
|
})),
|
||||||
|
pcsItemList: (stepUps.pcsItemList || []).map((item) => ({
|
||||||
|
goodsNo: item.goodsNo,
|
||||||
|
itemId: item.itemId,
|
||||||
|
itemNm: item.itemNm,
|
||||||
|
pcsMkrCd: item.pcsMkrCd,
|
||||||
|
pcsSerCd: item.pcsSerCd,
|
||||||
|
connList: (item.connList || []).map((conn) => ({
|
||||||
|
connAllowCur: conn.connAllowCur,
|
||||||
|
connMaxParalCnt: conn.connMaxParalCnt,
|
||||||
|
goodsNo: conn.goodsNo,
|
||||||
|
itemId: conn.itemId,
|
||||||
|
itemNm: conn.itemNm,
|
||||||
|
vstuParalCnt: conn.vstuParalCnt,
|
||||||
|
})),
|
||||||
|
serQtyList: (item.serQtyList || []).map((qty) => ({
|
||||||
|
serQty: qty.serQty,
|
||||||
|
paralQty: qty.paralQty,
|
||||||
|
})),
|
||||||
|
})),
|
||||||
|
}))
|
||||||
|
console.log('🚀 ~ useEffect ~ getPcsVoltageStepUpList ~ stepUpListData:', stepUpListData)
|
||||||
|
setStepUpListData(stepUpListData)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//setOptCodes(stepUpListData.optionList.map((opt) => ({ ...opt, code: opt.pcsOptCd, name: opt.pcsOptNm, nameJp: opt.pcsOptNmJp })))
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useCanvasPopupStatusController(6)
|
useCanvasPopupStatusController(6)
|
||||||
@ -81,11 +120,12 @@ export default function StepUp(props) {
|
|||||||
<div className="properties-setting-wrap outer">
|
<div className="properties-setting-wrap outer">
|
||||||
<div className="circuit-overflow">
|
<div className="circuit-overflow">
|
||||||
{/* 3개일때 className = by-max */}
|
{/* 3개일때 className = by-max */}
|
||||||
<div className={`module-table-box ${arrayLength === 3 ? 'by-max' : ''}`}>
|
{stepUpListData.map((stepUp, index) => (
|
||||||
{Array.from({ length: arrayLength }).map((_, idx) => (
|
<div key={index} className={`module-table-box ${stepUp.pcsItemList.length === 3 ? 'by-max' : ''}`}>
|
||||||
|
{Array.from({ length: stepUp.pcsItemList.length }).map((_, idx) => (
|
||||||
<div key={idx} className="module-table-inner">
|
<div key={idx} className="module-table-inner">
|
||||||
<div className="mb-box">
|
<div className="mb-box">
|
||||||
<div className="circuit-table-tit">HQJP-KA55-5</div>
|
<div className="circuit-table-tit">{stepUp.pcsItemList[idx].goodsNo}</div>
|
||||||
<div className="roof-module-table overflow-y min">
|
<div className="roof-module-table overflow-y min">
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
@ -95,30 +135,14 @@ export default function StepUp(props) {
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
{stepUp.pcsItemList[idx].serQtyList.map((item) => {
|
||||||
|
return (
|
||||||
<tr className="on">
|
<tr className="on">
|
||||||
<td className="al-r">10</td>
|
<td className="al-r">{item.serQty}</td>
|
||||||
<td className="al-r">0</td>
|
<td className="al-r">{item.paralQty}</td>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td className="al-r">10</td>
|
|
||||||
<td className="al-r">0</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td className="al-r">10</td>
|
|
||||||
<td className="al-r">0</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td className="al-r">10</td>
|
|
||||||
<td className="al-r">0</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td className="al-r">10</td>
|
|
||||||
<td className="al-r">0</td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td className="al-r">10</td>
|
|
||||||
<td className="al-r">0</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
@ -145,9 +169,9 @@ export default function StepUp(props) {
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
<td className="al-c">KTN-CBD4C</td>
|
<td className="al-c">{stepUp.pcsItemList[idx].connList[0].goodsNo}</td>
|
||||||
<td className="al-r">4</td>
|
<td className="al-r">{stepUp.pcsItemList[idx].connList[0].connMaxParalCnt}</td>
|
||||||
<td className="al-r">0</td>
|
<td className="al-r">{stepUp.pcsItemList[idx].connList[0].vstuParalCnt}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -178,15 +202,19 @@ export default function StepUp(props) {
|
|||||||
</div>
|
</div>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
<div className="slope-wrap">
|
<div className="slope-wrap">
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<span className="mr10" style={{ width: 'auto' }}>
|
<span className="mr10" style={{ width: 'auto' }}>
|
||||||
{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
|
{getMessage('modal.circuit.trestle.setting.step.up.allocation.select.monitor')}
|
||||||
</span>
|
</span>
|
||||||
|
{optCodes.length > 0 && (
|
||||||
<div className="grid-select mr10">
|
<div className="grid-select mr10">
|
||||||
<QSelectBox title={'電力検出ユニット (モニター付き)'} />
|
<QSelectBox title={'電力検出ユニット (モニター付き)'} />
|
||||||
|
{/* <QSelectBox options={optCodes} value={optCodes.name} sourceKey="code" targetKey="code" showKey="name" /> */}
|
||||||
</div>
|
</div>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,6 +15,7 @@ import { QcastContext } from '@/app/QcastProvider'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
import BoardDetailModal from '../community/modal/BoardDetailModal'
|
import BoardDetailModal from '../community/modal/BoardDetailModal'
|
||||||
|
import { handleFileDown } from '@/util/board-utils'
|
||||||
|
|
||||||
export default function MainContents() {
|
export default function MainContents() {
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
@ -22,8 +23,7 @@ export default function MainContents() {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet } = useAxios(globalLocaleState)
|
const { promiseGet, get } = useAxios(globalLocaleState)
|
||||||
|
|
||||||
//공지사항
|
//공지사항
|
||||||
const [recentNoticeList, setRecentNoticeList] = useState([])
|
const [recentNoticeList, setRecentNoticeList] = useState([])
|
||||||
|
|
||||||
@ -33,15 +33,42 @@ export default function MainContents() {
|
|||||||
const { qcastState, setIsGlobalLoading } = useContext(QcastContext)
|
const { qcastState, setIsGlobalLoading } = useContext(QcastContext)
|
||||||
const { fetchObjectList, initObjectList } = useMainContentsController()
|
const { fetchObjectList, initObjectList } = useMainContentsController()
|
||||||
|
|
||||||
|
//첨부파일
|
||||||
|
const [boardList, setBoardList] = useState([])
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
fetchObjectList()
|
fetchObjectList()
|
||||||
fetchNoticeList()
|
fetchNoticeList()
|
||||||
fetchFaqList()
|
fetchFaqList()
|
||||||
|
//첨부파일 목록 호출
|
||||||
|
fetchArchiveList()
|
||||||
return () => {
|
return () => {
|
||||||
initObjectList()
|
initObjectList()
|
||||||
}
|
}
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
|
//첨부파일 목록 호출
|
||||||
|
const fetchArchiveList = async () => {
|
||||||
|
const url = `/api/board/list`
|
||||||
|
|
||||||
|
const params = new URLSearchParams({
|
||||||
|
schNoticeTpCd: 'QC',
|
||||||
|
schNoticeClsCd: 'DOWN',
|
||||||
|
startRow: 1,
|
||||||
|
endRow: 2,
|
||||||
|
})
|
||||||
|
|
||||||
|
const apiUrl = `${url}?${params.toString()}`
|
||||||
|
const resultData = await get({ url: apiUrl })
|
||||||
|
|
||||||
|
if (resultData) {
|
||||||
|
if (resultData.result.code === 200) {
|
||||||
|
setBoardList(resultData.data)
|
||||||
|
} else {
|
||||||
|
alert(resultData.result.message)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
//공지사항 호출
|
//공지사항 호출
|
||||||
const fetchNoticeList = async () => {
|
const fetchNoticeList = async () => {
|
||||||
try {
|
try {
|
||||||
@ -114,7 +141,7 @@ export default function MainContents() {
|
|||||||
>
|
>
|
||||||
<div className="item-inner">
|
<div className="item-inner">
|
||||||
<span className="time">{dayjs(row.lastEditDatetime).format('YYYY.MM.DD HH:mm:ss')}</span>
|
<span className="time">{dayjs(row.lastEditDatetime).format('YYYY.MM.DD HH:mm:ss')}</span>
|
||||||
<span>{row.tempFlg === '0' ? row.objectNo : getMessage('stuff.gridData.tempObjectNo')}</span>
|
<span className="product">{row.tempFlg === '0' ? row.objectNo : getMessage('stuff.gridData.tempObjectNo')}</span>
|
||||||
<span>{row.objectName ? row.objectName : '-'}</span>
|
<span>{row.objectName ? row.objectName : '-'}</span>
|
||||||
<span>{row.saleStoreName}</span>
|
<span>{row.saleStoreName}</span>
|
||||||
</div>
|
</div>
|
||||||
@ -183,14 +210,19 @@ export default function MainContents() {
|
|||||||
)}
|
)}
|
||||||
</ProductItem>
|
</ProductItem>
|
||||||
<ProductItem num={4} name={'Data Download'}>
|
<ProductItem num={4} name={'Data Download'}>
|
||||||
|
{boardList.length > 0 ? (
|
||||||
<div className="data-download-wrap">
|
<div className="data-download-wrap">
|
||||||
<button className="data-down" type="button" onClick={() => swalFire({ text: getMessage('main.content.alert.noFile'), type: 'alert' })}>
|
{boardList?.map((board) => (
|
||||||
<span>{getMessage('main.content.download1')}</span>
|
<button type="button" className="data-down" onClick={() => handleFileDown(board.noticeNo, 'Y')}>
|
||||||
</button>
|
<span>{board.title}</span>
|
||||||
<button className="data-down" type="button" onClick={() => swalFire({ text: getMessage('main.content.alert.noFile'), type: 'alert' })}>
|
|
||||||
<span>{getMessage('main.content.download2')}</span>
|
|
||||||
</button>
|
</button>
|
||||||
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
) : (
|
||||||
|
<div className="file-down-nodata">
|
||||||
|
<h3>{getMessage('common.message.no.data')}</h3>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
</ProductItem>
|
</ProductItem>
|
||||||
<ProductItem num={5} name={'Sales Contact info'}>
|
<ProductItem num={5} name={'Sales Contact info'}>
|
||||||
<ul className="contact-info-list">
|
<ul className="contact-info-list">
|
||||||
|
|||||||
@ -222,7 +222,6 @@ export default function Stuff() {
|
|||||||
if (!params.saleStoreId) {
|
if (!params.saleStoreId) {
|
||||||
params.saleStoreId = session.storeId
|
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({
|
||||||
@ -278,6 +277,13 @@ export default function Stuff() {
|
|||||||
if (!stuffSearchParams.saleStoreId) {
|
if (!stuffSearchParams.saleStoreId) {
|
||||||
stuffSearchParams.saleStoreId = session.storeId
|
stuffSearchParams.saleStoreId = session.storeId
|
||||||
}
|
}
|
||||||
|
if (stuffSearchParams.schMyDataCheck) {
|
||||||
|
if (session.storeLvl === '1') {
|
||||||
|
//schOtherSelSaleStoreId 초기화 schSelSaleStoreId 에 saleStoreId 담아서 보내기
|
||||||
|
stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||||
|
stuffSearchParams.schSelSaleStoreId = session.storeId
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
const apiUrl = `/api/object/list?${queryStringFormatter(stuffSearchParams)}`
|
||||||
@ -312,6 +318,12 @@ export default function Stuff() {
|
|||||||
if (!params.saleStoreId) {
|
if (!params.saleStoreId) {
|
||||||
stuffSearchParams.saleStoreId = session.storeId
|
stuffSearchParams.saleStoreId = session.storeId
|
||||||
}
|
}
|
||||||
|
if (stuffSearchParams.schMyDataCheck) {
|
||||||
|
//schOtherSelSaleStoreId 초기화 schSelSaleStoreId 에 saleStoreId 담아서 보내기
|
||||||
|
stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||||
|
stuffSearchParams.schSelSaleStoreId = 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) => {
|
||||||
@ -347,6 +359,7 @@ export default function Stuff() {
|
|||||||
code: 'S',
|
code: 'S',
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
pageSize: 100,
|
pageSize: 100,
|
||||||
|
schMyDataCheck: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import { useState, useEffect, useRef, useContext } from 'react'
|
|||||||
import { useRouter, useSearchParams } from 'next/navigation'
|
import { useRouter, useSearchParams } from 'next/navigation'
|
||||||
import { Button } from '@nextui-org/react'
|
import { Button } from '@nextui-org/react'
|
||||||
import Select, { components } from 'react-select'
|
import Select, { components } from 'react-select'
|
||||||
import Link from 'next/link'
|
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { globalLocaleStore } from '@/store/localeAtom'
|
import { globalLocaleStore } from '@/store/localeAtom'
|
||||||
import { isEmptyArray, isNotEmptyArray, isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
import { isEmptyArray, isNotEmptyArray, isObjectNotEmpty, queryStringFormatter } from '@/util/common-utils'
|
||||||
@ -289,10 +288,12 @@ export default function StuffDetail() {
|
|||||||
display: 'none',
|
display: 'none',
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// if (managementState?.createUser === 'T01' && session?.userId !== 'T01') {
|
if (managementState?.createUser === 'T01') {
|
||||||
//createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기 적용할지 미정!!!!!!!!
|
if (session.userId !== 'T01') {
|
||||||
//buttonStyle = { display: 'none' }
|
// #474
|
||||||
// }
|
buttonStyle = { display: 'none' }
|
||||||
|
}
|
||||||
|
}
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="grid-cell-btn">
|
<div className="grid-cell-btn">
|
||||||
@ -301,7 +302,6 @@ export default function StuffDetail() {
|
|||||||
type="button"
|
type="button"
|
||||||
className="grid-btn"
|
className="grid-btn"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
//mid:5(견적서), /pid:플랜번호
|
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: params.data.objectNo })
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
setMenuNumber(5)
|
setMenuNumber(5)
|
||||||
@ -1025,6 +1025,8 @@ export default function StuffDetail() {
|
|||||||
const _objectNameOmit = watch('objectNameOmit')
|
const _objectNameOmit = watch('objectNameOmit')
|
||||||
// saleStoreId: '', //1차 판매점ID
|
// saleStoreId: '', //1차 판매점ID
|
||||||
const _saleStoreId = watch('saleStoreId')
|
const _saleStoreId = watch('saleStoreId')
|
||||||
|
// 2차 판매점명
|
||||||
|
const _otherSaleStoreId = watch('otherSaleStoreId')
|
||||||
// zipNo: '', //우편번호
|
// zipNo: '', //우편번호
|
||||||
const _zipNo = watch('zipNo')
|
const _zipNo = watch('zipNo')
|
||||||
// prefId: '', //도도부현
|
// prefId: '', //도도부현
|
||||||
@ -1043,6 +1045,7 @@ export default function StuffDetail() {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (editMode === 'NEW') {
|
if (editMode === 'NEW') {
|
||||||
const formData = form.getValues()
|
const formData = form.getValues()
|
||||||
|
|
||||||
let errors = {}
|
let errors = {}
|
||||||
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
if (!formData.receiveUser || formData.receiveUser.trim().length === 0) {
|
||||||
errors.receiveUser = true
|
errors.receiveUser = true
|
||||||
@ -1057,6 +1060,12 @@ export default function StuffDetail() {
|
|||||||
errors.saleStoreId = true
|
errors.saleStoreId = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (session?.storeLvl === '2') {
|
||||||
|
if (!formData.otherSaleStoreId) {
|
||||||
|
errors.otherSaleStoreId = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!formData.zipNo) {
|
if (!formData.zipNo) {
|
||||||
errors.zipNo = true
|
errors.zipNo = true
|
||||||
}
|
}
|
||||||
@ -1099,6 +1108,12 @@ export default function StuffDetail() {
|
|||||||
errors.saleStoreId = true
|
errors.saleStoreId = true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (session?.storeLvl === '2') {
|
||||||
|
if (!formData.otherSaleStoreId) {
|
||||||
|
errors.otherSaleStoreId = true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (!formData.zipNo) {
|
if (!formData.zipNo) {
|
||||||
errors.zipNo = true
|
errors.zipNo = true
|
||||||
}
|
}
|
||||||
@ -1130,6 +1145,7 @@ export default function StuffDetail() {
|
|||||||
_objectName,
|
_objectName,
|
||||||
_objectNameOmit,
|
_objectNameOmit,
|
||||||
_saleStoreId,
|
_saleStoreId,
|
||||||
|
_otherSaleStoreId,
|
||||||
_zipNo,
|
_zipNo,
|
||||||
_prefId,
|
_prefId,
|
||||||
_address,
|
_address,
|
||||||
@ -1368,13 +1384,12 @@ export default function StuffDetail() {
|
|||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
//상세화면으로 전환
|
//상세화면으로 전환
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: objectNo })
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.save'),
|
text: getMessage('stuff.detail.save'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
|
|
||||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -1391,12 +1406,12 @@ export default function StuffDetail() {
|
|||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
|
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
setFloorPlanObjectNo({ floorPlanObjectNo: res.data.objectNo })
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.save'),
|
text: getMessage('stuff.detail.save'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
router.push(`/management/stuff/detail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -1468,11 +1483,11 @@ export default function StuffDetail() {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.tempSave.message1'),
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -1487,11 +1502,11 @@ export default function StuffDetail() {
|
|||||||
.then((res) => {
|
.then((res) => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('stuff.detail.tempSave.message1'),
|
text: getMessage('stuff.detail.tempSave.message1'),
|
||||||
type: 'alert',
|
type: 'alert',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
setIsGlobalLoading(false)
|
|
||||||
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
router.push(`/management/stuff/tempdetail?objectNo=${res.data.objectNo.toString()}`, { scroll: false })
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
@ -1519,7 +1534,7 @@ export default function StuffDetail() {
|
|||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||||
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
|
del({ url: `/api/object/${objectNo}?${queryStringFormatter(delParams)}` })
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
setFloorPlanObjectNo({ floorPlanObjectNo: '' })
|
||||||
if (session.storeId === 'T01') {
|
if (session.storeId === 'T01') {
|
||||||
@ -1595,6 +1610,13 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
// 그리드 더블 클릭 해당플랜의 도면작성 화면으로 이동
|
// 그리드 더블 클릭 해당플랜의 도면작성 화면으로 이동
|
||||||
const getCellDoubleClicked = (params) => {
|
const getCellDoubleClicked = (params) => {
|
||||||
|
//#474정책
|
||||||
|
if (managementState.createUser === 'T01') {
|
||||||
|
if (session.userId !== 'T01') {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (params?.column?.colId !== 'estimateDate') {
|
if (params?.column?.colId !== 'estimateDate') {
|
||||||
if (params?.data?.planNo && params?.data?.objectNo) {
|
if (params?.data?.planNo && params?.data?.objectNo) {
|
||||||
let objectNo = params?.data?.objectNo
|
let objectNo = params?.data?.objectNo
|
||||||
@ -2462,6 +2484,7 @@ export default function StuffDetail() {
|
|||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
|
상세
|
||||||
<Select
|
<Select
|
||||||
id="long-value-select2"
|
id="long-value-select2"
|
||||||
instanceId="long-value-select2"
|
instanceId="long-value-select2"
|
||||||
@ -2473,16 +2496,18 @@ export default function StuffDetail() {
|
|||||||
onChange={onSelectionChange2}
|
onChange={onSelectionChange2}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
// isDisabled={
|
isDisabled={
|
||||||
// managementState?.tempFlg === '0'
|
managementState?.tempFlg === '0'
|
||||||
// ? true
|
? true
|
||||||
// : session?.storeLvl === '1' && form.watch('saleStoreId') != ''
|
: session?.storeLvl === '1'
|
||||||
// ? false
|
? otherSaleStoreList.length > 0
|
||||||
// : false
|
? false
|
||||||
// }
|
: true
|
||||||
isDisabled={managementState?.tempFlg === '0' ? true : false}
|
: otherSaleStoreList.length === 1
|
||||||
|
? true
|
||||||
|
: false
|
||||||
|
}
|
||||||
isClearable={managementState?.tempFlg === '0' ? false : true}
|
isClearable={managementState?.tempFlg === '0' ? false : true}
|
||||||
// isClearable={managementState?.tempFlg === '0' ? false : session?.storeLvl === '1' ? true : true}
|
|
||||||
value={otherSaleStoreList.filter(function (option) {
|
value={otherSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === otherSelOptions
|
return option.saleStoreId === otherSelOptions
|
||||||
})}
|
})}
|
||||||
|
|||||||
@ -343,7 +343,7 @@ export default function StuffSearchCondition() {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (session?.storeLvl === '2') {
|
if (session?.storeLvl === '2') {
|
||||||
if (otherSaleStoreList.length > 1) {
|
if (otherSaleStoreList.length === 1) {
|
||||||
setOtherSaleStoreId(session.storeId)
|
setOtherSaleStoreId(session.storeId)
|
||||||
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||||
stuffSearch.schObjectNo = ''
|
stuffSearch.schObjectNo = ''
|
||||||
@ -356,6 +356,24 @@ export default function StuffSearchCondition() {
|
|||||||
stuffSearch.schTempFlg = ''
|
stuffSearch.schTempFlg = ''
|
||||||
stuffSearch.schMyDataCheck = false
|
stuffSearch.schMyDataCheck = false
|
||||||
|
|
||||||
|
stuffSearch.startRow = 1
|
||||||
|
stuffSearch.endRow = 100
|
||||||
|
stuffSearch.schSortType = 'U'
|
||||||
|
stuffSearch.pageNo = 1
|
||||||
|
stuffSearch.pageSize = 100
|
||||||
|
} else if (otherSaleStoreList.length > 1) {
|
||||||
|
setOtherSaleStoreId('')
|
||||||
|
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||||
|
stuffSearch.schObjectNo = ''
|
||||||
|
stuffSearch.schAddress = ''
|
||||||
|
stuffSearch.schObjectName = ''
|
||||||
|
stuffSearch.schSaleStoreName = ''
|
||||||
|
stuffSearch.schReceiveUser = ''
|
||||||
|
stuffSearch.schDispCompanyName = ''
|
||||||
|
stuffSearch.schDateType = 'U'
|
||||||
|
stuffSearch.schTempFlg = ''
|
||||||
|
stuffSearch.schMyDataCheck = false
|
||||||
|
|
||||||
stuffSearch.startRow = 1
|
stuffSearch.startRow = 1
|
||||||
stuffSearch.endRow = 100
|
stuffSearch.endRow = 100
|
||||||
stuffSearch.schSortType = 'U'
|
stuffSearch.schSortType = 'U'
|
||||||
@ -504,6 +522,7 @@ export default function StuffSearchCondition() {
|
|||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (stuffSearch.code === 'S') {
|
if (stuffSearch.code === 'S') {
|
||||||
|
if (otherList.length === 1) {
|
||||||
setOtherSaleStoreId(session?.storeId)
|
setOtherSaleStoreId(session?.storeId)
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...stuffSearch,
|
...stuffSearch,
|
||||||
@ -511,6 +530,15 @@ export default function StuffSearchCondition() {
|
|||||||
schSelSaleStoreId: res[0].saleStoreId,
|
schSelSaleStoreId: res[0].saleStoreId,
|
||||||
schOtherSelSaleStoreId: otherList[0].saleStoreId,
|
schOtherSelSaleStoreId: otherList[0].saleStoreId,
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
setOtherSaleStoreId('')
|
||||||
|
setStuffSearch({
|
||||||
|
...stuffSearch,
|
||||||
|
code: 'S',
|
||||||
|
schSelSaleStoreId: res[0].saleStoreId,
|
||||||
|
schOtherSelSaleStoreId: '',
|
||||||
|
})
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
setOtherSaleStoreId(stuffSearch?.schOtherSelSaleStoreId)
|
setOtherSaleStoreId(stuffSearch?.schOtherSelSaleStoreId)
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
@ -561,7 +589,6 @@ export default function StuffSearchCondition() {
|
|||||||
setOtherSaleStoreId('')
|
setOtherSaleStoreId('')
|
||||||
setSchSelSaleStoreId(key.saleStoreId)
|
setSchSelSaleStoreId(key.saleStoreId)
|
||||||
stuffSearch.schSelSaleStoreId = key.saleStoreId
|
stuffSearch.schSelSaleStoreId = key.saleStoreId
|
||||||
//T01아닌 1차점은 본인으로 디폴트셋팅이고 수정할수없어서 여기안옴
|
|
||||||
//고른 1차점의 saleStoreId로 2차점 API호출하기
|
//고른 1차점의 saleStoreId로 2차점 API호출하기
|
||||||
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
let otherList
|
let otherList
|
||||||
@ -719,6 +746,47 @@ export default function StuffSearchCondition() {
|
|||||||
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
||||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if (stuffSearch.code === 'DELETE') {
|
||||||
|
//1차점인경우
|
||||||
|
if (session.storeLvl === '1') {
|
||||||
|
stuffSearch.schOtherSelSaleStoreId = ''
|
||||||
|
setOtherSaleStoreId('')
|
||||||
|
} else {
|
||||||
|
//2차점 본인하나인경우
|
||||||
|
//34있는경우
|
||||||
|
stuffSearch.schOtherSelSaleStoreId = ''
|
||||||
|
setOtherSaleStoreId('')
|
||||||
|
}
|
||||||
|
|
||||||
|
setObjectNo('')
|
||||||
|
setSaleStoreName('')
|
||||||
|
setAddress('')
|
||||||
|
setobjectName('')
|
||||||
|
setDispCompanyName('')
|
||||||
|
setReceiveUser('')
|
||||||
|
objectNoRef.current.value = ''
|
||||||
|
saleStoreNameRef.current.value = ''
|
||||||
|
addressRef.current.value = ''
|
||||||
|
objectNameRef.current.value = ''
|
||||||
|
dispCompanyNameRef.current.value = ''
|
||||||
|
receiveUserRef.current.value = ''
|
||||||
|
stuffSearch.schObjectNo = ''
|
||||||
|
stuffSearch.schAddress = ''
|
||||||
|
stuffSearch.schObjectName = ''
|
||||||
|
stuffSearch.schSaleStoreName = ''
|
||||||
|
stuffSearch.schReceiveUser = ''
|
||||||
|
stuffSearch.schDispCompanyName = ''
|
||||||
|
stuffSearch.schDateType = 'U'
|
||||||
|
stuffSearch.schTempFlg = ''
|
||||||
|
stuffSearch.schMyDataCheck = false
|
||||||
|
stuffSearch.schFromDt = dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD')
|
||||||
|
stuffSearch.schToDt = dayjs(new Date()).format('YYYY-MM-DD')
|
||||||
|
stuffSearch.startRow = 1
|
||||||
|
stuffSearch.endRow = 100
|
||||||
|
stuffSearch.schSortType = 'U'
|
||||||
|
stuffSearch.pageNo = 1
|
||||||
|
stuffSearch.pageSize = 100
|
||||||
} else {
|
} else {
|
||||||
setStartDate(stuffSearch?.schFromDt ? stuffSearch.schFromDt : dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'))
|
setStartDate(stuffSearch?.schFromDt ? stuffSearch.schFromDt : dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'))
|
||||||
setEndDate(stuffSearch?.schToDt ? stuffSearch.schToDt : dayjs(new Date()).format('YYYY-MM-DD'))
|
setEndDate(stuffSearch?.schToDt ? stuffSearch.schToDt : dayjs(new Date()).format('YYYY-MM-DD'))
|
||||||
@ -735,6 +803,7 @@ export default function StuffSearchCondition() {
|
|||||||
stuffSearch.schSelSaleStoreId = ''
|
stuffSearch.schSelSaleStoreId = ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stuffSearch.schDateType === 'R') {
|
if (stuffSearch.schDateType === 'R') {
|
||||||
setDateType('R')
|
setDateType('R')
|
||||||
@ -802,10 +871,12 @@ export default function StuffSearchCondition() {
|
|||||||
if (e.target.checked) {
|
if (e.target.checked) {
|
||||||
stuffSearch.schMyDataCheck = e.target.value
|
stuffSearch.schMyDataCheck = e.target.value
|
||||||
setMyDataCheck(true)
|
setMyDataCheck(true)
|
||||||
|
|
||||||
if (otherSaleStoreList.length > 1) {
|
if (otherSaleStoreList.length > 1) {
|
||||||
stuffSearch.schSelSaleStoreId = otherSaleStoreId
|
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||||
stuffSearch.schOtherSelSaleStoreId = ''
|
setOtherSaleStoreId(session.storeId)
|
||||||
|
} else {
|
||||||
|
stuffSearch.schSelSaleStoreId = ''
|
||||||
|
stuffSearch.schOtherSelSaleStoreId = session.storeId
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
setMyDataCheck(false)
|
setMyDataCheck(false)
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export function useCanvasPopupStatusController(param = 1) {
|
|||||||
const { getFetcher, postFetcher } = useAxios()
|
const { getFetcher, postFetcher } = useAxios()
|
||||||
|
|
||||||
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
const currentCanvasPlan = useRecoilValue(currentCanvasPlanState)
|
||||||
console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan)
|
// console.log('🚀 ~ Orientation ~ currentCanvasPlan:', currentCanvasPlan)
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: popupStatus,
|
data: popupStatus,
|
||||||
@ -30,7 +30,7 @@ export function useCanvasPopupStatusController(param = 1) {
|
|||||||
)
|
)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('🚀 ~ useEffect ~ popupStatus:', popupStatus)
|
// console.log('🚀 ~ useEffect ~ popupStatus:', popupStatus)
|
||||||
if (popupStatus) {
|
if (popupStatus) {
|
||||||
switch (parseInt(popupStatus?.popupType)) {
|
switch (parseInt(popupStatus?.popupType)) {
|
||||||
case 1:
|
case 1:
|
||||||
|
|||||||
@ -73,6 +73,7 @@ export function useModuleBasicSetting() {
|
|||||||
|
|
||||||
const makeModuleInstArea = () => {
|
const makeModuleInstArea = () => {
|
||||||
//지붕 객체 반환
|
//지붕 객체 반환
|
||||||
|
|
||||||
const roofs = canvas.getObjects().filter((obj) => obj.name === 'roof')
|
const roofs = canvas.getObjects().filter((obj) => obj.name === 'roof')
|
||||||
let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : -20
|
let offsetLength = canvasSetting.roofSizeSet === 3 ? -90 : -20
|
||||||
|
|
||||||
@ -80,6 +81,50 @@ export function useModuleBasicSetting() {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const batchObjects = canvas
|
||||||
|
?.getObjects()
|
||||||
|
.filter(
|
||||||
|
(obj) =>
|
||||||
|
obj.name === BATCH_TYPE.OPENING ||
|
||||||
|
obj.name === BATCH_TYPE.SHADOW ||
|
||||||
|
obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
|
||||||
|
obj.name === BATCH_TYPE.PENTAGON_DORMER,
|
||||||
|
) //도머s 객체
|
||||||
|
|
||||||
|
//도머도 외곽을 따야한다
|
||||||
|
|
||||||
|
const batchObjectOptions = {
|
||||||
|
stroke: 'red',
|
||||||
|
fill: 'transparent',
|
||||||
|
strokeDashArray: [10, 4],
|
||||||
|
strokeWidth: 1,
|
||||||
|
lockMovementX: true,
|
||||||
|
lockMovementY: true,
|
||||||
|
lockRotation: true,
|
||||||
|
lockScalingX: true,
|
||||||
|
lockScalingY: true,
|
||||||
|
selectable: true,
|
||||||
|
name: POLYGON_TYPE.OBJECT_SURFACE,
|
||||||
|
originX: 'center',
|
||||||
|
originY: 'center',
|
||||||
|
}
|
||||||
|
|
||||||
|
batchObjects.forEach((obj) => {
|
||||||
|
if (obj.name === BATCH_TYPE.TRIANGLE_DORMER || obj.name === BATCH_TYPE.PENTAGON_DORMER) {
|
||||||
|
const groupPoints = obj.groupPoints
|
||||||
|
const offsetObjects = offsetPolygon(groupPoints, 10)
|
||||||
|
const dormerOffset = new QPolygon(offsetObjects, batchObjectOptions)
|
||||||
|
dormerOffset.setViewLengthText(false)
|
||||||
|
canvas.add(dormerOffset) //모듈설치면 만들기
|
||||||
|
} else {
|
||||||
|
const points = obj.points
|
||||||
|
const offsetObjects = offsetPolygon(points, 10)
|
||||||
|
const offset = new QPolygon(offsetObjects, batchObjectOptions)
|
||||||
|
offset.setViewLengthText(false)
|
||||||
|
canvas.add(offset) //모듈설치면 만들기
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
roofs.forEach((roof) => {
|
roofs.forEach((roof) => {
|
||||||
const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id)
|
const isExistSurface = canvas.getObjects().find((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && obj.parentId === roof.id)
|
||||||
if (isExistSurface) {
|
if (isExistSurface) {
|
||||||
@ -190,15 +235,7 @@ export function useModuleBasicSetting() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
|
const moduleSetupSurfaces = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE) //모듈설치면를 가져옴
|
||||||
const batchObjects = canvas
|
const batchObjects = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.OBJECT_SURFACE) //도머s 객체
|
||||||
?.getObjects()
|
|
||||||
.filter(
|
|
||||||
(obj) =>
|
|
||||||
obj.name === BATCH_TYPE.OPENING ||
|
|
||||||
obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
|
|
||||||
obj.name === BATCH_TYPE.PENTAGON_DORMER ||
|
|
||||||
obj.name === BATCH_TYPE.SHADOW,
|
|
||||||
) //도머s 객체
|
|
||||||
|
|
||||||
const moduleOptions = {
|
const moduleOptions = {
|
||||||
fill: checkedModule[0].color,
|
fill: checkedModule[0].color,
|
||||||
@ -449,17 +486,7 @@ export function useModuleBasicSetting() {
|
|||||||
//도머 객체를 가져옴
|
//도머 객체를 가져옴
|
||||||
if (batchObjects) {
|
if (batchObjects) {
|
||||||
batchObjects.forEach((object) => {
|
batchObjects.forEach((object) => {
|
||||||
let dormerTurfPolygon
|
let dormerTurfPolygon = polygonToTurfPolygon(object, true)
|
||||||
|
|
||||||
if (object.type === 'group') {
|
|
||||||
//도머는 그룹형태임
|
|
||||||
dormerTurfPolygon = batchObjectGroupToTurfPolygon(object)
|
|
||||||
} else {
|
|
||||||
//개구, 그림자
|
|
||||||
object.set({ points: rectToPolygon(object) })
|
|
||||||
dormerTurfPolygon = polygonToTurfPolygon(object)
|
|
||||||
}
|
|
||||||
|
|
||||||
const intersection = turf.intersect(turf.featureCollection([dormerTurfPolygon, tempTurfModule])) //겹치는지 확인
|
const intersection = turf.intersect(turf.featureCollection([dormerTurfPolygon, tempTurfModule])) //겹치는지 확인
|
||||||
//겹치면 안됨
|
//겹치면 안됨
|
||||||
if (intersection) {
|
if (intersection) {
|
||||||
@ -520,15 +547,7 @@ export function useModuleBasicSetting() {
|
|||||||
?.getObjects()
|
?.getObjects()
|
||||||
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && !moduleSetupSurfaces.includes(obj)) //설치면이 아닌것
|
.filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE && !moduleSetupSurfaces.includes(obj)) //설치면이 아닌것
|
||||||
|
|
||||||
const batchObjects = canvas
|
const batchObjects = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.OBJECT_SURFACE) //도머s 객체
|
||||||
?.getObjects()
|
|
||||||
.filter(
|
|
||||||
(obj) =>
|
|
||||||
obj.name === BATCH_TYPE.OPENING ||
|
|
||||||
obj.name === BATCH_TYPE.TRIANGLE_DORMER ||
|
|
||||||
obj.name === BATCH_TYPE.PENTAGON_DORMER ||
|
|
||||||
obj.name === BATCH_TYPE.SHADOW,
|
|
||||||
) //도머s 객체
|
|
||||||
|
|
||||||
if (moduleSetupSurfaces.length === 0) {
|
if (moduleSetupSurfaces.length === 0) {
|
||||||
swalFire({ text: getMessage('module.place.no.surface') })
|
swalFire({ text: getMessage('module.place.no.surface') })
|
||||||
@ -582,18 +601,7 @@ export function useModuleBasicSetting() {
|
|||||||
const objectsIncludeSurface = (turfModuleSetupSurface) => {
|
const objectsIncludeSurface = (turfModuleSetupSurface) => {
|
||||||
let containsBatchObjects = []
|
let containsBatchObjects = []
|
||||||
containsBatchObjects = batchObjects.filter((batchObject) => {
|
containsBatchObjects = batchObjects.filter((batchObject) => {
|
||||||
let convertBatchObject
|
let convertBatchObject = polygonToTurfPolygon(batchObject)
|
||||||
|
|
||||||
if (batchObject.type === 'group') {
|
|
||||||
//도머는 그룹형태임
|
|
||||||
convertBatchObject = batchObjectGroupToTurfPolygon(batchObject)
|
|
||||||
} else {
|
|
||||||
//개구, 그림자
|
|
||||||
batchObject.set({ points: rectToPolygon(batchObject) })
|
|
||||||
canvas?.renderAll() // set된걸 바로 적용하기 위해
|
|
||||||
convertBatchObject = polygonToTurfPolygon(batchObject) //rect를 폴리곤으로 변환 -> turf 폴리곤으로 변환
|
|
||||||
}
|
|
||||||
|
|
||||||
// 폴리곤 안에 도머 폴리곤이 포함되어있는지 확인해서 반환하는 로직
|
// 폴리곤 안에 도머 폴리곤이 포함되어있는지 확인해서 반환하는 로직
|
||||||
return turf.booleanContains(turfModuleSetupSurface, convertBatchObject) || turf.booleanWithin(convertBatchObject, turfModuleSetupSurface)
|
return turf.booleanContains(turfModuleSetupSurface, convertBatchObject) || turf.booleanWithin(convertBatchObject, turfModuleSetupSurface)
|
||||||
})
|
})
|
||||||
@ -1309,13 +1317,13 @@ export function useModuleBasicSetting() {
|
|||||||
const pointX2 = coords[2].x + ((coords[2].y - top) / (coords[2].y - coords[1].y)) * (coords[1].x - coords[2].x)
|
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 pointY2 = top
|
||||||
|
|
||||||
const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
// const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||||
stroke: 'red',
|
// stroke: 'red',
|
||||||
strokeWidth: 1,
|
// strokeWidth: 1,
|
||||||
selectable: true,
|
// selectable: true,
|
||||||
})
|
// })
|
||||||
canvas?.add(finalLine)
|
// canvas?.add(finalLine)
|
||||||
canvas?.renderAll()
|
// canvas?.renderAll()
|
||||||
|
|
||||||
let rtnObj
|
let rtnObj
|
||||||
//평평하면
|
//평평하면
|
||||||
@ -1432,13 +1440,13 @@ export function useModuleBasicSetting() {
|
|||||||
const pointX2 = top
|
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 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], {
|
// const finalLine = new QLine([pointX1, pointY1, pointX2, pointY2], {
|
||||||
stroke: 'red',
|
// stroke: 'red',
|
||||||
strokeWidth: 1,
|
// strokeWidth: 1,
|
||||||
selectable: true,
|
// selectable: true,
|
||||||
})
|
// })
|
||||||
canvas?.add(finalLine)
|
// canvas?.add(finalLine)
|
||||||
canvas?.renderAll()
|
// canvas?.renderAll()
|
||||||
|
|
||||||
let rtnObj
|
let rtnObj
|
||||||
//평평하면
|
//평평하면
|
||||||
|
|||||||
@ -28,7 +28,7 @@ export function useModulePlace() {
|
|||||||
roofBaseCd: item.trestle.roofBaseCd,
|
roofBaseCd: item.trestle.roofBaseCd,
|
||||||
constTp: item.construction.constTp,
|
constTp: item.construction.constTp,
|
||||||
mixMatlNo: selectedModules.mixMatlNo,
|
mixMatlNo: selectedModules.mixMatlNo,
|
||||||
roofPitch: selectedModules.roofPchBase ? selectedModules.roofPchBase : null,
|
roofPitch: item.addRoof.roofPchBase ? item.addRoof.roofPchBase : null,
|
||||||
inclCd: String(item.addRoof.pitch),
|
inclCd: String(item.addRoof.pitch),
|
||||||
roofIndex: item.addRoof.index,
|
roofIndex: item.addRoof.index,
|
||||||
workingWidth: item.addRoof.lenBase,
|
workingWidth: item.addRoof.lenBase,
|
||||||
|
|||||||
@ -4,7 +4,7 @@ import { GlobalDataContext } from '@/app/GlobalDataProvider'
|
|||||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
import { useCommonCode } from '@/hooks/common/useCommonCode'
|
||||||
|
|
||||||
import { selectedModuleState, moduleSelectionInitParamsState } from '@/store/selectedModuleOptions'
|
import { selectedModuleState, moduleSelectionInitParamsState, moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||||
|
|
||||||
export function useModuleSelection(props) {
|
export function useModuleSelection(props) {
|
||||||
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
const { managementState, setManagementState, managementStateLoaded } = useContext(GlobalDataContext)
|
||||||
@ -13,30 +13,38 @@ export function useModuleSelection(props) {
|
|||||||
const [windSpeedCodes, setWindSpeedCodes] = useState([]) //기준풍속 목록
|
const [windSpeedCodes, setWindSpeedCodes] = useState([]) //기준풍속 목록
|
||||||
const [moduleList, setModuleList] = useState([{}]) //모듈 목록
|
const [moduleList, setModuleList] = useState([{}]) //모듈 목록
|
||||||
|
|
||||||
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈
|
|
||||||
const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도
|
const [selectedSurfaceType, setSelectedSurfaceType] = useState({}) //선택된 면조도
|
||||||
const [installHeight, setInstallHeight] = useState(managementState?.installHeight) //설치 높이
|
const [installHeight, setInstallHeight] = useState() //설치 높이
|
||||||
const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속
|
const [standardWindSpeed, setStandardWindSpeed] = useState({}) //기준풍속
|
||||||
const [verticalSnowCover, setVerticalSnowCover] = useState(managementState?.verticalSnowCover) //수직적설량
|
const [verticalSnowCover, setVerticalSnowCover] = useState() //수직적설량
|
||||||
|
|
||||||
|
const [selectedModules, setSelectedModules] = useRecoilState(selectedModuleState) //선택된 모듈
|
||||||
const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등
|
const [moduleSelectionInitParams, setModuleSelectionInitParams] = useRecoilState(moduleSelectionInitParamsState) //모듈 기본 데이터 ex) 면조도, 높이등등
|
||||||
|
|
||||||
const { getModuleTypeItemList } = useMasterController()
|
const { getModuleTypeItemList } = useMasterController()
|
||||||
|
|
||||||
const { findCommonCode } = useCommonCode()
|
const { findCommonCode } = useCommonCode()
|
||||||
|
|
||||||
//탭별 파라메터 초기화
|
const bindInitData = () => {
|
||||||
useEffect(() => {
|
|
||||||
setInstallHeight(managementState?.installHeight)
|
setInstallHeight(managementState?.installHeight)
|
||||||
setStandardWindSpeed(managementState?.standardWindSpeedId)
|
setStandardWindSpeed(managementState?.standardWindSpeedId)
|
||||||
setVerticalSnowCover(managementState?.verticalSnowCover)
|
setVerticalSnowCover(managementState?.verticalSnowCover)
|
||||||
setSelectedSurfaceType(managementState?.surfaceType)
|
setSelectedSurfaceType(managementState?.surfaceType)
|
||||||
|
}
|
||||||
|
|
||||||
|
//탭별 파라메터 초기화
|
||||||
|
useEffect(() => {
|
||||||
|
bindInitData()
|
||||||
const initParams = {
|
const initParams = {
|
||||||
illuminationTp: managementState?.surfaceTypeValue, //면조도
|
illuminationTp: managementState?.surfaceTypeValue, //면조도
|
||||||
instHt: managementState?.installHeight, //설치높이
|
instHt: managementState?.installHeight, //설치높이
|
||||||
stdWindSpeed: managementState?.standardWindSpeedId, //기준풍속
|
stdWindSpeed: managementState?.standardWindSpeedId, //기준풍속
|
||||||
stdSnowLd: managementState?.verticalSnowCover, //기준적설량
|
stdSnowLd: managementState?.verticalSnowCover, //기준적설량
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (selectedModules) {
|
||||||
|
initParams.moduleTpCd = selectedModules.itemTp
|
||||||
|
initParams.moduleItemId = selectedModules.itemId
|
||||||
|
}
|
||||||
|
|
||||||
setModuleSelectionInitParams(initParams)
|
setModuleSelectionInitParams(initParams)
|
||||||
}, [managementState])
|
}, [managementState])
|
||||||
|
|
||||||
@ -65,8 +73,10 @@ export function useModuleSelection(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//새로고침시 데이터 날아가는거 방지
|
//새로고침시 데이터 날아가는거 방지
|
||||||
if (!managementState) {
|
if (managementState === null) {
|
||||||
setManagementState(managementStateLoaded)
|
setManagementState(managementStateLoaded)
|
||||||
|
} else {
|
||||||
|
bindInitData()
|
||||||
}
|
}
|
||||||
|
|
||||||
getModuleData(roofsIds)
|
getModuleData(roofsIds)
|
||||||
@ -101,12 +111,23 @@ export function useModuleSelection(props) {
|
|||||||
...moduleSelectionInitParams,
|
...moduleSelectionInitParams,
|
||||||
illuminationTp: option.clCode,
|
illuminationTp: option.clCode,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
setManagementState({
|
||||||
|
...managementState,
|
||||||
|
surfaceType: option.clCodeNm,
|
||||||
|
surfaceTypeValue: option.clCode,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeWindSpeed = (option) => {
|
const handleChangeWindSpeed = (option) => {
|
||||||
setModuleSelectionInitParams({
|
setModuleSelectionInitParams({
|
||||||
...moduleSelectionInitParams,
|
...moduleSelectionInitParams,
|
||||||
surfaceType: option.clCode,
|
stdWindSpeed: option.clCode,
|
||||||
|
})
|
||||||
|
|
||||||
|
setManagementState({
|
||||||
|
...managementState,
|
||||||
|
standardWindSpeedId: option.clCode,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,15 +137,24 @@ export function useModuleSelection(props) {
|
|||||||
...moduleSelectionInitParams,
|
...moduleSelectionInitParams,
|
||||||
instHt: option,
|
instHt: option,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
setManagementState({
|
||||||
|
...managementState,
|
||||||
|
installHeight: option,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const handleChangeVerticalSnowCover = (option) => {
|
const handleChangeVerticalSnowCover = (option) => {
|
||||||
setVerticalSnowCover(option)
|
setVerticalSnowCover(option)
|
||||||
|
|
||||||
setModuleSelectionInitParams({
|
setModuleSelectionInitParams({
|
||||||
...moduleSelectionInitParams,
|
...moduleSelectionInitParams,
|
||||||
stdSnowLd: option,
|
stdSnowLd: option,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
setManagementState({
|
||||||
|
...managementState,
|
||||||
|
verticalSnowCover: option,
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -93,7 +93,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
if (!selectedSurface) {
|
if (!selectedSurface) {
|
||||||
swalFire({ text: '지붕안에 그려야해요', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' })
|
||||||
initEvent() //이벤트 초기화
|
initEvent() //이벤트 초기화
|
||||||
if (setIsHidden) setIsHidden(false)
|
if (setIsHidden) setIsHidden(false)
|
||||||
return
|
return
|
||||||
@ -150,7 +150,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
|
|
||||||
//지붕 밖으로 그렸을때
|
//지붕 밖으로 그렸을때
|
||||||
if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) {
|
if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) {
|
||||||
swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' })
|
||||||
//일단 지워
|
//일단 지워
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
@ -162,14 +162,14 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon))
|
const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon))
|
||||||
|
|
||||||
if (isCross) {
|
if (isCross) {
|
||||||
swalFire({ text: '겹치기 불가요...', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.notinstall.cross'), icon: 'error' })
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isDown = false
|
isDown = false
|
||||||
rect.set({ name: objName, parentId: selectedSurface.id })
|
rect.set({ name: objName, parentId: selectedSurface.id, points: rectToPolygon(rect) })
|
||||||
rect.setCoords()
|
rect.setCoords()
|
||||||
initEvent()
|
initEvent()
|
||||||
|
|
||||||
@ -232,7 +232,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
|
|
||||||
//지붕 밖으로 그렸을때
|
//지붕 밖으로 그렸을때
|
||||||
if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) {
|
if (!turf.booleanWithin(rectPolygon, selectedSurfacePolygon)) {
|
||||||
swalFire({ text: '개구를 배치할 수 없습니다.', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' })
|
||||||
//일단 지워
|
//일단 지워
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
@ -244,14 +244,14 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon))
|
const isCross = preObjectsArray.some((object) => turf.booleanOverlap(pointsToTurfPolygon(object), rectPolygon))
|
||||||
|
|
||||||
if (isCross) {
|
if (isCross) {
|
||||||
swalFire({ text: '겹치기 불가요...', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.notinstall.cross'), icon: 'error' })
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
isDown = false
|
isDown = false
|
||||||
rect.set({ name: objName, parentId: selectedSurface.id })
|
rect.set({ name: objName, parentId: selectedSurface.id, points: rectToPolygon(rect) })
|
||||||
rect.setCoords()
|
rect.setCoords()
|
||||||
initEvent()
|
initEvent()
|
||||||
if (setIsHidden) setIsHidden(false)
|
if (setIsHidden) setIsHidden(false)
|
||||||
@ -377,12 +377,9 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer))
|
const trianglePolygon = pointsToTurfPolygon(triangleToPolygon(dormer))
|
||||||
const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface)
|
const selectedSurfacePolygon = polygonToTurfPolygon(selectedSurface)
|
||||||
|
|
||||||
console.log('trianglePolygon', trianglePolygon)
|
|
||||||
console.log('selectedSurfacePolygon', selectedSurfacePolygon)
|
|
||||||
|
|
||||||
//지붕 밖으로 그렸을때
|
//지붕 밖으로 그렸을때
|
||||||
if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) {
|
if (!turf.booleanWithin(trianglePolygon, selectedSurfacePolygon)) {
|
||||||
swalFire({ text: '도머를 배치할 수 없습니다.', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' })
|
||||||
//일단 지워
|
//일단 지워
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
@ -406,6 +403,8 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
direction = 'north'
|
direction = 'north'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const groupPoints = offsetRef > 0 ? triangleToPolygon(dormerOffset) : triangleToPolygon(dormer)
|
||||||
|
|
||||||
let splitedTriangle = offsetRef > 0 ? splitDormerTriangle(dormerOffset, directionRef) : splitDormerTriangle(dormer, directionRef)
|
let splitedTriangle = offsetRef > 0 ? splitDormerTriangle(dormerOffset, directionRef) : splitDormerTriangle(dormer, directionRef)
|
||||||
canvas?.remove(offsetRef > 0 ? dormerOffset : dormer)
|
canvas?.remove(offsetRef > 0 ? dormerOffset : dormer)
|
||||||
|
|
||||||
@ -499,6 +498,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
parentId: selectedSurface.id,
|
parentId: selectedSurface.id,
|
||||||
originX: 'center',
|
originX: 'center',
|
||||||
originY: 'center',
|
originY: 'center',
|
||||||
|
groupPoints: groupPoints,
|
||||||
})
|
})
|
||||||
canvas?.add(objectGroup)
|
canvas?.add(objectGroup)
|
||||||
|
|
||||||
@ -604,7 +604,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
|
|
||||||
//지붕 밖으로 그렸을때
|
//지붕 밖으로 그렸을때
|
||||||
if (!turf.booleanWithin(pentagonPolygon, selectedSurfacePolygon)) {
|
if (!turf.booleanWithin(pentagonPolygon, selectedSurfacePolygon)) {
|
||||||
swalFire({ text: '도머를 배치할 수 없습니다.', icon: 'error' })
|
swalFire({ text: getMessage('batch.object.outside.roof'), icon: 'error' })
|
||||||
//일단 지워
|
//일단 지워
|
||||||
deleteTempObjects()
|
deleteTempObjects()
|
||||||
return
|
return
|
||||||
@ -708,6 +708,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const groupPolygon = offsetPolygon ? [leftPentagon, rightPentagon, offsetPolygon] : [leftPentagon, rightPentagon]
|
const groupPolygon = offsetPolygon ? [leftPentagon, rightPentagon, offsetPolygon] : [leftPentagon, rightPentagon]
|
||||||
|
const groupPoints = offsetRef > 0 ? pentagonOffsetPoints : pentagonPoints
|
||||||
|
|
||||||
const objectGroup = new fabric.Group(groupPolygon, {
|
const objectGroup = new fabric.Group(groupPolygon, {
|
||||||
subTargetCheck: true,
|
subTargetCheck: true,
|
||||||
@ -717,6 +718,7 @@ export function useObjectBatch({ isHidden, setIsHidden }) {
|
|||||||
groupYn: true,
|
groupYn: true,
|
||||||
originX: 'center',
|
originX: 'center',
|
||||||
originY: 'center',
|
originY: 'center',
|
||||||
|
groupPoints: groupPoints,
|
||||||
})
|
})
|
||||||
canvas?.add(objectGroup)
|
canvas?.add(objectGroup)
|
||||||
|
|
||||||
|
|||||||
@ -311,7 +311,7 @@
|
|||||||
"plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?",
|
"plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?",
|
||||||
"plan.message.save": "저장되었습니다.",
|
"plan.message.save": "저장되었습니다.",
|
||||||
"plan.message.delete": "삭제되었습니다.",
|
"plan.message.delete": "삭제되었습니다.",
|
||||||
"plan.message.leave": "작성한 물건을 저장하시겠습니까? [아니오]를 선택한 경우, 저장하지 않고 물건현황 목록으로 이동합니다.",
|
"plan.message.leave": "물건현황(목록)으로 이동하시겠습니까? [예]를 선택한 경우, 저장하고 이동합니다.",
|
||||||
"plan.message.confirm.yes": "예",
|
"plan.message.confirm.yes": "예",
|
||||||
"plan.message.confirm.no": "아니오",
|
"plan.message.confirm.no": "아니오",
|
||||||
"setting": "設定",
|
"setting": "設定",
|
||||||
|
|||||||
@ -95,6 +95,7 @@
|
|||||||
"modal.module.basic.setting.module.construction.method": "공법",
|
"modal.module.basic.setting.module.construction.method": "공법",
|
||||||
"modal.module.basic.setting.module.under.roof": "지붕밑바탕",
|
"modal.module.basic.setting.module.under.roof": "지붕밑바탕",
|
||||||
"modal.module.basic.setting.module.setting": "모듈 선택",
|
"modal.module.basic.setting.module.setting": "모듈 선택",
|
||||||
|
"modal.module.basic.setting.module.hajebichi": "망둥어 피치",
|
||||||
"modal.module.basic.setting.module.setting.info1": "※ 구배의 범위에는 제한이 있습니다. 지붕경사가 2.5치 미만, 10치를 초과하는 경우에는 시공이 가능한지 시공 매뉴얼을 확인해주십시오.",
|
"modal.module.basic.setting.module.setting.info1": "※ 구배의 범위에는 제한이 있습니다. 지붕경사가 2.5치 미만, 10치를 초과하는 경우에는 시공이 가능한지 시공 매뉴얼을 확인해주십시오.",
|
||||||
"modal.module.basic.setting.module.setting.info2": "※ 모듈 배치 시에는 시공 매뉴얼에 기재된 <모듈 배치 조건>을 반드시 확인해주십시오.",
|
"modal.module.basic.setting.module.setting.info2": "※ 모듈 배치 시에는 시공 매뉴얼에 기재된 <모듈 배치 조건>을 반드시 확인해주십시오.",
|
||||||
"modal.module.basic.setting.module.stuff.info": "물건정보",
|
"modal.module.basic.setting.module.stuff.info": "물건정보",
|
||||||
@ -311,7 +312,7 @@
|
|||||||
"plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?",
|
"plan.message.confirm.delete": "PLAN을 삭제하시겠습니까?",
|
||||||
"plan.message.save": "저장되었습니다.",
|
"plan.message.save": "저장되었습니다.",
|
||||||
"plan.message.delete": "삭제되었습니다.",
|
"plan.message.delete": "삭제되었습니다.",
|
||||||
"plan.message.leave": "작성한 물건을 저장하시겠습니까? [아니오]를 선택한 경우, 저장하지 않고 물건현황 목록으로 이동합니다.",
|
"plan.message.leave": "물건현황(목록)으로 이동하시겠습니까? [예]를 선택한 경우, 저장하고 이동합니다.",
|
||||||
"plan.message.corfirm.yes": "예",
|
"plan.message.corfirm.yes": "예",
|
||||||
"plan.message.confirm.no": "아니오",
|
"plan.message.confirm.no": "아니오",
|
||||||
"setting": "설정",
|
"setting": "설정",
|
||||||
@ -992,5 +993,9 @@
|
|||||||
"module.place.select.module": "모듈을 선택해주세요.",
|
"module.place.select.module": "모듈을 선택해주세요.",
|
||||||
"module.place.select.one.module": "모듈은 하나만 선택해주세요.",
|
"module.place.select.one.module": "모듈은 하나만 선택해주세요.",
|
||||||
"batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?",
|
"batch.canvas.delete.all": "배치면 내용을 전부 삭제하시겠습니까?",
|
||||||
"menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다."
|
"module.not.found": "설치 모듈을 선택하세요.",
|
||||||
|
"construction.length.difference": "지붕면 공법을 전부 선택해주세요.",
|
||||||
|
"menu.validation.canvas.roof": "패널을 배치하려면 지붕면을 입력해야 합니다.",
|
||||||
|
"batch.object.outside.roof": "오브젝트는 지붕내에 설치해야 합니다.",
|
||||||
|
"batch.object.notinstall.cross": "오브젝트는 겹쳐서 설치 할 수 없습니다."
|
||||||
}
|
}
|
||||||
|
|||||||
@ -81,6 +81,7 @@ export const moduleSelectionDataState = atom({
|
|||||||
key: 'moduleSelectionDataState',
|
key: 'moduleSelectionDataState',
|
||||||
default: {
|
default: {
|
||||||
common: {},
|
common: {},
|
||||||
|
module: {},
|
||||||
roofConstructions: [],
|
roofConstructions: [],
|
||||||
},
|
},
|
||||||
dangerouslyAllowMutability: true,
|
dangerouslyAllowMutability: true,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user