Compare commits
13 Commits
af627035cd
...
2ee0dc45f0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ee0dc45f0 | ||
| 4e8cc409d4 | |||
| 8ab41c8eda | |||
| 7fb232d9ae | |||
| 3a37d637ed | |||
| 17e88e5d3c | |||
| 5d3a7aa9cc | |||
| d886bb135f | |||
| ed68a93b20 | |||
| d8a7986120 | |||
| 058a3eabc6 | |||
| 5101fab027 | |||
| 50aa5ca556 |
@ -2,7 +2,7 @@ NEXT_PUBLIC_API_SERVER_PATH="https://api.hanasys.jp/"
|
|||||||
|
|
||||||
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"
|
NEXT_PUBLIC_HOST_URL="//1.248.227.176:4000"
|
||||||
|
|
||||||
NEXT_PUBLIC_API_HOST_URL="https://www.hanasys.jp/"
|
NEXT_PUBLIC_API_HOST_URL="https://www.hanasys.jp"
|
||||||
|
|
||||||
SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y="
|
SESSION_SECRET="i3iHH1yp2/2SpQSIySQ4bpyc4g0D+zCF9FAn5xUG0+Y="
|
||||||
|
|
||||||
|
|||||||
@ -210,6 +210,7 @@ export const SAVE_KEY = [
|
|||||||
'toFixed',
|
'toFixed',
|
||||||
'startPoint',
|
'startPoint',
|
||||||
'endPoint',
|
'endPoint',
|
||||||
|
'editable',
|
||||||
'isSortedPoints',
|
'isSortedPoints',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|||||||
@ -195,9 +195,7 @@ export default function Qna() {
|
|||||||
))
|
))
|
||||||
) : (
|
) : (
|
||||||
<tr>
|
<tr>
|
||||||
<td colSpan={4} className="al-c">
|
<td className="al-c no-data" colSpan={5}>{getMessage('common.message.no.data')}</td>
|
||||||
{getMessage('common.message.no.data')}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
)}
|
)}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
@ -27,6 +27,7 @@ export default function QnaRegModal({ setOpen, setReload, searchValue, selectPag
|
|||||||
const qnaTypeLgCodeRef = useRef(null)
|
const qnaTypeLgCodeRef = useRef(null)
|
||||||
const qnaTypeMdCodeRef = useRef(null)
|
const qnaTypeMdCodeRef = useRef(null)
|
||||||
const qnaTypeSmCodeRef = useRef(null)
|
const qnaTypeSmCodeRef = useRef(null)
|
||||||
|
const qstMail = useRef(null);
|
||||||
const regUserNmRef = useRef(null)
|
const regUserNmRef = useRef(null)
|
||||||
const regUserTelNoRef = useRef(null)
|
const regUserTelNoRef = useRef(null)
|
||||||
const titleRef = useRef(null)
|
const titleRef = useRef(null)
|
||||||
@ -65,6 +66,7 @@ let fileCheck = false;
|
|||||||
const initQnaReg = async () => {
|
const initQnaReg = async () => {
|
||||||
|
|
||||||
|
|
||||||
|
qstMail.current.value = ''
|
||||||
regUserNmRef.current.value = ''
|
regUserNmRef.current.value = ''
|
||||||
regUserTelNoRef.current.value = ''
|
regUserTelNoRef.current.value = ''
|
||||||
qnaTypeLgCodeRef.current.setValue();
|
qnaTypeLgCodeRef.current.setValue();
|
||||||
@ -148,7 +150,7 @@ let fileCheck = false;
|
|||||||
if(!fileCheck) return;
|
if(!fileCheck) return;
|
||||||
|
|
||||||
fileUploadProps.uploadFiles.forEach((file) => {
|
fileUploadProps.uploadFiles.forEach((file) => {
|
||||||
console.log("file::::::::",file)
|
//console.log("file::::::::",file)
|
||||||
formData.push(file)
|
formData.push(file)
|
||||||
|
|
||||||
})
|
})
|
||||||
@ -156,6 +158,16 @@ let fileCheck = false;
|
|||||||
fileCheck = false;
|
fileCheck = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const isValidEmail = (email) => {
|
||||||
|
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
|
||||||
|
return emailRegex.test(email);
|
||||||
|
};
|
||||||
|
|
||||||
|
const isEmpty = (value) => {
|
||||||
|
return value === null || value === undefined || value.trim() === "";
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
const handleQnaSubmit = async () => {
|
const handleQnaSubmit = async () => {
|
||||||
//필수 체크
|
//필수 체크
|
||||||
|
|
||||||
@ -164,13 +176,22 @@ let fileCheck = false;
|
|||||||
|
|
||||||
let regUserNm = qnaData?.regUserNm??'';
|
let regUserNm = qnaData?.regUserNm??'';
|
||||||
|
|
||||||
if (regUserNm.trim().length === 0) {
|
if (!isValidEmail(qnaData.qstMail)) {
|
||||||
|
qstMail.current.focus();
|
||||||
|
swalFire({
|
||||||
|
title: getMessage('qna.reg.alert.require.qstMail'),
|
||||||
|
icon: 'warning',
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
regUserNmRef.current.value = '';
|
|
||||||
|
if (isEmpty(regUserNm)) {
|
||||||
|
regUserNmRef.current.value = '';
|
||||||
regUserNmRef.current.focus()
|
regUserNmRef.current.focus()
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('qna.reg.alert.require.regUserNm'),
|
title: getMessage('qna.reg.alert.require.regUserNm'),
|
||||||
type: 'alert',
|
icon: 'warning',
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -178,35 +199,35 @@ let fileCheck = false;
|
|||||||
let qnaClsLrgCd = qnaData?.qnaClsLrgCd??'';
|
let qnaClsLrgCd = qnaData?.qnaClsLrgCd??'';
|
||||||
let qnaClsMidCd = qnaData?.qnaClsMidCd??'';
|
let qnaClsMidCd = qnaData?.qnaClsMidCd??'';
|
||||||
|
|
||||||
if (qnaClsLrgCd.trim().length === 0 || qnaClsMidCd.trim().length === 0 ) {
|
if (isEmpty(qnaClsLrgCd) || isEmpty(qnaClsMidCd) ) {
|
||||||
(qnaClsLrgCd.trim().length === 0)?qnaTypeLgCodeRef.current.focus():qnaTypeMdCodeRef.current.focus()
|
(isEmpty(qnaClsLrgCd))?qnaTypeLgCodeRef.current.focus():qnaTypeMdCodeRef.current.focus()
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('qna.reg.alert.select.type'),
|
title: getMessage('qna.reg.alert.select.type'),
|
||||||
type: 'alert',
|
icon: 'warning',
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
let title = qnaData?.title??'';
|
let title = qnaData?.title??'';
|
||||||
|
|
||||||
if (title.trim().length === 0) {
|
if (isEmpty(title)) {
|
||||||
titleRef.current.value = '';
|
titleRef.current.value = '';
|
||||||
titleRef.current.focus()
|
titleRef.current.focus()
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('qna.reg.alert.require.title'),
|
title: getMessage('qna.reg.alert.require.title'),
|
||||||
type: 'alert',
|
icon: 'warning',
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
//console.log("5::::",qnaData)
|
//console.log("5::::",qnaData)
|
||||||
let contents = qnaData?.contents??'';
|
let contents = qnaData?.contents??'';
|
||||||
|
|
||||||
if (contents.trim().length === 0) {
|
if (isEmpty(contents)) {
|
||||||
contentsRef.current.value = '';
|
contentsRef.current.value = '';
|
||||||
contentsRef.current.focus()
|
contentsRef.current.focus()
|
||||||
swalFire({
|
swalFire({
|
||||||
text: getMessage('qna.reg.alert.require.contents'),
|
title: getMessage('qna.reg.alert.require.contents'),
|
||||||
type: 'alert',
|
icon: 'warning',
|
||||||
})
|
})
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
@ -310,7 +331,13 @@ let fileCheck = false;
|
|||||||
<th>{getMessage('qna.list.header.regNm')}</th>
|
<th>{getMessage('qna.list.header.regNm')}</th>
|
||||||
<td><input type="text" className="input-light" value={sessionState?.userNm || ''} readOnly /></td>
|
<td><input type="text" className="input-light" value={sessionState?.userNm || ''} readOnly /></td>
|
||||||
<th>E-Mail<span className="red">*</span></th>
|
<th>E-Mail<span className="red">*</span></th>
|
||||||
<td ><input type="text" className="input-light" value={sessionState?.email || ''} readOnly /></td>
|
<td ><input type="text" className="input-light" required
|
||||||
|
ref={qstMail}
|
||||||
|
value={qnaData?.qstMail || ''}
|
||||||
|
onChange={(e) => setQnaData({...qnaData, qstMail: e.target.value })}
|
||||||
|
onBlur={(e) => setQnaData({ ...qnaData, qstMail: e.target.value })} />
|
||||||
|
</td>
|
||||||
|
|
||||||
<th>{getMessage('qna.reg.header.regDt')}</th>
|
<th>{getMessage('qna.reg.header.regDt')}</th>
|
||||||
<td>{dayjs(new Date()).format('YYYY-MM-DD')}</td>
|
<td>{dayjs(new Date()).format('YYYY-MM-DD')}</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -401,8 +428,8 @@ let fileCheck = false;
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div className="footer-btn-wrap">
|
<div className="footer-btn-wrap">
|
||||||
{isBtnDisable === false && <button className="btn-origin grey mr5" onClick={handleQnaSubmit}>{getMessage("qna.reg.header.save")}</button>}
|
{isBtnDisable === false && <button className="btn-origin navy mr5" onClick={handleQnaSubmit}>{getMessage("qna.reg.header.save")}</button>}
|
||||||
<button className="btn-origin navy" onClick={() => {
|
<button className="btn-origin grey" onClick={() => {
|
||||||
setOpen(false)
|
setOpen(false)
|
||||||
}}>{getMessage("board.sub.btn.close")}</button>
|
}}>{getMessage("board.sub.btn.close")}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -50,6 +50,7 @@ import JA from '@/locales/ja.json'
|
|||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
import { useRoofFn } from '@/hooks/common/useRoofFn'
|
||||||
import { usePolygon } from '@/hooks/usePolygon'
|
import { usePolygon } from '@/hooks/usePolygon'
|
||||||
|
import { useTrestle } from '@/hooks/module/useTrestle'
|
||||||
export default function CanvasMenu(props) {
|
export default function CanvasMenu(props) {
|
||||||
const { selectedMenu, setSelectedMenu } = props
|
const { selectedMenu, setSelectedMenu } = props
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
@ -67,6 +68,7 @@ export default function CanvasMenu(props) {
|
|||||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
const globalLocale = useRecoilValue(globalLocaleStore)
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { handleZoomClear, handleZoom } = useCanvasEvent()
|
const { handleZoomClear, handleZoom } = useCanvasEvent()
|
||||||
|
const { setAllModuleSurfaceIsComplete, isAllComplete } = useTrestle()
|
||||||
const { handleMenu } = useMenu()
|
const { handleMenu } = useMenu()
|
||||||
// const urlParams = useSearchParams()
|
// const urlParams = useSearchParams()
|
||||||
const { handleEstimateSubmit, fetchSetting, estimateContextState, setEstimateContextState } = useEstimateController()
|
const { handleEstimateSubmit, fetchSetting, estimateContextState, setEstimateContextState } = useEstimateController()
|
||||||
@ -194,6 +196,7 @@ export default function CanvasMenu(props) {
|
|||||||
confirmFn: () => {
|
confirmFn: () => {
|
||||||
//해당 메뉴 이동시 배치면 삭제
|
//해당 메뉴 이동시 배치면 삭제
|
||||||
|
|
||||||
|
setAllModuleSurfaceIsComplete(false)
|
||||||
const moduleSurfacesArray = canvas
|
const moduleSurfacesArray = canvas
|
||||||
.getObjects()
|
.getObjects()
|
||||||
.filter((obj) => [POLYGON_TYPE.MODULE_SETUP_SURFACE, POLYGON_TYPE.MODULE, POLYGON_TYPE.OBJECT_SURFACE].includes(obj.name))
|
.filter((obj) => [POLYGON_TYPE.MODULE_SETUP_SURFACE, POLYGON_TYPE.MODULE, POLYGON_TYPE.OBJECT_SURFACE].includes(obj.name))
|
||||||
@ -233,6 +236,10 @@ export default function CanvasMenu(props) {
|
|||||||
await reloadCanvasStatus(objectNo, pid)
|
await reloadCanvasStatus(objectNo, pid)
|
||||||
break
|
break
|
||||||
case 'estimate':
|
case 'estimate':
|
||||||
|
if (!isAllComplete()) {
|
||||||
|
swalFire({ text: getMessage('estimate.menu.move.valid1') })
|
||||||
|
return
|
||||||
|
}
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
promiseGet({ url: `/api/estimate/${objectNo}/${selectedPlan.planNo}/detail` }).then((res) => {
|
||||||
if (res.status === 200) {
|
if (res.status === 200) {
|
||||||
|
|||||||
@ -154,6 +154,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
||||||
if (res.resultCode === 'S') {
|
if (res.resultCode === 'S') {
|
||||||
setTabNum(2)
|
setTabNum(2)
|
||||||
|
setAllModuleSurfaceIsComplete(false)
|
||||||
} else {
|
} else {
|
||||||
swalFire({
|
swalFire({
|
||||||
title: res.resultMsg,
|
title: res.resultMsg,
|
||||||
@ -187,6 +188,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res?.result.resultCode === 'S' && res?.data) {
|
if (res?.result.resultCode === 'S' && res?.data) {
|
||||||
setTabNum(2)
|
setTabNum(2)
|
||||||
|
setAllModuleSurfaceIsComplete(false)
|
||||||
} else {
|
} else {
|
||||||
swalFire({ text: getMessage('common.message.send.error') })
|
swalFire({ text: getMessage('common.message.send.error') })
|
||||||
}
|
}
|
||||||
@ -286,6 +288,8 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
setSelectedModels(pcsItemList)
|
setSelectedModels(pcsItemList)
|
||||||
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
getPcsVoltageChk(pcsVoltageChkParams).then((res) => {
|
||||||
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
||||||
|
setAllModuleSurfaceIsComplete(false)
|
||||||
|
clearTrestle()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
swalFire({
|
swalFire({
|
||||||
@ -318,6 +322,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
setAllocationType(ALLOCATION_TYPE.PASSIVITY)
|
||||||
|
clearTrestle()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,6 +659,7 @@ export default function CircuitTrestleSetting({ id }) {
|
|||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
setTabNum(2)
|
setTabNum(2)
|
||||||
|
setAllModuleSurfaceIsComplete(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,12 +22,12 @@ export function useCommonUtils() {
|
|||||||
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
const lengthTextFont = useRecoilValue(fontSelector('lengthText'))
|
||||||
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
const commonTextFont = useRecoilValue(fontSelector('commonText'))
|
||||||
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
|
const [commonUtils, setCommonUtilsState] = useRecoilState(commonUtilsState)
|
||||||
const { addPopup } = usePopup()
|
const { addPopup, closeAll } = usePopup()
|
||||||
const { drawDirectionArrow, addLengthText } = usePolygon()
|
const { drawDirectionArrow, addLengthText } = usePolygon()
|
||||||
const { applyDormers } = useObjectBatch({})
|
const { applyDormers } = useObjectBatch({})
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (commonUtils.text) {
|
if (commonUtils.text || !commonUtils.text) {
|
||||||
commonTextMode()
|
commonTextMode()
|
||||||
} else if (commonUtils.dimension) {
|
} else if (commonUtils.dimension) {
|
||||||
commonDimensionMode()
|
commonDimensionMode()
|
||||||
@ -38,35 +38,57 @@ export function useCommonUtils() {
|
|||||||
|
|
||||||
const commonTextMode = () => {
|
const commonTextMode = () => {
|
||||||
let textbox
|
let textbox
|
||||||
|
closeAll()
|
||||||
if (commonUtils.text) {
|
if (commonUtils.text) {
|
||||||
commonTextKeyEvent()
|
setTimeout(() => {
|
||||||
addCanvasMouseEventListener('mouse:down', (event) => {
|
commonTextKeyEvent()
|
||||||
const pointer = canvas?.getPointer(event.e)
|
addCanvasMouseEventListener('mouse:down', (event) => {
|
||||||
|
const pointer = canvas?.getPointer(event.e)
|
||||||
|
|
||||||
textbox = new fabric.Textbox('', {
|
textbox = new fabric.Textbox('', {
|
||||||
left: pointer.x,
|
left: pointer.x,
|
||||||
top: pointer.y,
|
top: pointer.y,
|
||||||
width: 200,
|
width: 200,
|
||||||
editable: true,
|
editable: true,
|
||||||
name: 'commonText',
|
name: 'commonText',
|
||||||
visible: wordDisplay,
|
visible: wordDisplay,
|
||||||
fill: commonTextFont.fontColor.value,
|
fill: commonTextFont.fontColor.value,
|
||||||
fontFamily: commonTextFont.fontFamily.value,
|
fontFamily: commonTextFont.fontFamily.value,
|
||||||
fontSize: commonTextFont.fontSize.value,
|
fontSize: commonTextFont.fontSize.value,
|
||||||
fontStyle: commonTextFont.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal',
|
fontStyle: commonTextFont.fontWeight.value.toLowerCase().includes('italic') ? 'italic' : 'normal',
|
||||||
fontWeight: commonTextFont.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal',
|
fontWeight: commonTextFont.fontWeight.value.toLowerCase().includes('bold') ? 'bold' : 'normal',
|
||||||
selectable: true,
|
selectable: true,
|
||||||
lockMovementX: true,
|
lockMovementX: true,
|
||||||
lockMovementY: true,
|
lockMovementY: true,
|
||||||
originX: 'center',
|
originX: 'center',
|
||||||
originY: 'center',
|
originY: 'center',
|
||||||
|
})
|
||||||
|
|
||||||
|
canvas?.add(textbox)
|
||||||
|
canvas.setActiveObject(textbox)
|
||||||
|
textbox.enterEditing()
|
||||||
|
textbox.selectAll()
|
||||||
})
|
})
|
||||||
|
}, 100)
|
||||||
|
} else {
|
||||||
|
const activeObject = canvas?.getActiveObject()
|
||||||
|
if (activeObject && activeObject.name === 'commonText') {
|
||||||
|
if (activeObject && activeObject.isEditing) {
|
||||||
|
if (activeObject.text === '') {
|
||||||
|
canvas?.remove(activeObject)
|
||||||
|
} else {
|
||||||
|
activeObject.exitEditing()
|
||||||
|
}
|
||||||
|
//정책 협의
|
||||||
|
const texts = canvas.getObjects().filter((obj) => obj.name === 'commonText')
|
||||||
|
texts.forEach((text) => {
|
||||||
|
text.set({ editable: false })
|
||||||
|
})
|
||||||
|
canvas.renderAll()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
canvas?.add(textbox)
|
initEvent()
|
||||||
canvas.setActiveObject(textbox)
|
|
||||||
textbox.enterEditing()
|
|
||||||
textbox.selectAll()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -3077,6 +3077,9 @@ export const useTrestle = () => {
|
|||||||
// 배치면 전체에 가대 설치 여부
|
// 배치면 전체에 가대 설치 여부
|
||||||
const isAllComplete = () => {
|
const isAllComplete = () => {
|
||||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||||
|
if (surfaces.length === 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return surfaces.every((surface) => surface.isComplete)
|
return surfaces.every((surface) => surface.isComplete)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -199,6 +199,9 @@ export function useCanvasSetting(executeEffect = true) {
|
|||||||
if (!executeEffect) {
|
if (!executeEffect) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if (roofMaterials.length === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const selectedRoofMaterial = roofMaterials[0]
|
const selectedRoofMaterial = roofMaterials[0]
|
||||||
|
|
||||||
if (addedRoofs.length === 0) {
|
if (addedRoofs.length === 0) {
|
||||||
|
|||||||
@ -2,7 +2,14 @@ import { 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'
|
||||||
import { calculateDistance, calculateDistancePoint, calculateIntersection, distanceBetweenPoints, findClosestPoint } from '@/util/canvas-util'
|
import {
|
||||||
|
calculateDistance,
|
||||||
|
calculateDistancePoint,
|
||||||
|
calculateIntersection,
|
||||||
|
distanceBetweenPoints,
|
||||||
|
findClosestPoint,
|
||||||
|
getInterSectionLineNotOverCoordinate,
|
||||||
|
} from '@/util/canvas-util'
|
||||||
import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint'
|
import { useAdsorptionPoint } from '@/hooks/useAdsorptionPoint'
|
||||||
import { useDotLineGrid } from '@/hooks/useDotLineGrid'
|
import { useDotLineGrid } from '@/hooks/useDotLineGrid'
|
||||||
import { useTempGrid } from '@/hooks/useTempGrid'
|
import { useTempGrid } from '@/hooks/useTempGrid'
|
||||||
@ -146,7 +153,7 @@ export function useEvent() {
|
|||||||
...innerLinePoints,
|
...innerLinePoints,
|
||||||
]
|
]
|
||||||
|
|
||||||
if (dotLineGridSetting.LINE || canvas.getObjects().filter((obj) => ['lineGrid', 'tempGrid'].includes(obj.name)).length > 0) {
|
if (dotLineGridSetting.LINE || canvas.getObjects().filter((obj) => ['lineGrid', 'tempGrid'].includes(obj.name)).length > 1) {
|
||||||
const closestLine = getClosestLineGrid(pointer)
|
const closestLine = getClosestLineGrid(pointer)
|
||||||
|
|
||||||
const horizonLines = canvas.getObjects().filter((obj) => ['lineGrid', 'tempGrid'].includes(obj.name) && obj.direction === 'horizontal')
|
const horizonLines = canvas.getObjects().filter((obj) => ['lineGrid', 'tempGrid'].includes(obj.name) && obj.direction === 'horizontal')
|
||||||
@ -260,7 +267,9 @@ export function useEvent() {
|
|||||||
arrivalPoint = guideIntersectionPoint
|
arrivalPoint = guideIntersectionPoint
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {}
|
} catch (e) {
|
||||||
|
console.error(e)
|
||||||
|
}
|
||||||
|
|
||||||
const horizontalLine = new fabric.Line([-4 * canvas.width, arrivalPoint.y, 4 * canvas.width, arrivalPoint.y], {
|
const horizontalLine = new fabric.Line([-4 * canvas.width, arrivalPoint.y, 4 * canvas.width, arrivalPoint.y], {
|
||||||
stroke: 'red',
|
stroke: 'red',
|
||||||
@ -298,7 +307,12 @@ export function useEvent() {
|
|||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
//임의 그리드 모드일 경우
|
//임의 그리드 모드일 경우
|
||||||
let pointer = { x: e.offsetX, y: e.offsetY }
|
let originPointer = { x: e.offsetX, y: e.offsetY }
|
||||||
|
const mouseLines = canvas.getObjects().filter((obj) => obj.name === 'mouseLine')
|
||||||
|
let pointer = getInterSectionLineNotOverCoordinate(mouseLines[0], mouseLines[1]) || {
|
||||||
|
x: Math.round(originPointer.x),
|
||||||
|
y: Math.round(originPointer.y),
|
||||||
|
}
|
||||||
|
|
||||||
const tempGrid = new fabric.Line([-1500, pointer.y, 2500, pointer.y], {
|
const tempGrid = new fabric.Line([-1500, pointer.y, 2500, pointer.y], {
|
||||||
stroke: gridColor,
|
stroke: gridColor,
|
||||||
|
|||||||
@ -2,6 +2,7 @@ import { canvasState, tempGridModeState } from '@/store/canvasAtom'
|
|||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { gridColorState } from '@/store/gridAtom'
|
import { gridColorState } from '@/store/gridAtom'
|
||||||
import { gridDisplaySelector } from '@/store/settingAtom'
|
import { gridDisplaySelector } from '@/store/settingAtom'
|
||||||
|
import { useMouse } from '@/hooks/useMouse'
|
||||||
|
|
||||||
const GRID_PADDING = 5
|
const GRID_PADDING = 5
|
||||||
export function useTempGrid() {
|
export function useTempGrid() {
|
||||||
@ -9,10 +10,10 @@ export function useTempGrid() {
|
|||||||
const gridColor = useRecoilValue(gridColorState)
|
const gridColor = useRecoilValue(gridColorState)
|
||||||
const isGridDisplay = useRecoilValue(gridDisplaySelector)
|
const isGridDisplay = useRecoilValue(gridDisplaySelector)
|
||||||
const [tempGridMode, setTempGridMode] = useRecoilState(tempGridModeState)
|
const [tempGridMode, setTempGridMode] = useRecoilState(tempGridModeState)
|
||||||
|
const { getIntersectMousePoint } = useMouse()
|
||||||
const tempGridModeStateLeftClickEvent = (e) => {
|
const tempGridModeStateLeftClickEvent = (e) => {
|
||||||
//임의 그리드 모드일 경우
|
//임의 그리드 모드일 경우
|
||||||
let pointer = canvas.getPointer(e.e)
|
let pointer = getIntersectMousePoint(e)
|
||||||
|
|
||||||
const tempGrid = new fabric.Line([pointer.x, -1500, pointer.x, 2500], {
|
const tempGrid = new fabric.Line([pointer.x, -1500, pointer.x, 2500], {
|
||||||
stroke: gridColor,
|
stroke: gridColor,
|
||||||
|
|||||||
@ -612,6 +612,7 @@
|
|||||||
"qna.reg.header.contents": "お問い合わせ内容",
|
"qna.reg.header.contents": "お問い合わせ内容",
|
||||||
"qna.reg.header.fileList": "ファイル添付",
|
"qna.reg.header.fileList": "ファイル添付",
|
||||||
"qna.reg.header.save": "保存",
|
"qna.reg.header.save": "保存",
|
||||||
|
"qna.reg.alert.require.qstMail": "無効なメール形式です。",
|
||||||
"qna.reg.alert.require.regUserNm": "名前を入力してください。",
|
"qna.reg.alert.require.regUserNm": "名前を入力してください。",
|
||||||
"qna.reg.alert.select.type": "お問い合わせ区分を選択してください。",
|
"qna.reg.alert.select.type": "お問い合わせ区分を選択してください。",
|
||||||
"qna.reg.alert.require.title": "タイトルを入力してください。",
|
"qna.reg.alert.require.title": "タイトルを入力してください。",
|
||||||
|
|||||||
@ -612,6 +612,7 @@
|
|||||||
"qna.reg.header.contents": "문의정보",
|
"qna.reg.header.contents": "문의정보",
|
||||||
"qna.reg.header.fileList": "파일첨부",
|
"qna.reg.header.fileList": "파일첨부",
|
||||||
"qna.reg.header.save": "저장",
|
"qna.reg.header.save": "저장",
|
||||||
|
"qna.reg.alert.require.qstMail": "올바르지 않은 이메일 형식입니다.",
|
||||||
"qna.reg.alert.require.regUserNm": "이름을 입력하세요.",
|
"qna.reg.alert.require.regUserNm": "이름을 입력하세요.",
|
||||||
"qna.reg.alert.select.type": "문의구분을 선택하세요.",
|
"qna.reg.alert.select.type": "문의구분을 선택하세요.",
|
||||||
"qna.reg.alert.require.title": "제목을 입력하세요.",
|
"qna.reg.alert.require.title": "제목을 입력하세요.",
|
||||||
|
|||||||
@ -447,10 +447,11 @@
|
|||||||
border-top: none;
|
border-top: none;
|
||||||
.community_detail-file-wrap{
|
.community_detail-file-wrap{
|
||||||
padding-top: 0;
|
padding-top: 0;
|
||||||
|
margin-bottom: 24px;
|
||||||
}
|
}
|
||||||
.community_detail-inner{
|
.community_detail-inner{
|
||||||
max-height: 110px;
|
max-height: 110px;
|
||||||
margin-top: 24px;
|
margin-top: 0;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -461,12 +462,14 @@
|
|||||||
border: 1px solid #101010;
|
border: 1px solid #101010;
|
||||||
.community_detail-inner{
|
.community_detail-inner{
|
||||||
max-height: 110px;
|
max-height: 110px;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
.community_detail-file-wrap{
|
.community_detail-file-wrap{
|
||||||
border-top: 1px solid #D4DCE7;
|
border-top: 1px solid #D4DCE7;
|
||||||
padding: 16px 0 0 0;
|
padding: 16px 0 0 0;
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user