许静 hace 5 años
padre
commit
92ffbfb22a

+ 40
- 56
src/pages/Welcome.jsx Ver fichero

@@ -1,76 +1,60 @@
1
-import React, { useEffect, useState } from 'react';
1
+import React, { Component, useState, useEffect } from 'react';
2 2
 import { Card, Typography, Alert, Row, Col } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import EchartsTest from '../components/EchartsTest';
5 5
 import IndexEcharts from './indexEcharts/index';
6 6
 import router from 'umi/router';
7
+import request from '../utils/request';
7 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 14
   useEffect(() => {
25
-    echratsInfo();
15
+    getIndexEcharts()
26 16
   }, [])
27
-  const [data, setData] = useState({ records: [] })
28
-  function echratsInfo(params) {
17
+
18
+  function getIndexEcharts(params) {
29 19
     request({
30 20
       ...apis.indexEcharts.list,
31
-      params,
21
+      params
32 22
     }).then((data) => {
33 23
       setData(data)
34
-      console.log(data, "666666666666666666666666666666")
35
-
24
+      console.log(data, '11111')
36 25
     })
37 26
   }
38
-
39 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 Ver fichero

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

+ 11
- 0
src/pages/building/list/index.jsx Ver fichero

@@ -228,6 +228,14 @@ function body(props) {
228 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 239
   return (
232 240
     <>
233 241
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
@@ -285,6 +293,9 @@ function body(props) {
285 293
             <Button type="primary" htmlType="submit">
286 294
               搜索
287 295
             </Button>
296
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
297
+              重置
298
+            </Button>
288 299
         </Form.Item>
289 300
       </Form>
290 301
 

+ 11
- 17
src/pages/building/type/index.jsx Ver fichero

@@ -6,6 +6,7 @@ import Styles from './style.less'
6 6
 import request from '../../../utils/request';
7 7
 import apis from '../../../services/apis';
8 8
 import AuthButton from '@/components/AuthButton';
9
+import { debuglog } from 'util';
9 10
 
10 11
 function body() {
11 12
   // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -51,22 +52,6 @@ function body() {
51 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 55
   const openNotificationWithIcon = (type, message) => {
71 56
     notification[type]({
72 57
       message,
@@ -75,6 +60,15 @@ function body() {
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 73
   function onChange(pageNumber) {
80 74
     // eslint-disable-next-line no-console
@@ -90,7 +84,7 @@ function body() {
90 84
     }).then(() => {
91 85
       openNotificationWithIcon('success', '操作成功')
92 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 Ver fichero

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

+ 2
- 2
src/pages/customer/report/index.jsx Ver fichero

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

+ 5
- 0
src/services/apis.js Ver fichero

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