魏熙美 преди 5 години
родител
ревизия
d3caf12761

+ 33
- 0
config/config.js Целия файл

@@ -416,6 +416,39 @@ export default {
416 416
                 },
417 417
               ],
418 418
             },
419
+
420
+
421
+            {
422
+              path: '/indexEcharts',
423
+              name: '首页报表',
424
+              component: '../layouts/SecurityLayout',
425
+              routes: [
426
+                {
427
+                  path: '/indexEcharts/index',
428
+                  name: '报表',
429
+                  component: './indexEcharts/index',
430
+                },
431
+                {
432
+                  path: '/indexEcharts/userSource',
433
+                  name: '用户来源',
434
+                  component: './indexEcharts/userSource',
435
+                },
436
+                {
437
+                  path: '/indexEcharts/userBehavior',
438
+                  name: '用户行为',
439
+                  component: './indexEcharts/userBehavior',
440
+                },
441
+                {
442
+                  path: '/indexEcharts/newUsers',
443
+                  name: '新增用户',
444
+                  component: './indexEcharts/newUsers',
445
+                },
446
+                
447
+              ],
448
+            },
449
+            
450
+
451
+            
419 452
             {
420 453
               component: './404',
421 454
             },

+ 2
- 1
src/components/EchartsTest/EChart.jsx Целия файл

@@ -12,6 +12,8 @@ import 'echarts/lib/chart/map';
12 12
 import 'echarts/lib/component/tooltip';
13 13
 import 'echarts/lib/component/legend';
14 14
 import 'echarts/lib/component/title';
15
+import 'echarts/lib/chart/line';
16
+import 'echarts/lib/component/dataZoom';
15 17
 import 'echarts/lib/component/geo';
16 18
 import 'echarts/lib/component/visualMap';
17 19
 
@@ -41,7 +43,6 @@ class EchartsTest extends Component {
41 43
                 ...this.props.options || {},
42 44
             }
43 45
 
44
-            console.log('----options--->', options)
45 46
 
46 47
             this.chart.setOption(options);
47 48
         }

+ 2
- 0
src/components/EchartsTest/index.jsx Целия файл

@@ -7,6 +7,8 @@ import 'echarts/lib/chart/bar';
7 7
 // 引入提示框和标题组件
8 8
 import 'echarts/lib/component/tooltip';
9 9
 import 'echarts/lib/component/title';
10
+import 'echarts/lib/chart/line'
11
+
10 12
 class Chart extends Component {
11 13
 
12 14
   render() {

+ 3
- 0
src/global.less Целия файл

@@ -92,6 +92,9 @@ ol {
92 92
 .ant-row.ant-form-item .ant-form-item-label.ant-col-sm-3{
93 93
   min-width: 100px;
94 94
 }
95
+.ant-card-body{
96
+  padding: 0;
97
+}
95 98
 .ant-breadcrumb{
96 99
   font-size: 0.1rem;
97 100
   .anticon {

+ 1
- 1
src/pages/channel/editChannel.jsx Целия файл

@@ -57,7 +57,7 @@ const header = props => {
57 57
 
58 58
   return (
59 59
   <>
60
-        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
60
+        <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
61 61
         <Form.Item label="渠道名称">
62 62
           {getFieldDecorator('channelName', {
63 63
             rules: [{ required: true, message: '请输入渠道名称' }],

+ 103
- 0
src/pages/indexEcharts/components/IntentionalCustomers.jsx Целия файл

@@ -0,0 +1,103 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
4
+import { func } from 'prop-types';
5
+import request from '../../../utils/request';
6
+import apis from '../../../services/apis';
7
+// const { Option } = Select;
8
+
9
+const UserBehavior = (props) => {
10
+  const [data, setData] = useState({ records: [] })
11
+  useEffect(() => {
12
+    IntentionUsers()
13
+    // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
14
+
15
+  }, [])
16
+  function IntentionUsers (params) {
17
+    request({
18
+      ...apis.indexEcharts.intentionUsers,
19
+      params: { pageSize: 9999, ...params }
20
+    }).then((data) => {
21
+      setData(data)
22
+      console.log(data || {}, '2134')
23
+    })
24
+  }
25
+
26
+  // getIntentionUsers({ commit }, payload) {
27
+  //   return new Promise((resolve, reject) => {
28
+  //     request({
29
+  //       ...apis.indexEcharts.intentionUsers,
30
+  //       params: { pageSize: 9999, ...payload }
31
+  //     }).then((data) => {
32
+  //       resolve(data.records)
33
+  //     }).catch((err) => {
34
+  //       reject(err)
35
+  //     })
36
+  //   })
37
+  // },
38
+  // const dataSource = [
39
+  //   {
40
+  //     key: '1',
41
+  //     name: '胡彦斌',
42
+  //     age: 32,
43
+  //     address: '西湖区湖底公园1号',
44
+  //   },
45
+  //   {
46
+  //     key: '2',
47
+  //     name: '胡彦祖',
48
+  //     age: 42,
49
+  //     address: '西湖区湖底公园1号',
50
+  //   },
51
+  // ];
52
+  
53
+  const columns = [
54
+    {
55
+      title: '用户姓名',
56
+      dataIndex: 'personName',
57
+      key: 'personName',
58
+      width: '25%',
59
+    },
60
+    {
61
+      title: '手机号',
62
+      dataIndex: 'phone',
63
+      key: 'phone',
64
+      width: '25%',
65
+    },
66
+    {
67
+      title: '意向楼盘',
68
+      dataIndex: 'buildingName',
69
+      key: 'buildingName',
70
+      width: '25%',
71
+    },
72
+    {
73
+      title: '意向值',
74
+      dataIndex: 'intention',
75
+      key: 'intention',
76
+      width: '25%',
77
+    },
78
+  ];
79
+
80
+
81
+  function handleBuildingChange (e) {
82
+    IntentionUsers({ buildingId: e })
83
+
84
+  }
85
+  return (
86
+    <>
87
+      <div>
88
+        <h3>意向客户</h3>
89
+
90
+        <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
91
+
92
+        <Table dataSource={data.records} columns={columns} pagination={false} scroll={{ y: 500 }} />
93
+
94
+
95
+      </div>
96
+
97
+
98
+
99
+    </>
100
+  )
101
+}
102
+
103
+export default UserBehavior;

+ 151
- 0
src/pages/indexEcharts/components/NewUsers.jsx Целия файл

@@ -0,0 +1,151 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+const NewUsers = (props) => {
18
+  //  console.log(props,'999999999999')
19
+  const [data, setData] = useState({ records: [] })
20
+
21
+
22
+  useEffect(() => {
23
+    NewsUserCount(formatDate(props.startDate, props.endDate))
24
+  }, [props.startDate, props.endDate])
25
+
26
+  // getNewsUserCount ({ commit }, payload) {
27
+  //   return new Promise((resolve, reject) => {
28
+  //     request({
29
+  //       ...apis.indexEcharts.newUser,
30
+  //       params: payload,
31
+  //     }).then((data) => {
32
+  //       resolve(data.selectNewsUserCount)
33
+  //     }).catch((err) => {
34
+  //       const message = err.message || err.msg
35
+  //       if (typeof message === 'string') {
36
+  //         reject(message)
37
+  //       }
38
+  //     })
39
+  //   })
40
+  // },
41
+
42
+  function NewsUserCount (params) {
43
+    request({
44
+      ...apis.indexEcharts.newUser,
45
+      params,
46
+    }).then((data) => {
47
+      console.log(data, '3333')
48
+      setData(data)
49
+    })
50
+  }
51
+
52
+  const dataZoom=props.dataZoom?[
53
+    {
54
+      type: 'inside',
55
+      start: 0,
56
+      end: 100
57
+    },
58
+    {
59
+      type: 'slider',
60
+      start: 0,
61
+      end: 100
62
+    },
63
+  ] : undefined 
64
+  // //  show: false
65
+  const dataset = (data.selectNewsUserCount) || []
66
+  const options = {
67
+
68
+   
69
+      color: ["#FF814C", "#F02B3E"],
70
+      tooltip: {
71
+        trigger: "axis"
72
+      },
73
+      icon: "rect",
74
+      legend: {
75
+        data: ["新用户数", "授权注册"]
76
+      },
77
+      toolbox: {},
78
+      xAxis: {
79
+        type: "category",
80
+      },
81
+      yAxis: {},
82
+      dataZoom,
83
+      series: [
84
+        {
85
+          name: "新用户数",
86
+          type: "line",
87
+        },
88
+        {
89
+          name: "授权注册",
90
+          type: "line",
91
+        }
92
+      ],
93
+      dataset: {
94
+        dimensions: ['date', 'userCount', 'authorizationCount'],
95
+        source: dataset
96
+      }
97
+ 
98
+    
99
+    
100
+  }
101
+
102
+
103
+  // function onChange (value) {
104
+  //   UserActive({ dateType: value })
105
+  // }
106
+
107
+
108
+  const piestyles = {
109
+    width: '100%',
110
+    height: '400px',
111
+
112
+  }
113
+
114
+
115
+  return (
116
+    <>
117
+      <div>
118
+
119
+
120
+        <div >
121
+          <h3>新增用户</h3>
122
+
123
+
124
+          {/* <Select
125
+            showSearch
126
+            style={{ width: 100 }}
127
+            placeholder="日活跃"
128
+            optionFilterProp="children"
129
+            onChange={onChange}
130
+            
131
+          >
132
+            <Option value="day">日活跃</Option>
133
+            <Option value="month">月活跃</Option>
134
+
135
+          </Select>
136
+         */}
137
+       </div>
138
+
139
+
140
+        <EChart options={options} style={piestyles} />
141
+      </div>
142
+
143
+
144
+
145
+
146
+
147
+    </>
148
+  )
149
+}
150
+
151
+export default NewUsers;

+ 131
- 0
src/pages/indexEcharts/components/UserActive.jsx Целия файл

@@ -0,0 +1,131 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+const UserSource = (props) => {
18
+  //  console.log(props,'999999999999')
19
+  const [data, setData] = useState({ records: [] })
20
+  //柱图
21
+
22
+  useEffect(() => {
23
+    UserActive({ dateType: 'day' })
24
+  }, [])
25
+
26
+  //  getUserActive({ commit }, payload) {
27
+  //   return new Promise((resolve, reject) => {
28
+  //     request({
29
+  //       ...apis.indexEcharts.userActive,
30
+  //       params: { pageSize: 9999, ...payload }
31
+  //     }).then((data) => {
32
+  //       resolve(data.selectActiveUserCount)
33
+  //     }).catch((err) => {
34
+  //       reject(err)
35
+  //     })
36
+  //   })
37
+  // },
38
+
39
+
40
+  function UserActive (params) {
41
+    request({
42
+      ...apis.indexEcharts.userActive,
43
+      params: { pageSize: 9999, ...params },
44
+    }).then((data) => {
45
+      // console.log(data, '3333')
46
+      setData(data)
47
+    })
48
+  }
49
+  //  show: false
50
+  const dataset = (data.selectActiveUserCount) || []
51
+  const options = {
52
+    // legend: { },
53
+    // color: ['#8954BA', '#175DFB', '#0BB963', '#27DEFF', '#E713D2', '#E71313'],
54
+    tooltip: {},
55
+    xAxis: { type: 'category' },
56
+    yAxis: {},
57
+    // orient: 'horizontal',
58
+    series: {
59
+      // orient: 'horizontal',
60
+      type: 'bar',
61
+      name: '活跃用户',
62
+      barWidth: 50,
63
+      data: dataset.map(x => ([x.date, !x.activityCount ? 0 : x.activityCount])),
64
+      itemStyle: {
65
+        normal: {
66
+          barBorderRadius: [50, 50, 0, 0],
67
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
68
+            offset: 0,
69
+            color: '#FD8A95'
70
+          }, {
71
+            offset: 1,
72
+            color: '#F13043'
73
+          }]),
74
+          shadowColor: 'rgba(0, 0, 0, 0.4)',
75
+
76
+        }
77
+      }
78
+    }
79
+
80
+  }
81
+
82
+
83
+  function onChange (value) {
84
+    UserActive({ dateType: value })
85
+  }
86
+
87
+
88
+  const piestyles = {
89
+    width: '100%',
90
+    height: '400px',
91
+
92
+  }
93
+
94
+
95
+  return (
96
+    <>
97
+      <div>
98
+
99
+
100
+        <div >
101
+          <h3>用户活跃数</h3>
102
+
103
+
104
+          <Select
105
+            showSearch
106
+            style={{ width: 100 }}
107
+            placeholder="日活跃"
108
+            optionFilterProp="children"
109
+            onChange={onChange}
110
+            
111
+          >
112
+            <Option value="day">日活跃</Option>
113
+            <Option value="month">月活跃</Option>
114
+
115
+          </Select>
116
+        
117
+       </div>
118
+
119
+
120
+        <EChart options={options} style={piestyles} />
121
+      </div>
122
+
123
+
124
+
125
+
126
+
127
+    </>
128
+  )
129
+}
130
+
131
+export default UserSource;

+ 154
- 0
src/pages/indexEcharts/components/UserBehavior.jsx Целия файл

@@ -0,0 +1,154 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import 'echarts/lib/component/dataZoom'
9
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
10
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
11
+
12
+const { Option } = Select;
13
+
14
+const formatDate = (start, end) => {
15
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
16
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
17
+  return { startDate, endDate }
18
+}
19
+const UserBehavior = (props) => {
20
+// console.log(props,'11111111')
21
+
22
+const [data, setData] = useState({ records: [] })
23
+  const [datas, setDatas] = useState({ records: [] })
24
+ 
25
+  
26
+  //柱图
27
+
28
+  useEffect(() => {
29
+    getUserBehaviorSummary(formatDate(props.startDate, props.endDate))
30
+    getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
31
+
32
+  }, [props.startDate, props.endDate])
33
+
34
+  function getUserBehaviorSummary(params) {
35
+
36
+
37
+    request({
38
+      ...apis.indexEcharts.userBehavior.summary,
39
+      params
40
+    }).then((data) => {
41
+      setData(data || {})
42
+      // props.onReData(data)
43
+      // console.log(data || {}, '2134')
44
+    })
45
+  }
46
+  // showDetail (row) {
47
+  //   this.detailData = []
48
+  //   this.dialogVisible = true
49
+  //   this.getUserBehaviorProfile().then((data) => {
50
+  //     this.detailData = data
51
+  //   })
52
+
53
+  function getUserBehaviorProfile (row) {
54
+
55
+    setData([])
56
+    request({
57
+      ...apis.indexEcharts.userBehavior.profile,
58
+      params:{ event: row.event, personId: row.personId }
59
+    }).then((data) => {
60
+
61
+      
62
+      setData(data )
63
+      // props.onReData(data)
64
+      // console.log(data , '22354234')
65
+    })
66
+
67
+
68
+  }
69
+  
70
+    const seriesMaker = (data.selectUserBehavior || []).reduce((series, item) => {
71
+      let { date, activityCount, activity } = item
72
+      date = moment(date).format('YYYY-MM-DD')
73
+      if (!activityCount) activityCount = 0
74
+
75
+      // 使用对象, 可以去重
76
+      series[`${activity}`] = (series[`${activity}`] || []).concat([[ date, activityCount ]])
77
+
78
+      return series;
79
+    }, {})
80
+
81
+
82
+   const dataZoom=props.dataZoom?[
83
+      {
84
+        type: 'inside',
85
+        start: 0,
86
+        end: 100
87
+      },
88
+      {
89
+        type: 'slider',
90
+        start: 0,
91
+        end: 100
92
+      },
93
+    ] : undefined 
94
+    
95
+  
96
+    const options = {
97
+    title:  {
98
+        text: '用户行为',
99
+        subtext: '最近7天',
100
+      },
101
+      icon: "rect",
102
+      legend: {
103
+         show: true, zlevel: 10 ,
104
+         itemGap:100,
105
+        //  data:[{
106
+        //   //  name:'',
107
+        //   icon: 'rect',
108
+        //  }]
109
+      },
110
+      color: ['#F12B3E', '#FE929C', '#647CE1', '#A2B9FF', '#FF844F', '#FFBB9D'],
111
+      tooltip: {
112
+        trigger: 'axis'
113
+      },
114
+      xAxis: { type: 'category' },
115
+      yAxis: {},
116
+      dataZoom,
117
+      series: Object.keys(seriesMaker).map(x => {
118
+        return {
119
+          type: 'line',
120
+          name: x,
121
+          data: seriesMaker[x],
122
+        }
123
+      }),
124
+    }
125
+   function handleBuildingChange (e) {
126
+      getUserBehaviorSummary({ buildingId: e })
127
+    }
128
+
129
+
130
+  const style = {
131
+    width: '100%',
132
+    height: '400px',
133
+
134
+  }
135
+
136
+
137
+
138
+  return (
139
+    <>
140
+      <div>
141
+        {/* onSuccess={(e) => onTabledatas(e)} */}
142
+      <BuildSelect slot='action' onChange={(e=>handleBuildingChange(e))}></BuildSelect>
143
+      <EChart  options={options} style={style} />
144
+
145
+ 
146
+      </div>
147
+
148
+
149
+
150
+    </>
151
+  )
152
+}
153
+
154
+export default UserBehavior;

+ 173
- 0
src/pages/indexEcharts/components/UserConversion.jsx Целия файл

@@ -0,0 +1,173 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+
13
+const formatDate = (start, end) => {
14
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+  return { startDate, endDate }
17
+}
18
+
19
+const UserSource = (props) => {
20
+
21
+  const [data, setData] = useState({ records: [] })
22
+  const [theStatis, settheStatis] = useState({ records: [] })
23
+ 
24
+  const [theCurrent, settheCurrent] = useState({ records: [] })
25
+  const endDate = new Date()
26
+  const startDate = moment().subtract(7, 'day').toDate()
27
+ 
28
+  // const theStatis = 'authorization_phone'
29
+  useEffect(() => {
30
+    settheStatis('authorization_phone')
31
+    // UserConversionRate({ conversion: theStatis }).then(setDataset)
32
+  }, [])
33
+
34
+  // function UserConversionRate (params) {
35
+  //   console.log(params, '1111111')
36
+  //   request({
37
+  //     ...apis.indexEcharts.userConversion,
38
+  //     params,
39
+  //   }).then((data) => {
40
+
41
+  //     setData(data)
42
+  //     console.log(data, '000000')
43
+  //   }).then
44
+  // }
45
+  
46
+ function UserConversionRate(_, payload) {
47
+    return new Promise((resolve, reject) => {
48
+      request({
49
+        ...apis.indexEcharts.userConversion,
50
+        params: payload,
51
+      }).then((data) => {
52
+        resolve(data)
53
+      })
54
+    })
55
+  }
56
+  // const dataset = (data.selectSexUser) || []
57
+  // console.log(dataset, '000000')
58
+  const statisTypes=[
59
+    { label: '授权手机', value: 'authorization_phone' },
60
+    { label: '项目收藏', value: 'building_save' },
61
+    { label: '项目转发', value: 'building_share' },
62
+    { label: '活动收藏', value: 'activity_save' },
63
+    { label: '活动转发', value: 'activity_share' },
64
+    { label: '资讯收藏', value: 'news_save' },
65
+    { label: '资讯转发', value: 'news_share' },
66
+    { label: '活动报名', value: 'activity_sign' },
67
+
68
+  ]
69
+// const theCurrent = []
70
+ function setDataset(data) {      
71
+    const { pvNum, ...other } = data['data_count']
72
+
73
+    // 获取第一个值
74
+    let num = 0
75
+    for (let v of Object.keys(other)) {
76
+      num = other[v]
77
+      break
78
+    }
79
+
80
+
81
+    if (pvNum < num) {
82
+      theCurrent = []
83
+    } else {
84
+      theCurrent = [
85
+        { name: getStatisName(), value: num },
86
+        { name: '其余', value: pvNum - num },
87
+      ]
88
+    }
89
+    
90
+    dataset[theStatis] = theCurrent
91
+  }
92
+
93
+  function getStatisName() {
94
+    return statisTypes.filter(x => x.value === theStatis)[0].label
95
+  }
96
+
97
+  // getStatisName() {
98
+ 
99
+  const options = {
100
+    legend: {},
101
+    color: ['#8B7FE2', '#DDDDDD'],
102
+    tooltip: {},
103
+    series: {
104
+      type: 'pie',
105
+      name: '转化率',
106
+      radius: ['50%', '70%'],
107
+      data: theCurrent
108
+    }
109
+    
110
+      
111
+    
112
+
113
+  }
114
+  // statisTypes: [
115
+  //   { label: '授权手机', value: 'authorization_phone' },
116
+  //   { label: '项目收藏', value: 'building_save' },
117
+  //   { label: '项目转发', value: 'building_share' },
118
+  //   { label: '活动收藏', value: 'activity_save' },
119
+  //   { label: '活动转发', value: 'activity_share' },
120
+  //   { label: '资讯收藏', value: 'news_save' },
121
+  //   { label: '资讯转发', value: 'news_share' },
122
+  //   { label: '活动报名', value: 'activity_sign' },
123
+
124
+  // ],
125
+  function onChange (value) {
126
+
127
+  }
128
+
129
+  const piestyles = {
130
+    width: '100%',
131
+    height: '400px',
132
+
133
+  }
134
+
135
+
136
+  return (
137
+    <>
138
+      <div>
139
+        <h3>转化率</h3>
140
+
141
+        <Select
142
+          showSearch
143
+          style={{ width: 200 }}
144
+          placeholder="授权手机"
145
+          optionFilterProp="children"
146
+          onChange={onChange}
147
+
148
+        >
149
+          <Option value="authorization_phone">授权手机</Option>
150
+          <Option value="building_save">项目收藏</Option>
151
+          <Option value="building_share">项目转发</Option>
152
+          <Option value="activity_save">活动收藏</Option>
153
+          <Option value="activity_share">活动转发</Option>
154
+          <Option value="news_save">资讯收藏</Option>
155
+          <Option value="news_share">资讯转发</Option>
156
+          <Option value="activity_sign">活动报名</Option>
157
+        </Select>
158
+        {/* <EChart options={options} style={piestyles} /> */}
159
+
160
+
161
+
162
+
163
+      </div>
164
+
165
+
166
+
167
+
168
+
169
+    </>
170
+  )
171
+}
172
+
173
+export default UserSource;

+ 113
- 0
src/pages/indexEcharts/components/UserSex.jsx Целия файл

@@ -0,0 +1,113 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+
13
+const formatDate = (start, end) => {
14
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+  return { startDate, endDate }
17
+}
18
+
19
+const UserSource = (props) => {
20
+
21
+  const [data, setData] = useState({ records: [] })
22
+  const endDate = new Date()
23
+  const startDate = moment().subtract(7, 'day').toDate()
24
+
25
+
26
+  useEffect(() => {
27
+    UserSex(formatDate(startDate, endDate))
28
+  }, [])
29
+
30
+  function UserSex (params) {
31
+    request({
32
+      ...apis.indexEcharts.userSex,
33
+      params,
34
+    }).then((data) => {
35
+
36
+      setData(data)
37
+      // console.log(data, '000000')
38
+    })
39
+  }
40
+
41
+
42
+  const dataset = (data.selectSexUser) || []
43
+  // console.log(dataset, '000000')
44
+  const options = {
45
+    title: {
46
+      text: '性别比例'
47
+    },
48
+    legend: {},
49
+    color: ['#FF7E48', '#FFC1A4'],
50
+    tooltip: {},
51
+    
52
+    // label: { //  饼图图形上的文本标签
53
+
54
+    //   normal: { // normal 是图形在默认状态下的样式
55
+    //     show: true,
56
+    //     position: 'center',
57
+    //     color: 'red',
58
+    //     fontSize: 18,
59
+    //     fontWeight: 'bold',
60
+    //     formatter: '12' // {b}:数据名; {c}:数据值; {d}:百分比,可以自定义显示内容,
61
+    //   }
62
+    // },
63
+    series: {
64
+      type: 'pie',
65
+      name: '性别比例',
66
+      // radius: ['50%', '70%'],
67
+      center: ['50%', '65%'],
68
+
69
+        radius: ['40%', '60%'],
70
+      data:
71
+        dataset,
72
+
73
+
74
+
75
+
76
+    }
77
+    // series: {
78
+    //   ...this.defaultOpt.series,
79
+    //   data: this.dataset || [],
80
+
81
+    // },
82
+  }
83
+
84
+
85
+  const piestyles = {
86
+    width: '100%',
87
+    height: '400px',
88
+
89
+  }
90
+
91
+
92
+  return (
93
+    <>
94
+      <div>
95
+        {/* <h3>性别比例</h3> */}
96
+
97
+
98
+        <EChart options={options} style={piestyles} />
99
+
100
+
101
+
102
+
103
+      </div>
104
+
105
+
106
+
107
+
108
+
109
+    </>
110
+  )
111
+}
112
+
113
+export default UserSource;

+ 74
- 104
src/pages/indexEcharts/components/UserSource.jsx Целия файл

@@ -1,30 +1,39 @@
1 1
 import React, { Component, useState, useEffect } from 'react';
2
-
2
+import echarts from 'echarts/lib/echarts';
3 3
 import EChart from '../../../components/EchartsTest/EChart';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6
-import dayjs from 'dayjs';
6
+import moment from 'moment';
7 7
 import router from 'umi/router';
8
-import {Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9 9
 // import UserSource from './mmm';
10 10
 
11
+import styles from '../styles.less'
11 12
 
12
-const UserSource = (props) => {
13 13
 
14
+const formatDate = (start, end) => {
15
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
16
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
17
+  return { startDate, endDate }
18
+}
19
+
20
+const UserSource = (props) => {
21
+// console.log(props,'---------')
14 22
   const [data, setData] = useState({ records: [] })
15 23
   //柱图
16 24
 
17 25
   useEffect(() => {
18
-    userResource()
19
-  }, [])
26
+   userResource(formatDate(props.startDate, props.endDate))
27
+  }, [props.startDate, props.endDate])
20 28
 
21
-  function userResource () {
29
+  function userResource (params) {
22 30
     request({
23 31
       ...apis.indexEcharts.userResource,
24
-      params: { pageNum: 1, pageSize: 9999 }
32
+      params,
25 33
     }).then((data) => {
26 34
       // console.log(data , '3333')
27 35
       setData(data)
36
+      props.onSuccess(data)
28 37
     })
29 38
   }
30 39
 
@@ -43,19 +52,63 @@ const UserSource = (props) => {
43 52
   // const source = this.dataset.columnar || [];
44 53
   const subtitle = '最近7天';
45 54
   const baroptions = {
46
-    color: ['#286DD0', '#8565CE', '#6A96F8', '#F5749E', '#8B7FE2'],
55
+    title: {
56
+      text: '用户来源',
57
+      subtext: '最近7天',
58
+    },
59
+    // color: ['#286DD0', '#8565CE', '#6A96F8', '#F5749E', '#8B7FE2'],
47 60
     xAxis: { type: 'category' },
48 61
     legend: {
49 62
       left: '20%',
50
-      data: ['所有用户', '注册用户'],
63
+      data: ['所有用户', '注册用户']
64
+      // itemWidth: '24px',
65
+      // itemHeight:'24px',
51 66
     },
52 67
 
53 68
     tooltip: {},
54 69
 
55 70
     yAxis: {},
56 71
     series: [
57
-      { type: 'bar', name: '所有用户', datasetIndex: 0 },
58
-      { type: 'bar', name: '注册用户' },
72
+      {
73
+        type: 'bar', name: '所有用户', datasetIndex: 0,
74
+        barWidth: 20,
75
+        itemStyle: {
76
+          normal: {
77
+            barBorderRadius: [20, 20, 0, 0],
78
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
79
+              offset: 0,
80
+              color: '#FFC4A8'
81
+            }, {
82
+              offset: 1,
83
+              color: '#FF7E49'
84
+            }]),
85
+            shadowColor: 'rgba(0, 0, 0, 0.4)',
86
+
87
+          }
88
+        }
89
+      },
90
+      {
91
+        type: 'bar',
92
+        name: '注册用户',
93
+        barWidth: 20,
94
+        itemStyle: {
95
+          normal: {
96
+            barBorderRadius: [20, 20, 0, 0],
97
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
98
+              offset: 0,
99
+              color: '#FE939D'
100
+            }, {
101
+              offset: 1,
102
+              color: '#F0293C'
103
+            }]),
104
+            shadowColor: 'rgba(0, 0, 0, 0.4)',
105
+
106
+          }
107
+        }
108
+
109
+
110
+
111
+      },
59 112
     ],
60 113
     dataset: {
61 114
       id: 'bar',
@@ -64,92 +117,19 @@ const UserSource = (props) => {
64 117
     },
65 118
 
66 119
   }
67
-  const { person_estate_agent = 0, person_null = 0, person_realty_consultant = 0 } = dataset.pie || {};
68
-  const pieoptions = {
69
-    // xAxis: {},
70
-    color: ['#286DD0', '#8565CE', '#6A96F8', '#F5749E', '#8B7FE2'],
71
-    legend: {
72
-      // left: '70%',
73
-      data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
74
-    },
75
-    tooltip: {},
76
-    // yAxis: {},
77
-
78
-    series: [
79
-      {
80
-        type: 'pie',
81
-        // datasetIndex: 1,
82
-        center: ['50%', '50%'],
83
-        radius: [0, '50%'],
84
-      },
85
-    ],
86
-    dataset: {
87
-      id: 'pie',
88
-      source: [
89
-        { form: '来源置业顾问', value: person_realty_consultant },
90
-        { form: '来源全民经纪人', value: person_estate_agent },
91
-        { form: '自主进入', value: person_null },
92
-      ]
93
-    },
94
-
95
-
96
-
97
-
98 120
 
99
-  }
100 121
   function handleSelectChange (e) {
101 122
     // eslint-disable-next-line no-console
102
-    console.log(e)
123
+    // console.log(e)
103 124
   }
104 125
 
105
-  //表格
106
-  const dataSource = [
107
-    {
108
-      name: '置业顾问',
109
-      status: '1',//显示停用
110
-    },
111
-    {
112
-      name: '置业经理',
113
-      status: '1',//停用
114
-    },
115
-  ];
116
-
117
-  const columns = [
118
-    // {
119
-    //   title: '商品图片',
120
-    //   dataIndex: 'img',
121
-    //   key: 'img',
122
-    //   align: 'center',
123
-  
124
-    //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
125
-    // },
126
-    {
127
-      title: '角色名称',
128
-      dataIndex: 'name',
129
-      key: 'name',
130
-      align: 'center',
131
-      render: text => <a>{text}</a>,
132
-    },
133
-  
134
-    {
135
-      title: '操作  ',
136
-      dataIndex: 'status',
137
-      key: 'status',
138
-      align: 'center',
139
-  
140
-      render: () => <>11</>
141
-       
142
-    },
143
-  ];
144 126
 
145
-  const style = {
146
-    width: '100%',
147
-    height: '400px',
148 127
 
149
-  }
150
-  const styles = {
151
-    width: '100%',
152
-    height: '400px',
128
+
129
+
130
+  const barstyle = {
131
+    width: '1000px',
132
+    height: '480px',
153 133
 
154 134
   }
155 135
 
@@ -157,21 +137,11 @@ const UserSource = (props) => {
157 137
   return (
158 138
     <>
159 139
       <div>
160
-        <h3>用户来源 <small>{subtitle}</small></h3>
161
-        <Row>
162
-          <Col span={16}>
163
-            <EChart options={baroptions} style={style} /></Col>
164
-          <Col span={8}>
165
-            <EChart options={pieoptions} style={styles} /></Col>
166
-        </Row>
140
+    
141
+        <EChart options={baroptions} style={barstyle} />
142
+ 
167 143
       </div>
168
-      <Select style={{ width: '180px' }} placeholder="所有用户" onChange={handleSelectChange}>
169
-        <Option value={0}>所有用户</Option>
170
-        <Option value={1}>注册用户</Option>
171
-      </Select>
172
-
173 144
 
174
-      <Table dataSource={dataSource} columns={columns} />
175 145
 
176 146
     </>
177 147
   )

+ 180
- 0
src/pages/indexEcharts/components/UserSourcepie.jsx Целия файл

@@ -0,0 +1,180 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+const UserSource = (props) => {
18
+  //  console.log(props,'999999999999')
19
+  const [data, setData] = useState({ records: [] })
20
+  //柱图
21
+
22
+  useEffect(() => {
23
+    userResource(formatDate(props.startDate, props.endDate))
24
+   }, [props.startDate, props.endDate])
25
+ 
26
+   function userResource (params) {
27
+     request({
28
+       ...apis.indexEcharts.userResource,
29
+       params,
30
+     }).then((data) => {
31
+      //  console.log(data , '3333')
32
+       setData(data)
33
+     })
34
+   }
35
+
36
+  function toEdit () {
37
+    router.push({
38
+      pathname: '/indexEcharts/userSource',
39
+      // query: {
40
+      //   a: 'b',
41
+      // },
42
+    });
43
+  }
44
+
45
+  const dataset = data || {};
46
+
47
+
48
+
49
+
50
+
51
+  const { person_estate_agent = 0, person_null = 0, person_realty_consultant = 0 } = dataset.pie || {};
52
+  const pieoptions = {
53
+    // xAxis: {},
54
+    color: ['#6B82E6', '#F02D40', '#FF834E'],
55
+    legend: {
56
+      // left: '70%',
57
+      orient: 'vertical',
58
+      x: 'left',
59
+      data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
60
+      
61
+    },
62
+    tooltip: {
63
+
64
+    },
65
+    // yAxis: {},
66
+
67
+    series: [
68
+      {
69
+        type: 'pie',
70
+        // datasetIndex: 1,
71
+        center: ['50%', '65%'],
72
+
73
+        radius: ['40%', '60%'],
74
+       
75
+        // itemStyle: {
76
+        //   normal: {
77
+          
78
+        //     color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
79
+        //       offset: 0,
80
+        //       color: '#FFC4A8'
81
+        //     }, {
82
+        //       offset: 1,
83
+        //       color: '#FF7E49'
84
+        //     }]),
85
+        //   },
86
+  
87
+        // }
88
+     
89
+      },
90
+      // {
91
+        
92
+       
93
+       
94
+      //   itemStyle: {
95
+      //     normal: {
96
+          
97
+      //       color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
98
+      //         offset: 0,
99
+      //         color: '#214318'
100
+      //       }, {
101
+      //         offset: 1,
102
+      //         color: '#543E49'
103
+      //       }]),
104
+      //     },
105
+  
106
+      //   }
107
+     
108
+      // }
109
+      // {
110
+
111
+      //   itemStyle: {
112
+      //     normal: {
113
+          
114
+      //       color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
115
+      //         offset: 0,
116
+      //         color: '#FFC4A8'
117
+      //       }, {
118
+      //         offset: 1,
119
+      //         color: '#FF7E49'
120
+      //       }]),
121
+      //     }
122
+
123
+      // }
124
+
125
+
126
+    ],
127
+    dataset: {
128
+      id: 'pie',
129
+      source: [
130
+        {
131
+          form: '来源置业顾问', value: person_realty_consultant,
132
+        },
133
+        { form: '来源全民经纪人', value: person_estate_agent },
134
+        { form: '自主进入', value: person_null },
135
+      ]
136
+    },
137
+
138
+
139
+
140
+
141
+
142
+  }
143
+  function handleSelectChange (e) {
144
+    // eslint-disable-next-line no-console
145
+    // console.log(e)
146
+  }
147
+
148
+
149
+
150
+
151
+
152
+
153
+  const piestyles = {
154
+    width: '100%',
155
+    height: '400px',
156
+
157
+  }
158
+
159
+
160
+  return (
161
+    <>
162
+      <div>
163
+
164
+
165
+
166
+
167
+
168
+        <EChart options={pieoptions} style={piestyles} />
169
+
170
+      </div>
171
+
172
+
173
+
174
+
175
+
176
+    </>
177
+  )
178
+}
179
+
180
+export default UserSource;

+ 47
- 5
src/pages/indexEcharts/index.jsx Целия файл

@@ -1,5 +1,5 @@
1 1
 
2
-import React, { useState, useEffect }  from 'react';
2
+import React, { useState, useEffect } from 'react';
3 3
 import { Form, Input, Button, Icon, Select, message, Table, Divider, Row, Col, Tag, Pagination, Modal, DatePicker } from 'antd';
4 4
 
5 5
 // import styles from '../../style/GoodsList.less';
@@ -9,19 +9,61 @@ import request from '../../utils/request'
9 9
 import apis from '../../services/apis';
10 10
 // import Styles from './style.less';/
11 11
 import UserSource from './components/UserSource.jsx';
12
+import UserSourcepie from './components/UserSourcepie.jsx';
13
+import UserBehavior from './components/UserBehavior.jsx';
14
+import UserActive from './components/UserActive';
15
+import UserSex from './components/UserSex';
16
+import NewUsers from './components/NewUsers'
17
+import UserConversion from './components/UserConversion'
18
+import IntentionalCustomers from './components/IntentionalCustomers'
19
+import styles from './styles.less'
20
+import moment from 'moment';
21
+const header = (props) => {
12 22
 
23
+  const endDate = new Date()
13 24
 
14
-const header = (props) => {
25
+  //为了观察数据先设30天
26
+  const startDate = moment().subtract(30, 'day').toDate()
15 27
 
28
+  function onTabledatas (e) {
16 29
 
30
+  }
17 31
   return (
18 32
 
19 33
     <>
20
-    {/* <div>2222</div> */}
21
-     <UserSource  ></UserSource>
34
+      {/* <div>2222</div> */}
35
+      <div style={{ display: 'flex' }}>
36
+        <div className={styles.bar}>
37
+          <UserSource endDate={endDate} startDate={startDate} onSuccess={(e) => onTabledatas(e)}></UserSource>
38
+        </div>
39
+        <div className={styles.pie}>
40
+          <UserSourcepie endDate={endDate} startDate={startDate}></UserSourcepie>
41
+        </div>
42
+      </div>
43
+      <div className={styles.behavior}>
44
+        <UserBehavior endDate={endDate} startDate={startDate} dataZoom={false}></UserBehavior>
45
+      </div>
46
+      <div style={{ display: 'flex' }}>
47
+        <div className={styles.bar}>
48
+
49
+          <UserActive ></UserActive>
50
+        </div>
51
+        <div className={styles.pie}><UserSex></UserSex> </div>
52
+      </div>
53
+      <div style={{ display: 'flex' }}>
54
+        <div className={styles.bar}>
55
+          <NewUsers endDate={endDate} startDate={startDate} dataZoom={false}></NewUsers>
56
+
57
+        </div>
58
+        <div className={styles.pie}><UserConversion></UserConversion> </div>
59
+      </div >
60
+
61
+      <div className={styles.customers}>
62
+        <IntentionalCustomers></IntentionalCustomers>
63
+      </div>
22 64
     </>
23 65
   )
24 66
 }
25 67
 
26 68
 
27
-export default  header
69
+export default header

+ 122
- 0
src/pages/indexEcharts/newUsers.jsx Целия файл

@@ -0,0 +1,122 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
3
+import { Row, Col, Menu, Dropdown } from 'antd';
4
+import NewUsers from './components/NewUsers'
5
+// import XForm, { FieldTypes } from '../../components/XForm';
6
+import moment from 'moment';
7
+
8
+import EChart from '../../components/EchartsTest/EChart';
9
+import request from '../../utils/request';
10
+import apis from '../../services/apis';
11
+
12
+
13
+// const formatDate = (start, end) => {
14
+//   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+//   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+//   return { startDate, endDate }
17
+// }
18
+
19
+
20
+const header = props => {
21
+
22
+  const [tableData, setTableData] = useState({ records: [] })
23
+
24
+  const [endDate, setEndDate] = useState({})
25
+  const [startDate, setStartDate] = useState({})
26
+  let daterange= []
27
+
28
+  useEffect(() => {
29
+
30
+    setEndDate(new Date())
31
+    setStartDate(moment().subtract(30, 'day').toDate())
32
+
33
+  }, [])
34
+
35
+  const { RangePicker } = DatePicker;
36
+
37
+  function onChangetime (dates, dateStrings) {
38
+
39
+    daterange[1]=dateStrings[1]
40
+    daterange[0]=dateStrings[0]
41
+
42
+  }
43
+
44
+  const handleSubmit = (e, props) => {
45
+
46
+    e.preventDefault();
47
+
48
+  }
49
+
50
+  const getDataOf = (days) => () => {
51
+
52
+ 
53
+    setEndDate(new Date())
54
+    setStartDate(moment().subtract(days, 'day').toDate())
55
+
56
+  }
57
+
58
+  function onChange (e) {
59
+
60
+    // console.log(`radio checked:${e.target.value}`);
61
+
62
+  }
63
+
64
+  function datalist () {
65
+
66
+    setEndDate(daterange[1])
67
+    setStartDate(daterange[0])
68
+
69
+  }
70
+
71
+  
72
+ 
73
+
74
+ 
75
+  function handleSelectChange (e) {
76
+
77
+    console.log(e)
78
+
79
+  }
80
+
81
+  const { Column, ColumnGroup } = Table;
82
+
83
+
84
+
85
+
86
+
87
+  
88
+  return (<>
89
+    <div style={{
90
+      backgroundColor: '#fff',
91
+      padding: '32PX 28px',
92
+      boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
93
+      borderRadius: '12px',
94
+      minHeight: '60vh'
95
+    }}>
96
+      <Radio.Group onChange={onChange} defaultValue="a">
97
+        <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
98
+        <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
99
+      </Radio.Group>
100
+      <RangePicker
101
+        style={{ paddingLeft: '30px' }}
102
+        ranges={{
103
+          Today: [moment(), moment()],
104
+          'This Month': [moment().startOf('month'), moment().endOf('month')],
105
+        }}
106
+        showTime
107
+        // format="YYYY/MM/DD HH:mm:ss"
108
+        onChange={onChangetime}
109
+      />
110
+      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
111
+        搜索
112
+          </Button>
113
+      <div>
114
+        <NewUsers endDate={endDate} startDate={startDate}  dataZoom={true} ></NewUsers>
115
+        {/* */}
116
+      </div>
117
+    </div>
118
+  </>
119
+  )
120
+}
121
+
122
+export default header

+ 39
- 0
src/pages/indexEcharts/styles.less Целия файл

@@ -0,0 +1,39 @@
1
+.bar {
2
+  width: 1060px;
3
+  min-height: 560px;
4
+  background: rgba(255, 255, 255, 1);
5
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
6
+  border-radius: 12px;
7
+  padding: 40px;
8
+  margin-right: 40px;
9
+  margin-bottom: 40px;
10
+}
11
+
12
+.pie {
13
+  width: 509px;
14
+  height: 560px;
15
+  background: rgba(255, 255, 255, 1);
16
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
17
+  border-radius: 12px;
18
+  padding: 40px;
19
+  margin-bottom: 40px;
20
+}
21
+
22
+.behavior {
23
+  width: 1600px;
24
+  height: 586px;
25
+  background: rgba(255, 255, 255, 1);
26
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
27
+  border-radius: 12px;
28
+  margin-bottom: 40px;
29
+  padding: 40px;
30
+}
31
+
32
+.customers {
33
+  width: 1600px;
34
+  height: 718px;
35
+  background: rgba(255, 255, 255, 1);
36
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
37
+  border-radius: 12px 12px 0px 0px;
38
+  padding: 40px;
39
+}

+ 160
- 0
src/pages/indexEcharts/userBehavior.jsx Целия файл

@@ -0,0 +1,160 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
3
+import { Row, Col, Menu, Dropdown } from 'antd';
4
+import UserBehavior from './components/UserBehavior'
5
+// import XForm, { FieldTypes } from '../../components/XForm';
6
+import moment from 'moment';
7
+
8
+import EChart from '../../components/EchartsTest/EChart';
9
+import request from '../../utils/request';
10
+import apis from '../../services/apis';
11
+
12
+
13
+// const formatDate = (start, end) => {
14
+//   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+//   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+//   return { startDate, endDate }
17
+// }
18
+
19
+
20
+const header = props => {
21
+
22
+  const [tableData, setTableData] = useState({ records: [] })
23
+
24
+  const [endDate, setEndDate] = useState({})
25
+  const [startDate, setStartDate] = useState({})
26
+  let daterange= []
27
+
28
+  useEffect(() => {
29
+
30
+    setEndDate(new Date())
31
+    setStartDate(moment().subtract(30, 'day').toDate())
32
+
33
+  }, [])
34
+
35
+  const { RangePicker } = DatePicker;
36
+
37
+  function onChangetime (dates, dateStrings) {
38
+
39
+    daterange[1]=dateStrings[1]
40
+    daterange[0]=dateStrings[0]
41
+
42
+  }
43
+
44
+  const handleSubmit = (e, props) => {
45
+
46
+    e.preventDefault();
47
+
48
+  }
49
+
50
+  const getDataOf = (days) => () => {
51
+
52
+ 
53
+    setEndDate(new Date())
54
+    setStartDate(moment().subtract(days, 'day').toDate())
55
+
56
+  }
57
+
58
+  function onChange (e) {
59
+
60
+    // console.log(`radio checked:${e.target.value}`);
61
+
62
+  }
63
+
64
+  function datalist () {
65
+
66
+    setEndDate(daterange[1])
67
+    setStartDate(daterange[0])
68
+
69
+  }
70
+
71
+  
72
+  function redata (e) {
73
+  
74
+
75
+    console.log('行为回调数据:' ,e)
76
+  }
77
+ 
78
+
79
+ 
80
+  function handleSelectChange (e) {
81
+
82
+    console.log(e)
83
+
84
+  }
85
+
86
+  const columns = [
87
+    {
88
+      title: '访问事件',
89
+      dataIndex: 'personName',
90
+      key: 'personName',
91
+      width: '20%',
92
+    },
93
+    {
94
+      title: '访问用户',
95
+      dataIndex: 'phone',
96
+      key: 'phone',
97
+      width: '20%',
98
+    },
99
+    {
100
+      title: '访问次数',
101
+      dataIndex: 'buildingName',
102
+      key: 'buildingName',
103
+      width: '20%',
104
+    },
105
+    {
106
+      title: '首次访问时间',
107
+      dataIndex: 'intention',
108
+      key: 'intention',
109
+      width: '20%',
110
+    },
111
+    {
112
+      title: '离开时间',
113
+      dataIndex: 'stion',
114
+      key: 'stion',
115
+    
116
+    },
117
+  ];
118
+
119
+  const dataSource  = []
120
+
121
+
122
+
123
+  
124
+  return (<>
125
+    <div style={{
126
+      backgroundColor: '#fff',
127
+      padding: '32PX 28px',
128
+      boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
129
+      borderRadius: '12px',
130
+      minHeight: '60vh'
131
+    }}>
132
+      <Radio.Group onChange={onChange} defaultValue="a">
133
+        <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
134
+        <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
135
+      </Radio.Group>
136
+      <RangePicker
137
+        style={{ paddingLeft: '30px' }}
138
+        ranges={{
139
+          Today: [moment(), moment()],
140
+          'This Month': [moment().startOf('month'), moment().endOf('month')],
141
+        }}
142
+        showTime
143
+        // format="YYYY/MM/DD HH:mm:ss"
144
+        onChange={onChangetime}
145
+      />
146
+      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
147
+        搜索
148
+          </Button>
149
+      <div>
150
+        <UserBehavior endDate={endDate} startDate={startDate}  dataZoom={true}  onReData={(e) => redata(e)}></UserBehavior>
151
+        {/* */}
152
+      </div>
153
+
154
+      <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} />
155
+    </div>
156
+  </>
157
+  )
158
+}
159
+// data.records
160
+export default header

+ 197
- 46
src/pages/indexEcharts/userSource.jsx Целия файл

@@ -1,75 +1,226 @@
1
-import dayjs from 'dayjs';
2
-import React from 'react';
3
-import {Radio, DatePicker,  Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
4
-
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
5 3
 import UserSource from './components/UserSource.jsx';
4
+import UserSourcepie from './components/UserSourcepie.jsx';
6 5
 // import XForm, { FieldTypes } from '../../components/XForm';
7 6
 import moment from 'moment';
8 7
 
8
+import EChart from '../../components/EchartsTest/EChart';
9
+import request from '../../utils/request';
10
+import apis from '../../services/apis';
11
+
12
+
13
+// const formatDate = (start, end) => {
14
+//   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+//   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+//   return { startDate, endDate }
17
+// }
18
+
9 19
 
10 20
 const header = props => {
21
+
22
+  const [tableData, setTableData] = useState([])
23
+  const [userType, setuserType] = useState([])
24
+
25
+  const [endDate, setEndDate] = useState({})
26
+  const [startDate, setStartDate] = useState({})
27
+  let daterange = []
28
+
29
+  useEffect(() => {
30
+
31
+    setEndDate(new Date())
32
+    setStartDate(moment().subtract(7, 'day').toDate())
33
+    setuserType('all')
34
+  }, [])
35
+
11 36
   const { RangePicker } = DatePicker;
12
-  function onChange(dates, dateStrings) {
13
-    console.log('From: ', dates[0], ', to: ', dates[1]);
14
-    console.log('From: ', dateStrings[0], ', to: ', dateStrings[1]);
15
-  }
16 37
 
38
+  function onChangetime (dates, dateStrings) {
39
+
40
+    daterange[1] = dateStrings[1]
41
+    daterange[0] = dateStrings[0]
42
+
43
+  }
17 44
 
18 45
   const handleSubmit = (e, props) => {
46
+
19 47
     e.preventDefault();
20
-    // props.form.validateFields((err, values) => {
21
-    //   if (!err) {
22
-    //     getList({ pageNum: 1, pageSize: 10, ...values })
23
-    //   }
24
-    // });
48
+
25 49
   }
26 50
 
51
+  const getDataOf = (days) => () => {
27 52
 
28
-  function getDataOf(days){      
29
-    // const endDate = new Date()
30
-    // const startDate = dayjs().subtract(days, 'day').toDate()
31 53
 
32
-    // this.$refs.chart.getData({ startDate, endDate })
54
+    setEndDate(new Date())
55
+    setStartDate(moment().subtract(days, 'day').toDate())
56
+
33 57
   }
34 58
 
35
-  function onChange(e) {
36
-    console.log(`radio checked:${e.target.value}`);
59
+  function onChange (e) {
60
+
61
+    // console.log(`radio checked:${e.target.value}`);
62
+
63
+  }
64
+
65
+  function datalist () {
66
+
67
+    setEndDate(daterange[1])
68
+    setStartDate(daterange[0])
69
+
37 70
   }
38 71
 
72
+
73
+
74
+  // const userType = 'all'
75
+  let tableTitle = ['日期']
76
+  // const dataset = data || {}
77
+
78
+  // function tableData () {
79
+
80
+  //   const data = (dataset.data || []).reduce((acc, item, index) => {
81
+  //     const { date, fromName, count, registered } = item
82
+  //     const num = userType === 'registered' ? registered : count
83
+
84
+  //     tableTitle = tableTitle.indexOf(fromName) > -1 ? tableTitle : tableTitle.concat(fromName) // eslint-disable-line
85
+  //     acc[date] = { ...acc[date], [`${fromName}`]: !num ? 0 : num }
86
+
87
+  //     return acc
88
+  //   }, {})
89
+
90
+  //   return Object.keys(data).map(x => ({ label: x, ...data[x] }))
91
+
92
+  // }
93
+
94
+  function onTabledatas (e) {
95
+    const data = (e.data || []).reduce((acc, item, index) => {
96
+      const { date, fromName, count, registered } = item
97
+      const num = userType === 'registered' ? registered : count
98
+
99
+      tableTitle = tableTitle.indexOf(fromName) > -1 ? tableTitle : tableTitle.concat(fromName) // eslint-disable-line
100
+      acc[date] = { ...acc[date], [`${fromName}`]: !num ? 0 : num }
101
+
102
+      return acc
103
+    }, {})
104
+
105
+    // tabledata
106
+    setTableData(Object.keys(data).map(x => ({ label: x, ...data[x] })))
107
+
108
+    // console.log('回调数据11111111111111111111111111:' ,Object.keys(data).map(x => ({ label: x, ...data[x] })))
109
+    // console.log('回调数据1:' ,tableData[0])
110
+  }
111
+
112
+  const columns = [
113
+    {
114
+      title: '日期',
115
+      dataIndex: 'label',
116
+      key: 'label',
117
+      width: '20%',
118
+    },
119
+
120
+    // {
121
+    //   title: '名片分享',
122
+    //   dataIndex: '名片分享',
123
+    //   key: '名片分享',
124
+    //   width: '16%'
125
+
126
+    // },
127
+    // {
128
+    //   title: '好友分享',
129
+    //   dataIndex: '好友分享',
130
+    //   key: '好友分享',
131
+    //   width: '16%'
132
+    // },
133
+    // {
134
+    //   title: '小程序搜索',
135
+    //   dataIndex: '小程序搜索',
136
+    //   key: '小程序搜索',
137
+    //   width: '16%'
138
+    // },
139
+    // {
140
+    //   title: '线下扫码',
141
+    //   dataIndex: '线下扫码',
142
+    //   key: '线下扫码',
143
+    //   width: '16%'
144
+    // },
145
+    // {
146
+    //   title: '群分享',
147
+    //   dataIndex: '群分享',
148
+    //   key: '群分享',
149
+    //   width: '16%'
150
+    // },
151
+
152
+
153
+
154
+
155
+  ]
156
+
157
+  // const columns = [{}]
158
+
159
+  // console.log(tableData, '12222222222222')
160
+  function handleSelectChange (e) {
161
+
162
+    console.log(e)
163
+    setuserType(e)
164
+  }
165
+
166
+
167
+
168
+
39 169
   return (<>
40
-  {/* <el-button type="text" @click="() => getDataOf(7)">最近7天</el-button>
41
-      <el-button type="text" @click="() => getDataOf(30)">最近1月</el-button>
42
-      <el-date-picker
43
-        v-model="dateRange"
44
-        type="daterange"
45
-        start-placeholder="开始日期"
46
-        end-placeholder="结束日期"
47
-        style="margin-left: 16px">
48
-      </el-date-picker>
49
-      <el-button type="primary" icon="el-icon-search" style="margin-left: 32px" @click="search">查询</el-button>
50
-    </div>
51
-    <user-source ref="chart" mode="all"></user-source> */}
52
-  <Radio.Group onChange={onChange} defaultValue="a">
170
+    <div style={{
171
+      backgroundColor: '#fff',
172
+      padding: '32PX 28px',
173
+      boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
174
+      borderRadius: '12px',
175
+      minHeight: '60vh'
176
+    }}>
177
+      <Radio.Group onChange={onChange} defaultValue="a">
53 178
         <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
54 179
         <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
55 180
       </Radio.Group>
56 181
       <RangePicker
57
-      ranges={{
58
-        Today: [moment(), moment()],
59
-        'This Month': [moment().startOf('month'), moment().endOf('month')],
60
-      }}
61
-      showTime
62
-      format="YYYY/MM/DD HH:mm:ss"
63
-      // onChange={onChange}
64
-    />
65
-     <Button type="primary" htmlType="submit" >
66
-            查询
182
+        style={{ paddingLeft: '30px' }}
183
+        ranges={{
184
+          Today: [moment(), moment()],
185
+          'This Month': [moment().startOf('month'), moment().endOf('month')],
186
+        }}
187
+        showTime
188
+        // format="YYYY/MM/DD HH:mm:ss"
189
+        onChange={onChangetime}
190
+      />
191
+      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
192
+        查询
67 193
           </Button>
68
-  <div>
69
-    
194
+      <div>
195
+
196
+        <div style={{ display: 'flex' }}>
197
+          <div style={{
198
+            width: '1060px',
199
+            height: '560px',
200
+
201
+            paddingTop: '40px',
202
+            marginRight: ' 40px',
203
+          }}>
204
+            <UserSource endDate={endDate} startDate={startDate} onSuccess={(e) => onTabledatas(e)}></UserSource>
205
+          </div>
206
+          <div style={{
207
+            width: '509px',
208
+            height: '600px',
70 209
 
71
-    <UserSource ></UserSource>
72
-  </div>
210
+            paddingTop: '40px',
211
+
212
+          }}>
213
+            <UserSourcepie endDate={endDate} startDate={startDate}></UserSourcepie>
214
+          </div>
215
+        </div>
216
+        <Select style={{ width: '180px' }} placeholder="所有用户" onChange={handleSelectChange}>
217
+          <Option value='all'>所有用户</Option>
218
+          <Option value='registered'>注册用户</Option>
219
+        </Select>
220
+
221
+        <Table dataSource={tableData} columns={columns} pagination={false} scroll={{ y: 500 }}></Table>
222
+      </div>
223
+    </div>
73 224
   </>
74 225
   )
75 226
 }

+ 165
- 2
src/pages/news/list/editNewsList.jsx Целия файл

@@ -2,6 +2,7 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../../style/GoodsList.less';
5
+import apis from '../../../services/apis';
5 6
 import moment from 'moment';
6 7
 import router from 'umi/router';
7 8
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
@@ -9,8 +10,16 @@ import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9 10
 import XForm, { FieldTypes } from '../../../components/XForm';
10 11
 import Wangedit from '../../../components/Wangedit/Wangedit'
11 12
 import request from '../../../utils/request'
13
+import PosterBottom from '../../../assets/bottom.png'
14
+import ImageUploader from '../../../components/XForm/ImageUpload';
15
+import logo from '../../../assets/logo.png';
16
+import yinhao from '../../../assets/yinhao.png'
17
+import touxiang from '../../../assets/touxiang.jpg';
18
+import poster1 from '../../../assets/poster1.png';
19
+import poster2 from '../../../assets/poster2.png';
12 20
 
13 21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
+const { TextArea } = Input;
14 23
 /**
15 24
  *
16 25
  *
@@ -118,11 +127,165 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
118 127
   }
119 128
   
120 129
   const Poster = (props) => {
121
-   return <div>Poster</div>
130
+    const [inputValue, changeInput] = useState('')
131
+    const [textAreaValue, changeTextArea] = useState('')
132
+    const [imgValue, changeImg] = useState('')
133
+    const [posterId, setPosterId] = useState('')
134
+
135
+    if(newsId){
136
+      useEffect(() => {
137
+        request({ ...apis.activity.poster, params: {targetId: newsId,targetType: 'news'} }).then((data) => {
138
+          console.log(data,"2222")
139
+          if(data.length > 0){
140
+            setPosterId(data[0].posterId)
141
+            changeImg(data[0].posterImg)
142
+            changeTextArea(data[0].posterDescription)
143
+            changeInput(data[0].posterTitle)
144
+          }
145
+        }).catch((err) => {
146
+          message.info(err.msg || err.message)
147
+        })
148
+      }, [])
149
+    }
150
+
151
+    const submitPoster  = () => {
152
+       if(newsId){
153
+        if(posterId){
154
+          request({ ...apis.activity.updatePoster, urlData: {id: posterId}, data: {targetId: newsId,targetType: 'news',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
155
+            message.info("保存成功")
156
+          }).catch((err) => {
157
+            message.info(err.msg || err.message)
158
+          })
159
+         }else{
160
+          request({ ...apis.activity.addPoster, data: {targetId: newsId,targetType: 'news',posterImg: imgValue,posterTitle: inputValue,posterDescription: textAreaValue},}).then((data) => {
161
+            setPosterId(data.posterId)
162
+            message.info("保存成功")
163
+          }).catch((err) => {
164
+            message.info(err.msg || err.message)
165
+          })
166
+         }
167
+       }else{
168
+        message.warn("请先保存基本信息数据")
169
+       }
170
+    }
171
+
172
+    return <div>
173
+      <div style={{ display: 'flex' }}>
174
+        <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
175
+          <div style={{ width: '375px', height: '785px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
176
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
177
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
178
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
179
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
180
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您阅读</span>
181
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
182
+            </div>
183
+            <p style={{
184
+              margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
185
+              display: '-webkit-box', lineClamp: '3', height: '60px',
186
+              WebkitLineClamp: '2',
187
+              WebkitBoxOrient: 'vertical',
188
+              overflow: 'hidden',
189
+              textOverflow: 'ellipsis'
190
+            }}>{inputValue ? inputValue : '海报标题'}</p>
191
+
192
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
193
+            <p style={{
194
+              margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
195
+              display: '-webkit-box', lineClamp: '3', height: '76px',
196
+              WebkitLineClamp: '3',
197
+              WebkitBoxOrient: 'vertical',
198
+              overflow: 'hidden',
199
+              textOverflow: 'ellipsis'
200
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
201
+            <img src={PosterBottom} style={{ width: '100%' }} alt="" />
202
+          </div>
203
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
204
+        </div>
205
+
206
+        <div >
207
+          <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
208
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
209
+            <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
210
+          </div>
211
+          <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
212
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
213
+            <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
214
+          </div>
215
+          <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
216
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
217
+            <TextArea rows={5} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
218
+          </div>
219
+
220
+        </div>
221
+      </div>
222
+      <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
223
+      <Button onClick={() => router.go(-1)}>取消</Button>
224
+    </div>
225
+
122 226
   }
123 227
  
124 228
   const Share = (props) => {
125
-    return <div>Share</div>
229
+    const [inputValue, changeInput] = useState('')
230
+    const [imgValue, changeImg] = useState('')
231
+    const [shareContentId, setShareContentId] = useState('')
232
+    
233
+    if(newsId){
234
+      useEffect(() => {
235
+        request({ ...apis.activity.shareContent, params: {targetId: newsId,targetType: 'news'},}).then((data) => {
236
+          console.log(data,"2222")
237
+          if(data.length > 0){
238
+            setShareContentId(data[0].shareContentId)
239
+            changeImg(data[0].shareContentImg)
240
+            changeInput(data[0].shareContentTitle)
241
+          }
242
+        }).catch((err) => {
243
+          message.info(err.msg || err.message)
244
+        })
245
+      }, [])
246
+    }
247
+
248
+    const submitShare = () => {
249
+      if(newsId){
250
+        if(shareContentId){
251
+          request({ ...apis.activity.updateShareContent, urlData: {id: shareContentId},data: {targetId: newsId,shareContentType: 'news',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
252
+            message.info("保存成功")
253
+          }).catch((err) => {
254
+            message.info(err.msg || err.message)
255
+          })
256
+         }else{
257
+          request({ ...apis.activity.addShareContent, data: {targetId: newsId,shareContentType: 'news',shareContentImg: imgValue,shareContentTitle: inputValue},}).then((data) => {
258
+            setShareContentId(data.shareContentId)
259
+            message.info("保存成功")
260
+          }).catch((err) => {
261
+            message.info(err.msg || err.message)
262
+          })
263
+         }
264
+       }else{
265
+        message.warn("请先保存基本信息数据")
266
+       }
267
+    }
268
+
269
+    return <div style={{ padding: '20px' }}>
270
+      <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
271
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
272
+        <div>
273
+          <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}><img src={logo} style={{ width: '22px', marginRight: '10px' }} />知与行互动</p>
274
+          <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{inputValue ? inputValue : '置业V客厅 精准获客平台'}</p>
275
+          <img style={{ width: '200px', height: '140px' }} src={imgValue ? imgValue : poster2} alt="" />
276
+        </div>
277
+      </div>
278
+      <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
279
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
280
+        <Input placeholder="请输入海报标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
281
+      </div>
282
+      <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
283
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
284
+        <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
285
+      </div>
286
+      <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
287
+      <Button onClick={() => router.go(-1)}>取消</Button>
288
+    </div>
126 289
   }
127 290
 
128 291
   return (

+ 9
- 9
src/pages/staff/list/addRole.jsx Целия файл

@@ -152,11 +152,13 @@ const Poster = props => {
152 152
     }
153 153
   }
154 154
   const gridStyle1 = {
155
-    width: '17%',
155
+    width: '16%',
156 156
     textAlign: 'left',
157
+    height: '72px',
158
+    padding:'24px 10px'
157 159
   };
158 160
   const gridStyle2 = {
159
-    width: '80%',
161
+    width: '84%',
160 162
     textAlign: 'left',
161 163
     height: '72px',
162 164
   };
@@ -207,8 +209,8 @@ const Poster = props => {
207 209
   const { getFieldDecorator } = props.form;
208 210
   return (
209 211
     <>
210
-      <div >
211
-        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
212
+      <div>
213
+        <Form labelCol={{ span: 6 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
212 214
           <Form.Item label="角色名称">
213 215
             {getFieldDecorator('roleName', {
214 216
               rules: [{ required: true, message: '请输入角色名称' }],
@@ -218,13 +220,11 @@ const Poster = props => {
218 220
           {userMenus.map(item => (
219 221
             (item.parentCode === '-1') &&
220 222
             <Row >
221
-              <Col span={7}>
222
-
223
+              <Col span={6}>
223 224
               </Col>
224
-              <Col span={17}>
225
-
225
+              <Col span={18}>
226 226
 
227
-                <Card title={<Checkbox checked={dataMenuId.includes(item.menuId)} onChange={handleMenuChange(item)}>{item.name}</Checkbox>} bordered style={{ width: '100%', alignItems: 'center' }} >
227
+                <Card title={<Checkbox checked={dataMenuId.includes(item.menuId)} onChange={handleMenuChange(item)}>{item.name}</Checkbox>} bordered style={{ width: '100%', alignItems: 'center',margin:'10px 0', boxShadow:'3px 3px 10px  rgba(0,0,0,0.15)',borderRadius:'8px'}} >
228 228
                   {
229 229
                     userMenus.map(menu => (
230 230
 

+ 1
- 0
src/pages/staff/list/style.less Целия файл

@@ -21,6 +21,7 @@
21 21
   border-radius: 12px;
22 22
   margin-bottom: 40px;
23 23
   position: relative;
24
+  padding: 0.1rem;
24 25
   
25 26
 }
26 27
 

+ 48
- 54
src/services/apis.js Целия файл

@@ -26,7 +26,7 @@ export default {
26 26
     signout: {
27 27
       method: 'POST',
28 28
       url: `${prefix}/taUser/signout`,
29
-      logout: true
29
+      logout: true,
30 30
     },
31 31
   },
32 32
   building: {
@@ -190,12 +190,50 @@ export default {
190 190
   indexEcharts: {
191 191
     userResource: {
192 192
       method: 'GET',
193
-      url: `${prefix}/selectUserResource`
193
+      url: `${prefix}/selectUserResource`,
194
+      action: 'userStatistics',
195
+    },
196
+    userBehavior: {
197
+      summary: {
198
+        method: 'GET',
199
+        url: `${prefix}/selectUserBehavior`,
200
+        action: 'userBehaviorStatistics',
201
+      },
202
+      profile: {
203
+        method: 'GET',
204
+        url: `${prefix}/selectEventAll`,
205
+        action: 'behaviorIncident',
206
+      },
207
+    },
208
+    userActive: {
209
+      method: 'GET',
210
+      url: `${prefix}/selectActiveUserCount`,
211
+      action: 'selectActiveUserCount',
212
+    },
213
+    userSex: {
214
+      method: 'GET',
215
+      url: `${prefix}/selectSexUser`,
216
+      action: 'selectSexUser',
217
+    },
218
+    newUser: {
219
+      method: 'GET',
220
+      url: `${prefix}/selectNewsUserCount`,
221
+      action: 'selectNewsUserCount',
222
+    },
223
+    userConversion: {
224
+      method: 'GET',
225
+      url: `${prefix}/selectConversion`,
226
+      action: 'selectConversion',
227
+    },
228
+    intentionUsers: {
229
+      method: 'GET',
230
+      url: `${prefix}/selectIntentionUser`,
231
+      action: 'selectIntentionUser',
194 232
     },
195 233
     userCity: {
196
-      method:'get',
234
+      method: 'get',
197 235
       url: `${prefix}/selectCityUser`,
198
-      action: 'admin.selectCityUser.get'
236
+      action: 'admin.selectCityUser.get',
199 237
     },
200 238
 
201 239
   },
@@ -213,17 +251,17 @@ export default {
213 251
       cancel: {
214 252
         method: 'PUT',
215 253
         url: `${prefix}/buildingDynamic/cancel/:id`,
216
-        action: 'admin.buildingDynamic.cancel.dynamicId.put'
254
+        action: 'admin.buildingDynamic.cancel.dynamicId.put',
217 255
       },
218 256
       send: {
219 257
         url: `${prefix}/buildingDynamic/send/:id`,
220 258
         method: 'PUT',
221
-        action: 'admin.buildingDynamic.send.dynamicId.put'
259
+        action: 'admin.buildingDynamic.send.dynamicId.put',
222 260
       },
223 261
       finish: {
224 262
         url: `${prefix}/buildingDynamic/finish`,
225 263
         method: 'PUT',
226
-        action: 'admin.buildingDynamic.finish.put'
264
+        action: 'admin.buildingDynamic.finish.put',
227 265
       },
228 266
       details: {
229 267
         url: `${prefix}/buildingDynamic/Details`,
@@ -321,7 +359,7 @@ export default {
321 359
       url: `${prefix}/taPointsExchange/change`,
322 360
       method: 'PUT',
323 361
       action: 'admin.taPointsExchange.change.put',
324
-    }
362
+    },
325 363
   },
326 364
   carsuseFigure: {
327 365
     extendContent: {
@@ -348,7 +386,7 @@ export default {
348 386
       url: `${prefix}/extendContent`,
349 387
       method: 'POST',
350 388
       action: 'admin.extendContent.post',
351
-    }
389
+    },
352 390
   },
353 391
   system: {
354 392
     taPolicy: {
@@ -405,7 +443,7 @@ export default {
405 443
       url: `${prefix}/taBuildingReport/add`,
406 444
       method: 'POST',
407 445
       action: 'admin.taBuildingReport.add.post',
408
-    }
446
+    },
409 447
   },
410 448
   staff: {
411 449
     taUser: {
@@ -508,48 +546,4 @@ export default {
508 546
     action: 'admin.updateAuthMenu.post',
509 547
   },
510 548
  },
511
-  // indexEcharts:{
512
-  //   list:{
513
-  //     method:'get',
514
-  //     url: `${commPrefix}/indexStatistical`
515
-  //   },
516
-  //   userResource: {
517
-  //       method:'get',
518
-  //       url: `${commPrefix}/selectUserResource`
519
-  //   },
520
-  //   userConversion: {
521
-  //     method:'get',
522
-  //     url: `${commPrefix}/selectConversion`
523
-  //   },
524
-  //   userActive: {
525
-  //     method:'get',
526
-  //     url: `${commPrefix}/selectActiveUserCount`
527
-  //   },
528
-  //   newUser: {
529
-  //     method:'get',
530
-  //     url: `${commPrefix}/selectNewsUserCount`
531
-  //   },
532
-  //   userBehavior: {
533
-  //     summary: {
534
-  //       method:'get',
535
-  //       url: `${commPrefix}/selectUserBehavior`
536
-  //     },
537
-  //     profile: {
538
-  //       method:'get',
539
-  //       url: `${commPrefix}/selectEventAll`
540
-  //     },
541
-  //   },
542
-  //   intentionUsers: {
543
-  //     method:'get',
544
-  //     url: `${commPrefix}/selectIntentionUser`
545
-  //   },
546
-  //   userSex: {
547
-  //     method:'get',
548
-  //     url: `${commPrefix}/selectSexUser`
549
-  //   },
550
-  //   userCity: {
551
-  //     method:'get',
552
-  //     url: `${commPrefix}/selectCityUser`
553
-  //   },
554
-  // },
555 549
 }