import * as http from './http';
tableExport = () => {
http.tableExport(this.state.params);
}
// render中
<a className='export-btn' onClick={this.tableExport}>导出当前表</a>
// http.js
import httpServer from '../../crm-assets/js/httpServer';
// 导出
export const tableExport = async (params)=> {
let paramsStr = '';
if(Object.keys(params).length > 0) {
paramsStr = '?'+Object.keys(params).map(key => key + '=' + params[key]).join('&')
}
window.location.href = `${window.location.protocol}/rest/${httpServer.tableExport}${paramsStr}`;
};