Browse Source

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

许静 5 years ago
parent
commit
9c2b82cb4e

+ 1
- 1
src/components/SelectButton/CitySelect.jsx View File

30
   }
30
   }
31
 
31
 
32
   return (
32
   return (
33
-      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择城市" onChange={props.onChange}>
33
+      <Select showSearch value={props.value} style={{ width: '180px' }} placeholder="请选择城市" onChange={props.onChange}>
34
           {data.map(city => (
34
           {data.map(city => (
35
             <Option key={city.id} value={city.id}>{city.name}</Option>
35
             <Option key={city.id} value={city.id}>{city.name}</Option>
36
           ))}
36
           ))}

+ 18
- 6
src/pages/building/list/add/components/base.jsx View File

60
       if (res.receivedDate !== null) {
60
       if (res.receivedDate !== null) {
61
         res.receivedDate = moment(res.receivedDate)
61
         res.receivedDate = moment(res.receivedDate)
62
       }
62
       }
63
+      if (res.buildingTag !== null) {
64
+        res.tag = res.buildingTag.map((item, _) => item.tagName)
65
+      }
63
 
66
 
64
       res.avatarImage = res.buildingImg.map(item => item.url)
67
       res.avatarImage = res.buildingImg.map(item => item.url)
65
       props.form.setFieldsValue(res)
68
       props.form.setFieldsValue(res)
80
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
83
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
81
     // 项目主图
84
     // 项目主图
82
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
85
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
86
+    if (data.tag) {
87
+      data.tag = data.tag.map((item, _) => ({ tagName: item }))
88
+    }
83
 
89
 
84
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
90
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
85
     request({ ...api, data: { ...data } }).then(() => {
91
     request({ ...api, data: { ...data } }).then(() => {
108
             {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
114
             {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
109
           </Form.Item>
115
           </Form.Item>
110
           <Form.Item label="均价" hasFeedback>
116
           <Form.Item label="均价" hasFeedback>
111
-            {getFieldDecorator('price')(<Input />)}
117
+            {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}m²/元
112
           </Form.Item>
118
           </Form.Item>
113
           <Form.Item label="开盘时间"  hasFeedback>
119
           <Form.Item label="开盘时间"  hasFeedback>
114
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
120
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
128
             )}
134
             )}
129
           </Form.Item>
135
           </Form.Item>
130
           <Form.Item label="销售状态" hasFeedback>
136
           <Form.Item label="销售状态" hasFeedback>
131
-            {getFieldDecorator('marketStatus')(<Input />)}
137
+            {getFieldDecorator('marketStatus')(
138
+              <Select placeholder="销售状态" style={{ width: '1016px' }}>
139
+                <Option value="待定">待定</Option>
140
+                <Option value="在售">在售</Option>
141
+                <Option value="售完">售完</Option>
142
+              </Select>,
143
+            )}
132
           </Form.Item>
144
           </Form.Item>
133
-          <Form.Item label="标签" hasFeedback style={{ display: 'none' }}>
134
-            {getFieldDecorator('tags')(
135
-              <Select mode="multiple" placeholder="标签" style={{ width: '1016px' }}>
136
-                <Option value="未知">未知</Option>
145
+          <Form.Item label="项目标签" hasFeedback>
146
+            {getFieldDecorator('tag')(
147
+              <Select mode="tags" placeholder="输入后选中" style={{ width: '1016px' }}>
148
+                
137
               </Select>,
149
               </Select>,
138
             )}
150
             )}
139
           </Form.Item>
151
           </Form.Item>

+ 2
- 2
src/pages/building/list/add/components/imageSet.jsx View File

94
 
94
 
95
   const columns = [
95
   const columns = [
96
     {
96
     {
97
-      title: '名称',
97
+      title: '户型名称',
98
       dataIndex: 'apartmentName',
98
       dataIndex: 'apartmentName',
99
       key: 'apartmentName',
99
       key: 'apartmentName',
100
     },
100
     },
136
 
136
 
137
   return (
137
   return (
138
     <>
138
     <>
139
-      <Button type="primary" onClick={() => showEdi()}>新增户型</Button>
139
+      <Button type="primary" onClick={() => showEdi()}>新增户型</Button>
140
       <Table dataSource={data} columns={columns} pagination={false} rowKey="imageSet" />
140
       <Table dataSource={data} columns={columns} pagination={false} rowKey="imageSet" />
141
 
141
 
142
       {/* 编辑页 */}
142
       {/* 编辑页 */}

+ 2
- 2
src/pages/building/list/add/components/modalImage.jsx View File

165
               <Form.Item label="名称">
165
               <Form.Item label="名称">
166
                 {getFieldDecorator('apartmentName')(<Input />)}
166
                 {getFieldDecorator('apartmentName')(<Input />)}
167
               </Form.Item>
167
               </Form.Item>
168
-              {/* <Form.Item label="类型">
168
+              <Form.Item label="类型">
169
                 {getFieldDecorator('apartmentType')(
169
                 {getFieldDecorator('apartmentType')(
170
                   <Select placeholder="类型">
170
                   <Select placeholder="类型">
171
                     <Option value="apart">户型</Option>
171
                     <Option value="apart">户型</Option>
172
                     <Option value="photo">相册</Option>
172
                     <Option value="photo">相册</Option>
173
                   </Select>,
173
                   </Select>,
174
                 )}
174
                 )}
175
-              </Form.Item> */}
175
+              </Form.Item>
176
               <Form.Item label="销售状态">
176
               <Form.Item label="销售状态">
177
                 {getFieldDecorator('marketStatus')(
177
                 {getFieldDecorator('marketStatus')(
178
                   <Select placeholder="销售状态">
178
                   <Select placeholder="销售状态">

+ 1
- 1
src/pages/building/list/add/index.jsx View File

49
           props.location.query.id &&
49
           props.location.query.id &&
50
           (
50
           (
51
             <>
51
             <>
52
-              <Radio.Button value="image">图片</Radio.Button>
52
+              <Radio.Button value="image">户型库</Radio.Button>
53
               <Radio.Button value="poster">海报图片</Radio.Button>
53
               <Radio.Button value="poster">海报图片</Radio.Button>
54
               <Radio.Button value="share">分享设置</Radio.Button>
54
               <Radio.Button value="share">分享设置</Radio.Button>
55
             </>
55
             </>

+ 50
- 31
src/pages/channel/brokerList.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select } from 'antd';
2
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import channels from './channelList.less';
4
 import channels from './channelList.less';
5
 import router from 'umi/router';
5
 import router from 'umi/router';
125
       // eslint-disable-next-line react-hooks/rules-of-hooks
125
       // eslint-disable-next-line react-hooks/rules-of-hooks
126
       getListBroker({ pageNum: pageNumber, pageSize: 10 })
126
       getListBroker({ pageNum: pageNumber, pageSize: 10 })
127
     }
127
     }
128
-    // 获取input的值
129
-    function onInputChangePhone (e) {
130
-      // const InputValue = e.target.name.x.value;
131
-      setQueryData({ ...queryData, name: e.target.value })
132
-   }
128
+  //   // 获取input的值
129
+  //   function onInputChangeName (e) {
130
+  //     // const InputValue = e.target.name.x.value;
131
+  //     setQueryData({ ...queryData, name: e.target.value })
132
+  //  }
133
 
133
 
134
-   function onInputChangeName (e) {
135
-    // const InputValue = e.target.name.x.value;
136
-    setQueryData({ ...queryData, phone: e.target.value })
137
-  }
138
-  function refurbishList () {
139
-    getListBroker({ pageNum: 1, pageSize: 10 })
140
-  }
134
+  //  function onInputChangePhone (e) {
135
+  //   // const InputValue = e.target.name.x.value;
136
+  //   setQueryData({ ...queryData, phone: e.target.value })
137
+  // }
138
+  // function refurbishList () {
139
+  //   getListBroker({ pageNum: 1, pageSize: 10 })
140
+  // }
141
   // eslint-disable-next-line no-undef
141
   // eslint-disable-next-line no-undef
142
-  function handleClick() {
143
-    alert('11', this)
144
-    console.log('this is:', this);
142
+  // function handleClick() {
143
+  //   alert('11', this)
144
+  //   console.log('this is:', this);
145
+  // }
146
+
147
+  function handleSubmit(e) {
148
+    e.preventDefault();
149
+    props.form.validateFields((err, values) => {
150
+      console.log('values', values)
151
+      if (!err) {
152
+        console.log('values', values)
153
+        getListBroker({ ...queryData, pageNum: 1, pageSize: 10, channelId: props.location.query.id, name: values.name, phone: values.phone })
154
+      }
155
+    });
145
   }
156
   }
157
+
158
+  function handleReset() {
159
+    props.form.resetFields();
160
+    getListBroker({ pageNum: 1, pageSize: 10, channelId: props.location.query.id })
161
+  }
162
+  const { getFieldDecorator } = props.form;
146
 return (
163
 return (
147
   <>
164
   <>
148
-    <div className={ channels.searchBox }>
149
-      <div style = {{ marginLeft: '-5px' }}>
150
-        <span className={ channels.selectName }>姓名</span>
151
-        <Input onChange = { onInputChangePhone } style ={{ width: 150 }} />
152
-        <span className={ channels.selectName }>电话</span>
153
-        <Input onChange = { onInputChangeName } style ={{ width: 150 }} />
154
-      </div>
155
-      <div>
156
-      <Button type="primary" onClick={() => queryList() }>查询</Button>
157
-      {/* <Button onClick={() => refurbishList() }>重置</Button> */}
158
-    </div>
159
-    </div>
160
-    <Table style={{marginTop:'40px'}} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList"/>
165
+   <Form layout="inline" onSubmit={handleSubmit}>
166
+   <Form.Item label="姓名">
167
+          {getFieldDecorator('name', {
168
+          })(<Input/>)}
169
+        </Form.Item>
170
+    <Form.Item label="电话">
171
+      {getFieldDecorator('phone', {
172
+      })(<Input/>)}
173
+    </Form.Item>
174
+    <Form.Item >
175
+   <Button type="primary" htmlType="submit" >保存</Button>
176
+     <Button onClick={handleReset} style={{ marginLeft: 18 }}>重置</Button>
177
+    </Form.Item>
178
+   </Form>
179
+    <Table style={{ marginTop: '40px' }} dataSource={data.list} columns={columns} pagination={{ pageSize: 10, total: data.total, onChange }} rowKey="brokerList"/>
161
   </>
180
   </>
162
 )
181
 )
163
 }
182
 }
164
-
183
+const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);
165
 function handleMenuClick(e) {
184
 function handleMenuClick(e) {
166
   message.info('Click on menu item.');
185
   message.info('Click on menu item.');
167
   console.log('click', e);
186
   console.log('click', e);
168
 }
187
 }
169
-export default header
188
+export default WrappedNormalLoginForm

+ 1
- 1
src/pages/channel/channelList.jsx View File

64
     dataIndex: 'brokerCount',
64
     dataIndex: 'brokerCount',
65
     key: 'brokerCount',
65
     key: 'brokerCount',
66
     align: 'center',
66
     align: 'center',
67
-      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.recommendCount }</a>,
67
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick= {() => toBroker(record)} >{ record.brokerCount }</a>,
68
   },
68
   },
69
   {
69
   {
70
     title: '推荐客户有效',
70
     title: '推荐客户有效',

+ 4
- 4
src/pages/indexEcharts/components/UserBehavior.jsx View File

116
       activity: props.activity,
116
       activity: props.activity,
117
       event: props.event,
117
       event: props.event,
118
       eventType: props.eventType,
118
       eventType: props.eventType,
119
+      buildingId: props.buildingId,
119
     })
120
     })
120
     // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
121
     // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
121
-  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType])
122
+  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType, props.buildingId])
122
 
123
 
123
   const [recordList, setList] = useState([])
124
   const [recordList, setList] = useState([])
124
   function getUserBehaviorSummary(params) {
125
   function getUserBehaviorSummary(params) {
127
       params,
128
       params,
128
     }).then(data => {
129
     }).then(data => {
129
       setData(data || {})
130
       setData(data || {})
130
-      setList(data.data.records || [])
131
-
131
+      setList((data.data.records || []).filter(e => e.activity !== '客户'))
132
     })
132
     })
133
   }
133
   }
134
 
134
 
135
 
135
 
136
-  const seriesMaker = (data.selectUserBehavior || []).reduce((series, item) => {
136
+  const seriesMaker = (data.selectUserBehavior || []).filter(e => e.activity !== '客户').reduce((series, item) => {
137
     let { date, activityCount, activity } = item
137
     let { date, activityCount, activity } = item
138
     date = moment(date).format('YYYY-MM-DD')
138
     date = moment(date).format('YYYY-MM-DD')
139
     if (!activityCount) activityCount = 0
139
     if (!activityCount) activityCount = 0

+ 46
- 26
src/pages/indexEcharts/components/UserConversion.jsx View File

13
 const UserSource = props => {
13
 const UserSource = props => {
14
 
14
 
15
   const [theCurrent, setTheCurrent] = useState({ records: [] })
15
   const [theCurrent, setTheCurrent] = useState({ records: [] })
16
-
16
+  const [conversionRate, setConversionRate] = useState(0)
17
   useEffect(() => {
17
   useEffect(() => {
18
     UserConversionRate({ conversion: 'authorization_phone' })
18
     UserConversionRate({ conversion: 'authorization_phone' })
19
   }, [])
19
   }, [])
20
 
20
 
21
- function UserConversionRate(params) {
22
-   
23
-      request({
24
-        ...apis.indexEcharts.userConversion,
25
-        params,
26
-      }).then(data => {
27
-        setDataset(data, params.conversion)
28
-      })
21
+  function UserConversionRate (params) {
22
+
23
+    request({
24
+      ...apis.indexEcharts.userConversion,
25
+      params,
26
+    }).then(data => {  
27
+      console.log(data.data_count.registeredCount/data.data_count.pvNum,'1241234')
28
+      setDataset(data, params.conversion)
29
+    })
29
   }
30
   }
30
 
31
 
31
- function setDataset(data, theStatis) {
32
+  function setDataset (data, theStatis) {
32
     const { pvNum, ...other } = data.data_count
33
     const { pvNum, ...other } = data.data_count
33
 
34
 
34
     // 获取第一个值
35
     // 获取第一个值
41
     if (pvNum < num) {
42
     if (pvNum < num) {
42
       setTheCurrent([])
43
       setTheCurrent([])
43
     } else {
44
     } else {
45
+
46
+      setConversionRate(num/pvNum)
44
       setTheCurrent([
47
       setTheCurrent([
45
         { name: getStatisName(theStatis), value: num },
48
         { name: getStatisName(theStatis), value: num },
46
         { name: '其余', value: pvNum - num },
49
         { name: '其余', value: pvNum - num },
48
     }
51
     }
49
   }
52
   }
50
 
53
 
51
-  function getStatisName(theStatis) {
52
-     const statisTypes = [
53
-    { label: '授权手机', value: 'authorization_phone' },
54
-    { label: '项目收藏', value: 'building_save' },
55
-    { label: '项目转发', value: 'building_share' },
56
-    { label: '活动收藏', value: 'activity_save' },
57
-    { label: '活动转发', value: 'activity_share' },
58
-    { label: '资讯收藏', value: 'news_save' },
59
-    { label: '资讯转发', value: 'news_share' },
60
-    { label: '活动报名', value: 'activity_sign' },
61
-
62
-  ]
54
+  function getStatisName (theStatis) {
55
+    const statisTypes = [
56
+      { label: '授权手机', value: 'authorization_phone' },
57
+      { label: '项目收藏', value: 'building_save' },
58
+      { label: '项目转发', value: 'building_share' },
59
+      { label: '活动收藏', value: 'activity_save' },
60
+      { label: '活动转发', value: 'activity_share' },
61
+      { label: '资讯收藏', value: 'news_save' },
62
+      { label: '资讯转发', value: 'news_share' },
63
+      { label: '活动报名', value: 'activity_sign' },
64
+
65
+    ]
63
     return statisTypes.filter(x => x.value === theStatis)[0].label
66
     return statisTypes.filter(x => x.value === theStatis)[0].label
64
   }
67
   }
65
 
68
 
66
   const options = {
69
   const options = {
67
     legend: {},
70
     legend: {},
68
-    color: ['#8B7FE2', '#DDDDDD'],
71
+    color: ['#FF7E48', '#dcdcdc'],
69
     tooltip: {},
72
     tooltip: {},
70
     series: {
73
     series: {
71
       type: 'pie',
74
       type: 'pie',
72
       name: '转化率',
75
       name: '转化率',
73
       radius: ['34%', '52%'],
76
       radius: ['34%', '52%'],
77
+      avoidLabelOverlap: false,
78
+      label: { 
79
+        normal: { 
80
+          show: true,
81
+          position: 'center',
82
+          color: '#666666',
83
+          fontSize: 24,
84
+          fontWeight: 'bold',
85
+          formatter: `${(conversionRate*100).toFixed(2) === 'NaN' ? 0 : (conversionRate*100).toFixed(2) }%`, // {b}:数据名; {c}:数据值; {d}:百分比,可以自定义显示内容,
86
+        }
87
+      },
88
+      labelLine: {
89
+        normal: {
90
+          show: false
91
+        }
92
+      },
93
+
74
       data: theCurrent,
94
       data: theCurrent,
75
     },
95
     },
76
   }
96
   }
77
 
97
 
78
-  function onChange(e) {
98
+  function onChange (e) {
79
     UserConversionRate({ conversion: e })
99
     UserConversionRate({ conversion: e })
80
   }
100
   }
81
   const piestyles = {
101
   const piestyles = {
86
   return (
106
   return (
87
     <>
107
     <>
88
       <div>
108
       <div>
89
-      <p style={{ fontSize: '0.12rem', fontWeight: '600' }}>转化率</p>
109
+        <p style={{ fontSize: '0.12rem', fontWeight: '600' }}>转化率</p>
90
 
110
 
91
         <Select
111
         <Select
92
           style={{ width: 200 }}
112
           style={{ width: 200 }}
110
 
130
 
111
     </>
131
     </>
112
   )
132
   )
113
- }
133
+}
114
 
134
 
115
 export default UserSource
135
 export default UserSource

+ 6
- 1
src/pages/indexEcharts/userBehavior.jsx View File

121
     setActivity(value)
121
     setActivity(value)
122
   }
122
   }
123
 
123
 
124
+  const [buildingId, setBuildingId] = useState('')
125
+  function handleBuildingChange(value) {
126
+    setBuildingId(value)
127
+  }
128
+
124
   const columns = [
129
   const columns = [
125
     {
130
     {
126
       title: '访问事件',
131
       title: '访问事件',
200
 
205
 
201
 
206
 
202
       <div style={{ margin: '24px 0' }}>
207
       <div style={{ margin: '24px 0' }}>
203
-        <UserBehavior tableShow={true} BuildSelectHide={true} endDate={endDate} startDate={startDate}  eventType={eventType} activity={activity}  event={event} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
208
+        <UserBehavior tableShow={true} BuildSelectHide={true} buildingId={buildingId} endDate={endDate} startDate={startDate}  eventType={eventType} activity={activity}  event={event} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
204
       </div>
209
       </div>
205
 
210
 
206
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}
211
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}

+ 6
- 1
src/pages/staff/list/addRole.jsx View File

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Checkbox, Input, Card, Form, Button, Row, Col, Spin } from 'antd';
2
+import { Checkbox, Input, Card, Form, Button, Row, Col, Spin, message } from 'antd';
3
 import { connect } from 'dva';
3
 import { connect } from 'dva';
4
 import XForm, { FieldTypes } from '../../../components/XForm';
4
 import XForm, { FieldTypes } from '../../../components/XForm';
5
 import request from '../../../utils/request';
5
 import request from '../../../utils/request';
145
   function handleSubmit(e) {
145
   function handleSubmit(e) {
146
     e.preventDefault();
146
     e.preventDefault();
147
     props.form.validateFields((err, values) => {
147
     props.form.validateFields((err, values) => {
148
+      if (values.roleName === undefined || values.roleName === '') {
149
+        message.error('请输入角色名称')
150
+        return
151
+      }
152
+
148
       if (props.location.query.id !== undefined) {
153
       if (props.location.query.id !== undefined) {
149
         console.log('menus', menus)
154
         console.log('menus', menus)
150
       
155