团计划默认搜索为确认状态

release
Jimmy Liow 2 years ago
parent bc63e50747
commit 347719f77d

@ -11,6 +11,7 @@ class Auth {
makeAutoObservable(this, { rootStore: false }); makeAutoObservable(this, { rootStore: false });
this.root = root; this.root = root;
this.login.token = root.getSession(KEY_LOGIN_TOKEN); this.login.token = root.getSession(KEY_LOGIN_TOKEN);
console.info('Auth()');
} }
valdateUserPassword(usr, pwd) { valdateUserPassword(usr, pwd) {

@ -10,7 +10,7 @@ class Reservation {
this.root = root; this.root = root;
} }
fetchReservationList(current) { fetchReservationList(current, status=null) {
const fromDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[0].format('YYYY-MM-DD'); const fromDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[0].format('YYYY-MM-DD');
const thruDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[1].format('YYYY-MM-DD'); const thruDate = this.arrivalDateRange.length == 0 ? null : this.arrivalDateRange[1].format('YYYY-MM-DD');
this.reservationPage.current = current; this.reservationPage.current = current;
@ -21,6 +21,7 @@ class Reservation {
.append('GroupNo', this.referenceNo) .append('GroupNo', this.referenceNo)
.append('DateStart', fromDate) .append('DateStart', fromDate)
.append('DateEnd', thruDate) .append('DateEnd', thruDate)
.append('NotConfirm', status)
.append('TotalNum', totalNum) .append('TotalNum', totalNum)
.append('PageSize', this.reservationPage.size) .append('PageSize', this.reservationPage.size)
.append('PageIndex', this.reservationPage.current) .append('PageIndex', this.reservationPage.current)

@ -102,8 +102,9 @@ function Newest() {
}); });
useEffect (() => { useEffect (() => {
if (location.search !== '?back') { if (location.search !== '?back') {
onSearchClick(); //
onSearchClick(1, 1);
} }
return () => { return () => {
console.info('unmount...'); console.info('unmount...');
@ -140,9 +141,10 @@ function Newest() {
setDataLoading(false); setDataLoading(false);
}; };
const onSearchClick = (current=1) => { //
const onSearchClick = (current=1, status=null) => {
setDataLoading(true); setDataLoading(true);
reservationStore.fetchReservationList(current) reservationStore.fetchReservationList(current, status)
.catch(ex => { .catch(ex => {
notification.error({ notification.error({
message: `Notification`, message: `Notification`,

Loading…
Cancel
Save