Compare commits
10 Commits
12936ec1f9
...
a7ddfacdd2
| Author | SHA1 | Date | |
|---|---|---|---|
| a7ddfacdd2 | |||
| b51dacf421 | |||
| f25dac0ae3 | |||
| c99deaf93f | |||
| 8d65765daf | |||
| 2f8ca712c9 | |||
| f2470b346c | |||
| 1a5f78a970 | |||
| 5979555bcb | |||
| 26047df3c8 |
@ -175,7 +175,10 @@ export default function Estimate({}) {
|
|||||||
row.check = false
|
row.check = false
|
||||||
estimateOption.map((row2) => {
|
estimateOption.map((row2) => {
|
||||||
if (row.pkgYn === '0') {
|
if (row.pkgYn === '0') {
|
||||||
if (row2 === row.code) {
|
// if (row2 === row.code) {
|
||||||
|
// row.check = true
|
||||||
|
// }
|
||||||
|
if (row.code.split('、').includes(row2)) {
|
||||||
row.check = true
|
row.check = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -217,7 +220,10 @@ export default function Estimate({}) {
|
|||||||
row.check = false
|
row.check = false
|
||||||
estimateOption.map((row2) => {
|
estimateOption.map((row2) => {
|
||||||
if (row.pkgYn === '0') {
|
if (row.pkgYn === '0') {
|
||||||
if (row2 === row.code) {
|
// if (row2 === row.code) {
|
||||||
|
// row.check = true
|
||||||
|
// }
|
||||||
|
if (row.code.split('、').includes(row2)) {
|
||||||
row.check = true
|
row.check = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -240,7 +246,6 @@ export default function Estimate({}) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
setSpecialNoteList(res)
|
setSpecialNoteList(res)
|
||||||
|
|
||||||
setSpecialNoteFirstFlg(true)
|
setSpecialNoteFirstFlg(true)
|
||||||
@ -469,6 +474,21 @@ export default function Estimate({}) {
|
|||||||
} else {
|
} else {
|
||||||
item.check = false
|
item.check = false
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
let codes = item.code.split('、')
|
||||||
|
let flg = '0'
|
||||||
|
if (codes.length > 1) {
|
||||||
|
for (let i = 0; i < pushData.length; i++) {
|
||||||
|
if (codes.indexOf(pushData[i]) > -1) {
|
||||||
|
flg = '1'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (flg === '1') {
|
||||||
|
item.check = true
|
||||||
|
} else {
|
||||||
|
item.check = false
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@ import { useCanvasSetting } from '@/hooks/option/useCanvasSetting'
|
|||||||
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { compasDegAtom } from '@/store/orientationAtom'
|
import { compasDegAtom } from '@/store/orientationAtom'
|
||||||
|
import { hotkeyStore } from '@/store/hotkeyAtom'
|
||||||
|
|
||||||
export default function CanvasFrame() {
|
export default function CanvasFrame() {
|
||||||
const canvasRef = useRef(null)
|
const canvasRef = useRef(null)
|
||||||
@ -110,6 +111,38 @@ export default function CanvasFrame() {
|
|||||||
resetPcsCheckState()
|
resetPcsCheckState()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 캔버스가 있을 경우 핫키 이벤트 처리
|
||||||
|
* hotkeyStore에 핫키 이벤트 리스너 추가
|
||||||
|
*
|
||||||
|
* const hotkeys = [
|
||||||
|
{ key: 'c', fn: () => asdf() },
|
||||||
|
{ key: 'v', fn: () => qwer() },
|
||||||
|
]
|
||||||
|
setHotkeyStore(hotkeys)
|
||||||
|
*/
|
||||||
|
const hotkeyState = useRecoilValue(hotkeyStore)
|
||||||
|
const hotkeyHandlerRef = useRef(null)
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
hotkeyHandlerRef.current = (e) => {
|
||||||
|
hotkeyState.forEach((hotkey) => {
|
||||||
|
if (e.key === hotkey.key) {
|
||||||
|
hotkey.fn()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('keyup', hotkeyHandlerRef.current)
|
||||||
|
|
||||||
|
return () => {
|
||||||
|
if (hotkeyHandlerRef.current) {
|
||||||
|
document.removeEventListener('keyup', hotkeyHandlerRef.current)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}, [hotkeyState])
|
||||||
|
/** 핫키 이벤트 처리 끝 */
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="canvas-frame">
|
<div className="canvas-frame">
|
||||||
<canvas ref={canvasRef} id="canvas" style={{ position: 'relative' }}></canvas>
|
<canvas ref={canvasRef} id="canvas" style={{ position: 'relative' }}></canvas>
|
||||||
|
|||||||
@ -136,7 +136,7 @@ export const useEstimateController = (planNo, flag) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setEstimateData({ ...estimateContextState, userId: session.userId, sapSalesStoreCd: session.custCd })
|
setEstimateData({ ...estimateContextState, userId: session.userId })
|
||||||
}, [estimateContextState])
|
}, [estimateContextState])
|
||||||
|
|
||||||
// 첨부파일 다운로드
|
// 첨부파일 다운로드
|
||||||
@ -452,8 +452,6 @@ export const useEstimateController = (planNo, flag) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: session.storeId,
|
|
||||||
sapSalesStoreCd: session.custCd,
|
|
||||||
objectNo: estimateData.objectNo,
|
objectNo: estimateData.objectNo,
|
||||||
planNo: sendPlanNo,
|
planNo: sendPlanNo,
|
||||||
copySaleStoreId: otherSaleStoreId ? otherSaleStoreId : saleStoreId,
|
copySaleStoreId: otherSaleStoreId ? otherSaleStoreId : saleStoreId,
|
||||||
@ -462,24 +460,30 @@ export const useEstimateController = (planNo, flag) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
await promisePost({ url: '/api/estimate/save-estimate-copy', data: params }).then((res) => {
|
await promisePost({ url: '/api/estimate/save-estimate-copy', data: params })
|
||||||
setIsGlobalLoading(false)
|
.then((res) => {
|
||||||
if (res.status === 201) {
|
|
||||||
if (isObjectNotEmpty(res.data)) {
|
|
||||||
let newObjectNo = res.data.objectNo
|
|
||||||
swalFire({
|
|
||||||
text: getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'),
|
|
||||||
type: 'alert',
|
|
||||||
confirmFn: () => {
|
|
||||||
setEstimateCopyPopupOpen(false) //팝업닫고
|
|
||||||
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
setIsGlobalLoading(false)
|
setIsGlobalLoading(false)
|
||||||
}
|
if (res.status === 201) {
|
||||||
})
|
if (isObjectNotEmpty(res.data)) {
|
||||||
|
let newObjectNo = res.data.objectNo
|
||||||
|
swalFire({
|
||||||
|
text: getMessage('estimate.detail.estimateCopyPopup.copy.alertMessage'),
|
||||||
|
type: 'alert',
|
||||||
|
confirmFn: () => {
|
||||||
|
setEstimateCopyPopupOpen(false) //팝업닫고
|
||||||
|
router.push(`/management/stuff/detail?objectNo=${newObjectNo.toString()}`, { scroll: false })
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.catch((e) => {
|
||||||
|
console.error('캔버스 복사 중 오류 발생')
|
||||||
|
swalFire({ text: getMessage('estimate.detail.estimateCopyPopup.copy.alertMessageError'), type: 'alert', icon: 'error' })
|
||||||
|
setIsGlobalLoading(false)
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const checkLength = (value) => {
|
const checkLength = (value) => {
|
||||||
|
|||||||
@ -958,6 +958,7 @@
|
|||||||
"estimate.detail.estimateCopyPopup.close": "閉じる",
|
"estimate.detail.estimateCopyPopup.close": "閉じる",
|
||||||
"estimate.detail.estimateCopyPopup.copyBtn": "見積コピー",
|
"estimate.detail.estimateCopyPopup.copyBtn": "見積コピー",
|
||||||
"estimate.detail.estimateCopyPopup.copy.alertMessage": "見積書がコピーされました。コピーした見積情報に移動します。",
|
"estimate.detail.estimateCopyPopup.copy.alertMessage": "見積書がコピーされました。コピーした見積情報に移動します。",
|
||||||
|
"estimate.detail.estimateCopyPopup.copy.alertMessageError": "キャンバスのコピー中にエラーが発生しました.",
|
||||||
"estimate.detail.productFeaturesPopup.title": "製品特異事項",
|
"estimate.detail.productFeaturesPopup.title": "製品特異事項",
|
||||||
"estimate.detail.productFeaturesPopup.close": "閉じる",
|
"estimate.detail.productFeaturesPopup.close": "閉じる",
|
||||||
"estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です。",
|
"estimate.detail.productFeaturesPopup.requiredStoreId": "一次販売店は必須です。",
|
||||||
@ -1039,5 +1040,5 @@
|
|||||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※数字は[半角]入力のみ可能です。)",
|
"modal.placement.initial.setting.plan.drawing.only.number": "(※数字は[半角]入力のみ可能です。)",
|
||||||
"wall.line.not.found": "外壁がありません",
|
"wall.line.not.found": "外壁がありません",
|
||||||
"roof.line.not.found": "屋根形状がありません",
|
"roof.line.not.found": "屋根形状がありません",
|
||||||
"roof.material.can.not.delete" : "割り当てられた配置面があります。"
|
"roof.material.can.not.delete": "割り当てられた配置面があります。"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -958,6 +958,7 @@
|
|||||||
"estimate.detail.estimateCopyPopup.close": "닫기",
|
"estimate.detail.estimateCopyPopup.close": "닫기",
|
||||||
"estimate.detail.estimateCopyPopup.copyBtn": "견적복사",
|
"estimate.detail.estimateCopyPopup.copyBtn": "견적복사",
|
||||||
"estimate.detail.estimateCopyPopup.copy.alertMessage": "견적서가 복사되었습니다. 복사된 물건정보로 이동합니다.",
|
"estimate.detail.estimateCopyPopup.copy.alertMessage": "견적서가 복사되었습니다. 복사된 물건정보로 이동합니다.",
|
||||||
|
"estimate.detail.estimateCopyPopup.copy.alertMessageError": "캔버스 복사 중 오류 발생.",
|
||||||
"estimate.detail.productFeaturesPopup.title": "제품특이사항",
|
"estimate.detail.productFeaturesPopup.title": "제품특이사항",
|
||||||
"estimate.detail.productFeaturesPopup.close": "닫기",
|
"estimate.detail.productFeaturesPopup.close": "닫기",
|
||||||
"estimate.detail.productFeaturesPopup.requiredStoreId": "1차 판매점은 필수값 입니다.",
|
"estimate.detail.productFeaturesPopup.requiredStoreId": "1차 판매점은 필수값 입니다.",
|
||||||
@ -1039,5 +1040,5 @@
|
|||||||
"modal.placement.initial.setting.plan.drawing.only.number": "(※ 숫자는 [반각]입력만 가능합니다.)",
|
"modal.placement.initial.setting.plan.drawing.only.number": "(※ 숫자는 [반각]입력만 가능합니다.)",
|
||||||
"wall.line.not.found": "외벽선이 없습니다.",
|
"wall.line.not.found": "외벽선이 없습니다.",
|
||||||
"roof.line.not.found": "지붕형상이 없습니다.",
|
"roof.line.not.found": "지붕형상이 없습니다.",
|
||||||
"roof.material.can.not.delete" : "할당된 배치면이 있습니다."
|
"roof.material.can.not.delete": "할당된 배치면이 있습니다."
|
||||||
}
|
}
|
||||||
|
|||||||
6
src/store/hotkeyAtom.js
Normal file
6
src/store/hotkeyAtom.js
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
import { atom } from 'recoil'
|
||||||
|
|
||||||
|
export const hotkeyStore = atom({
|
||||||
|
key: 'hotkeyState',
|
||||||
|
default: [],
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user