Browse Source

修改文件下载的方式

sophieChenyx 5 years ago
parent
commit
4fca39e4fe

+ 5 - 5
src/routes/Dashboard/Accounts/AccountsCampus.js

@@ -27,11 +27,11 @@ export default class CampusAccountsPage extends Component {
   }
 
   handleDownloadOperation = () => {
-    window.open('/api/stmt/campus/export');
-    // this.props.dispatch({
-    //   type: 'accounts/fetchCampusExcel',
-    //   payload: 'download',
-    // })
+    //window.open('/api/stmt/campus/export');
+    this.props.dispatch({
+      type: 'accounts/fetchCampusExcel',
+      payload: 'download',
+    })
   };
   handleFilterOperation = (params, states) => {
     this.setState({

+ 4 - 4
src/routes/Dashboard/Accounts/index.js

@@ -8,14 +8,14 @@ export default class AccountsPage extends Component {
   handleTabChange = (key) => {
     const { dispatch, match } = this.props;
     switch (key) {
-      // 校区列表
-      case 'campus':
-        dispatch(routerRedux.push(`${match.url}/campus`));
-        break;
       // 终端课程包
       case 'terminals':
         dispatch(routerRedux.push(`${match.url}/terminals`));
         break;
+      // 校区列表
+      case 'campus':
+        dispatch(routerRedux.push(`${match.url}/campus`));
+        break;
       // 即将逾期
       case 'overdue':
         dispatch(routerRedux.push(`${match.url}/overdue`));