..
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
VITE_APP_ENV=development
|
VITE_APP_ENV=development
|
||||||
# VITE_APP_AUTH_PROXY_HOST='http://3.35.79.250:8090'
|
#VITE_APP_AUTH_PROXY_HOST='http://3.35.79.250:8090'
|
||||||
# VITE_APP_API_PROXY_HOST='http://3.35.79.250:8080'
|
#VITE_APP_API_PROXY_HOST='http://3.35.79.250:8080'
|
||||||
VITE_APP_AUTH_PROXY_HOST='https://auth.nicepay.co.kr'
|
VITE_APP_AUTH_PROXY_HOST='https://auth.nicepay.co.kr'
|
||||||
VITE_APP_API_PROXY_HOST='https://rest.nicepay.co.kr'
|
VITE_APP_API_PROXY_HOST='https://rest.nicepay.co.kr'
|
||||||
GENERATE_SOURCEMAP=false
|
GENERATE_SOURCEMAP=false
|
||||||
|
|||||||
@@ -69,13 +69,13 @@ export const AccountHolderSearchList = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<section className="transaction-list">
|
<section className="transaction-list">
|
||||||
{getListDateGroup()}
|
{ getListDateGroup() }
|
||||||
</section>
|
</section>
|
||||||
<div className="apply-row">
|
<div className="apply-row">
|
||||||
<button
|
<button
|
||||||
className="btn-50 btn-blue flex-1"
|
className="btn-50 btn-blue flex-1"
|
||||||
onClick={() => onClickToNavigate()}
|
onClick={ () => onClickToNavigate() }
|
||||||
>{t('additionalService.accountHolderSearch.searchRequest')}</button>
|
>{ t('additionalService.accountHolderSearch.searchRequest') }</button>
|
||||||
</div>
|
</div>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -3,11 +3,12 @@ import { IMAGE_ROOT } from '@/shared/constants/common';
|
|||||||
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
import { useNavigate } from '@/shared/lib/hooks/use-navigate';
|
||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useAppAlarmMarkMutation } from '../api/use-app-alarm-mark-mutation';
|
import { useAppAlarmMarkMutation } from '../api/use-app-alarm-mark-mutation';
|
||||||
import { AppAlarmMarkParams, AppAlarmMarkResponse } from '../model/types';
|
import { AlarmLinkOptions, AppAlarmMarkParams, AppAlarmMarkResponse } from '../model/types';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
|
|
||||||
|
|
||||||
export interface AlarmItemProps {
|
export interface AlarmItemProps {
|
||||||
appNotificationSequence?: number;
|
appNotificationSequence?: number;
|
||||||
appNotificationCategory?: string;
|
appNotificationCategory?: string;
|
||||||
@@ -16,6 +17,8 @@ export interface AlarmItemProps {
|
|||||||
appNotificationContent?: string;
|
appNotificationContent?: string;
|
||||||
appNotificationLink?: string;
|
appNotificationLink?: string;
|
||||||
appNotificationCategories: Array<any>;
|
appNotificationCategories: Array<any>;
|
||||||
|
setAlarmRoutesOn: (alarmRoutesOn: boolean) => void;
|
||||||
|
setAlarmOptions: (alarmOptions: AlarmLinkOptions) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AlarmItem = ({
|
export const AlarmItem = ({
|
||||||
@@ -25,9 +28,10 @@ export const AlarmItem = ({
|
|||||||
appNotificationTitle,
|
appNotificationTitle,
|
||||||
appNotificationContent,
|
appNotificationContent,
|
||||||
appNotificationLink,
|
appNotificationLink,
|
||||||
appNotificationCategories
|
appNotificationCategories,
|
||||||
|
setAlarmRoutesOn,
|
||||||
|
setAlarmOptions
|
||||||
}: AlarmItemProps) => {
|
}: AlarmItemProps) => {
|
||||||
const { navigate } = useNavigate();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
let userInfo = useStore.getState().UserStore.userInfo;
|
let userInfo = useStore.getState().UserStore.userInfo;
|
||||||
@@ -42,40 +46,11 @@ export const AlarmItem = ({
|
|||||||
return myCategory[0].desc1;
|
return myCategory[0].desc1;
|
||||||
};
|
};
|
||||||
const onClickToNavigate = () => {
|
const onClickToNavigate = () => {
|
||||||
let path = PATHS.support.notice.list + appNotificationSequence;
|
|
||||||
let pathState = {};
|
|
||||||
|
|
||||||
console.log('appNotificationSequence : [' + appNotificationSequence + ']');
|
|
||||||
console.log('appNotificationCategory : [' + appNotificationCategory + ']');
|
|
||||||
console.log('notificationReceivedDate : [' + notificationReceivedDate + ']');
|
|
||||||
console.log('appNotificationTitle : [' + appNotificationTitle + ']');
|
|
||||||
console.log('appNotificationContent : [' + appNotificationContent + ']');
|
|
||||||
console.log('appNotificationLink : [' + appNotificationLink + ']');
|
|
||||||
|
|
||||||
if(appNotificationLink){
|
if(appNotificationLink){
|
||||||
path = appNotificationLink;
|
setAlarmRoutesOn(true);
|
||||||
/*
|
setAlarmOptions({ linkUrl: appNotificationLink });
|
||||||
if(appNotificationCategory === '10'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(appNotificationCategory === '20'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(appNotificationCategory === '30'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(appNotificationCategory === '40'){
|
|
||||||
|
|
||||||
}
|
|
||||||
else if(appNotificationCategory === '60'){
|
|
||||||
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
navigate(path, {
|
|
||||||
state: pathState
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
|
|
||||||
const callAppAlarmMark = () => {
|
const callAppAlarmMark = () => {
|
||||||
@@ -97,23 +72,25 @@ export const AlarmItem = ({
|
|||||||
}, [appNotificationCategory]);
|
}, [appNotificationCategory]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<>
|
||||||
className="notice-item"
|
<div
|
||||||
onClick={ () => callAppAlarmMark() }
|
className="notice-item"
|
||||||
>
|
onClick={ () => callAppAlarmMark() }
|
||||||
<div className="notice-content">
|
>
|
||||||
<div className="notice-title">{ appNotificationTitle }</div>
|
<div className="notice-content">
|
||||||
<div className="notice-meta">
|
<div className="notice-title">{ appNotificationTitle }</div>
|
||||||
<strong>{ appNotificationCategoryName }</strong>
|
<div className="notice-meta">
|
||||||
<span>{ moment(notificationReceivedDate).format('YYYY.MM.DD HH:mm:ss') }</span>
|
<strong>{ appNotificationCategoryName }</strong>
|
||||||
|
<span>{ moment(notificationReceivedDate).format('YYYY.MM.DD HH:mm:ss') }</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="notice-arrow">
|
||||||
|
<img
|
||||||
|
src={ IMAGE_ROOT + '/Forward.svg' }
|
||||||
|
alt={t('alarm.goTo', { category: appNotificationCategoryName })}
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="notice-arrow">
|
</>
|
||||||
<img
|
|
||||||
src={ IMAGE_ROOT + '/Forward.svg' }
|
|
||||||
alt={t('alarm.goTo', { category: appNotificationCategoryName })}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import { IMAGE_ROOT } from '@/shared/constants/common';
|
import { IMAGE_ROOT } from '@/shared/constants/common';
|
||||||
import { AlarmItem } from './alarm-item';
|
import { AlarmItem } from './alarm-item';
|
||||||
import { AlarmListContent, AppAlarmListParams, AppAlarmListResponse, MERCHANT_ADMIN_APP } from '../model/types';
|
import { AlarmLinkOptions, AlarmListContent, AppAlarmListParams, AppAlarmListResponse, MERCHANT_ADMIN_APP } from '../model/types';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useAppAlarmListMutation } from '../api/use-app-alarm-list-mutation';
|
import { useAppAlarmListMutation } from '../api/use-app-alarm-list-mutation';
|
||||||
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
import { DEFAULT_PAGE_PARAM } from '@/entities/common/model/constant';
|
||||||
@@ -9,6 +9,7 @@ import { useNavigate } from '@/shared/lib/hooks';
|
|||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
import { useStore } from '@/shared/model/store';
|
import { useStore } from '@/shared/model/store';
|
||||||
import { DefaultRequestPagination } from '@/entities/common/model/types';
|
import { DefaultRequestPagination } from '@/entities/common/model/types';
|
||||||
|
import { AlarmRoutes } from './alarm-routes';
|
||||||
|
|
||||||
export interface AlarmListProps {
|
export interface AlarmListProps {
|
||||||
appNotificationCategory: string;
|
appNotificationCategory: string;
|
||||||
@@ -27,6 +28,8 @@ export const AlarmList = ({
|
|||||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||||
const [appCl, setAppCl] = useState<MERCHANT_ADMIN_APP>(MERCHANT_ADMIN_APP.MERCHANT_ADMIN_APP)
|
const [appCl, setAppCl] = useState<MERCHANT_ADMIN_APP>(MERCHANT_ADMIN_APP.MERCHANT_ADMIN_APP)
|
||||||
const [resultList, setResultList] = useState<Array<AlarmListContent>>([]);
|
const [resultList, setResultList] = useState<Array<AlarmListContent>>([]);
|
||||||
|
const [alarmRoutesOn, setAlarmRoutesOn] = useState<boolean>(false);
|
||||||
|
const [alarmOptions, setAlarmOptions] = useState<AlarmLinkOptions>();
|
||||||
|
|
||||||
const { mutateAsync: appAlarmList } = useAppAlarmListMutation();
|
const { mutateAsync: appAlarmList } = useAppAlarmListMutation();
|
||||||
|
|
||||||
@@ -107,6 +110,8 @@ export const AlarmList = ({
|
|||||||
appNotificationContent={ resultList[i]?.appNotificationContent }
|
appNotificationContent={ resultList[i]?.appNotificationContent }
|
||||||
appNotificationLink={ resultList[i]?.appNotificationLink }
|
appNotificationLink={ resultList[i]?.appNotificationLink }
|
||||||
appNotificationCategories={ appNotificationCategories }
|
appNotificationCategories={ appNotificationCategories }
|
||||||
|
setAlarmRoutesOn={ setAlarmRoutesOn }
|
||||||
|
setAlarmOptions={ setAlarmOptions }
|
||||||
></AlarmItem>
|
></AlarmItem>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -117,6 +122,12 @@ export const AlarmList = ({
|
|||||||
callList();
|
callList();
|
||||||
}, [appNotificationCategory]);
|
}, [appNotificationCategory]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(!!alarmRoutesOn){
|
||||||
|
console.log(alarmOptions)
|
||||||
|
}
|
||||||
|
}, [alarmRoutesOn, alarmOptions]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<div className="notice-box sub">
|
<div className="notice-box sub">
|
||||||
@@ -124,6 +135,11 @@ export const AlarmList = ({
|
|||||||
</div>
|
</div>
|
||||||
<div ref={ setTarget }></div>
|
<div ref={ setTarget }></div>
|
||||||
<div className="notice-alert">{t('alarm.retentionNotice')}</div>
|
<div className="notice-alert">{t('alarm.retentionNotice')}</div>
|
||||||
|
{ alarmRoutesOn &&
|
||||||
|
<AlarmRoutes
|
||||||
|
options={ alarmOptions }
|
||||||
|
></AlarmRoutes>
|
||||||
|
}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
86
src/entities/alarm/ui/alarm-routes.tsx
Normal file
86
src/entities/alarm/ui/alarm-routes.tsx
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
||||||
|
import { NoticeDetail } from '@/entities/support/ui/detail/notice-detail';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
import { QnaDetail } from '@/entities/support/ui/detail/qna-detail';
|
||||||
|
import { SettlementDetail } from '@/entities/settlement/ui/detail/settlement-detail';
|
||||||
|
import { SettlementPeriodType } from '@/entities/settlement/model/types';
|
||||||
|
|
||||||
|
export interface AlarmRoutesProps {
|
||||||
|
options?: AlarmLinkOptions;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const AlarmRoutes = ({
|
||||||
|
options
|
||||||
|
}: AlarmRoutesProps) => {
|
||||||
|
const [noticeDetailOn, setNoticeDetailOn] = useState<boolean>(false);
|
||||||
|
const [qnaDetailOn, setQnaDetailOn] = useState<boolean>(false);
|
||||||
|
const [settlementDetailOn, setSettlementDetailOn] = useState<boolean>(false);
|
||||||
|
const [seq, setSeq] = useState<number | string>();
|
||||||
|
const [settlementId, setSettlementId] = useState<string>();
|
||||||
|
|
||||||
|
const initOptions = () => {
|
||||||
|
if(options?.linkUrl){
|
||||||
|
let linkUrl = options.linkUrl;
|
||||||
|
if(linkUrl.indexOf('notice') > -1){
|
||||||
|
let linkArr: Array<any> = linkUrl.split('/');
|
||||||
|
setSeq(linkArr[linkArr.length - 1]);
|
||||||
|
setNoticeDetailOn(true);
|
||||||
|
setQnaDetailOn(false);
|
||||||
|
setSettlementDetailOn(false);
|
||||||
|
}
|
||||||
|
else if(linkUrl.indexOf('qna') > -1){
|
||||||
|
let linkArr: Array<any> = linkUrl.split('/');
|
||||||
|
setSeq(linkArr[linkArr.length - 1]);
|
||||||
|
setNoticeDetailOn(false);
|
||||||
|
setQnaDetailOn(true);
|
||||||
|
setSettlementDetailOn(false);
|
||||||
|
}
|
||||||
|
else if(linkUrl.indexOf('settlement') > -1){
|
||||||
|
let linkArr: Array<any> = linkUrl.split('/');
|
||||||
|
setSettlementId(linkArr[linkArr.length - 1]);
|
||||||
|
setNoticeDetailOn(false);
|
||||||
|
setQnaDetailOn(false);
|
||||||
|
setSettlementDetailOn(true);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
if(linkUrl.indexOf('http') > -1){
|
||||||
|
window.open(linkUrl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(options){
|
||||||
|
initOptions();
|
||||||
|
}
|
||||||
|
}, [options]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
{ !!noticeDetailOn &&
|
||||||
|
<NoticeDetail
|
||||||
|
detailOn={ noticeDetailOn }
|
||||||
|
setDetailOn={ setNoticeDetailOn }
|
||||||
|
seq={ seq }
|
||||||
|
></NoticeDetail>
|
||||||
|
}
|
||||||
|
{ !!qnaDetailOn &&
|
||||||
|
<QnaDetail
|
||||||
|
detailOn={ qnaDetailOn }
|
||||||
|
setDetailOn={ setQnaDetailOn }
|
||||||
|
seq={ seq }
|
||||||
|
></QnaDetail>
|
||||||
|
}
|
||||||
|
{ !!settlementDetailOn &&
|
||||||
|
<SettlementDetail
|
||||||
|
detailOn={ settlementDetailOn }
|
||||||
|
setDetailOn={ setSettlementDetailOn }
|
||||||
|
periodType={ SettlementPeriodType.SETTLEMENT_DATE }
|
||||||
|
settlementId={ settlementId }
|
||||||
|
></SettlementDetail>
|
||||||
|
}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
@@ -12,7 +12,7 @@ export const HomeNoticeList = () => {
|
|||||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||||
const [resultList, setResultList] = useState<Array<NoticeItem>>([]);
|
const [resultList, setResultList] = useState<Array<NoticeItem>>([]);
|
||||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||||
const [detailSeq, setDetailSeq] = useState<number>(0);
|
const [detailSeq, setDetailSeq] = useState<number | string>();
|
||||||
|
|
||||||
const { mutateAsync: noticeList } = useNoticeListMutation();
|
const { mutateAsync: noticeList } = useNoticeListMutation();
|
||||||
|
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import moment from 'moment';
|
|||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
||||||
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
|
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
|
||||||
|
import { snackBar } from '@/shared/lib';
|
||||||
|
|
||||||
export interface SettlementDetailProps {
|
export interface SettlementDetailProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
@@ -60,10 +61,16 @@ export const SettlementDetail = ({
|
|||||||
};
|
};
|
||||||
|
|
||||||
settlementsHistoryDetail(params).then((rs: SettlementsHistoryDetailResponse) => {
|
settlementsHistoryDetail(params).then((rs: SettlementsHistoryDetailResponse) => {
|
||||||
setAmountInfo(rs.amountInfo);
|
if(rs.amountInfo){
|
||||||
setSettlementInfo(rs.settlementInfo);
|
setAmountInfo(rs.amountInfo);
|
||||||
setSettlementAmount(rs.settlementAmount);
|
setSettlementInfo(rs.settlementInfo);
|
||||||
setSettlementDate(rs.settlementDate);
|
setSettlementAmount(rs.settlementAmount);
|
||||||
|
setSettlementDate(rs.settlementDate);
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
snackBar('데이터가 존재하지 않습니다.');
|
||||||
|
onClickToClose();
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
39
src/entities/support/api/use-qna-detail-mutation.ts
Normal file
39
src/entities/support/api/use-qna-detail-mutation.ts
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
import axios from 'axios';
|
||||||
|
import { API_URL_SUPPORT } from '@/shared/api/api-url-support';
|
||||||
|
import { resultify } from '@/shared/lib/resultify';
|
||||||
|
import { NiceAxiosError } from '@/shared/@types/error';
|
||||||
|
import {
|
||||||
|
QnaDetailParams,
|
||||||
|
QnaDetailResponse
|
||||||
|
} from '../model/types';
|
||||||
|
import {
|
||||||
|
useMutation,
|
||||||
|
UseMutationOptions
|
||||||
|
} from '@tanstack/react-query';
|
||||||
|
import { getHeaderUserAgent } from '@/shared/constants/url';
|
||||||
|
|
||||||
|
export const qnaDetail = (params: QnaDetailParams) => {
|
||||||
|
let headerOptions = {
|
||||||
|
menuId: 62,
|
||||||
|
apiType: 'SELECT'
|
||||||
|
};
|
||||||
|
let options = {
|
||||||
|
headers: {
|
||||||
|
'X-User-Agent': getHeaderUserAgent(headerOptions)
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return resultify(
|
||||||
|
axios.post<QnaDetailResponse>(API_URL_SUPPORT.qnaDetail(), params, options),
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export const useQnaDetailMutation = (options?: UseMutationOptions<QnaDetailResponse, NiceAxiosError, QnaDetailParams>) => {
|
||||||
|
const mutation = useMutation<QnaDetailResponse, NiceAxiosError, QnaDetailParams>({
|
||||||
|
...options,
|
||||||
|
mutationFn: (params: QnaDetailParams) => qnaDetail(params),
|
||||||
|
});
|
||||||
|
|
||||||
|
return {
|
||||||
|
...mutation,
|
||||||
|
};
|
||||||
|
};
|
||||||
@@ -29,6 +29,10 @@ export interface QnaListParams extends SupportParams {
|
|||||||
statusCode?: string;
|
statusCode?: string;
|
||||||
page?: DefaultRequestPagination;
|
page?: DefaultRequestPagination;
|
||||||
};
|
};
|
||||||
|
export interface QnaDetailParams {
|
||||||
|
seq: string | number;
|
||||||
|
};
|
||||||
|
export interface QnaDetailResponse extends QnaItem {};
|
||||||
export interface QnaItem {
|
export interface QnaItem {
|
||||||
answer?: string;
|
answer?: string;
|
||||||
answerDate?: string;
|
answerDate?: string;
|
||||||
@@ -47,9 +51,8 @@ export interface QnaListResponse extends DefaulResponsePagination {
|
|||||||
content: Array<QnaItem>
|
content: Array<QnaItem>
|
||||||
};
|
};
|
||||||
export interface DetailData {
|
export interface DetailData {
|
||||||
qnaItem?: QnaItem;
|
|
||||||
faqItem?: FaqItem;
|
faqItem?: FaqItem;
|
||||||
seq?: number;
|
seq?: string | number;
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
};
|
};
|
||||||
export interface QnaItemProps {
|
export interface QnaItemProps {
|
||||||
@@ -103,7 +106,7 @@ export enum InformCl {
|
|||||||
OTHERS = 'OTHERS'
|
OTHERS = 'OTHERS'
|
||||||
};
|
};
|
||||||
export interface NoticeDetailParams {
|
export interface NoticeDetailParams {
|
||||||
seq: number;
|
seq: number | string;
|
||||||
};
|
};
|
||||||
export interface NoticeDetailResponse extends NoticeItem {
|
export interface NoticeDetailResponse extends NoticeItem {
|
||||||
|
|
||||||
|
|||||||
@@ -11,27 +11,26 @@ import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
|||||||
export interface NoticeDetaillProps {
|
export interface NoticeDetaillProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
setDetailOn: (detailOn: boolean) => void;
|
setDetailOn: (detailOn: boolean) => void;
|
||||||
seq: number;
|
seq?: number | string;
|
||||||
};
|
};
|
||||||
export const NoticeDetail = ({
|
export const NoticeDetail = ({
|
||||||
detailOn,
|
detailOn,
|
||||||
setDetailOn,
|
setDetailOn,
|
||||||
seq
|
seq
|
||||||
}: NoticeDetaillProps) => {
|
}: NoticeDetaillProps) => {
|
||||||
const location = useLocation();
|
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [result, setResult] = useState<NoticeItem>({});
|
const [result, setResult] = useState<NoticeItem>({});
|
||||||
|
|
||||||
const { mutateAsync: noticeDetail } = useNoticeDetailMutation();
|
const { mutateAsync: noticeDetail } = useNoticeDetailMutation();
|
||||||
|
|
||||||
const callDetail = () => {
|
const callDetail = () => {
|
||||||
let detailParams: NoticeDetailParams = {
|
if(!!seq){
|
||||||
seq: seq,
|
let detailParams: NoticeDetailParams = {
|
||||||
};
|
seq: seq,
|
||||||
noticeDetail(detailParams).then((rs: NoticeDetailResponse) => {
|
};
|
||||||
setResult(rs);
|
noticeDetail(detailParams).then((rs: NoticeDetailResponse) => {
|
||||||
});
|
setResult(rs);
|
||||||
|
});
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const onClickToClose = () => {
|
const onClickToClose = () => {
|
||||||
|
|||||||
@@ -2,53 +2,45 @@ import moment from 'moment';
|
|||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { QnaItem } from '../../model/types';
|
import { QnaDetailParams, QnaDetailResponse, QnaItem } from '../../model/types';
|
||||||
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
|
import { DetailMotionDuration, DetailMotionStyle, DetailMotionVariants } from '@/entities/common/model/constant';
|
||||||
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
import { FullMenuClose } from '@/entities/common/ui/full-menu-close';
|
||||||
|
import { useQnaDetailMutation } from '../../api/use-qna-detail-mutation';
|
||||||
|
|
||||||
export interface qnaDetaillProps {
|
export interface qnaDetaillProps {
|
||||||
detailOn: boolean;
|
detailOn: boolean;
|
||||||
setDetailOn: (detailOn: boolean) => void;
|
setDetailOn: (detailOn: boolean) => void;
|
||||||
qnaItem: QnaItem;
|
seq?: string | number;
|
||||||
};
|
};
|
||||||
export const QnaDetail = ({
|
export const QnaDetail = ({
|
||||||
detailOn,
|
detailOn,
|
||||||
setDetailOn,
|
setDetailOn,
|
||||||
qnaItem
|
seq
|
||||||
}: qnaDetaillProps) => {
|
}: qnaDetaillProps) => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
const [result, setResult] = useState<QnaItem>({});
|
||||||
|
const { mutateAsync: qnaDetail } = useQnaDetailMutation();
|
||||||
|
|
||||||
const [answer, setAnswer] = useState<string>();
|
const callDetail = () => {
|
||||||
const [answerDate, setAnswerDate] = useState<string>();
|
if(!!seq){
|
||||||
const [contents, setContents] = useState<string>();
|
let detailParams: QnaDetailParams = {
|
||||||
const [corpName, setCorpName] = useState<string | null>();
|
seq: seq,
|
||||||
const [cursorId, setCursorId] = useState<number>();
|
};
|
||||||
const [requestDate, setRequestDate] = useState<string>();
|
qnaDetail(detailParams).then((rs: QnaDetailResponse) => {
|
||||||
const [requestName, setRequestName] = useState<string>();
|
setResult(rs);
|
||||||
const [requestType, setRequestType] = useState<string>();
|
});
|
||||||
const [sendEmail, setSendEmail] = useState<string | null>();
|
}
|
||||||
const [seq, setSeq] = useState<string>();
|
};
|
||||||
const [statusCode, setStatusCode] = useState<string>();
|
|
||||||
const [title, setTitle] = useState<string>();
|
|
||||||
|
|
||||||
const onClickToClose = () => {
|
const onClickToClose = () => {
|
||||||
setDetailOn(false);
|
setDetailOn(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setAnswer(qnaItem?.answer);
|
if(!!seq){
|
||||||
setAnswerDate(qnaItem?.answerDate);
|
callDetail();
|
||||||
setContents(qnaItem?.contents);
|
}
|
||||||
setCorpName(qnaItem?.corpName);
|
}, [seq]);
|
||||||
setCursorId(qnaItem?.cursorId);
|
|
||||||
setRequestDate(qnaItem?.requestDate);
|
|
||||||
setRequestName(qnaItem?.requestName);
|
|
||||||
setRequestType(qnaItem?.requestType);
|
|
||||||
setSendEmail(qnaItem?.sendEmail);
|
|
||||||
setSeq(qnaItem?.seq);
|
|
||||||
setStatusCode(qnaItem?.statusCode);
|
|
||||||
setTitle(qnaItem?.title);
|
|
||||||
}, [qnaItem]);
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@@ -60,7 +52,7 @@ export const QnaDetail = ({
|
|||||||
transition={ DetailMotionDuration }
|
transition={ DetailMotionDuration }
|
||||||
style={ DetailMotionStyle }
|
style={ DetailMotionStyle }
|
||||||
>
|
>
|
||||||
{ statusCode &&
|
{ result?.statusCode &&
|
||||||
<div className="full-menu-container pdw-16">
|
<div className="full-menu-container pdw-16">
|
||||||
<div className="full-menu-header">
|
<div className="full-menu-header">
|
||||||
<div className="full-menu-title center">{ t('support.qna.title') }</div>
|
<div className="full-menu-title center">{ t('support.qna.title') }</div>
|
||||||
@@ -76,29 +68,29 @@ export const QnaDetail = ({
|
|||||||
<div className="inq-detail__head">
|
<div className="inq-detail__head">
|
||||||
<div className="inq-detail__row">
|
<div className="inq-detail__row">
|
||||||
<span className="inq-badge">{t('support.qna.detailLabels.title')}</span>
|
<span className="inq-badge">{t('support.qna.detailLabels.title')}</span>
|
||||||
<span className="inq-head-text bold">{ title }</span>
|
<span className="inq-head-text bold">{ result?.title }</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-detail__row">
|
<div className="inq-detail__row">
|
||||||
<span className="inq-badge">{t('support.qna.detailLabels.type')}</span>
|
<span className="inq-badge">{t('support.qna.detailLabels.type')}</span>
|
||||||
<span className="inq-head-text">{ t(`support.qna.categories.${requestType}`) }</span>
|
<span className="inq-head-text">{ result?.requestType? t(`support.qna.categories.${result?.requestType}`): '' }</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-detail__row">
|
<div className="inq-detail__row">
|
||||||
<span className="inq-badge">{t('support.qna.detailLabels.registrationDate')}</span>
|
<span className="inq-badge">{t('support.qna.detailLabels.registrationDate')}</span>
|
||||||
<span className="inq-head-text">{ !!requestDate? moment(requestDate).format('YYYY.MM.DD'): '' }</span>
|
<span className="inq-head-text">{ result?.requestDate? moment(result?.requestDate).format('YYYY.MM.DD'): '' }</span>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-detail__row">
|
<div className="inq-detail__row">
|
||||||
<span className="inq-badge">{t('support.qna.detailLabels.answerDate')}</span>
|
<span className="inq-badge">{t('support.qna.detailLabels.answerDate')}</span>
|
||||||
<span className="inq-head-text">{ !!answerDate? moment(answerDate).format('YYYY.MM.DD'): '' }</span>
|
<span className="inq-head-text">{ result?.answerDate? moment(result?.answerDate).format('YYYY.MM.DD'): '' }</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-detail__divider"></div>
|
<div className="inq-detail__divider"></div>
|
||||||
<div className="inq-detail__section">
|
<div className="inq-detail__section">
|
||||||
<div className="inq-detail__section-title">{t('support.qna.detailLabels.inquiryAnswer')}</div>
|
<div className="inq-detail__section-title">{t('support.qna.detailLabels.inquiryAnswer')}</div>
|
||||||
<div className="inq-detail__body" dangerouslySetInnerHTML={{ __html: answer || '' }}></div>
|
<div className="inq-detail__body" dangerouslySetInnerHTML={{ __html: result?.answer || '' }}></div>
|
||||||
</div>
|
</div>
|
||||||
<div className="inq-detail__section">
|
<div className="inq-detail__section">
|
||||||
<div className="inq-detail__section-title">{t('support.qna.detailLabels.inquiryContents')}</div>
|
<div className="inq-detail__section-title">{t('support.qna.detailLabels.inquiryContents')}</div>
|
||||||
<div className="inq-detail__body" dangerouslySetInnerHTML={{ __html: contents || '' }}></div>
|
<div className="inq-detail__body" dangerouslySetInnerHTML={{ __html: result?.contents || '' }}></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export const SupportQnaItem = ({
|
|||||||
const onClickToDetail = () => {
|
const onClickToDetail = () => {
|
||||||
if(setDetailData){
|
if(setDetailData){
|
||||||
setDetailData({
|
setDetailData({
|
||||||
qnaItem: qnaItem,
|
seq: qnaItem.seq,
|
||||||
detailOn: true
|
detailOn: true
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,9 +15,11 @@ import {
|
|||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
import useIntersectionObserver from '@/widgets/intersection-observer';
|
import useIntersectionObserver from '@/widgets/intersection-observer';
|
||||||
import { NoticeDetail } from '@/entities/support/ui/detail/notice-detail';
|
import { NoticeDetail } from '@/entities/support/ui/detail/notice-detail';
|
||||||
|
import { useParams } from 'react-router';
|
||||||
|
|
||||||
export const NoticeListPage = () => {
|
export const NoticeListPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
const { seq } = useParams();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
|
const [onActionIntersect, setOnActionIntersect] = useState<boolean>(false);
|
||||||
@@ -26,7 +28,7 @@ export const NoticeListPage = () => {
|
|||||||
const [searchKeyword, setSearchKeyword] = useState<string>('');
|
const [searchKeyword, setSearchKeyword] = useState<string>('');
|
||||||
const [resultList, setResultList] = useState<Array<NoticeItem>>([]);
|
const [resultList, setResultList] = useState<Array<NoticeItem>>([]);
|
||||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||||
const [detailSeq, setDetailSeq] = useState<number>(0);
|
const [detailSeq, setDetailSeq] = useState<number | string>();
|
||||||
|
|
||||||
useSetHeaderTitle(t('support.notice.title'));
|
useSetHeaderTitle(t('support.notice.title'));
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
@@ -133,6 +135,12 @@ export const NoticeListPage = () => {
|
|||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
callList();
|
callList();
|
||||||
}, [informCl]);
|
}, [informCl]);
|
||||||
|
useEffect(() => {
|
||||||
|
if(seq){
|
||||||
|
setDetailOn(true);
|
||||||
|
setDetailSeq(parseInt(seq));
|
||||||
|
}
|
||||||
|
}, [seq]);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
|
|||||||
@@ -16,9 +16,11 @@ import {
|
|||||||
useSetOnBack
|
useSetOnBack
|
||||||
} from '@/widgets/sub-layout/use-sub-layout';
|
} from '@/widgets/sub-layout/use-sub-layout';
|
||||||
import { QnaDetail } from '@/entities/support/ui/detail/qna-detail';
|
import { QnaDetail } from '@/entities/support/ui/detail/qna-detail';
|
||||||
|
import { useParams } from 'react-router';
|
||||||
|
|
||||||
export const QnaListPage = () => {
|
export const QnaListPage = () => {
|
||||||
const { navigate } = useNavigate();
|
const { navigate } = useNavigate();
|
||||||
|
const { seq } = useParams();
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
const midOptions = useStore.getState().UserStore.selectOptionsMids;
|
const midOptions = useStore.getState().UserStore.selectOptionsMids;
|
||||||
@@ -33,7 +35,7 @@ export const QnaListPage = () => {
|
|||||||
const [statusCode, setStatusCode] = useState<string>(''); // 02, 03
|
const [statusCode, setStatusCode] = useState<string>(''); // 02, 03
|
||||||
const [resultList, setResultList] = useState<Array<QnaItem>>([]);
|
const [resultList, setResultList] = useState<Array<QnaItem>>([]);
|
||||||
const [detailOn, setDetailOn] = useState<boolean>(false);
|
const [detailOn, setDetailOn] = useState<boolean>(false);
|
||||||
const [detailQnaItem, setDetailQnaItem] = useState<QnaItem>({});
|
const [detailSeq, setDetailSeq] = useState<string | number>();
|
||||||
|
|
||||||
useSetHeaderTitle(t('support.qna.title'));
|
useSetHeaderTitle(t('support.qna.title'));
|
||||||
useSetHeaderType(HeaderType.LeftArrow);
|
useSetHeaderType(HeaderType.LeftArrow);
|
||||||
@@ -108,8 +110,8 @@ export const QnaListPage = () => {
|
|||||||
|
|
||||||
const setDetailData = (detailData: DetailData) => {
|
const setDetailData = (detailData: DetailData) => {
|
||||||
setDetailOn(detailData.detailOn);
|
setDetailOn(detailData.detailOn);
|
||||||
if(detailData?.qnaItem){
|
if(detailData?.seq){
|
||||||
setDetailQnaItem(detailData?.qnaItem);
|
setDetailSeq(detailData?.seq);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -138,6 +140,12 @@ export const QnaListPage = () => {
|
|||||||
callList();
|
callList();
|
||||||
}, [mid, statusCode]);
|
}, [mid, statusCode]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if(!!seq){
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<main>
|
<main>
|
||||||
@@ -191,7 +199,7 @@ export const QnaListPage = () => {
|
|||||||
<QnaDetail
|
<QnaDetail
|
||||||
detailOn={ detailOn }
|
detailOn={ detailOn }
|
||||||
setDetailOn={ setDetailOn }
|
setDetailOn={ setDetailOn }
|
||||||
qnaItem={ detailQnaItem }
|
seq={ detailSeq }
|
||||||
></QnaDetail>
|
></QnaDetail>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -12,12 +12,14 @@ export const SupportPages = () => {
|
|||||||
<SentryRoutes>
|
<SentryRoutes>
|
||||||
<Route path={ROUTE_NAMES.support.notice.base}>
|
<Route path={ROUTE_NAMES.support.notice.base}>
|
||||||
<Route path={ROUTE_NAMES.support.notice.list} element={<NoticeListPage />} />
|
<Route path={ROUTE_NAMES.support.notice.list} element={<NoticeListPage />} />
|
||||||
|
<Route path={ROUTE_NAMES.support.notice.list + '/:seq'} element={<NoticeListPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={ROUTE_NAMES.support.faq.base}>
|
<Route path={ROUTE_NAMES.support.faq.base}>
|
||||||
<Route path={ROUTE_NAMES.support.faq.list} element={<FaqListPage />} />
|
<Route path={ROUTE_NAMES.support.faq.list} element={<FaqListPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
<Route path={ROUTE_NAMES.support.qna.base}>
|
<Route path={ROUTE_NAMES.support.qna.base}>
|
||||||
<Route path={ROUTE_NAMES.support.qna.list} element={<QnaListPage />} />
|
<Route path={ROUTE_NAMES.support.qna.list} element={<QnaListPage />} />
|
||||||
|
<Route path={ROUTE_NAMES.support.qna.list + '/:seq'} element={<QnaListPage />} />
|
||||||
<Route path={ROUTE_NAMES.support.qna.register} element={<QnaRegisterPage />} />
|
<Route path={ROUTE_NAMES.support.qna.register} element={<QnaRegisterPage />} />
|
||||||
</Route>
|
</Route>
|
||||||
</SentryRoutes>
|
</SentryRoutes>
|
||||||
|
|||||||
@@ -19,6 +19,10 @@ export const API_URL_SUPPORT = {
|
|||||||
// POST: 1:1 문의 목록 조회
|
// POST: 1:1 문의 목록 조회
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/counsel/list`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/counsel/list`;
|
||||||
},
|
},
|
||||||
|
qnaDetail: () => {
|
||||||
|
// POST: 1:1 문의 상세 조회
|
||||||
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/counsel/detail`;
|
||||||
|
},
|
||||||
qnaSave: () => {
|
qnaSave: () => {
|
||||||
// POST: 1:1 문의 등록
|
// POST: 1:1 문의 등록
|
||||||
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/counsel/save`;
|
return `${API_BASE_URL}/api/v1/${API_URL_KEY}/counsel/save`;
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import { useUserFindAuthMethodMutation } from '@/entities/user/api/use-user-find
|
|||||||
import { useCodesSelectMutation } from '@/entities/common/api/use-codes-select-mutation';
|
import { useCodesSelectMutation } from '@/entities/common/api/use-codes-select-mutation';
|
||||||
import { MenuItems } from '@/entities/common/model/constant';
|
import { MenuItems } from '@/entities/common/model/constant';
|
||||||
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
import { AlarmLinkOptions } from '@/entities/alarm/model/types';
|
||||||
|
import { AlarmRoutes } from '@/entities/alarm/ui/alarm-routes';
|
||||||
|
|
||||||
export interface ContextType {
|
export interface ContextType {
|
||||||
setOnBack: (onBack: () => void) => void;
|
setOnBack: (onBack: () => void) => void;
|
||||||
@@ -73,6 +74,8 @@ export const SubLayout = () => {
|
|||||||
const [headerNavigationKey, setHeaderNavigationKey] = useState<number>(1);
|
const [headerNavigationKey, setHeaderNavigationKey] = useState<number>(1);
|
||||||
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
const [loginSuccess, setLoginSuccess] = useState<boolean>(false);
|
||||||
const [mid, setMid] = useState<string>();
|
const [mid, setMid] = useState<string>();
|
||||||
|
const [alarmRoutesOn, setAlarmRoutesOn] = useState<boolean>(false);
|
||||||
|
const [alarmOptions, setAlarmOptions] = useState<AlarmLinkOptions>();
|
||||||
|
|
||||||
const { isNativeEnvironment } = useAppBridge();
|
const { isNativeEnvironment } = useAppBridge();
|
||||||
const { mutateAsync: homeGroups } = useHomeGroupsMutation();
|
const { mutateAsync: homeGroups } = useHomeGroupsMutation();
|
||||||
@@ -328,6 +331,10 @@ export const SubLayout = () => {
|
|||||||
};
|
};
|
||||||
const alarmLink = (options: AlarmLinkOptions) => {
|
const alarmLink = (options: AlarmLinkOptions) => {
|
||||||
console.log(options);
|
console.log(options);
|
||||||
|
if(options?.linkUrl){
|
||||||
|
setAlarmRoutesOn(true);
|
||||||
|
setAlarmOptions(options);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.saveToken = saveToken;
|
window.saveToken = saveToken;
|
||||||
@@ -380,6 +387,11 @@ export const SubLayout = () => {
|
|||||||
setFavoriteEdit={ setFavoriteEdit }
|
setFavoriteEdit={ setFavoriteEdit }
|
||||||
></FooterNavigation>
|
></FooterNavigation>
|
||||||
}
|
}
|
||||||
|
{ alarmRoutesOn &&
|
||||||
|
<AlarmRoutes
|
||||||
|
options={ alarmOptions }
|
||||||
|
></AlarmRoutes>
|
||||||
|
}
|
||||||
|
|
||||||
</Fragment>
|
</Fragment>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user