Compare commits
10 Commits
134becaa93
...
14aa4227f4
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
14aa4227f4 | ||
|
|
af63891df2 | ||
| 070e9d933f | |||
| e67fc749f4 | |||
|
|
adf9febc8c | ||
|
|
089ffed7af | ||
|
|
990de88caf | ||
| d53d7f4220 | |||
| 97f0749f5c | |||
| 82210a99c9 |
@ -2057,7 +2057,9 @@ export default function Estimate({}) {
|
|||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td className="al-r">
|
<td className="al-r">
|
||||||
{convertNumberToPriceDecimal(
|
{item?.openFlg === '1'
|
||||||
|
? 'OPEN'
|
||||||
|
: convertNumberToPriceDecimal(
|
||||||
item?.showSaleTotPrice === '0'
|
item?.showSaleTotPrice === '0'
|
||||||
? null
|
? null
|
||||||
: item?.amount === ''
|
: item?.amount === ''
|
||||||
|
|||||||
@ -239,6 +239,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
if (i === selectedRoof.index) {
|
if (i === selectedRoof.index) {
|
||||||
return {
|
return {
|
||||||
...selectedRoof,
|
...selectedRoof,
|
||||||
|
hajebichi,
|
||||||
eavesMargin,
|
eavesMargin,
|
||||||
ridgeMargin,
|
ridgeMargin,
|
||||||
kerabaMargin,
|
kerabaMargin,
|
||||||
@ -268,8 +269,6 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isComplete = async () => {
|
const isComplete = async () => {
|
||||||
console.log('roofs', roofs)
|
|
||||||
|
|
||||||
const newAddedRoofs = roofs.map((roof, i) => {
|
const newAddedRoofs = roofs.map((roof, i) => {
|
||||||
if (i === selectedRoof?.index) {
|
if (i === selectedRoof?.index) {
|
||||||
return {
|
return {
|
||||||
@ -292,6 +291,8 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
snowGdPossYn,
|
snowGdPossYn,
|
||||||
cvrChecked,
|
cvrChecked,
|
||||||
snowGdChecked,
|
snowGdChecked,
|
||||||
|
setupCover: cvrChecked,
|
||||||
|
setupSnowCover: snowGdChecked,
|
||||||
},
|
},
|
||||||
trestleDetail: trestleDetail,
|
trestleDetail: trestleDetail,
|
||||||
}
|
}
|
||||||
@ -300,7 +301,6 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
let result = true
|
let result = true
|
||||||
console.log('newAddedRoofs', newAddedRoofs)
|
|
||||||
newAddedRoofs.forEach((roof) => {
|
newAddedRoofs.forEach((roof) => {
|
||||||
if (!roof?.eavesMargin || !roof?.ridgeMargin || !roof?.kerabaMargin) result = false
|
if (!roof?.eavesMargin || !roof?.ridgeMargin || !roof?.kerabaMargin) result = false
|
||||||
if (!roof.trestle?.trestleMkrCd) result = false
|
if (!roof.trestle?.trestleMkrCd) result = false
|
||||||
@ -367,8 +367,8 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
// ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp),
|
// ...constructionList.find((construction) => newAddedRoofs[index].construction.constTp === construction.constTp),
|
||||||
...roof.construction,
|
...roof.construction,
|
||||||
roofIndex: roof.index,
|
roofIndex: roof.index,
|
||||||
setupCover: roof.cvrYn === 'Y',
|
setupCover: cvrChecked,
|
||||||
setupSnowCover: roof.snowGdYn === 'Y',
|
setupSnowCover: snowGdChecked,
|
||||||
selectedIndex: roof.index,
|
selectedIndex: roof.index,
|
||||||
},
|
},
|
||||||
trestleDetail: roof.trestleDetail,
|
trestleDetail: roof.trestleDetail,
|
||||||
@ -461,7 +461,7 @@ const Trestle = forwardRef((props, ref) => {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-origin block"
|
className="input-origin block"
|
||||||
disabled={selectedRoof.roofPchAuth === 'R'}
|
disabled={selectedRoof.roofPchAuth === 'R'}
|
||||||
onChange={(e) => handleHajebichiAndLength(e, 'hajebichi')}
|
onChange={(e) => setHajebichi(e.target.value)}
|
||||||
value={hajebichi}
|
value={hajebichi}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -23,6 +23,7 @@ const trestleReducer = (state, action) => {
|
|||||||
return {
|
return {
|
||||||
moduleTpCd: action.roof.module?.itemTp ?? '',
|
moduleTpCd: action.roof.module?.itemTp ?? '',
|
||||||
roofMatlCd: action.roof?.roofMatlCd ?? '',
|
roofMatlCd: action.roof?.roofMatlCd ?? '',
|
||||||
|
hajebichi: action.roof?.hajebichi ?? 0,
|
||||||
raftBaseCd: action.roof?.raftBaseCd ?? null,
|
raftBaseCd: action.roof?.raftBaseCd ?? null,
|
||||||
trestleMkrCd: action.roof.trestle?.trestleMkrCd ?? null,
|
trestleMkrCd: action.roof.trestle?.trestleMkrCd ?? null,
|
||||||
constMthdCd: action.roof.trestle?.constMthdCd ?? null,
|
constMthdCd: action.roof.trestle?.constMthdCd ?? null,
|
||||||
@ -80,7 +81,7 @@ export function useModuleTrestle(props) {
|
|||||||
// setRidgeMargin(selectedRoof?.addRoof?.ridgeMargin ?? 0)
|
// setRidgeMargin(selectedRoof?.addRoof?.ridgeMargin ?? 0)
|
||||||
// setKerabaMargin(selectedRoof?.addRoof?.kerabaMargin ?? 0)
|
// setKerabaMargin(selectedRoof?.addRoof?.kerabaMargin ?? 0)
|
||||||
|
|
||||||
setHajebichi(selectedRoof?.trestle?.hajebichi ?? 0)
|
setHajebichi(selectedRoof?.hajebichi ?? 0)
|
||||||
setEavesMargin(selectedRoof?.eavesMargin ?? 0)
|
setEavesMargin(selectedRoof?.eavesMargin ?? 0)
|
||||||
setRidgeMargin(selectedRoof?.ridgeMargin ?? 0)
|
setRidgeMargin(selectedRoof?.ridgeMargin ?? 0)
|
||||||
setKerabaMargin(selectedRoof?.kerabaMargin ?? 0)
|
setKerabaMargin(selectedRoof?.kerabaMargin ?? 0)
|
||||||
|
|||||||
@ -717,6 +717,9 @@ export const useTrestle = () => {
|
|||||||
|
|
||||||
if (result.resultCode === 'E') {
|
if (result.resultCode === 'E') {
|
||||||
swalFire({ text: result.resultMsg, icon: 'error' })
|
swalFire({ text: result.resultMsg, icon: 'error' })
|
||||||
|
clear()
|
||||||
|
setViewCircuitNumberTexts(true)
|
||||||
|
setIsGlobalLoading(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -28,6 +28,7 @@ import { useCanvasPopupStatusController } from '@/hooks/common/useCanvasPopupSta
|
|||||||
import { outerLinePointsState } from '@/store/outerLineAtom'
|
import { outerLinePointsState } from '@/store/outerLineAtom'
|
||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { usePlan } from '@/hooks/usePlan'
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
|
import { roofsState } from '@/store/roofAtom'
|
||||||
|
|
||||||
export function useRoofAllocationSetting(id) {
|
export function useRoofAllocationSetting(id) {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -54,7 +55,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
const { setIsGlobalLoading } = useContext(QcastContext)
|
const { setIsGlobalLoading } = useContext(QcastContext)
|
||||||
const { setSurfaceShapePattern } = useRoofFn()
|
const { setSurfaceShapePattern } = useRoofFn()
|
||||||
const { saveCanvas } = usePlan()
|
const { saveCanvas } = usePlan()
|
||||||
|
const [roofsStore, setRoofsStore] = useRecoilState(roofsState)
|
||||||
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
const [moduleSelectionData, setModuleSelectionData] = useRecoilState(moduleSelectionDataState)
|
||||||
const resetPoints = useResetRecoilState(outerLinePointsState)
|
const resetPoints = useResetRecoilState(outerLinePointsState)
|
||||||
|
|
||||||
@ -265,6 +266,8 @@ export function useRoofAllocationSetting(id) {
|
|||||||
newRoofList[0].selected = true
|
newRoofList[0].selected = true
|
||||||
}
|
}
|
||||||
setCurrentRoofList(newRoofList)
|
setCurrentRoofList(newRoofList)
|
||||||
|
setRoofsStore(newRoofList)
|
||||||
|
setModuleSelectionData({ ...moduleSelectionData, roofConstructions: newRoofList })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -305,12 +308,14 @@ export function useRoofAllocationSetting(id) {
|
|||||||
|
|
||||||
setRoofList(newRoofList)
|
setRoofList(newRoofList)
|
||||||
setRoofMaterials(newRoofList)
|
setRoofMaterials(newRoofList)
|
||||||
|
setRoofsStore(newRoofList)
|
||||||
const selectedRoofMaterial = newRoofList.find((roof) => roof.selected)
|
const selectedRoofMaterial = newRoofList.find((roof) => roof.selected)
|
||||||
setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial, true)
|
setSurfaceShapePattern(currentObject, roofDisplay.column, false, selectedRoofMaterial, true)
|
||||||
drawDirectionArrow(currentObject)
|
drawDirectionArrow(currentObject)
|
||||||
modifyModuleSelectionData()
|
modifyModuleSelectionData()
|
||||||
closeAll()
|
closeAll()
|
||||||
basicSettingSave()
|
basicSettingSave()
|
||||||
|
setModuleSelectionData({ ...moduleSelectionData, roofConstructions: newRoofList })
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -419,7 +424,7 @@ export function useRoofAllocationSetting(id) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
setRoofMaterials(newRoofList)
|
setRoofMaterials(newRoofList)
|
||||||
|
setRoofsStore(newRoofList)
|
||||||
/** 외곽선 삭제 */
|
/** 외곽선 삭제 */
|
||||||
const removeTargets = canvas.getObjects().filter((obj) => obj.name === 'outerLinePoint' || obj.name === 'outerLine')
|
const removeTargets = canvas.getObjects().filter((obj) => obj.name === 'outerLinePoint' || obj.name === 'outerLine')
|
||||||
removeTargets.forEach((obj) => {
|
removeTargets.forEach((obj) => {
|
||||||
|
|||||||
@ -77,10 +77,10 @@ export function useEvent() {
|
|||||||
setCanvasZoom(Number((zoom * 100).toFixed(0)))
|
setCanvasZoom(Number((zoom * 100).toFixed(0)))
|
||||||
|
|
||||||
// 마우스 위치 기준으로 확대/축소
|
// 마우스 위치 기준으로 확대/축소
|
||||||
canvas.zoomToPoint({ x: opt.e.offsetX, y: opt.e.offsetY }, zoom)
|
canvas.zoomToPoint(new fabric.Point(opt.e.offsetX, opt.e.offsetY), zoom)
|
||||||
|
|
||||||
canvas.requestRenderAll()
|
|
||||||
canvas.calcOffset()
|
canvas.calcOffset()
|
||||||
|
canvas.setViewportTransform(canvas.viewportTransform)
|
||||||
|
canvas.requestRenderAll()
|
||||||
|
|
||||||
// 이벤트의 기본 동작 방지 (스크롤 방지)
|
// 이벤트의 기본 동작 방지 (스크롤 방지)
|
||||||
opt.e.preventDefault()
|
opt.e.preventDefault()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user