魏熙美 před 5 roky
rodič
revize
35581e1ab2

+ 1
- 1
config/config.js Zobrazit soubor

512
 
512
 
513
   proxy: {
513
   proxy: {
514
     '/api/': {
514
     '/api/': {
515
-      target: 'http://192.168.0.11:8080/',
515
+      target: 'http://localhost:8080/',
516
       changeOrigin: true,
516
       changeOrigin: true,
517
       // pathRewrite: { '^/server': '' },
517
       // pathRewrite: { '^/server': '' },
518
     },
518
     },

+ 32
- 0
src/pages/customer/recommendCustomer/index.jsx Zobrazit soubor

6
 import Styles from './style.less';
6
 import Styles from './style.less';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
9
+import axios from 'umi-request';
9
 
10
 
10
 
11
 
11
 const { Option } = Select;
12
 const { Option } = Select;
77
     })
78
     })
78
   }
79
   }
79
 
80
 
81
+  /**
82
+   *导出数据(推荐用户)
83
+   *
84
+   */
85
+  function exportRecommendCustomer() {
86
+    axios(apis.customer.customerRecommendRecommenderExport.url, {
87
+      ...apis.customer.customerRecommendRecommenderExport, responseType: 'blob',
88
+    }).then(response => {
89
+      // console.log('response: ', response)
90
+      download(response)
91
+    }).catch(error => {
92
+
93
+    })
94
+  }
95
+
96
+  function download(data) {
97
+    if (!data) {
98
+      return
99
+    }
100
+    const url = window.URL.createObjectURL(new Blob([data]))
101
+    const link = document.createElement('a')
102
+    link.style.display = 'none'
103
+    link.href = url
104
+    link.setAttribute('download', '推荐客户.xlsx')
105
+    document.body.append(link)
106
+    link.click()
107
+  }
108
+
80
   const columns = [
109
   const columns = [
81
     {
110
     {
82
       title: '头像',
111
       title: '头像',
184
             </Button>
213
             </Button>
185
         </Form.Item>
214
         </Form.Item>
186
       </Form>
215
       </Form>
216
+      <Button type="primary" onClick={() => exportRecommendCustomer()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
217
+        导出数据
218
+      </Button>
187
 
219
 
188
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
220
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
189
     </>
221
     </>

+ 5
- 0
src/services/apis.js Zobrazit soubor

186
       url: `${prefix}/customer/recommend/get/id`,
186
       url: `${prefix}/customer/recommend/get/id`,
187
       action: 'admin.customer.recommend.get.id.get',
187
       action: 'admin.customer.recommend.get.id.get',
188
     },
188
     },
189
+    customerRecommendRecommenderExport: { // 导出数据(推荐客户)
190
+      method: 'GET',
191
+      url: `${prefix}/customer/recommend/recommender/export`,
192
+      action: 'admin.customer.recommend.recommender.export.get',
193
+    },
189
   },
194
   },
190
   indexEcharts: {
195
   indexEcharts: {
191
     userResource: {
196
     userResource: {