浏览代码

sharetable

xujing 5 年前
父节点
当前提交
88bf5fabb8
共有 2 个文件被更改,包括 60 次插入17 次删除
  1. 54
    16
      src/pages/statistical/consultant/sharetable.jsx
  2. 6
    1
      src/services/apis.js

+ 54
- 16
src/pages/statistical/consultant/sharetable.jsx 查看文件

5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import request from '../../../utils/request'
6
 import request from '../../../utils/request'
7
 
7
 
8
+const typeList = [
9
+    {
10
+        label: '报名活动',
11
+        value: 'activity'
12
+    },
13
+    {
14
+        label: '助力活动',
15
+        value: 'help'
16
+    },
17
+    {
18
+        label: '拼团活动',
19
+        value: 'group'
20
+    },
21
+    {
22
+        label: 'H5活动',
23
+        value: 'h5'
24
+    },
25
+    {
26
+        label: '直播活动',
27
+        value: 'live'
28
+    },
29
+    {
30
+        label: '房源列表',
31
+        value: 'house'
32
+    },
33
+    {
34
+        label: '项目',
35
+        value: ' project'
36
+    },
37
+    {
38
+        label: '资讯',
39
+        value: 'news'
40
+    },
41
+    {
42
+        label: '首页',
43
+        value: 'mian'
44
+    },
45
+]
46
+
47
+
48
+function getType(type) {
49
+    return typeList.filter(t => t.value === type)[0].label
50
+}
51
+
8
 /**
52
 /**
9
   @param {*} props
53
   @param {*} props
10
   @returns
54
   @returns
28
 
72
 
29
     // 查询列表
73
     // 查询列表
30
     const getList = (params) => {
74
     const getList = (params) => {
31
-        request({ ...apis.stats.totalPersons, params: { ...params }, }).then((data) => {
75
+        request({ ...apis.stats.shareNum, params: { ...params }, }).then((data) => {
32
             setData(data)
76
             setData(data)
33
         })
77
         })
34
     }
78
     }
43
         e.preventDefault();
87
         e.preventDefault();
44
         props.form.validateFields((err, values) => {
88
         props.form.validateFields((err, values) => {
45
             if (!err) {
89
             if (!err) {
46
-                console.log('提交数据: ', values)
47
-
90
+                console.log('提交数据: ', values, { ...formData, ...values })
91
+                getList({ ...formData, ...values });
48
             }
92
             }
49
         });
93
         });
50
-        // getList(formData);
51
     }
94
     }
52
     // 更新页码
95
     // 更新页码
53
     const changePageNum = (pageNumber) => {
96
     const changePageNum = (pageNumber) => {
54
         props.form.validateFields((err, values) => {
97
         props.form.validateFields((err, values) => {
55
             if (!err) {
98
             if (!err) {
56
-                getList({ ...formData, pageNum: pageNumber });
99
+                getList({ ...formData, pageNum: pageNumber, ...values });
57
             }
100
             }
58
         });
101
         });
59
     }
102
     }
67
             dataIndex: 'intention',
110
             dataIndex: 'intention',
68
             key: 'intention',
111
             key: 'intention',
69
             align: 'center',
112
             align: 'center',
113
+            render: (_, record) => <><span>{() => getType(record.targetType)}{record.targetName}</span></>
70
         },
114
         },
71
         {
115
         {
72
             title: '分享时间',
116
             title: '分享时间',
86
             <Form layout="inline">
130
             <Form layout="inline">
87
                 <div style={{ display: 'flex', alignItems: 'center' }}>
131
                 <div style={{ display: 'flex', alignItems: 'center' }}>
88
                     <Form.Item>
132
                     <Form.Item>
89
-                        {getFieldDecorator('eventType')(
133
+                        {getFieldDecorator('targetType')(
90
                             <Select placeholder="分享类型" style={{ width: 150 }}>
134
                             <Select placeholder="分享类型" style={{ width: 150 }}>
91
-                                <Option value="activity_share">报名活动</Option>
92
-                                <Option value="help_share">助力活动</Option>
93
-                                <Option value="group_share">拼团活动</Option>
94
-                                <Option value="h5_share">H5活动</Option>
95
-                                <Option value="live_share">直播活动</Option>
96
-                                <Option value="house_share">房源列表</Option>
97
-                                <Option value="building_share">项目</Option>
98
-                                <Option value="news_share">资讯</Option>
99
-                                <Option value="index_share">首页</Option>
135
+                                {typeList.map((item, index) => (
136
+                                    <Option key={index} value={item.value}>{item.label}</Option>
137
+                                ))}
100
                             </Select>
138
                             </Select>
101
                         )}
139
                         )}
102
                     </Form.Item>
140
                     </Form.Item>
103
                     <Form.Item>
141
                     <Form.Item>
104
-                        {getFieldDecorator('activityName')(
142
+                        {getFieldDecorator('targetName')(
105
                             <Input
143
                             <Input
106
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
144
                                 prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
107
                                 placeholder="分享标题"
145
                                 placeholder="分享标题"

+ 6
- 1
src/services/apis.js 查看文件

1622
       url: `${prefix}/stats/consultant/kpi`,
1622
       url: `${prefix}/stats/consultant/kpi`,
1623
       action: 'admin.contract.list.post',
1623
       action: 'admin.contract.list.post',
1624
     },
1624
     },
1625
-    totalPersons: { // 客户总计
1625
+    totalPersons: { // 客户总计 //新增用户
1626
       method: 'GET',
1626
       method: 'GET',
1627
       url: `${prefix}/stats/consultant/customer`,
1627
       url: `${prefix}/stats/consultant/customer`,
1628
       action: 'admin.contract.list.get',
1628
       action: 'admin.contract.list.get',
1647
       url: `${prefix}/stats/consultant/chat/persons`,
1647
       url: `${prefix}/stats/consultant/chat/persons`,
1648
       action: 'admin.contract.list.get',
1648
       action: 'admin.contract.list.get',
1649
     },
1649
     },
1650
+    shareNum: { // 分享次数
1651
+      method: 'GET',
1652
+      url: `${prefix}/stats/consultant/share/targets`,
1653
+      action: 'admin.contract.list.get',
1654
+    },
1650
 
1655
 
1651
     buildingExport: {
1656
     buildingExport: {
1652
       method: 'GET',
1657
       method: 'GET',