|
@@ -2,9 +2,11 @@ import React, { useState, useEffect } from 'react'
|
2
|
2
|
import { Select, Spin, Table, Button, Form, Input, Divider, Modal,Popconfirm } from 'antd'
|
3
|
3
|
import NavLink from 'umi/navlink'
|
4
|
4
|
import { fetch, apis, fetchList } from '@/utils/request'
|
|
5
|
+import { exportExcel } from '@/utils/utils'
|
5
|
6
|
import IntegralRecord from '../customerlist/components/integralRecord'
|
6
|
7
|
|
7
|
8
|
const getPersonList = fetchList(apis.person.getPersonList)
|
|
9
|
+const exportPersonList = fetch(apis.person.export)
|
8
|
10
|
|
9
|
11
|
const Condition = Form.create()(props => {
|
10
|
12
|
const handleSubmit = e => {
|
|
@@ -81,6 +83,12 @@ export default props => {
|
81
|
83
|
})
|
82
|
84
|
}
|
83
|
85
|
|
|
86
|
+ const handleExport = () => {
|
|
87
|
+ exportPersonList({params: queryParams}).then(res => {
|
|
88
|
+ exportExcel(res, '会员列表')
|
|
89
|
+ })
|
|
90
|
+ }
|
|
91
|
+
|
84
|
92
|
useEffect(() => {
|
85
|
93
|
setLoading(true)
|
86
|
94
|
getPersonList(queryParams).then(res => {
|
|
@@ -94,7 +102,7 @@ export default props => {
|
94
|
102
|
return (
|
95
|
103
|
<div>
|
96
|
104
|
<Condition onSearch={handleSearch} onReset={handleSearch} />
|
97
|
|
- <div style={{margin: '24px 0'}}> </div>
|
|
105
|
+ <div style={{margin: '24px 0'}}><Button type="" onClick={handleExport}>导出</Button></div>
|
98
|
106
|
<Table dataSource={listData} loading={loading} pagination={{...pagination, onChange: handlePageChange}} rowKey="personId">
|
99
|
107
|
<Table.Column
|
100
|
108
|
title="头像"
|