Merge branch 'dev' into dev-yj
# Conflicts: # src/hooks/common/useCommonUtils.js # src/hooks/object/useObjectBatch.js # src/hooks/useContextMenu.js
This commit is contained in:
commit
088b0c5e77
@ -1,5 +1,4 @@
|
|||||||
import CanvasFrame from '@/components/floor-plan/CanvasFrame'
|
import CanvasFrame from '@/components/floor-plan/CanvasFrame'
|
||||||
import FloorPlan from '@/components/floor-plan/FloorPlan'
|
|
||||||
|
|
||||||
export default function FloorPlanPage() {
|
export default function FloorPlanPage() {
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -2,12 +2,14 @@
|
|||||||
import { useEffect } from 'react'
|
import { useEffect } from 'react'
|
||||||
import '@/styles/contents.scss'
|
import '@/styles/contents.scss'
|
||||||
import { useRecoilState } from 'recoil'
|
import { useRecoilState } from 'recoil'
|
||||||
import { contextMenuState } from '@/store/contextMenu'
|
import { contextMenuListState, contextMenuState } from '@/store/contextMenu'
|
||||||
|
|
||||||
export default function QContextMenu(props) {
|
export default function QContextMenu(props) {
|
||||||
const { contextRef, canvasProps, handleKeyup } = props
|
const { contextRef, canvasProps, handleKeyup } = props
|
||||||
const [contextMenu, setContextMenu] = useRecoilState(contextMenuState)
|
const [contextMenu, setContextMenu] = useRecoilState(contextMenuState)
|
||||||
|
const [contextMenuList, setContextMenuList] = useRecoilState(contextMenuListState)
|
||||||
const activeObject = canvasProps?.getActiveObject() //액티브된 객체를 가져옴
|
const activeObject = canvasProps?.getActiveObject() //액티브된 객체를 가져옴
|
||||||
|
|
||||||
let contextType = ''
|
let contextType = ''
|
||||||
|
|
||||||
if (activeObject) {
|
if (activeObject) {
|
||||||
@ -19,12 +21,22 @@ export default function QContextMenu(props) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getYPosition = (e) => {
|
||||||
|
const contextLength = contextMenuList.reduce((acc, cur, index) => {
|
||||||
|
return acc + cur.length
|
||||||
|
}, 0)
|
||||||
|
return e?.clientY - (contextLength * 25 + contextMenuList.length * 2 * 17)
|
||||||
|
}
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!contextRef.current) return
|
if (!contextRef.current) return
|
||||||
|
|
||||||
const handleContextMenu = (e) => {
|
const handleContextMenu = (e) => {
|
||||||
// e.preventDefault() //기존 contextmenu 막고
|
// e.preventDefault() //기존 contextmenu 막고
|
||||||
setContextMenu({ visible: true, x: e.pageX, y: e.pageY })
|
const position = {
|
||||||
|
x: window.innerWidth / 2 < e.pageX ? e.pageX - 240 : e.pageX,
|
||||||
|
y: window.innerHeight / 2 < e.pageY ? getYPosition(e) : e.pageY,
|
||||||
|
}
|
||||||
|
setContextMenu({ visible: true, ...position })
|
||||||
document.addEventListener('keyup', (e) => handleKeyup(e))
|
document.addEventListener('keyup', (e) => handleKeyup(e))
|
||||||
canvasProps?.upperCanvasEl.removeEventListener('contextmenu', handleContextMenu) //한번 노출 후 이벤트 삭제
|
canvasProps?.upperCanvasEl.removeEventListener('contextmenu', handleContextMenu) //한번 노출 후 이벤트 삭제
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,20 +1,31 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import { useEffect, useState, useRef } from 'react'
|
import { useEffect, useState, useRef } from 'react'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
|
||||||
import SingleDatePicker from '../common/datepicker/SingleDatePicker'
|
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
||||||
import { Button } from '@nextui-org/react'
|
|
||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
import { useCanvasMenu } from '@/hooks/common/useCanvasMenu'
|
||||||
|
import SingleDatePicker from '../common/datepicker/SingleDatePicker'
|
||||||
|
import EstimateFileUploader from './EstimateFileUploader'
|
||||||
|
|
||||||
export default function Estimate({ params }) {
|
export default function Estimate({ params }) {
|
||||||
const sessionState = useRecoilValue(sessionStore)
|
|
||||||
const { getMessage } = useMessage()
|
|
||||||
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
|
||||||
const [objectNo, setObjectNo] = useState('')
|
const [objectNo, setObjectNo] = useState('')
|
||||||
const fileInputRef = useRef(null)
|
|
||||||
const [files, setFiles] = useState([]) //첨부파일
|
const [files, setFiles] = useState([]) //첨부파일
|
||||||
const fileId = useRef(0)
|
|
||||||
|
const sessionState = useRecoilValue(sessionStore)
|
||||||
|
const objectRecoil = useRecoilValue(floorPlanObjectState)
|
||||||
|
const { getMessage } = useMessage()
|
||||||
|
|
||||||
|
const { setMenuNumber } = useCanvasMenu()
|
||||||
|
|
||||||
|
const fileUploadProps = {
|
||||||
|
// objectNo: '',
|
||||||
|
// planNo: params.pid,
|
||||||
|
// category: '10',
|
||||||
|
uploadFiles: files,
|
||||||
|
setUploadFiles: setFiles,
|
||||||
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setObjectNo(objectRecoil.floorPlanObjectNo)
|
setObjectNo(objectRecoil.floorPlanObjectNo)
|
||||||
@ -28,31 +39,9 @@ export default function Estimate({ params }) {
|
|||||||
}
|
}
|
||||||
}, [objectNo])
|
}, [objectNo])
|
||||||
|
|
||||||
const handleButtonClick = () => {
|
useEffect(() => {
|
||||||
fileInputRef.current.click()
|
setMenuNumber(5)
|
||||||
}
|
}, [])
|
||||||
|
|
||||||
const onChangeFiles = (e) => {
|
|
||||||
// e.preventDefault()
|
|
||||||
// e.persist()
|
|
||||||
// console.log('파일::', e.target.files[0])
|
|
||||||
// console.log('파일::', e.target.files)
|
|
||||||
// let selectFiles = []
|
|
||||||
// let tempFiles = files
|
|
||||||
// selectFiles = e.target.files
|
|
||||||
// for (const file of selectFiles) {
|
|
||||||
// tempFiles = [
|
|
||||||
// ...tempFiles,
|
|
||||||
// {
|
|
||||||
// id: fileId.current++,
|
|
||||||
// object: file,
|
|
||||||
// },
|
|
||||||
// ]
|
|
||||||
// }
|
|
||||||
// setFiles(tempFiles)
|
|
||||||
// const formData = new FormData()
|
|
||||||
// formData.append('file', e.target.files[0])
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="sub-content estimate">
|
<div className="sub-content estimate">
|
||||||
@ -210,7 +199,8 @@ export default function Estimate({ params }) {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>{getMessage('estimate.detail.header.fileList1')}</th>
|
<th>{getMessage('estimate.detail.header.fileList1')}</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="drag-file-box">
|
<EstimateFileUploader {...fileUploadProps} />
|
||||||
|
{/* <div className="drag-file-box">
|
||||||
<div className="btn-area">
|
<div className="btn-area">
|
||||||
<Button type="button" className="btn-origin grey" onClick={handleButtonClick}>
|
<Button type="button" className="btn-origin grey" onClick={handleButtonClick}>
|
||||||
{getMessage('estimate.detail.fileList.btn')}
|
{getMessage('estimate.detail.fileList.btn')}
|
||||||
@ -228,7 +218,7 @@ export default function Estimate({ params }) {
|
|||||||
<p>Drag file here</p>
|
<p>Drag file here</p>
|
||||||
<ul className="file-list"></ul>
|
<ul className="file-list"></ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> */}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|||||||
91
src/components/estimate/EstimateFileUploader.jsx
Normal file
91
src/components/estimate/EstimateFileUploader.jsx
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
'use client'
|
||||||
|
|
||||||
|
import { useContext, useRef } from 'react'
|
||||||
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
|
export default function EstimateFileUploader({ uploadFiles, setUploadFiles }) {
|
||||||
|
const fileInputRef = useRef(null)
|
||||||
|
const { getMessage } = useMessage()
|
||||||
|
const { session } = useContext(SessionContext)
|
||||||
|
|
||||||
|
const handleButtonClick = (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
fileInputRef.current.click()
|
||||||
|
}
|
||||||
|
|
||||||
|
const onChangeFiles = async (e) => {
|
||||||
|
// const formData = new FormData()
|
||||||
|
// formData.append('file', e.target.files[0])
|
||||||
|
// formData.append('objectNo', objectNo) // 받아와야 하는 값
|
||||||
|
// formData.append('planNo', planNo) // 받아와야 하는 값
|
||||||
|
// formData.append('category', category) // 받아와야 하는 값
|
||||||
|
// formData.append('userId', session.userId)
|
||||||
|
|
||||||
|
// await promisePost({ url: '/api/file/fileUpload', data: formData }).then((res) => {
|
||||||
|
// if (res.data > 0) setUploadFiles([...files, { name: e.target.files[0].name, id: uuidv4() }])
|
||||||
|
// })
|
||||||
|
setUploadFiles([...uploadFiles, { data: e.target.files[0], id: uuidv4() }])
|
||||||
|
}
|
||||||
|
|
||||||
|
const deleteFile = (id) => {
|
||||||
|
setUploadFiles(uploadFiles.filter((file) => file.id !== id))
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDrop = (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
const fileList = []
|
||||||
|
Array.from(e.dataTransfer.files).forEach((file) => {
|
||||||
|
fileList.push({ data: file, id: uuidv4() })
|
||||||
|
})
|
||||||
|
setUploadFiles([...uploadFiles, ...fileList])
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDragOver = (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDragEnd = (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
const handleDragLeave = (e) => {
|
||||||
|
e.preventDefault()
|
||||||
|
e.stopPropagation()
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="drag-file-box">
|
||||||
|
<div className="btn-area">
|
||||||
|
<label className="file-upload" htmlFor="img" onClick={handleButtonClick}>
|
||||||
|
{getMessage('estimate.detail.fileList.btn')}
|
||||||
|
</label>
|
||||||
|
<input type="file" name="file" id="img" ref={fileInputRef} style={{ display: 'none' }} onChange={(e) => onChangeFiles(e)} />
|
||||||
|
</div>
|
||||||
|
<div
|
||||||
|
className="drag-file-area"
|
||||||
|
draggable
|
||||||
|
onDrop={(e) => handleDrop(e)}
|
||||||
|
onDragOver={(e) => handleDragOver(e)}
|
||||||
|
onDragEnd={(e) => handleDragEnd(e)}
|
||||||
|
onDragLeave={(e) => handleDragLeave(e)}
|
||||||
|
>
|
||||||
|
<p>Drag file here</p>
|
||||||
|
<ul className="file-list">
|
||||||
|
{uploadFiles.length > 0 &&
|
||||||
|
uploadFiles.map((file) => (
|
||||||
|
<li className="file-item" key={file.id}>
|
||||||
|
<span>
|
||||||
|
{file.data.name} <button className="delete" onClick={() => deleteFile(file.id)}></button>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
))}
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -8,8 +8,7 @@ import { useCanvas } from '@/hooks/useCanvas'
|
|||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { usePlan } from '@/hooks/usePlan'
|
import { usePlan } from '@/hooks/usePlan'
|
||||||
import { useContextMenu } from '@/hooks/useContextMenu'
|
import { useContextMenu } from '@/hooks/useContextMenu'
|
||||||
import { currentMenuState, currentObjectState } from '@/store/canvasAtom'
|
import { currentMenuState } from '@/store/canvasAtom'
|
||||||
import { useCanvasEvent } from '@/hooks/useCanvasEvent'
|
|
||||||
import QContextMenu from '@/components/common/context-menu/QContextMenu'
|
import QContextMenu from '@/components/common/context-menu/QContextMenu'
|
||||||
import { useCanvasConfigInitialize } from '@/hooks/common/useCanvasConfigInitialize'
|
import { useCanvasConfigInitialize } from '@/hooks/common/useCanvasConfigInitialize'
|
||||||
import { MENU } from '@/common/common'
|
import { MENU } from '@/common/common'
|
||||||
@ -59,7 +58,7 @@ export default function CanvasFrame() {
|
|||||||
<canvas ref={canvasRef} id="canvas" style={{ position: 'relative' }}></canvas>
|
<canvas ref={canvasRef} id="canvas" style={{ position: 'relative' }}></canvas>
|
||||||
|
|
||||||
<QContextMenu contextRef={canvasRef} canvasProps={canvas} handleKeyup={handleKeyup}>
|
<QContextMenu contextRef={canvasRef} canvasProps={canvas} handleKeyup={handleKeyup}>
|
||||||
{contextMenu.map((menus, index) => (
|
{contextMenu?.map((menus, index) => (
|
||||||
<ul key={index}>
|
<ul key={index}>
|
||||||
{menus.map((menu) => (
|
{menus.map((menu) => (
|
||||||
<li key={menu.id} onClick={(e) => handleClick(e, menu)}>
|
<li key={menu.id} onClick={(e) => handleClick(e, menu)}>
|
||||||
|
|||||||
@ -26,10 +26,6 @@ export default function FloorPlan({ children }) {
|
|||||||
fetchSettings()
|
fetchSettings()
|
||||||
}, [objectNo])
|
}, [objectNo])
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
setMenuNumber(1)
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="canvas-wrap">
|
<div className="canvas-wrap">
|
||||||
|
|||||||
@ -15,7 +15,11 @@ export default function MenuDepth01() {
|
|||||||
const subMenus = useRecoilValue(subMenusState)
|
const subMenus = useRecoilValue(subMenusState)
|
||||||
|
|
||||||
const onClickMenu = ({ id, menu }) => {
|
const onClickMenu = ({ id, menu }) => {
|
||||||
setCurrentMenu(menu)
|
if (menu === currentMenu) {
|
||||||
|
handleMenu(type)
|
||||||
|
} else {
|
||||||
|
setCurrentMenu(menu)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@ -3,50 +3,79 @@ import WithDraggable from '@/components/common/draggable/WithDraggable'
|
|||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
export default function AuxiliaryCopy(props) {
|
export default function AuxiliaryCopy(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
const { id, pos = contextPopupPosition } = props
|
const { id, pos = contextPopupPosition } = props
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
|
const [arrow1, setArrow1] = useState(null)
|
||||||
|
const [arrow2, setArrow2] = useState(null)
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">補助線のコピー </h1>
|
<h1 className="title">{getMessage('modal.auxiliary.copy')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
닫기
|
닫기
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="modal-body">
|
<div className="modal-body">
|
||||||
<div className="grid-option-tit">コピーする方向を入力してください</div>
|
<div className="grid-option-tit">{getMessage('modal.auxiliary.copy.info')}</div>
|
||||||
<div className="grid-option-wrap">
|
<div className="grid-option-wrap">
|
||||||
<div className="grid-option-box">
|
<div className="grid-option-box">
|
||||||
<div className="move-form">
|
<div className="move-form">
|
||||||
<p className="mb5">長さ</p>
|
<p className="mb5">{getMessage('length')}</p>
|
||||||
<div className="input-move-wrap mb5">
|
<div className="input-move-wrap mb5">
|
||||||
<div className="input-move">
|
<div className="input-move">
|
||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction up ${arrow1 === '↑' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↑')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction down ${arrow1 === '↓' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↓')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-move-wrap">
|
<div className="input-move-wrap">
|
||||||
<div className="input-move">
|
<div className="input-move">
|
||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction left ${arrow2 === '←' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('←')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction right ${arrow2 === '→' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('→')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="direction-move-wrap">
|
|
||||||
<button className="direction up"></button>
|
|
||||||
<button className="direction down act"></button>
|
|
||||||
<button className="direction left"></button>
|
|
||||||
<button className="direction right"></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button className="btn-frame modal act">保存</button>
|
<button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -13,9 +13,10 @@ export default function AuxiliaryMove(props) {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [arrow1, setArrow1] = useState(null)
|
const [arrow1, setArrow1] = useState(null)
|
||||||
|
const [arrow2, setArrow2] = useState(null)
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.auxiliary.move')}</h1>
|
<h1 className="title">{getMessage('modal.auxiliary.move')}</h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
@ -33,44 +34,46 @@ export default function AuxiliaryMove(props) {
|
|||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction up ${arrow1 === '↑' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↑')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction down ${arrow1 === '↓' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↓')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-move-wrap">
|
<div className="input-move-wrap">
|
||||||
<div className="input-move">
|
<div className="input-move">
|
||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction left ${arrow2 === '←' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('←')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction right ${arrow2 === '→' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('→')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="direction-move-wrap">
|
|
||||||
<button
|
|
||||||
className={`direction up ${arrow1 === '↑' ? 'act' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setArrow1('↑')
|
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp' }))
|
|
||||||
}}
|
|
||||||
></button>
|
|
||||||
<button
|
|
||||||
className={`direction down ${arrow1 === '↓' ? 'act' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setArrow1('↓')
|
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' }))
|
|
||||||
}}
|
|
||||||
></button>
|
|
||||||
<button
|
|
||||||
className={`direction left ${arrow1 === '←' ? 'act' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setArrow1('←')
|
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft' }))
|
|
||||||
}}
|
|
||||||
></button>
|
|
||||||
<button
|
|
||||||
className={`direction right ${arrow1 === '→' ? 'act' : ''}`}
|
|
||||||
onClick={() => {
|
|
||||||
setArrow1('→')
|
|
||||||
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight' }))
|
|
||||||
}}
|
|
||||||
></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
|
|||||||
@ -11,9 +11,9 @@ export default function AuxiliarySize(props) {
|
|||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">補助線サイズ変更 </h1>
|
<h1 className="title">{getMessage('modal.auxiliary.size.edit')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
닫기
|
닫기
|
||||||
</button>
|
</button>
|
||||||
@ -22,7 +22,7 @@ export default function AuxiliarySize(props) {
|
|||||||
<div className="discrimination-box mb10">
|
<div className="discrimination-box mb10">
|
||||||
<div className="d-check-radio pop mb10">
|
<div className="d-check-radio pop mb10">
|
||||||
<input type="radio" name="radio01" id="ra01" />
|
<input type="radio" name="radio01" id="ra01" />
|
||||||
<label htmlFor="ra01">1支店</label>
|
<label htmlFor="ra01">1{getMessage('modal.auxiliary.size.edit.point')}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form mb15">
|
<div className="outline-form mb15">
|
||||||
<div className="input-grid mr5" style={{ flex: '1 1 auto' }}>
|
<div className="input-grid mr5" style={{ flex: '1 1 auto' }}>
|
||||||
@ -31,7 +31,7 @@ export default function AuxiliarySize(props) {
|
|||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<span style={{ width: 'auto' }}>長さ</span>
|
<span style={{ width: 'auto' }}>{getMessage('length')}</span>
|
||||||
<div className="input-grid mr5">
|
<div className="input-grid mr5">
|
||||||
<input type="text" className="input-origin block" defaultValue={100} />
|
<input type="text" className="input-origin block" defaultValue={100} />
|
||||||
</div>
|
</div>
|
||||||
@ -41,7 +41,7 @@ export default function AuxiliarySize(props) {
|
|||||||
<div className="discrimination-box ">
|
<div className="discrimination-box ">
|
||||||
<div className="d-check-radio pop mb10">
|
<div className="d-check-radio pop mb10">
|
||||||
<input type="radio" name="radio01" id="ra02" />
|
<input type="radio" name="radio01" id="ra02" />
|
||||||
<label htmlFor="ra02">2支店</label>
|
<label htmlFor="ra02">2{getMessage('modal.auxiliary.size.edit.point')}</label>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form mb15">
|
<div className="outline-form mb15">
|
||||||
<div className="input-grid mr5" style={{ flex: '1 1 auto' }}>
|
<div className="input-grid mr5" style={{ flex: '1 1 auto' }}>
|
||||||
@ -50,7 +50,7 @@ export default function AuxiliarySize(props) {
|
|||||||
<span className="thin">mm</span>
|
<span className="thin">mm</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="outline-form">
|
<div className="outline-form">
|
||||||
<span style={{ width: 'auto' }}>長さ</span>
|
<span style={{ width: 'auto' }}>{getMessage('length')}</span>
|
||||||
<div className="input-grid mr5">
|
<div className="input-grid mr5">
|
||||||
<input type="text" className="input-origin block" defaultValue={100} />
|
<input type="text" className="input-origin block" defaultValue={100} />
|
||||||
</div>
|
</div>
|
||||||
@ -58,7 +58,7 @@ export default function AuxiliarySize(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button className="btn-frame modal act">保存</button>
|
<button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -1,17 +1,16 @@
|
|||||||
import { useState, useEffect, useRef } from 'react'
|
import { useEffect, useRef, useState } from 'react'
|
||||||
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 { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useRecoilState, useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||||
import { pitchTextSelector } from '@/store/canvasAtom'
|
import { canvasState, pitchTextSelector } from '@/store/canvasAtom'
|
||||||
import { defaultSlope } from '@/store/commonAtom'
|
import { defaultSlope } from '@/store/commonAtom'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
|
||||||
|
|
||||||
export default function DimensionLineSetting(props) {
|
export default function DimensionLineSetting(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
const { id, setIsShow, pos = contextPopupPosition } = props
|
let { id, setIsShow, pos = contextPopupPosition } = props
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -79,7 +78,7 @@ export default function DimensionLineSetting(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('contextmenu.display.edit')} </h1>
|
<h1 className="title">{getMessage('contextmenu.display.edit')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
@ -131,7 +130,9 @@ export default function DimensionLineSetting(props) {
|
|||||||
<div className="warning">{getMessage('modal.display.edit.input.slope.info')}</div>
|
<div className="warning">{getMessage('modal.display.edit.input.slope.info')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button className="btn-frame modal act" onClick={handleChangeLength}>{getMessage('modal.common.save')}</button>
|
<button className="btn-frame modal act" onClick={handleChangeLength}>
|
||||||
|
{getMessage('modal.common.save')}
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -60,7 +60,7 @@ export default function FlowDirectionSetting(props) {
|
|||||||
}, [compasDeg])
|
}, [compasDeg])
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap lx`}>
|
<div className={`modal-pop-wrap lx mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.shape.flow.direction.setting')} </h1>
|
<h1 className="title">{getMessage('modal.shape.flow.direction.setting')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -34,20 +34,22 @@ export default function GridMove(props) {
|
|||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button className="direction up"></button>
|
||||||
|
<button className="direction down act"></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-move-wrap">
|
<div className="input-move-wrap">
|
||||||
<div className="input-move">
|
<div className="input-move">
|
||||||
<input type="text" className="input-origin" defaultValue={910} />
|
<input type="text" className="input-origin" defaultValue={910} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button className="direction left"></button>
|
||||||
|
<button className="direction right"></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="direction-move-wrap">
|
|
||||||
<button className="direction up"></button>
|
|
||||||
<button className="direction down act"></button>
|
|
||||||
<button className="direction left"></button>
|
|
||||||
<button className="direction right"></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
|
|||||||
@ -14,7 +14,7 @@ export default function ImageSizeSetting(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xxxm`}>
|
<div className={`modal-pop-wrap xxxm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.image.size.setting')} </h1>
|
<h1 className="title">{getMessage('modal.image.size.setting')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export default function CircuitNumberEdit(props) {
|
|||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title"> {getMessage('modal.module.circuit.number.edit')}</h1>
|
<h1 className="title"> {getMessage('modal.module.circuit.number.edit')}</h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default function ColumnInsert(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap r`}>
|
<div className={`modal-pop-wrap r mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.panel.column.insert')} </h1>
|
<h1 className="title">{getMessage('modal.panel.column.insert')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default function ColumnRemove(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap r`}>
|
<div className={`modal-pop-wrap r mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.panel.column.remove')} </h1>
|
<h1 className="title">{getMessage('modal.panel.column.remove')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default function RowInsert(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap r`}>
|
<div className={`modal-pop-wrap r mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.row.insert')} </h1>
|
<h1 className="title">{getMessage('modal.row.insert')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -25,7 +25,7 @@ export default function RowRemove(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap r`}>
|
<div className={`modal-pop-wrap r mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.row.remove')}</h1>
|
<h1 className="title">{getMessage('modal.row.remove')}</h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -3,15 +3,18 @@ import WithDraggable from '@/components/common/draggable/WithDraggable'
|
|||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilValue } from 'recoil'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState } from '@/store/popupAtom'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
export default function DormerOffset(props) {
|
export default function DormerOffset(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState)
|
||||||
const { id, pos = contextPopupPosition } = props
|
const { id, pos = contextPopupPosition } = props
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
|
const [arrow1, setArrow1] = useState(null)
|
||||||
|
const [arrow2, setArrow2] = useState(null)
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xm`}>
|
<div className={`modal-pop-wrap xm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('contextmenu.dormer.offset')}</h1>
|
<h1 className="title">{getMessage('contextmenu.dormer.offset')}</h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
@ -29,20 +32,46 @@ export default function DormerOffset(props) {
|
|||||||
<input type="text" className="input-origin" defaultValue={0} />
|
<input type="text" className="input-origin" defaultValue={0} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction up ${arrow1 === '↑' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↑')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowUp' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction down ${arrow1 === '↓' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow1('↓')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowDown' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="input-move-wrap">
|
<div className="input-move-wrap">
|
||||||
<div className="input-move">
|
<div className="input-move">
|
||||||
<input type="text" className="input-origin" defaultValue={0} />
|
<input type="text" className="input-origin" defaultValue={0} />
|
||||||
</div>
|
</div>
|
||||||
<span>mm</span>
|
<span>mm</span>
|
||||||
|
<div className="direction-move-wrap">
|
||||||
|
<button
|
||||||
|
className={`direction left ${arrow2 === '←' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('←')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowLeft' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
<button
|
||||||
|
className={`direction right ${arrow2 === '→' ? 'act' : ''}`}
|
||||||
|
onClick={() => {
|
||||||
|
setArrow2('→')
|
||||||
|
document.dispatchEvent(new KeyboardEvent('keydown', { key: 'ArrowRight' }))
|
||||||
|
}}
|
||||||
|
></button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="direction-move-wrap">
|
|
||||||
<button className="direction up"></button>
|
|
||||||
<button className="direction down act"></button>
|
|
||||||
<button className="direction left"></button>
|
|
||||||
<button className="direction right"></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
|
|||||||
@ -19,7 +19,8 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const [buttonAct, setButtonAct] = useState(1)
|
const [buttonAct, setButtonAct] = useState(1)
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { applyOpeningAndShadow, applyDormers } = useObjectBatch()
|
const [isHidden, setIsHidden] = useState(false)
|
||||||
|
const { applyOpeningAndShadow, applyDormers } = useObjectBatch({ isHidden, setIsHidden })
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
|
|
||||||
const surfaceShapePolygons = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
const surfaceShapePolygons = canvas?.getObjects().filter((obj) => obj.name === POLYGON_TYPE.ROOF)
|
||||||
@ -63,6 +64,7 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
} else {
|
} else {
|
||||||
applyDormers(dormerPlacement, buttonAct, surfaceShapePolygons)
|
applyDormers(dormerPlacement, buttonAct, surfaceShapePolygons)
|
||||||
}
|
}
|
||||||
|
setIsHidden(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
const buttonMenu = [
|
const buttonMenu = [
|
||||||
@ -71,9 +73,10 @@ export default function ObjectSetting({ id, pos = { x: 50, y: 230 } }) {
|
|||||||
{ id: 3, name: getMessage('modal.object.setting.type.triangle.dormer') },
|
{ id: 3, name: getMessage('modal.object.setting.type.triangle.dormer') },
|
||||||
{ id: 4, name: getMessage('modal.object.setting.type.pentagon.dormer') },
|
{ id: 4, name: getMessage('modal.object.setting.type.pentagon.dormer') },
|
||||||
]
|
]
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap lrr`}>
|
<div className={`modal-pop-wrap lrr`} style={{ visibility: isHidden ? 'hidden' : 'visible' }}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('plan.menu.placement.surface.object')} </h1>
|
<h1 className="title">{getMessage('plan.menu.placement.surface.object')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -22,9 +22,9 @@ export default function RoofMaterialSetting(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap xxxm`}>
|
<div className={`modal-pop-wrap xxxm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">変更 </h1>
|
<h1 className="title">{getMessage('modal.roof.material.edit')} </h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
닫기
|
닫기
|
||||||
</button>
|
</button>
|
||||||
@ -36,7 +36,7 @@ export default function RoofMaterialSetting(props) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button className="btn-frame modal act">ストレージ</button>
|
<button className="btn-frame modal act">{getMessage('modal.common.save')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -16,7 +16,7 @@ export default function RoofAllocationSetting(props) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={pos}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap ml`}>
|
<div className={`modal-pop-wrap ml mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1>
|
<h1 className="title">{getMessage('plan.menu.estimate.roof.alloc')}</h1>
|
||||||
<button className="modal-close" onClick={() => closePopup(id)}>
|
<button className="modal-close" onClick={() => closePopup(id)}>
|
||||||
|
|||||||
@ -15,7 +15,7 @@ export default function MainContents() {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet, get } = useAxios(globalLocaleState)
|
const { promiseGet } = useAxios(globalLocaleState)
|
||||||
|
|
||||||
const sessionState = useRecoilValue(sessionStore)
|
const sessionState = useRecoilValue(sessionStore)
|
||||||
|
|
||||||
@ -118,7 +118,7 @@ export default function MainContents() {
|
|||||||
key={row.objectNo}
|
key={row.objectNo}
|
||||||
className="recently-item"
|
className="recently-item"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
if (row.objectNo.substring(0, 1) === 'R') {
|
if (row.tempFlg === '0') {
|
||||||
router.push(`/management/stuff/detail?objectNo=${row.objectNo.toString()}`)
|
router.push(`/management/stuff/detail?objectNo=${row.objectNo.toString()}`)
|
||||||
} else {
|
} else {
|
||||||
router.push(`/management/stuff/tempdetail?objectNo=${row.objectNo.toString()}`)
|
router.push(`/management/stuff/tempdetail?objectNo=${row.objectNo.toString()}`)
|
||||||
|
|||||||
@ -1,12 +1,11 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import React, { useEffect, useState, useRef } from 'react'
|
import { useEffect, useState, useRef, useContext } from 'react'
|
||||||
import { useRouter, usePathname } from 'next/navigation'
|
import { useRouter, usePathname } from 'next/navigation'
|
||||||
import { Button } from '@nextui-org/react'
|
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import StuffQGrid from './StuffQGrid'
|
import StuffQGrid from './StuffQGrid'
|
||||||
import { useRecoilValue, useRecoilState } from 'recoil'
|
import { useRecoilValue, useRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import { stuffSearchState } from '@/store/stuffAtom'
|
import { stuffSearchState } from '@/store/stuffAtom'
|
||||||
import { queryStringFormatter, isEmptyArray } from '@/util/common-utils'
|
import { queryStringFormatter, isEmptyArray } from '@/util/common-utils'
|
||||||
import dayjs from 'dayjs'
|
import dayjs from 'dayjs'
|
||||||
@ -17,10 +16,12 @@ import KO from '@/locales/ko.json'
|
|||||||
import JA from '@/locales/ja.json'
|
import JA from '@/locales/ja.json'
|
||||||
import QPagination from '../common/pagination/QPagination'
|
import QPagination from '../common/pagination/QPagination'
|
||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
export default function Stuff() {
|
export default function Stuff() {
|
||||||
const sessionState = useRecoilValue(sessionStore)
|
const sessionState = useRecoilValue(sessionStore)
|
||||||
const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore)
|
const { session } = useContext(SessionContext)
|
||||||
|
const setAppMessageState = useSetRecoilState(appMessageStore)
|
||||||
const stuffSearchParams = useRecoilValue(stuffSearchState)
|
const stuffSearchParams = useRecoilValue(stuffSearchState)
|
||||||
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
const [stuffSearch, setStuffSearch] = useRecoilState(stuffSearchState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -224,11 +225,10 @@ export default function Stuff() {
|
|||||||
|
|
||||||
// 진입시 그리드 데이터 조회
|
// 진입시 그리드 데이터 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isObjectNotEmpty(sessionState)) {
|
if (isObjectNotEmpty(session)) {
|
||||||
//물건 메뉴 눌러서 최초 진입 sessionState
|
|
||||||
if (stuffSearchParams?.code === 'S') {
|
if (stuffSearchParams?.code === 'S') {
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: sessionState?.storeId,
|
saleStoreId: stuffSearchParams.schSelSaleStoreId,
|
||||||
schObjectNo: stuffSearchParams?.schObjectNo,
|
schObjectNo: stuffSearchParams?.schObjectNo,
|
||||||
schAddress: stuffSearchParams?.schAddress,
|
schAddress: stuffSearchParams?.schAddress,
|
||||||
schObjectName: stuffSearchParams?.schObjectName,
|
schObjectName: stuffSearchParams?.schObjectName,
|
||||||
@ -257,13 +257,15 @@ export default function Stuff() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
fetchData()
|
if (stuffSearchParams?.schSelSaleStoreId !== '') {
|
||||||
|
fetchData()
|
||||||
|
}
|
||||||
} else if (stuffSearchParams?.code === 'M') {
|
} else if (stuffSearchParams?.code === 'M') {
|
||||||
//메인화면에서 진입
|
//메인화면에서 진입
|
||||||
const params = {
|
const params = {
|
||||||
saleStoreId: sessionState?.storeId,
|
saleStoreId: session?.storeId,
|
||||||
schObjectNo: stuffSearchParams.schObjectNo,
|
schObjectNo: stuffSearchParams.schObjectNo,
|
||||||
schAddress: 'dfdfdfdfdf',
|
schAddress: '',
|
||||||
schObjectName: '',
|
schObjectName: '',
|
||||||
schSaleStoreName: '',
|
schSaleStoreName: '',
|
||||||
schReceiveUser: '',
|
schReceiveUser: '',
|
||||||
@ -281,23 +283,9 @@ export default function Stuff() {
|
|||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...params,
|
...params,
|
||||||
})
|
})
|
||||||
|
|
||||||
// async function fetchData() {
|
|
||||||
// const apiUrl = `/api/object/list?${queryStringFormatter(params)}`
|
|
||||||
// await get({
|
|
||||||
// url: apiUrl,
|
|
||||||
// }).then((res) => {
|
|
||||||
// if (!isEmptyArray(res)) {
|
|
||||||
// setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
|
||||||
// setTotalCount(res[0].totCnt)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// fetchData()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// }, [pageNo, sessionState, stuffSearchParams])
|
}, [pageNo, session, stuffSearchParams])
|
||||||
}, [pageNo, stuffSearchParams])
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (stuffSearchParams?.code === 'E') {
|
if (stuffSearchParams?.code === 'E') {
|
||||||
@ -309,7 +297,10 @@ export default function Stuff() {
|
|||||||
|
|
||||||
//조회를 눌렀을때
|
//조회를 눌렀을때
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
let saleStoreId
|
||||||
|
saleStoreId = stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : session?.storeId
|
||||||
|
// const apiUrl = `/api/object/list?saleStoreId=${session?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
|
const apiUrl = `/api/object/list?saleStoreId=${saleStoreId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
await get({ url: apiUrl }).then((res) => {
|
await get({ url: apiUrl }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
||||||
@ -335,13 +326,15 @@ export default function Stuff() {
|
|||||||
setPageSize(e.target.value)
|
setPageSize(e.target.value)
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...stuffSearchParams,
|
...stuffSearchParams,
|
||||||
// code: 'P',
|
|
||||||
startRow: startRow,
|
startRow: startRow,
|
||||||
endRow: 1 * e.target.value,
|
endRow: 1 * e.target.value,
|
||||||
})
|
})
|
||||||
|
|
||||||
setPageNo(1)
|
setPageNo(1)
|
||||||
const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
let saleStoreId
|
||||||
|
saleStoreId = stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : session?.storeId
|
||||||
|
// const apiUrl = `/api/object/list?saleStoreId=${session?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
|
const apiUrl = `/api/object/list?saleStoreId=${saleStoreId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
get({ url: apiUrl }).then((res) => {
|
get({ url: apiUrl }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
||||||
@ -373,7 +366,10 @@ export default function Stuff() {
|
|||||||
})
|
})
|
||||||
|
|
||||||
setPageNo(1)
|
setPageNo(1)
|
||||||
const apiUrl = `/api/object/list?saleStoreId=${sessionState?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
let saleStoreId
|
||||||
|
saleStoreId = stuffSearchParams?.schSelSaleStoreId ? stuffSearchParams.schSelSaleStoreId : session?.storeId
|
||||||
|
// const apiUrl = `/api/object/list?saleStoreId=${session?.storeId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
|
const apiUrl = `/api/object/list?saleStoreId=${saleStoreId}&${queryStringFormatter(stuffSearchParams)}`
|
||||||
get({ url: apiUrl }).then((res) => {
|
get({ url: apiUrl }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
setGridProps({ ...gridProps, gridData: res, count: res[0].totCnt })
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import React, { useState, useEffect, useRef } from 'react'
|
import { useState, useEffect, useRef, useContext } from 'react'
|
||||||
import { useRouter, useSearchParams, usePathname } from 'next/navigation'
|
import { useRouter, useSearchParams, usePathname } from 'next/navigation'
|
||||||
import { Button } from '@nextui-org/react'
|
import { Button } from '@nextui-org/react'
|
||||||
import Select, { components } from 'react-select'
|
import Select, { components } from 'react-select'
|
||||||
@ -12,6 +12,7 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { useForm } from 'react-hook-form'
|
import { useForm } from 'react-hook-form'
|
||||||
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
import { useRecoilValue, useSetRecoilState } from 'recoil'
|
||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
import FindAddressPop from './popup/FindAddressPop'
|
import FindAddressPop from './popup/FindAddressPop'
|
||||||
import PlanRequestPop from './popup/PlanRequestPop'
|
import PlanRequestPop from './popup/PlanRequestPop'
|
||||||
import WindSelectPop from './popup/WindSelectPop'
|
import WindSelectPop from './popup/WindSelectPop'
|
||||||
@ -22,19 +23,13 @@ import { floorPlanObjectState } from '@/store/floorPlanObjectAtom'
|
|||||||
export default function StuffDetail() {
|
export default function StuffDetail() {
|
||||||
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
const setFloorPlanObjectNo = useSetRecoilState(floorPlanObjectState) //견적서 화면용 물건번호리코일
|
||||||
|
|
||||||
// const inputReceiveUserEl = useRef(null) //담당자ref
|
|
||||||
// const inputObjectNameEl = useRef(null) //물건명ref
|
|
||||||
// const inputZipNoEl = useRef(null) //우편번호ref
|
|
||||||
// const inputAddressEl = useRef(null) //주소ref
|
|
||||||
// const inputVerticalSnowCoverEl = useRef(null) //수직적설량ref
|
|
||||||
// const inputInstallHeightEl = useRef(null) //설치높이ref
|
|
||||||
|
|
||||||
//공통코드
|
//공통코드
|
||||||
const { commonCode, findCommonCode } = useCommonCode()
|
const { commonCode, findCommonCode } = useCommonCode()
|
||||||
const [selOptions, setSelOptions] = useState('') //선택한 1차점
|
const [selOptions, setSelOptions] = useState('') //선택한 1차점
|
||||||
const [otherSelOptions, setOtherSelOptions] = useState('') //선택한 1차점외
|
const [otherSelOptions, setOtherSelOptions] = useState('') //선택한 1차점외
|
||||||
|
|
||||||
const sessionState = useRecoilValue(sessionStore)
|
const sessionState = useRecoilValue(sessionStore)
|
||||||
|
const { session } = useContext(SessionContext)
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const pathname = usePathname()
|
const pathname = usePathname()
|
||||||
@ -322,55 +317,91 @@ export default function StuffDetail() {
|
|||||||
//1차점 : X167 T01
|
//1차점 : X167 T01
|
||||||
//2차점 : 10X22, 201X112
|
//2차점 : 10X22, 201X112
|
||||||
let url
|
let url
|
||||||
if (sessionState?.storeId === 'T01') {
|
let firstList
|
||||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=an1`
|
let otherList
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}`
|
let favList
|
||||||
|
// if (sessionState?.storeId === 'T01') {
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
|
||||||
} else {
|
} else {
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list`
|
if (session.storeLvl === '1') {
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
|
} else {
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
res.map((row) => {
|
||||||
let favList
|
row.value = row.saleStoreId
|
||||||
if (sessionState?.storeId === 'T01') {
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
|
firstList = res
|
||||||
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||||
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||||
|
|
||||||
setSaleStoreList(firstList)
|
setSaleStoreList(firstList)
|
||||||
setFavoriteStoreList(favList)
|
setFavoriteStoreList(favList)
|
||||||
setShowSaleStoreList(favList)
|
setShowSaleStoreList(favList)
|
||||||
} else {
|
setSelOptions(session?.storeId)
|
||||||
//1차점 셀렉트박스
|
form.setValue('saleStoreId', session?.storeId)
|
||||||
setSaleStoreList(firstList)
|
form.setValue('saleStoreLevel', session?.storeLvl)
|
||||||
}
|
//T01일떄는 1차점을 고른다음 2차점 목록 조회하기
|
||||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
//디폴트 값(T01)으로 2차점목록 조회하기
|
||||||
let filterOtherList
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
if (sessionState?.storeId === 'T01') {
|
get({ url: url }).then((res) => {
|
||||||
filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01')
|
if (!isEmptyArray(res)) {
|
||||||
|
res.map((row) => {
|
||||||
|
row.value = row.saleStoreId
|
||||||
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
|
||||||
setOriginOtherSaleStoreList(filterOtherList)
|
otherList = res
|
||||||
setOtherSaleStoreList(filterOtherList)
|
setOtherSaleStoreList(otherList)
|
||||||
|
} else {
|
||||||
|
setOtherSaleStoreList([])
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
//T01 아니고 2차점 판매점 셀렉트박스
|
if (session?.storeLvl === '1') {
|
||||||
setOriginOtherSaleStoreList(otherList)
|
firstList = res
|
||||||
setOtherSaleStoreList(otherList)
|
favList = res.filter((row) => row.priority !== 'B')
|
||||||
}
|
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||||
|
|
||||||
if (sessionState?.storeLvl === '1') {
|
setSaleStoreList(firstList)
|
||||||
setSelOptions(sessionState?.storeId)
|
setFavoriteStoreList(firstList)
|
||||||
form.setValue('saleStoreId', sessionState?.storeId)
|
setShowSaleStoreList(firstList)
|
||||||
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
setSelOptions(firstList[0].saleStoreId)
|
||||||
} else {
|
form.setValue('saleStoreId', session?.storeId)
|
||||||
setSelOptions(firstList[0].saleStoreId)
|
form.setValue('saleStoreLevel', session?.storeLvl)
|
||||||
setOtherSelOptions(sessionState?.storeId)
|
|
||||||
form.setValue('saleStoreId', firstList[0].saleStoreId)
|
setOtherSaleStoreList(otherList)
|
||||||
form.setValue('otherSaleStoreId', sessionState?.storeId)
|
} else {
|
||||||
form.setValue('otherSaleStoreLevel', sessionState?.storeLvl)
|
//10X22, 201X112,202X217
|
||||||
|
firstList = res.filter((row) => row.firstAgentYn === 'Y')
|
||||||
|
setSaleStoreList(firstList)
|
||||||
|
setFavoriteStoreList(firstList)
|
||||||
|
setShowSaleStoreList(firstList)
|
||||||
|
setSelOptions(firstList[0].saleStoreId)
|
||||||
|
|
||||||
|
form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||||
|
form.setValue('saleStoreLevel', firstList[0].saleStoreLevel)
|
||||||
|
|
||||||
|
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
//2차 판매점명/ID는 본인을 셀렉트
|
||||||
|
setOtherSelOptions(session?.storeId)
|
||||||
|
form.setValue('otherSaleStoreId', session?.storeId)
|
||||||
|
form.setValue('otherSaleStoreLevel', session?.storeLvl)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [objectNo, sessionState])
|
// }, [objectNo, sessionState])
|
||||||
|
}, [objectNo, session])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const code1 = findCommonCode(200800) //경칭
|
const code1 = findCommonCode(200800) //경칭
|
||||||
@ -400,38 +431,78 @@ export default function StuffDetail() {
|
|||||||
//1차점 : X167 T01
|
//1차점 : X167 T01
|
||||||
//2차점 : 10X22, 201X112
|
//2차점 : 10X22, 201X112
|
||||||
let url
|
let url
|
||||||
if (sessionState?.storeId === 'T01') {
|
let firstList
|
||||||
// url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=an1`
|
let otherList
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?userId=${sessionState?.userId}`
|
let favList
|
||||||
|
// if (sessionState?.storeId === 'T01') {
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
|
// url = `/api/object/saleStore/${sessionState?.storeId}/firstList?userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
|
||||||
} else {
|
} else {
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list`
|
// if (sessionState.storeLvl === '1') {
|
||||||
|
if (session.storeLvl === '1') {
|
||||||
|
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||||
|
} else {
|
||||||
|
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||||
|
}
|
||||||
}
|
}
|
||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
const firstList = res.filter((row) => row.saleStoreLevel === '1')
|
// if (sessionState?.storeId === 'T01') {
|
||||||
const otherList = res.filter((row) => row.saleStoreLevel !== '1')
|
if (session?.storeId === 'T01') {
|
||||||
let favList
|
firstList = res.filter((row) => row.saleStoreLevel === '1')
|
||||||
|
|
||||||
if (sessionState?.storeId === 'T01') {
|
|
||||||
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
firstList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||||
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
favList = firstList.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||||
setSaleStoreList(firstList)
|
setSaleStoreList(firstList)
|
||||||
setFavoriteStoreList(favList)
|
setFavoriteStoreList(favList)
|
||||||
setShowSaleStoreList(favList)
|
setShowSaleStoreList(favList)
|
||||||
|
|
||||||
|
form.setValue('saleStoreId', firstList[0].saleStoreId)
|
||||||
|
form.setValue('saleStoreName', firstList[0].saleStoreName)
|
||||||
|
form.setValue('saleStoreLevel', firstList[0].saleStoreLevel)
|
||||||
|
setSelOptions(firstList[0].saleStoreId)
|
||||||
|
|
||||||
|
//상세데이터의 1차점 아이디로 2차점 목록 조회하기
|
||||||
|
// url = `/api/object/saleStore/${detailData?.saleStoreId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${detailData?.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
|
|
||||||
|
get({ url: url }).then((res) => {
|
||||||
|
if (!isEmptyArray(res)) {
|
||||||
|
res.map((row) => {
|
||||||
|
row.value = row.saleStoreId
|
||||||
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
|
||||||
|
otherList = res
|
||||||
|
setOriginOtherSaleStoreList(otherList)
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
//1차점 셀렉트박스
|
//1차점 셀렉트박스
|
||||||
setSaleStoreList(firstList)
|
// if (sessionState?.storeLvl === '1') {
|
||||||
}
|
if (session?.storeLvl === '1') {
|
||||||
|
firstList = res
|
||||||
|
favList = res.filter((row) => row.priority !== 'B')
|
||||||
|
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||||
|
|
||||||
let filterOtherList
|
setSaleStoreList(firstList)
|
||||||
if (sessionState?.storeId === 'T01') {
|
setFavoriteStoreList(firstList)
|
||||||
filterOtherList = otherList.filter((row) => row.firstAgentId === 'T01')
|
setShowSaleStoreList(firstList)
|
||||||
setOriginOtherSaleStoreList(filterOtherList)
|
|
||||||
setOtherSaleStoreList(filterOtherList)
|
setOtherSaleStoreList(otherList)
|
||||||
} else {
|
} else {
|
||||||
//1차점 아닌 판매점 셀렉트박스
|
setSelOptions(res[0].saleStoreId)
|
||||||
setOriginOtherSaleStoreList(otherList)
|
form.setValue('saleStoreId', res[0].saleStoreId)
|
||||||
setOtherSaleStoreList(otherList)
|
form.setValue('saleStoreLevel', res[0].storeLvl)
|
||||||
|
setSaleStoreList(res)
|
||||||
|
setFavoriteStoreList(res)
|
||||||
|
setShowSaleStoreList(res)
|
||||||
|
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -442,9 +513,6 @@ export default function StuffDetail() {
|
|||||||
form.setValue('saleStoreId', detailData.saleStoreId)
|
form.setValue('saleStoreId', detailData.saleStoreId)
|
||||||
form.setValue('saleStoreLevel', detailData.saleStoreLevel)
|
form.setValue('saleStoreLevel', detailData.saleStoreLevel)
|
||||||
} else {
|
} else {
|
||||||
setSelOptions(sessionState?.storeId)
|
|
||||||
form.setValue('saleStoreId', sessionState?.storeId)
|
|
||||||
form.setValue('saleStoreLevel', sessionState?.storeLvl)
|
|
||||||
setOtherSelOptions(detailData.saleStoreId)
|
setOtherSelOptions(detailData.saleStoreId)
|
||||||
form.setValue('otherSaleStoreId', detailData.saleStoreId)
|
form.setValue('otherSaleStoreId', detailData.saleStoreId)
|
||||||
form.setValue('otherSaleStoreLevel', detailData.saleStoreLevel)
|
form.setValue('otherSaleStoreLevel', detailData.saleStoreLevel)
|
||||||
@ -504,7 +572,8 @@ export default function StuffDetail() {
|
|||||||
form.setValue('remarks', detailData.remarks)
|
form.setValue('remarks', detailData.remarks)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [detailData, sessionState])
|
// }, [detailData, sessionState])
|
||||||
|
}, [detailData, session])
|
||||||
|
|
||||||
//경칭선택 변경 이벤트
|
//경칭선택 변경 이벤트
|
||||||
const onChangeHonorificCode = (key) => {
|
const onChangeHonorificCode = (key) => {
|
||||||
@ -574,6 +643,7 @@ export default function StuffDetail() {
|
|||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
tempObjectNo = objectNo.substring(0, 1)
|
tempObjectNo = objectNo.substring(0, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempObjectNo === 'T') {
|
if (tempObjectNo === 'T') {
|
||||||
if (planReqNo) {
|
if (planReqNo) {
|
||||||
if (delFlg) {
|
if (delFlg) {
|
||||||
@ -584,10 +654,21 @@ export default function StuffDetail() {
|
|||||||
form.setValue('saleStoreName', key.saleStoreName)
|
form.setValue('saleStoreName', key.saleStoreName)
|
||||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||||
setSelOptions(key.saleStoreId)
|
setSelOptions(key.saleStoreId)
|
||||||
//선택한 1차점 정보로 2차점 list 추리기
|
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
//長府工産株式会社 大阪支社
|
let otherList
|
||||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
get({ url: url }).then((res) => {
|
||||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
if (!isEmptyArray(res)) {
|
||||||
|
res.map((row) => {
|
||||||
|
row.value = row.saleStoreId
|
||||||
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
|
||||||
|
otherList = res
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
} else {
|
||||||
|
setOtherSaleStoreList([])
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
//X누름
|
//X누름
|
||||||
setSelOptions('')
|
setSelOptions('')
|
||||||
@ -604,15 +685,34 @@ export default function StuffDetail() {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isObjectNotEmpty(key)) {
|
if (isObjectNotEmpty(key)) {
|
||||||
setOtherSaleStoreList(otherSaleStoreList)
|
setSelOptions(key.saleStoreId)
|
||||||
form.setValue('saleStoreId', key.saleStoreId)
|
form.setValue('saleStoreId', key.saleStoreId)
|
||||||
form.setValue('saleStoreName', key.saleStoreName)
|
form.setValue('saleStoreName', key.saleStoreName)
|
||||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||||
setSelOptions(key.saleStoreId)
|
//선택한 1차점 정보로 2차점 조회하기
|
||||||
//선택한 1차점 정보로 2차점 list 추리기
|
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
//長府工産株式会社 大阪支社
|
let otherList
|
||||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
get({ url: url }).then((res) => {
|
||||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
if (!isEmptyArray(res)) {
|
||||||
|
res.map((row) => {
|
||||||
|
row.value = row.saleStoreId
|
||||||
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
|
||||||
|
otherList = res
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
setOtherSelOptions('')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
} else {
|
||||||
|
setOtherSelOptions('')
|
||||||
|
form.setValue('otherSaleStoreId', '')
|
||||||
|
form.setValue('otherSaleStoreName', '')
|
||||||
|
form.setValue('otherSaleStoreLevel', '')
|
||||||
|
setOtherSaleStoreList([])
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
//X누름
|
//X누름
|
||||||
setSelOptions('')
|
setSelOptions('')
|
||||||
@ -634,10 +734,21 @@ export default function StuffDetail() {
|
|||||||
form.setValue('saleStoreName', key.saleStoreName)
|
form.setValue('saleStoreName', key.saleStoreName)
|
||||||
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
form.setValue('saleStoreLevel', key.saleStoreLevel)
|
||||||
setSelOptions(key.saleStoreId)
|
setSelOptions(key.saleStoreId)
|
||||||
//선택한 1차점 정보로 2차점 list 추리기
|
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
//長府工産株式会社 大阪支社
|
let otherList
|
||||||
let newOtherSaleStoreList = originOtherSaleStoreList.filter((row) => row.firstAgentId === key.saleStoreId)
|
get({ url: url }).then((res) => {
|
||||||
setOtherSaleStoreList(newOtherSaleStoreList)
|
if (!isEmptyArray(res)) {
|
||||||
|
res.map((row) => {
|
||||||
|
row.value = row.saleStoreId
|
||||||
|
row.label = row.saleStoreName
|
||||||
|
})
|
||||||
|
|
||||||
|
otherList = res
|
||||||
|
setOtherSaleStoreList(otherList)
|
||||||
|
} else {
|
||||||
|
setOtherSaleStoreList([])
|
||||||
|
}
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
//X누름
|
//X누름
|
||||||
setSelOptions('')
|
setSelOptions('')
|
||||||
@ -687,6 +798,7 @@ export default function StuffDetail() {
|
|||||||
if (objectNo) {
|
if (objectNo) {
|
||||||
tempObjectNo = objectNo.substring(0, 1)
|
tempObjectNo = objectNo.substring(0, 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tempObjectNo === 'T') {
|
if (tempObjectNo === 'T') {
|
||||||
if (planReqNo) {
|
if (planReqNo) {
|
||||||
if (delFlg) {
|
if (delFlg) {
|
||||||
@ -1170,19 +1282,12 @@ export default function StuffDetail() {
|
|||||||
|
|
||||||
//1차점 or 2차점 안고르고 임시저장하면
|
//1차점 or 2차점 안고르고 임시저장하면
|
||||||
if (params.saleStoreId == '') {
|
if (params.saleStoreId == '') {
|
||||||
params.saleStoreId = sessionState.storeId
|
// params.saleStoreId = sessionState.storeId
|
||||||
params.saleStoreLevel = sessionState.storeLvl
|
params.saleStoreId = session.storeId
|
||||||
|
// params.saleStoreLevel = sessionState.storeLvl
|
||||||
|
params.saleStoreLevel = session.storeLvl
|
||||||
}
|
}
|
||||||
//수직적설량, 설치높이 0인지 체크
|
|
||||||
// let snow = params.verticalSnowCover
|
|
||||||
// let height = params.installHeight
|
|
||||||
|
|
||||||
// if (snow === '0') {
|
|
||||||
// return alert(getMessage('stuff.detail.save.valierror1'))
|
|
||||||
// }
|
|
||||||
// if (height === '0') {
|
|
||||||
// return alert(getMessage('stuff.detail.save.valierror2'))
|
|
||||||
// }
|
|
||||||
await promisePost({ url: '/api/object/save-object', data: params }).then((res) => {
|
await promisePost({ url: '/api/object/save-object', data: params }).then((res) => {
|
||||||
if (res.status === 201) {
|
if (res.status === 201) {
|
||||||
alert(getMessage('stuff.detail.tempSave.message1'))
|
alert(getMessage('stuff.detail.tempSave.message1'))
|
||||||
@ -1256,7 +1361,7 @@ export default function StuffDetail() {
|
|||||||
)) ||
|
)) ||
|
||||||
null}
|
null}
|
||||||
</div>
|
</div>
|
||||||
<Button className="btn-origin grey" onPress={onSearchDesignRequestPopOpen}>
|
<Button type="button" className="btn-origin grey" onPress={onSearchDesignRequestPopOpen}>
|
||||||
{getMessage('stuff.planReqPopup.title')}
|
{getMessage('stuff.planReqPopup.title')}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -1343,7 +1448,8 @@ export default function StuffDetail() {
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
{(sessionState?.storeId === 'T01' && (
|
{/* {sessionState?.storeId === 'T01' && ( */}
|
||||||
|
{session?.storeId === 'T01' && (
|
||||||
<>
|
<>
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
<Select
|
<Select
|
||||||
@ -1357,8 +1463,41 @@ export default function StuffDetail() {
|
|||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
isClearable={true}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
isDisabled={session?.storeLvl !== '1' ? true : false}
|
||||||
|
value={saleStoreList.filter(function (option) {
|
||||||
|
return option.saleStoreId === selOptions
|
||||||
|
})}
|
||||||
|
></Select>
|
||||||
|
</div>
|
||||||
|
<div className="input-wrap" style={{ width: '216px' }}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="input-light"
|
||||||
|
value={form.watch('saleStoreId') || ''}
|
||||||
|
{...form.register('saleStoreId')}
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
|
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && ( */}
|
||||||
|
{session?.storeId !== 'T01' && session?.storeLvl === '1' && (
|
||||||
|
<>
|
||||||
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
|
<Select
|
||||||
|
id="long-value-select1"
|
||||||
|
instanceId="long-value-select1"
|
||||||
|
className="react-select-custom"
|
||||||
|
classNamePrefix="custom"
|
||||||
|
placeholder="Select"
|
||||||
|
options={showSaleStoreList[0]}
|
||||||
|
onChange={onSelectionChange}
|
||||||
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
|
isClearable={false}
|
||||||
|
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||||
value={showSaleStoreList.filter(function (option) {
|
value={showSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === selOptions
|
return option.saleStoreId === selOptions
|
||||||
})}
|
})}
|
||||||
@ -1374,7 +1513,9 @@ export default function StuffDetail() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)) || (
|
)}
|
||||||
|
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl !== '1' && ( */}
|
||||||
|
{session?.storeId !== 'T01' && session?.storeLvl !== '1' && (
|
||||||
<>
|
<>
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
<Select
|
<Select
|
||||||
@ -1383,13 +1524,13 @@ export default function StuffDetail() {
|
|||||||
className="react-select-custom"
|
className="react-select-custom"
|
||||||
classNamePrefix="custom"
|
classNamePrefix="custom"
|
||||||
placeholder="Select"
|
placeholder="Select"
|
||||||
options={saleStoreList}
|
options={showSaleStoreList}
|
||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
isClearable={false}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
isDisabled={true}
|
||||||
value={saleStoreList.filter(function (option) {
|
value={showSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === selOptions
|
return option.saleStoreId === selOptions
|
||||||
})}
|
})}
|
||||||
></Select>
|
></Select>
|
||||||
@ -1432,8 +1573,8 @@ export default function StuffDetail() {
|
|||||||
onChange={onSelectionChange2}
|
onChange={onSelectionChange2}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
isDisabled={otherSaleStoreList.length > 1 ? false : true}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
isClearable={true}
|
||||||
value={otherSaleStoreList.filter(function (option) {
|
value={otherSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === otherSelOptions
|
return option.saleStoreId === otherSelOptions
|
||||||
})}
|
})}
|
||||||
@ -1688,7 +1829,7 @@ export default function StuffDetail() {
|
|||||||
<div className="product-input-wrap mr5">
|
<div className="product-input-wrap mr5">
|
||||||
<input type="text" className="product-input" readOnly value={form.watch('planReqNo') || ''} />
|
<input type="text" className="product-input" readOnly value={form.watch('planReqNo') || ''} />
|
||||||
{/* {detailData?.tempFlg === '1' && form.watch('planReqNo') ? ( */}
|
{/* {detailData?.tempFlg === '1' && form.watch('planReqNo') ? ( */}
|
||||||
{objectNo.substring(0, 1) === 'T' && form.watch('planReqNo') ? (
|
{detailData?.tempFlg === '1' && form.watch('planReqNo') ? (
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className="product-delete"
|
className="product-delete"
|
||||||
@ -1699,7 +1840,7 @@ export default function StuffDetail() {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{/* {detailData?.tempFlg === '1' ? ( */}
|
{/* {detailData?.tempFlg === '1' ? ( */}
|
||||||
{objectNo.substring(0, 1) === 'T' ? (
|
{detailData?.tempFlg === '1' ? (
|
||||||
<>
|
<>
|
||||||
<Button className="btn-origin grey" onPress={onSearchDesignRequestPopOpen}>
|
<Button className="btn-origin grey" onPress={onSearchDesignRequestPopOpen}>
|
||||||
{getMessage('stuff.planReqPopup.title')}
|
{getMessage('stuff.planReqPopup.title')}
|
||||||
@ -1790,10 +1931,12 @@ export default function StuffDetail() {
|
|||||||
</th>
|
</th>
|
||||||
<td>
|
<td>
|
||||||
<div className="flx-box">
|
<div className="flx-box">
|
||||||
{(sessionState?.storeId === 'T01' && (
|
{/* {sessionState?.storeId === 'T01' && ( */}
|
||||||
|
{session?.storeId === 'T01' && (
|
||||||
<>
|
<>
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
<Select
|
<Select
|
||||||
|
menuPlacement={'auto'}
|
||||||
id="long-value-select1"
|
id="long-value-select1"
|
||||||
instanceId="long-value-select1"
|
instanceId="long-value-select1"
|
||||||
className="react-select-custom"
|
className="react-select-custom"
|
||||||
@ -1804,8 +1947,10 @@ export default function StuffDetail() {
|
|||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
isClearable={session?.storeLvl === '1' ? true : false}
|
||||||
|
// isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
||||||
|
isDisabled={session?.storeLvl !== '1' ? true : false}
|
||||||
value={saleStoreList.filter(function (option) {
|
value={saleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === selOptions
|
return option.saleStoreId === selOptions
|
||||||
})}
|
})}
|
||||||
@ -1821,22 +1966,26 @@ export default function StuffDetail() {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)) || (
|
)}
|
||||||
|
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && ( */}
|
||||||
|
{session?.storeId !== 'T01' && session?.storeLvl === '1' && (
|
||||||
<>
|
<>
|
||||||
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
<Select
|
<Select
|
||||||
|
menuPlacement={'auto'}
|
||||||
id="long-value-select1"
|
id="long-value-select1"
|
||||||
instanceId="long-value-select1"
|
instanceId="long-value-select1"
|
||||||
className="react-select-custom"
|
className="react-select-custom"
|
||||||
classNamePrefix="custom"
|
classNamePrefix="custom"
|
||||||
placeholder="Select"
|
placeholder="Select"
|
||||||
options={saleStoreList}
|
options={showSaleStoreList[0]}
|
||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
isClearable={false}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : false}
|
// isDisabled={sessionState?.storeLvl !== '1' ? true : sessionState?.storeId !== 'T01' ? true : false}
|
||||||
value={saleStoreList.filter(function (option) {
|
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||||
|
value={showSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === selOptions
|
return option.saleStoreId === selOptions
|
||||||
})}
|
})}
|
||||||
/>
|
/>
|
||||||
@ -1852,6 +2001,41 @@ export default function StuffDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
{/* {sessionState?.storeId !== 'T01' && sessionState?.storeLvl !== '1' && ( */}
|
||||||
|
{session?.storeId !== 'T01' && session?.storeLvl !== '1' && (
|
||||||
|
<>
|
||||||
|
<div className="select-wrap mr5" style={{ width: '567px' }}>
|
||||||
|
<Select
|
||||||
|
menuPlacement={'auto'}
|
||||||
|
id="long-value-select1"
|
||||||
|
instanceId="long-value-select1"
|
||||||
|
className="react-select-custom"
|
||||||
|
classNamePrefix="custom"
|
||||||
|
placeholder="Select"
|
||||||
|
options={showSaleStoreList[0]}
|
||||||
|
onChange={onSelectionChange}
|
||||||
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
|
isClearable={false}
|
||||||
|
isDisabled={true}
|
||||||
|
value={showSaleStoreList.filter(function (option) {
|
||||||
|
if (option.firstAgentYn === 'Y') {
|
||||||
|
return option.saleStoreId
|
||||||
|
}
|
||||||
|
})}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className="input-wrap" style={{ width: '216px' }}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="input-light"
|
||||||
|
value={form.watch('saleStoreId') || ''}
|
||||||
|
{...form.register('saleStoreId')}
|
||||||
|
readOnly
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -1878,8 +2062,10 @@ export default function StuffDetail() {
|
|||||||
onChange={onSelectionChange2}
|
onChange={onSelectionChange2}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
// isDisabled={sessionState?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||||
isClearable={sessionState?.storeLvl === '1' ? true : false}
|
isDisabled={session?.storeLvl === '1' && form.watch('saleStoreId') != '' ? false : true}
|
||||||
|
// isClearable={sessionState?.storeLvl === '1' ? true : false}
|
||||||
|
isClearable={session?.storeLvl === '1' ? true : false}
|
||||||
value={otherSaleStoreList.filter(function (option) {
|
value={otherSaleStoreList.filter(function (option) {
|
||||||
return option.saleStoreId === otherSelOptions
|
return option.saleStoreId === otherSelOptions
|
||||||
})}
|
})}
|
||||||
@ -2112,7 +2298,7 @@ export default function StuffDetail() {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/* {detailData?.tempFlg === '0' ? ( */}
|
{/* {detailData?.tempFlg === '0' ? ( */}
|
||||||
{objectNo.substring(0, 1) !== 'T' ? (
|
{detailData?.tempFlg === '0' ? (
|
||||||
<>
|
<>
|
||||||
{/* 진짜R 플랜시작 */}
|
{/* 진짜R 플랜시작 */}
|
||||||
<div className="table-box-title-wrap">
|
<div className="table-box-title-wrap">
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
'use client'
|
'use client'
|
||||||
|
|
||||||
import React, { useEffect, useRef, useState } from 'react'
|
import { useEffect, useRef, useState, useContext } from 'react'
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useRecoilState, useRecoilValue, useResetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import { appMessageStore, globalLocaleStore } from '@/store/localeAtom'
|
import { appMessageStore, globalLocaleStore } from '@/store/localeAtom'
|
||||||
import Select from 'react-select'
|
import Select from 'react-select'
|
||||||
import KO from '@/locales/ko.json'
|
import KO from '@/locales/ko.json'
|
||||||
@ -15,10 +15,13 @@ import SingleDatePicker from '../common/datepicker/SingleDatePicker'
|
|||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
import { searchState } from '@/store/boardAtom'
|
|
||||||
|
import { SessionContext } from '@/app/SessionProvider'
|
||||||
|
|
||||||
export default function StuffSearchCondition() {
|
export default function StuffSearchCondition() {
|
||||||
|
const { session } = useContext(SessionContext)
|
||||||
const sessionState = useRecoilValue(sessionStore)
|
const sessionState = useRecoilValue(sessionStore)
|
||||||
const [appMessageState, setAppMessageState] = useRecoilState(appMessageStore)
|
const setAppMessageState = useSetRecoilState(appMessageStore)
|
||||||
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
const globalLocaleState = useRecoilValue(globalLocaleStore)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const ref = useRef()
|
const ref = useRef()
|
||||||
@ -74,14 +77,14 @@ export default function StuffSearchCondition() {
|
|||||||
|
|
||||||
if (stuffSearch.code === 'S') {
|
if (stuffSearch.code === 'S') {
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
schObjectNo: objectNo ? objectNo : stuffSearch?.schObjectNo,
|
schObjectNo: objectNo ? objectNo : stuffSearch.schObjectNo,
|
||||||
schSaleStoreName: stuffSearch?.schSaleStoreName ? stuffSearch?.schSaleStoreName : saleStoreName,
|
schSaleStoreName: saleStoreName ? saleStoreName : '',
|
||||||
schAddress: address ? address : stuffSearch?.schAddress,
|
schAddress: address ? address : '',
|
||||||
schObjectName: objectName ? objectName : stuffSearch?.schObjectName,
|
schObjectName: objectName ? objectName : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName : stuffSearch?.schDispCompanyName,
|
schDispCompanyName: dispCompanyName ? dispCompanyName : '',
|
||||||
schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||||
schReceiveUser: receiveUser ? receiveUser : stuffSearch?.schReceiveUser,
|
schReceiveUser: receiveUser ? receiveUser : '',
|
||||||
schDateType: stuffSearch?.schDateType ? stuffSearch.schDateType : dateType,
|
schDateType: dateType,
|
||||||
schFromDt: dayjs(startDate).format('YYYY-MM-DD'),
|
schFromDt: dayjs(startDate).format('YYYY-MM-DD'),
|
||||||
schToDt: dayjs(endDate).format('YYYY-MM-DD'),
|
schToDt: dayjs(endDate).format('YYYY-MM-DD'),
|
||||||
code: 'E',
|
code: 'E',
|
||||||
@ -128,7 +131,8 @@ export default function StuffSearchCondition() {
|
|||||||
setDateType('U')
|
setDateType('U')
|
||||||
setStartDate(dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'))
|
setStartDate(dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'))
|
||||||
setEndDate(dayjs(new Date()).format('YYYY-MM-DD'))
|
setEndDate(dayjs(new Date()).format('YYYY-MM-DD'))
|
||||||
if (sessionState?.storeId === 'T01') {
|
// if (sessionState?.storeId === 'T01') {
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
setSchSelSaleStoreId('')
|
setSchSelSaleStoreId('')
|
||||||
handleClear1() //판매대리점선택 자동완성 클리어
|
handleClear1() //판매대리점선택 자동완성 클리어
|
||||||
resetStuffRecoil()
|
resetStuffRecoil()
|
||||||
@ -152,18 +156,24 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (isObjectNotEmpty(sessionState)) {
|
// if (isObjectNotEmpty(sessionState)) {
|
||||||
|
if (isObjectNotEmpty(session)) {
|
||||||
// storeId가 T01 이거나 storeLvl이 1차점일때만 판매대리점 선택 활성화
|
// storeId가 T01 이거나 storeLvl이 1차점일때만 판매대리점 선택 활성화
|
||||||
let url
|
let url
|
||||||
if (sessionState?.storeId === 'T01') {
|
// if (sessionState?.storeId === 'T01') {
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
//T01일떄
|
//T01일떄
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/firstList?userId=${sessionState?.userId}`
|
// url = `/api/object/saleStore/${sessionState?.storeId}/firstList?userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/firstList?userId=${session?.userId}`
|
||||||
} else {
|
} else {
|
||||||
if (sessionState.storeLvl === '1') {
|
// if (sessionState.storeLvl === '1') {
|
||||||
|
if (session.storeLvl === '1') {
|
||||||
//T01아닌 1차점일때
|
//T01아닌 1차점일때
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
} else {
|
} else {
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=1&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=1&userId=${session?.userId}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -177,22 +187,26 @@ export default function StuffSearchCondition() {
|
|||||||
let allList
|
let allList
|
||||||
let favList
|
let favList
|
||||||
let otherList
|
let otherList
|
||||||
if (sessionState?.storeId === 'T01') {
|
// if (sessionState?.storeId === 'T01') {
|
||||||
|
if (session?.storeId === 'T01') {
|
||||||
allList = res
|
allList = res
|
||||||
allList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
allList.sort((a, b) => (a.saleStoreId !== 'T01') - (b.saleStoreId !== 'T01') || a.saleStoreId - b.saleStoreId)
|
||||||
favList = res.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
favList = res.filter((row) => row.saleStoreId === 'T01' || row.priority !== 'B')
|
||||||
setSchSelSaleStoreList(allList)
|
setSchSelSaleStoreList(allList)
|
||||||
setFavoriteStoreList(favList)
|
setFavoriteStoreList(favList)
|
||||||
setShowSaleStoreList(favList)
|
setShowSaleStoreList(favList)
|
||||||
setSchSelSaleStoreId(sessionState?.storeId)
|
// setSchSelSaleStoreId(sessionState?.storeId)
|
||||||
|
setSchSelSaleStoreId(session?.storeId)
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...stuffSearch,
|
...stuffSearch,
|
||||||
code: 'S',
|
code: 'S',
|
||||||
schSelSaleStoreId: sessionState?.storeId,
|
// schSelSaleStoreId: sessionState?.storeId,
|
||||||
|
schSelSaleStoreId: session?.storeId,
|
||||||
})
|
})
|
||||||
|
|
||||||
//T01일때 2차 판매점 호출하기
|
//T01일때 2차 판매점 호출하기 디폴트로 1차점을 본인으로 셋팅해서 세션storeId사용
|
||||||
url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
// url = `/api/object/saleStore/${sessionState?.storeId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
||||||
|
url = `/api/object/saleStore/${session?.storeId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
|
|
||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
@ -208,7 +222,8 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
if (sessionState?.storeLvl === '1') {
|
// if (sessionState?.storeLvl === '1') {
|
||||||
|
if (session?.storeLvl === '1') {
|
||||||
allList = res
|
allList = res
|
||||||
favList = res.filter((row) => row.priority !== 'B')
|
favList = res.filter((row) => row.priority !== 'B')
|
||||||
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
otherList = res.filter((row) => row.firstAgentYn === 'N')
|
||||||
@ -225,7 +240,7 @@ export default function StuffSearchCondition() {
|
|||||||
schSelSaleStoreId: allList[0].saleStoreId,
|
schSelSaleStoreId: allList[0].saleStoreId,
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
//201X112 그냥2차점
|
//10X22, 201X112 그냥2차점
|
||||||
//2차점인데 34들고있는애 202X217
|
//2차점인데 34들고있는애 202X217
|
||||||
setSchSelSaleStoreList(res)
|
setSchSelSaleStoreList(res)
|
||||||
setFavoriteStoreList(res)
|
setFavoriteStoreList(res)
|
||||||
@ -235,7 +250,8 @@ export default function StuffSearchCondition() {
|
|||||||
setOtherSaleStoreList(otherList)
|
setOtherSaleStoreList(otherList)
|
||||||
|
|
||||||
//선택한 2차점 세션으로 자동셋팅
|
//선택한 2차점 세션으로 자동셋팅
|
||||||
setOtherSaleStoreId(sessionState?.storeId)
|
// setOtherSaleStoreId(sessionState?.storeId)
|
||||||
|
setOtherSaleStoreId(session?.storeId)
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
...stuffSearch,
|
...stuffSearch,
|
||||||
code: 'S',
|
code: 'S',
|
||||||
@ -246,7 +262,8 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}, [sessionState])
|
// }, [sessionState])
|
||||||
|
}, [session])
|
||||||
|
|
||||||
//초기화 눌렀을 때 1차판매점 자동완성도..
|
//초기화 눌렀을 때 1차판매점 자동완성도..
|
||||||
const handleClear1 = () => {
|
const handleClear1 = () => {
|
||||||
@ -279,7 +296,8 @@ export default function StuffSearchCondition() {
|
|||||||
stuffSearch.schSelSaleStoreId = key.saleStoreId
|
stuffSearch.schSelSaleStoreId = key.saleStoreId
|
||||||
//T01아닌 1차점은 본인으로 디폴트셋팅이고 수정할수없어서 여기안옴
|
//T01아닌 1차점은 본인으로 디폴트셋팅이고 수정할수없어서 여기안옴
|
||||||
//고른 1차점의 saleStoreId로 2차점 API호출하기
|
//고른 1차점의 saleStoreId로 2차점 API호출하기
|
||||||
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
// let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${sessionState?.userId}`
|
||||||
|
let url = `/api/object/saleStore/${key.saleStoreId}/list?firstFlg=0&userId=${session?.userId}`
|
||||||
let otherList
|
let otherList
|
||||||
get({ url: url }).then((res) => {
|
get({ url: url }).then((res) => {
|
||||||
if (!isEmptyArray(res)) {
|
if (!isEmptyArray(res)) {
|
||||||
@ -334,6 +352,7 @@ export default function StuffSearchCondition() {
|
|||||||
// 엔터 이벤트
|
// 엔터 이벤트
|
||||||
const handleByOnKeyUp = (e) => {
|
const handleByOnKeyUp = (e) => {
|
||||||
if (e.key === 'Enter') {
|
if (e.key === 'Enter') {
|
||||||
|
stuffSearch.code = 'E'
|
||||||
onSubmit()
|
onSubmit()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -381,7 +400,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
ref={objectNoRef}
|
ref={objectNoRef}
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch.code === 'E' || stuffSearch.code === 'M' ? stuffSearch?.schObjectNo : objectNo}
|
defaultValue={stuffSearch?.schObjectNo ? stuffSearch.schObjectNo : objectNo}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setObjectNo(objectNoRef.current.value)
|
setObjectNo(objectNoRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -396,7 +415,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
ref={saleStoreNameRef}
|
ref={saleStoreNameRef}
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch.code === 'E' ? stuffSearch?.schSaleStoreName : saleStoreName}
|
defaultValue={stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setSaleStoreName(saleStoreNameRef.current.value)
|
setSaleStoreName(saleStoreNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -411,7 +430,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
ref={addressRef}
|
ref={addressRef}
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch.code === 'E' ? stuffSearch?.schAddress : address}
|
defaultValue={stuffSearch?.schAddress ? stuffSearch.schAddress : address}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setAddress(addressRef.current.value)
|
setAddress(addressRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -426,7 +445,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
ref={dispCompanyNameRef}
|
ref={dispCompanyNameRef}
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch.code === 'E' ? stuffSearch?.schDispCompanyName : dispCompanyName}
|
defaultValue={stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setDispCompanyName(dispCompanyNameRef.current.value)
|
setDispCompanyName(dispCompanyNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -443,7 +462,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
ref={objectNameRef}
|
ref={objectNameRef}
|
||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch.code === 'E' ? stuffSearch?.schObjectName : objectName}
|
defaultValue={stuffSearch?.schObjectName ? stuffSearch.schObjectName : objectName}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setobjectName(objectNameRef.current.value)
|
setobjectName(objectNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -458,7 +477,7 @@ export default function StuffSearchCondition() {
|
|||||||
type="text"
|
type="text"
|
||||||
className="input-light"
|
className="input-light"
|
||||||
ref={receiveUserRef}
|
ref={receiveUserRef}
|
||||||
defaultValue={stuffSearch.code === 'E' ? stuffSearch?.schReceiveUser : receiveUser}
|
defaultValue={stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setReceiveUser(receiveUserRef.current.value)
|
setReceiveUser(receiveUserRef.current.value)
|
||||||
}}
|
}}
|
||||||
@ -470,7 +489,7 @@ export default function StuffSearchCondition() {
|
|||||||
<td colSpan={3}>
|
<td colSpan={3}>
|
||||||
<div className="form-flex-wrap">
|
<div className="form-flex-wrap">
|
||||||
<div className="select-wrap mr5" style={{ flex: 1 }}>
|
<div className="select-wrap mr5" style={{ flex: 1 }}>
|
||||||
{sessionState?.storeId === 'T01' && (
|
{session?.storeId === 'T01' && (
|
||||||
<Select
|
<Select
|
||||||
id="long-value-select1"
|
id="long-value-select1"
|
||||||
instanceId="long-value-select1"
|
instanceId="long-value-select1"
|
||||||
@ -483,7 +502,7 @@ export default function StuffSearchCondition() {
|
|||||||
onChange={onSelectionChange}
|
onChange={onSelectionChange}
|
||||||
getOptionLabel={(x) => x.saleStoreName}
|
getOptionLabel={(x) => x.saleStoreName}
|
||||||
getOptionValue={(x) => x.saleStoreId}
|
getOptionValue={(x) => x.saleStoreId}
|
||||||
value={showSaleStoreList.filter(function (option) {
|
value={schSelSaleStoreList.filter(function (option) {
|
||||||
if (stuffSearch?.code === 'S' && schSelSaleStoreId === '') {
|
if (stuffSearch?.code === 'S' && schSelSaleStoreId === '') {
|
||||||
return false
|
return false
|
||||||
} else if (stuffSearch?.code === 'S' && schSelSaleStoreId !== '') {
|
} else if (stuffSearch?.code === 'S' && schSelSaleStoreId !== '') {
|
||||||
@ -498,11 +517,11 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : sessionState?.storeId !== 'T01' ? true : false}
|
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||||
isClearable={true}
|
isClearable={true}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{sessionState?.storeId !== 'T01' && sessionState?.storeLvl === '1' && (
|
{session?.storeId !== 'T01' && session?.storeLvl === '1' && (
|
||||||
<Select
|
<Select
|
||||||
id="long-value-select1"
|
id="long-value-select1"
|
||||||
instanceId="long-value-select1"
|
instanceId="long-value-select1"
|
||||||
@ -529,11 +548,11 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})}
|
})}
|
||||||
isDisabled={sessionState?.storeLvl !== '1' ? true : sessionState?.storeId !== 'T01' ? true : false}
|
isDisabled={session?.storeLvl !== '1' ? true : session?.storeId !== 'T01' ? true : false}
|
||||||
isClearable={false}
|
isClearable={false}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{sessionState?.storeId !== 'T01' && sessionState?.storeLvl !== '1' && (
|
{session?.storeId !== 'T01' && session?.storeLvl !== '1' && (
|
||||||
<Select
|
<Select
|
||||||
id="long-value-select1"
|
id="long-value-select1"
|
||||||
instanceId="long-value-select1"
|
instanceId="long-value-select1"
|
||||||
@ -597,11 +616,11 @@ export default function StuffSearchCondition() {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="radio_ptype"
|
name="radio_ptype"
|
||||||
id="radio_u"
|
id="radio_u"
|
||||||
checked={stuffSearch?.schDateType === 'U' ? true : false}
|
checked={dateType === 'U' ? true : false}
|
||||||
value={'U'}
|
value={'U'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setDateType(e.target.value)
|
setDateType(e.target.value)
|
||||||
setStuffSearch({ ...stuffSearch, code: 'S', schDateType: e.target.value })
|
//setStuffSearch({ ...stuffSearch, code: 'S', schDateType: e.target.value })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
||||||
@ -611,11 +630,11 @@ export default function StuffSearchCondition() {
|
|||||||
type="radio"
|
type="radio"
|
||||||
name="radio_ptype"
|
name="radio_ptype"
|
||||||
id="radio_r"
|
id="radio_r"
|
||||||
checked={stuffSearch?.schDateType === 'R' ? true : false}
|
checked={dateType === 'R' ? true : false}
|
||||||
value={'R'}
|
value={'R'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setDateType(e.target.value)
|
setDateType(e.target.value)
|
||||||
setStuffSearch({ ...stuffSearch, code: 'S', schDateType: e.target.value })
|
//setStuffSearch({ ...stuffSearch, code: 'S', schDateType: e.target.value })
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
||||||
|
|||||||
@ -88,7 +88,7 @@ export default function StuffSubHeader({ type }) {
|
|||||||
<li className="title-item">
|
<li className="title-item">
|
||||||
<a className="sub-header-title" onClick={moveFloorPlan}>
|
<a className="sub-header-title" onClick={moveFloorPlan}>
|
||||||
<span className="icon drawing"></span>
|
<span className="icon drawing"></span>
|
||||||
{getMessage('plan.menu.plan.drawing')}
|
{getMessage('stuff.temp.subTitle2')}
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
@ -786,6 +786,15 @@ export function useCommonUtils() {
|
|||||||
canvas?.renderAll()
|
canvas?.renderAll()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const deleteOuterLineObject = () => {
|
||||||
|
const selectedOuterLine = canvas.getActiveObject()
|
||||||
|
if (selectedOuterLine && selectedOuterLine.name === 'outerLine') {
|
||||||
|
canvas.remove(selectedOuterLine)
|
||||||
|
canvas.renderAll()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
commonFunctions,
|
commonFunctions,
|
||||||
dimensionSettings,
|
dimensionSettings,
|
||||||
@ -796,5 +805,6 @@ export function useCommonUtils() {
|
|||||||
copyObject,
|
copyObject,
|
||||||
editText,
|
editText,
|
||||||
changeDimensionExtendLine,
|
changeDimensionExtendLine,
|
||||||
|
deleteOuterLineObject,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import { useRecoilValue } from 'recoil'
|
|||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { BATCH_TYPE, INPUT_TYPE } from '@/common/common'
|
import { BATCH_TYPE, INPUT_TYPE } from '@/common/common'
|
||||||
import { useEvent } from '@/hooks/useEvent'
|
import { useEvent } from '@/hooks/useEvent'
|
||||||
import { pointsToTurfPolygon, polygonToTurfPolygon, rectToPolygon, triangleToPolygon, setSurfaceShapePattern } from '@/util/canvas-util'
|
import { pointsToTurfPolygon, polygonToTurfPolygon, rectToPolygon, setSurfaceShapePattern, triangleToPolygon } from '@/util/canvas-util'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import * as turf from '@turf/turf'
|
import * as turf from '@turf/turf'
|
||||||
import { usePolygon } from '@/hooks/usePolygon'
|
import { usePolygon } from '@/hooks/usePolygon'
|
||||||
@ -13,7 +13,7 @@ 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'
|
||||||
|
|
||||||
export function useObjectBatch() {
|
export function useObjectBatch({ isHidden, setIsHidden }) {
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
const { addCanvasMouseEventListener, initEvent } = useEvent()
|
||||||
@ -64,12 +64,12 @@ export function useObjectBatch() {
|
|||||||
const selectedType = objectPlacement.typeRef.current.find((radio) => radio.checked).value
|
const selectedType = objectPlacement.typeRef.current.find((radio) => radio.checked).value
|
||||||
const isCrossChecked = buttonAct === 1 ? objectPlacement.isCrossRef.current.checked : false
|
const isCrossChecked = buttonAct === 1 ? objectPlacement.isCrossRef.current.checked : false
|
||||||
const objName = buttonAct === 1 ? BATCH_TYPE.OPENING : BATCH_TYPE.SHADOW
|
const objName = buttonAct === 1 ? BATCH_TYPE.OPENING : BATCH_TYPE.SHADOW
|
||||||
const objTempName = buttonAct === 1 ? BATCH_TYPE.OPENING_TEMP : BATCH_TYPE.SHADOW_TEMP
|
|
||||||
|
|
||||||
|
const objTempName = buttonAct === 1 ? BATCH_TYPE.OPENING_TEMP : BATCH_TYPE.SHADOW_TEMP
|
||||||
let rect, isDown, origX, origY
|
let rect, isDown, origX, origY
|
||||||
let selectedSurface
|
let selectedSurface
|
||||||
|
|
||||||
//프리입력
|
//프리입력
|
||||||
|
console.log('useObjectBatch', isHidden)
|
||||||
if (selectedType === INPUT_TYPE.FREE) {
|
if (selectedType === INPUT_TYPE.FREE) {
|
||||||
addCanvasMouseEventListener('mouse:down', (e) => {
|
addCanvasMouseEventListener('mouse:down', (e) => {
|
||||||
isDown = true
|
isDown = true
|
||||||
@ -84,6 +84,7 @@ export function useObjectBatch() {
|
|||||||
if (!selectedSurface) {
|
if (!selectedSurface) {
|
||||||
swalFire({ text: '지붕안에 그려야해요', icon: 'error' })
|
swalFire({ text: '지붕안에 그려야해요', icon: 'error' })
|
||||||
initEvent() //이벤트 초기화
|
initEvent() //이벤트 초기화
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -160,6 +161,8 @@ export function useObjectBatch() {
|
|||||||
rect.set({ name: objName })
|
rect.set({ name: objName })
|
||||||
rect.setCoords()
|
rect.setCoords()
|
||||||
initEvent()
|
initEvent()
|
||||||
|
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (selectedType === INPUT_TYPE.DIMENSION) {
|
} else if (selectedType === INPUT_TYPE.DIMENSION) {
|
||||||
@ -239,6 +242,7 @@ export function useObjectBatch() {
|
|||||||
rect.set({ name: objName })
|
rect.set({ name: objName })
|
||||||
rect.setCoords()
|
rect.setCoords()
|
||||||
initEvent()
|
initEvent()
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -456,6 +460,7 @@ export function useObjectBatch() {
|
|||||||
isDown = false
|
isDown = false
|
||||||
initEvent()
|
initEvent()
|
||||||
dbClickEvent()
|
dbClickEvent()
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
} else if (buttonAct === 4) {
|
} else if (buttonAct === 4) {
|
||||||
@ -631,7 +636,9 @@ export function useObjectBatch() {
|
|||||||
|
|
||||||
isDown = false
|
isDown = false
|
||||||
initEvent()
|
initEvent()
|
||||||
|
|
||||||
dbClickEvent()
|
dbClickEvent()
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -649,6 +656,7 @@ export function useObjectBatch() {
|
|||||||
)
|
)
|
||||||
canvas?.remove(...deleteTarget)
|
canvas?.remove(...deleteTarget)
|
||||||
initEvent() //이벤트 초기화
|
initEvent() //이벤트 초기화
|
||||||
|
if (setIsHidden) setIsHidden(false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const splitDormerTriangle = (triangle, direction) => {
|
const splitDormerTriangle = (triangle, direction) => {
|
||||||
@ -747,28 +755,40 @@ export function useObjectBatch() {
|
|||||||
leftPoints = [
|
leftPoints = [
|
||||||
{ x: points[0].x, y: points[0].y },
|
{ x: points[0].x, y: points[0].y },
|
||||||
{ x: points[0].x - (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) },
|
{ x: points[0].x - (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) },
|
||||||
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y - (points[0].x - points[1].x) },
|
{
|
||||||
|
x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y),
|
||||||
|
y: points[0].y - (points[0].x - points[1].x),
|
||||||
|
},
|
||||||
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y },
|
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y },
|
||||||
]
|
]
|
||||||
|
|
||||||
rightPoints = [
|
rightPoints = [
|
||||||
{ x: points[0].x, y: points[0].y },
|
{ x: points[0].x, y: points[0].y },
|
||||||
{ x: points[0].x - (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) },
|
{ x: points[0].x - (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) },
|
||||||
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y + (points[0].x - points[1].x) },
|
{
|
||||||
|
x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y),
|
||||||
|
y: points[0].y + (points[0].x - points[1].x),
|
||||||
|
},
|
||||||
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y },
|
{ x: points[0].x - (points[1].y - points[0].y) - (points[2].y - points[1].y), y: points[0].y },
|
||||||
]
|
]
|
||||||
} else if (direction === 'right') {
|
} else if (direction === 'right') {
|
||||||
leftPoints = [
|
leftPoints = [
|
||||||
{ x: points[0].x, y: points[0].y },
|
{ x: points[0].x, y: points[0].y },
|
||||||
{ x: points[0].x + (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) },
|
{ x: points[0].x + (points[1].y - points[0].y), y: points[0].y + (points[0].x - points[1].x) },
|
||||||
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y + (points[0].x - points[1].x) },
|
{
|
||||||
|
x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y),
|
||||||
|
y: points[0].y + (points[0].x - points[1].x),
|
||||||
|
},
|
||||||
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y },
|
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y },
|
||||||
]
|
]
|
||||||
|
|
||||||
rightPoints = [
|
rightPoints = [
|
||||||
{ x: points[0].x, y: points[0].y },
|
{ x: points[0].x, y: points[0].y },
|
||||||
{ x: points[0].x + (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) },
|
{ x: points[0].x + (points[1].y - points[0].y), y: points[0].y - (points[0].x - points[1].x) },
|
||||||
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y - (points[0].x - points[1].x) },
|
{
|
||||||
|
x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y),
|
||||||
|
y: points[0].y - (points[0].x - points[1].x),
|
||||||
|
},
|
||||||
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y },
|
{ x: points[0].x + (points[1].y - points[0].y) + (points[2].y - points[1].y), y: points[0].y },
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,6 +22,7 @@ import { useSwal } from '@/hooks/useSwal'
|
|||||||
import { booleanPointInPolygon } from '@turf/turf'
|
import { booleanPointInPolygon } from '@turf/turf'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { calculateAngle } from '@/util/qpolygon-utils'
|
import { calculateAngle } from '@/util/qpolygon-utils'
|
||||||
|
import { QPolygon } from '@/components/fabric/QPolygon'
|
||||||
|
|
||||||
// 보조선 작성
|
// 보조선 작성
|
||||||
export function useAuxiliaryDrawing(id) {
|
export function useAuxiliaryDrawing(id) {
|
||||||
@ -561,17 +562,62 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase')
|
const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase')
|
||||||
|
/*const allLines = [...auxiliaryLines]
|
||||||
const allLines = [...auxiliaryLines]
|
|
||||||
|
|
||||||
roofBases.forEach((roofBase) => {
|
roofBases.forEach((roofBase) => {
|
||||||
roofBase.lines.forEach((line) => {
|
allLines.push(...roofBase.lines)
|
||||||
allLines.push(line)
|
})*/
|
||||||
})
|
|
||||||
|
const innerLines = [...auxiliaryLines]
|
||||||
|
const roofLines = []
|
||||||
|
|
||||||
|
roofBases.forEach((roofBase) => {
|
||||||
|
innerLines.push(...roofBase.innerLines)
|
||||||
|
roofLines.push(...roofBase.lines)
|
||||||
})
|
})
|
||||||
|
|
||||||
auxiliaryLines.forEach((line1) => {
|
auxiliaryLines.forEach((line1) => {
|
||||||
allLines.forEach((line2) => {
|
let interSectionPointsWithRoofLines = []
|
||||||
|
|
||||||
|
//지붕선과 만나는 점을 찾는다.
|
||||||
|
roofLines.forEach((line2) => {
|
||||||
|
const intersectionPoint = calculateIntersection(line1, line2)
|
||||||
|
if (!intersectionPoint) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// 기존 점과 겹치는지 확인
|
||||||
|
if (interSectionPointsWithRoofLines.some((point) => point.x === intersectionPoint.x && point.y === intersectionPoint.y)) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
interSectionPointsWithRoofLines.push(intersectionPoint)
|
||||||
|
})
|
||||||
|
|
||||||
|
//지붕선과 만나는 점이 두개일 경우 넘친 보조선을 잘라준다 (케라바로 만든 마루)
|
||||||
|
if (interSectionPointsWithRoofLines.length === 2) {
|
||||||
|
const newLine = addLine(
|
||||||
|
[
|
||||||
|
interSectionPointsWithRoofLines[0].x,
|
||||||
|
interSectionPointsWithRoofLines[0].y,
|
||||||
|
interSectionPointsWithRoofLines[1].x,
|
||||||
|
interSectionPointsWithRoofLines[1].y,
|
||||||
|
],
|
||||||
|
{
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 1,
|
||||||
|
selectable: false,
|
||||||
|
name: 'auxiliaryLine',
|
||||||
|
isFixed: true,
|
||||||
|
},
|
||||||
|
)
|
||||||
|
lineHistory.current.push(newLine)
|
||||||
|
removeLine(line1)
|
||||||
|
intersectionPoints.current.push(...interSectionPointsWithRoofLines)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
//보조선과 만나는 점을 찾는다.
|
||||||
|
innerLines.forEach((line2) => {
|
||||||
if (line1 === line2) {
|
if (line1 === line2) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -615,6 +661,53 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
lineHistory.current.push(newLine)
|
lineHistory.current.push(newLine)
|
||||||
removeLine(line1)
|
removeLine(line1)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
/*auxiliaryLines.forEach((line1) => {
|
||||||
|
allLines.forEach((line2) => {
|
||||||
|
if (line1 === line2) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const intersectionPoint = calculateIntersection(line1, line2)
|
||||||
|
if (!intersectionPoint) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
roofAdsorptionPoints.current.push(intersectionPoint)
|
||||||
|
intersectionPoints.current.push(intersectionPoint)
|
||||||
|
|
||||||
|
const distance1 = distanceBetweenPoints({ x: line1.x1, y: line1.y1 }, intersectionPoint)
|
||||||
|
const distance2 = distanceBetweenPoints({ x: line1.x2, y: line1.y2 }, intersectionPoint)
|
||||||
|
|
||||||
|
if (distance1 === 0 || distance2 === 0) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
//historyLine에서 기존 line을 제거한다.
|
||||||
|
lineHistory.current = lineHistory.current.filter((history) => history !== line1)
|
||||||
|
|
||||||
|
let newLine
|
||||||
|
|
||||||
|
if (distance1 >= distance2) {
|
||||||
|
newLine = addLine([line1.x1, line1.y1, intersectionPoint.x, intersectionPoint.y], {
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 1,
|
||||||
|
selectable: false,
|
||||||
|
name: 'auxiliaryLine',
|
||||||
|
isFixed: true,
|
||||||
|
intersectionPoint,
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
newLine = addLine([line1.x2, line1.y2, intersectionPoint.x, intersectionPoint.y], {
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 1,
|
||||||
|
selectable: false,
|
||||||
|
name: 'auxiliaryLine',
|
||||||
|
isFixed: true,
|
||||||
|
intersectionPoint,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
lineHistory.current.push(newLine)
|
||||||
|
removeLine(line1)
|
||||||
|
})
|
||||||
|
})*/
|
||||||
})
|
})
|
||||||
addCanvasMouseEventListener('mouse:move', mouseMove)
|
addCanvasMouseEventListener('mouse:move', mouseMove)
|
||||||
}
|
}
|
||||||
@ -650,15 +743,38 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase')
|
const roofBases = canvas.getObjects().filter((obj) => obj.name === 'roofBase')
|
||||||
const innerLines = [...lineHistory.current]
|
|
||||||
|
//lineHistory.current에 있는 선들 중 startPoint와 endPoint가 겹치는 line은 제거
|
||||||
|
// 겹치는 선 하나는 canvas에서 제거한다.
|
||||||
|
|
||||||
|
const tempLines = [...lineHistory.current]
|
||||||
|
lineHistory.current = []
|
||||||
|
tempLines.forEach((line) => {
|
||||||
|
if (
|
||||||
|
lineHistory.current.some(
|
||||||
|
(history) =>
|
||||||
|
JSON.stringify(history.startPoint) === JSON.stringify(line.startPoint) &&
|
||||||
|
JSON.stringify(history.endPoint) === JSON.stringify(line.endPoint),
|
||||||
|
)
|
||||||
|
) {
|
||||||
|
canvas.remove(line)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
lineHistory.current.push(line)
|
||||||
|
})
|
||||||
|
|
||||||
|
const innerLines = lineHistory.current
|
||||||
|
|
||||||
roofBases.forEach((roofBase) => {
|
roofBases.forEach((roofBase) => {
|
||||||
|
const tempPolygonPoints = [...roofBase.points].map((obj) => {
|
||||||
|
return { x: Math.round(obj.x), y: Math.round(obj.y) }
|
||||||
|
})
|
||||||
const roofInnerLines = innerLines.filter((line) => {
|
const roofInnerLines = innerLines.filter((line) => {
|
||||||
const turfPolygon = polygonToTurfPolygon(roofBase)
|
const inPolygon1 =
|
||||||
|
tempPolygonPoints.some((point) => point.x === line.x1 && point.y === line.y1) || roofBase.inPolygon({ x: line.x1, y: line.y1 })
|
||||||
// innerLines의 두 점이 모두 polygon 안에 있는지 확인
|
const inPolygon2 =
|
||||||
const inPolygon1 = booleanPointInPolygon([line.x1, line.y1], turfPolygon)
|
tempPolygonPoints.some((point) => point.x === line.x2 && point.y === line.y2) || roofBase.inPolygon({ x: line.x2, y: line.y2 })
|
||||||
const inPolygon2 = booleanPointInPolygon([line.x2, line.y2], turfPolygon)
|
|
||||||
|
|
||||||
if (inPolygon1 && inPolygon2) {
|
if (inPolygon1 && inPolygon2) {
|
||||||
line.attributes = { ...line.attributes, roofId: roofBase.id }
|
line.attributes = { ...line.attributes, roofId: roofBase.id }
|
||||||
@ -667,6 +783,8 @@ export function useAuxiliaryDrawing(id) {
|
|||||||
})
|
})
|
||||||
|
|
||||||
roofBase.innerLines = [...roofInnerLines]
|
roofBase.innerLines = [...roofInnerLines]
|
||||||
|
|
||||||
|
canvas.renderAll()
|
||||||
})
|
})
|
||||||
|
|
||||||
closePopup(id)
|
closePopup(id)
|
||||||
|
|||||||
@ -70,9 +70,7 @@ export function useMovementSetting(id) {
|
|||||||
updownEvent(e)
|
updownEvent(e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const flowLineEvent = (e) => {
|
const flowLineEvent = (e) => {}
|
||||||
console.log('flow')
|
|
||||||
}
|
|
||||||
|
|
||||||
const updownEvent = (e) => {
|
const updownEvent = (e) => {
|
||||||
const target = canvas.getActiveObject()
|
const target = canvas.getActiveObject()
|
||||||
@ -113,18 +111,24 @@ export function useMovementSetting(id) {
|
|||||||
canvas?.renderAll()
|
canvas?.renderAll()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getOnlyDecimal = function (_number, _length) {
|
|
||||||
let result
|
|
||||||
|
|
||||||
result = _number % 1
|
|
||||||
|
|
||||||
result = Number(result.toFixed(_length))
|
|
||||||
|
|
||||||
return result * 10
|
|
||||||
}
|
|
||||||
|
|
||||||
const handleSave = () => {
|
const handleSave = () => {
|
||||||
closePopup(id)
|
if (type === TYPE.FLOW_LINE) {
|
||||||
|
// 동선이동
|
||||||
|
if (FLOW_LINE_REF.DOWN_LEFT_RADIO_REF.current.checked) {
|
||||||
|
// 높이 변경: 아래, 왼쪽 체크
|
||||||
|
} else {
|
||||||
|
// 높이 변경: 위, 오른쪽 체크
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// 형 올림내림
|
||||||
|
if (UP_DOWN_REF.UP_RADIO_REF.current.checked) {
|
||||||
|
// 자릿수를 올리다 체크
|
||||||
|
const length = Number(UP_DOWN_REF.UP_INPUT_REF.current.value)
|
||||||
|
} else {
|
||||||
|
// 자릿수를 내리다 체크
|
||||||
|
const length = Number(UP_DOWN_REF.DOWN_INPUT_REF.current.value)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import GridMove from '@/components/floor-plan/modal/grid/GridMove'
|
|||||||
import GridCopy from '@/components/floor-plan/modal/grid/GridCopy'
|
import GridCopy from '@/components/floor-plan/modal/grid/GridCopy'
|
||||||
import ColorPickerModal from '@/components/common/color-picker/ColorPickerModal'
|
import ColorPickerModal from '@/components/common/color-picker/ColorPickerModal'
|
||||||
import { gridColorState } from '@/store/gridAtom'
|
import { gridColorState } from '@/store/gridAtom'
|
||||||
import { contextPopupPositionState } from '@/store/popupAtom'
|
import { contextPopupPositionState, contextPopupState } from '@/store/popupAtom'
|
||||||
import AuxiliaryCopy from '@/components/floor-plan/modal/auxiliary/AuxiliaryCopy'
|
import AuxiliaryCopy from '@/components/floor-plan/modal/auxiliary/AuxiliaryCopy'
|
||||||
import SizeSetting from '@/components/floor-plan/modal/object/SizeSetting'
|
import SizeSetting from '@/components/floor-plan/modal/object/SizeSetting'
|
||||||
import RoofMaterialSetting from '@/components/floor-plan/modal/object/RoofMaterialSetting'
|
import RoofMaterialSetting from '@/components/floor-plan/modal/object/RoofMaterialSetting'
|
||||||
@ -24,7 +24,7 @@ import { useCommonUtils } from './common/useCommonUtils'
|
|||||||
import { useObjectBatch } from './object/useObjectBatch'
|
import { useObjectBatch } from './object/useObjectBatch'
|
||||||
import { useMessage } from '@/hooks/useMessage'
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
import { useCanvasEvent } from '@/hooks/useCanvasEvent'
|
import { useCanvasEvent } from '@/hooks/useCanvasEvent'
|
||||||
import { contextMenuState } from '@/store/contextMenu'
|
import { contextMenuListState, contextMenuState } from '@/store/contextMenu'
|
||||||
import ImageSizeSetting from '@/components/floor-plan/modal/image/ImageSizeSetting'
|
import ImageSizeSetting from '@/components/floor-plan/modal/image/ImageSizeSetting'
|
||||||
import PanelEdit from '@/components/floor-plan/modal/module/PanelEdit'
|
import PanelEdit from '@/components/floor-plan/modal/module/PanelEdit'
|
||||||
import DimensionLineSetting from '@/components/floor-plan/modal/dimensionLine/DimensionLineSetting'
|
import DimensionLineSetting from '@/components/floor-plan/modal/dimensionLine/DimensionLineSetting'
|
||||||
@ -37,21 +37,19 @@ import CircuitNumberEdit from '@/components/floor-plan/modal/module/CircuitNumbe
|
|||||||
export function useContextMenu() {
|
export function useContextMenu() {
|
||||||
const currentMenu = useRecoilValue(currentMenuState) // 현재 메뉴
|
const currentMenu = useRecoilValue(currentMenuState) // 현재 메뉴
|
||||||
const setContextPopupPosition = useSetRecoilState(contextPopupPositionState) // 현재 메뉴
|
const setContextPopupPosition = useSetRecoilState(contextPopupPositionState) // 현재 메뉴
|
||||||
const [contextMenu, setContextMenu] = useState([[]]) // 메뉴.object 별 context menu
|
const [contextMenu, setContextMenu] = useRecoilState(contextMenuListState) // 메뉴.object 별 context menu
|
||||||
const [currentContextMenu, setCurrentContextMenu] = useState(null) // 선택한 contextMenu
|
const [currentContextMenu, setCurrentContextMenu] = useRecoilState(contextPopupState) // 선택한 contextMenu
|
||||||
const currentObject = useRecoilValue(currentObjectState)
|
const currentObject = useRecoilValue(currentObjectState)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { addPopup } = usePopup()
|
const { addPopup } = usePopup()
|
||||||
const [popupId, setPopupId] = useState(uuidv4())
|
const [popupId, setPopupId] = useState(uuidv4())
|
||||||
const [gridColor, setGridColor] = useRecoilState(gridColorState)
|
const [gridColor, setGridColor] = useRecoilState(gridColorState)
|
||||||
|
const { deleteObject, moveObject, copyObject, editText, changeDimensionExtendLine, deleteOuterLineObject } = useCommonUtils()
|
||||||
const [qContextMenu, setQContextMenu] = useRecoilState(contextMenuState)
|
const [qContextMenu, setQContextMenu] = useRecoilState(contextMenuState)
|
||||||
const [cell, setCell] = useState(null)
|
const [cell, setCell] = useState(null)
|
||||||
const [column, setColumn] = useState(null)
|
const [column, setColumn] = useState(null)
|
||||||
const { handleZoomClear } = useCanvasEvent()
|
const { handleZoomClear } = useCanvasEvent()
|
||||||
|
|
||||||
const { deleteObject, moveObject, copyObject, editText, changeDimensionExtendLine } = useCommonUtils()
|
|
||||||
const { deleteObjectBatch } = useObjectBatch()
|
|
||||||
|
|
||||||
const currentMenuSetting = () => {
|
const currentMenuSetting = () => {
|
||||||
switch (currentMenu) {
|
switch (currentMenu) {
|
||||||
case MENU.PLAN_DRAWING:
|
case MENU.PLAN_DRAWING:
|
||||||
@ -119,6 +117,7 @@ export function useContextMenu() {
|
|||||||
{
|
{
|
||||||
id: 'wallLineRemove',
|
id: 'wallLineRemove',
|
||||||
name: getMessage('contextmenu.wallline.remove'),
|
name: getMessage('contextmenu.wallline.remove'),
|
||||||
|
fn: () => deleteOuterLineObject(),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 'imageSizeEdit',
|
id: 'imageSizeEdit',
|
||||||
@ -224,9 +223,10 @@ export function useContextMenu() {
|
|||||||
if (menu?.fn) {
|
if (menu?.fn) {
|
||||||
menu.fn()
|
menu.fn()
|
||||||
}
|
}
|
||||||
|
|
||||||
setContextPopupPosition({
|
setContextPopupPosition({
|
||||||
x: e?.clientX,
|
x: window.innerWidth / 2,
|
||||||
y: e?.clientY,
|
y: 180,
|
||||||
})
|
})
|
||||||
setCurrentContextMenu(menu)
|
setCurrentContextMenu(menu)
|
||||||
setQContextMenu({ ...qContextMenu, visible: false })
|
setQContextMenu({ ...qContextMenu, visible: false })
|
||||||
|
|||||||
@ -1,14 +1,15 @@
|
|||||||
import { useRecoilState } from 'recoil'
|
import { useRecoilState } from 'recoil'
|
||||||
import { popupState } from '@/store/popupAtom'
|
import { contextPopupState, popupState } from '@/store/popupAtom'
|
||||||
|
|
||||||
export function usePopup() {
|
export function usePopup() {
|
||||||
const [popup, setPopup] = useRecoilState(popupState)
|
const [popup, setPopup] = useRecoilState(popupState)
|
||||||
|
const [contextMenuPopup, setContextMenuPopup] = useRecoilState(contextPopupState)
|
||||||
const addPopup = (id, depth, component) => {
|
const addPopup = (id, depth, component) => {
|
||||||
setPopup({ children: [...filterDepth(depth), { id: id, depth: depth, component: component }] })
|
setPopup({ children: [...filterDepth(depth), { id: id, depth: depth, component: component }] })
|
||||||
}
|
}
|
||||||
|
|
||||||
const closePopup = (id) => {
|
const closePopup = (id) => {
|
||||||
|
if (contextMenuPopup) setContextMenuPopup(null)
|
||||||
setPopup({ children: [...filterChildrenPopup(id).filter((child) => child.id !== id)] })
|
setPopup({ children: [...filterChildrenPopup(id).filter((child) => child.id !== id)] })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
"header.go": "移動",
|
"header.go": "移動",
|
||||||
"header.online.warranty.system": "オンライン保証シ",
|
"header.online.warranty.system": "オンライン保証シ",
|
||||||
"header.stem": "ステム",
|
"header.stem": "ステム",
|
||||||
"plan.menu.plan.drawing": "도면작성",
|
"plan.menu.plan.drawing": "물건정보(JA)",
|
||||||
"plan.menu.placement.surface.initial.setting": "配置面 初期設定",
|
"plan.menu.placement.surface.initial.setting": "配置面 初期設定",
|
||||||
"modal.placement.initial.setting.plan.drawing.size.stuff": "寸法入力による物品作成",
|
"modal.placement.initial.setting.plan.drawing.size.stuff": "寸法入力による物品作成",
|
||||||
"modal.placement.initial.setting.plan.": "図面の作成方法",
|
"modal.placement.initial.setting.plan.": "図面の作成方法",
|
||||||
@ -293,10 +293,14 @@
|
|||||||
"contextmenu.select.move": "선택・이동(JA)",
|
"contextmenu.select.move": "선택・이동(JA)",
|
||||||
"contextmenu.wallline.remove": "외벽선 삭제(JA)",
|
"contextmenu.wallline.remove": "외벽선 삭제(JA)",
|
||||||
"contextmenu.size.edit": "サイズ変更",
|
"contextmenu.size.edit": "サイズ変更",
|
||||||
|
"modal.auxiliary.size.edit": "補助線サイズ変更",
|
||||||
|
"modal.auxiliary.size.edit.point": "支店",
|
||||||
"contextmenu.auxiliary.move": "補助線の移動",
|
"contextmenu.auxiliary.move": "補助線の移動",
|
||||||
"modal.auxiliary.move": "補助線の移動",
|
"modal.auxiliary.move": "補助線の移動",
|
||||||
"modal.auxiliary.move.info": "移動する方向を入力してください",
|
"modal.auxiliary.move.info": "移動する方向を入力してください",
|
||||||
"contextmenu.auxiliary.copy": "보조선 복사(JA)",
|
"contextmenu.auxiliary.copy": "補助線のコピー",
|
||||||
|
"modal.auxiliary.copy": "補助線のコピー",
|
||||||
|
"modal.auxiliary.copy.info": "コピーする方向を入力してください",
|
||||||
"contextmenu.auxiliary.remove": "보조선 삭제(JA)",
|
"contextmenu.auxiliary.remove": "보조선 삭제(JA)",
|
||||||
"contextmenu.auxiliary.vertical.bisector": "보조선 수직이등분선(JA)",
|
"contextmenu.auxiliary.vertical.bisector": "보조선 수직이등분선(JA)",
|
||||||
"contextmenu.auxiliary.cut": "보조선 절삭(JA)",
|
"contextmenu.auxiliary.cut": "보조선 절삭(JA)",
|
||||||
@ -582,6 +586,7 @@
|
|||||||
"stuff.addressPopup.btn2": "住所適用",
|
"stuff.addressPopup.btn2": "住所適用",
|
||||||
"stuff.planReqPopup.title": "設計依頼のインポート",
|
"stuff.planReqPopup.title": "設計依頼のインポート",
|
||||||
"stuff.temp.subTitle": "商品情報",
|
"stuff.temp.subTitle": "商品情報",
|
||||||
|
"stuff.temp.subTitle2": "作図",
|
||||||
"stuff.detail.header.message1": "存在しないものです。",
|
"stuff.detail.header.message1": "存在しないものです。",
|
||||||
"stuff.detail.header.message2": "商品番号がコピーされました。",
|
"stuff.detail.header.message2": "商品番号がコピーされました。",
|
||||||
"stuff.detail.header.message3": "存在しないものです。",
|
"stuff.detail.header.message3": "存在しないものです。",
|
||||||
|
|||||||
@ -13,7 +13,7 @@
|
|||||||
"header.go": "이동",
|
"header.go": "이동",
|
||||||
"header.online.warranty.system": "온라인 보증 시스템",
|
"header.online.warranty.system": "온라인 보증 시스템",
|
||||||
"header.stem": "Stem",
|
"header.stem": "Stem",
|
||||||
"plan.menu.plan.drawing": "도면작성",
|
"plan.menu.plan.drawing": "물건정보",
|
||||||
"plan.menu.placement.surface.initial.setting": "배치면 초기 설정",
|
"plan.menu.placement.surface.initial.setting": "배치면 초기 설정",
|
||||||
"modal.placement.initial.setting.plan.drawing": "도면 작성방법",
|
"modal.placement.initial.setting.plan.drawing": "도면 작성방법",
|
||||||
"modal.placement.initial.setting.plan.drawing.size.stuff": "치수 입력에 의한 물건 작성",
|
"modal.placement.initial.setting.plan.drawing.size.stuff": "치수 입력에 의한 물건 작성",
|
||||||
@ -292,16 +292,21 @@
|
|||||||
"margin": "간격",
|
"margin": "간격",
|
||||||
"contextmenu.roof.material.placement": "지붕재 배치",
|
"contextmenu.roof.material.placement": "지붕재 배치",
|
||||||
"contextmenu.roof.material.edit": "지붕재 변경",
|
"contextmenu.roof.material.edit": "지붕재 변경",
|
||||||
|
"modal.roof.material.edit": "지붕재 변경",
|
||||||
"contextmenu.roof.material.remove": "지붕재 삭제",
|
"contextmenu.roof.material.remove": "지붕재 삭제",
|
||||||
"contextmenu.roof.material.remove.all": "지붕재 전체 삭제",
|
"contextmenu.roof.material.remove.all": "지붕재 전체 삭제",
|
||||||
"contextmenu.dormer.offset": "도머 오프셋",
|
"contextmenu.dormer.offset": "도머 오프셋",
|
||||||
"contextmenu.select.move": "선택・이동",
|
"contextmenu.select.move": "선택・이동",
|
||||||
"contextmenu.wallline.remove": "외벽선 삭제",
|
"contextmenu.wallline.remove": "외벽선 삭제",
|
||||||
"contextmenu.size.edit": "사이즈 변경",
|
"contextmenu.size.edit": "사이즈 변경",
|
||||||
|
"modal.auxiliary.size.edit": "보조선 사이즈 변경",
|
||||||
|
"modal.auxiliary.size.edit.point": "지점",
|
||||||
"contextmenu.auxiliary.move": "보조선 이동",
|
"contextmenu.auxiliary.move": "보조선 이동",
|
||||||
"modal.auxiliary.move": "보조선 이동",
|
"modal.auxiliary.move": "보조선 이동",
|
||||||
"modal.auxiliary.move.info": "이동할 방향을 입력해주세요.",
|
"modal.auxiliary.move.info": "이동할 방향을 입력해주세요.",
|
||||||
"contextmenu.auxiliary.copy": "보조선 복사",
|
"contextmenu.auxiliary.copy": "보조선 복사",
|
||||||
|
"modal.auxiliary.copy": "보조선 복사",
|
||||||
|
"modal.auxiliary.copy.info": "복사할 방향을 입력해주세요.",
|
||||||
"contextmenu.auxiliary.remove": "보조선 삭제",
|
"contextmenu.auxiliary.remove": "보조선 삭제",
|
||||||
"contextmenu.auxiliary.vertical.bisector": "보조선 수직이등분선",
|
"contextmenu.auxiliary.vertical.bisector": "보조선 수직이등분선",
|
||||||
"contextmenu.auxiliary.cut": "보조선 절삭",
|
"contextmenu.auxiliary.cut": "보조선 절삭",
|
||||||
@ -587,6 +592,7 @@
|
|||||||
"stuff.addressPopup.btn2": "주소적용",
|
"stuff.addressPopup.btn2": "주소적용",
|
||||||
"stuff.planReqPopup.title": "설계의뢰 불러오기",
|
"stuff.planReqPopup.title": "설계의뢰 불러오기",
|
||||||
"stuff.temp.subTitle": "물건정보",
|
"stuff.temp.subTitle": "물건정보",
|
||||||
|
"stuff.temp.subTitle2": "도면작성",
|
||||||
"stuff.detail.header.message1": "존재하지 않는 물건입니다.",
|
"stuff.detail.header.message1": "존재하지 않는 물건입니다.",
|
||||||
"stuff.detail.header.message2": "물건번호가 복사되었습니다.",
|
"stuff.detail.header.message2": "물건번호가 복사되었습니다.",
|
||||||
"stuff.detail.header.message3": "물건번호 복사에 실패했습니다.",
|
"stuff.detail.header.message3": "물건번호 복사에 실패했습니다.",
|
||||||
|
|||||||
@ -9,3 +9,9 @@ export const contextMenuState = atom({
|
|||||||
},
|
},
|
||||||
dangerouslyAllowMutability: true,
|
dangerouslyAllowMutability: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const contextMenuListState = atom({
|
||||||
|
key: 'contextMenuListState',
|
||||||
|
default: [[]],
|
||||||
|
dangerouslyAllowMutability: true,
|
||||||
|
})
|
||||||
|
|||||||
@ -12,6 +12,12 @@ export const popupState = atom({
|
|||||||
dangerouslyAllowMutability: true,
|
dangerouslyAllowMutability: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
export const contextPopupState = atom({
|
||||||
|
key: 'contextPopupState',
|
||||||
|
default: null,
|
||||||
|
dangerouslyAllowMutability: true,
|
||||||
|
})
|
||||||
|
|
||||||
export const contextPopupPositionState = atom({
|
export const contextPopupPositionState = atom({
|
||||||
key: 'contextPopupPositionState',
|
key: 'contextPopupPositionState',
|
||||||
default: {
|
default: {
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -39,7 +39,7 @@
|
|||||||
background-color: #F7F9FA;
|
background-color: #F7F9FA;
|
||||||
}
|
}
|
||||||
&.important_row{
|
&.important_row{
|
||||||
background-color: #e7e7e7;
|
background-color: #f5fcff;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.ag-cell{
|
.ag-cell{
|
||||||
|
|||||||
@ -355,6 +355,7 @@ $alert-color: #101010;
|
|||||||
|
|
||||||
// grid-move
|
// grid-move
|
||||||
.move-form{
|
.move-form{
|
||||||
|
width: 100%;
|
||||||
p{
|
p{
|
||||||
font-size: $pop-normal-size;
|
font-size: $pop-normal-size;
|
||||||
color: $pop-color;
|
color: $pop-color;
|
||||||
@ -380,7 +381,8 @@ $alert-color: #101010;
|
|||||||
flex: none;
|
flex: none;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 1fr 1fr;
|
grid-template-columns: 1fr 1fr;
|
||||||
gap: 10px;
|
gap: 5px;
|
||||||
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 배치면 초기 설정
|
// 배치면 초기 설정
|
||||||
|
|||||||
@ -9,8 +9,6 @@
|
|||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
}
|
}
|
||||||
html, body{
|
html, body{
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
}
|
}
|
||||||
html, body, div, span, applet, object, iframe,
|
html, body, div, span, applet, object, iframe,
|
||||||
|
|||||||
@ -1034,9 +1034,10 @@ export const splitPolygonWithLines = (polygon) => {
|
|||||||
const routes = []
|
const routes = []
|
||||||
|
|
||||||
// 시작점은 시작 hip라인의 출발점
|
// 시작점은 시작 hip라인의 출발점
|
||||||
const startPoint = point
|
const startPoint = { x: Math.round(point.x), y: Math.round(point.y) }
|
||||||
// 도착점은 마지막 hip라인의 끝나는 점
|
// 도착점은 마지막 hip라인의 끝나는 점
|
||||||
const endPoint = polygon.points[(index + 1) % polygon.points.length]
|
let endPoint = polygon.points[(index + 1) % polygon.points.length]
|
||||||
|
endPoint = { x: Math.round(endPoint.x), y: Math.round(endPoint.y) }
|
||||||
|
|
||||||
const startLine = allLines.find((line) => line.startPoint.x === startPoint.x && line.startPoint.y === startPoint.y)
|
const startLine = allLines.find((line) => line.startPoint.x === startPoint.x && line.startPoint.y === startPoint.y)
|
||||||
const endLine = allLines.find((line) => line.startPoint.x === endPoint.x && line.startPoint.y === endPoint.y)
|
const endLine = allLines.find((line) => line.startPoint.x === endPoint.x && line.startPoint.y === endPoint.y)
|
||||||
@ -1166,7 +1167,7 @@ export const splitPolygonWithLines = (polygon) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const isSamePoint = (a, b) => {
|
const isSamePoint = (a, b) => {
|
||||||
return a.x === b.x && a.y === b.y
|
return Math.abs(Math.round(a.x) - Math.round(b.x)) <= 1 && Math.abs(Math.round(a.y) - Math.round(b.y)) <= 1
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user