Przeglądaj źródła

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

Yansen 5 lat temu
rodzic
commit
3a1749ba07

+ 97
- 4
src/components/EditIcon/index.jsx Wyświetl plik

@@ -1,14 +1,107 @@
1
-import React from 'react';
1
+import React, { useMemo } from 'react';
2 2
 import spriteImg from '../../assets/sprite.png';
3 3
 
4
-const EditIcon = ({ text, color, position }) => {
4
+const spriteInfo = [
5
+    {
6
+        name: '启用',
7
+        type: 'start',
8
+        pos: 0,
9
+        color: '#ff925c'
10
+    },
11
+    {
12
+        name: '发布',
13
+        type: 'publish',
14
+        pos: -126,
15
+        color: '#ff925c'
16
+    },
17
+    {
18
+        name: '上架',
19
+        type: 'up',
20
+        pos: -18,
21
+        color: '#ff925c'
22
+    },
23
+    {
24
+        name: '编辑',
25
+        type: 'edit',
26
+        pos: -144,
27
+        color: '#ff925c'
28
+    },
29
+    {
30
+        name: '取消',
31
+        type: 'cancel',
32
+        pos: -36,
33
+        color: '#FF4A4A'
34
+    },
35
+    {
36
+        name: '停用',
37
+        type: 'stop',
38
+        pos: -162,
39
+        color: '#FF4A4A'
40
+    },
41
+    {
42
+        name: '结束',
43
+        type: 'end',
44
+        pos: -54,
45
+        color: '#FF4A4A'
46
+    },
47
+    {
48
+        name: '删除',
49
+        type: 'delete',
50
+        pos: -180,
51
+        color: '#FF4A4A'
52
+    },
53
+    {
54
+        name: '查看',
55
+        type: 'look',
56
+        pos: -72,
57
+        color: '#FF4A4A'
58
+    },
59
+    {
60
+        name: '添加',
61
+        type: 'add',
62
+        pos: -198,
63
+        color: '#FF4A4A'
64
+    },
65
+    {
66
+        name: '前置',
67
+        type: 'top',
68
+        pos: -90,
69
+        color: '#FF4A4A'
70
+    },
71
+    {
72
+        name: '下架',
73
+        type: 'down',
74
+        pos: -216,
75
+        color: '#FF4A4A'
76
+    },
77
+    {
78
+        name: '记录',
79
+        type: 'record',
80
+        pos: -108,
81
+        color: '#FF4A4A'
82
+    },
83
+
84
+]
85
+
86
+const EditIcon = ({ text, type, color, position }) => {
87
+
88
+    const icon = spriteInfo.filter(x => x.type === type)[0];
89
+    const color2 = color || icon.color;
90
+    const position2 = position || icon.pos;
91
+
92
+    const wrappedStyle = useMemo(() => ({ color: `${color2}`, display: 'flex', alignItems: 'center' }), [color]);
93
+    const iconStyle = useMemo(() => ({ display: 'inline-block', marginLeft: '6px', background: `url(${spriteImg}) 0 ${position2}px / 100% 1300% no-repeat`, width: '18px', height: '18px' }), [position])
94
+
95
+
5 96
 
6 97
     return (
7
-        <span style={{ color: `${color}`, display: 'flex', alignItems: 'center' }} >
98
+
99
+        <span style={wrappedStyle} >
8 100
             {text}
9
-            <span style={{ display: 'inline-block', marginLeft: '6px', background: `url(${spriteImg}) 0 ${position}px no-repeat`, width: '18px', height: '18px', backgroundSize: '100% 1300%' }}></span>
101
+            <span style={iconStyle}></span>
10 102
         </span>
11 103
 
104
+
12 105
     )
13 106
 
14 107
 };

+ 76
- 29
src/pages/activity/ActivityList.jsx Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Menu, Dropdown, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import router from 'umi/router';
5 5
 import moment from 'moment';
@@ -10,6 +10,8 @@ import apis from '../../services/apis';
10 10
 import request from '../../utils/request';
11 11
 import AuthButton from '@/components/AuthButton';
12 12
 import Prompt from 'umi/prompt';
13
+import { DownOutlined } from '@ant-design/icons';
14
+import EditIcon from '@/components/EditIcon';
13 15
 
14 16
 const { Option } = Select;
15 17
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
@@ -43,7 +45,7 @@ const header = props => {
43 45
   }, [])
44 46
 
45 47
   // 跳转到编辑商品
46
-  const toEditGoods = dynamicId  => () => {
48
+  const toEditGoods = dynamicId => () => {
47 49
     router.push({
48 50
       pathname: '/activity/editActivity',
49 51
       query: {
@@ -90,18 +92,48 @@ const header = props => {
90 92
     router.push({
91 93
       pathname: '/activity/activityRecord',
92 94
       query: {
93
-        
95
+
94 96
         id,
95 97
       },
96 98
     });
97 99
   }
98
-  
100
+
99 101
   /**
100 102
    *
101 103
    *
102 104
    * @param {*} props
103 105
    * @returns
104 106
    */
107
+
108
+  const menu = (row) => (
109
+    <Menu>
110
+      <Menu.Item>
111
+        <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
112
+          <span style={{ cursor: 'pointer' }} onClick={homeDynamic(row)}>{row.home === 1 ? <EditIcon text="取消推首页" color='#666' type="cancel"></EditIcon> : <EditIcon text="推荐首页" color='#666' type="top"></EditIcon>}</span>
113
+        </AuthButton>
114
+      </Menu.Item>
115
+      <Menu.Item>
116
+        <span style={{ cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}><EditIcon text="数据记录" color='#666' type="record"></EditIcon></span>
117
+      </Menu.Item>
118
+      <Menu.Item>
119
+        <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
120
+          <span style={{ cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? <EditIcon text="取消标签" color='#666' type="cancel"></EditIcon> : <EditIcon text="添加标签" color='#666' type="add"></EditIcon>}</span>
121
+        </AuthButton>
122
+      </Menu.Item>
123
+      <Menu.Item>
124
+        <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
125
+          <span style={{ cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? <EditIcon text="取消发布" color='#666' type="cancel"></EditIcon> : <EditIcon text="发布" color='#666' type="publish"></EditIcon>}</span>
126
+        </AuthButton>
127
+      </Menu.Item>
128
+      <Menu.Item>
129
+        <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
130
+          {row.activityStatus === 0 && <span style={{ cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}><EditIcon text="结束活动" color='#666' type="end"></EditIcon></span>}
131
+        </AuthButton>
132
+      </Menu.Item>
133
+
134
+    </Menu>
135
+
136
+  );
105 137
   const columns = [
106 138
     {
107 139
       title: '活动标题',
@@ -110,7 +142,7 @@ const header = props => {
110 142
       align: 'center',
111 143
       // width: '15%',
112 144
       render: (x, row) => <><div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: '201px', title: 'content' }}>
113
-        <span style={{ color: 'blue', cursor: 'pointer' }} onClick={getActivityDetail(row.dynamicId)}>{row.title}</span></div></>,
145
+        <span style={{ color: '#1D74D9', cursor: 'pointer' }} onClick={getActivityDetail(row.dynamicId)}>{row.title}</span></div></>,
114 146
       // width: '300px',
115 147
       // ellipsis:'true'overflow: hidden; /*溢出隐藏*/
116 148
       // text-overflow: ellipsis; /*以省略号...显示*/
@@ -131,7 +163,7 @@ const header = props => {
131 163
       key: 'count',
132 164
       align: 'center',
133 165
       render: (x, row) => <><div style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap', width: '201px', title: 'content' }}>
134
-        <span style={{ color: 'blue', cursor: 'pointer' }} onClick={getJoinPeople(row.dynamicId)}>{row.count}</span></div></>,
166
+        <span style={{ color: '#1D74D9', cursor: 'pointer' }} onClick={getJoinPeople(row.dynamicId)}>{row.count}</span></div></>,
135 167
       // width: '10%',
136 168
       // width: '6%',
137 169
     },
@@ -177,32 +209,47 @@ const header = props => {
177 209
       align: 'center',
178 210
       render: (x, row) => (
179 211
         <>
180
-          {/* <AuthButton name="admin.SignList.get" noRight={null}>
181
-          {(row.activityStatus === 0 || row.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>报名记录{<Icon type="snippets" className={styles.shoppingCart} />}</span>}
182
-          </AuthButton> */}
183
-          <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
184
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
185
-          </AuthButton>
186
-          <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
187
-            {row.activityStatus === 0 && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
188
-          </AuthButton>
189
-          <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
190
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
191
-          </AuthButton>
192
-          <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
193
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={homeDynamic(row)}>{row.home === 1 ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
194
-          </AuthButton>
195
-          {/* <AuthButton name="admin.buildingDynamic.update.put" noRight={null}> */}
196
-          {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
197
-          {/* </AuthButton> */}
198
-          <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
199
-            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId,row.count)}>编辑<Icon type="form" className={styles.edit} /></span>}
200
-          </AuthButton>
201
-          
202
-          {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}
212
+          <Dropdown overlay={menu(row)}>
213
+            <a style={{ color: '#666' }} onClick={e => e.preventDefault()}>
214
+              <span style={{ color: '#FF4A4A' }} >更多</span> <DownOutlined />
215
+            </a>
216
+          </Dropdown>
203 217
         </>
204 218
       ),
205 219
     },
220
+    // {
221
+    //   title: '操作',
222
+    //   dataIndex: 'handle',
223
+    //   key: 'handle',
224
+    //   align: 'center',
225
+    //   render: (x, row) => (
226
+    //     <>
227
+    //       {/* <AuthButton name="admin.SignList.get" noRight={null}>
228
+    //       {(row.activityStatus === 0 || row.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>报名记录{<Icon type="snippets" className={styles.shoppingCart} />}</span>}
229
+    //       </AuthButton> */}
230
+    //       <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
231
+    //         <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
232
+    //       </AuthButton>
233
+    //       <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
234
+    //         {row.activityStatus === 0 && <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
235
+    //       </AuthButton>
236
+    //       <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
237
+    //         <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
238
+    //       </AuthButton>
239
+    //       <AuthButton name="admin.buildingDynamic.tag" noRight={null}>
240
+    //         <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={homeDynamic(row)}>{row.home === 1 ? '取消推首页' : '推首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
241
+    //       </AuthButton>
242
+    //       {/* <AuthButton name="admin.buildingDynamic.update.put" noRight={null}> */}
243
+    //       {<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={toDataReacord(row.dynamicId)}>数据记录<Icon type="form" className={styles.edit} /></span>}
244
+    //       {/* </AuthButton> */}
245
+    //       <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
246
+    //         {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId, row.count)}>编辑<Icon type="form" className={styles.edit} /></span>}
247
+    //       </AuthButton>
248
+
249
+    //       {/* {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{'下载二维码'} {<Icon type="qrcode" className={styles.shoppingCart} />}</span>} */}
250
+    //     </>
251
+    //   ),
252
+    // },
206 253
   ];
207 254
   const getSignList = dynamicId => {
208 255
     router.push({

+ 8
- 28
src/pages/activity/dataRecord/index.jsx Wyświetl plik

@@ -16,7 +16,6 @@ const { TabPane } = Tabs;
16 16
 
17 17
 const DataRecord = props => {
18 18
 
19
-    const [showHelp, setShowHelp] = useState(false)
20 19
     const [tab, setTab] = useState('1')
21 20
     const [data, setData] = useState({})
22 21
 
@@ -31,15 +30,15 @@ const DataRecord = props => {
31 30
     }, [])
32 31
 
33 32
     const getData = (params) => {
34
-  
33
+
35 34
         request({ ...apis.activityDataStatis.getStatisticData, params: { ...params, } }).then((data) => {
36 35
             console.log(data)
37
-            setData(data||{})
36
+            setData(data || {})
38 37
         })
39 38
     }
40 39
 
41 40
     function tabsCallback(e) {
42
-        
41
+
43 42
         setTab(e)
44 43
     }
45 44
 
@@ -47,25 +46,6 @@ const DataRecord = props => {
47 46
         <div>
48 47
             <div>
49 48
                 <span>{data.activityName || '0'}</span>
50
-                <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
51
-                <Modal
52
-                    title="指标说明(数据会存在一定时间延迟)"
53
-                    centered
54
-                    visible={showHelp}
55
-                    footer={null}
56
-                    onCancel={() => setShowHelp(false)}
57
-                >
58
-                    <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
59
-                    <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
60
-                    <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
61
-                    <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
62
-                    <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
63
-                    <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
64
-                    <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
65
-                    <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
66
-                    <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
67
-                    <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
68
-                </Modal>
69 49
                 <Button type="primary" style={{ float: 'right', marginLeft: '20px', zIndex: 1 }} onClick={() => router.go(-1)}>
70 50
                     返回
71 51
                </Button>
@@ -122,15 +102,15 @@ const DataRecord = props => {
122 102
             </Tabs>
123 103
             <div style={{ marginTop: '20px' }}>
124 104
                 {/* 访问人数 */}
125
-                {(tab === '1' && < Visitors id={id} type={type} getData={()=>getData({ id: id, type: type })}/>)}
105
+                {(tab === '1' && < Visitors id={id} type={type} getData={() => getData({ id: id, type: type })} />)}
126 106
                 {/* 访问次数 */}
127
-                {(tab === '2' && <VisitNum id={id} type={type} getData={()=>getData({ id: id, type: type })}/>)}
107
+                {(tab === '2' && <VisitNum id={id} type={type} getData={() => getData({ id: id, type: type })} />)}
128 108
                 {/* 新增注册用户 */}
129
-                {(tab === '3' && <Newuser id={id} type={type} getData={()=>getData({ id: id, type: type })}/>)}
109
+                {(tab === '3' && <Newuser id={id} type={type} getData={() => getData({ id: id, type: type })} />)}
130 110
                 {/* 分享人数 */}
131
-                {(tab === '4' && <Shares id={id} type={type} getData={()=>getData({ id: id, type: type })}/>)}
111
+                {(tab === '4' && <Shares id={id} type={type} getData={() => getData({ id: id, type: type })} />)}
132 112
                 {/* 分享次数 */}
133
-                {(tab === '5' && <ShareNum id={id} type={type} getData={()=>getData({ id: id, type: type })}/>)}
113
+                {(tab === '5' && <ShareNum id={id} type={type} getData={() => getData({ id: id, type: type })} />)}
134 114
 
135 115
                 {/* { (tab === 'desc' && <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft:'30px'}} />)} */}
136 116
 

+ 129
- 110
src/pages/activity/dataRecord/table/newuser.jsx Wyświetl plik

@@ -8,143 +8,162 @@ import WxDictSelect from '@/components/SelectButton/WxDictSelect';
8 8
 import moment from 'moment';
9 9
 
10 10
 const date = {
11
-  startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z',
12
-  endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z'
11
+  startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z',
12
+  endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z'
13 13
 }
14 14
 
15 15
 const header = props => {
16
-
16
+  const [showHelp, setShowHelp] = useState(false)
17 17
   const [data, setData] = useState({})
18 18
   const activityId = props.id
19 19
   const activityType = props.type
20 20
 
21 21
   useEffect(() => {
22 22
     console.log(activityId, activityType)
23
-    getList({pageNum: 1, pageSize: 10 })
23
+    getList({ pageNum: 1, pageSize: 10 })
24 24
 
25 25
   }, [])
26 26
 
27 27
   const getList = params => {
28 28
     console.log(params)
29
-    request({ ...apis.activityDataStatis.activityAddRegist, params: {...params,activityId: activityId, activityType: activityType,...date  }}).then( data=> {
29
+    request({ ...apis.activityDataStatis.activityAddRegist, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
30 30
       console.log(data)
31 31
       props.getData()
32 32
       setData(data)
33
-    }).catch(e=>{
33
+    }).catch(e => {
34 34
       console.log(e)
35 35
     })
36 36
   }
37
-  
37
+
38 38
   const columns = [
39
-        {
40
-          title: '姓名',
41
-          dataIndex: 'nickName',
42
-          key: 'nickName',
43
-        },
44
-        {
45
-          title: '电话',
46
-          dataIndex: 'phone',
47
-          key: 'phone',
48
-        },
49
-        {
50
-          title: '性别',
51
-          dataIndex: 'gender',
52
-          key: 'gender',
53
-        },
54
-        {
55
-          title: '归属地',
56
-          dataIndex: 'province',
57
-          key: 'province',
58
-        },
59
-        {
60
-          title: '来源渠道',
61
-          dataIndex: 'personFrom',
62
-          key: 'personFrom',
63
-        },
64
-        {
65
-          title: '置业顾问',
66
-          dataIndex: 'realtyConsultant',
67
-          key: 'realtyConsultant',
68
-        },
69
-        {
70
-          title: '置业顾问电话',
71
-          dataIndex: 'realtyConsultantPhone',
72
-          key: 'realtyConsultantPhone',
73
-        },
74
-        {
75
-          title: '分享者',
76
-          dataIndex: 'sharePersonName',
77
-          key: 'sharePersonName',
78
-        },
79
-        {
80
-          title: '分享者电话',
81
-          dataIndex: 'sharePersonPhone',
82
-          key: 'sharePersonPhone',
83
-        },
84
-      ]
39
+    {
40
+      title: '姓名',
41
+      dataIndex: 'nickName',
42
+      key: 'nickName',
43
+    },
44
+    {
45
+      title: '电话',
46
+      dataIndex: 'phone',
47
+      key: 'phone',
48
+    },
49
+    {
50
+      title: '性别',
51
+      dataIndex: 'gender',
52
+      key: 'gender',
53
+    },
54
+    {
55
+      title: '归属地',
56
+      dataIndex: 'province',
57
+      key: 'province',
58
+    },
59
+    {
60
+      title: '来源渠道',
61
+      dataIndex: 'personFrom',
62
+      key: 'personFrom',
63
+    },
64
+    {
65
+      title: '置业顾问',
66
+      dataIndex: 'realtyConsultant',
67
+      key: 'realtyConsultant',
68
+    },
69
+    {
70
+      title: '置业顾问电话',
71
+      dataIndex: 'realtyConsultantPhone',
72
+      key: 'realtyConsultantPhone',
73
+    },
74
+    {
75
+      title: '分享者',
76
+      dataIndex: 'sharePersonName',
77
+      key: 'sharePersonName',
78
+    },
79
+    {
80
+      title: '分享者电话',
81
+      dataIndex: 'sharePersonPhone',
82
+      key: 'sharePersonPhone',
83
+    },
84
+  ]
85 85
 
86
-    function handleReset() {
87
-        props.form.resetFields();
88
-        getList({ pageNum: 1, pageSize: 10 })
89
-    }
86
+  function handleReset() {
87
+    props.form.resetFields();
88
+    getList({ pageNum: 1, pageSize: 10 })
89
+  }
90 90
 
91
-    const changePageNum = pageNumber => {
92
-        getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
93
-      }
91
+  const changePageNum = pageNumber => {
92
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
93
+  }
94 94
 
95
-      const handleSubmit = e => {
96
-        e.preventDefault();
97
-        props.form.validateFields((err, values) => {
98
-          if (!err) {
99
-            console.log('提交数据: ', values)
100
-           
101
-            getList({ pageNum: 1, pageSize: 10, ...values })
102
-          }
103
-        });
95
+  const handleSubmit = e => {
96
+    e.preventDefault();
97
+    props.form.validateFields((err, values) => {
98
+      if (!err) {
99
+        console.log('提交数据: ', values)
100
+
101
+        getList({ pageNum: 1, pageSize: 10, ...values })
104 102
       }
105
-    
106
-      const exportActivityStats = () => {
107
-        
108
-        request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: {activityId: activityId, activityType: activityType,...props.form.getFieldsValue(),...date} }).then(data => {
109
-          if (!data) {
110
-            return
111
-          }
112
-          const url = window.URL.createObjectURL(new Blob([data]))
113
-            const link = document.createElement('a')
114
-            link.style.display = 'none'
115
-            link.href = url
116
-            link.setAttribute('download', '访问统计.xlsx')
117
-            document.body.append(link)
118
-            link.click()
119
-        }).catch()
103
+    });
104
+  }
105
+
106
+  const exportActivityStats = () => {
107
+
108
+    request({ ...apis.activityDataStatis.activityAddRegistNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
109
+      if (!data) {
110
+        return
120 111
       }
112
+      const url = window.URL.createObjectURL(new Blob([data]))
113
+      const link = document.createElement('a')
114
+      link.style.display = 'none'
115
+      link.href = url
116
+      link.setAttribute('download', '访问统计.xlsx')
117
+      document.body.append(link)
118
+      link.click()
119
+    }).catch()
120
+  }
121 121
 
122
-    const { getFieldDecorator } = props.form
123
-    return <>
124
-        <div>
125
-            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
126
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
127
-                    {getFieldDecorator('personFrom')(
128
-                        <WxDictSelect />,
129
-                    )}
130
-                </Form.Item>
131
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
132
-                    {getFieldDecorator('province')(<Input placeholder="请输入归属地" />)}
133
-                </Form.Item>
134
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
135
-                    <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}> 查询</Button>
136
-                    <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
137
-                </Form.Item>
138
-            </Form>
139
-            <div>
140
-                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
141
-            </div>
142
-            <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
143
-            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
144
-                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
145
-            </div>
146
-        </div>
147
-    </>
122
+  const { getFieldDecorator } = props.form
123
+  return <>
124
+    <div>
125
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
126
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
127
+          {getFieldDecorator('personFrom')(
128
+            <WxDictSelect />,
129
+          )}
130
+        </Form.Item>
131
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
132
+          {getFieldDecorator('province')(<Input placeholder="请输入归属地" />)}
133
+        </Form.Item>
134
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
135
+          <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}> 查询</Button>
136
+          <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
137
+          <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
138
+          <Modal
139
+            title="指标说明(数据会存在一定时间延迟)"
140
+            centered
141
+            visible={showHelp}
142
+            footer={null}
143
+            onCancel={() => setShowHelp(false)}
144
+          >
145
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
146
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
147
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
148
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
149
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
150
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
151
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
152
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
153
+            <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
154
+            <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
155
+          </Modal>
156
+        </Form.Item>
157
+      </Form>
158
+      <div>
159
+        <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
160
+      </div>
161
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
162
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
163
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
164
+      </div>
165
+    </div>
166
+  </>
148 167
 }
149 168
 
150 169
 const WrappedTypeForm = Form.create()(header);

+ 154
- 135
src/pages/activity/dataRecord/table/shareNum.jsx Wyświetl plik

@@ -9,142 +9,161 @@ import moment from 'moment';
9 9
 
10 10
 
11 11
 const date = {
12
-    startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z',
13
-    endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z'
12
+  startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z',
13
+  endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z'
14
+}
15
+
16
+const header = props => {
17
+
18
+  const [data, setData] = useState({})
19
+  const [showHelp, setShowHelp] = useState(false)
20
+  const activityId = props.id
21
+  const activityType = props.type
22
+
23
+  useEffect(() => {
24
+    console.log(activityId, activityType)
25
+    getList({ pageNum: 1, pageSize: 10 })
26
+
27
+  }, [])
28
+
29
+  const getList = params => {
30
+    console.log(params)
31
+    request({ ...apis.activityDataStatis.activityShareNum, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
32
+      console.log(data)
33
+      props.getData()
34
+      setData(data)
35
+    }).catch(e => {
36
+      console.log(e)
37
+    })
38
+  }
39
+
40
+  const columns = [
41
+    {
42
+      title: '分享者姓名',
43
+      dataIndex: 'sharePersonName',
44
+      key: 'sharePersonName',
45
+    },
46
+    {
47
+      title: '分享者类型',
48
+      dataIndex: 'shareType',
49
+      key: 'shareType',
50
+      render: (text, records) => {
51
+        if (records.sharePersonType === 'drift') { return '游客' }
52
+        if (records.sharePersonType === 'customer') { return '普通客户' }
53
+        if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
54
+        if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
55
+      },
56
+    },
57
+    {
58
+      title: '分享时间',
59
+      dataIndex: 'shareTime',
60
+      key: 'shareTime',
61
+      render: (x, row) => <><span>{`${moment(row.shareTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
62
+    },
63
+    {
64
+      title: '分享者电话',
65
+      dataIndex: 'sharePersonPhone',
66
+      key: 'sharePersonPhone',
67
+    },
68
+    // {
69
+    //   title: '访问人数',
70
+    //   dataIndex: 'visitPersonNum',
71
+    //   key: 'visitPersonNum',
72
+    // },
73
+  ]
74
+
75
+  function handleReset() {
76
+    props.form.resetFields();
77
+    getList({ pageNum: 1, pageSize: 10 })
78
+  }
79
+
80
+  const changePageNum = pageNumber => {
81
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
14 82
   }
15
-  
16
-  const header = props => {
17
-  
18
-    const [data, setData] = useState({})
19
-
20
-    const activityId = props.id
21
-    const activityType = props.type
22
-  
23
-    useEffect(() => {
24
-      console.log(activityId, activityType)
25
-      getList({pageNum: 1, pageSize: 10 })
26
-  
27
-    }, [])
28
-  
29
-    const getList = params => {
30
-      console.log(params)
31
-      request({ ...apis.activityDataStatis.activityShareNum, params: {...params, activityId: activityId, activityType: activityType,...date  }}).then( data=> {
32
-        console.log(data)
33
-        props.getData()
34
-        setData(data)
35
-      }).catch(e=>{
36
-        console.log(e)
37
-      })
38
-    }
39
-   
40
-    const columns = [
41
-        {
42
-          title: '分享者姓名',
43
-          dataIndex: 'sharePersonName',
44
-          key: 'sharePersonName',
45
-        },
46
-        {
47
-          title: '分享者类型',
48
-          dataIndex: 'shareType',
49
-          key: 'shareType',
50
-          render: (text, records) => {
51
-            if (records.sharePersonType === 'drift') { return '游客' }
52
-            if (records.sharePersonType === 'customer') { return '普通客户' }
53
-            if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
54
-            if (records.sharePersonType === 'estate agent') { return '专业经纪人' }
55
-          },
56
-        },
57
-        {
58
-          title: '分享时间',
59
-          dataIndex: 'shareTime',
60
-          key: 'shareTime',
61
-          render: (x, row) => <><span>{`${moment(row.shareTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
62
-        },
63
-        {
64
-          title: '分享者电话',
65
-          dataIndex: 'sharePersonPhone',
66
-          key: 'sharePersonPhone',
67
-        },
68
-        // {
69
-        //   title: '访问人数',
70
-        //   dataIndex: 'visitPersonNum',
71
-        //   key: 'visitPersonNum',
72
-        // },
73
-      ]
74
-
75
-    function handleReset() {
76
-        props.form.resetFields();
77
-        getList({ pageNum: 1, pageSize: 10 })
78
-    }
79
-
80
-    const changePageNum = pageNumber => {
81
-        getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
82
-    }
83
-
84
-    const handleSubmit = e => {
85
-      e.preventDefault();
86
-      props.form.validateFields((err, values) => {
87
-        if (!err) {
88
-         
89
-          getList({ pageNum: 1, pageSize: 10, ...values })
90
-        }
91
-      });
92
-    }
93
-
94
-
95
-  
96
-    const exportActivityStats = () => {
97
-      
98
-      request({ ...apis.activityDataStatis.activityShareNumExport, params: {activityId: activityId, activityType: activityType,...props.form.getFieldsValue(),...date} }).then(data => {
99
-        if (!data) {
100
-          return
101
-        }
102
-        const url = window.URL.createObjectURL(new Blob([data]))
103
-          const link = document.createElement('a')
104
-          link.style.display = 'none'
105
-          link.href = url
106
-          link.setAttribute('download', '访问统计.xlsx')
107
-          document.body.append(link)
108
-          link.click()
109
-      }).catch()
110
-    }
111
-  
112
-
113
-    const { getFieldDecorator } = props.form
114
-    return <>
115
-        <div>
116
-            <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
117
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
118
-                    {getFieldDecorator('sharePersonType')(
119
-                        <Select placeholder="分享者类型" style={{ width: 150, marginLeft: '20px' }}>
120
-                            <Option value="">全部</Option>
121
-                            <Option value="drift">游客</Option>
122
-                            <Option value="customer">普通客户</Option>
123
-                            <Option value="Realty Consultant">置业顾问</Option>
124
-                            <Option value="estate agent">专业经纪人</Option>
125
-                        </Select>
126
-                    )}
127
-                </Form.Item>
128
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
129
-                    {getFieldDecorator('sharePersonPhone')(<Input placeholder="分享者电话" />)}
130
-                </Form.Item>
131
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
132
-                    {getFieldDecorator('sharePersonName')(<Input placeholder="分享者姓名" />)}
133
-                </Form.Item>
134
-                <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
135
-                    <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}> 查询</Button>
136
-                    <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
137
-                </Form.Item>
138
-            </Form>
139
-            <div>
140
-                <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
141
-            </div>
142
-            <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
143
-            <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
144
-                <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
145
-            </div>
146
-        </div>
147
-    </>
83
+
84
+  const handleSubmit = e => {
85
+    e.preventDefault();
86
+    props.form.validateFields((err, values) => {
87
+      if (!err) {
88
+
89
+        getList({ pageNum: 1, pageSize: 10, ...values })
90
+      }
91
+    });
92
+  }
93
+
94
+
95
+
96
+  const exportActivityStats = () => {
97
+
98
+    request({ ...apis.activityDataStatis.activityShareNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
99
+      if (!data) {
100
+        return
101
+      }
102
+      const url = window.URL.createObjectURL(new Blob([data]))
103
+      const link = document.createElement('a')
104
+      link.style.display = 'none'
105
+      link.href = url
106
+      link.setAttribute('download', '访问统计.xlsx')
107
+      document.body.append(link)
108
+      link.click()
109
+    }).catch()
110
+  }
111
+
112
+
113
+  const { getFieldDecorator } = props.form
114
+  return <>
115
+    <div>
116
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
117
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
118
+          {getFieldDecorator('sharePersonType')(
119
+            <Select placeholder="分享者类型" style={{ width: 150, marginLeft: '20px' }}>
120
+              <Option value="">全部</Option>
121
+              <Option value="drift">游客</Option>
122
+              <Option value="customer">普通客户</Option>
123
+              <Option value="Realty Consultant">置业顾问</Option>
124
+              <Option value="estate agent">专业经纪人</Option>
125
+            </Select>
126
+          )}
127
+        </Form.Item>
128
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
129
+          {getFieldDecorator('sharePersonPhone')(<Input placeholder="分享者电话" />)}
130
+        </Form.Item>
131
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
132
+          {getFieldDecorator('sharePersonName')(<Input placeholder="分享者姓名" />)}
133
+        </Form.Item>
134
+        <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
135
+          <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}> 查询</Button>
136
+          <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
137
+        </Form.Item>
138
+        <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
139
+        <Modal
140
+          title="指标说明(数据会存在一定时间延迟)"
141
+          centered
142
+          visible={showHelp}
143
+          footer={null}
144
+          onCancel={() => setShowHelp(false)}
145
+        >
146
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
147
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
148
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
149
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
150
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
151
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
152
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
153
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
154
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
155
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
156
+        </Modal>
157
+      </Form>
158
+      <div>
159
+        <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats}>导出</Button>
160
+      </div>
161
+      <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
162
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
163
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
164
+      </div>
165
+    </div>
166
+  </>
148 167
 }
149 168
 
150 169
 const WrappedTypeForm = Form.create()(header);

+ 21
- 2
src/pages/activity/dataRecord/table/shares.jsx Wyświetl plik

@@ -16,7 +16,7 @@ const header = props => {
16 16
 
17 17
   const [data, setData] = useState({})
18 18
   const [sort, setSort] = useState({})
19
-
19
+  const [showHelp, setShowHelp] = useState(false)
20 20
   const activityId = props.id
21 21
   const activityType = props.type
22 22
 
@@ -147,7 +147,7 @@ const header = props => {
147 147
   const { getFieldDecorator } = props.form
148 148
   return <>
149 149
     <div>
150
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
150
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
151 151
         <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
152 152
           {getFieldDecorator('sharePersonType')(
153 153
             <Select placeholder="分享者类型" style={{ width: 150, marginLeft: '20px' }}>
@@ -170,6 +170,25 @@ const header = props => {
170 170
           <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }}> 查询</Button>
171 171
           <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
172 172
         </Form.Item>
173
+        <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
174
+        <Modal
175
+          title="指标说明(数据会存在一定时间延迟)"
176
+          centered
177
+          visible={showHelp}
178
+          footer={null}
179
+          onCancel={() => setShowHelp(false)}
180
+        >
181
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
182
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
183
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
184
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
185
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
186
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
187
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
188
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
189
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
190
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
191
+        </Modal>
173 192
       </Form>
174 193
       <div>
175 194
         <Button type="primary" style={{ float: 'right', marginBottom: '20px', zIndex: 1 }} onClick={exportActivityStats} >导出</Button>

+ 21
- 2
src/pages/activity/dataRecord/table/visitNum.jsx Wyświetl plik

@@ -13,7 +13,7 @@ const date = {
13 13
 }
14 14
 
15 15
 const header = props => {
16
-
16
+  const [showHelp, setShowHelp] = useState(false)
17 17
   const [data, setData] = useState({})
18 18
   const activityId = props.id
19 19
   const activityType = props.type
@@ -134,7 +134,7 @@ const header = props => {
134 134
   const { getFieldDecorator } = props.form
135 135
   return <>
136 136
     <div>
137
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
137
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
138 138
         <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
139 139
           {getFieldDecorator('personFrom')(
140 140
             <WxDictSelect />,
@@ -155,6 +155,25 @@ const header = props => {
155 155
             </Button>
156 156
           <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
157 157
         </Form.Item>
158
+        <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
159
+        <Modal
160
+          title="指标说明(数据会存在一定时间延迟)"
161
+          centered
162
+          visible={showHelp}
163
+          footer={null}
164
+          onCancel={() => setShowHelp(false)}
165
+        >
166
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
167
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
168
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
169
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
170
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
171
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
172
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
173
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
174
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
175
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
176
+        </Modal>
158 177
       </Form>
159 178
       <div>
160 179
 

+ 45
- 26
src/pages/activity/dataRecord/table/visitors.jsx Wyświetl plik

@@ -8,33 +8,33 @@ import WxDictSelect from '@/components/SelectButton/WxDictSelect';
8 8
 import moment from 'moment';
9 9
 
10 10
 const date = {
11
-  startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z',
12
-  endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss')+'.000Z'
11
+  startDate: moment().year(1000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z',
12
+  endDate: moment().year(3000).hours(0).minutes(0).seconds(0).milliseconds(0).format('YYYY-MM-DDTHH:mm:ss') + '.000Z'
13 13
 }
14 14
 // 2020-04-18T16:00:00.000Z
15 15
 
16 16
 const header = props => {
17 17
 
18 18
   // const [id,type] = props
19
-
19
+  const [showHelp, setShowHelp] = useState(false)
20 20
   const [data, setData] = useState({})
21 21
   const activityId = props.id
22 22
   const activityType = props.type
23
-  
23
+
24 24
 
25 25
   useEffect(() => {
26 26
 
27
-    getList({pageNum: 1, pageSize: 10 })
27
+    getList({ pageNum: 1, pageSize: 10 })
28 28
 
29 29
   }, [])
30 30
 
31 31
   const getList = params => {
32 32
     console.log(params)
33
-    request({ ...apis.activityDataStatis.activityVisitPersonNum, params: {...params, activityId: activityId, activityType: activityType ,...date  }}).then( data=> {
33
+    request({ ...apis.activityDataStatis.activityVisitPersonNum, params: { ...params, activityId: activityId, activityType: activityType, ...date } }).then(data => {
34 34
       console.log(data)
35 35
       props.getData()
36 36
       setData(data)
37
-    }).catch(e=>{
37
+    }).catch(e => {
38 38
       console.log(e)
39 39
     })
40 40
   }
@@ -47,10 +47,10 @@ const header = props => {
47 47
   //     this.setState({ tableData: data.records, total: data.total})
48 48
   //   }).catch()
49 49
   // }
50
-  const format = data =>{
51
-    console.log(data.replace(/,/g,'\n'))
52
-    
53
-  return <div dangerouslySetInnerHTML={{__html:data.replace(/,/g,",<br/>")}}>{}</div>
50
+  const format = data => {
51
+    console.log(data.replace(/,/g, '\n'))
52
+
53
+    return <div dangerouslySetInnerHTML={{ __html: data.replace(/,/g, ",<br/>") }}>{}</div>
54 54
   }
55 55
   const columns = [
56 56
     {
@@ -82,15 +82,15 @@ const header = props => {
82 82
       title: '置业顾问',
83 83
       dataIndex: 'realtyConsultant',
84 84
       key: 'realtyConsultant',
85
-      render: (x, row) => <>{row.realtyConsultant?format(row.realtyConsultant):''}</>,
86
-      width:180
85
+      render: (x, row) => <>{row.realtyConsultant ? format(row.realtyConsultant) : ''}</>,
86
+      width: 180
87 87
     },
88 88
     {
89 89
       title: '置业顾问电话',
90 90
       dataIndex: 'realtyConsultantPhone',
91 91
       key: 'realtyConsultantPhone',
92
-      render: (x, row) => <>{row.realtyConsultantPhone?format(row.realtyConsultantPhone):''}</>,
93
-      width:180
92
+      render: (x, row) => <>{row.realtyConsultantPhone ? format(row.realtyConsultantPhone) : ''}</>,
93
+      width: 180
94 94
     },
95 95
     {
96 96
       title: '推广人',
@@ -118,32 +118,32 @@ const header = props => {
118 118
     props.form.validateFields((err, values) => {
119 119
       if (!err) {
120 120
         console.log('提交数据: ', values)
121
-       
121
+
122 122
         getList({ pageNum: 1, pageSize: 10, ...values })
123 123
       }
124 124
     });
125 125
   }
126 126
 
127 127
   const exportActivityStats = () => {
128
-    
129
-    request({ ...apis.activityDataStatis.activityVisitPersonNumExport, params: {activityId: activityId, activityType: activityType,...props.form.getFieldsValue(),...date} }).then(data => {
128
+
129
+    request({ ...apis.activityDataStatis.activityVisitPersonNumExport, params: { activityId: activityId, activityType: activityType, ...props.form.getFieldsValue(), ...date } }).then(data => {
130 130
       if (!data) {
131 131
         return
132 132
       }
133 133
       const url = window.URL.createObjectURL(new Blob([data]))
134
-        const link = document.createElement('a')
135
-        link.style.display = 'none'
136
-        link.href = url
137
-        link.setAttribute('download', '访问统计.xlsx')
138
-        document.body.append(link)
139
-        link.click()
134
+      const link = document.createElement('a')
135
+      link.style.display = 'none'
136
+      link.href = url
137
+      link.setAttribute('download', '访问统计.xlsx')
138
+      document.body.append(link)
139
+      link.click()
140 140
     }).catch()
141 141
   }
142 142
 
143 143
   const { getFieldDecorator } = props.form
144 144
   return <>
145
-    <div>
146
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
145
+    <div >
146
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)} style={{ display: 'flex', alignItems: 'center' }}>
147 147
         <Form.Item style={{ marginTop: '20px', marginBottom: '20px' }}>
148 148
           {getFieldDecorator('personFrom')(
149 149
             <WxDictSelect />,
@@ -164,6 +164,25 @@ const header = props => {
164 164
             </Button>
165 165
           <Button onClick={handleReset} style={{ marginLeft: '30px' }}>重置</Button>
166 166
         </Form.Item>
167
+        <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft: '30px' }} onClick={() => setShowHelp(true)} />
168
+        <Modal
169
+          title="指标说明(数据会存在一定时间延迟)"
170
+          centered
171
+          visible={showHelp}
172
+          footer={null}
173
+          onCancel={() => setShowHelp(false)}
174
+        >
175
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享人数:</p>
176
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>分享小程序活动的总人数</p>
177
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
178
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>触发小程序活动分享的总次数</p>
179
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增注册用户:</p>
180
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过当前活动授权手机号的总人数</p>
181
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问人数:</p>
182
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总人数</p>
183
+          <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>访问次数:</p>
184
+          <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问小程序活动的总次数</p>
185
+        </Modal>
167 186
       </Form>
168 187
       <div>
169 188
 

+ 3
- 4
src/pages/building/list/index.jsx Wyświetl plik

@@ -118,8 +118,7 @@ function CartBody(props) {
118 118
           <span style={{ textOverflow: 'ellipsis', whiteSpace: 'nowrap', overflow: 'hidden' }}>:{data.code}</span>
119 119
           <AuthButton name="admin.building.update" noRight={null}>
120 120
             <span className={Styles.ediText} onClick={() => toEdi(data)}>
121
-              编辑
122
-                  <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
121
+              <EditIcon text="编辑" type="edit"></EditIcon>
123 122
             </span>
124 123
           </AuthButton>
125 124
         </p>
@@ -150,14 +149,14 @@ function CartBody(props) {
150 149
           <AuthButton name="admin.building.public" noRight={null}>
151 150
             <span style={{ color: '#FF4A4A' }} onClick={() => pulicAndUnPulic(data)}>
152 151
               {/* 已发布的时候,需要显示取消发布的字样 */}
153
-              {data.status === 1 ? <EditIcon text="取消发布" color='#FF4A4A' position="-36"></EditIcon> : <EditIcon text="发布" color='#FF4A4A' position="-126"></EditIcon>}
152
+              {data.status === 1 ? <EditIcon text="取消发布" type="cancel"></EditIcon> : <EditIcon text="发布" type="publish"></EditIcon>}
154 153
             </span>
155 154
           </AuthButton>
156 155
           <AuthButton name="admin.building.delete" noRight={null}>
157 156
             <span style={{
158 157
               color: '#FF4A4A', position: 'absolute', right: '0', bottom: '0'
159 158
             }} onClick={() => deleteBuilding(data)}>
160
-              <EditIcon text="删除" color='#FF4A4A' position="-180"></EditIcon>
159
+              <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon>
161 160
             </span>
162 161
           </AuthButton>
163 162
         </p>

+ 2
- 2
src/pages/building/type/index.jsx Wyświetl plik

@@ -42,14 +42,14 @@ function body() {
42 42
             <Button type="link" style={{
43 43
               color: '#FF4A4A', right: '0',
44 44
             }} onClick={() => deleteType(record)}>
45
-              <EditIcon text="删除" color='#FF4A4A' position="-180"></EditIcon>
45
+              <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon>
46 46
             </Button>
47 47
           </AuthButton>
48 48
           <AuthButton name="admin.tdBuildingType.update" noRight={null}>
49 49
             <Button type="link" style={{
50 50
               color: '#FF4A4A', right: '0',
51 51
             }} onClick={() => toEdi(record.buildingTypeId)}>
52
-              <EditIcon text="编辑" color='#ff925c' position="-144"></EditIcon>
52
+              <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
53 53
             </Button>
54 54
           </AuthButton>
55 55
         </span>

+ 106
- 103
src/pages/carouselFigure/advertisingList.jsx Wyświetl plik

@@ -9,29 +9,30 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import apis from '../../services/apis';
10 10
 import request from '../../utils/request';
11 11
 import AuthButton from '@/components/AuthButton';
12
+import EditIcon from '@/components/EditIcon';
12 13
 
13 14
 const { Option } = Select;
14 15
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15 16
 
16 17
 const header = (props) => {
17
-  const [ data, setData ] = useState({})
18
-//   const [page, changePage] = useState({})
18
+  const [data, setData] = useState({})
19
+  //   const [page, changePage] = useState({})
19 20
 
20 21
   useEffect(() => {
21 22
     getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
22
-  },[])
23
+  }, [])
23 24
 
24 25
   // 查询列表
25 26
   const getList = (params) => {
26
-    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
27
-        console.log(data)
28
-        setData(data)
27
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
28
+      console.log(data)
29
+      setData(data)
29 30
     })
30 31
   }
31 32
 
32
-  
33
-// 跳转到编辑商品
34
-const toEdit = (contentId) => () => {
33
+
34
+  // 跳转到编辑商品
35
+  const toEdit = (contentId) => () => {
35 36
     router.push({
36 37
       pathname: '/carouselFigure/editAdvertising',
37 38
       query: {
@@ -39,7 +40,7 @@ const toEdit = (contentId) => () => {
39 40
       },
40 41
     });
41 42
   }
42
-  
43
+
43 44
   const columns = [
44 45
     {
45 46
       title: '主图',
@@ -59,15 +60,15 @@ const toEdit = (contentId) => () => {
59 60
       dataIndex: 'buildingName',
60 61
       key: 'buildingName',
61 62
       align: 'center',
62
-      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
63 64
     },
64 65
     {
65 66
       title: '关联内容类型',
66 67
       dataIndex: 'contentType',
67 68
       key: 'contentType',
68 69
       align: 'center',
69
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : 
70
-                                       contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' :  contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无' }</span>
70
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
71
+        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
71 72
     },
72 73
     // {
73 74
     //   title: '发布位置',
@@ -88,106 +89,108 @@ const toEdit = (contentId) => () => {
88 89
       dataIndex: 'status',
89 90
       key: 'status',
90 91
       align: 'center',
91
-      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
92
+      render: (status) => <><span>{status == 1 ? '上架' : '下架'}</span></>
92 93
     },
93 94
     {
94 95
       title: '操作',
95 96
       dataIndex: 'handle',
96 97
       key: 'handle',
97 98
       align: 'center',
98
-      render: (x,row) => (
99
+      render: (x, row) => (
99 100
         <>
100
-          <AuthButton name="admin.advert.publish" noRight={null}>
101
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-          </AuthButton>
103
-          <AuthButton name="admin.advert.put" noRight={null}>
104
-            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
105
-          </AuthButton>
106
-          <AuthButton name="admin.advert.delete" noRight={null}>
107
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
108
-          </AuthButton>
101
+          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
102
+            <AuthButton name="admin.advert.publish" noRight={null}>
103
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={changeStatus(row)}>{row.status === 1 ? <EditIcon text="下架" color='#FF4A4A' type="down"></EditIcon> : <EditIcon text="上架" color='#ff925c' type="up"></EditIcon>}</span>
104
+            </AuthButton>
105
+            <AuthButton name="admin.advert.put" noRight={null}>
106
+              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}><EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon></span>
107
+            </AuthButton>
108
+            <AuthButton name="admin.advert.delete" noRight={null}>
109
+              <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}><EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon></span>
110
+            </AuthButton>
111
+          </div>
109 112
         </>
110 113
       )
111 114
     },
112 115
   ];
113
-  
116
+
114 117
   const finishDynamic = (row) => {
115
-      Modal.confirm({
116
-          title: '结束以后将无法编辑, 是否继续?',
117
-          okText: '确定',
118
-          cancelText: '取消',
119
-          onOk() {
120
-              request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
121
-                  console.log(data)
122
-                  message.info('操作成功!')
123
-                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
124
-              }).catch((err) => {
125
-                  console.log(err)
126
-                  message.info(err.msg || err.message)
127
-              })
128
-          },
129
-        });
118
+    Modal.confirm({
119
+      title: '结束以后将无法编辑, 是否继续?',
120
+      okText: '确定',
121
+      cancelText: '取消',
122
+      onOk() {
123
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
124
+          console.log(data)
125
+          message.info('操作成功!')
126
+          getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
127
+        }).catch((err) => {
128
+          console.log(err)
129
+          message.info(err.msg || err.message)
130
+        })
131
+      },
132
+    });
130 133
   }
131
-  
134
+
132 135
   //删除
133
-const deleteCarouse = (contentId) => () =>{
134
-  Modal.confirm({
135
-    title: '确认删除此数据?',
136
-    okText: '确定',
137
-    cancelText: '取消',
138
-    onOk() {
139
-      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
136
+  const deleteCarouse = (contentId) => () => {
137
+    Modal.confirm({
138
+      title: '确认删除此数据?',
139
+      okText: '确定',
140
+      cancelText: '取消',
141
+      onOk() {
142
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
143
+          message.info('操作成功!')
144
+          getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
145
+        }).catch((err) => {
146
+          console.log(err)
147
+          message.info(err.msg || err.message)
148
+        })
149
+      },
150
+    });
151
+  }
152
+
153
+  //   停用启用
154
+  const changeStatus = (row) => () => {
155
+    console.log(row)
156
+    if (row.status === 0) {
157
+
158
+      Modal.confirm({
159
+        title: '确认发布此数据?',
160
+        okText: '确定',
161
+        cancelText: '取消',
162
+        onOk() {
163
+          row.status = 1
164
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
140 165
             message.info('操作成功!')
141 166
             getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
142
-        }).catch((err) => {
167
+          }).catch((err) => {
143 168
             console.log(err)
144 169
             message.info(err.msg || err.message)
145
-        })
146
-    },
147
-  });
148
-}
170
+          })
171
+        },
172
+      });
173
+    } else if (row.status === 1) {
149 174
 
150
-//   停用启用
151
-  const changeStatus = (row) => () => {
152
-      console.log(row)
153
-      if(row.status === 0) {
154
-        
155
-        Modal.confirm({
156
-          title: '确认发布此数据?',
157
-          okText: '确定',
158
-          cancelText: '取消',
159
-          onOk() {
160
-            row.status = 1
161
-              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
162
-                  message.info('操作成功!')
163
-                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
164
-              }).catch((err) => {
165
-                  console.log(err)
166
-                  message.info(err.msg || err.message)
167
-              })
168
-          },
169
-        });
170
-      }else if(row.status === 1){
171
-        
172
-        Modal.confirm({
173
-          title: '停用后不会再显示在小程序端',
174
-          okText: '确定',
175
-          cancelText: '取消',
176
-          onOk() {
177
-            row.status = 0
178
-              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
179
-                  message.info('操作成功!')
180
-                  getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
181
-              }).catch((err) => {
182
-                  console.log(err)
183
-                  message.info(err.msg || err.message)
184
-              })
185
-          },
186
-        });
187
-      }
175
+      Modal.confirm({
176
+        title: '停用后不会再显示在小程序端',
177
+        okText: '确定',
178
+        cancelText: '取消',
179
+        onOk() {
180
+          row.status = 0
181
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
182
+            message.info('操作成功!')
183
+            getList({ pageNum: 1, pageSize: 10, showType: 'screen' })
184
+          }).catch((err) => {
185
+            console.log(err)
186
+            message.info(err.msg || err.message)
187
+          })
188
+        },
189
+      });
190
+    }
188 191
 
189 192
   }
190
-  
193
+
191 194
   const changePageNum = (pageNumber, props) => {
192 195
     props.form.validateFields((err, values) => {
193 196
       if (!err) {
@@ -197,7 +200,7 @@ const deleteCarouse = (contentId) => () =>{
197 200
   }
198 201
 
199 202
   // 提交事件
200
-const handleSubmit = (e, props) => {
203
+  const handleSubmit = (e, props) => {
201 204
     e.preventDefault();
202 205
     props.form.validateFields((err, values) => {
203 206
       if (!err) {
@@ -207,8 +210,8 @@ const handleSubmit = (e, props) => {
207 210
     });
208 211
   }
209 212
 
210
-   //重置搜索
211
-   function handleReset() {
213
+  //重置搜索
214
+  function handleReset() {
212 215
     props.form.resetFields();
213 216
     getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
214 217
   }
@@ -219,9 +222,9 @@ const handleSubmit = (e, props) => {
219 222
 
220 223
     <>
221 224
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
222
-      <Form.Item>
225
+        <Form.Item>
223 226
           {getFieldDecorator('cityId')(
224
-             <SelectCity />,
227
+            <SelectCity />,
225 228
           )}
226 229
         </Form.Item>
227 230
         <Form.Item>
@@ -259,22 +262,22 @@ const handleSubmit = (e, props) => {
259 262
           )}
260 263
         </Form.Item>
261 264
         <Form.Item>
262
-        <AuthButton name="admin.advert.search" noRight={null}>
263
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
264
-            搜索
265
+          <AuthButton name="admin.advert.search" noRight={null}>
266
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
267
+              搜索
265 268
           </Button>
266 269
           </AuthButton>
267 270
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
268
-              重置
271
+            重置
269 272
             </Button>
270 273
         </Form.Item>
271 274
       </Form>
272 275
       <AuthButton name="admin.advert.post" noRight={null}>
273 276
         <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
274 277
       </AuthButton>
275
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList"/>
278
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />
276 279
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
277
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current}/>
280
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e, props)} current={data.current} />
278 281
       </div>
279 282
     </>
280 283
   )

+ 109
- 106
src/pages/carouselFigure/carouselFigureList.jsx Wyświetl plik

@@ -9,29 +9,30 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import apis from '../../services/apis';
10 10
 import request from '../../utils/request';
11 11
 import AuthButton from '@/components/AuthButton';
12
+import EditIcon from '@/components/EditIcon';
12 13
 
13 14
 const { Option } = Select;
14 15
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15 16
 
16 17
 const header = (props) => {
17
-  const [ data, setData ] = useState({})
18
-//   const [page, changePage] = useState({})
18
+  const [data, setData] = useState({})
19
+  //   const [page, changePage] = useState({})
19 20
 
20 21
   useEffect(() => {
21 22
     getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
22
-  },[])
23
+  }, [])
23 24
 
24 25
   // 查询列表
25 26
   const getList = (params) => {
26
-    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
27
-        console.log(data)
28
-        setData(data)
27
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
28
+      console.log(data)
29
+      setData(data)
29 30
     })
30 31
   }
31 32
 
32
-  
33
-// 跳转到编辑页面
34
-const toEditCarouse = (contentId) => () => {
33
+
34
+  // 跳转到编辑页面
35
+  const toEditCarouse = (contentId) => () => {
35 36
     router.push({
36 37
       pathname: '/carouselFigure/editCarousel',
37 38
       query: {
@@ -39,7 +40,7 @@ const toEditCarouse = (contentId) => () => {
39 40
       },
40 41
     });
41 42
   }
42
-  
43
+
43 44
   const columns = [
44 45
     {
45 46
       title: '主图',
@@ -59,22 +60,22 @@ const toEditCarouse = (contentId) => () => {
59 60
       dataIndex: 'buildingName',
60 61
       key: 'buildingName',
61 62
       align: 'center',
62
-      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
63 64
     },
64 65
     {
65 66
       title: '关联内容类型',
66 67
       dataIndex: 'contentType',
67 68
       key: 'contentType',
68 69
       align: 'center',
69
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : 
70
-                                       contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' :  contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无' }</span>
70
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
71
+        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
71 72
     },
72 73
     {
73 74
       title: '发布位置',
74 75
       dataIndex: 'showPosition',
75 76
       key: 'showPosition',
76 77
       align: 'center',
77
-      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
78
+      render: (showPosition) => <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
78 79
     },
79 80
     {
80 81
       title: '发布时间',
@@ -88,114 +89,116 @@ const toEditCarouse = (contentId) => () => {
88 89
       dataIndex: 'status',
89 90
       key: 'status',
90 91
       align: 'center',
91
-      render: (status)=> <><span>{status == 1 ? '已上架' : '已下架'}</span></>
92
+      render: (status) => <><span>{status == 1 ? '已上架' : '已下架'}</span></>
92 93
     },
93 94
     {
94 95
       title: '操作',
95 96
       dataIndex: 'handle',
96 97
       key: 'handle',
97 98
       align: 'center',
98
-      render: (x,row) => (
99
+      render: (x, row) => (
99 100
         <>
100
-          <AuthButton name="admin.extendContent.publish" noRight={null}>
101
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer'}} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-          </AuthButton>
103
-          <AuthButton name="admin.extendContent.id.put" noRight={null}>
104
-            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
105
-          </AuthButton>
106
-          <AuthButton name="admin.extendContent.delete" noRight={null}>
107
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
108
-          </AuthButton>
101
+          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
102
+            <AuthButton name="admin.extendContent.publish" noRight={null}>
103
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={changeStatus(row)}>{row.status === 1 ? <EditIcon text="下架" color='#FF4A4A' type="down"></EditIcon> : <EditIcon text="上架" color='#ff925c' type="up"></EditIcon>}</span>
104
+            </AuthButton>
105
+            <AuthButton name="admin.extendContent.id.put" noRight={null}>
106
+              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditCarouse(row.contentId)}><EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon></span>
107
+            </AuthButton>
108
+            <AuthButton name="admin.extendContent.delete" noRight={null}>
109
+              <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}><EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon></span>
110
+            </AuthButton>
111
+          </div>
109 112
         </>
110 113
       )
111 114
     },
112 115
   ];
113
-  
116
+
114 117
   const finishDynamic = (row) => {
115
-      Modal.confirm({
116
-          title: '结束以后将无法编辑, 是否继续?',
117
-          okText: '确定',
118
-          cancelText: '取消',
119
-          onOk() {
120
-            request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
121
-                  console.log(data)
122
-                  message.info('操作成功!')
123
-                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
124
-              }).catch((err) => {
125
-                  console.log(err)
126
-                  message.info(err.msg || err.message)
127
-              })
128
-          },
129
-        });
118
+    Modal.confirm({
119
+      title: '结束以后将无法编辑, 是否继续?',
120
+      okText: '确定',
121
+      cancelText: '取消',
122
+      onOk() {
123
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
124
+          console.log(data)
125
+          message.info('操作成功!')
126
+          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
127
+        }).catch((err) => {
128
+          console.log(err)
129
+          message.info(err.msg || err.message)
130
+        })
131
+      },
132
+    });
130 133
   }
131
-  
132
-//删除
133
-const deleteCarouse = (contentId) => () =>{
134
-  Modal.confirm({
135
-    title: '确认删除此数据?',
136
-    okText: '确定',
137
-    cancelText: '取消',
138
-    onOk() {
139
-      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
134
+
135
+  //删除
136
+  const deleteCarouse = (contentId) => () => {
137
+    Modal.confirm({
138
+      title: '确认删除此数据?',
139
+      okText: '确定',
140
+      cancelText: '取消',
141
+      onOk() {
142
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
143
+          message.info('操作成功!')
144
+          getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
145
+        }).catch((err) => {
146
+          console.log(err)
147
+          message.info(err.msg || err.message)
148
+        })
149
+      },
150
+    });
151
+  }
152
+
153
+  //   停用启用
154
+  const changeStatus = (row) => () => {
155
+    console.log(row)
156
+    if (row.status === 0) {
157
+
158
+      Modal.confirm({
159
+        title: '确认发布此数据?',
160
+        okText: '确定',
161
+        cancelText: '取消',
162
+        onOk() {
163
+          row.status = 1
164
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
140 165
             message.info('操作成功!')
141 166
             getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
142
-        }).catch((err) => {
167
+          }).catch((err) => {
143 168
             console.log(err)
169
+            row.status = 0
144 170
             message.info(err.msg || err.message)
145
-        })
146
-    },
147
-  });
148
-}
171
+          })
172
+        },
173
+      });
174
+    } else if (row.status === 1) {
149 175
 
150
-//   停用启用
151
-  const changeStatus = (row) => () => {
152
-      console.log(row)
153
-      if(row.status === 0) {
154
-        
155
-        Modal.confirm({
156
-          title: '确认发布此数据?',
157
-          okText: '确定',
158
-          cancelText: '取消',
159
-          onOk() {
176
+      Modal.confirm({
177
+        title: '停用后不会再显示在小程序端',
178
+        okText: '确定',
179
+        cancelText: '取消',
180
+        onOk() {
181
+          row.status = 0
182
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
183
+            message.info('操作成功!')
184
+            getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
185
+          }).catch((err) => {
186
+            console.log(err)
160 187
             row.status = 1
161
-            request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
162
-                  message.info('操作成功!')
163
-                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
164
-              }).catch((err) => {
165
-                  console.log(err)
166
-                  row.status = 0
167
-                  message.info(err.msg || err.message)
168
-              })
169
-          },
170
-        });
171
-      }else if(row.status === 1){
172
-        
173
-        Modal.confirm({
174
-          title: '停用后不会再显示在小程序端',
175
-          okText: '确定',
176
-          cancelText: '取消',
177
-          onOk() {
178
-            row.status = 0
179
-            request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
180
-                  message.info('操作成功!')
181
-                  getList({ pageNum: 1, pageSize: 10, showType: 'banner' })
182
-              }).catch((err) => {
183
-                  console.log(err)
184
-                  row.status = 1
185
-                  message.info(err.msg || err.message)
186
-              })
187
-          },
188
-        });
189
-      }
188
+            message.info(err.msg || err.message)
189
+          })
190
+        },
191
+      });
192
+    }
190 193
 
191 194
   }
192
-  
195
+
193 196
   const changePageNum = (pageNumber) => {
194
-      getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner', ...props.form.getFieldsValue() })
197
+    getList({ pageNum: pageNumber, pageSize: 10, showType: 'banner', ...props.form.getFieldsValue() })
195 198
   }
196 199
 
197 200
   // 提交事件
198
-const handleSubmit = (e, props) => {
201
+  const handleSubmit = (e, props) => {
199 202
     e.preventDefault();
200 203
     props.form.validateFields((err, values) => {
201 204
       if (!err) {
@@ -205,8 +208,8 @@ const handleSubmit = (e, props) => {
205 208
     });
206 209
   }
207 210
 
208
-   //重置搜索
209
-   function handleReset() {
211
+  //重置搜索
212
+  function handleReset() {
210 213
     props.form.resetFields();
211 214
     getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
212 215
   }
@@ -218,7 +221,7 @@ const handleSubmit = (e, props) => {
218 221
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
219 222
         <Form.Item>
220 223
           {getFieldDecorator('cityId')(
221
-             <SelectCity />,
224
+            <SelectCity />,
222 225
           )}
223 226
         </Form.Item>
224 227
         <Form.Item>
@@ -257,22 +260,22 @@ const handleSubmit = (e, props) => {
257 260
           )}
258 261
         </Form.Item>
259 262
         <Form.Item>
260
-        <AuthButton name="admin.extendContent.search" noRight={null}>
261
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
262
-            搜索
263
+          <AuthButton name="admin.extendContent.search" noRight={null}>
264
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
265
+              搜索
263 266
           </Button>
264 267
           </AuthButton>
265 268
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
266
-              重置
269
+            重置
267 270
             </Button>
268 271
         </Form.Item>
269 272
       </Form>
270 273
       <AuthButton name="admin.extendContent.post" noRight={null}>
271 274
         <Button type="danger" className={styles.addBtn} onClick={toEditCarouse()}>新增</Button>
272 275
       </AuthButton>
273
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
276
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList" />
274 277
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
275
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
278
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
276 279
       </div>
277 280
     </>
278 281
   )

+ 38
- 37
src/pages/carouselFigure/customImg/list.jsx Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal,Breadcrumb } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../../style/GoodsList.less';
5 5
 import router from 'umi/router';
@@ -7,73 +7,74 @@ import BuildSelect from '../../../components/SelectButton/BuildSelect'
7 7
 import apis from '../../../services/apis';
8 8
 import request from '../../../utils/request'
9 9
 import AuthButton from '@/components/AuthButton';
10
+import EditIcon from '@/components/EditIcon';
10 11
 
11 12
 const { Option } = Select;
12 13
 const { Column } = Table;
13 14
 
14 15
 function header(props) {
15 16
   // 获取初始化数据
16
-  const [ data, setData ] = useState([])
17
+  const [data, setData] = useState([])
17 18
 
18 19
   useEffect(() => {
19 20
     getList({ pageNum: 1, pageSize: 10 });
20
-  },[])
21
+  }, [])
21 22
 
22 23
   // 查询列表
23 24
   const getList = (params) => {
24
-    request({ ...apis.carsuseFigure.customImg, params: { ...params },}).then((data) => {
25
-        console.log(data,"datadata")
26
-        if(data.records.length > 0){
27
-          setData(data.records)
28
-        }else{
29
-          setData([
30
-            {'imgUrl':'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg','imgType':'index','imgDesc':'小程序首页分享配图'},
31
-            {'imgUrl':'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png','imgType':'indexNews','imgDesc':'首页资讯logo'}
32
-          ])
33
-        }
34
-        
25
+    request({ ...apis.carsuseFigure.customImg, params: { ...params }, }).then((data) => {
26
+      console.log(data, "datadata")
27
+      if (data.records.length > 0) {
28
+        setData(data.records)
29
+      } else {
30
+        setData([
31
+          { 'imgUrl': 'https://estateagents.oss-cn-shanghai.aliyuncs.com/miniapp/upload/images/1574145199853-97feda7895c65be33aa234a7b81b37f.jpg', 'imgType': 'index', 'imgDesc': '小程序首页分享配图' },
32
+          { 'imgUrl': 'http://njcj.oss-cn-shanghai.aliyuncs.com/icon.png', 'imgType': 'indexNews', 'imgDesc': '首页资讯logo' }
33
+        ])
34
+      }
35
+
35 36
     })
36 37
   }
37
-  
38
-    // 跳转到编辑商品
38
+
39
+  // 跳转到编辑商品
39 40
   const toEditCustom = (imgId, imgType) => () => {
40 41
     router.push({
41 42
       pathname: '/carouselFigure/customImg/edit',
42 43
       query: {
43 44
         imgId,
44
-        imgType:imgType
45
+        imgType: imgType
45 46
       },
46 47
     });
47 48
   }
48 49
 
49
- 
50
+
50 51
   // const { getFieldDecorator } = props.form
51 52
   return (
52 53
 
53 54
     <>
54 55
       <Table dataSource={data}>
55
-        <Column title="图片" dataIndex="imgUrl" key="imgUrl" 
56
-        render={(text, record) => (
57
-        <img src={record.imgUrl} height="120px" width="150px" style={{ objectFit: 'contain' }}/>
58
-        )}/>
59
-        <Column title="类型" dataIndex="imgType" key="imgType" 
60
-        render={(text, record) => (
61
-          <span>
62
-            {record.imgType === 'index' ?'首页分享': record.imgType === 'indexNews' ? '首页资讯' : '请编辑'}
63
-          </span>
56
+        <Column title="图片" dataIndex="imgUrl" key="imgUrl"
57
+          render={(text, record) => (
58
+            <img src={record.imgUrl} height="120px" width="150px" style={{ objectFit: 'contain' }} />
59
+          )} />
60
+        <Column title="类型" dataIndex="imgType" key="imgType"
61
+          render={(text, record) => (
62
+            <span>
63
+              {record.imgType === 'index' ? '首页分享' : record.imgType === 'indexNews' ? '首页资讯' : '请编辑'}
64
+            </span>
64 65
           )}
65 66
         />
66 67
         <Column title="说明" dataIndex="imgDesc" key="imgDesc" />
67
-        <Column title="操作" 
68
-        dataIndex="handle" 
69
-        key="handle" 
70
-        render={(text, record) => (
71
-          <AuthButton name="admin.custom.put" noRight={null}>
72
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId, record.imgType)}>
73
-              编辑<Icon type="form" className={styles.edit} />
74
-            </span>
75
-          </AuthButton>
76
-          )}/>/>
68
+        <Column title="操作"
69
+          dataIndex="handle"
70
+          key="handle"
71
+          render={(text, record) => (
72
+            <AuthButton name="admin.custom.put" noRight={null}>
73
+              <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditCustom(record.imgId, record.imgType)}>
74
+                <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
75
+              </span>
76
+            </AuthButton>
77
+          )} />/>
77 78
       </Table>,
78 79
     </>
79 80
   )

+ 106
- 103
src/pages/carouselFigure/propagandaList.jsx Wyświetl plik

@@ -9,29 +9,30 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import apis from '../../services/apis';
10 10
 import request from '../../utils/request';
11 11
 import AuthButton from '@/components/AuthButton';
12
+import EditIcon from '@/components/EditIcon';
12 13
 
13 14
 const { Option } = Select;
14 15
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15 16
 
16 17
 const header = (props) => {
17
-  const [ data, setData ] = useState({})
18
-//   const [page, changePage] = useState({})
18
+  const [data, setData] = useState({})
19
+  //   const [page, changePage] = useState({})
19 20
 
20 21
   useEffect(() => {
21 22
     getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
22
-  },[])
23
+  }, [])
23 24
 
24 25
   // 查询列表
25 26
   const getList = (params) => {
26
-    request({ ...apis.carsuseFigure.extendContent, params: { ...params },}).then((data) => {
27
-        console.log(data)
28
-        setData(data)
27
+    request({ ...apis.carsuseFigure.extendContent, params: { ...params }, }).then((data) => {
28
+      console.log(data)
29
+      setData(data)
29 30
     })
30 31
   }
31 32
 
32
-  
33
-// 跳转到编辑商品
34
-const toEdit = (contentId) => () => {
33
+
34
+  // 跳转到编辑商品
35
+  const toEdit = (contentId) => () => {
35 36
     router.push({
36 37
       pathname: '/carouselFigure/propaganda',
37 38
       query: {
@@ -39,7 +40,7 @@ const toEdit = (contentId) => () => {
39 40
       },
40 41
     });
41 42
   }
42
-  
43
+
43 44
   const columns = [
44 45
     {
45 46
       title: '主图',
@@ -59,15 +60,15 @@ const toEdit = (contentId) => () => {
59 60
       dataIndex: 'buildingName',
60 61
       key: 'buildingName',
61 62
       align: 'center',
62
-      render: (buildingName) => <span>{ buildingName === null ? '无' : buildingName }</span>
63
+      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
63 64
     },
64 65
     {
65 66
       title: '关联内容类型',
66 67
       dataIndex: 'contentType',
67 68
       key: 'contentType',
68 69
       align: 'center',
69
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : 
70
-                                       contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无' }</span>
70
+      render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
71
+        contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '销售批次详情' : contentType === 'live' ? '直播活动详情' : '无'}</span>
71 72
     },
72 73
     // {
73 74
     //   title: '发布位置',
@@ -88,106 +89,108 @@ const toEdit = (contentId) => () => {
88 89
       dataIndex: 'status',
89 90
       key: 'status',
90 91
       align: 'center',
91
-      render: (status)=> <><span>{status == 1 ? '上架' : '下架'}</span></>
92
+      render: (status) => <><span>{status == 1 ? '上架' : '下架'}</span></>
92 93
     },
93 94
     {
94 95
       title: '操作',
95 96
       dataIndex: 'handle',
96 97
       key: 'handle',
97 98
       align: 'center',
98
-      render: (x,row) => (
99
+      render: (x, row) => (
99 100
         <>
100
-          <AuthButton name="admin.propaganda.publish" noRight={null}>
101
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={changeStatus(row)}>{ row.status === 1 ? '下架' : '上架' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-          </AuthButton>
103
-          <AuthButton name="admin.propaganda.put" noRight={null}>
104
-            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}>编辑<Icon type="form" className={styles.edit} /></span>
105
-          </AuthButton>
106
-          <AuthButton name="admin.propaganda.delete" noRight={null}>
107
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}>删除<Icon type="vertical-align-top" className={styles.edit} /></span>
108
-          </AuthButton>
101
+          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
102
+            <AuthButton name="admin.propaganda.publish" noRight={null}>
103
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={changeStatus(row)}>{row.status === 1 ? <EditIcon text="下架" color='#FF4A4A' type="down"></EditIcon> : <EditIcon text="上架" color='#ff925c' type="up"></EditIcon>}</span>
104
+            </AuthButton>
105
+            <AuthButton name="admin.propaganda.put" noRight={null}>
106
+              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEdit(row.contentId)}><EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon></span>
107
+            </AuthButton>
108
+            <AuthButton name="admin.propaganda.delete" noRight={null}>
109
+              <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={deleteCarouse(row.contentId)}><EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon></span>
110
+            </AuthButton>
111
+          </div>
109 112
         </>
110 113
       )
111 114
     },
112 115
   ];
113
-  
116
+
114 117
   const finishDynamic = (row) => {
115
-      Modal.confirm({
116
-          title: '结束以后将无法编辑, 是否继续?',
117
-          okText: '确定',
118
-          cancelText: '取消',
119
-          onOk() {
120
-              request({ ...apis.carsuseFigure.finish, data: {dynamicId: row.dynamicId, top: ""},}).then((data) => {
121
-                  console.log(data)
122
-                  message.info('操作成功!')
123
-                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
124
-              }).catch((err) => {
125
-                  console.log(err)
126
-                  message.info(err.msg || err.message)
127
-              })
128
-          },
129
-        });
118
+    Modal.confirm({
119
+      title: '结束以后将无法编辑, 是否继续?',
120
+      okText: '确定',
121
+      cancelText: '取消',
122
+      onOk() {
123
+        request({ ...apis.carsuseFigure.finish, data: { dynamicId: row.dynamicId, top: "" }, }).then((data) => {
124
+          console.log(data)
125
+          message.info('操作成功!')
126
+          getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
127
+        }).catch((err) => {
128
+          console.log(err)
129
+          message.info(err.msg || err.message)
130
+        })
131
+      },
132
+    });
130 133
   }
131
-  
134
+
132 135
   //删除
133
-const deleteCarouse = (contentId) => () =>{
134
-  Modal.confirm({
135
-    title: '确认删除此数据?',
136
-    okText: '确定',
137
-    cancelText: '取消',
138
-    onOk() {
139
-      request({ ...apis.carsuseFigure.deleteExtendContent,urlData:{id: contentId}}).then((data) => {
136
+  const deleteCarouse = (contentId) => () => {
137
+    Modal.confirm({
138
+      title: '确认删除此数据?',
139
+      okText: '确定',
140
+      cancelText: '取消',
141
+      onOk() {
142
+        request({ ...apis.carsuseFigure.deleteExtendContent, urlData: { id: contentId } }).then((data) => {
143
+          message.info('操作成功!')
144
+          getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
145
+        }).catch((err) => {
146
+          console.log(err)
147
+          message.info(err.msg || err.message)
148
+        })
149
+      },
150
+    });
151
+  }
152
+
153
+  //   停用启用
154
+  const changeStatus = (row) => () => {
155
+    console.log(row)
156
+    if (row.status === 0) {
157
+
158
+      Modal.confirm({
159
+        title: '确认发布此数据?',
160
+        okText: '确定',
161
+        cancelText: '取消',
162
+        onOk() {
163
+          row.status = 1
164
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
140 165
             message.info('操作成功!')
141 166
             getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
142
-        }).catch((err) => {
167
+          }).catch((err) => {
143 168
             console.log(err)
144 169
             message.info(err.msg || err.message)
145
-        })
146
-    },
147
-  });
148
-}
170
+          })
171
+        },
172
+      });
173
+    } else if (row.status === 1) {
149 174
 
150
-//   停用启用
151
-  const changeStatus = (row) => () => {
152
-      console.log(row)
153
-      if(row.status === 0) {
154
-        
155
-        Modal.confirm({
156
-          title: '确认发布此数据?',
157
-          okText: '确定',
158
-          cancelText: '取消',
159
-          onOk() {
160
-            row.status = 1
161
-              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
162
-                  message.info('操作成功!')
163
-                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
164
-              }).catch((err) => {
165
-                  console.log(err)
166
-                  message.info(err.msg || err.message)
167
-              })
168
-          },
169
-        });
170
-      }else if(row.status === 1){
171
-        
172
-        Modal.confirm({
173
-          title: '停用后不会再显示在小程序端',
174
-          okText: '确定',
175
-          cancelText: '取消',
176
-          onOk() {
177
-            row.status = 0
178
-              request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: row.contentId}, data: row,}).then((data) => {
179
-                  message.info('操作成功!')
180
-                  getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
181
-              }).catch((err) => {
182
-                  console.log(err)
183
-                  message.info(err.msg || err.message)
184
-              })
185
-          },
186
-        });
187
-      }
175
+      Modal.confirm({
176
+        title: '停用后不会再显示在小程序端',
177
+        okText: '确定',
178
+        cancelText: '取消',
179
+        onOk() {
180
+          row.status = 0
181
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: row.contentId }, data: row, }).then((data) => {
182
+            message.info('操作成功!')
183
+            getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' })
184
+          }).catch((err) => {
185
+            console.log(err)
186
+            message.info(err.msg || err.message)
187
+          })
188
+        },
189
+      });
190
+    }
188 191
 
189 192
   }
190
-  
193
+
191 194
   const changePageNum = (pageNumber, props) => {
192 195
     props.form.validateFields((err, values) => {
193 196
       if (!err) {
@@ -197,7 +200,7 @@ const deleteCarouse = (contentId) => () =>{
197 200
   }
198 201
 
199 202
   // 提交事件
200
-const handleSubmit = (e, props) => {
203
+  const handleSubmit = (e, props) => {
201 204
     e.preventDefault();
202 205
     props.form.validateFields((err, values) => {
203 206
       if (!err) {
@@ -207,8 +210,8 @@ const handleSubmit = (e, props) => {
207 210
     });
208 211
   }
209 212
 
210
-   //重置搜索
211
-   function handleReset() {
213
+  //重置搜索
214
+  function handleReset() {
212 215
     props.form.resetFields();
213 216
     getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
214 217
   }
@@ -219,9 +222,9 @@ const handleSubmit = (e, props) => {
219 222
 
220 223
     <>
221 224
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
222
-      <Form.Item>
225
+        <Form.Item>
223 226
           {getFieldDecorator('cityId')(
224
-             <SelectCity />,
227
+            <SelectCity />,
225 228
           )}
226 229
         </Form.Item>
227 230
         <Form.Item>
@@ -259,22 +262,22 @@ const handleSubmit = (e, props) => {
259 262
           )}
260 263
         </Form.Item>
261 264
         <Form.Item>
262
-        <AuthButton name="admin.advert.search" noRight={null}>
263
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
264
-            搜索
265
+          <AuthButton name="admin.advert.search" noRight={null}>
266
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
267
+              搜索
265 268
           </Button>
266 269
           </AuthButton>
267 270
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
268
-              重置
271
+            重置
269 272
             </Button>
270 273
         </Form.Item>
271 274
       </Form>
272 275
       <AuthButton name="admin.propaganda.post" noRight={null}>
273 276
         <Button type="danger" className={styles.addBtn} onClick={toEdit()}>新增</Button>
274 277
       </AuthButton>
275
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList"/>
278
+      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList" />
276 279
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
277
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e,props)} current={data.current}/>
280
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e, props)} current={data.current} />
278 281
       </div>
279 282
     </>
280 283
   )

+ 1
- 1
src/pages/channel/channelList.jsx Wyświetl plik

@@ -82,7 +82,7 @@ const columns = [
82 82
     render: (text, record) => (
83 83
       <AuthButton name="admin.channel.id.put" noRight={null}>
84 84
         <a style={{ display: 'flex', justifyContent: 'center' }} onClick={() => toedit(record.channelId)} >
85
-          <EditIcon text="编辑" color='#ff925c' position="-144"></EditIcon>
85
+          <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
86 86
         </a>
87 87
       </AuthButton>
88 88
     ),

+ 75
- 72
src/pages/house/house/edit/components/house.jsx Wyświetl plik

@@ -11,6 +11,7 @@ import FloorSelect from '../../../../../components/HouseSelect/FloorSelect'
11 11
 import RoomSelect from '../../../../../components/HouseSelect/RoomSelect'
12 12
 import ApartmentSelect from '../../../../../components/HouseSelect/ApartmentSelect';
13 13
 import styles from '../../../../style/GoodsList.less';
14
+import EditIcon from '@/components/EditIcon';
14 15
 
15 16
 /**
16 17
  *图片设置
@@ -39,24 +40,24 @@ function House(props) {
39 40
 
40 41
   function getList(params) {
41 42
     // 网路请求
42
-    request({ ...apis.house.taHousingResources, params: { ...params,salesBatchId: props.salesBatchId,buildingId: props.buildingId } }).then(res => {
43
-      console.log(res,"resresres")
43
+    request({ ...apis.house.taHousingResources, params: { ...params, salesBatchId: props.salesBatchId, buildingId: props.buildingId } }).then(res => {
44
+      console.log(res, "resresres")
44 45
       setData(res)
45 46
     }).catch(err => {
46 47
       openNotificationWithIcon('error', err.message)
47 48
     })
48 49
   }
49 50
 
50
-    // 重置搜索
51
-    function handleReset () {
52
-      props.form.resetFields();
53
-      getList({ pageNumber: 1, pageSize: 10 })
54
-    }
51
+  // 重置搜索
52
+  function handleReset() {
53
+    props.form.resetFields();
54
+    getList({ pageNumber: 1, pageSize: 10 })
55
+  }
55 56
 
56
-      // 分页
57
+  // 分页
57 58
   function changePageNum(pageNumber) {
58 59
     // eslint-disable-next-line react-hooks/rules-of-hooks
59
-    getList({ pageNumber: pageNumber, pageSize: 10,...props.form.getFieldsValue()})
60
+    getList({ pageNumber: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
60 61
   }
61 62
 
62 63
   const rowSelection = {
@@ -74,7 +75,7 @@ function House(props) {
74 75
 
75 76
   //打开model
76 77
   function showAparement() {
77
-    if(houseIdList.length < 1){
78
+    if (houseIdList.length < 1) {
78 79
       openNotificationWithIcon('error', '请先选择需要改变的房源')
79 80
       return
80 81
     }
@@ -91,32 +92,32 @@ function House(props) {
91 92
     props.form.validateFields((err, values) => {
92 93
       if (!err) {
93 94
         console.log('提交数据: ', values)
94
-        
95
+
95 96
         getList({ pageNumber: 1, pageSize: 10, ...values })
96 97
       }
97 98
     });
98 99
   }
99 100
 
100
-    // model提交事件
101
-    const handleSubmitApartMent = e => {
102
-      props.form.validateFields((err, values) => {
103
-        // if (!err) {
104
-          if(!values.apartmentIdSelected){
105
-            openNotificationWithIcon('error', '请选择户型')
106
-            return
107
-          }
108
-          request({ ...apis.house.changeApartment, data: { apartmentId: values.apartmentIdSelected, houseIdList } }).then(res => {
109
-            setViable(false)
110
-            setSelectedRowKeys([])
111
-            setHouseIdList([])
112
-            getList({ pageNumber: data.current, pageSize: 10 })
113
-            openNotificationWithIcon('success', '操作成功')
114
-          }).catch(err => {
115
-            openNotificationWithIcon('error', err.message)
116
-          })
117
-        // }
118
-      });
119
-    }
101
+  // model提交事件
102
+  const handleSubmitApartMent = e => {
103
+    props.form.validateFields((err, values) => {
104
+      // if (!err) {
105
+      if (!values.apartmentIdSelected) {
106
+        openNotificationWithIcon('error', '请选择户型')
107
+        return
108
+      }
109
+      request({ ...apis.house.changeApartment, data: { apartmentId: values.apartmentIdSelected, houseIdList } }).then(res => {
110
+        setViable(false)
111
+        setSelectedRowKeys([])
112
+        setHouseIdList([])
113
+        getList({ pageNumber: data.current, pageSize: 10 })
114
+        openNotificationWithIcon('success', '操作成功')
115
+      }).catch(err => {
116
+        openNotificationWithIcon('error', err.message)
117
+      })
118
+      // }
119
+    });
120
+  }
120 121
   /**
121 122
    * 删除
122 123
    *
@@ -137,7 +138,7 @@ function House(props) {
137 138
           // openNotificationWithIcon('error', err.message)
138 139
         })
139 140
       },
140
-      onCancel() {},
141
+      onCancel() { },
141 142
     });
142 143
   }
143 144
 
@@ -150,7 +151,7 @@ function House(props) {
150 151
     },
151 152
     {
152 153
       title: '房源',
153
-      render:  (x, row) => <><span>{row.termName}/{row.blockName}/{row.unitName}/{row.floorName}/{row.roomName}</span></>,
154
+      render: (x, row) => <><span>{row.termName}/{row.blockName}/{row.unitName}/{row.floorName}/{row.roomName}</span></>,
154 155
     },
155 156
     // {
156 157
     //   title: '期/区',
@@ -221,8 +222,10 @@ function House(props) {
221 222
       key: 'apartmentId',
222 223
       render: (_, record) => (
223 224
         <>
224
-          <Button type="link" style={{ color: 'red' }} onClick={() => showEdi({type: "add",houseId: record.houseId})}>编辑<Icon type="form" className={styles.edit} /></Button>
225
-          <Button type="link" style={{ color: 'red' }} onClick={() => deleteHouseResource(record)}>删除<Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} /></Button>
225
+          <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
226
+            <div style={{ marginRight: '16px' }} onClick={() => showEdi({ type: "add", houseId: record.houseId })}> <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon></div>
227
+            <div onClick={() => deleteHouseResource(record)}><EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon></div>
228
+          </div>
226 229
         </>
227 230
       ),
228 231
     },
@@ -230,48 +233,48 @@ function House(props) {
230 233
   const { getFieldDecorator } = props.form
231 234
   return (
232 235
     <>
233
-    <Form layout="inline" onSubmit={e => handleSubmit(e)}>
236
+      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
234 237
         <Form.Item>
235 238
           {getFieldDecorator('termName')(
236
-            <Input placeholder="请输入期/区"/>
239
+            <Input placeholder="请输入期/区" />
237 240
           )}
238 241
         </Form.Item>
239 242
         <Form.Item>
240 243
           {getFieldDecorator('blockName')(
241
-            <Input placeholder="请输入楼栋"/>
244
+            <Input placeholder="请输入楼栋" />
242 245
           )}
243 246
         </Form.Item>
244 247
         <Form.Item>
245 248
           {getFieldDecorator('unitName')(
246
-            <Input placeholder="请输入单元"/>
249
+            <Input placeholder="请输入单元" />
247 250
           )}
248 251
         </Form.Item>
249 252
         <Form.Item>
250 253
           {getFieldDecorator('floorName')(
251
-            <Input placeholder="请输入层"/>
254
+            <Input placeholder="请输入层" />
252 255
           )}
253 256
         </Form.Item>
254 257
         <Form.Item>
255 258
           {getFieldDecorator('roomName')(
256
-             <Input placeholder="请输入房号"/>
259
+            <Input placeholder="请输入房号" />
257 260
           )}
258 261
         </Form.Item>
259 262
         <Form.Item>
260 263
           {getFieldDecorator('apartmentId')(
261
-             <ApartmentSelect buildingId={props.buildingId} />
264
+            <ApartmentSelect buildingId={props.buildingId} />
262 265
           )}
263 266
         </Form.Item>
264 267
         <Form.Item>
265 268
           {getFieldDecorator('status')(
266
-             <Select placeholder="发布状态" style={{width: '120px'}}>
267
-             <Option value="0">否</Option>
268
-             <Option value="1">是</Option>
269
-           </Select>,
269
+            <Select placeholder="发布状态" style={{ width: '120px' }}>
270
+              <Option value="0">否</Option>
271
+              <Option value="1">是</Option>
272
+            </Select>,
270 273
           )}
271 274
         </Form.Item>
272 275
         <Form.Item>
273 276
           {getFieldDecorator('houseId')(
274
-            <Input placeholder="请输入房源编号"/>,
277
+            <Input placeholder="请输入房源编号" />,
275 278
           )}
276 279
         </Form.Item>
277 280
         <Form.Item>
@@ -283,34 +286,34 @@ function House(props) {
283 286
             </Button>
284 287
         </Form.Item>
285 288
       </Form>
286
-      <Button type="primary" onClick={() => showEdi({type: "add",houseId: ''})} style={{ marginTop: '20px'}}>新增房源</Button>
287
-      <Button type="primary" onClick={() => showEdi({type: "batch"})} style={{ marginLeft: '18px'}}>批量导入房源</Button>
288
-      <Button type="primary" onClick={() => showAparement()} style={{ marginLeft: '18px'}}>批量修改对应户型</Button>
289
-      <Button type="danger" style={{ marginLeft: '18px'}} onClick={() => router.go(-1)}>返回</Button>
290
-      <Table rowSelection={rowSelection} dataSource={data.records} columns={columns} pagination={{defaultCurrent:1,current:data.current, total: data.total, onChange: e => changePageNum(e) }} style={{ marginTop: '20px'}} rowKey={r => r.houseId} />
291
-  
289
+      <Button type="danger" onClick={() => showEdi({ type: "add", houseId: '' })} style={{ marginTop: '20px' }}>新增房源</Button>
290
+      <Button type="primary" onClick={() => showEdi({ type: "batch" })} style={{ marginLeft: '18px' }}>批量导入房源</Button>
291
+      <Button type="primary" onClick={() => showAparement()} style={{ marginLeft: '18px' }}>批量修改对应户型</Button>
292
+      <Button type="danger" style={{ marginLeft: '18px' }} onClick={() => router.go(-1)}>返回</Button>
293
+      <Table rowSelection={rowSelection} dataSource={data.records} columns={columns} pagination={{ defaultCurrent: 1, current: data.current, total: data.total, onChange: e => changePageNum(e) }} style={{ marginTop: '20px' }} rowKey={r => r.houseId} />
294
+
292 295
       <Modal
293
-            title="批量修改对应户型"
294
-            width={400}
295
-            destroyOnClose="true"
296
-            footer={null}
297
-            visible={viable}
298
-            onOk={() => this.handleOk()}
299
-            onCancel={e => handleCancel(e)}
300
-          >
301
-            <Form onSubmit={e => handleSubmitApartMent(e)}>
302
-              <Form.Item label="将所选房源对应户型信息修改为" >
303
-                {getFieldDecorator('apartmentIdSelected')(
304
-                <ApartmentSelect buildingId={props.buildingId} />
305
-                )}
306
-              </Form.Item>
307
-              <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
308
-                <Button type="primary" htmlType="submit">保存</Button>
296
+        title="批量修改对应户型"
297
+        width={400}
298
+        destroyOnClose="true"
299
+        footer={null}
300
+        visible={viable}
301
+        onOk={() => this.handleOk()}
302
+        onCancel={e => handleCancel(e)}
303
+      >
304
+        <Form onSubmit={e => handleSubmitApartMent(e)}>
305
+          <Form.Item label="将所选房源对应户型信息修改为" >
306
+            {getFieldDecorator('apartmentIdSelected')(
307
+              <ApartmentSelect buildingId={props.buildingId} />
308
+            )}
309
+          </Form.Item>
310
+          <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
311
+            <Button type="primary" htmlType="submit">保存</Button>
309 312
                 &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
310 313
                 <Button onClick={() => handleCancel()}>取消</Button>
311
-              </Form.Item>
312
-            </Form>
313
-        </Modal>
314
+          </Form.Item>
315
+        </Form>
316
+      </Modal>
314 317
     </>
315 318
   )
316 319
 }

+ 37
- 43
src/pages/indexEcharts/newUsers.jsx Wyświetl plik

@@ -24,7 +24,7 @@ let columns = [
24 24
   },
25 25
 ]
26 26
 
27
-let daterange= []
27
+let daterange = []
28 28
 
29 29
 const header = props => {
30 30
 
@@ -33,22 +33,22 @@ const header = props => {
33 33
   const [data, setDate] = useState({})
34 34
   const [userType, setUserType] = useState({})
35 35
   const [startDate, setStartDate] = useState({})
36
-  
36
+
37 37
 
38 38
   useEffect(() => {
39 39
 
40 40
     setEndDate(new Date())
41 41
     setStartDate(moment().subtract(7, 'day').toDate())
42 42
     // setStartDate(moment().subtract(7, 'day').toDate())
43
-    userResource({startDate: moment().subtract(7, 'day').toDate(), endDate: new Date()})
43
+    userResource({ startDate: moment().subtract(7, 'day').toDate(), endDate: new Date() })
44 44
   }, [])
45 45
 
46 46
   const { RangePicker } = DatePicker;
47 47
 
48
-  function onChangetime (dates, dateStrings) {
48
+  function onChangetime(dates, dateStrings) {
49 49
 
50
-    daterange[1]=`${moment(dateStrings[1]).format('YYYY-MM-DDT00:00:00.000')}Z`
51
-    daterange[0]=`${moment(dateStrings[0]).format('YYYY-MM-DDT00:00:00.000')}Z`
50
+    daterange[1] = `${moment(dateStrings[1]).format('YYYY-MM-DDT00:00:00.000')}Z`
51
+    daterange[0] = `${moment(dateStrings[0]).format('YYYY-MM-DDT00:00:00.000')}Z`
52 52
 
53 53
   }
54 54
 
@@ -60,21 +60,21 @@ const header = props => {
60 60
 
61 61
   const getDataOf = (days) => () => {
62 62
 
63
- 
63
+
64 64
     setEndDate(new Date())
65 65
     setStartDate(moment().subtract(days, 'day').toDate())
66
-    userResource({startDate: moment().subtract(days, 'day').toDate(), endDate: new Date()})
66
+    userResource({ startDate: moment().subtract(days, 'day').toDate(), endDate: new Date() })
67 67
   }
68 68
 
69
-  function onChange (e) {
69
+  function onChange(e) {
70 70
 
71 71
 
72 72
   }
73 73
 
74
-  function datalist () {
74
+  function datalist() {
75 75
     setEndDate(daterange[1])
76 76
     setStartDate(daterange[0])
77
-    userResource({startDate, endDate})
77
+    userResource({ startDate, endDate })
78 78
 
79 79
   }
80 80
 
@@ -84,17 +84,17 @@ const header = props => {
84 84
       params,
85 85
     }).then((data) => {
86 86
       setDate(data);
87
-      onTabledatas(data,"all")
87
+      onTabledatas(data, "all")
88 88
     })
89 89
   }
90 90
 
91
-  const onTabledatas = (e,changeType) => {
91
+  const onTabledatas = (e, changeType) => {
92 92
     e.tdWxDicts.map(x => {
93
-        columns = columns.filter(y => y.key != x.sceneType).concat({
94
-          title: x.sceneAlias,
95
-          dataIndex: x.sceneType,
96
-          key: x.sceneType,
97
-        })
93
+      columns = columns.filter(y => y.key != x.sceneType).concat({
94
+        title: x.sceneAlias,
95
+        dataIndex: x.sceneType,
96
+        key: x.sceneType,
97
+      })
98 98
     })
99 99
     const data = (e.list || []).reduce((acc, item) => {
100 100
       const { sceneType, fromNum, registeredNum, createTime } = item
@@ -103,31 +103,31 @@ const header = props => {
103 103
       return acc
104 104
     }, {})
105 105
 
106
-    const dictData =  e.tdWxDicts.reduce((acc,item,index) => {
106
+    const dictData = e.tdWxDicts.reduce((acc, item, index) => {
107 107
       const { sceneType } = item
108 108
       acc[sceneType] = 0
109 109
       return acc
110
-    },{})
110
+    }, {})
111 111
 
112
-    const tableData = Object.keys(data).map(k => data[k]).reduce((acc,item,index) => {
112
+    const tableData = Object.keys(data).map(k => data[k]).reduce((acc, item, index) => {
113 113
       acc[index] = { ...dictData, ...item }
114 114
       return acc
115
-    },[])
115
+    }, [])
116 116
 
117 117
     setTableData(tableData)
118 118
 
119 119
   }
120
- 
121
-  function handleSelectChange (e) {
120
+
121
+  function handleSelectChange(e) {
122 122
     setUserType(e)
123
-    onTabledatas(data,e)
123
+    onTabledatas(data, e)
124 124
   }
125 125
 
126 126
   function exportUserStats() {
127 127
     console.log(startDate, endDate, userType)
128 128
     request({
129 129
       ...apis.indexEcharts.exportUserStats,
130
-      params: {startDate, endDate, userType},
130
+      params: { startDate, endDate, userType },
131 131
     }).then((data) => {
132 132
       if (!data) {
133 133
         return
@@ -145,14 +145,8 @@ const header = props => {
145 145
   const { Column, ColumnGroup } = Table;
146 146
 
147 147
   return (<>
148
-    <div style={{
149
-      backgroundColor: '#fff',
150
-      padding: '32PX 28px',
151
-      boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)',
152
-      borderRadius: '12px',
153
-      minHeight: '60vh'
154
-    }}>
155
-      <Radio.Group onChange={onChange} buttonStyle="solid" defaultValue="a"  style={{marginBottom:'20px'}}>
148
+    <div >
149
+      <Radio.Group onChange={onChange} buttonStyle="solid" defaultValue="a" style={{ marginBottom: '20px' }}>
156 150
         {/* <Radio.Button value="c" onClick={getDataOf(0)}>今日</Radio.Button> */}
157 151
         <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
158 152
         <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
@@ -170,24 +164,24 @@ const header = props => {
170 164
       <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
171 165
         搜索
172 166
           </Button>
173
-          <Button type="danger" onClick={() => router.go(-1)} style={{ marginBottom: '18px', marginLeft: '30px' }}>返回</Button>  
167
+      <Button onClick={() => router.go(-1)} style={{ float: 'right' }}>返回</Button>
174 168
       <div>
175
-        <NewUsers BuildSelectHide={true} endDate={endDate} startDate={startDate}  dataZoom={true} ></NewUsers>
169
+        <NewUsers BuildSelectHide={true} endDate={endDate} startDate={startDate} dataZoom={true} ></NewUsers>
176 170
         {/* */}
177
-        
171
+
178 172
         <Row>
179
-            <Col span={22}>
173
+          <Col span={22}>
180 174
             <Select style={{ width: '180px' }} placeholder="所有用户" onChange={(e) => handleSelectChange(e)}>
181 175
               <Option value='all'>所有用户</Option>
182 176
               <Option value='registered'>注册用户</Option>
183 177
             </Select>
184
-            </Col>
185
-            <Col span={2}>
186
-              <Button type="primary" onClick={exportUserStats}>导出</Button>
187
-            </Col>
178
+          </Col>
179
+          <Col span={2}>
180
+            <Button type="primary" onClick={exportUserStats}>导出</Button>
181
+          </Col>
188 182
         </Row>
189 183
 
190
-        <Table style={{marginTop:'20px'}} dataSource={tableData} columns={columns} pagination={false} scroll={{ y: 500 }}></Table>
184
+        <Table style={{ marginTop: '20px' }} dataSource={tableData} columns={columns} pagination={false} scroll={{ y: 500 }}></Table>
191 185
       </div>
192 186
     </div>
193 187
   </>

+ 19
- 22
src/pages/news/list/NewsList.jsx Wyświetl plik

@@ -12,6 +12,7 @@ import SelectCity from '../../../components/SelectButton/CitySelect'
12 12
 import Prompt from 'umi/prompt';
13 13
 
14 14
 import AuthButton from '@/components/AuthButton';
15
+import EditIcon from '@/components/EditIcon';
15 16
 
16 17
 
17 18
 const { Option } = Select;
@@ -36,15 +37,15 @@ function body(props) {
36 37
 
37 38
   // eslint-disable-next-line react-hooks/rules-of-hooks
38 39
   useEffect(() => {
39
-    if(localStorage.getItem("newsPageParams")){
40
+    if (localStorage.getItem("newsPageParams")) {
40 41
       props.form.setFieldsValue(JSON.parse(localStorage.getItem("newsPageParams")));
41 42
       // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
42
-      
43
+
43 44
       getList(JSON.parse(localStorage.getItem("newsPageParams")))
44
-    }else{
45
-      localStorage.setItem("newsPageParams",JSON.stringify({ pageNum: 1, pageSize: 6 }));
45
+    } else {
46
+      localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: 1, pageSize: 6 }));
46 47
       getList({ pageNum: 1, pageSize: 6 })
47
-    } 
48
+    }
48 49
   }, [])
49 50
 
50 51
   function getList(params) {
@@ -71,8 +72,8 @@ function body(props) {
71 72
       if (!err) {
72 73
         console.log('提交数据: ', values)
73 74
         const { startDate } = values
74
-        localStorage.setItem("newsPageParams",(JSON.stringify({ pageNum: 1, pageSize: 6 ,...values})));
75
-        getList({ pageNum: 1, pageSize: 6 ,...values})
75
+        localStorage.setItem("newsPageParams", (JSON.stringify({ pageNum: 1, pageSize: 6, ...values })));
76
+        getList({ pageNum: 1, pageSize: 6, ...values })
76 77
       }
77 78
     });
78 79
   }
@@ -197,27 +198,23 @@ function body(props) {
197 198
         </AuthButton>
198 199
 
199 200
         <AuthButton name="admin.taNews.id.put" noRight={null}>
200
-          <span style={{ position: 'absolute', right: '10px', top: '17px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(data.newsId)}>
201
-            编辑
202
-                  <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
201
+          <span style={{ position: 'absolute', right: '10px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(data.newsId)}>
202
+            <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
203 203
           </span>
204 204
         </AuthButton>
205 205
         <AuthButton name="admin.taNews.publish" noRight={null}>
206 206
           {data.newsStatus === 0 ?
207 207
             <span style={{ position: 'absolute', left: '250px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', zIndex: 1, cursor: 'pointer' }} onClick={cancelRelease.bind(this, data.newsId, 1, data.buildingId, data.newsType.newsTypeId)}>
208
-              取消发布
209
-                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
208
+              <EditIcon text="取消发布" color='#FF4A4A' type="cancel"></EditIcon>
210 209
             </span> :
211 210
             <span style={{ position: 'absolute', left: '250px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', zIndex: 1, cursor: 'pointer' }} onClick={cancelRelease.bind(this, data.newsId, 0, data.buildingId, data.newsType.newsTypeId)}>
212
-              发布
213
-                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
211
+              <EditIcon text="发布" color='#ff925c' type="publish"></EditIcon>
214 212
             </span>
215 213
           }
216 214
         </AuthButton>
217 215
         <AuthButton name="admin.taNews.id.delete" noRight={null}>
218 216
           <span style={{ position: 'absolute', right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', zIndex: 1 }} onClick={changeNewsListStatus(data, data.newsId)}>
219
-            删除
220
-                <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
217
+            <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon>
221 218
           </span>
222 219
         </AuthButton>
223 220
         <div style={{ position: 'absolute', left: '240px', top: '0px', padding: '16px 10px', width: '64%' }}>
@@ -259,8 +256,8 @@ function body(props) {
259 256
   function onChange(pageNumber) {
260 257
     props.form.validateFields((err, values) => {
261 258
       if (!err) {
262
-        localStorage.setItem("newsPageParams",JSON.stringify({ pageNum: pageNumber, pageSize: 6, ...values }));
263
-    // eslint-disable-next-line react-hooks/rules-of-hooks
259
+        localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: pageNumber, pageSize: 6, ...values }));
260
+        // eslint-disable-next-line react-hooks/rules-of-hooks
264 261
         getList({ pageNum: pageNumber, pageSize: 6, ...values })
265 262
       }
266 263
     });
@@ -269,7 +266,7 @@ function body(props) {
269 266
   //重置搜索
270 267
   function handleReset() {
271 268
     props.form.resetFields();
272
-    localStorage.setItem("newsPageParams",JSON.stringify({ pageNum: 1, pageSize: 6 }));
269
+    localStorage.setItem("newsPageParams", JSON.stringify({ pageNum: 1, pageSize: 6 }));
273 270
     getList({ pageNum: 1, pageSize: 6 })
274 271
   }
275 272
 
@@ -345,9 +342,9 @@ function body(props) {
345 342
         <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} pageSize={6} onChange={onChange} current={dataSource.current} />
346 343
       </div>
347 344
       <Prompt message={location =>
348
-                          location.pathname.startsWith("/news/list")
349
-                            ? true
350
-                            : localStorage.removeItem("newsPageParams")} />
345
+        location.pathname.startsWith("/news/list")
346
+          ? true
347
+          : localStorage.removeItem("newsPageParams")} />
351 348
     </>
352 349
   );
353 350
 }

+ 2
- 2
src/pages/news/type/NewsType.jsx Wyświetl plik

@@ -108,12 +108,12 @@ function header(props) {
108 108
           <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
109 109
             <AuthButton name="admin.taNewsType.id.delete" noRight={null}>
110 110
               <span style={{ color: '#EF273A', marginRight: '20px', cursor: 'pointer' }} onClick={changeNewsStatus(row, row.newsTypeId)}>
111
-                {row.status == 1 ? <EditIcon text="删除" color='#FF4A4A' position="-180"></EditIcon> : <EditIcon text="上架" color='#ff925c' position="-18"></EditIcon>}
111
+                {row.status == 1 ? <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon> : <EditIcon text="上架" color='#ff925c' type="up"></EditIcon>}
112 112
               </span>
113 113
             </AuthButton>
114 114
             <AuthButton name="admin.taNewsType.id.put" noRight={null}>
115 115
               <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditNews(row.newsTypeId)}>
116
-                <EditIcon text="编辑" color='#ff925c' position="-144"></EditIcon>
116
+                <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
117 117
               </span>
118 118
             </AuthButton>
119 119
           </div>

+ 126
- 124
src/pages/staff/list/RoleList.jsx Wyświetl plik

@@ -9,139 +9,141 @@ import request from '../../../utils/request'
9 9
 import Styles from './style.less';
10 10
 import apis from '../../../services/apis';
11 11
 import AuthButton from '../../../components/AuthButton';
12
+import EditIcon from '@/components/EditIcon';
12 13
 
13 14
 const header = props => {
14
-// function confirm(id) {
15
-//   Modal.confirm({
16
-//     title: '确认停用该角色?',
17
-//     okText: '确认',
18
-//     cancelText: '取消',
19
-//     onOk() {
20
-//     },
21
-//     onCancel() {
22
-//       console.log('Cancel');
23
-//     },
24
-//   });
25
-// }
26
-
27
-function addRole(roleId) {
28
-  router.push({
29
-    pathname: '/staff/list/addRole',
30
-  });
31
-}
32
-
33
-function toEditRole(roleId) {
34
-  router.push({
35
-    pathname: '/staff/list/addRole',
36
-    query: {
37
-      id: roleId,
38
-    },
39
-  });
40
-}
41
-const [data, setData] = useState({ data: [] })
42
-// 初始化角色
43
- useEffect(() => {
44
-   localStorage.removeItem('value');
15
+  // function confirm(id) {
16
+  //   Modal.confirm({
17
+  //     title: '确认停用该角色?',
18
+  //     okText: '确认',
19
+  //     cancelText: '取消',
20
+  //     onOk() {
21
+  //     },
22
+  //     onCancel() {
23
+  //       console.log('Cancel');
24
+  //     },
25
+  //   });
26
+  // }
27
+
28
+  function addRole(roleId) {
29
+    router.push({
30
+      pathname: '/staff/list/addRole',
31
+    });
32
+  }
33
+
34
+  function toEditRole(roleId) {
35
+    router.push({
36
+      pathname: '/staff/list/addRole',
37
+      query: {
38
+        id: roleId,
39
+      },
40
+    });
41
+  }
42
+  const [data, setData] = useState({ data: [] })
43
+  // 初始化角色
44
+  useEffect(() => {
45
+    localStorage.removeItem('value');
45 46
     getRoleList({ pageNum: 1, pageSize: 100 })
46
- }, [])
47
-
48
-//  function getRoleList(params) {
49
-//    request({
50
-//      url: '/api/admin/taRole',
51
-//      method: 'GET',
52
-//      params: { ...params },
53
-//  // eslint-disable-next-line no-shadow
54
-//  }).then(data => {
55
-//      console.log(data)
56
-//      setData(data)
57
-//  })
58
-//  }
59
-
60
- function getRoleList(params) {
61
-  request({ ...apis.role.getRoleList, params: { ...params } }).then((data) => {
62
-    setData(data)
63
-}).catch((err) => {
64
-    console.log(err)
65
-    message.info(err.msg || err.message)
66
-})
67
-}
68
-
47
+  }, [])
48
+
49
+  //  function getRoleList(params) {
50
+  //    request({
51
+  //      url: '/api/admin/taRole',
52
+  //      method: 'GET',
53
+  //      params: { ...params },
54
+  //  // eslint-disable-next-line no-shadow
55
+  //  }).then(data => {
56
+  //      console.log(data)
57
+  //      setData(data)
58
+  //  })
59
+  //  }
60
+
61
+  function getRoleList(params) {
62
+    request({ ...apis.role.getRoleList, params: { ...params } }).then((data) => {
63
+      setData(data)
64
+    }).catch((err) => {
65
+      console.log(err)
66
+      message.info(err.msg || err.message)
67
+    })
68
+  }
69
+
70
+
71
+  function stop(ids, status) {
72
+    Modal.confirm({
73
+      title: "删除后角色对应账号权限也会被自动停用,请谨慎操作",
74
+      okText: '确认',
75
+      cancelText: '取消',
76
+      onOk() {
77
+        request({ ...apis.role.stop, urlData: { id: ids } }).then((data) => {
78
+          getRoleList({ pageNum: 1, pageSize: 100 })
79
+        }).catch((err) => {
80
+          console.log(err)
81
+          message.info(err.msg || err.message)
82
+        })
83
+      }
84
+    });
85
+  }
69 86
 
70
-function stop(ids, status) {
71
-  Modal.confirm({
72
-    title: "删除后角色对应账号权限也会被自动停用,请谨慎操作",
73
-    okText: '确认',
74
-    cancelText: '取消',
75
-    onOk () {
76
-      request({ ...apis.role.stop, urlData: { id: ids } }).then((data) => {
77
-        getRoleList({ pageNum: 1, pageSize: 100 })
78
-      }).catch((err) => {
79
-        console.log(err)
80
-        message.info(err.msg || err.message)
81
-      })
82
-    }
83
-  });
84
-}
87
+  const dataSource = [
88
+    {
89
+      name: '置业顾问',
90
+      status: '1',
91
+    },
92
+    {
93
+      name: '置业经理',
94
+      status: '1',
95
+    },
96
+  ];
97
+
98
+  const columns = [
99
+    // {
100
+    //   title: '商品图片',
101
+    //   dataIndex: 'img',
102
+    //   key: 'img',
103
+    //   align: 'center',
104
+
105
+    //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
106
+    // },
107
+    {
108
+      title: '角色名称',
109
+      dataIndex: 'roleName',
110
+      key: 'roleName',
111
+      align: 'center',
112
+    },
85 113
 
86
-const dataSource = [
87
-  {
88
-    name: '置业顾问',
89
-    status: '1',
90
-  },
91
-  {
92
-    name: '置业经理',
93
-    status: '1',
94
-  },
95
-];
96
-
97
-const columns = [
98
-  // {
99
-  //   title: '商品图片',
100
-  //   dataIndex: 'img',
101
-  //   key: 'img',
102
-  //   align: 'center',
103
-
104
-  //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
105
-  // },
106
-  {
107
-    title: '角色名称',
108
-    dataIndex: 'roleName',
109
-    key: 'roleName',
110
-    align: 'center',
111
-  },
112
-
113
-  {
114
-    title: '操作  ',
115
-    dataIndex: 'status',
116
-    key: 'status',
117
-    align: 'center',
118
-
119
-    render: (text, record) => <>
120
-    {record.isAdmin ? "" : 
121
-      <>
122
-        <AuthButton name="admin.role.publish" noRight={null}>
123
-        <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={() => stop(record.roleId, record.status)}>{ record.status === 1 ? '删除' : '' }
124
-        <Icon type="stop" className={styles.shoppingCart} style={{ fontSize: 14 }}/>
125
-        </span>
126
-        </AuthButton>
127
-        <AuthButton name="admin.role.put" noRight={null}>
128
-        <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={() => toEditRole(record.roleId)} >编辑
129
-        <Icon type="form" className={styles.edit} />
130
-        </span>
131
-        </AuthButton>
132
-      </>
133
-      }
134
-      
135
-    </>,
114
+    {
115
+      title: '操作  ',
116
+      dataIndex: 'status',
117
+      key: 'status',
118
+      align: 'center',
119
+
120
+      render: (text, record) => <>
121
+        {record.isAdmin ? "" :
122
+          <>
123
+            <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
124
+              <AuthButton name="admin.role.publish" noRight={null}>
125
+                <span style={{ marginRight: '20px', cursor: 'pointer' }} onClick={() => stop(record.roleId, record.status)}>{record.status === 1 ? <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon> : ''}
126
+                </span>
127
+              </AuthButton>
128
+              <AuthButton name="admin.role.put" noRight={null}>
129
+                <span style={{ cursor: 'pointer' }} onClick={() => toEditRole(record.roleId)} >
130
+                  <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
131
+                </span>
132
+              </AuthButton>
133
+            </div>
134
+          </>
135
+        }
136
+
137
+      </>,
136 138
 
137
-  },
138
-];
139
+    },
140
+  ];
139 141
 
140 142
 
141
-return (
143
+  return (
142 144
     <>
143
-    <AuthButton name="admin.role.add" noRight={null}>
144
-      <Button type="danger" className={styles.addBtn} onClick={addRole}>新增</Button>
145
+      <AuthButton name="admin.role.add" noRight={null}>
146
+        <Button type="danger" className={styles.addBtn} onClick={addRole}>新增</Button>
145 147
       </AuthButton>
146 148
       <div className={Styles.roletext}>
147 149
 

+ 28
- 28
src/pages/staff/list/StaffList.jsx Wyświetl plik

@@ -1,6 +1,6 @@
1 1
 
2 2
 import React, { useState, useEffect } from 'react';
3
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Row, Col, Tag, Pagination, Modal, DatePicker , Card, Avatar } from 'antd';
3
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Row, Col, Tag, Pagination, Modal, DatePicker, Card, Avatar } from 'antd';
4 4
 import { FormattedMessage } from 'umi-plugin-react/locale';
5 5
 import styles from '../../style/GoodsList.less';
6 6
 import router from 'umi/router';
@@ -10,6 +10,7 @@ import request from '../../../utils/request'
10 10
 import Styles from './style.less';
11 11
 import BuildingSelect from '@/components/SelectButton/BuildSelect';
12 12
 import CustomerChange from '../components/CustomerChange'
13
+import EditIcon from '@/components/EditIcon';
13 14
 
14 15
 const { Meta } = Card;
15 16
 const { Option } = Select;
@@ -39,24 +40,24 @@ const CartBody = props => {
39 40
   const confirm = data => () => {
40 41
     // console.log(data, "11111")
41 42
     if (data.status === 1) {
42
-      if(data.isConsultant){
43
+      if (data.isConsultant) {
43 44
         request({ ...apis.staff.check, params: { userId: data.userId, personId: data.consultantPersonId, buildingId: data.buildingId } }).then(res => {
44
-          if(res.length > 0){
45
+          if (res.length > 0) {
45 46
             Modal.confirm({
46 47
               title: '此置业顾问下有私客,是否转移私客?',
47 48
               okText: '确认',
48 49
               cancelText: '取消',
49
-              onOk () {
50
+              onOk() {
50 51
                 setVisible(true)
51 52
               },
52 53
             });
53
-          }else{
54
+          } else {
54 55
             const titleMessahe = data.isConsultant ? '停用后此员工无法继续登录后台(若为置业顾问停用后在小程序端将成为普通用户)确认进行停用操作?' : '停用后此员工无法继续登录后台,确认进行停用操作?';
55 56
             Modal.confirm({
56 57
               title: titleMessahe,
57 58
               okText: '确认',
58 59
               cancelText: '取消',
59
-              onOk () {
60
+              onOk() {
60 61
                 request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(res => {
61 62
                   message.info('操作成功')
62 63
                   props.onFresh()
@@ -64,14 +65,14 @@ const CartBody = props => {
64 65
               },
65 66
             });
66 67
           }
67
-       })
68
-      }else{
68
+        })
69
+      } else {
69 70
         const titleMessahe = data.isConsultant ? '停用后此员工无法继续登录后台(若为置业顾问停用后在小程序端将成为普通用户)确认进行停用操作?' : '停用后此员工无法继续登录后台,确认进行停用操作?';
70 71
         Modal.confirm({
71 72
           title: titleMessahe,
72 73
           okText: '确认',
73 74
           cancelText: '取消',
74
-          onOk () {
75
+          onOk() {
75 76
             request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then(res => {
76 77
               message.info('操作成功')
77 78
               props.onFresh()
@@ -84,7 +85,7 @@ const CartBody = props => {
84 85
         title: '确认启用该角色?',
85 86
         okText: '确认',
86 87
         cancelText: '取消',
87
-        onOk () {
88
+        onOk() {
88 89
           request({ ...apis.staff.change, urlData: { id: data.userId, type: 'on' } }).then(res => {
89 90
             message.info('操作成功')
90 91
             props.onFresh()
@@ -97,7 +98,7 @@ const CartBody = props => {
97 98
   //迁移私客成功回调
98 99
   const moveSuccess = (e) => {
99 100
     setVisible(false)
100
-    if(e === 'success'){
101
+    if (e === 'success') {
101 102
       confirm(data)()
102 103
     }
103 104
   }
@@ -122,7 +123,7 @@ const CartBody = props => {
122 123
       content: '确认进行离职操作?',
123 124
       okText: '确认',
124 125
       cancelText: '取消',
125
-      onOk () {
126
+      onOk() {
126 127
         request({ ...apis.staff.departure, urlData: { id: row.userId } }).then(() => {
127 128
           message.info('操作成功')
128 129
           props.onFresh()
@@ -139,20 +140,19 @@ const CartBody = props => {
139 140
         <div>
140 141
           <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
141 142
           <AuthButton name="admin.user.put" noRight={null}>
142
-          <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
143
-            编辑
144
-                  <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
145
-          </Button>
143
+            <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
144
+              <EditIcon text="编辑" color='#ff925c' type="edit"></EditIcon>
145
+            </Button>
146 146
           </AuthButton>
147 147
           {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={() => departure(data)}>
148 148
             离职
149 149
                   <Icon type="exclamation-circle" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
150 150
           </Button> */}
151 151
           <AuthButton name="admin.user.publish" noRight={null}>
152
-          <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
153
-            {data.status === 1 ? '停用' : '启用'}
154
-            <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
155
-          </Button>
152
+            <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
153
+              {data.status === 1 ? <EditIcon text="停用" color='#FF4A4A' type="stop"></EditIcon> : <EditIcon text="启用" color='#ff925c' type="start"></EditIcon>}
154
+
155
+            </Button>
156 156
           </AuthButton>
157 157
         </div>
158 158
         <div>
@@ -180,7 +180,7 @@ const CartBody = props => {
180 180
         footer={null}
181 181
         width={900}
182 182
       >
183
-          <CustomerChange userId={data.userId} consultantPersonId={data.consultantPersonId} buildingId={data.buildingId} onSuccess={moveSuccess} />
183
+        <CustomerChange userId={data.userId} consultantPersonId={data.consultantPersonId} buildingId={data.buildingId} onSuccess={moveSuccess} />
184 184
       </Modal>
185 185
     </div>
186 186
   )
@@ -216,7 +216,7 @@ const header = props => {
216 216
   }
217 217
 
218 218
   // 重置搜索
219
-  function handleReset () {
219
+  function handleReset() {
220 220
     props.form.resetFields();
221 221
     getList({ pageNum: 1, pageSize: 8 });
222 222
   }
@@ -279,18 +279,18 @@ const header = props => {
279 279
         </Form.Item>
280 280
 
281 281
         <Form.Item>
282
-        <AuthButton name="admin.user.search" noRight={null}>
283
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
284
-            搜索
282
+          <AuthButton name="admin.user.search" noRight={null}>
283
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
284
+              搜索
285 285
           </Button>
286
-        </AuthButton>
286
+          </AuthButton>
287 287
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
288 288
             重置
289 289
             </Button>
290 290
         </Form.Item>
291 291
       </Form>
292 292
       <AuthButton name="admin.user.add" noRight={null}>
293
-      <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
293
+        <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
294 294
       </AuthButton>
295 295
       <Row style={{ padding: ' 0 10px' }}>
296 296
         {
@@ -304,7 +304,7 @@ const header = props => {
304 304
 
305 305
       {/* 分页  */}
306 306
       <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
307
-        <Pagination showQuickJumper defaultCurrent={1} pageSize={8} total={tempData.total} onChange={onChange} current={tempData.current}/>
307
+        <Pagination showQuickJumper defaultCurrent={1} pageSize={8} total={tempData.total} onChange={onChange} current={tempData.current} />
308 308
       </div>
309 309
     </>
310 310
   )

+ 9
- 8
src/pages/statistical/consultant/index.jsx Wyświetl plik

@@ -44,12 +44,12 @@ function record(props) {
44 44
                 startDate: consultantPageParams.startDate,
45 45
                 endDate: consultantPageParams.endDate,
46 46
                 buildingId: consultantPageParams.buildingId,
47
-                pageNum:consultantPageParams.pageNum
47
+                pageNum: consultantPageParams.pageNum
48 48
             })
49 49
             getList(JSON.parse(localStorage.getItem("consultantPageParams")))
50
-          } else {
50
+        } else {
51 51
             getList(formData);
52
-          }
52
+        }
53 53
     }, [])
54 54
 
55 55
     // 查询列表
@@ -132,7 +132,7 @@ function record(props) {
132 132
         if (val == 0) {
133 133
             return <><span>{val}</span></>
134 134
         }
135
-        return <><span style={{ color: 'blue', cursor: 'pointer' }} onClick={() => toDetail(record, type)} >{val}</span></>
135
+        return <><span style={{ color: '#1D74D9', cursor: 'pointer' }} onClick={() => toDetail(record, type)} >{val}</span></>
136 136
     }
137 137
 
138 138
     // 分享详情
@@ -404,7 +404,7 @@ function record(props) {
404 404
     return (
405 405
 
406 406
         <>
407
-            <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginBottom: '10px' }} onClick={() => setVisible(true)} />
407
+
408 408
             <Modal
409 409
                 title="指标说明(数据会存在一定时间延迟)"
410 410
                 centered
@@ -448,6 +448,7 @@ function record(props) {
448 448
                         <Button type="primary" onClick={handleSubmit}>搜索</Button>
449 449
                         <Button style={{ marginLeft: 8 }} onClick={handleReset}>重置</Button>
450 450
                     </Form.Item>
451
+                    <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00' }} onClick={() => setVisible(true)} />
451 452
                 </div>
452 453
             </Form>
453 454
             <AuthButton name="admin.statistical.consultant.export" noRight={null}>
@@ -468,9 +469,9 @@ function record(props) {
468 469
                 <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
469 470
             </div>
470 471
             <Prompt message={location =>
471
-        location.pathname.startsWith("/statistical/consultant")
472
-          ? true
473
-          : localStorage.removeItem("consultantPageParams")} />
472
+                location.pathname.startsWith("/statistical/consultant")
473
+                    ? true
474
+                    : localStorage.removeItem("consultantPageParams")} />
474 475
         </>
475 476
     )
476 477
 }

+ 132
- 81
src/pages/system/housingPolicy.jsx Wyświetl plik

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
2
+import { Form, Input, Button, Icon, Select, message, Menu, Dropdown, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import styles from '../style/GoodsList.less';
5 5
 import router from 'umi/router';
@@ -9,28 +9,31 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import apis from '../../services/apis';
10 10
 import request from '../../utils/request';
11 11
 import AuthButton from '@/components/AuthButton';
12
+import { DownOutlined } from '@ant-design/icons';
13
+import EditIcon from '@/components/EditIcon';
14
+
12 15
 
13 16
 const { Option } = Select;
14 17
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15 18
 
16 19
 const header = (props) => {
17
-  const [ data, setData ] = useState({})
20
+  const [data, setData] = useState({})
18 21
 
19 22
   useEffect(() => {
20
-    getList({ pageNum: 1, pageSize: 10,cityId: '' });
21
-  },[])
23
+    getList({ pageNum: 1, pageSize: 10, cityId: '' });
24
+  }, [])
22 25
 
23 26
   // 查询列表
24 27
   const getList = (params) => {
25 28
     request({ ...apis.system.getTaPolicy, params: { ...params }, }).then((data) => {
26
-        console.log(data)
27
-        setData(data)
29
+      console.log(data)
30
+      setData(data)
28 31
     })
29 32
   }
30 33
 
31
-  
32
-// 跳转到编辑商品
33
-const toEditPolicy = (policyId) => () => {
34
+
35
+  // 跳转到编辑商品
36
+  const toEditPolicy = (policyId) => () => {
34 37
     router.push({
35 38
       pathname: '/system/editPolicy',
36 39
       query: {
@@ -38,14 +41,47 @@ const toEditPolicy = (policyId) => () => {
38 41
       },
39 42
     });
40 43
   }
41
-  
44
+
42 45
   /**
43 46
    *
44 47
    *
45 48
    * @param {*} props
46 49
    * @returns
47 50
    */
48
-  
51
+
52
+  const menu = (row) => (
53
+    <Menu>
54
+      <Menu.Item>
55
+        <AuthButton name="admin.taPolicy.top" noRight={null}>
56
+          <span style={{ cursor: 'pointer' }} onClick={topPolicy(row)}>{row.weight === 1 ? <EditIcon text="取消置顶" color='#666' type="cancel"></EditIcon> : <EditIcon text="置顶" color='#666' type="top"></EditIcon>}</span>
57
+        </AuthButton>
58
+      </Menu.Item>
59
+      <Menu.Item>
60
+        <AuthButton name="admin.taPolicy.publish" noRight={null}>
61
+          <span style={{ cursor: 'pointer' }} onClick={publicOrNoPublic(row)}>{row.publishStatus === 0 ? <EditIcon text="发布" color='#666' type="publish"></EditIcon> : <EditIcon text="取消发布" color='#666' type="cancel"></EditIcon>}</span>
62
+        </AuthButton>
63
+      </Menu.Item>
64
+      <Menu.Item>
65
+        <AuthButton name="admin.taPolicy.id.put" noRight={null}>
66
+          <span style={{ cursor: 'pointer' }} onClick={toEditPolicy(row.policyId)}> <EditIcon text="编辑" color='#666' type="edit"></EditIcon></span>
67
+        </AuthButton>
68
+      </Menu.Item>
69
+      <Menu.Item>
70
+        <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
71
+          <span style={{ cursor: 'pointer' }} onClick={deletePolicy(row.policyId)}>  <EditIcon text="删除" color='#FF4A4A' type="delete"></EditIcon></span>
72
+        </AuthButton>
73
+      </Menu.Item>
74
+
75
+    </Menu>
76
+
77
+
78
+
79
+
80
+
81
+
82
+
83
+
84
+  );
49 85
   const columns = [
50 86
     {
51 87
       title: '购房须知主图',
@@ -78,97 +114,112 @@ const toEditPolicy = (policyId) => () => {
78 114
       dataIndex: 'publishStatus',
79 115
       key: 'publishStatus',
80 116
       align: 'center',
81
-      render: (publishStatus)=> <><span>{publishStatus === 1 ? '已发布' : '未发布' }</span></>
117
+      render: (publishStatus) => <><span>{publishStatus === 1 ? '已发布' : '未发布'}</span></>
82 118
     },
83 119
     {
84 120
       title: '操作',
85 121
       dataIndex: 'handle',
86 122
       key: 'handle',
87 123
       align: 'center',
88
-      render: (x,row) => (
124
+      render: (x, row) => (
89 125
         <>
90
-          <AuthButton name="admin.taPolicy.publish" noRight={null}>
91
-            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={publicOrNoPublic(row)}>{ row.publishStatus === 0 ? '发布' : '取消发布' }<Icon type="close-circle" className={styles.edit} /></span>
92
-          </AuthButton> 
93
-          <AuthButton name="admin.taPolicy.top" noRight={null}>
94
-            <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={topPolicy(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
95
-          </AuthButton>
96
-          <AuthButton name="admin.taPolicy.id.put" noRight={null}>
97
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditPolicy(row.policyId)}>编辑<Icon type="form" className={styles.edit} /></span>
98
-          </AuthButton>
99
-          <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
100
-            <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={deletePolicy(row.policyId)}>删除<Icon type="form" className={styles.edit} /></span>
101
-          </AuthButton>
126
+          <Dropdown overlay={menu(row)}>
127
+            <a style={{ color: '#666' }} onClick={e => e.preventDefault()}>
128
+              <span style={{ color: '#FF4A4A' }} >更多</span> <DownOutlined />
129
+            </a>
130
+          </Dropdown>
102 131
         </>
103 132
       )
104 133
     },
134
+    // {
135
+    //   title: '操作',
136
+    //   dataIndex: 'handle',
137
+    //   key: 'handle',
138
+    //   align: 'center',
139
+    //   render: (x,row) => (
140
+    //     <>
141
+    //       <AuthButton name="admin.taPolicy.publish" noRight={null}>
142
+    //         <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={publicOrNoPublic(row)}>{ row.publishStatus === 0 ? '发布' : '取消发布' }<Icon type="close-circle" className={styles.edit} /></span>
143
+    //       </AuthButton> 
144
+    //       <AuthButton name="admin.taPolicy.top" noRight={null}>
145
+    //         <span style={{ color: '#1990FF', marginRight: '20px',cursor: 'pointer' }} onClick={topPolicy(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
146
+    //       </AuthButton>
147
+    //       <AuthButton name="admin.taPolicy.id.put" noRight={null}>
148
+    //         <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={toEditPolicy(row.policyId)}>编辑<Icon type="form" className={styles.edit} /></span>
149
+    //       </AuthButton>
150
+    //       <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
151
+    //         <span style={{ color: '#FF925C',cursor: 'pointer' }} onClick={deletePolicy(row.policyId)}>删除<Icon type="form" className={styles.edit} /></span>
152
+    //       </AuthButton>
153
+    //     </>
154
+    //   )
155
+    // },
105 156
   ];
106
-  
157
+
107 158
   // 删除
108
-const deletePolicy = (policyId) => () => {
109
-  Modal.confirm({
110
-    title: '购房政策会被删除,小程序端和后台都无法再看到',
111
-    okText: '确定',
112
-    cancelText: '取消',
113
-    onOk() {
114
-        request({ ...apis.system.deleteTaPolicy, urlData: {id: policyId }, }).then((data) => {
115
-            message.info('操作成功!')
116
-            getList({ pageNum: 1, pageSize: 10,cityId: '' });
159
+  const deletePolicy = (policyId) => () => {
160
+    Modal.confirm({
161
+      title: '购房政策会被删除,小程序端和后台都无法再看到',
162
+      okText: '确定',
163
+      cancelText: '取消',
164
+      onOk() {
165
+        request({ ...apis.system.deleteTaPolicy, urlData: { id: policyId }, }).then((data) => {
166
+          message.info('操作成功!')
167
+          getList({ pageNum: 1, pageSize: 10, cityId: '' });
117 168
         }).catch((err) => {
118
-            console.log(err)
119
-            message.info(err.msg || err.message)
169
+          console.log(err)
170
+          message.info(err.msg || err.message)
120 171
         })
121
-    },
122
-  });
123
-}
172
+      },
173
+    });
174
+  }
124 175
 
125 176
 
126
-//   置顶
177
+  //   置顶
127 178
   const topPolicy = (row) => () => {
128
-      const weight = Math.abs(row.weight - 1)
129
-      row.weight = weight
130
-      request({ ...apis.system.updateTaPolicy, urlData: {id: row.policyId},data: row, }).then((data) => {
179
+    const weight = Math.abs(row.weight - 1)
180
+    row.weight = weight
181
+    request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
182
+      console.log(data)
183
+      message.info('操作成功!')
184
+      getList({ pageNum: 1, pageSize: 10, cityId: '' });
185
+    }).catch((err) => {
186
+      console.log(err)
187
+      message.info(err.msg || err.message)
188
+    })
189
+  }
190
+
191
+  const publicOrNoPublic = (row) => () => {
192
+    if (row.publishStatus === 1) {
193
+      row.publishStatus = 0
194
+    } else {
195
+      row.publishStatus = 1
196
+    }
197
+    const title = row.publishStatus === 0 ? '购房政策会在小程序端隐藏,后台可继续编辑重新发布' : '确认发布此数据'
198
+    Modal.confirm({
199
+      title: title,
200
+      okText: '确定',
201
+      cancelText: '取消',
202
+      onOk() {
203
+        request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
131 204
           console.log(data)
132 205
           message.info('操作成功!')
133
-          getList({ pageNum: 1, pageSize: 10,cityId: '' });
134
-      }).catch((err) => {
206
+          getList({ pageNum: 1, pageSize: 10, cityId: '' });
207
+        }).catch((err) => {
135 208
           console.log(err)
136 209
           message.info(err.msg || err.message)
137
-      })
138
-  }
139
-  
140
-  const publicOrNoPublic = (row) => () => {
141
-      if (row.publishStatus === 1) {
142
-        row.publishStatus = 0
143
-      } else {
144
-        row.publishStatus = 1
145
-      }
146
-      const title = row.publishStatus === 0 ? '购房政策会在小程序端隐藏,后台可继续编辑重新发布' : '确认发布此数据'
147
-      Modal.confirm({
148
-        title: title,
149
-        okText: '确定',
150
-        cancelText: '取消',
151
-        onOk() {
152
-          request({ ...apis.system.updateTaPolicy, urlData: {id: row.policyId},data: row, }).then((data) => {
153
-            console.log(data)
154
-            message.info('操作成功!')
155
-            getList({ pageNum: 1, pageSize: 10,cityId: '' });
156
-            }).catch((err) => {
157
-                console.log(err)
158
-                message.info(err.msg || err.message)
159
-            })
160
-        },
161
-      });
162
-
163
-      
210
+        })
211
+      },
212
+    });
213
+
214
+
164 215
   }
165
-  
216
+
166 217
   const changePageNum = (pageNumber) => {
167
-      getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
218
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
168 219
   }
169 220
 
170 221
   // 提交事件
171
-const handleSubmit = (e, props) => {
222
+  const handleSubmit = (e, props) => {
172 223
     e.preventDefault();
173 224
     props.form.validateFields((err, values) => {
174 225
       if (!err) {
@@ -189,9 +240,9 @@ const handleSubmit = (e, props) => {
189 240
           )}
190 241
         </Form.Item>
191 242
         <Form.Item>
192
-        <AuthButton name="admin.taPolicy.search" noRight={null}>
193
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
194
-            搜索
243
+          <AuthButton name="admin.taPolicy.search" noRight={null}>
244
+            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
245
+              搜索
195 246
           </Button>
196 247
           </AuthButton>
197 248
         </Form.Item>
@@ -199,9 +250,9 @@ const handleSubmit = (e, props) => {
199 250
       <AuthButton name="admin.taPolicy.post" noRight={null}>
200 251
         <Button type="danger" className={styles.addBtn} onClick={toEditPolicy()}>新增</Button>
201 252
       </AuthButton>
202
-      <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false}/>
253
+      <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false} />
203 254
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
204
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
255
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
205 256
       </div>
206 257
     </>
207 258
   )