dingxin 5 年之前
父節點
當前提交
f87f874e0b

+ 36
- 1
config/config.js 查看文件

@@ -201,6 +201,11 @@ export default {
201 201
                   name: '商品核销',
202 202
                   component: './integralMall/writeOff',
203 203
                 },
204
+                {
205
+                  path: '/integralMall/verifyList',
206
+                  name: '',
207
+                  component: './integralMall/verifyList',
208
+                },
204 209
               ],
205 210
             },
206 211
             {
@@ -284,6 +289,36 @@ export default {
284 289
                 },
285 290
               ],
286 291
             },
292
+
293
+            {
294
+              path: '/staff',
295
+              name: '员工管理',
296
+              component: '../layouts/BlankLayout',
297
+              routes: [
298
+                {
299
+                  path: '/staff/StaffList',
300
+                  name: '员工列表',
301
+                  component: './staff/list/StaffList',
302
+                },
303
+                {
304
+                  path: '/staff/editStaff',
305
+                  name: '',
306
+                  component: './staff/list/editStaff',
307
+                },
308
+             
309
+                {
310
+                  path: '/staff/RoleList',
311
+                  name: '角色管理',
312
+                  component: './staff/list/RoleList',
313
+                },
314
+                {
315
+                  path: '/staff/editRole',
316
+                  name: '',
317
+                  component: './staff/list/editRole',
318
+                },
319
+             
320
+              ],
321
+            },
287 322
             {
288 323
               component: './404',
289 324
             },
@@ -347,7 +382,7 @@ export default {
347 382
 
348 383
   proxy: {
349 384
     '/api/': {
350
-      target: 'http://localhost:8080/',
385
+      target: 'http://192.168.0.11:8080/',
351 386
       changeOrigin: true,
352 387
       // pathRewrite: { '^/server': '' },
353 388
     },

+ 1
- 0
package.json 查看文件

@@ -46,6 +46,7 @@
46 46
     "antd": "^3.20.0",
47 47
     "classnames": "^2.2.6",
48 48
     "dva": "^2.4.1",
49
+    "echarts": "^4.3.0",
49 50
     "lodash": "^4.17.11",
50 51
     "md5": "^2.2.1",
51 52
     "moment": "^2.24.0",

+ 49
- 0
src/components/EchartsTest/EChart.jsx 查看文件

@@ -0,0 +1,49 @@
1
+import React, { Component } from 'react';
2
+
3
+// 引入 ECharts 主模块
4
+import echarts from 'echarts/lib/echarts';
5
+// 引入柱状图
6
+import  'echarts/lib/chart/bar';
7
+// 引入提示框和标题组件
8
+import 'echarts/lib/component/tooltip';
9
+import 'echarts/lib/component/title';
10
+
11
+class EchartsTest extends Component {
12
+    chartRef = undefined
13
+    chart = undefined
14
+    defaultChartOption = {}
15
+
16
+    componentDidMount() {
17
+        this.chart = echarts.init(this.chartRef.current)
18
+
19
+        // 绘制图表
20
+        this.chart.setOption({
21
+            ...this.defaultChartOption,
22
+            ...this.props.options || {},
23
+        });
24
+    }
25
+
26
+    componentDidUpdate(preProps) {
27
+        if (preProps.options != this.props.options) {
28
+            this.chart.setOption({
29
+                ...this.defaultChartOption,
30
+                ...this.props.options || {},
31
+            });
32
+        }
33
+    }
34
+
35
+    handleDom = ref => this.chartRef = ref
36
+
37
+    render() {
38
+        const style = {
39
+            width: '600px',
40
+            ...this.props.style || {}
41
+        }
42
+
43
+        return (
44
+            <div ref={this.handleDom} style={style}></div>
45
+        );
46
+    }
47
+}
48
+
49
+export default EchartsTest;

+ 37
- 0
src/components/EchartsTest/Line.jsx 查看文件

@@ -0,0 +1,37 @@
1
+import React, { useEffect } from 'react';
2
+import EChart from './EChart';
3
+
4
+
5
+const Line = (props) => {
6
+
7
+  const {person_realty_consultant, person_estate_agent, person_null} = xxx
8
+
9
+  const options = {
10
+    xAxis: {},
11
+    legend: {
12
+      left: '70%',
13
+      data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
14
+    },
15
+    series: [
16
+      {
17
+        type: 'pie',
18
+        datasetIndex: 1,
19
+        center: ['75%', '50%'],
20
+        radius: [0, '50%'],
21
+      },
22
+    ],
23
+    dataset: {
24
+      id: 'pie',
25
+      source: [
26
+        { form: '来源置业顾问', value: person_realty_consultant },
27
+        { form: '来源全民经纪人', value: person_estate_agent },
28
+        { form: '自主进入', value: person_null },
29
+      ]
30
+    },
31
+  }
32
+
33
+  return (
34
+    <EChart options={options} />
35
+  )
36
+
37
+}

+ 17
- 0
src/components/EchartsTest/index.jsx 查看文件

@@ -0,0 +1,17 @@
1
+import React, { Component } from 'react';
2
+
3
+// 引入 ECharts 主模块
4
+import echarts from 'echarts/lib/echarts';
5
+// 引入柱状图
6
+import  'echarts/lib/chart/bar';
7
+// 引入提示框和标题组件
8
+import 'echarts/lib/component/tooltip';
9
+import 'echarts/lib/component/title';
10
+class Chart extends Component {
11
+
12
+  render() { 
13
+    return ( <div></div> );
14
+  }
15
+}
16
+ 
17
+export default Chart;

+ 17
- 16
src/pages/Welcome.jsx 查看文件

@@ -1,21 +1,20 @@
1 1
 import React from 'react';
2 2
 import { Card, Typography, Alert, Row, Col } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-
5
-// const CodePreview = ({ children }) => (
6
-//   <pre
7
-//     style={{
8
-//       background: '#f2f4f5',
9
-//       padding: '12px 20px',
10
-//       margin: '12px 0',
11
-//     }}
12
-//   >
13
-//     <code>
14
-//       <Typography.Text copyable>{children}</Typography.Text>
15
-//     </code>
16
-//   </pre>
17
-// );
18
-
4
+import EchartsTest from '../components/EchartsTest'
5
+const option = {
6
+  xAxis: {
7
+    type: 'category',
8
+    data: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
9
+  },
10
+  yAxis: {
11
+    type: 'value'
12
+  },
13
+  series: [{
14
+    data: [820, 932, 901, 934, 1290, 1330, 1320],
15
+    type: 'line'
16
+  }]
17
+};
19 18
 export default () => (
20 19
   <>
21 20
     <div style={{ display: 'flex' }}>
@@ -44,6 +43,8 @@ export default () => (
44 43
         <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>91</span>
45 44
       </div>
46 45
     </div>
47
-    <div>11111111111111</div>
46
+    <EchartsTest style={{width: 500, height:500}}></EchartsTest>
47
+
48 48
   </>
49 49
 );
50
+

+ 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);

+ 151
- 0
src/pages/customer/customerlist/components/attribution.jsx 查看文件

@@ -0,0 +1,151 @@
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
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+/**
14
+ * 调整归属
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalAttribution extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: { records: [] },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData.realtyConsultant)
35
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
+      this.getList({ pageNumber: 1, pageSize: 5 })
37
+      this.setState({ visibleData: this.props.visibleData });
38
+    }
39
+  }
40
+
41
+  // 弹框确定按钮
42
+  // eslint-disable-next-line react/sort-comp
43
+  handleOk() {
44
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
45
+  }
46
+
47
+  // 弹框取消按钮
48
+  handleCancel() {
49
+    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
50
+  }
51
+
52
+  getList(params) {
53
+    // 网路请求
54
+    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
55
+      this.setState({ dataSource: res })
56
+    }).catch(err => {
57
+      // eslint-disable-next-line no-unused-expressions
58
+      <Alert
59
+        style={{
60
+          marginBottom: 24,
61
+        }}
62
+        message={err}
63
+        type="error"
64
+        showIcon
65
+      />
66
+    })
67
+  }
68
+
69
+  openNotificationWithIcon = (type, message) => {
70
+    notification[type]({
71
+      message,
72
+      description:
73
+        '',
74
+    });
75
+  };
76
+
77
+   // 分页
78
+  onChange(pageNum) {
79
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
80
+  }
81
+
82
+  // 提交
83
+  submitGm(record) {
84
+    const { url, method } = apis.customer.recommendEdit
85
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(this.state.visibleData.customerId)
86
+
87
+    // 网路请求
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', '操作成功')
91
+      this.handleCancel()
92
+    }).catch(err => {
93
+      // eslint-disable-next-line no-unused-expressions
94
+      this.openNotificationWithIcon('error', err)
95
+    })
96
+  }
97
+
98
+  render() {
99
+    const columns = [
100
+      // {
101
+      //   title: '编号',
102
+      //   dataIndex: 'personId',
103
+      //   key: 'personId',
104
+      // },
105
+      {
106
+        title: '姓名',
107
+        dataIndex: 'name',
108
+        key: 'name',
109
+      },
110
+      {
111
+        title: '电话',
112
+        dataIndex: 'phone',
113
+        key: 'phone',
114
+      },
115
+      {
116
+        title: '部门',
117
+        dataIndex: 'department',
118
+        key: 'department',
119
+      },
120
+      {
121
+        title: '岗位',
122
+        dataIndex: 'post',
123
+        key: 'post',
124
+      },
125
+      {
126
+        title: '操作',
127
+        dataIndex: 'personId',
128
+        key: 'personId',
129
+        // eslint-disable-next-line no-nested-ternary
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
131
+      },
132
+    ]
133
+    return (
134
+      <>
135
+        <Modal
136
+            title="选择置业顾问"
137
+            width={800}
138
+            destroyOnClose="true"
139
+            footer={null}
140
+            visible={this.state.visibleData.visible}
141
+            // onOk={() => this.handleOk()}
142
+            onCancel={(e) => this.handleCancel(e)}
143
+          >
144
+            <Table dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
145
+          </Modal>
146
+      </>
147
+    );
148
+  }
149
+}
150
+
151
+export default ModalAttribution

+ 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

+ 153
- 0
src/pages/customer/customerlist/components/integralRecord.jsx 查看文件

@@ -0,0 +1,153 @@
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
+
9
+const { Option } = Select;
10
+// eslint-disable-next-line @typescript-eslint/no-unused-vars
11
+const { Meta } = Card;
12
+
13
+/**
14
+ * 积分记录
15
+ *
16
+ * @param {*} props
17
+ * @returns
18
+ */
19
+class ModalIntegralRecord extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: { result: { records: [] }, totalPoints: 0 },
24
+       visibleData: { visible: false, customerId: '' },
25
+    }
26
+  }
27
+
28
+  // 挂载之后
29
+  componentDidMount() {
30
+    this.getList({ pageNumber: 1, pageSize: 5 })
31
+  }
32
+
33
+  componentDidUpdate(preProps, preState) {
34
+    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
35
+      this.getList({ pageNumber: 1, pageSize: 5 })
36
+      this.setState({ visibleData: this.props.visibleData });
37
+    }
38
+  }
39
+
40
+  // 弹框确定按钮
41
+  // eslint-disable-next-line react/sort-comp
42
+  handleOk() {
43
+    this.setState({ visibleData: { visible: false, customerId: '' } })
44
+  }
45
+
46
+  // 弹框取消按钮
47
+  handleCancel() {
48
+    this.setState({ visibleData: { visible: false, customerId: '' } })
49
+  }
50
+
51
+  openNotificationWithIcon = (type, message) => {
52
+    notification[type]({
53
+      message,
54
+      description:
55
+        '',
56
+    });
57
+  }
58
+
59
+  getList(params) {
60
+    const { customerId } = this.state.visibleData
61
+    if (customerId === '' || customerId === undefined) {
62
+      return
63
+    }
64
+    // 网路请求
65
+    const { url, method } = apis.customer.taPointsRecords
66
+    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(customerId)
67
+
68
+    // 网路请求
69
+    request({ url: tempUrl, method, params: { ...params } }).then(res => {
70
+      this.setState({ dataSource: res })
71
+    }).catch(err => {
72
+      this.openNotificationWithIcon('error', err)
73
+    })
74
+  }
75
+
76
+   // 分页
77
+  onChange(pageNum) {
78
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
79
+  }
80
+
81
+  // 积分类型
82
+  showChangeType(str) { 
83
+
84
+    switch (str) {
85
+      case 'goods':
86
+        return '兑换商品'
87
+      case 'checkin':
88
+        return '签到'
89
+      case 'share-poster':
90
+        return '分享'
91
+      case 'signup-agent':
92
+        return '注册经纪人'
93
+      case 'recommend-customer':
94
+        return '推荐客户'
95
+      default:
96
+        return '未知类型'
97
+    }
98
+  }
99
+  
100
+  // 判断是否是 - 开头
101
+  subPoints(points) { 
102
+    let subStr = points.toString().substring(0, 1)
103
+    if (subStr === '-') {
104
+      return true
105
+    }
106
+    return false
107
+  }
108
+
109
+  render() {
110
+    const columns = [
111
+      {
112
+        title: '序号',
113
+        dataIndex: 'index',
114
+        key: 'index',
115
+      },
116
+      {
117
+        title: '积分类型',
118
+        dataIndex: 'changeType',
119
+        key: 'changeType',
120
+        render: (_, record) => { this.showChangeType(record.changeType) },
121
+      },
122
+      {
123
+        title: '积分变化',
124
+        dataIndex: 'pointsAmount',
125
+        key: 'pointsAmount',
126
+        render: (_, record) => { <span style={this.subPoints(record.pointsAmount) && {color: 'red'}}>{ record.pointsAmount }</span> },
127
+      },
128
+      {
129
+        title: '发生时间',
130
+        dataIndex: 'createDate',
131
+        key: 'createDate',
132
+        render: (_, record) => { moment(record.createDate).format('YYYY-MM-DD') },
133
+      },
134
+    ]
135
+    return (
136
+      <>
137
+        <Modal
138
+            title={ "当前可用积分:" + this.state.dataSource.totalPoints }
139
+            width={800}
140
+            destroyOnClose="true"
141
+            footer={null}
142
+            visible={this.state.visibleData.visible}
143
+            // onOk={() => this.handleOk()}
144
+            onCancel={(e) => this.handleCancel(e)}
145
+          >
146
+            <Table dataSource={this.state.dataSource.result.records} columns={columns} pagination={{ total: this.state.dataSource.result.total, onChange: e => this.onChange(e) }} />
147
+          </Modal>
148
+      </>
149
+    );
150
+  }
151
+}
152
+
153
+export default ModalIntegralRecord

+ 0
- 1
src/pages/customer/report/index.jsx 查看文件

@@ -159,7 +159,6 @@ function body(props) {
159 159
           </Button>
160 160
         </Form.Item>
161 161
       </Form>
162
-
163 162
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
164 163
     </>
165 164
   );

+ 115
- 67
src/pages/integralMall/achieve.jsx 查看文件

@@ -1,86 +1,134 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Tabs, Row, Col, Table } from 'antd';
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Tabs, Row, Col, Table, Pagination, Alert, message } 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';
6
-
6
+import moment from 'moment';
7
+import BuildSelect from '../../components/SelectButton/BuildSelect'
8
+import request from '../../utils/request'
7 9
 
8 10
 const { TabPane } = Tabs;
9
-function callback(key) {
10
-  console.log(key);
11
+
12
+
13
+
14
+
15
+function header(props) {
16
+  const [ carType, setCarType ] = useState({})
17
+  const callback = (key) => {
18
+    setCarType(key)
19
+    getList({ pageNum: 1, pageSize: 10 , type: key});
20
+  }
21
+  
22
+// 获取初始化数据
23
+const [ data, setData ] = useState({})
24
+
25
+useEffect(() => {
26
+  getList({ pageNum: 1, pageSize: 10 , type: 'platform'});
27
+},[])
28
+
29
+// 查询列表
30
+const getList = (params) => {
31
+  request({
32
+      url: '/api/admin/tdPointsRules',
33
+      method: 'GET',
34
+      params: { ...params },
35
+  }).then((data) => {
36
+      console.log(data)
37
+      setData(data)
38
+  })
11 39
 }
12 40
 
13
-/**
14
- *
15
- *
16
- * @param {*} props
17
- * @returns
18
- */
19
-const dataSource = [
20
-  {
21
-    key: '1',
22
-    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
23
-    name: '华为P30 Pro',
24
-  },
25
-  {
26
-    key: '2',
27
-    img: '',
28
-    name: '大米',
29
-  },
30
-];
41
+const changePageNum = (pageNumber) => {
42
+  getList({ pageNum: pageNumber, pageSize: 10, type: carType })
43
+}
31 44
 
32
-const columns = [
33
-  {
34
-    title: '类型',
35
-    dataIndex: 'type',
36
-    key: 'type',
37
-    align: 'center',
38
-  },
39
-  {
40
-    title: '获取积分',
41
-    dataIndex: 'intergral',
42
-    key: 'intergral',
43
-    align: 'center',
44
-  },
45
-  {
46
-    title: '状态',
47
-    dataIndex: 'state',
48
-    key: 'state',
49
-    align: 'center',
50
-  },
51
-  {
52
-    title: '说明',
53
-    dataIndex: 'desc',
54
-    key: 'desc',
55
-    align: 'center',
56
-  },
57
-  {
58
-    title: '操作时间',
59
-    dataIndex: 'time',
60
-    key: 'time',
61
-    align: 'center',
62
-  },
63
-  {
64
-    title: '操作',
65
-    dataIndex: 'handle',
66
-    key: 'handle',
67
-    align: 'center',
68
-    render: () => <><span style={{ color: '#EF273A', marginRight: '20px' }} >停用<Icon type="stop" className={styles.shoppingCart} /></span><span style={{ color: '#EF273A', marginRight: '20px' }} >启用<Icon type="check-circle" className={styles.shoppingCart} /></span><span style={{ color: '#FF925C' }}>编辑<Icon type="form" className={styles.edit} /></span></>,
69
-  },
70 45
 
71
-];
46
+  // 提交事件
47
+  const handleSubmit = (e, props) => {
48
+    e.preventDefault();
49
+    props.form.validateFields((err, values) => {
50
+      if (!err) {
51
+        getList({ pageNum: 1, pageSize: 10, ...values, type: carType})
52
+      }
53
+    });
54
+  }
72 55
 
56
+  const changeStatus = (row) => () => {
57
+    request({
58
+      url: '/api/admin/tdPointsRules/change',
59
+      method: 'PUT',
60
+      data: { ...row },
61
+    }).then((data) => {
62
+      message.info('操作成功!')
63
+      getList({ pageNum: 1, pageSize: 10, type: carType})
64
+    })
65
+  }
66
+
67
+const columns = [
68
+    {
69
+      title: '类型',
70
+      dataIndex: 'ruleName',
71
+      key: 'ruleName',
72
+      align: 'center',
73
+    },
74
+    {
75
+      title: '获取积分',
76
+      dataIndex: 'pointsAmount',
77
+      key: 'pointsAmount',
78
+      align: 'center',
79
+    },
80
+    {
81
+      title: '状态',
82
+      dataIndex: 'status',
83
+      key: 'status',
84
+      align: 'center',
85
+      render: (status) => <span>{status == 1 ? '启用' : '停用'}</span>
86
+    },
87
+    {
88
+      title: '操作时间',
89
+      dataIndex: 'updateDate',
90
+      key: 'updateDate',
91
+      align: 'center',
92
+      render: (updateDate) => <><span>{updateDate != null ? moment(updateDate).format('YYYY-MM-DD') : ''}</span></>
93
+    },
94
+    {
95
+      title: '操作',
96
+      dataIndex: 'handle',
97
+      key: 'handle',
98
+      align: 'center',
99
+      render: (x,row) => <><span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeStatus(row)}>{row.status == 1?'停用':'启用'}<Icon type="stop" className={styles.shoppingCart} /></span>
100
+                      <span style={{ color: '#FF925C' }}>{row.buildingId != null ? '编辑'`${<Icon type="form" className={styles.edit} />}` : ''}</span></>,
101
+    },
102
+  ];
73 103
 
74
-function header(props) {
75 104
   const { getFieldDecorator } = props.form
76 105
   return (
77 106
     <>
78 107
       <Tabs onChange={callback} type="card">
79
-        <TabPane tab="平台积分" key="1">
80
-          <Table style={{ marginTop: '40px' }} dataSource={dataSource} columns={columns} />
108
+        <TabPane tab="平台积分" key="platform">
109
+          <Table style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
110
+          <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
111
+            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
112
+          </div>
81 113
         </TabPane>
82
-        <TabPane tab="项目积分" key="2">
83
-          <Table style={{ marginTop: '40px' }} dataSource={dataSource} columns={columns} />
114
+        <TabPane tab="项目积分" key="project">
115
+        <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
116
+            <Form.Item>
117
+              {getFieldDecorator('buildingId')(
118
+                <BuildSelect />,
119
+              )}
120
+            </Form.Item>
121
+             
122
+            <Form.Item>
123
+              <Button type="primary" htmlType="submit" className={styles.searchBtn}>
124
+                搜索
125
+              </Button>
126
+            </Form.Item>
127
+          </Form>
128
+          <Table style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
129
+          <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
130
+            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
131
+          </div>
84 132
         </TabPane>
85 133
       </Tabs>,
86 134
     </>

+ 128
- 0
src/pages/integralMall/verifyList.jsx 查看文件

@@ -0,0 +1,128 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import styles from '../style/GoodsList.less';
5
+import router from 'umi/router';
6
+import moment from 'moment';
7
+
8
+import request from '../../utils/request'
9
+
10
+const { Option } = Select;
11
+const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
12
+
13
+const header = (props) => {
14
+  const [ data, setData ] = useState({})
15
+
16
+  useEffect(() => {
17
+    getVerifyList({pageNum: 1,pageSize: 10, phone: props.location.query.telValue });
18
+  },[])
19
+
20
+  // 查询列表
21
+  const getVerifyList = (params) => {
22
+    request({
23
+      url: '/api/admin/taPointsExchange',
24
+      method: 'GET',
25
+      params: { ...params },
26
+    }).then((data) => {
27
+        setData(data)
28
+    })
29
+  }
30
+
31
+  const changePageNum = (pageNumber) => {
32
+    getVerifyList({ pageNum: 1, pageSize: 10, phone: props.location.query.telValue })
33
+  }
34
+
35
+  const toBack = () => {
36
+    router.push({
37
+      pathname: '/integralMall/writeOff',
38
+    });
39
+  }
40
+
41
+  const changeStatus = (row) => () => {
42
+    request({
43
+      url: '/api/admin/taPointsExchange/change',
44
+      method: 'PUT',
45
+      data: row
46
+    }).then((data) => {
47
+        message.info("操作成功")
48
+        getVerifyList({ pageNum: pageNumber, pageSize: 10, phone: props.location.query.telValue })
49
+    })
50
+  }
51
+  
52
+  const columns = [
53
+    {
54
+      title: '用户姓名',
55
+      dataIndex: 'personName',
56
+      key: 'personName',
57
+      align: 'center',
58
+    },
59
+    {
60
+      title: '用户类型',
61
+      dataIndex: 'personType',
62
+      key: 'personType',
63
+      align: 'center',
64
+      render: (personType)=> <><span>{personType === 'Realty Consultant' ? '置业顾问' : personType === 'Sales Executive' ? '销售主管' : personType === 'estate agent' ? '经纪人' : ''}</span></>
65
+    },
66
+    {
67
+      title: '手机号',
68
+      dataIndex: 'phone',
69
+      key: 'phone',
70
+      align: 'center',
71
+    },
72
+    {
73
+      title: '商品图片',
74
+      dataIndex: 'image',
75
+      key: 'image',
76
+      align: 'center',
77
+      render: (text, record) => <img src={record.image} className={styles.touxiang} />,
78
+    },
79
+    {
80
+      title: '商品名称',
81
+      dataIndex: 'targetName',
82
+      key: 'targetName',
83
+      align: 'center',
84
+    },
85
+    {
86
+      title: '兑换时间',
87
+      dataIndex: 'createDate',
88
+      key: 'createDate',
89
+      align: 'center',
90
+      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD HH:mm')}</span></>
91
+    },
92
+    {
93
+      title: '领取时间',
94
+      dataIndex: 'verifyDate',
95
+      key: 'verifyDate',
96
+      align: 'center',
97
+      render: (verifyDate) => <><span>{verifyDate != null ? moment(verifyDate).format('YYYY-MM-DD HH:mm') : ''}</span></>
98
+    },
99
+    {
100
+      title: '状态',
101
+      dataIndex: 'status',
102
+      key: 'status',
103
+      align: 'center',
104
+      render: (status)=> <><span>{status == 1 ? '已领取' : '未领取'}</span></>
105
+    },
106
+    {
107
+      title: '操作',
108
+      dataIndex: 'handle',
109
+      key: 'handle',
110
+      align: 'center',
111
+      render: (x,row) => <span style={{ color: '#1990FF' }} onClick={changeStatus(row)}>{ row.status == 1?'':'核销' }</span>
112
+           
113
+    },
114
+  ];
115
+
116
+  return (
117
+    <>
118
+      <Button type="primary" className={styles.addBtn} onClick={toBack}>返回</Button>
119
+      <Table dataSource={data.records} columns={columns} pagination={false} />
120
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
121
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
122
+      </div>
123
+    </>
124
+  )
125
+}
126
+const WrappedHeader = Form.create({ name: 'header' })(header);
127
+
128
+export default WrappedHeader

+ 22
- 4
src/pages/integralMall/writeOff.jsx 查看文件

@@ -1,5 +1,5 @@
1
-import React from 'react';
2
-import { Form, Input, Button, Icon, Tabs, Row, Col } from 'antd';
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Input, Button, Icon, Tabs, Row, Col, message } 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';
@@ -20,6 +20,24 @@ function callback(key) {
20 20
  */
21 21
 
22 22
 function header(props) {
23
+  const [telValue, setTelValue] = useState('')
24
+  const changeTel = (e) => {
25
+    setTelValue(e.target.value)
26
+  }
27
+
28
+  const verifyTel = () =>{
29
+    if(telValue === ""){
30
+      message.error("请输入手机号");
31
+      return;
32
+    }
33
+    router.push({
34
+      pathname: '/integralMall/verifyList',
35
+      query: {
36
+        telValue
37
+      },
38
+    });
39
+  }
40
+
23 41
   const { getFieldDecorator } = props.form
24 42
   return (
25 43
     <>
@@ -60,8 +78,8 @@ function header(props) {
60 78
             </Col>
61 79
           </Row>
62 80
           <div style={{ margin: '110px auto', display: 'block',textAlign:'center' }}>
63
-            <Input placeholder="请输入手机号" style={{width:'200px'}} />
64
-            <Button type="primary" style={{marginLeft:'10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }}>立即核销</Button>
81
+            <Input placeholder="请输入手机号" style={{width:'200px'}} onChange={changeTel}/>
82
+            <Button type="primary" style={{marginLeft:'10px', padding: '6px 46px', backgroundColor: '#EA2323', border: 'none' }} onClick={verifyTel}>立即核销</Button>
65 83
           </div>
66 84
         </TabPane>
67 85
       </Tabs>,

+ 101
- 88
src/pages/news/type/NewsType.jsx 查看文件

@@ -1,115 +1,128 @@
1
-import React from 'react';
1
+import React, { useState, useEffect } from 'react';
2 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
-import styles from './style.less';
4
+import styles from '../../style/GoodsList.less';
5 5
 import router from 'umi/router';
6
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
7
+
8
+import request from '../../../utils/request'
6 9
 
7 10
 const { Option } = Select;
8
-// 提交事件
9
-function handleSubmit(e, props) {
10
-  e.preventDefault();
11
-  props.form.validateFields((err, values) => {
12
-    if (!err) {
13
-      console.log('提交数据: ', values)
14
-    }
15
-  });
16
-}
17
-// Change 事件
18
-function handleSelectChange(props) {
19
-  console.log(props)
20
-}
21 11
 
22
-// 分页
23
-function onChange(pageNumber) {
24
-  console.log('Page: ', pageNumber);
25
-}
26 12
 
27
-// 跳转到编辑资讯
28
-function toEditNews() {
29
-  router.push({
30
-    pathname: '/news/type/editNews',
31
-    query: {
32
-      a: 'b',
33
-    },
34
-  });
35
-}
13
+function header(props) {
14
+  // 获取初始化数据
15
+  const [ data, setData ] = useState({})
36 16
 
37
-/**
38
- *
39
- *
40
- * @param {*} props
41
- * @returns
42
- */
17
+  useEffect(() => {
18
+    getList({ pageNum: 1, pageSize: 10 });
19
+  },[])
43 20
 
44
-const dataSource = [
45
-  {
46
-    key: '1',
47
-    img: 'http://img0.imgtn.bdimg.com/it/u=4246326797,2657995307&fm=26&gp=0.jpg',
48
-    name: '华为P30 Pro',
49
-  },
50
-  {
51
-    key: '2',
52
-    img: '',
53
-    name: '大米',
54
-  },
55
-];
21
+  // 查询列表
22
+  const getList = (params) => {
23
+    request({
24
+        url: '/api/admin/taNewsType',
25
+        method: 'GET',
26
+        params: { ...params },
27
+    }).then((data) => {
28
+        console.log(data)
29
+        setData(data)
30
+    })
31
+  }
32
+  
33
+  // 提交事件
34
+  const handleSubmit = (e, props) => {
35
+    e.preventDefault();
36
+    props.form.validateFields((err, values) => {
37
+      if (!err) {
38
+        getList({ pageNum: 1, pageSize: 10, ...values })
39
+      }
40
+    });
41
+  }
56 42
 
57
-const columns = [
58
-  {
59
-    title: '类型图片',
60
-    dataIndex: 'img',
61
-    key: 'img',
62
-    align: 'left',
63
-    render: (text, record) => <img src={record.img} className={styles.touxiang} />,
64
-  },
65
-  {
66
-    title: '名称',
67
-    dataIndex: 'name',
68
-    key: 'name',
69
-    align: 'center',
43
+  const changePageNum = (pageNumber) => {
44
+    getList({ pageNum: pageNumber, pageSize: 10 })
45
+  }
46
+
47
+
48
+  // 跳转到编辑咨询
49
+  const toEditNews = (id) => () => {
50
+    router.push({
51
+      pathname: '/news/type/editNews',
52
+      query: {
53
+        id
54
+      },
55
+    });
56
+  }
57
+
58
+  
59
+  const changeNewsStatus = (row, newsId) => () => {
60
+    Modal.confirm({
61
+      title: '确认删除该商品?',
62
+      okText: '确认',
63
+      cancelText: '取消',
64
+      onOk() {
65
+        request({
66
+          url: '/api/admin/taNewsType/' + newsId,
67
+          method: 'DELETE',
68
+          data: { ...row },
69
+        }).then((data) => {
70
+          message.info('操作成功!')
71
+          getList({ pageNum: 1, pageSize: 10 });
72
+        })
73
+      }
74
+    });
75
+  }
76
+  /**
77
+   *
78
+   *
79
+   * @param {*} props
80
+   * @returns
81
+   */
82
+  const columns = [
83
+    {
84
+      title: '类型图',
85
+      dataIndex: 'newsTypeImg',
86
+      key: 'newsTypeImg',
87
+      align: 'center',
88
+      render: (text, record) => <img src={record.newsTypeImg} className={styles.touxiang} />,
89
+    },
90
+    {
91
+      title: '名称',
92
+      dataIndex: 'newsTypeName',
93
+      key: 'newsTypeName',
94
+      align: 'center',
70 95
 
71
-  },
72
-  {
73
-    title: '操作',
74
-    dataIndex: 'handle',
75
-    key: 'handle',
76
-    align: 'center',
77
-    render: () => <>
78
-    <span style={{ color: '#1990FF', marginRight: '20px' }} onClick={confirm}>删除<Icon type="shopping-cart" className={styles.shoppingCart} /></span>
79
-    <span style={{ color: '#FF925C' }} onClick={toEditNews}>编辑<Icon type="form" className={styles.edit} /></span></>,
80
-  },
81
-];
82
-function confirm() {
83
-  Modal.confirm({
84
-    title: '确认删除该类型?',
85
-    okText: '确认',
86
-    cancelText: '取消',
87
-    onOk() {
88
-      console.log('OK');
89 96
     },
90
-    onCancel() {
91
-      console.log('Cancel');
97
+    {
98
+      title: '操作',
99
+      dataIndex: 'handle',
100
+      key: 'handle',
101
+      align: 'center',
102
+      render: (x, row) => <><span style={{ color: '#EF273A', marginRight: '20px' }} onClick={changeNewsStatus(row, row.newsTypeId)}>{row.status == 1 ? '删除' : '上架'}<Icon type="shopping-cart" className={styles.shoppingCart} />
103
+                            </span><span style={{ color: '#FF925C' }} onClick={toEditNews(row.newsTypeId)}>编辑<Icon type="form" className={styles.edit} /></span></>,
92 104
     },
93
-  });
105
+  ];
94 106
 
95
-}
96
-function header(props) {
97 107
   const { getFieldDecorator } = props.form
98 108
   return (
99 109
 
100 110
     <>
101 111
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
102 112
         <Form.Item>
103
-          {getFieldDecorator('goodState')(
104
-            <Select style={{ width: '180px' }} placeholder="请选择" onChange={handleSelectChange}>
105
-              <Option value="1">上架</Option>
106
-              <Option value="0">下架</Option>
113
+          {getFieldDecorator('status')(
114
+            <Select style={{ width: '180px' }} placeholder="请选择">
115
+              <Option value="1">上架</Option>
116
+              <Option value="0">下架</Option>
107 117
             </Select>,
108 118
           )}
109 119
         </Form.Item>
110 120
       </Form>
111
-      <Button type="primary" className={styles.addBtn} onClick={toEditNews}>新增</Button>
112
-      <Table dataSource={dataSource} columns={columns} />
121
+      <Button type="primary" className={styles.addBtn} onClick={toEditNews()}>新增</Button>
122
+      <Table dataSource={data.records} columns={columns} pagination={false} />
123
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
124
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
125
+      </div>
113 126
     </>
114 127
   )
115 128
 }

+ 73
- 49
src/pages/news/type/editNews.jsx 查看文件

@@ -2,6 +2,8 @@ import React, { useState, useEffect } from 'react';
2 2
 import { Input, Menu, Dropdown, Button, Icon, message, Table, Divider, Tag, Select, Form, Alert } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4 4
 import channels from '../../channel/channelList.less';
5
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
6
+import XForm, { FieldTypes } from '../../../components/XForm';
5 7
 import router from 'umi/router';
6 8
 import request from '../../../utils/request'
7 9
 
@@ -9,65 +11,87 @@ const { TextArea } = Input;
9 11
 const { Option } = Select;
10 12
 
11 13
 const header = props => {
14
+  const newsId = props.location.query.id
15
+  console.log("newsId" + newsId);
16
+  const [ newsData, setNewsData ] = useState({})
17
+  if(newsId){
18
+    useEffect(() => {
19
+      getNewsData(newsId);
20
+    },[])
12 21
 
13
-  const [data, setData] = useState({ channelNmae: [], result: [] })
14
-
15
-  function goBack(){
16
-    router.push({
17
-      pathname: '/news/type/NewsType',
18
-    });
19
-  }
20
-
21
-  function addChannel(params) {
22
+  // 查询列表
23
+  const getNewsData = (newsId) => {
22 24
     request({
23
-      url: '/api/admin/channel',
24
-      method: 'POST',
25
-      data: { ...params },
26
-      // eslint-disable-next-line no-shadow
27
-    }).then(data => {
28
-      console.log(data)
29
-      setData(data)
30
-      // eslint-disable-next-line no-unused-expressions
31
-      router.go(-1)
25
+        url: '/api/admin/taNewsType/' + newsId,
26
+        method: 'GET',
27
+    }).then((data) => {
28
+        console.log(data)
29
+        setNewsData(data)
32 30
     })
33 31
   }
32
+  }
34 33
 
35
-  function handleSubmit(e) {
36
-    e.preventDefault();
37
-    props.form.validateFields((err, values) => {
38
-      if (!err) {
39
-        console.log('Received values of form: ', values);
40
-        // eslint-disable-next-line max-len
41
-        addChannel({ channelName: values.channelName, channelContact: values.channelContact, contactTel: values.contactTel })
34
+  const fields = [
35
+    {
36
+      label: '所属项目',
37
+      name: 'buildingId',
38
+      render: <BuildSelect />,
39
+      value: newsData.buildingId,
40
+      rules: [
41
+        {required: true, message: '请选择所属项目'},
42
+      ]
43
+    },
44
+    {
45
+      label: '类型图',
46
+      name: 'newsTypeImg',
47
+      type: FieldTypes.ImageUploader,
48
+      value: newsData.newsTypeImg,
49
+    },
50
+    {
51
+      label: '名称',
52
+      name: 'newsTypeName',
53
+      type: FieldTypes.Text,
54
+      value: newsData.newsTypeName,
55
+      rules: [
56
+        {required: true, message: '请输入咨询名称'},
57
+      ]
58
+    },
59
+  ]
60
+
61
+   
62
+  const handleSubmit = (values) => {
63
+    if(newsId){
64
+      values.newsTypeId = newsId
65
+      request({
66
+        url: '/api/admin/taNewsType/' + newsId,
67
+        method: 'PUT',
68
+        data: values,
69
+      }).then((data) => {
70
+        cancelPage()
71
+      }).catch((err) => {
72
+        message.info(err.msg || err.message)
73
+      })
74
+      }else{
75
+      request({
76
+        url: '/api/admin/taNewsType',
77
+        method: 'POST',
78
+        data: values,
79
+      }).then((data) => {
80
+        cancelPage()
81
+      }).catch((err) => {
82
+        message.info(err.msg || err.message)
83
+      })
42 84
       }
43
-    });
44 85
   }
45 86
 
46
-  const { getFieldDecorator } = props.form;
87
+  const cancelPage = () => {
88
+    router.push({
89
+      pathname: '/news/type/NewsType',
90
+    });
91
+  }
47 92
 
48 93
   return (
49
-    <>
50
-      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
51
-      <Form.Item label="类型图片">
52
-          {getFieldDecorator('newsName', {
53
-            rules: [{ message: '' }],
54
-          })(<Input className={channels.inpuit} />)}
55
-        </Form.Item>
56
-        <Form.Item label="名称">
57
-          {getFieldDecorator('newsName', {
58
-            rules: [{ message: '请输入资讯名称' }],
59
-          })(<Input className={channels.inpuit} />)}
60
-        </Form.Item>
61
-        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
62
-          <Button type="primary" htmlType="submit">
63
-            保存
64
-          </Button>
65
-          <Button className={channels.formButton} onClick={goBack} type="primary" htmlType="submit">
66
-            取消
67
-          </Button>
68
-        </Form.Item>
69
-      </Form>
70
-    </>
94
+    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
71 95
   )
72 96
 }
73 97
 

+ 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
+}