Selaa lähdekoodia

Merge branch 'v3.5' into v3.5.1

魏超 5 vuotta sitten
vanhempi
commit
75c9801fd2
69 muutettua tiedostoa jossa 2319 lisäystä ja 1194 poistoa
  1. 1
    7
      config/routes.js
  2. 1
    0
      package.json
  3. 10
    7
      src/components/SelectButton/BuildSelect.jsx
  4. 41
    2
      src/components/Wangedit/Wangedit.jsx
  5. 57
    0
      src/components/XForm/FileUpload.jsx
  6. 41
    25
      src/pages/Welcome.jsx
  7. 136
    82
      src/pages/activity/ActivityList.jsx
  8. 88
    8
      src/pages/activity/SignList.jsx
  9. 92
    56
      src/pages/activity/drainage/Detail.jsx
  10. 156
    110
      src/pages/activity/drainage/DrainageList.jsx
  11. 1
    0
      src/pages/activity/editActivity.jsx
  12. 2
    1
      src/pages/activity/groupActivity/editGroupActivity.jsx
  13. 29
    39
      src/pages/activity/groupActivity/helpRecord.jsx
  14. 112
    96
      src/pages/activity/groupActivity/list.jsx
  15. 8
    6
      src/pages/activity/helpActivity/edithelpActivity.jsx
  16. 35
    19
      src/pages/activity/helpActivity/helpRecord.jsx
  17. 31
    22
      src/pages/activity/helpActivity/list.jsx
  18. 28
    9
      src/pages/building/list/add/components/amap.jsx
  19. 94
    25
      src/pages/building/list/add/components/base.jsx
  20. 30
    0
      src/pages/building/list/add/components/buildingImage.jsx
  21. 3
    2
      src/pages/building/list/add/components/buildingProjectType.jsx
  22. 30
    18
      src/pages/building/list/add/components/imageSet.jsx
  23. 22
    28
      src/pages/building/list/add/components/modalImage.jsx
  24. 6
    1
      src/pages/building/list/add/components/poster.jsx
  25. 1
    0
      src/pages/building/list/add/components/share.jsx
  26. 30
    18
      src/pages/building/list/add/index.jsx
  27. 15
    11
      src/pages/building/list/index.jsx
  28. 3
    2
      src/pages/building/type/edi.jsx
  29. 12
    5
      src/pages/building/type/index.jsx
  30. 8
    1
      src/pages/carouselFigure/SelectActivity.jsx
  31. 74
    0
      src/pages/carouselFigure/SelectGroup.jsx
  32. 76
    0
      src/pages/carouselFigure/SelectHelp.jsx
  33. 23
    14
      src/pages/carouselFigure/SelectNews.jsx
  34. 9
    9
      src/pages/carouselFigure/advertisingList.jsx
  35. 4
    4
      src/pages/carouselFigure/carouselFigureList.jsx
  36. 30
    1
      src/pages/carouselFigure/editAdvertising.jsx
  37. 180
    111
      src/pages/carouselFigure/editCarousel.jsx
  38. 22
    25
      src/pages/customer/customerlist/components/attribution.jsx
  39. 6
    3
      src/pages/customer/customerlist/customerDetail.jsx
  40. 11
    5
      src/pages/customer/customerlist/index.jsx
  41. 26
    25
      src/pages/customer/independentList/index.jsx
  42. 58
    26
      src/pages/customer/recommendCustomer/audit.jsx
  43. 151
    0
      src/pages/customer/recommendCustomer/components/attribution.jsx
  44. 2
    2
      src/pages/customer/recommendCustomer/index.jsx
  45. 4
    3
      src/pages/customer/report/index.jsx
  46. 1
    1
      src/pages/indexEcharts/components/UserBehavior.jsx
  47. 51
    26
      src/pages/indexEcharts/index.jsx
  48. 107
    74
      src/pages/indexEcharts/userBehavior.jsx
  49. 5
    1
      src/pages/indexEcharts/userSource.jsx
  50. 3
    2
      src/pages/integralMall/GoodsList.jsx
  51. 16
    16
      src/pages/integralMall/achieve.jsx
  52. 2
    1
      src/pages/integralMall/exchangeRecords.jsx
  53. 1
    1
      src/pages/integralMall/verifyList.jsx
  54. 2
    2
      src/pages/integralMall/writeOff.jsx
  55. 1
    1
      src/pages/news/list/NewsList.jsx
  56. 1
    0
      src/pages/news/list/editNewsList.jsx
  57. 15
    6
      src/pages/news/type/NewsType.jsx
  58. 27
    28
      src/pages/staff/list/StaffList.jsx
  59. 17
    17
      src/pages/staff/list/editStaff.jsx
  60. 10
    5
      src/pages/style/GoodsList.less
  61. 172
    50
      src/pages/system/document/audit.jsx
  62. 31
    29
      src/pages/system/document/list.jsx
  63. 0
    64
      src/pages/system/document/see.jsx
  64. 1
    1
      src/pages/system/housingPolicy.jsx
  65. 1
    1
      src/pages/system/intention.jsx
  66. 1
    1
      src/pages/system/messageList.jsx
  67. 1
    1
      src/pages/third/thirdList.jsx
  68. 50
    34
      src/services/apis.js
  69. 4
    4
      src/utils/request.js

+ 1
- 7
config/routes.js Näytä tiedosto

@@ -292,7 +292,7 @@ export default [
292 292
               },
293 293
               {
294 294
                 path: '/activity/helpActivity/edithelpActivity',
295
-                name: '新增',
295
+                name: '编辑',
296 296
                 hideInMenu: true,
297 297
                 component: './activity/helpActivity/edithelpActivity',
298 298
               },
@@ -424,12 +424,6 @@ export default [
424 424
                 hideInMenu: true,
425 425
                 component: './system/document/audit',
426 426
               },
427
-              {
428
-                path: '/system/document/see',
429
-                name: '客户资料查看',
430
-                hideInMenu: true,
431
-                component: './system/document/see',
432
-              },
433 427
             ],
434 428
           },
435 429
           {

+ 1
- 0
package.json Näytä tiedosto

@@ -77,6 +77,7 @@
77 77
     "@types/history": "^4.7.2",
78 78
     "@types/jest": "^24.0.13",
79 79
     "@types/lodash": "^4.14.133",
80
+    "@types/qrcode.react": "^0.9.0",
80 81
     "@types/qs": "^6.5.3",
81 82
     "@types/react": "^16.8.19",
82 83
     "@types/react-document-title": "^2.0.3",

+ 10
- 7
src/components/SelectButton/BuildSelect.jsx Näytä tiedosto

@@ -22,21 +22,25 @@ function usePrevious(props) {
22 22
 const BuildingSelect = (props) => {
23 23
   const [ data, setData ] = useState([])
24 24
   const [ value, setValue ] = useState('')
25
-  const preProps = usePrevious(props)
25
+  // const preProps = usePrevious(props)
26 26
 
27
-  if ((!preProps || !preProps.value) && props.value && !value) {
27
+  // if ((!preProps) && props.value != value) {
28
+  //   setValue(props.value)
29
+  // }
30
+
31
+  useEffect(() => {
28 32
     setValue(props.value)
29
-  }
33
+  }, [props.value])
30 34
 
31 35
   useEffect(() => {
32 36
     getCityList();
33 37
   },[])
34 38
 
35 39
   const getCityList = (e) => {
36
-    request({ ...apis.building.buildingSelect, params: {pageNum: 1,pageSize: 999}, }).then((data) => {
40
+    request({ ...apis.building.getList, params: {pageNum: 1,pageSize: 999}, }).then((data) => {
37 41
         setData(data.records)
38 42
         // 默认选中第一个
39
-        if ((!preProps || !preProps.one) && props.one === 'true') {
43
+        if (props.checkFirst) {
40 44
           setValue(data.records[0].buildingId)
41 45
           props.onChange(data.records[0].buildingId)
42 46
         }
@@ -51,7 +55,7 @@ const BuildingSelect = (props) => {
51 55
   return (
52 56
       <Select
53 57
       showSearch
54
-      value={props.value}
58
+      value={value}
55 59
       style={{ width: '180px' }} 
56 60
       placeholder="请选择项目" 
57 61
       onChange={handleChange}
@@ -65,4 +69,3 @@ const BuildingSelect = (props) => {
65 69
   )
66 70
 }
67 71
 export default BuildingSelect
68
-

+ 41
- 2
src/components/Wangedit/Wangedit.jsx Näytä tiedosto

@@ -1,5 +1,6 @@
1 1
 import React from 'react';
2
-import E from 'wangeditor'
2
+import E from 'wangeditor';
3
+import { fetch, apis } from '../../utils/request';
3 4
 
4 5
 /**
5 6
  * @param {*} props
@@ -33,7 +34,33 @@ class Wangedit extends React.Component {
33 34
       }
34 35
     }
35 36
     this.editor.customConfig.zIndex = 100
36
-    this.editor.customConfig.uploadImgShowBase64 = true   
37
+    this.editor.customConfig.uploadImgMaxLength = 1
38
+    this.editor.customConfig.customUploadImg = function (files, insert) {
39
+      if (!files.length) return
40
+      
41
+      const data = new FormData()
42
+      data.append('file', files[0])
43
+
44
+      fetch(apis.image.upload)({data}).then(insert)
45
+    }
46
+    this.editor.customConfig.menus = [
47
+      'head',  // 标题
48
+      'bold',  // 粗体
49
+      'fontSize',  // 字号
50
+      'fontName',  // 字体
51
+      'italic',  // 斜体
52
+      'underline',  // 下划线
53
+      'strikeThrough',  // 删除线
54
+      'foreColor',  // 文字颜色
55
+      'backColor',  // 背景颜色
56
+      'list',  // 列表
57
+      'justify',  // 对齐方式
58
+      'quote',  // 引用
59
+      'image',  // 插入图片
60
+      'undo',  // 撤销
61
+      'redo'  // 重复
62
+    ]
63
+
37 64
     this.editor.create()
38 65
     this.editor.customConfig.uploadImgShowBase64 = true
39 66
     this.editor.txt.html(this.props.value)
@@ -46,6 +73,18 @@ class Wangedit extends React.Component {
46 73
       }
47 74
     }
48 75
   }
76
+
77
+  /**
78
+   *增加这个 shouldComponentUpdate 生命函数
79
+    处理自动聚焦到富文本上
80
+   *
81
+   * @param {*} nextProps
82
+   * @returns
83
+   * @memberof Wangedit
84
+   */
85
+  shouldComponentUpdate(nextProps) {
86
+    return nextProps.value !== this.editor.txt.html()
87
+  }
49 88
 }
50 89
 
51 90
 export default Wangedit

+ 57
- 0
src/components/XForm/FileUpload.jsx Näytä tiedosto

@@ -0,0 +1,57 @@
1
+import React, { useState, useEffect } from 'react'
2
+import { Upload, Button, Icon } from 'antd';
3
+import { uploaderProps } from '../../utils/upload';
4
+
5
+function fileUpload(props) {
6
+
7
+  const { value } = props
8
+  console.log('fileUploadProps: ', props)
9
+  // eslint-disable-next-line react-hooks/rules-of-hooks
10
+  const [defaultFileList, setDefaultFileList] = useState([])
11
+
12
+  // eslint-disable-next-line react-hooks/rules-of-hooks
13
+  useEffect(() => {
14
+    setDefaultValue()
15
+  }, [props.value]);
16
+
17
+
18
+  function getFileList() {
19
+    return (value || []).map((img, inx) => ({ uid: inx, url: img, name: img.substring(img.lastIndexOf('/') + 1, img.length), status: 'done' }))
20
+  }
21
+
22
+  function setDefaultValue() {
23
+    if (!value) {
24
+      return;
25
+    }
26
+
27
+    setDefaultFileList(getFileList())
28
+  }
29
+
30
+  function onFileChange({ file, fileList }) {
31
+    setDefaultFileList(fileList)
32
+    if (file.status === 'uploading') {
33
+      return
34
+    }
35
+
36
+    if (file.status === 'done') {
37
+      props.onChange([].concat(file.response))
38
+    }
39
+  }
40
+
41
+  return (
42
+    <>
43
+      <Upload
44
+        { ...uploaderProps }
45
+        {...props}
46
+        onChange={onFileChange}
47
+        fileList={defaultFileList}
48
+      >
49
+        <Button>
50
+          <Icon type="upload" /> {props.label}
51
+        </Button>
52
+      </Upload>
53
+    </>
54
+  )
55
+}
56
+
57
+export default fileUpload

+ 41
- 25
src/pages/Welcome.jsx Näytä tiedosto

@@ -11,8 +11,11 @@ const welcome = (props) => {
11 11
 
12 12
   const [data, setData] = useState([])
13 13
 
14
+  const [checkData, setCheckData] = useState([])
15
+
14 16
   useEffect(() => {
15 17
     getIndexEcharts()
18
+    getBuildingReports()
16 19
   }, [])
17 20
 
18 21
   function getIndexEcharts(params) {
@@ -24,35 +27,48 @@ const welcome = (props) => {
24 27
       console.log(data, '11111')
25 28
     })
26 29
   }
30
+
31
+  function getBuildingReports() {
32
+    request({ ...apis.system.taBuildingReports, }).then((data) => {
33
+      setCheckData((data.records || []).map((x) => x.reportCode))
34
+    })
35
+  }
36
+
27 37
   return (
28 38
     <>
29 39
       <div style={{ display: 'flex', marginBottom: '33px' }}>
30
-        <div style={{
31
-          textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
32
-          boxShadow: '0px  0.106rem 14px -15px rgba(241,43,62,1)',
33
-          borderRadius: '12px', width: '32%', marginRight: '2%'
34
-        }}>
35
-          <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
36
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
37
-        </div>
38
-        <div style={{
39
-          textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
40
-          boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
41
-          borderRadius: '12px', width: '32%', marginRight: '2%'
42
-        }}>
43
-          <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
44
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
45
-        </div>
46
-        <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
47
-          textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
48
-          boxShadow: '0px  0.106rem 14px -15px rgba(107,130,230,1)',
49
-          borderRadius: '12px', width: '32%',
50
-        }}>
51
-          <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0',cursor: 'pointer' }}>最近7天新增 </span>
52
-          <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
53
-        </div>
40
+        {checkData.includes('total_number_of_users') &&
41
+          <div style={{
42
+            textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(241,43,62,1) 0%,rgba(254,144,155,1) 100%)', height: '100px',
43
+            boxShadow: '0px  0.106rem 14px -15px rgba(241,43,62,1)',
44
+            borderRadius: '12px', width: '32%', marginRight: '2%'
45
+          }}>
46
+            <span style={{ fontSize: '24px', color: '#fff' }}>总用户 </span>
47
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectUserCount || '0'}</span>
48
+          </div>
49
+        }
50
+        {checkData.includes('total_number_of_registered_users') &&
51
+          <div style={{
52
+            textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
53
+            boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
54
+            borderRadius: '12px', width: '32%', marginRight: '2%'
55
+          }}>
56
+            <span style={{ fontSize: '24px', color: '#fff' }}>总注册用户 </span>
57
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
58
+          </div>
59
+        }
60
+        {checkData.includes('number_of_new_users') &&
61
+          <div onClick={() => router.push('/indexEcharts/newUsers')} style={{
62
+            textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
63
+            boxShadow: '0px  0.106rem 14px -15px rgba(107,130,230,1)',
64
+            borderRadius: '12px', width: '32%',
65
+          }}>
66
+            <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0',cursor: 'pointer' }}>最近7天新增 </span>
67
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
68
+          </div>
69
+        }
54 70
       </div>
55
-      <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} ></IndexEcharts>
71
+      <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} checkData={checkData}></IndexEcharts>
56 72
     </>
57 73
   )
58 74
 

+ 136
- 82
src/pages/activity/ActivityList.jsx Näytä tiedosto

@@ -1,9 +1,9 @@
1 1
 import React, { useState, useEffect } from 'react';
2 2
 import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import styles from '../style/GoodsList.less';
5 4
 import router from 'umi/router';
6 5
 import moment from 'moment';
6
+import styles from '../style/GoodsList.less';
7 7
 import SelectCity from '../../components/SelectButton/CitySelect'
8 8
 import BuildSelect from '../../components/SelectButton/BuildSelect'
9 9
 import apis from '../../services/apis';
@@ -16,23 +16,24 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
16 16
 const header = props => {
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18 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
- const getList = params => {
23
-  request({ ...apis.activity.list, params: { ...params } }).then(data => {
22
+  // 查询列表
23
+  const getList = params => {
24
+    request({ ...apis.activity.list, params: { ...params } }).then(data => {
24 25
       console.log(data)
25 26
       setData(data)
26
-  })
27
-}
27
+    })
28
+  }
28 29
 
29 30
   // eslint-disable-next-line react-hooks/rules-of-hooks
30 31
   useEffect(() => {
31 32
     getList({ pageNum: 1, pageSize: 10 });
32 33
   }, [])
33 34
 
34
-// 跳转到编辑商品
35
-const toEditGoods = dynamicId => () => {
35
+  // 跳转到编辑商品
36
+  const toEditGoods = dynamicId => () => {
36 37
     router.push({
37 38
       pathname: '/activity/editActivity',
38 39
       query: {
@@ -41,6 +42,23 @@ const toEditGoods = dynamicId => () => {
41 42
     });
42 43
   }
43 44
 
45
+  const newQrcode = row => {
46
+    const x = new XMLHttpRequest();
47
+    const resourceUrl = row.qrCode
48
+    x.open('GET', resourceUrl, true);
49
+    x.responseType = 'blob';
50
+    x.onload = function (e) {
51
+      const url = window.URL.createObjectURL(x.response)
52
+      const a = document.createElement('a');
53
+      a.href = url;
54
+      a.style.display = 'none'
55
+      a.download = '活动二维码.png';
56
+      a.click();
57
+    }
58
+    x.send();
59
+  }
60
+
61
+
44 62
   /**
45 63
    *
46 64
    *
@@ -53,44 +71,64 @@ const toEditGoods = dynamicId => () => {
53 71
       dataIndex: 'title',
54 72
       key: 'title',
55 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;
56 80
     },
57 81
     {
58 82
       title: '活动时间',
59 83
       dataIndex: 'startDate',
60 84
       key: 'startDate',
61 85
       align: 'center',
62
-      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>
86
+      // width: '15%',
87
+      // width: '20%',
88
+      render: (x, row) => <><span>{`${moment(row.startDate).format('YYYY-MM-DD')} —— ${moment(row.endDate).format('YYYY-MM-DD')}`}</span></>,
63 89
     },
64 90
     {
65 91
       title: '已参加人数',
66 92
       dataIndex: 'count',
67 93
       key: 'count',
68 94
       align: 'center',
95
+      // width: '10%',
96
+      // width: '6%',
69 97
     },
70 98
     {
71 99
       title: '阅读量',
72 100
       dataIndex: 'pvNum',
73 101
       key: 'pvNum',
74 102
       align: 'center',
103
+      // width: '10%',
75 104
     },
76 105
     {
77 106
       title: '转发量',
78 107
       dataIndex: 'shareNum',
79 108
       key: 'shareNum',
80 109
       align: 'center',
110
+      // width: '10%',
81 111
     },
82 112
     {
83 113
       title: '收藏数',
84 114
       dataIndex: 'saveNum',
85 115
       key: 'saveNum',
86 116
       align: 'center',
117
+      // width: '10%',
87 118
     },
88 119
     {
89
-      title: '状态',
120
+      title: '报名状态',
90 121
       dataIndex: 'activityStatus',
91 122
       key: 'activityStatus',
92 123
       align: 'center',
93
-      render: activityStatus => <><span>{activityStatus == 0 ? "进行中" : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
124
+      // width: '10%',
125
+      render: activityStatus => <><span>{activityStatus == 0 ? '进行中' : activityStatus == 1 ? '未开始' : '已结束'}</span></>,
126
+    },
127
+    {
128
+      title: '权重',
129
+      dataIndex: 'heavy',
130
+      key: 'heavy',
131
+      align: 'center',
94 132
     },
95 133
     {
96 134
       title: '操作',
@@ -100,111 +138,125 @@ const toEditGoods = dynamicId => () => {
100 138
       render: (x, row) => (
101 139
         <>
102 140
           <AuthButton name="admin.SignList.get" noRight={null}>
103
-            <span style={{ color: '#1990FF', cursor: 'pointer'}} onClick={getSignList.bind(this, row.dynamicId)}>{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>}
104 142
           </AuthButton>
105 143
           <AuthButton name="admin.buildingDynamic.send.dynamicId.put" noRight={null}>
106
-            <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>
107 145
           </AuthButton>
108 146
           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
109
-            {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>}
110 148
           </AuthButton>
111 149
           <AuthButton name="admin.buildingDynamic.update.put" noRight={null}>
112
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
113
-            {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>}
114 152
           </AuthButton>
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>}
115 154
         </>
116
-      )
155
+      ),
117 156
     },
118 157
   ];
119
-
120 158
   const getSignList = dynamicId => {
121
-      router.push({
122
-          pathname: '/activity/SignList',
123
-          query: {
124
-              dynamicId,
125
-          },
126
-        });
159
+    router.push({
160
+      pathname: '/activity/SignList',
161
+      query: {
162
+        dynamicId,
163
+      },
164
+    });
127 165
   }
128 166
 
129 167
   const finishDynamic = row => {
130
-      Modal.confirm({
131
-          title: '结束以后将无法编辑, 是否继续?',
132
-          okText: '确定',
133
-          cancelText: '取消',
134
-          onOk() {
135
-              request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: "" } }).then(data => {
136
-                  console.log(data)
137
-                  message.info('操作成功!')
138
-                  getList({ pageNum: 1, pageSize: 10 })
139
-              }).catch(err => {
140
-                  console.log(err)
141
-                  message.info(err.msg || err.message)
142
-              })
143
-          },
144
-        });
145
-  }
146
-
147
-//   置顶
148
-  const topDynamic = row => () => {
149
-      const weight = Math.abs(row.weight - 1)
150
-      request({ ...apis.activity.weight, params: {dynamicId: row.dynamicId, weight} }).then(data => {
168
+    Modal.confirm({
169
+      title: '结束以后将无法编辑, 是否继续?',
170
+      okText: '确定',
171
+      cancelText: '取消',
172
+      onOk () {
173
+        request({ ...apis.activity.finish, data: { dynamicId: row.dynamicId, top: '' } }).then(data => {
151 174
           console.log(data)
152 175
           message.info('操作成功!')
153
-          getList({ pageNum: 1, pageSize: 10 })
154
-      }).catch(err => {
176
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
177
+        }).catch(err => {
155 178
           console.log(err)
156 179
           message.info(err.msg || err.message)
157
-      })
180
+        })
181
+      },
182
+    });
183
+  }
184
+
185
+  //   置顶
186
+  const topDynamic = row => () => {
187
+    const weight = Math.abs(row.weight - 1)
188
+    request({ ...apis.activity.weight, params: { dynamicId: row.dynamicId, weight } }).then(data => {
189
+      console.log(data)
190
+      message.info('操作成功!')
191
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
192
+    }).catch(err => {
193
+      console.log(err)
194
+      message.info(err.msg || err.message)
195
+    })
158 196
   }
159
-  
197
+
160 198
   const sendOrPublicDynamic = row => {
161
-      if (row.status === 1) {
162
-          cancelDynamic(row)
163
-      } else {
164
-          sendDynamic(row)
165
-      }
199
+    if (row.status === 1) {
200
+      cancelDynamic(row)
201
+    } else {
202
+      sendDynamic(row)
203
+    }
166 204
   }
167
-  
205
+
168 206
   // 取消活动
169 207
   const cancelDynamic = row => {
170
-      request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
171
-          message.info('操作成功!')
172
-          getList({ pageNum: 1, pageSize: 10 })
173
-      }).catch((err) => {
174
-          console.log(err)
175
-          message.info(err.msg || err.message)
176
-      })
208
+    request({ ...apis.activity.cancel, urlData: { id: row.dynamicId } }).then(data => {
209
+      message.info('操作成功!')
210
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue()  })
211
+    }).catch(err => {
212
+      console.log(err)
213
+      message.info(err.msg || err.message)
214
+    })
177 215
   }
178
-  
179
-  //发布活动
216
+
217
+  // 发布活动
180 218
   const sendDynamic = row => {
181
-      request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
182
-          message.info('操作成功!')
183
-          getList({ pageNum: 1, pageSize: 10 });
184
-      }).catch((err) => {
185
-          console.log(err)
186
-          message.info(err.msg || err.message)
187
-      })
219
+    request({ ...apis.activity.send, urlData: { id: row.dynamicId } }).then(data => {
220
+      message.info('操作成功!')
221
+      getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
222
+    }).catch(err => {
223
+      console.log(err)
224
+      message.info(err.msg || err.message)
225
+    })
188 226
   }
189
-  
227
+
190 228
   const changePageNum = pageNumber => {
191
-      getList({ pageNum: pageNumber, pageSize: 10 })
229
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
192 230
   }
193 231
 
194 232
   // 提交事件
195
-const handleSubmit = (e, props) => {
233
+  const handleSubmit = e => {
196 234
     e.preventDefault();
197 235
     props.form.validateFields((err, values) => {
198 236
       if (!err) {
199 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
+        
200 244
         getList({ pageNum: 1, pageSize: 10, ...values })
201 245
       }
202 246
     });
203 247
   }
204 248
 
205
-   //重置搜索
206
-   function handleReset() {
249
+  // 重置搜索
250
+  function handleReset () {
207 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)
208 260
   }
209 261
 
210 262
 
@@ -212,7 +264,9 @@ const handleSubmit = (e, props) => {
212 264
   return (
213 265
 
214 266
     <>
215
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
267
+      {/* style={{ display: 'none' }} */}
268
+      <div id="qrcode"></div>
269
+      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
216 270
         <Form.Item>
217 271
           {getFieldDecorator('cityId')(
218 272
             <SelectCity />,
@@ -233,7 +287,7 @@ const handleSubmit = (e, props) => {
233 287
         </Form.Item>
234 288
         <Form.Item>
235 289
           {getFieldDecorator('time')(
236
-            <DatePicker />
290
+            <DatePicker onChange={timeOnChange}/>,
237 291
           )}
238 292
         </Form.Item>
239 293
         <Form.Item>
@@ -249,16 +303,16 @@ const handleSubmit = (e, props) => {
249 303
             搜索
250 304
           </Button>
251 305
           <Button style={{ marginLeft: 8 }} onClick={handleReset}>
252
-              重置
306
+            重置
253 307
             </Button>
254 308
         </Form.Item>
255 309
       </Form>
256 310
       <AuthButton name="admin.buildingDynamic.add.post" noRight={null}>
257 311
         <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
258 312
       </AuthButton>
259
-      <Table dataSource={data.list} columns={columns} pagination={false} rowKey="activityList"/>
313
+      <Table dataSource={data.list} columns={columns} pagination={false} rowKey="activityList" />
260 314
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
261
-       <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={(e) => changePageNum(e)} />
315
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
262 316
       </div>
263 317
     </>
264 318
   )

+ 88
- 8
src/pages/activity/SignList.jsx Näytä tiedosto

@@ -41,7 +41,7 @@ const columns = [
41 41
     dataIndex: 'createDate',
42 42
     key: 'createDate',
43 43
     align: 'center',
44
-    render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD')}`}</span></>
44
+    render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD')}`}</span></>,
45 45
   },
46 46
   {
47 47
     title: '推广人',
@@ -55,20 +55,32 @@ const columns = [
55 55
     key: 'orgName',
56 56
     align: 'center',
57 57
   },
58
+  {
59
+    title: '状态',
60
+    dataIndex: 'isCheckin',
61
+    key: 'isCheckin',
62
+    align: 'center',
63
+    render: (x, row) => <><span>{row.isCheckin === 1 ? '已签到' : '未签到'}</span></>,
64
+  },
58 65
 ];
59 66
 
60 67
 
61 68
 
62
-const header = (props) => {
63
-  const [ data, setData ] = useState({list: {}})
69
+const header = props => {
70
+  const [data, setData] = useState({list: {}})
64 71
 //   const [page, changePage] = useState({})
72
+// 存入导入数据的值
73
+const { getFieldDecorator, getFieldsValue } = props.form
74
+  // eslint-disable-next-line react-hooks/rules-of-hooks
65 75
   useEffect(() => {
66
-    getSignList({pageNum: 1,pageSize: 10, dynamicId: props.location.query.dynamicId });
67
-  },[])
76
+    // eslint-disable-next-line no-use-before-define
77
+    getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId });
78
+  }, [])
68 79
 
69 80
   // 查询列表
70
-  const getSignList = (params) => {
71
-    request({ ...apis.activity.signList, params: { ...params },}).then((data) => {
81
+  const getSignList = params => {
82
+    // eslint-disable-next-line no-shadow
83
+    request({ ...apis.activity.signList, params: { ...params } }).then(data => {
72 84
         console.log(data)
73 85
         setData(data)
74 86
     })
@@ -83,13 +95,81 @@ const header = (props) => {
83 95
       pathname: '/activity/ActivityList',
84 96
     });
85 97
   }
98
+    // 提交事件
99
+// eslint-disable-next-line no-shadow
100
+const handleSubmit = (e, props) => {
101
+    e.preventDefault();
102
+    props.form.validateFields((err, values) => {
103
+      getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId, isCheckin: values.isCheckin, name: values.name, phone: values.phone })
104
+    });
105
+  }
106
+   // 重置搜索
107
+   function handleReset() {
108
+    props.form.resetFields();
109
+    getSignList({ pageNum: 1, pageSize: 10, dynamicId: props.location.query.dynamicId })
110
+  }
111
+ // eslint-disable-next-line class-methods-use-this
112
+ function exportHelp() {
113
+  const fieldsValue = getFieldsValue()
114
+  console.log('fieldsValue', fieldsValue)
115
+    request({ ...apis.activity.getTaActivityDynamicEnlistExport, params: { ...fieldsValue, dynamicId: props.location.query.dynamicId } })
116
+      .then(data => {
117
+        if (!data) {
118
+          return
119
+        }
120
+        const url = window.URL.createObjectURL(new Blob([data]))
121
+        const link = document.createElement('a')
122
+        link.style.display = 'none'
123
+        link.href = url
124
+        link.setAttribute('download', '助力者记录.xlsx')
125
+        document.body.append(link)
126
+        link.click()
127
+      }).catch(() => {
128
+
129
+      })
130
+  }
86 131
 
87 132
   return (
88 133
     <>
134
+    <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
135
+        <Form.Item>
136
+          {getFieldDecorator('isCheckin')(
137
+            <Select style={{ width: '180px' }} placeholder="签到状态">
138
+              <Option value="0">未签到</Option>
139
+              <Option value="1">已签到</Option>
140
+            </Select>,
141
+          )}
142
+        </Form.Item>
143
+        <Form.Item>
144
+          {getFieldDecorator('name')(
145
+            <Input
146
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
147
+              placeholder="用户姓名"
148
+            />,
149
+          )}
150
+        </Form.Item>
151
+        <Form.Item>
152
+          {getFieldDecorator('phone')(
153
+            <Input
154
+              prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
155
+              placeholder="手机号"
156
+            />,
157
+          )}
158
+        </Form.Item>
159
+        <Form.Item>
160
+          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
161
+            搜索
162
+          </Button>
163
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
164
+              重置
165
+            </Button>
166
+        </Form.Item>
167
+      </Form>
89 168
       <Button type="primary" className={styles.addBtn} onClick={toActivityList}>返回</Button>
169
+      <Button name="admin.activityDynamicEnlist.export.get" noRight={null} type="primary" style={{ marginLeft: '85%' }} onClick={exportHelp}>导出</Button>
90 170
       <Table dataSource={data.list.data} columns={columns} pagination={false} rowKey="activity"/>
91 171
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
92
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
172
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
93 173
       </div>
94 174
     </>
95 175
   )

+ 92
- 56
src/pages/activity/drainage/Detail.jsx Näytä tiedosto

@@ -7,13 +7,14 @@ import moment from 'moment';
7 7
 import apis from '../../../services/apis';
8 8
 import request from '../../../utils/request';
9 9
 import { SSL_OP_SSLEAY_080_CLIENT_DH_BUG } from 'constants';
10
-
10
+import AuthButton from '../../../components/AuthButton';
11
+import { timeout } from 'q';
11 12
 
12 13
 
13 14
 const data = []
14 15
 
15 16
 const header = (props) => {
16
-  const drainageId = props.location.query.drainageId
17
+  const { drainageId, name } = props.location.query
17 18
 
18 19
 
19 20
   const [datas, setDatas] = useState([])
@@ -21,8 +22,7 @@ const header = (props) => {
21 22
   const [columns, setColumns] = useState([])
22 23
   const [startDate, setStartDate] = useState('')
23 24
   const [endDate, setEndDate] = useState('')
24
-  const [total,setTotal] = useState({})
25
-  let daterange = []
25
+  const [total, setTotal] = useState({})
26 26
   // let content = {}
27 27
   useEffect(() => {
28 28
 
@@ -33,20 +33,19 @@ const header = (props) => {
33 33
   function gettaDrainageRecord (params) {
34 34
     request({ ...apis.activity.taDrainageRecord, params: { ...params } }).then((data) => {
35 35
       // setDatas(data) 
36
-      console.log(data.total, '3333333333333')
37
-      if(data.total!=0){
38
-      setTotal(data)
39
-      // console.log(data.total, '3333333333333')
40
-     
41
-      setDatas(tableData(data.records))
42
-      // content = data.records[0]
43
-      console.log('json: ', eval('(' + data.records[0].content + ')'))
44
-      setContent(eval('(' + data.records[0].content + ')'))
45
-      setColumns(tableTitle(eval('(' + data.records[0].content + ')')))
46
-    }
47
-    else{
48
-      message.info('数据为空')
49
-    }
36
+      console.log(data, '3333333333333')
37
+      if (data.total != 0) {
38
+        setTotal(data)
39
+        setDatas(tableData(data.records))
40
+        // content = data.records[0]
41
+        console.log('json: ', eval('(' + data.records[0].content + ')'))
42
+        setContent(eval('(' + data.records[0].content + ')'))
43
+        setColumns(tableTitle(data.records))
44
+      }
45
+      else {
46
+        setDatas([])
47
+        message.info('数据为空')
48
+      }
50 49
 
51 50
 
52 51
 
@@ -56,11 +55,13 @@ const header = (props) => {
56 55
     })
57 56
   }
58 57
   function tableData (data) {
59
-    console.log('data', data)
58
+    console.log('tabledata', data)
60 59
     return data.map((row, inx) => {
61 60
       return eval('(' + row.content + ')').reduce((acc, col) => {
62 61
         const r = {
62
+
63 63
           key: inx + 1,
64
+          createDate: row.createDate,
64 65
           [`${col.key}`]: col.value,
65 66
           ...acc,
66 67
         }
@@ -71,39 +72,51 @@ const header = (props) => {
71 72
   }
72 73
 
73 74
   function tableTitle (data) {
74
-    return data.map((item) => {
75
+    tableTitle = eval('(' + data[0].content + ')')
76
+    const cols = [{
77
+      title: "提交时间",
78
+      dataIndex: "createDate",
79
+      key: "createDate",
80
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
81
+    }]
82
+    return cols.concat(tableTitle.map((item) => {
75 83
       const col = {
76 84
         title: item.label,
77 85
         dataIndex: item.key,
78 86
         key: item.key
79 87
       }
80 88
       return col
81
-    })
89
+    }))
82 90
   }
91
+  // function datalist () {
83 92
 
93
+  //   gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
94
+  // }
84 95
 
85
-  function datalist() {
86
-
87
-    gettaDrainageRecord({ pageNum: 1, pageSize: 10, drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate)  })
88
-  }
89
-
90
-  function fromTime(str) {
96
+  function fromTime (str) {
91 97
     return str === '' ? null : `${moment(str).format('YYYY-MM-DDT00:00:00.000')}Z`
92 98
   }
93 99
 
94
-  function onChangetime(dates, dateStrings) {
95
- 
100
+  function Time (str) {
101
+    return str === '' ? null : `${moment(str).format('YYYY-MM-DD')}`
102
+  }
103
+  // 2019-10-30T11:04:49
104
+  function onChangetime (dates, dateStrings) {
105
+    console.log(dateStrings[1])
96 106
     setEndDate(dateStrings[1])
97 107
     setStartDate(dateStrings[0])
98
-    
108
+
99 109
   }
100 110
 
101 111
   const changePageNum = pageNumber => {
102
-    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10 ,drainageId: drainageId, startTime: fromTime(startDate) ,endTime: fromTime(endDate)})
103
-}
104
-  function excelPort(){
112
+    gettaDrainageRecord({ pageNum: pageNumber, pageSize: 10, drainageId: drainageId, startTime: Time(startDate), endTime: Time(endDate) })
113
+  }
114
+
115
+
116
+  function excelPort () {
105 117
     // const fieldsValue = getFieldsValue()
106
-    request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId ,startTime: fromTime(startDate) ,endTime: fromTime(endDate) }  })
118
+
119
+    request({ ...apis.activity.exporttaDrainageRecord, params: { drainageId: drainageId, startTime: fromTime(startDate), endTime: fromTime(endDate) } })
107 120
       .then(response => {
108 121
         download(response)
109 122
       }).catch(error => {
@@ -126,31 +139,54 @@ const header = (props) => {
126 139
     link.click()
127 140
   }
128 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
+
129 154
   const { RangePicker } = DatePicker;
155
+  const { getFieldDecorator } = props.form
130 156
   return (
131 157
     <>
132
-
133
-<RangePicker
134
-          style={{ width: '400px' }}
135
-          // ranges={{
136
-          //   Today: [moment(), moment()],
137
-          //   'This Month': [moment().startOf('month'), moment().endOf('month')],
138
-          // }}
139
-          // 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')]}
140
-          showTime
141
-          onChange={onChangetime}
142
-        />
143
-        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
144
-          搜索
145
-      </Button>
146
-    
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>
147 176
       <div>
148
-        {/* H5项目名称 */}
149
-        {}  <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px',marginBottom: '30px' }} onClick={excelPort}>导出数据</Button>
150
-        <Table columns={columns} dataSource={datas}  pagination={false} />
177
+        <div style={{ display: 'flex', justifyContent: 'space-between' }}>
178
+          <div style={{ lineHeight: '92px', width: '600px', fontWeight: 'bold', fontSize: '18px' }}>
179
+            H5项目:{name}
180
+          </div>
181
+          {/* H5项目名称 style={{ float: 'right', margin: '20px 0', zIndex: 1 }} */}
182
+          <AuthButton name="admin.taDrainageRecord.export.get" noRight={null}>
183
+            <Button type="primary" style={{ marginLeft: '30px', float: 'right', marginTop: '30px', marginBottom: '30px', zIndex: 1 }} onClick={excelPort}>导出数据</Button>
184
+          </AuthButton>
185
+        </div>
186
+        <Table columns={columns} dataSource={datas} pagination={false} />
151 187
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
152
-       <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} />
153
-      </div>
188
+          <Pagination showQuickJumper defaultCurrent={1} total={total.total} onChange={(e) => changePageNum(e)} current={total.current} />
189
+        </div>
154 190
       </div>
155 191
 
156 192
 
@@ -159,6 +195,6 @@ const header = (props) => {
159 195
     </>
160 196
   )
161 197
 }
198
+const WrappedHeader = Form.create({ name: 'header' })(header);
162 199
 
163
-
164
-export default header
200
+export default WrappedHeader

+ 156
- 110
src/pages/activity/drainage/DrainageList.jsx Näytä tiedosto

@@ -7,32 +7,18 @@ import apis from '../../../services/apis';
7 7
 import request from '../../../utils/request';
8 8
 import XForm, { FieldTypes } from '../../../components/XForm';
9 9
 import moment from 'moment';
10
+import AuthButton from '../../../components/AuthButton';
10 11
 
11
-const toEditList = (drainageId) => () => {
12
-  console.log(drainageId,'12344567')
12
+const toEditList = (row) => () => {
13 13
   router.push({
14 14
     pathname: '/activity/drainage/Detail',
15 15
     query: {
16
-      drainageId
16
+      drainageId: row.drainageId,
17
+      name: row.name,
17 18
     },
18 19
   });
19 20
 }
20 21
 
21
-
22
-
23
-const data = [
24
-
25
-  {
26
-    Id: '1',
27
-    name: 'zls',
28
-    // StartTime:'',
29
-    // EndTime:'',
30
-    number: 33,
31
-  }
32
-
33
-
34
-];
35
-
36 22
 const header = (props) => {
37 23
   // const [data, setData] = useState({ data: [] })
38 24
   const [datas, setDatas] = useState([])//表格数据
@@ -47,11 +33,11 @@ const header = (props) => {
47 33
       visible: false,
48 34
       confirmLoading: false,
49 35
     })
50
-    
36
+
51 37
   }, [])
52 38
 
53 39
   function gettaDrainage (params) {
54
-    request({ ...apis.activity.taDrainage, params: params  }).then((data) => {
40
+    request({ ...apis.activity.taDrainage, params: params }).then((data) => {
55 41
       setDatas(data)
56 42
       console.log(data.records, '_213_')
57 43
     }).catch((err) => {
@@ -65,18 +51,18 @@ const header = (props) => {
65 51
       title: '确认删除该引流?',
66 52
       okText: '确认',
67 53
       cancelText: '取消',
68
-      onOk() {
69
-        request({ ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }).then((data) => {
54
+      onOk () {
55
+        request({ ...apis.activity.deletetaDrainage, urlData: { id: drainageIid }, }).then((data) => {
70 56
           message.info('操作成功!')
71 57
           gettaDrainage({ pageNum: 1, pageSize: 10 })
72 58
         }).catch((err) => {
73
-          console.log('111111',err)
74
-          message.info(err.msg || err.message)
59
+          console.log('111111', err)
60
+          // message.info(err.msg || err.message)
75 61
         })
76 62
       }
77 63
     });
78 64
   }
79
-  
65
+
80 66
   const columns = [
81 67
     {
82 68
       title: 'H5项目编号',
@@ -89,14 +75,18 @@ const header = (props) => {
89 75
       dataIndex: 'name',
90 76
       key: 'name',
91 77
       align: 'center',
92
-      render: (text, datas) => <div style={ { color: '#66B3FF' } } onClick= {() => addshowModal(datas)} >{ datas.name }</div>,
78
+      render: (text, datas) => <>
79
+
80
+        <div style={{ color: '#66B3FF' }} onClick={() => addshowModal(datas)} >{datas.name}</div>
81
+
82
+      </>
93 83
     },
94 84
     {
95 85
       title: 'appid',
96 86
       dataIndex: 'appid',
97 87
       key: 'appid',
98 88
       align: 'center',
99
-      // 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>, 
100 90
     },
101 91
     {
102 92
       title: 'secret',
@@ -112,7 +102,7 @@ const header = (props) => {
112 102
       align: 'center',
113 103
       render: (x, row) => (
114 104
         <>
115
-          <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>
116 106
         </>
117 107
       ),
118 108
     },
@@ -123,7 +113,7 @@ const header = (props) => {
123 113
       align: 'center',
124 114
       render: (x, row) => (
125 115
         <>
126
-          <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>
127 117
         </>
128 118
       ),
129 119
     },
@@ -140,75 +130,66 @@ const header = (props) => {
140 130
       align: 'center',
141 131
       render: (text, datas) => (
142 132
         <>
143
-          <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas.drainageId)}>
144
-            查看详情
133
+          <AuthButton name="admin.customer.recommend.edit.id.put" noRight={null}>
134
+            <span style={{ right: '20px', top: '20px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={toEditList(datas)}>
135
+              查看详情
145 136
             </span>
146
-  
147
-          <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={deleteDrainage(datas.drainageId)}>
148
-            删除
137
+          </AuthButton>
138
+          <AuthButton name="admin.taDrainage.id.delete" noRight={null}>
139
+            <span style={{ right: '20px', bottom: ' 10px', fontSize: ' 0.106rem', color: '#FF7E48', cursor: 'pointer', marginLeft: 20 }} onClick={deleteDrainage(datas.drainageId)}>
140
+              删除
149 141
             </span>
142
+          </AuthButton >
150 143
         </>
151 144
       ),
152 145
     },
153 146
   ];
154 147
   const Forms = props => {
155
-   
156
-    console.log(date,'---------------')
157
-    console.log(formsdate,'---------------')
158
-    console.log(formsdate,'22222222')
159
-    const fields = [
160
-      {
161
-        label: 'H5项目名称',
162
-        name: 'name',
163
-        type: FieldTypes.Text,
164
-        placeholder:"请输入H5项目名称",
165
-        value: formsdate.name,
166
-
167
-      },
168
-      {
169
-        label: '截止时间',
170
-        name: 'endDate',
171
-        type: FieldTypes.DatePicker,
172
-        value:formsdate.endDate ? moment(formsdate.endDate, 'YYYY-MM-DD HH:mm') : null
173
-        // render: <DatePicker placeholder="截止时间" value= {formsdate.endDate} />,
174
-      },
175 148
 
149
+    console.log(date, '---------------')
150
+    console.log(formsdate.name, '---------------')
151
+    console.log(formsdate, '22222222')
176 152
 
177
-    ]
178 153
 
179
-    const handleSubmit = val => {
180
-      console.log(date,'111---------------')
181
-    console.log(formsdate,'111---------------')
182
-    console.log(formsdate,'11122222222')
183
-      // data: { ...submitValue }
184
-
185
-      console.log(formsdate.drainageId,'9999999999999')
186
-      if (formsdate.drainageId) {
187
-        // { ...apis.activity.deletetaDrainage,urlData: { id: drainageIid }, }
188
-        request({ ...apis.activity.updatetaDrainage, urlData: { id: formsdate.drainageId }, data: val}).then((data) => {
189
-          message.info('操作成功!')
190
-          // gettaDrainage({ pageNum: 1, pageSize: 10 })
191
-        }).catch((err) => {
192
-          console.log('111111',err)
193
-          message.info(err.msg || err.message)
194
-        })
195
-       
196
-      } else {
197
-
198
-     
199
-
200
-        request({ ...apis.activity.addtaDrainage, data: val }).then((data) => {
201
-          message.info("保存成功")
202
-          console.log(data, '22222')
203
-          
204
-        }).catch((err) => {
205
-          message.error(err.msg || err.message)
206
-        })
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 })
207 158
       }
208
-      setDate({
209
-        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
+        }
210 192
       });
211
-      gettaDrainage({ pageNum: 1, pageSize: 10 })
212 193
     }
213 194
 
214 195
     const handleCancel = val => {
@@ -217,47 +198,111 @@ const header = (props) => {
217 198
       });
218 199
     }
219 200
 
220
-    return <XForm onSubmit={handleSubmit} onCancel={handleCancel}  fields={fields}></XForm>
221
-    
222
-  }
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
+    };
213
+
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
+    };
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>
258
+
259
+  }
260
+  const Formss = Form.create({ name: 'Forms' })(Forms);
224 261
 
225 262
 
226 263
 
227 264
   //重置搜索
228 265
   function handleReset () {
229 266
     props.form.resetFields();
267
+    gettaDrainage({ pageNum: 1, pageSize: 10 })
230 268
   }
231 269
 
232
-  
270
+
233 271
 
234 272
   function addshowModal (datas) {
235 273
 
236 274
     // alert(datas.drainageId)
237
-console.log(datas,'22222222')
275
+    console.log(datas, '22222222')
238 276
     setFormsDate({
239
-      drainageId:datas.drainageId,
240
-      name:datas.name,
241
-      endDate:datas.endDate,
277
+      drainageId: datas.drainageId,
278
+      name: datas.name,
279
+      endDate: datas.endDate,
242 280
     })
243
-    console.log(formsdate,'22222222')
281
+    console.log(formsdate, '22222222')
244 282
     setDate({
245 283
       visible: true,
284
+      title: "修改H5项目"
246 285
     });
286
+
287
+
288
+    console.log('form :', props.form)
289
+
290
+
247 291
   };
248 292
   function showModal () {
249 293
     setFormsDate({
250
-      drainageId:'',
251
-      name:'',
252
-      endDate:'',
294
+      drainageId: '',
295
+      name: '',
296
+      endDate: '',
253 297
     })
254 298
     setDate({
255 299
       visible: true,
300
+      title: '新建H5项目'
256 301
     });
257 302
   };
258 303
   const changePageNum = pageNumber => {
259 304
     gettaDrainage({ pageNum: pageNumber, pageSize: 10 })
260
-}
305
+  }
261 306
 
262 307
   function handleOk () {
263 308
 
@@ -280,7 +325,7 @@ console.log(datas,'22222222')
280 325
       visible: false,
281 326
     });
282 327
   };
283
-  function handleSubmit(e) {
328
+  function handleSubmit (e) {
284 329
     e.preventDefault();
285 330
     props.form.validateFields((err, values) => {
286 331
       console.log('values', values)
@@ -292,7 +337,7 @@ console.log(datas,'22222222')
292 337
   }
293 338
 
294 339
   const { getFieldDecorator } = props.form;
295
-  const { visible, confirmLoading, ModalText } = date;
340
+  const { visible, confirmLoading, ModalText, title } = date;
296 341
   return (
297 342
     <>
298 343
       <div>
@@ -315,7 +360,7 @@ console.log(datas,'22222222')
315 360
               />,
316 361
             )}
317 362
           </Form.Item>
318
-          <Form.Item>
363
+          <Form.Item >
319 364
             <Button type="primary" htmlType="submit" className={styles.searchBtn} onClick>
320 365
               搜索
321 366
           </Button>
@@ -324,23 +369,24 @@ console.log(datas,'22222222')
324 369
             </Button>
325 370
           </Form.Item>
326 371
         </Form>
327
-        {/* <AuthButton name="admin.buildingDynamic.add.post" noRight={null}> */}
328
-        <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
329
-
372
+        <AuthButton name="admin.taDrainage.add.post" noRight={null}>
373
+          <Button type="danger" className={styles.addBtn} onClick={showModal}>新增</Button>
374
+        </AuthButton>
330 375
         <Modal
331
-          title="新建H5项目"
376
+          title={title}
377
+
332 378
           visible={visible}
333 379
           //  onOk={handleOk}
334 380
           confirmLoading={confirmLoading}
335 381
           onCancel={handleCancel}
336 382
           footer={null}
337 383
         >
338
-          <Forms />
384
+          <Formss formsDate={formsdate} />
339 385
         </Modal>
340
-        <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList"/>
386
+        <Table columns={columns} dataSource={datas.records} pagination={false} rowKey="drainageList" />
341 387
         <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
342
-       <Pagination showQuickJumper defaultCurrent={1} total={datas.total} onChange={(e) => changePageNum(e)} />
343
-      </div>
388
+          <Pagination showQuickJumper defaultCurrent={1} total={datas.total} onChange={(e) => changePageNum(e)} current={datas.current} />
389
+        </div>
344 390
       </div>
345 391
     </>
346 392
   )

+ 1
- 0
src/pages/activity/editActivity.jsx Näytä tiedosto

@@ -366,6 +366,7 @@ const Edit = props => {
366 366
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
367 367
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
368 368
       </div>
369
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '250px' }}>图片比例: 5:4</p>
369 370
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
370 371
       <Button onClick={() => router.go(-1)}>取消</Button>
371 372
     </div>

+ 2
- 1
src/pages/activity/groupActivity/editGroupActivity.jsx Näytä tiedosto

@@ -140,7 +140,7 @@ const Edit = props => {
140 140
       submitValue.endTime = moment(endTime).format('YYYY-MM-DD HH:mm');
141 141
       console.log('submit data --->', submitValue)
142 142
       if (groupActivityId) {
143
-        submitValue.groupActicityId = groupActivityId
143
+        submitValue.groupActivityId = groupActivityId
144 144
         request({ ...apis.groupActivity.update, data: submitValue }).then((data) => {
145 145
           message.info("保存成功")
146 146
           cancelPage()
@@ -334,6 +334,7 @@ const Edit = props => {
334 334
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
335 335
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
336 336
       </div>
337
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '250px' }}>图片比例: 5:4</p>
337 338
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
338 339
       <Button onClick={() => router.go(-1)}>取消</Button>
339 340
     </div>

+ 29
- 39
src/pages/activity/groupActivity/helpRecord.jsx Näytä tiedosto

@@ -32,7 +32,6 @@ class InviteTable extends React.Component {
32 32
 
33 33
   componentDidUpdate (preProps, preState) {
34 34
     const { groupActivityId } = this.props.visibleData
35
-    console.log("groupActivityId",this.props.visibleData);
36 35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37 36
       this.getList({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })
38 37
       this.setState({ visibleData: this.props.visibleData });
@@ -110,6 +109,7 @@ class InviteTable extends React.Component {
110 109
         dataIndex: 'createTime',
111 110
         key: 'createTime',
112 111
         align: 'center',
112
+        render: (x, row) => <><span>{row.createTime ? `${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
113 113
       },
114 114
     ]
115 115
     return (
@@ -123,7 +123,7 @@ class InviteTable extends React.Component {
123 123
           // onOk={() => this.handleOk()}
124 124
           onCancel={(e) => this.handleCancel(e)}
125 125
         >
126
-          <Button type="primary" onClick={() => this.exportChildRecord({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
126
+          <Button type="primary" name="admin.taShareChildRecord.export.get" noRight={null} onClick={() => this.exportChildRecord({ ...this.props.visibleData, pageNumber: 1, pageSize: 5 })} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
127 127
             导出
128 128
           </Button>
129 129
 
@@ -143,7 +143,7 @@ class Verifier extends React.Component {
143 143
     super(props);
144 144
     this.state = {
145 145
       groupActivityId: { id: '' },
146
-      visibleData: { visible: false, groupActivityId: '' },
146
+      visibleData: { visible: false, groupActivityId: '', recordId: '' },
147 147
     }
148 148
   }
149 149
 
@@ -161,24 +161,19 @@ class Verifier extends React.Component {
161 161
   }
162 162
 
163 163
   // 弹框确定按钮
164
-  // eslint-disable-next-line react/sort-comp
165 164
   handleOk () {
166
-    // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
167 165
   }
168 166
 
169 167
   // 弹框取消按钮
170 168
   handleCancel () {
171
-    // this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
172
-    // this.props.onCancel();
173 169
     this.props.onSuccess({groupActivityId: this.props.visibleData.groupActivityId, groupStatus: 0});
174 170
   }
175 171
 
176 172
    getVerCodeList (params) {
177 173
     request({ ...apis.groupActivity.verification, params: { ...params } }).then(res => {
178
-      // eslint-disable-next-line no-undef
179 174
       message.info('核销成功')
175
+      this.props.onSuccess({groupActivityId: this.state.visibleData.groupActivityId, groupStatus: 0});
180 176
     }).catch(err => {
181
-      // eslint-disable-next-line no-unused-expressions
182 177
       <Alert
183 178
         style={{
184 179
           marginBottom: 24,
@@ -190,15 +185,14 @@ class Verifier extends React.Component {
190 185
     })
191 186
   }
192 187
 
193
-  // eslint-disable-next-line class-methods-use-this
194 188
   verify(e) {
195
-    this.setState({ visibleData: { visible: true, groupActivityId: this.props.visibleData.groupActivityId, verificationCode: e.target.value } })
189
+    this.setState({ visibleData: { visible: true, groupActivityId: this.props.visibleData.groupActivityId, verificationCode: e.target.value, recordId: this.state.visibleData.recordId } })
196 190
   }
197 191
 
198 192
   // eslint-disable-next-line class-methods-use-this
199 193
   verification(e) {
200
-    this.getVerCodeList({ groupActivityId: this.state.visibleData.groupActivityId, verifyCode: this.state.visibleData.verificationCode })
201
-    this.props.onSuccess({groupActivityId: this.props.visibleData.groupActivityId, groupStatus: 0});
194
+    console.log("asdasdasdasd",this.state.visibleData);
195
+    this.getVerCodeList({ groupActivityId: this.state.visibleData.groupActivityId, verifyCode: this.state.visibleData.verificationCode, recordId: this.state.visibleData.recordId})
202 196
   }
203 197
 
204 198
   render () {
@@ -213,8 +207,8 @@ class Verifier extends React.Component {
213 207
           // onOk={() => this.handleOk()}
214 208
           onCancel={(e) => this.handleCancel(e)}
215 209
         >
216
-          <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
217
-           <Button onClick={(e) => this.verification(e)}>立即核销</Button>
210
+          <div><span>核销码:<input style={{marginLeft: '10px'}} onChange={this.verify.bind(this)}/></span>
211
+           <Button name="admin.taShareRecord.verificate.put" noRight={null} style={{ marginLeft: '80px', marginTop:'10px', backgroundColor:'red' }} onClick={() => this.verification()}><span style={{color:'white'}}>立即核销</span></Button>
218 212
           </div>
219 213
         </Modal>
220 214
       </>
@@ -231,7 +225,7 @@ class Verifier extends React.Component {
231 225
 function body(props) {
232 226
   const [gInviteData, setGInviteData] = useState({ visible: false, groupActivityId : '', recordId:'',  groupStatus: ''})
233 227
 
234
-  const [gVerifierData, setVerifierData] = useState({ visible: false, groupActivityId: '', verificateCode: '' })
228
+  const [gVerifierData, setVerifierData] = useState({ visible: false, groupActivityId: '', verificateCode: '', recordId: ''})
235 229
 
236 230
   const { getFieldDecorator, getFieldsValue } = props.form
237 231
 
@@ -280,6 +274,7 @@ function body(props) {
280 274
     console.log(params);
281 275
     // 网路请求
282 276
     request({ ...apis.groupActivity.shareSuccList, params: { ...params } }).then(res => {
277
+      console.log("process");
283 278
       setDataSource(res)
284 279
     }).catch(err => {
285 280
       // eslint-disable-next-line no-unused-expressions
@@ -295,7 +290,7 @@ function body(props) {
295 290
   }
296 291
 
297 292
   function displayNone() {
298
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
293
+    setGVisibleData({ visible: false})
299 294
   }
300 295
 
301 296
   // 提交事件
@@ -306,7 +301,7 @@ function body(props) {
306 301
     e.preventDefault();
307 302
     props.form.validateFields((err, values) => {
308 303
       if (!err) {
309
-        getList({ pageNum: 1, pageSize: 10, groupStatus, ...values })
304
+        getList({ pageNum: 1, pageSize: 10, groupStatus, ...values, groupActivityId })
310 305
       }
311 306
     });
312 307
   }
@@ -339,7 +334,7 @@ function body(props) {
339 334
 
340 335
   function handleReset() {
341 336
     props.form.resetFields();
342
-    getList({ pageNumber: 1, pageSize: 10, groupStatus })
337
+    getList({ pageNumber: 1, pageSize: 10, groupStatus, groupActivityId:groupActivityId })
343 338
   }
344 339
 
345 340
   function toCustomerDateil(record) {
@@ -381,17 +376,14 @@ function helpRecord(row) {
381 376
   // eslint-disable-next-line max-len
382 377
   setGInviteData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: row.status, recordId: row.recordId})
383 378
 }
384
- // 核销
379
+ // 打开核销
385 380
  function shareRecordVerify(row) {
386
-// 关闭助力记录弹框
387
-// eslint-disable-next-line max-len
388
-  setVerifierData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: 0})
389
-  // eslint-disable-next-line max-len
381
+  setVerifierData({ visible: true, groupActivityId: row.groupActivityId, groupStatus: 0, recordId: row.recordId})
390 382
   setGInviteData({ visible: false, groupActivityId: row.groupActivityId})
391 383
  }
392 384
 
393 385
  function onSuccess(e) {
394
-  setVerifierData({ visible: false, groupActivityId: '', groupStatus: 0})
386
+  setVerifierData({ visible: false, groupActivityId: e.groupActivityId, groupStatus: 0})
395 387
   getList({ pageNumber: 1, pageSize: 10, ...e});
396 388
  }
397 389
 
@@ -403,25 +395,26 @@ function helpRecord(row) {
403 395
 
404 396
   const publicColumns = [
405 397
     {
406
-      title: '团者',
398
+      title: '团者',
407 399
       dataIndex: 'nickname',
408 400
       key: 'nickname',
409 401
       align: 'center',
410 402
       width: '15%',
411 403
     },
412 404
     {
413
-      title: '团者手机号',
405
+      title: '团者手机号',
414 406
       dataIndex: 'phone',
415 407
       key: 'phone',
416 408
       align: 'center',
417 409
       width: '10%',
418 410
     },
419 411
     {
420
-      title: '团时间',
412
+      title: '团时间',
421 413
       dataIndex: 'createTime',
422 414
       key: 'createTime',
423 415
       align: 'center',
424 416
       width: '15%',
417
+      render: (x, row) => <><span>{row.createTime ? `${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>,
425 418
     },
426 419
     {
427 420
       title: '参团者',
@@ -429,7 +422,7 @@ function helpRecord(row) {
429 422
       key: 'helpCount',
430 423
       align: 'center',
431 424
       width: '15%',
432
-      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick={() => helpRecord(record)}>{record.joinPeople}/{record.groupBuyPeople}</a>,
425
+      render: (text, record) => <a style={ { color: '#66B3FF' } } onClick={() => helpRecord(record)}>{record.joinPeople === null ? 0 : record.joinPeople}/{record.groupBuyPeople}</a>,
433 426
     },
434 427
   ]
435 428
 
@@ -440,24 +433,21 @@ function helpRecord(row) {
440 433
       key: 'nickname',
441 434
       align: 'center',
442 435
       width: '15%',
443
-      // render: (_, record) => <Avatar shape="square" src={groupStatus === 'helpSucceed' ? record.picture : record.avatarurl} size={64} icon="user" />,
444 436
     },
445 437
     {
446
-      title: '手机号',
438
+      title: '拼团者手机号',
447 439
       dataIndex: 'phone',
448 440
       key: 'phone',
449 441
       align: 'center',
450 442
       width: '10%',
451
-      // eslint-disable-next-line no-nested-ternary
452
-      // render: (_, record) => <><span>{groupStatus === 'helpSucceed' ? record.name : record.nickname}</span></>,
453 443
     },
454 444
     {
455
-      title: '发起时间',
445
+      title: '拼团时间',
456 446
       dataIndex: 'createTime',
457 447
       key: 'createTime',
458 448
       align: 'center',
459 449
       width: '10%',
460
-      // eslint-disable-next-line no-nested-ternary
450
+      render: (x, row) => <><span>{row.createTime ?`${moment(row.createTime).format('YYYY-MM-DD HH:mm:ss')}` : ''}</span></>
461 451
     },
462 452
     {
463 453
         title: '成团时间',
@@ -465,7 +455,7 @@ function helpRecord(row) {
465 455
         key: 'endTime',
466 456
         align: 'center',
467 457
         width: '10%',
468
-        // eslint-disable-next-line no-nested-ternary
458
+        render: (x, row) => <><span>{row.endTime ?`${moment(row.endTime).format('YYYY-MM-DD HH:mm:ss')}`:''}</span></>
469 459
     },
470 460
     {
471 461
       title: '核销状态',
@@ -488,7 +478,7 @@ function helpRecord(row) {
488 478
       render: (x, row) => (
489 479
         <>
490 480
           {row.verificationStatus === 0 &&
491
-          <AuthButton name="admin.SignList.get" noRight={null}>
481
+          <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
492 482
            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={(e) => shareRecordVerify(row)}>核销</span>
493 483
           </AuthButton>
494 484
         }
@@ -525,12 +515,12 @@ function helpRecord(row) {
525 515
             </Button>
526 516
         </Form.Item>
527 517
       </Form>
528
-      <Button type="primary" onClick={() => exportRecord()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
518
+      <Button name="admin.taShareRecord.export.get" noRight={null} type="primary" onClick={() => exportRecord()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
529 519
         导出
530 520
       </Button>
531 521
 
532 522
       <div style={{ margin: '20px 0' }}>
533
-        <AuthButton name="admin.customer.recommend.get" noRight={null}>
523
+        <AuthButton name="admin.taShareSuccessRecord.get" noRight={null}>
534 524
           <Radio.Group value={groupStatus} onChange={radioButtonHandleSizeChange} buttonStyle="solid">
535 525
             <Radio.Button value="0">拼团成功</Radio.Button>
536 526
             <Radio.Button value="1">进行中</Radio.Button>

+ 112
- 96
src/pages/activity/groupActivity/list.jsx Näytä tiedosto

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

+ 8
- 6
src/pages/activity/helpActivity/edithelpActivity.jsx Näytä tiedosto

@@ -81,8 +81,13 @@ const header = props => {
81 81
         }
82 82
 
83 83
         // 判断助力人数不得超过200
84
-        if (values.helpNum > 200) {
85
-          message.error('限制助力人数不能超过200')
84
+        if (values.personNum > 200) {
85
+          message.error('助力邀请人数不能超过200')
86
+          return
87
+        }
88
+          // 助力邀请人数>0
89
+        if (values.personNum <= 0) {
90
+          message.error('助力邀请人数大于0')
86 91
           return
87 92
         }
88 93
 
@@ -92,10 +97,6 @@ const header = props => {
92 97
           message.error('限制助力次数必须大于0')
93 98
           return
94 99
         }
95
-        if (values.personNum <= 0) {
96
-          message.error('助力邀请人数大于0')
97
-          return
98
-        }
99 100
       }
100 101
         const { activityTime, signupTime, ...submitValue } = values
101 102
         const [startDate, endDate] = activityTime
@@ -453,6 +454,7 @@ const Edit = props => {
453 454
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
454 455
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
455 456
       </div>
457
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '250px' }}>图片比例: 5:4</p>
456 458
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
457 459
       <Button onClick={() => router.go(-1)}>取消</Button>
458 460
     </div>

+ 35
- 19
src/pages/activity/helpActivity/helpRecord.jsx Näytä tiedosto

@@ -32,7 +32,6 @@ class InviteTable extends React.Component {
32 32
 
33 33
   componentDidUpdate (preProps, preState) {
34 34
     const { helpId } = this.state.visibleData
35
-
36 35
     if (this.props.visibleData.visible !== preState.visibleData.visible) {
37 36
       this.getList({ helpRecordInitiateId: helpId, pageNumber: 1, pageSize: 5 })
38 37
       this.setState({ visibleData: this.props.visibleData });
@@ -43,14 +42,19 @@ class InviteTable extends React.Component {
43 42
   // eslint-disable-next-line react/sort-comp
44 43
   handleOk () {
45 44
     this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
45
+    this.props.onCancel()
46 46
   }
47 47
 
48 48
   // 弹框取消按钮
49 49
   handleCancel () {
50 50
     this.setState({ visibleData: { visible: false, helpId: '', realtyConsultant: '' } })
51
+    this.props.onCancel()
51 52
   }
52 53
 
53 54
   getList (params) {
55
+    if (params.helpRecordInitiateId === '') {
56
+      return
57
+    }
54 58
     request({ ...apis.helpActivity.helpPeopleDetails, params: { ...params } }).then(res => {
55 59
       this.setState({ dataSource: res })
56 60
     }).catch(err => {
@@ -68,7 +72,6 @@ class InviteTable extends React.Component {
68 72
 
69 73
   // eslint-disable-next-line class-methods-use-this
70 74
   exportHelp() {
71
-    console.log('this.state.25252464122', this.state.visibleData)
72 75
     request({ ...apis.helpActivity.gethelpRecordExport, responseType: 'blob', params: { helpRecordInitiateId: this.state.visibleData.helpId } })
73 76
       .then(data => {
74 77
         if (!data) {
@@ -113,6 +116,7 @@ class InviteTable extends React.Component {
113 116
         dataIndex: 'createDate',
114 117
         key: 'createDate',
115 118
         align: 'center',
119
+        render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
116 120
       },
117 121
     ]
118 122
     return (
@@ -124,10 +128,10 @@ class InviteTable extends React.Component {
124 128
           footer={null}
125 129
           visible={this.state.visibleData.visible}
126 130
           // onOk={() => this.handleOk()}
127
-          onCancel={(e) => this.handleCancel(e)}
131
+          onCancel={e => this.handleCancel(e)}
128 132
         >
129 133
 
130
-      <Button type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
134
+      <Button name="admin.HelpInitiateRecordSucceed.export.get" noRight={null} type="primary" onClick={() => this.exportHelp()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
131 135
         导出
132 136
       </Button>
133 137
           <Table rowKey="independent" dataSource={this.state.dataSource.records} columns={columns} pagination={{ total: this.state.dataSource.total, onChange: e => this.onChange(e) }} />
@@ -167,12 +171,13 @@ class Verifier extends React.Component {
167 171
   // eslint-disable-next-line react/sort-comp
168 172
   handleOk () {
169 173
     this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
170
-    
171 174
   }
172 175
 
173 176
   // 弹框取消按钮
174 177
   handleCancel () {
175
-    this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
178
+    console.log('核销关闭');
179
+    // this.setState({ visibleData: { visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' } })
180
+    this.props.onCancel()
176 181
   }
177 182
 
178 183
   // eslint-disable-next-line class-methods-use-this
@@ -180,6 +185,7 @@ class Verifier extends React.Component {
180 185
     request({ ...apis.helpActivity.verification, params: { ...params } }).then(res => {
181 186
       // eslint-disable-next-line no-undef
182 187
       message.info('核销成功')
188
+      this.props.onSuccess({ pageNumber: 1, pageSize: 10, helpActivityId: this.props.visibleData.helpActivityId, status: 'helpSucceed' })
183 189
     }).catch(err => {
184 190
       // eslint-disable-next-line no-unused-expressions
185 191
       <Alert
@@ -201,7 +207,6 @@ class Verifier extends React.Component {
201 207
   // eslint-disable-next-line class-methods-use-this
202 208
   verification(e) {
203 209
     this.audit({ helpRecordInitiateId: this.state.visibleData.helpId, verifyCode: this.state.visibleData.verificationCode })
204
-    this.props.onSuccess({ pageNumber: 1, pageSize: 10, helpActivityId: this.props.visibleData.helpActivityId, status: 'helpSucceed' })
205 210
   }
206 211
 
207 212
   render () {
@@ -214,10 +219,10 @@ class Verifier extends React.Component {
214 219
           footer={null}
215 220
           visible={this.state.visibleData.visible}
216 221
           // onOk={() => this.handleOk()}
217
-          onCancel={(e) => this.handleCancel(e)}
222
+          onCancel={e => this.handleCancel(e)}
218 223
         >
219
-          <div><span>核销码:<input onChange={this.verify.bind(this)}/></span>
220
-           <Button onClick={(e) => this.verification(e)} style={{ marginLeft: '80px' }}>立即核销</Button>
224
+          <div><span>核销码:<input style={{marginLeft: '10px'}} onChange={this.verify.bind(this)}/></span>
225
+           <Button name="admin.helpInitiateRecordVerify.post" noRight={null} onClick={e => this.verification(e)} style={{ marginLeft: '80px', marginTop:'10px', backgroundColor:'red' }}><span style={{color:'white'}}>立即核销</span></Button>
221 226
           </div>
222 227
         </Modal>
223 228
       </>
@@ -287,7 +292,7 @@ function body(props) {
287 292
 
288 293
   // 提交事件
289 294
   function handleSubmit(e) {
290
-    displayNone()
295
+    // displayNone()
291 296
 
292 297
 
293 298
     e.preventDefault();
@@ -314,7 +319,7 @@ function body(props) {
314 319
   function radioButtonHandleSizeChange(e) {
315 320
     setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
316 321
     setVerifierData({ visible: false, helpId: '', helpRecordInitiateId: '', verificationCode: '' })
317
-    displayNone()
322
+    // displayNone()
318 323
 
319 324
     const { value } = e.target
320 325
     setCustomerType(value)
@@ -376,9 +381,18 @@ function helpRecord(row) {
376 381
  function onSuccess(e) {
377 382
    console.log('回调:', e)
378 383
    getList(e)
379
-     // 核销
380
-   setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
384
+    
385
+   // 关闭
386
+   onCancel()
381 387
  }
388
+
389
+ function onCancel(e) {
390
+  // 核销
391
+  setVerifierData({ visible: false, helpId: '', helpActivityId: '', elpRecordInitiateId: '', verificationCode: '' })
392
+  // 助力者
393
+  setGInviteData({ visible: false, helpId: '', realtyConsultant: '' })
394
+ }
395
+
382 396
  // 返回到首页
383 397
  function returList(params) {
384 398
   router.push({
@@ -407,6 +421,7 @@ function helpRecord(row) {
407 421
       key: 'createDate',
408 422
       align: 'center',
409 423
       width: '15%',
424
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
410 425
     },
411 426
     {
412 427
       title: '助力者',
@@ -442,6 +457,7 @@ function helpRecord(row) {
442 457
       key: 'createDate',
443 458
       align: 'center',
444 459
       width: '10%',
460
+      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
445 461
       // eslint-disable-next-line no-nested-ternary
446 462
     },
447 463
     {
@@ -460,7 +476,7 @@ function helpRecord(row) {
460 476
       width: '10%',
461 477
       // eslint-disable-next-line no-nested-ternary
462 478
       render: (text, records) => {
463
-        if (records.verificationStatus === 0) { return '未核销' }
479
+        if (records.verificationStatus === 0 || records.verificationStatus === null) { return '未核销' }
464 480
         if (records.verificationStatus === 1) { return '已核销' }
465 481
       },
466 482
     },
@@ -504,7 +520,7 @@ function helpRecord(row) {
504 520
             </Button>
505 521
         </Form.Item>
506 522
       </Form>
507
-      <Button type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
523
+      <Button name="admin.helpRecord.export.get" noRight={null} type="primary" onClick={() => exportCustomer()} style={{ float: 'right', margin: '20px 0', zIndex: 1 }}>
508 524
         导出
509 525
       </Button>
510 526
 
@@ -519,10 +535,10 @@ function helpRecord(row) {
519 535
       </div>
520 536
       {customerType === 'helpSucceed' ?
521 537
         <Table dataSource={dataSource.list} columns={privateColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> :
522
-        <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" /> 
538
+        <Table dataSource={dataSource.list} columns={publicColumns} pagination={{ total: dataSource.total, onChange }} rowKey="customerList" />
523 539
       }
524
-        <Verifier visibleData={gVerifierData} onSuccess={(e) => onSuccess(e)} />
525
-       <InviteTable visibleData={gInviteData} />  
540
+        <Verifier visibleData={gVerifierData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)} />
541
+       <InviteTable visibleData={gInviteData} onSuccess={e => onSuccess(e)} onCancel={(e) => onCancel(e)}/>
526 542
     </>
527 543
   );
528 544
 }

+ 31
- 22
src/pages/activity/helpActivity/list.jsx Näytä tiedosto

@@ -92,28 +92,37 @@ const toEditGoods = (helpActivityId) => () => {
92 92
       render: (x, row) => (
93 93
         <>
94 94
           {row.activityStatus === 0 &&
95
-          <AuthButton name="admin.SignList.get" noRight={null}>
96
-        
97
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
98
-            <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span>
99
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
100
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
95
+          <AuthButton name="admin.helpRecord.get">
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>}
98
+          {row.activityStatus === 0 &&
99
+          <AuthButton name="admin.top.update.post" noRight={null}>
100
+            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" style={{color:'#bebebe'}} 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"  style={{color:'#bebebe'}} 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" style={{color:'#bebebe'}} className={styles.edit} /></span>
101 103
           </AuthButton> }
102 104
 
103 105
           {row.activityStatus === 1 &&
104
-           <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
105
-                      <span style={{ color: '#FF925C', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" className={styles.edit} /></span>
106
-                      {/* <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={topDynamic(row, 2)}>结束活动<Icon type="poweroff" className={styles.edit} /></span> */}
107
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
108
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
106
+          <AuthButton name="admin.helpActivity.update.put" noRight={null}>
107
+            <span style={{ color: '#FF925C', marginRight: '20px', cursor: 'pointer' }} onClick={toEditGoods(row.helpActivityId)}>编辑<Icon type="form" style={{color:'#bebebe'}} 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" style={{color:'#bebebe'}} 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" style={{color:'#bebebe'}} className={styles.edit} /></span>
109 114
             </AuthButton>
110 115
           }
111 116
 
112 117
           {row.activityStatus === 2 &&
113
-        <AuthButton name="admin.buildingDynamic.finish.put" noRight={null}>
114
-           <span style={{ color: '#1990FF', cursor: 'pointer' }} onClick={ getSignList.bind(this, row.helpActivityId)}>助力记录<Icon type="snippets" className={styles.shoppingCart} /></span>
115
-           <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 0)}>{ row.weight === 1 ? '取消置顶' : '置顶' }<Icon type="vertical-align-top" className={styles.edit} /></span>
116
-            <span style={{ color: '#1990FF', marginRight: '20px', cursor: 'pointer' }} onClick={topDynamic(row, 1)}>{ row.isMain === true ? '取消推首页' : '推首页' }<Icon type="vertical-align-top" className={styles.edit} /></span>
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" style={{color:'#bebebe'}} className={styles.shoppingCart} /></span>
120
+          </AuthButton>
121
+          }
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" style={{color:'#bebebe'}} 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" style={{color:'#bebebe'}} className={styles.edit} /></span>
117 126
         </AuthButton>
118 127
           }
119 128
         </>
@@ -138,7 +147,7 @@ const toEditGoods = (helpActivityId) => () => {
138 147
               request({ ...apis.activity.finish, data: {dynamicId: row.dynamicId, top: ""} }).then((data) => {
139 148
                   console.log(data)
140 149
                   message.info('操作成功!')
141
-                  getList({ pageNum: 1, pageSize: 10 })
150
+                  getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
142 151
               }).catch((err) => {
143 152
                   console.log(err)
144 153
                   message.info(err.msg || err.message)
@@ -152,7 +161,7 @@ const toEditGoods = (helpActivityId) => () => {
152 161
       request({ ...apis.helpActivity.top, data: { helpActivityId: row.helpActivityId, status: code } }).then((data) => {
153 162
           console.log(data)
154 163
           message.info('操作成功!')
155
-          getList({ pageNum: 1, pageSize: 10 })
164
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
156 165
       }).catch((err) => {
157 166
           console.log(err)
158 167
           message.info(err.msg || err.message)
@@ -171,7 +180,7 @@ const toEditGoods = (helpActivityId) => () => {
171 180
   const cancelDynamic = (row) => {
172 181
       request({ ...apis.activity.cancel, urlData: {id: row.dynamicId}}).then((data) => {
173 182
           message.info('操作成功!')
174
-          getList({ pageNum: 1, pageSize: 10 })
183
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() })
175 184
       }).catch((err) => {
176 185
           console.log(err)
177 186
           message.info(err.msg || err.message)
@@ -182,7 +191,7 @@ const toEditGoods = (helpActivityId) => () => {
182 191
   const sendDynamic = (row) => {
183 192
       request({ ...apis.activity.send, urlData: {id: row.dynamicId}}).then((data) => {
184 193
           message.info('操作成功!')
185
-          getList({ pageNum: 1, pageSize: 10 });
194
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
186 195
       }).catch(err => {
187 196
           console.log(err)
188 197
           message.info(err.msg || err.message)
@@ -190,7 +199,7 @@ const toEditGoods = (helpActivityId) => () => {
190 199
   }
191 200
   
192 201
   const changePageNum = pageNumber => {
193
-      getList({ pageNum: pageNumber, pageSize: 10 })
202
+      getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
194 203
   }
195 204
 
196 205
   // 提交事件
@@ -266,11 +275,11 @@ const handleSubmit = (e, props) => {
266 275
         </Form.Item>
267 276
       </Form>
268 277
       <AuthButton name="admin.buildingDynamic.add.post" noRight={null}>
269
-        <Button type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
278
+        <Button name="admin.helpActivity.add.post" noRight={null} type="danger" className={styles.addBtn} onClick={toEditGoods()}>新增</Button>
270 279
       </AuthButton>
271 280
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="activityList"/>
272 281
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
273
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
282
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
274 283
       </div>
275 284
     </>
276 285
   )

+ 28
- 9
src/pages/building/list/add/components/amap.jsx Näytä tiedosto

@@ -4,23 +4,29 @@ import { Map, Marker } from 'react-amap';
4 4
 import styles from '../amap.less'
5 5
 
6 6
 class Amap extends React.Component {
7
+
7 8
   constructor(props) {
8 9
     super(props);
10
+    this.state = {
11
+      markerPosition: { longitude: 120, latitude: 35 },
12
+    }
9 13
     // 高德地图 Marker 实例
10 14
     this.markerInstance = undefined
11 15
     // 高德地图 Map 实例
12 16
     this.mapInstance = undefined
17
+
13 18
     this.amapEvents = {
14 19
       created: mapInstance => {
15 20
         console.log('高德地图 Map 实例创建成功;如果你要亲自对实例进行操作,可以从这里开始。比如:');
16
-        console.log(mapInstance.getZoom());
21
+        console.log('缩放级别:', mapInstance.getZoom());
17 22
         this.mapInstance = mapInstance
23
+        
18 24
 
19 25
         AMap.plugin(['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.CitySearch'], () => {
20 26
           // 实例化Autocomplete
21 27
           const autoOptions = {
22 28
             // city 限定城市,默认全国
23
-            city: '全国',
29
+            // city: '025',
24 30
             // input 为绑定输入提示功能的input的DOM ID
25 31
             input: 'amapInput',
26 32
           }
@@ -28,7 +34,7 @@ class Amap extends React.Component {
28 34
           // 无需再手动执行search方法,autoComplete会根据传入input对应的DOM动态触发search
29 35
 
30 36
           const placeSearch = new AMap.PlaceSearch({
31
-            city: '南京',
37
+            // city: '南京',
32 38
             map: mapInstance,
33 39
           })
34 40
 
@@ -54,6 +60,8 @@ class Amap extends React.Component {
54 60
                 // document.getElementById('info').innerHTML = '您当前所在城市:'+cityinfo;
55 61
                 // 地图显示当前城市
56 62
                 mapInstance.setBounds(citybounds);
63
+                // 需要在设置坐标成功后,重新设置 缩放级别
64
+                // mapInstance.setZoom(15)
57 65
               }
58 66
             }
59 67
           })
@@ -75,20 +83,31 @@ class Amap extends React.Component {
75 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 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 105
     return (
88 106
       <>
89 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 111
           </Map>
93 112
           {
94 113
           <div className={styles.infoBox}>

+ 94
- 25
src/pages/building/list/add/components/base.jsx Näytä tiedosto

@@ -12,6 +12,7 @@ import TagGroup from './tags'
12 12
 import Amap from './amap'
13 13
 import BudildingProjectType from './buildingProjectType'
14 14
 import SelectCity from '../../../../../components/SelectButton/CitySelect'
15
+import FileUpload from '@/components/XForm/FileUpload';
15 16
 
16 17
 const { Option } = Select
17 18
 const { TabPane } = Tabs;
@@ -40,14 +41,15 @@ function openNotificationWithIcon(type, message) {
40 41
 function AddBuilding(props) {
41 42
   const { getFieldDecorator } = props.form;
42 43
 
44
+  console.log('props.building: ', props.building)
43 45
   if (props.building.buildingId !== undefined) {
44 46
     const { buildingId } = props.building
45
-    if (buildingId !== '') {
46
-      // eslint-disable-next-line react-hooks/rules-of-hooks
47
-      useEffect(() => {
47
+     // eslint-disable-next-line react-hooks/rules-of-hooks
48
+     useEffect(() => {
49
+      if (buildingId !== '') {
48 50
         getById(buildingId)
49
-      }, [])
50
-    }
51
+      }
52
+    }, [])
51 53
   }
52 54
 
53 55
    // 获取详情信息
@@ -65,7 +67,13 @@ function AddBuilding(props) {
65 67
       }
66 68
 
67 69
       res.avatarImage = res.buildingImg.map(item => item.url)
70
+      res.listImage = res.buildingListImg.map(item => item.url)
71
+      res.mapCoordinate = res.coordinate
72
+      if (res.videoUrl) {
73
+        res.videoUrl = [].concat(res.videoUrl)
74
+      }
68 75
       props.form.setFieldsValue(res)
76
+      props.onSuccess(res)
69 77
     })
70 78
   }
71 79
 
@@ -83,40 +91,63 @@ function AddBuilding(props) {
83 91
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
84 92
     // 项目主图
85 93
     data.img = data.avatarImage && data.avatarImage.map((item, index) => ({ imgType: 'banner', url: item, orderNo: index + 1 }))
94
+    // 列表图
95
+    data.listImg = data.listImage && data.listImage.map((item, index) => ({ imgType: 'list', url: item, orderNo: index + 1 }))
96
+    data.videoUrl = data.videoUrl[0]
86 97
     if (data.tag) {
87 98
       data.tag = data.tag.map((item, _) => ({ tagName: item }))
88 99
     }
89 100
 
90 101
     const api = data.buildingId === undefined ? apis.building.addBuilding : apis.building.updateBuilding
91
-    request({ ...api, data: { ...data } }).then(() => {
102
+    request({ ...api, data: { ...data } }).then(res => {
92 103
       openNotificationWithIcon('success', '操作成功')
93 104
       // router.go(-1)
105
+      getById(res.buildingId)
94 106
     }).catch(err => {
95 107
       openNotificationWithIcon('error', err.message)
96 108
     })
97 109
   }
98 110
 
111
+  // 视频文件上传前 回调
112
+  function fileUploadBeforeUpload(file, fileList) {
113
+    console.log(file, fileList)
114
+    return new Promise((resolve, reject) => {
115
+      if (file.type === 'video/mp4' || file.type === '.mp4') {
116
+          resolve(file)
117
+      } else {
118
+        openNotificationWithIcon('error', '项目视频,仅支持MP4格式')
119
+        reject()
120
+      }
121
+    })
122
+  }
123
+
99 124
   return (
100 125
         <Form {...formItemLayout} onSubmit={handleSubmit}>
101
-          <Form.Item label="项目Id"  style={{ display: 'none' }}>
126
+          <Form.Item label="项目Id" style={{ display: 'none' }}>
102 127
             {getFieldDecorator('buildingId')(<Input disabled />)}
103 128
           </Form.Item>
104 129
           <Form.Item label="楼盘编号" >
105
-            {getFieldDecorator('code')(<Input />)}
130
+            {getFieldDecorator('code', {
131
+              rules: [{ required: true, message: '请输入楼盘编号' }],
132
+            })(<Input />)}
106 133
           </Form.Item>
107 134
           <Form.Item label="楼盘名称" >
108
-            {getFieldDecorator('buildingName')(<Input />)}
135
+            {getFieldDecorator('buildingName', {
136
+              rules: [{ required: true, message: '请输入楼盘名' }],
137
+            })(<Input />)}
109 138
           </Form.Item>
110
-          <Form.Item label="别名" >
139
+          {/* <Form.Item label="别名" >
111 140
             {getFieldDecorator('name')(<Input />)}
112
-          </Form.Item>
141
+          </Form.Item> */}
113 142
           <Form.Item label="项目类型">
114
-            {getFieldDecorator('buildingProjectType')(<BudildingProjectType />)}
143
+            {getFieldDecorator('buildingProjectType', {
144
+              rules: [{ required: true, message: '请选择项目类型' }],
145
+            })(<BudildingProjectType />)}
115 146
           </Form.Item>
116 147
           <Form.Item label="均价" >
117 148
             {getFieldDecorator('price')(<Input type="number" style={{ width: '210px' }}/>)}元/m²
118 149
           </Form.Item>
119
-          <Form.Item label="开盘时间"  >
150
+          <Form.Item label="开盘时间" >
120 151
             {getFieldDecorator('openingDate')(<DatePicker format="YYYY/MM/DD" />)}
121 152
           </Form.Item>
122 153
           <Form.Item label="电话" >
@@ -142,7 +173,9 @@ function AddBuilding(props) {
142 173
             )}
143 174
           </Form.Item>
144 175
           <Form.Item label="销售状态" >
145
-            {getFieldDecorator('marketStatus')(
176
+            {getFieldDecorator('marketStatus', {
177
+              rules: [{ required: true, message: '请选择销售状态' }],
178
+            })(
146 179
               <Select placeholder="销售状态" style={{ width: '1016px' }}>
147 180
                 <Option value="待定">待定</Option>
148 181
                 <Option value="在售">在售</Option>
@@ -157,21 +190,35 @@ function AddBuilding(props) {
157 190
               </Select>,
158 191
             )}
159 192
           </Form.Item>
193
+          <Form.Item label="项目视频" help="视频仅支持mp4格式,建议尺寸:1920*1080,比例16:9">
194
+            {getFieldDecorator('videoUrl')(
195
+              <FileUpload accept=".mp4" beforeUpload={fileUploadBeforeUpload} label="上传视频"/>,
196
+            )}
197
+          </Form.Item>
160 198
           <Form.Item label="项目主图" help="建议图片尺寸:640px*360px">
161
-            {getFieldDecorator('avatarImage')(
199
+            {getFieldDecorator('avatarImage', {
200
+              rules: [{ required: true, message: '请选择项目主图' }],
201
+            })(
162 202
               <ImageListUpload />,
163 203
             )}
164 204
           </Form.Item>
165
-          <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
205
+          <Form.Item label="列表图" help="建议图片尺寸:640px*360px">
206
+            {getFieldDecorator('listImage', {
207
+              rules: [{ required: true, message: '请选择列表图' }],
208
+            })(
209
+              <ImageListUpload />,
210
+            )}
211
+          </Form.Item>
212
+          {/* <Form.Item label="地址图片" help="建议图片尺寸:750px*455px">
166 213
             {getFieldDecorator('mapImg')(
167 214
               <ImageUpload />,
168 215
             )}
169
-          </Form.Item>
170
-          <Form.Item label="海报底图" help="建议图片尺寸:640px*1136px" >
216
+          </Form.Item> */}
217
+          {/* <Form.Item label="海报底图" help="建议图片尺寸:640px*1136px" >
171 218
             {getFieldDecorator('poster')(
172 219
               <ImageUpload />,
173 220
             )}
174
-          </Form.Item>
221
+          </Form.Item> */}
175 222
           <Form.Item label="排序" >
176 223
             {getFieldDecorator('orderNo')(<Input />)}
177 224
           </Form.Item>
@@ -179,7 +226,9 @@ function AddBuilding(props) {
179 226
             {getFieldDecorator('discount')(<Input />)}
180 227
           </Form.Item>
181 228
           <Form.Item label="首页推荐" >
182
-            {getFieldDecorator('isMain')(
229
+            {getFieldDecorator('isMain',{
230
+              initialValue: 1,
231
+            })(
183 232
             <Radio.Group>
184 233
               <Radio value={1}>是</Radio>
185 234
               <Radio value={2}>否</Radio>
@@ -187,21 +236,41 @@ function AddBuilding(props) {
187 236
             )}
188 237
           </Form.Item>
189 238
           <Form.Item label="所在城市" >
190
-            {getFieldDecorator('cityId')(
239
+            {getFieldDecorator('cityId', {
240
+              rules: [{ required: true, message: '请选择城市' }],
241
+            })(
191 242
               <SelectCity />,
192 243
             )}
193 244
           </Form.Item>
194 245
           <Form.Item label="楼盘区域" >
195
-            {getFieldDecorator('buildingArea')(<Input />)}
246
+            {getFieldDecorator('buildingArea', {
247
+              rules: [{ required: true, message: '请输入楼盘区域' }],
248
+            })(<Input />)}
196 249
           </Form.Item>
197 250
           <Form.Item label="项目地址" >
198
-            {getFieldDecorator('address')(<Input />)}
251
+            {getFieldDecorator('address', {
252
+              rules: [{ required: true, message: '请输入项目地址' }],
253
+            })(<Input />)}
199 254
           </Form.Item>
200 255
           <Form.Item label="项目坐标" >
201
-            {getFieldDecorator('coordinate')(<Input disabled />)}
256
+            {getFieldDecorator('coordinate', {
257
+              rules: [{ required: true, message: '请输入项目坐标' }],
258
+            })(<Input disabled />)}
202 259
           </Form.Item>
203 260
           <Form.Item label="地图位置" >
204
-            {getFieldDecorator('coordinate')(<Amap />)}
261
+            {getFieldDecorator('mapCoordinate')(<Amap onChange={e => props.form.setFieldsValue({ coordinate: e })}/>)}
262
+          </Form.Item>
263
+          <Form.Item label="周边设施搜索范围" style={{ width: '2000px' }}>
264
+            {getFieldDecorator('mapScope', {
265
+              rules: [{ required: true, message: '请选择周边设施搜索范围' }],
266
+            })(
267
+              <Select placeholder="请选择周边设施搜索范围" style={{ width: '970px' }}>
268
+                <Option value={1000}>1公里</Option>
269
+                <Option value={3000}>3公里</Option>
270
+                <Option value={5000}>5公里</Option>
271
+                <Option value={10000}>10公里</Option>
272
+              </Select>,
273
+            )}
205 274
           </Form.Item>
206 275
           <Form.Item label="周边交通" >
207 276
             {getFieldDecorator('buildingTransport')(

+ 30
- 0
src/pages/building/list/add/components/buildingImage.jsx Näytä tiedosto

@@ -0,0 +1,30 @@
1
+import React 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
+
4
+const { Header, Footer, Sider, Content } = Layout;
5
+
6
+function BuildingImageModel() {
7
+  return (
8
+    <>
9
+      <span>效果图(10)</span>
10
+      <Button type="link">重命名</Button>
11
+      <Button type="link">删除相册</Button>
12
+    </>
13
+  )
14
+}
15
+
16
+
17
+function buildingImage() {
18
+  return (
19
+    <>
20
+      <Button type="primary">新增</Button>
21
+      <Layout>
22
+        <Content><BuildingImageModel /></Content>
23
+        <Content><BuildingImageModel /></Content>
24
+        <Content><BuildingImageModel /></Content>
25
+      </Layout>
26
+    </>
27
+  )
28
+}
29
+
30
+export default buildingImage

+ 3
- 2
src/pages/building/list/add/components/buildingProjectType.jsx Näytä tiedosto

@@ -61,7 +61,7 @@ class TypeForm extends React.Component {
61 61
           position: 'relative',
62 62
           border: '1px solid #eee',
63 63
           borderRadius: '4px',
64
-          marginTop:'16px'
64
+          marginTop: '16px',
65 65
         }}>
66 66
 
67 67
           <p style={{ padding: '20px', borderBottom: '1px solid #eee' }}>{this.props.type.buildingTypeName || ''}  <Button type="link" style={{ position: 'absolute', right: '16px' }} icon="close" onClick={() => this.close()} /></p>
@@ -140,6 +140,7 @@ class ProjectTypeBody extends React.Component {
140 140
     const updateProjectDate = this.updateProjectType(tempDate)
141 141
     console.log('updateProjectDate: ', updateProjectDate)
142 142
     this.setState({ data: updateProjectDate })
143
+    this.setState({ defaultCheckboxValue: updateProjectDate.map(item => item.buildingTypeId) })
143 144
   }
144 145
 
145 146
   onClose = e => {
@@ -239,7 +240,7 @@ class ProjectTypeBody extends React.Component {
239 240
           onOk={this.handleOk}
240 241
           onCancel={this.handleCancel}
241 242
         >
242
-          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} defaultValue={this.state.defaultCheckboxValue} onChange={e => this.onCheckboxChange(e)} />
243
+          <Checkbox.Group options={this.state.projectType.map(item => ({ label: item.buildingTypeName, value: item.buildingTypeId }))} onChange={e => this.onCheckboxChange(e)} value={this.state.defaultCheckboxValue}/>
243 244
         </Modal>
244 245
         <Row type="flex" justify="space-between">
245 246
           {

+ 30
- 18
src/pages/building/list/add/components/imageSet.jsx Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, 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 3
 import moment from 'moment';
4 4
 import request from '../../../../../utils/request';
5 5
 import apis from '../../../../../services/apis';
@@ -7,6 +7,8 @@ import Styles from '../style.less';
7 7
 import { router } from 'umi';
8 8
 import ModalImage from './modalImage';
9 9
 
10
+const { confirm } = Modal;
11
+
10 12
 
11 13
 const saleType = [
12 14
   {
@@ -82,13 +84,22 @@ function imageSet(props) {
82 84
    * @param {*} record
83 85
    */
84 86
   function deleteApartment(record) {
85
-    // 网路请求
86
-    request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
87
-      getList()
88
-      openNotificationWithIcon('error', '操作成功')
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,12 +109,6 @@ function imageSet(props) {
98 109
       dataIndex: 'apartmentName',
99 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 113
       title: '销售状态',
109 114
       dataIndex: 'marketStatus',
@@ -111,9 +116,16 @@ function imageSet(props) {
111 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 131
       title: '创建时间',
@@ -141,7 +153,7 @@ function imageSet(props) {
141 153
 
142 154
       {/* 编辑页 */}
143 155
       {/*  onSuccess是子组件传递事件信息  */}
144
-      <ModalImage visibleData={visibleData} key={1} onSuccess={() => onModalChange()}/>
156
+      <ModalImage visibleData={visibleData} key="ModalImage" onSuccess={() => onModalChange()}/>
145 157
     </>
146 158
   )
147 159
 }

+ 22
- 28
src/pages/building/list/add/components/modalImage.jsx Näytä tiedosto

@@ -30,7 +30,7 @@ const formItemLayout = {
30 30
 const saleType = [
31 31
   {
32 32
     id: 1,
33
-    name: '待',
33
+    name: '待',
34 34
   },
35 35
   {
36 36
     id: 2,
@@ -162,19 +162,18 @@ class ModalImage extends React.Component {
162 162
               <Form.Item label="编号" style={{ display: 'none' }}>
163 163
                   {getFieldDecorator('apartmentId')(<Input />)}
164 164
               </Form.Item>
165
-              <Form.Item label="名称">
166
-                {getFieldDecorator('apartmentName')(<Input />)}
167
-              </Form.Item>
168
-              <Form.Item label="类型">
169
-                {getFieldDecorator('apartmentType')(
170
-                  <Select placeholder="类型">
171
-                    <Option value="apart">户型</Option>
172
-                    <Option value="photo">相册</Option>
173
-                  </Select>,
174
-                )}
165
+              <Form.Item label="户型名称">
166
+                {getFieldDecorator('apartmentName', {
167
+                  rules: [
168
+                    { required: true, message: '请填写户型名称' },
169
+                    { max: 10, message: '户型名称不超过10个字符' },
170
+                  ],
171
+                })(<Input placeholder="户型名称不超过10个字符"/>)}
175 172
               </Form.Item>
176 173
               <Form.Item label="销售状态">
177
-                {getFieldDecorator('marketStatus')(
174
+                {getFieldDecorator('marketStatus', {
175
+                  rules: [{ required: true, message: '请选择销售状态' }],
176
+                })(
178 177
                   <Select placeholder="销售状态">
179 178
                     {
180 179
                       saleType.map((item, _) => <Option value={item.id}>{item.name}</Option>)
@@ -183,26 +182,21 @@ class ModalImage extends React.Component {
183 182
                 )}
184 183
               </Form.Item>
185 184
               <Form.Item label="图片">
186
-              {getFieldDecorator('img')(
185
+              {getFieldDecorator('img', {
186
+                  rules: [{ required: true, message: '请上传户型图片' }],
187
+              })(
187 188
                 <ImageListUpload />,
188 189
               )}
189 190
               </Form.Item>
190
-              <Form.Item label="面积">
191
-                {getFieldDecorator('buildingArea')(<Input />)}
192
-              </Form.Item>
193
-              <Form.Item label="套内面积">
194
-                {getFieldDecorator('insideArea')(<Input />)}
195
-              </Form.Item>
196
-              <Form.Item label="户型总价">
197
-                {getFieldDecorator('apartmentPrice')(<Input />)}
198
-              </Form.Item>
199
-              <Form.Item label="户型简介">
200
-                {getFieldDecorator('apartmentDescription')(
201
-                  <Wangedit />,
202
-                )}
191
+              <Form.Item label="面积" help="单位 ㎡">
192
+                {getFieldDecorator('buildingArea', {
193
+                  rules: [{ required: true, message: '请填写面积' }],
194
+                })(<Input type="number" />)}
203 195
               </Form.Item>
204
-              <Form.Item label="备注">
205
-                {getFieldDecorator('remark')(<TextArea rows={10} />)}
196
+              <Form.Item label="套内面积" help="单位 ㎡">
197
+                {getFieldDecorator('insideArea', {
198
+                  rules: [{ required: true, message: '请填写套内面积' }],
199
+                })(<Input type="number" />)}
206 200
               </Form.Item>
207 201
               <Form.Item style={{ width: '400px', margin: 'auto', display: 'flex', justifyContent: 'space-between' }}>
208 202
                 <Button type="primary" htmlType="submit">保存</Button>

+ 6
- 1
src/pages/building/list/add/components/poster.jsx Näytä tiedosto

@@ -71,6 +71,11 @@ const Poster = props => {
71 71
 
72 72
   const submitPoster = () => {
73 73
     if (buildingId) {
74
+      if (!imgValue) {
75
+        message.error('请选择海报图片')
76
+        return
77
+      }
78
+
74 79
       if (posterId) {
75 80
         request({
76 81
           ...apis.activity.updatePoster,
@@ -136,7 +141,7 @@ const Poster = props => {
136 141
       </div>
137 142
       <div >
138 143
         <div style={{ display: 'flex', width: '100%', margin: '60px 0' }}>
139
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报图片</p>
144
+          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 海报图片</p>
140 145
           <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
141 146
         </div>
142 147
         <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>

+ 1
- 0
src/pages/building/list/add/components/share.jsx Näytä tiedosto

@@ -87,6 +87,7 @@ const Share = props => {
87 87
       <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
88 88
       <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
89 89
     </div>
90
+    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '250px' }}>图片比例: 5:4</p>
90 91
     <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
91 92
     <Button onClick={() => router.go(-1)}>取消</Button>
92 93
   </div>

+ 30
- 18
src/pages/building/list/add/index.jsx Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, 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 3
 import moment from 'moment';
4 4
 import request from '../../../../utils/request';
5 5
 import apis from '../../../../services/apis';
@@ -11,9 +11,10 @@ import ImageUpload from '../../../../components/XForm/ImageUpload'
11 11
 import Wangedit from '../../../../components/Wangedit/Wangedit'
12 12
 import TagGroup from './components/tags'
13 13
 import Base from './components/base'
14
-import ImageSet from './components/imageSet'
14
+import Apartment from './components/imageSet'
15 15
 import Poster from './components/poster'
16 16
 import Share from './components/share'
17
+import BuildingImage from './components/buildingImage';
17 18
 
18 19
 
19 20
 const { Option } = Select
@@ -30,37 +31,48 @@ const formItemLayout = {
30 31
   },
31 32
 };
32 33
 
34
+function openNotificationWithIcon(type, message) {
35
+  notification[type]({
36
+    message,
37
+    description:
38
+      '',
39
+  });
40
+}
41
+
33 42
 function AddBuilding(props) {
34 43
 
35 44
   const [tab, setTab] = useState('base')
45
+  const [buildingData, setBuildingData] = useState({ buildingId: undefined })
36 46
 
37 47
   function tabsCallback(e) {
38 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 61
   return (
45 62
     <>
46 63
       <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
47 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 69
       </Radio.Group>
59 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 76
       </div>
65 77
     </>
66 78
     // <Tabs defaultActiveKey="1" onChange={tabsCallback}>

+ 15
- 11
src/pages/building/list/index.jsx Näytä tiedosto

@@ -31,7 +31,6 @@ function openNotificationWithIcon(type, message) {
31 31
 function CartBody(props) {
32 32
   const { data } = props
33 33
 
34
-
35 34
   function toEdi(record) {
36 35
     router.push({
37 36
       pathname: '/building/list/add',
@@ -87,7 +86,7 @@ function CartBody(props) {
87 86
           openNotificationWithIcon('success', '操作成功')
88 87
           props.onSuccess()
89 88
         }).catch(err => {
90
-          openNotificationWithIcon('error', err.message)
89
+          // openNotificationWithIcon('error', err.message)
91 90
         })
92 91
 
93 92
         modal.destroy();
@@ -98,11 +97,13 @@ function CartBody(props) {
98 97
     });
99 98
   }
100 99
 
100
+  const { buildingImg } = data
101
+  console.log("buildingImg: ", data.buildingImg, "data: ", data)
101 102
   return (
102 103
     <Card
103 104
       hoverable
104 105
       style={{ minWidth: '330px', borderRadius: '12px', margin: '10px', boxShadow: '0px 0px 16px 2px rgba(0,0,0,0.12)' }}
105
-      cover={<img alt="example" src={data.poster} 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>}
106 107
       bodyStyle={{ padding: '10px 20px' }}
107 108
     >
108 109
       <p className={Styles.cardText}>
@@ -117,12 +118,12 @@ function CartBody(props) {
117 118
       </p>
118 119
       <p className={Styles.cardText}>
119 120
         <span className={Styles.title}>楼盘名称</span>
120
-        <span >:{data.name}</span>
121
+        <span >:{data.buildingName || data.name}</span>
121 122
       </p>
122 123
       <p className={Styles.cardItem}>
123 124
         <span className={Styles.title}>均价</span>
124 125
         <span >
125
-          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price} </span>元/m
126
+          :约<span style={{ color: '#FF0707', fontSize: '20px' }}> {data.price || '待定'} </span>元/m²
126 127
         </span>
127 128
       </p>
128 129
       <p className={Styles.cardItem}>
@@ -179,6 +180,7 @@ function body(props) {
179 180
     // 网路请求
180 181
     request({ ...apis.building.getList, params: { ...params } }).then(res => {
181 182
       setDataSource(res)
183
+      console.log("res:",res)
182 184
     }).catch(err => {
183 185
       // eslint-disable-next-line no-unused-expressions
184 186
       <Alert
@@ -218,7 +220,7 @@ function body(props) {
218 220
   // 分页
219 221
   function onChange(pageNumber) {
220 222
     // eslint-disable-next-line react-hooks/rules-of-hooks
221
-    getList({ pageNum: pageNumber, pageSize: 9 })
223
+    getList({ pageNum: pageNumber, pageSize: 9, ...props.form.getFieldsValue() })
222 224
   }
223 225
 
224 226
   function getDate(value, dateString) {
@@ -236,6 +238,7 @@ function body(props) {
236 238
    */
237 239
   function handleReset() {
238 240
     props.form.resetFields();
241
+    getList({ pageNum: 1, pageSize: 9 })
239 242
   }
240 243
 
241 244
 
@@ -267,15 +270,16 @@ function body(props) {
267 270
           {getFieldDecorator('buildingStatus')(
268 271
             <Select style={{ width: '180px' }} placeholder="楼盘状态" onChange={handleSelectChange}>
269 272
               <Option value="1">发布</Option>
270
-              <Option value="0">未发布</Option>
273
+              <Option value="2">未发布</Option>
271 274
             </Select>,
272 275
           )}
273 276
         </Form.Item>
274 277
         <Form.Item>
275 278
           {getFieldDecorator('marketStatus')(
276 279
             <Select style={{ width: '180px' }} placeholder="销售状态" onChange={handleSelectChange}>
277
-              <Option value="1">已销售</Option>
278
-              <Option value="0">未销售</Option>
280
+                <Option value="待定">待定</Option>
281
+                <Option value="在售">在售</Option>
282
+                <Option value="售完">售完</Option>
279 283
             </Select>,
280 284
           )}
281 285
         </Form.Item>
@@ -288,7 +292,7 @@ function body(props) {
288 292
           {getFieldDecorator('isMain')(
289 293
             <Select style={{ width: '180px' }} placeholder="首页推荐" onChange={handleSelectChange}>
290 294
               <Option value="1">首页推荐</Option>
291
-              <Option value="0">首页未推荐</Option>
295
+              <Option value="2">首页未推荐</Option>
292 296
             </Select>,
293 297
           )}
294 298
         </Form.Item>
@@ -320,7 +324,7 @@ function body(props) {
320 324
       </Row>
321 325
       {/* 分页 */}
322 326
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
323
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} />
327
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} pageSize={dataSource.size} />
324 328
       </div>
325 329
     </>
326 330
   );

+ 3
- 2
src/pages/building/type/edi.jsx Näytä tiedosto

@@ -59,8 +59,7 @@ function body(props) {
59 59
       openNotificationWithIcon('success', '操作成功')
60 60
       router.go(-1)
61 61
     }).catch(err => {
62
-      // eslint-disable-next-line no-unused-expressions
63
-      openNotificationWithIcon('error', err)
62
+      
64 63
     })
65 64
   }
66 65
 
@@ -76,6 +75,8 @@ function body(props) {
76 75
         // eslint-disable-next-line no-unused-expressions
77 76
         openNotificationWithIcon('success', '操作成功')
78 77
         router.go(-1)
78
+      }).catch(err => {
79
+        
79 80
       })
80 81
     }
81 82
 

+ 12
- 5
src/pages/building/type/index.jsx Näytä tiedosto

@@ -15,8 +15,9 @@ function body() {
15 15
   const columns = [
16 16
     {
17 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 23
       title: '类型名称',
@@ -42,6 +43,12 @@ function body() {
42 43
             删除
43 44
             <Icon type="rest" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
44 45
           </Button>
46
+          <Button type="link" style={{
47
+            color: '#FF4A4A', right: '0',
48
+          }} onClick={() => toEdi(record.buildingTypeId)}>
49
+            编辑
50
+            <Icon type="copy" style={{ color: '#C0C4CC', marginLeft: '8px' }} />
51
+          </Button>
45 52
         </span>
46 53
       ),
47 54
     },
@@ -65,7 +72,7 @@ function body() {
65 72
       setData(res)
66 73
     }).catch(err => {
67 74
       // eslint-disable-next-line no-unused-expressions
68
-      openNotificationWithIcon('error', err)
75
+      // openNotificationWithIcon('error', err)
69 76
     })
70 77
   }
71 78
 
@@ -84,7 +91,7 @@ function body() {
84 91
     }).then(() => {
85 92
       openNotificationWithIcon('success', '操作成功')
86 93
     }).catch(err => {
87
-      //openNotificationWithIcon('error', err.message)
94
+      // openNotificationWithIcon('error', err.message)
88 95
     })
89 96
   }
90 97
 
@@ -106,7 +113,7 @@ function body() {
106 113
       <Table style={{ marginTop: '30px' }} dataSource={data.records} columns={columns} pagination={false} rowKey="buildingType"/>
107 114
       {/* 分页 */}
108 115
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
109
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={onChange} />
116
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={onChange} current={data.current}/>
110 117
       </div>
111 118
     </>
112 119
   )

+ 8
- 1
src/pages/carouselFigure/SelectActivity.jsx Näytä tiedosto

@@ -56,7 +56,14 @@ export default (props) => {
56 56
         }}
57 57
         onCancel={() => setVisible(false)}
58 58
       >
59
-        <Select defaultValue={chooseVal} onChange={handleChange} style={{ width: '90%' }}>
59
+        <Select
60
+        showSearch
61
+        filterOption={(input, option) =>
62
+          option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
63
+        }
64
+        defaultValue={chooseVal} 
65
+        onChange={handleChange} 
66
+        style={{ width: '90%' }}>
60 67
           {
61 68
             list.map(x => (<Select.Option key={x.dynamicId} value={x.dynamicId}>{x.title}</Select.Option>))
62 69
           }

+ 74
- 0
src/pages/carouselFigure/SelectGroup.jsx Näytä tiedosto

@@ -0,0 +1,74 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Modal } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+
5
+const getGroupList = fetch(apis.groupActivity.EffectiveList)
6
+
7
+export default props => {
8
+  const {
9
+    value,
10
+    onChange,
11
+    ...rest
12
+  } = props;
13
+
14
+  const [list, setList] = useState([]);
15
+  const [visible, setVisible] = useState(false);
16
+  const [group, setGroup] = useState({ groupId: undefined, groupName: '请选择拼团' })
17
+  const getGroupTitle = val => {
18
+    return (list.filter(x => x.groupActivityId == val)[0] || {}).activityName || '请选择拼团'
19
+  }
20
+  const updateGroup = val => setGroup({ groupId: val, groupName: getGroupTitle(val) })
21
+
22
+  const buildingId = props.buildingId()
23
+
24
+  useEffect(() => {
25
+    getGroupList({
26
+      params: {
27
+        buildingId,
28
+        pageNum: 1,
29
+        pageSize: 999,
30
+      },
31
+    }).then(data => {
32
+      setList(data.records || [])
33
+
34
+      updateGroup(buildingId ? undefined : value);
35
+    })
36
+  }, [buildingId]);
37
+
38
+  if (value !== group.groupId) {
39
+    updateGroup(value);
40
+  }
41
+
42
+  const handleChange = val => {
43
+      onChange(val)
44
+  }
45
+
46
+  return (
47
+    <div>
48
+      <div onClick={() => setVisible(true)}>{group.groupName}</div>
49
+      <Modal
50
+        title="请选择拼团"
51
+        visible={visible}
52
+        onOk={() => {
53
+          updateGroup(value)
54
+          onChange(value)
55
+          setVisible(false)
56
+        }}
57
+        onCancel={() => setVisible(false)}
58
+      >
59
+        <Select
60
+          showSearch
61
+          value={value ? parseInt(value) : undefined}
62
+          onChange={handleChange}
63
+          style={{ width: '90%' }}
64
+          filterOption={(input, option) =>
65
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
66
+          }>
67
+          {
68
+            list.map(x => (<Select.Option key={x.groupActivityId} value={x.groupActivityId}>{x.activityName}</Select.Option>))
69
+          }
70
+        </Select>
71
+      </Modal>
72
+    </div>
73
+  );
74
+}

+ 76
- 0
src/pages/carouselFigure/SelectHelp.jsx Näytä tiedosto

@@ -0,0 +1,76 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select, Modal } from 'antd';
3
+import { apis, fetch } from '../../utils/request';
4
+
5
+const getHelpList = fetch(apis.helpActivity.effectiveList)
6
+
7
+export default props => {
8
+  const {
9
+    value,
10
+    onChange,
11
+    ...rest
12
+  } = props;
13
+
14
+  const [list, setList] = useState([]);
15
+  const [visible, setVisible] = useState(false);
16
+  const [help, setHelp] = useState({ helpId: undefined, helpName: '请选择助力' })
17
+  const getHelpTitle = val => {
18
+    return (list.filter(x => x.helpActivityId == val)[0] || {}).title || '请选择助力'
19
+  }
20
+
21
+  const updateHelp = val => setHelp({ helpId: val, helpName: getHelpTitle(val) })
22
+
23
+  const buildingId = props.buildingId()
24
+
25
+  useEffect(() => {
26
+    getHelpList({
27
+      params: {
28
+        buildingId,
29
+        pageNum: 1,
30
+        pageSize: 999,
31
+      },
32
+    }).then(data => {
33
+      setList(data.records || [])
34
+
35
+      updateHelp(value ? undefined : value);
36
+    })
37
+  }, [buildingId]);
38
+
39
+  if (value !== help.helpId) {
40
+    updateHelp(value);
41
+  }
42
+
43
+  const handleChange = val => {
44
+    onChange(val)
45
+  }
46
+
47
+  return (
48
+    <div>
49
+      <div onClick={() => setVisible(true)}>{help.helpName}</div>
50
+      <Modal
51
+        title="请选择助力"
52
+        visible={visible}
53
+        onOk={() => {
54
+          updateHelp(value)
55
+          onChange(value)
56
+          setVisible(false)
57
+        }}
58
+        onCancel={() => setVisible(false)}
59
+      >
60
+        <Select
61
+          placeholder="请选择助力"
62
+          showSearch
63
+          value={value ? parseInt(value) : undefined}
64
+          onChange={handleChange}
65
+          style={{ width: '90%' }}
66
+          filterOption={(input, option) =>
67
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
68
+          }>
69
+          {
70
+            list.map(x => (<Select.Option key={x.helpActivityId} value={x.helpActivityId}>{x.title}</Select.Option>))
71
+          }
72
+        </Select>
73
+      </Modal>
74
+    </div>
75
+  );
76
+}

+ 23
- 14
src/pages/carouselFigure/SelectNews.jsx Näytä tiedosto

@@ -1,10 +1,10 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import{ Select, Modal } from 'antd';
2
+import { Select, Modal } from 'antd';
3 3
 import { apis, fetch } from '../../utils/request';
4 4
 
5 5
 const getNewsList = fetch(apis.news.getList)
6 6
 
7
-export default (props) => {
7
+export default props => {
8 8
   const {
9 9
     value,
10 10
     onChange,
@@ -13,21 +13,21 @@ export default (props) => {
13 13
 
14 14
   const [list, setList] = useState([]);
15 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 18
   const updateNews = val => setNews({ newsId: val, newsName: getNewsTitle(val) })
19 19
 
20 20
   const buildingId = props.buildingId()
21
-  
21
+
22 22
   useEffect(() => {
23 23
     getNewsList({
24 24
       params: {
25 25
         buildingId,
26 26
         pageNum: 1,
27 27
         pageSize: 999,
28
-      }
29
-    }).then((data) => {
30
-      setList(data.list || [])
28
+      },
29
+    }).then(data => {
30
+      setList(data.records || [])
31 31
 
32 32
       updateNews(buildingId ? undefined : value);
33 33
     })
@@ -37,10 +37,11 @@ export default (props) => {
37 37
     updateNews(value);
38 38
   }
39 39
 
40
-  let chooseVal = value
41
-
42
-  const handleChange = val => chooseVal = val
40
+  const handleChange = val => {
41
+    onChange(val)
42
+  }
43 43
 
44
+  console.log(value, typeof value)
44 45
   return (
45 46
     <div>
46 47
       <div onClick={() => setVisible(true)}>{news.newsName}</div>
@@ -48,13 +49,21 @@ export default (props) => {
48 49
         title="请选择资讯"
49 50
         visible={visible}
50 51
         onOk={() => {
51
-          updateNews(chooseVal)
52
-          onChange(chooseVal)
52
+          updateNews(value)
53
+          onChange(value)
53 54
           setVisible(false)
54 55
         }}
55 56
         onCancel={() => setVisible(false)}
56 57
       >
57
-        <Select defaultValue={chooseVal} onChange={handleChange} style={{ width: '90%' }}>
58
+        <Select
59
+          showSearch
60
+          value={value ? parseInt(value) : undefined}
61
+          onChange={handleChange}
62
+          style={{ width: '90%' }}
63
+          filterOption={(input, option) =>
64
+            option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
65
+          }
66
+        >
58 67
           {
59 68
             list.map(x => (<Select.Option key={x.newsId} value={x.newsId}>{x.newsName}</Select.Option>))
60 69
           }

+ 9
- 9
src/pages/carouselFigure/advertisingList.jsx Näytä tiedosto

@@ -53,15 +53,15 @@ const toEdit = (contentId) => () => {
53 53
       dataIndex: 'contentType',
54 54
       key: 'contentType',
55 55
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : '' }</span>
57
-    },
58
-    {
59
-      title: '发布位置',
60
-      dataIndex: 'showPosition',
61
-      key: 'showPosition',
62
-      align: 'center',
63
-      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : '' }</span>
56
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
64 57
     },
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 66
       title: '发布时间',
67 67
       dataIndex: 'createDate',
@@ -220,7 +220,7 @@ const handleSubmit = (e, props) => {
220 220
       </AuthButton>
221 221
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="advertisingList"/>
222 222
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
223
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
224 224
       </div>
225 225
     </>
226 226
   )

+ 4
- 4
src/pages/carouselFigure/carouselFigureList.jsx Näytä tiedosto

@@ -53,7 +53,7 @@ const toEditCarouse = (contentId) => () => {
53 53
       dataIndex: 'contentType',
54 54
       key: 'contentType',
55 55
       align: 'center',
56
-      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : '' }</span>
56
+      render: (contentType) => <span>{ contentType === 'project' ? '项目' : contentType === 'activity' ? '活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' : contentType === 'help' ? '助力' : contentType === 'group' ? '拼团' : '' }</span>
57 57
     },
58 58
     {
59 59
       title: '发布位置',
@@ -185,14 +185,14 @@ const handleSubmit = (e, props) => {
185 185
               <Option value="activity">活动</Option>
186 186
               <Option value="project">项目</Option>
187 187
               <Option value="news">资讯</Option>
188
-              <Option value="other">其他</Option>
188
+              {/* <Option value="other">其他</Option> */}
189 189
             </Select>,
190 190
           )}
191 191
         </Form.Item>
192 192
         <Form.Item>
193 193
           {getFieldDecorator('showPosition')(
194 194
             <Select style={{ width: '180px' }} placeholder="发布位置">
195
-              <Option value="mall">商城</Option>
195
+              <Option value="mall">积分商城</Option>
196 196
               <Option value="index">首页</Option>
197 197
             </Select>,
198 198
           )}
@@ -219,7 +219,7 @@ const handleSubmit = (e, props) => {
219 219
       </AuthButton>
220 220
       <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
221 221
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
222
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
222
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
223 223
       </div>
224 224
     </>
225 225
   )

+ 30
- 1
src/pages/carouselFigure/editAdvertising.jsx Näytä tiedosto

@@ -11,6 +11,8 @@ import SelectActivity from './SelectActivity';
11 11
 import SelectNews from './SelectNews';
12 12
 import apis from '../../services/apis';
13 13
 import request from '../../utils/request'
14
+import SelectHelp from './SelectHelp';
15
+import SelectGroup from './SelectGroup';
14 16
 
15 17
 /**
16 18
  *
@@ -22,12 +24,17 @@ import request from '../../utils/request'
22 24
   let contentVisible = false
23 25
   let activityVisible = false
24 26
   let newsVisible = false
27
+  let helpVisible = false
28
+  let groupVisible = false
25 29
   let buildingId = ''
26 30
 
27 31
   const setExtraData = (data) => {
28 32
     contentVisible = data.contentType === 'other';
29 33
     activityVisible = data.contentType === 'activity';
30 34
     newsVisible = data.contentType === 'news';
35
+    helpVisible = data.contentType === 'help';
36
+    groupVisible = data.contentType === 'group';
37
+
31 38
     buildingId = data.buildingId
32 39
   }
33 40
   
@@ -87,7 +94,7 @@ import request from '../../utils/request'
87 94
         name: 'contentType',
88 95
         type: FieldTypes.Select,
89 96
         dict: [{
90
-          label: '活动',
97
+          label: '常规活动',
91 98
           value: 'activity'
92 99
         },
93 100
         {
@@ -101,6 +108,14 @@ import request from '../../utils/request'
101 108
         {
102 109
           label: '其他',
103 110
           value: 'other'
111
+        },
112
+        {
113
+          label: '拼团',
114
+          value: 'group'
115
+        },
116
+        {
117
+          label: '助力',
118
+          value: 'help'
104 119
         }],
105 120
         value: data.contentType,
106 121
       },
@@ -125,6 +140,20 @@ import request from '../../utils/request'
125 140
         value: data.content,
126 141
         hidden: () => !contentVisible,
127 142
       },
143
+      {
144
+        label: '发布助力',
145
+        name: 'targetId',
146
+        render: <SelectHelp buildingId={() => buildingId} />,
147
+        hidden: () => !helpVisible,
148
+        value: data.targetId,
149
+      },
150
+      {
151
+        label: '发布拼团',
152
+        name: 'targetId',
153
+        render: <SelectGroup buildingId={() => buildingId} />,
154
+        hidden: () => !groupVisible,
155
+        value: data.targetId,
156
+      },
128 157
       {
129 158
         label: '状态',
130 159
         name: 'status',

+ 180
- 111
src/pages/carouselFigure/editCarousel.jsx Näytä tiedosto

@@ -1,14 +1,18 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker,message } from 'antd';
2
+import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message } from 'antd';
3 3
 import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import styles from '../style/GoodsList.less';
5 4
 import moment from 'moment';
6 5
 import router from 'umi/router';
6
+import styles from '../style/GoodsList.less';
7 7
 import BuildSelect from '../../components/SelectButton/BuildSelect'
8
-import XForm, { FieldTypes } from '../../components/XForm';
8
+import { createForm, FieldTypes } from '../../components/XForm';
9 9
 import Wangedit from '../../components/Wangedit/Wangedit'
10 10
 import apis from '../../services/apis';
11 11
 import request from '../../utils/request'
12
+import SelectHelp from './SelectHelp';
13
+import SelectGroup from './SelectGroup';
14
+import SelectNews from './SelectNews';
15
+import SelectActivity from './SelectActivity';
12 16
 
13 17
 const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
14 18
 /**
@@ -17,130 +21,195 @@ const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
17 21
  * @param {*} props
18 22
  * @returns
19 23
  */
20
- const Edit = (props) => {
21
-  const [ tab, changeTab ] = useState('basic')
22
-  const contentId = props.location.query.contentId
23
-  const [ data, setData ] = useState({})
24
-  if(contentId){
25
-    useEffect(() => {
26
-      getDetail(contentId);
27
-    },[])
24
+ const Edit = props => {
25
+  let contentVisible = false
26
+  let activityVisible = false
27
+  let newsVisible = false
28
+  let helpVisible = false
29
+  let groupVisible = false
30
+  let buildingId = ''
28 31
 
29
-  // 查询列表
30
-  const getDetail = (contentId) => {
31
-    request({ ...apis.carsuseFigure.getExtendContent,urlData:{id: contentId}}).then((data) => {
32
-        console.log(data)
33
-        setData(data)
34
-    })
35
-  }
32
+  const setExtraData = data => {
33
+    contentVisible = data.contentType === 'other';
34
+    activityVisible = data.contentType === 'activity';
35
+    newsVisible = data.contentType === 'news';
36
+    helpVisible = data.contentType === 'help';
37
+    groupVisible = data.contentType === 'group';
38
+
39
+    buildingId = data.buildingId
36 40
   }
37 41
 
38
-  const cancelPage = () =>{
39
-    router.push({
40
-      pathname: '/carouselFigure/carouselFigureList',
41
-    });
42
+    
43
+  const handleFormValueChange = (props, changedValues, allValues) => {
44
+    setExtraData(allValues)
42 45
   }
43
- 
44
-    const fields = [
45
-      {
46
-        label: '所属项目',
47
-        name: 'buildingId',
48
-        render: <BuildSelect />,
49
-        value: data.buildingId,
50
-      },
51
-      {
52
-        label: '商品图片',
53
-        name: 'image',
54
-        type: FieldTypes.ImageUploader,
55
-        value: data.image,
56
-        help: '建议图片尺寸:640px*330px',
57
-      },
58
-      {
59
-        label: '标题',
60
-        name: 'title',
61
-        type: FieldTypes.Text,
62
-        value: data.title,
63
-      },
64
-      {
65
-        label: '发布位置',
66
-        name: 'showPosition',
67
-        type: FieldTypes.Select,
68
-        dict: [{
69
-          label: '首页',
70
-          value: 'index'
46
+
47
+  const XForm = createForm({ onValuesChange: handleFormValueChange })
48
+
49
+  return (props) => {
50
+
51
+    const [tab, changeTab] = useState('basic')
52
+    const { contentId } = props.location.query
53
+    const [data, setData] = useState({})
54
+    if (contentId) {
55
+      // eslint-disable-next-line react-hooks/rules-of-hooks
56
+      useEffect(() => {
57
+        getDetail(contentId);
58
+      }, [])
59
+
60
+    // 查询列表
61
+    const getDetail = contentId => {
62
+      request({ ...apis.carsuseFigure.getExtendContent, urlData: { id: contentId } }).then(data => {
63
+          console.log(data)
64
+          setExtraData(data)
65
+          setData(data)
66
+      })
67
+    }
68
+    }
69
+
70
+    const cancelPage = () => {
71
+      router.push({
72
+        pathname: '/carouselFigure/carouselFigureList',
73
+      });
74
+    }
75
+
76
+      const fields = [
77
+        {
78
+          label: '所属项目',
79
+          name: 'buildingId',
80
+          render: <BuildSelect />,
81
+          value: data.buildingId,
71 82
         },
72 83
         {
73
-          label: '商城',
74
-          value: 'mall'
75
-        }],
76
-        value: data.showPosition,
77
-      },
78
-      {
79
-        label: '类型',
80
-        name: 'contentType',
81
-        type: FieldTypes.Select,
82
-        dict: [{
83
-          label: '活动',
84
-          value: 'activity'
84
+          label: '商品图片',
85
+          name: 'image',
86
+          type: FieldTypes.ImageUploader,
87
+          value: data.image,
88
+          help: '建议图片尺寸:640px*330px',
85 89
         },
86 90
         {
87
-          label: '项目',
88
-          value: 'project'
91
+          label: '标题',
92
+          name: 'title',
93
+          type: FieldTypes.Text,
94
+          value: data.title,
89 95
         },
90 96
         {
91
-          label: '资讯',
92
-          value: 'news'
97
+          label: '发布位置',
98
+          name: 'showPosition',
99
+          type: FieldTypes.Select,
100
+          dict: [{
101
+            label: '首页',
102
+            value: 'index',
103
+          },
104
+          {
105
+            label: '积分商城',
106
+            value: 'mall',
107
+          }],
108
+          value: data.showPosition,
93 109
         },
94 110
         {
95
-          label: '其他',
96
-          value: 'other'
97
-        }],
98
-        value: data.contentType,
99
-      },
100
-      {
101
-        label: '发布内容',
102
-        name: 'content',
103
-        render: <Wangedit />,
104
-        value: data.content,
105
-      },
106
-      {
107
-        label: '状态',
108
-        name: 'status',
109
-        type: FieldTypes.Select,
110
-        dict: [{
111
-          label: "启用",
112
-          value: 1
111
+          label: '类型',
112
+          name: 'contentType',
113
+          type: FieldTypes.Select,
114
+          dict: [{
115
+            label: '常规活动',
116
+            value: 'activity',
117
+          },
118
+          {
119
+            label: '项目',
120
+            value: 'project',
121
+          },
122
+          {
123
+            label: '资讯',
124
+            value: 'news',
125
+          },
126
+          // {
127
+          //   label: '其他',
128
+          //   value: 'other',
129
+          // },
130
+          {
131
+            label: '拼团',
132
+            value: 'group',
133
+          },
134
+          {
135
+            label: '助力',
136
+            value: 'help',
137
+          }],
138
+          value: data.contentType,
113 139
         },
114 140
         {
115
-          label: "停用",
116
-          value: 0
117
-        },],
118
-        value: data.status != null ? data.status : 1,
119
-      },
120
-    ]
121
-  
122
-    const handleSubmit = val => { 
123
-      val.showType = 'banner'
124
-      if(contentId){
125
-        request({ ...apis.carsuseFigure.updataExtendContent,urlData:{id: contentId}, data: val,}).then((data) => {
126
-          cancelPage()
127
-        }).catch((err) => {
128
-          message.info(err.msg || err.message)
129
-        })
130
-      }else{
131
-        request({ ...apis.carsuseFigure.addExtendContent, data: val,}).then((data) => {
132
-          cancelPage()
133
-        }).catch((err) => {
134
-          message.info(err.msg || err.message)
135
-        })
141
+          label: '发布活动',
142
+          name: 'targetId',
143
+          render: <SelectActivity buildingId={() => buildingId} />,
144
+          hidden: () => !activityVisible,
145
+          value: data.targetId,
146
+        },
147
+        {
148
+          label: '发布资讯',
149
+          name: 'targetId',
150
+          render: <SelectNews buildingId={() => buildingId} />,
151
+          hidden: () => !newsVisible,
152
+          value: data.targetId,
153
+        },
154
+        {
155
+          label: '发布内容',
156
+          name: 'content',
157
+          render: <Wangedit />,
158
+          value: data.content,
159
+          hidden: () => !contentVisible,
160
+        },
161
+        {
162
+          label: '发布助力',
163
+          name: 'targetId',
164
+          render: <SelectHelp buildingId={() => buildingId} />,
165
+          hidden: () => !helpVisible,
166
+          value: data.targetId,
167
+        },
168
+        {
169
+          label: '发布拼团',
170
+          name: 'targetId',
171
+          render: <SelectGroup buildingId={() => buildingId} />,
172
+          hidden: () => !groupVisible,
173
+          value: data.targetId,
174
+        },
175
+        {
176
+          label: '状态',
177
+          name: 'status',
178
+          type: FieldTypes.Select,
179
+          dict: [{
180
+            label: '启用',
181
+            value: 1,
182
+          },
183
+          {
184
+            label: '停用',
185
+            value: 0,
186
+          } ],
187
+          value: data.status != null ? data.status : 1,
188
+        },
189
+      ]
190
+
191
+      const handleSubmit = val => {
192
+        val.showType = 'banner'
193
+        if (contentId) {
194
+          request({ ...apis.carsuseFigure.updataExtendContent, urlData: { id: contentId }, data: val  }).then(data => {
195
+            cancelPage()
196
+          }).catch(err => {
197
+            message.info(err.msg || err.message)
198
+          })
199
+        } else{
200
+          request({ ...apis.carsuseFigure.addExtendContent, data: val  }).then(data => {
201
+            cancelPage()
202
+          }).catch(err => {
203
+            message.info(err.msg || err.message)
204
+          })
205
+        }
136 206
       }
137
-    }
138 207
 
139
-  return (
140
-    <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
141
-  );
208
+    return (
209
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
210
+    );
211
+  }
142 212
  }
143 213
 
144 214
 
145
-
146
-export default Edit
215
+export default Edit()

+ 22
- 25
src/pages/customer/customerlist/components/attribution.jsx Näytä tiedosto

@@ -21,19 +21,19 @@ class ModalAttribution extends React.Component {
21 21
     super(props);
22 22
     this.state = {
23 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 29
   componentDidMount() {
30
-    this.getList({ pageNumber: 1, pageSize: 5 })
30
+    // this.getList({ pageNumber: 1, pageSize: 5 })
31 31
   }
32 32
 
33 33
   componentDidUpdate(preProps, preState) {
34
-    console.log(this.props.visibleData.realtyConsultant)
35
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
36
-      this.getList({ pageNumber: 1, pageSize: 5 })
34
+    console.log(this.props.visibleData)
35
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
36
+      this.getList({ pageNumber: 1, pageSize: 5, buildingId: this.props.visibleData.buildingId })
37 37
       this.setState({ visibleData: this.props.visibleData });
38 38
     }
39 39
   }
@@ -41,28 +41,25 @@ class ModalAttribution extends React.Component {
41 41
   // 弹框确定按钮
42 42
   // eslint-disable-next-line react/sort-comp
43 43
   handleOk() {
44
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
44
+    this.props.onCancel()
45 45
   }
46 46
 
47 47
   // 弹框取消按钮
48 48
   handleCancel() {
49
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
49
+    this.props.onCancel()
50 50
   }
51 51
 
52 52
   getList(params) {
53
+    console.log('params: ', params)
54
+    if (params.buildingId === '' || params.buildingId === null || params.buildingId === undefined) {
55
+      return
56
+    }
53 57
     // 网路请求
54
-    request({ ...apis.customer.consultant, params: { ...params } }).then(res => {
58
+    request({ ...apis.customer.buildingConsultant, params: { ...params } }).then(res => {
55 59
       this.setState({ dataSource: res })
56 60
     }).catch(err => {
57 61
       // eslint-disable-next-line no-unused-expressions
58
-      <Alert
59
-        style={{
60
-          marginBottom: 24,
61
-        }}
62
-        message={err}
63
-        type="error"
64
-        showIcon
65
-      />
62
+      
66 63
     })
67 64
   }
68 65
 
@@ -76,13 +73,13 @@ class ModalAttribution extends React.Component {
76 73
 
77 74
    // 分页
78 75
   onChange(pageNum) {
79
-    this.getList({ pageNumber: pageNum, pageSize: 5 })
76
+    this.getList({ pageNumber: pageNum, pageSize: 5, buildingId: this.props.visibleData.buildingId })
80 77
   }
81 78
 
82 79
   // 提交
83 80
   submitGm(record) {
84 81
     // 网路请求
85
-    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 => {
86 83
       // eslint-disable-next-line no-unused-expressions
87 84
       this.openNotificationWithIcon('success', '操作成功')
88 85
       this.handleCancel()
@@ -96,13 +93,13 @@ class ModalAttribution extends React.Component {
96 93
     const columns = [
97 94
       // {
98 95
       //   title: '编号',
99
-      //   dataIndex: 'personId',
100
-      //   key: 'personId',
96
+      //   dataIndex: 'userId',
97
+      //   key: 'userId',
101 98
       // },
102 99
       {
103 100
         title: '姓名',
104
-        dataIndex: 'name',
105
-        key: 'name',
101
+        dataIndex: 'userName',
102
+        key: 'userName',
106 103
       },
107 104
       {
108 105
         title: '电话',
@@ -116,15 +113,15 @@ class ModalAttribution extends React.Component {
116 113
       },
117 114
       {
118 115
         title: '岗位',
119
-        dataIndex: 'post',
120
-        key: 'post',
116
+        dataIndex: 'position',
117
+        key: 'position',
121 118
       },
122 119
       {
123 120
         title: '操作',
124 121
         dataIndex: 'personId',
125 122
         key: 'personId',
126 123
         // eslint-disable-next-line no-nested-ternary
127
-        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>}</>,
128 125
       },
129 126
     ]
130 127
     return (

+ 6
- 3
src/pages/customer/customerlist/customerDetail.jsx Näytä tiedosto

@@ -16,6 +16,7 @@ function header(props) {
16 16
    */
17 17
   // eslint-disable-next-line react-hooks/rules-of-hooks
18 18
   const [data, setData] = useState([{ visitRecords: [] }])
19
+  const [dataConsultant, setDataonsultant] = useState({})
19 20
 
20 21
   // eslint-disable-next-line react-hooks/rules-of-hooks
21 22
   useEffect(() => {
@@ -31,6 +32,7 @@ function header(props) {
31 32
 
32 33
     request({ ...apis.customer.CustomerRecommendGet, urlData: { id }, params: { ...params } }).then(res => {
33 34
       setData(res)
35
+      setDataonsultant(res.geoInfo)
34 36
     })
35 37
   }
36 38
 
@@ -59,6 +61,7 @@ function header(props) {
59 61
   return (
60 62
     <>
61 63
       <div className={styles.cardBox}>
64
+     {/* { console.log("data:",data),console.log("data:",dataConsultant)} */}
62 65
         <div className={styles.leftBox}>
63 66
           <p className={styles.tit}>置业顾问信息</p>
64 67
           <img className={styles.touxiang} src={ data.consultant && data.consultant.picture } />
@@ -88,9 +91,9 @@ function header(props) {
88 91
           <p className={styles.rightItem}>首次访问时间:{data.visitTime && moment(data.visitTime).format('YYYY-MM-DD')}</p>
89 92
           <p className={styles.rightItem}>预约到访时间:{data.appointmentTime && moment(data.appointmentTime).format('YYYY-MM-DD') }</p>
90 93
           <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}>国家:{ dataConsultant&&dataConsultant.country }</p>
95
+            <p className={styles.rightItem}>省份:{ dataConsultant&&dataConsultant.provience }</p>
96
+            <p className={styles.rightItem}>城市:{dataConsultant&&dataConsultant.city }</p>
94 97
             <p className={styles.rightItem}>详细信息:</p>
95 98
             <p className={styles.rightItem}>意向项目:{data.intention }</p>
96 99
             <p className={styles.rightItem}>价格区间:{data.priceRange }</p>

+ 11
- 5
src/pages/customer/customerlist/index.jsx Näytä tiedosto

@@ -37,7 +37,7 @@ function body(props) {
37 37
 
38 38
   // 调整归属 ============  start
39 39
   // eslint-disable-next-line react-hooks/rules-of-hooks
40
-  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '' })
40
+  const [gVisibleData, setGVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
41 41
   // 调整归属 ============= end
42 42
 
43 43
   // 积分记录 ============  start
@@ -123,20 +123,20 @@ function body(props) {
123 123
   // 所有这里临时解决方法是,弹出一个Modal对话框的时候,把其他的对话框给隐藏
124 124
 
125 125
   function showGM(record) {
126
-    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant })
126
+    setGVisibleData({ visible: true, customerId: record.customerId, realtyConsultant: record.realtyConsultant, buildingId: record.buildingId })
127 127
     setRecordVisibleData({ visible: false, customerId: '' })
128 128
     setStatusVisibleData({ visible: false, customerId: '' })
129 129
   }
130 130
 
131 131
   function showRecord(record) {
132 132
     setRecordVisibleData({ visible: true, customerId: record.customerId })
133
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
133
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
134 134
     setStatusVisibleData({ visible: false, customerId: '' })
135 135
   }
136 136
 
137 137
   function showStatus(record) {
138 138
     setRecordVisibleData({ visible: false, customerId: '' })
139
-    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '' })
139
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
140 140
     setStatusVisibleData({ visible: true, customerId: record.customerId, status: record.status })
141 141
   }
142 142
   function toCustomerDateil(record) {
@@ -171,6 +171,12 @@ function body(props) {
171 171
     link.click()
172 172
   }
173 173
 
174
+  // 关闭调整归属的窗口
175
+  function closeAttribution() {
176
+    setGVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
177
+    getList({ pageNum: 1, pageSize: 10, customerType, ...props.form.getFieldsValue() })
178
+  }
179
+
174 180
   const publicColumns = [
175 181
     {
176 182
       title: '头像',
@@ -374,7 +380,7 @@ function body(props) {
374 380
       }
375 381
       
376 382
       {/* 调整归属 */}
377
-      <Attribution visibleData={gVisibleData} />
383
+      <Attribution visibleData={gVisibleData} onCancel={() => closeAttribution()}/>
378 384
 
379 385
       {/* 积分记录 */}
380 386
       <IntegralRecord visibleData={recordVisibleData} />

+ 26
- 25
src/pages/customer/independentList/index.jsx Näytä tiedosto

@@ -112,13 +112,15 @@ class ModalTable extends React.Component {
112 112
         title: '状态',
113 113
         // eslint-disable-next-line consistent-return
114 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 117
           if (records.status === 2) { return '到访' }
117 118
           if (records.status === 3) { return '认购' }
118 119
           if (records.status === 4) { return '签约' }
119 120
           if (records.verifyStatus === 1) { return '待审核' }
120 121
           if (records.verifyStatus === 2) { return '审核同意' }
121 122
           if (records.verifyStatus === 3) { return '签约' }
123
+          // reportRecommendStatus
122 124
         },
123 125
       },
124 126
     ]
@@ -155,13 +157,13 @@ class InviteTable extends React.Component {
155 157
 
156 158
   // 挂载之后
157 159
   componentDidMount () {
158
-    const { customerId } = this.state.visibleData
159
-    this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
160
+    
160 161
   }
161 162
 
162 163
   componentDidUpdate (preProps, preState) {
163
-    const { customerId } = this.state.visibleData
164
-    if (this.props.visibleData.customerId !== preState.visibleData.customerId) {
164
+    const { customerId } = this.props.visibleData
165
+    
166
+    if (this.props.visibleData.visible !== preState.visibleData.visible) {
165 167
       this.getList({ id: customerId, pageNumber: 1, pageSize: 5 })
166 168
       this.setState({ visibleData: this.props.visibleData });
167 169
     }
@@ -170,31 +172,27 @@ class InviteTable extends React.Component {
170 172
   // 弹框确定按钮
171 173
   // eslint-disable-next-line react/sort-comp
172 174
   handleOk () {
173
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
175
+    this.setState({ dataSource: { records: [] } })
176
+    this.props.onCancel()
174 177
   }
175 178
 
176 179
   // 弹框取消按钮
177 180
   handleCancel () {
178
-    this.setState({ visibleData: { visible: false, customerId: '', realtyConsultant: '' } })
181
+    this.setState({ dataSource: { records: [] } })
182
+    this.props.onCancel()
179 183
   }
180 184
 
181 185
   getList (params) {
182
-    const { customerId } = this.props.visibleData
183
-    if (customerId === '' || customerId === undefined) {
186
+    const { id } = params
187
+    console.log(id)
188
+    if (id === '' || id === undefined) {
184 189
       return
185 190
     }
186 191
     request({ ...apis.customer.InviteClientsList, params: { ...params } }).then(res => {
187 192
       this.setState({ dataSource: res })
188 193
     }).catch(err => {
189 194
       // eslint-disable-next-line no-unused-expressions
190
-      <Alert
191
-        style={{
192
-          marginBottom: 24,
193
-        }}
194
-        message={err}
195
-        type="error"
196
-        showIcon
197
-      />
195
+    
198 196
     })
199 197
   }
200 198
 
@@ -214,15 +212,15 @@ class InviteTable extends React.Component {
214 212
       },
215 213
       {
216 214
         title: '用户姓名',
217
-        dataIndex: 'name',
218
-        key: 'name',
215
+        dataIndex: 'nickname',
216
+        key: 'nickname',
219 217
         align: 'center',
220 218
         render: text => <a>{text}</a>,
221 219
       },
222 220
       {
223 221
         title: '电话',
224
-        dataIndex: 'tel',
225
-        key: 'tel',
222
+        dataIndex: 'phone',
223
+        key: 'phone',
226 224
         align: 'center',
227 225
       },
228 226
       {
@@ -236,7 +234,7 @@ class InviteTable extends React.Component {
236 234
     return (
237 235
       <>
238 236
         <Modal
239
-          title="推荐客户"
237
+          title="邀请经纪人"
240 238
           destroyOnClose="true"
241 239
           width={900}
242 240
           footer={null}
@@ -388,12 +386,13 @@ function body (props) {
388 386
       title: '类型',
389 387
       dataIndex: 'personType',
390 388
       key: 'personType',
391
-      render: (_, record) => <><span>{record.channelName !== null ? '渠道经纪人' : '独立经纪人'}</span></>,
389
+      render: (_, record) => <><span>{record.personType === 'channel agent' ? '渠道经纪人' : '独立经纪人'}</span></>,
392 390
     },
393 391
     {
394 392
       title: '所属渠道',
395 393
       dataIndex: 'channelName',
396 394
       key: 'channelName',
395
+      render: (_, record) => <><span>{record.personType === 'channel agent' ? record.channelName : ''}</span></>,
397 396
     },
398 397
     {
399 398
       title: '操作',
@@ -450,9 +449,11 @@ function body (props) {
450 449
         导出
451 450
       </Button>
452 451
       <Table rowKey="independentIndex" dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />
453
-      {/* 调整归属 */}
452
+      {/* 推荐客户 */}
454 453
       <ModalTable visibleData={gVisibleData} />
455
-      <InviteTable visibleData={gInviteData} />
454
+
455
+      {/* 邀请经纪人 */}
456
+      <InviteTable visibleData={gInviteData} onCancel={() => setGInviteData({ visible: false, customerId: '', realtyConsultant: '' })} />
456 457
     </>
457 458
   );
458 459
 }

+ 58
- 26
src/pages/customer/recommendCustomer/audit.jsx Näytä tiedosto

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message } from 'antd';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Upload, message, notification } from 'antd';
3 3
 import ImageUpload from '../../../components/XForm/ImageUpload';
4 4
 import moment from 'moment';
5 5
 import request from '../../../utils/request';
@@ -7,6 +7,8 @@ import apis from '../../../services/apis';
7 7
 import Styles from './style.less';
8 8
 import { router } from 'umi';
9 9
 
10
+import Attribution from './components/attribution'
11
+
10 12
 const { Option } = Select;
11 13
 // eslint-disable-next-line @typescript-eslint/no-unused-vars
12 14
 const { Meta } = Card;
@@ -24,9 +26,20 @@ const tailFormItemLayout = {
24 26
   },
25 27
 };
26 28
 
29
+const openNotificationWithIcon = (type, message) => {
30
+  notification[type]({
31
+    message,
32
+    description:
33
+      '',
34
+  });
35
+}
36
+
27 37
 function body(props) {
28 38
   const { getFieldDecorator } = props.form
29 39
 
40
+  // eslint-disable-next-line react-hooks/rules-of-hooks
41
+  const [visibleData, setVisibleData] = useState({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
42
+
30 43
   // eslint-disable-next-line react-hooks/rules-of-hooks
31 44
   const [dataSource, setDataSource] = useState({ picture: '' })
32 45
 
@@ -49,27 +62,13 @@ function body(props) {
49 62
 
50 63
   function submitDate(params) {
51 64
     // props.form.setFieldsValue(res)
52
-    request({ ...apis.customer.auto, urlData: { id: params.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(() => {
53 66
       // eslint-disable-next-line no-unused-expressions
54
-      <Alert
55
-        style={{
56
-          marginBottom: 24,
57
-        }}
58
-        message="操作成功"
59
-        type="success"
60
-        showIcon
61
-      />
67
+      openNotificationWithIcon('success', '操作成功')
62 68
       router.go(-1)
63 69
     }).catch(err => {
64 70
       // eslint-disable-next-line no-unused-expressions
65
-      <Alert
66
-        style={{
67
-          marginBottom: 24,
68
-        }}
69
-        message={err}
70
-        type="error"
71
-        showIcon
72
-      />
71
+
73 72
     })
74 73
   }
75 74
 
@@ -89,6 +88,22 @@ function body(props) {
89 88
     console.log(e)
90 89
   }
91 90
 
91
+  // 显示选择置业顾问的窗口
92
+  function showConsultant() {
93
+    setVisibleData({ visible: true, customerId: props.form.getFieldValue('customerId'), realtyConsultant: props.form.getFieldValue('realtyConsultant'), buildingId: props.form.getFieldValue('buildingId') })
94
+  }
95
+
96
+  // 关闭选择置业顾问的窗口
97
+  function closeConsultant() {
98
+    setVisibleData({ visible: false, customerId: '', realtyConsultant: '', buildingId: '' })
99
+  }
100
+
101
+  // 选择置业顾问弹窗
102
+  function consultantSuccess(e) {
103
+    console.log(e)
104
+    props.form.setFieldsValue({ realtyConsultant: e.realtyConsultant, consultantName: e.name })
105
+  }
106
+
92 107
   return (
93 108
     <>
94 109
       <Form {...tailFormItemLayout} onSubmit={e => handleSubmit(e)} style={{ width: '800px', margin: 'auto' }}>
@@ -99,6 +114,20 @@ function body(props) {
99 114
             />,
100 115
           )}
101 116
         </Form.Item>
117
+        <Form.Item label="项目ID" style={{ display: 'none' }}>
118
+          {getFieldDecorator('buildingId')(
119
+            <Input
120
+              placeholder="项目ID"
121
+            />,
122
+          )}
123
+        </Form.Item>
124
+        <Form.Item label="归属人" style={{ display: 'none' }}>
125
+          {getFieldDecorator('realtyConsultant')(
126
+            <Input
127
+              placeholder="归属人"
128
+            />,
129
+          )}
130
+        </Form.Item>
102 131
         <Form.Item label="意向项目:">
103 132
           {getFieldDecorator('intention')(
104 133
             <Input
@@ -159,7 +188,7 @@ function body(props) {
159 188
             <DatePicker showTime placeholder="报备日期" />,
160 189
           )}
161 190
         </Form.Item>
162
-        <Form.Item label="状态">
191
+        {/* <Form.Item label="状态">
163 192
           {getFieldDecorator('verifyStatus')(
164 193
             <Select style={{ width: '180px' }} placeholder="状态" onChange={handleSelectChange}>
165 194
               <Option value={0}>未通过</Option>
@@ -167,27 +196,30 @@ function body(props) {
167 196
               <Option value={2}>已驳回</Option>
168 197
             </Select>,
169 198
           )}
170
-        </Form.Item>
199
+        </Form.Item> */}
171 200
         <Form.Item label="归属置业顾问">
172 201
             <Row gutter={8}>
173 202
               <Col span={12}>
174
-                {getFieldDecorator('consultantName')(<Input placeholder="归属置业顾问" />)}
203
+                {getFieldDecorator('consultantName')(<Input placeholder="请选择置业顾问" />)}
175 204
               </Col>
176 205
               <Col span={12}>
177
-                <Button>选择</Button>
206
+                <Button onClick={() => showConsultant()}>选择</Button>
178 207
               </Col>
179 208
             </Row>
180 209
         </Form.Item>
181 210
         <Form.Item style={{ display: 'flex', justifyContent: 'center' }}>
182
-          <Button type="primary" htmlType="submit" className={Styles.SubmitButton}>
183
-            确定
211
+          <Button type="primary" className={Styles.SubmitButton} onClick={() => submitDate({ verifyStatus: '1' })}>
212
+            审核通过
184 213
           </Button>
185 214
           &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
186
-          <Button onClick={() => router.go(-1)}>
187
-            取消
215
+          <Button onClick={() => submitDate({ verifyStatus: '2' })}>
216
+            驳回
188 217
           </Button>
189 218
         </Form.Item>
190 219
       </Form>
220
+
221
+      {/* 选择置业顾问 */}
222
+      <Attribution visibleData={visibleData} onCancel={() => closeConsultant()} onSuccess={e => consultantSuccess(e)}/>
191 223
     </>
192 224
   );
193 225
 }

+ 151
- 0
src/pages/customer/recommendCustomer/components/attribution.jsx Näytä tiedosto

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

+ 2
- 2
src/pages/customer/recommendCustomer/index.jsx Näytä tiedosto

@@ -160,7 +160,7 @@ function body(props) {
160 160
       title: '状态',
161 161
       dataIndex: 'verifyStatus',
162 162
       key: 'verifyStatus',
163
-      render: (_, record) => <><span>{ record.verifyStatus === 0 ? '未通过': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</span></>,
163
+      render: (_, record) => <><span>{ record.verifyStatus === 0 ? '待审核': record.verifyStatus === 1 ? '已通过' : record.verifyStatus === 2 ? '已驳回' : '' }</span></>,
164 164
     },
165 165
     {
166 166
       title: '操作',
@@ -170,7 +170,7 @@ function body(props) {
170 170
         <>
171 171
           {
172 172
             <AuthButton name="admin.customer.recommend.verify.id.put" noRight={null}>
173
-              {record.verifyStatus === null ? <span style={{ color: 'rgba(239,39,58,1)',cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
173
+              {record.verifyStatus === 0 ? <span style={{ color: 'rgba(239,39,58,1)',cursor: 'pointer' }} onClick={() => toAudit(record.customerId)}>审核</span> : ''}
174 174
             </AuthButton>
175 175
           }
176 176
         </>

+ 4
- 3
src/pages/customer/report/index.jsx Näytä tiedosto

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

+ 1
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Näytä tiedosto

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

+ 51
- 26
src/pages/indexEcharts/index.jsx Näytä tiedosto

@@ -15,11 +15,19 @@ import IntentionalCustomers from './components/IntentionalCustomers'
15 15
 import styles from './styles.less'
16 16
 import moment from 'moment';
17 17
 import CityNums from '../charts/CityNums';
18
-const indexEcharts = (props) => {
18
+const indexEcharts = props => {
19
+
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
21
+  const [checkData, setCheckData] = useState([])
22
+
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
24
+  useEffect(() => {
25
+    setCheckData(props.checkData)
26
+  }, [props.checkData]);
19 27
 
20 28
   const endDate = new Date()
21 29
 
22
-  //为了观察数据先设30天
30
+  // 为了观察数据先设30天
23 31
   const startDate = moment().subtract(7, 'day').toDate()
24 32
 
25 33
   function onTabledatas (e) {
@@ -29,37 +37,54 @@ const indexEcharts = (props) => {
29 37
   return (
30 38
 
31 39
     <>
32
-      <div style={{ display: 'flex',width:'100%' }}>
33
-        <div className={styles.bar}>
34
-          <UserSource endDate={endDate}  startDate={startDate} onSuccess={(e) => onTabledatas(e)}></UserSource>
40
+      <div style={{ display: 'flex', width: '100%' }}>
41
+        {checkData.includes('user_source') &&
42
+          <div className={styles.bar}>
43
+            <UserSource endDate={endDate} startDate={startDate} onSuccess={e => onTabledatas(e)}></UserSource>
44
+          </div>
45
+        }
46
+        {checkData.includes('user_source') &&
47
+          <div className={styles.pie}>
48
+            <UserSourcepie endDate={endDate} startDate={startDate}></UserSourcepie>
49
+          </div>
50
+        }
51
+      </div>
52
+      {checkData.includes('urban_distribution') &&
53
+        <div>
54
+          <CityNums></CityNums>
35 55
         </div>
36
-        <div className={styles.pie}>
37
-          <UserSourcepie endDate={endDate} startDate={startDate}></UserSourcepie>
56
+      }
57
+      {checkData.includes('user_behavior') &&
58
+        <div className={styles.behavior}>
59
+          <UserBehavior tableShow={false} endDate={endDate} startDate={startDate} dataZoom={false}></UserBehavior>
38 60
         </div>
39
-      </div>
40
-      <div>
41
-      <CityNums></CityNums>
42
-      </div>
43
-      <div className={styles.behavior}>
44
-        <UserBehavior tableShow={false} endDate={endDate} startDate={startDate} dataZoom={false}></UserBehavior>
45
-      </div>
61
+      }
46 62
       <div style={{ display: 'flex' }}>
47
-        <div className={styles.bar}>
48
-
49
-          <UserActive ></UserActive>
50
-        </div>
51
-        <div className={styles.pie}><UserSex></UserSex> </div>
63
+        {checkData.includes('active_users') &&
64
+          <div className={styles.bar}>
65
+            <UserActive ></UserActive>
66
+          </div>
67
+        }
68
+        {checkData.includes('sex_ratio') &&
69
+          <div className={styles.pie}><UserSex></UserSex> </div>
70
+        }
52 71
       </div>
53 72
       <div style={{ display: 'flex' }}>
54
-        <div className={styles.bar}>
55
-          <NewUsers endDate={endDate} startDate={startDate} dataZoom={false}></NewUsers>
56
-        </div>
57
-        <div className={styles.pie}><UserConversion></UserConversion> </div>
73
+        {checkData.includes('number_of_new_users') &&
74
+          <div className={styles.bar}>
75
+            <NewUsers endDate={endDate} startDate={startDate} dataZoom={false}></NewUsers>
76
+          </div>
77
+        }
78
+        {checkData.includes('conversion_rate') &&
79
+          <div className={styles.pie}><UserConversion></UserConversion> </div>
80
+        }
58 81
       </div >
59 82
 
60
-      <div className={styles.customers}>
61
-        <IntentionalCustomers></IntentionalCustomers>
62
-      </div>
83
+      {checkData.includes('intentional_user') &&
84
+        <div className={styles.customers}>
85
+          <IntentionalCustomers></IntentionalCustomers>
86
+        </div>
87
+      }
63 88
     </>
64 89
   )
65 90
 }

+ 107
- 74
src/pages/indexEcharts/userBehavior.jsx Näytä tiedosto

@@ -1,12 +1,13 @@
1 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 4
 import moment from 'moment';
5
+import UserBehavior from './components/UserBehavior'
6 6
 import EChart from '../../components/EchartsTest/EChart';
7 7
 import request from '../../utils/request';
8 8
 import apis from '../../services/apis';
9 9
 import BuildSelect from '../../components/SelectButton/BuildSelect'
10
+import { func } from 'prop-types';
10 11
 
11 12
 // const formatDate = (start, end) => {
12 13
 //   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
@@ -16,77 +17,73 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
16 17
 const { Option } = Select;
17 18
 
18 19
 const header = props => {
19
-
20
+  // eslint-disable-next-line react-hooks/rules-of-hooks
20 21
   const [tableData, setTableData] = useState({ records: [] })
21 22
 
23
+  // eslint-disable-next-line react-hooks/rules-of-hooks
22 24
   const [endDate, setEndDate] = useState({})
25
+  // eslint-disable-next-line react-hooks/rules-of-hooks
23 26
   const [startDate, setStartDate] = useState({})
24
-  let daterange = []
27
+  const daterange = []
25 28
 
29
+  // eslint-disable-next-line react-hooks/rules-of-hooks
26 30
   useEffect(() => {
27
-
31
+    window.scrollTo(0, 0)
28 32
     setEndDate(new Date())
29 33
     setStartDate(moment().subtract(7, 'day').toDate())
30 34
     getBizEventType()
31 35
     getBizEventList()
32 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 41
   const [eventypes, setEventTypes] = useState([])
38 42
   function getBizEventType(row) {
39
-
40 43
     request({
41 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 50
   const [eventList, setEventList] = useState([])
48 51
   function getBizEventList(row) {
49
-
50 52
     request({
51 53
       ...apis.indexEcharts.bizEvent.list,
52
-    }).then((data) => {
54
+    }).then(data => {
53 55
       setEventList(data.records)
54
-      
55 56
     })
56 57
   }
57 58
   const [properties, setProperties] = useState([])
58 59
   function getProperties(row) {
59
-
60 60
     request({
61 61
       ...apis.indexEcharts.bizEvent.properties,
62
-    }).then((data) => {
63
-
62
+    }).then(data => {
64 63
       setProperties(data.records)
65
-
66 64
     })
67 65
   }
68 66
 
69 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 83
     setEndDate(new Date())
81 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 88
   function redata(e) {
92 89
     console.log('行为回调数据:', e)
@@ -109,6 +106,12 @@ const header = props => {
109 106
     setBuildingId(value)
110 107
   }
111 108
 
109
+  // 重置
110
+  function resetQuery() {
111
+    props.form.resetFields()
112
+    props.form.setFieldsValue({ radioGroup: 'a' })
113
+  }
114
+
112 115
   const columns = [
113 116
     {
114 117
       title: '访问事件',
@@ -144,52 +147,80 @@ const header = props => {
144 147
 
145 148
   const dataSource = []
146 149
 
147
-  return (<>
150
+  const { getFieldDecorator, getFieldsError, getFieldError, isFieldTouched } = props.form;
151
+  return (
152
+  <>
148 153
     <div>
149 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 220
       </div>
189 221
 
190
-
191 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 224
       </div>
194 225
 
195 226
       {/* <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} /> */}
@@ -197,4 +228,6 @@ const header = props => {
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 Näytä tiedosto

@@ -96,7 +96,11 @@ class Header extends React.Component {
96 96
   }
97 97
 
98 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 106
   onSuccess = e => {

+ 3
- 2
src/pages/integralMall/GoodsList.jsx Näytä tiedosto

@@ -43,6 +43,7 @@ function header(props) {
43 43
 
44 44
   function handleReset() {
45 45
     props.form.resetFields();
46
+    getList({ pageNum: 1, pageSize: 10 });
46 47
   }
47 48
 
48 49
   // 跳转到编辑商品
@@ -64,7 +65,7 @@ function header(props) {
64 65
       onOk() {
65 66
         request({ ...apis.integralMall.changeTaGoods, data: { ...row },}).then((data) => {
66 67
           message.info('操作成功!')
67
-          getList({ pageNum: 1, pageSize: 10 });
68
+          getList({ pageNum: 1, pageSize: 10, ...props.form.getFieldsValue() });
68 69
         })
69 70
       }
70 71
     });
@@ -201,7 +202,7 @@ function header(props) {
201 202
       </AuthButton>
202 203
       <Table rowKey="goodsList" dataSource={data.records} columns={columns} pagination={false} />
203 204
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
204
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
205
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
205 206
       </div>
206 207
     </>
207 208
   )

+ 16
- 16
src/pages/integralMall/achieve.jsx Näytä tiedosto

@@ -129,28 +129,28 @@ const columns = [
129 129
         <TabPane tab="平台积分" key="platform">
130 130
           <Table rowKey="achieve" style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
131 131
           <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
132
-            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
132
+            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
133 133
           </div>
134 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 148
           </Form>
149 149
           <Table rowKey="achie" style={{ marginTop: '40px' }} dataSource={data.records} columns={columns} pagination={false}/>
150 150
           <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
151
-            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
151
+            <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
152 152
           </div>
153
-        </TabPane>
153
+        </TabPane> */}
154 154
       </Tabs>,
155 155
     </>
156 156
   )

+ 2
- 1
src/pages/integralMall/exchangeRecords.jsx Näytä tiedosto

@@ -30,6 +30,7 @@ function record(props) {
30 30
   const getList = (params) => {
31 31
     request({ ...apis.integralMall.taPointsExchange, params: { ...params },}).then((data) => {
32 32
         setData(data)
33
+        console.log("data:",data)
33 34
     })
34 35
   }
35 36
 
@@ -204,7 +205,7 @@ function record(props) {
204 205
       </Form>
205 206
       <Table rowKey="exchangeRecords" style={{marginTop:'40px'}} dataSource={data.records} columns={columns} pagination={false} />
206 207
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
207
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
208
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
208 209
       </div>
209 210
     </>
210 211
   )

+ 1
- 1
src/pages/integralMall/verifyList.jsx Näytä tiedosto

@@ -113,7 +113,7 @@ const header = (props) => {
113 113
       <Button type="primary" className={styles.addBtn} onClick={toBack}>返回</Button>
114 114
       <Table rowKey="verifyList" dataSource={data.records} columns={columns} pagination={false} />
115 115
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
116
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
116
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
117 117
       </div>
118 118
     </>
119 119
   )

+ 2
- 2
src/pages/integralMall/writeOff.jsx Näytä tiedosto

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

+ 1
- 1
src/pages/news/list/NewsList.jsx Näytä tiedosto

@@ -319,7 +319,7 @@ function body(props) {
319 319
       </Row>
320 320
       {/* 分页 */}
321 321
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
322
-        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} />
322
+        <Pagination showQuickJumper defaultCurrent={1} total={dataSource.total} onChange={onChange} current={dataSource.current}/>
323 323
       </div>
324 324
     </>
325 325
   );

+ 1
- 0
src/pages/news/list/editNewsList.jsx Näytä tiedosto

@@ -293,6 +293,7 @@ const { TextArea } = Input;
293 293
         <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
294 294
         <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
295 295
       </div>
296
+      <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '250px' }}>图片比例: 5:4</p>
296 297
       <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
297 298
       <Button onClick={() => router.go(-1)}>取消</Button>
298 299
     </div>

+ 15
- 6
src/pages/news/type/NewsType.jsx Näytä tiedosto

@@ -114,6 +114,10 @@ function header(props) {
114 114
       ),
115 115
     },
116 116
   ];
117
+  function handleReset() {
118
+    props.form.resetFields();
119
+    getList({ pageNum: 1, pageSize: 10 })
120
+  }
117 121
 
118 122
   const { getFieldDecorator } = props.form
119 123
   return (
@@ -121,20 +125,25 @@ function header(props) {
121 125
     <>
122 126
       <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
123 127
         <Form.Item>
124
-          {getFieldDecorator('status')(
125
-            <Select style={{ width: '180px' }} placeholder="请选择">
126
-              <Option value="1">已上架</Option>
127
-              <Option value="0">已下架</Option>
128
-            </Select>,
128
+          {getFieldDecorator('buildingId')(
129
+            <BuildSelect />,
129 130
           )}
130 131
         </Form.Item>
132
+        <Form.Item>
133
+            <Button type="primary" htmlType="submit" >
134
+              查询
135
+            </Button>
136
+            <Button style={{ marginLeft: 8 }} onClick={handleReset}>
137
+              重置
138
+            </Button>
139
+        </Form.Item>
131 140
       </Form>
132 141
       <AuthButton name="admin.taNewsType.post" noRight={null}>
133 142
         <Button type="danger" className={styles.addBtn} onClick={toEditNews()}>新增</Button>
134 143
       </AuthButton>
135 144
       <Table rowKey="newsType" dataSource={data.records} columns={columns} pagination={false} />
136 145
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
137
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
146
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
138 147
       </div>
139 148
     </>
140 149
   )

+ 27
- 28
src/pages/staff/list/StaffList.jsx Näytä tiedosto

@@ -31,48 +31,49 @@ const toEditStaff = (userId) => () => {
31 31
  */
32 32
 const CartBody = (props) => {
33 33
   const { data } = props
34
+  // console.log("data11:", data)
34 35
 
35 36
   const confirm = (data) => () => {
36
-    console.log(data,"11111")
37
-    if(data.status === 1){
37
+    // console.log(data, "11111")
38
+    if (data.status === 1) {
38 39
       Modal.confirm({
39 40
         title: '确认停用该角色?',
40 41
         okText: '确认',
41 42
         cancelText: '取消',
42
-        onOk() {
43
-          request({ ...apis.staff.change, urlData: {id:data.userId,type:'off'}}).then((data) => {
43
+        onOk () {
44
+          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'off' } }).then((data) => {
44 45
             message.info("操作成功")
45 46
             props.onFresh()
46 47
           })
47 48
         }
48 49
       });
49
-    }else{
50
+    } else {
50 51
       Modal.confirm({
51 52
         title: '确认启用该角色?',
52 53
         okText: '确认',
53 54
         cancelText: '取消',
54
-        onOk() {
55
-          request({ ...apis.staff.change, urlData: {id:data.userId,type:'on'}}).then((data) => {
55
+        onOk () {
56
+          request({ ...apis.staff.change, urlData: { id: data.userId, type: 'on' } }).then((data) => {
56 57
             message.info("操作成功")
57 58
             props.onFresh()
58 59
           })
59 60
         }
60 61
       });
61 62
     }
62
-    
63
+
63 64
   }
64 65
   return (
65 66
 
66 67
     <Card className={Styles.card}>
67 68
       <div>
68
-        <Avatar src={data.avatar} style={{ width: '0.48rem', height: '0.48rem' }} />
69
-        <Button type="link" style={{color: '#FF925C', fontSize: '0.106rem',position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
69
+        <Avatar src={data.photo} style={{ width: '0.48rem', height: '0.48rem' }} />
70
+        <Button type="link" style={{ color: '#FF925C', fontSize: '0.106rem', position: 'absolute', top: '40px', left: '0.56rem' }} onClick={toEditStaff(data.userId)}>
70 71
           编辑
71 72
                 <Icon type="form" style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
72 73
         </Button>
73 74
         <Button type="link" style={{ fontSize: ' 0.106rem', color: '#cacaca', position: 'absolute', top: '40px', right: '0' }} onClick={confirm(data)}>
74 75
           {data.status === 1 ? '停用' : '启用'}
75
-                <Icon type={data.status===1?'close-circle':'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
76
+          <Icon type={data.status === 1 ? 'close-circle' : 'form'} style={{ color: '#C0C4CC', marginLeft: '0.04rem' }} />
76 77
         </Button>
77 78
         {/* <Button type="link" style={{ fontSize: ' 0.106rem', color: '#FF925C', position: 'absolute', top: '50px', right: '0' }} onClick={confirm}>
78 79
           启用
@@ -103,23 +104,21 @@ const CartBody = (props) => {
103 104
 }
104 105
 
105 106
 const header = (props) => {
106
-  const [tempData, setTempData] = useState([])
107
-  const [pageTotal, setPageTotal] = useState('')
107
+  const [tempData, setTempData] = useState({ records: [] })
108 108
   useEffect(() => {
109
-    getList({ pageNum: 1, pageSize: 10 });
109
+    getList({ pageNum: 1, pageSize: 8 });
110 110
   }, [])
111 111
 
112 112
   const getList = (params) => {
113 113
     request({ ...apis.staff.taUser, params: { ...params } }).then((data) => {
114 114
       console.log(data, "listData")
115
-      setTempData(data.records)
116
-      setPageTotal(data.total)
115
+      setTempData(data)
117 116
     })
118 117
   }
119 118
 
120 119
   // 分页
121 120
   const onChange = (pageNumber) => {
122
-    getList({ pageNum: pageNumber, pageSize: 10 });
121
+    getList({ pageNum: pageNumber, pageSize: 8 });
123 122
   }
124 123
 
125 124
   // 提交事件
@@ -128,13 +127,13 @@ const header = (props) => {
128 127
     props.form.validateFields((err, values) => {
129 128
       if (!err) {
130 129
         console.log('提交数据: ', values)
131
-        getList({ pageNum: 1, pageSize: 10, ...values })
130
+        getList({ pageNum: 1, pageSize: 8, ...values })
132 131
       }
133 132
     });
134 133
   }
135 134
 
136
-   //重置搜索
137
-   function handleReset() {
135
+  //重置搜索
136
+  function handleReset () {
138 137
     props.form.resetFields();
139 138
   }
140 139
 
@@ -184,30 +183,30 @@ const header = (props) => {
184 183
           <Button type="primary" htmlType="submit" className={styles.searchBtn}>
185 184
             搜索
186 185
           </Button>
187
-          
188
-   <Button style={{ marginLeft: 8 }} onClick={handleReset}>
189
-              重置
186
+
187
+          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
188
+            重置
190 189
             </Button>
191 190
         </Form.Item>
192 191
       </Form>
193 192
       <Button type="danger" style={{ margin: '20px 0', padding: '2px 36px' }} onClick={toEditStaff()}>新增</Button>
194 193
       <Row style={{ padding: ' 0 10px' }}>
195 194
         {
196
-          tempData.map((item, index) => (
195
+          tempData.records.map((item, index) => (
197 196
             <Col span={6}>
198
-              <CartBody data={item} onFresh={()=> getList({ pageNum: 1, pageSize: 10 })}/>
197
+              <CartBody data={item} onFresh={() => getList({ pageNum: 1, pageSize: 8 })} key={item.userId} />
199 198
             </Col>
200 199
           ))
201 200
         }
202 201
       </Row>
203 202
 
204 203
       {/* 分页  */}
205
-      <div style={{ display: 'flex', justifyContent: 'flex-end' }}>
206
-        <Pagination showQuickJumper defaultCurrent={1} total={pageTotal} onChange={onChange} />
204
+      <div style={{ display: 'flex', justifyContent: 'flex-end' }}>     
205
+        <Pagination showQuickJumper defaultCurrent={1} pageSize={8} total={tempData.total} onChange={onChange} current={tempData.current}/>
207 206
       </div>
208 207
     </>
209 208
   )
210 209
 }
211 210
 const WrappedHeader = Form.create({ name: 'header' })(header);
212 211
 
213
-export default WrappedHeader
212
+export default WrappedHeader

+ 17
- 17
src/pages/staff/list/editStaff.jsx Näytä tiedosto

@@ -158,22 +158,22 @@ const Edit = (props) => {
158 158
       </Select>,
159 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 178
       label: '地址',
179 179
       name: 'address',
@@ -220,7 +220,7 @@ const Edit = (props) => {
220 220
 
221 221
   console.log('--------->', fields)
222 222
 
223
-  return <XForm onSubmit={handleSubmit} fields={fields}></XForm>
223
+  return <XForm onSubmit={handleSubmit} fields={fields} onCancel={() => router.go(-1)}></XForm>
224 224
 }
225 225
 
226 226
 

+ 10
- 5
src/pages/style/GoodsList.less Näytä tiedosto

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

+ 172
- 50
src/pages/system/document/audit.jsx Näytä tiedosto

@@ -1,88 +1,210 @@
1 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 3
 import ZmageImg from '../../../components/ZmageImg/ZmageImg'
4 4
 import request from '../../../utils/request';
5 5
 import apis from '../../../services/apis';
6 6
 import { router } from 'umi';
7
+import AuthButton from '../../../components/AuthButton';
8
+import moment from 'moment';
7 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 26
 function body (props) {
10 27
   const documentVerifyId = props.location.query.id
11 28
   const [data, setData] = useState([])
12
-
29
+  const [datas, setDatas] = useState({})
30
+  // const [status,setStatus] = useState()
13 31
   useEffect(() => {
14 32
     getList()
15
-
33
+    // setVisible(false)
34
+    // setReasonValue()
35
+    // useState(2)
16 36
   }, [])
17
-// , documentVerifyId: documentVerifyId
37
+  // , documentVerifyId: documentVerifyId
18 38
   function getList (params) {
19 39
     // 网路请求
20
-    console.log(props,'1111')
21
-    request({ ...apis.system.documentVerifyDetail, urlData:{ id:documentVerifyId }  }).then(data => {
22
-      console.log('data:', data.imgList)
23
-      setData(data.imgList)
40
+    console.log(props, '1111')
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 45
     }).catch(err => {
25 46
       // eslint-disable-next-line no-unused-expressions
26 47
 
27 48
     })
28 49
   }
29
-  
30
-  function onVerify (params) {
31 50
 
32
-    alert(params)
33
-    // 网路请求
34
-    request({ ...apis.system.updateTaPolicy, urlData:{ id:documentVerifyId }, data:  {  verifyStatus: params}  }).then(data => {
35
-    
36
-    }).catch(err => {
37
-      // eslint-disable-next-line no-unused-expressions
38 51
 
39
-    })
52
+
53
+  const cancelPage = () => {
54
+    router.push({
55
+      pathname: '/system/document/list',
56
+    });
40 57
   }
41 58
 
42 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 => {
75
+
76
+
77
+      })
78
+    }
79
+
80
+
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)
96
+      }
97
+    }
43 98
 
44
-  const handleOk =  () => {
45
-    Modal.confirm({
46
-      title: '审核通过后,将给当前用户发放积分 确认审核通过?',
47
-      okText: '确认',
48
-      cancelText: '取消',
49
-      onOk() {
50
-       
99
+    const showModal = () => {
100
+      setVisible(true)
101
+    };
102
+
103
+    const handleOk1 = e => {
104
+      console.log(reasonValue, "2222");
105
+      if (reasonValue ) {
106
+        // console.log(e);
51 107
         onVerify(2)
108
+        console.log(reasonValue, "11111111");
109
+        setVisible(false)
110
+      } else {
111
+        message.info("不能为空")
52 112
       }
53
-    });
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 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
-        <Button type="primary" onClick={()=>handleOk()}>通过</Button>
78
-        &nbsp;&nbsp;&nbsp;&nbsp;
79
-        <Button onClick={()=>onVerify(2)}>不通过</Button>
80
-        &nbsp;&nbsp;&nbsp;&nbsp;
81
-        <Button onClick={cancelPage}>返回</Button>
82
-        
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>
202
+
83 203
       </div>
84
-     
85
-      
204
+
205
+
206
+
207
+
86 208
     </>
87 209
   )
88 210
 }

+ 31
- 29
src/pages/system/document/list.jsx Näytä tiedosto

@@ -3,6 +3,8 @@ import { Table, Form, Icon, Input, Button, message  } from 'antd'
3 3
 import request from '../../../utils/request';
4 4
 import apis from '../../../services/apis';
5 5
 import { router } from 'umi';
6
+import moment from 'moment';
7
+import AuthButton from '../../../components/AuthButton';
6 8
 
7 9
 function body(props) {
8 10
   // eslint-disable-next-line react-hooks/rules-of-hooks
@@ -54,23 +56,14 @@ function body(props) {
54 56
   }
55 57
 
56 58
   function audit(record){
57
-    if(record.verifyStatus === 0){
59
+    
58 60
       router.push({
59 61
         pathname: '/system/document/audit',
60 62
         query: {
61
-          id: record.documentVerifyId,
63
+          id: record.personId,
62 64
         },
63 65
       })
64
-    }
65
-  else{
66
-    router.push({
67
-      pathname: '/system/document/see',
68
-      query: {
69
-        id: record.documentVerifyId,
70
-      },
71
-    })
72
-      
73
-    }
66
+   
74 67
   }
75 68
 
76 69
   const columns = [
@@ -78,38 +71,47 @@ function body(props) {
78 71
       title: '姓名',
79 72
       dataIndex: 'name',
80 73
       key: 'name',
74
+      align: 'center',
81 75
     },
82 76
     {
83 77
       title: '手机号',
84
-      dataIndex: 'phone',
85
-      key: 'phone',
78
+      dataIndex: 'tel',
79
+      key: 'tel',
80
+      align: 'center',
86 81
     },
87 82
     {
88 83
       title: '提交时间',
89
-      dataIndex: 'createDate',
90
-      key: 'createDate',
84
+      dataIndex: 'summitDate',
85
+      key: 'summitDate',
86
+      align: 'center',
87
+      render: (summitDate) => moment(summitDate).format('YYYY-MM-DD HH:mm:ss')
91 88
     },
89
+
92 90
     {
93
-      title: '状态',
94
-      dataIndex: 'verifyStatus',
95
-      key: 'verifyStatus',
96
-      render: (x,row) => (
97
-        <>
98
-         
99
-            <span style={{ cursor: 'pointer' }}>{ row.verifyStatus === 0 ? '未审核' : row.verifyStatus === 1 ? '审核通过' : '审核未通过' }</span>
100
-           
101
-        </>
102
-      )
91
+      title: '已审核数',
92
+      dataIndex: 'totalSummit',
93
+      key: 'totalSummit',
94
+      align: 'center',
103 95
     },
96
+
97
+    {
98
+      title: '未审核数',
99
+      dataIndex: 'unverified',
100
+      key: 'unverified',
101
+      align: 'center',
102
+    },
103
+
104
+   
104 105
     {
105 106
       title: '操作',
106 107
       dataIndex: 'documentVerifyId',
107 108
       key: 'documentVerifyId',
109
+      align: 'center',
108 110
       render: (x,row) => (
109 111
         <>
110
-          
111
-            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.verifyStatus === 0 ? '审核' : '查看' }</span>
112
-           
112
+          <AuthButton name="admin.documentVerify.id.get" noRight={null}>
113
+            <span style={{ color: '#1990FF',cursor: 'pointer' }} onClick={()=>audit(row)}>{ row.unverified === 0 ? '查看' : '审核' }</span>
114
+           </AuthButton>
113 115
         </>
114 116
       )
115 117
     },

+ 0
- 64
src/pages/system/document/see.jsx Näytä tiedosto

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

+ 1
- 1
src/pages/system/housingPolicy.jsx Näytä tiedosto

@@ -186,7 +186,7 @@ const handleSubmit = (e, props) => {
186 186
       </AuthButton>
187 187
       <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false}/>
188 188
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
189
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
189
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
190 190
       </div>
191 191
     </>
192 192
   )

+ 1
- 1
src/pages/system/intention.jsx Näytä tiedosto

@@ -57,7 +57,7 @@ const Edit = (props) => {
57 57
     <>
58 58
       <Row>
59 59
         <Col span={6}>
60
-          <BuildSelect onChange={changBuilding} one="true" />
60
+          <BuildSelect onChange={changBuilding} checkFirst />
61 61
         </Col>
62 62
         <Col span={5} style={{ lineHeight: '30px' }}>
63 63
           用户操作

+ 1
- 1
src/pages/system/messageList.jsx Näytä tiedosto

@@ -62,7 +62,7 @@ const header = (props) => {
62 62
     <>
63 63
       <Table rowKey="messageList" dataSource={data.records} columns={columns} pagination={false}/>
64 64
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
65
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
65
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
66 66
       </div>
67 67
     </>
68 68
   )

+ 1
- 1
src/pages/third/thirdList.jsx Näytä tiedosto

@@ -93,7 +93,7 @@ const header = (props) => {
93 93
       </AuthButton>
94 94
       <Table rowKey="messageList" dataSource={data.records} columns={columns} pagination={false}/>
95 95
       <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
96
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} />
96
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
97 97
       </div>
98 98
     </>
99 99
   )

+ 50
- 34
src/services/apis.js Näytä tiedosto

@@ -236,6 +236,11 @@ export default {
236 236
       url: `${prefix}/consultant`,
237 237
       action: 'admin.consultant.get',
238 238
     },
239
+    buildingConsultant: {
240
+      method: 'GET',
241
+      url: `${prefix}/building/consultant`,
242
+      action: 'admin.building.consultant.get',
243
+    },
239 244
     recommendEdit: {
240 245
       method: 'PUT',
241 246
       url: `${prefix}/customer/recommend/edit/:id`,
@@ -441,6 +446,11 @@ export default {
441 446
         method: 'GET',
442 447
         action: 'admin.SignList.get',
443 448
       },
449
+      getTaActivityDynamicEnlistExport: {
450
+        url: `${prefix}/activityDynamicEnlist/export`,
451
+        method: 'GET',
452
+        action: 'admin.activityDynamicEnlist.export.get',
453
+      },
444 454
       taDrainage: {
445 455
         url: `${prefix}/taDrainage`,
446 456
         method: 'GET',
@@ -461,16 +471,16 @@ export default {
461 471
         method: 'PUT',
462 472
         action: 'admin.taDrainage.id.put',
463 473
       },
464
-      taDrainageRecord:{
474
+      taDrainageRecord: {
465 475
         url: `${prefix}/taDrainageRecord`,
466 476
         method: 'GET',
467 477
         action: 'admin.taDrainageRecord.get',
468 478
       },
469
-      exporttaDrainageRecord:{
479
+      exporttaDrainageRecord: {
470 480
         url: `${prefix}/taDrainageRecord/export`,
471 481
         method: 'GET',
472
-        action: 'admin.taDrainageRecord/export.get',
473
-      }
482
+        action: 'admin.taDrainageRecord.export.get',
483
+      },
474 484
   },
475 485
   integralMall: {
476 486
     tdPointsRules: {
@@ -612,25 +622,21 @@ export default {
612 622
       method: 'POST',
613 623
       action: 'admin.taBuildingReport.add.post',
614 624
     },
615
-
616
-    documentVerifylist:{
625
+    documentVerifylist: {
617 626
       url: `${prefix}/documentVerify`,
618 627
       method: 'GET',
619 628
       action: 'admin.documentVerify.get',
620 629
     },
621
-    documentVerifyDetail:{
630
+    documentVerifyDetail: {
622 631
       url: `${prefix}/documentVerify/:id`,
623 632
       method: 'GET',
624 633
       action: 'admin.documentVerify.id.get',
625 634
     },
626
-    updateTaPolicy: {
635
+    updateVerify: {
627 636
       url: `${prefix}/documentVerify/:id`,
628 637
       method: 'PUT',
629 638
       action: 'admin.documentVerify.id.put',
630 639
     },
631
-// /admin/documentVerify  查询审核列表,参数 pageNum, pageSize, name, tel
632
-// /documentVerify/{id}   根据id查询详情
633
-// /admin/documentVerify/{id} 根据Id修改
634 640
   },
635 641
   staff: {
636 642
     taUser: {
@@ -734,122 +740,132 @@ export default {
734 740
   },
735 741
  },
736 742
  helpActivity: {
743
+  effectiveList: {
744
+    url: `${prefix}/helpActivityEffective/list`,
745
+    method: 'GET',
746
+    action: 'admin.helpActivityEffective.list.get',
747
+  },
737 748
   list: {
738 749
     url: `${prefix}/helpActivity/list`,
739 750
     method: 'GET',
740
-    action: 'admin.taRole.get',
751
+    action: 'admin.helpActivity.get',
741 752
   },
742 753
   add: {
743 754
     url: `${prefix}/helpActivity/add`,
744 755
     method: 'post',
745
-    action: 'admin.taRole.get',
756
+    action: 'admin.helpActivity.add.post',
746 757
   },
747 758
   details: {
748 759
     url: `${prefix}/helpActivity/details`,
749 760
     method: 'get',
750
-    action: 'admin.taRole.get',
761
+    action: 'admin.helpActivity.details.get',
751 762
   },
752 763
   update: {
753 764
     url: `${prefix}/helpActivity/update`,
754 765
     method: 'put',
755
-    action: 'admin.taRole.get',
766
+    action: 'admin.helpActivity.update.put',
756 767
   },
757 768
   top: {
758 769
     url: `${prefix}/top/update`,
759 770
     method: 'post',
760
-    action: 'admin.taRole.get',
771
+    action: 'admin.top.update.post',
761 772
   },
762 773
   record: {
763 774
     url: `${prefix}/helpRecord`,
764 775
     method: 'get',
765
-    action: 'admin.taRole.get',
776
+    action: 'admin.helpRecord.get',
766 777
   },
767 778
   helpPeopleDetails: {
768 779
     url: `${prefix}/taHelpRecord/details`,
769 780
     method: 'get',
770
-    action: 'admin.taRole.get',
781
+    action: 'admin.taHelpRecord.details.get',
771 782
   },
772 783
   verification: {
773 784
     url: `${prefix}/helpInitiateRecordVerify`,
774 785
     method: 'post',
775
-    action: 'admin.taRole.get',
786
+    action: 'admin.helpInitiateRecordVerify.get',
776 787
   },
777 788
   HelpInitiateRecordSucceed: {
778 789
     url: `${prefix}/HelpInitiateRecordSucceed/export`,
779 790
     method: 'get',
780
-    action: 'admin.taRole.get',
791
+    action: 'admin.HelpInitiateRecordSucceed.export.get',
781 792
   },
782 793
   gethelpRecordExport: {
783 794
     url: `${prefix}/helpRecord/export`,
784 795
     method: 'get',
785
-    action: 'admin.taRole.get',
796
+    action: 'admin.helpRecord.export.get',
786 797
   },
787 798
  },
788 799
  groupActivity: {
789 800
   list: {
790 801
     url: `${prefix}/taShareActivity/list`,
791 802
     method: 'get',
792
-    action: 'admin.taShareActivity.get',
803
+    action: 'admin.taShareActivity.list.get',
804
+  },
805
+  EffectiveList: {
806
+    url: `${prefix}/taShareActivityEffective/list`,
807
+    method: 'get',
808
+    action: 'admin.taShareActivityEffective.list.get',
793 809
   },
794 810
   add: {
795 811
     url: `${prefix}/taShareActivity`,
796 812
     method: 'post',
797
-    action: 'admin.taRole.get',
813
+    action: 'admin.taShareActivity.post',
798 814
   },
799 815
   details: {
800 816
     url: `${prefix}/taShareActivity/:id`,
801 817
     method: 'get',
802
-    action: 'admin.taRole.get',
818
+    action: 'admin.taShareActivity.id.get',
803 819
   },
804 820
   avgScore: {
805 821
     url: `${prefix}/taShareActivity/avgScore`,
806 822
     method: 'get',
807
-    action: 'admin.taRole.get',
823
+    action: 'admin.taShareActivity.avgScore.get',
808 824
   },
809 825
   update: {
810 826
     url: `${prefix}/taShareActivity/update`,
811 827
     method: 'put',
812
-    action: 'admin.taRole.get',
828
+    action: 'admin.taShareActivity.update.put',
813 829
   },
814 830
   finish: {
815 831
     url: `${prefix}/taShareActivity/finish/:id`,
816 832
     method: 'put',
817
-    action: 'admin.taShareActivity.finish',
833
+    action: 'admin.taShareActivity.finish.put',
818 834
   },
819 835
   top: {
820 836
     url: `${prefix}/taShareActivity/weight`,
821 837
     method: 'put',
822
-    action: 'admin.taShareActivity.weight',
838
+    action: 'admin.taShareActivity.weight.put',
823 839
   },
824 840
   shareSuccList: {
825 841
     url: `${prefix}/taShareSuccessRecord`,
826 842
     method: 'get',
827
-    action: 'admin.taRole.get',
843
+    action: 'admin.taShareSuccessRecord.get',
828 844
   },
829 845
   shareFailList : {
830 846
     url: `${prefix}/taShareFailAndProcessingRecord`,
831 847
     method: 'get',
832
-    action: 'admin.taRole.get',
848
+    action: 'admin.taShareFailAndProcessingRecord.get',
833 849
   },
834 850
   shareChildList : {
835 851
     url: `${prefix}/taShareChildRecord`,
836 852
     method: 'get',
837
-    action: 'admin.taRole.get',
853
+    action: 'admin.taShareChildRecord.get',
838 854
   },
839 855
   exportShareChildRecord: {
840 856
     url: `${prefix}/taShareChildRecord/export`,
841 857
     method: 'get',
842
-    action: 'admin.taRole.get',
858
+    action: 'admin.taShareChildRecord.export.get',
843 859
   },
844 860
   exportShareRecord: {
845 861
     url: `${prefix}/taShareRecord/export`,
846 862
     method: 'get',
847
-    action: 'admin.taRole.get',
863
+    action: 'admin.taShareRecord.export.get',
848 864
   },
849 865
   verification: {
850 866
     url: `${prefix}/taShareRecord/verificate`,
851 867
     method: 'put',
852
-    action: 'admin.taRole.get',
868
+    action: 'admin.taShareRecord.verificate.put',
853 869
   }
854 870
  },
855 871
  third: {

+ 4
- 4
src/utils/request.js Näytä tiedosto

@@ -86,14 +86,14 @@ request.interceptors.response.use(async (response, options) => {
86 86
       if (code != 1000) {
87 87
         if (code === 1001) {
88 88
           notification.error({
89
-            message: `请求错误`,
90
-            description: '请登录系统',
89
+            message: `请登录系统`,
90
+            // description: '请登录系统',
91 91
           });
92 92
           throw new Error('请登录系统');
93 93
         } else {
94 94
           notification.error({
95
-            message: `请求错误`,
96
-            description: message,
95
+            message: message || '请求错误',
96
+            // description: message,
97 97
           });
98 98
           throw new Error(message);
99 99
         }