From c3360a8632d456e8e7723ee5d5d610a1fb5482df Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 30 Oct 2024 09:54:51 +0900 Subject: [PATCH 1/9] =?UTF-8?q?text=20type=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/common.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/common.js b/src/common/common.js index a0204047..8a7e9041 100644 --- a/src/common/common.js +++ b/src/common/common.js @@ -158,7 +158,7 @@ export const SAVE_KEY = [ export const OBJECT_PROTOTYPE = [ fabric.Line.prototype, fabric.Polygon.prototype, - fabric.Text.prototype, - fabric.IText.prototype, + // fabric.Text.prototype, + // fabric.IText.prototype, fabric.Triangle.prototype, ] From b9b4eae47413192a52aca1350881b94dc69fcae9 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 30 Oct 2024 09:57:37 +0900 Subject: [PATCH 2/9] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=ED=98=84=ED=99=A9=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/StuffDetail.jsx | 29 +++++++++-------------- 1 file changed, 11 insertions(+), 18 deletions(-) diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 21dc5d17..1a4c99ae 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -22,12 +22,12 @@ import { floorPlanObjectState } from '@/store/floorPlanObjectAtom' export default function StuffDetail() { 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 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() @@ -1183,6 +1183,7 @@ export default function StuffDetail() { return alert(getMessage('stuff.detail.save.valierror2')) } + return await promisePost({ url: '/api/object/save-object', data: params }).then((res) => { if (res.status === 201) { alert(getMessage('stuff.detail.tempSave.message1')) @@ -1268,7 +1269,7 @@ export default function StuffDetail() {
- +
@@ -1297,7 +1298,7 @@ export default function StuffDetail() { })} {/* 라디오끝 */}
- +
+
))}
{getMessage('setting')}
- {buttonAct === 1 && } - {buttonAct === 2 && } + {type === TYPE.FLOW_LINE && } + {type === TYPE.UP_DOWN && }
- +
diff --git a/src/components/floor-plan/modal/movement/type/FlowLine.jsx b/src/components/floor-plan/modal/movement/type/FlowLine.jsx index d1bf8023..1d3dd26e 100644 --- a/src/components/floor-plan/modal/movement/type/FlowLine.jsx +++ b/src/components/floor-plan/modal/movement/type/FlowLine.jsx @@ -1,7 +1,24 @@ import { useMessage } from '@/hooks/useMessage' +import { useEffect, useState } from 'react' -export default function FlowLine({}) { +const FLOW_LINE_TYPE = { + DOWN_LEFT: 'downLeft', + UP_RIGHT: 'upRight', +} + +export default function FlowLine({ FLOW_LINE_REF }) { const { getMessage } = useMessage() + const [type, setType] = useState(FLOW_LINE_TYPE.DOWN_LEFT) + + useEffect(() => { + if (type === FLOW_LINE_TYPE.DOWN_LEFT) { + FLOW_LINE_REF.UP_RIGHT_INPUT_REF.current.value = '' + FLOW_LINE_REF.DOWN_LEFT_INPUT_REF.current.focus() + } else { + FLOW_LINE_REF.DOWN_LEFT_INPUT_REF.current.value = '' + FLOW_LINE_REF.UP_RIGHT_INPUT_REF.current.focus() + } + }, [type]) return ( <> @@ -11,14 +28,28 @@ export default function FlowLine({}) {
- + { + setType(FLOW_LINE_TYPE.DOWN_LEFT) + }} + />
- +
@@ -26,14 +57,27 @@ export default function FlowLine({}) {
- + { + setType(FLOW_LINE_TYPE.UP_RIGHT) + }} + />
- +
mm
diff --git a/src/components/floor-plan/modal/movement/type/Updown.jsx b/src/components/floor-plan/modal/movement/type/Updown.jsx index 2650ca4a..a27abf80 100644 --- a/src/components/floor-plan/modal/movement/type/Updown.jsx +++ b/src/components/floor-plan/modal/movement/type/Updown.jsx @@ -1,7 +1,24 @@ import { useMessage } from '@/hooks/useMessage' +import { useEffect, useState } from 'react' -export default function Updown({}) { +const UP_DOWN_TYPE = { + UP: 'up', + DOWN: 'down', +} + +export default function Updown({ UP_DOWN_REF }) { const { getMessage } = useMessage() + const [type, setType] = useState(UP_DOWN_TYPE.UP) + + useEffect(() => { + if (type === UP_DOWN_TYPE.UP) { + UP_DOWN_REF.DOWN_INPUT_REF.current.value = '' + UP_DOWN_REF.UP_INPUT_REF.current.focus() + } else { + UP_DOWN_REF.UP_INPUT_REF.current.value = '' + UP_DOWN_REF.DOWN_INPUT_REF.current.focus() + } + }, [type]) return ( <> @@ -11,14 +28,23 @@ export default function Updown({}) {
- + { + setType(UP_DOWN_TYPE.UP) + }} + />
- +
@@ -26,14 +52,22 @@ export default function Updown({}) {
- + { + setType(UP_DOWN_TYPE.DOWN) + }} + />
- +
mm
diff --git a/src/hooks/roofcover/useMovementSetting.js b/src/hooks/roofcover/useMovementSetting.js new file mode 100644 index 00000000..355a6bf8 --- /dev/null +++ b/src/hooks/roofcover/useMovementSetting.js @@ -0,0 +1,48 @@ +import { useRecoilValue } from 'recoil' +import { canvasState } from '@/store/canvasAtom' +import { usePopup } from '@/hooks/usePopup' +import { useMessage } from '@/hooks/useMessage' +import { useRef, useState } from 'react' + +//동선이동 형 올림 내림 +export function useMovementSetting(id) { + const TYPE = { + FLOW_LINE: 'flowLine', // 동선이동 + UP_DOWN: 'updown', //형 올림내림 + } + const canvas = useRecoilValue(canvasState) + const { closePopup } = usePopup() + const { getMessage } = useMessage() + const buttonType = [ + { id: 1, name: getMessage('modal.movement.flow.line.move'), type: TYPE.FLOW_LINE }, + { id: 2, name: getMessage('modal.movement.flow.line.updown'), type: TYPE.UP_DOWN }, + ] + const [type, setType] = useState(TYPE.FLOW_LINE) + + const FLOW_LINE_REF = { + DOWN_LEFT_INPUT_REF: useRef(null), + UP_RIGHT_INPUT_REF: useRef(null), + DOWN_LEFT_RADIO_REF: useRef(null), + UP_RIGHT_RADIO_REF: useRef(null), + } + + const UP_DOWN_REF = { + UP_INPUT_REF: useRef(null), + DOWN_INPUT_REF: useRef(null), + UP_RADIO_REF: useRef(null), + DOWN_RADIO_REF: useRef(null), + } + + const handleSave = () => {} + + return { + TYPE, + closePopup, + buttonType, + type, + setType, + FLOW_LINE_REF, + UP_DOWN_REF, + handleSave, + } +} From f56906cac135d2d356a03dcf5b6e28e3c544eed7 Mon Sep 17 00:00:00 2001 From: basssy Date: Wed, 30 Oct 2024 11:16:26 +0900 Subject: [PATCH 8/9] =?UTF-8?q?=EB=AC=BC=EA=B1=B4=EB=AA=A9=EB=A1=9D?= =?UTF-8?q?=ED=99=94=EB=A9=B4=20=EA=B7=B8=EB=A6=AC=EB=93=9C=20=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=84=B0=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/management/Stuff.jsx | 36 ++++++++++++++--------------- src/locales/ja.json | 1 + src/locales/ko.json | 1 + 3 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/components/management/Stuff.jsx b/src/components/management/Stuff.jsx index 5a1bee40..999ea900 100644 --- a/src/components/management/Stuff.jsx +++ b/src/components/management/Stuff.jsx @@ -50,12 +50,11 @@ export default function Stuff() { } //물건번호 복사버튼 옆에 영역 - const onDoubleClick = (e) => { - let objectNo = e.target.innerText - if (objectNo.substring(0, 1) === 'R') { - router.push(`${pathname}/detail?objectNo=${objectNo.toString()}`, { scroll: false }) + const onDoubleClick = (data) => { + if (data.tempFlg === '0') { + router.push(`${pathname}/detail?objectNo=${data.objectNo.toString()}`, { scroll: false }) } else { - router.push(`${pathname}/tempdetail?objectNo=${objectNo.toString()}`, { scroll: false }) + router.push(`${pathname}/tempdetail?objectNo=${data.objectNo.toString()}`, { scroll: false }) } } @@ -85,20 +84,21 @@ export default function Stuff() { minWidth: 230, headerName: getMessage('stuff.gridHeader.objectNo'), cellRenderer: function (params) { - let objectNo = params.value.substring(0, 1) if (params.data.objectNo) { return ( -
- {params.value.toLocaleString()} - {objectNo === 'R' && ( - - )} +
onDoubleClick(params.data)}> + {(params.data.tempFlg === '0' && ( + <> + {params.value.toLocaleString()} + + + )) || <>{getMessage('stuff.gridData.tempObjectNo')}}
) } @@ -157,7 +157,7 @@ export default function Stuff() { } else { //T 면 임시 R은 진짜 if (event.data.objectNo) { - if (event.data.objectNo.substring(0, 1) === 'R') { + if (event.data.tempFlg === '0') { router.push(`${pathname}/detail?objectNo=${event.data.objectNo.toString()}`, { scroll: false }) } else { router.push(`${pathname}/tempdetail?objectNo=${event.data.objectNo.toString()}`, { scroll: false }) diff --git a/src/locales/ja.json b/src/locales/ja.json index 27b20ada..08cff23d 100644 --- a/src/locales/ja.json +++ b/src/locales/ja.json @@ -514,6 +514,7 @@ "stuff.gridHeader.receiveUser": "担当者", "stuff.gridHeader.specificationConfirmDate": "仕様確認日", "stuff.gridHeader.createDatetime": "登録日", + "stuff.gridData.tempObjectNo": "一時保存物", "stuff.message.periodError": "最大1年間閲覧可能.", "stuff.addressPopup.title": "郵便番号", "stuff.addressPopup.placeholder": "郵便番号の7桁を入力してください。", diff --git a/src/locales/ko.json b/src/locales/ko.json index ecd5b73b..f63e04b6 100644 --- a/src/locales/ko.json +++ b/src/locales/ko.json @@ -519,6 +519,7 @@ "stuff.gridHeader.receiveUser": "담당자", "stuff.gridHeader.specificationConfirmDate": "사양확인일", "stuff.gridHeader.createDatetime": "등록일", + "stuff.gridData.tempObjectNo": "임시저장물건", "stuff.message.periodError": "최대1년 조회 가능합니다.", "stuff.addressPopup.title": "우편번호", "stuff.addressPopup.placeholder": "우편번호의 7자리를 입력하세요.", From 2ca8b84f17dab35bf9d289150bcb283abfbce1d9 Mon Sep 17 00:00:00 2001 From: "hyojun.choi" Date: Wed, 30 Oct 2024 11:38:11 +0900 Subject: [PATCH 9/9] =?UTF-8?q?=EC=99=B8=EB=B2=BD=EC=84=A0=20=EA=B7=B8?= =?UTF-8?q?=EB=A6=AC=EA=B8=B0=20input=20foucs=EC=8B=9C=20=EC=B4=88?= =?UTF-8?q?=EA=B8=B0=ED=99=94=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/floor-plan/modal/lineTypes/Angle.jsx | 2 ++ src/components/floor-plan/modal/lineTypes/Diagonal.jsx | 2 ++ src/components/floor-plan/modal/lineTypes/DoublePitch.jsx | 5 ++++- src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx | 1 + src/components/floor-plan/modal/lineTypes/RightAngle.jsx | 2 ++ src/hooks/roofcover/useOuterLineWall.js | 6 ++++++ 6 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/components/floor-plan/modal/lineTypes/Angle.jsx b/src/components/floor-plan/modal/lineTypes/Angle.jsx index 83985016..e90f437f 100644 --- a/src/components/floor-plan/modal/lineTypes/Angle.jsx +++ b/src/components/floor-plan/modal/lineTypes/Angle.jsx @@ -19,6 +19,7 @@ export default function Angle({ props }) { className="input-origin block" value={angle1} ref={angle1Ref} + onFocus={(e) => (angle1Ref.current.value = '')} onChange={(e) => onlyNumberWithDotInputChange(e, setAngle1)} placeholder="45" /> @@ -38,6 +39,7 @@ export default function Angle({ props }) { className="input-origin block" value={length1} ref={length1Ref} + onFocus={(e) => (length1Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> diff --git a/src/components/floor-plan/modal/lineTypes/Diagonal.jsx b/src/components/floor-plan/modal/lineTypes/Diagonal.jsx index 84c25329..23972fb5 100644 --- a/src/components/floor-plan/modal/lineTypes/Diagonal.jsx +++ b/src/components/floor-plan/modal/lineTypes/Diagonal.jsx @@ -35,6 +35,7 @@ export default function Diagonal({ props }) { className="input-origin block" value={outerLineDiagonalLength} ref={outerLineDiagonalLengthRef} + onFocus={(e) => (outerLineDiagonalLengthRef.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setOuterLineDiagonalLength)} placeholder="3000" /> @@ -56,6 +57,7 @@ export default function Diagonal({ props }) { className="input-origin block" value={length1} ref={length1Ref} + onFocus={(e) => (length1Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> diff --git a/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx b/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx index 5bfa5950..b34a1f3e 100644 --- a/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx +++ b/src/components/floor-plan/modal/lineTypes/DoublePitch.jsx @@ -55,6 +55,7 @@ export default function DoublePitch({ props }) { className="input-origin block" value={angle1} ref={angle1Ref} + onFocus={(e) => (angle1Ref.current.value = '')} onChange={(e) => onlyNumberWithDotInputChange(e, setAngle1)} placeholder="45" /> @@ -71,6 +72,7 @@ export default function DoublePitch({ props }) { className="input-origin block" value={length1} ref={length1Ref} + onFocus={(e) => (length1Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> @@ -128,9 +130,9 @@ export default function DoublePitch({ props }) { className="input-origin block" value={angle2} ref={angle2Ref} + onFocus={(e) => (angle2Ref.current.value = '')} onChange={(e) => { onlyNumberWithDotInputChange(e, setAngle2) - console.log(getLength2()) setLength2(getLength2()) }} placeholder="45" @@ -153,6 +155,7 @@ export default function DoublePitch({ props }) { className="input-origin block" value={length2} ref={length2Ref} + onFocus={(e) => (length2Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength2)} readOnly={true} placeholder="3000" diff --git a/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx b/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx index f469fba8..439e0748 100644 --- a/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx +++ b/src/components/floor-plan/modal/lineTypes/OuterLineWall.jsx @@ -18,6 +18,7 @@ export default function OuterLineWall({ props }) { className="input-origin block" value={length1} ref={length1Ref} + onFocus={(e) => (length1Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> diff --git a/src/components/floor-plan/modal/lineTypes/RightAngle.jsx b/src/components/floor-plan/modal/lineTypes/RightAngle.jsx index 306a09f0..b217a867 100644 --- a/src/components/floor-plan/modal/lineTypes/RightAngle.jsx +++ b/src/components/floor-plan/modal/lineTypes/RightAngle.jsx @@ -15,6 +15,7 @@ export default function RightAngle({ props }) { className="input-origin block" value={length1} ref={length1Ref} + onFocus={(e) => (length1Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength1)} placeholder="3000" /> @@ -70,6 +71,7 @@ export default function RightAngle({ props }) { className="input-origin block" value={length2} ref={length2Ref} + onFocus={(e) => (length2Ref.current.value = '')} onChange={(e) => onlyNumberInputChange(e, setLength2)} placeholder="3000" /> diff --git a/src/hooks/roofcover/useOuterLineWall.js b/src/hooks/roofcover/useOuterLineWall.js index 531aab48..b2244da8 100644 --- a/src/hooks/roofcover/useOuterLineWall.js +++ b/src/hooks/roofcover/useOuterLineWall.js @@ -115,6 +115,12 @@ export function useOuterLineWall(id, propertiesId) { setAngle2(0) setOuterLineDiagonalLength(0) + + const activeElem = document.activeElement + + if (activeElem) { + activeElem.blur() + } } const mouseDown = (e) => {