Merge branch 'dev' of https://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
dbb5a56126
@ -14,7 +14,7 @@ import { Button } from '@nextui-org/react'
|
|||||||
import SingleDatePicker from './common/datepicker/SingleDatePicker'
|
import SingleDatePicker from './common/datepicker/SingleDatePicker'
|
||||||
import RangeDatePicker from './common/datepicker/RangeDatePicker'
|
import RangeDatePicker from './common/datepicker/RangeDatePicker'
|
||||||
import QGrid from './common/grid/QGrid'
|
import QGrid from './common/grid/QGrid'
|
||||||
import { QToast } from '@/hooks/useToast'
|
import { toastUp } from '@/hooks/useToast'
|
||||||
|
|
||||||
export default function Intro() {
|
export default function Intro() {
|
||||||
const { get } = useAxios()
|
const { get } = useAxios()
|
||||||
@ -127,7 +127,7 @@ export default function Intro() {
|
|||||||
<Button
|
<Button
|
||||||
color="primary"
|
color="primary"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
QToast({
|
toastUp({
|
||||||
message: 'This is a toast message',
|
message: 'This is a toast message',
|
||||||
type: 'success',
|
type: 'success',
|
||||||
})
|
})
|
||||||
|
|||||||
@ -14,6 +14,7 @@ import QSelect from '@/components/ui/QSelect'
|
|||||||
import styles from './playground.module.css'
|
import styles from './playground.module.css'
|
||||||
import { useRecoilState } from 'recoil'
|
import { useRecoilState } from 'recoil'
|
||||||
import { cadFileNameState, useCadFileState } from '@/store/canvasAtom'
|
import { cadFileNameState, useCadFileState } from '@/store/canvasAtom'
|
||||||
|
import { toastUp } from '@/hooks/useToast'
|
||||||
|
|
||||||
export default function Playground() {
|
export default function Playground() {
|
||||||
const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState)
|
const [useCadFile, setUseCadFile] = useRecoilState(useCadFileState)
|
||||||
@ -47,9 +48,11 @@ export default function Playground() {
|
|||||||
convertDwgToPng(res.data.Files[0].FileName, res.data.Files[0].FileData)
|
convertDwgToPng(res.data.Files[0].FileName, res.data.Files[0].FileData)
|
||||||
setUseCadFile(true)
|
setUseCadFile(true)
|
||||||
setCadFileName(res.data.Files[0].FileName)
|
setCadFileName(res.data.Files[0].FileName)
|
||||||
|
toastUp({ message: '파일 변환 완료', type: 'success' })
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
console.error(err)
|
console.error(err)
|
||||||
|
toastUp({ message: '파일 변환 실패', type: 'error' })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -789,9 +789,11 @@ export default function Roof2(props) {
|
|||||||
<Button
|
<Button
|
||||||
className="m-1 p-2"
|
className="m-1 p-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setUseCadFile(false)
|
if (useCadFile) {
|
||||||
setCadFileName('')
|
setUseCadFile(false)
|
||||||
handleCadImageInit()
|
setCadFileName('')
|
||||||
|
handleCadImageInit()
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
cad 파일 초기화
|
cad 파일 초기화
|
||||||
@ -799,15 +801,17 @@ export default function Roof2(props) {
|
|||||||
<Button
|
<Button
|
||||||
className="m-1 p-2"
|
className="m-1 p-2"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
backImg
|
if (useCadFile) {
|
||||||
.set({
|
backImg
|
||||||
selectable: false,
|
.set({
|
||||||
})
|
selectable: false,
|
||||||
.sendToBack()
|
})
|
||||||
canvas.clear()
|
.sendToBack()
|
||||||
canvas.add(backImg)
|
canvas.clear()
|
||||||
canvas.renderAll()
|
canvas.add(backImg)
|
||||||
setCadFileComplete(true)
|
canvas.renderAll()
|
||||||
|
setCadFileComplete(true)
|
||||||
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
cad 파일 조정 완료
|
cad 파일 조정 완료
|
||||||
|
|||||||
@ -13,7 +13,7 @@ const toastDefaultOptions = {
|
|||||||
closeOnClick: true,
|
closeOnClick: true,
|
||||||
}
|
}
|
||||||
|
|
||||||
const QToast = (props) => {
|
const toastUp = (props) => {
|
||||||
// type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default'
|
// type TypeOptions = 'info' | 'success' | 'warning' | 'error' | 'default'
|
||||||
const { message, type = 'info', options } = props
|
const { message, type = 'info', options } = props
|
||||||
const customOptions = { ...toastDefaultOptions, ...options }
|
const customOptions = { ...toastDefaultOptions, ...options }
|
||||||
@ -32,4 +32,4 @@ const QToast = (props) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export { QToast }
|
export { toastUp }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user