Преглед изворни кода

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

许静 пре 5 година
родитељ
комит
3c2690c0df

+ 36
- 1
config/config.js Прегледај датотеку

@@ -265,6 +265,11 @@ export default {
265 265
                   name: '资讯列表',
266 266
                   component: './news/list/NewsList',
267 267
                 },
268
+                {
269
+                  path: '/news/list/editNewsList',
270
+                  name: '',
271
+                  component: './news/list/editNewsList',
272
+                },
268 273
               ],
269 274
             },
270 275
             {
@@ -289,6 +294,36 @@ export default {
289 294
                 },
290 295
               ],
291 296
             },
297
+
298
+            {
299
+              path: '/staff',
300
+              name: '员工管理',
301
+              component: '../layouts/BlankLayout',
302
+              routes: [
303
+                {
304
+                  path: '/staff/StaffList',
305
+                  name: '员工列表',
306
+                  component: './staff/list/StaffList',
307
+                },
308
+                {
309
+                  path: '/staff/editStaff',
310
+                  name: '',
311
+                  component: './staff/list/editStaff',
312
+                },
313
+             
314
+                {
315
+                  path: '/staff/RoleList',
316
+                  name: '角色管理',
317
+                  component: './staff/list/RoleList',
318
+                },
319
+                {
320
+                  path: '/staff/editRole',
321
+                  name: '',
322
+                  component: './staff/list/editRole',
323
+                },
324
+             
325
+              ],
326
+            },
292 327
             {
293 328
               component: './404',
294 329
             },
@@ -352,7 +387,7 @@ export default {
352 387
 
353 388
   proxy: {
354 389
     '/api/': {
355
-      target: 'http://192.168.0.84:8080/',
390
+      target: 'http://192.168.0.11:8080/',
356 391
       changeOrigin: true,
357 392
       // pathRewrite: { '^/server': '' },
358 393
     },

+ 40
- 0
src/components/SelectButton/NewTypeSelect.jsx Прегледај датотеку

@@ -0,0 +1,40 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const NewsTypeSelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+
17
+  useEffect(() => {
18
+    getCityList();
19
+  },[])
20
+
21
+  const getCityList = (e) => {
22
+    request({
23
+        url: '/api/admin/taNewsType',
24
+        method: 'GET',
25
+        params: {pageNum: 1,pageSize: 999},
26
+    }).then((data) => {
27
+        setData(data.records)
28
+    })
29
+  }
30
+
31
+  return (
32
+      <Select value={props.value} style={{ width: '180px' }} placeholder="请选择类型" onChange={props.onChange}>
33
+          {data.map(type => (
34
+            <Option key={type.newsTypeId}>{type.newsTypeName}</Option>
35
+          ))}
36
+      </Select>
37
+  )
38
+}
39
+export default NewsTypeSelect
40
+

+ 11
- 17
src/pages/building/type/edi.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Input, Button, Row, Col, Form, Alert } from 'antd';
2
+import { Input, Button, Row, Col, Form, Alert, notification } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import Styles from './style.less';
5 5
 import request from '../../../utils/request';
@@ -40,6 +40,14 @@ function body(props) {
40 40
     })
41 41
   }
42 42
 
43
+  const openNotificationWithIcon = (type, message) => {
44
+    notification[type]({
45
+      message,
46
+      description:
47
+        '',
48
+    });
49
+  }
50
+
43 51
   function submitData(dataSources) {
44 52
     if (id !== '') {
45 53
       // 修改
@@ -51,25 +59,11 @@ function body(props) {
51 59
     dataSources.createDate = new Date()
52 60
     request({ ...apis.buildingType.add, data: { ...dataSources } }).then(() => {
53 61
       // eslint-disable-next-line no-unused-expressions
54
-      <Alert
55
-        style={{
56
-          marginBottom: 24,
57
-        }}
58
-        message="操作成功"
59
-        type="success"
60
-        showIcon
61
-      />
62
+      this.openNotificationWithIcon('success', '操作成功')
62 63
       router.go(-1)
63 64
     }).catch(err => {
64 65
       // eslint-disable-next-line no-unused-expressions
65
-      <Alert
66
-        style={{
67
-          marginBottom: 24,
68
-        }}
69
-        message={ err }
70
-        type="err"
71
-        showIcon
72
-      />
66
+      this.openNotificationWithIcon('error', err)
73 67
     })
74 68
   }
75 69
 

+ 17
- 17
src/pages/channel/addChannel.jsx Прегледај датотеку

@@ -17,21 +17,21 @@ const header = props => {
17 17
   //   addChannel({ pageNum: 1, pageSize: 10 })
18 18
   // }, [])
19 19
 
20
-  function addChannel(params) {
21
-      request({
22
-        url: '/api/admin/channel',
23
-        method: 'POST',
24
-        data: { ...params },
25
-    // eslint-disable-next-line no-shadow
20
+  function addChannel (params) {
21
+    request({
22
+      url: '/api/admin/channel',
23
+      method: 'POST',
24
+      data: { ...params },
25
+      // eslint-disable-next-line no-shadow
26 26
     }).then(data => {
27
-        console.log(data)
28
-        setData(data)
29
-         // eslint-disable-next-line no-unused-expressions
30
-         router.go(-1)
27
+      console.log(data)
28
+      setData(data)
29
+      // eslint-disable-next-line no-unused-expressions
30
+      router.go(-1)
31 31
     })
32 32
   }
33 33
 
34
-  function handleSubmit(e) {
34
+  function handleSubmit (e) {
35 35
     e.preventDefault();
36 36
     props.form.validateFields((err, values) => {
37 37
       if (!err) {
@@ -48,12 +48,12 @@ const header = props => {
48 48
   const { getFieldDecorator } = props.form;
49 49
 
50 50
   return (
51
-  <>
52
-        <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
51
+    <>
52
+      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
53 53
         <Form.Item label="渠道名称">
54 54
           {getFieldDecorator('channelName', {
55 55
             rules: [{ required: true, message: '请输入渠道名称' }],
56
-          })(<Input className={channels.inpuit} / >)}
56
+          })(<Input className={channels.inpuit} />)}
57 57
         </Form.Item>
58 58
         <Form.Item label="联系人">
59 59
           {getFieldDecorator('channelContact', {
@@ -73,13 +73,13 @@ const header = props => {
73 73
           <Button type="primary" htmlType="submit">
74 74
             保存
75 75
           </Button>
76
-          <Button className={channels.formButton} onClick = {() => router.go(-1)} type="primary" htmlType="submit">
76
+          <Button className={channels.formButton} onClick={() => router.go(-1)} type="primary" htmlType="submit">
77 77
             取消
78 78
           </Button>
79 79
         </Form.Item>
80 80
       </Form>
81
-  </>
82
-)
81
+    </>
82
+  )
83 83
 }
84 84
 
85 85
 const WrappedNormalLoginForm = Form.create({ name: 'header' })(header);

+ 0
- 16
src/pages/channel/brokerList.jsx Прегледај датотеку

@@ -27,22 +27,6 @@ const menu = (
27 27
     </Menu.Item>
28 28
   </Menu>
29 29
 );
30
-// const dataSource = [
31
-//   {
32
-//     key: '1',
33
-//     img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
34
-//     name: '123',
35
-//     age: 32,
36
-//     address: '西湖区湖底公园1号',
37
-//   },
38
-//   {
39
-//     key: '2',
40
-//     img: '',
41
-//     age: 42,
42
-//     address: '西湖区湖底公园1号',
43
-//   },
44
-// ];
45
-
46 30
 const columns = [
47 31
   {
48 32
     title: '头像',

+ 0
- 1
src/pages/channel/channelList.jsx Прегледај датотеку

@@ -74,7 +74,6 @@ const columns = [
74 74
     dataIndex: 'agentsInvite',
75 75
     key: 'agentsInvite',
76 76
     align: 'center',
77
-    // render: () => <a>Delete</a>,
78 77
   },
79 78
   {
80 79
     title: '操作',

+ 21
- 12
src/pages/customer/customerlist/components/attribution.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../../utils/request';
5 5
 import apis from '../../../../services/apis';
@@ -31,6 +31,7 @@ class ModalAttribution extends React.Component {
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData.realtyConsultant)
34 35
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
35 36
       this.getList({ pageNumber: 1, pageSize: 5 })
36 37
       this.setState({ visibleData: this.props.visibleData });
@@ -65,34 +66,42 @@ class ModalAttribution extends React.Component {
65 66
     })
66 67
   }
67 68
 
69
+  openNotificationWithIcon = (type, message) => {
70
+    notification[type]({
71
+      message,
72
+      description:
73
+        '',
74
+    });
75
+  };
76
+
68 77
    // 分页
69 78
   onChange(pageNum) {
70 79
     this.getList({ pageNumber: pageNum, pageSize: 5 })
71 80
   }
72 81
 
73 82
   // 提交
74
-  submitGm() {
83
+  submitGm(record) {
75 84
     const { url, method } = apis.customer.recommendEdit
76 85
     const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
77 86
 
78 87
     // 网路请求
79
-    request({ url: tempUrl, method, data: { ...this.state.visibleData } }).then(res => {
88
+    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
89
+      // eslint-disable-next-line no-unused-expressions
90
+      this.openNotificationWithIcon('success', '操作成功')
80 91
       this.handleCancel()
81 92
     }).catch(err => {
82 93
       // eslint-disable-next-line no-unused-expressions
83
-      <Alert
84
-        style={{
85
-          marginBottom: 24,
86
-        }}
87
-        message={err}
88
-        type="error"
89
-        showIcon
90
-      />
94
+      this.openNotificationWithIcon('error', err)
91 95
     })
92 96
   }
93 97
 
94 98
   render() {
95 99
     const columns = [
100
+      // {
101
+      //   title: '编号',
102
+      //   dataIndex: 'personId',
103
+      //   key: 'personId',
104
+      // },
96 105
       {
97 106
         title: '姓名',
98 107
         dataIndex: 'name',
@@ -118,7 +127,7 @@ class ModalAttribution extends React.Component {
118 127
         dataIndex: 'personId',
119 128
         key: 'personId',
120 129
         // eslint-disable-next-line no-nested-ternary
121
-        render: (_, record) => <><Button className={Styles.SubmitButton} onClick={() => this.submitGm()}>确定</Button></>,
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
122 131
       },
123 132
     ]
124 133
     return (

+ 84
- 0
src/pages/customer/customerlist/components/changeStatus.jsx Прегледај датотеку

@@ -0,0 +1,84 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3
+import moment from 'moment';
4
+import request from '../../../../utils/request';
5
+import apis from '../../../../services/apis';
6
+import Styles from '../style.less';
7
+
8
+class ChangeStatus extends React.Component {
9
+  constructor(props) {
10
+    super(props)
11
+    this.state = {
12
+      value: '',
13
+      visibleData: { visible: false, customerId: '' },
14
+    }
15
+  }
16
+
17
+  componentDidUpdate(preProps, preState) {
18
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
19
+      this.setState({ visibleData: { ...this.props.visibleData } })
20
+      this.setState({ value: this.props.visibleData.status })
21
+    }
22
+  }
23
+
24
+  // 弹框取消按钮
25
+  handleCancel() {
26
+    this.setState({ visibleData: { visible: false, customerId: '' } })
27
+  }
28
+
29
+  onChange = e => {
30
+    this.setState({
31
+      value: e.target.value,
32
+    });
33
+  };
34
+
35
+  openNotificationWithIcon = (type, message) => {
36
+    notification[type]({
37
+      message,
38
+      description:
39
+        '',
40
+    });
41
+  };
42
+
43
+  submitButton = e => {
44
+    const { url, method } = apis.customer.recommendEdit
45
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
46
+
47
+    // 网路请求
48
+    request({ url: tempUrl, method, data: { customerId: this.state.visibleData.customerId, status: this.state.value } }).then(res => {
49
+      // eslint-disable-next-line no-unused-expressions
50
+      this.openNotificationWithIcon('success', '操作成功')
51
+      this.handleCancel()
52
+    }).catch(err => {
53
+      // eslint-disable-next-line no-unused-expressions
54
+      this.openNotificationWithIcon('error', err)
55
+    })
56
+  }
57
+
58
+  render() {
59
+    return (
60
+      <>
61
+          <Modal
62
+            title="变更状态"
63
+            width={800}
64
+            destroyOnClose="true"
65
+            footer={null}
66
+            visible={this.state.visibleData.visible}
67
+            // onOk={() => this.handleOk()}
68
+            onCancel={(e) => this.handleCancel(e)}
69
+          >
70
+            <Radio.Group onChange={this.onChange} value={this.state.value}>
71
+              <Radio value={1}>客户报备</Radio>
72
+              <Radio value={2}>客户到访</Radio>
73
+              <Radio value={3}>客户认购</Radio>
74
+              <Radio value={4}>客户签约</Radio>
75
+            </Radio.Group>
76
+
77
+            <Button type="danger" onClick={this.submitButton}>确定</Button>
78
+          </Modal>
79
+      </>
80
+    )
81
+  }
82
+}
83
+
84
+export default ChangeStatus

+ 10
- 11
src/pages/customer/customerlist/components/integralRecord.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions, notification } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../../utils/request';
5 5
 import apis from '../../../../services/apis';
@@ -31,7 +31,6 @@ class ModalIntegralRecord extends React.Component {
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34
-    console.log(this.props.visibleData)
35 34
     if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36 35
       this.getList({ pageNumber: 1, pageSize: 5 })
37 36
       this.setState({ visibleData: this.props.visibleData });
@@ -49,6 +48,14 @@ class ModalIntegralRecord extends React.Component {
49 48
     this.setState({ visibleData: { visible: false, customerId: '' } })
50 49
   }
51 50
 
51
+  openNotificationWithIcon = (type, message) => {
52
+    notification[type]({
53
+      message,
54
+      description:
55
+        '',
56
+    });
57
+  }
58
+
52 59
   getList(params) {
53 60
     const { customerId } = this.state.visibleData
54 61
     if (customerId === '' || customerId === undefined) {
@@ -62,15 +69,7 @@ class ModalIntegralRecord extends React.Component {
62 69
     request({ url: tempUrl, method, params: { ...params } }).then(res => {
63 70
       this.setState({ dataSource: res })
64 71
     }).catch(err => {
65
-      // eslint-disable-next-line no-unused-expressions
66
-      <Alert
67
-        style={{
68
-          marginBottom: 24,
69
-        }}
70
-        message={err}
71
-        type="error"
72
-        showIcon
73
-      />
72
+      this.openNotificationWithIcon('error', err)
74 73
     })
75 74
   }
76 75
 

+ 31
- 3
src/pages/customer/customerlist/index.jsx Прегледај датотеку

@@ -7,6 +7,7 @@ import Styles from './style.less';
7 7
 
8 8
 import Attribution from './components/attribution'
9 9
 import IntegralRecord from './components/integralRecord'
10
+import ChangeStatus from './components/changeStatus'
10 11
 
11 12
 
12 13
 const { Option } = Select;
@@ -39,6 +40,11 @@ function body(props) {
39 40
   const [recordVisibleData, setRecordVisibleData] = useState({ visible: false, customerId: '' })
40 41
   // 积分记录 ============= end
41 42
 
43
+  // 变更状态 ============  start
44
+  // eslint-disable-next-line react-hooks/rules-of-hooks
45
+  const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
46
+  // 变更状态 ============= end
47
+
42 48
   // eslint-disable-next-line react-hooks/rules-of-hooks
43 49
   useEffect(() => {
44 50
     getList({ pageNumber: 1, pageSize: 10, customerType })
@@ -61,8 +67,17 @@ function body(props) {
61 67
     })
62 68
   }
63 69
 
70
+  function displayNone() {
71
+    setRecordVisibleData({ visible: false, customerId: '' })
72
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
73
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
74
+  }
75
+
64 76
   // 提交事件
65 77
   function handleSubmit(e) {
78
+    displayNone()
79
+
80
+
66 81
     e.preventDefault();
67 82
     props.form.validateFields((err, values) => {
68 83
       if (!err) {
@@ -85,6 +100,8 @@ function body(props) {
85 100
 
86 101
   // 私客/公客切换
87 102
   function radioButtonHandleSizeChange(e) {
103
+    displayNone()
104
+
88 105
     const { value } = e.target
89 106
     setCustomerType(value)
90 107
     getList({ pageNumber: 1, pageSize: 10, customerType: value })
@@ -93,14 +110,22 @@ function body(props) {
93 110
   // 这里有个 Bug, 就是 Modal 弹框,会联动出现, 比如 我点击 调整归属的Model弹框, 那么 积分记录的Model弹框莫名其妙的也显示了
94 111
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
95 112
 
96
-function showGM(record) {
113
+  function showGM(record) {
97 114
     setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
98 115
     setRecordVisibleData({ visible: false, customerId: '' })
116
+    setStatusVisibleData({ visible: false, customerId: '' })
99 117
   }
100 118
 
101 119
   function showRecord(record) {
102 120
     setRecordVisibleData({ visible: true, customerId: record.customerId })
103 121
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
122
+    setStatusVisibleData({ visible: false, customerId: '' })
123
+  }
124
+
125
+  function showStatus(record) {
126
+    setRecordVisibleData({ visible: false, customerId: '' })
127
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
128
+    setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
104 129
   }
105 130
 
106 131
   const columns = [
@@ -156,7 +181,7 @@ function showGM(record) {
156 181
       // eslint-disable-next-line no-nested-ternary
157 182
       render: (_, record) => (
158 183
         <>
159
-          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link">变更状态</Button>
184
+          <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showStatus(record)}>变更状态</Button>
160 185
           &nbsp;&nbsp;
161 186
           <Button className={ customerType === 'private' ? Styles.text : Styles.displayS } type="link" onClick={() => showGM(record)}>调整归属</Button>
162 187
           <br/>
@@ -214,7 +239,7 @@ function showGM(record) {
214 239
           )}
215 240
         </Form.Item>
216 241
         <Form.Item>
217
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
242
+          <Button type="danger" htmlType="submit" >
218 243
             搜索
219 244
           </Button>
220 245
         </Form.Item>
@@ -233,6 +258,9 @@ function showGM(record) {
233 258
 
234 259
         {/* 积分记录 */}
235 260
         <IntegralRecord visibleData={recordVisibleData} />
261
+
262
+        {/* 变更状态 */}
263
+        <ChangeStatus visibleData={statusVisibleData} />
236 264
     </>
237 265
   );
238 266
 }

+ 135
- 3
src/pages/customer/independentList/index.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Modal } from 'antd';
3 3
 import moment from 'moment';
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
@@ -11,6 +11,132 @@ const { Option } = Select;
11 11
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12 12
 const { Meta } = Card;
13 13
 
14
+class ModalTable extends React.Component {
15
+  constructor(props) {
16
+    super(props);
17
+    this.state = {
18
+       dataSource: { records: [] },
19
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
20
+    }
21
+  }
22
+
23
+  // 挂载之后
24
+  componentDidMount() {
25
+    this.getList({ pageNumber: 1, pageSize: 5 })
26
+  }
27
+
28
+  componentDidUpdate(preProps, preState) {
29
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
30
+      this.getList({ pageNumber: 1, pageSize: 5 })
31
+      this.setState({ visibleData: this.props.visibleData });
32
+    }
33
+  }
34
+
35
+  // 弹框确定按钮
36
+  // eslint-disable-next-line react/sort-comp
37
+  handleOk() {
38
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
39
+  }
40
+
41
+  // 弹框取消按钮
42
+  handleCancel() {
43
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
44
+  }
45
+
46
+  getList(params) {
47
+    console.log('this.state.visibleData', this.state.visibleData)
48
+    const { customerId } = this.state.visibleData
49
+    if (customerId === '' || customerId === undefined) {
50
+      return
51
+    }
52
+    // 网路请求
53
+    const { url, method } = apis.customer.recommend
54
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
55
+    // 网路请求
56
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
57
+      this.setState({ dataSource: res })
58
+    }).catch(err => {
59
+      // eslint-disable-next-line no-unused-expressions
60
+      <Alert
61
+        style={{
62
+          marginBottom: 24,
63
+        }}
64
+        message={err}
65
+        type="error"
66
+        showIcon
67
+      />
68
+    })
69
+  }
70
+
71
+   // 分页
72
+  onChange(pageNum) {
73
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
74
+  }
75
+
76
+  render() {
77
+    const columns = [
78
+      {
79
+        title: '头像',
80
+        // eslint-disable-next-line jsx-a11y/alt-text
81
+        render: (text, records) => <img src={records.picture } width={50} height={50} />,
82
+      },
83
+      {
84
+        title: '用户名',
85
+        dataIndex: 'name',
86
+        key: 'name',
87
+      },
88
+      {
89
+        title: '电话',
90
+        dataIndex: 'phone',
91
+        key: 'phone',
92
+      },
93
+      {
94
+        title: '性别',
95
+        dataIndex: 'sex',
96
+        key: 'sex',
97
+        render: (text, records) => <span>{ records.sex === 1 ? '男' : '女' }</span>,
98
+      },
99
+      {
100
+        title: '意向项目',
101
+        dataIndex: 'intention',
102
+        key: 'intention',
103
+      },
104
+      {
105
+        title: '推荐时间',
106
+        dataIndex: 'createDate',
107
+        key: 'createDate',
108
+      },
109
+      {
110
+        title: '状态',
111
+        // eslint-disable-next-line consistent-return
112
+        render: (text, records) => {
113
+                                    if (records.status === 1) { return '报备' }
114
+                                    if (records.status === 2) { return '到访' }
115
+                                    if (records.status === 3) { return '认购' }
116
+                                    if (records.status === 4) { return '签约' }
117
+                                    if (records.verifyStatus === 1) { return '待审核' }
118
+                                    if (records.verifyStatus === 2) { return '审核同意' }
119
+                                    if (records.verifyStatus === 3) { return '签约' }
120
+                                  },
121
+      },
122
+    ]
123
+    return (
124
+      <>
125
+        <Modal
126
+            title="推荐客户"
127
+            destroyOnClose="true"
128
+            width={900}
129
+            footer={null}
130
+            visible={this.state.visibleData.visible}
131
+            // onOk={() => this.handleOk()}
132
+            onCancel={(e) => this.handleCancel(e)}
133
+          >
134
+            <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
135
+          </Modal>
136
+      </>
137
+    );
138
+  }
139
+}
14 140
 /**
15 141
  *
16 142
  *
@@ -54,12 +180,16 @@ function body(props) {
54 180
       }
55 181
     });
56 182
   }
57
-
183
+  // eslint-disable-next-line react-hooks/rules-of-hooks
184
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
58 185
   // Change 事件
59 186
   function handleSelectChange(e) {
60 187
     // eslint-disable-next-line no-console
61 188
     console.log(e)
62 189
   }
190
+  function gM(row) {
191
+    setGVisibleData({ visible: true, customerId: row.personId, realtyConsultant: row.realtyConsultant })
192
+  }
63 193
 
64 194
   // 分页
65 195
   function onChange(pageNum) {
@@ -123,7 +253,7 @@ function body(props) {
123 253
               &nbsp;&nbsp;&nbsp;&nbsp;
124 254
               <sapn style={{ color: 'rgba(239,39,58,1)' }}>邀请经纪人</sapn>
125 255
               &nbsp;&nbsp;&nbsp;&nbsp;
126
-              <sapn style={{ color: 'rgba(239,39,58,1)' }}>推荐客户</sapn>
256
+              <sapn style={{ color: 'rgba(239,39,58,1)' }} onClick={() => gM(record)}>推荐客户</sapn>
127 257
             </>
128 258
           }
129 259
         </>
@@ -158,6 +288,8 @@ function body(props) {
158 288
       </Form>
159 289
 
160 290
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
291
+            {/* 调整归属 */}
292
+        <ModalTable visibleData={gVisibleData} />
161 293
     </>
162 294
   );
163 295
 }

+ 68
- 10
src/pages/news/list/NewsList.jsx Прегледај датотеку

@@ -1,9 +1,11 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Modal, message, Card, Row, Col, Pagination, Alert } from 'antd';
3 3
 import moment from 'moment';
4
+import router from 'umi/router';
4 5
 import request from '../../../utils/request';
5 6
 import apis from '../../../services/apis';
6 7
 import Styles from './style.less';
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
7 9
 
8 10
 
9 11
 const { Option } = Select;
@@ -19,7 +21,53 @@ const tempDate = [{ code: 's101' }]
19 21
  */
20 22
 function CartBody(props) {
21 23
   const { data } = props
22
-  console.log(props);
24
+
25
+  const cancelPage = () =>{
26
+    router.push({
27
+      pathname: '/news/list/NewsList',
28
+    });
29
+  }
30
+
31
+  // 查询列表
32
+  const getList = (params) => {
33
+    request({
34
+        url: '/api/admin/taNews',
35
+        method: 'GET',
36
+        params: { ...params },
37
+    }).then((data) => {
38
+        cancelPage();
39
+    })
40
+  }
41
+
42
+  //删除资讯
43
+  const changeNewsListStatus = (newsId) => () => {
44
+    Modal.confirm({
45
+      title: '确认删除该资讯?',
46
+      okText: '确认',
47
+      cancelText: '取消',
48
+      onOk() {
49
+        request({
50
+          url: '/api/admin/taNews/' + newsId,
51
+          method: 'DELETE',
52
+          // data: { ...row },
53
+        }).then((data) => {
54
+          message.info('操作成功!')
55
+          getList({ pageNum: 1, pageSize: 10 });
56
+        })
57
+      }
58
+    });
59
+  }
60
+
61
+  // 跳转到编辑资讯列表
62
+  const toEditList = (newsId) => ()  => {
63
+    router.push({
64
+      pathname: '/news/list/editNewsList',
65
+      query: {
66
+        newsId
67
+      },
68
+    });
69
+  }
70
+
23 71
   return (
24 72
           <Card
25 73
             hoverable
@@ -30,14 +78,14 @@ function CartBody(props) {
30 78
             <p className={Styles.cardText}>
31 79
               <span className={Styles.title}>资讯类型</span>
32 80
               <span >:{ data.newsType.newsTypeName }</span>
33
-              <span className={Styles.ediText}>
81
+              <span className={Styles.ediText} onClick={toEditList(data.newsId)}>
34 82
                 编辑
35 83
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
36 84
               </span>
37 85
             </p>
38 86
             <p className={Styles.cardText}>
39 87
               <span className={Styles.title}>状态</span>
40
-              <span >:{ data.status == 0 ? "已发布" : "未发布" }</span>
88
+              <span >:{ data.newsStatus == 0 ? "已发布" : "未发布" }</span>
41 89
             </p>
42 90
             <p className={Styles.cardItem}>
43 91
               <span className={Styles.title}>阅读数量</span>
@@ -45,7 +93,7 @@ function CartBody(props) {
45 93
             </p>
46 94
             <p className={Styles.cardItem}>
47 95
               <span className={Styles.title}>转发数量</span>
48
-              <span className={ Styles.address }>:{ data.shareNum }</span>
96
+              <span>:{ data.shareNum }</span>
49 97
             </p>
50 98
             <p className={Styles.cardItem}>
51 99
               <span className={Styles.title}>点赞数量</span>     
@@ -66,7 +114,7 @@ function CartBody(props) {
66 114
               </span>
67 115
               <span style={{
68 116
                 color: '#FF4A4A', position: 'absolute', right: '0',
69
-              }} >
117
+              }} onClick={changeNewsListStatus(data.newsId)}>
70 118
                 删除
71 119
                 <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
72 120
               </span>
@@ -122,6 +170,17 @@ function body(props) {
122 170
     });
123 171
   }
124 172
 
173
+  // 跳转到编辑资讯列表
174
+  const toEditList = (id) => ()  => {
175
+    router.push({
176
+      pathname: '/news/list/editNewsList',
177
+      query: {
178
+        id
179
+      },
180
+    });
181
+  }
182
+
183
+
125 184
   // Change 事件
126 185
   function handleSelectChange(e) {
127 186
     // eslint-disable-next-line no-console
@@ -165,9 +224,8 @@ function body(props) {
165 224
           )}
166 225
         </Form.Item>
167 226
         <Form.Item>
168
-          {getFieldDecorator('type')(
169
-            <Select style={{ width: '180px' }} placeholder="咨询类型" onChange={handleSelectChange}>
170
-            </Select>,
227
+          {getFieldDecorator('buildingId')(
228
+            <NewsTypeSelect />,
171 229
           )}
172 230
         </Form.Item>       
173 231
         <Form.Item>
@@ -184,7 +242,7 @@ function body(props) {
184 242
           </Button>
185 243
         </Form.Item>
186 244
       </Form>
187
-      <Button type="primary" className={Styles.addButton}>
245
+      <Button type="primary" className={Styles.addButton} onClick={toEditList()}>
188 246
         新增
189 247
       </Button>
190 248
 

+ 148
- 0
src/pages/news/list/editNewsList.jsx Прегледај датотеку

@@ -0,0 +1,148 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
8
+import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect'
9
+import XForm, { FieldTypes } from '../../../components/XForm';
10
+import Wangedit from '../../../components/Wangedit/Wangedit'
11
+import request from '../../../utils/request'
12
+
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+/**
15
+ *
16
+ *
17
+ * @param {*} props
18
+ * @returns
19
+ */
20
+ const Edit = (props) => {
21
+  const [ tab, changeTab ] = useState('basic')
22
+  const newsId = props.location.query.newsId
23
+  const [ dynamicData, setDynamicData ] = useState({})
24
+  if(newsId){
25
+    useEffect(() => {
26
+      getDynamicData(newsId);
27
+    },[])
28
+
29
+  // 查询列表
30
+  const getDynamicData = (newsId) => {
31
+    request({
32
+        url: '/api/admin/taNews/' + newsId,
33
+        method: 'GET',
34
+        params: { newsId },
35
+    }).then((data) => {
36
+        console.log(data)
37
+        setDynamicData(data)
38
+    })
39
+  }
40
+  }
41
+
42
+  const cancelPage = () =>{
43
+    router.push({
44
+      pathname: '/news/list/NewsList',
45
+    });
46
+  }
47
+
48
+  const Basic = (props) => {
49
+    const fields = [
50
+      {
51
+        label: '意向项目',
52
+        name: 'buildingId',
53
+        render: <BuildSelect />,
54
+        value: dynamicData.buildingId,
55
+        rules: [
56
+          {required: true, message: '请选择所属项目'},
57
+        ]
58
+      },
59
+      {
60
+        label: '资讯图片',
61
+        name: 'newsImg',
62
+        type: FieldTypes.ImageUploader,
63
+        value: dynamicData.newsImg,
64
+      },
65
+      {
66
+        label: '资讯标题',
67
+        name: 'newsName',
68
+        type: FieldTypes.Text,
69
+        value: dynamicData.newsName,
70
+        rules: [
71
+          {required: true, message: '请输入资讯标题'},
72
+        ]
73
+      },
74
+      {
75
+        label: '资讯类型',
76
+        name: 'newsTypeId',
77
+        render: <NewsTypeSelect />,
78
+        value: dynamicData.newsTypeId,
79
+        rules: [
80
+          {required: true, message: '请选择资讯类型'},
81
+        ]
82
+      },
83
+      {
84
+        label: '资讯详情',
85
+        name: 'desc',
86
+        render: <Wangedit />,
87
+        value: dynamicData.desc,
88
+      },
89
+    ]
90
+  
91
+    const handleSubmit = val => { 
92
+      let {...submitValue} = val
93
+      if(dynamicId){
94
+        submitValue.dynamicId = dynamicId
95
+        request({
96
+          url: '/api/admin/buildingDynamic/update',
97
+          method: 'PUT',
98
+          data: submitValue,
99
+        }).then((data) => {
100
+          cancelPage()
101
+        }).catch((err) => {
102
+          message.info(err.msg || err.message)
103
+        })
104
+      }else{
105
+        request({
106
+          url: '/api/admin/taNews',
107
+          method: 'POST',
108
+          data: submitValue,
109
+        }).then((data) => {
110
+          cancelPage()
111
+        }).catch((err) => {
112
+          message.info(err.msg || err.message)
113
+        })
114
+      }
115
+    }
116
+    
117
+    return <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
118
+  }
119
+  
120
+  const Poster = (props) => {
121
+   return <div>Poster</div>
122
+  }
123
+ 
124
+  const Share = (props) => {
125
+    return <div>Share</div>
126
+  }
127
+
128
+  return (
129
+    <div>
130
+      <div>
131
+        <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
132
+          <Radio.Button value="basic">基本信息</Radio.Button>
133
+          <Radio.Button value="poster">海报图片</Radio.Button>
134
+          <Radio.Button value="share">分享设置</Radio.Button>
135
+        </Radio.Group>
136
+      </div>
137
+      <div>
138
+        { tab === 'basic' && <Basic /> }
139
+        { tab === 'poster' && <Poster /> }
140
+        { tab === 'share' && <Share /> }
141
+      </div>
142
+    </div>
143
+  );
144
+ }
145
+
146
+
147
+
148
+export default Edit

+ 1
- 1
src/pages/news/type/NewsType.jsx Прегледај датотеку

@@ -45,7 +45,7 @@ function header(props) {
45 45
   }
46 46
 
47 47
 
48
-  // 跳转到编辑咨询
48
+  // 跳转到编辑资讯
49 49
   const toEditNews = (id) => () => {
50 50
     router.push({
51 51
       pathname: '/news/type/editNews',

+ 83
- 0
src/pages/staff/components/Tagss.jsx Прегледај датотеку

@@ -0,0 +1,83 @@
1
+import React from 'react';
2
+import { Tag, Input, Tooltip, Icon } from 'antd';
3
+import Styles from './style.less';
4
+
5
+ class Tagss extends React.Component {
6
+  state = {
7
+    tags: [ 'Tag 2', 'Tag 3'],
8
+    inputVisible: false,
9
+    inputValue: '',
10
+  };
11
+
12
+  handleClose = removedTag => {
13
+    const tags = this.state.tags.filter(tag => tag !== removedTag);
14
+    console.log(tags);
15
+    this.setState({ tags });
16
+  };
17
+
18
+  showInput = () => {
19
+    this.setState({ inputVisible: true }, () => this.input.focus());
20
+  };
21
+
22
+  handleInputChange = e => {
23
+    this.setState({ inputValue: e.target.value });
24
+  };
25
+
26
+  handleInputConfirm = () => {
27
+    const { inputValue } = this.state;
28
+    let { tags } = this.state;
29
+    if (inputValue && tags.indexOf(inputValue) === -1) {
30
+      tags = [...tags, inputValue];
31
+    }
32
+    console.log(tags);
33
+    this.setState({
34
+      tags,
35
+      inputVisible: false,
36
+      inputValue: '',
37
+    });
38
+  };
39
+
40
+  saveInputRef = input => (this.input = input);
41
+
42
+  render() {
43
+    const { tags, inputVisible, inputValue } = this.state;
44
+    return (
45
+      <div>
46
+        {tags.map((tag, index) => {
47
+          const isLongTag = tag.length > 20;
48
+          const tagElem = (
49
+            <Tag className = {Styles.tagss} key={tag} closable = {true} onClose={() => this.handleClose(tag)}>
50
+              {isLongTag ? `${tag.slice(0, 20)}...` : tag}
51
+            </Tag>
52
+          );
53
+          return isLongTag ? (
54
+            <Tooltip title={tag} key={tag}>
55
+              {tagElem}
56
+            </Tooltip>
57
+          ) : (
58
+            tagElem
59
+          );
60
+        })}
61
+        {inputVisible && (
62
+          <Input className = {Styles.tagss}
63
+            ref={this.saveInputRef}
64
+            // type="text"
65
+            // size="small"
66
+            // style={{ width: 78 }}
67
+            value={inputValue}
68
+            onChange={this.handleInputChange}
69
+            onBlur={this.handleInputConfirm}
70
+            onPressEnter={this.handleInputConfirm}
71
+          />
72
+        )}
73
+        {!inputVisible && (
74
+          <Tag className = {Styles.tagss} onClick={this.showInput} >
75
+            <Icon type="plus" /> 新建
76
+          </Tag>
77
+        )}
78
+      </div>
79
+    );
80
+  }
81
+}
82
+
83
+export default Tagss;

+ 24
- 0
src/pages/staff/components/style.less Прегледај датотеку

@@ -0,0 +1,24 @@
1
+.tagss{
2
+  width: 150px;
3
+  height: 32px;
4
+  
5
+font-size:14px;
6
+
7
+font-weight:400;
8
+color:rgba(153,153,153,1);
9
+
10
+
11
+padding: 4px 11px;
12
+
13
+color: rgba(0, 0, 0, 0.65);
14
+
15
+
16
+
17
+line-height: 1.5;
18
+
19
+background-color: #fff;
20
+
21
+
22
+
23
+border: 1px solid #d9d9d9;
24
+}

+ 101
- 0
src/pages/staff/list/RoleList.jsx Прегледај датотеку

@@ -0,0 +1,101 @@
1
+
2
+import React, { useState, useEffect } from 'react';
3
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Row, Col, Tag, Pagination, Modal, DatePicker } from 'antd';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import router from 'umi/router';
7
+import { Card, Avatar } from 'antd';
8
+import request from '../../../utils/request'
9
+import Styles from './style.less';
10
+
11
+
12
+function confirm() {
13
+  Modal.confirm({
14
+    title: '确认停用该角色?',
15
+    okText: '确认',
16
+    cancelText: '取消',
17
+    onOk() {
18
+      console.log('OK');
19
+    },
20
+    onCancel() {
21
+      console.log('Cancel');
22
+    },
23
+  });
24
+
25
+}
26
+function toEditRole() {
27
+  router.push({
28
+    pathname: '/staff/editRole',
29
+    query: {
30
+      a: 'b',
31
+    },
32
+  });
33
+}
34
+
35
+
36
+const dataSource = [
37
+  {
38
+    name: '置业顾问',
39
+    status: '1',//显示停用
40
+  },
41
+  {
42
+    name: '置业经理',
43
+    status: '1',//停用
44
+  },
45
+];
46
+
47
+const columns = [
48
+  // {
49
+  //   title: '商品图片',
50
+  //   dataIndex: 'img',
51
+  //   key: 'img',
52
+  //   align: 'center',
53
+
54
+  //   render: (text, record) => <img src={record.img} className={channels.touxiang} />,
55
+  // },
56
+  {
57
+    title: '角色名称',
58
+    dataIndex: 'name',
59
+    key: 'name',
60
+    align: 'center',
61
+    render: text => <a>{text}</a>,
62
+  },
63
+
64
+  {
65
+    title: '操作  ',
66
+    dataIndex: 'status',
67
+    key: 'status',
68
+    align: 'center',
69
+
70
+    render: () => <>
71
+      <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>停用
72
+      <Icon type="stop" className={styles.shoppingCart} style={{fontSize:14}}/>
73
+      </span>
74
+      <span style={{ color: '#FF925C' }} onClick={toEditRole}>编辑
75
+      <Icon type="form" className={styles.edit} />
76
+      </span>
77
+    </>,
78
+
79
+  },
80
+];
81
+
82
+
83
+const header = (props) => {
84
+
85
+
86
+
87
+
88
+  return (
89
+    <>
90
+      <Button type="danger" className={styles.addBtn} onClick={toEditRole}>新增</Button>
91
+      <div className={Styles.roletext}>
92
+
93
+        <Table dataSource={dataSource} columns={columns} />
94
+      </div>
95
+    </>
96
+
97
+  )
98
+}
99
+const WrappedHeader = Form.create({ name: 'header' })(header);
100
+
101
+export default WrappedHeader

+ 279
- 0
src/pages/staff/list/StaffList.jsx Прегледај датотеку

@@ -0,0 +1,279 @@
1
+
2
+import React, { useState, useEffect } from 'react';
3
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Row, Col, Tag, Pagination, Modal, DatePicker } from 'antd';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import router from 'umi/router';
7
+import { Card, Avatar } from 'antd';
8
+import request from '../../../utils/request'
9
+import Styles from './style.less';
10
+
11
+const { Meta } = Card;
12
+const { Option } = Select;
13
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
+//标签颜色
15
+const colors = {
16
+  金牌顾问: '#E34B59',
17
+  销售冠军: '#E8747E',
18
+  优选顾问: '#EEC37E',
19
+  人气顾问: '#FDDA9F',
20
+}
21
+// 提交事件
22
+function handleSubmit (e, props) {
23
+  e.preventDefault();
24
+  props.form.validateFields((err, values) => {
25
+    if (!err) {
26
+      console.log('提交数据: ', values)
27
+    }
28
+  });
29
+}
30
+// Change 事件
31
+function handleSelectChange (props) {
32
+  console.log(props)
33
+}
34
+
35
+// 分页
36
+function onChange (pageNumber) {
37
+  console.log('Page: ', pageNumber);
38
+}
39
+// 跳转到编辑商品
40
+function toEditStaff () {
41
+  router.push({
42
+    pathname: '/staff/editStaff',
43
+    // query: {
44
+    //   a: 'b',
45
+    // },
46
+  });
47
+}
48
+function confirm () {
49
+  Modal.confirm({
50
+    title: '确认停用该角色?',
51
+    okText: '确认',
52
+    cancelText: '取消',
53
+    onOk () {
54
+      console.log('OK');
55
+    },
56
+    onCancel () {
57
+      console.log('Cancel');
58
+    },
59
+  });
60
+
61
+}
62
+/**
63
+ *
64
+ *
65
+ * 
66
+ */
67
+
68
+// 假数据
69
+const tempData = [
70
+  {
71
+    name: '吴媛',
72
+    status: '1',// 启用
73
+    tel: '133 333 222',
74
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
75
+    labels: ['金牌顾问', '销售冠军'],
76
+  },
77
+  {
78
+    name: '吴媛',
79
+    status: '1',// 启用
80
+    tel: '133 333 333',
81
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
82
+    labels: ['金牌顾问', '销售冠军'],
83
+  },
84
+  {
85
+    name: '吴媛',
86
+    status: '1',// 启用
87
+    tel: '133 333 444',
88
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
89
+    labels: ['金牌顾问', '销售冠军'],
90
+  },
91
+  {
92
+    name: '吴媛',
93
+    status: '1',// 启用
94
+    tel: '133 333 555',
95
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
96
+    labels: ['金牌顾问', '销售冠军'],
97
+  },
98
+  {
99
+    name: '吴媛',
100
+    status: '0',
101
+    tel: '133 333 555',
102
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
103
+    labels: ['金牌顾问', '销售冠军'],
104
+  },
105
+  {
106
+    name: '吴媛',
107
+    status: '1',// 启用
108
+    tel: '133 333 555',
109
+    avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png',
110
+    labels: ['金牌顾问'],
111
+  },
112
+
113
+
114
+
115
+]
116
+
117
+
118
+/**
119
+ *卡片
120
+ *
121
+ * @returns
122
+ */
123
+function CartBody (props) {
124
+  const { data } = props
125
+
126
+  return (
127
+
128
+    <Card className={Styles.card}>
129
+      <div>
130
+
131
+        <Avatar src={data.avatar} style={{ width: 94, height: 94 }} />
132
+        <span className={Styles.ediText} style={{ marginLeft: '20px' }} onClick={toEditStaff}>
133
+          编辑
134
+                <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
135
+        </span>
136
+        <span className={Styles.ediText} style={{ marginLeft: '50px' }} onClick={confirm}>
137
+          停用
138
+                <Icon type="close-circle" style={{ color: '#C0C4CC', marginLeft: '10px' }} />
139
+        </span>
140
+
141
+      </div>
142
+      <div>
143
+
144
+        <span>
145
+          {
146
+            data.labels.map((item, index) => {
147
+              const color = colors[item];
148
+              console.log(color, '------');
149
+              return <Tag className={Styles.cardTag}  color = {color}>{item}</Tag>
150
+            })
151
+          }
152
+        </span>
153
+        {/* {
154
+           data.label.map((item, index) => (
155
+              
156
+                <Tag className={Styles.cardTag}>{item}</Tag>
157
+          
158
+            ))
159
+            } */}
160
+
161
+        <p className={Styles.cardText} style={{ width: '300px' }}>
162
+          <span>姓名:{data.name}</span>
163
+
164
+          <span style={{ float: "right" }}>状态:{data.status === '1' ? '启用' : '停用'}</span>
165
+
166
+        </p>
167
+        <p className={Styles.cardText} style={{ width: '300px' }}>
168
+          <span>电话:{data.tel}</span>
169
+        </p>
170
+      </div>
171
+
172
+    </Card>
173
+  )
174
+}
175
+
176
+
177
+const header = (props) => {
178
+  const [data, setData] = useState({})
179
+  //   const [page, changePage] = useState({})
180
+
181
+  // useEffect(() => {
182
+  //   request({
183
+  //       url: '/api/admin/iBuildingDynamicList',
184
+  //       method: 'GET',
185
+  //       params: {pageNum: 1,pageSize: 10},
186
+  //   }).then((data) => {
187
+  //       console.log(data)
188
+  //       setData(data)
189
+  //   })
190
+  // })
191
+
192
+  // const getList = (e) => {
193
+  //   request({
194
+  //       url: '/api/xxx',
195
+  //       method: 'GET',
196
+  //       params: {},
197
+  //   }).then((data) => {
198
+  //       setData(data)
199
+  //   })
200
+  // }
201
+
202
+  const { getFieldDecorator } = props.form
203
+  return (
204
+
205
+    <>
206
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
207
+        <Form.Item>
208
+          {getFieldDecorator('name')(
209
+            <Input
210
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
211
+              placeholder="姓名"
212
+            />,
213
+          )}
214
+        </Form.Item>
215
+        <Form.Item>
216
+          {getFieldDecorator('tel')(
217
+            <Input
218
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
219
+              placeholder="电话"
220
+            />,
221
+          )}
222
+        </Form.Item>
223
+
224
+        <Form.Item>
225
+
226
+          {getFieldDecorator('goodState')(
227
+            <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
228
+              <Option value="1">启用</Option>
229
+              <Option value="0">停用</Option>
230
+            </Select>,
231
+          )}
232
+        </Form.Item>
233
+        <Form.Item>
234
+          {getFieldDecorator('isMain')(
235
+            <Select style={{ width: '180px' }} placeholder="请选择" onChange={handleSelectChange}>
236
+              <Option value="1">职业顾问</Option>
237
+              <Option value="0">其他</Option>
238
+            </Select>,
239
+          )}
240
+        </Form.Item>
241
+        <Form.Item>
242
+          {getFieldDecorator('name')(
243
+            <Input
244
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
245
+              placeholder="标签"
246
+            />,
247
+          )}
248
+        </Form.Item>
249
+
250
+
251
+        <Form.Item>
252
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
253
+            搜索
254
+          </Button>
255
+        </Form.Item>
256
+      </Form>
257
+      <Button type="danger" className={styles.addBtn} onClick={toEditStaff}>新增</Button>
258
+
259
+      <Row style={{ padding: ' 0 10px' }}>
260
+        {
261
+          tempData.map((item, index) => (
262
+            <Col span={6}>
263
+              <CartBody data={item} />
264
+            </Col>
265
+          ))
266
+        }
267
+      </Row>
268
+
269
+      {/* <Table dataSource={data.records} columns={columns} /> */}
270
+      {/* 分页  */}
271
+      <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
272
+        <Pagination showQuickJumper defaultCurrent={1} total={500} onChange={onChange} />
273
+      </div>
274
+    </>
275
+  )
276
+}
277
+const WrappedHeader = Form.create({ name: 'header' })(header);
278
+
279
+export default WrappedHeader

+ 64
- 0
src/pages/staff/list/channelList.less Прегледај датотеку

@@ -0,0 +1,64 @@
1
+.searchBox {
2
+  font-size: 20px;
3
+  color: red;
4
+  display: flex;
5
+  display: flex;
6
+  align-items: center;
7
+  justify-content: space-between;
8
+  .searchItem {
9
+    min-width: 20px;
10
+    margin-right: 20px;
11
+    text-align: left;
12
+    .anticon-down {
13
+      float: right !important;
14
+    }
15
+  }
16
+}
17
+.addBtn {
18
+  padding: 0 30px;
19
+  height: 36px;
20
+  background-color: #50be00;
21
+  color: #fff;
22
+  margin: 30px 0;
23
+}
24
+.touxiang {
25
+  width: 93px;
26
+  height: 93px;
27
+}
28
+.ant-table-column-title {
29
+  font-weight: 600;
30
+}
31
+
32
+.about {
33
+  padding: 0 30px;
34
+  height: 36px;
35
+  background-color: #00bfff;
36
+  color: #fff;
37
+  margin: 30px 0;
38
+}
39
+
40
+.selectName {
41
+  font-size: 17px;
42
+  padding: 0 10px;
43
+  height: 36px;
44
+  color: rgb(10, 10, 10);
45
+  margin: 30px 0;
46
+}
47
+
48
+.inpuit {
49
+  width:50%;
50
+}
51
+
52
+.inpuitTxt {
53
+  width:70%;
54
+}
55
+
56
+
57
+.formButton{
58
+  margin-left: 12% 
59
+}
60
+
61
+.divInput{
62
+  float: 'left'; 
63
+  width: 500
64
+}

+ 27
- 0
src/pages/staff/list/editRole.jsx Прегледај датотеку

@@ -0,0 +1,27 @@
1
+import React from 'react';
2
+import { Form, Input, Button, Icon, Select } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../../style/GoodsList.less';
5
+
6
+
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+
15
+
16
+function header(props) {
17
+  const { getFieldDecorator } = props.form
18
+  return (
19
+
20
+    <>
21
+     <div>编辑角色</div>
22
+    </>
23
+  )
24
+}
25
+const WrappedHeader = Form.create({ name: 'header' })(header);
26
+
27
+export default WrappedHeader

+ 135
- 0
src/pages/staff/list/editStaff.jsx Прегледај датотеку

@@ -0,0 +1,135 @@
1
+import React, { useState } from 'react';
2
+
3
+import { Input, Menu, Dropdown, Button, Icon, message, Table, Tooltip, Tabs, Radio, Divider, Tag, Select, Form, Alert } from 'antd';
4
+import { FormattedMessage } from 'umi-plugin-react/locale';
5
+import styles from '../../style/GoodsList.less';
6
+import XForm, { FieldTypes } from '../../../components/XForm';
7
+import Wangedit from '../../../components/Wangedit/Wangedit'
8
+import channels from './channelList.less';
9
+
10
+import Tagss from '../components/Tagss.jsx';
11
+
12
+const { TextArea } = Input;
13
+
14
+
15
+/**
16
+ *
17
+ *
18
+ * @param {*} props
19
+ * @returns
20
+ */
21
+const Edit = (props) => {
22
+
23
+  const fields = [
24
+    {
25
+      label: '公司',
26
+      name: 'staffCompany',
27
+      type: FieldTypes.Text,
28
+      placeholder: '请输入公司名称',
29
+      value: ''
30
+    },
31
+    {
32
+      label: '部门',
33
+      name: 'staffDepartment',
34
+      type: FieldTypes.Text,
35
+      placeholder: '请输入部门',
36
+      value: ''
37
+    },
38
+    {
39
+      label: '职位',
40
+      name: 'staffPosition',
41
+      type: FieldTypes.Text,
42
+      placeholder: '请输入职位',
43
+      value: ''
44
+    },
45
+    {
46
+      label: '电话',
47
+      name: 'staffTel',
48
+      type: FieldTypes.Text,
49
+      placeholder: '请输入电话号码',
50
+      value: ''
51
+      // rules: [
52
+      //   { message: '请输入电话号码'}
53
+      // ]
54
+    },
55
+    {
56
+      label: '标签',
57
+      name: 'staffTag',
58
+      render: 
59
+      <Tagss/>
60
+     
61
+   
62
+    },
63
+    {
64
+      label: '地址',
65
+      name: 'staffAddress',
66
+      type: FieldTypes.Text,
67
+      placeholder: '请输入地址',
68
+      value: ''
69
+
70
+    },
71
+    {
72
+      label: '授权项目',
73
+      name: 'staffProject',
74
+      type: FieldTypes.Select,
75
+      placeholder: '请选择',
76
+      value: ''
77
+    },
78
+
79
+    // {
80
+    //   label: '授权项目',
81
+    //   name: 'staffProject',
82
+    //   type: FieldTypes.Text,
83
+    //   placeholder: '请选择'
84
+    // },
85
+
86
+    {
87
+      label: '图片',
88
+      name: 'staffImage',
89
+      type: FieldTypes.ImageUploader,
90
+      extra: '建议图片大小 640 * 640',
91
+      value: ''
92
+    },
93
+
94
+
95
+    {
96
+      label: '简介',
97
+      name: 'staffIntroduction',
98
+      render: <TextArea className={channels.inpuitTxt} ></TextArea>,
99
+      value: ''
100
+
101
+    },
102
+    {
103
+      label: '状态',
104
+      name: 'staffstate',
105
+      render: <Radio.Group>
106
+        <Radio.Button style={{background:'#f0f0f0'}} value="a">禁用</Radio.Button>
107
+        <Radio.Button style={{background:'#f0f0f0',color:'#ff7e48'}} value="b">启用</Radio.Button>
108
+      </Radio.Group>,
109
+      value: 'b'
110
+    },
111
+
112
+  ]
113
+
114
+  const handleSubmit = val => {
115
+    window.console.log('submit data --->', val)
116
+  }
117
+  return <XForm onSubmit={handleSubmit} fields={fields} offset={8}></XForm>
118
+
119
+
120
+
121
+
122
+}
123
+
124
+
125
+
126
+export default Edit
127
+
128
+
129
+
130
+
131
+
132
+
133
+
134
+
135
+

+ 90
- 0
src/pages/staff/list/style.less Прегледај датотеку

@@ -0,0 +1,90 @@
1
+.SubmitButton {
2
+  background: #3a91d5;
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+
7
+.SelectFrom {
8
+  width: 180px;
9
+  background: #ffffff;
10
+  border-radius: 7px;
11
+  border: 1px solid #dbdbdb;
12
+}
13
+
14
+.addButton {
15
+  // background: #50be00;
16
+  border-radius: 4px;
17
+  border: 0px;
18
+  margin: 10px 0px;
19
+}
20
+
21
+.card {
22
+  width: 348px;
23
+  height: 244px;
24
+  background: rgba(255, 255, 255, 1);
25
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
26
+  border-radius: 12px;
27
+  margin-bottom: 40px;
28
+
29
+}
30
+
31
+.cardText {
32
+
33
+  height: 28px;
34
+  font-size: 20px;
35
+  font-weight: 400;
36
+  color: rgba(102, 102, 102, 1);
37
+  line-height: 28px;
38
+  margin-top: 10px;
39
+  margin-bottom: 0;
40
+
41
+}
42
+
43
+.cardItem {
44
+  font-size: 18px;
45
+  font-weight: 400;
46
+  color: #666;
47
+  line-height: 24px;
48
+  display: flex;
49
+  align-items: center;
50
+}
51
+
52
+.ediText {
53
+  width: 36px;
54
+  height: 25px;
55
+  font-size: 18px;
56
+
57
+  font-weight: 400;
58
+  color: rgba(255, 146, 92, 1);
59
+  line-height: 25px;
60
+
61
+}
62
+
63
+.cardTag {
64
+  width: 48px;
65
+  height: 18px;
66
+  font-size: 10px;
67
+  // background: #fdce22;
68
+  border-radius: 4px;
69
+  color: #ffffff;
70
+  line-height: 14px;
71
+  margin-top: 10px;
72
+  padding: 1px 3px;
73
+}
74
+
75
+.title {
76
+  display: inline-block;
77
+  width: 84px;
78
+  justify-content: space-between;
79
+  text-align: justify;
80
+  text-align-last: justify
81
+}
82
+
83
+
84
+.roletext {
85
+  font-size: 20px;
86
+
87
+  font-weight: 400;
88
+  color: rgba(51, 51, 51, 1);
89
+  line-height: 28px;
90
+}

+ 4
- 0
src/services/apis.js Прегледај датотеку

@@ -92,5 +92,9 @@ export default {
92 92
       method: 'GET',
93 93
       url: `${prefix}/mine/taPointsRecords/id`,
94 94
     },
95
+    recommend: {
96
+      method: 'GET',
97
+      url: `${prefix}/customer/recommend/id`,
98
+    },
95 99
   },
96 100
 }