Merge branch 'qcast-pub' into dev
# Conflicts: # src/components/floor-plan/modal/setting01/GridOption.jsx
This commit is contained in:
commit
12377b3db7
@ -2,6 +2,7 @@ import WithDraggable from '@/components/common/draggable/withDraggable'
|
|||||||
import QSelectBox from '@/components/common/select/QSelectBox'
|
import QSelectBox from '@/components/common/select/QSelectBox'
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { useState } from 'react'
|
import { useState } from 'react'
|
||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
|
||||||
const fonts = [
|
const fonts = [
|
||||||
{ name: 'MS PGothic', value: 'MS PGothic' },
|
{ name: 'MS PGothic', value: 'MS PGothic' },
|
||||||
@ -42,7 +43,8 @@ const fontColors = [
|
|||||||
{ name: '남색', value: 'darkblue' },
|
{ name: '남색', value: 'darkblue' },
|
||||||
]
|
]
|
||||||
export default function FontSetting(props) {
|
export default function FontSetting(props) {
|
||||||
const { id, setIsShow, font, setFont, fontSize, setFontSize } = props
|
const { id, setIsShow, font, setFont, fontSize, setFontSize, pos = { x: 455, y: 180 } } = props
|
||||||
|
const { getMessage } = useMessage()
|
||||||
const { closePopup } = usePopup()
|
const { closePopup } = usePopup()
|
||||||
const [originFont, setOriginFont] = useState(font)
|
const [originFont, setOriginFont] = useState(font)
|
||||||
const [originFontSize, setOriginFontSize] = useState(fontSize)
|
const [originFontSize, setOriginFontSize] = useState(fontSize)
|
||||||
@ -50,10 +52,10 @@ export default function FontSetting(props) {
|
|||||||
const [selectedFontSize, setSelectedFontSize] = useState(fontSize ? fontSize : fontSizes[0])
|
const [selectedFontSize, setSelectedFontSize] = useState(fontSize ? fontSize : fontSizes[0])
|
||||||
const [selectedFontColor, setSelectedFontColor] = useState(null)
|
const [selectedFontColor, setSelectedFontColor] = useState(null)
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={{ x: 455, y: 180 }}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap lrr`}>
|
<div className={`modal-pop-wrap lrr mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">フォント </h1>
|
<h1 className="title">{getMessage('modal.font')} </h1>
|
||||||
<button
|
<button
|
||||||
className="modal-close"
|
className="modal-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
@ -68,32 +70,32 @@ export default function FontSetting(props) {
|
|||||||
<div className="slope-wrap">
|
<div className="slope-wrap">
|
||||||
<div className="font-option-warp">
|
<div className="font-option-warp">
|
||||||
<div className="font-option-item">
|
<div className="font-option-item">
|
||||||
<div className="option-item-tit">文字(F)</div>
|
<div className="option-item-tit">{getMessage('modal.font')}(F)</div>
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<QSelectBox options={fonts} value={selectedFont} onChange={(e) => setSelectedFont(e)} />
|
<QSelectBox options={fonts} value={selectedFont} onChange={(e) => setSelectedFont(e)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="font-option-item">
|
<div className="font-option-item">
|
||||||
<div className="option-item-tit">フォントスタイル(Y)</div>
|
<div className="option-item-tit">{getMessage('modal.font.style')}(Y)</div>
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<QSelectBox options={fontOptions} onChange={(e) => setSelectedFont(e)} />
|
<QSelectBox options={fontOptions} onChange={(e) => setSelectedFont(e)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="font-option-item">
|
<div className="font-option-item">
|
||||||
<div className="option-item-tit">サイズ(S)</div>
|
<div className="option-item-tit">{getMessage('modal.font.size')}(S)</div>
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<QSelectBox options={fontSizes} value={selectedFontSize} onChange={(e) => setSelectedFontSize(e)} />
|
<QSelectBox options={fontSizes} value={selectedFontSize} onChange={(e) => setSelectedFontSize(e)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="font-option-item">
|
<div className="font-option-item">
|
||||||
<div className="option-item-tit">フォン</div>
|
<div className="option-item-tit">{getMessage('modal.font.color')}</div>
|
||||||
<div className="grid-select">
|
<div className="grid-select">
|
||||||
<QSelectBox title={''} options={fontColors} value={selectedFontColor} onChange={(e) => setSelectedFontColor(e)} />
|
<QSelectBox title={''} options={fontColors} value={selectedFontColor} onChange={(e) => setSelectedFontColor(e)} />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="font-ex-wrap">
|
<div className="font-ex-wrap">
|
||||||
<div className="font-ex-tit">見る</div>
|
<div className="font-ex-tit">{getMessage('modal.font.setting.display')}</div>
|
||||||
<div className="font-ex-box">
|
<div className="font-ex-box">
|
||||||
<span
|
<span
|
||||||
style={{
|
style={{
|
||||||
@ -107,7 +109,7 @@ export default function FontSetting(props) {
|
|||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="normal-font">ントです。プリンタと画面 でも同じフォントを使用します.</div>
|
<div className="normal-font">{getMessage('modal.font.setting.info')}</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="grid-btn-wrap">
|
<div className="grid-btn-wrap">
|
||||||
<button
|
<button
|
||||||
@ -119,7 +121,7 @@ export default function FontSetting(props) {
|
|||||||
closePopup(id)
|
closePopup(id)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
ストレージ
|
{getMessage('modal.common.save')}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -21,7 +21,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, setShowDotLineGridModal } = props
|
const { id, setIsShow, pos = { x: 840, y: -815 } } = props
|
||||||
const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState)
|
const setSettingModalGridOptions = useSetRecoilState(settingModalGridOptionsState)
|
||||||
const gridColor = useRecoilValue(gridColorState)
|
const gridColor = useRecoilValue(gridColorState)
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
@ -315,14 +315,14 @@ export default function DotLineGrid(props) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<WithDraggable isShow={true} pos={{ x: 840, y: -815 }}>
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
<div className={`modal-pop-wrap ssm mount`}>
|
<div className={`modal-pop-wrap ssm mount`}>
|
||||||
<div className="modal-head">
|
<div className="modal-head">
|
||||||
<h1 className="title">{getMessage('modal.canvas.setting.grid.dot.line.setting')}</h1>
|
<h1 className="title">{getMessage('modal.canvas.setting.grid.dot.line.setting')}</h1>
|
||||||
<button
|
<button
|
||||||
className="modal-close"
|
className="modal-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setShowDotLineGridModal(false)
|
setIsShow(false)
|
||||||
closePopup(id)
|
closePopup(id)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
|
|||||||
@ -22,21 +22,32 @@ export default function GridOption() {
|
|||||||
const [showColorPickerModal, setShowColorPickerModal] = useState(false)
|
const [showColorPickerModal, setShowColorPickerModal] = useState(false)
|
||||||
const [showDotLineGridModal, setShowDotLineGridModal] = useState(false)
|
const [showDotLineGridModal, setShowDotLineGridModal] = useState(false)
|
||||||
const { addPopup, closePopup } = usePopup()
|
const { addPopup, closePopup } = usePopup()
|
||||||
let [colorId, dotLineId] = ''
|
// const [colorId, setColorId] = useState(uuidv4())
|
||||||
|
// const [dotLineId, setDotLineId] = useState(uuidv4())
|
||||||
|
|
||||||
|
let colorId = null
|
||||||
|
let dotLineId = null
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
colorId = uuidv4()
|
||||||
|
dotLineId = uuidv4()
|
||||||
|
}, [])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setGridColor(color.hex)
|
setGridColor(color.hex)
|
||||||
}, [color])
|
}, [color])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
console.log(showColorPickerModal)
|
|
||||||
gridOptions[3].selected = showColorPickerModal
|
gridOptions[3].selected = showColorPickerModal
|
||||||
setGridOptions([...gridOptions])
|
setGridOptions([...gridOptions])
|
||||||
}, [showColorPickerModal])
|
}, [showColorPickerModal])
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
colorId = uuidv4()
|
gridOptions[2].selected = showDotLineGridModal
|
||||||
dotLineId = uuidv4()
|
setGridOptions([...gridOptions])
|
||||||
|
}, [showDotLineGridModal])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
return () => {
|
return () => {
|
||||||
setSettingModalGridOptions((prev) => {
|
setSettingModalGridOptions((prev) => {
|
||||||
const newSettingOptions = [...prev]
|
const newSettingOptions = [...prev]
|
||||||
@ -67,6 +78,19 @@ export default function GridOption() {
|
|||||||
item.selected = false
|
item.selected = false
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
console.log(colorId, dotLineId)
|
||||||
|
newGridOptions.map((item) => {
|
||||||
|
if (item.id === option.id) {
|
||||||
|
item.selected = !item.selected
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
if (option.id === 1) {
|
||||||
|
// 점 그리드
|
||||||
|
setAdsorptionPointAddMode(false)
|
||||||
|
setTempGridMode(option.selected)
|
||||||
|
newGridOptions[2].selected = false
|
||||||
|
}
|
||||||
|
|
||||||
const selectedOption = newGridOptions.find((item) => item.id === option.id)
|
const selectedOption = newGridOptions.find((item) => item.id === option.id)
|
||||||
if (selectedOption.id === 1) {
|
if (selectedOption.id === 1) {
|
||||||
@ -83,16 +107,54 @@ export default function GridOption() {
|
|||||||
// 그리드 색 설정 모달
|
// 그리드 색 설정 모달
|
||||||
setShowColorPickerModal(selectedOption.selected)
|
setShowColorPickerModal(selectedOption.selected)
|
||||||
addPopup(colorId, 2, <ColorPickerModal {...colorPickerProps} id={colorId} />)
|
addPopup(colorId, 2, <ColorPickerModal {...colorPickerProps} id={colorId} />)
|
||||||
|
if (option.id === 2) {
|
||||||
|
// 점.선 그리드
|
||||||
|
if (option.selected) {
|
||||||
|
addPopup(dotLineId, 2, <DotLineGrid {...dotListGridProps} />)
|
||||||
|
} else {
|
||||||
|
closePopup(dotLineId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.name === 'modal.canvas.setting.grid.absorption.add') {
|
||||||
|
setAdsorptionPointAddMode(!adsorptionPointAddMode)
|
||||||
|
setTempGridMode(false)
|
||||||
|
newGridOptions[0].selected = false
|
||||||
|
}
|
||||||
|
|
||||||
|
if (option.id === 4) {
|
||||||
|
// 그리드 색 설정
|
||||||
|
if (option.selected) {
|
||||||
|
setShowColorPickerModal(true)
|
||||||
|
addPopup(colorId, 2, <ColorPickerModal {...colorPickerProps} />)
|
||||||
|
} else {
|
||||||
|
setShowColorPickerModal(false)
|
||||||
|
closePopup(colorId)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setGridOptions(newGridOptions)
|
setGridOptions(newGridOptions)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const dotListGridProps = {
|
||||||
|
id: dotLineId,
|
||||||
|
setIsShow: setShowDotLineGridModal,
|
||||||
|
pos: {
|
||||||
|
x: 845,
|
||||||
|
y: 180,
|
||||||
|
},
|
||||||
|
}
|
||||||
|
|
||||||
const colorPickerProps = {
|
const colorPickerProps = {
|
||||||
|
id: colorId,
|
||||||
color: gridColor,
|
color: gridColor,
|
||||||
setColor: setGridColor,
|
setColor: setGridColor,
|
||||||
isShow: showColorPickerModal,
|
isShow: showColorPickerModal,
|
||||||
setIsShow: setShowColorPickerModal,
|
setIsShow: setShowColorPickerModal,
|
||||||
|
pos: {
|
||||||
|
x: 785,
|
||||||
|
y: 180,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -9,6 +9,7 @@ import DimensionLineSetting from '@/components/floor-plan/modal/setting01/dimens
|
|||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import FontSetting from '@/components/common/font/FontSetting'
|
import FontSetting from '@/components/common/font/FontSetting'
|
||||||
|
import PlanSizeSetting from '@/components/floor-plan/modal/setting01/planSize/PlanSizeSetting'
|
||||||
|
|
||||||
export default function SecondOption() {
|
export default function SecondOption() {
|
||||||
const [objectNo, setObjectNo] = useState('test123240912001') // 이후 삭제 필요
|
const [objectNo, setObjectNo] = useState('test123240912001') // 이후 삭제 필요
|
||||||
@ -22,9 +23,10 @@ export default function SecondOption() {
|
|||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
const { get, post } = useAxios()
|
const { get, post } = useAxios()
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
const { addPopup } = usePopup()
|
const { addPopup, closePopup, closePopups } = usePopup()
|
||||||
const [showFontSettingModal, setShowFontSettingModal] = useState(false)
|
const [showFontSettingModal, setShowFontSettingModal] = useState(false)
|
||||||
const [showDimensionLineSettingModal, setShowDimensionLineSettingModal] = useState(false)
|
const [showDimensionLineSettingModal, setShowDimensionLineSettingModal] = useState(false)
|
||||||
|
const [showPlanSizeSettingModal, setShowPlanSizeSettingModal] = useState(false)
|
||||||
|
|
||||||
// 데이터를 최초 한 번만 조회
|
// 데이터를 최초 한 번만 조회
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
@ -134,14 +136,21 @@ export default function SecondOption() {
|
|||||||
}
|
}
|
||||||
setAdsorptionRange(option.range)
|
setAdsorptionRange(option.range)
|
||||||
}
|
}
|
||||||
const dimensionId = uuidv4()
|
let dimensionId = null
|
||||||
const fontId = uuidv4()
|
let fontId = null
|
||||||
|
let planSizeId = null
|
||||||
const [pixel, setPixel] = useState(1)
|
const [pixel, setPixel] = useState(1)
|
||||||
const [color, setColor] = useState('#FF0000')
|
const [color, setColor] = useState('#FF0000')
|
||||||
const [font, setFont] = useState(null)
|
const [font, setFont] = useState(null)
|
||||||
const [fontSize, setFontSize] = useState('#FF0000')
|
const [fontSize, setFontSize] = useState('#FF0000')
|
||||||
const [fontColor, setFontColor] = useState('#FF0000')
|
const [fontColor, setFontColor] = useState('#FF0000')
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
dimensionId = uuidv4()
|
||||||
|
fontId = uuidv4()
|
||||||
|
planSizeId = uuidv4()
|
||||||
|
}, [])
|
||||||
|
|
||||||
const dimensionProps = {
|
const dimensionProps = {
|
||||||
color,
|
color,
|
||||||
setColor,
|
setColor,
|
||||||
@ -158,19 +167,42 @@ export default function SecondOption() {
|
|||||||
setIsShow: setShowDimensionLineSettingModal,
|
setIsShow: setShowDimensionLineSettingModal,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const [horizon, setHorizon] = useState(1600)
|
||||||
|
const [vertical, setVertical] = useState(1600)
|
||||||
|
const planSizeProps = {
|
||||||
|
id: planSizeId,
|
||||||
|
horizon,
|
||||||
|
setHorizon,
|
||||||
|
vertical,
|
||||||
|
setVertical,
|
||||||
|
setIsShow: setShowPlanSizeSettingModal,
|
||||||
|
pos: { x: 1020, y: 180 },
|
||||||
|
}
|
||||||
|
|
||||||
const handlePopup = (type) => {
|
const handlePopup = (type) => {
|
||||||
const id = uuidv4()
|
const id = uuidv4()
|
||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'dimensionLine':
|
case 'dimensionLine':
|
||||||
setShowDimensionLineSettingModal(true)
|
if (!showDimensionLineSettingModal) {
|
||||||
addPopup(dimensionId, 2, <DimensionLineSetting {...dimensionProps} />)
|
setShowDimensionLineSettingModal(true)
|
||||||
|
addPopup(dimensionId, 2, <DimensionLineSetting {...dimensionProps} />)
|
||||||
|
} else {
|
||||||
|
setShowDimensionLineSettingModal(false)
|
||||||
|
closePopups([dimensionId, fontId])
|
||||||
|
}
|
||||||
|
|
||||||
break
|
break
|
||||||
case 'font1': //문자 글꼴변경
|
case 'font1': //문자 글꼴변경
|
||||||
case 'font2': //흐름 방향 글꼴 변경
|
case 'font2': //흐름 방향 글꼴 변경
|
||||||
case 'font3': //치수 글꼴변경
|
case 'font3': //치수 글꼴변경
|
||||||
case 'font4': //회로번호 글꼴변경
|
case 'font4': //회로번호 글꼴변경
|
||||||
addPopup(fontId, 2, <FontSetting id={id} setShowFontSettingModal={setShowFontSettingModal} />)
|
addPopup(fontId, 2, <FontSetting id={fontId} setShowFontSettingModal={setShowFontSettingModal} />)
|
||||||
|
break
|
||||||
|
case 'planSize':
|
||||||
|
setShowPlanSizeSettingModal(true)
|
||||||
|
addPopup(planSizeId, 2, <PlanSizeSetting {...planSizeProps} />)
|
||||||
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -203,7 +235,7 @@ export default function SecondOption() {
|
|||||||
<button className={`arr-btn ${showDimensionLineSettingModal ? 'act' : ''}`} onClick={() => handlePopup('dimensionLine')}>
|
<button className={`arr-btn ${showDimensionLineSettingModal ? 'act' : ''}`} onClick={() => handlePopup('dimensionLine')}>
|
||||||
<span>{getMessage('modal.canvas.setting.font.plan.absorption.dimension.line')}</span>
|
<span>{getMessage('modal.canvas.setting.font.plan.absorption.dimension.line')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button className="arr-btn">
|
<button className={`arr-btn ${showPlanSizeSettingModal ? 'act' : ''}`} onClick={() => handlePopup('planSize')}>
|
||||||
<span>{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}</span>
|
<span>{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}</span>
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
|
|||||||
@ -24,11 +24,12 @@ export default function DimensionLineSetting(props) {
|
|||||||
setFontSize,
|
setFontSize,
|
||||||
pixel,
|
pixel,
|
||||||
setPixel,
|
setPixel,
|
||||||
|
isShow,
|
||||||
setIsShow,
|
setIsShow,
|
||||||
id,
|
id,
|
||||||
pos = { x: 985, y: 180 },
|
pos = { x: 985, y: 180 },
|
||||||
} = props
|
} = props
|
||||||
const { addPopup, closePopup } = usePopup()
|
const { addPopup, closePopup, closePopups } = usePopup()
|
||||||
const pixels = Array.from({ length: 5 }).map((_, index) => {
|
const pixels = Array.from({ length: 5 }).map((_, index) => {
|
||||||
return { name: index + 1, value: index + 1 }
|
return { name: index + 1, value: index + 1 }
|
||||||
})
|
})
|
||||||
@ -37,11 +38,17 @@ export default function DimensionLineSetting(props) {
|
|||||||
const [originFontColor, setOriginFontColor] = useState(fontColor)
|
const [originFontColor, setOriginFontColor] = useState(fontColor)
|
||||||
const [originFontSize, setOriginFontSize] = useState(fontSize)
|
const [originFontSize, setOriginFontSize] = useState(fontSize)
|
||||||
const [originPixel, setOriginPixel] = useState(pixel)
|
const [originPixel, setOriginPixel] = useState(pixel)
|
||||||
const fontModalId = uuidv4()
|
const [fontModalId, setFontModalId] = useState(uuidv4())
|
||||||
const colorModalId = uuidv4()
|
const [colorModalId, setColorModalId] = useState(uuidv4())
|
||||||
|
|
||||||
const [showColorPickerModal, setShowColorPickerModal] = useState(false)
|
const [showColorPickerModal, setShowColorPickerModal] = useState(false)
|
||||||
const [showFontModal, setShowFontModal] = useState(false)
|
const [showFontModal, setShowFontModal] = useState(false)
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
|
useEffect(() => {
|
||||||
|
if (!isShow) {
|
||||||
|
closePopups([fontModalId, colorModalId])
|
||||||
|
}
|
||||||
|
}, [isShow])
|
||||||
const colorPickerProps = {
|
const colorPickerProps = {
|
||||||
isShow: showColorPickerModal,
|
isShow: showColorPickerModal,
|
||||||
setIsShow: setShowColorPickerModal,
|
setIsShow: setShowColorPickerModal,
|
||||||
@ -49,8 +56,8 @@ export default function DimensionLineSetting(props) {
|
|||||||
setColor: setOriginColor,
|
setColor: setOriginColor,
|
||||||
id: colorModalId,
|
id: colorModalId,
|
||||||
pos: {
|
pos: {
|
||||||
x: 480,
|
x: 495,
|
||||||
y: -815,
|
y: 180,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,8 +74,8 @@ export default function DimensionLineSetting(props) {
|
|||||||
setFontSize: setOriginFontSize,
|
setFontSize: setOriginFontSize,
|
||||||
id: fontModalId,
|
id: fontModalId,
|
||||||
pos: {
|
pos: {
|
||||||
x: 480,
|
x: 455,
|
||||||
y: -815,
|
y: 180,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
const popupHandle = (type) => {
|
const popupHandle = (type) => {
|
||||||
@ -99,8 +106,10 @@ export default function DimensionLineSetting(props) {
|
|||||||
<button
|
<button
|
||||||
className="modal-close"
|
className="modal-close"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setIsShow(false)
|
console.log('fontModalId', fontModalId)
|
||||||
closePopup(id)
|
console.log('colorModalId', colorModalId)
|
||||||
|
closePopups([fontModalId, colorModalId, id])
|
||||||
|
// setIsShow(false)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
닫기
|
닫기
|
||||||
@ -161,7 +170,7 @@ export default function DimensionLineSetting(props) {
|
|||||||
setColor(originColor)
|
setColor(originColor)
|
||||||
setFont(originFont)
|
setFont(originFont)
|
||||||
setIsShow(false)
|
setIsShow(false)
|
||||||
closePopup(id)
|
closePopups([fontModalId, colorModalId, id])
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{getMessage('modal.common.save')}
|
{getMessage('modal.common.save')}
|
||||||
|
|||||||
@ -0,0 +1,67 @@
|
|||||||
|
import WithDraggable from '@/components/common/draggable/withDraggable'
|
||||||
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
import { useMessage } from '@/hooks/useMessage'
|
||||||
|
import { useState } from 'react'
|
||||||
|
|
||||||
|
export default function PlanSizeSetting(props) {
|
||||||
|
const { horizon, setHorizon, vertical, setVertical, id, pos = { x: 985, y: 180 }, setIsShow } = props
|
||||||
|
const { closePopup } = usePopup()
|
||||||
|
const { getMessage } = useMessage()
|
||||||
|
const [originHorizon, setOriginHorizon] = useState(horizon)
|
||||||
|
const [originVertical, setOriginVertical] = useState(vertical)
|
||||||
|
|
||||||
|
return (
|
||||||
|
<WithDraggable isShow={true} pos={pos}>
|
||||||
|
<div className={`modal-pop-wrap xsm`}>
|
||||||
|
<div className="modal-head">
|
||||||
|
<h1 className="title">{getMessage('modal.canvas.setting.font.plan.absorption.plan.size.setting')}</h1>
|
||||||
|
<button
|
||||||
|
className="modal-close"
|
||||||
|
onClick={() => {
|
||||||
|
setIsShow(false)
|
||||||
|
closePopup(id)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
닫기
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="modal-body">
|
||||||
|
<div className="slope-wrap">
|
||||||
|
<div className="outline-form mb10">
|
||||||
|
<span style={{ width: 'auto' }}>{getMessage('common.horizon')}</span>
|
||||||
|
<div className="input-grid mr5" style={{ width: '90px' }}>
|
||||||
|
<input type="text" className="input-origin block" value={originHorizon} onChange={(e) => setOriginHorizon(Number(e.target.value))} />
|
||||||
|
</div>
|
||||||
|
<span className="thin">mm</span>
|
||||||
|
</div>
|
||||||
|
<div className="outline-form">
|
||||||
|
<span style={{ width: 'auto' }}>{getMessage('common.vertical')}</span>
|
||||||
|
<div className="input-grid mr5" style={{ width: '90px' }}>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
className="input-origin block"
|
||||||
|
value={originVertical}
|
||||||
|
onChange={(e) => setOriginVertical(Number(e.target.value))}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<span className="thin">mm</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="grid-btn-wrap">
|
||||||
|
<button
|
||||||
|
className="btn-frame modal act"
|
||||||
|
onClick={() => {
|
||||||
|
setHorizon(originHorizon)
|
||||||
|
setVertical(originVertical)
|
||||||
|
setIsShow(false)
|
||||||
|
closePopup(id)
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
{getMessage('modal.common.save')}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</WithDraggable>
|
||||||
|
)
|
||||||
|
}
|
||||||
@ -14,9 +14,14 @@ export function usePopup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closePopup = (id) => {
|
const closePopup = (id) => {
|
||||||
|
console.log(id)
|
||||||
setPopup({ children: [...popup.children.filter((child) => child.id !== id)] })
|
setPopup({ children: [...popup.children.filter((child) => child.id !== id)] })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const closePopups = (ids) => {
|
||||||
|
setPopup({ children: [...popup.children.filter((child) => !ids.includes(child.id))] })
|
||||||
|
}
|
||||||
|
|
||||||
const closeAll = () => {
|
const closeAll = () => {
|
||||||
setPopup({ children: [] })
|
setPopup({ children: [] })
|
||||||
}
|
}
|
||||||
@ -34,6 +39,7 @@ export function usePopup() {
|
|||||||
setPopup,
|
setPopup,
|
||||||
addPopup,
|
addPopup,
|
||||||
closePopup,
|
closePopup,
|
||||||
|
closePopups,
|
||||||
closeAll,
|
closeAll,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,6 +157,14 @@
|
|||||||
"plan.mode.vertical.horizontal": "垂直水平モード",
|
"plan.mode.vertical.horizontal": "垂直水平モード",
|
||||||
"plan.mode.free": "프리 모드(JA)",
|
"plan.mode.free": "프리 모드(JA)",
|
||||||
"modal.font.setting": "フォント設定",
|
"modal.font.setting": "フォント設定",
|
||||||
|
"modal.font": "フォント",
|
||||||
|
"modal.font.style": "フォントスタイル",
|
||||||
|
"modal.font.size": "サイズ",
|
||||||
|
"modal.font.color": "フォン",
|
||||||
|
"common.horizon": "ガロ",
|
||||||
|
"common.vertical": "縦ロ",
|
||||||
|
"modal.font.setting.display": "見る",
|
||||||
|
"modal.font.setting.info": "ントです。プリンタと画面 でも同じフォントを使用します.",
|
||||||
"modal.canvas.setting": "Canvas設定",
|
"modal.canvas.setting": "Canvas設定",
|
||||||
"modal.canvas.setting.display": "ディスプレイ設定",
|
"modal.canvas.setting.display": "ディスプレイ設定",
|
||||||
"modal.canvas.setting.font.plan": " フォントと図面サイズの設定",
|
"modal.canvas.setting.font.plan": " フォントと図面サイズの設定",
|
||||||
|
|||||||
@ -161,6 +161,14 @@
|
|||||||
"plan.mode.vertical.horizontal": "수직 수평 모드",
|
"plan.mode.vertical.horizontal": "수직 수평 모드",
|
||||||
"plan.mode.free": "프리 모드",
|
"plan.mode.free": "프리 모드",
|
||||||
"modal.font.setting": "글꼴 설정",
|
"modal.font.setting": "글꼴 설정",
|
||||||
|
"modal.font": "글꼴",
|
||||||
|
"modal.font.style": "글꼴 스타일",
|
||||||
|
"modal.font.size": "크기",
|
||||||
|
"modal.font.color": "글꼴 색",
|
||||||
|
"common.horizon": "가로",
|
||||||
|
"common.vertical": "세로",
|
||||||
|
"modal.font.setting.display": "보기",
|
||||||
|
"modal.font.setting.info": "이것은 Open Type 글꼴입니다. 프린터 및 화면에서도 같은 글꼴을 사용합니다.",
|
||||||
"modal.canvas.setting": "Canvas 설정",
|
"modal.canvas.setting": "Canvas 설정",
|
||||||
"modal.canvas.setting.display": "디스플레이 설정",
|
"modal.canvas.setting.display": "디스플레이 설정",
|
||||||
"modal.canvas.setting.font.plan": "글꼴 및 도면 크기 설정",
|
"modal.canvas.setting.font.plan": "글꼴 및 도면 크기 설정",
|
||||||
|
|||||||
@ -424,8 +424,11 @@
|
|||||||
// &::-webkit-scrollbar-track {
|
// &::-webkit-scrollbar-track {
|
||||||
// background-color: #fff;
|
// background-color: #fff;
|
||||||
// }
|
// }
|
||||||
canvas{
|
.canvas-container{
|
||||||
|
margin: 0 auto;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
}
|
||||||
|
canvas{
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
|||||||
@ -1629,7 +1629,7 @@ $alert-color: #101010;
|
|||||||
min-height: 80px;
|
min-height: 80px;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 치수선 설정
|
// 치수선 설정
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user