Compare commits
No commits in common. "61d8c083b21b4d5b5bdbe402cbd220e9452ddd6e" and "c0b38a00b33c5fb025925efcd0af1ba1562d96ce" have entirely different histories.
61d8c083b2
...
c0b38a00b3
@ -1075,7 +1075,7 @@ export default function Estimate({}) {
|
|||||||
item.showSaleTotPrice = '0'
|
item.showSaleTotPrice = '0'
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.dispCableFlg === '1' && item.itemTpCd !== 'M12') {
|
if (item.dispCableFlg === '1') {
|
||||||
dispCableFlgCnt++
|
dispCableFlgCnt++
|
||||||
setCableItem(item.itemId)
|
setCableItem(item.itemId)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,9 @@
|
|||||||
import { useEffect, useState } from 'react'
|
import { useEffect, useState } from 'react'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { canvasSizeState, canvasState, canvasZoomState, currentMenuState, currentObjectState } from '@/store/canvasAtom'
|
import { canvasSizeState, canvasState, canvasZoomState, currentObjectState } from '@/store/canvasAtom'
|
||||||
import { QPolygon } from '@/components/fabric/QPolygon'
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
import { fontSelector } from '@/store/fontAtom'
|
import { fontSelector } from '@/store/fontAtom'
|
||||||
import { MENU } from '@/common/common'
|
|
||||||
|
|
||||||
// 캔버스에 필요한 이벤트
|
// 캔버스에 필요한 이벤트
|
||||||
export function useCanvasEvent() {
|
export function useCanvasEvent() {
|
||||||
@ -14,16 +13,11 @@ export function useCanvasEvent() {
|
|||||||
const canvasSize = useRecoilValue(canvasSizeState)
|
const canvasSize = useRecoilValue(canvasSizeState)
|
||||||
const [canvasZoom, setCanvasZoom] = useRecoilState(canvasZoomState)
|
const [canvasZoom, setCanvasZoom] = useRecoilState(canvasZoomState)
|
||||||
const lengthTextOption = useRecoilValue(fontSelector('lengthText'))
|
const lengthTextOption = useRecoilValue(fontSelector('lengthText'))
|
||||||
const currentMenu = useRecoilValue(currentMenuState)
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
canvas?.setZoom(canvasZoom / 100)
|
canvas?.setZoom(canvasZoom / 100)
|
||||||
}, [canvasZoom])
|
}, [canvasZoom])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
attachDefaultEventOnCanvas()
|
|
||||||
}, [currentMenu])
|
|
||||||
|
|
||||||
// 기본적인 이벤트 필요시 추가
|
// 기본적인 이벤트 필요시 추가
|
||||||
const attachDefaultEventOnCanvas = () => {
|
const attachDefaultEventOnCanvas = () => {
|
||||||
removeEventOnCanvas()
|
removeEventOnCanvas()
|
||||||
@ -204,7 +198,7 @@ export function useCanvasEvent() {
|
|||||||
|
|
||||||
if (selected?.length > 0) {
|
if (selected?.length > 0) {
|
||||||
selected.forEach((obj) => {
|
selected.forEach((obj) => {
|
||||||
if (obj.type === 'QPolygon' && currentMenu !== MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING) {
|
if (obj.type === 'QPolygon') {
|
||||||
obj.set({ stroke: 'red' })
|
obj.set({ stroke: 'red' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -217,7 +211,7 @@ export function useCanvasEvent() {
|
|||||||
|
|
||||||
if (deselected?.length > 0) {
|
if (deselected?.length > 0) {
|
||||||
deselected.forEach((obj) => {
|
deselected.forEach((obj) => {
|
||||||
if (obj.type === 'QPolygon' && currentMenu !== MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING) {
|
if (obj.type === 'QPolygon') {
|
||||||
if (obj.name !== 'moduleSetupSurface') {
|
if (obj.name !== 'moduleSetupSurface') {
|
||||||
obj.set({ stroke: 'black' })
|
obj.set({ stroke: 'black' })
|
||||||
}
|
}
|
||||||
@ -233,7 +227,7 @@ export function useCanvasEvent() {
|
|||||||
|
|
||||||
if (deselected?.length > 0) {
|
if (deselected?.length > 0) {
|
||||||
deselected.forEach((obj) => {
|
deselected.forEach((obj) => {
|
||||||
if (obj.type === 'QPolygon' && currentMenu !== MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING) {
|
if (obj.type === 'QPolygon') {
|
||||||
obj.set({ stroke: 'black' })
|
obj.set({ stroke: 'black' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -241,7 +235,7 @@ export function useCanvasEvent() {
|
|||||||
|
|
||||||
if (selected?.length > 0) {
|
if (selected?.length > 0) {
|
||||||
selected.forEach((obj) => {
|
selected.forEach((obj) => {
|
||||||
if (obj.type === 'QPolygon' && currentMenu !== MENU.MODULE_CIRCUIT_SETTING.BASIC_SETTING) {
|
if (obj.type === 'QPolygon') {
|
||||||
obj.set({ stroke: 'red' })
|
obj.set({ stroke: 'red' })
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user