From 3a4821374a917f997ee0411e6459fc04419f9f94 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Tue, 7 Jan 2025 15:31:20 +0900 Subject: [PATCH] =?UTF-8?q?=ED=99=8D=EA=B8=B0=EB=8B=98=20=EC=9A=94?= =?UTF-8?q?=EC=B2=AD=EC=82=AC=ED=95=AD=20=EC=88=98=EC=A0=95=20=EC=A0=90=20?= =?UTF-8?q?=EC=84=A0=20=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EA=B8=B0=EB=8A=A5=20?= =?UTF-8?q?=EC=88=98=EC=A0=95=20=EC=BC=80=EB=9D=BC=EB=B0=94=EC=9D=98=20?= =?UTF-8?q?=EA=B2=BD=EC=9A=B0=20=EA=B2=BD=EC=82=AC=20=ED=95=84=EC=9A=94=20?= =?UTF-8?q?=EC=97=86=EC=9D=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../floor-plan/modal/grid/DotLineGrid.jsx | 77 +++++++++++-------- .../modal/roofShape/passivity/Gable.jsx | 9 --- 2 files changed, 44 insertions(+), 42 deletions(-) diff --git a/src/components/floor-plan/modal/grid/DotLineGrid.jsx b/src/components/floor-plan/modal/grid/DotLineGrid.jsx index 9e402a71..67c4cdf3 100644 --- a/src/components/floor-plan/modal/grid/DotLineGrid.jsx +++ b/src/components/floor-plan/modal/grid/DotLineGrid.jsx @@ -29,6 +29,8 @@ export default function DotLineGrid(props) { const { SelectOptions, currentSetting, setCurrentSetting, dotLineGridSettingState, setSettingModalGridOptions, setDotLineGridSettingState } = useCanvasSetting() + const [copyCurrentSetting, setCopyCurrentSetting] = useState({ ...currentSetting }) + // 데이터를 최초 한 번만 조회 useEffect(() => { console.log('DotLineGrid useEffect 실행') @@ -57,7 +59,7 @@ export default function DotLineGrid(props) { const handleCheckBoxChange = (e) => { const { value, checked } = e.target - setCurrentSetting((prev) => { + setCopyCurrentSetting((prev) => { return { ...prev, [value]: checked, @@ -66,23 +68,23 @@ export default function DotLineGrid(props) { } const handleSave = async () => { - if (!currentSetting.DOT && !currentSetting.LINE) { + /*if (!currentSetting.DOT && !currentSetting.LINE) { swalFire({ text: '배치할 그리드를 설정해주세요.' }) return - } + }*/ setDotLineGridSettingState((prev) => { return { ...prev, INTERVAL: { - type: currentSetting.INTERVAL.type, - horizontalInterval: currentSetting.INTERVAL.horizontalInterval, - verticalInterval: currentSetting.INTERVAL.verticalInterval, - ratioInterval: currentSetting.INTERVAL.ratioInterval, - dimension: currentSetting.INTERVAL.dimension, + type: copyCurrentSetting.INTERVAL.type, + horizontalInterval: copyCurrentSetting.INTERVAL.horizontalInterval, + verticalInterval: copyCurrentSetting.INTERVAL.verticalInterval, + ratioInterval: copyCurrentSetting.INTERVAL.ratioInterval, + dimension: copyCurrentSetting.INTERVAL.dimension, }, - DOT: currentSetting.DOT, - LINE: currentSetting.LINE, + DOT: copyCurrentSetting.DOT, + LINE: copyCurrentSetting.LINE, } //setDotLineGridSettingState({ ...currentSetting }) }) @@ -90,16 +92,18 @@ export default function DotLineGrid(props) { setSettingsData({ ...settingsData, INTERVAL: { - type: currentSetting.INTERVAL.type, - horizontalInterval: currentSetting.INTERVAL.horizontalInterval, - verticalInterval: currentSetting.INTERVAL.verticalInterval, - ratioInterval: currentSetting.INTERVAL.ratioInterval, - dimension: currentSetting.INTERVAL.dimension, + type: copyCurrentSetting.INTERVAL.type, + horizontalInterval: copyCurrentSetting.INTERVAL.horizontalInterval, + verticalInterval: copyCurrentSetting.INTERVAL.verticalInterval, + ratioInterval: copyCurrentSetting.INTERVAL.ratioInterval, + dimension: copyCurrentSetting.INTERVAL.dimension, }, - DOT: currentSetting.DOT, - LINE: currentSetting.LINE, + DOT: copyCurrentSetting.DOT, + LINE: copyCurrentSetting.LINE, }) + setCurrentSetting({ ...copyCurrentSetting }) + setIsShow(false) closePopup(id, isConfig) } @@ -107,7 +111,7 @@ export default function DotLineGrid(props) { const handleRadioChange = (e) => { const { value, name, checked, selected } = e.target - setCurrentSetting((prev) => { + setCopyCurrentSetting((prev) => { return { ...prev, INTERVAL: { @@ -120,7 +124,7 @@ export default function DotLineGrid(props) { const changeInput = (value, e) => { const { name } = e.target - setCurrentSetting((prev) => { + setCopyCurrentSetting((prev) => { return { ...prev, INTERVAL: { @@ -133,7 +137,7 @@ export default function DotLineGrid(props) { const changeDimension = (result) => { const { value } = result - setCurrentSetting((prev) => { + setCopyCurrentSetting((prev) => { return { ...prev, INTERVAL: { @@ -146,7 +150,7 @@ export default function DotLineGrid(props) { // 초기화 const reset = () => { - canvas + /*canvas ?.getObjects() .filter((obj) => obj.name === 'lineGrid') .forEach((obj) => canvas?.remove(obj)) @@ -154,9 +158,9 @@ export default function DotLineGrid(props) { ?.getObjects() .filter((obj) => obj.name === 'dotGrid') .forEach((obj) => canvas?.remove(obj)) - +*/ // resetDotLineGridSetting() - setCurrentSetting({ + setCopyCurrentSetting({ INTERVAL: { type: 2, // 1: 가로,세로 간격 수동, 2: 비율 간격 ratioInterval: 910, @@ -188,11 +192,11 @@ export default function DotLineGrid(props) {
- +
- +
@@ -205,8 +209,8 @@ export default function DotLineGrid(props) { id="ra01" value={1} onChange={handleRadioChange} - checked={(currentSetting.DOT || currentSetting.LINE) && currentSetting.INTERVAL.type === 1} - readOnly={!currentSetting.DOT && !currentSetting.LINE} + checked={(copyCurrentSetting.DOT || copyCurrentSetting.LINE) && copyCurrentSetting.INTERVAL.type === 1} + readOnly={!copyCurrentSetting.DOT && !copyCurrentSetting.LINE} />
@@ -217,7 +221,7 @@ export default function DotLineGrid(props) { type="text" className="input-origin" name={`horizontalInterval`} - value={currentSetting.INTERVAL.horizontalInterval} + value={copyCurrentSetting.INTERVAL.horizontalInterval} onChange={(e) => onlyNumberInputChange(e, changeInput)} /> @@ -230,7 +234,7 @@ export default function DotLineGrid(props) { type="text" className="input-origin" name={`verticalInterval`} - value={currentSetting.INTERVAL.verticalInterval} + value={copyCurrentSetting.INTERVAL.verticalInterval} onChange={(e) => onlyNumberInputChange(e, changeInput)} /> @@ -245,8 +249,8 @@ export default function DotLineGrid(props) { id="ra02" value={2} onChange={handleRadioChange} - checked={(currentSetting.DOT || currentSetting.LINE) && currentSetting.INTERVAL.type === 2} - readOnly={!currentSetting.DOT && !currentSetting.LINE} + checked={(copyCurrentSetting.DOT || copyCurrentSetting.LINE) && copyCurrentSetting.INTERVAL.type === 2} + readOnly={!copyCurrentSetting.DOT && !copyCurrentSetting.LINE} /> @@ -257,14 +261,21 @@ export default function DotLineGrid(props) { type="text" className="input-origin" name={`ratioInterval`} - value={currentSetting.INTERVAL.ratioInterval} + value={copyCurrentSetting.INTERVAL.ratioInterval} onChange={(e) => onlyNumberInputChange(e, changeInput)} /> mm
- +
diff --git a/src/components/floor-plan/modal/roofShape/passivity/Gable.jsx b/src/components/floor-plan/modal/roofShape/passivity/Gable.jsx index e7d9718d..8773ec32 100644 --- a/src/components/floor-plan/modal/roofShape/passivity/Gable.jsx +++ b/src/components/floor-plan/modal/roofShape/passivity/Gable.jsx @@ -7,15 +7,6 @@ export default function Gable({ offsetRef, pitchRef, pitchText }) { const currentAngleType = useRecoilValue(currentAngleTypeSelector) return ( <> -
- - {getMessage('slope')} - -
- -
- {pitchText} -
{getMessage('gable.offset')}