|
@@ -32,12 +32,36 @@ export default class TerminalProfile extends Component {
|
|
|
this.props.dispatch({ type: 'terminalDetail/hideModal' });
|
|
|
}
|
|
|
|
|
|
- handleCampusModalSearch = () => {
|
|
|
-
|
|
|
+ handleCampusModalSearch = (data) => {
|
|
|
+ const newData = { ...data };
|
|
|
+ if (newData.keyword) {
|
|
|
+ newData[newData.field] = newData.keyword;
|
|
|
+ }
|
|
|
+ delete newData.field;
|
|
|
+ delete newData.keyword;
|
|
|
+ this.props.dispatch({
|
|
|
+ type: 'campus/query',
|
|
|
+ payload: { ...newData, pageNo: 1, pageSize },
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
- handleCampusModalTableChange = () => {
|
|
|
-
|
|
|
+ handleCampusModalTableChange = (pagination, filterArgs, filters) => {
|
|
|
+ const newFilters = { ...filters };
|
|
|
+ if (newFilters.keyword) {
|
|
|
+ newFilters[newFilters.field] = newFilters.keyword;
|
|
|
+ }
|
|
|
+ delete newFilters.field;
|
|
|
+ delete newFilters.keyword;
|
|
|
+ const getValue = obj => Object.keys(obj).map(key => obj[key]).join(',');
|
|
|
+ const tableFilters = Object.keys(filterArgs).reduce((obj, key) => {
|
|
|
+ const newObj = { ...obj };
|
|
|
+ newObj[key] = getValue(filterArgs[key]);
|
|
|
+ return newObj;
|
|
|
+ }, {});
|
|
|
+
|
|
|
+ const data = { ...newFilters, ...tableFilters, pageNo: pagination.current, pageSize: pagination.pageSize };
|
|
|
+ Object.keys(data).map(key => (data[key] ? null : delete data[key]));
|
|
|
+ this.props.dispatch({ type: 'campus/query', payload: data });
|
|
|
}
|
|
|
|
|
|
handlePageCancel = () => {
|
|
@@ -175,7 +199,6 @@ export default class TerminalProfile extends Component {
|
|
|
<CampusSelectModal
|
|
|
rowKeyName="id"
|
|
|
modalVisible={modalShow}
|
|
|
- style={{ top: 20 }}
|
|
|
width={600}
|
|
|
onOk={this.handleCampusModalOk}
|
|
|
onCancel={this.handleCampusModalCancel}
|