Merge branch 'dev' of ssh://git.jetbrains.space/nalpari/q-cast-iii/qcast-front into dev
This commit is contained in:
commit
8385a89027
@ -13,6 +13,8 @@ import { QcastContext } from '@/app/QcastProvider'
|
|||||||
import { sessionStore } from '@/store/commonAtom'
|
import { sessionStore } from '@/store/commonAtom'
|
||||||
import { isObjectNotEmpty } from '@/util/common-utils'
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
|
|
||||||
|
import BoardDetailModal from './community/modal/BoardDetailModal'
|
||||||
|
|
||||||
export default function MainPage() {
|
export default function MainPage() {
|
||||||
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
const [sessionState, setSessionState] = useRecoilState(sessionStore)
|
||||||
const [chagePasswordPopOpen, setChagePasswordPopOpen] = useState(false)
|
const [chagePasswordPopOpen, setChagePasswordPopOpen] = useState(false)
|
||||||
@ -79,8 +81,13 @@ export default function MainPage() {
|
|||||||
}
|
}
|
||||||
}, [sessionState])
|
}, [sessionState])
|
||||||
|
|
||||||
|
// FAQ 팝업 관련
|
||||||
|
const [open, setOpen] = useState(false)
|
||||||
|
const [modalNoticeNo, setModalNoticeNo] = useState('')
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
{open && <BoardDetailModal noticeNo={modalNoticeNo} setOpen={setOpen} />}
|
||||||
{(!chagePasswordPopOpen && (
|
{(!chagePasswordPopOpen && (
|
||||||
<>
|
<>
|
||||||
<div className="background-bord"></div>
|
<div className="background-bord"></div>
|
||||||
@ -120,7 +127,7 @@ export default function MainPage() {
|
|||||||
<button className="search-icon" onClick={handleOnSubmit}></button>
|
<button className="search-icon" onClick={handleOnSubmit}></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<MainContents />
|
<MainContents setFaqOpen={setOpen} setFaqModalNoticeNo={setModalNoticeNo} />
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
)) || (
|
)) || (
|
||||||
|
|||||||
@ -14,10 +14,9 @@ import { useMainContentsController } from '@/hooks/main/useMainContentsControlle
|
|||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
import { useSwal } from '@/hooks/useSwal'
|
import { useSwal } from '@/hooks/useSwal'
|
||||||
|
|
||||||
import BoardDetailModal from '../community/modal/BoardDetailModal'
|
|
||||||
import { handleFileDown } from '@/util/board-utils'
|
import { handleFileDown } from '@/util/board-utils'
|
||||||
|
|
||||||
export default function MainContents() {
|
export default function MainContents({ setFaqOpen, setFaqModalNoticeNo }) {
|
||||||
const { swalFire } = useSwal()
|
const { swalFire } = useSwal()
|
||||||
|
|
||||||
const { getMessage } = useMessage()
|
const { getMessage } = useMessage()
|
||||||
@ -116,10 +115,6 @@ export default function MainContents() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FAQ 팝업 관련
|
|
||||||
const [open, setOpen] = useState(false)
|
|
||||||
const [modalNoticeNo, setModalNoticeNo] = useState('')
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="main-product-list-wrap">
|
<div className="main-product-list-wrap">
|
||||||
<div className="main-product-list">
|
<div className="main-product-list">
|
||||||
@ -178,7 +173,6 @@ export default function MainContents() {
|
|||||||
</ProductItem>
|
</ProductItem>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{open && <BoardDetailModal noticeNo={modalNoticeNo} setOpen={setOpen} />}
|
|
||||||
<div className="main-product-list">
|
<div className="main-product-list">
|
||||||
<ProductItem num={3} name={getMessage('main.faq')}>
|
<ProductItem num={3} name={getMessage('main.faq')}>
|
||||||
{recentFaqList.length > 0 ? (
|
{recentFaqList.length > 0 ? (
|
||||||
@ -192,8 +186,8 @@ export default function MainContents() {
|
|||||||
className="faq-title pre"
|
className="faq-title pre"
|
||||||
style={{ cursor: 'pointer' }}
|
style={{ cursor: 'pointer' }}
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setOpen(true)
|
setFaqOpen(true)
|
||||||
setModalNoticeNo(row.noticeNo)
|
setFaqModalNoticeNo(row.noticeNo)
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{row.title}
|
{row.title}
|
||||||
|
|||||||
@ -303,11 +303,6 @@ export default function Stuff() {
|
|||||||
stuffSearchParams.schSaleStoreId = session.storeId
|
stuffSearchParams.schSaleStoreId = session.storeId
|
||||||
stuffSearchParams.schOtherSelSaleStoreId = ''
|
stuffSearchParams.schOtherSelSaleStoreId = ''
|
||||||
stuffSearchParams.schSelSaleStoreId = ''
|
stuffSearchParams.schSelSaleStoreId = ''
|
||||||
// if (session.storeLvl === '1') {
|
|
||||||
// stuffSearchParams.schSaleStoreId = session.storeId
|
|
||||||
// stuffSearchParams.schOtherSelSaleStoreId = ''
|
|
||||||
// stuffSearchParams.schSelSaleStoreId = ''
|
|
||||||
// }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async function fetchData() {
|
async function fetchData() {
|
||||||
|
|||||||
@ -56,7 +56,7 @@ export default function StuffSearchCondition() {
|
|||||||
const [objectNo, setObjectNo] = useState('') //물건번호
|
const [objectNo, setObjectNo] = useState('') //물건번호
|
||||||
const [saleStoreName, setSaleStoreName] = useState('') //판매대리점명
|
const [saleStoreName, setSaleStoreName] = useState('') //판매대리점명
|
||||||
const [address, setAddress] = useState('') //물건주소
|
const [address, setAddress] = useState('') //물건주소
|
||||||
const [objectName, setobjectName] = useState('') //물건명
|
const [objectName, setObjectName] = useState('') //물건명
|
||||||
const [dispCompanyName, setDispCompanyName] = useState('') //견적처
|
const [dispCompanyName, setDispCompanyName] = useState('') //견적처
|
||||||
const [schSelSaleStoreId, setSchSelSaleStoreId] = useState('') //판매대리점 선택
|
const [schSelSaleStoreId, setSchSelSaleStoreId] = useState('') //판매대리점 선택
|
||||||
const [receiveUser, setReceiveUser] = useState('') //담당자
|
const [receiveUser, setReceiveUser] = useState('') //담당자
|
||||||
@ -87,7 +87,6 @@ export default function StuffSearchCondition() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setIsGlobalLoading(true)
|
setIsGlobalLoading(true)
|
||||||
|
|
||||||
if (stuffSearch.code === 'S') {
|
if (stuffSearch.code === 'S') {
|
||||||
if (stuffSearch.pageNo !== 1) {
|
if (stuffSearch.pageNo !== 1) {
|
||||||
setStuffSearch({
|
setStuffSearch({
|
||||||
@ -96,8 +95,6 @@ export default function StuffSearchCondition() {
|
|||||||
schAddress: address ? address.trim() : '',
|
schAddress: address ? address.trim() : '',
|
||||||
schObjectName: objectName ? objectName.trim() : '',
|
schObjectName: objectName ? objectName.trim() : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||||
// schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
|
||||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
|
||||||
schSaleStoreId: stuffSearch?.schMyDataCheck ? stuffSearch?.schSaleStoreId : '',
|
schSaleStoreId: stuffSearch?.schMyDataCheck ? stuffSearch?.schSaleStoreId : '',
|
||||||
schSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schSelSaleStoreId,
|
||||||
schOtherSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schOtherSelSaleStoreId,
|
schOtherSelSaleStoreId: stuffSearch?.schMyDataCheck ? '' : stuffSearch.schOtherSelSaleStoreId,
|
||||||
@ -122,8 +119,6 @@ export default function StuffSearchCondition() {
|
|||||||
schAddress: address ? address.trim() : '',
|
schAddress: address ? address.trim() : '',
|
||||||
schObjectName: objectName ? objectName.trim() : '',
|
schObjectName: objectName ? objectName.trim() : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||||
// schSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? '' : stuffSearch.schSelSaleStoreId,
|
|
||||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
|
||||||
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||||
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
||||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||||
@ -146,8 +141,6 @@ export default function StuffSearchCondition() {
|
|||||||
schAddress: address ? address.trim() : '',
|
schAddress: address ? address.trim() : '',
|
||||||
schObjectName: objectName ? objectName.trim() : '',
|
schObjectName: objectName ? objectName.trim() : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||||
// schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
|
||||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
|
||||||
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||||
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
||||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||||
@ -194,8 +187,6 @@ export default function StuffSearchCondition() {
|
|||||||
schAddress: address ? address.trim() : '',
|
schAddress: address ? address.trim() : '',
|
||||||
schObjectName: objectName ? objectName.trim() : '',
|
schObjectName: objectName ? objectName.trim() : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||||
// schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
|
||||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
|
||||||
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||||
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
||||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||||
@ -242,8 +233,6 @@ export default function StuffSearchCondition() {
|
|||||||
schAddress: address ? address.trim() : '',
|
schAddress: address ? address.trim() : '',
|
||||||
schObjectName: objectName ? objectName.trim() : '',
|
schObjectName: objectName ? objectName.trim() : '',
|
||||||
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
schDispCompanyName: dispCompanyName ? dispCompanyName.trim() : '',
|
||||||
// schSelSaleStoreId: stuffSearch?.schSelSaleStoreId ? stuffSearch.schSelSaleStoreId : '',
|
|
||||||
// schOtherSelSaleStoreId: stuffSearch?.schOtherSelSaleStoreId ? stuffSearch.schOtherSelSaleStoreId : '',
|
|
||||||
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
schSelSaleStoreId: schSelSaleStoreId ? schSelSaleStoreId : stuffSearch.schSelSaleStoreId,
|
||||||
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
schOtherSelSaleStoreId: otherSaleStoreId ? otherSaleStoreId : stuffSearch.schOtherSelSaleStoreId,
|
||||||
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
schReceiveUser: receiveUser ? receiveUser.trim() : '',
|
||||||
@ -346,7 +335,7 @@ export default function StuffSearchCondition() {
|
|||||||
stuffSearch.schSaleStoreId = ''
|
stuffSearch.schSaleStoreId = ''
|
||||||
setObjectNo('')
|
setObjectNo('')
|
||||||
setAddress('')
|
setAddress('')
|
||||||
setobjectName('')
|
setObjectName('')
|
||||||
setSaleStoreName('')
|
setSaleStoreName('')
|
||||||
setReceiveUser('')
|
setReceiveUser('')
|
||||||
setDispCompanyName('')
|
setDispCompanyName('')
|
||||||
@ -714,7 +703,7 @@ export default function StuffSearchCondition() {
|
|||||||
setObjectNo('')
|
setObjectNo('')
|
||||||
setSaleStoreName('')
|
setSaleStoreName('')
|
||||||
setAddress('')
|
setAddress('')
|
||||||
setobjectName('')
|
setObjectName('')
|
||||||
setDispCompanyName('')
|
setDispCompanyName('')
|
||||||
setReceiveUser('')
|
setReceiveUser('')
|
||||||
objectNoRef.current.value = ''
|
objectNoRef.current.value = ''
|
||||||
@ -749,7 +738,7 @@ export default function StuffSearchCondition() {
|
|||||||
setObjectNo('')
|
setObjectNo('')
|
||||||
setSaleStoreName('')
|
setSaleStoreName('')
|
||||||
setAddress('')
|
setAddress('')
|
||||||
setobjectName('')
|
setObjectName('')
|
||||||
setDispCompanyName('')
|
setDispCompanyName('')
|
||||||
setReceiveUser('')
|
setReceiveUser('')
|
||||||
objectNoRef.current.value = ''
|
objectNoRef.current.value = ''
|
||||||
@ -780,15 +769,6 @@ export default function StuffSearchCondition() {
|
|||||||
setSchSelSaleStoreId('')
|
setSchSelSaleStoreId('')
|
||||||
setOtherSaleStoreId('')
|
setOtherSaleStoreId('')
|
||||||
} else {
|
} else {
|
||||||
setStartDate(stuffSearch?.schFromDt ? stuffSearch.schFromDt : dayjs(new Date()).add(-1, 'year').format('YYYY-MM-DD'))
|
|
||||||
setEndDate(stuffSearch?.schToDt ? stuffSearch.schToDt : dayjs(new Date()).format('YYYY-MM-DD'))
|
|
||||||
setObjectNo(stuffSearch.schObjectNo ? stuffSearch.schObjectNo : objectNo)
|
|
||||||
setSaleStoreName(stuffSearch.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName)
|
|
||||||
setAddress(stuffSearch.schAddress ? stuffSearch.schAddress : address)
|
|
||||||
setobjectName(stuffSearch.schObjectName ? stuffSearch.schObjectName : objectName)
|
|
||||||
setDispCompanyName(stuffSearch.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName)
|
|
||||||
setReceiveUser(stuffSearch.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser)
|
|
||||||
setDateType(stuffSearch.schDateType ? stuffSearch.schDateType : dateType)
|
|
||||||
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
setTempFlg(stuffSearch.schTempFlg ? stuffSearch.schTempFlg : tempFlg)
|
||||||
setMyDataCheck(stuffSearch.schMyDataCheck)
|
setMyDataCheck(stuffSearch.schMyDataCheck)
|
||||||
}
|
}
|
||||||
@ -807,7 +787,7 @@ export default function StuffSearchCondition() {
|
|||||||
setObjectNo('')
|
setObjectNo('')
|
||||||
setSaleStoreName('')
|
setSaleStoreName('')
|
||||||
setAddress('')
|
setAddress('')
|
||||||
setobjectName('')
|
setObjectName('')
|
||||||
setDispCompanyName('')
|
setDispCompanyName('')
|
||||||
setReceiveUser('')
|
setReceiveUser('')
|
||||||
objectNoRef.current.value = ''
|
objectNoRef.current.value = ''
|
||||||
@ -838,7 +818,7 @@ export default function StuffSearchCondition() {
|
|||||||
setObjectNo(stuffSearch.schObjectNo ? stuffSearch.schObjectNo : objectNo)
|
setObjectNo(stuffSearch.schObjectNo ? stuffSearch.schObjectNo : objectNo)
|
||||||
setSaleStoreName(stuffSearch.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName)
|
setSaleStoreName(stuffSearch.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName)
|
||||||
setAddress(stuffSearch.schAddress ? stuffSearch.schAddress : address)
|
setAddress(stuffSearch.schAddress ? stuffSearch.schAddress : address)
|
||||||
setobjectName(stuffSearch.schObjectName ? stuffSearch.schObjectName : objectName)
|
setObjectName(stuffSearch.schObjectName ? stuffSearch.schObjectName : objectName)
|
||||||
setDispCompanyName(stuffSearch.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName)
|
setDispCompanyName(stuffSearch.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName)
|
||||||
setReceiveUser(stuffSearch.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser)
|
setReceiveUser(stuffSearch.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser)
|
||||||
setDateType(stuffSearch.schDateType ? stuffSearch.schDateType : dateType)
|
setDateType(stuffSearch.schDateType ? stuffSearch.schDateType : dateType)
|
||||||
@ -1019,7 +999,7 @@ export default function StuffSearchCondition() {
|
|||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch?.schObjectNo ? stuffSearch.schObjectNo : objectNo}
|
defaultValue={stuffSearch?.schObjectNo ? stuffSearch.schObjectNo : objectNo}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schObjectNo = objectNoRef.current.value
|
// stuffSearch.schObjectNo = objectNoRef.current.value
|
||||||
setObjectNo(objectNoRef.current.value)
|
setObjectNo(objectNoRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
@ -1035,7 +1015,7 @@ export default function StuffSearchCondition() {
|
|||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName}
|
defaultValue={stuffSearch?.schSaleStoreName ? stuffSearch.schSaleStoreName : saleStoreName}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schSaleStoreName = saleStoreNameRef.current.value
|
// stuffSearch.schSaleStoreName = saleStoreNameRef.current.value
|
||||||
setSaleStoreName(saleStoreNameRef.current.value)
|
setSaleStoreName(saleStoreNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
@ -1052,7 +1032,7 @@ export default function StuffSearchCondition() {
|
|||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName}
|
defaultValue={stuffSearch?.schDispCompanyName ? stuffSearch.schDispCompanyName : dispCompanyName}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schDispCompanyName = dispCompanyNameRef.current.value
|
// stuffSearch.schDispCompanyName = dispCompanyNameRef.current.value
|
||||||
setDispCompanyName(dispCompanyNameRef.current.value)
|
setDispCompanyName(dispCompanyNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
@ -1070,8 +1050,8 @@ export default function StuffSearchCondition() {
|
|||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch?.schObjectName ? stuffSearch.schObjectName : objectName}
|
defaultValue={stuffSearch?.schObjectName ? stuffSearch.schObjectName : objectName}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schObjectName = objectNameRef.current.value
|
// stuffSearch.schObjectName = objectNameRef.current.value
|
||||||
setobjectName(objectNameRef.current.value)
|
setObjectName(objectNameRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
/>
|
/>
|
||||||
@ -1086,7 +1066,7 @@ export default function StuffSearchCondition() {
|
|||||||
ref={receiveUserRef}
|
ref={receiveUserRef}
|
||||||
defaultValue={stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser}
|
defaultValue={stuffSearch?.schReceiveUser ? stuffSearch.schReceiveUser : receiveUser}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schReceiveUser = receiveUserRef.current.value
|
// stuffSearch.schReceiveUser = receiveUserRef.current.value
|
||||||
setReceiveUser(receiveUserRef.current.value)
|
setReceiveUser(receiveUserRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
@ -1102,7 +1082,7 @@ export default function StuffSearchCondition() {
|
|||||||
className="input-light"
|
className="input-light"
|
||||||
defaultValue={stuffSearch?.schAddress ? stuffSearch.schAddress : address}
|
defaultValue={stuffSearch?.schAddress ? stuffSearch.schAddress : address}
|
||||||
onChange={() => {
|
onChange={() => {
|
||||||
stuffSearch.schAddress = addressRef.current.value
|
// stuffSearch.schAddress = addressRef.current.value
|
||||||
setAddress(addressRef.current.value)
|
setAddress(addressRef.current.value)
|
||||||
}}
|
}}
|
||||||
onKeyUp={handleByOnKeyUp}
|
onKeyUp={handleByOnKeyUp}
|
||||||
@ -1124,7 +1104,7 @@ export default function StuffSearchCondition() {
|
|||||||
value={'U'}
|
value={'U'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setDateType(e.target.value)
|
setDateType(e.target.value)
|
||||||
stuffSearch.schDateType = e.target.value
|
// stuffSearch.schDateType = e.target.value
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
<label htmlFor="radio_u">{getMessage('stuff.search.schDateTypeU')}</label>
|
||||||
@ -1138,7 +1118,7 @@ export default function StuffSearchCondition() {
|
|||||||
value={'R'}
|
value={'R'}
|
||||||
onChange={(e) => {
|
onChange={(e) => {
|
||||||
setDateType(e.target.value)
|
setDateType(e.target.value)
|
||||||
stuffSearch.schDateType = e.target.value
|
// stuffSearch.schDateType = e.target.value
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
<label htmlFor="radio_r">{getMessage('stuff.search.schDateTypeR')}</label>
|
||||||
|
|||||||
@ -1,16 +1,18 @@
|
|||||||
import { useRecoilValue } from 'recoil'
|
import { useRecoilState, useRecoilValue } from 'recoil'
|
||||||
import { canvasState } from '@/store/canvasAtom'
|
import { canvasState } from '@/store/canvasAtom'
|
||||||
import { POLYGON_TYPE } from '@/common/common'
|
import { POLYGON_TYPE } from '@/common/common'
|
||||||
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
import { moduleSelectionDataState } from '@/store/selectedModuleOptions'
|
||||||
import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
|
import { getDegreeByChon, getTrestleLength } from '@/util/canvas-util'
|
||||||
import { v4 as uuidv4 } from 'uuid'
|
import { v4 as uuidv4 } from 'uuid'
|
||||||
import { useMasterController } from '@/hooks/common/useMasterController'
|
import { useMasterController } from '@/hooks/common/useMasterController'
|
||||||
|
import { estimateParamAtom } from '@/store/estimateAtom'
|
||||||
|
|
||||||
// 회로 및 가대설정
|
// 회로 및 가대설정
|
||||||
export const useTrestle = () => {
|
export const useTrestle = () => {
|
||||||
const canvas = useRecoilValue(canvasState)
|
const canvas = useRecoilValue(canvasState)
|
||||||
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
const moduleSelectionData = useRecoilValue(moduleSelectionDataState) //다음으로 넘어가는 최종 데이터
|
||||||
const { getQuotationItem } = useMasterController()
|
const { getQuotationItem } = useMasterController()
|
||||||
|
const [estimateParam, setEstimateParam] = useRecoilState(estimateParamAtom)
|
||||||
|
|
||||||
const apply = () => {
|
const apply = () => {
|
||||||
//처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함.
|
//처마력바가 체크되어 있는 경우 exposedBottomPoints를 이용해 처마력바 그려줘야함.
|
||||||
@ -54,6 +56,10 @@ export const useTrestle = () => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const result = calculateForApi(surface)
|
const result = calculateForApi(surface)
|
||||||
|
|
||||||
|
if (!result) {
|
||||||
|
return
|
||||||
|
}
|
||||||
const centerPoints = result.centerPoints
|
const centerPoints = result.centerPoints
|
||||||
|
|
||||||
const exposedBottomModules = [] // 아래 두면이 모두 노출 되어있는 경우
|
const exposedBottomModules = [] // 아래 두면이 모두 노출 되어있는 경우
|
||||||
@ -439,16 +445,50 @@ export const useTrestle = () => {
|
|||||||
const quotationParam = getTrestleParams(surface)
|
const quotationParam = getTrestleParams(surface)
|
||||||
|
|
||||||
surface.set({ quotationParam })
|
surface.set({ quotationParam })
|
||||||
getQuoationItems()
|
})
|
||||||
|
setQuoationItem()
|
||||||
|
}
|
||||||
|
|
||||||
|
// itemList 조회 후 estimateParam에 저장
|
||||||
|
const setQuoationItem = () => {
|
||||||
|
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||||
|
//surfaces.pcses들을 배열로 묶는다
|
||||||
|
const pcses = surfaces[0].pcses
|
||||||
|
surfaces.forEach((surface, index) => {
|
||||||
|
if (index !== 0) {
|
||||||
|
pcses.concat(surface.pcses)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses }
|
||||||
|
//견적서 itemList 조회
|
||||||
|
getQuotationItem(params).then((res) => {
|
||||||
|
if (!res.data) {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const itemList = res.data
|
||||||
|
//northArrangement 북면 설치 여부
|
||||||
|
const northArrangement = getNorthArrangement()
|
||||||
|
|
||||||
|
setEstimateParam({ ...estimateParam, itemList, northArrangement })
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const getQuoationItems = () => {
|
const getNorthArrangement = () => {
|
||||||
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
const surfaces = canvas.getObjects().filter((obj) => obj.name === POLYGON_TYPE.MODULE_SETUP_SURFACE)
|
||||||
const params = { trestles: surfaces.map((surface) => surface.quotationParam), pcses: surfaces[0].pcses ?? [] }
|
let northArrangement = '0'
|
||||||
getQuotationItem(params).then((res) => {
|
|
||||||
console.log('res', res)
|
surfaces.forEach((surface) => {
|
||||||
|
const parent = canvas.getObjects().find((obj) => obj.id === surface.parentId)
|
||||||
|
const directionText = parent.directionText
|
||||||
|
// ['西北西','東北東'] 의 경우를 제외하고는 北이 들어간 경우 전부 북면으로 간주
|
||||||
|
if (directionText.includes('北') && !directionText.includes('西北西') && !directionText.includes('東北東')) {
|
||||||
|
if (surface.modules.length > 0) {
|
||||||
|
northArrangement = '1'
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
return northArrangement
|
||||||
}
|
}
|
||||||
|
|
||||||
const findNextModule = (currentPoint, centerPoints, direction) => {
|
const findNextModule = (currentPoint, centerPoints, direction) => {
|
||||||
|
|||||||
23
src/store/estimateAtom.js
Normal file
23
src/store/estimateAtom.js
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import { atom } from 'recoil'
|
||||||
|
|
||||||
|
export const estimateParamAtom = atom({
|
||||||
|
// 견적서 post parameter
|
||||||
|
key: 'estimateParamAtom',
|
||||||
|
default: {
|
||||||
|
saleStoreId: '',
|
||||||
|
objectNo: '',
|
||||||
|
planNo: '',
|
||||||
|
slope: '',
|
||||||
|
angle: '',
|
||||||
|
surfaceType: '',
|
||||||
|
setupHeight: '',
|
||||||
|
standardWindSpeedId: '',
|
||||||
|
snowfall: '',
|
||||||
|
northArrangement: '',
|
||||||
|
drawingFlg: '',
|
||||||
|
userId: '',
|
||||||
|
roofSurfaceList: [],
|
||||||
|
circuitItemList: [],
|
||||||
|
itemList: [],
|
||||||
|
},
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user