componentWillMount() { var newPaging = Object.assign({}, this.state.paging, store.paging); if (JSON.stringify(toJS(store.coursePrefSearchData)) !== '{}') { this.setState( { isInitValue: true, paging: newPaging, searchData: toJS(store.coursePrefSearchData), }, () => { this.onSearch(this.state.searchData, this.state.paging); store.coursePrefSearchData = {}; } ); } }
// 保留搜索条件(课程偏好) @observable coursePrefSearchData = {}; @observable paging = {}; @action saveSearchData = (data,paging) => { runInAction(() => { this.coursePrefSearchData = Object.assign({}, this.coursePrefSearchData, data); this.paging=Object.assign({},this.paging,paging) }); };