modal 버그 수정
This commit is contained in:
parent
40fa42b19b
commit
45c9abd86a
@ -8,7 +8,7 @@ import { contextPopupPositionState } from '@/store/popupAtom'
|
|||||||
|
|
||||||
export default function ColorPickerModal(props) {
|
export default function ColorPickerModal(props) {
|
||||||
const contextPopupPosition = useRecoilValue(contextPopupPositionState) // 현재 메뉴
|
const contextPopupPosition = useRecoilValue(contextPopupPositionState) // 현재 메뉴
|
||||||
const { isShow, setIsShow, pos = contextPopupPosition, color = '#ff0000', setColor, id } = props
|
const { isShow, setIsShow, pos = contextPopupPosition, color = '#ff0000', setColor, id, isConfig = false } = props
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const [originColor, setOriginColor] = useState(color)
|
const [originColor, setOriginColor] = useState(color)
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
@ -29,7 +29,7 @@ export default function ColorPickerModal(props) {
|
|||||||
setIsShow(false)
|
setIsShow(false)
|
||||||
}
|
}
|
||||||
console.log(id)
|
console.log(id)
|
||||||
closePopup(id)
|
closePopup(id, isConfig)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
닫기
|
닫기
|
||||||
@ -49,7 +49,7 @@ export default function ColorPickerModal(props) {
|
|||||||
if (setColor) setColor(originColor)
|
if (setColor) setColor(originColor)
|
||||||
if (setIsShow) setIsShow(false)
|
if (setIsShow) setIsShow(false)
|
||||||
|
|
||||||
closePopup(id)
|
closePopup(id, isConfig)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{getMessage('common.message.save')}
|
{getMessage('common.message.save')}
|
||||||
|
|||||||
@ -5,9 +5,7 @@ import { useMessage } from '@/hooks/useMessage'
|
|||||||
import { canvasState, dotLineGridSettingState, dotLineIntervalSelector } from '@/store/canvasAtom'
|
import { canvasState, dotLineGridSettingState, dotLineIntervalSelector } from '@/store/canvasAtom'
|
||||||
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
import { useRecoilState, useRecoilValue, useResetRecoilState, useSetRecoilState } from 'recoil'
|
||||||
import { onlyNumberInputChange } from '@/util/input-utils'
|
import { onlyNumberInputChange } from '@/util/input-utils'
|
||||||
import { fabric } from 'fabric'
|
import { settingModalGridOptionsState } from '@/store/settingAtom'
|
||||||
import { gridColorState } from '@/store/gridAtom'
|
|
||||||
import { gridDisplaySelector, settingModalGridOptionsState } from '@/store/settingAtom'
|
|
||||||
import { useAxios } from '@/hooks/useAxios'
|
import { useAxios } from '@/hooks/useAxios'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
@ -33,7 +31,7 @@ export default function DotLineGrid(props) {
|
|||||||
// const [modalOption, setModalOption] = useRecoilState(modalState); //modal 열림닫힘 state
|
// const [modalOption, setModalOption] = useRecoilState(modalState); //modal 열림닫힘 state
|
||||||
const [objectNo, setObjectNo] = useState('test123240912001') // 이후 삭제 필요
|
const [objectNo, setObjectNo] = useState('test123240912001') // 이후 삭제 필요
|
||||||
const [close, setClose] = useState(false)
|
const [close, setClose] = useState(false)
|
||||||
const { id, setIsShow, pos = { x: 840, y: -815 } } = props
|
const { id, setIsShow, pos = { x: 840, y: -815 }, isConfig = false } = props
|
||||||
const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState)
|
const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState)
|
||||||
|
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -142,7 +140,7 @@ export default function DotLineGrid(props) {
|
|||||||
await post({ url: `/api/canvas-management/canvas-grid-settings`, data: patternData }).then((res) => {
|
await post({ url: `/api/canvas-management/canvas-grid-settings`, data: patternData }).then((res) => {
|
||||||
swalFire({ text: getMessage(res.returnMessage) })
|
swalFire({ text: getMessage(res.returnMessage) })
|
||||||
setDotLineGridSettingState({ ...currentSetting })
|
setDotLineGridSettingState({ ...currentSetting })
|
||||||
closePopup(id)
|
closePopup(id, isConfig)
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
swalFire({ text: getMessage(res.returnMessage), icon: 'error' })
|
swalFire({ text: getMessage(res.returnMessage), icon: 'error' })
|
||||||
@ -213,7 +211,7 @@ export default function DotLineGrid(props) {
|
|||||||
className="modal-close"
|
className="modal-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsShow(false)
|
setIsShow(false)
|
||||||
closePopup(id)
|
closePopup(id, isConfig)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
닫기
|
닫기
|
||||||
|
|||||||
@ -94,6 +94,7 @@ export default function GridOption() {
|
|||||||
const dotLineGridProps = {
|
const dotLineGridProps = {
|
||||||
id: dotLineId,
|
id: dotLineId,
|
||||||
setIsShow: setShowDotLineGridModal,
|
setIsShow: setShowDotLineGridModal,
|
||||||
|
isConfig: true,
|
||||||
pos: {
|
pos: {
|
||||||
x: 845,
|
x: 845,
|
||||||
y: 180,
|
y: 180,
|
||||||
@ -106,6 +107,7 @@ export default function GridOption() {
|
|||||||
setColor: setGridColor,
|
setColor: setGridColor,
|
||||||
isShow: showColorPickerModal,
|
isShow: showColorPickerModal,
|
||||||
setIsShow: setShowColorPickerModal,
|
setIsShow: setShowColorPickerModal,
|
||||||
|
isConfig: true,
|
||||||
pos: {
|
pos: {
|
||||||
x: 785,
|
x: 785,
|
||||||
y: 180,
|
y: 180,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user