许静 5 年前
父节点
当前提交
92ffbfb22a

+ 40
- 56
src/pages/Welcome.jsx 查看文件

1
-import React, { useEffect, useState } from 'react';
1
+import React, { Component, useState, useEffect } from 'react';
2
 import { Card, Typography, Alert, Row, Col } from 'antd';
2
 import { Card, Typography, Alert, Row, Col } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import EchartsTest from '../components/EchartsTest';
4
 import EchartsTest from '../components/EchartsTest';
5
 import IndexEcharts from './indexEcharts/index';
5
 import IndexEcharts from './indexEcharts/index';
6
 import router from 'umi/router';
6
 import router from 'umi/router';
7
+import request from '../utils/request';
7
 import apis from '../services/apis';
8
 import apis from '../services/apis';
8
-import request from '../utils/request'
9
-const Welcome = (props) => {
10
 
9
 
11
-  const option = {
12
-    xAxis: {
13
-      type: 'category',
14
-      data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
15
-    },
16
-    yAxis: {
17
-      type: 'value'
18
-    },
19
-    series: [{
20
-      data: [820, 932, 901, 934, 1290, 1330, 1320],
21
-      type: 'line'
22
-    }]
23
-  };
10
+const welcome = (props) => {
11
+
12
+  const [data, setData] = useState([])
13
+
24
   useEffect(() => {
14
   useEffect(() => {
25
-    echratsInfo();
15
+    getIndexEcharts()
26
   }, [])
16
   }, [])
27
-  const [data, setData] = useState({ records: [] })
28
-  function echratsInfo(params) {
17
+
18
+  function getIndexEcharts(params) {
29
     request({
19
     request({
30
       ...apis.indexEcharts.list,
20
       ...apis.indexEcharts.list,
31
-      params,
21
+      params
32
     }).then((data) => {
22
     }).then((data) => {
33
       setData(data)
23
       setData(data)
34
-      console.log(data, "666666666666666666666666666666")
35
-
24
+      console.log(data, '11111')
36
     })
25
     })
37
   }
26
   }
38
-
39
   return (
27
   return (
40
-    <>
41
-      <div style={{ display: 'flex', marginBottom: '33px' }}>
42
-        <div style={{
43
-          textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
44
-          boxShadow: '0px  0.11rem 14px -15px rgba(241,43,62,1)',
45
-          borderRadius: '12px', width: '32%', marginRight: '2%'
46
-        }}>
47
-          <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
48
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
49
-        </div>
50
-        <div style={{
51
-          textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
52
-          boxShadow: '0px  0.11rem 14px -15px rgba(255,126,74,1)',
53
-          borderRadius: '12px', width: '32%', marginRight: '2%'
54
-        }}>
55
-          <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
56
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
57
-        </div>
58
-        <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
59
-          textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
60
-          boxShadow: '0px  0.11rem 14px -15px rgba(107,130,230,1)',
61
-          borderRadius: '12px', width: '32%',
62
-        }}>
63
-          <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0' }}>最近7天新增 </span>
64
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
65
-        </div>
66
-      </div>
67
-      <IndexEcharts style={{ width: '100%' }}></IndexEcharts>
68
 
28
 
69
-      {/* <EchartsTest style={{ width: 500, height: 500 }}></EchartsTest> */}
70
-
71
-    </>
29
+    <div style={{ display: 'flex', marginBottom: '33px' }}>
30
+      <div style={{
31
+        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
32
+        boxShadow: '0px  0.11rem 14px -15px rgba(241,43,62,1)',
33
+        borderRadius: '12px', width: '32%', marginRight: '2%'
34
+      }}>
35
+        <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
36
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
37
+      </div>
38
+      <div style={{
39
+        textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
40
+        boxShadow: '0px  0.11rem 14px -15px rgba(255,126,74,1)',
41
+        borderRadius: '12px', width: '32%', marginRight: '2%'
42
+      }}>
43
+        <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
44
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
45
+      </div>
46
+      <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
47
+        textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
48
+        boxShadow: '0px  0.11rem 14px -15px rgba(107,130,230,1)',
49
+        borderRadius: '12px', width: '32%',
50
+      }}>
51
+        <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0' }}>最近7天新增 </span>
52
+        <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
53
+      </div>
54
+      <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} ></IndexEcharts>
55
+    </div>
72
   )
56
   )
73
-}
74
-export default Welcome;
75
 
57
 
58
+}
59
+export default welcome
76
 
60
 

+ 1
- 1
src/pages/building/list/add/components/base.jsx 查看文件

188
               <TagGroup />,
188
               <TagGroup />,
189
             )}
189
             )}
190
           </Form.Item>
190
           </Form.Item>
191
-          <Form.Item label="周边交通" hasFeedback>
191
+          <Form.Item label="周边商业" hasFeedback>
192
             {getFieldDecorator('buildingMall')(
192
             {getFieldDecorator('buildingMall')(
193
               <TagGroup />,
193
               <TagGroup />,
194
             )}
194
             )}

+ 11
- 0
src/pages/building/list/index.jsx 查看文件

228
     router.push({ pathname: '/building/list/add' })
228
     router.push({ pathname: '/building/list/add' })
229
   }
229
   }
230
 
230
 
231
+  /**
232
+   * 重置搜索
233
+   */
234
+  function handleReset() {
235
+    props.form.resetFields();
236
+  }
237
+
238
+
231
   return (
239
   return (
232
     <>
240
     <>
233
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
241
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
285
             <Button type="primary" htmlType="submit">
293
             <Button type="primary" htmlType="submit">
286
               搜索
294
               搜索
287
             </Button>
295
             </Button>
296
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
297
+              重置
298
+            </Button>
288
         </Form.Item>
299
         </Form.Item>
289
       </Form>
300
       </Form>
290
 
301
 

+ 11
- 17
src/pages/building/type/index.jsx 查看文件

6
 import request from '../../../utils/request';
6
 import request from '../../../utils/request';
7
 import apis from '../../../services/apis';
7
 import apis from '../../../services/apis';
8
 import AuthButton from '@/components/AuthButton';
8
 import AuthButton from '@/components/AuthButton';
9
+import { debuglog } from 'util';
9
 
10
 
10
 function body() {
11
 function body() {
11
   // eslint-disable-next-line react-hooks/rules-of-hooks
12
   // eslint-disable-next-line react-hooks/rules-of-hooks
51
     getList({ pageNum: 1, pageSize: 10 })
52
     getList({ pageNum: 1, pageSize: 10 })
52
   }, [])
53
   }, [])
53
 
54
 
54
-  function getList(params) {
55
-    request({ ...apis.buildingType.getList, params: { ...params } }).then(res => {
56
-      setData(res)
57
-    }).catch(err => {
58
-      // eslint-disable-next-line no-unused-expressions
59
-      <Alert
60
-        style={{
61
-          marginBottom: 24,
62
-        }}
63
-        message={err}
64
-        type="error"
65
-        showIcon
66
-      />
67
-    })
68
-  }
69
-
70
   const openNotificationWithIcon = (type, message) => {
55
   const openNotificationWithIcon = (type, message) => {
71
     notification[type]({
56
     notification[type]({
72
       message,
57
       message,
75
     });
60
     });
76
   }
61
   }
77
 
62
 
63
+  function getList(params) {
64
+    request({ ...apis.buildingType.getList, params: { ...params } }).then(res => {
65
+      setData(res)
66
+    }).catch(err => {
67
+      // eslint-disable-next-line no-unused-expressions
68
+      openNotificationWithIcon('error', err)
69
+    })
70
+  }
71
+
78
   // 分页
72
   // 分页
79
   function onChange(pageNumber) {
73
   function onChange(pageNumber) {
80
     // eslint-disable-next-line no-console
74
     // eslint-disable-next-line no-console
90
     }).then(() => {
84
     }).then(() => {
91
       openNotificationWithIcon('success', '操作成功')
85
       openNotificationWithIcon('success', '操作成功')
92
     }).catch(err => {
86
     }).catch(err => {
93
-      openNotificationWithIcon('error', err)
87
+      //openNotificationWithIcon('error', err.message)
94
     })
88
     })
95
   }
89
   }
96
 
90
 

+ 8
- 0
src/pages/customer/customerlist/index.jsx 查看文件

110
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
110
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
111
   }
111
   }
112
 
112
 
113
+  function handleReset() {
114
+    props.form.resetFields();
115
+  }
116
+
117
+
113
   // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
118
   // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
114
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
119
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
115
 
120
 
257
             <Button type="primary" htmlType="submit" >
262
             <Button type="primary" htmlType="submit" >
258
               查询
263
               查询
259
             </Button>
264
             </Button>
265
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
266
+              重置
267
+            </Button>
260
         </Form.Item>
268
         </Form.Item>
261
       </Form>
269
       </Form>
262
 
270
 

+ 2
- 2
src/pages/customer/report/index.jsx 查看文件

152
         </Form.Item>
152
         </Form.Item>
153
         <Form.Item>
153
         <Form.Item>
154
           {getFieldDecorator('consultName')(
154
           {getFieldDecorator('consultName')(
155
-            <Input placeholder="推荐人" />,
155
+            <Input placeholder="置业顾问" />,
156
           )}
156
           )}
157
         </Form.Item>
157
         </Form.Item>
158
         <Form.Item>
158
         <Form.Item>
159
           {getFieldDecorator('consultTel')(
159
           {getFieldDecorator('consultTel')(
160
-            <Input placeholder="推荐电话" />,
160
+            <Input placeholder="置业顾问电话" />,
161
           )}
161
           )}
162
         </Form.Item>
162
         </Form.Item>
163
         <Form.Item>
163
         <Form.Item>

+ 5
- 0
src/services/apis.js 查看文件

263
     },
263
     },
264
   },
264
   },
265
   indexEcharts: {
265
   indexEcharts: {
266
+    list:{
267
+      method:'GET',
268
+      url: `${prefix}/indexStatistical`,
269
+      action: 'userStatistics',
270
+    },
266
     userResource: {
271
     userResource: {
267
       method: 'GET',
272
       method: 'GET',
268
       url: `${prefix}/selectUserResource`,
273
       url: `${prefix}/selectUserResource`,