2 커밋

5개의 변경된 파일11440개의 추가작업 그리고 18596개의 파일을 삭제
통합 보기
  1. +11398
    -18588
      package-lock.json
  2. +6
    -1
      src/pages/GFMIS/SearchForm.js
  3. +28
    -1
      src/pages/Payment/Search_GLD/SearchForm.js
  4. +5
    -4
      src/utils/ComboData.js
  5. +3
    -2
      src/utils/HttpUtils.js

+ 11398
- 18588
package-lock.json
파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
파일 보기


+ 6
- 1
src/pages/GFMIS/SearchForm.js 파일 보기

@@ -46,6 +46,11 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria, onGr
setToDateValue(maxDate); setToDateValue(maxDate);
}, [maxDate]); }, [maxDate]);


const toPayMethodArray = (opt) => {
if (!opt || opt.type === 'all') return [];
return Array.isArray(opt.type) ? opt.type : [opt.type];
};

const onSubmit = () => { const onSubmit = () => {
let sentDateFrom = ""; let sentDateFrom = "";
let sentDateTo = ""; let sentDateTo = "";
@@ -63,7 +68,7 @@ const SearchPublicNoticeForm = ({ applySearch, generateXML, searchCriteria, onGr
dateFrom: sentDateFrom, dateFrom: sentDateFrom,
dateTo: sentDateTo, dateTo: sentDateTo,
paymentId: selectedIds.join(','), paymentId: selectedIds.join(','),
payMethod : (payMethod?.type && payMethod?.type != 'all') ? payMethod?.type : "",
payMethod : toPayMethodArray(payMethod),
// status : (status?.type && status?.type != 'all') ? status?.type : "", // status : (status?.type && status?.type != 'all') ? status?.type : "",
}; };
applySearch(temp); applySearch(temp);


+ 28
- 1
src/pages/Payment/Search_GLD/SearchForm.js 파일 보기

@@ -44,6 +44,26 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, onGridReady }) =>
} }
}, [searchCriteria]); }, [searchCriteria]);


React.useEffect(() => {
const defaultPayMethod = ComboData.payMethod[0];
const value = searchCriteria?.payMethod; // may be [], null, undefined, or array of strings

if (!value || value.length === 0) {
setPayMethod(defaultPayMethod);
return;
}

// Find the matching entry whose type array matches value contents
const found = ComboData.payMethod.find(item =>
Array.isArray(item.type) &&
item.type.length === value.length &&
item.type.every((v, i) => v === value[i]) // strict positional match
);

setPayMethod(found ?? defaultPayMethod);
}, [searchCriteria?.payMethod]);


React.useEffect(() => { React.useEffect(() => {
setFromDateValue(minDate); setFromDateValue(minDate);
}, [minDate]); }, [minDate]);
@@ -52,6 +72,13 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, onGridReady }) =>
setToDateValue(maxDate); setToDateValue(maxDate);
}, [maxDate]); }, [maxDate]);


// add near the top inside the component (after useState for payMethod)
const toPayMethodArray = (opt) => {
if (!opt || opt.type === 'all') return [];
return Array.isArray(opt.type) ? opt.type : [opt.type];
};


const onSubmit = (data) => { const onSubmit = (data) => {
let sentDateFrom = ""; let sentDateFrom = "";
let sentDateTo = ""; let sentDateTo = "";
@@ -67,7 +94,7 @@ const SearchPublicNoticeForm = ({ applySearch, searchCriteria, onGridReady }) =>
dateFrom: sentDateFrom, dateFrom: sentDateFrom,
dateTo: sentDateTo, dateTo: sentDateTo,
status : (status?.type && status?.type != 'all') ? status?.type : "", status : (status?.type && status?.type != 'all') ? status?.type : "",
payMethod : (payMethod?.type && payMethod?.type != 'all') ? payMethod?.type : "",
payMethod : toPayMethodArray(payMethod),
start:0, start:0,
limit:10 limit:10
}; };


+ 5
- 4
src/utils/ComboData.js 파일 보기

@@ -143,10 +143,11 @@ export const paymentStatus = [


export const payMethod = [ export const payMethod = [
{ key: 0, labelCht: '全部', label: 'All', type: 'all' }, { key: 0, labelCht: '全部', label: 'All', type: 'all' },
{ key: 1, labelCht: '繳費靈', label: 'PPS', type: '01,PPSB,PPS' },
{ key: 2, labelCht: '信用卡', label:'Credit Card', type: '02,BCMP,CreditCard' },
{ key: 3, labelCht: '銀聯', label:'UnionPay', type: '03,BCMP,CreditCard' },
{ key: 4, labelCht: '轉數快', label:'FPS', type: '04,BCFP,FPS' },
{ key: 1, labelCht: '繳費靈', label: 'PPS', type: ['01,PPSB,PPS'] },
{ key: 2, labelCht: '信用卡', label:'Credit Card', type: ['02,BCMP,CreditCard','03,BCMP,CreditCard'] },
{ key: 3, labelCht: '轉數快', label:'FPS', type: ['04,BCFP,FPS'] },
// { key: 3, labelCht: '銀聯', label:'UnionPay', type: '03,BCMP,CreditCard' },
// { key: 4, labelCht: '轉數快', label:'FPS', type: '04,BCFP,FPS' },
]; ];


export const paymentMeans= [ export const paymentMeans= [


+ 3
- 2
src/utils/HttpUtils.js 파일 보기

@@ -1,13 +1,14 @@
import axios from "axios"; import axios from "axios";
import { FILE_UP_POST, FILE_DOWN_GET } from "../utils/ApiPathConst"; import { FILE_UP_POST, FILE_DOWN_GET } from "../utils/ApiPathConst";
import qs from 'qs';


export const get = ({ url, params, onSuccess, onFail, onError }) => { export const get = ({ url, params, onSuccess, onFail, onError }) => {
axios.get(url, { axios.get(url, {
params: params
params,
paramsSerializer: (p) => qs.stringify(p, { arrayFormat: 'repeat' }) // <-- FIX
}).then( }).then(
(response) => { onResponse(response, onSuccess, onFail); } (response) => { onResponse(response, onSuccess, onFail); }
).catch((error) => { ).catch((error) => {
// console.log(error);
return handleError(error, onError); return handleError(error, onError);
}); });
}; };


불러오는 중...
취소
저장