Browse Source

Merge branch 'master' of http://git.ycjcjy.com/zhiyuxing/estateagents-admin-manager

许静 5 years ago
parent
commit
9b6ca151ce

+ 5
- 386
config/config.js View File

@@ -2,6 +2,9 @@ import defaultSettings from './defaultSettings'; // https://umijs.org/config/
2 2
 
3 3
 import slash from 'slash2';
4 4
 import webpackPlugin from './plugin.config';
5
+import routes from './routes';
6
+import proxy from './proxy';
7
+
5 8
 const { pwa, primaryColor } = defaultSettings; // preview.pro.ant.design only do not use in your production ;
6 9
 // preview.pro.ant.design 专用环境变量,请不要在你的项目中使用它。
7 10
 
@@ -82,385 +85,7 @@ export default {
82 85
   },
83 86
   devtool: isAntDesignProPreview ? 'source-map' : false,
84 87
   // umi routes: https://umijs.org/zh/guide/router.html
85
-  routes: [
86
-    {
87
-      path: '/user',
88
-      component: '../layouts/UserLayout',
89
-      routes: [
90
-        {
91
-          name: 'login',
92
-          path: '/user/login',
93
-          component: './user/login',
94
-        },
95
-      ],
96
-    },
97
-    {
98
-      path: '/',
99
-      component: '../layouts/SecurityLayout',
100
-      routes: [
101
-        {
102
-          path: '/',
103
-          component: '../layouts/BasicLayout',
104
-          authority: ['admin', 'user'],
105
-          routes: [
106
-            {
107
-              path: '/',
108
-              redirect: '/welcome',
109
-            },
110
-            {
111
-              path: '/welcome',
112
-              name: '首页',
113
-              component: './Welcome',
114
-            },
115
-            {
116
-              path: '/building',
117
-              name: '项目管理',
118
-              component: '../layouts/BlankLayout',
119
-              routes: [
120
-                {
121
-                  path: '/building/list',
122
-                  name: '项目列表',
123
-                  component: './building/list/index',
124
-                },
125
-                {
126
-                  path: '/building/list/add',
127
-                  name: '项目添加', // 项目添加
128
-                  hideInMenu: true,
129
-                  component: './building/list/add/index',
130
-                },
131
-                {
132
-                  path: '/building/type',
133
-                  name: '项目类型',
134
-                  component: './building/type/index',
135
-                },
136
-                {
137
-                  path: '/building/type/edi',
138
-                  name: '项目类型编辑',
139
-                  hideInMenu: true,
140
-                  component: './building/type/edi',
141
-                },
142
-              ],
143
-            },
144
-            {
145
-              path: '/customer',
146
-              name: '客户管理',
147
-              component: '../layouts/BlankLayout',
148
-              routes: [
149
-                {
150
-                  path: '/customer/customerlist/list',
151
-                  name: '客户列表',
152
-                  component: './customer/customerlist/index',
153
-                },
154
-                {
155
-                  path: '/customer/customerlist/customerDetail',
156
-                  name: '客户编辑',
157
-                  hideInMenu: true,
158
-                  component: './customer/customerlist/customerDetail',
159
-                },
160
-                {
161
-                  path: '/customer/drift/list',
162
-                  name: '游客列表',
163
-                  component: './customer/drift/index',
164
-                },
165
-                {
166
-                  path: '/customer/report/list',
167
-                  name: '报备客户',
168
-                  component: './customer/report/index',
169
-                },
170
-                {
171
-                  path: '/customer/recommendCustomer/list',
172
-                  name: '推荐客户',
173
-                  component: './customer/recommendCustomer/index',
174
-                },
175
-                {
176
-                  path: '/customer/recommendCustomer/audit',
177
-                  name: '客户审核', 
178
-                  hideInMenu: true,
179
-                  component: './customer/recommendCustomer/audit',
180
-                },
181
-                {
182
-                  path: '/customer/independentList',
183
-                  name: '经纪人',
184
-                  component: './customer/independentList/index',
185
-                },
186
-              ],
187
-            },
188
-            {
189
-              path: '/integralMall',
190
-              name: '积分商城',
191
-              component: '../layouts/BlankLayout',
192
-              routes: [
193
-                {
194
-                  path: '/integralMall/GoodsList',
195
-                  name: '商品列表',
196
-                  component: './integralMall/GoodsList',
197
-                },
198
-                {
199
-                  path: '/integralMall/achieve',
200
-                  name: '积分获取',
201
-                  component: './integralMall/achieve',
202
-                },
203
-                {
204
-                  path: '/integralMall/editGoods',
205
-                  name: '商品编辑',
206
-                  hideInMenu: true,
207
-                  component: './integralMall/editGoods',
208
-                },
209
-                {
210
-                  path: '/integralMall/exchangeRecords',
211
-                  name: '兑换记录',
212
-                  component: './integralMall/exchangeRecords',
213
-                },
214
-                {
215
-                  path: '/integralMall/writeOff',
216
-                  name: '商品核销',
217
-                  component: './integralMall/writeOff',
218
-                },
219
-                {
220
-                  path: '/integralMall/verifyList',
221
-                  name: '商品核销列表',
222
-                  hideInMenu: true,
223
-                  component: './integralMall/verifyList',
224
-                },
225
-              ],
226
-            },
227
-            {
228
-              path: '/channel',
229
-              name: '渠道管理',
230
-              component: '../layouts/BlankLayout',
231
-              routes: [
232
-                {
233
-                  path: '/channel/channelList',
234
-                  name: '渠道管理',
235
-                  component: './channel/channelList',
236
-                },
237
-                {
238
-                  path: '/channel/addChannel',
239
-                  name: '添加渠道',
240
-                  hideInMenu: true,
241
-                  component: './channel/addChannel',
242
-                },
243
-                {
244
-                  path: '/channel/editChannel',
245
-                  name: '编辑渠道',
246
-                  hideInMenu: true,
247
-                  component: './channel/editChannel',
248
-                },
249
-                {
250
-                  path: '/channel/brokerList',
251
-                  name: '经纪人',
252
-                  component: './channel/brokerList',
253
-                },
254
-                {
255
-                  path: '/channel/recommendClients',
256
-                  name: '渠道推荐',
257
-                  hideInMenu: true,
258
-                  component: './channel/recommendClients',
259
-                },
260
-                {
261
-                  path: '/channel/InviteClients',
262
-                  name: '邀请客户',
263
-                  hideInMenu: true,
264
-                  component: './channel/InviteClients',
265
-                },
266
-              ],
267
-            },
268
-            {
269
-              path: '/news',
270
-              name: '资讯管理',
271
-              component: '../layouts/BlankLayout',
272
-              routes: [
273
-                {
274
-                  path: '/news/type/NewsType',
275
-                  name: '资讯类型',
276
-                  component: './news/type/NewsType',
277
-                },
278
-                {
279
-                  path: '/news/type/editNews',
280
-                  name: '编辑资讯类型',
281
-                  hideInMenu: true,
282
-                  component: './news/type/editNews',
283
-                },
284
-                {
285
-                  path: '/news/list/NewsList',
286
-                  name: '资讯列表',
287
-                  component: './news/list/NewsList',
288
-                },
289
-                {
290
-                  path: '/news/list/editNewsList',
291
-                  name: '编辑资讯',
292
-                  hideInMenu: true,
293
-                  component: './news/list/editNewsList',
294
-                },
295
-              ],
296
-            },
297
-            {
298
-              path: '/activity',
299
-              name: '活动管理',
300
-              component: '../layouts/BlankLayout',
301
-              routes: [
302
-                {
303
-                  path: '/activity/ActivityList',
304
-                  name: '活动列表',
305
-                  component: './activity/ActivityList',
306
-                },
307
-                {
308
-                  path: '/activity/editActivity',
309
-                  name: '编辑活动',
310
-                  hideInMenu: true,
311
-                  component: './activity/editActivity',
312
-                },
313
-                {
314
-                  path: '/activity/SignList',
315
-                  name: '报名列表',
316
-                  hideInMenu: true,
317
-                  component: './activity/SignList',
318
-                },
319
-              ],
320
-            },
321
-            {
322
-              path: '/staff',
323
-              name: '员工管理',
324
-              component: '../layouts/BlankLayout',
325
-              routes: [
326
-                {
327
-                  path: '/staff/StaffList',
328
-                  name: '员工列表',
329
-                  component: './staff/list/StaffList',
330
-                },
331
-                {
332
-                  path: '/staff/editStaff',
333
-                  name: '编辑员工',
334
-                  hideInMenu: true,
335
-                  component: './staff/list/editStaff',
336
-                },
337
-
338
-                {
339
-                  path: '/staff/RoleList',
340
-                  name: '角色管理',
341
-                  component: './staff/list/RoleList',
342
-                },
343
-                {
344
-                  path: '/staff/editRole',
345
-                  name: '编辑角色',
346
-                  hideInMenu: true,
347
-                  component: './staff/list/editRole',
348
-                },
349
-                {
350
-                  path: '/staff/list/addRole',
351
-                  name: '添加角色',
352
-                  hideInMenu: true,
353
-                  component: './staff/list/addRole',
354
-                },  
355
-              ],
356
-            },
357
-            {
358
-              path: '/carouselFigure',
359
-              name: '轮播图管理',
360
-              component: '../layouts/BlankLayout',
361
-              routes: [
362
-                {
363
-                  path: '/carouselFigure/carouselFigureList',
364
-                  name: '轮播图列表',
365
-                  component: './carouselFigure/carouselFigureList',
366
-                },
367
-                {
368
-                  path: '/carouselFigure/editCarousel',
369
-                  name: '轮播图编辑',
370
-                  hideInMenu: true,
371
-                  component: './carouselFigure/editCarousel',
372
-                },
373
-                {
374
-                  path: '/carouselFigure/advertisingList',
375
-                  name: '开屏广告',
376
-                  component: './carouselFigure/advertisingList',
377
-                },
378
-                {
379
-                  path: '/carouselFigure/editAdvertising',
380
-                  name: '开屏广告编辑',
381
-                  hideInMenu: true,
382
-                  component: './carouselFigure/editAdvertising',
383
-                },
384
-              ],
385
-            },
386
-            {
387
-              path: '/system',
388
-              name: '系统管理',
389
-              component: '../layouts/BlankLayout',
390
-              routes: [
391
-                {
392
-                  path: '/system/messageList',
393
-                  name: '客户留言',
394
-                  component: './system/messageList',
395
-                },
396
-                {
397
-                  path: '/system/report',
398
-                  name: '报表数据',
399
-                  component: './system/report',
400
-                },
401
-                {
402
-                  path: '/system/intention',
403
-                  name: '意向值',
404
-                  component: './system/intention',
405
-                },
406
-                {
407
-                  path: '/system/housingPolicy',
408
-                  name: '购房政策维护',
409
-                  component: './system/housingPolicy',
410
-                },
411
-                {
412
-                  path: '/system/editPolicy',
413
-                  name: '购房政策编辑',
414
-                  hideInMenu: true,
415
-                  component: './system/editPolicy',
416
-                },
417
-              ],
418
-            },
419
-            {
420
-              path: '/indexEcharts',
421
-              name: '首页报表',
422
-              component: '../layouts/SecurityLayout',
423
-              hideInMenu: true,
424
-              routes: [
425
-                {
426
-                  path: '/indexEcharts/index',
427
-                  name: '报表',
428
-                  component: './indexEcharts/index',
429
-                },
430
-                {
431
-                  path: '/indexEcharts/userSource',
432
-                  name: '用户来源',
433
-                  component: './indexEcharts/userSource',
434
-                },
435
-                {
436
-                  path: '/indexEcharts/userBehavior',
437
-                  name: '用户行为',
438
-                  component: './indexEcharts/userBehavior',
439
-                },
440
-                {
441
-                  path: '/indexEcharts/newUsers',
442
-                  name: '新增用户',
443
-                  component: './indexEcharts/newUsers',
444
-                },
445
-                
446
-              ],
447
-            },
448
-          
449
-            
450
-            {
451
-              component: './404',
452
-            },
453
-          ],
454
-        },
455
-        {
456
-          component: './404',
457
-        },
458
-      ],
459
-    },
460
-    {
461
-      component: './404',
462
-    },
463
-  ],
88
+  routes,
464 89
   // Theme for antd: https://ant.design/docs/react/customize-theme-cn
465 90
   theme: {
466 91
     'primary-color': primaryColor,
@@ -508,11 +133,5 @@ export default {
508 133
   },
509 134
   chainWebpack: webpackPlugin,
510 135
 
511
-  proxy: {
512
-    '/api/': {
513
-      target: 'http://192.168.0.84:8080/',
514
-      changeOrigin: true,
515
-      // pathRewrite: { '^/server': '' },
516
-    },
517
-  },
136
+  proxy,
518 137
 };

+ 20
- 1
src/pages/customer/independentList/index.jsx View File

@@ -332,6 +332,23 @@ function body(props) {
332 332
     })
333 333
   }
334 334
 
335
+  function exportIndependen() {
336
+
337
+  }
338
+
339
+  function download(data) {
340
+    if (!data) {
341
+      return
342
+    }
343
+    const url = window.URL.createObjectURL(new Blob([data]))
344
+    const link = document.createElement('a')
345
+    link.style.display = 'none'
346
+    link.href = url
347
+    link.setAttribute('download', '经纪人.xlsx')
348
+    document.body.append(link)
349
+    link.click()
350
+  }
351
+
335 352
   const columns = [
336 353
     {
337 354
       title: '头像',
@@ -415,7 +432,9 @@ function body(props) {
415 432
             </Button>
416 433
         </Form.Item>
417 434
       </Form>
418
-
435
+      <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
436
+        导出数据
437
+      </Button>
419 438
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
420 439
             {/* 调整归属 */}
421 440
         <ModalTable visibleData={gVisibleData} />

+ 4
- 5
src/pages/customer/recommendCustomer/index.jsx View File

@@ -6,7 +6,6 @@ import apis from '../../../services/apis';
6 6
 import Styles from './style.less';
7 7
 import { router } from 'umi';
8 8
 import AuthButton from '@/components/AuthButton';
9
-import axios from 'umi-request';
10 9
 
11 10
 
12 11
 const { Option } = Select;
@@ -83,8 +82,9 @@ function body(props) {
83 82
    *
84 83
    */
85 84
   function exportRecommendCustomer() {
86
-    axios(apis.customer.customerRecommendRecommenderExport.url, {
87
-      ...apis.customer.customerRecommendRecommenderExport, responseType: 'blob',
85
+    request({
86
+      ...apis.customer.customerRecommendRecommenderExport, 
87
+      responseType: 'blob',
88 88
     }).then(response => {
89 89
       // console.log('response: ', response)
90 90
       download(response)
@@ -213,10 +213,9 @@ function body(props) {
213 213
             </Button>
214 214
         </Form.Item>
215 215
       </Form>
216
-      <Button type="primary" onClick={() => exportRecommendCustomer()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
216
+      <Button type="primary" onClick={() => exportRecommendCustomer()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
217 217
         导出数据
218 218
       </Button>
219
-
220 219
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
221 220
     </>
222 221
   );

+ 20
- 0
src/pages/customer/report/index.jsx View File

@@ -70,6 +70,23 @@ function body(props) {
70 70
       getList({ pageNumber: pageNum, pageSize: 9 })
71 71
   }
72 72
 
73
+  function exportReport() {
74
+
75
+  }
76
+
77
+  function download(data) {
78
+    if (!data) {
79
+      return
80
+    }
81
+    const url = window.URL.createObjectURL(new Blob([data]))
82
+    const link = document.createElement('a')
83
+    link.style.display = 'none'
84
+    link.href = url
85
+    link.setAttribute('download', '报备客户.xlsx')
86
+    document.body.append(link)
87
+    link.click()
88
+  }
89
+
73 90
   const columns = [
74 91
     {
75 92
       title: '头像',
@@ -159,6 +176,9 @@ function body(props) {
159 176
             </Button>
160 177
         </Form.Item>
161 178
       </Form>
179
+      <Button type="primary" onClick={() => exportReport()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
180
+        导出数据
181
+      </Button>
162 182
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
163 183
     </>
164 184
   );

+ 2
- 0
src/pages/staff/list/addRole.jsx View File

@@ -131,7 +131,9 @@ const Poster = props => {
131 131
   }
132 132
 
133 133
   function updateAuthMenu(data) {
134
+    setLoading(true)
134 135
     request({ ...apis.role.updateAuthMenu, data: { ...data } }).then((data) => {
136
+      setLoading(false)
135 137
       toRoleList()
136 138
   }).catch((err) => {
137 139
       console.log(err)

+ 2
- 0
src/utils/request.js View File

@@ -75,6 +75,8 @@ request.interceptors.response.use(async (response, options) => {
75 75
       });
76 76
       throw new Error(response.statusText);
77 77
     } else {
78
+      console.log('response: ', response)
79
+      console.log('response.headers: ', response.headers)
78 80
       const { code, data, message } = await response.clone().json();
79 81
       if (code != 1000) {
80 82
         notification.error({