mid 셋팅및 코드 정리
This commit is contained in:
@@ -16,17 +16,20 @@ import { useExtensionSmsDownloadExcelMutation } from '@/entities/additional-serv
|
||||
import { SmsPaymentList } from '@/entities/additional-service/ui/sms-payment/sms-payment-list';
|
||||
import { SmsPaymentFilter } from '@/entities/additional-service/ui/sms-payment/sms-payment-filter';
|
||||
import { useExtensionSmsDetailMutation } from '@/entities/additional-service/api/sms-payment/use-extension-sms-detail-mutation';
|
||||
import { useStore } from '@/shared/model/store';
|
||||
|
||||
|
||||
export const SmsPaymentPage = () => {
|
||||
const { navigate } = useNavigate();
|
||||
const userMid = useStore.getState().UserStore.mid;
|
||||
|
||||
const [bottomSmsPaymentDetailResendOn, setBottomSmsPaymentDetailResendOn] = useState<boolean>(false)
|
||||
|
||||
const [sortBy, setSortBy] = useState<SortByKeys>(SortByKeys.New);
|
||||
const [listItems, setListItems] = useState({});
|
||||
const [pageParam, setPageParam] = useState(DEFAULT_PAGE_PARAM);
|
||||
const [filterOn, setFilterOn] = useState<boolean>(false);
|
||||
const [mid, setMid] = useState<string>('nictest00m');
|
||||
const [mid, setMid] = useState<string>(userMid);
|
||||
const [selectedTid, setSelectedTid] = useState<string>('');
|
||||
const [selectedMid, setSelectedMid] = useState<string>('');
|
||||
const [searchCl, setSearchCl] = useState<SmsPaymentSearchType>(SmsPaymentSearchType.BUYER_NAME)
|
||||
@@ -48,7 +51,7 @@ export const SmsPaymentPage = () => {
|
||||
sortBy?: string,
|
||||
val?: string
|
||||
}) => {
|
||||
pageParam.sortBy = (option?.sortBy) ? option.sortBy : sortBy;
|
||||
pageParam.sortBy = (option?.sortBy)? option.sortBy: sortBy;
|
||||
setPageParam(pageParam);
|
||||
|
||||
let listParams = {
|
||||
@@ -57,7 +60,7 @@ export const SmsPaymentPage = () => {
|
||||
searchValue: searchValue,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
smsCl: smsCl === SmsType.ALL ? '' : smsCl,
|
||||
smsCl: (smsCl === SmsType.ALL)? '' :smsCl,
|
||||
page: pageParam
|
||||
}
|
||||
|
||||
@@ -72,25 +75,25 @@ export const SmsPaymentPage = () => {
|
||||
for (let i = 0; i < content?.length; i++) {
|
||||
let paymentDate = content[i]?.paymentDate?.substring(0, 8);
|
||||
let groupDate = moment(paymentDate).format('YYYYMMDD');
|
||||
if (!!groupDate && !data.hasOwnProperty(groupDate)) {
|
||||
if(!!groupDate && !data.hasOwnProperty(groupDate)){
|
||||
data[groupDate] = [];
|
||||
}
|
||||
if (!!groupDate && data.hasOwnProperty(groupDate)) {
|
||||
if(!!groupDate && data.hasOwnProperty(groupDate)){
|
||||
data[groupDate].push(content[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
console.log('Data : ', data)
|
||||
console.log('Data : ', data);
|
||||
return data;
|
||||
};
|
||||
|
||||
const callDetail = (selectedMid: string, selectedTid: string) => {
|
||||
console.log("Selected Mid: ", selectedMid, "Selected Tid: ", selectedTid)
|
||||
console.log('Selected Mid: ', selectedMid, 'Selected Tid: ', selectedTid);
|
||||
detail({
|
||||
mid: selectedMid,
|
||||
tid: selectedTid
|
||||
}).then((rs) => {
|
||||
console.log('Detail info : ', rs)
|
||||
console.log('Detail info : ', rs);
|
||||
setSmsDetailData(rs);
|
||||
})
|
||||
}
|
||||
@@ -102,9 +105,9 @@ export const SmsPaymentPage = () => {
|
||||
searchValue: searchValue,
|
||||
fromDate: fromDate,
|
||||
toDate: toDate,
|
||||
smsCl: smsCl === SmsType.ALL ? '' : smsCl,
|
||||
smsCl: (smsCl === SmsType.ALL)? '': smsCl,
|
||||
}).then((rs) => {
|
||||
console.log('Excel Dowload Status : ' + rs.status)
|
||||
console.log('Excel Dowload Status : ' + rs.status);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -163,9 +166,9 @@ export const SmsPaymentPage = () => {
|
||||
</section>
|
||||
<div className="detail-divider"></div>
|
||||
<SmsPaymentList
|
||||
listItems={listItems}
|
||||
mid={mid}
|
||||
onResendClick={onClickToShowDetail}
|
||||
listItems={ listItems }
|
||||
mid={ mid }
|
||||
onResendClick={ onClickToShowDetail }
|
||||
></SmsPaymentList>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user