알림톡
This commit is contained in:
@@ -38,6 +38,16 @@ import { checkGrant } from '@/shared/lib/check-grant';
|
||||
import { showAlert } from '@/widgets/show-alert';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
|
||||
const defaultParams = {
|
||||
searchCl: AlimtalkSearchCl.BUYER_NAME,
|
||||
searchValue: '',
|
||||
serviceCode: ServiceCode.ALL,
|
||||
alimCl: AlimtalkAlimCl.DEPOSIT_REQUEST,
|
||||
fromDate: moment().format('YYYYMMDD'),
|
||||
toDate: moment().format('YYYYMMDD'),
|
||||
sendType: AlimtalkSendType.ALL,
|
||||
sendCl: AlimTalkSendCl.ALL
|
||||
};
|
||||
export const AlimtalkListPage = () => {
|
||||
const { t } = useTranslation();
|
||||
const { navigate } = useNavigate();
|
||||
@@ -53,14 +63,14 @@ export const AlimtalkListPage = () => {
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [pageParam, setPageParam] = useState<DefaultRequestPagination>(DEFAULT_PAGE_PARAM);
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [searchCl, setSearchCl] = useState<AlimtalkSearchCl>(AlimtalkSearchCl.BUYER_NAME);
|
||||
const [searchValue, setSearchValue] = useState<string>('');
|
||||
const [serviceCode, setServiceCode] = useState<ServiceCode>(ServiceCode.ALL);
|
||||
const [alimCl, setAlimCl] = useState<AlimtalkAlimCl>(AlimtalkAlimCl.DEPOSIT_REQUEST);
|
||||
const [fromDate, setFromDate] = useState<string>(moment().format('YYYYMMDD'));
|
||||
const [toDate, setToDate] = useState<string>(moment().format('YYYYMMDD'));
|
||||
const [sendType, setSendType] = useState<AlimtalkSendType>(AlimtalkSendType.ALL);
|
||||
const [sendCl, setSendCl] = useState<AlimTalkSendCl>(AlimTalkSendCl.ALL);
|
||||
const [searchCl, setSearchCl] = useState<AlimtalkSearchCl>(defaultParams.searchCl);
|
||||
const [searchValue, setSearchValue] = useState<string>(defaultParams.searchValue);
|
||||
const [serviceCode, setServiceCode] = useState<ServiceCode>(defaultParams.serviceCode);
|
||||
const [alimCl, setAlimCl] = useState<AlimtalkAlimCl>(defaultParams.alimCl);
|
||||
const [fromDate, setFromDate] = useState<string>(defaultParams.fromDate);
|
||||
const [toDate, setToDate] = useState<string>(defaultParams.toDate);
|
||||
const [sendType, setSendType] = useState<AlimtalkSendType>(defaultParams.sendType);
|
||||
const [sendCl, setSendCl] = useState<AlimTalkSendCl>(defaultParams.sendCl);
|
||||
|
||||
const [downloadBottomSheetOn, setDownloadBottomSheetOn] = useState<boolean>(false);
|
||||
|
||||
@@ -73,6 +83,7 @@ export const AlimtalkListPage = () => {
|
||||
const [groupDateOn, setGroupDateOn] = useState<boolean>(false);
|
||||
|
||||
const [listHeight, setListHeight] = useState<number>(0);
|
||||
const [filterUsed, setFilterUsed] = useState<boolean>(false);
|
||||
|
||||
const { mutateAsync: extensionAlimtalkList } = useExtensionAlimtalkListMutation();
|
||||
const { mutateAsync: extensionAlimtalkDownloadExcel } = useExtensionAlimtalkDownloadExcelMutation();
|
||||
@@ -268,8 +279,34 @@ export const AlimtalkListPage = () => {
|
||||
return rs;
|
||||
}
|
||||
|
||||
const checkUsedFilter = () => {
|
||||
let rs: boolean = true;
|
||||
console.log(`searchCl [${searchCl}] [${defaultParams.searchCl}]`);
|
||||
console.log(`searchValue [${searchValue}] [${defaultParams.searchValue}]`);
|
||||
console.log(`serviceCode [${serviceCode}] [${defaultParams.serviceCode}]`);
|
||||
console.log(`alimCl [${alimCl}] [${defaultParams.alimCl}]`);
|
||||
console.log(`fromDate [${fromDate}] [${defaultParams.fromDate}]`);
|
||||
console.log(`toDate [${toDate}] [${defaultParams.toDate}]`);
|
||||
console.log(`sendType [${sendType}] [${defaultParams.sendType}]`);
|
||||
console.log(`sendCl [${sendCl}] [${defaultParams.sendCl}]`);
|
||||
|
||||
if(searchCl === defaultParams.searchCl
|
||||
&& searchValue === defaultParams.searchValue
|
||||
&& serviceCode === defaultParams.serviceCode
|
||||
&& alimCl === defaultParams.alimCl
|
||||
&& fromDate === defaultParams.fromDate
|
||||
&& toDate === defaultParams.toDate
|
||||
&& sendType === defaultParams.sendType
|
||||
&& sendCl === defaultParams.sendCl
|
||||
){
|
||||
rs = false;
|
||||
}
|
||||
setFilterUsed(rs);
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
callList();
|
||||
checkUsedFilter();
|
||||
}, [
|
||||
mid,
|
||||
searchCl,
|
||||
@@ -300,9 +337,11 @@ export const AlimtalkListPage = () => {
|
||||
};
|
||||
}, []);
|
||||
|
||||
/*
|
||||
if (!hasAccess) {
|
||||
return <AccessDeniedDialog />;
|
||||
}
|
||||
*/
|
||||
|
||||
return (
|
||||
<>
|
||||
@@ -327,6 +366,9 @@ export const AlimtalkListPage = () => {
|
||||
src={IMAGE_ROOT + '/ico_setting.svg'}
|
||||
alt="검색옵션"
|
||||
/>
|
||||
{ filterUsed &&
|
||||
<span className="notification-badge2"></span>
|
||||
}
|
||||
</button>
|
||||
</div>
|
||||
<button
|
||||
|
||||
Reference in New Issue
Block a user