Merge branch 'dev' of https://git.hanasys.jp/qcast3/qcast-front into feature/ysCha
This commit is contained in:
commit
01dda7e43e
@ -20,6 +20,8 @@ import { stuffSearchState } from '@/store/stuffAtom'
|
|||||||
import { QcastContext } from '@/app/QcastProvider'
|
import { QcastContext } from '@/app/QcastProvider'
|
||||||
|
|
||||||
import { usePopup } from '@/hooks/usePopup'
|
import { usePopup } from '@/hooks/usePopup'
|
||||||
|
import { commonCodeState } from '@/store/commonCodeAtom'
|
||||||
|
import { isObjectNotEmpty } from '@/util/common-utils'
|
||||||
|
|
||||||
export const ToggleonMouse = (e, act, target) => {
|
export const ToggleonMouse = (e, act, target) => {
|
||||||
const listWrap = e.target.closest(target)
|
const listWrap = e.target.closest(target)
|
||||||
@ -67,6 +69,21 @@ export default function Header(props) {
|
|||||||
|
|
||||||
const [SelectOptions, setSelectOptions] = useState([])
|
const [SelectOptions, setSelectOptions] = useState([])
|
||||||
|
|
||||||
|
const [commonCode, setCommonCode] = useRecoilState(commonCodeState)
|
||||||
|
const { promiseGet } = useAxios()
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
const getCommonCode = async () => {
|
||||||
|
await promiseGet({ url: '/api/commcode/qc-comm-code' }).then((res) => {
|
||||||
|
setCommonCode(Object.groupBy(res.data, ({ clHeadCd }) => clHeadCd))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!isObjectNotEmpty(commonCode)) {
|
||||||
|
getCommonCode()
|
||||||
|
}
|
||||||
|
}, [])
|
||||||
|
|
||||||
const getAutoLoginParam = async () => {
|
const getAutoLoginParam = async () => {
|
||||||
await promisePost({ url: '/api/login/v1.0/user/login/autoLoginEncryptData', data: { loginId: userSession.userId } })
|
await promisePost({ url: '/api/login/v1.0/user/login/autoLoginEncryptData', data: { loginId: userSession.userId } })
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
|
|||||||
@ -22,9 +22,8 @@ import { useAxios } from '../useAxios'
|
|||||||
* const honorificCodes = findCommonCode(200800);
|
* const honorificCodes = findCommonCode(200800);
|
||||||
*/
|
*/
|
||||||
export const useCommonCode = () => {
|
export const useCommonCode = () => {
|
||||||
const [commonCode, setCommonCode] = useRecoilState(commonCodeState)
|
|
||||||
const globalLocale = useRecoilValue(globalLocaleStore)
|
const globalLocale = useRecoilValue(globalLocaleStore)
|
||||||
const { promiseGet } = useAxios()
|
const [commonCode, setCommonCode] = useRecoilState(commonCodeState)
|
||||||
|
|
||||||
const findCommonCode = (key) => {
|
const findCommonCode = (key) => {
|
||||||
const resultCodes = commonCode[key]?.map((code) => {
|
const resultCodes = commonCode[key]?.map((code) => {
|
||||||
@ -41,18 +40,6 @@ export const useCommonCode = () => {
|
|||||||
return resultCodes
|
return resultCodes
|
||||||
}
|
}
|
||||||
|
|
||||||
useEffect(() => {
|
|
||||||
const getCommonCode = async () => {
|
|
||||||
await promiseGet({ url: '/api/commcode/qc-comm-code' }).then((res) => {
|
|
||||||
setCommonCode(Object.groupBy(res.data, ({ clHeadCd }) => clHeadCd))
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!isObjectNotEmpty(commonCode)) {
|
|
||||||
getCommonCode()
|
|
||||||
}
|
|
||||||
}, [])
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
commonCode,
|
commonCode,
|
||||||
findCommonCode,
|
findCommonCode,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user