From e5d48b6b68bef84aec2dc81e87c1c43a86d72e12 Mon Sep 17 00:00:00 2001 From: basssy Date: Tue, 7 Jan 2025 09:35:11 +0900 Subject: [PATCH] =?UTF-8?q?T01=20=EC=9D=B4=20=EC=9E=91=EC=84=B1=ED=95=9C?= =?UTF-8?q?=20=EB=AC=BC=EA=B1=B4=20T01=EC=95=84=EB=8B=8C=20=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=EC=9E=90=EA=B0=80=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=ED=96=88=EC=9D=84=EB=95=8C=20=EB=B2=84=ED=8A=BC=20=EC=88=A8?= =?UTF-8?q?=EA=B9=80=20=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Main.jsx | 4 +- src/components/management/StuffDetail.jsx | 55 ++++++++++++++--------- 2 files changed, 37 insertions(+), 22 deletions(-) diff --git a/src/components/Main.jsx b/src/components/Main.jsx index 1a436582..5f6c1052 100644 --- a/src/components/Main.jsx +++ b/src/components/Main.jsx @@ -41,12 +41,12 @@ export default function MainPage(mainPageProps) { if (searchRadioType === 'object') { setStuffSearch({ ...stuffSearch, - schObjectNo: searchTxt, + schObjectNo: searchTxt.trim(), code: 'M', }) router.push('/management/stuff', { scroll: false }) } else { - setSearchForm({ ...searchForm, searchValue: searchTxt, mainFlag: 'Y' }) + setSearchForm({ ...searchForm, searchValue: searchTxt.trim(), mainFlag: 'Y' }) router.push('/community/faq') } } diff --git a/src/components/management/StuffDetail.jsx b/src/components/management/StuffDetail.jsx index 6fe185c7..284849b6 100644 --- a/src/components/management/StuffDetail.jsx +++ b/src/components/management/StuffDetail.jsx @@ -34,6 +34,8 @@ export default function StuffDetail() { const [popPlanNo, setPopPlanNo] = useState('1') //default 1 + const [showButton, setShowButton] = useState('') //임시저장, 저장, 삭제 버튼 컨트롤 + //공통코드 const { commonCode, findCommonCode } = useCommonCode() const [selOptions, setSelOptions] = useState('') //선택한 1차점 @@ -266,7 +268,11 @@ export default function StuffDetail() { display: 'none', } } - + //createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기 + if (managementState?.createUser === 'T01' && session?.userId !== 'T01') { + //createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기 + setShowButton('none') + } return ( <>
@@ -318,8 +324,16 @@ export default function StuffDetail() { setIsFormValid(true) } promiseGet({ url: `/api/object/${objectNo}/detail` }).then((res) => { - // console.log('res::::', res.data) if (res.status === 200) { + // console.log(res.data.createUser) + // console.log(session) + if (res?.data?.createUser === 'T01') { + if (session?.userId !== 'T01') { + //createUser가 T01인데 로그인사용자가 T01이 아니면 버튼숨기기 + setShowButton('none') + } + } + if (isObjectNotEmpty(res.data)) { let surfaceTypeValue if (res.data.surfaceType === 'Ⅲ・Ⅳ') { @@ -1475,11 +1489,11 @@ export default function StuffDetail() {
{!isFormValid ? ( - ) : ( - )} @@ -1514,7 +1528,7 @@ export default function StuffDetail() { )) || null}
- @@ -1751,7 +1765,7 @@ export default function StuffDetail() {
-
{getMessage('stuff.detail.btn.addressPop.guide')}
@@ -1841,7 +1855,7 @@ export default function StuffDetail() { > {getMessage('stuff.detail.standardWindSpeedIdSpan')} - @@ -1963,11 +1977,11 @@ export default function StuffDetail() {
{!isFormValid ? ( - ) : ( - )} @@ -1995,10 +2009,10 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.moveList')} - -
@@ -2007,11 +2021,11 @@ export default function StuffDetail() { <>
{!isFormValid ? ( - ) : ( - )} @@ -2045,12 +2059,13 @@ export default function StuffDetail() { onClick={() => { form.setValue('planReqNo', '') }} + style={{ display: showButton }} > ) : null}
{managementState?.tempFlg === '1' ? ( <> - @@ -2306,7 +2321,7 @@ export default function StuffDetail() {
-
{getMessage('stuff.detail.btn.addressPop.guide')}
@@ -2401,7 +2416,7 @@ export default function StuffDetail() { > {getMessage('stuff.detail.standardWindSpeedIdSpan')} - @@ -2571,10 +2586,10 @@ export default function StuffDetail() { {getMessage('stuff.detail.btn.moveList')} - - @@ -2583,11 +2598,11 @@ export default function StuffDetail() { <>
{!isFormValid ? ( - ) : ( - )}