소스 검색

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

张延森 5 년 전
부모
커밋
1c28320254
59개의 변경된 파일2577개의 추가작업 그리고 853개의 파일을 삭제
  1. 9
    1
      config/config.js
  2. 6
    6
      config/routes.js
  3. 1
    1
      package.json
  4. 10
    14
      src/components/SelectButton/BuildSelect.jsx
  5. 73
    0
      src/components/XForm/FileUpload.jsx
  6. 6
    1
      src/components/XForm/ImageListUpload.jsx
  7. 1
    1
      src/pages/Welcome.jsx
  8. 50
    16
      src/pages/activity/ActivityList.jsx
  9. 51
    33
      src/pages/activity/drainage/Detail.jsx
  10. 118
    76
      src/pages/activity/drainage/DrainageList.jsx
  11. 96
    43
      src/pages/activity/editActivity.jsx
  12. 47
    7
      src/pages/activity/groupActivity/editGroupActivity.jsx
  13. 1
    0
      src/pages/activity/groupActivity/helpRecord.jsx
  14. 113
    107
      src/pages/activity/groupActivity/list.jsx
  15. 33
    8
      src/pages/activity/helpActivity/edithelpActivity.jsx
  16. 5
    1
      src/pages/activity/helpActivity/helpRecord.jsx
  17. 27
    37
      src/pages/activity/helpActivity/list.jsx
  18. 28
    9
      src/pages/building/list/add/components/amap.jsx
  19. 103
    0
      src/pages/building/list/add/components/amapAroundData.js
  20. 191
    24
      src/pages/building/list/add/components/base.jsx
  21. 275
    0
      src/pages/building/list/add/components/buildingImage.jsx
  22. 31
    19
      src/pages/building/list/add/components/imageSet.jsx
  23. 20
    31
      src/pages/building/list/add/components/modalImage.jsx
  24. 3
    2
      src/pages/building/list/add/components/poster.jsx
  25. 2
    1
      src/pages/building/list/add/components/share.jsx
  26. 30
    18
      src/pages/building/list/add/index.jsx
  27. 11
    10
      src/pages/building/list/index.jsx
  28. 3
    2
      src/pages/building/type/index.jsx
  29. 9
    8
      src/pages/carouselFigure/SelectNews.jsx
  30. 7
    7
      src/pages/carouselFigure/advertisingList.jsx
  31. 2
    2
      src/pages/carouselFigure/editAdvertising.jsx
  32. 7
    3
      src/pages/carouselFigure/editCarousel.jsx
  33. 0
    6
      src/pages/channel/channelList.jsx
  34. 18
    13
      src/pages/customer/customerlist/components/attribution.jsx
  35. 145
    0
      src/pages/customer/customerlist/components/recommend.jsx
  36. 88
    32
      src/pages/customer/customerlist/customerDetail.jsx
  37. 85
    15
      src/pages/customer/customerlist/index.jsx
  38. 137
    0
      src/pages/customer/customerlist/publicCustomerDetail.jsx
  39. 209
    0
      src/pages/customer/customerlist/publicStyle.less
  40. 64
    6
      src/pages/customer/customerlist/style.less
  41. 7
    5
      src/pages/customer/independentList/index.jsx
  42. 12
    4
      src/pages/customer/recommendCustomer/audit.jsx
  43. 30
    20
      src/pages/customer/recommendCustomer/components/attribution.jsx
  44. 4
    3
      src/pages/customer/report/index.jsx
  45. 1
    1
      src/pages/indexEcharts/components/UserBehavior.jsx
  46. 107
    74
      src/pages/indexEcharts/userBehavior.jsx
  47. 5
    1
      src/pages/indexEcharts/userSource.jsx
  48. 14
    14
      src/pages/integralMall/achieve.jsx
  49. 9
    2
      src/pages/integralMall/editGoods.jsx
  50. 2
    2
      src/pages/integralMall/writeOff.jsx
  51. 6
    4
      src/pages/news/list/editNewsList.jsx
  52. 18
    18
      src/pages/staff/list/editStaff.jsx
  53. 10
    5
      src/pages/style/GoodsList.less
  54. 164
    46
      src/pages/system/document/audit.jsx
  55. 25
    26
      src/pages/system/document/list.jsx
  56. 0
    62
      src/pages/system/document/see.jsx
  57. 2
    2
      src/pages/system/editPolicy.jsx
  58. 38
    0
      src/services/apis.js
  59. 8
    4
      src/utils/request.js

+ 9
- 1
config/config.js 파일 보기

138
   },
138
   },
139
   chainWebpack: webpackPlugin,
139
   chainWebpack: webpackPlugin,
140
 
140
 
141
-  proxy,
141
+  proxy: {
142
+    ...proxy,
143
+    '/gaode_amap': { // 高德地图
144
+      // target: 'http://192.168.0.11:8080/',
145
+      target: 'https://restapi.amap.com/v3/',
146
+      changeOrigin: true,
147
+      pathRewrite: { '^/gaode_amap': '' },
148
+    },
149
+  },
142
 };
150
 };

+ 6
- 6
config/routes.js 파일 보기

128
                 name: '到访记录',
128
                 name: '到访记录',
129
                 component: './customer/visiting/index',
129
                 component: './customer/visiting/index',
130
               },
130
               },
131
+              {
132
+                path: '/customer/customerlist/publicCustomerDetail',
133
+                name: '私客详情',
134
+                hideInMenu: true,
135
+                component: './customer/customerlist/publicCustomerDetail',
136
+              },
131
             ],
137
             ],
132
           },
138
           },
133
           {
139
           {
424
                 hideInMenu: true,
430
                 hideInMenu: true,
425
                 component: './system/document/audit',
431
                 component: './system/document/audit',
426
               },
432
               },
427
-              {
428
-                path: '/system/document/see',
429
-                name: '客户资料查看',
430
-                hideInMenu: true,
431
-                component: './system/document/see',
432
-              },
433
             ],
433
             ],
434
           },
434
           },
435
           {
435
           {

+ 1
- 1
package.json 파일 보기

43
   "dependencies": {
43
   "dependencies": {
44
     "@ant-design/pro-layout": "^4.5.9",
44
     "@ant-design/pro-layout": "^4.5.9",
45
     "@antv/data-set": "^0.10.2",
45
     "@antv/data-set": "^0.10.2",
46
-    "antd": "^3.20.0",
46
+    "antd": "^3.25.0",
47
     "classnames": "^2.2.6",
47
     "classnames": "^2.2.6",
48
     "dayjs": "^1.8.16",
48
     "dayjs": "^1.8.16",
49
     "dva": "^2.4.1",
49
     "dva": "^2.4.1",

+ 10
- 14
src/components/SelectButton/BuildSelect.jsx 파일 보기

19
  * @param {*} props
19
  * @param {*} props
20
  * @returns
20
  * @returns
21
  */
21
  */
22
-const BuildingSelect = (props) => {
23
-  const [ data, setData ] = useState([])
24
-  const [ value, setValue ] = useState('')
25
-  // const preProps = usePrevious(props)
26
-
27
-  // if ((!preProps) && props.value != value) {
28
-  //   setValue(props.value)
29
-  // }
22
+const BuildingSelect = props => {
23
+  const [data, setData] = useState([])
24
+  const [value, setValue] = useState('')
30
 
25
 
31
   useEffect(() => {
26
   useEffect(() => {
32
     setValue(props.value)
27
     setValue(props.value)
34
 
29
 
35
   useEffect(() => {
30
   useEffect(() => {
36
     getCityList();
31
     getCityList();
37
-  },[])
32
+  }, [])
38
 
33
 
39
-  const getCityList = (e) => {
40
-    request({ ...apis.building.getList, params: {pageNum: 1,pageSize: 999}, }).then((data) => {
34
+  const getCityList = e => {
35
+    request({ ...apis.building.getList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
41
         setData(data.records)
36
         setData(data.records)
42
         // 默认选中第一个
37
         // 默认选中第一个
43
         if (props.checkFirst) {
38
         if (props.checkFirst) {
47
     })
42
     })
48
   }
43
   }
49
 
44
 
50
-  const handleChange = (e) => {
45
+  const handleChange = e => {
51
     setValue(e)
46
     setValue(e)
52
     props.onChange(e)
47
     props.onChange(e)
53
   }
48
   }
54
   // '' === value ? undefined : value
49
   // '' === value ? undefined : value
55
   return (
50
   return (
56
       <Select
51
       <Select
52
+      {...props} 
57
       showSearch
53
       showSearch
58
       value={value}
54
       value={value}
59
-      style={{ width: '180px' }} 
60
-      placeholder="请选择项目" 
55
+      style={{ width: '180px' }}
56
+      placeholder="请选择项目"
61
       onChange={handleChange}
57
       onChange={handleChange}
62
       filterOption={(input, option) =>
58
       filterOption={(input, option) =>
63
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
59
         option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 73
- 0
src/components/XForm/FileUpload.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react'
2
+import { Upload, Button, Icon } from 'antd';
3
+import { uploaderProps } from '../../utils/upload';
4
+
5
+/**
6
+ * value 数据的接收格式 [{ url: xxxxx.mp4 }]
7
+ * @param {*} props 
8
+ */
9
+function fileUpload(props) {
10
+
11
+  const { value } = props
12
+  console.log('fileUploadProps: ', props)
13
+  // eslint-disable-next-line react-hooks/rules-of-hooks
14
+  const [defaultFileList, setDefaultFileList] = useState([])
15
+
16
+  // eslint-disable-next-line react-hooks/rules-of-hooks
17
+  useEffect(() => {
18
+    setDefaultValue()
19
+  }, [props.value]);
20
+
21
+
22
+  function getFileList() {
23
+    console.log('fileUpload: ', value)
24
+    // value 数据的接收格式 [{ url: xxxxx.mp4 }, { url: xxxxx.jpg }]
25
+    return (value || []).filter(f => f !== undefined).map((img, inx) => ({ uid: inx, url: img, name: img.substring(img.lastIndexOf('/') + 1, img.length), status: 'done' }))
26
+  }
27
+
28
+  function setDefaultValue() {
29
+    if (!value) {
30
+      return;
31
+    }
32
+
33
+    setDefaultFileList(getFileList())
34
+  }
35
+
36
+  function onFileChange({ file, fileList }) {
37
+    console.log(file, fileList)
38
+    setDefaultFileList(fileList)
39
+    if (file.status === 'uploading') {
40
+      return
41
+    }
42
+
43
+    if (file.status === 'done' || file.status === 'removed') {
44
+
45
+      // 因为这个控件本身返回的数据格式 [{ ..., response: '服务器返回的数据' }]
46
+      // 但是 我这里自己用的时候 传入的数据是 [ 'xxxx.mp4', 'xxxx.jpg' ], 然后通过 getFileList() 转换成了 [{ url: 'xxx.mp4' }] 这样的格式
47
+
48
+      // 原因是因为 控件返回的数据 和 fileList 展示已经上传的数据 的格式字段不一样
49
+
50
+      const resFileList = fileList.filter(f => f.response !== undefined).map(i => i.response)
51
+      const tempFileList = fileList.filter(f => f.url !== undefined).map(i => i.url)
52
+      const resultList = tempFileList.concat(resFileList || [])
53
+      props.onChange(resultList)
54
+    }
55
+  }
56
+
57
+  return (
58
+    <>
59
+      <Upload
60
+        { ...uploaderProps }
61
+        {...props}
62
+        onChange={onFileChange}
63
+        fileList={defaultFileList}
64
+      >
65
+        <Button>
66
+          <Icon type="upload" /> {props.label}
67
+        </Button>
68
+      </Upload>
69
+    </>
70
+  )
71
+}
72
+
73
+export default fileUpload

+ 6
- 1
src/components/XForm/ImageListUpload.jsx 파일 보기

3
 import './style.less';
3
 import './style.less';
4
 import { uploaderProps } from '../../utils/upload';
4
 import { uploaderProps } from '../../utils/upload';
5
 
5
 
6
+/**
7
+ * unlimited  属性表示上传图片无限制
8
+ * 例子: <ImageListUpload unlimited/>
9
+ */
6
 class ImageListUpload extends React.Component {
10
 class ImageListUpload extends React.Component {
7
   state = {
11
   state = {
8
     previewVisible: false,
12
     previewVisible: false,
79
           { ...uploaderProps }
83
           { ...uploaderProps }
80
           onSuccess={this.handleUploadSucess}
84
           onSuccess={this.handleUploadSucess}
81
         >
85
         >
82
-          {(fileList || images).length >= 8 ? null : uploadButton}
86
+          {/* unlimited 表示上传无限制数量 */}
87
+          {(this.props.unlimited && uploadButton) || ((fileList || images).length >= 8 ? null : uploadButton)}
83
         </Upload>
88
         </Upload>
84
         <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
89
         <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
85
           <img alt="example" style={{ width: '100%' }} src={previewImage} />
90
           <img alt="example" style={{ width: '100%' }} src={previewImage} />

+ 1
- 1
src/pages/Welcome.jsx 파일 보기

54
             borderRadius: '12px', width: '32%', marginRight: '2%'
54
             borderRadius: '12px', width: '32%', marginRight: '2%'
55
           }}>
55
           }}>
56
             <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
56
             <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
57
-            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{(data.selectRegisteredCount && data.selectRegisteredCount + 95) || '0'}</span>
57
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
58
           </div>
58
           </div>
59
         }
59
         }
60
         {checkData.includes('number_of_new_users') &&
60
         {checkData.includes('number_of_new_users') &&

+ 50
- 16
src/pages/activity/ActivityList.jsx 파일 보기

17
   // eslint-disable-next-line react-hooks/rules-of-hooks
17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18
   const [data, setData] = useState({ list: [], total: 0 })
18
   const [data, setData] = useState({ list: [], total: 0 })
19
   //   const [page, changePage] = useState({})
19
   //   const [page, changePage] = useState({})
20
+  const [time, setTime] = useState('')
20
 
21
 
21
   // 查询列表
22
   // 查询列表
22
   const getList = params => {
23
   const getList = params => {
70
       dataIndex: 'title',
71
       dataIndex: 'title',
71
       key: 'title',
72
       key: 'title',
72
       align: 'center',
73
       align: 'center',
74
+      // width: '15%',
75
+      render:  (x, row) => <><div style={{overflow: 'hidden',textOverflow: 'ellipsis',whiteSpace: 'nowrap', width: '201px',title:'content'}}>{row.title}</div></>,
76
+      // width: '300px',
77
+      // ellipsis:'true'overflow: hidden; /*溢出隐藏*/
78
+// text-overflow: ellipsis; /*以省略号...显示*/
79
+// white-space: nowrap;
73
     },
80
     },
74
     {
81
     {
75
       title: '活动时间',
82
       title: '活动时间',
76
       dataIndex: 'startDate',
83
       dataIndex: 'startDate',
77
       key: 'startDate',
84
       key: 'startDate',
78
       align: 'center',
85
       align: 'center',
86
+      // width: '15%',
87
+      // width: '20%',
79
       render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>,
88
       render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>,
80
     },
89
     },
81
     {
90
     {
83
       dataIndex: 'count',
92
       dataIndex: 'count',
84
       key: 'count',
93
       key: 'count',
85
       align: 'center',
94
       align: 'center',
95
+      // width: '10%',
96
+      // width: '6%',
86
     },
97
     },
87
     {
98
     {
88
       title: '阅读量',
99
       title: '阅读量',
89
       dataIndex: 'pvNum',
100
       dataIndex: 'pvNum',
90
       key: 'pvNum',
101
       key: 'pvNum',
91
       align: 'center',
102
       align: 'center',
103
+      // width: '10%',
92
     },
104
     },
93
     {
105
     {
94
       title: '转发量',
106
       title: '转发量',
95
       dataIndex: 'shareNum',
107
       dataIndex: 'shareNum',
96
       key: 'shareNum',
108
       key: 'shareNum',
97
       align: 'center',
109
       align: 'center',
110
+      // width: '10%',
98
     },
111
     },
99
     {
112
     {
100
       title: '收藏数',
113
       title: '收藏数',
101
       dataIndex: 'saveNum',
114
       dataIndex: 'saveNum',
102
       key: 'saveNum',
115
       key: 'saveNum',
103
       align: 'center',
116
       align: 'center',
117
+      // width: '10%',
104
     },
118
     },
105
     {
119
     {
106
-      title: '状态',
120
+      title: '报名状态',
107
       dataIndex: 'activityStatus',
121
       dataIndex: 'activityStatus',
108
       key: 'activityStatus',
122
       key: 'activityStatus',
109
       align: 'center',
123
       align: 'center',
124
+      // width: '10%',
110
       render: activityStatus => <><span>{activityStatus == 0 ? '进行中' : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
125
       render: activityStatus => <><span>{activityStatus == 0 ? '进行中' : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
111
     },
126
     },
127
+    {
128
+      title: '权重',
129
+      dataIndex: 'heavy',
130
+      key: 'heavy',
131
+      align: 'center',
132
+    },
112
     {
133
     {
113
       title: '操作',
134
       title: '操作',
114
       dataIndex: 'handle',
135
       dataIndex: 'handle',
117
       render: (x, row) => (
138
       render: (x, row) => (
118
         <>
139
         <>
119
           <AuthButton name="admin.SignList.get" noRight={null}>
140
           <AuthButton name="admin.SignList.get" noRight={null}>
120
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' || row.isEnlist == '2' ? '报名记录' : ''}{ (row.isEnlist==1||row.isEnlist==2)  && <Icon type="snippets" className={styles.shoppingCart} />}</span>
141
+          {(row.activityStatus === 0 || row.activityStatus === 2) && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.dynamicId)}>{row.isEnlist == '1' ? '报名记录' : ''}{ (row.isEnlist==1)  && <Icon type="snippets" className={styles.shoppingCart} />}</span>}
121
           </AuthButton>
142
           </AuthButton>
122
           <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
143
           <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
123
-            {row.activityStatus != 0 && <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>}
144
+            <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
124
           </AuthButton>
145
           </AuthButton>
125
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
146
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
126
-            {row.isEnlist == 1 && <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
147
+            {row.activityStatus === 0 && <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={finishDynamic.bind(this, row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>}
127
           </AuthButton>
148
           </AuthButton>
128
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
149
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
129
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消置顶' : '置顶'}<Icon type="vertical-align-top" className={styles.edit} /></span>
130
-            {row.isEnlist != 2 && <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
150
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
151
+            {(row.activityStatus === 0 || row.activityStatus === 1) && <span style={{ color: '#FF925C',marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.dynamicId)}>编辑<Icon type="form" className={styles.edit} /></span>}
131
           </AuthButton>
152
           </AuthButton>
132
-          <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>下载二维码<Icon type="qrcode" className={styles.shoppingCart} /></span>
153
+      {(row.activityStatus === 0 || row.activityStatus === 2) &&<span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={newQrcode.bind(this, row)}>{row.isEnlist === 1 && '下载二维码'} {row.isEnlist === 1 && <Icon type="qrcode" className={styles.shoppingCart} />}</span>}
133
         </>
154
         </>
134
       ),
155
       ),
135
     },
156
     },
136
   ];
157
   ];
137
-
138
   const getSignList = dynamicId => {
158
   const getSignList = dynamicId => {
139
     router.push({
159
     router.push({
140
       pathname: '/activity/SignList',
160
       pathname: '/activity/SignList',
153
         request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: '' } }).then(data => {
173
         request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: '' } }).then(data => {
154
           console.log(data)
174
           console.log(data)
155
           message.info('操作成功!')
175
           message.info('操作成功!')
156
-          getList({ pageNum: 1, pageSize: 10 })
176
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
157
         }).catch(err => {
177
         }).catch(err => {
158
           console.log(err)
178
           console.log(err)
159
           message.info(err.msg || err.message)
179
           message.info(err.msg || err.message)
168
     request({ ...apis.activity.weight, params: { dynamicId: row.dynamicId, weight } }).then(data => {
188
     request({ ...apis.activity.weight, params: { dynamicId: row.dynamicId, weight } }).then(data => {
169
       console.log(data)
189
       console.log(data)
170
       message.info('操作成功!')
190
       message.info('操作成功!')
171
-      getList({ pageNum: 1, pageSize: 10 })
191
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
172
     }).catch(err => {
192
     }).catch(err => {
173
       console.log(err)
193
       console.log(err)
174
       message.info(err.msg || err.message)
194
       message.info(err.msg || err.message)
187
   const cancelDynamic = row => {
207
   const cancelDynamic = row => {
188
     request({ ...apis.activity.cancel, urlData: { id: row.dynamicId } }).then(data => {
208
     request({ ...apis.activity.cancel, urlData: { id: row.dynamicId } }).then(data => {
189
       message.info('操作成功!')
209
       message.info('操作成功!')
190
-      getList({ pageNum: 1, pageSize: 10 })
210
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
191
     }).catch(err => {
211
     }).catch(err => {
192
       console.log(err)
212
       console.log(err)
193
       message.info(err.msg || err.message)
213
       message.info(err.msg || err.message)
198
   const sendDynamic = row => {
218
   const sendDynamic = row => {
199
     request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then(data => {
219
     request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then(data => {
200
       message.info('操作成功!')
220
       message.info('操作成功!')
201
-      getList({ pageNum: 1, pageSize: 10 });
221
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
202
     }).catch(err => {
222
     }).catch(err => {
203
       console.log(err)
223
       console.log(err)
204
       message.info(err.msg || err.message)
224
       message.info(err.msg || err.message)
206
   }
226
   }
207
 
227
 
208
   const changePageNum = pageNumber => {
228
   const changePageNum = pageNumber => {
209
-    getList({ pageNum: pageNumber, pageSize: 10 })
229
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
210
   }
230
   }
211
 
231
 
212
   // 提交事件
232
   // 提交事件
213
-  const handleSubmit = (e, props) => {
233
+  const handleSubmit = e => {
214
     e.preventDefault();
234
     e.preventDefault();
215
     props.form.validateFields((err, values) => {
235
     props.form.validateFields((err, values) => {
216
       if (!err) {
236
       if (!err) {
217
         console.log('提交数据: ', values)
237
         console.log('提交数据: ', values)
238
+        if (time) {
239
+          values.time = `${moment(time).format('YYYY-MM-DDT00:00:00.000')}Z`
240
+        } else {
241
+          values.time = null
242
+        }
243
+        
218
         getList({ pageNum: 1, pageSize: 10, ...values })
244
         getList({ pageNum: 1, pageSize: 10, ...values })
219
       }
245
       }
220
     });
246
     });
223
   // 重置搜索
249
   // 重置搜索
224
   function handleReset () {
250
   function handleReset () {
225
     props.form.resetFields();
251
     props.form.resetFields();
252
+    setTime('')
253
+    getList({ pageNum: 1, pageSize: 10 })
254
+  }
255
+
256
+  // 时间回调
257
+  function timeOnChange(date, dateString) {
258
+    console.log(date, dateString)
259
+    setTime(date)
226
   }
260
   }
227
 
261
 
228
 
262
 
232
     <>
266
     <>
233
       {/* style={{ display: 'none' }} */}
267
       {/* style={{ display: 'none' }} */}
234
       <div id="qrcode"></div>
268
       <div id="qrcode"></div>
235
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
269
+      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
236
         <Form.Item>
270
         <Form.Item>
237
           {getFieldDecorator('cityId')(
271
           {getFieldDecorator('cityId')(
238
             <SelectCity />,
272
             <SelectCity />,
253
         </Form.Item>
287
         </Form.Item>
254
         <Form.Item>
288
         <Form.Item>
255
           {getFieldDecorator('time')(
289
           {getFieldDecorator('time')(
256
-            <DatePicker />,
290
+            <DatePicker onChange={timeOnChange}/>,
257
           )}
291
           )}
258
         </Form.Item>
292
         </Form.Item>
259
         <Form.Item>
293
         <Form.Item>

+ 51
- 33
src/pages/activity/drainage/Detail.jsx 파일 보기

8
 import request from '../../../utils/request';
8
 import request from '../../../utils/request';
9
 import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'constants';
9
 import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'constants';
10
 import AuthButton from '../../../components/AuthButton';
10
 import AuthButton from '../../../components/AuthButton';
11
+import { timeout } from 'q';
11
 
12
 
12
 
13
 
13
 const data = []
14
 const data = []
22
   const [startDate, setStartDate] = useState('')
23
   const [startDate, setStartDate] = useState('')
23
   const [endDate, setEndDate] = useState('')
24
   const [endDate, setEndDate] = useState('')
24
   const [total, setTotal] = useState({})
25
   const [total, setTotal] = useState({})
25
-  let daterange = []
26
   // let content = {}
26
   // let content = {}
27
   useEffect(() => {
27
   useEffect(() => {
28
 
28
 
61
         const r = {
61
         const r = {
62
 
62
 
63
           key: inx + 1,
63
           key: inx + 1,
64
-          createDate:row.createDate,
64
+          createDate: row.createDate,
65
           [`${col.key}`]: col.value,
65
           [`${col.key}`]: col.value,
66
           ...acc,
66
           ...acc,
67
         }
67
         }
72
   }
72
   }
73
 
73
 
74
   function tableTitle (data) {
74
   function tableTitle (data) {
75
-   tableTitle = eval('(' + data[0].content + ')')
75
+    tableTitle = eval('(' + data[0].content + ')')
76
     const cols = [{
76
     const cols = [{
77
       title: "提交时间",
77
       title: "提交时间",
78
       dataIndex: "createDate",
78
       dataIndex: "createDate",
79
       key: "createDate",
79
       key: "createDate",
80
       render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
80
       render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81
     }]
81
     }]
82
-    return cols.concat( tableTitle.map((item) => {
82
+    return cols.concat(tableTitle.map((item) => {
83
       const col = {
83
       const col = {
84
         title: item.label,
84
         title: item.label,
85
         dataIndex: item.key,
85
         dataIndex: item.key,
88
       return col
88
       return col
89
     }))
89
     }))
90
   }
90
   }
91
+  // function datalist () {
91
 
92
 
92
-
93
-  function datalist () {
94
-
95
-    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) })
96
-  }
93
+  //   gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
94
+  // }
97
 
95
 
98
   function fromTime (str) {
96
   function fromTime (str) {
99
     return str === '' ? null : `${moment(str).format('YYYY-MM-DDT00:00:00.000')}Z`
97
     return str === '' ? null : `${moment(str).format('YYYY-MM-DDT00:00:00.000')}Z`
100
   }
98
   }
101
 
99
 
100
+  function Time (str) {
101
+    return str === '' ? null : `${moment(str).format('YYYY-MM-DD')}`
102
+  }
103
+  // 2019-10-30T11:04:49
102
   function onChangetime (dates, dateStrings) {
104
   function onChangetime (dates, dateStrings) {
103
-
105
+    console.log(dateStrings[1])
104
     setEndDate(dateStrings[1])
106
     setEndDate(dateStrings[1])
105
     setStartDate(dateStrings[0])
107
     setStartDate(dateStrings[0])
106
 
108
 
107
   }
109
   }
108
 
110
 
109
   const changePageNum = pageNumber => {
111
   const changePageNum = pageNumber => {
110
-    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10, drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) })
112
+    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
111
   }
113
   }
112
 
114
 
113
 
115
 
114
   function excelPort () {
116
   function excelPort () {
115
     // const fieldsValue = getFieldsValue()
117
     // const fieldsValue = getFieldsValue()
116
-  
118
+
117
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
119
     request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
118
       .then(response => {
120
       .then(response => {
119
         download(response)
121
         download(response)
137
     link.click()
139
     link.click()
138
   }
140
   }
139
 
141
 
142
+  function handleReset (e) {
143
+    console.log(e)
144
+    props.form.resetFields();
145
+    setEndDate('')
146
+    setStartDate('')
147
+  }
148
+
149
+  const handleSubmit = (e, props) => {
150
+    e.preventDefault();
151
+    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
152
+  }
153
+
140
   const { RangePicker } = DatePicker;
154
   const { RangePicker } = DatePicker;
155
+  const { getFieldDecorator } = props.form
141
   return (
156
   return (
142
     <>
157
     <>
143
-
144
-      <RangePicker
145
-        style={{ width: '400px' }}
146
-        // ranges={{
147
-        //   Today: [moment(), moment()],
148
-        //   'This Month': [moment().startOf('month'), moment().endOf('month')],
149
-        // }}
150
-        // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
151
-        showTime
152
-        onChange={onChangetime}
153
-      />
154
-      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
155
-        搜索
156
-      </Button>
157
-
158
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
159
+        <Form.Item label="提交时间">
160
+        {getFieldDecorator('time')(
161
+            <RangePicker showTime format="YYYY-MM-DD HH:mm:ss" 
162
+            showTime
163
+            onChange={onChangetime}
164
+            />,
165
+          )}
166
+        </Form.Item>
167
+        <Form.Item>
168
+          <Button type="primary" htmlType="submit" >
169
+            搜索
170
+          </Button>
171
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
172
+            重置
173
+            </Button>
174
+        </Form.Item>
175
+      </Form>
158
       <div>
176
       <div>
159
         <div style={{ display: 'flex', justifyContent: 'space-between' }}>
177
         <div style={{ display: 'flex', justifyContent: 'space-between' }}>
160
-         <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
161
-            H5项目:{ name }
162
-         </div>
178
+          <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
179
+            H5项目:{name}
180
+          </div>
163
           {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
181
           {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
164
           <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
182
           <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
165
             <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
183
             <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
167
         </div>
185
         </div>
168
         <Table columns={columns} dataSource={datas} pagination={false} />
186
         <Table columns={columns} dataSource={datas} pagination={false} />
169
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
187
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
170
-          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current}/>
188
+          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current} />
171
         </div>
189
         </div>
172
       </div>
190
       </div>
173
 
191
 
177
     </>
195
     </>
178
   )
196
   )
179
 }
197
 }
198
+const WrappedHeader = Form.create({ name: 'header' })(header);
180
 
199
 
181
-
182
-export default header
200
+export default WrappedHeader

+ 118
- 76
src/pages/activity/drainage/DrainageList.jsx 파일 보기

19
   });
19
   });
20
 }
20
 }
21
 
21
 
22
-
23
-
24
-const data = [
25
-
26
-  {
27
-    Id: '1',
28
-    name: 'zls',
29
-    // StartTime:'',
30
-    // EndTime:'',
31
-    number: 33,
32
-  }
33
-
34
-
35
-];
36
-
37
 const header = (props) => {
22
 const header = (props) => {
38
   // const [data, setData] = useState({ data: [] })
23
   // const [data, setData] = useState({ data: [] })
39
   const [datas, setDatas] = useState([])//表格数据
24
   const [datas, setDatas] = useState([])//表格数据
72
           gettaDrainage({ pageNum: 1, pageSize: 10 })
57
           gettaDrainage({ pageNum: 1, pageSize: 10 })
73
         }).catch((err) => {
58
         }).catch((err) => {
74
           console.log('111111', err)
59
           console.log('111111', err)
75
-          message.info(err.msg || err.message)
60
+          // message.info(err.msg || err.message)
76
         })
61
         })
77
       }
62
       }
78
     });
63
     });
90
       dataIndex: 'name',
75
       dataIndex: 'name',
91
       key: 'name',
76
       key: 'name',
92
       align: 'center',
77
       align: 'center',
93
-      render: (text, datas) => <AuthButton name="admin.taDrainage.id.put" noRight={null}><div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div></AuthButton>
78
+      render: (text, datas) => <>
79
+
80
+        <div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div>
81
+
82
+      </>
94
     },
83
     },
95
     {
84
     {
96
       title: 'appid',
85
       title: 'appid',
97
       dataIndex: 'appid',
86
       dataIndex: 'appid',
98
       key: 'appid',
87
       key: 'appid',
99
       align: 'center',
88
       align: 'center',
100
-      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
89
+      // render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>, 
101
     },
90
     },
102
     {
91
     {
103
       title: 'secret',
92
       title: 'secret',
113
       align: 'center',
102
       align: 'center',
114
       render: (x, row) => (
103
       render: (x, row) => (
115
         <>
104
         <>
116
-          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD hh:mm:ss')}</span>
105
+          <span>{row.createDate && moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}</span>
117
         </>
106
         </>
118
       ),
107
       ),
119
     },
108
     },
124
       align: 'center',
113
       align: 'center',
125
       render: (x, row) => (
114
       render: (x, row) => (
126
         <>
115
         <>
127
-          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD hh:mm:ss')}</span>
116
+          <span>{row.endDate && moment(row.endDate).format('YYYY-MM-DD HH:mm:ss')}</span>
128
         </>
117
         </>
129
       ),
118
       ),
130
     },
119
     },
158
   const Forms = props => {
147
   const Forms = props => {
159
 
148
 
160
     console.log(date, '---------------')
149
     console.log(date, '---------------')
161
-    console.log(formsdate, '---------------')
150
+    console.log(formsdate.name, '---------------')
162
     console.log(formsdate, '22222222')
151
     console.log(formsdate, '22222222')
163
-    const fields = [
164
-      {
165
-        label: 'H5项目名称',
166
-        name: 'name',
167
-        type: FieldTypes.Text,
168
-        placeholder: "请输入H5项目名称",
169
-        value: formsdate.name,
170
-
171
-      },
172
-      {
173
-        label: '截止时间',
174
-        name: 'endDate',
175
-        type: FieldTypes.DatePicker,
176
-        value: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
177
-        // render: <DatePicker placeholder="截止时间" value= {formsdate.endDate} />,
178
-      },
179
-
180
-
181
-    ]
182
-
183
-    const handleSubmit = val => {
184
-      console.log(date, '111---------------')
185
-      console.log(formsdate, '111---------------')
186
-      console.log(formsdate, '11122222222')
187
-      // data: { ...submitValue }
188
-
189
-      console.log(formsdate.drainageId, '9999999999999')
190
-      if (formsdate.drainageId) {
191
-        // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
192
-        request({ ...apis.activity.updatetaDrainage, urlData: { id: formsdate.drainageId }, data: val }).then((data) => {
193
-          message.info('操作成功!')
194
-          // gettaDrainage({ pageNum: 1, pageSize: 10 })
195
-        }).catch((err) => {
196
-          console.log('111111', err)
197
-          message.info(err.msg || err.message)
198
-        })
199
-
200
-      } else {
201
 
152
 
202
 
153
 
203
-
204
-        request({ ...apis.activity.addtaDrainage, data: val }).then((data) => {
205
-          message.info("保存成功")
206
-          console.log(data, '22222')
207
-
208
-        }).catch((err) => {
209
-          message.error(err.msg || err.message)
210
-        })
154
+    const { formsDate } = props
155
+    useEffect(() => {
156
+      if (formsDate) {
157
+        props.form.setFieldsValue({ name: formsdate.name, endDate: formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null })
211
       }
158
       }
212
-      setDate({
213
-        visible: false,
159
+    }, [formsDate])
160
+
161
+
162
+    const handleSubmit = e => {
163
+      e.preventDefault();
164
+      props.form.validateFields((err, values) => {
165
+        if (!err) {
166
+          if (formsDate.drainageId) {
167
+            // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
168
+            request({ ...apis.activity.updatetaDrainage, urlData: { id: formsDate.drainageId }, data: values }).then((data) => {
169
+              message.info('操作成功!')
170
+              gettaDrainage({ pageNum: 1, pageSize: 10 })
171
+              setDate({
172
+                visible: false,
173
+              });
174
+            }).catch((err) => {
175
+              console.log('111111', err)
176
+              message.info(err.msg || err.message)
177
+            })
178
+
179
+          } else {
180
+
181
+            request({ ...apis.activity.addtaDrainage, data: values }).then((data) => {
182
+              message.info("操作成功")
183
+              gettaDrainage({ pageNum: 1, pageSize: 10 })
184
+              setDate({
185
+                visible: false,
186
+              });
187
+            }).catch((err) => {
188
+              message.error(err.msg || err.message)
189
+            })
190
+          }
191
+        }
214
       });
192
       });
215
-      gettaDrainage({ pageNum: 1, pageSize: 10 })
216
     }
193
     }
217
 
194
 
218
     const handleCancel = val => {
195
     const handleCancel = val => {
221
       });
198
       });
222
     }
199
     }
223
 
200
 
224
-    return <XForm onSubmit={handleSubmit} onCancel={handleCancel} fields={fields}></XForm>
201
+    const tailFormItemLayout = {
202
+      wrapperCol: {
203
+        xs: {
204
+          span: 24,
205
+          offset: 0,
206
+        },
207
+        sm: {
208
+          span: 16,
209
+          offset: 8,
210
+        },
211
+      },
212
+    };
225
 
213
 
226
-  }
214
+    const formItemLayout = {
215
+      labelCol: {
216
+        xs: { span: 24 },
217
+        sm: { span: 8 },
218
+      },
219
+      wrapperCol: {
220
+        xs: { span: 24 },
221
+        sm: { span: 16 },
222
+      },
223
+    };
224
+
225
+    const { getFieldDecorator } = props.form;
226
+    {/* <XForm onSubmit={handleSubmit} onCancel={handleCancel} fields={fields} ></XForm> */ }
227
+
228
+    return <Form {...formItemLayout} onSubmit={handleSubmit}>
229
+
230
+
231
+      <Form.Item label="H5项目名称">
232
+        {getFieldDecorator('name')(
233
+          <Input
234
+            placeholder="请输入H5项目名称"
235
+          />,
236
+        )}
237
+      </Form.Item>
238
+      <Form.Item label="截止时间">
239
+        {getFieldDecorator('endDate')(
240
+          <DatePicker
241
+          // prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
242
+          // placeholder={formsdate.endDate}
243
+          // value= formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
244
+          />,
245
+        )}
246
+      </Form.Item>
247
+      <Form.Item {...tailFormItemLayout}>
248
+        <AuthButton name="admin.taDrainage.id.put" noRight={null}>
249
+          <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
250
+            确定
251
+    </Button>
252
+        </AuthButton>
253
+        <Button style={{ marginLeft: 8 }} onClick={handleCancel}>
254
+          取消
255
+      </Button>
256
+      </Form.Item>
257
+    </Form>
227
 
258
 
259
+  }
260
+  const Formss = Form.create({ name: 'Forms' })(Forms);
228
 
261
 
229
 
262
 
230
 
263
 
231
   //重置搜索
264
   //重置搜索
232
   function handleReset () {
265
   function handleReset () {
233
     props.form.resetFields();
266
     props.form.resetFields();
267
+    gettaDrainage({ pageNum: 1, pageSize: 10 })
234
   }
268
   }
235
 
269
 
236
 
270
 
247
     console.log(formsdate, '22222222')
281
     console.log(formsdate, '22222222')
248
     setDate({
282
     setDate({
249
       visible: true,
283
       visible: true,
284
+      title: "修改H5项目"
250
     });
285
     });
286
+
287
+
288
+    console.log('form :', props.form)
289
+
290
+
251
   };
291
   };
252
   function showModal () {
292
   function showModal () {
253
     setFormsDate({
293
     setFormsDate({
257
     })
297
     })
258
     setDate({
298
     setDate({
259
       visible: true,
299
       visible: true,
300
+      title: '新建H5项目'
260
     });
301
     });
261
   };
302
   };
262
   const changePageNum = pageNumber => {
303
   const changePageNum = pageNumber => {
296
   }
337
   }
297
 
338
 
298
   const { getFieldDecorator } = props.form;
339
   const { getFieldDecorator } = props.form;
299
-  const { visible, confirmLoading, ModalText } = date;
340
+  const { visible, confirmLoading, ModalText, title } = date;
300
   return (
341
   return (
301
     <>
342
     <>
302
       <div>
343
       <div>
319
               />,
360
               />,
320
             )}
361
             )}
321
           </Form.Item>
362
           </Form.Item>
322
-          <Form.Item>
363
+          <Form.Item >
323
             <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
364
             <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
324
               搜索
365
               搜索
325
           </Button>
366
           </Button>
332
           <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
373
           <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
333
         </AuthButton>
374
         </AuthButton>
334
         <Modal
375
         <Modal
335
-          title="新建H5项目"
376
+          title={title}
377
+
336
           visible={visible}
378
           visible={visible}
337
           //  onOk={handleOk}
379
           //  onOk={handleOk}
338
           confirmLoading={confirmLoading}
380
           confirmLoading={confirmLoading}
339
           onCancel={handleCancel}
381
           onCancel={handleCancel}
340
           footer={null}
382
           footer={null}
341
         >
383
         >
342
-          <Forms />
384
+          <Formss formsDate={formsdate} />
343
         </Modal>
385
         </Modal>
344
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
386
         <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
345
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
387
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>

+ 96
- 43
src/pages/activity/editActivity.jsx 파일 보기

16
 import poster1 from '../../assets/poster1.png';
16
 import poster1 from '../../assets/poster1.png';
17
 import poster2 from '../../assets/poster2.png';
17
 import poster2 from '../../assets/poster2.png';
18
 import xiaochengxu from '../../assets/xiaochengxu.png'
18
 import xiaochengxu from '../../assets/xiaochengxu.png'
19
-import PosterCard from '../../components/Cards/PosterCard'
20
 
19
 
21
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
20
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
 const { TextArea } = Input;
21
 const { TextArea } = Input;
28
 
27
 
29
 const BasicForm = props => {
28
 const BasicForm = props => {
30
   const [isEnlist, setIsEnlist] = useState(1)
29
   const [isEnlist, setIsEnlist] = useState(1)
30
+  const [activityStatus, setActivityStatus] = useState(1)
31
+  const [disable, setDisable] = useState(false)
31
 
32
 
32
   const radioOnChange = e => {
33
   const radioOnChange = e => {
33
-    // console.log(e.target.value)
34
     setIsEnlist(e.target.value)
34
     setIsEnlist(e.target.value)
35
   }
35
   }
36
 
36
 
44
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
44
       data.signupTime = [moment(data.enlistStart), moment(data.enlistEnd)]
45
 
45
 
46
       setIsEnlist(data.isEnlist)
46
       setIsEnlist(data.isEnlist)
47
+      setActivityStatus(data.activityStatus)
48
+      setDisable(data.activityStatus === 0 ? true : false)
47
       props.form.setFieldsValue(data)
49
       props.form.setFieldsValue(data)
48
     })
50
     })
49
   }
51
   }
104
               message: '请选择所属项目',
106
               message: '请选择所属项目',
105
             },
107
             },
106
           ],
108
           ],
107
-        })(<BuildSelect />)}
109
+        })(<BuildSelect disabled={disable}/>)}
108
         </Form.Item>
110
         </Form.Item>
109
-        <Form.Item label="主图">
110
-          {getFieldDecorator('imgUrl')(<ImageUploader />)}
111
-          <span>建议图片尺寸:750px*560px</span>
111
+        <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于活动列表">
112
+          {getFieldDecorator('listImgUrl', {
113
+          rules: [
114
+            {
115
+              required: true,
116
+              message: '请选择活动封面图1',
117
+            },
118
+          ],
119
+        })(<ImageUploader />)}
120
+        </Form.Item>
121
+        <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动详情">
122
+          {getFieldDecorator('imgUrl', {
123
+          rules: [
124
+            {
125
+              required: true,
126
+              message: '请选择活动详情主图',
127
+            },
128
+          ],
129
+        })(<ImageUploader />)}
112
         </Form.Item>
130
         </Form.Item>
113
         <Form.Item label="活动标题">
131
         <Form.Item label="活动标题">
114
         {getFieldDecorator('title', {
132
         {getFieldDecorator('title', {
118
               message: '请输入活动标题',
136
               message: '请输入活动标题',
119
             },
137
             },
120
           ],
138
           ],
121
-        })(<Input />)}
139
+        })(<Input/>)}
122
         </Form.Item>
140
         </Form.Item>
123
         <Form.Item label="活动时间">
141
         <Form.Item label="活动时间">
124
         {getFieldDecorator('activityTime', {
142
         {getFieldDecorator('activityTime', {
128
               message: '请选择活动时间',
146
               message: '请选择活动时间',
129
             },
147
             },
130
           ],
148
           ],
131
-        })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
149
+        })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
132
         </Form.Item>
150
         </Form.Item>
133
         <Form.Item label="活动地点">
151
         <Form.Item label="活动地点">
134
         {getFieldDecorator('address', {
152
         {getFieldDecorator('address', {
138
               message: '请输入活动地点',
156
               message: '请输入活动地点',
139
             },
157
             },
140
           ],
158
           ],
141
-        })(<Input />)}
159
+        })(<Input disabled={activityStatus===0 ? true : false}/>)}
142
         </Form.Item>
160
         </Form.Item>
143
         <Form.Item label="活动人数">
161
         <Form.Item label="活动人数">
144
         {getFieldDecorator('personNum', {
162
         {getFieldDecorator('personNum', {
148
               message: '请输入活动人数',
166
               message: '请输入活动人数',
149
             },
167
             },
150
           ],
168
           ],
151
-        })(<Input type="number" />)}
169
+        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
152
         </Form.Item>
170
         </Form.Item>
153
         <Form.Item label="最大报名人数">
171
         <Form.Item label="最大报名人数">
154
         {getFieldDecorator('maxEnlistByPerson', {
172
         {getFieldDecorator('maxEnlistByPerson', {
158
               message: '请输入最大报名人数',
176
               message: '请输入最大报名人数',
159
             },
177
             },
160
           ],
178
           ],
161
-        })(<Input type="number" />)}
179
+        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
162
         </Form.Item>
180
         </Form.Item>
163
         <Form.Item label="活动详情">
181
         <Form.Item label="活动详情">
164
         {getFieldDecorator('desc')(<Wangedit />)}
182
         {getFieldDecorator('desc')(<Wangedit />)}
165
         </Form.Item>
183
         </Form.Item>
166
-        <Form.Item label="是否需要报名">
167
-        {getFieldDecorator('isEnlist')(
168
-          <Radio.Group onChange={(e) => radioOnChange(e)}>
169
-            <Radio value={1}>是</Radio>
170
-            <Radio value={0}>否</Radio>
171
-          </Radio.Group>,
172
-        )}
173
-        </Form.Item>
174
-        {
175
-          isEnlist === 1 && (<Form.Item label="报名时间">
184
+        <Form.Item label="报名时间">
176
           {getFieldDecorator('signupTime', {
185
           {getFieldDecorator('signupTime', {
177
             rules: [
186
             rules: [
178
               {
187
               {
180
                 message: '请选择报名时间',
189
                 message: '请选择报名时间',
181
               },
190
               },
182
             ],
191
             ],
183
-          })(<RangePicker format="YYYY-MM-DD HH:mm" />)}
184
-          </Form.Item>)
185
-        }
192
+          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
193
+        </Form.Item>  
194
+        <Form.Item label="权重">
195
+        {getFieldDecorator('heavy', {
196
+          rules: [
197
+            {
198
+              required: true,
199
+              message: '请输入权重',
200
+            },
201
+          ],
202
+        })(<Input type="number" disabled={activityStatus===0 ? true : false} style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
203
+        </Form.Item>
186
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
204
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
187
           <Button type="primary" htmlType="submit">
205
           <Button type="primary" htmlType="submit">
188
             确认
206
             确认
224
     if (dynamicId) {
242
     if (dynamicId) {
225
       console.log(dynamicId, 'dynamicId')
243
       console.log(dynamicId, 'dynamicId')
226
       useEffect(() => {
244
       useEffect(() => {
227
-        request({ ...apis.activity.usedPoster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
245
+        request({ ...apis.activity.poster, params: { targetId: dynamicId, targetType: 'activity' } }).then((data) => {
228
           console.log(data, "2222")
246
           console.log(data, "2222")
229
-          if (data) {
230
-            setPosterId(data.posterId)
231
-            changeImg(data.posterImg)
232
-            changeTextArea(data.posterDescription)
233
-            changeInput(data.posterTitle)
247
+          if (data.length > 0) {
248
+            setPosterId(data[0].posterId)
249
+            changeImg(data[0].posterImg)
250
+            changeTextArea(data[0].posterDescription)
251
+            changeInput(data[0].posterTitle)
234
           }
252
           }
235
         }).catch((err) => {
253
         }).catch((err) => {
236
           message.info(err.msg || err.message)
254
           message.info(err.msg || err.message)
249
       })
267
       })
250
     }
268
     }
251
 
269
 
252
-    //获取选中的模板
253
-    const [ checkList, setCheckList ] = useState([])
254
-
255
-    const cardChange = (e) => {
256
-      console.log(e,"123")
257
-      setCheckList(e)
258
-    }
259
-
260
     const submitPoster = () => {
270
     const submitPoster = () => {
261
       if (dynamicId) {
271
       if (dynamicId) {
262
         if (posterId) {
272
         if (posterId) {
263
-          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
273
+          request({ ...apis.activity.updatePoster, urlData: { id: posterId }, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
264
             message.info("保存成功")
274
             message.info("保存成功")
265
           }).catch((err) => {
275
           }).catch((err) => {
266
             message.info(err.msg || err.message)
276
             message.info(err.msg || err.message)
267
           })
277
           })
268
         } else {
278
         } else {
269
-          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue, templateIds: checkList }, }).then((data) => {
279
+          request({ ...apis.activity.addPoster, data: { targetId: dynamicId, targetType: 'activity', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue }, }).then((data) => {
270
             setPosterId(data.posterId)
280
             setPosterId(data.posterId)
271
             message.info("保存成功")
281
             message.info("保存成功")
272
           }).catch((err) => {
282
           }).catch((err) => {
281
     return <div>
291
     return <div>
282
       <div style={{ display: 'flex' }}>
292
       <div style={{ display: 'flex' }}>
283
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
293
         <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
284
-           <PosterCard postType="dynamic"  checkedList={checkList} onChange={cardChange} />
294
+          <div style={{ width: '375px', height: '700px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
295
+            <img style={{ width: '100%', height: '300px' }} src={imgValue ? imgValue : poster1} alt="" />
296
+            <div style={{ display: 'flex', alignItems: 'center', marginTop: '-24px' }}>
297
+              <img style={{ width: '70px', height: '70px', border: '4px solid #fff', borderRadius: '35px', marginLeft: '16px' }} src={touxiang} alt="" />
298
+              <span style={{ color: '#222', fontWeight: '600', margin: '24px 10px 0 14px', fontSize: '17px' }}>喵喵</span>
299
+              <span style={{ color: '#999', marginTop: '25px', fontSize: '17px' }}>邀您参与</span>
300
+              <span style={{ color: '#999', margin: '25px 0 0 60px', fontSize: '17px' }}>2019.09.21</span>
301
+            </div>
302
+            <p style={{
303
+              margin: '10px 20px',
304
+              fontSize: '20px',
305
+              color: '#222',
306
+              fontWeight: '600',
307
+              display: '-webkit-box',
308
+              lineClamp: '3',
309
+              height: '60px',
310
+              WebkitLineClamp: '2',
311
+              WebkitBoxOrient: 'vertical',
312
+              overflow: 'hidden',
313
+              textOverflow: 'ellipsis'
314
+            }}>{inputValue ? inputValue : '海报标题'}</p>
315
+
316
+            <img src={yinhao} style={{ width: '30px', marginLeft: '20px' }} alt="" />
317
+            <p style={{
318
+              margin: '16px 20px 28px 20px',
319
+              fontSize: '17px',
320
+              color: '#999',
321
+              display: '-webkit-box',
322
+              lineClamp: '3',
323
+              height: '72px',
324
+              WebkitLineClamp: '3',
325
+              WebkitBoxOrient: 'vertical',
326
+              overflow: 'hidden',
327
+              textOverflow: 'ellipsis'
328
+            }}>{textAreaValue ? textAreaValue : '海报描述'}</p>
329
+            <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc', position: 'relative' }}>
330
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>长按识别小程序码</p>
331
+              <p style={{ margin: '0', fontSize: '18px', color: '#888' }}>进入<span style={{ margin: '0 5px', fontSize: '18px', color: '#333', fontWeight: '600' }}>{miniappName || '置业V顾问'}</span>报名活动</p>
332
+              <img style={{ width: '80px', position: 'absolute', right: '30px', top: '10px' }} src={xiaochengxu} alt="" />
333
+            </div>
334
+          </div>
335
+          <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
285
         </div>
336
         </div>
286
 
337
 
287
         <div >
338
         <div >
288
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
339
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
289
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
340
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
290
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
341
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
291
           </div>
342
           </div>
343
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于普通活动海报</p>
292
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
344
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
293
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
345
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
294
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
346
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
363
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
415
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
364
       </div>
416
       </div>
365
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
417
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
366
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
418
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动分享图</p>
367
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
419
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
368
       </div>
420
       </div>
421
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于活动分享好友</p>
369
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
422
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
370
       <Button onClick={() => router.go(-1)}>取消</Button>
423
       <Button onClick={() => router.go(-1)}>取消</Button>
371
     </div>
424
     </div>

+ 47
- 7
src/pages/activity/groupActivity/editGroupActivity.jsx 파일 보기

32
   const { groupActivityId } = props.location.query
32
   const { groupActivityId } = props.location.query
33
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
33
   const [dynamicData, setDynamicData] = useState({ isEnlist: 1 })
34
   const [scoreData, setScoreData] = useState({})
34
   const [scoreData, setScoreData] = useState({})
35
+  const [activityStatus, setActivityStatus] = useState({})
36
+  const [disable, setDisable] = useState(false)
37
+
35
   useEffect(() => {
38
   useEffect(() => {
36
     request(apis.groupActivity.avgScore).then((data) => {
39
     request(apis.groupActivity.avgScore).then((data) => {
37
       setScoreData(data);
40
       setScoreData(data);
46
     const getDynamicData = (groupActivityId) => {
49
     const getDynamicData = (groupActivityId) => {
47
       request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
50
       request({ ...apis.groupActivity.details, urlData: { id: groupActivityId } }).then((data) => {
48
         setDynamicData(data)
51
         setDynamicData(data)
52
+        setActivityStatus(data.activityStatus)
53
+        setDisable(data.activityStatus === 0 ? true : false)
49
       })
54
       })
50
     }
55
     }
51
   }
56
   }
65
       {
70
       {
66
         label: '选择项目',
71
         label: '选择项目',
67
         name: 'buildingId',
72
         name: 'buildingId',
68
-        render: <BuildSelect />,
73
+        render: <BuildSelect disabled={disable}/>,
69
         value: dynamicData.buildingId,
74
         value: dynamicData.buildingId,
70
         rules: [
75
         rules: [
71
           { required: true, message: '请选择项目' },
76
           { required: true, message: '请选择项目' },
81
         ]
86
         ]
82
       },
87
       },
83
       {
88
       {
84
-        label: '活动主图',
89
+        label: '拼团详情主图',
85
         name: 'mainImg',
90
         name: 'mainImg',
86
         type: FieldTypes.ImageUploader,
91
         type: FieldTypes.ImageUploader,
87
         value: dynamicData.mainImg,
92
         value: dynamicData.mainImg,
88
         rules: [
93
         rules: [
89
-          { required: true, message: '请输入活动主图' },
94
+          { required: true, message: '请输入拼团详情主图' },
95
+        ],
96
+        help: '建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动详情',
97
+      },
98
+      {
99
+        label: '拼团封面图1',
100
+        name: 'listImg',
101
+        type: FieldTypes.ImageUploader,
102
+        value: dynamicData.listImg,
103
+        rules: [
104
+          { required: true, message: '请输入拼团封面图1' },
90
         ],
105
         ],
91
-        help: '建议尺寸375*312px',
106
+        help: '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表',
107
+      },
108
+      {
109
+        label: '拼团封面图2',
110
+        name: 'bannerListImg',
111
+        type: FieldTypes.ImageUploader,
112
+        value: dynamicData.bannerListImg,
113
+        rules: [
114
+          { required: true, message: '请输入拼团封面图2' },
115
+        ],
116
+        help: '建议图片尺寸:670*224px,比例3:1,格式:jpg,用于首页底部活动轮播',
92
       },
117
       },
93
       {
118
       {
94
         label: '活动时间',
119
         label: '活动时间',
95
         name: 'activityTime',
120
         name: 'activityTime',
96
         type: FieldTypes.RangePicker,
121
         type: FieldTypes.RangePicker,
97
         value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
122
         value: dynamicData.startTime != null ? [moment(dynamicData.startTime, 'YYYY-MM-DD HH:mm'), moment(dynamicData.endTime, 'YYYY-MM-DD HH:mm')] : null,
98
-        props: { showTime: { format: 'HH:mm' } },
123
+        props: { showTime: { format: 'HH:mm' }, disabled: activityStatus === 0 ? true : false },
99
         rules: [
124
         rules: [
100
           { required: true, message: '请选择活动时间' },
125
           { required: true, message: '请选择活动时间' },
101
         ],
126
         ],
105
         name: 'groupBuyPeople',
130
         name: 'groupBuyPeople',
106
         type: FieldTypes.Text,
131
         type: FieldTypes.Text,
107
         value: dynamicData.groupBuyPeople,
132
         value: dynamicData.groupBuyPeople,
133
+        props: {disabled: activityStatus === 0 ? true : false },
108
         help: '注:成团所需人数',
134
         help: '注:成团所需人数',
109
         rules: [
135
         rules: [
110
           { required: true, message: '请输入成团人数' },
136
           { required: true, message: '请输入成团人数' },
115
         name: 'integral',
141
         name: 'integral',
116
         type: FieldTypes.Text,
142
         type: FieldTypes.Text,
117
         value: dynamicData.integral,
143
         value: dynamicData.integral,
144
+        props: {disabled: activityStatus === 0 ? true : false },
118
         help: '注:用户平均积分' + scoreData.averageScore,
145
         help: '注:用户平均积分' + scoreData.averageScore,
119
         rules: [
146
         rules: [
120
           { required: true, message: '请输入所需积分' },
147
           { required: true, message: '请输入所需积分' },
130
         ],
157
         ],
131
         help: '建议宽度:335px,高度不限',
158
         help: '建议宽度:335px,高度不限',
132
       },
159
       },
160
+      {
161
+        label: '权重',
162
+        name: 'heavy',
163
+        type: FieldTypes.Number,
164
+        render: <Input type="number" style={{ width: 80}}/>,
165
+        value: dynamicData.heavy,
166
+        rules: [
167
+          { required: true, message: '请输入权重' },
168
+        ],
169
+        help: '数字越大越靠前',
170
+      },
133
     ]
171
     ]
134
 
172
 
135
     const handleSubmit = val => {
173
     const handleSubmit = val => {
254
 
292
 
255
         <div >
293
         <div >
256
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
294
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
257
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
295
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团海报图</p>
258
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
296
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
259
           </div>
297
           </div>
298
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动海报</p>
260
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
299
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
261
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
300
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
262
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
301
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
331
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
370
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
332
       </div>
371
       </div>
333
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
372
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
334
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
373
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>拼团分享图</p>
335
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
374
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
336
       </div>
375
       </div>
376
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于拼团活动分享好友</p>
337
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
377
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
338
       <Button onClick={() => router.go(-1)}>取消</Button>
378
       <Button onClick={() => router.go(-1)}>取消</Button>
339
     </div>
379
     </div>

+ 1
- 0
src/pages/activity/groupActivity/helpRecord.jsx 파일 보기

109
         dataIndex: 'createTime',
109
         dataIndex: 'createTime',
110
         key: 'createTime',
110
         key: 'createTime',
111
         align: 'center',
111
         align: 'center',
112
+        render: (x, row) => <><span>{row.createTime ? `${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
112
       },
113
       },
113
     ]
114
     ]
114
     return (
115
     return (

+ 113
- 107
src/pages/activity/groupActivity/list.jsx 파일 보기

14
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
15
 
15
 
16
 const header = props => {
16
 const header = props => {
17
-  const [ data, setData ] = useState({})
18
-//   const [page, changePage] = useState({})
17
+  const [data, setData] = useState({})
18
+  //   const [page, changePage] = useState({})
19
 
19
 
20
   useEffect(() => {
20
   useEffect(() => {
21
     getList({ pageNum: 1, pageSize: 10 });
21
     getList({ pageNum: 1, pageSize: 10 });
22
-  },[])
22
+  }, [])
23
 
23
 
24
   // 查询列表
24
   // 查询列表
25
   const getList = (params) => {
25
   const getList = (params) => {
26
-      console.log(params);
26
+    console.log(params);
27
     request({ ...apis.groupActivity.list, params: { ...params } }).then((data) => {
27
     request({ ...apis.groupActivity.list, params: { ...params } }).then((data) => {
28
-        console.log(data)
29
-        setData(data)
28
+      console.log(data)
29
+      setData(data)
30
     })
30
     })
31
   }
31
   }
32
 
32
 
33
-  
34
-// 跳转到拼团活动新增
35
-const toEditActivity = (groupActivityId) => () => {
33
+
34
+  // 跳转到拼团活动新增
35
+  const toEditActivity = (groupActivityId) => () => {
36
     router.push({
36
     router.push({
37
       pathname: '/activity/groupActivity/editGroupActivity',
37
       pathname: '/activity/groupActivity/editGroupActivity',
38
       query: {
38
       query: {
40
       },
40
       },
41
     });
41
     });
42
   }
42
   }
43
-  
43
+
44
   /**
44
   /**
45
    *
45
    *
46
    *
46
    *
47
    * @param {*} props
47
    * @param {*} props
48
    * @returns
48
    * @returns
49
    */
49
    */
50
-  
50
+
51
   const columns = [
51
   const columns = [
52
     {
52
     {
53
       title: '活动标题',
53
       title: '活动标题',
63
       render: (x, row) => <><span>{`${moment(row.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(row.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>
63
       render: (x, row) => <><span>{`${moment(row.startTime).format('YYYY-MM-DD HH:mm:ss')} —— ${moment(row.endTime).format('YYYY-MM-DD HH:mm:ss')}`}</span></>
64
     },
64
     },
65
     {
65
     {
66
-        title: '所需积分',
67
-        dataIndex: 'integral',
68
-        key: 'integral',
69
-        align: 'center',
70
-      },
66
+      title: '所需积分',
67
+      dataIndex: 'integral',
68
+      key: 'integral',
69
+      align: 'center',
70
+    },
71
     {
71
     {
72
       title: '已参与人数',
72
       title: '已参与人数',
73
       dataIndex: 'participateNum',
73
       dataIndex: 'participateNum',
79
       dataIndex: 'groupBuyPeople',
79
       dataIndex: 'groupBuyPeople',
80
       key: 'groupBuyPeople',
80
       key: 'groupBuyPeople',
81
       align: 'center',
81
       align: 'center',
82
-    },  
82
+    },
83
     {
83
     {
84
       title: '状态',
84
       title: '状态',
85
       dataIndex: 'activityStatus',
85
       dataIndex: 'activityStatus',
99
       render: (x, row) => (
99
       render: (x, row) => (
100
         <>
100
         <>
101
           {row.activityStatus === 0 &&
101
           {row.activityStatus === 0 &&
102
-          <AuthButton name="admin.taShareActivity.finish.put" noRight={null}><span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span></AuthButton>
103
-          }
104
-          {row.activityStatus === 0 &&
105
-          <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>    <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span></AuthButton>
102
+            <AuthButton name="admin.taShareActivity.finish.put" noRight={null}><span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span></AuthButton>
106
           }
103
           }
107
-          {row.activityStatus === 0 &&
108
-          <AuthButton name="admin.taShareActivity.list.get" noRight={null}>
109
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
110
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
111
-        </AuthButton> }
112
-
113
-          {row.activityStatus === 1 &&
114
-          <AuthButton name="admin.taShareActivity.update.put" noRight={null}>
115
-            <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
116
-          </AuthButton>
104
+          {(row.activityStatus === 0 || row.activityStatus === 2)&&
105
+            <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
106
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span>
107
+            </AuthButton>
117
           }
108
           }
118
-           {row.activityStatus === 1 &&
119
-          <AuthButton name="admin.taShareActivity.finish.put" noRight={null}>
120
-                <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={endGroupActivity(row)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
121
-          </AuthButton>
122
-          }
123
-           {row.activityStatus === 1 &&
124
-           <AuthButton name="admin.taShareActivity.weight.put" noRight={null}>
125
-                <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
126
-                <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
127
-        </AuthButton>
109
+          {
110
+            <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
111
+              <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
112
+            </AuthButton>
128
           }
113
           }
114
+          {
115
+            <AuthButton name="admin.taShareActivity.list.get" noRight={null}>
116
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{row.weight === 1 ? '取消标签' : '添加标签'}<Icon type="vertical-align-top" className={styles.edit} /></span>
117
+              <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{row.sort === true ? '取消推荐首页' : '推荐首页'}<Icon type="vertical-align-top" className={styles.edit} /></span>
118
+            </AuthButton>}
129
 
119
 
130
-        {row.activityStatus === 2 &&
131
-        <AuthButton><span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.groupActivityId)}>拼团记录<Icon type="snippets" className={styles.shoppingCart} /></span></AuthButton>
132
-        }
133
-         {row.activityStatus === 2 &&
134
-        <AuthButton name="admin.taShareActivity.weight.put" noRight={null}>
135
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topGroupActivity(row, row.weight)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
136
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={recommendGroupActivity(row)}>{ row.sort === true ? '取消推荐首页' : '推荐首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
137
-        </AuthButton>
120
+          {(row.activityStatus === 0 || row.activityStatus === 1) &&
121
+            <AuthButton name="admin.taShareActivity.update.put" noRight={null}>
122
+              <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditActivity(row.groupActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
123
+            </AuthButton>
138
           }
124
           }
139
         </>
125
         </>
140
       ),
126
       ),
141
     },
127
     },
142
   ];
128
   ];
143
   const getSignList = groupActivityId => {
129
   const getSignList = groupActivityId => {
144
-      router.push({
145
-          pathname: '/activity/groupActivity/helpRecord',
146
-          query: {
147
-            groupActivityId,
148
-          },
149
-        });
130
+    router.push({
131
+      pathname: '/activity/groupActivity/helpRecord',
132
+      query: {
133
+        groupActivityId,
134
+      },
135
+    });
150
   }
136
   }
151
-  
137
+
152
   const finishDynamic = (row) => {
138
   const finishDynamic = (row) => {
153
-      Modal.confirm({
154
-          title: '结束以后将无法编辑, 是否继续?',
155
-          okText: '确定',
156
-          cancelText: '取消',
157
-          onOk() {
158
-              request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
159
-                  console.log(data)
160
-                  message.info('操作成功!')
161
-                  getList({ pageNum: 1, pageSize: 10 })
162
-              }).catch((err) => {
163
-                  console.log(err)
164
-                  message.info(err.msg || err.message)
165
-              })
166
-          },
167
-        });
168
-  }
169
-  
170
-  //结束活动
171
-  const endGroupActivity = (row) => () => {
172
-      request({ ...apis.groupActivity.finish, urlData: { id: row.groupActivityId} }).then((data) => {
139
+    Modal.confirm({
140
+      title: '结束以后将无法编辑, 是否继续?',
141
+      okText: '确定',
142
+      cancelText: '取消',
143
+      onOk () {
144
+        request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: "" } }).then((data) => {
173
           console.log(data)
145
           console.log(data)
174
           message.info('操作成功!')
146
           message.info('操作成功!')
175
-          getList({ pageNum: 1, pageSize: 10 })
176
-      }).catch((err) => {
147
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
148
+        }).catch((err) => {
177
           console.log(err)
149
           console.log(err)
178
           message.info(err.msg || err.message)
150
           message.info(err.msg || err.message)
179
-      })
151
+        })
152
+      },
153
+    });
154
+  }
155
+
156
+  //结束活动
157
+  const endGroupActivity = (row) => () => {
158
+    request({ ...apis.groupActivity.finish, urlData: { id: row.groupActivityId } }).then((data) => {
159
+      console.log(data)
160
+      message.info('操作成功!')
161
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
162
+    }).catch((err) => {
163
+      console.log(err)
164
+      message.info(err.msg || err.message)
165
+    })
180
   }
166
   }
181
 
167
 
182
   //置顶
168
   //置顶
183
   const topGroupActivity = (row, weight) => () => {
169
   const topGroupActivity = (row, weight) => () => {
184
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, weight: weight } }).then((data) => {
170
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, weight: weight } }).then((data) => {
185
-        console.log(data)
186
-        message.info('操作成功!')
187
-        getList({ pageNum: 1, pageSize: 10 })
171
+      console.log(data)
172
+      message.info('操作成功!')
173
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
188
     }).catch((err) => {
174
     }).catch((err) => {
189
-        console.log(err)
190
-        message.info(err.msg || err.message)
175
+      console.log(err)
176
+      message.info(err.msg || err.message)
177
+    })
178
+  }
179
+
180
+  const sendOrPublicDynamic = row => {
181
+    if (row.status === 1) {
182
+      cancelDynamic(row)
183
+    } else {
184
+      sendDynamic(row)
185
+    }
186
+  }
187
+
188
+  // 取消活动
189
+  const cancelDynamic = row => {
190
+    request({ ...apis.groupActivity.cancel, urlData: { id: row.groupActivityId } }).then(data => {
191
+      message.info('操作成功!')
192
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
193
+    }).catch(err => {
194
+      console.log(err)
195
+      message.info(err.msg || err.message)
196
+    })
197
+  }
198
+
199
+  // 发布活动
200
+  const sendDynamic = row => {
201
+    request({ ...apis.groupActivity.send, urlData: { id: row.groupActivityId } }).then(data => {
202
+      message.info('操作成功!')
203
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
204
+    }).catch(err => {
205
+      console.log(err)
206
+      message.info(err.msg || err.message)
191
     })
207
     })
192
   }
208
   }
193
 
209
 
194
   //首页推荐
210
   //首页推荐
195
   const recommendGroupActivity = (row, code) => () => {
211
   const recommendGroupActivity = (row, code) => () => {
196
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
212
     request({ ...apis.groupActivity.top, data: { groupActivityId: row.groupActivityId, sort: row.sort } }).then((data) => {
197
-        console.log(data)
198
-        message.info('操作成功!')
199
-        getList({ pageNum: 1, pageSize: 10 })
213
+      console.log(data)
214
+      message.info('操作成功!')
215
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
200
     }).catch((err) => {
216
     }).catch((err) => {
201
-        console.log(err)
202
-        message.info(err.msg || err.message)
217
+      console.log(err)
218
+      message.info(err.msg || err.message)
203
     })
219
     })
204
   }
220
   }
205
-    
206
-  //发布活动
207
-  const sendDynamic = (row) => {
208
-      request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
209
-          message.info('操作成功!')
210
-          getList({ pageNum: 1, pageSize: 10 });
211
-      }).catch(err => {
212
-          console.log(err)
213
-          message.info(err.msg || err.message)
214
-      })
215
-  }
216
-  
221
+
217
   const changePageNum = pageNumber => {
222
   const changePageNum = pageNumber => {
218
-      getList({ pageNum: pageNumber, pageSize: 10 })
223
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
219
   }
224
   }
220
 
225
 
221
   // 提交事件
226
   // 提交事件
222
-const handleSubmit = (e, props) => {
227
+  const handleSubmit = (e, props) => {
223
     e.preventDefault();
228
     e.preventDefault();
224
     props.form.validateFields((err, values) => {
229
     props.form.validateFields((err, values) => {
225
       if (!err) {
230
       if (!err) {
229
     });
234
     });
230
   }
235
   }
231
 
236
 
232
-   //重置搜索
233
-   function handleReset() {
237
+  //重置搜索
238
+  function handleReset () {
234
     props.form.resetFields();
239
     props.form.resetFields();
240
+    getList({ pageNum: 1, pageSize: 10 })
235
   }
241
   }
236
 
242
 
237
 
243
 
272
             搜索
278
             搜索
273
           </Button>
279
           </Button>
274
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
280
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
275
-              重置
281
+            重置
276
             </Button>
282
             </Button>
277
         </Form.Item>
283
         </Form.Item>
278
       </Form>
284
       </Form>
279
       <AuthButton name="admin.taShareActivity.post" noRight={null}>
285
       <AuthButton name="admin.taShareActivity.post" noRight={null}>
280
         <Button type="danger" className={styles.addBtn} onClick={toEditActivity()}>新增</Button>
286
         <Button type="danger" className={styles.addBtn} onClick={toEditActivity()}>新增</Button>
281
       </AuthButton>
287
       </AuthButton>
282
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
288
+      <Table style={{marginTop:'30px'}} dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
283
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
289
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
284
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
290
         <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
285
       </div>
291
       </div>

+ 33
- 8
src/pages/activity/helpActivity/edithelpActivity.jsx 파일 보기

85
           message.error('助力邀请人数不能超过200')
85
           message.error('助力邀请人数不能超过200')
86
           return
86
           return
87
         }
87
         }
88
+          // 助力邀请人数>0
89
+        if (values.personNum <= 0) {
90
+          message.error('助力邀请人数大于0')
91
+          return
92
+        }
88
 
93
 
89
         // 判断助力人数必须大于0
94
         // 判断助力人数必须大于0
90
         if (values.isEnlist === 1) {
95
         if (values.isEnlist === 1) {
92
           message.error('限制助力次数必须大于0')
97
           message.error('限制助力次数必须大于0')
93
           return
98
           return
94
         }
99
         }
95
-        if (values.personNum <= 0) {
96
-          message.error('助力邀请人数大于0')
97
-          return
98
-        }
99
       }
100
       }
100
         const { activityTime, signupTime, ...submitValue } = values
101
         const { activityTime, signupTime, ...submitValue } = values
101
         const [startDate, endDate] = activityTime
102
         const [startDate, endDate] = activityTime
153
         })(<Input />)}
154
         })(<Input />)}
154
         </Form.Item>
155
         </Form.Item>
155
 
156
 
156
-        <Form.Item label="活动主图" help="建议尺寸375*312px">
157
+        <Form.Item label="助力详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动详情">
157
           {getFieldDecorator('img', {
158
           {getFieldDecorator('img', {
158
           rules: [
159
           rules: [
159
             {
160
             {
160
               required: true,
161
               required: true,
161
-              message: '活动主图不能为空',
162
+              message: '助力详情主图不能为空',
163
+            },
164
+          ],
165
+        })(<ImageUploader />)}
166
+        </Form.Item>
167
+
168
+        <Form.Item label="助力封面图1" help="建议图片尺寸:750*420px,比例16:9,格式:jpg,用于活动列表">
169
+          {getFieldDecorator('listImg', {
170
+          rules: [
171
+            {
172
+              required: true,
173
+              message: '助力封面图1不能为空',
174
+            },
175
+          ],
176
+        })(<ImageUploader />)}
177
+        </Form.Item>
178
+
179
+        <Form.Item label="助力封面图2" help="建议图片尺寸:670*224px,比例3:1,格式:jpg,用于首页底部活动轮播">
180
+          {getFieldDecorator('bannerListImg', {
181
+          rules: [
182
+            {
183
+              required: true,
184
+              message: '助力封面图2不能为空',
162
             },
185
             },
163
           ],
186
           ],
164
         })(<ImageUploader />)}
187
         })(<ImageUploader />)}
373
 
396
 
374
         <div >
397
         <div >
375
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
398
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
376
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
399
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力海报图</p>
377
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
400
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
378
           </div>
401
           </div>
402
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动海报</p>
379
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
403
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
380
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
404
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
381
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
405
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
450
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
474
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
451
       </div>
475
       </div>
452
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
476
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
453
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
477
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>助力分享图</p>
454
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
478
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
455
       </div>
479
       </div>
480
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于助力活动分享好友</p>
456
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
481
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
457
       <Button onClick={() => router.go(-1)}>取消</Button>
482
       <Button onClick={() => router.go(-1)}>取消</Button>
458
     </div>
483
     </div>

+ 5
- 1
src/pages/activity/helpActivity/helpRecord.jsx 파일 보기

32
 
32
 
33
   componentDidUpdate (preProps, preState) {
33
   componentDidUpdate (preProps, preState) {
34
     const { helpId } = this.state.visibleData
34
     const { helpId } = this.state.visibleData
35
-
36
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
36
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
38
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });
42
   // 弹框确定按钮
41
   // 弹框确定按钮
43
   // eslint-disable-next-line react/sort-comp
42
   // eslint-disable-next-line react/sort-comp
44
   handleOk () {
43
   handleOk () {
44
+    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
45
     this.props.onCancel()
45
     this.props.onCancel()
46
   }
46
   }
47
 
47
 
48
   // 弹框取消按钮
48
   // 弹框取消按钮
49
   handleCancel () {
49
   handleCancel () {
50
+    this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
50
     this.props.onCancel()
51
     this.props.onCancel()
51
   }
52
   }
52
 
53
 
53
   getList (params) {
54
   getList (params) {
55
+    if (params.helpRecordInitiateId === '') {
56
+      return
57
+    }
54
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
58
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
55
       this.setState({ dataSource: res })
59
       this.setState({ dataSource: res })
56
     }).catch(err => {
60
     }).catch(err => {

+ 27
- 37
src/pages/activity/helpActivity/list.jsx 파일 보기

91
       align: 'center',
91
       align: 'center',
92
       render: (x, row) => (
92
       render: (x, row) => (
93
         <>
93
         <>
94
-          {row.activityStatus === 0 &&
94
+          {(row.activityStatus === 0 || row.activityStatus === 2) &&
95
           <AuthButton name="admin.helpRecord.get">
95
           <AuthButton name="admin.helpRecord.get">
96
-             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
96
+             <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" style={{color:'#bebebe'}}   className={styles.shoppingCart} /></span>
97
           </AuthButton>}
97
           </AuthButton>}
98
+          {
99
+            <AuthButton name="admin.top.update.post" noRight={null}>
100
+              <span style={{ color: '#1990FF',marginRight: '20px', cursor: 'pointer' }} onClick={sendOrPublicDynamic.bind(this, row)}>{row.status === 1 ? '取消发布' : '发布'}<Icon type="close-circle" className={styles.edit} /></span>
101
+            </AuthButton>
102
+          }
98
           {row.activityStatus === 0 &&
103
           {row.activityStatus === 0 &&
104
+            <AuthButton name="admin.top.update.post" noRight={null}>
105
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{color:'#bebebe'}} className={styles.edit} /></span> </AuthButton>
106
+          }
107
+          {
99
           <AuthButton name="admin.top.update.post" noRight={null}>
108
           <AuthButton name="admin.top.update.post" noRight={null}>
100
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
101
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
102
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
109
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消标签' : '添加标签' }<Icon type="vertical-align-top"  style={{color:'#bebebe'}} className={styles.edit} /></span>
110
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" style={{color:'#bebebe'}} className={styles.edit} /></span>
103
           </AuthButton> }
111
           </AuthButton> }
104
 
112
 
105
-          {row.activityStatus === 1 &&
113
+          {(row.activityStatus === 1 || row.activityStatus === 0) &&
106
           <AuthButton name="admin.helpActivity.update.put" noRight={null}>
114
           <AuthButton name="admin.helpActivity.update.put" noRight={null}>
107
-            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
108
-          </AuthButton>
109
-          }
110
-          {row.activityStatus === 1 &&
111
-           <AuthButton name="admin.top.update.post" noRight={null}>
112
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
113
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
114
-            </AuthButton>
115
-          }
116
-
117
-          {row.activityStatus === 2 &&
118
-          <AuthButton name="admin.helpRecord.get" noRight={null}>
119
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
115
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" style={{color:'#bebebe'}} className={styles.edit} /></span>
120
           </AuthButton>
116
           </AuthButton>
121
           }
117
           }
122
-           {row.activityStatus === 2 &&
123
-        <AuthButton name="admin.top.update.post" noRight={null}>
124
-           <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
125
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
126
-        </AuthButton>
127
-          }
128
         </>
118
         </>
129
       ),
119
       ),
130
     },
120
     },
147
               request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
137
               request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
148
                   console.log(data)
138
                   console.log(data)
149
                   message.info('操作成功!')
139
                   message.info('操作成功!')
150
-                  getList({ pageNum: 1, pageSize: 10 })
140
+                  getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
151
               }).catch((err) => {
141
               }).catch((err) => {
152
                   console.log(err)
142
                   console.log(err)
153
                   message.info(err.msg || err.message)
143
                   message.info(err.msg || err.message)
161
       request({ ...apis.helpActivity.top, data: { helpActivityId: row.helpActivityId, status: code } }).then((data) => {
151
       request({ ...apis.helpActivity.top, data: { helpActivityId: row.helpActivityId, status: code } }).then((data) => {
162
           console.log(data)
152
           console.log(data)
163
           message.info('操作成功!')
153
           message.info('操作成功!')
164
-          getList({ pageNum: 1, pageSize: 10 })
154
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
165
       }).catch((err) => {
155
       }).catch((err) => {
166
           console.log(err)
156
           console.log(err)
167
           message.info(err.msg || err.message)
157
           message.info(err.msg || err.message)
168
       })
158
       })
169
   }
159
   }
170
   
160
   
171
-  // const sendOrPublicDynamic = (row) => {
172
-  //     if (row.status === 1) {
173
-  //         cancelDynamic(row)
174
-  //     } else {
175
-  //         sendDynamic(row)
176
-  //     }
177
-  // }
161
+  const sendOrPublicDynamic = (row) => {
162
+      if (row.status === 1) {
163
+          cancelDynamic(row)
164
+      } else {
165
+          sendDynamic(row)
166
+      }
167
+  }
178
   
168
   
179
   // 取消活动
169
   // 取消活动
180
   const cancelDynamic = (row) => {
170
   const cancelDynamic = (row) => {
181
       request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
171
       request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
182
           message.info('操作成功!')
172
           message.info('操作成功!')
183
-          getList({ pageNum: 1, pageSize: 10 })
173
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
184
       }).catch((err) => {
174
       }).catch((err) => {
185
           console.log(err)
175
           console.log(err)
186
           message.info(err.msg || err.message)
176
           message.info(err.msg || err.message)
191
   const sendDynamic = (row) => {
181
   const sendDynamic = (row) => {
192
       request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
182
       request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
193
           message.info('操作成功!')
183
           message.info('操作成功!')
194
-          getList({ pageNum: 1, pageSize: 10 });
184
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
195
       }).catch(err => {
185
       }).catch(err => {
196
           console.log(err)
186
           console.log(err)
197
           message.info(err.msg || err.message)
187
           message.info(err.msg || err.message)
199
   }
189
   }
200
   
190
   
201
   const changePageNum = pageNumber => {
191
   const changePageNum = pageNumber => {
202
-      getList({ pageNum: pageNumber, pageSize: 10 })
192
+      getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
203
   }
193
   }
204
 
194
 
205
   // 提交事件
195
   // 提交事件

+ 28
- 9
src/pages/building/list/add/components/amap.jsx 파일 보기

4
 import styles from '../amap.less'
4
 import styles from '../amap.less'
5
 
5
 
6
 class Amap extends React.Component {
6
 class Amap extends React.Component {
7
+
7
   constructor(props) {
8
   constructor(props) {
8
     super(props);
9
     super(props);
10
+    this.state = {
11
+      markerPosition: { longitude: 120, latitude: 35 },
12
+    }
9
     // 高德地图 Marker 实例
13
     // 高德地图 Marker 实例
10
     this.markerInstance = undefined
14
     this.markerInstance = undefined
11
     // 高德地图 Map 实例
15
     // 高德地图 Map 实例
12
     this.mapInstance = undefined
16
     this.mapInstance = undefined
17
+
13
     this.amapEvents = {
18
     this.amapEvents = {
14
       created: mapInstance => {
19
       created: mapInstance => {
15
         console.log('高德地图 Map 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
20
         console.log('高德地图 Map 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
16
-        console.log(mapInstance.getZoom());
21
+        console.log('缩放级别:', mapInstance.getZoom());
17
         this.mapInstance = mapInstance
22
         this.mapInstance = mapInstance
23
+        
18
 
24
 
19
         AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.CitySearch'], () => {
25
         AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.CitySearch'], () => {
20
           // 实例化Autocomplete
26
           // 实例化Autocomplete
21
           const autoOptions = {
27
           const autoOptions = {
22
             // city 限定城市,默认全国
28
             // city 限定城市,默认全国
23
-            city: '全国',
29
+            // city: '025',
24
             // input 为绑定输入提示功能的input的DOM ID
30
             // input 为绑定输入提示功能的input的DOM ID
25
             input: 'amapInput',
31
             input: 'amapInput',
26
           }
32
           }
28
           // 无需再手动执行search方法,autoComplete会根据传入input对应的DOM动态触发search
34
           // 无需再手动执行search方法,autoComplete会根据传入input对应的DOM动态触发search
29
 
35
 
30
           const placeSearch = new AMap.PlaceSearch({
36
           const placeSearch = new AMap.PlaceSearch({
31
-            city: '南京',
37
+            // city: '南京',
32
             map: mapInstance,
38
             map: mapInstance,
33
           })
39
           })
34
 
40
 
54
                 // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
60
                 // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
55
                 // 地图显示当前城市
61
                 // 地图显示当前城市
56
                 mapInstance.setBounds(citybounds);
62
                 mapInstance.setBounds(citybounds);
63
+                // 需要在设置坐标成功后,重新设置 缩放级别
64
+                // mapInstance.setZoom(15)
57
               }
65
               }
58
             }
66
             }
59
           })
67
           })
75
         this.markerInstance = markerInstance
83
         this.markerInstance = markerInstance
76
       },
84
       },
77
     }
85
     }
78
-    this.markerPosition = { longitude: 120, latitude: 30 };
86
+    // this.markerPosition = { longitude: 120, latitude: 30 };
79
   }
87
   }
80
 
88
 
81
-  render() {
89
+  componentDidUpdate(prevProps) {
82
     const { value } = this.props
90
     const { value } = this.props
83
-    if (value) {
84
-     // this.markerInstance.setPosition(value.split(','))
91
+    if (this.props.value !== prevProps.value) {
92
+      if (value) {
93
+        const temp = value.split(',')
94
+        this.setState({ markerPosition: { longitude: temp[1], latitude: temp[0] } }, () => {
95
+          if (this.mapInstance) {
96
+            // 需要在设置坐标成功后,重新设置 缩放级别
97
+            this.mapInstance.setZoom(15)
98
+          }
99
+        })
100
+      }
85
     }
101
     }
102
+  }
86
 
103
 
104
+  render() {
87
     return (
105
     return (
88
       <>
106
       <>
89
         <div style={{ width: '100%', height: '400px', position: 'relative' }}>
107
         <div style={{ width: '100%', height: '400px', position: 'relative' }}>
90
-          <Map events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03">
91
-            <Marker position={this.markerPosition} events={this.markerEvents} />
108
+          {/* zoom={15} 设置后,无效,不知道什么原因,必须手动设置 */}
109
+          <Map plugins={['ToolBar']} events={this.amapEvents} amapkey="f0d1d4f82432504003ebf46e5e36ff03" center={this.state.markerPosition}>
110
+            <Marker position={this.state.markerPosition} events={this.markerEvents} />
92
           </Map>
111
           </Map>
93
           {
112
           {
94
           <div className={styles.infoBox}>
113
           <div className={styles.infoBox}>

+ 103
- 0
src/pages/building/list/add/components/amapAroundData.js 파일 보기

1
+import request from '../../../../../utils/request';
2
+import apis from '../../../../../services/apis';
3
+
4
+const KEY = '14f05ce59c26364fd0674014dc0d8b1b'
5
+
6
+const POI_TYPES_KETY = {
7
+    Transport: 'Transport',
8
+    Mall: 'Mall',
9
+    Edu: 'Edu',
10
+    Hospital: 'Hospital',
11
+    Bank: 'Bank',
12
+    Restaurant: 'Restaurant',
13
+}
14
+
15
+// key 值会被拿到 building 表中 组合为字段名
16
+const POI_TYPES = [
17
+    {
18
+      key: POI_TYPES_KETY.Transport,
19
+      label: '交通',
20
+      types: ['150100', '150200', '150300', '150400', '150500', '150600'],
21
+      data: [],
22
+    },
23
+    {
24
+      key: POI_TYPES_KETY.Mall,
25
+      label: '商业',
26
+      types: ['060100', '060200', '060300', '060400', '060500', '060600',
27
+              '060700', '060800', '060900', '061000', '061100', '061200',
28
+              '061300', '061400', '080100', '080200', '080300', '080400',
29
+              '080500', '080600'],
30
+      data: [],
31
+    },
32
+    {
33
+      key: POI_TYPES_KETY.Edu,
34
+      label: '学校',
35
+      types: ['141200'],
36
+      data: [],
37
+    },
38
+    {
39
+      key: POI_TYPES_KETY.Hospital,
40
+      label: '医院',
41
+      types: ['090100', '090200', '090300', '090400', '090500', '090600', '090700'],
42
+      data: [],
43
+    },
44
+    {
45
+      key: POI_TYPES_KETY.Bank,
46
+      label: '银行',
47
+      types: ['160100'],
48
+      data: [],
49
+    },
50
+    {
51
+      key: POI_TYPES_KETY.Restaurant,
52
+      label: '餐饮',
53
+      types: ['050100', '050200', '050300', '050400', '050500', '050600',
54
+              '050700', '050800', '050900'],
55
+      data: [],
56
+    },
57
+  ]
58
+
59
+/**
60
+ * 获取 POI 类型
61
+ * @param {*} keyType 
62
+ */
63
+const getPOIType = keyType => {
64
+    return POI_TYPES.filter(item => item.key === keyType)
65
+}
66
+
67
+/**
68
+ * 获取这个 keyType 类型的所有 types
69
+ * @param {类型的key值} keyType 
70
+ */
71
+const getTypes = keyType => {
72
+  const typesArr = getPOIType(keyType)
73
+  return typesArr[0].types.join('|')
74
+}
75
+
76
+/**
77
+ * 获取周边数据
78
+ * @param {查询参数} params 
79
+ */
80
+function getAroundData (params) {
81
+    return new Promise((resolve, reject) => {
82
+        const { types, location } = params
83
+        if (!types) {
84
+            // console.err('未传输类型types值')
85
+            reject(new Error('未传输类型types值'))
86
+            return
87
+        }
88
+        if (!location) {
89
+            // console.err('未传输传输中心坐标location值')
90
+            reject(new Error('未传输传输中心坐标location值'))
91
+            return
92
+        }
93
+
94
+        request({ ...apis.amap.webService, params: { ...params, key: KEY, types: getTypes(types), location } }).then(data => {
95
+            // console.log(data)
96
+            resolve(data)
97
+        }).catch(err => {
98
+            reject(err)
99
+        })
100
+    })
101
+}
102
+
103
+export { POI_TYPES_KETY, getAroundData, getPOIType, POI_TYPES }

+ 191
- 24
src/pages/building/list/add/components/base.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber, notification } from 'antd';
2
 import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, InputNumber, notification } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
+import { router } from 'umi';
4
 import request from '../../../../../utils/request';
5
 import request from '../../../../../utils/request';
5
 import apis from '../../../../../services/apis';
6
 import apis from '../../../../../services/apis';
6
 import Styles from '../style.less';
7
 import Styles from '../style.less';
7
-import { router } from 'umi';
8
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
8
 import ImageUpload from '../../../../../components/XForm/ImageUpload'
9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
9
 import ImageListUpload from '../../../../../components/XForm/ImageListUpload'
10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
10
 import Wangedit from '../../../../../components/Wangedit/Wangedit'
12
 import Amap from './amap'
12
 import Amap from './amap'
13
 import BudildingProjectType from './buildingProjectType'
13
 import BudildingProjectType from './buildingProjectType'
14
 import SelectCity from '../../../../../components/SelectButton/CitySelect'
14
 import SelectCity from '../../../../../components/SelectButton/CitySelect'
15
+import FileUpload from '@/components/XForm/FileUpload';
16
+import { POI_TYPES_KETY, getAroundData, getPOIType, POI_TYPES } from './amapAroundData'
17
+import { ifError } from 'assert';
15
 
18
 
16
 const { Option } = Select
19
 const { Option } = Select
17
 const { TabPane } = Tabs;
20
 const { TabPane } = Tabs;
40
 function AddBuilding(props) {
43
 function AddBuilding(props) {
41
   const { getFieldDecorator } = props.form;
44
   const { getFieldDecorator } = props.form;
42
 
45
 
46
+  const [poi, setPoi] = useState([])
47
+
48
+  // 视频上传按钮是否 禁用
49
+  const [fileUploadDisabled, setFileUploadDisabled] = useState(false)
50
+
51
+  // console.log('props.building: ', props.building)
43
   if (props.building.buildingId !== undefined) {
52
   if (props.building.buildingId !== undefined) {
44
     const { buildingId } = props.building
53
     const { buildingId } = props.building
45
-    if (buildingId !== '') {
46
-      // eslint-disable-next-line react-hooks/rules-of-hooks
47
-      useEffect(() => {
54
+     // eslint-disable-next-line react-hooks/rules-of-hooks
55
+     useEffect(() => {
56
+      if (buildingId !== '') {
48
         getById(buildingId)
57
         getById(buildingId)
49
-      }, [])
50
-    }
58
+        setPoi(POI_TYPES)
59
+      }
60
+    }, [])
51
   }
61
   }
52
 
62
 
53
    // 获取详情信息
63
    // 获取详情信息
54
    function getById(currentId) {
64
    function getById(currentId) {
55
-
56
     request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
65
     request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
57
       if (res.openingDate !== null) {
66
       if (res.openingDate !== null) {
58
         res.openingDate = moment(res.openingDate)
67
         res.openingDate = moment(res.openingDate)
65
       }
74
       }
66
 
75
 
67
       res.avatarImage = res.buildingImg.map(item => item.url)
76
       res.avatarImage = res.buildingImg.map(item => item.url)
77
+      res.listImage = res.buildingListImg.map(item => item.url)
78
+      res.mapCoordinate = res.coordinate
79
+      if (res.videoUrl) {
80
+        res.videoUrl = [].concat(res.videoUrl)
81
+        // 视频上传按钮禁用
82
+        setFileUploadDisabled(true)
83
+      }
84
+      if (res.videoImage) {
85
+        res.videoImage = res.videoImage[0].url
86
+      }
87
+      setPoi(res.mapJson || [])
68
       props.form.setFieldsValue(res)
88
       props.form.setFieldsValue(res)
89
+      props.onSuccess(res)
69
     })
90
     })
70
   }
91
   }
71
 
92
 
79
   }
100
   }
80
 
101
 
81
   function addBuilding(data) {
102
   function addBuilding(data) {
103
+    // console.log('poi: ', poi)
104
+    data.mapJson = poi
82
     data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
105
     data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
83
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
106
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
84
     // 项目主图
107
     // 项目主图
85
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
108
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
109
+    // 列表图
110
+    data.listImg = data.listImage && data.listImage.map((item, index) => ({ imgType: 'list', url: item, orderNo: index + 1 }))
111
+    if (data.videoUrl) {
112
+      // console.log(data.videoUrl[0])
113
+      data.videoUrl = data.videoUrl[0]
114
+    }
115
+    
86
     if (data.tag) {
116
     if (data.tag) {
87
       data.tag = data.tag.map((item, _) => ({ tagName: item }))
117
       data.tag = data.tag.map((item, _) => ({ tagName: item }))
88
     }
118
     }
89
 
119
 
120
+    if (data.videoImage) {
121
+      data.videoImage = [{ imgType: 'videoImage', url: data.videoImage, orderNo: 1 }]
122
+    }
123
+
90
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
124
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
91
-    request({ ...api, data: { ...data } }).then(() => {
125
+    request({ ...api, data: { ...data } }).then(res => {
92
       openNotificationWithIcon('success', '操作成功')
126
       openNotificationWithIcon('success', '操作成功')
93
-      router.go(-1)
127
+      // router.go(-1)
128
+      getById(res.buildingId)
94
     }).catch(err => {
129
     }).catch(err => {
95
       openNotificationWithIcon('error', err.message)
130
       openNotificationWithIcon('error', err.message)
96
     })
131
     })
97
   }
132
   }
98
 
133
 
134
+  // 视频文件上传前 回调
135
+  function fileUploadBeforeUpload(file, fileList) {
136
+    // console.log('视频文件上传前 回调: ', file, fileList)
137
+    return new Promise((resolve, reject) => {
138
+      if (fileUploadDisabled) {
139
+        openNotificationWithIcon('error', '项目视频,只允许上传一个')
140
+        reject()
141
+      } else if (file.type === 'video/mp4' || file.type === '.mp4') {
142
+          setFileUploadDisabled(true)
143
+          resolve(file)
144
+      } else {
145
+        openNotificationWithIcon('error', '项目视频,仅支持MP4格式')
146
+        reject()
147
+      }
148
+    })
149
+  }
150
+
151
+  // 周边设施 回调
152
+  function getMapScope(e) {
153
+    const coordinate = props.form.getFieldValue('coordinate').split(',')
154
+    const poiData = [].concat(POI_TYPES)
155
+    poiData.map(item => {
156
+      getAroundData({ types: item.key, location: `${coordinate[1]},${coordinate[0]}`, radius: e }).then(res => {
157
+        const { pois } = res
158
+        setFormMapScopeValue(item.key, pois)
159
+      }).catch(err => {
160
+        console.log(err.message)
161
+        openNotificationWithIcon('error', '周边数据获取失败')
162
+      })
163
+    })
164
+  }
165
+
166
+  function setFormMapScopeValue(key, pois) {
167
+    const poiArray = pois.map(p => {
168
+      return {
169
+        address: p.address,
170
+        adname: p.adname,
171
+        cityname: p.cityname,
172
+        distance: p.distance,
173
+        id: p.id,
174
+        location: p.location,
175
+        name: p.name,
176
+        pname: p.pname,
177
+        shopinfo: p.shopinfo,
178
+        type: p.type,
179
+        typecode: p.typecode,
180
+      }
181
+    })
182
+    
183
+    // 设置表单值
184
+    getFormMapScopeName(key, { data: poiArray })
185
+
186
+    const poiData = [].concat(POI_TYPES)
187
+    const newPoi = poiData.map(m => {
188
+      if (m.key === key) {
189
+        m.data = poiArray
190
+      }
191
+      return m
192
+    })
193
+    setPoi(newPoi)
194
+  }
195
+
196
+  function getFormMapScopeName(keyType, item) {
197
+    switch (keyType) {
198
+      case POI_TYPES_KETY.Transport:
199
+        props.form.setFieldsValue({ buildingTransport: item.data.map(t => t.name).join(',') })
200
+        return 'buildingTransport';
201
+      case POI_TYPES_KETY.Bank:
202
+        props.form.setFieldsValue({ buildingBank: item.data.map(t => t.name).join(',') })
203
+        return 'buildingBank';
204
+      case POI_TYPES_KETY.Edu:
205
+        props.form.setFieldsValue({ buildingEdu: item.data.map(t => t.name).join(',') })
206
+        return 'buildingEdu';
207
+      case POI_TYPES_KETY.Hospital:
208
+        props.form.setFieldsValue({ buildingHospital: item.data.map(t => t.name).join(',') })
209
+        return 'buildingHospital';
210
+      case POI_TYPES_KETY.Restaurant:
211
+        props.form.setFieldsValue({ buildingRestaurant: item.data.map(t => t.name).join(',') })
212
+        return 'buildingRestaurant';
213
+      case POI_TYPES_KETY.Mall:
214
+        props.form.setFieldsValue({ buildingMall: item.data.map(t => t.name).join(',') })
215
+        return 'buildingMall';
216
+      default:
217
+    }
218
+  }
219
+
99
   return (
220
   return (
100
         <Form {...formItemLayout} onSubmit={handleSubmit}>
221
         <Form {...formItemLayout} onSubmit={handleSubmit}>
101
-          <Form.Item label="项目Id"  style={{ display: 'none' }}>
222
+          <Form.Item label="项目Id" style={{ display: 'none' }}>
102
             {getFieldDecorator('buildingId')(<Input disabled />)}
223
             {getFieldDecorator('buildingId')(<Input disabled />)}
103
           </Form.Item>
224
           </Form.Item>
104
           <Form.Item label="楼盘编号" >
225
           <Form.Item label="楼盘编号" >
111
               rules: [{ required: true, message: '请输入楼盘名' }],
232
               rules: [{ required: true, message: '请输入楼盘名' }],
112
             })(<Input />)}
233
             })(<Input />)}
113
           </Form.Item>
234
           </Form.Item>
114
-          <Form.Item label="别名" >
235
+          {/* <Form.Item label="别名" >
115
             {getFieldDecorator('name')(<Input />)}
236
             {getFieldDecorator('name')(<Input />)}
116
-          </Form.Item>
237
+          </Form.Item> */}
117
           <Form.Item label="项目类型">
238
           <Form.Item label="项目类型">
118
-            {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
239
+            {getFieldDecorator('buildingProjectType', {
240
+              rules: [{ required: true, message: '请选择项目类型' }],
241
+            })(<BudildingProjectType />)}
119
           </Form.Item>
242
           </Form.Item>
120
           <Form.Item label="均价" >
243
           <Form.Item label="均价" >
121
             {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}元/m²
244
             {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}元/m²
146
             )}
269
             )}
147
           </Form.Item>
270
           </Form.Item>
148
           <Form.Item label="销售状态" >
271
           <Form.Item label="销售状态" >
149
-            {getFieldDecorator('marketStatus')(
272
+            {getFieldDecorator('marketStatus', {
273
+              rules: [{ required: true, message: '请选择销售状态' }],
274
+            })(
150
               <Select placeholder="销售状态" style={{ width: '1016px' }}>
275
               <Select placeholder="销售状态" style={{ width: '1016px' }}>
151
                 <Option value="待定">待定</Option>
276
                 <Option value="待定">待定</Option>
152
                 <Option value="在售">在售</Option>
277
                 <Option value="在售">在售</Option>
157
           <Form.Item label="项目标签" >
282
           <Form.Item label="项目标签" >
158
             {getFieldDecorator('tag')(
283
             {getFieldDecorator('tag')(
159
               <Select mode="tags" placeholder="输入后选中" style={{ width: '1016px' }}>
284
               <Select mode="tags" placeholder="输入后选中" style={{ width: '1016px' }}>
160
-                
285
+
161
               </Select>,
286
               </Select>,
162
             )}
287
             )}
163
           </Form.Item>
288
           </Form.Item>
164
-          <Form.Item label="项目主图" help="建议图片尺寸:640px*360px">
165
-            {getFieldDecorator('avatarImage')(
289
+          <Form.Item label="项目视频" help="视频仅支持mp4格式,建议尺寸:1920*1080,比例16:9">
290
+            {getFieldDecorator('videoUrl')(
291
+              // disabled={fileUploadDisabled}
292
+              <FileUpload accept=".mp4" beforeUpload={fileUploadBeforeUpload} label="上传视频" />,
293
+            )}
294
+          </Form.Item>
295
+          <Form.Item label="视频封面图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于视频封面" >
296
+            {getFieldDecorator('videoImage', {
297
+              rules: [{ required: true, message: '请选择视频封面图' }],
298
+            })(
299
+              <ImageUpload />,
300
+            )}
301
+          </Form.Item>
302
+          <Form.Item label="楼盘主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘详情">
303
+            {getFieldDecorator('avatarImage', {
304
+              rules: [{ required: true, message: '请选择项目主图' }],
305
+            })(
306
+              <ImageListUpload />,
307
+            )}
308
+          </Form.Item>
309
+          <Form.Item label="楼盘封面图" help="建议图片尺寸:670*377px,比例16:9,格式:jpg,用于楼盘列表">
310
+            {getFieldDecorator('listImage', {
311
+              rules: [{ required: true, message: '请选择列表图' }],
312
+            })(
166
               <ImageListUpload />,
313
               <ImageListUpload />,
167
             )}
314
             )}
168
           </Form.Item>
315
           </Form.Item>
169
-          <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
316
+          {/* <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
170
             {getFieldDecorator('mapImg')(
317
             {getFieldDecorator('mapImg')(
171
               <ImageUpload />,
318
               <ImageUpload />,
172
             )}
319
             )}
173
-          </Form.Item>
320
+          </Form.Item> */}
174
           {/* <Form.Item label="海报底图" help="建议图片尺寸:640px*1136px" >
321
           {/* <Form.Item label="海报底图" help="建议图片尺寸:640px*1136px" >
175
             {getFieldDecorator('poster')(
322
             {getFieldDecorator('poster')(
176
               <ImageUpload />,
323
               <ImageUpload />,
183
             {getFieldDecorator('discount')(<Input />)}
330
             {getFieldDecorator('discount')(<Input />)}
184
           </Form.Item>
331
           </Form.Item>
185
           <Form.Item label="首页推荐" >
332
           <Form.Item label="首页推荐" >
186
-            {getFieldDecorator('isMain')(
333
+            {getFieldDecorator('isMain', {
334
+              initialValue: 1,
335
+            })(
187
             <Radio.Group>
336
             <Radio.Group>
188
               <Radio value={1}>是</Radio>
337
               <Radio value={1}>是</Radio>
189
               <Radio value={2}>否</Radio>
338
               <Radio value={2}>否</Radio>
198
             )}
347
             )}
199
           </Form.Item>
348
           </Form.Item>
200
           <Form.Item label="楼盘区域" >
349
           <Form.Item label="楼盘区域" >
201
-            {getFieldDecorator('buildingArea')(<Input />)}
350
+            {getFieldDecorator('buildingArea', {
351
+              rules: [{ required: true, message: '请输入楼盘区域' }],
352
+            })(<Input />)}
202
           </Form.Item>
353
           </Form.Item>
203
           <Form.Item label="项目地址" >
354
           <Form.Item label="项目地址" >
204
-            {getFieldDecorator('address')(<Input />)}
355
+            {getFieldDecorator('address', {
356
+              rules: [{ required: true, message: '请输入项目地址' }],
357
+            })(<Input />)}
205
           </Form.Item>
358
           </Form.Item>
206
           <Form.Item label="项目坐标" >
359
           <Form.Item label="项目坐标" >
207
-            {getFieldDecorator('coordinate')(<Input disabled />)}
360
+            {getFieldDecorator('coordinate', {
361
+              rules: [{ required: true, message: '请输入项目坐标' }],
362
+            })(<Input disabled />)}
208
           </Form.Item>
363
           </Form.Item>
209
           <Form.Item label="地图位置" >
364
           <Form.Item label="地图位置" >
210
-            {getFieldDecorator('coordinate')(<Amap />)}
365
+            {getFieldDecorator('mapCoordinate')(<Amap onChange={e => props.form.setFieldsValue({ coordinate: e })}/>)}
366
+          </Form.Item>
367
+          <Form.Item label="周边设施搜索范围" style={{ width: '2000px' }}>
368
+            {getFieldDecorator('mapScope', {
369
+              rules: [{ required: true, message: '请选择周边设施搜索范围' }],
370
+            })(
371
+              <Select placeholder="请选择周边设施搜索范围" style={{ width: '970px' }} onChange={e => getMapScope(e)}>
372
+                <Option value={1000}>1公里</Option>
373
+                <Option value={3000}>3公里</Option>
374
+                <Option value={5000}>5公里</Option>
375
+                <Option value={10000}>10公里</Option>
376
+              </Select>,
377
+            )}
211
           </Form.Item>
378
           </Form.Item>
212
           <Form.Item label="周边交通" >
379
           <Form.Item label="周边交通" >
213
             {getFieldDecorator('buildingTransport')(
380
             {getFieldDecorator('buildingTransport')(

+ 275
- 0
src/pages/building/list/add/components/buildingImage.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification, Modal, Layout } from 'antd';
3
+import ImageListUpload from '../../../../../components/XForm/ImageListUpload';
4
+import moment from 'moment';
5
+import request from '../../../../../utils/request';
6
+import apis from '../../../../../services/apis';
7
+
8
+const { Header, Footer, Sider, Content } = Layout;
9
+
10
+const modalEdiFormItemLayout = {
11
+  labelCol: {
12
+    xs: { span: 24 },
13
+    sm: { span: 8 },
14
+  },
15
+  wrapperCol: {
16
+    xs: { span: 24 },
17
+    sm: { span: 16 },
18
+  },
19
+};
20
+
21
+const openNotificationWithIcon = (type, message) => {
22
+  notification[type]({
23
+    message,
24
+    description:
25
+      '',
26
+  });
27
+};
28
+
29
+/**
30
+ * 弹框
31
+ */
32
+function ModalEdi(props) {
33
+  const { apartment, buildingId, apartmentId } = props.visibleData
34
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
35
+
36
+  if (!props.visibleData) {
37
+    console.error('缺少visibleData参数!')
38
+  }
39
+
40
+  useEffect(() => {
41
+    setVisibleData(props.visibleData)
42
+    props.form.setFieldsValue({ apartmentId, apartmentName: apartment !== '' ? apartment.apartmentName : '' })
43
+  }, [props.visibleData.visible])
44
+
45
+  function handleOk(e) {
46
+    // console.log(e);
47
+    props.onCancel();
48
+  }
49
+
50
+  function handleCancel(e) {
51
+    // console.log(e);
52
+    props.onCancel();
53
+  }
54
+
55
+  function handleSubmit(e) {
56
+    e.preventDefault();
57
+    props.form.validateFieldsAndScroll((err, values) => {
58
+      if (!err) {
59
+        console.log('Received values of form: ', values);
60
+        submitData(values)
61
+      }
62
+    });
63
+  }
64
+
65
+  function submitData(data) {
66
+    if (buildingId === '' || buildingId === undefined) {
67
+      return
68
+    }
69
+    if (data.img) {
70
+        // 如果是 名称 和 图片一起编辑,就穿最新的图片
71
+      data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
72
+    } else {
73
+        // 如果是 名称 和 图片一起编辑,就穿最新的图片
74
+      data.img = visibleData.apartment.buildingImgList
75
+    }
76
+    data.buildingId = buildingId;
77
+    data.apartmentType = 'photo'
78
+    const api = (data.apartmentId !== undefined && data.apartmentId !== '') ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
79
+
80
+    // 网路请求
81
+    request({ ...api, data: { ...data } }).then(() => {
82
+      // eslint-disable-next-line no-unused-expressions
83
+      openNotificationWithIcon('success', '操作成功')
84
+      handleCancel()
85
+      props.onSuccess()
86
+      // this.setState({ visibleData: { visible: false, apartmentId: '', buildingId: '' } }, () => console.log('回调:', this.state.visibleData))
87
+    }).catch(err => {
88
+      // eslint-disable-next-line no-unused-expressions
89
+      openNotificationWithIcon('error', err)
90
+    })
91
+  }
92
+
93
+  const { getFieldDecorator } = props.form;
94
+  return (
95
+    <>
96
+      <Modal
97
+          title="编辑"
98
+          visible={visibleData.visible}
99
+          onOk={handleOk}
100
+          onCancel={handleCancel}
101
+          width={700}
102
+          footer={null}
103
+        >
104
+         <Form {...modalEdiFormItemLayout} onSubmit={handleSubmit}>
105
+          <Form.Item label="编号" style={{ display: 'none' }}>
106
+              {getFieldDecorator('apartmentId')(<Input />)}
107
+          </Form.Item>
108
+          <Form.Item label="相册名称">
109
+            {getFieldDecorator('apartmentName', {
110
+              rules: [
111
+                {
112
+                  required: true,
113
+                  message: '请输入相册名称',
114
+                },
115
+                {
116
+                  max: 10,
117
+                  message: '不超过10个字符',
118
+                },
119
+              ],
120
+            })(<Input />)}
121
+          </Form.Item>
122
+          {
123
+            !props.noImage && <Form.Item label="选择图片">
124
+            {getFieldDecorator('img', {
125
+              rules: [
126
+                {
127
+                  required: true,
128
+                  message: '请选择图片',
129
+                },
130
+              ],
131
+            })(<ImageListUpload />)}
132
+          </Form.Item>
133
+          }
134
+          <Form.Item style={{ display: 'flex', justifyContent: 'flex-end' }}>
135
+            <Button type="primary" htmlType="submit">
136
+              保存
137
+            </Button>
138
+            &nbsp;&nbsp;&nbsp;&nbsp;
139
+            <Button onClick={() => handleCancel()}>
140
+              取消
141
+            </Button>
142
+          </Form.Item>
143
+         </Form>
144
+        </Modal>
145
+    </>
146
+  )
147
+}
148
+
149
+const WrappedModalEdiForm = Form.create({ name: 'ModalEdi' })(ModalEdi);
150
+
151
+/**
152
+ * 模块
153
+ */
154
+function BuildingImageModel(props) {
155
+  const [imageList, setImageList] = useState([])
156
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
157
+
158
+  useEffect(() => {
159
+    setImageList(getImgUrl())
160
+  }, [props.apartment.apartmentId])
161
+
162
+  function getImgUrl() {
163
+    return ((props.apartment.buildingImgList || [])).map(item => item.url)
164
+  }
165
+
166
+  function submitData(data) {
167
+    const { apartmentId } = props.apartment
168
+    if (apartmentId === '' || apartmentId === undefined) {
169
+      return
170
+    }
171
+
172
+    data.buildingId = props.apartment.buildingId;
173
+    data.apartmentType = 'photo'
174
+    const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
175
+
176
+    // 网路请求
177
+    request({ ...api, data: { ...data } }).then(() => {
178
+      // eslint-disable-next-line no-unused-expressions
179
+      openNotificationWithIcon('success', '操作成功')
180
+    }).catch(err => {
181
+      // eslint-disable-next-line no-unused-expressions
182
+      // openNotificationWithIcon('error', err)
183
+    })
184
+  }
185
+
186
+  function onImageChange(e) {
187
+    setImageList(e)
188
+       
189
+    // 新增加图片后,更新后端数据
190
+    const img = e.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
191
+    submitData({ ...props.apartment, img })
192
+  }
193
+
194
+  function edi() {
195
+    setVisibleData({ visible: true, buildingId: props.apartment.buildingId, apartmentId: props.apartment.apartmentId, apartment: props.apartment })
196
+  }
197
+
198
+  function onCancel(e) {
199
+    setVisibleData({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
200
+  }
201
+
202
+  function deletePhoto() {
203
+    request({ ...apis.building.buildingApartmentDelete, urlData: { id: props.apartment.apartmentId } }).then(() => {
204
+      openNotificationWithIcon('success', '操作成功')
205
+      props.onSuccess()
206
+    }).catch(err => {
207
+
208
+    })
209
+  }
210
+
211
+  return (
212
+    <>
213
+      <span style={{ marginTop: '10px', marginBottom: '10px' }}>{props.apartment.apartmentName}({imageList.length})</span>
214
+      <Button type="link" style={{ color: 'blue' }} onClick={() => edi()}>重命名</Button>
215
+      <Button type="link" style={{ color: 'blue' }} onClick={() => deletePhoto()}>删除相册</Button>
216
+      <ImageListUpload value={imageList} onChange={onImageChange} unlimited/>
217
+
218
+       {/* 编辑页 */}
219
+       <WrappedModalEdiForm visibleData={visibleData} onCancel={e => onCancel(e)} onSuccess={() => props.onSuccess()} noImage/>
220
+       <hr />
221
+    </>
222
+  )
223
+}
224
+
225
+/**
226
+ * 主体
227
+ */
228
+function buildingImage(props) {
229
+  // eslint-disable-next-line react-hooks/rules-of-hooks
230
+  const [visibleData, setVisibleData] = useState({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
231
+  const [imageList, setImageList] = useState([])
232
+
233
+  // eslint-disable-next-line react-hooks/rules-of-hooks
234
+  useEffect(() => {
235
+    getList()
236
+  }, [props.building.buildingId])
237
+ 
238
+
239
+  function edi() {
240
+    setVisibleData({ visible: true, buildingId: props.building.buildingId, apartmentId: '', apartment: '' })
241
+  }
242
+
243
+  function onCancel(e) {
244
+    setVisibleData({ visible: false, buildingId: '', apartmentId: '', apartment: '' })
245
+  }
246
+
247
+  function onSuccess(e) {
248
+    getList()
249
+  }
250
+
251
+  function getList(params) {
252
+    // 网路请求
253
+    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params, apartmentType: 'photo' } }).then(res => {
254
+      setImageList(res)
255
+    }).catch(err => {
256
+      openNotificationWithIcon('error', err.message)
257
+    })
258
+  }
259
+
260
+  return (
261
+    <>
262
+      <Button type="primary" onClick={() => edi()}>新增</Button>
263
+      <Layout style={{ background: '#fff' }}>
264
+        {
265
+          imageList.map(item => <Content><BuildingImageModel apartment={item} key={item.apartmentId} onSuccess={e => onSuccess(e)}/></Content>)
266
+        }
267
+      </Layout>
268
+
269
+      {/* 编辑页 */}
270
+      <WrappedModalEdiForm visibleData={visibleData} onCancel={e => onCancel(e)} onSuccess={e => onSuccess(e)}/>
271
+    </>
272
+  )
273
+}
274
+
275
+export default buildingImage

+ 31
- 19
src/pages/building/list/add/components/imageSet.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, Table, notification, Modal } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../../../utils/request';
4
 import request from '../../../../../utils/request';
5
 import apis from '../../../../../services/apis';
5
 import apis from '../../../../../services/apis';
7
 import { router } from 'umi';
7
 import { router } from 'umi';
8
 import ModalImage from './modalImage';
8
 import ModalImage from './modalImage';
9
 
9
 
10
+const { confirm } = Modal;
11
+
10
 
12
 
11
 const saleType = [
13
 const saleType = [
12
   {
14
   {
51
 
53
 
52
   function getList(params) {
54
   function getList(params) {
53
     // 网路请求
55
     // 网路请求
54
-    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params } }).then(res => {
56
+    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params, apartmentType: 'apart' } }).then(res => {
55
       setData(res)
57
       setData(res)
56
     }).catch(err => {
58
     }).catch(err => {
57
       openNotificationWithIcon('error', err.message)
59
       openNotificationWithIcon('error', err.message)
82
    * @param {*} record
84
    * @param {*} record
83
    */
85
    */
84
   function deleteApartment(record) {
86
   function deleteApartment(record) {
85
-    // 网路请求
86
-    request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
87
-      getList()
88
-      openNotificationWithIcon('success', '操作成功')
89
-    }).catch(err => {
90
-      // openNotificationWithIcon('error', err.message)
91
-    })
87
+    confirm({
88
+      title: '确认删除当前数据?',
89
+      content: '确定后成功删除,点击取消则放弃当前操作',
90
+      okText: '确定',
91
+      cancelText: '取消',
92
+      onOk() {
93
+        // 网路请求
94
+        request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
95
+          getList()
96
+          openNotificationWithIcon('success', '操作成功')
97
+        }).catch(err => {
98
+          // openNotificationWithIcon('error', err.message)
99
+        })
100
+      },
101
+      onCancel() {},
102
+    });
92
   }
103
   }
93
 
104
 
94
 
105
 
98
       dataIndex: 'apartmentName',
109
       dataIndex: 'apartmentName',
99
       key: 'apartmentName',
110
       key: 'apartmentName',
100
     },
111
     },
101
-    {
102
-      title: '类型',
103
-      dataIndex: 'apartmentType',
104
-      key: 'apartmentType',
105
-      render: (_, record) => <span>{ record.apartmentType === 'apart' ? '户型' : '相册' }</span>,
106
-    },
107
     {
112
     {
108
       title: '销售状态',
113
       title: '销售状态',
109
       dataIndex: 'marketStatus',
114
       dataIndex: 'marketStatus',
111
       render: (_, record) => <span>{ (saleType.filter(x => x.id == record.marketStatus)[0] || {}).name }</span>,
116
       render: (_, record) => <span>{ (saleType.filter(x => x.id == record.marketStatus)[0] || {}).name }</span>,
112
     },
117
     },
113
     {
118
     {
114
-      title: '备注',
115
-      dataIndex: 'remark',
116
-      key: 'remark',
119
+      title: '面积',
120
+      dataIndex: 'buildingArea',
121
+      key: 'buildingArea',
122
+      render: (buildingArea, _) => <span>{ `${buildingArea}m²` }</span>,
123
+    },
124
+    {
125
+      title: '套内面积',
126
+      dataIndex: 'insideArea',
127
+      key: 'insideArea',
128
+      render: (insideArea, _) => <span>{ `${insideArea}m²` }</span>,
117
     },
129
     },
118
     {
130
     {
119
       title: '创建时间',
131
       title: '创建时间',
141
 
153
 
142
       {/* 编辑页 */}
154
       {/* 编辑页 */}
143
       {/*  onSuccess是子组件传递事件信息  */}
155
       {/*  onSuccess是子组件传递事件信息  */}
144
-      <ModalImage visibleData={visibleData} key={1} onSuccess={() => onModalChange()}/>
156
+      <ModalImage visibleData={visibleData} key="ModalImage" onSuccess={() => onModalChange()}/>
145
     </>
157
     </>
146
   )
158
   )
147
 }
159
 }

+ 20
- 31
src/pages/building/list/add/components/modalImage.jsx 파일 보기

30
 const saleType = [
30
 const saleType = [
31
   {
31
   {
32
     id: 1,
32
     id: 1,
33
-    name: '待',
33
+    name: '待',
34
   },
34
   },
35
   {
35
   {
36
     id: 2,
36
     id: 2,
118
     // TODO 这里应该是要支持多图,但是封装的控件没有
118
     // TODO 这里应该是要支持多图,但是封装的控件没有
119
     data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
119
     data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
120
     data.buildingId = this.props.visibleData.buildingId;
120
     data.buildingId = this.props.visibleData.buildingId;
121
+    data.apartmentType = 'apart'
121
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
122
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
122
 
123
 
123
     // 网路请求
124
     // 网路请求
162
               <Form.Item label="编号" style={{ display: 'none' }}>
163
               <Form.Item label="编号" style={{ display: 'none' }}>
163
                   {getFieldDecorator('apartmentId')(<Input />)}
164
                   {getFieldDecorator('apartmentId')(<Input />)}
164
               </Form.Item>
165
               </Form.Item>
165
-              <Form.Item label="名称">
166
+              <Form.Item label="户型名称">
166
                 {getFieldDecorator('apartmentName', {
167
                 {getFieldDecorator('apartmentName', {
167
-                  rules: [{ required: true, message: '请输入名称' }],
168
-                })(<Input />)}
169
-              </Form.Item>
170
-              <Form.Item label="类型">
171
-                {getFieldDecorator('apartmentType', {
172
-                  rules: [{ required: true, message: '请选择类型' }],
173
-                })(
174
-                  <Select placeholder="类型">
175
-                    <Option value="apart">户型</Option>
176
-                    <Option value="photo">相册</Option>
177
-                  </Select>,
178
-                )}
168
+                  rules: [
169
+                    { required: true, message: '请填写户型名称' },
170
+                    { max: 10, message: '户型名称不超过10个字符' },
171
+                  ],
172
+                })(<Input placeholder="户型名称不超过10个字符"/>)}
179
               </Form.Item>
173
               </Form.Item>
180
               <Form.Item label="销售状态">
174
               <Form.Item label="销售状态">
181
-                {getFieldDecorator('marketStatus')(
175
+                {getFieldDecorator('marketStatus', {
176
+                  rules: [{ required: true, message: '请选择销售状态' }],
177
+                })(
182
                   <Select placeholder="销售状态">
178
                   <Select placeholder="销售状态">
183
                     {
179
                     {
184
                       saleType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
180
                       saleType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
188
               </Form.Item>
184
               </Form.Item>
189
               <Form.Item label="图片">
185
               <Form.Item label="图片">
190
               {getFieldDecorator('img', {
186
               {getFieldDecorator('img', {
191
-                  rules: [{ required: true, message: '请选择图片' }],
187
+                  rules: [{ required: true, message: '请上传户型图片' }],
192
               })(
188
               })(
193
                 <ImageListUpload />,
189
                 <ImageListUpload />,
194
               )}
190
               )}
195
               </Form.Item>
191
               </Form.Item>
196
-              <Form.Item label="面积">
197
-                {getFieldDecorator('buildingArea')(<Input />)}
198
-              </Form.Item>
199
-              <Form.Item label="套内面积">
200
-                {getFieldDecorator('insideArea')(<Input />)}
201
-              </Form.Item>
202
-              <Form.Item label="户型总价">
203
-                {getFieldDecorator('apartmentPrice')(<Input />)}
204
-              </Form.Item>
205
-              <Form.Item label="户型简介">
206
-                {getFieldDecorator('apartmentDescription')(
207
-                  <Wangedit />,
208
-                )}
192
+              <Form.Item label="面积" help="单位 ㎡">
193
+                {getFieldDecorator('buildingArea', {
194
+                  rules: [{ required: true, message: '请填写面积' }],
195
+                })(<Input type="number" />)}
209
               </Form.Item>
196
               </Form.Item>
210
-              <Form.Item label="备注">
211
-                {getFieldDecorator('remark')(<TextArea rows={10} />)}
197
+              <Form.Item label="套内面积" help="单位 ㎡">
198
+                {getFieldDecorator('insideArea', {
199
+                  rules: [{ required: true, message: '请填写套内面积' }],
200
+                })(<Input type="number" />)}
212
               </Form.Item>
201
               </Form.Item>
213
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
202
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
214
                 <Button type="primary" htmlType="submit">保存</Button>
203
                 <Button type="primary" htmlType="submit">保存</Button>

+ 3
- 2
src/pages/building/list/add/components/poster.jsx 파일 보기

140
         <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
140
         <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
141
       </div>
141
       </div>
142
       <div >
142
       <div >
143
-        <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
144
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 海报图</p>
143
+        <div style={{ display: 'flex', width: '100%', margin: '30px 0' }}>
144
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 楼盘海报图</p>
145
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
145
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
146
         </div>
146
         </div>
147
+        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘海报</p>
147
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
148
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
148
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
149
           <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
149
           <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
150
           <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />

+ 2
- 1
src/pages/building/list/add/components/share.jsx 파일 보기

84
       <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
84
       <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
85
     </div>
85
     </div>
86
     <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
86
     <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
87
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
87
+      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>楼盘分享图</p>
88
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
88
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
89
     </div>
89
     </div>
90
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于楼盘分享好友</p>
90
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
91
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
91
     <Button onClick={() => router.go(-1)}>取消</Button>
92
     <Button onClick={() => router.go(-1)}>取消</Button>
92
   </div>
93
   </div>

+ 30
- 18
src/pages/building/list/add/index.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, notification } from 'antd';
3
 import moment from 'moment';
3
 import moment from 'moment';
4
 import request from '../../../../utils/request';
4
 import request from '../../../../utils/request';
5
 import apis from '../../../../services/apis';
5
 import apis from '../../../../services/apis';
11
 import Wangedit from '../../../../components/Wangedit/Wangedit'
11
 import Wangedit from '../../../../components/Wangedit/Wangedit'
12
 import TagGroup from './components/tags'
12
 import TagGroup from './components/tags'
13
 import Base from './components/base'
13
 import Base from './components/base'
14
-import ImageSet from './components/imageSet'
14
+import Apartment from './components/imageSet'
15
 import Poster from './components/poster'
15
 import Poster from './components/poster'
16
 import Share from './components/share'
16
 import Share from './components/share'
17
+import BuildingImage from './components/buildingImage';
17
 
18
 
18
 
19
 
19
 const { Option } = Select
20
 const { Option } = Select
30
   },
31
   },
31
 };
32
 };
32
 
33
 
34
+function openNotificationWithIcon(type, message) {
35
+  notification[type]({
36
+    message,
37
+    description:
38
+      '',
39
+  });
40
+}
41
+
33
 function AddBuilding(props) {
42
 function AddBuilding(props) {
34
 
43
 
35
   const [tab, setTab] = useState('base')
44
   const [tab, setTab] = useState('base')
45
+  const [buildingData, setBuildingData] = useState({ buildingId: undefined })
36
 
46
 
37
   function tabsCallback(e) {
47
   function tabsCallback(e) {
38
     console.log(e);
48
     console.log(e);
39
-    setTab(e.target.value)
49
+    if (!buildingData.buildingId) {
50
+      openNotificationWithIcon('error', '请先保存基本信息')
51
+    } else {
52
+      setTab(e.target.value)
53
+    }
40
   }
54
   }
41
 
55
 
42
-  // console.log(props.location)
56
+  // building 回调
57
+  function buildingOnSuccess(e) {
58
+    setBuildingData(e)
59
+  }
43
 
60
 
44
   return (
61
   return (
45
     <>
62
     <>
46
       <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
63
       <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
47
         <Radio.Button value="base">基本信息</Radio.Button>
64
         <Radio.Button value="base">基本信息</Radio.Button>
48
-        {
49
-          props.location.query.id &&
50
-          (
51
-            <>
52
-              <Radio.Button value="image">户型库</Radio.Button>
53
-              <Radio.Button value="poster">海报图片</Radio.Button>
54
-              <Radio.Button value="share">分享设置</Radio.Button>
55
-            </>
56
-          )
57
-        }
65
+        <Radio.Button value="apartment">户型库</Radio.Button>
66
+        <Radio.Button value="image">项目相册</Radio.Button>
67
+        <Radio.Button value="poster">海报图片</Radio.Button>
68
+        <Radio.Button value="share">分享设置</Radio.Button>
58
       </Radio.Group>
69
       </Radio.Group>
59
       <div style={{ marginTop: '20px' }}>
70
       <div style={{ marginTop: '20px' }}>
60
-        { tab === 'base' && <Base building={{ buildingId: props.location.query && props.location.query.id }} /> }
61
-        { props.location.query.id && (tab === 'image' && <ImageSet building={{ buildingId: props.location.query && props.location.query.id }} />)}
62
-        { props.location.query.id && (tab === 'poster' && <Poster building={{ buildingId: props.location.query && props.location.query.id }} />)}
63
-        { props.location.query.id && (tab === 'share' && <Share building={{ buildingId: props.location.query && props.location.query.id }} />)}
71
+        { tab === 'base' && <Base building={{ buildingId: buildingData.buildingId || (props.location.query && props.location.query.id) }} onSuccess={e => buildingOnSuccess(e)}/> }
72
+        { (tab === 'apartment' && <Apartment building={buildingData} />)}
73
+        { (tab === 'image' && <BuildingImage building={buildingData} />)}
74
+        { (tab === 'poster' && <Poster building={buildingData} />)}
75
+        { (tab === 'share' && <Share building={buildingData} />)}
64
       </div>
76
       </div>
65
     </>
77
     </>
66
     // <Tabs defaultActiveKey="1" onChange={tabsCallback}>
78
     // <Tabs defaultActiveKey="1" onChange={tabsCallback}>

+ 11
- 10
src/pages/building/list/index.jsx 파일 보기

86
           openNotificationWithIcon('success', '操作成功')
86
           openNotificationWithIcon('success', '操作成功')
87
           props.onSuccess()
87
           props.onSuccess()
88
         }).catch(err => {
88
         }).catch(err => {
89
-          openNotificationWithIcon('error', err.message)
89
+          // openNotificationWithIcon('error', err.message)
90
         })
90
         })
91
 
91
 
92
         modal.destroy();
92
         modal.destroy();
97
     });
97
     });
98
   }
98
   }
99
 
99
 
100
-  const { buildingImg = []} = data
101
-
100
+  const { buildingImg } = data
101
+  console.log("buildingImg: ", data.buildingImg, "data: ", data)
102
   return (
102
   return (
103
     <Card
103
     <Card
104
       hoverable
104
       hoverable
105
       style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
105
       style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
106
-      cover={<img alt="example" src={(buildingImg[0] || {}).url} style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
106
+      cover={<img alt="example" src={((data.buildingImg && data.buildingImg[0]) || {}).url} style={{ borderRadius: '12px 12px 0 0', width: '100%', height: '14vw' }}></img>}
107
       bodyStyle={{ padding: '10px 20px' }}
107
       bodyStyle={{ padding: '10px 20px' }}
108
     >
108
     >
109
       <p className={Styles.cardText}>
109
       <p className={Styles.cardText}>
118
       </p>
118
       </p>
119
       <p className={Styles.cardText}>
119
       <p className={Styles.cardText}>
120
         <span className={Styles.title}>楼盘名称</span>
120
         <span className={Styles.title}>楼盘名称</span>
121
-        <span >:{data.name}</span>
121
+        <span >:{data.buildingName || data.name}</span>
122
       </p>
122
       </p>
123
       <p className={Styles.cardItem}>
123
       <p className={Styles.cardItem}>
124
         <span className={Styles.title}>均价</span>
124
         <span className={Styles.title}>均价</span>
125
         <span >
125
         <span >
126
-          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price} </span>元/m²
126
+          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price || '待定'} </span>元/m²
127
         </span>
127
         </span>
128
       </p>
128
       </p>
129
       <p className={Styles.cardItem}>
129
       <p className={Styles.cardItem}>
220
   // 分页
220
   // 分页
221
   function onChange(pageNumber) {
221
   function onChange(pageNumber) {
222
     // eslint-disable-next-line react-hooks/rules-of-hooks
222
     // eslint-disable-next-line react-hooks/rules-of-hooks
223
-    getList({ pageNum: pageNumber, pageSize: 9 })
223
+    getList({ pageNum: pageNumber, pageSize: 9, ...props.form.getFieldsValue() })
224
   }
224
   }
225
 
225
 
226
   function getDate(value, dateString) {
226
   function getDate(value, dateString) {
238
    */
238
    */
239
   function handleReset() {
239
   function handleReset() {
240
     props.form.resetFields();
240
     props.form.resetFields();
241
+    getList({ pageNum: 1, pageSize: 9 })
241
   }
242
   }
242
 
243
 
243
 
244
 
269
           {getFieldDecorator('buildingStatus')(
270
           {getFieldDecorator('buildingStatus')(
270
             <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
271
             <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
271
               <Option value="1">发布</Option>
272
               <Option value="1">发布</Option>
272
-              <Option value="0">未发布</Option>
273
+              <Option value="2">未发布</Option>
273
             </Select>,
274
             </Select>,
274
           )}
275
           )}
275
         </Form.Item>
276
         </Form.Item>
291
           {getFieldDecorator('isMain')(
292
           {getFieldDecorator('isMain')(
292
             <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
293
             <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
293
               <Option value="1">首页推荐</Option>
294
               <Option value="1">首页推荐</Option>
294
-              <Option value="0">首页未推荐</Option>
295
+              <Option value="2">首页未推荐</Option>
295
             </Select>,
296
             </Select>,
296
           )}
297
           )}
297
         </Form.Item>
298
         </Form.Item>
323
       </Row>
324
       </Row>
324
       {/* 分页 */}
325
       {/* 分页 */}
325
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
326
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
326
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} current={dataSource.current}/>
327
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} />
327
       </div>
328
       </div>
328
     </>
329
     </>
329
   );
330
   );

+ 3
- 2
src/pages/building/type/index.jsx 파일 보기

15
   const columns = [
15
   const columns = [
16
     {
16
     {
17
       title: '编号',
17
       title: '编号',
18
-      dataIndex: 'buildingTypeId',
19
-      key: 'buildingTypeId',
18
+      dataIndex: 'index',
19
+      key: 'index',
20
+      render: (text, record, index) => <span>{index + 1}</span>,
20
     },
21
     },
21
     {
22
     {
22
       title: '类型名称',
23
       title: '类型名称',

+ 9
- 8
src/pages/carouselFigure/SelectNews.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import{ Select, Modal } from 'antd';
2
+import { Select, Modal } from 'antd';
3
 import { apis, fetch } from '../../utils/request';
3
 import { apis, fetch } from '../../utils/request';
4
 
4
 
5
 const getNewsList = fetch(apis.news.getList)
5
 const getNewsList = fetch(apis.news.getList)
6
 
6
 
7
-export default (props) => {
7
+export default props => {
8
   const {
8
   const {
9
     value,
9
     value,
10
     onChange,
10
     onChange,
13
 
13
 
14
   const [list, setList] = useState([]);
14
   const [list, setList] = useState([]);
15
   const [visible, setVisible] = useState(false);
15
   const [visible, setVisible] = useState(false);
16
-  const [ news, setNews ] = useState({ newsId: undefined, newsName: '请选择资讯' })
17
-  const getNewsTitle = val => ((list.filter(x => x.newsId === val)[0]) || {}).newsName || '请选择资讯'
16
+  const [news, setNews] = useState({ newsId: undefined, newsName: '请选择资讯' })
17
+  const getNewsTitle = val => ((list.filter(x => x.newsId == val)[0]) || {}).newsName || '请选择资讯'
18
   const updateNews = val => setNews({ newsId: val, newsName: getNewsTitle(val) })
18
   const updateNews = val => setNews({ newsId: val, newsName: getNewsTitle(val) })
19
 
19
 
20
   const buildingId = props.buildingId()
20
   const buildingId = props.buildingId()
21
-  
21
+
22
   useEffect(() => {
22
   useEffect(() => {
23
     getNewsList({
23
     getNewsList({
24
       params: {
24
       params: {
25
         buildingId,
25
         buildingId,
26
         pageNum: 1,
26
         pageNum: 1,
27
         pageSize: 999,
27
         pageSize: 999,
28
-      }
29
-    }).then((data) => {
30
-      setList(data.list || [])
28
+      },
29
+    }).then(data => {
30
+      setList(data.records || [])
31
 
31
 
32
       updateNews(buildingId ? undefined : value);
32
       updateNews(buildingId ? undefined : value);
33
     })
33
     })
41
     onChange(val)
41
     onChange(val)
42
   }
42
   }
43
 
43
 
44
+  console.log(value, typeof value)
44
   return (
45
   return (
45
     <div>
46
     <div>
46
       <div onClick={() => setVisible(true)}>{news.newsName}</div>
47
       <div onClick={() => setVisible(true)}>{news.newsName}</div>

+ 7
- 7
src/pages/carouselFigure/advertisingList.jsx 파일 보기

55
       align: 'center',
55
       align: 'center',
56
       render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
56
       render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
57
     },
57
     },
58
-    {
59
-      title: '发布位置',
60
-      dataIndex: 'showPosition',
61
-      key: 'showPosition',
62
-      align: 'center',
63
-      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
64
-    },
58
+    // {
59
+    //   title: '发布位置',
60
+    //   dataIndex: 'showPosition',
61
+    //   key: 'showPosition',
62
+    //   align: 'center',
63
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
64
+    // },
65
     {
65
     {
66
       title: '发布时间',
66
       title: '发布时间',
67
       dataIndex: 'createDate',
67
       dataIndex: 'createDate',

+ 2
- 2
src/pages/carouselFigure/editAdvertising.jsx 파일 보기

77
         value: data.buildingId,
77
         value: data.buildingId,
78
       },
78
       },
79
       {
79
       {
80
-        label: '商品图片',
80
+        label: '开屏广告',
81
         name: 'image',
81
         name: 'image',
82
         type: FieldTypes.ImageUploader,
82
         type: FieldTypes.ImageUploader,
83
         value: data.image,
83
         value: data.image,
84
-        help: '建议图片尺寸:640px*960px',
84
+        help: '建议图片尺寸:640*960px,比例2:3,格式:jpg,用于开屏广告',
85
       },
85
       },
86
       {
86
       {
87
         label: '标题',
87
         label: '标题',

+ 7
- 3
src/pages/carouselFigure/editCarousel.jsx 파일 보기

28
   let helpVisible = false
28
   let helpVisible = false
29
   let groupVisible = false
29
   let groupVisible = false
30
   let buildingId = ''
30
   let buildingId = ''
31
+  let locationType = false
31
 
32
 
32
   const setExtraData = data => {
33
   const setExtraData = data => {
34
+    console.log(data, 'data');
33
     contentVisible = data.contentType === 'other';
35
     contentVisible = data.contentType === 'other';
34
     activityVisible = data.contentType === 'activity';
36
     activityVisible = data.contentType === 'activity';
35
     newsVisible = data.contentType === 'news';
37
     newsVisible = data.contentType === 'news';
36
     helpVisible = data.contentType === 'help';
38
     helpVisible = data.contentType === 'help';
37
     groupVisible = data.contentType === 'group';
39
     groupVisible = data.contentType === 'group';
38
-
40
+    
39
     buildingId = data.buildingId
41
     buildingId = data.buildingId
42
+    locationType = data.showPosition === 'mall';
43
+    console.log(locationType, 'locationType');
40
   }
44
   }
41
 
45
 
42
     
46
     
81
           value: data.buildingId,
85
           value: data.buildingId,
82
         },
86
         },
83
         {
87
         {
84
-          label: '商品图片',
88
+          label: locationType ? '积分商城轮播图' : '首页轮播图',
85
           name: 'image',
89
           name: 'image',
86
           type: FieldTypes.ImageUploader,
90
           type: FieldTypes.ImageUploader,
87
           value: data.image,
91
           value: data.image,
88
-          help: '建议图片尺寸:640px*330px',
92
+          help: locationType ? '建议图片尺寸:750*420px,比例16:9,格式:jpg,用于积分商城banner轮播':'建议图片尺寸:750*600px,比例5:4,格式:jpg,用于首页顶部banner轮播',
89
         },
93
         },
90
         {
94
         {
91
           label: '标题',
95
           label: '标题',

+ 0
- 6
src/pages/channel/channelList.jsx 파일 보기

72
     key: 'recommendCount',
72
     key: 'recommendCount',
73
     align: 'center',
73
     align: 'center',
74
   },
74
   },
75
-  {
76
-    title: '邀请经纪人',
77
-    dataIndex: 'inviteCount',
78
-    key: 'inviteCount',
79
-    align: 'center',
80
-  },
81
   {
75
   {
82
     title: '操作',
76
     title: '操作',
83
     dataIndex: '',
77
     dataIndex: '',

+ 18
- 13
src/pages/customer/customerlist/components/attribution.jsx 파일 보기

21
     super(props);
21
     super(props);
22
     this.state = {
22
     this.state = {
23
        dataSource: { records: [] },
23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25
     }
25
     }
26
   }
26
   }
27
 
27
 
28
   // 挂载之后
28
   // 挂载之后
29
   componentDidMount() {
29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
+    console.log(this.props.visibleData)
34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
36
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36
       this.setState({ visibleData: this.props.visibleData });
37
       this.setState({ visibleData: this.props.visibleData });
37
     }
38
     }
38
   }
39
   }
49
   }
50
   }
50
 
51
 
51
   getList(params) {
52
   getList(params) {
53
+    console.log('params: ', params)
54
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
55
+      return
56
+    }
52
     // 网路请求
57
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
58
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54
       this.setState({ dataSource: res })
59
       this.setState({ dataSource: res })
55
     }).catch(err => {
60
     }).catch(err => {
56
       // eslint-disable-next-line no-unused-expressions
61
       // eslint-disable-next-line no-unused-expressions
68
 
73
 
69
    // 分页
74
    // 分页
70
   onChange(pageNum) {
75
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
76
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72
   }
77
   }
73
 
78
 
74
   // 提交
79
   // 提交
75
   submitGm(record) {
80
   submitGm(record) {
76
     // 网路请求
81
     // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
82
+    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.userId } }).then(res => {
78
       // eslint-disable-next-line no-unused-expressions
83
       // eslint-disable-next-line no-unused-expressions
79
       this.openNotificationWithIcon('success', '操作成功')
84
       this.openNotificationWithIcon('success', '操作成功')
80
       this.handleCancel()
85
       this.handleCancel()
88
     const columns = [
93
     const columns = [
89
       // {
94
       // {
90
       //   title: '编号',
95
       //   title: '编号',
91
-      //   dataIndex: 'personId',
92
-      //   key: 'personId',
96
+      //   dataIndex: 'userId',
97
+      //   key: 'userId',
93
       // },
98
       // },
94
       {
99
       {
95
         title: '姓名',
100
         title: '姓名',
96
-        dataIndex: 'name',
97
-        key: 'name',
101
+        dataIndex: 'userName',
102
+        key: 'userName',
98
       },
103
       },
99
       {
104
       {
100
         title: '电话',
105
         title: '电话',
108
       },
113
       },
109
       {
114
       {
110
         title: '岗位',
115
         title: '岗位',
111
-        dataIndex: 'post',
112
-        key: 'post',
116
+        dataIndex: 'position',
117
+        key: 'position',
113
       },
118
       },
114
       {
119
       {
115
         title: '操作',
120
         title: '操作',
116
         dataIndex: 'personId',
121
         dataIndex: 'personId',
117
         key: 'personId',
122
         key: 'personId',
118
         // eslint-disable-next-line no-nested-ternary
123
         // eslint-disable-next-line no-nested-ternary
119
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
124
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant != record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
120
       },
125
       },
121
     ]
126
     ]
122
     return (
127
     return (

+ 145
- 0
src/pages/customer/customerlist/components/recommend.jsx 파일 보기

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 ModalRecommendRecord extends React.Component {
20
+  constructor(props) {
21
+    super(props);
22
+    this.state = {
23
+       dataSource: [],
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
+    // console.log('this.props.visibleData', this.props.visibleData)
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: '' } })
45
+  }
46
+
47
+  // 弹框取消按钮
48
+  handleCancel() {
49
+    this.setState({ visibleData: { visible: false, customerId: '' } })
50
+  }
51
+
52
+  openNotificationWithIcon = (type, message) => {
53
+    notification[type]({
54
+      message,
55
+      description:
56
+        '',
57
+    });
58
+  }
59
+
60
+  getList(params) {
61
+    const { customerId } = this.state.visibleData
62
+    if (customerId === '' || customerId === undefined) {
63
+      return
64
+    }
65
+    console.log('customerId', customerId)
66
+    // 网路请求
67
+    // 网路请求
68
+    request({ ...apis.customer.recommendClient, urlData: { id: customerId }, params: { ...params } }).then(res => {
69
+      this.setState({ dataSource: res })
70
+    }).catch(err => {
71
+      this.openNotificationWithIcon('error', err)
72
+    })
73
+  }
74
+
75
+   // 分页
76
+  onChange(pageNum) {
77
+    this.getList({ pageNumber: pageNum, pageSize: 5 })
78
+  }
79
+
80
+  render() {
81
+    const columns = [
82
+      {
83
+        title: '头像',
84
+        // eslint-disable-next-line jsx-a11y/alt-text
85
+        render: (text, records) => <img src={records.picture} width={50} height={50} />,
86
+      },
87
+      {
88
+        title: '用户名',
89
+        dataIndex: 'name',
90
+        key: 'name',
91
+      },
92
+      {
93
+        title: '电话',
94
+        dataIndex: 'phone',
95
+        key: 'phone',
96
+      },
97
+      {
98
+        title: '性别',
99
+        dataIndex: 'sex',
100
+        key: 'sex',
101
+        render: (text, records) => <span>{records.sex === 1 ? '男' : '女'}</span>,
102
+      },
103
+      {
104
+        title: '意向项目',
105
+        dataIndex: 'intention',
106
+        key: 'intention',
107
+      },
108
+      {
109
+        title: '推荐时间',
110
+        dataIndex: 'createDate',
111
+        key: 'createDate',
112
+        render: (_, record) => <><span>{ record.createDate && moment(record.createDate).format('YYYY-MM-DD') }</span></>,
113
+      },
114
+      {
115
+        title: '状态',
116
+        // eslint-disable-next-line consistent-return
117
+        render: (text, records) => {
118
+          if (records.status === 1) { return '报备' }
119
+          if (records.status === 2) { return '到访' }
120
+          if (records.status === 3) { return '认筹' }
121
+          if (records.status === 4) { return '签约' }
122
+          // reportRecommendStatus
123
+        },
124
+      },
125
+    ]
126
+    return (
127
+      <>
128
+        <Modal
129
+            title="推荐客户"
130
+            width={800}
131
+            destroyOnClose="true"
132
+            footer={null}
133
+            visible={this.state.visibleData.visible}
134
+            // onOk={() => this.handleOk()}
135
+            onCancel={(e) => this.handleCancel(e)}
136
+          >
137
+            {console.log('this.state.dataSource', this.state.dataSource)}
138
+            <Table dataSource={this.state.dataSource.records} rowKey="integralrecord" columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
139
+          </Modal>
140
+      </>
141
+    );
142
+  }
143
+}
144
+
145
+export default ModalRecommendRecord

+ 88
- 32
src/pages/customer/customerlist/customerDetail.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Table } from 'antd';
2
+import { Form, Table, Pagination } from 'antd';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
 import styles from './style.less';
4
 import styles from './style.less';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
16
    */
16
    */
17
   // eslint-disable-next-line react-hooks/rules-of-hooks
17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18
   const [data, setData] = useState([{ visitRecords: [] }])
18
   const [data, setData] = useState([{ visitRecords: [] }])
19
+  const [dataConsultant, setDataonsultant] = useState({})
20
+  const [intentionData, setIntentionData] = useState([])
19
 
21
 
20
   // eslint-disable-next-line react-hooks/rules-of-hooks
22
   // eslint-disable-next-line react-hooks/rules-of-hooks
21
   useEffect(() => {
23
   useEffect(() => {
31
 
33
 
32
     request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
34
     request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
33
       setData(res)
35
       setData(res)
36
+      setDataonsultant(res.geoInfo)
34
     })
37
     })
35
   }
38
   }
36
-
39
+// 分页
40
+  const changePageNum = pageNumber => {
41
+    // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
42
+  }
37
   const columns = [
43
   const columns = [
38
     {
44
     {
39
       title: '访问事件',
45
       title: '访问事件',
56
       render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
62
       render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
57
     },
63
     },
58
   ]
64
   ]
65
+  // 意向
66
+  const intention = [
67
+    {
68
+      title: 'Name',
69
+      dataIndex: 'name',
70
+      width: 150,
71
+      render: (_, record) => <span>香颂半岛</span>,
72
+    },
73
+    {
74
+      title: 'Address',
75
+      dataIndex: 'address',
76
+      render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
77
+    },
78
+  ];
79
+
80
+for (let i = 0; i < 100; i++) {
81
+  intentionData.push({
82
+    key: i,
83
+    name: `Edward King ${i}`,
84
+    age: 32,
85
+    address: `London, Park Lane no. ${i}`,
86
+  });
87
+}
59
   return (
88
   return (
60
     <>
89
     <>
61
       <div className={styles.cardBox}>
90
       <div className={styles.cardBox}>
62
-        <div className={styles.leftBox}>
63
-          <p className={styles.tit}>置业顾问信息</p>
64
-          <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
65
-          <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
66
-          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p>
67
-          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
91
+     {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
92
+        <div className={styles.rightBox}>
93
+          <p className={styles.tit}>客户信息</p>
94
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
95
+          <div className={styles.right}>
96
+            <p className={styles.rightItem}>用户名称:{ data.name }</p>
97
+            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
98
+            <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
99
+          </div>
100
+          <div className={styles.Centered}>
101
+          <p>访问时长:{ data.duration }秒</p>
102
+          <p>访问次数:{ data.visitTimes }</p>
103
+          <p className={styles.rightItem}>客户描述:{ data.describe }</p>
104
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
105
+          </div>
106
+          <div className={styles.rightCentered}>
107
+          <p >需求类型:{ data.demandType }</p>
108
+          <p >价格区间:{data.priceRange }</p>
109
+          <p >物业类型:{ data.realtyManageType }</p>
110
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
111
+          </div>
112
+          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
113
+          <div className={styles.rightInfo}>
114
+            <p className={styles.rightItem}>国家:{ dataConsultant&&dataConsultant.country }</p>
115
+            <p className={styles.rightItem}>省份:{ dataConsultant&&dataConsultant.provience }</p>
116
+            <p className={styles.rightItem}>城市:{dataConsultant&&dataConsultant.city }</p>
117
+            <p className={styles.rightItem}>来访渠道:活动分享</p>
118
+            {/* <p className={styles.rightItem}>详细信息:</p> */}
119
+            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
120
+            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
121
+          </div>
122
+        </div>
123
+        
124
+      </div>
125
+      <br></br>
126
+      <div className={styles.cardBox}>
127
+        <div className={styles.rightBoxCentre}>
128
+        <p className={styles.tit}>置业顾问信息</p>
129
+          <img className={styles.touxiang} src={ data.picture && data.picture } />
130
+          <p className={styles.infoItem}>曹玉文</p>
131
+          <div className={styles.right}>
132
+          {/* <p className={styles.infoItem}>姓名:{ data.consultant && data.consultant.name }</p>
133
+          <p className={styles.infoItem}>部门:{ data.consultant && data.consultant.department }</p> */}
68
           <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
134
           <p className={styles.infoItem}>号码:{ data.consultant && data.consultant.phone } </p>
135
+          <p className={styles.infoItem}>岗位:{ data.consultant && data.consultant.post }</p>
136
+          </div>
137
+          <div className={styles.left}>
69
           <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
138
           <p className={styles.infoItem}>公司:{ data.consultant && data.consultant.company } </p>
70
           <p className={styles.infoItem}>
139
           <p className={styles.infoItem}>
71
             所属项目:
140
             所属项目:
73
               data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
142
               data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
74
             }
143
             }
75
           </p>
144
           </p>
145
+          </div>
76
         </div>
146
         </div>
77
-        <div className={styles.rightBox}>
78
-          <p className={styles.tit}>客户信息</p>
79
-          <img className={styles.touxiang} src={ data.picture && data.picture } />
80
-          <div className={styles.right}>
81
-            <p className={styles.rightItem}>用户名称:{ data.name }</p>
82
-            <p className={styles.rightItem}>手机号码:{ data.phone }</p>
83
-            <p className={styles.rightItem}>来访渠道:活动分享</p>
147
+        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
148
+        <div className={styles.leftBoxCentre}>
149
+          <div className={styles.tit}>
150
+                <span>项目名称</span>
151
+                <span style={{ marginLeft: '47%' }}>项目名称</span>
84
           </div>
152
           </div>
85
-          <p className={styles.rightItem}>访问时长:{ data.duration }秒</p>
86
-          <p className={styles.rightItem}>访问次数:{ data.visitTimes }</p>
87
-          <p className={styles.rightItem}>预约人数:{ data.visiteNum }</p>
88
-          <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
89
-          <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
90
-          <div className={styles.rightInfo}>
91
-            <p className={styles.rightItem}>国家:{ data.country }</p>
92
-            <p className={styles.rightItem}>省份:{ data.province }</p>
93
-            <p className={styles.rightItem}>城市:{data.city }</p>
94
-            <p className={styles.rightItem}>详细信息:</p>
95
-            <p className={styles.rightItem}>意向项目:{data.intention }</p>
96
-            <p className={styles.rightItem}>价格区间:{data.priceRange }</p>
97
-            <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p>
98
-            <p className={styles.rightItem}>客户描述:{ data.describe }</p>
99
-            <p className={styles.rightItem}>需求类型:{ data.demandType }</p>
100
-            <p className={styles.rightItem}>物业类型:{ data.realtyManageType }</p>
153
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
154
+          <div className={styles.infoItem}>
155
+          <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
101
           </div>
156
           </div>
102
         </div>
157
         </div>
158
+
103
       </div>
159
       </div>
104
       <div className={styles.recordBox}>
160
       <div className={styles.recordBox}>
105
         <p className={styles.tableName}>访问记录</p>
161
         <p className={styles.tableName}>访问记录</p>
106
-        <Table dataSource={data.visitRecords} columns={columns} pagination={false} rowKey="customerDetail" />
162
+        <Table showQuickJumper defaultCurrent={1} dataSource={data.visitRecords} columns={columns} current={50} />
107
       </div>
163
       </div>
108
 
164
 
109
     </>
165
     </>

+ 85
- 15
src/pages/customer/customerlist/index.jsx 파일 보기

8
 
8
 
9
 import Attribution from './components/attribution'
9
 import Attribution from './components/attribution'
10
 import IntegralRecord from './components/integralRecord'
10
 import IntegralRecord from './components/integralRecord'
11
+import ModalRecommendRecord from './components/recommend'
11
 import ChangeStatus from './components/changeStatus'
12
 import ChangeStatus from './components/changeStatus'
12
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
13
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
13
 import AuthButton from '@/components/AuthButton';
14
 import AuthButton from '@/components/AuthButton';
37
 
38
 
38
   // 调整归属 ============  start
39
   // 调整归属 ============  start
39
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
41
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
41
   // 调整归属 ============= end
42
   // 调整归属 ============= end
42
 
43
 
43
   // 积分记录 ============  start
44
   // 积分记录 ============  start
50
   const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
51
   const [statusVisibleData, setStatusVisibleData] = useState({ visible: false, customerId: '', status: '' })
51
   // 变更状态 ============= end
52
   // 变更状态 ============= end
52
 
53
 
54
+  // 推荐客户
55
+  const [recommendVisibleData, setRecommendVisibleData] = useState({ visible: false, customerId: '' })
56
+
53
   // eslint-disable-next-line react-hooks/rules-of-hooks
57
   // eslint-disable-next-line react-hooks/rules-of-hooks
54
   useEffect(() => {
58
   useEffect(() => {
55
     getList({ pageNumber: 1, pageSize: 10, customerType })
59
     getList({ pageNumber: 1, pageSize: 10, customerType })
76
     setRecordVisibleData({ visible: false, customerId: '' })
80
     setRecordVisibleData({ visible: false, customerId: '' })
77
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
81
     setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
78
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
82
     setStatusVisibleData({ visible: false, customerId: '', status: '' })
83
+    setRecommendVisibleData({ visible: false, customerId: '' })
79
   }
84
   }
80
 
85
 
81
   // 提交事件
86
   // 提交事件
123
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
128
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
124
 
129
 
125
   function showGM(record) {
130
   function showGM(record) {
126
-    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
131
+    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
127
     setRecordVisibleData({ visible: false, customerId: '' })
132
     setRecordVisibleData({ visible: false, customerId: '' })
128
     setStatusVisibleData({ visible: false, customerId: '' })
133
     setStatusVisibleData({ visible: false, customerId: '' })
134
+    setRecommendVisibleData({ visible: false, customerId: '' })
129
   }
135
   }
130
 
136
 
131
   function showRecord(record) {
137
   function showRecord(record) {
132
     setRecordVisibleData({ visible: true, customerId: record.customerId })
138
     setRecordVisibleData({ visible: true, customerId: record.customerId })
133
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
139
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
134
     setStatusVisibleData({ visible: false, customerId: '' })
140
     setStatusVisibleData({ visible: false, customerId: '' })
141
+    setRecommendVisibleData({ visible: false, customerId: '' })
135
   }
142
   }
136
 
143
 
137
   function showStatus(record) {
144
   function showStatus(record) {
138
     setRecordVisibleData({ visible: false, customerId: '' })
145
     setRecordVisibleData({ visible: false, customerId: '' })
139
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
146
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
147
+    setRecommendVisibleData({ visible: false, customerId: '' })
140
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
148
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
141
   }
149
   }
150
+
151
+  // 推荐客户
152
+  function showRecommend(personId) {
153
+    setRecordVisibleData({ visible: false, customerId: '' })
154
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
155
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
156
+    setRecommendVisibleData({ visible: true, customerId: personId })
157
+  }
142
   function toCustomerDateil(record) {
158
   function toCustomerDateil(record) {
143
     router.push({
159
     router.push({
144
       pathname: '/customer/customerlist/customerDetail',
160
       pathname: '/customer/customerlist/customerDetail',
147
       },
163
       },
148
     });
164
     });
149
   }
165
   }
166
+  // 私客详情
167
+  function publicCustomerDetail(record) {
168
+    router.push({
169
+      pathname: '/customer/customerlist/publicCustomerDetail',
170
+      query: {
171
+        id: record.customerId,
172
+      },
173
+    });
174
+  }
150
 
175
 
151
   function exportCustomer () {
176
   function exportCustomer () {
152
     const fieldsValue = getFieldsValue()
177
     const fieldsValue = getFieldsValue()
173
 
198
 
174
   // 关闭调整归属的窗口
199
   // 关闭调整归属的窗口
175
   function closeAttribution() {
200
   function closeAttribution() {
176
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
201
+    alert(1)
202
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
177
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
203
     getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178
   }
204
   }
205
+  // 回调关闭所有弹框
206
+  function closeAll() {
207
+    alert(1)
208
+    setRecordVisibleData({ visible: false, customerId: '' })
209
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
210
+    setStatusVisibleData({ visible: false, customerId: '', status: '' })
211
+    setRecommendVisibleData({ visible: false, customerId: '' })
212
+  }
179
 
213
 
180
   const publicColumns = [
214
   const publicColumns = [
181
     {
215
     {
202
       align: 'center',
236
       align: 'center',
203
       width: '15%',
237
       width: '15%',
204
     },
238
     },
205
-    // {
206
-    //   title: '推广人员',
207
-    //   dataIndex: 'sharePersonName',
208
-    //   key: 'sharePersonName',
209
-    //   align: 'center',
210
-    //   width: '15%',
211
-    // },
239
+    {
240
+      title: '推广人员',
241
+      dataIndex: 'sharePersonName',
242
+      key: 'sharePersonName',
243
+      align: 'center',
244
+      width: '15%',
245
+    },
246
+    {
247
+      title: '性别',
248
+      dataIndex: 'sex',
249
+      key: 'sex',
250
+      align: 'center',
251
+      width: '10%',
252
+      // eslint-disable-next-line no-nested-ternary
253
+      render: (_, record) => <><span>{record.sex === 1 ? '男' : record.sex === 2 ? '女' : '未知'}</span></>,
254
+    },
255
+    {
256
+      title: '操作',
257
+      dataIndex: 'customerId',
258
+      key: 'customerId',
259
+      align: 'center',
260
+      width: '25%',
261
+      // eslint-disable-next-line no-nested-ternary
262
+      render: (_, record) => (
263
+        <>
264
+          <AuthButton>
265
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => publicCustomerDetail(record)}>查看详情</Button>
266
+          </AuthButton>
267
+          &nbsp;&nbsp;
268
+          <AuthButton>
269
+            <Button className={customerType === 'private' ? Styles.displayS : Styles.text } type="link" onClick={() => showRecommend(record.personId)}>推荐客户</Button>
270
+          </AuthButton>
271
+        </>
272
+      ),
273
+    },
212
   ]
274
   ]
213
 
275
 
214
   const privateColumns = [
276
   const privateColumns = [
290
       // eslint-disable-next-line no-nested-ternary
352
       // eslint-disable-next-line no-nested-ternary
291
       render: (_, record) => (
353
       render: (_, record) => (
292
         <>
354
         <>
355
+            &nbsp;
293
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
356
           <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
294
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
357
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showStatus(record)}>变更状态</Button>
295
             &nbsp;&nbsp;
358
             &nbsp;&nbsp;
296
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
359
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showGM(record)}>调整归属</Button>
297
           </AuthButton>
360
           </AuthButton>
298
-            <br />
361
+            &nbsp;&nbsp;
299
           <AuthButton name="admin.customer.recommend.get" noRight={null}>
362
           <AuthButton name="admin.customer.recommend.get" noRight={null}>
300
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
363
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => toCustomerDateil(record)}>查看详情</Button>
301
           </AuthButton>
364
           </AuthButton>
303
           <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
366
           <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
304
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
367
             <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecord(record)}>积分记录</Button>
305
           </AuthButton>
368
           </AuthButton>
369
+            &nbsp;
370
+          <AuthButton name="admin.mine.taPointsRecords.id.get" noRight={null}>
371
+            <Button className={customerType === 'private' ? Styles.text : Styles.displayS} type="link" onClick={() => showRecommend(record.customerId)}>推荐客户</Button>
372
+          </AuthButton>
306
         </>
373
         </>
307
       ),
374
       ),
308
     },
375
     },
383
       <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
450
       <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
384
 
451
 
385
       {/* 积分记录 */}
452
       {/* 积分记录 */}
386
-      <IntegralRecord visibleData={recordVisibleData} />
453
+      <IntegralRecord visibleData={recordVisibleData} onCancel={() => closeAll()} />
387
 
454
 
388
       {/* 变更状态 */}
455
       {/* 变更状态 */}
389
-      <ChangeStatus visibleData={statusVisibleData} />
456
+      <ChangeStatus visibleData={statusVisibleData} onCancel={() => closeAll()}/>
457
+
458
+      {/* 推荐客户 */}
459
+      <ModalRecommendRecord visibleData={recommendVisibleData} onCancel={() => closeAll()}/>
390
     </>
460
     </>
391
   );
461
   );
392
 }
462
 }

+ 137
- 0
src/pages/customer/customerlist/publicCustomerDetail.jsx 파일 보기

1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Table, Pagination } from 'antd';
3
+import { FormattedMessage } from 'umi-plugin-react/locale';
4
+import publicStyle from './publicStyle.less';
5
+import apis from '../../../services/apis';
6
+import request from '../../../utils/request';
7
+import moment from 'moment';
8
+
9
+import router from 'umi/router';
10
+
11
+
12
+function header(props) {
13
+  /**
14
+   * @param {*} props
15
+   * @returns
16
+   */
17
+  // eslint-disable-next-line react-hooks/rules-of-hooks
18
+  const [data, setData] = useState([{ visitRecords: [] }])
19
+  const [dataConsultant, setDataonsultant] = useState({})
20
+  const [intentionData, setIntentionData] = useState([])
21
+
22
+  // eslint-disable-next-line react-hooks/rules-of-hooks
23
+  useEffect(() => {
24
+    getById()
25
+  }, [])
26
+
27
+  // 查询
28
+  function getById(params) {
29
+    const { id } = props.location.query;
30
+    if (id === '' || id === undefined) {
31
+      return
32
+    }
33
+
34
+    request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
35
+      setData(res)
36
+      setDataonsultant(res.geoInfo)
37
+    })
38
+  }
39
+// 分页
40
+  const changePageNum = pageNumber => {
41
+    // getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
42
+  }
43
+  const columns = [
44
+    {
45
+      title: '访问事件',
46
+      dataIndex: 'activity',
47
+      key: 'activity',
48
+      align: 'center',
49
+    },
50
+    {
51
+      title: '访问时间',
52
+      dataIndex: 'visitTime',
53
+      key: 'visitTime',
54
+      align: 'center',
55
+
56
+    },
57
+    {
58
+      title: '停留时间',
59
+      dataIndex: 'visitDuration',
60
+      key: 'visitDuration',
61
+      align: 'center',
62
+      render: (_, record) => <span>{record.visitDuration === null ? 0 : record.visitDuration }秒</span>,
63
+    },
64
+  ]
65
+  // 意向
66
+  const intention = [
67
+    {
68
+      title: 'Name',
69
+      dataIndex: 'name',
70
+      width: 150,
71
+      render: (_, record) => <span>香颂半岛</span>,
72
+    },
73
+    {
74
+      title: 'Address',
75
+      dataIndex: 'address',
76
+      render: (_, record) => <span style={{ marginLeft: '55%' }}>22</span>,
77
+    },
78
+  ];
79
+
80
+for (let i = 0; i < 1; i++ ) {
81
+  intentionData.push({
82
+    key: i,
83
+    name: `Edward King ${i}`,
84
+    age: 32,
85
+    address: `London, Park Lane no. ${i}`,
86
+  });
87
+}
88
+  return (
89
+    <>
90
+      <div className={publicStyle.cardBox}>
91
+     {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
92
+        <div className={publicStyle.rightBox}>
93
+          <p className={publicStyle.tit}>客户信息</p>
94
+          <img className={publicStyle.touxiang} src={ data.picture && data.picture } />
95
+          <div className={publicStyle.right}>
96
+            <p className={publicStyle.rightItem}>用户名称:{ data.name }</p>
97
+            <p className={publicStyle.rightItem}>手机号码:{ data.phone }</p>
98
+            <p className={publicStyle.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
99
+          </div>
100
+          <div className={publicStyle.Centered}>
101
+          <p>访问时长:{ data.duration }秒</p>
102
+          <p>访问次数:{ data.visitTimes }</p>
103
+          <p className={publicStyle.rightItem}>来访渠道:活动分享</p>
104
+          {/* <p>预约人数:{ data.visiteNum }</p> */}
105
+          </div>
106
+          {/* <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p> */}
107
+          <div className={publicStyle.rightInfo}>
108
+            <p className={publicStyle.rightItem}>国家:{ dataConsultant && dataConsultant.country }</p>
109
+            <p className={publicStyle.rightItem}>省份:{ dataConsultant && dataConsultant.provience }</p>
110
+            <p className={publicStyle.rightItem}>城市:{dataConsultant && dataConsultant.city }</p>
111
+            {/* <p className={styles.rightItem}>详细信息:</p> */}
112
+            {/* <p className={styles.rightItem}>意向项目:{data.intention }</p> */} 
113
+            {/* <p className={styles.rightItem}>客户说明:{ data.verifyRemark }</p> */}
114
+          </div>
115
+        </div>
116
+        {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
117
+        <div className={publicStyle.leftBoxCentre}>
118
+          <div className={publicStyle.tit}>
119
+                <span>项目名称</span>
120
+                <span style={{ marginLeft: '47%' }}>项目名称</span>
121
+          </div>
122
+          {/* <img className={styles.touxiang} src={ data.picture && data.picture } /> */}
123
+          <div className={publicStyle.infoItem}>
124
+          <Table columnWidth={10} showHeader={false} columns={intention} dataSource={intentionData} pagination={{ pageSize: 50 }} scroll={{ y: 240 }}/>,
125
+          </div>
126
+        </div>
127
+      </div>
128
+      <div className={publicStyle.recordBox}>
129
+        <p className={publicStyle.tableName}>访问记录</p>
130
+        <Table dataSource={data.visitRecords} columns={columns} rowKey="customerDetail" onChange={changePageNum} showQuickJumper/>
131
+      </div>
132
+    </>
133
+  )
134
+}
135
+const WrappedHeader = Form.create({ name: 'header' })(header);
136
+
137
+export default WrappedHeader

+ 209
- 0
src/pages/customer/customerlist/publicStyle.less 파일 보기

1
+.SubmitButton {
2
+  background: rgba(239,39,58,1);
3
+  border-radius: 7px;
4
+  border: 0px;
5
+}
6
+.text {
7
+  color: rgba(239,39,58,1);
8
+}
9
+.SelectFrom {
10
+  width: 180px;
11
+  background: #ffffff;
12
+  border-radius: 7px;
13
+  border: 1px solid #dbdbdb;
14
+}
15
+.addButton {
16
+  background: #50be00;
17
+  border-radius: 4px;
18
+  border: 0px;
19
+  margin: 10px 0px;
20
+}
21
+.cardText {
22
+  color: #333;
23
+  display: flex;
24
+  align-items: center;
25
+  position: relative;
26
+  line-height: 1.5;
27
+  font-size: 0.106rem;
28
+  margin-bottom: 0.08rem;
29
+
30
+}
31
+.cardItem{
32
+  color: #666;
33
+  display: flex;
34
+  align-items: center; 
35
+  line-height: 1.5;
36
+  font-size: 0.106rem;
37
+  margin-bottom: 0.08rem; 
38
+}
39
+.ediText {
40
+  font-size: 0.106rem;
41
+  color: #ff925c;
42
+  line-height: 24px;
43
+  position: absolute;
44
+  right: 0;
45
+}
46
+.title{
47
+  display: inline-block;
48
+  width:  0.54rem;
49
+  justify-content: space-between;
50
+  text-align: justify;
51
+  text-align-last:justify
52
+}
53
+
54
+.address { 
55
+  width: 400px;
56
+  height: 24px; 
57
+  text-overflow: ellipsis; 
58
+  white-space: nowrap;
59
+  overflow: hidden;
60
+}
61
+
62
+.pitchButton { 
63
+  border-color: rgba(255,126,72,1);
64
+  background-color: rgba(255,126,72,1);
65
+  color: rgba(255,255,255,1); 
66
+}
67
+.noButton {
68
+  border-color: rgba(255,126,72,1);
69
+  color: rgba(255,126,72,1);
70
+}
71
+.displayS {
72
+  display: none;
73
+}
74
+
75
+
76
+// 客户详情样式
77
+.cardBox{
78
+  display: flex;
79
+  .leftBox{
80
+    width:90%;
81
+    min-width:28.5%;
82
+    height:315px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:865px;
93
+    min-width:342px;
94
+    height:290px;
95
+    background:rgba(255,255,255,1);
96
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97
+    border-radius:8px;
98
+    display: inline-block;
99
+    margin-right: 30px;
100
+    padding: 30px;
101
+    overflow: hidden;
102
+  }
103
+  .rightBox{
104
+    width:-webkit-fill-available;
105
+    height:315px;
106
+    min-width: 70%;
107
+    background:rgba(255,255,255,1);
108
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
109
+    border-radius:8px;
110
+    display: inline-block;
111
+    padding: 30px;
112
+    overflow: hidden;
113
+    position: relative;
114
+  }
115
+  .rightBoxCentre{
116
+    width:865px;
117
+    height:315px;
118
+    min-width: 60%;
119
+    background:rgba(255,255,255,1);
120
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
121
+    border-radius:8px;
122
+    display: inline-block;
123
+    padding: 30px;
124
+    overflow: hidden;
125
+    position: relative;
126
+  }
127
+  .leftBoxCentre{
128
+    width:100%;
129
+    height:315px;
130
+    background:rgba(255,255,255,1);
131
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
132
+    border-radius:8px;
133
+    display: inline-block;
134
+    padding: 30px;
135
+    overflow: hidden;
136
+    position: relative;
137
+  }
138
+  .tit{
139
+    font-size:24px;
140
+    font-weight:600;
141
+    color:#222;
142
+    margin: 10px 0 0 0;
143
+  }
144
+  .touxiang{
145
+    width: 120px;
146
+    width: 120px;
147
+    border-radius: 6px;
148
+    margin: 30px 0 20px 0;
149
+  }
150
+  .infoItem{
151
+    color:#666;
152
+    font-size: 19px;
153
+    margin: 0 0 10px 0;
154
+    
155
+  }
156
+  .rightItem{
157
+    color:#666;
158
+    font-size: 19px;
159
+    margin: 0 0 15px 0;
160
+  }
161
+  .right{
162
+    position: absolute;
163
+    top:108px;
164
+    left:170px;
165
+  }
166
+  .left{
167
+    position: absolute;
168
+    top:108px;
169
+    left:60%;
170
+  }
171
+  .rightInfo{
172
+    position: absolute;
173
+    top:108px;
174
+    left:80%;
175
+  }
176
+
177
+  .Centered{
178
+    position: absolute;
179
+    top:108px;
180
+    left:40%;
181
+    margin: 0 0 15px 0;
182
+    color:#666;
183
+    font-size: 19px;
184
+  }
185
+
186
+  .rightCentered{
187
+    position: absolute;
188
+    top:108px;
189
+    left:55%;
190
+    margin: 0 0 15px 0;
191
+    color:#666;
192
+    font-size: 19px;
193
+  }
194
+  
195
+}
196
+.recordBox{
197
+  width:100%;
198
+  background:rgba(255,255,255,1);
199
+  box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
200
+  border-radius:8px;
201
+  margin-top: 30px;
202
+  padding: 30px;
203
+  .tableName{
204
+    font-size:24px;
205
+    font-weight:600;
206
+    color:#222;
207
+  }
208
+}
209
+

+ 64
- 6
src/pages/customer/customerlist/style.less 파일 보기

77
 .cardBox{
77
 .cardBox{
78
   display: flex;
78
   display: flex;
79
   .leftBox{
79
   .leftBox{
80
-    width:342px;
80
+    width:1000px;
81
     min-width:342px;
81
     min-width:342px;
82
-    height:511px;
82
+    height:1000px;
83
+    background:rgba(255,255,255,1);
84
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
+    border-radius:8px;
86
+    display: inline-block;
87
+    margin-right: 30px;
88
+    padding: 30px;
89
+    overflow: hidden;
90
+  }
91
+  .rightBox{
92
+    width:865px;
93
+    min-width:342px;
94
+    height:290px;
83
     background:rgba(255,255,255,1);
95
     background:rgba(255,255,255,1);
84
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
96
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
85
     border-radius:8px;
97
     border-radius:8px;
90
   }
102
   }
91
   .rightBox{
103
   .rightBox{
92
     width:-webkit-fill-available;
104
     width:-webkit-fill-available;
93
-    height:511px;
94
-    min-width: 800px;
105
+    height:315px;
106
+    min-width: 100%;
107
+    background:rgba(255,255,255,1);
108
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
109
+    border-radius:8px;
110
+    display: inline-block;
111
+    padding: 30px;
112
+    overflow: hidden;
113
+    position: relative;
114
+  }
115
+  .rightBoxCentre{
116
+    width:865px;
117
+    height:315px;
118
+    min-width: 60%;
119
+    background:rgba(255,255,255,1);
120
+    box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
121
+    border-radius:8px;
122
+    display: inline-block;
123
+    padding: 30px;
124
+    overflow: hidden;
125
+    position: relative;
126
+  }
127
+  .leftBoxCentre{
128
+    width:100%;
129
+    height:315px;
95
     background:rgba(255,255,255,1);
130
     background:rgba(255,255,255,1);
96
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
131
     box-shadow:0px 0px 16px 2px rgba(0,0,0,0.12);
97
     border-radius:8px;
132
     border-radius:8px;
128
     top:108px;
163
     top:108px;
129
     left:170px;
164
     left:170px;
130
   }
165
   }
166
+  .left{
167
+    position: absolute;
168
+    top:108px;
169
+    left:60%;
170
+  }
131
   .rightInfo{
171
   .rightInfo{
132
     position: absolute;
172
     position: absolute;
133
-    top:50px;
134
-    left:50%;
173
+    top:108px;
174
+    left:80%;
175
+  }
176
+
177
+  .Centered{
178
+    position: absolute;
179
+    top:108px;
180
+    left:30%;
181
+    margin: 0 0 15px 0;
182
+    color:#666;
183
+    font-size: 19px;
184
+  }
185
+
186
+  .rightCentered{
187
+    position: absolute;
188
+    top:108px;
189
+    left:55%;
190
+    margin: 0 0 15px 0;
191
+    color:#666;
192
+    font-size: 19px;
135
   }
193
   }
136
   
194
   
137
 }
195
 }

+ 7
- 5
src/pages/customer/independentList/index.jsx 파일 보기

112
         title: '状态',
112
         title: '状态',
113
         // eslint-disable-next-line consistent-return
113
         // eslint-disable-next-line consistent-return
114
         render: (text, records) => {
114
         render: (text, records) => {
115
-          if (records.status === 1) { return '报备' }
115
+          console.log("retrun", records)
116
+          if (records.status === 1) { if(records.reportRecommendStatus === 1) {return '报备'} if(records.reportRecommendStatus === 2) {return '推荐'}  }
116
           if (records.status === 2) { return '到访' }
117
           if (records.status === 2) { return '到访' }
117
           if (records.status === 3) { return '认购' }
118
           if (records.status === 3) { return '认购' }
118
           if (records.status === 4) { return '签约' }
119
           if (records.status === 4) { return '签约' }
119
           if (records.verifyStatus === 1) { return '待审核' }
120
           if (records.verifyStatus === 1) { return '待审核' }
120
           if (records.verifyStatus === 2) { return '审核同意' }
121
           if (records.verifyStatus === 2) { return '审核同意' }
121
           if (records.verifyStatus === 3) { return '签约' }
122
           if (records.verifyStatus === 3) { return '签约' }
123
+          // reportRecommendStatus
122
         },
124
         },
123
       },
125
       },
124
     ]
126
     ]
210
       },
212
       },
211
       {
213
       {
212
         title: '用户姓名',
214
         title: '用户姓名',
213
-        dataIndex: 'name',
214
-        key: 'name',
215
+        dataIndex: 'nickname',
216
+        key: 'nickname',
215
         align: 'center',
217
         align: 'center',
216
         render: text => <a>{text}</a>,
218
         render: text => <a>{text}</a>,
217
       },
219
       },
218
       {
220
       {
219
         title: '电话',
221
         title: '电话',
220
-        dataIndex: 'tel',
221
-        key: 'tel',
222
+        dataIndex: 'phone',
223
+        key: 'phone',
222
         align: 'center',
224
         align: 'center',
223
       },
225
       },
224
       {
226
       {

+ 12
- 4
src/pages/customer/recommendCustomer/audit.jsx 파일 보기

38
   const { getFieldDecorator } = props.form
38
   const { getFieldDecorator } = props.form
39
 
39
 
40
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
   // eslint-disable-next-line react-hooks/rules-of-hooks
41
-  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
42
 
42
 
43
   // eslint-disable-next-line react-hooks/rules-of-hooks
43
   // eslint-disable-next-line react-hooks/rules-of-hooks
44
   const [dataSource, setDataSource] = useState({ picture: '' })
44
   const [dataSource, setDataSource] = useState({ picture: '' })
62
 
62
 
63
   function submitDate(params) {
63
   function submitDate(params) {
64
     // props.form.setFieldsValue(res)
64
     // props.form.setFieldsValue(res)
65
-    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus } }).then(() => {
65
+    request({ ...apis.customer.auto, urlData: { id: params.customerId || props.form.getFieldValue('customerId') }, params: { verifyStatus: params.verifyStatus, realtyConsultant: props.form.getFieldValue('realtyConsultant') } }).then(() => {
66
       // eslint-disable-next-line no-unused-expressions
66
       // eslint-disable-next-line no-unused-expressions
67
       openNotificationWithIcon('success', '操作成功')
67
       openNotificationWithIcon('success', '操作成功')
68
       router.go(-1)
68
       router.go(-1)
90
 
90
 
91
   // 显示选择置业顾问的窗口
91
   // 显示选择置业顾问的窗口
92
   function showConsultant() {
92
   function showConsultant() {
93
-    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant') })
93
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
94
   }
94
   }
95
 
95
 
96
   // 关闭选择置业顾问的窗口
96
   // 关闭选择置业顾问的窗口
97
   function closeConsultant() {
97
   function closeConsultant() {
98
-    setVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
98
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
99
   }
99
   }
100
 
100
 
101
   // 选择置业顾问弹窗
101
   // 选择置业顾问弹窗
102
   function consultantSuccess(e) {
102
   function consultantSuccess(e) {
103
+    console.log(e)
103
     props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
104
     props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
104
   }
105
   }
105
 
106
 
113
             />,
114
             />,
114
           )}
115
           )}
115
         </Form.Item>
116
         </Form.Item>
117
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
118
+          {getFieldDecorator('buildingId')(
119
+            <Input
120
+              placeholder="项目ID"
121
+            />,
122
+          )}
123
+        </Form.Item>
116
         <Form.Item label="归属人" style={{ display: 'none' }}>
124
         <Form.Item label="归属人" style={{ display: 'none' }}>
117
           {getFieldDecorator('realtyConsultant')(
125
           {getFieldDecorator('realtyConsultant')(
118
             <Input
126
             <Input

+ 30
- 20
src/pages/customer/recommendCustomer/components/attribution.jsx 파일 보기

21
     super(props);
21
     super(props);
22
     this.state = {
22
     this.state = {
23
        dataSource: { records: [] },
23
        dataSource: { records: [] },
24
-       visibleData: { visible: false, customerId: '', realtyConsultant: '' },
24
+       visibleData: { visible: false, customerId: '', realtyConsultant: '', buildingId: '' },
25
     }
25
     }
26
   }
26
   }
27
 
27
 
28
   // 挂载之后
28
   // 挂载之后
29
   componentDidMount() {
29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31
   }
31
   }
32
 
32
 
33
   componentDidUpdate(preProps, preState) {
33
   componentDidUpdate(preProps, preState) {
34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
34
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
35
-      this.getList({ pageNumber: 1, pageSize: 5 })
35
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
36
       this.setState({ visibleData: this.props.visibleData });
36
       this.setState({ visibleData: this.props.visibleData });
37
     }
37
     }
38
   }
38
   }
49
   }
49
   }
50
 
50
 
51
   getList(params) {
51
   getList(params) {
52
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
53
+      return
54
+    }
55
+
52
     // 网路请求
56
     // 网路请求
53
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
57
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
54
       this.setState({ dataSource: res })
58
       this.setState({ dataSource: res })
55
     }).catch(err => {
59
     }).catch(err => {
56
       // eslint-disable-next-line no-unused-expressions
60
       // eslint-disable-next-line no-unused-expressions
68
 
72
 
69
    // 分页
73
    // 分页
70
   onChange(pageNum) {
74
   onChange(pageNum) {
71
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
75
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
72
   }
76
   }
73
 
77
 
74
   // 提交
78
   // 提交
75
   submitGm(record) {
79
   submitGm(record) {
76
-    // 网路请求
77
-    request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
78
-      // eslint-disable-next-line no-unused-expressions
79
-      this.openNotificationWithIcon('success', '操作成功')
80
-      this.handleCancel()
81
-      this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
82
-    }).catch(err => {
83
-      // eslint-disable-next-line no-unused-expressions
84
-      // this.openNotificationWithIcon('error', err)
85
-    })
80
+
81
+    console.log('传递之前:', record)
82
+    this.handleCancel()
83
+    this.props.onSuccess({ realtyConsultant: record.userId, name: record.userName })
84
+
85
+
86
+    // // 网路请求
87
+    // request({ ...apis.customer.recommendEdit, urlData: { id: this.state.visibleData.customerId }, data: { customerId: this.state.visibleData.customerId, realtyConsultant: record.personId } }).then(res => {
88
+    //   // eslint-disable-next-line no-unused-expressions
89
+    //   this.openNotificationWithIcon('success', '操作成功')
90
+    //   this.handleCancel()
91
+    //   this.props.onSuccess({ realtyConsultant: record.personId, name: record.name })
92
+    // }).catch(err => {
93
+    //   // eslint-disable-next-line no-unused-expressions
94
+    //   // this.openNotificationWithIcon('error', err)
95
+    // })
86
   }
96
   }
87
 
97
 
88
   render() {
98
   render() {
94
       // },
104
       // },
95
       {
105
       {
96
         title: '姓名',
106
         title: '姓名',
97
-        dataIndex: 'name',
98
-        key: 'name',
107
+        dataIndex: 'userName',
108
+        key: 'userName',
99
       },
109
       },
100
       {
110
       {
101
         title: '电话',
111
         title: '电话',
109
       },
119
       },
110
       {
120
       {
111
         title: '岗位',
121
         title: '岗位',
112
-        dataIndex: 'post',
113
-        key: 'post',
122
+        dataIndex: 'position',
123
+        key: 'position',
114
       },
124
       },
115
       {
125
       {
116
         title: '操作',
126
         title: '操作',
117
         dataIndex: 'personId',
127
         dataIndex: 'personId',
118
         key: 'personId',
128
         key: 'personId',
119
         // eslint-disable-next-line no-nested-ternary
129
         // eslint-disable-next-line no-nested-ternary
120
-        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.personId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
130
+        render: (_, record) => <>{ this.props.visibleData.realtyConsultant !== record.userId && <Button type="danger" onClick={() => this.submitGm(record)}>确定</Button>}</>,
121
       },
131
       },
122
     ]
132
     ]
123
     return (
133
     return (

+ 4
- 3
src/pages/customer/report/index.jsx 파일 보기

75
     */
75
     */
76
   function handleReset() {
76
   function handleReset() {
77
     props.form.resetFields();
77
     props.form.resetFields();
78
+    getList({ pageNumber: 1, pageSize: 9 })
78
   }
79
   }
79
 
80
 
80
   function exportReport() {
81
   function exportReport() {
81
-    request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
82
+    request({ ...apis.customer.customerRecommendReportExport, params: { ...props.form.getFieldsValue() }, responseType: 'blob' })
82
       .then(response => {
83
       .then(response => {
83
         download(response)
84
         download(response)
84
       })
85
       })
123
     },
124
     },
124
     {
125
     {
125
       title: '意向项目',
126
       title: '意向项目',
126
-      dataIndex: 'intention',
127
-      key: 'intention',
127
+      dataIndex: 'intentionName',
128
+      key: 'intentionName',
128
     },
129
     },
129
     {
130
     {
130
       title: '置业顾问',
131
       title: '置业顾问',

+ 1
- 1
src/pages/indexEcharts/components/UserBehavior.jsx 파일 보기

272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
272
           {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
273
         </p>
273
         </p>
274
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
274
         <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
275
-          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} checkFirst></BuildSelect>}
275
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))}></BuildSelect>}
276
         </div>
276
         </div>
277
         <EChart options={options} style={style} />
277
         <EChart options={options} style={style} />
278
         {props.tableShow &&
278
         {props.tableShow &&

+ 107
- 74
src/pages/indexEcharts/userBehavior.jsx 파일 보기

1
 import React, { Component, useState, useEffect } from 'react';
1
 import React, { Component, useState, useEffect } from 'react';
2
-import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table } from 'antd';
3
-import { Row, Col, Menu, Dropdown } from 'antd';
4
-import UserBehavior from './components/UserBehavior'
2
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table , Row, Col, Menu, Dropdown } from 'antd';
3
+
5
 import moment from 'moment';
4
 import moment from 'moment';
5
+import UserBehavior from './components/UserBehavior'
6
 import EChart from '../../components/EchartsTest/EChart';
6
 import EChart from '../../components/EchartsTest/EChart';
7
 import request from '../../utils/request';
7
 import request from '../../utils/request';
8
 import apis from '../../services/apis';
8
 import apis from '../../services/apis';
9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
10
+import { func } from 'prop-types';
10
 
11
 
11
 // const formatDate = (start, end) => {
12
 // const formatDate = (start, end) => {
12
 //   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
13
 //   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
16
 const { Option } = Select;
17
 const { Option } = Select;
17
 
18
 
18
 const header = props => {
19
 const header = props => {
19
-
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
20
   const [tableData, setTableData] = useState({ records: [] })
21
   const [tableData, setTableData] = useState({ records: [] })
21
 
22
 
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
22
   const [endDate, setEndDate] = useState({})
24
   const [endDate, setEndDate] = useState({})
25
+  // eslint-disable-next-line react-hooks/rules-of-hooks
23
   const [startDate, setStartDate] = useState({})
26
   const [startDate, setStartDate] = useState({})
24
-  let daterange = []
27
+  const daterange = []
25
 
28
 
29
+  // eslint-disable-next-line react-hooks/rules-of-hooks
26
   useEffect(() => {
30
   useEffect(() => {
27
-
31
+    window.scrollTo(0, 0)
28
     setEndDate(new Date())
32
     setEndDate(new Date())
29
     setStartDate(moment().subtract(7, 'day').toDate())
33
     setStartDate(moment().subtract(7, 'day').toDate())
30
     getBizEventType()
34
     getBizEventType()
31
     getBizEventList()
35
     getBizEventList()
32
     getProperties()
36
     getProperties()
33
-  
34
-    
37
+    props.form.setFieldsValue({ radioGroup: 'a' })
35
   }, [])
38
   }, [])
36
- 
39
+
40
+  // eslint-disable-next-line react-hooks/rules-of-hooks
37
   const [eventypes, setEventTypes] = useState([])
41
   const [eventypes, setEventTypes] = useState([])
38
   function getBizEventType(row) {
42
   function getBizEventType(row) {
39
-
40
     request({
43
     request({
41
       ...apis.indexEcharts.bizEvent.dict,
44
       ...apis.indexEcharts.bizEvent.dict,
42
-    }).then((data) => {
43
-      setEventTypes(data.records)
44
-
45
+    }).then(data => {
46
+      const eventType = ['agent', 'main']
47
+      setEventTypes(data.records.filter(item => !eventType.includes(item.typeId)))
45
     })
48
     })
46
   }
49
   }
47
   const [eventList, setEventList] = useState([])
50
   const [eventList, setEventList] = useState([])
48
   function getBizEventList(row) {
51
   function getBizEventList(row) {
49
-
50
     request({
52
     request({
51
       ...apis.indexEcharts.bizEvent.list,
53
       ...apis.indexEcharts.bizEvent.list,
52
-    }).then((data) => {
54
+    }).then(data => {
53
       setEventList(data.records)
55
       setEventList(data.records)
54
-      
55
     })
56
     })
56
   }
57
   }
57
   const [properties, setProperties] = useState([])
58
   const [properties, setProperties] = useState([])
58
   function getProperties(row) {
59
   function getProperties(row) {
59
-
60
     request({
60
     request({
61
       ...apis.indexEcharts.bizEvent.properties,
61
       ...apis.indexEcharts.bizEvent.properties,
62
-    }).then((data) => {
63
-
62
+    }).then(data => {
64
       setProperties(data.records)
63
       setProperties(data.records)
65
-
66
     })
64
     })
67
   }
65
   }
68
 
66
 
69
   const { RangePicker } = DatePicker;
67
   const { RangePicker } = DatePicker;
70
 
68
 
71
-  function onChangetime(dates, dateStrings) {
72
-
73
-    daterange[1] = dateStrings[1]
74
-    daterange[0] = dateStrings[0]
75
 
69
 
70
+  function handleSubmit(e) {
71
+    e.preventDefault();
72
+    props.form.validateFields((err, values) => {
73
+      if (!err) {
74
+        const { rangePicker } = values
75
+        console.log('Received values of form: ', values.rangePicker);
76
+        setEndDate(rangePicker[1])
77
+        setStartDate(rangePicker[0])
78
+      }
79
+    });
76
   }
80
   }
77
 
81
 
78
-  const getDataOf = (days) => () => {
79
-
82
+  const getDataOf = days => () => {
80
     setEndDate(new Date())
83
     setEndDate(new Date())
81
     setStartDate(moment().subtract(days, 'day').toDate())
84
     setStartDate(moment().subtract(days, 'day').toDate())
82
   }
85
   }
83
 
86
 
84
-  function datalist() {
85
-
86
-    setEndDate(daterange[1])
87
-    setStartDate(daterange[0])
88
-
89
-  }
90
 
87
 
91
   function redata(e) {
88
   function redata(e) {
92
     console.log('行为回调数据:', e)
89
     console.log('行为回调数据:', e)
109
     setBuildingId(value)
106
     setBuildingId(value)
110
   }
107
   }
111
 
108
 
109
+  // 重置
110
+  function resetQuery() {
111
+    props.form.resetFields()
112
+    props.form.setFieldsValue({ radioGroup: 'a' })
113
+  }
114
+
112
   const columns = [
115
   const columns = [
113
     {
116
     {
114
       title: '访问事件',
117
       title: '访问事件',
144
 
147
 
145
   const dataSource = []
148
   const dataSource = []
146
 
149
 
147
-  return (<>
150
+  const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = props.form;
151
+  return (
152
+  <>
148
     <div>
153
     <div>
149
       <div>
154
       <div>
150
-        <Radio.Group buttonStyle="solid" defaultValue="a">
151
-          <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
152
-          <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
153
-        </Radio.Group>
154
-        <RangePicker
155
-          style={{ paddingLeft: '30px', width: '400px' }}
156
-          ranges={{
157
-            Today: [moment(), moment()],
158
-            'This Month': [moment().startOf('month'), moment().endOf('month')],
159
-          }}
160
-          // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
161
-          showTime
162
-          onChange={onChangetime}
163
-        />
164
-        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
165
-          搜索
166
-      </Button>
167
-      </div>
168
-
169
-      <div style={{ display: 'flex', margin: '24px 0' }}>
170
-        <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
171
-       
172
-        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
173
-          {eventypes.map(type => (
174
-            <Option key={type.typeId}>{type.typeName}</Option>
175
-          ))}
176
-      </Select>
177
-        <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
178
-          {eventList.map(event => (
179
-            <Option key={event.eventId}>{event.eventName}</Option>
180
-          ))}
181
-      </Select>
182
-        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
183
-          {properties.map(property => (
184
-            <Option key={property.propertyId}>{property.propertyName}</Option>
185
-          ))}
186
-      </Select>
187
-     
155
+        <Form layout="inline" onSubmit={handleSubmit}>
156
+          <Form.Item>
157
+            {getFieldDecorator('radioGroup')(
158
+              <Radio.Group buttonStyle="solid">
159
+                <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
160
+                <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
161
+              </Radio.Group>,
162
+            )}
163
+          </Form.Item>
164
+          <Form.Item>
165
+            {getFieldDecorator('rangePicker')(
166
+              <RangePicker
167
+                style={{ paddingLeft: '30px', width: '400px' }}
168
+                ranges={{
169
+                  Today: [moment(), moment()],
170
+                  'This Month': [moment().startOf('month'), moment().endOf('month')],
171
+                }}
172
+                // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
173
+                showTime
174
+              />,
175
+            )}
176
+          </Form.Item>
177
+
178
+            <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }}>
179
+              搜索
180
+            </Button>
181
+            <Button style={{ marginLeft: '30px', float: 'right' }} onClick={resetQuery}>
182
+              重置
183
+            </Button>
184
+
185
+          <div style={{ display: 'flex', margin: '24px 0' }}>
186
+            <Form.Item>
187
+              {getFieldDecorator('buildingId')(
188
+                <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot="action" onChange={(e => handleBuildingChange(e))}></BuildSelect>,
189
+              )}
190
+            </Form.Item>
191
+            <Form.Item>
192
+              {getFieldDecorator('handleType')(
193
+                <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
194
+                    {eventypes.map(type => (
195
+                      <Option key={type.typeId}>{type.typeName}</Option>
196
+                    ))}
197
+                </Select>,
198
+              )}
199
+            </Form.Item>
200
+            <Form.Item>
201
+              {getFieldDecorator('handleEvent')(
202
+                 <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
203
+                      {eventList.map(event => (
204
+                        <Option key={event.eventId}>{event.eventName}</Option>
205
+                      ))}
206
+                  </Select>,
207
+              )}
208
+            </Form.Item>
209
+            <Form.Item>
210
+              {getFieldDecorator('handleProperty')(
211
+                 <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
212
+                    {properties.map(property => (
213
+                      <Option key={property.propertyId}>{property.propertyName}</Option>
214
+                    ))}
215
+                </Select>,
216
+              )}
217
+            </Form.Item>
218
+          </div>
219
+        </Form>
188
       </div>
220
       </div>
189
 
221
 
190
-
191
       <div style={{ margin: '24px 0' }}>
222
       <div style={{ margin: '24px 0' }}>
192
-        <UserBehavior tableShow={true} BuildSelectHide={true} buildingId={buildingId} endDate={endDate} startDate={startDate}  eventType={eventType} activity={activity}  event={event} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
223
+       <UserBehavior tableShow BuildSelectHide buildingId={buildingId} endDate={endDate} startDate={startDate} eventType={eventType} activity={activity} event={event} dataZoom onReData={e => redata(e)}></UserBehavior>
193
       </div>
224
       </div>
194
 
225
 
195
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}
226
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}
197
   </>
228
   </>
198
   )
229
   )
199
 }
230
 }
200
-export default header
231
+
232
+const WrappedHorizontalLoginForm = Form.create({ name: 'header' })(header);
233
+export default WrappedHorizontalLoginForm

+ 5
- 1
src/pages/indexEcharts/userSource.jsx 파일 보기

96
   }
96
   }
97
 
97
 
98
   datalist = () => {
98
   datalist = () => {
99
-    this.setState({ endDate: daterange[1], startDate: daterange[0] })
99
+    console.log()
100
+    this.setState({ 
101
+      endDate: daterange[1] === '' ? new Date() : daterange[1],
102
+      startDate: daterange[0] === '' ? moment().subtract(7, 'day').toDate() : daterange[0],
103
+    })
100
   }
104
   }
101
 
105
 
102
   onSuccess = e => {
106
   onSuccess = e => {

+ 14
- 14
src/pages/integralMall/achieve.jsx 파일 보기

132
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
132
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
133
           </div>
133
           </div>
134
         </TabPane>
134
         </TabPane>
135
-        <TabPane tab="项目积分" key="project">
136
-        <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
137
-            <Form.Item>
138
-              {getFieldDecorator('buildingId')(
139
-                <BuildSelect />,
140
-              )}
141
-            </Form.Item>
142
-             
143
-            <Form.Item>
144
-              <Button type="primary" htmlType="submit" className={styles.searchBtn}>
145
-                搜索
146
-              </Button>
147
-            </Form.Item>
135
+        {/* <TabPane tab="项目积分" key="project">
136
+          <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
137
+              <Form.Item>
138
+                {getFieldDecorator('buildingId')(
139
+                  <BuildSelect />,
140
+                )}
141
+              </Form.Item>
142
+              
143
+              <Form.Item>
144
+                <Button type="primary" htmlType="submit" className={styles.searchBtn}>
145
+                  搜索
146
+                </Button>
147
+              </Form.Item>
148
           </Form>
148
           </Form>
149
           <Table rowKey="achie" style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
149
           <Table rowKey="achie" style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
150
           <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
150
           <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
151
             <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
152
           </div>
152
           </div>
153
-        </TabPane>
153
+        </TabPane> */}
154
       </Tabs>,
154
       </Tabs>,
155
     </>
155
     </>
156
   )
156
   )

+ 9
- 2
src/pages/integralMall/editGoods.jsx 파일 보기

40
       ]
40
       ]
41
     },
41
     },
42
     {
42
     {
43
-      label: '商品图',
43
+      label: '商品封面图',
44
       name: 'imgUrl',
44
       name: 'imgUrl',
45
       type: FieldTypes.ImageUploader,
45
       type: FieldTypes.ImageUploader,
46
       value: goodsData.imgUrl,
46
       value: goodsData.imgUrl,
47
-      help: '建议图片尺寸:164px*164px',
47
+      help: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于商品封面图',
48
+    },
49
+    {
50
+      label: '商品主图',
51
+      name: 'detailImgUrl',
52
+      type: FieldTypes.ImageUploader,
53
+      value: goodsData.detailImgUrl,
54
+      help: '建议图片尺寸:750*750px,比例1:1,格式:jpg,用于商品主图',
48
     },
55
     },
49
     {
56
     {
50
       label: '商品名称',
57
       label: '商品名称',

+ 2
- 2
src/pages/integralMall/writeOff.jsx 파일 보기

108
   return (
108
   return (
109
     <>
109
     <>
110
       <Tabs onChange={callback} type="card">
110
       <Tabs onChange={callback} type="card">
111
-        <TabPane tab="扫码核销" key="1">
111
+        {/* <TabPane tab="扫码核销" key="1">
112
           <Row>
112
           <Row>
113
             <Col span={8} style={{ textAlign: 'center' }}>
113
             <Col span={8} style={{ textAlign: 'center' }}>
114
               <img src={erweima} style={{ width: '50px', height: '50px', margin: '30px auto' }} />
114
               <img src={erweima} style={{ width: '50px', height: '50px', margin: '30px auto' }} />
129
             </Col>
129
             </Col>
130
           </Row>
130
           </Row>
131
           <Dialog onEnter={handleEnter} onChange={changeCode} />
131
           <Dialog onEnter={handleEnter} onChange={changeCode} />
132
-        </TabPane>
132
+        </TabPane> */}
133
         <TabPane tab="手机号核销" key="2">
133
         <TabPane tab="手机号核销" key="2">
134
           <Row>
134
           <Row>
135
             <Col span={12} style={{ textAlign: 'center' }}>
135
             <Col span={12} style={{ textAlign: 'center' }}>

+ 6
- 4
src/pages/news/list/editNewsList.jsx 파일 보기

64
         ]
64
         ]
65
       },
65
       },
66
       {
66
       {
67
-        label: '资讯图片',
67
+        label: '资讯列表',
68
         name: 'newsImg',
68
         name: 'newsImg',
69
         type: FieldTypes.ImageUploader,
69
         type: FieldTypes.ImageUploader,
70
         value: dynamicData.newsImg,
70
         value: dynamicData.newsImg,
71
-        help: '建议图片尺寸:660px*416px',
71
+        help: '建议图片尺寸:320*256px,比例5:4,格式:jpg,用于资讯列表',
72
       },
72
       },
73
       {
73
       {
74
         label: '资讯标题',
74
         label: '资讯标题',
215
 
215
 
216
         <div >
216
         <div >
217
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
217
           <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
218
-            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图</p>
218
+            <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>资讯海报图</p>
219
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
219
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
220
           </div>
220
           </div>
221
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于资讯海报</p>
221
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
222
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
222
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
223
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
223
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
224
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />
290
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
291
         <Input placeholder="请输入分享标题" value={inputValue} onChange={e => changeInput(e.target.value)} />
291
       </div>
292
       </div>
292
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
293
       <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
293
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图</p>
294
+        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>资讯分享好友图</p>
294
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
295
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
295
       </div>
296
       </div>
297
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议图片尺寸:750*600px,比例5:4,格式:jpg,用于资讯分享好友</p>
296
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
298
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
297
       <Button onClick={() => router.go(-1)}>取消</Button>
299
       <Button onClick={() => router.go(-1)}>取消</Button>
298
     </div>
300
     </div>

+ 18
- 18
src/pages/staff/list/editStaff.jsx 파일 보기

158
       </Select>,
158
       </Select>,
159
       value: userData.roleIds,
159
       value: userData.roleIds,
160
     },
160
     },
161
-    {
162
-      label: '标签',
163
-      name: 'taTags',
164
-      render: <Select
165
-        mode="multiple"
166
-        style={{ width: '100%' }}
167
-        placeholder="请选择标签"
168
-        onChange={tagsChange} >
169
-        {tagData.map(item => (
170
-          <Select.Option key={item.tagId} value={item.tagId}>
171
-            {item.tagName}
172
-          </Select.Option>
173
-        ))}
174
-      </Select>,
175
-      value: userData.taTags,
176
-    },
161
+    // {
162
+    //   label: '标签',
163
+    //   name: 'taTags',
164
+    //   render: <Select
165
+    //     mode="multiple"
166
+    //     style={{ width: '100%' }}
167
+    //     placeholder="请选择标签"
168
+    //     onChange={tagsChange} >
169
+    //     {tagData.map(item => (
170
+    //       <Select.Option key={item.tagId} value={item.tagId}>
171
+    //         {item.tagName}
172
+    //       </Select.Option>
173
+    //     ))}
174
+    //   </Select>,
175
+    //   value: userData.taTags,
176
+    // },
177
     {
177
     {
178
       label: '地址',
178
       label: '地址',
179
       name: 'address',
179
       name: 'address',
191
       value: userData.buildingId
191
       value: userData.buildingId
192
     },
192
     },
193
     {
193
     {
194
-      label: '头像',
194
+      label: '置业顾问头像',
195
       name: 'photo',
195
       name: 'photo',
196
       type: FieldTypes.ImageUploader,
196
       type: FieldTypes.ImageUploader,
197
-      extra: '建议图片大小 640 * 640',
197
+      extra: '建议图片尺寸:320*320px,比例1:1,格式:jpg,用于置业顾问头像',
198
       value: userData.photo,
198
       value: userData.photo,
199
       rules: [
199
       rules: [
200
         { required: true, message: '请选择头像' },
200
         { required: true, message: '请选择头像' },

+ 10
- 5
src/pages/style/GoodsList.less 파일 보기

8
   width: 93px;
8
   width: 93px;
9
   height: 93px;
9
   height: 93px;
10
 }
10
 }
11
+
11
 .ant-table-column-title {
12
 .ant-table-column-title {
12
   font-weight: 600;
13
   font-weight: 600;
13
 }
14
 }
14
-.shoppingCart{
15
-  color: #dcdcdc;
15
+
16
+.shoppingCart {
17
+  // color: #dcdcdc;
18
+  color: #bebebe;
16
   margin-left: 6px;
19
   margin-left: 6px;
17
   font-size: 16px;
20
   font-size: 16px;
18
 }
21
 }
19
-.edit{
20
-  color: #dcdcdc;
22
+
23
+.edit {
24
+  // color: #dcdcdc;
25
+  color: #bebebe;
21
   margin-left: 6px;
26
   margin-left: 6px;
22
   font-size: 15px;
27
   font-size: 15px;
23
-}
28
+}

+ 164
- 46
src/pages/system/document/audit.jsx 파일 보기

1
 import React, { useState, useEffect } from 'react';
1
 import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal } from 'antd'
2
+import { Col, Row, Button, Modal, Input, Pagination, message } from 'antd'
3
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
3
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4
 import request from '../../../utils/request';
4
 import request from '../../../utils/request';
5
 import apis from '../../../services/apis';
5
 import apis from '../../../services/apis';
6
 import { router } from 'umi';
6
 import { router } from 'umi';
7
 import AuthButton from '../../../components/AuthButton';
7
 import AuthButton from '../../../components/AuthButton';
8
+import moment from 'moment';
9
+
10
+const unaudited = {
11
+  // color :'rgb(255, 126, 72)'
12
+  float: "right", fontWeight: "bold", marginRight: '30px'
13
+}
14
+
15
+const auditPass = {
16
+  // color : '#FF7E48',
17
+  color: 'green',
18
+  float: "right", fontWeight: "bold", marginRight: '30px'
19
+}
20
+
21
+const noauditPass = {
22
+  color: ' #fc515c',
23
+  float: "right", fontWeight: "bold", marginRight: '30px'
24
+}
8
 
25
 
9
 function body (props) {
26
 function body (props) {
10
   const documentVerifyId = props.location.query.id
27
   const documentVerifyId = props.location.query.id
11
   const [data, setData] = useState([])
28
   const [data, setData] = useState([])
12
-
29
+  const [datas, setDatas] = useState({})
30
+  // const [status,setStatus] = useState()
13
   useEffect(() => {
31
   useEffect(() => {
14
     getList()
32
     getList()
15
-
33
+    // setVisible(false)
34
+    // setReasonValue()
35
+    // useState(2)
16
   }, [])
36
   }, [])
17
   // , documentVerifyId: documentVerifyId
37
   // , documentVerifyId: documentVerifyId
18
   function getList (params) {
38
   function getList (params) {
19
     // 网路请求
39
     // 网路请求
20
     console.log(props, '1111')
40
     console.log(props, '1111')
21
-    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
22
-      console.log('data:', data)
23
-      setData(data.imgList)
41
+    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId }, params: params }).then(data => {
42
+      console.log('data:', data.records)
43
+      setDatas(data)
44
+      setData(data.records)
24
     }).catch(err => {
45
     }).catch(err => {
25
       // eslint-disable-next-line no-unused-expressions
46
       // eslint-disable-next-line no-unused-expressions
26
 
47
 
27
     })
48
     })
28
   }
49
   }
29
 
50
 
30
-  function onVerify (params) {
31
-    // 网路请求
32
-    request({ ...apis.system.updateVerify, urlData: { id: documentVerifyId }, data: { verifyStatus: params } }).then(data => {
33
 
51
 
34
-    }).catch(err => {
35
-      // eslint-disable-next-line no-unused-expressions
36
 
52
 
37
-    })
53
+  const cancelPage = () => {
54
+    router.push({
55
+      pathname: '/system/document/list',
56
+    });
38
   }
57
   }
39
 
58
 
40
 
59
 
60
+  const Card = (props) => {
61
+    const [visible, setVisible] = useState()
62
+    const [reasonValue, setReasonValue] = useState('')
63
+    useEffect(() => {
64
+      setVisible(false)
65
+    }, [])
66
+
67
+
68
+    function onVerify (params) {
69
+      // 网路请求
70
+      console.log(reasonValue, "111212")
71
+      request({ ...apis.system.updateVerify, urlData: { id: props.data.documentVerifyId }, data: { verifyStatus: params, rejectReason: reasonValue } }).then(data => {
72
+        console.log(data, "datadata")
73
+        getList()
74
+      }).catch(err => {
41
 
75
 
42
-  const handleOk = () => {
43
 
76
 
77
+      })
78
+    }
44
 
79
 
45
-    Modal.confirm({
46
-      title: '审核通过后,将给当前用户发放积分 确认审核通过?',
47
-      okText: '确认',
48
-      cancelText: '取消',
49
-      onOk () {
50
 
80
 
51
-        onVerify(1)
81
+
82
+    const handleOk = (data) => {
83
+
84
+      if (data == 1) {
85
+        Modal.confirm({
86
+          title: '审核通过后,将给当前用户发放积分 确认审核通过?',
87
+          okText: '确认',
88
+          cancelText: '取消',
89
+          onOk () {
90
+
91
+            onVerify(1)
92
+          }
93
+        });
94
+      } else {
95
+        setVisible(true)
52
       }
96
       }
53
-    });
97
+    }
98
+
99
+    const showModal = () => {
100
+      setVisible(true)
101
+    };
102
+
103
+    const handleOk1 = e => {
104
+      console.log(reasonValue, "2222");
105
+      if (reasonValue ) {
106
+        // console.log(e);
107
+        onVerify(2)
108
+        console.log(reasonValue, "11111111");
109
+        setVisible(false)
110
+      } else {
111
+        message.info("不能为空")
112
+      }
113
+
114
+    };
115
+
116
+    const handleCancel = e => {
117
+
118
+      setVisible(false)
119
+    };
120
+
121
+    const Reason = e => {
122
+      console.log(e.target.value)
123
+      // e.target.
124
+      setReasonValue(e.target.value)
125
+    }
126
+
127
+
128
+    // console.log("props", props.data)
129
+    const carddata = props.data.imgList
130
+    return (
131
+      <>
132
+        <div style={{ background: '#ffffff', padding: '40px', marginTop: '30px', borderRadius: '12px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}>
133
+          <p style={{ fontSize: '0.096rem' }}>
134
+            <span>资料说明:{props.data.documentTitle} </span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
135
+           
136
+            <span style={props.data.verifyStatus == 0 ? unaudited : props.data.verifyStatus == 1 ? auditPass : noauditPass} >
137
+              {props.data.verifyStatus == 0 ? "待审核" : props.data.verifyStatus == 1 ? "审核通过" : "不通过"}
138
+            </span>
139
+          </p>
140
+          <p style={{ fontSize: '0.096rem' }}>提交时间:{moment(props.data.createDate).format('YYYY-MM-DD HH:mm:ss')}   </p>
141
+
142
+          <div style={{ fontSize: '0.096rem' }}>资料图片:
143
+        <Row gutter={16}>
144
+              {
145
+                // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
146
+                carddata.map((data, inx) =>
147
+                  <Col span={4} style={{ textAlign: "center" }}>
148
+                    <ZmageImg style={{ width: '128px', height: '128px', marginTop: '30px' }} src={data.img} />
149
+                  </Col>
150
+                )
151
+              }
152
+            </Row>
153
+          </div>
154
+          {props.data.verifyStatus == 0 && <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
155
+            <AuthButton name="admin.documentVerify.id.put" noRight={null}>
156
+              <Button type="primary" style={{ marginTop: '30px' }} onClick={() => handleOk(1)}>通过</Button>
157
+            </AuthButton>
158
+            &nbsp;&nbsp;&nbsp;&nbsp;
159
+        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
160
+              <Button style={{ marginTop: '30px' }} onClick={() => handleOk(2)}>不通过</Button>
161
+            </AuthButton>
162
+          </div>}
163
+
164
+          {props.data.verifyStatus == 2 &&  <p style={{ fontSize: '0.096rem',marginTop: '30px' }}>驳回原因:{props.data.rejectReason}   </p>}
165
+
166
+          <Modal
167
+            title="驳回原因"
168
+            visible={visible}
169
+            onOk={handleOk1}
170
+            onCancel={handleCancel}
171
+            okText="确认"
172
+            cancelText="取消"
173
+          >
174
+            <Input value={reasonValue} onChange={e => Reason(e)} />
175
+          </Modal>
176
+        </div>
177
+
178
+      </>
179
+    )
180
+    // return <div>111</div>
54
   }
181
   }
55
 
182
 
56
-  const cancelPage = () => {
57
-    router.push({
58
-      pathname: '/system/document/list',
59
-    });
183
+  const changePageNum = (pageNumber) => {
184
+    getList({ pageNum: pageNumber, pageSize: 5 })
60
   }
185
   }
61
 
186
 
187
+
62
   return (
188
   return (
63
     <>
189
     <>
64
-      <div style={{ background: '#ECECEC', padding: '30px' }}>
65
-        <Row gutter={16}>
66
-          {
67
-            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
68
-            data.map((data, inx) =>
69
-              <Col span={6}>
70
-                <ZmageImg style={{ width: '300px', height: '400px' }} src={data.img} />
71
-              </Col>
72
-            )
73
-          }
74
-        </Row>
75
-      </div>
76
-      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
77
-        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
78
-          <Button type="primary" onClick={() => handleOk()}>通过</Button>
79
-        </AuthButton>
80
-        &nbsp;&nbsp;&nbsp;&nbsp;
81
-        <AuthButton name="admin.documentVerify.id.put" noRight={null}>
82
-          <Button onClick={() => onVerify(2)}>不通过</Button>
83
-        </AuthButton>
84
-        &nbsp;&nbsp;&nbsp;&nbsp;
85
-        <Button onClick={cancelPage}>返回</Button>
190
+      {/* <div>111</div> */}
191
+      <div>
192
+        {
193
+          // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
194
+          data.map((data, inx) =>
195
+            <Card data={data}></Card>
196
+          )
197
+        }
198
+        {/* <Card data = {data.records}></Card> */}
199
+        <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
200
+          <Pagination showQuickJumper defaultCurrent={1} total={datas.total} pageSize={datas.size} onChange={changePageNum} current={datas.current} />
201
+        </div>
86
 
202
 
87
       </div>
203
       </div>
88
 
204
 
89
 
205
 
206
+
207
+
90
     </>
208
     </>
91
   )
209
   )
92
 }
210
 }

+ 25
- 26
src/pages/system/document/list.jsx 파일 보기

56
   }
56
   }
57
 
57
 
58
   function audit(record){
58
   function audit(record){
59
-    if(record.verifyStatus === 0){
59
+    
60
       router.push({
60
       router.push({
61
         pathname: '/system/document/audit',
61
         pathname: '/system/document/audit',
62
         query: {
62
         query: {
63
-          id: record.documentVerifyId,
63
+          id: record.personId,
64
         },
64
         },
65
       })
65
       })
66
-    }
67
-  else{
68
-    router.push({
69
-      pathname: '/system/document/see',
70
-      query: {
71
-        id: record.documentVerifyId,
72
-      },
73
-    })
74
-      
75
-    }
66
+   
76
   }
67
   }
77
 
68
 
78
   const columns = [
69
   const columns = [
80
       title: '姓名',
71
       title: '姓名',
81
       dataIndex: 'name',
72
       dataIndex: 'name',
82
       key: 'name',
73
       key: 'name',
74
+      align: 'center',
83
     },
75
     },
84
     {
76
     {
85
       title: '手机号',
77
       title: '手机号',
86
       dataIndex: 'tel',
78
       dataIndex: 'tel',
87
       key: 'tel',
79
       key: 'tel',
80
+      align: 'center',
88
     },
81
     },
89
     {
82
     {
90
       title: '提交时间',
83
       title: '提交时间',
91
-      dataIndex: 'createDate',
92
-      key: 'createDate',
93
-      render: (createDate) => moment(createDate).format('YYYY-MM-DD')
84
+      dataIndex: 'summitDate',
85
+      key: 'summitDate',
86
+      align: 'center',
87
+      render: (summitDate) => moment(summitDate).format('YYYY-MM-DD HH:mm:ss')
94
     },
88
     },
89
+
95
     {
90
     {
96
-      title: '状态',
97
-      dataIndex: 'verifyStatus',
98
-      key: 'verifyStatus',
99
-      render: (x,row) => (
100
-        <>
101
-         
102
-            <span style={{ cursor: 'pointer' }}>{ row.verifyStatus === 0 ? '未审核' : row.verifyStatus === 1 ? '审核通过' : '审核未通过' }</span>
103
-           
104
-        </>
105
-      )
91
+      title: '已审核数',
92
+      dataIndex: 'totalSummit',
93
+      key: 'totalSummit',
94
+      align: 'center',
106
     },
95
     },
96
+
97
+    {
98
+      title: '未审核数',
99
+      dataIndex: 'unverified',
100
+      key: 'unverified',
101
+      align: 'center',
102
+    },
103
+
104
+   
107
     {
105
     {
108
       title: '操作',
106
       title: '操作',
109
       dataIndex: 'documentVerifyId',
107
       dataIndex: 'documentVerifyId',
110
       key: 'documentVerifyId',
108
       key: 'documentVerifyId',
109
+      align: 'center',
111
       render: (x,row) => (
110
       render: (x,row) => (
112
         <>
111
         <>
113
           <AuthButton name="admin.documentVerify.id.get" noRight={null}>
112
           <AuthButton name="admin.documentVerify.id.get" noRight={null}>
114
-            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.verifyStatus === 0 ? '审核' : '查看' }</span>
113
+            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.unverified === 0 ? '查看' : '审核' }</span>
115
            </AuthButton>
114
            </AuthButton>
116
         </>
115
         </>
117
       )
116
       )

+ 0
- 62
src/pages/system/document/see.jsx 파일 보기

1
-import React, { useState, useEffect } from 'react';
2
-import { Col, Row, Button, Modal } from 'antd'
3
-import { router } from 'umi';
4
-import ZmageImg from '../../../components/ZmageImg/ZmageImg'
5
-import request from '../../../utils/request';
6
-import apis from '../../../services/apis';
7
-
8
-
9
-function body (props) {
10
-  const documentVerifyId = props.location.query.id
11
-  const [data, setData] = useState([])
12
-
13
-  useEffect(() => {
14
-    getList()
15
-  }, [])
16
-// , documentVerifyId: documentVerifyId
17
-  function getList (_params) {
18
-    // 网路请求
19
-    console.log(props, '1111')
20
-    request({ ...apis.system.documentVerifyDetail, urlData: { id: documentVerifyId } }).then(data => {
21
-      console.log('data:', data.imgList)
22
-      setData(data.imgList)
23
-    }).catch(_err => {
24
-      // eslint-disable-next-line no-unused-expressions
25
-
26
-    })
27
-  }
28
-
29
-
30
-  const cancelPage = () => {
31
-    router.push({
32
-      pathname: '/system/document/list',
33
-    });
34
-  }
35
-
36
-
37
-  return (
38
-    <>
39
-      <div style={{ background: '#ECECEC', padding: '30px' }}>
40
-        <Row gutter={16}>
41
-          {
42
-            // data.consultant && data.consultant.projects.map((item, _) => <span>{item}</span>)
43
-            data.map(item =>
44
-              <Col span={6} key={item.documentImgId}>
45
-               <ZmageImg style={{ width: '300px', height: '400px' }} src={item.img} />
46
-              </Col>,
47
-            )
48
-          }
49
-        </Row>
50
-      </div>
51
-      <div style={{ marginTop: '10px', display: 'flex', justifyContent: 'center' }}>
52
-
53
-        <Button onClick={cancelPage}>返回</Button>
54
-
55
-      </div>
56
-
57
-
58
-    </>
59
-  )
60
-}
61
-
62
-export default body

+ 2
- 2
src/pages/system/editPolicy.jsx 파일 보기

48
         value: policyData.cityId,
48
         value: policyData.cityId,
49
       },
49
       },
50
       {
50
       {
51
-        label: '政策图',
51
+        label: '购房政策封面图',
52
         name: 'policyImg',
52
         name: 'policyImg',
53
         type: FieldTypes.ImageUploader,
53
         type: FieldTypes.ImageUploader,
54
         value: policyData.policyImg,
54
         value: policyData.policyImg,
55
-        help: '建议图片尺寸:660px*416px',
55
+        help: '建议图片尺寸:220*176px,比例5:4,格式:jpg,用于购房百科列表',
56
       },
56
       },
57
       {
57
       {
58
         label: '政策标题',
58
         label: '政策标题',

+ 38
- 0
src/services/apis.js 파일 보기

1
 const prefix = '/api/admin'
1
 const prefix = '/api/admin'
2
+// 高德地图
3
+const amapPrefix = '/gaode_amap'
2
 
4
 
3
 export default {
5
 export default {
4
   image: {
6
   image: {
236
       url: `${prefix}/consultant`,
238
       url: `${prefix}/consultant`,
237
       action: 'admin.consultant.get',
239
       action: 'admin.consultant.get',
238
     },
240
     },
241
+    buildingConsultant: {
242
+      method: 'GET',
243
+      url: `${prefix}/building/consultant`,
244
+      action: 'admin.building.consultant.get',
245
+    },
239
     recommendEdit: {
246
     recommendEdit: {
240
       method: 'PUT',
247
       method: 'PUT',
241
       url: `${prefix}/customer/recommend/edit/:id`,
248
       url: `${prefix}/customer/recommend/edit/:id`,
281
       url: `${prefix}/customer/recommend/export`,
288
       url: `${prefix}/customer/recommend/export`,
282
       action: 'admin.customer.recommend.export.get',
289
       action: 'admin.customer.recommend.export.get',
283
     },
290
     },
291
+    recommendClient: {
292
+      method: 'GET',
293
+      url: `${prefix}/customer/recommend/:id`,
294
+      action: 'admin.customer.recommend.get',
295
+    },
284
   },
296
   },
285
   indexEcharts: {
297
   indexEcharts: {
286
     list:{
298
     list:{
765
     method: 'post',
777
     method: 'post',
766
     action: 'admin.top.update.post',
778
     action: 'admin.top.update.post',
767
   },
779
   },
780
+  cancel: {
781
+    method: 'PUT',
782
+    url: `${prefix}/helpActivity/cancel/:id`,
783
+    action: 'admin.helpActivity.update.put',
784
+  },
785
+  send: {
786
+    url: `${prefix}/helpActivity/send/:id`,
787
+    method: 'PUT',
788
+    action: 'admin.helpActivity.update.put',
789
+  },
768
   record: {
790
   record: {
769
     url: `${prefix}/helpRecord`,
791
     url: `${prefix}/helpRecord`,
770
     method: 'get',
792
     method: 'get',
827
     method: 'put',
849
     method: 'put',
828
     action: 'admin.taShareActivity.finish.put',
850
     action: 'admin.taShareActivity.finish.put',
829
   },
851
   },
852
+  send: {
853
+    url: `${prefix}/taShareActivity/send/:id`,
854
+    method: 'PUT',
855
+    action: 'admin.taShareActivity.finish.put',
856
+  },
857
+  cancel: {
858
+    method: 'PUT',
859
+    url: `${prefix}/taShareActivity/cancel/:id`,
860
+    action: 'admin.taShareActivity.finish.put',
861
+  },
830
   top: {
862
   top: {
831
     url: `${prefix}/taShareActivity/weight`,
863
     url: `${prefix}/taShareActivity/weight`,
832
     method: 'put',
864
     method: 'put',
891
     method: 'GET',
923
     method: 'GET',
892
     action: 'admin.posterTemplate.get',
924
     action: 'admin.posterTemplate.get',
893
   },
925
   },
926
+ },
927
+ amap: { // 高德地图
928
+   webService: { // Web服务Api ---- 周边搜索
929
+     url: `${amapPrefix}/place/around`,
930
+     method: 'GET',
931
+   },
894
  }
932
  }
895
 }
933
 }

+ 8
- 4
src/utils/request.js 파일 보기

65
 });
65
 });
66
 
66
 
67
 request.interceptors.response.use(async (response, options) => {
67
 request.interceptors.response.use(async (response, options) => {
68
-
69
   if (response && response.status) {
68
   if (response && response.status) {
70
     if (response.status != 200) {
69
     if (response.status != 200) {
71
       const errorText = codeMessage[response.status] || response.statusText;
70
       const errorText = codeMessage[response.status] || response.statusText;
76
       });
75
       });
77
       throw new Error(response.statusText);
76
       throw new Error(response.statusText);
78
     } else {
77
     } else {
79
-      console.log('response.headers: ', response.headers)
80
-      console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
78
+      // console.log('response.headers: ', response.headers)
79
+      // console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
81
       if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
80
       if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
82
         return await response.clone().blob();
81
         return await response.clone().blob();
83
       }
82
       }
84
 
83
 
84
+      // 高德地图的数据,直接返回
85
+      if (response.url.indexOf('gaode_amap') !== -1) {
86
+        return await response.clone().json();
87
+      }
88
+
85
       const { code, data, message } = await response.clone().json();
89
       const { code, data, message } = await response.clone().json();
86
       if (code != 1000) {
90
       if (code != 1000) {
87
         if (code === 1001) {
91
         if (code === 1001) {
92
           throw new Error('请登录系统');
96
           throw new Error('请登录系统');
93
         } else {
97
         } else {
94
           notification.error({
98
           notification.error({
95
-            message,
99
+            message: message || '请求错误',
96
             // description: message,
100
             // description: message,
97
           });
101
           });
98
           throw new Error(message);
102
           throw new Error(message);