diff --git a/ecosystem.config.js b/ecosystem.config.js index 97676e2e..295b7871 100644 --- a/ecosystem.config.js +++ b/ecosystem.config.js @@ -2,7 +2,7 @@ module.exports = { apps: [ { name: 'qcast-front-production', - script: 'npm run start', + script: 'npm run start:dev', instance: 2, exec_mode: 'cluster', }, diff --git a/src/components/auth/AutoLogin.jsx b/src/components/auth/AutoLogin.jsx index d400f2c4..b3dcbb6e 100644 --- a/src/components/auth/AutoLogin.jsx +++ b/src/components/auth/AutoLogin.jsx @@ -2,26 +2,111 @@ import { useState } from 'react' import { useMessage } from '@/hooks/useMessage' +import { setSession, login } from '@/lib/authActions' +import { sessionStore } from '@/store/commonAtom' +import { useRecoilState } from 'recoil' +import { useAxios } from '@/hooks/useAxios' +import { globalLocaleStore } from '@/store/localeAtom' +import { useRouter } from 'next/navigation' + import GlobalSpinner from '@/components/common/spinner/GlobalSpinner' -export default function AutoLoginPage() { - const [isLoading, setIsLoading] = useState(true) +export default function AutoLoginPage({ autoLoginParam }) { + const router = useRouter() + + const [isLoading, setIsLoading] = useState(autoLoginParam === 'Y' ? false : true) + const [globalLocaleState, setGlbalLocaleState] = useRecoilState(globalLocaleStore) + + const { promisePost } = useAxios(globalLocaleState) const { getMessage } = useMessage() + const [userId, setUserId] = useState('') + const [sessionState, setSessionState] = useRecoilState(sessionStore) + + const [idFocus, setIdFocus] = useState(false) + + const loginProcess = async () => { + setIsLoading(true) + await promisePost({ url: '/api/login/v1.0/user', data: { loginId: userId } }).then((response) => { + setIsLoading(false) + if (response.data) { + const res = response.data + const result = { ...res, storeLvl: res.groupId === '60000' ? '1' : '2', pwdInitYn: 'Y' } + setSession(result) + setSessionState(result) + login() + } else { + alert(getMessage('login.fail')) + router.push('/login?autoLoginParam1=Y') + } + }) + } + return ( <> {isLoading && } -
-
- {getMessage('site.name')} - {getMessage('site.sub_name')} -
-
-
- {getMessage('login.auto.page.text')} + {autoLoginParam !== 'Y' ? ( + <> +
+
+ {getMessage('site.name')} + {getMessage('site.sub_name')} +
+
+
+ {getMessage('login.auto.page.text')} +
+
-
-
+ + ) : ( + <> +
+
{ + e.preventDefault() + loginProcess() + }} + className="space-y-6" + > +
+ {getMessage('site.name')} + {getMessage('site.sub_name')} +
+
+
+ { + setUserId(e.target.value) + }} + onFocus={() => setIdFocus(true)} + onBlur={() => setIdFocus(false)} + /> + +
+
+ +
+
+
+
+ + )} ) } diff --git a/src/components/auth/Login.jsx b/src/components/auth/Login.jsx index 85e342d4..7a6ba957 100644 --- a/src/components/auth/Login.jsx +++ b/src/components/auth/Login.jsx @@ -25,7 +25,9 @@ export default function Login() { useEffect(() => { if (autoLoginParam) { - autoLoginProcess(autoLoginParam) + if (autoLoginParam !== 'Y') { + autoLoginProcess(autoLoginParam) + } } // console.log('🚀 ~ checkSession ~ checkSession():', checkSession()) @@ -334,7 +336,7 @@ export default function Login() {
)} - {autoLoginParam && } + {autoLoginParam && }
COPYRIGHT©2024 Hanwha Japan All Rights Reserved.
diff --git a/src/components/estimate/Estimate.jsx b/src/components/estimate/Estimate.jsx index a44af878..532d6364 100644 --- a/src/components/estimate/Estimate.jsx +++ b/src/components/estimate/Estimate.jsx @@ -377,8 +377,8 @@ export default function Estimate({}) { useEffect(() => { if (estimateContextState.estimateType !== '') { const param = { - saleStoreId: session.storeId, - sapSalesStoreCd: session.custCd, + saleStoreId: estimateContextState.sapSaleStoreId, + sapSalesStoreCd: estimateContextState.sapSalesStoreCd, docTpCd: estimateContextState?.estimateType, } @@ -387,6 +387,8 @@ export default function Estimate({}) { if (isNotEmptyArray(res?.data)) { setStorePriceList(res.data) } + + setItemChangeYn(true) }) if (estimateContextState.estimateType === 'YJSS') { @@ -416,8 +418,6 @@ export default function Estimate({}) { handlePricing('UNIT_PRICE') } } - - setItemChangeYn(true) } }, [estimateContextState?.estimateType]) @@ -481,8 +481,8 @@ export default function Estimate({}) { //Pricing 버튼 const handlePricing = async (showPriceCd) => { const param = { - saleStoreId: session.storeId, - sapSalesStoreCd: session.custCd, + saleStoreId: estimateContextState.sapSaleStoreId, + sapSalesStoreCd: estimateContextState.sapSalesStoreCd, docTpCd: estimateContextState.estimateType, priceCd: showPriceCd, itemIdList: estimateContextState.itemList.filter((item) => item.delFlg === '0' && item.paDispOrder === null), @@ -506,7 +506,6 @@ export default function Estimate({}) { }) } } - setIsGlobalLoading(true) await promisePost({ url: '/api/estimate/price/item-price-list', data: param }).then((res) => { let updateList = [] diff --git a/src/components/fabric/QPolygon.js b/src/components/fabric/QPolygon.js index f19687aa..4b15d687 100644 --- a/src/components/fabric/QPolygon.js +++ b/src/components/fabric/QPolygon.js @@ -119,10 +119,12 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.addLengthText() this.on('moving', () => { + this.initLines() this.addLengthText() }) this.on('modified', (e) => { + this.initLines() this.addLengthText() }) @@ -183,7 +185,7 @@ export const QPolygon = fabric.util.createClass(fabric.Polygon, { this.lines = [] - this.points.forEach((point, i) => { + this.getCurrentPoints().forEach((point, i) => { const nextPoint = this.points[(i + 1) % this.points.length] const line = new QLine([point.x, point.y, nextPoint.x, nextPoint.y], { stroke: this.stroke, diff --git a/src/components/floor-plan/CanvasMenu.jsx b/src/components/floor-plan/CanvasMenu.jsx index 0d9ddc0a..a268604e 100644 --- a/src/components/floor-plan/CanvasMenu.jsx +++ b/src/components/floor-plan/CanvasMenu.jsx @@ -634,7 +634,7 @@ export default function CanvasMenu(props) { onClick={() => setEstimatePopupOpen(true)} > - {getMessage('plan.menu.estimate.docDown')} + {getMessage('plan.menu.estimate.docDownload')}