Merge branch 'dev' into feature/test-jy
This commit is contained in:
commit
416beb1eb1
34
src/app/floor-plan/EventProvider.js
Normal file
34
src/app/floor-plan/EventProvider.js
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
|
import { createContext, useState } from 'react'
|
||||||
|
|
||||||
|
export const EventContext = createContext({})
|
||||||
|
|
||||||
|
const EventProvider = ({ children }) => {
|
||||||
|
const {
|
||||||
|
addDocumentEventListener,
|
||||||
|
addCanvasMouseEventListener,
|
||||||
|
addTargetMouseEventListener,
|
||||||
|
removeAllMouseEventListeners,
|
||||||
|
removeAllDocumentEventListeners,
|
||||||
|
removeDocumentEvent,
|
||||||
|
removeMouseEvent,
|
||||||
|
removeMouseLine,
|
||||||
|
initEvent,
|
||||||
|
} = useEvent()
|
||||||
|
|
||||||
|
const [value, setValue] = useState({
|
||||||
|
addDocumentEventListener,
|
||||||
|
addCanvasMouseEventListener,
|
||||||
|
addTargetMouseEventListener,
|
||||||
|
removeAllMouseEventListeners,
|
||||||
|
removeAllDocumentEventListeners,
|
||||||
|
removeDocumentEvent,
|
||||||
|
removeMouseEvent,
|
||||||
|
removeMouseLine,
|
||||||
|
initEvent,
|
||||||
|
})
|
||||||
|
|
||||||
|
return <EventContext.Provider value={value}>{children}</EventContext.Provider>
|
||||||
|
}
|
||||||
|
|
||||||
|
export default EventProvider
|
||||||
@ -3,17 +3,20 @@
|
|||||||
import FloorPlanProvider from './FloorPlanProvider'
|
import FloorPlanProvider from './FloorPlanProvider'
|
||||||
import FloorPlan from '@/components/floor-plan/FloorPlan'
|
import FloorPlan from '@/components/floor-plan/FloorPlan'
|
||||||
import CanvasLayout from '@/components/floor-plan/CanvasLayout'
|
import CanvasLayout from '@/components/floor-plan/CanvasLayout'
|
||||||
|
import EventProvider from './EventProvider'
|
||||||
|
|
||||||
export default function FloorPlanLayout({ children }) {
|
export default function FloorPlanLayout({ children }) {
|
||||||
console.log('🚀 ~ FloorPlanLayout ~ FloorPlanLayout:')
|
console.log('🚀 ~ FloorPlanLayout ~ FloorPlanLayout:')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<FloorPlanProvider>
|
<EventProvider>
|
||||||
<FloorPlan>
|
<FloorPlanProvider>
|
||||||
<CanvasLayout>{children}</CanvasLayout>
|
<FloorPlan>
|
||||||
</FloorPlan>
|
<CanvasLayout>{children}</CanvasLayout>
|
||||||
</FloorPlanProvider>
|
</FloorPlan>
|
||||||
|
</FloorPlanProvider>
|
||||||
|
</EventProvider>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
import '@/styles/contents.scss'
|
import '@/styles/contents.scss'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { contextMenuListState, contextMenuState } from '@/store/contextMenu'
|
import { contextMenuListState, contextMenuState } from '@/store/contextMenu'
|
||||||
import { useTempGrid } from '@/hooks/useTempGrid'
|
import { useTempGrid } from '@/hooks/useTempGrid'
|
||||||
import { useContextMenu } from '@/hooks/useContextMenu'
|
import { useContextMenu } from '@/hooks/useContextMenu'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function QContextMenu(props) {
|
export default function QContextMenu(props) {
|
||||||
const { contextRef, canvasProps } = props
|
const { contextRef, canvasProps } = props
|
||||||
@ -14,7 +15,8 @@ export default function QContextMenu(props) {
|
|||||||
const activeObject = canvasProps?.getActiveObject() //액티브된 객체를 가져옴
|
const activeObject = canvasProps?.getActiveObject() //액티브된 객체를 가져옴
|
||||||
const { tempGridMode, setTempGridMode } = useTempGrid()
|
const { tempGridMode, setTempGridMode } = useTempGrid()
|
||||||
const { handleKeyup } = useContextMenu()
|
const { handleKeyup } = useContextMenu()
|
||||||
const { addDocumentEventListener, removeDocumentEvent } = useEvent()
|
// const { addDocumentEventListener, removeDocumentEvent } = useEvent()
|
||||||
|
const { addDocumentEventListener, removeDocumentEvent } = useContext(EventContext)
|
||||||
|
|
||||||
let contextType = ''
|
let contextType = ''
|
||||||
|
|
||||||
|
|||||||
@ -54,23 +54,6 @@ export default function FontSetting(props) {
|
|||||||
{ id: 'gold', name: getMessage('color.gold'), value: 'gold' },
|
{ id: 'gold', name: getMessage('color.gold'), value: 'gold' },
|
||||||
{ id: 'darkblue', name: getMessage('color.darkblue'), value: 'darkblue' },
|
{ id: 'darkblue', name: getMessage('color.darkblue'), value: 'darkblue' },
|
||||||
]
|
]
|
||||||
useEffect(() => {
|
|
||||||
if (font.fontFamily) {
|
|
||||||
setSelectedFont(fonts.filter((data) => data.value === font.fontFamily)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font.fontWeight) {
|
|
||||||
setSelectedFontWeight(fontOptions.filter((data) => data.value === font.fontWeight)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font.fontSize) {
|
|
||||||
setSelectedFontSize(fontSizes.filter((data) => data.value === font.fontSize)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (font.fontColor) {
|
|
||||||
setSelectedFontColor(fontColors.filter((data) => data.value === font.fontColor)[0])
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
const handleSaveBtn = () => {
|
const handleSaveBtn = () => {
|
||||||
onSave({
|
onSave({
|
||||||
@ -131,10 +114,10 @@ export default function FontSetting(props) {
|
|||||||
<div className="font-ex-box">
|
<div className="font-ex-box">
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
fontFamily: selectedFont?.value ?? '',
|
fontFamily: selectedFont?.value ?? 'MS PGothic',
|
||||||
fontWeight: selectedFontWeight?.value?.toLowerCase().includes('bold') ? 'bold' : 'normal',
|
fontWeight: selectedFontWeight?.value?.toLowerCase().includes('bold') ? 'bold' : 'normal',
|
||||||
fontStyle: selectedFontWeight?.value?.toLowerCase().includes('italic') ? 'italic' : 'normal',
|
fontStyle: selectedFontWeight?.value?.toLowerCase().includes('italic') ? 'italic' : 'normal',
|
||||||
fontSize: selectedFontSize?.value ?? '12px',
|
fontSize: selectedFontSize?.value ?? 16,
|
||||||
color: selectedFontColor?.value ?? 'black',
|
color: selectedFontColor?.value ?? 'black',
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -20,6 +20,7 @@ import ProductFeaturesPop from './popup/ProductFeaturesPop'
|
|||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
|
||||||
export default function Estimate({ params }) {
|
export default function Estimate({ params }) {
|
||||||
|
const [handlePricingFlag, setHandlePricingFlag] = useState(false)
|
||||||
const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false)
|
const [specialNoteFirstFlg, setSpecialNoteFirstFlg] = useState(false)
|
||||||
const fixedKey = 'itemKey'
|
const fixedKey = 'itemKey'
|
||||||
const [itemChangeYn, setItemChangeYn] = useState(false)
|
const [itemChangeYn, setItemChangeYn] = useState(false)
|
||||||
@ -63,6 +64,7 @@ export default function Estimate({ params }) {
|
|||||||
|
|
||||||
//견적특이사항 List
|
//견적특이사항 List
|
||||||
const [specialNoteList, setSpecialNoteList] = useState([])
|
const [specialNoteList, setSpecialNoteList] = useState([])
|
||||||
|
const [popShowSpecialNoteList, setPopShowSpecialNoteList] = useState([])
|
||||||
|
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { get, promisePost } = useAxios(globalLocaleState)
|
const { get, promisePost } = useAxios(globalLocaleState)
|
||||||
@ -98,22 +100,40 @@ export default function Estimate({ params }) {
|
|||||||
setDisplayItemList(res)
|
setDisplayItemList(res)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
//견적특이사항 API호출
|
||||||
|
//여러개 선택하면 구분자로 (、)
|
||||||
|
//제품영역 팝업용
|
||||||
|
let url = '/api/estimate/special-note-list'
|
||||||
|
get({ url: url }).then((res) => {
|
||||||
|
if (isNotEmptyArray(res)) {
|
||||||
|
setPopShowSpecialNoteList(res)
|
||||||
|
}
|
||||||
|
})
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
//견적특이사항 API호출
|
//견적특이사항 API호출
|
||||||
//여러개 선택하면 구분자로 (、)
|
//여러개 선택하면 구분자로 (、)
|
||||||
|
//체크용
|
||||||
if (!specialNoteFirstFlg) {
|
if (!specialNoteFirstFlg) {
|
||||||
let url = `/api/estimate/special-note-list`
|
let url = `/api/estimate/special-note-title-list`
|
||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (isNotEmptyArray(res)) {
|
if (isNotEmptyArray(res)) {
|
||||||
|
//디테일 ATTR001、ATTR002、ATTR003、ATTR007、ATTR009、ATTR010、ATTR015、ATTR019
|
||||||
if (estimateContextState?.estimateOption) {
|
if (estimateContextState?.estimateOption) {
|
||||||
res.map((row) => {
|
res.map((row) => {
|
||||||
let estimateOption = estimateContextState?.estimateOption?.split('、')
|
let estimateOption = estimateContextState?.estimateOption?.split('、')
|
||||||
row.check = false
|
row.check = false
|
||||||
estimateOption.map((row2) => {
|
estimateOption.map((row2) => {
|
||||||
if (row2 === row.code) {
|
if (row.pkgYn === '0') {
|
||||||
row.check = true
|
if (row2 === row.code) {
|
||||||
|
row.check = true
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (row.code.includes(row2)) {
|
||||||
|
row.check = true
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
//detail과 상관없이 디폴트 체크목록
|
//detail과 상관없이 디폴트 체크목록
|
||||||
@ -135,48 +155,6 @@ export default function Estimate({ params }) {
|
|||||||
}
|
}
|
||||||
}, [estimateContextState?.estimateOption])
|
}, [estimateContextState?.estimateOption])
|
||||||
|
|
||||||
//변경버전
|
|
||||||
// useEffect(() => {
|
|
||||||
// //견적특이사항 API호출
|
|
||||||
// //여러개 선택하면 구분자로 (、)
|
|
||||||
// let url = `/api/estimate/special-note-title-list`
|
|
||||||
// // let url = `/api/estimate/special-note-list`
|
|
||||||
// get({ url: url }).then((res) => {
|
|
||||||
// if (isNotEmptyArray(res)) {
|
|
||||||
// if (estimateContextState?.estimateOption) {
|
|
||||||
// res.map((row) => {
|
|
||||||
// // console.log('API결과:::', row)
|
|
||||||
// //ATTR001、ATTR002、ATTR009、ATTR010
|
|
||||||
// let estimateOption = estimateContextState?.estimateOption?.split('、')
|
|
||||||
// row.check = false
|
|
||||||
// estimateOption.map((row2) => {
|
|
||||||
// if (row.pkgYn === '0') {
|
|
||||||
// if (row2 === row.code) {
|
|
||||||
// row.check = true
|
|
||||||
// }
|
|
||||||
// } else {
|
|
||||||
// if (row.code.includes(row2)) {
|
|
||||||
// row.check = true
|
|
||||||
// return
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// //detail과 상관없이 디폴트 체크목록
|
|
||||||
// //ATTR003,ATTR007
|
|
||||||
// if (row.code === 'ATTR003') {
|
|
||||||
// row.check = true
|
|
||||||
// }
|
|
||||||
// if (row.code === 'ATTR007') {
|
|
||||||
// row.check = true
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
|
|
||||||
// setSpecialNoteList(res)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }, [estimateContextState?.estimateOption])
|
|
||||||
|
|
||||||
//API데이터로 견적일 셋팅
|
//API데이터로 견적일 셋팅
|
||||||
let begin = 1
|
let begin = 1
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -276,7 +254,9 @@ export default function Estimate({ params }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//YJSS UNIT_PIRCE로 프라이싱 실행
|
//YJSS UNIT_PIRCE로 프라이싱 실행
|
||||||
handlePricing('UNIT_PRICE')
|
if (handlePricingFlag) {
|
||||||
|
handlePricing('UNIT_PRICE')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (specialNoteList.length > 0) {
|
if (specialNoteList.length > 0) {
|
||||||
specialNoteList.map((item) => {
|
specialNoteList.map((item) => {
|
||||||
@ -293,7 +273,9 @@ export default function Estimate({ params }) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
//YJOD로 돌아가도 UNIT_PRICE로 프라이싱 실행해서 정가로 셋팅
|
//YJOD로 돌아가도 UNIT_PRICE로 프라이싱 실행해서 정가로 셋팅
|
||||||
handlePricing('UNIT_PRICE')
|
if (handlePricingFlag) {
|
||||||
|
handlePricing('UNIT_PRICE')
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setItemChangeYn(true)
|
setItemChangeYn(true)
|
||||||
@ -333,7 +315,7 @@ export default function Estimate({ params }) {
|
|||||||
sapSalesStoreCd: session.custCd,
|
sapSalesStoreCd: session.custCd,
|
||||||
docTpCd: estimateContextState.estimateType,
|
docTpCd: estimateContextState.estimateType,
|
||||||
priceCd: showPriceCd,
|
priceCd: showPriceCd,
|
||||||
itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0'),
|
itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null),
|
||||||
}
|
}
|
||||||
|
|
||||||
if (param.itemIdList.length > 0) {
|
if (param.itemIdList.length > 0) {
|
||||||
@ -440,14 +422,14 @@ export default function Estimate({ params }) {
|
|||||||
//현재 PKG용량값 가져오기
|
//현재 PKG용량값 가져오기
|
||||||
|
|
||||||
let totVolKw = estimateContextState.totVolKw * 1000
|
let totVolKw = estimateContextState.totVolKw * 1000
|
||||||
let pkgTotPrice = pkgAsp.replaceAll(',', '') * totVolKw
|
let pkgTotPrice = pkgAsp.replaceAll(',', '') * totVolKw * 1000
|
||||||
|
|
||||||
setEstimateContextState({
|
setEstimateContextState({
|
||||||
pkgAsp: pkgAsp,
|
pkgAsp: pkgAsp,
|
||||||
pkgTotPrice: pkgTotPrice.toFixed(3),
|
pkgTotPrice: pkgTotPrice.toFixed(3),
|
||||||
})
|
})
|
||||||
//아이템들 중 조건에 맞는애들 뽑아서 상단 공급가액 부가세 총액 수정
|
//아이템들 중 조건에 맞는애들 뽑아서 상단 공급가액 부가세 총액 수정
|
||||||
setItemChangeYn(true)
|
setItemChangeYn(true)
|
||||||
} else {
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,7 +438,7 @@ export default function Estimate({ params }) {
|
|||||||
//itemChangeFlg = 1, partAdd = 0 셋팅
|
//itemChangeFlg = 1, partAdd = 0 셋팅
|
||||||
let amount = Number(value.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
let amount = Number(value.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
||||||
if (isNaN(amount)) {
|
if (isNaN(amount)) {
|
||||||
amount = 0
|
amount = '0'
|
||||||
} else {
|
} else {
|
||||||
amount = amount.toLocaleString()
|
amount = amount.toLocaleString()
|
||||||
}
|
}
|
||||||
@ -471,10 +453,13 @@ export default function Estimate({ params }) {
|
|||||||
updateList = estimateContextState.itemList.map((item) => {
|
updateList = estimateContextState.itemList.map((item) => {
|
||||||
if (item.dispOrder === dispOrder) {
|
if (item.dispOrder === dispOrder) {
|
||||||
return { ...item, ...updates }
|
return { ...item, ...updates }
|
||||||
|
} else if (item.paDispOrder === dispOrder) {
|
||||||
|
return { ...item, ...updates, amount: (item.bomAmount * amount?.replaceAll(',', '')).toLocaleString(), saleTotPrice: '0' }
|
||||||
} else {
|
} else {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
setEstimateContextState({
|
setEstimateContextState({
|
||||||
itemList: updateList,
|
itemList: updateList,
|
||||||
})
|
})
|
||||||
@ -541,11 +526,12 @@ export default function Estimate({ params }) {
|
|||||||
updates.itemGroup = res.itemGroup
|
updates.itemGroup = res.itemGroup
|
||||||
updates.delFlg = '0' // 삭제플래그 0
|
updates.delFlg = '0' // 삭제플래그 0
|
||||||
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
|
updates.saleTotPrice = (res.salePrice * estimateContextState.itemList[index].amount).toString()
|
||||||
|
updates.amount = ''
|
||||||
|
|
||||||
if (estimateContextState.estimateType === 'YJSS') {
|
if (estimateContextState.estimateType === 'YJSS') {
|
||||||
if (res.pkgMaterialFlg === '0') {
|
if (res.pkgMaterialFlg === '0') {
|
||||||
//updates.showSalePrice = '0'
|
updates.showSalePrice = '0'
|
||||||
//updates.showSaleTotPrice = '0'
|
updates.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//104671
|
//104671
|
||||||
@ -555,8 +541,8 @@ export default function Estimate({ params }) {
|
|||||||
if (item.dispOrder === dispOrder) {
|
if (item.dispOrder === dispOrder) {
|
||||||
return { ...item, ...updates }
|
return { ...item, ...updates }
|
||||||
} else if (item.paDispOrder === dispOrder) {
|
} else if (item.paDispOrder === dispOrder) {
|
||||||
return { ...item, delFlg: '0' }
|
//봄제품을 바꿨을떄
|
||||||
// return { ...item, delFlg: '1' }
|
return { ...item, delFlg: '1' }
|
||||||
} else {
|
} else {
|
||||||
return item
|
return item
|
||||||
}
|
}
|
||||||
@ -569,14 +555,16 @@ export default function Estimate({ params }) {
|
|||||||
bomItem.dispOrder = (index + 1 + maxItemDispOrder).toString()
|
bomItem.dispOrder = (index + 1 + maxItemDispOrder).toString()
|
||||||
bomItem.paDispOrder = dispOrder
|
bomItem.paDispOrder = dispOrder
|
||||||
bomItem.salePrice = '0'
|
bomItem.salePrice = '0'
|
||||||
//unitPrice는??
|
|
||||||
bomItem.saleTotPrice = '0'
|
bomItem.saleTotPrice = '0'
|
||||||
|
bomItem.unitPrice = '0'
|
||||||
|
// bomItem.amount = null
|
||||||
} else {
|
} else {
|
||||||
bomItem.dispOrder = (index + 1 + Number(dispOrder)).toString()
|
bomItem.dispOrder = (index + 1 + Number(dispOrder)).toString()
|
||||||
bomItem.paDispOrder = dispOrder
|
bomItem.paDispOrder = dispOrder
|
||||||
bomItem.salePrice = '0'
|
bomItem.salePrice = '0'
|
||||||
//unitPrice는??
|
|
||||||
bomItem.saleTotPrice = '0'
|
bomItem.saleTotPrice = '0'
|
||||||
|
bomItem.unitPrice = '0'
|
||||||
|
// bomItem.amount = null
|
||||||
}
|
}
|
||||||
|
|
||||||
bomItem.delFlg = '0'
|
bomItem.delFlg = '0'
|
||||||
@ -648,19 +636,18 @@ export default function Estimate({ params }) {
|
|||||||
let totPrice = 0
|
let totPrice = 0
|
||||||
let addSupplyPrice = 0
|
let addSupplyPrice = 0
|
||||||
if (estimateContextState.estimateType === 'YJOD') {
|
if (estimateContextState.estimateType === 'YJOD') {
|
||||||
console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList)
|
|
||||||
|
|
||||||
estimateContextState.itemList.sort((a, b) => {
|
estimateContextState.itemList.sort((a, b) => {
|
||||||
return a.dispOrder - b.dispOrder
|
return a.dispOrder - b.dispOrder
|
||||||
})
|
})
|
||||||
|
console.log('YJOD 토탈만들어주기::::::::::', estimateContextState.itemList)
|
||||||
|
|
||||||
estimateContextState.itemList.map((item) => {
|
estimateContextState.itemList.map((item) => {
|
||||||
//delete item.showSalePrice
|
delete item.showSalePrice
|
||||||
//delete item.showSaleTotPrice
|
delete item.showSaleTotPrice
|
||||||
if (item.delFlg === '0') {
|
if (item.delFlg === '0') {
|
||||||
let amount = Number(item?.amount?.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
let amount = Number(item?.amount?.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
||||||
if (isNaN(amount)) {
|
if (isNaN(amount)) {
|
||||||
amount = 0
|
amount = '0'
|
||||||
}
|
}
|
||||||
let price = Number(item?.saleTotPrice?.replaceAll(',', ''))
|
let price = Number(item?.saleTotPrice?.replaceAll(',', ''))
|
||||||
if (isNaN(price)) {
|
if (isNaN(price)) {
|
||||||
@ -669,6 +656,7 @@ export default function Estimate({ params }) {
|
|||||||
if (item.moduleFlg === '1') {
|
if (item.moduleFlg === '1') {
|
||||||
//용량(Kw)은 모듈플래그 1만 합산
|
//용량(Kw)은 모듈플래그 1만 합산
|
||||||
const volKw = (item.pnowW * amount) / 1000
|
const volKw = (item.pnowW * amount) / 1000
|
||||||
|
// const volKw = item.pnowW * amount
|
||||||
totVolKw += volKw
|
totVolKw += volKw
|
||||||
}
|
}
|
||||||
// const price
|
// const price
|
||||||
@ -696,15 +684,15 @@ export default function Estimate({ params }) {
|
|||||||
estimateContextState.itemList.map((item) => {
|
estimateContextState.itemList.map((item) => {
|
||||||
if (item.delFlg === '0') {
|
if (item.delFlg === '0') {
|
||||||
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
let amount = Number(item.amount?.replace(/[^0-9]/g, '').replaceAll(',', ''))
|
||||||
let price = Number(item.saleTotPrice?.replaceAll(',', ''))
|
|
||||||
let salePrice = Number(item.salePrice?.replaceAll(',', ''))
|
let salePrice = Number(item.salePrice?.replaceAll(',', ''))
|
||||||
|
let saleTotPrice = Number(item.saleTotPrice?.replaceAll(',', ''))
|
||||||
|
|
||||||
if (isNaN(amount)) {
|
if (isNaN(amount)) {
|
||||||
amount = 0
|
amount = '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(price)) {
|
if (isNaN(saleTotPrice)) {
|
||||||
price = 0
|
saleTotPrice = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isNaN(salePrice)) {
|
if (isNaN(salePrice)) {
|
||||||
@ -713,11 +701,14 @@ export default function Estimate({ params }) {
|
|||||||
if (item.moduleFlg === '1') {
|
if (item.moduleFlg === '1') {
|
||||||
//용량(Kw)은 모듈플래그 1만 합산
|
//용량(Kw)은 모듈플래그 1만 합산
|
||||||
const volKw = (item.pnowW * amount) / 1000
|
const volKw = (item.pnowW * amount) / 1000
|
||||||
|
// const volKw = item.pnowW * amount
|
||||||
totVolKw += volKw
|
totVolKw += volKw
|
||||||
}
|
}
|
||||||
|
setEstimateContextState({
|
||||||
// const price
|
pkgTotPrice: estimateContextState.pkgAsp.replaceAll(',', '') * totVolKw * 1000,
|
||||||
supplyPrice += price
|
})
|
||||||
|
//pkgTotPrice
|
||||||
|
// const saleTotPrice
|
||||||
totAmount += amount
|
totAmount += amount
|
||||||
if (item.pkgMaterialFlg === '1') {
|
if (item.pkgMaterialFlg === '1') {
|
||||||
const pkgPrice = amount * salePrice
|
const pkgPrice = amount * salePrice
|
||||||
@ -725,17 +716,17 @@ export default function Estimate({ params }) {
|
|||||||
//YJSS는 PKG제외상품들만(1) 모아서 수량 * 단가를 공급가액(supplyPrice)에 추가로 더해줌
|
//YJSS는 PKG제외상품들만(1) 모아서 수량 * 단가를 공급가액(supplyPrice)에 추가로 더해줌
|
||||||
addSupplyPrice += pkgPrice
|
addSupplyPrice += pkgPrice
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item.paDispOrder) {
|
if (!item.paDispOrder) {
|
||||||
//paDispOrder
|
//paDispOrder
|
||||||
if (item.pkgMaterialFlg === '0') {
|
if (item.pkgMaterialFlg === '0') {
|
||||||
//item.showSalePrice = '0'
|
item.showSalePrice = '0'
|
||||||
//item.showSaleTotPrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
supplyPrice = addSupplyPrice + Number(estimateContextState.pkgTotPrice)
|
||||||
supplyPrice += addSupplyPrice
|
|
||||||
vatPrice = supplyPrice * 0.1
|
vatPrice = supplyPrice * 0.1
|
||||||
totPrice = supplyPrice + vatPrice
|
totPrice = supplyPrice + vatPrice
|
||||||
setEstimateContextState({
|
setEstimateContextState({
|
||||||
@ -904,6 +895,7 @@ export default function Estimate({ params }) {
|
|||||||
checked={estimateContextState?.estimateType === 'YJSS' ? true : false}
|
checked={estimateContextState?.estimateType === 'YJSS' ? true : false}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
//주문분류
|
//주문분류
|
||||||
|
setHandlePricingFlag(true)
|
||||||
setEstimateContextState({ estimateType: e.target.value })
|
setEstimateContextState({ estimateType: e.target.value })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -917,6 +909,7 @@ export default function Estimate({ params }) {
|
|||||||
value={'YJOD'}
|
value={'YJOD'}
|
||||||
checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
|
checked={estimateContextState?.estimateType === 'YJOD' ? true : false}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
|
setHandlePricingFlag(true)
|
||||||
setEstimateContextState({ estimateType: e.target.value })
|
setEstimateContextState({ estimateType: e.target.value })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
@ -1100,7 +1093,9 @@ export default function Estimate({ params }) {
|
|||||||
settingShowContent(row.code, event)
|
settingShowContent(row.code, event)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor={row.code}>{row.codeNm}</label>
|
<label htmlFor={row.code}>
|
||||||
|
{row.codeNm} / {row.code}
|
||||||
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
@ -1110,13 +1105,34 @@ export default function Estimate({ params }) {
|
|||||||
<div className="calculation-estimate">
|
<div className="calculation-estimate">
|
||||||
{specialNoteList.map((row) => {
|
{specialNoteList.map((row) => {
|
||||||
if (row.code === showContentCode) {
|
if (row.code === showContentCode) {
|
||||||
return (
|
let showcontent = popShowSpecialNoteList.find((item) => {
|
||||||
<dl key={uuidv4()}>
|
return item.code === showContentCode
|
||||||
<dt>{row.codeNm}</dt>
|
})
|
||||||
{/* <dd dangerouslySetInnerHTML={{ __html: row.remarks }}></dd> */}
|
|
||||||
<dd dangerouslySetInnerHTML={{ __html: row.remarks }} style={{ whiteSpace: 'pre-wrap' }}></dd>
|
if (isObjectNotEmpty(showcontent)) {
|
||||||
</dl>
|
return (
|
||||||
)
|
<dl key={uuidv4()}>
|
||||||
|
<dt>{showcontent.codeNm}</dt>
|
||||||
|
<dd dangerouslySetInnerHTML={{ __html: showcontent.remarks }} style={{ whiteSpace: 'pre-wrap' }}></dd>
|
||||||
|
</dl>
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
let pushData = []
|
||||||
|
popShowSpecialNoteList.map((item) => {
|
||||||
|
let option = showContentCode.split(',')
|
||||||
|
option.map((item2) => {
|
||||||
|
if (item.code === item2) {
|
||||||
|
pushData.push(item)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
return pushData.map((item) => (
|
||||||
|
<dl key={uuidv4()}>
|
||||||
|
<dt>{item.codeNm}</dt>
|
||||||
|
<dd dangerouslySetInnerHTML={{ __html: item.remarks }} style={{ whiteSpace: 'pre-wrap' }}></dd>
|
||||||
|
</dl>
|
||||||
|
))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
@ -1145,15 +1161,15 @@ export default function Estimate({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.supplyPrice')}</div>
|
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.supplyPrice')}</div>
|
||||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.supplyPrice, 2)}</div>
|
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.supplyPrice)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
|
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.vatPrice')}</div>
|
||||||
<div className="estimate-name blue">{convertNumberToPriceDecimalToFixed(estimateContextState?.vatPrice, 2)}</div>
|
<div className="estimate-name blue">{convertNumberToPriceDecimal(estimateContextState?.vatPrice)}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="estimate-box">
|
<div className="estimate-box">
|
||||||
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div>
|
<div className="estimate-tit">{getMessage('estimate.detail.sepcialEstimateProductInfo.totPrice')}</div>
|
||||||
<div className="estimate-name red">{convertNumberToPriceDecimalToFixed(estimateContextState?.totPrice, 2)}</div>
|
<div className="estimate-name red">{convertNumberToPriceDecimal(estimateContextState?.totPrice)}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -1187,9 +1203,9 @@ export default function Estimate({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgWeight')}</th>
|
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgWeight')}</th>
|
||||||
<td>{convertNumberToPriceDecimalToFixed(estimateContextState?.totVolKw, 2)}</td>
|
<td>{convertNumberToPriceDecimalToFixed(estimateContextState?.totVolKw, 3)}</td>
|
||||||
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgPrice')}</th>
|
<th>{getMessage('estimate.detail.sepcialEstimateProductInfo.pkgPrice')}</th>
|
||||||
<td>{convertNumberToPriceDecimalToFixed(estimateContextState?.pkgTotPrice, 2)}</td>
|
<td>{convertNumberToPriceDecimal(estimateContextState?.pkgTotPrice)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -1221,6 +1237,7 @@ export default function Estimate({ params }) {
|
|||||||
type="button"
|
type="button"
|
||||||
className="btn-origin grey ml5"
|
className="btn-origin grey ml5"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
|
setHandlePricingFlag(true)
|
||||||
handlePricing(showPriceCd)
|
handlePricing(showPriceCd)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
@ -1275,7 +1292,7 @@ export default function Estimate({ params }) {
|
|||||||
<col width={250} />
|
<col width={250} />
|
||||||
<col width={90} />
|
<col width={90} />
|
||||||
<col width={80} />
|
<col width={80} />
|
||||||
<col width={140} />
|
<col width={170} />
|
||||||
<col width={190} />
|
<col width={190} />
|
||||||
</colgroup>
|
</colgroup>
|
||||||
<thead>
|
<thead>
|
||||||
@ -1401,16 +1418,13 @@ export default function Estimate({ params }) {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
{/* <div className="btn-area">
|
{/* <div className="btn-area">
|
||||||
<span className="tb_ico open_check">OPEN아이콘 처리</span>
|
<span className="tb_ico open_check"></span>
|
||||||
</div> */}
|
</div> */}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="al-r">{convertNumberToPriceDecimalToFixed(item?.saleTotPrice?.replaceAll(',', ''), 2)}</td>
|
<td className="al-r">
|
||||||
{/* {item?.showSaleTotPrice === '0' ? (
|
{convertNumberToPriceDecimal(item?.showSaleTotPrice === '0' ? null : item?.saleTotPrice?.replaceAll(',', ''))}
|
||||||
<td className="al-r"></td>
|
</td>
|
||||||
) : (
|
|
||||||
<td className="al-r">{convertNumberToPriceDecimalToFixed(item?.saleTotPrice?.replaceAll(',', ''), 2)}</td>
|
|
||||||
)} */}
|
|
||||||
</tr>
|
</tr>
|
||||||
)
|
)
|
||||||
} else {
|
} else {
|
||||||
@ -1428,7 +1442,7 @@ export default function Estimate({ params }) {
|
|||||||
</div>
|
</div>
|
||||||
{productFeaturesPopupOpen && (
|
{productFeaturesPopupOpen && (
|
||||||
<ProductFeaturesPop
|
<ProductFeaturesPop
|
||||||
specialNoteList={specialNoteList}
|
popShowSpecialNoteList={popShowSpecialNoteList}
|
||||||
showProductFeatureData={showProductFeatureData}
|
showProductFeatureData={showProductFeatureData}
|
||||||
setProductFeaturesPopupOpen={setProductFeaturesPopupOpen}
|
setProductFeaturesPopupOpen={setProductFeaturesPopupOpen}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
export default function ProductFeaturesPop({ specialNoteList, showProductFeatureData, setProductFeaturesPopupOpen }) {
|
export default function ProductFeaturesPop({ popShowSpecialNoteList, showProductFeatureData, setProductFeaturesPopupOpen }) {
|
||||||
const [showSpecialNoteList, setShowSpecialNoteList] = useState([])
|
const [showSpecialNoteList, setShowSpecialNoteList] = useState([])
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
let pushData = []
|
let pushData = []
|
||||||
specialNoteList.map((row) => {
|
popShowSpecialNoteList.map((row) => {
|
||||||
let option = showProductFeatureData.split('、')
|
let option = showProductFeatureData.split('、')
|
||||||
option.map((row2) => {
|
option.map((row2) => {
|
||||||
if (row.code === row2) {
|
if (row.code === row2) {
|
||||||
@ -16,7 +16,7 @@ export default function ProductFeaturesPop({ specialNoteList, showProductFeature
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
setShowSpecialNoteList(pushData)
|
setShowSpecialNoteList(pushData)
|
||||||
}, [specialNoteList])
|
}, [popShowSpecialNoteList])
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="modal-popup">
|
<div className="modal-popup">
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useEffect, useRef } from 'react'
|
import { useContext, useEffect, useRef } from 'react'
|
||||||
|
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
|
|
||||||
@ -15,6 +15,7 @@ import { MENU } from '@/common/common'
|
|||||||
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
import PanelBatchStatistics from '@/components/floor-plan/modal/panelBatch/PanelBatchStatistics'
|
||||||
import { totalDisplaySelector } from '@/store/settingAtom'
|
import { totalDisplaySelector } from '@/store/settingAtom'
|
||||||
import ImgLoad from '@/components/floor-plan/modal/ImgLoad'
|
import ImgLoad from '@/components/floor-plan/modal/ImgLoad'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function CanvasFrame() {
|
export default function CanvasFrame() {
|
||||||
const canvasRef = useRef(null)
|
const canvasRef = useRef(null)
|
||||||
@ -24,7 +25,9 @@ export default function CanvasFrame() {
|
|||||||
const { contextMenu, handleClick } = useContextMenu()
|
const { contextMenu, handleClick } = useContextMenu()
|
||||||
const { selectedPlan, modifiedPlanFlag, checkCanvasObjectEvent, resetModifiedPlans, currentCanvasPlan } = usePlan()
|
const { selectedPlan, modifiedPlanFlag, checkCanvasObjectEvent, resetModifiedPlans, currentCanvasPlan } = usePlan()
|
||||||
const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부
|
const totalDisplay = useRecoilValue(totalDisplaySelector) // 집계표 표시 여부
|
||||||
useEvent()
|
// useEvent()
|
||||||
|
// const { initEvent } = useContext(EventContext)
|
||||||
|
// initEvent()
|
||||||
|
|
||||||
const loadCanvas = () => {
|
const loadCanvas = () => {
|
||||||
if (canvas) {
|
if (canvas) {
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useContext, useEffect, useState } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
import { FloorPlanContext } from '@/app/floor-plan/FloorPlanProvider'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
@ -20,7 +20,7 @@ export default function CanvasLayout({ children }) {
|
|||||||
|
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { plans, modifiedPlans, loadCanvasPlanData, handleCurrentPlan, handleAddPlan, handleDeletePlan } = usePlan()
|
const { plans, initCanvasPlans, modifiedPlans, loadCanvasPlanData, handleCurrentPlan, handleAddPlan, handleDeletePlan } = usePlan()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
loadCanvasPlanData(session.userId, objectNo, pid)
|
loadCanvasPlanData(session.userId, objectNo, pid)
|
||||||
@ -37,14 +37,18 @@ export default function CanvasLayout({ children }) {
|
|||||||
onClick={() => handleCurrentPlan(session.userId, plan.id)}
|
onClick={() => handleCurrentPlan(session.userId, plan.id)}
|
||||||
>
|
>
|
||||||
<span>
|
<span>
|
||||||
{plan.name}
|
{!initCanvasPlans.some((initCanvasPlans) => initCanvasPlans.id === plan.id) && 'New '}
|
||||||
|
{`Plan ${plan.ordering}`}
|
||||||
{modifiedPlans.some((modifiedPlan) => modifiedPlan === plan.id) && ' [ M ]'}
|
{modifiedPlans.some((modifiedPlan) => modifiedPlan === plan.id) && ' [ M ]'}
|
||||||
</span>
|
</span>
|
||||||
<i
|
<i
|
||||||
className="close"
|
className="close"
|
||||||
onClick={(e) =>
|
onClick={(e) =>
|
||||||
swalFire({
|
swalFire({
|
||||||
text: `${plan.name} ` + getMessage('plan.message.confirm.delete'),
|
text:
|
||||||
|
(!initCanvasPlans.some((initCanvasPlans) => initCanvasPlans.id === plan.id) ? 'New ' : '') +
|
||||||
|
`Plan ${plan.ordering} ` +
|
||||||
|
getMessage('plan.message.confirm.delete'),
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
handleDeletePlan(e, plan.id)
|
handleDeletePlan(e, plan.id)
|
||||||
|
|||||||
@ -41,6 +41,7 @@ import EstimateCopyPop from '../estimate/popup/EstimateCopyPop'
|
|||||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||||
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
import { pwrGnrSimTypeState } from '@/store/simulatorAtom'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function CanvasMenu(props) {
|
export default function CanvasMenu(props) {
|
||||||
const { menuNumber, setMenuNumber } = props
|
const { menuNumber, setMenuNumber } = props
|
||||||
@ -70,7 +71,8 @@ export default function CanvasMenu(props) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { currentCanvasPlan, saveCanvas } = usePlan()
|
const { currentCanvasPlan, saveCanvas } = usePlan()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { initEvent, addCanvasMouseEventListener, addDocumentEventListener } = useEvent()
|
// const { initEvent, addCanvasMouseEventListener, addDocumentEventListener } = useEvent()
|
||||||
|
const { initEvent, addCanvasMouseEventListener, addDocumentEventListener } = useContext(EventContext)
|
||||||
const commonUtils = useRecoilValue(commonUtilsState)
|
const commonUtils = useRecoilValue(commonUtilsState)
|
||||||
const { commonFunctions } = useCommonUtils()
|
const { commonFunctions } = useCommonUtils()
|
||||||
const SelectOption = [{ name: '瓦53A' }, { name: '瓦53A' }]
|
const SelectOption = [{ name: '瓦53A' }, { name: '瓦53A' }]
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import Module from '@/components/floor-plan/modal/basic/step/Module'
|
import Module from '@/components/floor-plan/modal/basic/step/Module'
|
||||||
import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchModule'
|
import PitchModule from '@/components/floor-plan/modal/basic/step/pitch/PitchModule'
|
||||||
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
import PitchPlacement from '@/components/floor-plan/modal/basic/step/pitch/PitchPlacement'
|
||||||
@ -11,6 +11,7 @@ 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 { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
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()
|
||||||
@ -18,7 +19,8 @@ export default function BasicSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
const [tabNum, setTabNum] = useState(1)
|
const [tabNum, setTabNum] = useState(1)
|
||||||
const canvasSetting = useRecoilValue(canvasSettingState)
|
const canvasSetting = useRecoilValue(canvasSettingState)
|
||||||
const orientationRef = useRef(null)
|
const orientationRef = useRef(null)
|
||||||
const { initEvent } = useEvent()
|
// const { initEvent } = useEvent()
|
||||||
|
const { initEvent } = useContext(EventContext)
|
||||||
const { makeModuleInstArea, manualModuleSetup, autoModuleSetup } = useModuleBasicSetting()
|
const { makeModuleInstArea, manualModuleSetup, autoModuleSetup } = useModuleBasicSetting()
|
||||||
const handleBtnNextStep = () => {
|
const handleBtnNextStep = () => {
|
||||||
if (tabNum === 1) {
|
if (tabNum === 1) {
|
||||||
|
|||||||
@ -32,6 +32,16 @@ export default function Module({}) {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
}
|
}
|
||||||
|
const surfaceTypes = [
|
||||||
|
{ id: 1, name: 'Ⅱ', value: 'Ⅱ' },
|
||||||
|
{ id: 2, name: 'Ⅲ ∙ Ⅳ', value: 'Ⅲ ∙ Ⅳ' },
|
||||||
|
]
|
||||||
|
const fiftingHeights = Array.from({ length: 16 }).map((data, index) => {
|
||||||
|
return { id: index, name: index + 5, value: index + 5 }
|
||||||
|
})
|
||||||
|
const windSpeeds = Array.from({ length: 7 }).map((data, index) => {
|
||||||
|
return { id: index, name: index * 2 + 30, value: index * 2 + 30 }
|
||||||
|
})
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="module-table-flex-wrap mb10">
|
<div className="module-table-flex-wrap mb10">
|
||||||
@ -47,11 +57,13 @@ export default function Module({}) {
|
|||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{moduleData.header.map((data) => (
|
{moduleData.header.map((header) => {
|
||||||
<th key={data.prop} style={{ width: data.width ? data.width : '' }}>
|
return (
|
||||||
{data.name}
|
<th key={header.prop} style={{ width: header.width ? header.width + 'px' : '' }}>
|
||||||
</th>
|
{header.name}
|
||||||
))}
|
</th>
|
||||||
|
)
|
||||||
|
})}
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -88,37 +100,50 @@ export default function Module({}) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="module-table-box">
|
<div className="module-table-box none-flex">
|
||||||
<div className="module-box-tab">
|
|
||||||
<button className="module-btn act">スレート</button>
|
|
||||||
<button className="module-btn">平板瓦</button>
|
|
||||||
<button className="module-btn">53A</button>
|
|
||||||
<button className="module-btn">53A</button>
|
|
||||||
</div>
|
|
||||||
<div className="module-table-inner">
|
<div className="module-table-inner">
|
||||||
<div className="module-table-tit">{getMessage('modal.module.basic.setting.module.roof.material')}: スレーツ(4寸)</div>
|
<div className="module-table-tit">{getMessage('modal.module.basic.setting.module.stuff.info')}</div>
|
||||||
<div className="eaves-keraba-table">
|
<div className="eaves-keraba-table">
|
||||||
<div className="eaves-keraba-item">
|
<div className="eaves-keraba-item">
|
||||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.trestle.maker')}</div>
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.surface.type')}</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="grid-select">
|
<div className="outline-form">
|
||||||
<QSelectBox title={'屋根技術研究所'} option={SelectOption01} />
|
<div className="grid-select" style={{ width: '95.77px', flex: 'none' }}>
|
||||||
|
<QSelectBox title={'Ⅲ ∙ Ⅳ'} options={surfaceTypes} />
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="eaves-keraba-item">
|
<div className="eaves-keraba-item">
|
||||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.construction.method')}</div>
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.fitting.height')}</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="grid-select">
|
<div className="outline-form">
|
||||||
<QSelectBox title={'スレート金具4'} option={SelectOption01} />
|
<div className="grid-select mr10">
|
||||||
|
<QSelectBox title={'13'} options={fiftingHeights} />
|
||||||
|
</div>
|
||||||
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="eaves-keraba-item">
|
<div className="eaves-keraba-item">
|
||||||
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.under.roof')}</div>
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.standard.wind.speed')}</div>
|
||||||
<div className="eaves-keraba-td">
|
<div className="eaves-keraba-td">
|
||||||
<div className="grid-select">
|
<div className="outline-form">
|
||||||
<QSelectBox title={'構造溶合板 12mm以上'} option={SelectOption01} />
|
<div className="grid-select mr10">
|
||||||
|
<QSelectBox title={'32'} options={windSpeeds} />
|
||||||
|
</div>
|
||||||
|
<span className="thin">m/s</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.standard.snowfall.amount')}</div>
|
||||||
|
<div className="eaves-keraba-td">
|
||||||
|
<div className="outline-form">
|
||||||
|
<div className="grid-select mr10">
|
||||||
|
<input type="text" className="input-origin block" />
|
||||||
|
</div>
|
||||||
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -127,61 +152,93 @@ export default function Module({}) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="module-table-box mb10">
|
<div className="module-table-box mb10">
|
||||||
|
<div className="module-box-tab">
|
||||||
|
<button className="module-btn act">屋根材1</button>
|
||||||
|
<button className="module-btn">屋根材2</button>
|
||||||
|
<button className="module-btn">屋根材3</button>
|
||||||
|
<button className="module-btn">屋根材4</button>
|
||||||
|
</div>
|
||||||
<div className="module-table-inner">
|
<div className="module-table-inner">
|
||||||
<div className="module-table-flex-wrap">
|
<div className="module-table-flex-wrap tab2">
|
||||||
<div className="outline-form">
|
<div className="module-flex-item">
|
||||||
<span className="mr10">{getMessage('modal.module.basic.setting.module.cotton.classification')}</span>
|
<div className="module-flex-item-tit">{getMessage('modal.module.basic.setting.module.roof.material')}:スレーツ(4寸)</div>
|
||||||
<div className="grid-select">
|
<div className="eaves-keraba-table">
|
||||||
<QSelectBox title={'Ⅲ ∙ Ⅳ'} option={SelectOption01} />
|
<div className="eaves-keraba-item">
|
||||||
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.rafter.margin')}</div>
|
||||||
|
<div className="eaves-keraba-td">
|
||||||
|
<div className="keraba-flex">
|
||||||
|
<div className="grid-select">
|
||||||
|
<QSelectBox title={'455'} option={SelectOption01} />
|
||||||
|
</div>
|
||||||
|
<div className="outline-form">
|
||||||
|
<span>垂木の間隔</span>
|
||||||
|
<div className="grid-select">
|
||||||
|
<QSelectBox title={'455'} option={SelectOption01} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.trestle.maker')}</div>
|
||||||
|
<div className="eaves-keraba-td">
|
||||||
|
<div className="grid-select">
|
||||||
|
<QSelectBox title={'屋根技術研究所'} option={SelectOption01} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.construction.method')}</div>
|
||||||
|
<div className="eaves-keraba-td">
|
||||||
|
<div className="grid-select">
|
||||||
|
<QSelectBox title={'スレート金具4'} option={SelectOption01} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="eaves-keraba-item">
|
||||||
|
<div className="eaves-keraba-th">{getMessage('modal.module.basic.setting.module.under.roof')}</div>
|
||||||
|
<div className="eaves-keraba-td">
|
||||||
|
<div className="grid-select">
|
||||||
|
<QSelectBox title={'構造用合板12mm以上 又はOSB12mm以上'} option={SelectOption01} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form">
|
<div className="module-flex-item non-flex">
|
||||||
<span className="mr10">{getMessage('modal.module.basic.setting.module.fitting.height')}</span>
|
<div className="flex-item-btn-wrap">
|
||||||
<div className="grid-select">
|
<button className="btn-frame roof blue">標準施工(I)</button>
|
||||||
<QSelectBox title={'13'} option={SelectOption01} />
|
<button className="btn-frame roof white">多設施工</button>
|
||||||
|
<button className="btn-frame roof">標準施工</button>
|
||||||
|
<button className="btn-frame roof">多設施工(II)</button>
|
||||||
|
<button className="btn-frame roof">強化施工</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
<div className="grid-check-form">
|
||||||
<div className="outline-form">
|
<div className="d-check-box pop">
|
||||||
<span className="mr10">{getMessage('modal.module.basic.setting.module.standard.wind.speed')}</span>
|
<input type="checkbox" id="ch01" />
|
||||||
<div className="grid-select">
|
<label htmlFor="ch01">{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
||||||
<QSelectBox title={'32'} option={SelectOption01} />
|
</div>
|
||||||
</div>
|
<div className="d-check-box pop">
|
||||||
</div>
|
<input type="checkbox" id="ch02" />
|
||||||
<div className="outline-form">
|
<label htmlFor="ch02">{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
||||||
<span className="mr10">{getMessage('modal.module.basic.setting.module.standard.snowfall.amount')}</span>
|
</div>
|
||||||
<div className="grid-select">
|
|
||||||
<QSelectBox title={'15'} option={SelectOption01} />
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="module-table-box mb15">
|
<div className="module-bottom">
|
||||||
<div className="warning-guide">
|
<div className="module-table-box ">
|
||||||
<div className="warning">
|
<div className="warning-guide">
|
||||||
{getMessage('modal.module.basic.setting.module.setting.info1')}
|
<div className="warning">
|
||||||
<br />
|
{getMessage('modal.module.basic.setting.module.setting.info1')}
|
||||||
{getMessage('modal.module.basic.setting.module.setting.info2')}
|
<br />
|
||||||
<br />
|
{getMessage('modal.module.basic.setting.module.setting.info2')}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
{/* 설정 오류시 노출 */}
|
||||||
<div className="modal-btn-wrap mb15">
|
<div className="reset-word">※ 施工方法が選択できません。 基準風速または基準積雪量を確認してください。</div>
|
||||||
<button className="btn-frame roof blue">{getMessage('modal.module.basic.setting.module.standard.construction')}(1)</button>
|
|
||||||
<button className="btn-frame roof white">{getMessage('modal.module.basic.setting.module.standard.construction')}</button>
|
|
||||||
<button className="btn-frame roof">{getMessage('modal.module.basic.setting.module.enforce.construction')}</button>
|
|
||||||
<button className="btn-frame roof">{getMessage('modal.module.basic.setting.module.multiple.construction')}</button>
|
|
||||||
<button className="btn-frame roof blue">{getMessage('modal.module.basic.setting.module.multiple.construction')}(II)</button>
|
|
||||||
</div>
|
|
||||||
<div className="grid-check-form border">
|
|
||||||
<div className="d-check-box pop">
|
|
||||||
<input type="checkbox" id="ch01" />
|
|
||||||
<label htmlFor="ch01">{getMessage('modal.module.basic.setting.module.eaves.bar.fitting')}</label>
|
|
||||||
</div>
|
|
||||||
<div className="d-check-box pop">
|
|
||||||
<input type="checkbox" id="ch02" />
|
|
||||||
<label htmlFor="ch02">{getMessage('modal.module.basic.setting.module.blind.metal.fitting')}</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)
|
)
|
||||||
|
|||||||
@ -3,10 +3,11 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useState, useEffect } from 'react'
|
import { useState, useEffect, useContext } from 'react'
|
||||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { LINE_TYPE } from '@/common/common'
|
import { LINE_TYPE } from '@/common/common'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function LinePropertySetting(props) {
|
export default function LinePropertySetting(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
@ -14,7 +15,8 @@ export default function LinePropertySetting(props) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const { changeSurfaceLinePropertyEvent, changeSurfaceLineProperty, changeSurfaceLinePropertyReset } = useSurfaceShapeBatch()
|
const { changeSurfaceLinePropertyEvent, changeSurfaceLineProperty, changeSurfaceLinePropertyReset } = useSurfaceShapeBatch()
|
||||||
const { initEvent } = useEvent()
|
// const { initEvent } = useEvent()
|
||||||
|
const { initEvent } = useContext(EventContext)
|
||||||
|
|
||||||
const properties = [
|
const properties = [
|
||||||
{ name: getMessage('eaves.line'), value: LINE_TYPE.WALLLINE.EAVES },
|
{ name: getMessage('eaves.line'), value: LINE_TYPE.WALLLINE.EAVES },
|
||||||
|
|||||||
@ -5,11 +5,12 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
import WithDraggable from '@/components/common/draggable/WithDraggable'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { useRef, useState, useEffect } from 'react'
|
import { useRef, useState, useEffect, useContext } from 'react'
|
||||||
import { useObjectBatch } from '@/hooks/object/useObjectBatch'
|
import { useObjectBatch } from '@/hooks/object/useObjectBatch'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { BATCH_TYPE, POLYGON_TYPE } from '@/common/common'
|
import { BATCH_TYPE, POLYGON_TYPE } from '@/common/common'
|
||||||
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
import { useSurfaceShapeBatch } from '@/hooks/surface/useSurfaceShapeBatch'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function SizeSetting(props) {
|
export default function SizeSetting(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
@ -22,11 +23,12 @@ export default function SizeSetting(props) {
|
|||||||
const widthRef = useRef(null)
|
const widthRef = useRef(null)
|
||||||
const heightRef = useRef(null)
|
const heightRef = useRef(null)
|
||||||
|
|
||||||
const { initEvent } = useEvent()
|
// const { initEvent } = useEvent()
|
||||||
|
// const { initEvent } = useContext(EventContext)
|
||||||
|
|
||||||
useEffect(() => {
|
// useEffect(() => {
|
||||||
initEvent()
|
// initEvent()
|
||||||
}, [])
|
// }, [])
|
||||||
|
|
||||||
const handleReSizeObject = () => {
|
const handleReSizeObject = () => {
|
||||||
const width = widthRef.current.value
|
const width = widthRef.current.value
|
||||||
|
|||||||
@ -25,11 +25,7 @@ export default function SecondOption() {
|
|||||||
const [planSizeId, setPlanSizeId] = useState(uuidv4())
|
const [planSizeId, setPlanSizeId] = useState(uuidv4())
|
||||||
|
|
||||||
const {
|
const {
|
||||||
//horizon, setHorizon, vertical, setVertical,
|
fetchSettings,
|
||||||
// originHorizon,
|
|
||||||
// setOriginHorizon,
|
|
||||||
// originVertical,
|
|
||||||
// setOriginVertical,
|
|
||||||
planSizeSettingMode,
|
planSizeSettingMode,
|
||||||
setPlanSizeSettingMode,
|
setPlanSizeSettingMode,
|
||||||
settingModalSecondOptions,
|
settingModalSecondOptions,
|
||||||
@ -40,12 +36,9 @@ export default function SecondOption() {
|
|||||||
} = useCanvasSetting()
|
} = useCanvasSetting()
|
||||||
const { option3, option4 } = settingModalSecondOptions
|
const { option3, option4 } = settingModalSecondOptions
|
||||||
|
|
||||||
// const [horizon, setHorizon] = useState(originHorizon)
|
|
||||||
// const [vertical, setVertical] = useState(originVertical)
|
|
||||||
|
|
||||||
// 데이터를 최초 한 번만 조회
|
// 데이터를 최초 한 번만 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('SecondOption useEffect 실행', planSizeSettingMode)
|
console.log('SecondOption useEffect 실행')
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const handlePopup = (type) => {
|
const handlePopup = (type) => {
|
||||||
@ -119,6 +112,7 @@ export default function SecondOption() {
|
|||||||
case 'planSize': {
|
case 'planSize': {
|
||||||
//도면크기 설정
|
//도면크기 설정
|
||||||
if (!showPlanSizeSettingModal) {
|
if (!showPlanSizeSettingModal) {
|
||||||
|
fetchSettings() //화면 오픈 시 데이터 조회
|
||||||
setShowPlanSizeSettingModal(true)
|
setShowPlanSizeSettingModal(true)
|
||||||
addPopup(planSizeId, 2, <PlanSizeSetting {...planSizeProps} />, true)
|
addPopup(planSizeId, 2, <PlanSizeSetting {...planSizeProps} />, true)
|
||||||
} else {
|
} else {
|
||||||
@ -135,10 +129,14 @@ export default function SecondOption() {
|
|||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
[fontProps.type]: {
|
[fontProps.type]: {
|
||||||
fontFamily: font.fontFamily.value,
|
// fontFamily: font.fontFamily.value,
|
||||||
fontWeight: font.fontWeight.value,
|
// fontWeight: font.fontWeight.value,
|
||||||
fontSize: font.fontSize.value,
|
// fontSize: font.fontSize.value,
|
||||||
fontColor: font.fontColor.value,
|
// fontColor: font.fontColor.value,
|
||||||
|
fontFamily: font.fontFamily,
|
||||||
|
fontWeight: font.fontWeight,
|
||||||
|
fontSize: font.fontSize,
|
||||||
|
fontColor: font.fontColor,
|
||||||
},
|
},
|
||||||
fontFlag: true,
|
fontFlag: true,
|
||||||
}
|
}
|
||||||
@ -161,10 +159,6 @@ export default function SecondOption() {
|
|||||||
|
|
||||||
const planSizeProps = {
|
const planSizeProps = {
|
||||||
id: planSizeId,
|
id: planSizeId,
|
||||||
// horizon,
|
|
||||||
// setHorizon,
|
|
||||||
// vertical,
|
|
||||||
// setVertical,
|
|
||||||
horizon: planSizeSettingMode.originHorizon,
|
horizon: planSizeSettingMode.originHorizon,
|
||||||
vertical: planSizeSettingMode.originVertical,
|
vertical: planSizeSettingMode.originVertical,
|
||||||
isShow: showPlanSizeSettingModal,
|
isShow: showPlanSizeSettingModal,
|
||||||
|
|||||||
@ -77,28 +77,9 @@ export default function DimensionLineSetting(props) {
|
|||||||
{ id: 'darkblue', name: getMessage('color.darkblue'), value: 'darkblue' },
|
{ id: 'darkblue', name: getMessage('color.darkblue'), value: 'darkblue' },
|
||||||
]
|
]
|
||||||
|
|
||||||
let originPixelView
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (originPixel) {
|
if (originPixel) {
|
||||||
setOriginPixel(pixels?.filter((data) => data.value === originPixel)[0])
|
setOriginPixel(pixels?.filter((data) => data.value === originPixel)[0])
|
||||||
originPixelView = originPixel
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalFont.dimensionLineText.fontFamily) {
|
|
||||||
setOriginFont(fonts.filter((data) => data.value === globalFont.dimensionLineText.fontFamily)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalFont.dimensionLineText.fontWeight) {
|
|
||||||
setOriginFontWeight(fontOptions.filter((data) => data.value === globalFont.dimensionLineText.fontWeight)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalFont.dimensionLineText.fontSize) {
|
|
||||||
setOriginFontSize(fontSizes.filter((data) => data.value === globalFont.dimensionLineText.fontSize)[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
if (globalFont.dimensionLineText.fontColor) {
|
|
||||||
setOriginFontColor(fontColors.filter((data) => data.value === globalFont.dimensionLineText.fontColor)[0])
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setIsShow(true)
|
setIsShow(true)
|
||||||
@ -106,7 +87,6 @@ export default function DimensionLineSetting(props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (originPixel.name) {
|
if (originPixel.name) {
|
||||||
originPixelView = originPixel.name
|
|
||||||
setOriginPixel(originPixel)
|
setOriginPixel(originPixel)
|
||||||
}
|
}
|
||||||
}, [originPixel])
|
}, [originPixel])
|
||||||
@ -142,10 +122,10 @@ export default function DimensionLineSetting(props) {
|
|||||||
isShow: showFontModal,
|
isShow: showFontModal,
|
||||||
setIsShow: setShowFontModal,
|
setIsShow: setShowFontModal,
|
||||||
font: {
|
font: {
|
||||||
fontFamily: originFont?.value,
|
fontFamily: originFont,
|
||||||
fontWeight: originFontWeight?.value,
|
fontWeight: originFontWeight,
|
||||||
fontSize: originFontSize?.value,
|
fontSize: originFontSize,
|
||||||
fontColor: originFontColor?.value,
|
fontColor: originFontColor,
|
||||||
},
|
},
|
||||||
onSave: handleFontSave,
|
onSave: handleFontSave,
|
||||||
isConfig: true,
|
isConfig: true,
|
||||||
@ -172,10 +152,10 @@ export default function DimensionLineSetting(props) {
|
|||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
dimensionLineText: {
|
dimensionLineText: {
|
||||||
fontFamily: originFont.value,
|
fontFamily: originFont,
|
||||||
fontWeight: originFontWeight.value,
|
fontWeight: originFontWeight,
|
||||||
fontSize: originFontSize.value,
|
fontSize: originFontSize,
|
||||||
fontColor: originFontColor.value,
|
fontColor: originFontColor,
|
||||||
},
|
},
|
||||||
fontFlag: true,
|
fontFlag: true,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,28 +13,19 @@ export default function PlanSizeSetting(props) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
|
|
||||||
// const [originHorizon, setOriginHorizon] = useCanvasSetting(horizon)
|
|
||||||
// const [originVertical, setOriginVertical] = useCanvasSetting(vertical)
|
|
||||||
// const { originHorizon, setOriginHorizon, originVertical, setOriginVertical } = useCanvasSetting()
|
|
||||||
const { planSizeSettingMode, setPlanSizeSettingMode } = useCanvasSetting()
|
const { planSizeSettingMode, setPlanSizeSettingMode } = useCanvasSetting()
|
||||||
|
|
||||||
// 데이터를 최초 한 번만 조회
|
// 데이터를 최초 한 번만 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log('PlanSizeSetting useEffect 실행')
|
console.log('PlanSizeSetting useEffect 실행')
|
||||||
console.log('11111', planSizeSettingMode)
|
|
||||||
//setOriginHorizon({ originHorizon: horizon, flag: false })
|
|
||||||
//setOriginVertical({ originVertical: vertical, flag: false })
|
|
||||||
}, [])
|
}, [])
|
||||||
|
|
||||||
const onSave = () => {
|
const onSave = () => {
|
||||||
console.log('22222', planSizeSettingMode)
|
|
||||||
setPlanSizeSettingMode((prev) => {
|
setPlanSizeSettingMode((prev) => {
|
||||||
console.log('4', prev)
|
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
originHorizon: planSizeSettingMode.originHorizon,
|
originHorizon: Number(planSizeSettingMode.originHorizon),
|
||||||
originVertical: planSizeSettingMode.originVertical,
|
originVertical: Number(planSizeSettingMode.originVertical),
|
||||||
flag: true,
|
flag: true,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -53,7 +44,7 @@ export default function PlanSizeSetting(props) {
|
|||||||
setPlanSizeSettingMode((prev) => {
|
setPlanSizeSettingMode((prev) => {
|
||||||
return {
|
return {
|
||||||
...prev,
|
...prev,
|
||||||
[name]: value,
|
[name]: Number(value),
|
||||||
flag: false,
|
flag: false,
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) {
|
export default function Offset({ length1Ref, arrow1Ref, currentWallLineRef }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addDocumentEventListener, initEvent } = useEvent()
|
// const { addDocumentEventListener, initEvent } = useEvent()
|
||||||
|
const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
addDocumentEventListener('keydown', document, keyDown)
|
addDocumentEventListener('keydown', document, keyDown)
|
||||||
|
|||||||
@ -1,10 +1,12 @@
|
|||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { forwardRef, useEffect, useImperativeHandle, useState } from 'react'
|
import { forwardRef, useContext, useEffect, useImperativeHandle, useState } from 'react'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref, arrow2Ref, radioTypeRef, currentWallLineRef }, ref) {
|
export default forwardRef(function WallLine({ length1Ref, length2Ref, arrow1Ref, arrow2Ref, radioTypeRef, currentWallLineRef }, ref) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addDocumentEventListener, initEvent } = useEvent()
|
// const { addDocumentEventListener, initEvent } = useEvent()
|
||||||
|
const { addDocumentEventListener, initEvent } = useContext(EventContext)
|
||||||
const [type, setType] = useState(1)
|
const [type, setType] = useState(1)
|
||||||
const [arrow1, setArrow1] = useState('up')
|
const [arrow1, setArrow1] = useState('up')
|
||||||
const [arrow2, setArrow2] = useState('up')
|
const [arrow2, setArrow2] = useState('up')
|
||||||
|
|||||||
@ -142,6 +142,16 @@ export default function StuffDetail() {
|
|||||||
headerName: getMessage('stuff.detail.planGridHeader.capacity'),
|
headerName: getMessage('stuff.detail.planGridHeader.capacity'),
|
||||||
width: 120,
|
width: 120,
|
||||||
cellStyle: { justifyContent: 'flex-end' /* 우측정렬*/ },
|
cellStyle: { justifyContent: 'flex-end' /* 우측정렬*/ },
|
||||||
|
cellRenderer: (params) => {
|
||||||
|
let origin = params.value
|
||||||
|
let capacity
|
||||||
|
if (origin) {
|
||||||
|
capacity = origin / 1000
|
||||||
|
return capacity.toFixed(3)
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'roofMaterialIdMulti',
|
field: 'roofMaterialIdMulti',
|
||||||
@ -170,8 +180,8 @@ export default function StuffDetail() {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
field: 'constructSpecification',
|
field: 'constructSpecificationMulti',
|
||||||
headerName: getMessage('stuff.detail.planGridHeader.constructSpecification'),
|
headerName: getMessage('stuff.detail.planGridHeader.constructSpecificationMulti'),
|
||||||
wrapText: true,
|
wrapText: true,
|
||||||
autoHeight: true,
|
autoHeight: true,
|
||||||
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
cellStyle: { justifyContent: 'flex-start' /* 좌측정렬*/ },
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { wordDisplaySelector } from '@/store/settingAtom'
|
import { wordDisplaySelector } from '@/store/settingAtom'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
@ -9,11 +9,13 @@ import { canvasState } from '@/store/canvasAtom'
|
|||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import Distance from '@/components/floor-plan/modal/distance/Distance'
|
import Distance from '@/components/floor-plan/modal/distance/Distance'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export function useCommonUtils() {
|
export function useCommonUtils() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const wordDisplay = useRecoilValue(wordDisplaySelector)
|
const wordDisplay = useRecoilValue(wordDisplaySelector)
|
||||||
const { addCanvasMouseEventListener, addDocumentEventListener, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, addDocumentEventListener, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, addDocumentEventListener, initEvent } = useContext(EventContext)
|
||||||
const dimensionSettings = useRecoilValue(dimensionLineSettingsState)
|
const dimensionSettings = useRecoilValue(dimensionLineSettingsState)
|
||||||
const dimensionLineTextFont = useRecoilValue(fontSelector('dimensionLineText'))
|
const dimensionLineTextFont = useRecoilValue(fontSelector('dimensionLineText'))
|
||||||
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
||||||
@ -21,7 +23,7 @@ export function useCommonUtils() {
|
|||||||
const { addPopup } = usePopup()
|
const { addPopup } = usePopup()
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
initEvent()
|
// initEvent()
|
||||||
if (commonUtils.text) {
|
if (commonUtils.text) {
|
||||||
commonTextMode()
|
commonTextMode()
|
||||||
} else if (commonUtils.dimension) {
|
} else if (commonUtils.dimension) {
|
||||||
|
|||||||
@ -12,7 +12,7 @@ export function useFont() {
|
|||||||
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
const circuitNumberText = useRecoilValue(fontSelector('circuitNumberText'))
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (canvas && commonText.fontWeight?.value) {
|
if (canvas && commonText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'commonText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'commonText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
obj.set({
|
obj.set({
|
||||||
@ -28,7 +28,7 @@ export function useFont() {
|
|||||||
}, [commonText])
|
}, [commonText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (canvas && dimensionLineText.fontWeight?.value) {
|
if (canvas && dimensionLineText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'dimensionLineText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'dimensionLineText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
obj.set({
|
obj.set({
|
||||||
@ -44,7 +44,7 @@ export function useFont() {
|
|||||||
}, [dimensionLineText])
|
}, [dimensionLineText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (canvas && flowText.fontWeight?.value) {
|
if (canvas && flowText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'flowText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'flowText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
obj.set({
|
obj.set({
|
||||||
@ -60,7 +60,7 @@ export function useFont() {
|
|||||||
}, [flowText])
|
}, [flowText])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (canvas && lengthText.fontWeight?.value) {
|
if (canvas && lengthText.fontWeight.value) {
|
||||||
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'lengthText')
|
const textObjs = canvas?.getObjects().filter((obj) => obj.name === 'lengthText')
|
||||||
textObjs.forEach((obj) => {
|
textObjs.forEach((obj) => {
|
||||||
obj.set({
|
obj.set({
|
||||||
|
|||||||
@ -80,7 +80,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
itemId: '', //제품번호
|
itemId: '', //제품번호
|
||||||
itemNo: '',
|
itemNo: '',
|
||||||
itemName: '', //형명
|
itemName: '', //형명
|
||||||
amount: '0', //수량
|
amount: '', //수량
|
||||||
unitPrice: '0',
|
unitPrice: '0',
|
||||||
unit: '', //단위
|
unit: '', //단위
|
||||||
salePrice: '', //단가
|
salePrice: '', //단가
|
||||||
@ -126,6 +126,8 @@ export const useEstimateController = (planNo) => {
|
|||||||
const handleEstimateSubmit = async () => {
|
const handleEstimateSubmit = async () => {
|
||||||
//0. 필수체크
|
//0. 필수체크
|
||||||
let flag = true
|
let flag = true
|
||||||
|
let fileFlg = true
|
||||||
|
let itemFlg = true
|
||||||
if (estimateData.charger.trim().length === 0) {
|
if (estimateData.charger.trim().length === 0) {
|
||||||
flag = false
|
flag = false
|
||||||
return alert(getMessage('estimate.detail.save.requiredCharger'))
|
return alert(getMessage('estimate.detail.save.requiredCharger'))
|
||||||
@ -141,26 +143,58 @@ export const useEstimateController = (planNo) => {
|
|||||||
return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
|
return alert(getMessage('estimate.detail.save.requiredEstimateDate'))
|
||||||
}
|
}
|
||||||
|
|
||||||
// console.log('첨부파일:::::', estimateData.fileList)
|
|
||||||
//첨부파일을 첨부안했는데
|
//첨부파일을 첨부안했는데
|
||||||
//아이템 fileUploadFlg가1(첨부파일 필수)이 1개라도 있는데 후일 자료 제출(fileFlg) 체크안했으면(0) alert 저장안돼
|
//아이템 fileUploadFlg가1(첨부파일 필수)이 1개라도 있는데 후일 자료 제출(fileFlg) 체크안했으면(0) alert 저장안돼
|
||||||
let fileFlg = true
|
if (flag) {
|
||||||
if (estimateData.fileList.length < 1) {
|
if (estimateData.fileList.length < 1) {
|
||||||
if (estimateData.itemList.length > 1) {
|
if (estimateData.itemList.length > 1) {
|
||||||
estimateData.itemList.map((row) => {
|
estimateData.itemList.map((row) => {
|
||||||
if (row.fileUploadFlg === '1') {
|
if (row.fileUploadFlg === '1') {
|
||||||
if (fileFlg) {
|
if (fileFlg) {
|
||||||
if (estimateData.fileFlg === '0') {
|
if (estimateData.fileFlg === '0') {
|
||||||
fileFlg = false
|
fileFlg = false
|
||||||
return alert(getMessage('estimate.detail.save.requiredFileUpload'))
|
return alert(getMessage('estimate.detail.save.requiredFileUpload'))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
})
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flag && fileFlg) {
|
if (fileFlg) {
|
||||||
|
estimateData.itemList.map((item) => {
|
||||||
|
item.amount = item.amount?.replaceAll(',', '')
|
||||||
|
item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2)
|
||||||
|
item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2)
|
||||||
|
|
||||||
|
if (!item.paDispOrder) {
|
||||||
|
if (itemFlg) {
|
||||||
|
if (isNaN(item.amount)) {
|
||||||
|
item.amount = '0'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.amount < 1) {
|
||||||
|
itemFlg = false
|
||||||
|
return alert(getMessage('estimate.detail.save.requiredAmount'))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (estimateData.estimateType !== 'YJSS') {
|
||||||
|
if (isNaN(item.salePrice)) {
|
||||||
|
item.salePrice = '0'
|
||||||
|
}
|
||||||
|
|
||||||
|
if (item.salePrice < 1) {
|
||||||
|
itemFlg = false
|
||||||
|
return alert(getMessage('estimate.detail.save.requiredSalePrice'))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (flag && fileFlg && itemFlg) {
|
||||||
//1. 첨부파일 저장시작
|
//1. 첨부파일 저장시작
|
||||||
const formData = new FormData()
|
const formData = new FormData()
|
||||||
formData.append('file', estimateData.fileList)
|
formData.append('file', estimateData.fileList)
|
||||||
@ -173,7 +207,7 @@ export const useEstimateController = (planNo) => {
|
|||||||
//첨부파일저장끝
|
//첨부파일저장끝
|
||||||
|
|
||||||
//제품라인 추가했는데 아이템 안고르고 저장하면itemId=''은 날리고 나머지 저장하기
|
//제품라인 추가했는데 아이템 안고르고 저장하면itemId=''은 날리고 나머지 저장하기
|
||||||
estimateData.itemList = estimateData.itemList.filter((item) => item.itemId !== '')
|
estimateData.itemList = estimateData.itemList.filter((item) => item.itemId !== '' && item.delFlg === '0')
|
||||||
|
|
||||||
let delCnt = 0
|
let delCnt = 0
|
||||||
estimateData.itemList.map((item) => {
|
estimateData.itemList.map((item) => {
|
||||||
@ -186,12 +220,6 @@ export const useEstimateController = (planNo) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
console.log('최종 아이템 정보::;', estimateData.itemList)
|
console.log('최종 아이템 정보::;', estimateData.itemList)
|
||||||
estimateData.itemList.map((item) => {
|
|
||||||
item.amount = item.amount?.replaceAll(',', '')
|
|
||||||
item.salePrice = parseFloat(item.salePrice?.replaceAll(',', '')).toFixed(2)
|
|
||||||
item.saleTotPrice = parseFloat(item.saleTotPrice?.replaceAll(',', '')).toFixed(2)
|
|
||||||
})
|
|
||||||
|
|
||||||
console.log('최종 정보::;', estimateData)
|
console.log('최종 정보::;', estimateData)
|
||||||
//2. 상세데이터 저장
|
//2. 상세데이터 저장
|
||||||
// return
|
// return
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useContext, useEffect, useState } from 'react'
|
||||||
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { rectToPolygon, setSurfaceShapePattern } from '@/util/canvas-util'
|
import { rectToPolygon, setSurfaceShapePattern } from '@/util/canvas-util'
|
||||||
@ -11,14 +11,15 @@ import { useEvent } from '@/hooks/useEvent'
|
|||||||
import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common'
|
import { POLYGON_TYPE, BATCH_TYPE } from '@/common/common'
|
||||||
|
|
||||||
import * as turf from '@turf/turf'
|
import * as turf from '@turf/turf'
|
||||||
import next from 'next'
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export function useModuleBasicSetting() {
|
export function useModuleBasicSetting() {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||||
const [moduleSetupSurface, setModuleSetupSurface] = useRecoilState(moduleSetupSurfaceState)
|
const [moduleSetupSurface, setModuleSetupSurface] = useRecoilState(moduleSetupSurfaceState)
|
||||||
const [moduleIsSetup, setModuleIsSetup] = useRecoilState(moduleIsSetupState)
|
const [moduleIsSetup, setModuleIsSetup] = useRecoilState(moduleIsSetupState)
|
||||||
const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent } = useEvent()
|
// const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
|
const { addTargetMouseEventListener, addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
let selectedModuleInstSurfaceArray = []
|
let selectedModuleInstSurfaceArray = []
|
||||||
|
|
||||||
const makeModuleInstArea = () => {
|
const makeModuleInstArea = () => {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
'use client'
|
'use client'
|
||||||
import { useEffect } from 'react'
|
import { useContext, useEffect } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
@ -12,11 +12,13 @@ import { usePolygon } from '@/hooks/usePolygon'
|
|||||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
export function useObjectBatch({ isHidden, setIsHidden }) {
|
export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { addCanvasMouseEventListener, initEvent, addDocumentEventListener } = useEvent()
|
// const { addCanvasMouseEventListener, initEvent, addDocumentEventListener } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, initEvent, addDocumentEventListener } = useContext(EventContext)
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { drawDirectionArrow } = usePolygon()
|
const { drawDirectionArrow } = usePolygon()
|
||||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import { useAxios } from '@/hooks/useAxios'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { correntObjectNoState, corridorDimensionSelector, settingModalFirstOptionsState, settingModalSecondOptionsState } from '@/store/settingAtom'
|
import { correntObjectNoState, corridorDimensionSelector, settingModalFirstOptionsState, settingModalSecondOptionsState } from '@/store/settingAtom'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
import { fontSelector, globalFontAtom } from '@/store/fontAtom'
|
import { globalFontAtom } from '@/store/fontAtom'
|
||||||
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
import { dimensionLineSettingsState } from '@/store/commonUtilsAtom'
|
||||||
|
|
||||||
let objectNo
|
let objectNo
|
||||||
@ -32,7 +32,7 @@ export function useCanvasSetting() {
|
|||||||
|
|
||||||
const [adsorptionPointMode, setAdsorptionPointMode] = useRecoilState(adsorptionPointModeState)
|
const [adsorptionPointMode, setAdsorptionPointMode] = useRecoilState(adsorptionPointModeState)
|
||||||
const [adsorptionRange, setAdsorptionRange] = useRecoilState(adsorptionRangeState)
|
const [adsorptionRange, setAdsorptionRange] = useRecoilState(adsorptionRangeState)
|
||||||
const [planSizeSettingMode, setPlanSizeSettingMode] = useRecoilState(adsorptionRangeState)
|
const [planSizeSettingMode, setPlanSizeSettingMode] = useRecoilState(planSizeSettingState)
|
||||||
//const setAdsorptionRange = useSetRecoilState(adsorptionRangeState)
|
//const setAdsorptionRange = useSetRecoilState(adsorptionRangeState)
|
||||||
|
|
||||||
const [selectedFont, setSelectedFont] = useState()
|
const [selectedFont, setSelectedFont] = useState()
|
||||||
@ -40,13 +40,8 @@ export function useCanvasSetting() {
|
|||||||
const [selectedFontSize, setSelectedFontSize] = useState()
|
const [selectedFontSize, setSelectedFontSize] = useState()
|
||||||
const [selectedFontColor, setSelectedFontColor] = useState()
|
const [selectedFontColor, setSelectedFontColor] = useState()
|
||||||
const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom)
|
const [globalFont, setGlobalFont] = useRecoilState(globalFontAtom)
|
||||||
//const [objectNo, setObjectNo] = useState('test123240912001') // 이후 삭제 필요
|
|
||||||
|
|
||||||
const [dimensionLineSettings, setDimensionLineSettings] = useRecoilState(dimensionLineSettingsState)
|
const [dimensionLineSettings, setDimensionLineSettings] = useRecoilState(dimensionLineSettingsState)
|
||||||
|
|
||||||
//const [originHorizon, setOriginHorizon] = useState({ originHorizon: 1600, flag: false })
|
|
||||||
//const [originVertical, setOriginVertical] = useState({ originVertical: 1600, flag: false })
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!canvas) {
|
if (!canvas) {
|
||||||
return
|
return
|
||||||
@ -97,9 +92,9 @@ export function useCanvasSetting() {
|
|||||||
console.log('useCanvasSetting useEffect 실행3', settingModalFirstOptions.fontFlag, settingModalSecondOptions.fontFlag, correntObjectNo)
|
console.log('useCanvasSetting useEffect 실행3', settingModalFirstOptions.fontFlag, settingModalSecondOptions.fontFlag, correntObjectNo)
|
||||||
if (settingModalFirstOptions.fontFlag || settingModalSecondOptions.fontFlag) {
|
if (settingModalFirstOptions.fontFlag || settingModalSecondOptions.fontFlag) {
|
||||||
onClickOption2()
|
onClickOption2()
|
||||||
|
frontSettings()
|
||||||
fetchSettings()
|
fetchSettings()
|
||||||
}
|
}
|
||||||
frontSettings()
|
|
||||||
}, [settingModalFirstOptions, settingModalSecondOptions])
|
}, [settingModalFirstOptions, settingModalSecondOptions])
|
||||||
|
|
||||||
// 글꼴 변경 시
|
// 글꼴 변경 시
|
||||||
@ -114,20 +109,85 @@ export function useCanvasSetting() {
|
|||||||
|
|
||||||
// 도명크기 변경 시
|
// 도명크기 변경 시
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(
|
console.log('useCanvasSetting useEffect 실행5', planSizeSettingMode.flag, correntObjectNo)
|
||||||
'useCanvasSetting useEffect 실행5',
|
|
||||||
correntObjectNo,
|
|
||||||
planSizeSettingMode.flag,
|
|
||||||
planSizeSettingMode.originHorizon,
|
|
||||||
planSizeSettingMode.originVertical,
|
|
||||||
)
|
|
||||||
|
|
||||||
if (planSizeSettingMode.flag) {
|
if (planSizeSettingMode.flag) {
|
||||||
onClickOption2()
|
onClickOption2()
|
||||||
frontSettings()
|
frontSettings()
|
||||||
fetchSettings()
|
fetchSettings()
|
||||||
}
|
}
|
||||||
}, [planSizeSettingMode.flag])
|
}, [planSizeSettingMode])
|
||||||
|
|
||||||
|
const getFonts = (itemValue) => {
|
||||||
|
if (!itemValue) return { id: 1, name: 'MS PGothic', value: 'MS PGothic' }
|
||||||
|
const data = [
|
||||||
|
{ id: 1, name: 'MS PGothic', value: 'MS PGothic' },
|
||||||
|
{ id: 2, name: '@Yu Gothic', value: '@Yu Gothic' },
|
||||||
|
{ id: 3, name: 'Yu Gothic', value: 'Yu Gothic' },
|
||||||
|
{ id: 4, name: '@Yu Gothic UI', value: '@Yu Gothic UI' },
|
||||||
|
{ id: 5, name: 'Yu Gothic UI', value: 'Yu Gothic UI' },
|
||||||
|
].filter((font) => font.value === itemValue)
|
||||||
|
if (data.length !== 0) {
|
||||||
|
return data[0]
|
||||||
|
} else {
|
||||||
|
return { id: 1, name: 'MS PGothic', value: 'MS PGothic' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFontSizes = (itemValue) => {
|
||||||
|
if (!itemValue) return { id: 16, name: 16, value: 16 }
|
||||||
|
const data = [
|
||||||
|
...Array.from({ length: 4 }).map((_, index) => {
|
||||||
|
return { id: index + 8, name: index + 8, value: index + 8 }
|
||||||
|
}),
|
||||||
|
...Array.from({ length: 9 }).map((_, index) => {
|
||||||
|
return { id: (index + 6) * 2, name: (index + 6) * 2, value: (index + 6) * 2 }
|
||||||
|
}),
|
||||||
|
{ id: 36, name: 36, value: 36 },
|
||||||
|
{ id: 48, name: 48, value: 48 },
|
||||||
|
{ id: 72, name: 72, value: 72 },
|
||||||
|
].filter((fontSize) => fontSize.value === itemValue)
|
||||||
|
if (data.length !== 0) {
|
||||||
|
return data[0]
|
||||||
|
} else {
|
||||||
|
return { id: 16, name: 16, value: 16 }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFontStyles = (itemValue) => {
|
||||||
|
if (!itemValue) return { id: 'normal', name: getMessage('font.style.normal'), value: 'normal' }
|
||||||
|
const data = [
|
||||||
|
{ id: 'normal', name: getMessage('font.style.normal'), value: 'normal' },
|
||||||
|
{ id: 'italic', name: getMessage('font.style.italic'), value: 'italic' },
|
||||||
|
{ id: 'bold', name: getMessage('font.style.bold'), value: 'bold' },
|
||||||
|
{ id: 'boldAndItalic', name: getMessage('font.style.bold.italic'), value: 'boldAndItalic' },
|
||||||
|
].filter((fontStyle) => fontStyle.value === itemValue)
|
||||||
|
if (data.length !== 0) {
|
||||||
|
return data[0]
|
||||||
|
} else {
|
||||||
|
return { id: 'normal', name: getMessage('font.style.normal'), value: 'normal' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getFontColors = (itemValue) => {
|
||||||
|
if (!itemValue) return { id: 'black', name: getMessage('color.black'), value: 'black' }
|
||||||
|
const data = [
|
||||||
|
{ id: 'black', name: getMessage('color.black'), value: 'black' },
|
||||||
|
{ id: 'red', name: getMessage('color.red'), value: 'red' },
|
||||||
|
{ id: 'blue', name: getMessage('color.blue'), value: 'blue' },
|
||||||
|
{ id: 'gray', name: getMessage('color.gray'), value: 'gray' },
|
||||||
|
{ id: 'yellow', name: getMessage('color.yellow'), value: 'yellow' },
|
||||||
|
{ id: 'green', name: getMessage('color.green'), value: 'green' },
|
||||||
|
{ id: 'pink', name: getMessage('color.pink'), value: 'pink' },
|
||||||
|
{ id: 'gold', name: getMessage('color.gold'), value: 'gold' },
|
||||||
|
{ id: 'darkblue', name: getMessage('color.darkblue'), value: 'darkblue' },
|
||||||
|
].filter((fontColor) => fontColor.value === itemValue)
|
||||||
|
if (data.length !== 0) {
|
||||||
|
return data[0]
|
||||||
|
} else {
|
||||||
|
return { id: 'black', name: getMessage('color.black'), value: 'black' }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const fetchSettings = async () => {
|
const fetchSettings = async () => {
|
||||||
try {
|
try {
|
||||||
@ -141,8 +201,6 @@ export function useCanvasSetting() {
|
|||||||
const optionData4 = settingModalSecondOptions.option4.map((item) => ({ ...item, selected: res[item.column] }))
|
const optionData4 = settingModalSecondOptions.option4.map((item) => ({ ...item, selected: res[item.column] }))
|
||||||
const optionData5 = settingModalFirstOptions.dimensionDisplay.map((item) => ({ ...item }))
|
const optionData5 = settingModalFirstOptions.dimensionDisplay.map((item) => ({ ...item }))
|
||||||
|
|
||||||
//setObjectNo(floorPlanState.objectNo)
|
|
||||||
|
|
||||||
//흡착점 ON/OFF
|
//흡착점 ON/OFF
|
||||||
setAdsorptionPointMode({ ...adsorptionPointMode, adsorptionPoint: res.adsorpPoint, fontFlag: false })
|
setAdsorptionPointMode({ ...adsorptionPointMode, adsorptionPoint: res.adsorpPoint, fontFlag: false })
|
||||||
|
|
||||||
@ -156,16 +214,6 @@ export function useCanvasSetting() {
|
|||||||
originVertical: res.originVertical,
|
originVertical: res.originVertical,
|
||||||
flag: false,
|
flag: false,
|
||||||
})
|
})
|
||||||
// setOriginHorizon({
|
|
||||||
// ...originHorizon,
|
|
||||||
// originHorizon: res.originHorizon,
|
|
||||||
// flag: false,
|
|
||||||
// })
|
|
||||||
// setOriginVertical({
|
|
||||||
// ...originVertical,
|
|
||||||
// originVertical: res.originVertical,
|
|
||||||
// flag: false,
|
|
||||||
// })
|
|
||||||
|
|
||||||
// 데이터 설정
|
// 데이터 설정
|
||||||
setSettingModalFirstOptions({
|
setSettingModalFirstOptions({
|
||||||
@ -185,43 +233,43 @@ export function useCanvasSetting() {
|
|||||||
const fontPatternData = {
|
const fontPatternData = {
|
||||||
commonText: {
|
commonText: {
|
||||||
//문자 글꼴 조회 데이터
|
//문자 글꼴 조회 데이터
|
||||||
fontFamily: res.wordFont,
|
fontFamily: getFonts(res.wordFont),
|
||||||
fontWeight: res.wordFontStyle,
|
fontWeight: getFontStyles(res.wordFontStyle),
|
||||||
fontSize: res.wordFontSize,
|
fontSize: getFontSizes(res.wordFontSize),
|
||||||
fontColor: res.wordFontColor,
|
fontColor: getFontColors(res.wordFontColor),
|
||||||
},
|
},
|
||||||
flowText: {
|
flowText: {
|
||||||
//흐름방향 글꼴 조회 데이터
|
//흐름방향 글꼴 조회 데이터
|
||||||
fontFamily: res.flowFont,
|
fontFamily: getFonts(res.flowFont),
|
||||||
fontWeight: res.flowFontStyle,
|
fontWeight: getFontStyles(res.flowFontStyle),
|
||||||
fontSize: res.flowFontSize,
|
fontSize: getFontSizes(res.flowFontSize),
|
||||||
fontColor: res.flowFontColor,
|
fontColor: getFontColors(res.flowFontColor),
|
||||||
},
|
},
|
||||||
dimensionLineText: {
|
dimensionLineText: {
|
||||||
//치수 글꼴 조회 데이터
|
//치수 글꼴 조회 데이터
|
||||||
fontFamily: res.dimensioFont,
|
fontFamily: getFonts(res.dimensioFont),
|
||||||
fontWeight: res.dimensioFontStyle,
|
fontWeight: getFontStyles(res.dimensioFontStyle),
|
||||||
fontSize: res.dimensioFontSize,
|
fontSize: getFontSizes(res.dimensioFontSize),
|
||||||
fontColor: res.dimensioFontColor,
|
fontColor: getFontColors(res.dimensioFontColor),
|
||||||
},
|
},
|
||||||
circuitNumberText: {
|
circuitNumberText: {
|
||||||
//회로번호 글꼴 조회 데이터
|
//회로번호 글꼴 조회 데이터
|
||||||
fontFamily: res.circuitNumFont,
|
fontFamily: getFonts(res.circuitNumFont),
|
||||||
fontWeight: res.circuitNumFontStyle,
|
fontWeight: getFontStyles(res.circuitNumFontStyle),
|
||||||
fontSize: res.circuitNumFontSize,
|
fontSize: getFontSizes(res.circuitNumFontSize),
|
||||||
fontColor: res.circuitNumFontColor,
|
fontColor: getFontColors(res.circuitNumFontColor),
|
||||||
},
|
},
|
||||||
lengthText: {
|
lengthText: {
|
||||||
//치수선 글꼴 조회 데이터
|
//치수선 글꼴 조회 데이터
|
||||||
fontFamily: res.lengthFont,
|
fontFamily: getFonts(res.lengthFont),
|
||||||
fontWeight: res.lengthFontStyle,
|
fontWeight: getFontStyles(res.lengthFontStyle),
|
||||||
fontSize: res.lengthFontSize,
|
fontSize: getFontSizes(res.lengthFontSize),
|
||||||
fontColor: res.lengthFontColor,
|
fontColor: getFontColors(res.lengthFontColor),
|
||||||
},
|
},
|
||||||
//글꼴 설정 Flag
|
//글꼴 설정 Flag
|
||||||
fontFlag: false,
|
fontFlag: false,
|
||||||
}
|
}
|
||||||
//console.log('fontPatternData', fontPatternData)
|
console.log('fontPatternData', fontPatternData)
|
||||||
|
|
||||||
//조회된 글꼴 데이터 set
|
//조회된 글꼴 데이터 set
|
||||||
setGlobalFont(fontPatternData)
|
setGlobalFont(fontPatternData)
|
||||||
@ -239,14 +287,6 @@ export function useCanvasSetting() {
|
|||||||
...planSizeSettingMode,
|
...planSizeSettingMode,
|
||||||
flag: false,
|
flag: false,
|
||||||
})
|
})
|
||||||
// setOriginHorizon({
|
|
||||||
// ...originHorizon,
|
|
||||||
// flag: false,
|
|
||||||
// })
|
|
||||||
// setOriginVertical({
|
|
||||||
// ...originVertical,
|
|
||||||
// flag: false,
|
|
||||||
// })
|
|
||||||
|
|
||||||
// 데이터 설정
|
// 데이터 설정
|
||||||
setSettingModalFirstOptions({
|
setSettingModalFirstOptions({
|
||||||
@ -258,52 +298,7 @@ export function useCanvasSetting() {
|
|||||||
fontFlag: false,
|
fontFlag: false,
|
||||||
})
|
})
|
||||||
|
|
||||||
//console.log('globalFont2', globalFont)
|
setGlobalFont({ ...globalFont, fontFlag: false })
|
||||||
const fontPatternData = {
|
|
||||||
commonText: {
|
|
||||||
//문자 글꼴
|
|
||||||
fontFamily: globalFont.commonText.fontFamily.value,
|
|
||||||
fontWeight: globalFont.commonText.fontWeight.value,
|
|
||||||
fontSize: globalFont.commonText.fontSize.value,
|
|
||||||
fontColor: globalFont.commonText.fontColor.value,
|
|
||||||
},
|
|
||||||
flowText: {
|
|
||||||
//흐름방향 글꼴
|
|
||||||
fontFamily: globalFont.flowText.fontFamily.value,
|
|
||||||
fontWeight: globalFont.flowText.fontWeight.value,
|
|
||||||
fontSize: globalFont.flowText.fontSize.value,
|
|
||||||
fontColor: globalFont.flowText.fontColor.value,
|
|
||||||
},
|
|
||||||
dimensionLineText: {
|
|
||||||
//치수 글꼴
|
|
||||||
fontFamily: globalFont.dimensionLineText.fontFamily.value,
|
|
||||||
fontWeight: globalFont.dimensionLineText.fontWeight.value,
|
|
||||||
fontSize: globalFont.dimensionLineText.fontSize.value,
|
|
||||||
fontColor: globalFont.dimensionLineText.fontColor.value,
|
|
||||||
},
|
|
||||||
circuitNumberText: {
|
|
||||||
//회로번호 글꼴
|
|
||||||
fontFamily: globalFont.circuitNumberText.fontFamily.value,
|
|
||||||
fontWeight: globalFont.circuitNumberText.fontWeight.value,
|
|
||||||
fontSize: globalFont.circuitNumberText.fontSize.value,
|
|
||||||
fontColor: globalFont.circuitNumberText.fontColor.value,
|
|
||||||
},
|
|
||||||
lengthText: {
|
|
||||||
//치수선 글꼴
|
|
||||||
fontFamily: globalFont.lengthText.fontFamily.value,
|
|
||||||
fontWeight: globalFont.lengthText.fontWeight.value,
|
|
||||||
fontSize: globalFont.lengthText.fontSize.value,
|
|
||||||
fontColor: globalFont.lengthText.fontColor.value,
|
|
||||||
},
|
|
||||||
//글꼴 설정 Flag
|
|
||||||
fontFlag: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
//console.log('fontPatternData', fontPatternData)
|
|
||||||
|
|
||||||
setGlobalFont(fontPatternData)
|
|
||||||
|
|
||||||
//setGlobalFont({ ...globalFont, fontFlag: false })
|
|
||||||
}
|
}
|
||||||
frontSettings()
|
frontSettings()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -332,7 +327,7 @@ export function useCanvasSetting() {
|
|||||||
selected: item.selected,
|
selected: item.selected,
|
||||||
})),
|
})),
|
||||||
}
|
}
|
||||||
|
// console.log('globalFont', globalFont)
|
||||||
const patternData = {
|
const patternData = {
|
||||||
//견적서 번호
|
//견적서 번호
|
||||||
objectNo: correntObjectNo,
|
objectNo: correntObjectNo,
|
||||||
@ -366,34 +361,34 @@ export function useCanvasSetting() {
|
|||||||
|
|
||||||
//글꼴 설정
|
//글꼴 설정
|
||||||
//문자 글꼴
|
//문자 글꼴
|
||||||
wordFont: globalFont.commonText.fontFamily,
|
wordFont: globalFont.commonText.fontFamily?.value ?? 'MS PGothic',
|
||||||
wordFontStyle: globalFont.commonText.fontWeight,
|
wordFontStyle: globalFont.commonText.fontWeight?.value ?? 'normal',
|
||||||
wordFontSize: globalFont.commonText.fontSize,
|
wordFontSize: globalFont.commonText.fontSize?.value ?? 16,
|
||||||
wordFontColor: globalFont.commonText.fontColor,
|
wordFontColor: globalFont.commonText.fontColor?.value ?? 'black',
|
||||||
|
|
||||||
//흐름방향 글꼴
|
//흐름방향 글꼴
|
||||||
flowFont: globalFont.flowText.fontFamily,
|
flowFont: globalFont.flowText.fontFamily?.value ?? 'MS PGothic',
|
||||||
flowFontStyle: globalFont.flowText.fontWeight,
|
flowFontStyle: globalFont.flowText.fontWeight?.value ?? 'normal',
|
||||||
flowFontSize: globalFont.flowText.fontSize,
|
flowFontSize: globalFont.flowText.fontSize?.value ?? 16,
|
||||||
flowFontColor: globalFont.flowText.fontColor,
|
flowFontColor: globalFont.flowText.fontColor?.value ?? 'black',
|
||||||
|
|
||||||
//치수 글꼴
|
//치수 글꼴
|
||||||
dimensioFont: globalFont.dimensionLineText.fontFamily,
|
dimensioFont: globalFont.dimensionLineText.fontFamily?.value ?? 'MS PGothic',
|
||||||
dimensioFontStyle: globalFont.dimensionLineText.fontWeight,
|
dimensioFontStyle: globalFont.dimensionLineText.fontWeight?.value ?? 'normal',
|
||||||
dimensioFontSize: globalFont.dimensionLineText.fontSize,
|
dimensioFontSize: globalFont.dimensionLineText.fontSize?.value ?? 16,
|
||||||
dimensioFontColor: globalFont.dimensionLineText.fontColor,
|
dimensioFontColor: globalFont.dimensionLineText.fontColor?.value ?? 'black',
|
||||||
|
|
||||||
//회로번호 글꼴
|
//회로번호 글꼴
|
||||||
circuitNumFont: globalFont.circuitNumberText.fontFamily,
|
circuitNumFont: globalFont.circuitNumberText.fontFamily?.value ?? 'MS PGothic',
|
||||||
circuitNumFontStyle: globalFont.circuitNumberText.fontWeight,
|
circuitNumFontStyle: globalFont.circuitNumberText.fontWeight?.value ?? 'normal',
|
||||||
circuitNumFontSize: globalFont.circuitNumberText.fontSize,
|
circuitNumFontSize: globalFont.circuitNumberText.fontSize?.value ?? 16,
|
||||||
circuitNumFontColor: globalFont.circuitNumberText.fontColor,
|
circuitNumFontColor: globalFont.circuitNumberText.fontColor?.value ?? 'black',
|
||||||
|
|
||||||
//치수선 글꼴
|
//치수선 글꼴
|
||||||
lengthFont: globalFont.lengthText.fontFamily,
|
lengthFont: globalFont.lengthText.fontFamily?.value ?? 'MS PGothic',
|
||||||
lengthFontStyle: globalFont.lengthText.fontWeight,
|
lengthFontStyle: globalFont.lengthText.fontWeight?.value ?? 'normal',
|
||||||
lengthFontSize: globalFont.lengthText.fontSize,
|
lengthFontSize: globalFont.lengthText.fontSize?.value ?? 16,
|
||||||
lengthFontColor: globalFont.lengthText.fontColor,
|
lengthFontColor: globalFont.lengthText.fontColor?.value ?? 'black',
|
||||||
|
|
||||||
//치수선 설정
|
//치수선 설정
|
||||||
originPixel: dimensionLineSettings.pixel,
|
originPixel: dimensionLineSettings.pixel,
|
||||||
@ -402,8 +397,6 @@ export function useCanvasSetting() {
|
|||||||
//치수선 설정
|
//치수선 설정
|
||||||
originHorizon: planSizeSettingMode.originHorizon,
|
originHorizon: planSizeSettingMode.originHorizon,
|
||||||
originVertical: planSizeSettingMode.originVertical,
|
originVertical: planSizeSettingMode.originVertical,
|
||||||
// originHorizon: originHorizon.originHorizon,
|
|
||||||
// originVertical: originVertical.originVertical,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('patternData ', patternData)
|
console.log('patternData ', patternData)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { adsorptionRangeState, canvasState, verticalHorizontalModeState } from '@/store/canvasAtom'
|
import { adsorptionRangeState, canvasState, verticalHorizontalModeState } from '@/store/canvasAtom'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
@ -22,11 +22,13 @@ import { useSwal } from '@/hooks/useSwal'
|
|||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils'
|
import { calculateAngle, isSamePoint } from '@/util/qpolygon-utils'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
// 보조선 작성
|
// 보조선 작성
|
||||||
export function useAuxiliaryDrawing(id) {
|
export function useAuxiliaryDrawing(id) {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { addCanvasMouseEventListener, addDocumentEventListener, removeMouseLine, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, addDocumentEventListener, removeMouseLine, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, addDocumentEventListener, removeMouseLine, initEvent } = useContext(EventContext)
|
||||||
const { getIntersectMousePoint } = useMouse()
|
const { getIntersectMousePoint } = useMouse()
|
||||||
const { addLine, removeLine } = useLine()
|
const { addLine, removeLine } = useLine()
|
||||||
const { tempGridMode } = useTempGrid()
|
const { tempGridMode } = useTempGrid()
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, pitchTextSelector } from '@/store/canvasAtom'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
@ -10,12 +10,14 @@ import { outerLineFixState } from '@/store/outerLineAtom'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { getChonByDegree } from '@/util/canvas-util'
|
import { getChonByDegree } from '@/util/canvas-util'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
// 처마.케라바 변경
|
// 처마.케라바 변경
|
||||||
export function useEavesGableEdit(id) {
|
export function useEavesGableEdit(id) {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const TYPES = {
|
const TYPES = {
|
||||||
EAVES: 'eaves',
|
EAVES: 'eaves',
|
||||||
|
|||||||
@ -2,11 +2,12 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
import { OUTER_LINE_TYPE } from '@/store/outerLineAtom'
|
import { OUTER_LINE_TYPE } from '@/store/outerLineAtom'
|
||||||
import { QLine } from '@/components/fabric/QLine'
|
import { QLine } from '@/components/fabric/QLine'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
//동선이동 형 올림 내림
|
//동선이동 형 올림 내림
|
||||||
export function useMovementSetting(id) {
|
export function useMovementSetting(id) {
|
||||||
@ -15,7 +16,8 @@ export function useMovementSetting(id) {
|
|||||||
UP_DOWN: 'updown', //형 올림내림
|
UP_DOWN: 'updown', //형 올림내림
|
||||||
}
|
}
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { initEvent, addCanvasMouseEventListener } = useEvent()
|
// const { initEvent, addCanvasMouseEventListener } = useEvent()
|
||||||
|
const { initEvent, addCanvasMouseEventListener } = useContext(EventContext)
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef } from 'react'
|
import { useContext, useEffect, useRef } from 'react'
|
||||||
import { distanceBetweenPoints } from '@/util/canvas-util'
|
import { distanceBetweenPoints } from '@/util/canvas-util'
|
||||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import {
|
import {
|
||||||
@ -31,6 +31,7 @@ import { fabric } from 'fabric'
|
|||||||
import { outlineDisplaySelector } from '@/store/settingAtom'
|
import { outlineDisplaySelector } from '@/store/settingAtom'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/PropertiesSetting'
|
import PropertiesSetting from '@/components/floor-plan/modal/outerlinesetting/PropertiesSetting'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
//외벽선 그리기
|
//외벽선 그리기
|
||||||
export function useOuterLineWall(id, propertiesId) {
|
export function useOuterLineWall(id, propertiesId) {
|
||||||
@ -43,6 +44,14 @@ export function useOuterLineWall(id, propertiesId) {
|
|||||||
removeAllDocumentEventListeners,
|
removeAllDocumentEventListeners,
|
||||||
removeMouseEvent,
|
removeMouseEvent,
|
||||||
} = useEvent()
|
} = useEvent()
|
||||||
|
// const {
|
||||||
|
// initEvent,
|
||||||
|
// // addCanvasMouseEventListener,
|
||||||
|
// // addDocumentEventListener,
|
||||||
|
// removeAllMouseEventListeners,
|
||||||
|
// removeAllDocumentEventListeners,
|
||||||
|
// removeMouseEvent,
|
||||||
|
// } = useContext(EventContext)
|
||||||
const { getIntersectMousePoint } = useMouse()
|
const { getIntersectMousePoint } = useMouse()
|
||||||
const { addLine, removeLine } = useLine()
|
const { addLine, removeLine } = useLine()
|
||||||
const { tempGridMode } = useTempGrid()
|
const { tempGridMode } = useTempGrid()
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, currentObjectState, pitchTextSelector } from '@/store/canvasAtom'
|
import { ANGLE_TYPE, canvasState, currentAngleTypeSelector, currentObjectState, pitchTextSelector } from '@/store/canvasAtom'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import { useLine } from '@/hooks/useLine'
|
import { useLine } from '@/hooks/useLine'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
@ -11,6 +11,7 @@ import { outerLineFixState } from '@/store/outerLineAtom'
|
|||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { getChonByDegree } from '@/util/canvas-util'
|
import { getChonByDegree } from '@/util/canvas-util'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
//지붕형상 수동 설정
|
//지붕형상 수동 설정
|
||||||
export function useRoofShapePassivitySetting(id) {
|
export function useRoofShapePassivitySetting(id) {
|
||||||
@ -25,7 +26,8 @@ export function useRoofShapePassivitySetting(id) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { showLine, hideLine, addPitchTextsByOuterLines } = useLine()
|
const { showLine, hideLine, addPitchTextsByOuterLines } = useLine()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
const { drawRoofPolygon } = useMode()
|
const { drawRoofPolygon } = useMode()
|
||||||
const { addPolygonByLines } = usePolygon()
|
const { addPolygonByLines } = usePolygon()
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
|
|||||||
@ -1,11 +1,12 @@
|
|||||||
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
import { canvasState, currentObjectState } from '@/store/canvasAtom'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { useEffect, useRef, useState } from 'react'
|
import { useContext, useEffect, useRef, useState } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { useLine } from '@/hooks/useLine'
|
import { useLine } from '@/hooks/useLine'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
|
||||||
// 외벽선 편집 및 오프셋
|
// 외벽선 편집 및 오프셋
|
||||||
export function useWallLineOffsetSetting(id) {
|
export function useWallLineOffsetSetting(id) {
|
||||||
@ -14,7 +15,8 @@ export function useWallLineOffsetSetting(id) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
const wallLineEditRef = useRef(null)
|
const wallLineEditRef = useRef(null)
|
||||||
const length1Ref = useRef(null)
|
const length1Ref = useRef(null)
|
||||||
const length2Ref = useRef(null)
|
const length2Ref = useRef(null)
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import { useEvent } from '@/hooks/useEvent'
|
|||||||
import { useMouse } from '@/hooks/useMouse'
|
import { useMouse } from '@/hooks/useMouse'
|
||||||
import { useLine } from '@/hooks/useLine'
|
import { useLine } from '@/hooks/useLine'
|
||||||
import { useTempGrid } from '@/hooks/useTempGrid'
|
import { useTempGrid } from '@/hooks/useTempGrid'
|
||||||
import { useEffect, useRef } from 'react'
|
import { useContext, useEffect, useRef } from 'react'
|
||||||
import { distanceBetweenPoints, setSurfaceShapePattern } from '@/util/canvas-util'
|
import { distanceBetweenPoints, setSurfaceShapePattern } from '@/util/canvas-util'
|
||||||
import { fabric } from 'fabric'
|
import { fabric } from 'fabric'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle } from '@/util/qpolygon-utils'
|
||||||
@ -33,12 +33,15 @@ import { POLYGON_TYPE } from '@/common/common'
|
|||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
|
||||||
import { roofDisplaySelector } from '@/store/settingAtom'
|
import { roofDisplaySelector } from '@/store/settingAtom'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
// 면형상 배치
|
// 면형상 배치
|
||||||
export function usePlacementShapeDrawing(id) {
|
export function usePlacementShapeDrawing(id) {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||||
|
// const { addCanvasMouseEventListener, addDocumentEventListener, removeAllMouseEventListeners, removeAllDocumentEventListeners, removeMouseEvent } =
|
||||||
|
// useEvent()
|
||||||
const { addCanvasMouseEventListener, addDocumentEventListener, removeAllMouseEventListeners, removeAllDocumentEventListeners, removeMouseEvent } =
|
const { addCanvasMouseEventListener, addDocumentEventListener, removeAllMouseEventListeners, removeAllDocumentEventListeners, removeMouseEvent } =
|
||||||
useEvent()
|
useContext(EventContext)
|
||||||
const { getIntersectMousePoint } = useMouse()
|
const { getIntersectMousePoint } = useMouse()
|
||||||
const { addLine, removeLine } = useLine()
|
const { addLine, removeLine } = useLine()
|
||||||
const { addPolygonByLines, drawDirectionArrow } = usePolygon()
|
const { addPolygonByLines, drawDirectionArrow } = usePolygon()
|
||||||
|
|||||||
@ -15,6 +15,8 @@ import { usePolygon } from '@/hooks/usePolygon'
|
|||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
import { slopeSelector } from '@/store/commonAtom'
|
import { slopeSelector } from '@/store/commonAtom'
|
||||||
import { QLine } from '@/components/fabric/QLine'
|
import { QLine } from '@/components/fabric/QLine'
|
||||||
|
import { EventContext } from '@/app/floor-plan/EventProvider'
|
||||||
|
import { useContext } from 'react'
|
||||||
|
|
||||||
export function useSurfaceShapeBatch() {
|
export function useSurfaceShapeBatch() {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -26,7 +28,8 @@ export function useSurfaceShapeBatch() {
|
|||||||
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
const roofDisplay = useRecoilValue(roofDisplaySelector)
|
||||||
const slope = useRecoilValue(slopeSelector(globalPitch))
|
const slope = useRecoilValue(slopeSelector(globalPitch))
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
// const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
|
const { addCanvasMouseEventListener, initEvent } = useContext(EventContext)
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
|
|
||||||
const applySurfaceShape = (surfaceRefs, selectedType, id) => {
|
const applySurfaceShape = (surfaceRefs, selectedType, id) => {
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useEffect, useRef } from 'react'
|
import { useCallback, useEffect, useRef } from 'react'
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
||||||
import { canvasState, canvasZoomState, currentMenuState, textModeState } from '@/store/canvasAtom'
|
import { canvasState, canvasZoomState, currentMenuState, textModeState } from '@/store/canvasAtom'
|
||||||
import { fabric } from 'fabric'
|
import { fabric } from 'fabric'
|
||||||
|
|||||||
@ -23,9 +23,6 @@ export function usePlan() {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { get, promisePost, promisePut, promiseDel } = useAxios()
|
const { get, promisePost, promisePut, promiseDel } = useAxios()
|
||||||
|
|
||||||
const planLabel = 'Plan '
|
|
||||||
const newPlanLabel = 'New Plan '
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 마우스 포인터의 가이드라인을 제거합니다.
|
* 마우스 포인터의 가이드라인을 제거합니다.
|
||||||
*/
|
*/
|
||||||
@ -145,7 +142,9 @@ export function usePlan() {
|
|||||||
*/
|
*/
|
||||||
const checkUnsavedCanvasPlan = async (userId) => {
|
const checkUnsavedCanvasPlan = async (userId) => {
|
||||||
swalFire({
|
swalFire({
|
||||||
text: `저장 안된 ${currentCanvasPlan.name} PLAN을 저장하시겠습니까? `,
|
text:
|
||||||
|
(!initCanvasPlans.some((initCanvasPlans) => initCanvasPlans.id === plan.id) ? 'New ' : '') +
|
||||||
|
`Plan ${plan.ordering}의 변경 사항을 저장하시겠습니까?`,
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: async () => {
|
confirmFn: async () => {
|
||||||
initCanvasPlans.some((plan) => plan.id === currentCanvasPlan.id)
|
initCanvasPlans.some((plan) => plan.id === currentCanvasPlan.id)
|
||||||
@ -185,20 +184,20 @@ export function usePlan() {
|
|||||||
*/
|
*/
|
||||||
const getCanvasByObjectNo = async (userId, objectNo) => {
|
const getCanvasByObjectNo = async (userId, objectNo) => {
|
||||||
return get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) =>
|
return get({ url: `/api/canvas-management/canvas-statuses/by-object/${objectNo}/${userId}` }).then((res) =>
|
||||||
res.map((item) => ({
|
res.map((item, index) => ({
|
||||||
id: item.id,
|
id: item.id,
|
||||||
name: planLabel + item.id,
|
|
||||||
userId: item.userId,
|
userId: item.userId,
|
||||||
canvasStatus: dbToCanvasFormat(item.canvasStatus),
|
canvasStatus: dbToCanvasFormat(item.canvasStatus),
|
||||||
isCurrent: false,
|
isCurrent: false,
|
||||||
bgImageName: item.bgImageName,
|
bgImageName: item.bgImageName,
|
||||||
mapPositionAddress: item.mapPositionAddress,
|
mapPositionAddress: item.mapPositionAddress,
|
||||||
|
ordering: index + 1,
|
||||||
})),
|
})),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* canvas 데이터를 추가
|
* 신규 canvas 데이터를 저장
|
||||||
*/
|
*/
|
||||||
const postCanvasStatus = async (userId, canvasStatus) => {
|
const postCanvasStatus = async (userId, canvasStatus) => {
|
||||||
const planData = {
|
const planData = {
|
||||||
@ -216,7 +215,6 @@ export function usePlan() {
|
|||||||
? {
|
? {
|
||||||
...plan,
|
...plan,
|
||||||
id: res.data,
|
id: res.data,
|
||||||
name: planLabel + res.data,
|
|
||||||
canvasStatus: canvasStatus,
|
canvasStatus: canvasStatus,
|
||||||
}
|
}
|
||||||
: plan,
|
: plan,
|
||||||
@ -306,7 +304,10 @@ export function usePlan() {
|
|||||||
const handleAddPlan = (userId, objectNo) => {
|
const handleAddPlan = (userId, objectNo) => {
|
||||||
JSON.parse(currentCanvasData()).objects.length > 0
|
JSON.parse(currentCanvasData()).objects.length > 0
|
||||||
? swalFire({
|
? swalFire({
|
||||||
text: `${currentCanvasPlan.name} ` + getMessage('plan.message.confirm.copy'),
|
text:
|
||||||
|
(!initCanvasPlans.some((initCanvasPlans) => initCanvasPlans.id === currentCanvasPlan.id) ? 'New ' : '') +
|
||||||
|
`Plan ${currentCanvasPlan.ordering} ` +
|
||||||
|
getMessage('plan.message.confirm.copy'),
|
||||||
type: 'confirm',
|
type: 'confirm',
|
||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
addPlan(userId, objectNo, currentCanvasData())
|
addPlan(userId, objectNo, currentCanvasData())
|
||||||
@ -321,10 +322,10 @@ export function usePlan() {
|
|||||||
const id = uuidv4()
|
const id = uuidv4()
|
||||||
const newPlan = {
|
const newPlan = {
|
||||||
id: id,
|
id: id,
|
||||||
name: newPlanLabel + `${planNum + 1}`,
|
|
||||||
objectNo: objectNo,
|
objectNo: objectNo,
|
||||||
userId: userId,
|
userId: userId,
|
||||||
canvasStatus: canvasStatus,
|
canvasStatus: canvasStatus,
|
||||||
|
ordering: planNum + 1,
|
||||||
}
|
}
|
||||||
setPlans([...plans, newPlan])
|
setPlans([...plans, newPlan])
|
||||||
handleCurrentPlan(userId, id)
|
handleCurrentPlan(userId, id)
|
||||||
@ -373,9 +374,10 @@ export function usePlan() {
|
|||||||
if (res.length > 0) {
|
if (res.length > 0) {
|
||||||
setInitCanvasPlans(res)
|
setInitCanvasPlans(res)
|
||||||
setPlans(res)
|
setPlans(res)
|
||||||
updateCurrentPlan(Number(pid)) // last 데이터에 포커싱
|
updateCurrentPlan(Number(pid))
|
||||||
|
setPlanNum(res.length)
|
||||||
} else {
|
} else {
|
||||||
addPlan(userId, objectNo)
|
addPlan(userId, objectNo, '')
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -383,6 +385,7 @@ export function usePlan() {
|
|||||||
return {
|
return {
|
||||||
canvas,
|
canvas,
|
||||||
plans,
|
plans,
|
||||||
|
initCanvasPlans,
|
||||||
selectedPlan,
|
selectedPlan,
|
||||||
currentCanvasPlan,
|
currentCanvasPlan,
|
||||||
modifiedPlans,
|
modifiedPlans,
|
||||||
|
|||||||
@ -86,12 +86,14 @@
|
|||||||
"modal.module.basic.setting.orientation.setting.angle.passivity": "角度を直接入力",
|
"modal.module.basic.setting.orientation.setting.angle.passivity": "角度を直接入力",
|
||||||
"modal.module.basic.setting.module.roof.material": "屋根材",
|
"modal.module.basic.setting.module.roof.material": "屋根材",
|
||||||
"modal.module.basic.setting.module.trestle.maker": "架台メーカー",
|
"modal.module.basic.setting.module.trestle.maker": "架台メーカー",
|
||||||
|
"modal.module.basic.setting.module.rafter.margin": "マンドンピッチ",
|
||||||
"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.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.cotton.classification": "綿調道区分",
|
"modal.module.basic.setting.module.stuff.info": "商品情報",
|
||||||
|
"modal.module.basic.setting.module.surface.type": "면조도구분(JA)",
|
||||||
"modal.module.basic.setting.module.fitting.height": "設置高さ",
|
"modal.module.basic.setting.module.fitting.height": "設置高さ",
|
||||||
"modal.module.basic.setting.module.standard.wind.speed": "基準風速",
|
"modal.module.basic.setting.module.standard.wind.speed": "基準風速",
|
||||||
"modal.module.basic.setting.module.standard.snowfall.amount": "基準積雪量",
|
"modal.module.basic.setting.module.standard.snowfall.amount": "基準積雪量",
|
||||||
@ -729,7 +731,7 @@
|
|||||||
"stuff.detail.planGridHeader.moduleModel": "モジュール",
|
"stuff.detail.planGridHeader.moduleModel": "モジュール",
|
||||||
"stuff.detail.planGridHeader.capacity": "システム容量",
|
"stuff.detail.planGridHeader.capacity": "システム容量",
|
||||||
"stuff.detail.planGridHeader.roofMaterialIdMulti": "屋根材",
|
"stuff.detail.planGridHeader.roofMaterialIdMulti": "屋根材",
|
||||||
"stuff.detail.planGridHeader.constructSpecification": "施工方法",
|
"stuff.detail.planGridHeader.constructSpecificationMulti": "施工方法",
|
||||||
"stuff.detail.planGridHeader.supportMethodIdMulti": "架台",
|
"stuff.detail.planGridHeader.supportMethodIdMulti": "架台",
|
||||||
"stuff.detail.planGridHeader.pcTypeNo": "パワーコンディショナー",
|
"stuff.detail.planGridHeader.pcTypeNo": "パワーコンディショナー",
|
||||||
"stuff.detail.planGridHeader.management": "管理",
|
"stuff.detail.planGridHeader.management": "管理",
|
||||||
@ -895,6 +897,8 @@
|
|||||||
"estimate.detail.save.requiredCharger": "担当者は必須です.",
|
"estimate.detail.save.requiredCharger": "担当者は必須です.",
|
||||||
"estimate.detail.save.requiredObjectName": "案件名は必須です.",
|
"estimate.detail.save.requiredObjectName": "案件名は必須です.",
|
||||||
"estimate.detail.save.requiredEstimateDate": "見積日は必須です.",
|
"estimate.detail.save.requiredEstimateDate": "見積日は必須です.",
|
||||||
|
"estimate.detail.save.requiredAmount": "数量は0より大きい値を入力してください.",
|
||||||
|
"estimate.detail.save.requiredSalePrice": "単価は0より大きい値を入力してください.",
|
||||||
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
"estimate.detail.reset.confirmMsg": "保存した見積書情報が初期化され、図面情報が反映されます。本当に初期化しますか?",
|
||||||
"simulator.title.sub1": "物件番号",
|
"simulator.title.sub1": "物件番号",
|
||||||
"simulator.title.sub2": "作成日",
|
"simulator.title.sub2": "作成日",
|
||||||
|
|||||||
@ -89,12 +89,14 @@
|
|||||||
"modal.module.basic.setting.orientation.setting.angle.passivity": "각도를 직접 입력",
|
"modal.module.basic.setting.orientation.setting.angle.passivity": "각도를 직접 입력",
|
||||||
"modal.module.basic.setting.module.roof.material": "지붕재",
|
"modal.module.basic.setting.module.roof.material": "지붕재",
|
||||||
"modal.module.basic.setting.module.trestle.maker": "가대메이거",
|
"modal.module.basic.setting.module.trestle.maker": "가대메이거",
|
||||||
|
"modal.module.basic.setting.module.rafter.margin": "서까래 간격",
|
||||||
"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.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.cotton.classification": "면조도구분",
|
"modal.module.basic.setting.module.stuff.info": "물건정보",
|
||||||
|
"modal.module.basic.setting.module.surface.type": "면조도구분",
|
||||||
"modal.module.basic.setting.module.fitting.height": "설치높이",
|
"modal.module.basic.setting.module.fitting.height": "설치높이",
|
||||||
"modal.module.basic.setting.module.standard.wind.speed": "기준 풍속",
|
"modal.module.basic.setting.module.standard.wind.speed": "기준 풍속",
|
||||||
"modal.module.basic.setting.module.standard.snowfall.amount": "기준 적설량",
|
"modal.module.basic.setting.module.standard.snowfall.amount": "기준 적설량",
|
||||||
@ -739,7 +741,7 @@
|
|||||||
"stuff.detail.planGridHeader.moduleModel": "모듈",
|
"stuff.detail.planGridHeader.moduleModel": "모듈",
|
||||||
"stuff.detail.planGridHeader.capacity": "시스템용량",
|
"stuff.detail.planGridHeader.capacity": "시스템용량",
|
||||||
"stuff.detail.planGridHeader.roofMaterialIdMulti": "지붕재",
|
"stuff.detail.planGridHeader.roofMaterialIdMulti": "지붕재",
|
||||||
"stuff.detail.planGridHeader.constructSpecification": "시공방법",
|
"stuff.detail.planGridHeader.constructSpecificationMulti": "시공방법",
|
||||||
"stuff.detail.planGridHeader.supportMethodIdMulti": "가대",
|
"stuff.detail.planGridHeader.supportMethodIdMulti": "가대",
|
||||||
"stuff.detail.planGridHeader.pcTypeNo": "파워컨디셔너",
|
"stuff.detail.planGridHeader.pcTypeNo": "파워컨디셔너",
|
||||||
"stuff.detail.planGridHeader.management": "관리",
|
"stuff.detail.planGridHeader.management": "관리",
|
||||||
@ -905,6 +907,8 @@
|
|||||||
"estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.",
|
"estimate.detail.save.requiredCharger": "담당자는 필수값 입니다.",
|
||||||
"estimate.detail.save.requiredObjectName": "안건명은 필수값 입니다.",
|
"estimate.detail.save.requiredObjectName": "안건명은 필수값 입니다.",
|
||||||
"estimate.detail.save.requiredEstimateDate": "견적일은 필수값 입니다.",
|
"estimate.detail.save.requiredEstimateDate": "견적일은 필수값 입니다.",
|
||||||
|
"estimate.detail.save.requiredAmount": "수량은 0보다 큰값을 입력해주세요.",
|
||||||
|
"estimate.detail.save.requiredSalePrice": "단가는 0보다 큰값을 입력해주세요.",
|
||||||
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
"estimate.detail.reset.confirmMsg": "저장된 견적서 정보가 초기화되고, 도면정보가 반영됩니다. 정말로 초기화 하시겠습니까?",
|
||||||
"simulator.title.sub1": "물건번호",
|
"simulator.title.sub1": "물건번호",
|
||||||
"simulator.title.sub2": "작성일",
|
"simulator.title.sub2": "작성일",
|
||||||
|
|||||||
@ -59,6 +59,46 @@
|
|||||||
.ag-icon-filter::before{
|
.ag-icon-filter::before{
|
||||||
color: #fff;
|
color: #fff;
|
||||||
}
|
}
|
||||||
|
.ag-body-vertical-scroll{
|
||||||
|
width: 4px !important;
|
||||||
|
max-width: 4px !important;
|
||||||
|
min-width: 4px !important;
|
||||||
|
.ag-body-vertical-scroll-viewport{
|
||||||
|
width: 4px !important;
|
||||||
|
max-width: 4px !important;
|
||||||
|
min-width: 4px !important;
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
width: 4px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #C1CCD7;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.ag-body-horizontal-scroll{
|
||||||
|
height: 4px !important;
|
||||||
|
max-height: 4px !important;
|
||||||
|
min-height: 4px !important;
|
||||||
|
.ag-body-horizontal-scroll-viewport{
|
||||||
|
height: 4px !important;
|
||||||
|
max-height: 4px !important;
|
||||||
|
min-height: 4px !important;
|
||||||
|
&::-webkit-scrollbar {
|
||||||
|
height: 4px;
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-thumb {
|
||||||
|
background-color: #C1CCD7;
|
||||||
|
}
|
||||||
|
&::-webkit-scrollbar-track {
|
||||||
|
background-color: transparent;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
.copy-ico-wrap{
|
.copy-ico-wrap{
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -226,8 +226,8 @@ button{
|
|||||||
border: 1px solid #484848;
|
border: 1px solid #484848;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
&.blue{
|
&.blue{
|
||||||
background-color: #414E6C;
|
background-color: #4C6FBF;
|
||||||
border: 1px solid #414E6C;
|
border: 1px solid #4C6FBF;
|
||||||
&:hover{
|
&:hover{
|
||||||
background-color: #414E6C;
|
background-color: #414E6C;
|
||||||
border: 1px solid #414E6C;
|
border: 1px solid #414E6C;
|
||||||
|
|||||||
@ -337,3 +337,35 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 견적 복사
|
||||||
|
.estimate-copy-info-item{
|
||||||
|
margin-bottom: 20px;
|
||||||
|
&:last-child{
|
||||||
|
margin-bottom: 0;
|
||||||
|
}
|
||||||
|
.estimate-copy-info-tit{
|
||||||
|
font-size: 13px;
|
||||||
|
color: #101010;
|
||||||
|
font-weight: 500;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
}
|
||||||
|
.estimate-copy-info-box{
|
||||||
|
display: flex;
|
||||||
|
gap: 5px;
|
||||||
|
.estimate-copy-sel{
|
||||||
|
flex: 1 1 auto;
|
||||||
|
}
|
||||||
|
.estimate-copy-id{
|
||||||
|
flex: none;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 150px;
|
||||||
|
background-color: #FAFAFA;
|
||||||
|
border: 1px solid #EEEEEE;
|
||||||
|
font-size: 13px;
|
||||||
|
color: #999;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user