zlisen 3 gadus atpakaļ
vecāks
revīzija
aa0d14d460
48 mainītis faili ar 3345 papildinājumiem un 2379 dzēšanām
  1. 2
    2
      config/proxy.js
  2. 30
    30
      config/routes.js
  3. 1
    1
      src/components/SelectButton/CitySelect.jsx
  4. 57
    0
      src/components/SelectButton/SelectPolicyType.jsx
  5. 0
    182
      src/pages/Live/liveActivity copy/add/index.jsx
  6. 0
    65
      src/pages/Live/liveActivity copy/edit/components/BuildSelect/BuildSelect.jsx
  7. 0
    109
      src/pages/Live/liveActivity copy/edit/components/HelpDoc/index.jsx
  8. 0
    36
      src/pages/Live/liveActivity copy/edit/components/HelpDoc/style.less
  9. 0
    206
      src/pages/Live/liveActivity copy/edit/components/base.jsx
  10. 0
    167
      src/pages/Live/liveActivity copy/edit/components/poster.jsx
  11. 0
    118
      src/pages/Live/liveActivity copy/edit/components/share.jsx
  12. 0
    154
      src/pages/Live/liveActivity copy/edit/components/shareRecord.jsx
  13. 0
    97
      src/pages/Live/liveActivity copy/edit/components/style.less
  14. 0
    154
      src/pages/Live/liveActivity copy/edit/components/visitRecord.jsx
  15. 0
    87
      src/pages/Live/liveActivity copy/edit/index.jsx
  16. 0
    323
      src/pages/Live/liveActivity copy/list/index.jsx
  17. 0
    16
      src/pages/Live/liveActivity copy/list/liveActivityRecord.jsx
  18. 0
    4
      src/pages/Live/video/Edit/index.jsx
  19. 1
    0
      src/pages/Live/video/List/index.jsx
  20. 1
    1
      src/pages/building/Edit/SpecialRoom/index.jsx
  21. 20
    23
      src/pages/building/type/index.jsx
  22. 20
    20
      src/pages/carouselFigure/advertisingList.jsx
  23. 13
    13
      src/pages/carouselFigure/carouselFigureList.jsx
  24. 96
    93
      src/pages/carouselFigure/editAdvertising.jsx
  25. 44
    40
      src/pages/carouselFigure/editCarousel.jsx
  26. 132
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/IntentionalCustomers.jsx
  27. 103
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/NewUsers.jsx
  28. 109
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserActive.jsx
  29. 289
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserBehavior.jsx
  30. 291
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserBehaviorIndex.jsx
  31. 139
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserConversion.jsx
  32. 92
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserSex.jsx
  33. 123
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserSource.jsx
  34. 139
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserSourceDetail.jsx
  35. 103
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/UserSourcepie.jsx
  36. 138
    0
      src/pages/statistical/Monitor/components/indexEcharts/components/charts/CityNums.jsx
  37. 98
    0
      src/pages/statistical/Monitor/components/indexEcharts/index.jsx
  38. 191
    0
      src/pages/statistical/Monitor/components/indexEcharts/newUsers.jsx
  39. 37
    0
      src/pages/statistical/Monitor/components/indexEcharts/styles.less
  40. 237
    0
      src/pages/statistical/Monitor/components/indexEcharts/userBehavior.jsx
  41. 207
    0
      src/pages/statistical/Monitor/components/indexEcharts/userSource.jsx
  42. 88
    0
      src/pages/statistical/Monitor/index.jsx
  43. 164
    14
      src/pages/system/Sellhouse/Edit.jsx
  44. 0
    148
      src/pages/system/Sellhouse/compents/Basic.jsx
  45. 100
    20
      src/pages/system/Sellhouse/houseTypes/Newindex.jsx
  46. 57
    39
      src/pages/system/Sellhouse/houseTypes/index.jsx
  47. 188
    217
      src/pages/system/Sellhouse/index.jsx
  48. 35
    0
      src/services/apis.js

+ 2
- 2
config/proxy.js Parādīt failu

@@ -8,8 +8,8 @@
8 8
 export default {
9 9
   dev: {
10 10
     '/api/': {
11
-      // target: 'https://xlk.njyz.tech/',
12
-      target: 'http://localhost:8081/',
11
+      target: 'https://xlk.njyz.tech/',
12
+      // target: 'http://localhost:8081/',
13 13
       changeOrigin: true,
14 14
       pathRewrite: {
15 15
         '^': '',

+ 30
- 30
config/routes.js Parādīt failu

@@ -542,17 +542,17 @@ export default [
542 542
                 hideInMenu: true,
543 543
                 component: './carouselFigure/editAdvertising',
544 544
               },
545
-              {
546
-                path: '/carouselFigure/propagandaList',
547
-                name: '宣传位',
548
-                component: './carouselFigure/propagandaList',
549
-              },
550
-              {
551
-                path: '/carouselFigure/propaganda',
552
-                name: '宣传位编辑',
553
-                hideInMenu: true,
554
-                component: './carouselFigure/propaganda',
555
-              },
545
+              // {
546
+              //   path: '/carouselFigure/propagandaList',
547
+              //   name: '宣传位',
548
+              //   component: './carouselFigure/propagandaList',
549
+              // },
550
+              // {
551
+              //   path: '/carouselFigure/propaganda',
552
+              //   name: '宣传位编辑',
553
+              //   hideInMenu: true,
554
+              //   component: './carouselFigure/propaganda',
555
+              // },
556 556
               {
557 557
                 path: '/carouselFigure/customImg/list',
558 558
                 name: '其他',
@@ -594,32 +594,32 @@ export default [
594 594
               },
595 595
               {
596 596
                 path: '/system/houseTypes/index',
597
-                name: '购房百科类型',
597
+                name: '购房百科类型',
598 598
                 component: './system/Sellhouse/houseTypes/index',
599 599
               },
600 600
               {
601 601
                 path: '/system/Sellhouse/Edit',
602
-                name: '新增/编辑购房百科',
602
+                name: '编辑购房百科',
603 603
                 hideInMenu: true,
604 604
                 component: './system/Sellhouse/Edit',
605 605
               },
606 606
               {
607 607
                 path: '/system/Sellhouse/houseTypes/Newindex',
608
-                name: '新增',
608
+                name: '编辑购房百百科类型',
609 609
                 hideInMenu: true,
610 610
                 component: './system/Sellhouse/houseTypes/Newindex',
611 611
               },
612
-              {
613
-                path: '/system/housingPolicy/list',
614
-                name: '购房百科',
615
-                component: './system/housingPolicy/List',
616
-              },
617
-              {
618
-                path: '/system/housingPolicy/edit',
619
-                name: '购房百科编辑',
620
-                hideInMenu: true,
621
-                component: './system/housingPolicy/Edit',
622
-              },
612
+              // {
613
+              //   path: '/system/housingPolicy/list',
614
+              //   name: '购房百科',
615
+              //   component: './system/housingPolicy/List',
616
+              // },
617
+              // {
618
+              //   path: '/system/housingPolicy/edit',
619
+              //   name: '购房百科编辑',
620
+              //   hideInMenu: true,
621
+              //   component: './system/housingPolicy/Edit',
622
+              // },
623 623
               // {
624 624
               //   path: '/system/editPolicy',
625 625
               //   name: '购房政策编辑',
@@ -659,11 +659,11 @@ export default [
659 659
                 path: '/statistical',
660 660
                 redirect: '/statistical/monitor',
661 661
               },
662
-              // {
663
-              //   path: '/statistical/monitor',
664
-              //   name: '数据报表',
665
-              //   component: './Monitor',
666
-              // },
662
+              {
663
+                path: '/statistical/monitor',
664
+                name: '数据报表',
665
+                component: './statistical/Monitor',
666
+              },
667 667
               {
668 668
                 path: '/statistical/activity',
669 669
                 name: '活动统计',

+ 1
- 1
src/components/SelectButton/CitySelect.jsx Parādīt failu

@@ -37,7 +37,7 @@ const CitySelect = (props) => {
37 37
     if (props.value) {
38 38
       const tempData = data.filter(f => f.id == props.value)
39 39
       const va = (tempData.length > 0) ? props.value : undefined
40
-      props.onChange(va)
40
+      // props.onChange(va)
41 41
     }
42 42
   }
43 43
 

+ 57
- 0
src/components/SelectButton/SelectPolicyType.jsx Parādīt failu

@@ -0,0 +1,57 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+import apis from '../../services/apis';
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+
9
+/**
10
+ *
11
+ *
12
+ * @param {*} props
13
+ * @returns
14
+ */
15
+const SelectPolicyType = props => {
16
+  const [data, setData] = useState([])
17
+//   const [value, setValue] = useState([])
18
+  useEffect(() => {
19
+    getBuildList();
20
+  }, [])
21
+
22
+  const getBuildList = e => {
23
+    request({ ...apis.system.getPolicyTypeList, params: { pageNum: 1, pageSize: 999 } }).then(data => {
24
+        setData(data.records)
25
+        checkValue(data.records)
26
+        // 默认选中第一个
27
+    })
28
+  }
29
+
30
+
31
+  const checkValue = (data) => {
32
+    if (props.value) {
33
+      const tempData = data.filter(f => f.institutionId == props.value)
34
+      const va = (tempData.length > 0) ? props.value : '类型已删除,请重新选择类型'
35
+      props.onChange(va)
36
+
37
+    }
38
+  }
39
+
40
+  return (
41
+      <Select
42
+      showSearch
43
+      value={props.value}
44
+      style={{ width: '300px' }}
45
+      placeholder="请选择项目"
46
+      onChange={props.onChange}
47
+      filterOption={(input, option) =>
48
+        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
49
+      }>
50
+          {/* <Option key="" value="">全部项目</Option> */}
51
+          {data.map(building => (
52
+            <Option key={building.policyTypeId} value={building.policyTypeId}>{building.policyTypeName}</Option>
53
+          ))}
54
+      </Select>
55
+  )
56
+}
57
+export default SelectPolicyType

+ 0
- 182
src/pages/Live/liveActivity copy/add/index.jsx Parādīt failu

@@ -1,182 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, DatePicker, Radio, Upload, InputNumber } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import XForm, { FieldTypes } from '../../../../components/XForm';
5
-import router from 'umi/router';
6
-import moment from 'moment';
7
-import styles from '../../../style/GoodsList.less';
8
-import SelectCity from '../../../../components/SelectButton/CitySelect'
9
-import BuildSelect2 from '../../../../components/SelectButton/BuildSelect2'
10
-import LivePlatSelect from '../../../../components/SelectButton/LivePlatSelect'
11
-import CitySelect3 from '../../../../components/SelectButton/CitySelect3'
12
-import ImageUpload from '../../../../components/XForm/ImageUpload'
13
-import Wangedit from '../../../../components/Wangedit/Wangedit'
14
-import Navigate from '@/components/Navigate';
15
-import apis from '../../../../services/apis';
16
-import request from '../../../../utils/request';
17
-import AuthButton from '@/components/AuthButton';
18
-import Prompt from 'umi/prompt';
19
-
20
-const { Option } = Select;
21
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
22
-
23
-let cityId = ''
24
-
25
-const header = props => {
26
-  const { salesBatchId } = props.location.query
27
-  console.log(salesBatchId)
28
-  const [ saleBatchData, setSaleBatchData ] = useState({})
29
-  const [showHelp, setShowHelp] = useState(false)
30
-
31
-  const cancelPage = () =>{
32
-    router.push({
33
-      pathname: '/activity/liveActivity/list',
34
-    });
35
-  }
36
-
37
-   //打开新页面
38
-   const openIndexImg = () => {
39
-    const newWin=window.open('about:blank');
40
-    newWin.location.href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%95%99%E7%A8%8B.png"
41
-  }
42
-
43
-  function highlightsTypeChange(e) {
44
-    console.log(e.target.value,"ee")
45
-    setTypeState(e.target.value)
46
-  }
47
-
48
-  function disabledDate(current) {
49
-    // Can not select days before today and today
50
-    return current && current < moment().endOf('day');
51
-  }
52
-
53
-  function handleSubmit (e) {
54
-    e.preventDefault();
55
-    props.form.validateFields((err, values) => {
56
-      if (!err){
57
-        let {liveTime, ...submitValue} = values
58
-        submitValue.liveStartDate = moment(submitValue.liveStartDate._d).format('YYYY-MM-DD HH:mm:ss')
59
-        submitValue.liveEndDate = moment(submitValue.liveEndDate._d).format('YYYY-MM-DD HH:mm:ss')
60
-        
61
-        if (values.liveStartDate > values.liveEndDate){
62
-          message.info("直播结束时间大于开始时间")
63
-          return;
64
-        }
65
-
66
-        request({ ...apis.taliveActivity.addTaLiveActivity, data: { ...submitValue },}).then((data) => {
67
-          message.info("保存成功")
68
-          console.log(data,"datattttttt")
69
-          router.push({
70
-            pathname: '/activity/liveActivity/list/index',
71
-          });
72
-        }).catch((err) => {
73
-          message.info(err.msg || err.message)
74
-        })
75
-      }
76
-    });
77
-  }
78
-
79
-  const { getFieldDecorator } = props.form;
80
-
81
-  return (
82
-    <>
83
-      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
84
-        <Form.Item label="所属城市">
85
-          {getFieldDecorator('cityId', {
86
-            rules: [{ required: true, message: ' 请输入所属城市' }],
87
-          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')}/>)}
88
-        </Form.Item>
89
-        <Form.Item label="所属楼盘">
90
-          {getFieldDecorator('buildingId')(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
91
-        </Form.Item>
92
-        <Form.Item label="直播活动标题">
93
-          {getFieldDecorator('liveActivityTitle', {
94
-            rules: [{ required: true, message: '请输入直播活动标题' }],
95
-          })(<Input maxLength={20} placeholder="给直播活动起个名字" />)}
96
-        </Form.Item>
97
-        <Form.Item label="直播开始时间">
98
-          {getFieldDecorator('liveStartDate', {
99
-                rules: [
100
-                  {
101
-                    required: true,
102
-                    message: '请选择直播开始时间',
103
-                  },
104
-                ],
105
-              })(<DatePicker placeholder="预计开始时间"style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
106
-        </Form.Item>
107
-        <Form.Item label="直播结束时间">
108
-          {getFieldDecorator('liveEndDate', {
109
-                rules: [
110
-                  {
111
-                    required: true,
112
-                    message: '请选择直播结束时间',
113
-                  },
114
-                ],
115
-              })(<DatePicker placeholder="预计结束时间" disabledDate={disabledDate} style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
116
-        </Form.Item>
117
-        <Form.Item label="直播小程序">
118
-          {getFieldDecorator('liveApp', {
119
-              rules: [{ required: true, message: '请选择直播小程序' }],
120
-            })((<LivePlatSelect />))}
121
-        </Form.Item>
122
-        <Form.Item label="房间参数">
123
-          {getFieldDecorator('liveRoomParam', {
124
-            rules: [{ required: true, message: '请输入房间参数' }],
125
-          })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}<Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
126
-        </Form.Item>
127
-        <Form.Item label="封面图1" help="建议尺寸:750px*420px,比例16:9,格式:jpg,用于:活动列表">
128
-              {getFieldDecorator('listImg', {
129
-                  rules: [{ required: true, message: '请上传封面图1' }],
130
-              })(
131
-                <ImageUpload />,
132
-              )}
133
-        </Form.Item>  
134
-        <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
135
-              {getFieldDecorator('detailImg', {
136
-                  rules: [{ required: true, message: '请上传封面图2' }],
137
-              })(
138
-                <ImageUpload />,
139
-              )}
140
-        </Form.Item>  
141
-        <Form.Item label="详情图" help="格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
142
-              {getFieldDecorator('detailTypeImg', {
143
-                  rules: [{ required: true, message: '请上传详情图' }],
144
-              })(
145
-                <ImageUpload />,
146
-              )}
147
-        </Form.Item>      
148
-        <Form.Item label="权重">
149
-              {getFieldDecorator('weight', {
150
-                  rules: [{ required: true, message: '请设置权重' }],
151
-              })(
152
-                <InputNumber placeholder="权重越大越靠前" style={{width:'150px'}}/>
153
-              )}
154
-        </Form.Item>
155
-        <Form.Item label="发布状态">
156
-          {getFieldDecorator('status', {
157
-              rules: [{ required: true, message: '请选择发布状态' }],
158
-            })(<Select placeholder="发布状态" style={{ width: '300px' }}>
159
-            <Option value="0">否</Option>
160
-            <Option value="1">是</Option>
161
-          </Select>)}
162
-        </Form.Item>
163
-        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
164
-          <Button type="primary" htmlType="submit"style={{marginRight:'20px'}}>
165
-            确定
166
-          </Button>
167
-          <Button onClick={() => router.go(-1)}>
168
-            取消
169
-          </Button>
170
-        </Form.Item>
171
-      </Form>
172
-      <Prompt message={location =>
173
-        location.pathname.startsWith("/activity/liveActivity")
174
-          ? true
175
-          : localStorage.removeItem("liveActivePageParams")} />
176
-    </>
177
-  )
178
-}
179
-
180
-const WrappedHeader = Form.create({ name: 'header' })(header);
181
-
182
-export default WrappedHeader

+ 0
- 65
src/pages/Live/liveActivity copy/edit/components/BuildSelect/BuildSelect.jsx Parādīt failu

@@ -1,65 +0,0 @@
1
-import React, { useState, useEffect, useRef } from 'react';
2
-import { Select } from 'antd';
3
-import apis from '../../../../../../services/apis';
4
-import request from '../../../../../../utils/request'
5
-
6
-const { Option } = Select;
7
-
8
-function usePrevious(props) {
9
-  const ref = useRef();
10
-  useEffect(() => {
11
-    ref.current = props;
12
-  });
13
-  return ref.current;
14
-}
15
-
16
-/**
17
- *
18
- *
19
- * @param {*} props
20
- * @returns
21
- */
22
-const BuildingSelect = props => {
23
-  const [data, setData] = useState([])
24
-  const [value, setValue] = useState([])
25
-  console.log('props', props.cityId());
26
-  useEffect(() => {
27
-    getBuildList();
28
-  }, [props.cityId()])
29
-
30
-
31
-  const getBuildList = e => {
32
-    request({ ...apis.building.buildingSelect, params: { cityId: props.cityId(), pageNum: 1, pageSize: 999 } }).then(data => {
33
-        setData(data)
34
-        checkValue(data)
35
-        // 默认选中第一个
36
-    })
37
-  }
38
-
39
-
40
-  const checkValue = (data) => {
41
-    if (props.value) {
42
-      const tempData = data.filter(f => f.buildingId == props.value)
43
-      const va = (tempData.length > 0) ? props.value : '项目已下线,请重新选择项目'
44
-      props.onChange(va)
45
-
46
-    }
47
-  }
48
-
49
-  return (
50
-      <Select
51
-      showSearch
52
-      value={props.value}
53
-      style={{ width: '300px' }}
54
-      placeholder="请选择项目"
55
-      onChange={props.onChange}
56
-      filterOption={(input, option) =>
57
-        option.props.children && option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
58
-      }>
59
-          {data.map(building => (
60
-            <Option key={building.buildingId} value={building.buildingId}>{building.buildingName}</Option>
61
-          ))}
62
-      </Select>
63
-  )
64
-}
65
-export default BuildingSelect

+ 0
- 109
src/pages/Live/liveActivity copy/edit/components/HelpDoc/index.jsx Parādīt failu

@@ -1,109 +0,0 @@
1
-import React, { PureComponent } from 'react'
2
-import { Modal, Row, Col } from 'antd'
3
-import EnDash from '../EnDash'
4
-
5
-import Style from './style.less'
6
-import HotBlock from '../HotBlock'
7
-
8
-const dataset = [
9
-  {
10
-    label: '(0)',
11
-    value: 0,
12
-  },
13
-  {
14
-    label: '(1)',
15
-    value: 1,
16
-  },
17
-  {
18
-    label: '(2)',
19
-    value: 2,
20
-  },
21
-  {
22
-    label: '(3)',
23
-    value: 3,
24
-  },
25
-  {
26
-    label: '(4)',
27
-    value: 4,
28
-  },
29
-  {
30
-    label: '(5)',
31
-    value: 5,
32
-  },
33
-  {
34
-    label: '(6~10)',
35
-    value: 8,
36
-  },
37
-  {
38
-    label: '(11~20)',
39
-    value: 15,
40
-  },
41
-  {
42
-    label: '(21~30)',
43
-    value: 25,
44
-  },
45
-  {
46
-    label: '(31~40)',
47
-    value: 35,
48
-  },
49
-  {
50
-    label: '(41~50)',
51
-    value: 45,
52
-  },
53
-  {
54
-    label: '(51~100)',
55
-    value: 80,
56
-  },
57
-  {
58
-    label: '(101~200)',
59
-    value: 150,
60
-  },
61
-  {
62
-    label: '(200以上)',
63
-    value: 201,
64
-  },
65
-]
66
-
67
-function Cell(props) {
68
-  return (
69
-    <Row type="flex" align="middle" gutter={20}>
70
-      <Col span={2}>{props.left}</Col>
71
-      <Col span={12}><EnDash /></Col>
72
-      <Col span={6}>{props.right}</Col>
73
-    </Row>
74
-  )
75
-}
76
-
77
-export default function HelpDoc(props) {
78
-  return (
79
-    <Modal footer={null} title="相关说明" visible={props.visible} onCancel={props.onCancel} width={800}>
80
-      <div className={Style.article}>
81
-        <div className={Style.section}>
82
-          <div className={Style.title}>1.图例解释:</div>
83
-          <div>
84
-            <Cell left="1号楼" right="楼栋/幢" />
85
-            <Cell left="2单元" right="单元" />
86
-            <Cell left="3楼" right="楼层" />
87
-            <Cell left="301" right="房号" />
88
-            <Cell left="1人" right="预选人数" />
89
-            <Cell left="234万" right="价格" />
90
-            <Cell left="A户型" right="户型名" />
91
-          </div>
92
-        </div>
93
-        <div className={Style.section}>
94
-          <div className={Style.title}>2.预选人数(热度):</div>
95
-          <div>每有一位客户预选此房源,热度自动增加1,热度越大说明想购买此房源的用户越多,认筹摇号购买难度越大。</div>
96
-        </div>
97
-        <div className={Style.section}>
98
-          <div className={Style.title}>3.热度指标:</div>
99
-          <div className={Style.subtitle}>颜色越深代表热度越高。黑底白字代表房源未发布,未发布房源用户不会看到。</div>
100
-          <div className={Style.flex}>
101
-            {
102
-              dataset.map((block) => (<div className={Style['flex-item']} key={block.value}><HotBlock number={block.value}>{block.label}</HotBlock></div>))
103
-            }
104
-          </div>
105
-        </div>
106
-      </div>
107
-    </Modal>
108
-  );
109
-}

+ 0
- 36
src/pages/Live/liveActivity copy/edit/components/HelpDoc/style.less Parādīt failu

@@ -1,36 +0,0 @@
1
-.article {
2
-    .section {
3
-        font-size: 16px;
4
-        line-height: 1.8em;
5
-        color: #666;
6
-
7
-        & + .section {
8
-            margin-top: 24px;
9
-        }
10
-    }
11
-
12
-    .title {
13
-        font-size: 18px;
14
-        line-height: 2em;
15
-        color: #333;
16
-    }
17
-
18
-    .subtitle {
19
-        font-size: 14px;
20
-        line-height: 1.6em;
21
-        color: #999;
22
-    }
23
-
24
-    .flex {
25
-        display: flex;
26
-        flex-wrap: wrap;
27
-
28
-        .flex-item {
29
-            margin-top: 16px;
30
-            margin-right: 8px;
31
-            flex: none;
32
-            width: 100px;
33
-            text-align: center;
34
-        }
35
-    }
36
-}

+ 0
- 206
src/pages/Live/liveActivity copy/edit/components/base.jsx Parādīt failu

@@ -1,206 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload, InputNumber } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import moment from 'moment';
5
-import router from 'umi/router';
6
-import styles from '../../../../style/GoodsList.less';
7
-import XForm, { FieldTypes, createForm } from '../../../../../components/XForm';
8
-import apis from '../../../../../services/apis';
9
-import BuildSelect2 from '../../../../../components/SelectButton/BuildSelect2';
10
-import LivePlatSelect from '../../../../../components/SelectButton/LivePlatSelect'
11
-import CitySelect3 from '../../../../../components/SelectButton/CitySelect3';
12
-import ImageUpload from '../../../../../components/XForm/ImageUpload'
13
-import request from '../../../../../utils/request';
14
-import Navigate from '@/components/Navigate';
15
-
16
-const { Option } = Select;
17
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
18
-
19
-let cityId = ''
20
-
21
-const header = props => {
22
-  console.log(props)
23
-  const liveActivityId = props.liveActivityId.liveId
24
-  console.log(liveActivityId)
25
-  const [ liveActivityData, setLiveActivityData ] = useState({})
26
-  const [showHelp, setShowHelp] = useState(false)
27
-
28
-  if(liveActivityId){
29
-    useEffect(() => {
30
-      getLiveActivityData(liveActivityId);
31
-    },[])
32
-
33
-  // 查询列表
34
-  const getLiveActivityData = (liveActivityId) => {
35
-    request({ ...apis.taliveActivity.getTaLiveActivity, urlData: {id: liveActivityId} }).then((data) => {
36
-        console.log(data, 'getLiveActivityData')
37
-        setLiveActivityData(data.data)
38
-        // if(data.qrCode == 'null'){
39
-        //   message.error("暂时无法获取二维码")
40
-        // }
41
-    })
42
-  }
43
-  }
44
-
45
-  const cancelPage = () =>{
46
-    router.push({
47
-      pathname: '/activity/liveActivity/list/index',
48
-    });
49
-  }
50
-
51
-  //打开新页面
52
-  const openIndexImg = () => {
53
-    const newWin=window.open('about:blank');
54
-    newWin.location.href="http://njcj.oss-cn-shanghai.aliyuncs.com/%E6%95%99%E7%A8%8B.png"
55
-  }
56
-
57
-  function highlightsTypeChange(e) {
58
-    console.log(e.target.value,"ee")
59
-    setTypeState(e.target.value)
60
-  }
61
-
62
-  function disabledDate(current) {
63
-    // Can not select days before today and today
64
-    return current && current < moment().endOf('day');
65
-  }
66
-
67
-  function handleSubmit (e) {
68
-    e.preventDefault();
69
-    props.form.validateFields((err, values) => {
70
-      console.log(values, 'values');
71
-      if (!err){
72
-        let {liveTime, ...submitValue} = values
73
-        if (submitValue.status == '已发布' || submitValue.status == '1'){
74
-          submitValue.status = 1
75
-        }else{
76
-          submitValue.status = 0
77
-        }
78
-        if (values.liveStartDate > values.liveEndDate){
79
-          message.info("直播结束时间大于开始时间")
80
-          return;
81
-        }
82
-        submitValue.liveStartDate = moment(submitValue.liveStartDate._d).format('YYYY-MM-DD HH:mm:ss')
83
-        submitValue.liveEndDate = moment(submitValue.liveEndDate._d).format('YYYY-MM-DD HH:mm:ss')
84
-        console.log(submitValue)
85
-        request({ ...apis.taliveActivity.updateTaLiveActivity, urlData: {id: liveActivityId},data: submitValue, }).then((data) => {
86
-          message.info("保存成功")
87
-          cancelPage()
88
-        }).catch((err) => {
89
-          message.info(err.msg || err.message)
90
-        })
91
-      }
92
-    });
93
-  }
94
-
95
-  const { getFieldDecorator } = props.form;
96
-
97
-  return (
98
-    <>
99
-      <Form labelCol={{ span: 7 }} wrapperCol={{ span: 12 }} onSubmit={handleSubmit}>
100
-        <Form.Item label="所属城市">
101
-          {getFieldDecorator('cityId', {
102
-            initialValue: liveActivityData.cityId,
103
-            rules: [{ required: true, message: ' 请输入所属城市' }],
104
-          })(<CitySelect3 buildingId={props.form.getFieldValue('buildingId')}/>)}
105
-        </Form.Item>
106
-        <Form.Item label="所属楼盘">
107
-          {getFieldDecorator('buildingId', {
108
-            initialValue: liveActivityData.buildingId,
109
-          })(<BuildSelect2 cityId={props.form.getFieldValue('cityId')}/>)}
110
-        </Form.Item>
111
-        <Form.Item label="直播活动标题">
112
-          {getFieldDecorator('liveActivityTitle', {
113
-            initialValue: liveActivityData.liveActivityTitle,
114
-            rules: [{ required: true, message: '请输入直播活动标题' }],
115
-          })(<Input maxLength={20} placeholder="给直播活动起个名字" />)}
116
-        </Form.Item>
117
-        <Form.Item label="直播开始时间">
118
-          {getFieldDecorator('liveStartDate', { initialValue : liveActivityData.liveStartDate ? moment(liveActivityData.liveStartDate, 'YYYY-MM-DD HH:mm:ss') : null,
119
-                rules: [
120
-                  {
121
-                    required: true,
122
-                    message: '请选择直播开始时间',
123
-                  },
124
-                ],
125
-              })(<DatePicker placeholder="预计开始时间" style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
126
-        </Form.Item>
127
-        <Form.Item label="直播结束时间">
128
-          {getFieldDecorator('liveEndDate', { initialValue : liveActivityData.liveEndDate ? moment(liveActivityData.liveEndDate, 'YYYY-MM-DD HH:mm:ss') : null,
129
-                rules: [
130
-                  {
131
-                    required: true,
132
-                    message: '请选择直播结束时间',
133
-                  },
134
-                ],
135
-              })(<DatePicker placeholder="预计结束时间" disabledDate={disabledDate} style={{ width: '500px' }}format="YYYY-MM-DD HH:mm:ss" showTime={{ format: 'HH:mm:ss' }}/>)}
136
-        </Form.Item>
137
-        <Form.Item label="直播小程序">
138
-          {getFieldDecorator('liveApp', {
139
-              initialValue: liveActivityData.liveApp,
140
-              rules: [{ required: true, message: '请选择直播小程序' }],
141
-            })(<LivePlatSelect />)}
142
-        </Form.Item>
143
-        <Form.Item label="房间参数">
144
-          {getFieldDecorator('liveRoomParam', {
145
-            initialValue: liveActivityData.liveRoomParam,
146
-            rules: [{ required: true, message: '请输入房间参数' }],
147
-          })(<Input maxLength={1000} placeholder="点击右侧按钮查看如何获取房间参数" style={{width:'680px'}}/>)}
148
-          <Navigate onClick={openIndexImg}>不知道怎么填?查看说明</Navigate>
149
-        </Form.Item>
150
-        <Form.Item label="封面图1" help="建议尺寸:750px*420px,比例16:9,格式:jpg,用于:活动列表">
151
-              {getFieldDecorator('listImg', {
152
-                  initialValue: liveActivityData.listImg,
153
-                  rules: [{ required: true, message: '请上传封面图1' }],
154
-              })(
155
-                <ImageUpload />,
156
-              )}
157
-        </Form.Item>  
158
-        <Form.Item label="封面图2" help="建议尺寸:750*250px,比例3:1,格式:jpg,用于:项目详情页">
159
-              {getFieldDecorator('detailImg', {
160
-                  initialValue: liveActivityData.detailImg,
161
-                  rules: [{ required: true, message: '请上传封面图2' }],
162
-              })(
163
-                <ImageUpload />,
164
-              )}
165
-        </Form.Item>  
166
-        <Form.Item label="详情图" help="格式:jpg,用于:直播活动详情页,点击可跳转到直播间">
167
-              {getFieldDecorator('detailTypeImg', {
168
-                  initialValue: liveActivityData.detailTypeImg,
169
-                  rules: [{ required: true, message: '请上传详情图' }],
170
-              })(
171
-                <ImageUpload style={{width:'300px',height:'600px'}}/>,
172
-              )}
173
-        </Form.Item>      
174
-        <Form.Item label="权重">
175
-              {getFieldDecorator('weight', {
176
-                  initialValue: liveActivityData.weight,
177
-                  rules: [{ required: true, message: '请设置权重' }],
178
-              })(
179
-                <InputNumber placeholder="权重越大越靠前" style={{width:'150px'}}/>
180
-              )}
181
-        </Form.Item>
182
-        <Form.Item label="发布状态">
183
-          {getFieldDecorator('status', {
184
-              initialValue: liveActivityData.status == 1 ? '已发布' : '未发布',
185
-              rules: [{ required: true, message: '请选择发布状态' }],
186
-            })(<Select placeholder="发布状态" style={{ width: '300px' }}>
187
-            <Option value="0">未发布</Option>
188
-            <Option value="1">已发布</Option>
189
-          </Select>)}
190
-        </Form.Item>
191
-        <Form.Item wrapperCol={{ span: 15, offset: 7 }}>
192
-          <Button type="primary" htmlType="submit"style={{marginRight:'20px'}}>
193
-            确定
194
-          </Button>
195
-          <Button onClick={() => router.go(-1)}>
196
-            取消
197
-          </Button>
198
-        </Form.Item>
199
-      </Form>
200
-    </>
201
-  )
202
-}
203
-
204
-const Base = Form.create({ name: 'header' })(header);
205
-
206
-export default Base

+ 0
- 167
src/pages/Live/liveActivity copy/edit/components/poster.jsx Parādīt failu

@@ -1,167 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import moment from 'moment';
5
-import router from 'umi/router';
6
-import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
-import XForm, { FieldTypes } from '../../../../../components/XForm';
8
-import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
-import request from '../../../../../utils/request'
10
-import yinhao from '../../../../../assets/yinhao.png'
11
-import xiaochengxu from '../../../../../assets/xiaochengxu.png'
12
-import ImageUploader from '../../../../../components/XForm/ImageUpload';
13
-import poster1 from '../../../../../assets/poster1.png';
14
-import poster2 from '../../../../../assets/poster2.png';
15
-import Styles from './style.less';
16
-import apis from '../../../../../services/apis';
17
-
18
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
19
-const { TextArea } = Input;
20
-
21
-const Poster = props => {
22
-  const [inputValue, changeInput] = useState('')
23
-  const [textAreaValue, changeTextArea] = useState('')
24
-  const [imgValue, changeImg] = useState('')
25
-  const [posterId, setPosterId] = useState('')
26
-
27
-  const [building, setBuilding] = useState({ buildingImg: [{ url: '' }] })
28
-  const liveActivityId = props.liveActivityId.liveId
29
-  if (liveActivityId) {
30
-    // eslint-disable-next-line react-hooks/rules-of-hooks
31
-    useEffect(() => {
32
-      request({
33
-        ...apis.activity.poster,
34
-        params: { targetId: liveActivityId, targetType: 'live' },
35
-      }).then(data => {
36
-        if (data.length > 0) {
37
-          setPosterId(data[0].posterId)
38
-          changeImg(data[0].posterImg)
39
-          changeTextArea(data[0].posterDescription)
40
-          changeInput(data[0].posterTitle)
41
-        }
42
-      }).catch(err => {
43
-        message.info(err.msg || err.message)
44
-      })
45
-
46
-      // getById(salesBatchId)
47
-      getMiniappName()
48
-    }, [])
49
-  }
50
-
51
-  // 获取详情信息
52
-  function getById(currentId) {
53
-
54
-    request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
55
-      setBuilding(res)
56
-      console.log('getById: ', res)
57
-    })
58
-  }
59
-  // 获取小程序名称
60
-  const [miniappName, setMiniappName] = useState('')
61
-  function getMiniappName() {
62
-
63
-    request({ ...apis.building.getMiniappName }).then(res => {
64
-    
65
-      setMiniappName(res)
66
-     
67
-    })
68
-  }
69
-
70
-  const submitPoster = () => {
71
-    if (liveActivityId) {
72
-      if (!imgValue) {
73
-        message.error('请选择海报图片')
74
-        return
75
-      }
76
-
77
-      if (posterId) {
78
-        request({
79
-          ...apis.activity.updatePoster,
80
-          urlData: { id: posterId },
81
-          data: { targetId: liveActivityId, targetType: 'live', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
82
-        }).then(() => {
83
-          message.info('保存成功')
84
-        }).catch(err => {
85
-          message.info(err.msg || err.message)
86
-        })
87
-      } else {
88
-        request({
89
-          ...apis.activity.addPoster,
90
-          data: { targetId: liveActivityId, targetType: 'live', posterImg: imgValue, posterTitle: inputValue, posterDescription: textAreaValue },
91
-        }).then(data => {
92
-          setPosterId(data.posterId)
93
-          message.info('保存成功')
94
-        }).catch(err => {
95
-          message.info(err.msg || err.message)
96
-        })
97
-      }
98
-    } else {
99
-      message.warn('请先保存基本信息数据')
100
-    }
101
-  }
102
-
103
-  return <div>
104
-    <div style={{ display: 'flex' }}>
105
-      <div style={{ width: '420px', height: '900px', display: 'inline-block', marginTop: '30px' }}>
106
-        <div style={{ width: '375px', height: '600px', backgroundColor: '#fff', boxShadow: '0px 0px 16px 6px rgba(0,0,0,0.15)', position: 'relative', margin: '0 auto' }}>
107
-          <img style={{ width: '100%', height: '560px' }} src={imgValue ? imgValue : poster1} alt="" />
108
-
109
-          {/* <p className={Styles.tagLabel}>
110
-            {
111
-              building.buildingTag && building.buildingTag.map(item => <span>{item.tagName}</span>)
112
-            }
113
-          </p> */}
114
-          {/* <p style={{
115
-            margin: '10px 20px', fontSize: '20px', color: '#222', fontWeight: '600',
116
-            display: '-webkit-box', lineClamp: '3', height: '36px', lineHeight: '36px',
117
-            WebkitLineClamp: '1',
118
-            WebkitBoxOrient: 'vertical',
119
-            overflow: 'hidden',
120
-            textOverflow: 'ellipsis',
121
-          }}>{inputValue || (building.buildingName || '海报标题')}</p>
122
-          <p style={{ color: '#999', padding: ' 0 20px' }}><span style={{ color: '#fd0d0c', fontSize: '24px', marginLeft: '6px' }}>{building.price} </span><span style={{ color: '#fd0d0c', fontSize: '20px' }}></span></p>
123
-          <img src={yinhao} style={{ width: '30px', marginLeft: '22px' }} alt="" />
124
-          <p style={{
125
-            margin: '16px 20px 28px 20px', fontSize: '17px', color: '#999',
126
-            display: '-webkit-box', lineClamp: '3', height: '72px',
127
-            WebkitLineClamp: '3',
128
-            WebkitBoxOrient: 'vertical',
129
-            overflow: 'hidden',
130
-            textOverflow: 'ellipsis',
131
-          }}>{textAreaValue || '海报描述'}</p> */}
132
-          <div style={{ backgroundColor: '#f1f1f1', padding: '22px 30px', boxShadow: '0px 6px 12px -4px #dcdcdc',position:'relative' }}>
133
-            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>长按识别小程序码</p>
134
-            <p style={{margin:'0',fontSize:'18px',color:'#888'}}>进入<span style={{margin:'0 5px',fontSize:'18px',color:'#333',fontWeight:'600'}}>{miniappName||'置业V顾问'}</span>房源列表</p>
135
-            <img style={{ width: '80px',position: 'absolute',right:'30px',top:'10px' }} src={xiaochengxu} alt="" />
136
-          </div>
137
-        </div>
138
-        <p style={{ textAlign: 'center', fontSize: '19px', color: '#666', marginTop: '30px' }}>海报模板</p>
139
-      </div>
140
-      <div >
141
-        <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
142
-        <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>
143
-          <span style={{marginLeft:'135px', color: '#999'}}>请上传制作好的海报图片用于置业顾问或用户保存分享到朋友圈,可随时更新</span>
144
-        </p>
145
-        </div>
146
-        <div style={{ display: 'flex', width: '100%', margin: '30px 0' }}>
147
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}><span style={{ color: 'red' }}>*</span> 海报图片</p>
148
-          <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
149
-        </div>
150
-        <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议尺寸:640*960px,比例2::3,格式:jpg,文件小于300KB,用于:吸引用户扫码进入直播活动页</p>
151
-        <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
152
-          {/* <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
153
-          <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} /> */}
154
-        </div>
155
-        {/* <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
156
-          <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报描述</p>
157
-          <TextArea rows={5} maxLength={1024} value={textAreaValue} onChange={e => changeTextArea(e.target.value)} />
158
-        </div> */}
159
-
160
-      </div>
161
-    </div>
162
-    <Button type="primary" onClick={submitPoster} style={{ margin: '40px 40px 40px 30vw' }}> 确定</Button>
163
-    <Button onClick={() => router.go(-1)}>取消</Button>
164
-  </div>
165
-}
166
-
167
-export default Poster

+ 0
- 118
src/pages/Live/liveActivity copy/edit/components/share.jsx Parādīt failu

@@ -1,118 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import moment from 'moment';
5
-import router from 'umi/router';
6
-import BuildSelect from '../../../../../components/SelectButton/BuildSelect'
7
-import XForm, { FieldTypes } from '../../../../../components/XForm';
8
-import Wangedit from '../../../../../components/Wangedit/Wangedit'
9
-import request from '../../../../../utils/request'
10
-import yinhao from '../../../../../assets/yinhao.png'
11
-import ImageUploader from '../../../../../components/XForm/ImageUpload';
12
-import logo from '../../../../../assets/logo.svg';
13
-import touxiang from '../../../../../assets/touxiang.jpg';
14
-import poster1 from '../../../../../assets/poster1.png';
15
-import poster2 from '../../../../../assets/poster2.png';
16
-import apis from '../../../../../services/apis';
17
-
18
-const Share = props => {
19
-  const [inputValue, changeInput] = useState('')
20
-  const [imgValue, changeImg] = useState('')
21
-  const [shareContentId, setShareContentId] = useState('')
22
-  const liveActivityId = props.liveActivityId.liveId
23
-  if (liveActivityId) {
24
-    // eslint-disable-next-line react-hooks/rules-of-hooks
25
-    useEffect(() => {
26
-      request({
27
-        ...apis.activity.shareContent,
28
-        params: { targetId: liveActivityId, targetType: 'live' },
29
-      }).then(data => {
30
-        if (data.length > 0) {
31
-          setShareContentId(data[0].shareContentId)
32
-          changeImg(data[0].shareContentImg)
33
-          changeInput(data[0].shareContentTitle)
34
-        }
35
-        // else{
36
-        //   changeInput("诚挚邀您在线选房购房~");
37
-        //   request({ ...apis.house.getTaSalesBatch, urlData: {id: salesBatchId} }).then((data) => {
38
-        //     changeImg(data.aerialViewImg);
39
-        // })
40
-        // }
41
-      }).catch(err => {
42
-        message.info(err.msg || err.message)
43
-      })
44
-      getMiniappName();
45
-    }, [])
46
-  }
47
-
48
-  // 获取小程序名称
49
-  const [miniappName, setMiniappName] = useState('')
50
-  function getMiniappName() {
51
-
52
-    request({ ...apis.building.getMiniappName }).then(res => {
53
-    
54
-      setMiniappName(res)
55
-     
56
-    })
57
-  }
58
-
59
-  const submitShare = () => {
60
-    if (liveActivityId) {
61
-      if (shareContentId) {
62
-        request({
63
-          ...apis.activity.updateShareContent,
64
-          urlData: { id: shareContentId },
65
-          data: { targetId: liveActivityId, shareContentType: 'live', shareContentImg: imgValue,shareContentTitle: inputValue },
66
-        }).then(data => {
67
-          message.info('保存成功')
68
-        }).catch(err => {
69
-          message.info(err.msg || err.message)
70
-        })
71
-       } else {
72
-        request({
73
-          ...apis.activity.addShareContent,
74
-          data: { targetId: liveActivityId, shareContentType: 'live', shareContentImg: imgValue,shareContentTitle: inputValue },
75
-        }).then(data => {
76
-          setShareContentId(data.shareContentId)
77
-          message.info('保存成功')
78
-        }).catch(err => {
79
-          message.info(err.msg || err.message)
80
-        })
81
-       }
82
-     } else {
83
-      message.warn('请先保存基本信息数据')
84
-     }
85
-  }
86
-
87
-  return <div style={{ padding: '20px' }}>
88
-    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
89
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>
90
-        <span style={{marginLeft:'135px', color: '#999'}}>请上传制作好的分享图片用于置业顾问或用户分享房源列表页面到好友或群</span>
91
-      </p>
92
-    </div>
93
-    <div style={{ display: 'flex', margin: '10px 0 40px 0', width: '100%' }}>
94
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享模板</p>
95
-      <div>
96
-        <p style={{ display: 'flex', alignItems: 'center', fontSize: '14px', color: '#999', margin: '0', lineHeight: '0' }}>
97
-          <img src={logo} style={{ width: '22px', marginRight: '10px' }} />
98
-            {miniappName}
99
-        </p>
100
-        <p style={{ fontSize: '16px', color: '#222', fontWeight: '600', margin: '0' }}>{miniappName ? miniappName : '置业V客厅 精准获客平台'}</p>
101
-        <img style={{ width: '200px', height: '160px' }} src={imgValue ? imgValue : poster2} alt="" />
102
-      </div>
103
-    </div>
104
-    <div style={{ display: 'flex', alignItems: 'center', width: '100%' }}>
105
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享标题</p>
106
-      <Input placeholder="请输入分享标题" value={inputValue}  onChange={e => changeInput(e.target.value)} />
107
-    </div>
108
-    <div style={{ display: 'flex', width: '100%', marginTop: '40px' }}>
109
-      <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>分享图片</p>
110
-      <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
111
-    </div>
112
-    <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginTop: '20px' }}>建议尺寸:750*600px,比例5:4,格式:jpg</p>
113
-    <Button type="primary" htmlType="submit" onClick={submitShare} style={{ margin: '40px 40px 40px 220px' }}> 确定</Button>
114
-    <Button onClick={() => router.go(-1)}>取消</Button>
115
-  </div>
116
-}
117
-
118
-export default Share

+ 0
- 154
src/pages/Live/liveActivity copy/edit/components/shareRecord.jsx Parādīt failu

@@ -1,154 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload, Table, Pagination } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import moment from 'moment';
5
-import router from 'umi/router';
6
-import apis from '../../../../../services/apis';
7
-import BuildSelect from '../../../../../components/SelectButton/BuildSelect';
8
-import AuthButton from '@/components/AuthButton';
9
-import styles from './style.less';
10
-import request from '../../../../../utils/request';
11
-
12
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
-const { TextArea } = Input;
14
-
15
-const header = (props) => {
16
-  const [ data, setData ] = useState({})
17
-  const [page, changePage] = useState({})
18
-  const liveActivityId = props.liveActivityId.liveId
19
-
20
-  useEffect(() => {
21
-    getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId});
22
-  },[])
23
-
24
-  // 查询列表
25
-  const getList = (params) => {
26
-    request({ ...apis.taliveActivity.taLiveShare, params: { ...params },}).then((data) => {
27
-        console.log(data)
28
-        setData(data)
29
-    }).catch(e=>
30
-      console.error(e))
31
-  }
32
-  
33
-  const columns = [
34
-    {
35
-      title: '头像',
36
-      align: 'center',
37
-      render: (text, records) => <img src={records.photoOravatar} width={50} height={50} />,
38
-    },
39
-    {
40
-      title: '昵称',
41
-      dataIndex: 'nameOrnick',
42
-      key: 'nameOrnick',
43
-      align: 'center',
44
-    },
45
-    {
46
-      title: '姓名',
47
-      dataIndex: 'name',
48
-      key: 'name',
49
-      align: 'center',
50
-    },
51
-    {
52
-      title: '手机号',
53
-      dataIndex: 'phone',
54
-      key: 'phone',
55
-      align: 'center',
56
-    },
57
-    {
58
-      title: '身份',
59
-      dataIndex: 'personType',
60
-      key: 'personType',
61
-      align: 'center',
62
-      render: (personType) => <span>{ personType === 'Realty Consultant' ? '置业顾问' : personType === 'customer' || personType === 'estate agent' ? '用户' : '游客' }</span>
63
-    },
64
-    {
65
-      title: '分享时间',
66
-      dataIndex: 'createDate',
67
-      key: 'createDate',
68
-      align: 'center',
69
-      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD hh:mm:ss')}</span></>
70
-    },
71
-    {
72
-      title: '分享方式',
73
-      dataIndex: 'shareType',
74
-      key: 'shareType',
75
-      align: 'center',
76
-      render: (x, row) => <span>{ row.tagertType == 'livePost' ? '海报分享' : '小程序分享' }</span>
77
-    },
78
-    {
79
-      title: '分享内容',
80
-      dataIndex: 'liveActivityTitle',
81
-      key: 'liveActivityTitle',
82
-      align: 'center',
83
-      render: (x, row) => <span>直播活动{ row.liveActivityTitle }的活动详情</span>
84
-    },
85
-  ];
86
-  
87
-  const changePageNum = (pageNumber) => {
88
-      getList({ pageNum: pageNumber, pageSize: 10, liveActivityId : liveActivityId, ...props.form.getFieldsValue() })
89
-  }
90
-
91
-  // 提交事件
92
-const handleSubmit = (e, props) => {
93
-    e.preventDefault();
94
-    props.form.validateFields((err, values) => {
95
-      if (!err) {
96
-        console.log('提交数据: ', values)
97
-        getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId,  ...values })
98
-      }
99
-    });
100
-  }
101
-
102
-   //重置搜索
103
-   function handleReset() {
104
-    props.form.resetFields();
105
-  }
106
-
107
-  const { getFieldDecorator } = props.form
108
-  return (
109
-
110
-    <>
111
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
112
-        <Form.Item>
113
-          {getFieldDecorator('shareType')(
114
-            <Select style={{ width: '180px' }} placeholder="分享方式">
115
-              <Option value="livePost">海报分享</Option>
116
-              <Option value="liveApp">小程序分享</Option>
117
-            </Select>,
118
-          )}
119
-        </Form.Item>
120
-        <Form.Item>
121
-          {getFieldDecorator('personType')(
122
-            <Select style={{ width: '180px' }} placeholder="身份">
123
-              <Option value="Realty Consultant">置业顾问</Option>
124
-              <Option value="customer">用户</Option>
125
-            </Select>,
126
-          )}
127
-        </Form.Item>
128
-        <Form.Item>
129
-          {getFieldDecorator('phone')(
130
-            <Input placeholder="手机号"/>
131
-          )}
132
-        </Form.Item>
133
-        <Form.Item>
134
-        <AuthButton name="admin.extendContent.search" noRight={null}>
135
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
136
-            搜索
137
-          </Button>
138
-          </AuthButton>
139
-          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
140
-              重置
141
-            </Button>
142
-        </Form.Item>
143
-      </Form>
144
-      <span>共筛选出{data.total}条记录</span>
145
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
146
-      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
147
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
148
-      </div>
149
-    </>
150
-  )
151
-}
152
-const ShareRecord = Form.create({ name: 'header' })(header);
153
-
154
-export default ShareRecord

+ 0
- 97
src/pages/Live/liveActivity copy/edit/components/style.less Parādīt failu

@@ -1,97 +0,0 @@
1
-.SubmitButton {
2
-  background: #3a91d5;
3
-  border-radius: 7px;
4
-  border: 0px;
5
-}
6
-.SelectFrom {
7
-  width: 180px;
8
-  background: #ffffff;
9
-  border-radius: 7px;
10
-  border: 1px solid #dbdbdb;
11
-}
12
-.addButton {
13
-  border-radius: 4px;
14
-  border: 0px;
15
-  margin: 10px 0px;
16
-}
17
-.cardText {
18
-  font-size: 0.106rem;
19
-  color: #333;
20
-  display: flex;
21
-  align-items: center;
22
-  position: relative;
23
-  margin-bottom: 0.08rem; 
24
-}
25
-
26
-.recommderTag{
27
-  position: absolute;
28
-  color: #fff;
29
-  line-height: 0.28rem;
30
-  width: 0.54rem;
31
-  background-color: rgba(0,0,0,0.4);
32
-  text-align: center;
33
-  border-radius: 12px 0 12px 0;
34
-  font-size: 0.09rem;
35
-}
36
-.cardItem{
37
-  font-size: 0.106rem;
38
-  font-weight: 400;
39
-  color: #666;
40
-  display: flex;
41
-  align-items: center;  
42
-  margin-bottom: 0.08rem;
43
-  .title{
44
-    display: inline-block;
45
-    width: 0.58rem;
46
-  
47
-    min-width: 0.58rem;
48
-    justify-content: space-between;
49
-    text-align: justify;
50
-    text-align-last:justify
51
-  }
52
-  
53
-}
54
-.cardText{
55
-  font-size: 0.106rem;
56
-  font-weight: 400;
57
-  color: #666;
58
-  display: flex;
59
-  align-items: center;  
60
-  margin-bottom: 0.08rem;
61
-  .title{
62
-    display: inline-block;
63
-    width: 0.58rem;
64
-  
65
-    min-width: 0.58rem;
66
-    justify-content: space-between;
67
-    text-align: justify;
68
-    text-align-last:justify
69
-  }
70
-  
71
-}
72
-.ediText {
73
-  font-size: 0.106rem;
74
-  color: #ff925c;
75
-  position: absolute;
76
-  right: 0;
77
-
78
-}
79
-
80
-
81
-.address { 
82
-  width: 400px;
83
-  height: 24px; 
84
-  text-overflow: ellipsis; 
85
-  white-space: nowrap;
86
-  overflow: hidden;
87
-}
88
-.cover{
89
-  width: 100%;
90
-
91
-  padding-bottom: 56.25%;
92
-  background-size: 100% 100% !important;
93
- 
94
-  border-radius: 12px 12px 0 0;
95
-  
96
-    // height: '14vw';
97
-}

+ 0
- 154
src/pages/Live/liveActivity copy/edit/components/visitRecord.jsx Parādīt failu

@@ -1,154 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, Tabs, Radio, DatePicker, message, Upload, Table, Pagination } from 'antd';
3
-import { FormattedMessage } from 'umi-plugin-react/locale';
4
-import moment from 'moment';
5
-import router from 'umi/router';
6
-import apis from '../../../../../services/apis';
7
-import BuildSelect from '../../../../../components/SelectButton/BuildSelect';
8
-import AuthButton from '@/components/AuthButton';
9
-import styles from './style.less';
10
-import request from '../../../../../utils/request';
11
-
12
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
13
-const { TextArea } = Input;
14
-
15
-const header = (props) => {
16
-  const [ data, setData ] = useState({})
17
-  // const [page, changePage] = useState({})
18
-  const liveActivityId = props.liveActivityId.liveId
19
-
20
-  useEffect(() => {
21
-    getList({ pageNum: 1, pageSize: 10, liveActivityId : liveActivityId});
22
-  },[])
23
-
24
-  // 查询列表
25
-  const getList = (params) => {
26
-    request({ ...apis.taliveActivity.taLiveVisit, liveActivityId : liveActivityId, params: { ...params },}).then((data) => {
27
-        console.log(data)
28
-        setData(data)
29
-    })
30
-  }
31
-  
32
-  const columns = [
33
-    {
34
-      title: '头像',
35
-      align: 'center',
36
-      render: (text, records) => <img src={records.photoOravatar} width={50} height={50} />,
37
-    },
38
-    {
39
-      title: '昵称',
40
-      dataIndex: 'nameOrnick',
41
-      key: 'nameOrnick',
42
-      align: 'center',
43
-    },
44
-    {
45
-      title: '姓名',
46
-      dataIndex: 'name',
47
-      key: 'name',
48
-      align: 'center',
49
-    },
50
-    {
51
-      title: '手机号',
52
-      dataIndex: 'phone',
53
-      key: 'phone',
54
-      align: 'center',
55
-    },
56
-    {
57
-      title: '身份',
58
-      dataIndex: 'sharePersonType',
59
-      key: 'sharePersonType',
60
-      align: 'center',
61
-      render: (sharePersonType) => <span>{ sharePersonType == 'Realty Consultant' ? '置业顾问' : sharePersonType == 'customer' || sharePersonType === 'estate agent'? '用户' : '游客' }</span>
62
-    },
63
-    {
64
-      title: '访问时间',
65
-      dataIndex: 'createDate',
66
-      key: 'createDate',
67
-      align: 'center',
68
-      render: (x, row) => <><span>{moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}</span></>
69
-    },
70
-    // {
71
-    //   title: '进入场景',
72
-    //   dataIndex: 'sceneName',
73
-    //   key: 'sceneName',
74
-    //   align: 'center',
75
-    //   render: (x, row) => <span>{ row.sceneName === 'mini_program_code' ? '扫码进入' : row.sceneName === 'search' ? '自主进入' : '小程序分享进入' }</span>
76
-    // },
77
-    {
78
-      title: '访问内容',
79
-      dataIndex: 'liveActivityTitle',
80
-      key: 'liveActivityTitle',
81
-      align: 'center',
82
-      render: (x, row) => <span>直播活动{ row.liveActivityTitle }的活动详情</span>
83
-    },
84
-  ];
85
-  
86
-  const changePageNum = (pageNumber) => {
87
-      getList({ pageNum: pageNumber, pageSize: 10, liveActivityId : liveActivityId, ...props.form.getFieldsValue() })
88
-  }
89
-
90
-  // 提交事件
91
-const handleSubmit = (e, props) => {
92
-    e.preventDefault();
93
-    props.form.validateFields((err, values) => {
94
-      if (!err) {
95
-        console.log('提交数据: ', values)
96
-        getList({ pageNum: 1, pageSize: 10, liveActivityId: liveActivityId, ...values})
97
-      }
98
-    });
99
-  }
100
-
101
-   //重置搜索
102
-   function handleReset() {
103
-    props.form.resetFields();
104
-  }
105
-
106
-  const { getFieldDecorator } = props.form
107
-  return (
108
-
109
-    <>
110
-      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
111
-        {/* <Form.Item>
112
-          {getFieldDecorator('sceneType')(
113
-            <Select style={{ width: '180px' }} placeholder="进入场景">
114
-              <Option value="mini_program_code">扫码进入</Option>
115
-              <Option value="share">小程序分享进入</Option>
116
-              <Option value="search">自主进入</Option>
117
-            </Select>,
118
-          )}
119
-        </Form.Item> */}
120
-        <Form.Item>
121
-          {getFieldDecorator('personType')(
122
-            <Select style={{ width: '180px' }} placeholder="身份">
123
-              <Option value="Realty Consultant">置业顾问</Option>
124
-              <Option value="customer">用户</Option>
125
-              <Option value="drift">游客</Option>
126
-            </Select>,
127
-          )}
128
-        </Form.Item>
129
-        <Form.Item>
130
-          {getFieldDecorator('phone')(
131
-            <Input placeholder="手机号"/>
132
-          )}
133
-        </Form.Item>
134
-        <Form.Item>
135
-        <AuthButton name="admin.extendContent.search" noRight={null}>
136
-          <Button type="primary" htmlType="submit" className={styles.searchBtn}>
137
-            搜索
138
-          </Button>
139
-          </AuthButton>
140
-          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
141
-              重置
142
-            </Button>
143
-        </Form.Item>
144
-      </Form>
145
-      <span>共筛选出{data.total}条记录</span>
146
-      <Table dataSource={data.records} columns={columns} pagination={false} rowKey="carouseFigureList"/>
147
-      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
148
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current}/>
149
-      </div>
150
-    </>
151
-  )
152
-}
153
-const VisitRecord = Form.create({ name: 'header' })(header);
154
-export default VisitRecord

+ 0
- 87
src/pages/Live/liveActivity copy/edit/index.jsx Parādīt failu

@@ -1,87 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Radio, Tag, Tooltip, Tabs, notification } from 'antd';
3
-import moment from 'moment';
4
-import request from '../../../../utils/request';
5
-import apis from '../../../../services/apis';
6
-import { router } from 'umi';
7
-
8
-import Base from './components/base'
9
-import Poster from './components/poster'
10
-import Share from './components/share'
11
-import ShareRecord from './components/shareRecord'
12
-import VisitRecord from './components/visitRecord'
13
-import Prompt from 'umi/prompt';
14
-
15
-
16
-const { Option } = Select
17
-const { TabPane } = Tabs;
18
-
19
-const formItemLayout = {
20
-  labelCol: {
21
-    xs: { span: 24 },
22
-    sm: { span: 2 },
23
-  },
24
-  wrapperCol: {
25
-    xs: { span: 24 },
26
-    sm: { span: 16 },
27
-  },
28
-};
29
-
30
-function openNotificationWithIcon(type, message) {
31
-  notification[type]({
32
-    message,
33
-    description:
34
-      '',
35
-  });
36
-}
37
-
38
-function EditHouse(props) {
39
-  const {liveActivityId} = props.location.query.id;
40
-  console.log(props.location.query.id)
41
-  const [tab, setTab] = useState('base')
42
-  const [liveActivity, setLiveActivity] = useState({ liveActivityId: undefined })
43
-  const [houseId, setHouseId] = useState('')
44
-
45
-  function tabsCallback(e) {
46
-    setTab(e.target.value)
47
-  }
48
-
49
-  // building 回调
50
-  function buildingOnSuccess(e) {
51
-    setBuildingData(e)
52
-  }
53
-
54
-  function housTabChange(e) {
55
-    setHouseId(e.houseId)
56
-    setTab('preselectionRecord')
57
-  }
58
-
59
-  const liveId = liveActivity.liveActivityId || (props.location.query && props.location.query.id)
60
-  console.log(liveId)
61
-  return (
62
-    <>
63
-      <Radio.Group value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
64
-        <Radio.Button value="base">基本信息</Radio.Button>
65
-        <Radio.Button value="poster">海报设置</Radio.Button>
66
-        <Radio.Button value="share">分享设置</Radio.Button>
67
-        <Radio.Button value="shareRecord">分享记录</Radio.Button>
68
-        <Radio.Button value="visitRecord">分享访问记录</Radio.Button>
69
-      </Radio.Group>
70
-      <div style={{ marginTop: '20px' }}>
71
-        { (tab === 'base' && <Base liveActivityId={{ liveId }} onSuccess={e => buildingOnSuccess(e)}/>)} 
72
-        { (tab === 'poster' && <Poster liveActivityId={{ liveId }}/>)}
73
-        { (tab === 'share' && <Share liveActivityId={{ liveId }}/>)}
74
-        { (tab === 'shareRecord' && <ShareRecord liveActivityId={{ liveId }}/>)}
75
-        { (tab === 'visitRecord' && <VisitRecord liveActivityId={{ liveId }}/>)}
76
-      </div>
77
-      <Prompt message={location =>
78
-        location.pathname.startsWith("/activity/liveActivity")
79
-          ? true
80
-          : localStorage.removeItem("liveActivePageParams")} />
81
-    </>
82
-  )
83
-}
84
-
85
-const WrappedEditHouseForm = Form.create({ name: 'editHouse' })(EditHouse);
86
-
87
-export default WrappedEditHouseForm

+ 0
- 323
src/pages/Live/liveActivity copy/list/index.jsx Parādīt failu

@@ -1,323 +0,0 @@
1
-import React, { useState, useEffect } from 'react';
2
-import { Form, Input, Button, Icon, Select, message, Table, Pagination, Modal, DatePicker, notification } from 'antd';
3
-import router from 'umi/router';
4
-import moment from 'moment';
5
-import AuthButton from '@/components/AuthButton';
6
-import Prompt from 'umi/prompt';
7
-import withActions from '@/components/ActionList';
8
-import EditIcon from '@/components/EditIcon';
9
-import styles from '../../../style/GoodsList.less';
10
-import SelectCity from '../../../../components/SelectButton/CitySelect'
11
-import BuildSelect from '../../../../components/SelectButton/BuildSelect'
12
-import apis from '../../../../services/apis';
13
-import request from '../../../../utils/request';
14
-import Navigate from '@/components/Navigate';
15
-// import SaleBatchListHelpDoc from '../edit/components/SalesBatchListHelpDoc';
16
-
17
-const { Option } = Select;
18
-
19
-const header = props => {
20
-  // eslint-disable-next-line react-hooks/rules-of-hooks
21
-  const [data, setData] = useState({ list: [], total: 0 })
22
-  //   const [page, changePage] = useState({})
23
-  const [liveIdList, setLiveIdList] = useState([])
24
-  const [time, setTime] = useState('')
25
-  const [showHelp, setShowHelp] = useState(false)
26
-
27
-  // 查询列表
28
-  const getList = params => {
29
-    request({ ...apis.taliveActivity.taLiveActivity, params: { ...params } }).then(data => {
30
-      console.log(data)
31
-      setData(data)
32
-    })
33
-  }
34
-
35
-  // eslint-disable-next-line react-hooks/rules-of-hooks
36
-  useEffect(() => {
37
-
38
-    if (localStorage.getItem("liveActivePageParams")) {
39
-      props.form.setFieldsValue(JSON.parse(localStorage.getItem("liveActivePageParams")));
40
-      // const { getFieldDecorator } = JSON.parse(localStorage.getItem("pageParams"))
41
-
42
-      getList(JSON.parse(localStorage.getItem("liveActivePageParams")))
43
-    } else {
44
-      localStorage.setItem("liveActivePageParams", JSON.stringify({ pageNum: 1, pageSize: 10 }));
45
-      getList({ pageNum: 1, pageSize: 10 });
46
-    }
47
-   
48
-  }, [])
49
-
50
-  // 跳转到编辑
51
-  const toAddLive = rowData => () => {
52
-    if(rowData) {
53
-      router.push({
54
-      pathname: '/activity/liveActivity/edit',
55
-      query: {
56
-        id: rowData.liveActivityId,
57
-        buildingId: rowData.buildingId,
58
-      },
59
-    });
60
-      return
61
-    }
62
-    router.push({
63
-      pathname: '/activity/liveActivity/add',
64
-    });
65
-  }
66
-
67
-  const toDataReacord = rowData => () => {
68
-  
69
-      router.push({
70
-      pathname: '/activity/liveActivity/liveActivityRecord',
71
-      query: {
72
-        id: rowData.liveActivityId,
73
-      },
74
-    });
75
-  }
76
-
77
-  function openNotificationWithIcon(type, message) {
78
-    notification[type]({
79
-      message,
80
-      description:
81
-        '',
82
-    });
83
-  }
84
-
85
-  
86
-  const toDelLiveActivity = rowData => () =>{
87
-    console.log(liveIdList, 'liveIdListliveIdList')
88
-    if(liveIdList.length < 1){
89
-      openNotificationWithIcon('error', '请先选择需要删除的直播活动')
90
-      return
91
-    }
92
-    Modal.confirm({
93
-      title: '删除后当前直播活动关联的小程序端开屏图、banner图等也会自动下架',
94
-      okText: '确定',
95
-      cancelText: '取消',
96
-      onOk () {
97
-        request({ ...apis.taliveActivity.deleteTaLiveActivity, data: liveIdList, }).then((data) => {
98
-          message.info("操作成功")
99
-          getList(JSON.parse(localStorage.getItem("liveActivePageParams")))
100
-        }).catch((err) => {
101
-          // message.info(err.msg)
102
-        })
103
-      },
104
-    });
105
-
106
-    
107
-  }
108
-
109
-  /**
110
-   *
111
-   *
112
-   * @param {*} props
113
-   * @returns
114
-   */
115
-  const columns = [
116
-    {
117
-      title: '直播活动标题',
118
-      dataIndex: 'liveActivityTitle',
119
-      key: 'liveActivityTitle',
120
-      align: 'center',
121
-      render:  (x, row) => <Navigate onClick={toAddLive(row)}>{row.liveActivityTitle}</Navigate>,
122
-    },
123
-    {
124
-      title: '所属城市',
125
-      dataIndex: 'cityName',
126
-      key: 'cityName',
127
-      align: 'center',
128
-    },
129
-    {
130
-      title: '所属楼盘',
131
-      dataIndex: 'buildingName',
132
-      key: 'buildingName',
133
-      align: 'center',
134
-    },
135
-    {
136
-      title: '直播开始时间',
137
-      dataIndex: 'liveStartDate',
138
-      key: 'liveStartDate',
139
-      align: 'center',
140
-      render: (x, row) => <><span>{`${moment(row.liveStartDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
141
-    },
142
-    {
143
-      title: '直播结束时间',
144
-      dataIndex: 'liveEndDate',
145
-      key: 'liveEndDate',
146
-      align: 'center',
147
-      render: (x, row) => <><span>{`${moment(row.liveEndDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
148
-    },
149
-    {
150
-      title: '权重',
151
-      dataIndex: 'weight',
152
-      key: 'weight',
153
-      align: 'center',
154
-    },
155
-    {
156
-      title: '发布状态',
157
-      dataIndex: 'status',
158
-      key: 'status',
159
-      align: 'center',
160
-      render: status => <><span>{status == 0 ? '未发布' : '已发布'}</span></>,
161
-    },
162
-    {
163
-      title: '新增人',
164
-      dataIndex: 'createName',
165
-      key: 'createName',
166
-      align: 'center',
167
-    },
168
-    {
169
-      title: '新增时间',
170
-      dataIndex: 'createDate',
171
-      key: 'createDate',
172
-      align: 'center',
173
-      render: (x, row) => <><span>{`${moment(row.createDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
174
-    },
175
-    {
176
-      title: '修改人',
177
-      dataIndex: 'updateName',
178
-      key: 'updateName',
179
-      align: 'center',
180
-    },
181
-    {
182
-      title: '修改时间',
183
-      dataIndex: 'updateDate',
184
-      key: 'updateDate',
185
-      align: 'center',
186
-      render: (x, row) => <><span>{`${moment(row.updateDate).format('YYYY-MM-DD HH:mm:ss')}`}</span></>,
187
-    },
188
-    {
189
-      title: '操作',
190
-      align: 'center',
191
-      width: 240,
192
-      render: withActions((text, record) => [    
193
-        <AuthButton name="admin.liveActivity.dataRecord" noRight={null}>
194
-          <EditIcon type="record" text="数据记录" onClick={toDataReacord(record)} />
195
-        </AuthButton>,
196
- 
197
-        <AuthButton name="admin.live.detail.get" noRight={null}>
198
-          <EditIcon type="look" text="查看详情" onClick={toAddLive(record)} />
199
-        </AuthButton>,
200
-      ]),
201
-    },
202
-  ];
203
-  const getSignList = dynamicId => {
204
-    router.push({
205
-      pathname: '/activity/SignList',
206
-      query: {
207
-        dynamicId,
208
-      },
209
-    });
210
-  }
211
-
212
-  const changePageNum = pageNumber => {
213
-    localStorage.setItem("liveActivePageParams", JSON.stringify({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() }));
214
-    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
215
-  }
216
-
217
-  const rowSelection = {
218
-    onChange: (selectedRowKeys, selectedRows) => {
219
-      console.log('selectedRowKeys:', selectedRowKeys, 'selectedRows: ', selectedRows);
220
-      setLiveIdList(selectedRows)
221
-    },
222
-  };
223
-
224
-  // 提交事件
225
-  const handleSubmit = e => {
226
-    e.preventDefault();
227
-    props.form.validateFields((err, values) => {
228
-      if (!err) {
229
-        console.log('提交数据: ', values)
230
-        if (time) {
231
-          values.time = `${moment(time).format('YYYY-MM-DDT00:00:00.000')}Z`
232
-        } else {
233
-          values.time = null
234
-        }
235
-        localStorage.setItem("liveActivePageParams", JSON.stringify({ pageNum: 1, pageSize: 10, ...values }));
236
-        getList({ pageNum: 1, pageSize: 10, ...values })
237
-      }
238
-    });
239
-  }
240
-
241
-  // 重置搜索
242
-  function handleReset () {
243
-    props.form.resetFields();
244
-    setTime('')
245
-    localStorage.setItem("liveActivePageParams", JSON.stringify({ pageNum: 1, pageSize: 10 }));
246
-    getList({ pageNum: 1, pageSize: 10 })
247
-  }
248
-
249
-  // 时间回调
250
-  function timeOnChange(date, dateString) {
251
-    console.log(date, dateString)
252
-    setTime(date)
253
-  }
254
-
255
-
256
-  const { getFieldDecorator } = props.form
257
-  return (
258
-
259
-    <>
260
-      {/* style={{ display: 'none' }} */}
261
-      <div id="qrcode"></div>
262
-      <Form layout="inline" onSubmit={e => handleSubmit(e)}>
263
-        <Form.Item>
264
-          {getFieldDecorator('liveActivityTitle')(
265
-             <Input
266
-             prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
267
-             placeholder="直播活动标题"
268
-           />,
269
-          )}
270
-        </Form.Item>
271
-        <Form.Item>
272
-          {getFieldDecorator('cityId')(
273
-            <SelectCity />,
274
-          )}
275
-        </Form.Item>
276
-        <Form.Item>
277
-          {getFieldDecorator('buildingId')(
278
-            <BuildSelect />,
279
-          )}
280
-        </Form.Item>
281
-        <Form.Item>
282
-          {getFieldDecorator('status')(
283
-            <Select style={{ width: '180px' }} placeholder="发布状态">
284
-            <Option value="1">已发布</Option>
285
-            <Option value="0">未发布</Option>
286
-          </Select>,
287
-          )}
288
-        </Form.Item>
289
-        <Form.Item>
290
-          <AuthButton name="admin.buildingDynamic.search" noRight={null}>
291
-            <Button type="primary" htmlType="submit" className={styles.searchBtn}>
292
-              搜索
293
-            </Button>
294
-          </AuthButton>
295
-          <Button style={{ marginLeft: 8 }} onClick={handleReset}>
296
-            重置
297
-            </Button>
298
-        </Form.Item>
299
-      </Form>
300
-      
301
-      <AuthButton name="admin.live.add.post" noRight={null}>
302
-        <Button type="danger" className={styles.addBtn} onClick={toAddLive()}>新增</Button>
303
-      </AuthButton>
304
-      <AuthButton name="admin.live.del" noRight={null}>
305
-        <Button type="primary" className={styles.addBtn} onClick={toDelLiveActivity()} style={{marginLeft:'30px'}}>删除</Button>
306
-      </AuthButton><br/>
307
-      <span>共筛选出{data.total}条记录</span>
308
-      <Table rowSelection={rowSelection}
309
-       dataSource={data.records} columns={columns} pagination={false} rowKey="activityList" />
310
-      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
311
-        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={e => changePageNum(e)} current={data.current}/>
312
-      </div>
313
-      {/* <SaleBatchListHelpDoc visible={showHelp} onCancel={() => setShowHelp(false)} /> */}
314
-      <Prompt message={location =>
315
-        location.pathname.startsWith("/activity/liveActivity")
316
-          ? true
317
-          : localStorage.removeItem("liveActivePageParams")} />
318
-    </>
319
-  )
320
-}
321
-const WrappedHeader = Form.create({ name: 'header' })(header);
322
-
323
-export default WrappedHeader

+ 0
- 16
src/pages/Live/liveActivity copy/list/liveActivityRecord.jsx Parādīt failu

@@ -1,16 +0,0 @@
1
-import React from 'react';
2
-import DataRecord from '../../dataRecord/index'
3
-import Prompt from 'umi/prompt';
4
-
5
-const header = props =>{
6
-    const id = props.location.query.id
7
-    // type:'live',
8
-    return <><DataRecord id ={id} activeType="live"/>
9
-    <Prompt message={location =>
10
-        location.pathname.startsWith("/activity/liveActivity")
11
-          ? true
12
-          : localStorage.removeItem("liveActivePageParams")} />
13
-          </>
14
-}
15
-
16
-export default header

+ 0
- 4
src/pages/Live/video/Edit/index.jsx Parādīt failu

@@ -25,10 +25,6 @@ import ImageUpload from '@/components/XForm/ImageUpload';
25 25
 import request from '@/utils/request';
26 26
 import Navigate from '@/components/Navigate';
27 27
 
28
-const { Option } = Select;
29
-const { MonthPicker, RangePicker, WeekPicker } = DatePicker;
30
-
31
-let cityId = '';
32 28
 
33 29
 const header = props => {
34 30
   console.log(props);

+ 1
- 0
src/pages/Live/video/List/index.jsx Parādīt failu

@@ -102,6 +102,7 @@ const Video = props => {
102 102
       dataIndex: 'lookNum',
103 103
       key: 'lookNum',
104 104
       align: 'center',
105
+      render: (x, row) =>x||0
105 106
     },
106 107
     {
107 108
       title: '归属楼盘',

+ 1
- 1
src/pages/building/Edit/SpecialRoom/index.jsx Parādīt failu

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react'
2
-import { Button } from 'antd'
2
+import { Button,notification } from 'antd'
3 3
 import Form from './Form'
4 4
 import List from './List'
5 5
 import request from '@/utils/request';

+ 20
- 23
src/pages/building/type/index.jsx Parādīt failu

@@ -1,5 +1,5 @@
1
-import React from 'react';
2
-import { Button, Tag,  Modal } from 'antd';
1
+import React, { useRef } from 'react';
2
+import { Button, Tag, Modal, message } from 'antd';
3 3
 
4 4
 import router from 'umi/router';
5 5
 import moment from 'moment';
@@ -7,11 +7,11 @@ import withActions from '@/components/ActionList';
7 7
 import EditIcon from '@/components/EditIcon';
8 8
 import AuthButton from '@/components/AuthButton';
9 9
 import TableList from '@/components/TableList';
10
-// import request from '../../../utils/request';
11
-import apis from '../../../services/apis';
10
+import request from '@/utils/request';
11
+import apis from '@/services/apis';
12 12
 
13 13
 export default function BuildType() {
14
-
14
+  const ref = useRef();
15 15
 
16 16
   const columns = [
17 17
     {
@@ -55,7 +55,6 @@ export default function BuildType() {
55 55
     },
56 56
   ];
57 57
 
58
-
59 58
   function deleteType(row) {
60 59
     row.status = -1;
61 60
     const modal = Modal.confirm();
@@ -64,20 +63,18 @@ export default function BuildType() {
64 63
       okText: '确认',
65 64
       cancelText: '关闭',
66 65
       onOk: () => {
67
-        // request({
68
-        //   ...apis.buildingType.update,
69
-        //   urlData: { id: row.buildingTypeId },
70
-        //   data: { ...row },
71
-        // })
72
-        //   .then(() => {
73
-     
74
-        //   })
75
-        //   .then(() => {
76
-        //     openNotificationWithIcon('success', '操作成功');
77
-        //   })
78
-        //   .catch(err => {
79
-        //     // openNotificationWithIcon('error', err.message)
80
-        //   });
66
+        request({
67
+          ...apis.buildingType.update,
68
+          urlData: { id: row.buildingTypeId },
69
+          data: { ...row },
70
+        })
71
+          .then(() => {
72
+            ref.current.reload();
73
+            message.info('删除成功!');
74
+          })
75
+          .catch(err => {
76
+            // openNotificationWithIcon('error', err.message)
77
+          });
81 78
 
82 79
         modal.destroy();
83 80
       },
@@ -99,7 +96,7 @@ export default function BuildType() {
99 96
   const actionRender = () => {
100 97
     return (
101 98
       <AuthButton name="admin.tdBuildingType.add" noRight={null}>
102
-        <Button type='primary' onClick={() => toEdi()} style={{ marginBottom: '20px' }}>
99
+        <Button type="primary" onClick={() => toEdi()} style={{ marginBottom: '20px' }}>
103 100
           新增类型
104 101
         </Button>
105 102
       </AuthButton>
@@ -109,8 +106,8 @@ export default function BuildType() {
109 106
   return (
110 107
     <>
111 108
       <TableList
112
-        // ref={ref}
113
-        rowKey="buildingType"
109
+        ref={ref}
110
+        rowKey="buildingTypeId"
114 111
         api={apis.buildingType.getList}
115 112
         // searchFields={searchFields}
116 113
         actionRender={actionRender}

+ 20
- 20
src/pages/carouselFigure/advertisingList.jsx Parādīt failu

@@ -55,13 +55,13 @@ const header = (props) => {
55 55
       key: 'cityName',
56 56
       align: 'center',
57 57
     },
58
-    {
59
-      title: '关联项目',
60
-      dataIndex: 'buildingName',
61
-      key: 'buildingName',
62
-      align: 'center',
63
-      render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
64
-    },
58
+    // {
59
+    //   title: '关联项目',
60
+    //   dataIndex: 'buildingName',
61
+    //   key: 'buildingName',
62
+    //   align: 'center',
63
+    //   render: (buildingName) => <span>{buildingName === null ? '无' : buildingName}</span>
64
+    // },
65 65
     {
66 66
       title: '关联内容类型',
67 67
       dataIndex: 'contentType',
@@ -70,13 +70,13 @@ const header = (props) => {
70 70
       render: (contentType) => <span>{contentType === 'project' ? '项目' : contentType === 'activity' ? '报名活动' : contentType === 'news' ? '资讯' : contentType === 'other' ? '其他' :
71 71
         contentType === 'help' ? '助力活动' : contentType === 'group' ? '拼团活动' : contentType === 'h5' ? 'H5活动' : contentType === 'salesBatch' ? '在线选房' : contentType === 'live' ? '直播活动' : '无'}</span>
72 72
     },
73
-    {
74
-      title: '发布位置',
75
-      dataIndex: 'showPosition',
76
-      key: 'showPosition',
77
-      align: 'center',
78
-      render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'building' ? '项目' : '' }</span>
79
-    },
73
+    // {
74
+    //   title: '发布位置',
75
+    //   dataIndex: 'showPosition',
76
+    //   key: 'showPosition',
77
+    //   align: 'center',
78
+    //   render: (showPosition) => <span>{ showPosition === 'index' ? '首页' : showPosition === 'building' ? '项目' : '' }</span>
79
+    // },
80 80
     {
81 81
       title: '发布时间',
82 82
       dataIndex: 'createDate',
@@ -233,24 +233,24 @@ const header = (props) => {
233 233
             <Select style={{ width: '180px' }} placeholder="类型">
234 234
               <Option value="project">项目</Option>
235 235
               <Option value="news">资讯</Option>
236
-              <Option value="activity">报名活动</Option>
237
-              <Option value="help">助力活动</Option>
236
+              <Option value="activity">活动</Option>
237
+              {/* <Option value="help">助力活动</Option>
238 238
               <Option value="group">拼团活动</Option>
239
-              <Option value="h5">H5活动</Option>
239
+              <Option value="h5">H5活动</Option> */}
240 240
               <Option value="live">直播活动</Option>
241
-              <Option value="salesBatch">在线选房</Option>
241
+              {/* <Option value="salesBatch">在线选房</Option> */}
242 242
               <Option value="nothing">无</Option>
243 243
             </Select>,
244 244
           )}
245 245
         </Form.Item>
246
-        <Form.Item>
246
+        {/* <Form.Item>
247 247
           {getFieldDecorator('showPosition')(
248 248
             <Select style={{ width: '180px' }} placeholder="发布位置">
249 249
               <Option value="index">首页</Option>
250 250
               <Option value="building">项目</Option>
251 251
             </Select>,
252 252
           )}
253
-        </Form.Item>
253
+        </Form.Item> */}
254 254
         <Form.Item>
255 255
           {getFieldDecorator('status')(
256 256
             <Select style={{ width: '180px' }} placeholder="状态">

+ 13
- 13
src/pages/carouselFigure/carouselFigureList.jsx Parādīt failu

@@ -103,15 +103,15 @@ const header = props => {
103 103
         </span>
104 104
       ),
105 105
     },
106
-    {
107
-      title: '发布位置',
108
-      dataIndex: 'showPosition',
109
-      key: 'showPosition',
110
-      align: 'center',
111
-      render: showPosition => (
112
-        <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
113
-      ),
114
-    },
106
+    // {
107
+    //   title: '发布位置',
108
+    //   dataIndex: 'showPosition',
109
+    //   key: 'showPosition',
110
+    //   align: 'center',
111
+    //   render: showPosition => (
112
+    //     <span>{showPosition === 'index' ? '首页' : showPosition === 'mall' ? '商城' : ''}</span>
113
+    //   ),
114
+    // },
115 115
     {
116 116
       title: '发布时间',
117 117
       dataIndex: 'createDate',
@@ -289,22 +289,22 @@ const header = props => {
289 289
               <Option value="activity">活动</Option>
290 290
               <Option value="project">项目</Option>
291 291
               <Option value="news">资讯</Option>
292
-              <Option value="help">助力</Option>
292
+              {/* <Option value="help">助力</Option>
293 293
               <Option value="group">拼团</Option>
294
-              <Option value="h5">H5</Option>
294
+              <Option value="h5">H5</Option> */}
295 295
               <Option value="nothing">无</Option>
296 296
               {/* <Option value="other">其他</Option> */}
297 297
             </Select>,
298 298
           )}
299 299
         </Form.Item>
300
-        <Form.Item>
300
+        {/* <Form.Item>
301 301
           {getFieldDecorator('showPosition')(
302 302
             <Select style={{ width: '180px' }} placeholder="发布位置">
303 303
               <Option value="mall">积分商城</Option>
304 304
               <Option value="index">首页</Option>
305 305
             </Select>,
306 306
           )}
307
-        </Form.Item>
307
+        </Form.Item> */}
308 308
         <Form.Item>
309 309
           {getFieldDecorator('status')(
310 310
             <Select style={{ width: '180px' }} placeholder="状态">

+ 96
- 93
src/pages/carouselFigure/editAdvertising.jsx Parādīt failu

@@ -152,54 +152,54 @@ const createEditor = () => {
152 152
     };
153 153
 
154 154
     const fields = [
155
-      {
156
-        label: '是否关联项目',
157
-        name: 'isHaveActive',
158
-        type: FieldTypes.Switch,
159
-        value: isHaveActive,
160
-        hidden: () => !isCanChoose,
161
-        props: {
162
-          onChange: () => {
163
-            const type = formRef.current.props.form.getFieldValue('contentType');
164
-            if (formRef.current && type !== 'live' && type !== 'h5') {
165
-              console.log(formRef.current.props.form.getFieldValue('contentType'), '2222');
166
-              formRef.current.props.form.resetFields(['contentType', []]);
167
-            }
168
-          },
169
-        },
170
-        rules: [{ required: true, message: '是否城市活动' }],
171
-      },
172
-      {
173
-        label: '发布位置',
174
-        name: 'showPosition',
175
-        type: FieldTypes.Select,
176
-        value: isHaveActive,
177
-        dict: [
178
-          {
179
-            label: '首页',
180
-            value: 'index',
181
-          },
182
-          {
183
-            label: '项目',
184
-            value: 'building',
185
-          },
186
-        ],
187
-        value: data.showPosition,
188
-        rules: [{ required: true, message: '请选择发布位置' }],
189
-      },
190
-      {
191
-        label: '所属项目',
192
-        name: 'buildingId',
193
-        render: <BuildSelect />,
194
-        value: data.buildingId,
195
-        hidden: () => !isHaveActive && isHavePosition,
196
-        rules: [{ required: true, message: '请选择所属项目' }],
197
-      },
155
+      // {
156
+      //   label: '是否关联项目',
157
+      //   name: 'isHaveActive',
158
+      //   type: FieldTypes.Switch,
159
+      //   value: isHaveActive,
160
+      //   hidden: () => !isCanChoose,
161
+      //   props: {
162
+      //     onChange: () => {
163
+      //       const type = formRef.current.props.form.getFieldValue('contentType');
164
+      //       if (formRef.current && type !== 'live' && type !== 'h5') {
165
+         
166
+      //         formRef.current.props.form.resetFields(['contentType', []]);
167
+      //       }
168
+      //     },
169
+      //   },
170
+      //   rules: [{ required: true, message: '是否城市活动' }],
171
+      // },
172
+      // {
173
+      //   label: '发布位置',
174
+      //   name: 'showPosition',
175
+      //   type: FieldTypes.Select,
176
+      //   value: isHaveActive,
177
+      //   dict: [
178
+      //     {
179
+      //       label: '首页',
180
+      //       value: 'index',
181
+      //     },
182
+      //     {
183
+      //       label: '项目',
184
+      //       value: 'building',
185
+      //     },
186
+      //   ],
187
+      //   value: data.showPosition,
188
+      //   rules: [{ required: true, message: '请选择发布位置' }],
189
+      // },
190
+      // {
191
+      //   label: '所属项目',
192
+      //   name: 'buildingId',
193
+      //   render: <BuildSelect />,
194
+      //   value: data.buildingId,
195
+      //   hidden: () => !isHaveActive && isHavePosition,
196
+      //   rules: [{ required: true, message: '请选择所属项目' }],
197
+      // },
198 198
       {
199 199
         label: '展示城市',
200 200
         name: 'cityId',
201 201
         render: <CitySelect />,
202
-        hidden: () => !isHavePosition || isHaveActive,
202
+        // hidden: () => !isHavePosition || isHaveActive,
203 203
         value: data.cityId,
204 204
         rules: [{ required: true, message: '请选择展示城市' }],
205 205
       },
@@ -211,28 +211,28 @@ const createEditor = () => {
211 211
         help: '建议图片尺寸:640*960px,比例2:3,格式:jpg,用于开屏广告',
212 212
         rules: [{ required: true, message: '请上传图片' }],
213 213
       },
214
-      {
215
-        label: '类型',
216
-        name: 'contentType',
217
-        type: FieldTypes.Select,
218
-        hidden: () => isHaveActive,
219
-        dict: [
220
-          {
221
-            label: 'H5活动详情',
222
-            value: 'h5',
223
-          },
224
-          {
225
-            label: '直播活动详情',
226
-            value: 'live',
227
-          },
228
-          {
229
-            label: '其它',
230
-            value: 'others',
231
-          },
232
-        ],
233
-        value: data.contentType,
234
-        rules: [{ required: true, message: '请选择类型' }],
235
-      },
214
+      // {
215
+      //   label: '类型',
216
+      //   name: 'contentType',
217
+      //   type: FieldTypes.Select,
218
+      //   hidden: () => isHaveActive,
219
+      //   dict: [
220
+      //     // {
221
+      //     //   label: 'H5活动详情',
222
+      //     //   value: 'h5',
223
+      //     // },
224
+      //     {
225
+      //       label: '直播活动详情',
226
+      //       value: 'live',
227
+      //     },
228
+      //     {
229
+      //       label: '其它',
230
+      //       value: 'others',
231
+      //     },
232
+      //   ],
233
+      //   value: data.contentType,
234
+      //   rules: [{ required: true, message: '请选择类型' }],
235
+      // },
236 236
       {
237 237
         label: '标题',
238 238
         name: 'title',
@@ -244,7 +244,7 @@ const createEditor = () => {
244 244
       {
245 245
         label: '类型',
246 246
         name: 'contentType',
247
-        hidden: () => !isHaveActive,
247
+        // hidden: () => !isHaveActive,
248 248
         type: FieldTypes.Select,
249 249
         dict: [
250 250
           {
@@ -259,29 +259,29 @@ const createEditor = () => {
259 259
             label: '资讯详情',
260 260
             value: 'news',
261 261
           },
262
-          {
263
-            label: '拼团活动详情',
264
-            value: 'group',
265
-          },
266
-          {
267
-            label: '助力活动详情',
268
-            value: 'help',
269
-          },
270
-          {
271
-            label: 'H5活动详情',
272
-            value: 'h5',
273
-          },
274
-          {
275
-            label: '在线选房详情',
276
-            value: 'salesBatch',
277
-          },
262
+          // {
263
+          //   label: '拼团活动详情',
264
+          //   value: 'group',
265
+          // },
266
+          // {
267
+          //   label: '助力活动详情',
268
+          //   value: 'help',
269
+          // },
270
+          // {
271
+          //   label: 'H5活动详情',
272
+          //   value: 'h5',
273
+          // },
274
+          // {
275
+          //   label: '在线选房详情',
276
+          //   value: 'salesBatch',
277
+          // },
278 278
           {
279 279
             label: '直播活动详情',
280 280
             value: 'live',
281 281
           },
282 282
           {
283
-            label: '其它',
284
-            value: 'others',
283
+            label: '',
284
+            value: 'nothing',
285 285
           },
286 286
         ],
287 287
         value: data.contentType,
@@ -371,14 +371,15 @@ const createEditor = () => {
371 371
 
372 372
     const handleSubmit = val => {
373 373
       val.showType = 'screen';
374
-      if (!isHaveActive && val.targetId) {
375
-        if (!val.contentType) {
376
-          val.contentType = 'h5';
377
-        }
378
-      }
379
-      if (!isHaveActive && !val.targetId) {
380
-        val.contentType = '';
381
-      }
374
+      // if (!isHaveActive && val.targetId) {
375
+      //   if (!val.contentType) {
376
+      //     val.contentType = 'h5';
377
+      //   }
378
+      // }
379
+      // if (!isHaveActive && !val.targetId) {
380
+      //   val.contentType = '';
381
+      // }
382
+      val.showPosition='index'
382 383
       if (contentId) {
383 384
         request({
384 385
           ...apis.carsuseFigure.updataExtendContent,
@@ -386,6 +387,7 @@ const createEditor = () => {
386 387
           data: val,
387 388
         })
388 389
           .then(data => {
390
+            message.info('操作成功');
389 391
             cancelPage();
390 392
           })
391 393
           .catch(err => {
@@ -394,6 +396,7 @@ const createEditor = () => {
394 396
       } else {
395 397
         request({ ...apis.carsuseFigure.addExtendContent, data: val })
396 398
           .then(data => {
399
+            message.info('操作成功');
397 400
             cancelPage();
398 401
           })
399 402
           .catch(err => {

+ 44
- 40
src/pages/carouselFigure/editCarousel.jsx Parādīt failu

@@ -147,23 +147,23 @@ const Edit = props => {
147 147
         value: data.cityId,
148 148
         rules: [{ required: true, message: '请选择展示城市' }],
149 149
       },
150
-      {
151
-        label: '发布位置',
152
-        name: 'showPosition',
153
-        type: FieldTypes.Select,
154
-        dict: [
155
-          {
156
-            label: '首页',
157
-            value: 'index',
158
-          },
159
-          {
160
-            label: '积分商城',
161
-            value: 'mall',
162
-          },
163
-        ],
164
-        value: data.showPosition,
165
-        rules: [{ required: true, message: '请选择发布位置' }],
166
-      },
150
+      // {
151
+      //   label: '发布位置',
152
+      //   name: 'showPosition',
153
+      //   type: FieldTypes.Select,
154
+      //   dict: [
155
+      //     {
156
+      //       label: '首页',
157
+      //       value: 'index',
158
+      //     },
159
+      //     {
160
+      //       label: '积分商城',
161
+      //       value: 'mall',
162
+      //     },
163
+      //   ],
164
+      //   value: data.showPosition,
165
+      //   rules: [{ required: true, message: '请选择发布位置' }],
166
+      // },
167 167
       {
168 168
         label: () => (locationType ? '积分商城轮播图' : '首页轮播图'),
169 169
         name: 'image',
@@ -181,12 +181,12 @@ const Edit = props => {
181 181
         type: FieldTypes.Select,
182 182
         hidden: () => isHaveActive,
183 183
         dict: [
184
+          // {
185
+          //   label: 'h5',
186
+          //   value: 'h5',
187
+          // },
184 188
           {
185
-            label: 'h5',
186
-            value: 'h5',
187
-          },
188
-          {
189
-            label: '直播活动详情',
189
+            label: '直播活动',
190 190
             value: 'live',
191 191
           },
192 192
           {
@@ -212,7 +212,7 @@ const Edit = props => {
212 212
         hidden: () => !isHaveActive,
213 213
         dict: [
214 214
           {
215
-            label: '常规活动',
215
+            label: '活动',
216 216
             value: 'activity',
217 217
           },
218 218
           {
@@ -227,24 +227,24 @@ const Edit = props => {
227 227
           //   label: '其他',
228 228
           //   value: 'other',
229 229
           // },
230
+          // {
231
+          //   label: '拼团',
232
+          //   value: 'group',
233
+          // },
234
+          // {
235
+          //   label: '助力',
236
+          //   value: 'help',
237
+          // },
238
+          // {
239
+          //   label: 'h5',
240
+          //   value: 'h5',
241
+          // },
242
+          // {
243
+          //   label: '销售批次详情',
244
+          //   value: 'salesBatch',
245
+          // },
230 246
           {
231
-            label: '拼团',
232
-            value: 'group',
233
-          },
234
-          {
235
-            label: '助力',
236
-            value: 'help',
237
-          },
238
-          {
239
-            label: 'h5',
240
-            value: 'h5',
241
-          },
242
-          {
243
-            label: '销售批次详情',
244
-            value: 'salesBatch',
245
-          },
246
-          {
247
-            label: '直播活动详情',
247
+            label: '直播活动',
248 248
             value: 'live',
249 249
           },
250 250
         ],
@@ -351,6 +351,8 @@ const Edit = props => {
351 351
       if (!isHaveActive && !val.targetId) {
352 352
         val.contentType = '';
353 353
       }
354
+      // 发布在首页
355
+      val.showPosition ='index'
354 356
       if (contentId) {
355 357
         request({
356 358
           ...apis.carsuseFigure.updataExtendContent,
@@ -358,6 +360,7 @@ const Edit = props => {
358 360
           data: val,
359 361
         })
360 362
           .then(data => {
363
+            message.info('操作成功');
361 364
             cancelPage();
362 365
           })
363 366
           .catch(err => {
@@ -366,6 +369,7 @@ const Edit = props => {
366 369
       } else {
367 370
         request({ ...apis.carsuseFigure.addExtendContent, data: val })
368 371
           .then(data => {
372
+            message.info('操作成功');
369 373
             cancelPage();
370 374
           })
371 375
           .catch(err => {

+ 132
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/IntentionalCustomers.jsx Parādīt failu

@@ -0,0 +1,132 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import BuildSelect from '@/components/SelectButton/BuildSelect'
4
+import { func } from 'prop-types';
5
+import request from '@/utils/request';
6
+import apis from '@/services/apis';
7
+// const { Option } = Select;
8
+
9
+const UserBehavior = (props) => {
10
+  const [data, setData] = useState({ records: [] })
11
+  const [buildingId, setBuildingId] = useState('')
12
+  useEffect(() => {
13
+    IntentionUsers({ pageNum: 1, pageSize: 5 })
14
+    // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
15
+
16
+  }, [])
17
+  function IntentionUsers (params) {
18
+    request({
19
+      ...apis.indexEcharts.intentionUsers,
20
+      params: { ...params }
21
+    }).then((data) => {
22
+      console.log(data,"datadata")
23
+      setData(data)
24
+    })
25
+  }
26
+
27
+  // 分页
28
+  function onChange(pageNum) {
29
+    // eslint-disable-next-line react-hooks/rules-of-hooks
30
+    IntentionUsers({ pageNum: pageNum, pageSize: 5, buildingId })
31
+  }
32
+
33
+  // getIntentionUsers({ commit }, payload) {
34
+  //   return new Promise((resolve, reject) => {
35
+  //     request({
36
+  //       ...apis.indexEcharts.intentionUsers,
37
+  //       params: { pageSize: 9999, ...payload }
38
+  //     }).then((data) => {
39
+  //       resolve(data.records)
40
+  //     }).catch((err) => {
41
+  //       reject(err)
42
+  //     })
43
+  //   })
44
+  // },
45
+  // const dataSource = [
46
+  //   {
47
+  //     key: '1',
48
+  //     name: '胡彦斌',
49
+  //     age: 32,
50
+  //     address: '西湖区湖底公园1号',
51
+  //   },
52
+  //   {
53
+  //     key: '2',
54
+  //     name: '胡彦祖',
55
+  //     age: 42,
56
+  //     address: '西湖区湖底公园1号',
57
+  //   },
58
+  // ];
59
+  
60
+  const columns = [
61
+    {
62
+      title: '用户姓名',
63
+      dataIndex: 'personName',
64
+      key: 'personName',
65
+      width: '25%',
66
+    },
67
+    {
68
+      title: '手机号',
69
+      dataIndex: 'phone',
70
+      key: 'phone',
71
+      width: '25%',
72
+    },
73
+    {
74
+      title: '意向楼盘',
75
+      dataIndex: 'buildingName',
76
+      key: 'buildingName',
77
+      width: '25%',
78
+    },
79
+    {
80
+      title: '意向值',
81
+      dataIndex: 'intention',
82
+      key: 'intention',
83
+      width: '25%',
84
+    },
85
+  ];
86
+
87
+  function handleBuildingChange (e) {
88
+    IntentionUsers({  pageNum: 1, pageSize: 5, buildingId: e })
89
+    setBuildingId(e)
90
+  }
91
+
92
+  //意向客户导出
93
+  function exportIntentionUsers () {
94
+    request({
95
+      ...apis.indexEcharts.exportIntentionUsers,
96
+      params: { buildingId }
97
+    }).then((data) => {
98
+      if (!data) {
99
+        return
100
+      }
101
+      const url = window.URL.createObjectURL(new Blob([data]))
102
+      const link = document.createElement('a')
103
+      link.style.display = 'none'
104
+      link.href = url
105
+      link.setAttribute('download', '意向客户.xlsx')
106
+      document.body.append(link)
107
+      link.click()
108
+    })
109
+  }
110
+
111
+  return (
112
+    <>
113
+      <div>
114
+      <p style={{fontSize:'0.12rem',fontWeight:'600'}}>意向客户</p>
115
+        <Row>
116
+          <Col span={22}>
117
+            <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>
118
+          </Col>
119
+          <Col span={2}>
120
+            <Button type="primary" onClick={exportIntentionUsers}>导出</Button>
121
+          </Col>
122
+        </Row>
123
+
124
+        <Table rowKey="IntentionalCustomers" dataSource={data.records} columns={columns} style={{marginTop:'15px'}} pagination={{ total: data.total, defaultPageSize: 5, onChange: e => onChange(e) }} scroll={{ y: 500 }} />
125
+
126
+      </div>
127
+
128
+    </>
129
+  )
130
+}
131
+
132
+export default UserBehavior;

+ 103
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/NewUsers.jsx Parādīt failu

@@ -0,0 +1,103 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+// import styles from '../styles.less'
11
+const formatDate = (start, end) => {
12
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
13
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
14
+  return { startDate, endDate }
15
+}
16
+const NewUsers = (props) => {
17
+  const [data, setData] = useState({ records: [] })
18
+
19
+
20
+  useEffect(() => {
21
+    NewsUserCount(formatDate(props.startDate, props.endDate))
22
+  }, [props.startDate, props.endDate])
23
+
24
+
25
+  function NewsUserCount (params) {
26
+    request({
27
+      ...apis.indexEcharts.changeNewUser,
28
+      params,
29
+    }).then((data) => {
30
+      setData(data)
31
+    })
32
+  }
33
+
34
+  const dataZoom=props.dataZoom?[
35
+    {
36
+      type: 'inside',
37
+      start: 0,
38
+      end: 100
39
+    },
40
+    {
41
+      type: 'slider',
42
+      start: 0,
43
+      end: 100
44
+    },
45
+  ] : undefined 
46
+  const dataset = data || []
47
+  const options = {
48
+
49
+   
50
+      color: ["#FF814C", "#F02B3E"],
51
+      tooltip: {
52
+        trigger: "axis"
53
+      },
54
+      icon: "rect",
55
+      legend: {
56
+        data: ["新用户数", "授权注册"]
57
+      },
58
+      toolbox: {},
59
+      xAxis: {
60
+        type: "category",
61
+      },
62
+      yAxis: {},
63
+      dataZoom,
64
+      series: [
65
+        {
66
+          name: "新用户数",
67
+          type: "line",
68
+          smooth:true, 
69
+        },
70
+        {
71
+          name: "授权注册",
72
+          type: "line",
73
+          smooth:true, 
74
+        }
75
+      ],
76
+      dataset: {
77
+        dimensions: ['createTime', 'fromNum', 'registeredNum'],
78
+        source: dataset
79
+      }
80
+ 
81
+    
82
+    
83
+  }
84
+
85
+
86
+  const piestyles = {
87
+    width: '100%',
88
+    height: '400px',
89
+  }
90
+
91
+  return (
92
+    <>
93
+      <div>
94
+        <div >
95
+          <p onClick={()=>router.push('/statistical/newUsers')}><span style={{borderBottom:'1px solid #f02d40',cursor: 'pointer',fontSize:'0.12rem',fontWeight:'600'}}>新增用户</span> {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}</p>
96
+       </div>
97
+        <EChart options={options} style={piestyles}  />
98
+      </div>
99
+    </>
100
+  )
101
+}
102
+
103
+export default NewUsers;

+ 109
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserActive.jsx Parādīt failu

@@ -0,0 +1,109 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+// import UserSource from './mmm';
10
+
11
+import styles from '../styles.less'
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+const UserSource = (props) => {
18
+  const [data, setData] = useState({ records: [] })
19
+  //柱图
20
+
21
+  useEffect(() => {
22
+    UserActive({ dateType: 'day' })
23
+  }, [])
24
+
25
+
26
+
27
+  function UserActive (params) {
28
+    request({
29
+      ...apis.indexEcharts.userActive,
30
+      params: { pageSize: 9999, ...params },
31
+    }).then((data) => {
32
+  
33
+      setData(data)
34
+    })
35
+  }
36
+
37
+  const dataset = (data.selectActiveUserCount) || []
38
+  const options = {
39
+
40
+    tooltip: {},
41
+    xAxis: { type: 'category' },
42
+    yAxis: {},
43
+    series: {
44
+      type: 'bar',
45
+      name: '活跃用户',
46
+      barWidth: 50,
47
+      data: dataset.map(x => ([x.date, !x.activityCount ? 0 : x.activityCount])),
48
+      itemStyle: {
49
+        normal: {
50
+          barBorderRadius: [50, 50, 0, 0],
51
+          color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
52
+            offset: 0,
53
+            color: '#FD8A95'
54
+          }, {
55
+            offset: 1,
56
+            color: '#F13043'
57
+          }]),
58
+          shadowColor: 'rgba(0, 0, 0, 0.4)',
59
+
60
+        }
61
+      }
62
+    }
63
+
64
+  }
65
+
66
+
67
+  function onChange (value) {
68
+    UserActive({ dateType: value })
69
+  }
70
+
71
+
72
+  const piestyles = {
73
+    width: '100%',
74
+    height: '400px',
75
+
76
+  }
77
+
78
+
79
+  return (
80
+    <>
81
+      <div>
82
+
83
+
84
+        <div >
85
+        <p><span style={{fontSize:'0.12rem',fontWeight:'600'}}>用户活跃数</span></p>
86
+
87
+          <Select
88
+            showSearch
89
+            style={{ width: 100 }}
90
+            placeholder="日活跃"
91
+            optionFilterProp="children"
92
+            onChange={onChange}
93
+          >
94
+            <Option value="day">日活跃</Option>
95
+            <Option value="month">月活跃</Option>
96
+
97
+          </Select>
98
+        
99
+       </div>
100
+
101
+
102
+        <EChart options={options} style={piestyles} />
103
+      </div>
104
+
105
+    </>
106
+  )
107
+}
108
+
109
+export default UserSource;

+ 289
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserBehavior.jsx Parādīt failu

@@ -0,0 +1,289 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import EChart from '../../../components/EchartsTest/EChart';
3
+import request from '../../../utils/request';
4
+import apis from '../../../services/apis';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import 'echarts/lib/component/dataZoom'
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message, Modal } from 'antd';
9
+import BuildSelect from '../../../components/SelectButton/BuildSelect'
10
+
11
+const { Option } = Select;
12
+
13
+
14
+const eventcolumns = [
15
+  {
16
+    title: '编号',
17
+    dataIndex: 'recordId',
18
+    key: 'recordId',
19
+    align: 'center',
20
+    width: '16%',
21
+  },
22
+  {
23
+    title: '访问时间',
24
+    dataIndex: 'visitTime',
25
+    key: 'visitTime',
26
+    align: 'center',
27
+    width: '18%',
28
+    render: (x, row) => (
29
+      <>
30
+        <span>{ moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>
31
+      </>
32
+    ),
33
+  },
34
+  {
35
+    title: '离开时间',
36
+    dataIndex: 'leaveTime',
37
+    key: 'leaveTime',
38
+    align: 'center',
39
+    width: '18%',
40
+    render: (x, row) => (
41
+      <>
42
+        <span>{ row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss') }</span>
43
+      </>
44
+    ),
45
+  },
46
+]
47
+
48
+
49
+class EventcoModal extends React.Component {
50
+  constructor(props) {
51
+    super(props)
52
+    this.state = {
53
+      eventList: [],
54
+      visibleData: { visible: false, row: {} },
55
+    }
56
+  }
57
+
58
+  componentDidUpdate(prevProps) {
59
+    if (this.props.visibleData.visible !== prevProps.visibleData.visible) {
60
+      // eslint-disable-next-line react/no-did-update-set-state
61
+      this.setState({ visibleData: this.props.visibleData }, () => {
62
+        this.showDetails(this.props.visibleData.row)
63
+      })
64
+    }
65
+  }
66
+
67
+  showDetails = row => {
68
+    request({
69
+      ...apis.indexEcharts.userBehavior.profile,
70
+      params: { event: row.event, personId: row.personId },
71
+    }).then(data => {
72
+        this.setState({ eventList: data })
73
+    })
74
+  }
75
+
76
+  handleOk = e => {
77
+    this.props.onSuccess()
78
+  };
79
+
80
+  handleCancel = e => {
81
+    this.props.onSuccess()
82
+  };
83
+
84
+  render() {
85
+    return (
86
+      <>
87
+        <Modal
88
+          title="访问详情"
89
+          visible={this.state.visibleData.visible}
90
+          onOk={() => this.handleOk()}
91
+          onCancel={() => this.handleCancel()}
92
+          footer={null}
93
+        >
94
+         <Table rowKey="UserBehavior" dataSource={this.state.eventList} columns={eventcolumns} pagination={false} rowKey="eventall" scroll={{ y: 400 }} />
95
+        </Modal>
96
+      </>
97
+    )
98
+  }
99
+}
100
+
101
+
102
+const formatDate = (start, end) => {
103
+  const startDate = `${moment(start).format('YYYY-MM-DDT00:00:00.000')}Z`
104
+  const endDate = `${moment(end).format('YYYY-MM-DDT23:59:59.999')}Z`
105
+  return { startDate, endDate }
106
+}
107
+const UserBehavior = props => {
108
+  const [data, setData] = useState({ records: [] })
109
+  const [visibleData, setVisibleData] = useState({ visible: false, row: {} })
110
+  const [buildingId, setBuildingId] = useState('')
111
+
112
+  // 柱图
113
+  useEffect(() => {
114
+    const date = formatDate(props.startDate, props.endDate)
115
+    getUserBehaviorSummary({
116
+      ...date,
117
+      activity: props.activity,
118
+      event: props.event,
119
+      eventType: props.eventType,
120
+      buildingId: props.buildingId,
121
+    })
122
+    // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
123
+  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType, props.buildingId])
124
+
125
+  const [recordList, setList] = useState([])
126
+  function getUserBehaviorSummary(params) {
127
+    request({
128
+      ...apis.indexEcharts.userBehavior.summary,
129
+      params,
130
+    }).then(data => {
131
+      setData(data || {})
132
+      setList((data.data.records || []).filter(e => e.activity !== '客户'))
133
+    })
134
+  }
135
+
136
+
137
+  const seriesMaker = (data.selectUserBehavior || []).filter(e => e.activity !== '客户' && e.activity !== '首页').reduce((series, item) => {
138
+    let { date, activityCount, activity } = item
139
+    date = moment(date).format('YYYY-MM-DD')
140
+    if (!activityCount) activityCount = 0
141
+
142
+    // 使用对象, 可以去重
143
+    series[`${activity}`] = (series[`${activity}`] || []).concat([[date, activityCount]])
144
+
145
+    return series;
146
+  }, {})
147
+
148
+
149
+  const dataZoom = props.dataZoom ? [
150
+    {
151
+      type: 'inside',
152
+      start: 0,
153
+      end: 100,
154
+    },
155
+    {
156
+      type: 'slider',
157
+      start: 0,
158
+      end: 100,
159
+    },
160
+  ] : undefined
161
+
162
+
163
+  const options = {
164
+    title: {},
165
+    icon: 'rect',
166
+    legend: {
167
+      show: true,
168
+      zlevel: 10,
169
+      itemGap: 100,
170
+    },
171
+    color: ['#F12B3E', '#FE929C', '#647CE1', '#A2B9FF', '#FF844F', '#FFBB9D'],
172
+    tooltip: {
173
+      trigger: 'axis',
174
+    },
175
+    xAxis: { type: 'category' },
176
+    yAxis: {},
177
+    dataZoom,
178
+    series: Object.keys(seriesMaker).map(x => ({
179
+        type: 'line',
180
+        smooth: true,
181
+        name: x,
182
+        data: seriesMaker[x],
183
+      })),
184
+  }
185
+  function handleBuildingChange(e) {
186
+    const date = formatDate(props.startDate, props.endDate)
187
+    getUserBehaviorSummary({
188
+      ...date,
189
+      activity: props.activity,
190
+      event: props.event,
191
+      eventType: props.eventType,
192
+      buildingId: e,
193
+    })
194
+    setBuildingId(e)
195
+  }
196
+
197
+  function showDetails(row) {
198
+    setVisibleData({ visible: true, row })
199
+  }
200
+
201
+  function onSuccess() {
202
+    setVisibleData({ visible: false, row: {} })
203
+  }
204
+
205
+
206
+  const style = {
207
+    width: '100%',
208
+    height: '400px',
209
+
210
+  }
211
+
212
+  const columns = [
213
+    {
214
+      title: '访问事件',
215
+      dataIndex: 'eventName',
216
+      key: 'eventName',
217
+      align: 'center',
218
+      width: '16%',
219
+
220
+    },
221
+    {
222
+      title: '访问用户',
223
+      dataIndex: 'userName',
224
+      key: 'userName',
225
+      align: 'center',
226
+      width: '15%',
227
+
228
+    },
229
+    {
230
+      title: '访问次数',
231
+      dataIndex: 'accessCount',
232
+      key: 'accessCount',
233
+      align: 'center',
234
+      width: '17%',
235
+
236
+      render: (x, row) => (
237
+        <>
238
+          <span style={{ color: '#EF273A', cursor: 'pointer' }} onClick={() => showDetails(row)}> {row.accessCount}</span>
239
+        </>
240
+      ),
241
+    },
242
+    {
243
+      title: '首次访问时间',
244
+      dataIndex: 'visitTime',
245
+      key: 'visitTime',
246
+      align: 'center',
247
+      width: '18%',
248
+      render: (x, row) => (
249
+        <>
250
+          <span>{ row.visitTime && moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss') }</span>
251
+        </>
252
+      ),
253
+    },
254
+    {
255
+      title: '离开时间',
256
+      dataIndex: 'leaveTime',
257
+      key: 'leaveTime',
258
+      width: '18%',
259
+      align: 'center',
260
+      render: (x, row) => (
261
+        <>
262
+          <span>{ row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss') }</span>
263
+        </>
264
+      ),
265
+    },
266
+  ]
267
+
268
+
269
+  return (
270
+    <>
271
+      <div>
272
+        <p onClick={() => router.push('/statistical/userBehavior')} style={{cursor: 'pointer'}}>
273
+          <span style={{ borderBottom: '1px solid #f02d40', color: '#333', fontSize: '0.12rem', fontWeight: '600' }}>用户行为</span>
274
+          {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
275
+        </p>
276
+        <div style={{ float: 'right', marginTop: '-40px', marginBottom: '20px' }}>
277
+          {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>}
278
+        </div>
279
+        <EChart options={options} style={style} />
280
+        {props.tableShow &&
281
+          <Table rowKey="UserBehaviorTwo" dataSource={recordList} columns={columns} pagination={false} rowKey="userbehavior" scroll={{ y: 500 }} />
282
+        }
283
+      </div>
284
+      <EventcoModal visibleData={visibleData} onSuccess={() => onSuccess()} />
285
+    </>
286
+  )
287
+}
288
+
289
+export default UserBehavior

+ 291
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserBehaviorIndex.jsx Parādīt failu

@@ -0,0 +1,291 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import EChart from '@/components/EchartsTest/EChart';
3
+import request from '@/utils/request';
4
+import apis from '@/services/apis';
5
+import moment from 'moment';
6
+import router from 'umi/router';
7
+import 'echarts/lib/component/dataZoom'
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message, Modal } from 'antd';
9
+import BuildSelect from '@/components/SelectButton/BuildSelect'
10
+
11
+const { Option } = Select;
12
+
13
+
14
+const eventcolumns = [
15
+  {
16
+    title: '编号',
17
+    dataIndex: 'recordId',
18
+    key: 'recordId',
19
+    align: 'center',
20
+    width: '16%',
21
+  },
22
+  {
23
+    title: '访问时间',
24
+    dataIndex: 'visitTime',
25
+    key: 'visitTime',
26
+    align: 'center',
27
+    width: '18%',
28
+    render: (x, row) => (
29
+      <>
30
+        <span>{moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss')}</span>
31
+      </>
32
+    ),
33
+  },
34
+  {
35
+    title: '离开时间',
36
+    dataIndex: 'leaveTime',
37
+    key: 'leaveTime',
38
+    align: 'center',
39
+    width: '18%',
40
+    render: (x, row) => (
41
+      <>
42
+        <span>{row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss')}</span>
43
+      </>
44
+    ),
45
+  },
46
+]
47
+
48
+
49
+class EventcoModal extends React.Component {
50
+  constructor(props) {
51
+    super(props)
52
+    this.state = {
53
+      eventList: [],
54
+      visibleData: { visible: false, row: {} },
55
+    }
56
+  }
57
+
58
+  componentDidUpdate(prevProps) {
59
+    if (this.props.visibleData.visible !== prevProps.visibleData.visible) {
60
+      // eslint-disable-next-line react/no-did-update-set-state
61
+      this.setState({ visibleData: this.props.visibleData }, () => {
62
+        this.showDetails(this.props.visibleData.row)
63
+      })
64
+    }
65
+  }
66
+
67
+  showDetails = row => {
68
+    request({
69
+      ...apis.indexEcharts.userBehavior.profile,
70
+      params: { event: row.event, personId: row.personId },
71
+    }).then(data => {
72
+      this.setState({ eventList: data })
73
+    })
74
+  }
75
+
76
+  handleOk = e => {
77
+    this.props.onSuccess()
78
+  };
79
+
80
+  handleCancel = e => {
81
+    this.props.onSuccess()
82
+  };
83
+
84
+  render() {
85
+    return (
86
+      <>
87
+        <Modal
88
+          title="访问详情"
89
+          visible={this.state.visibleData.visible}
90
+          onOk={() => this.handleOk()}
91
+          onCancel={() => this.handleCancel()}
92
+          footer={null}
93
+        >
94
+          <Table rowKey="UserBehavior" dataSource={this.state.eventList} columns={eventcolumns} pagination={false} rowKey="eventall" scroll={{ y: 400 }} />
95
+        </Modal>
96
+      </>
97
+    )
98
+  }
99
+}
100
+
101
+
102
+const formatDate = (start, end) => {
103
+  const startDate = `${moment(start).format('YYYY-MM-DDT00:00:00.000')}Z`
104
+  const endDate = `${moment(end).format('YYYY-MM-DDT23:59:59.999')}Z`
105
+  return { startDate, endDate }
106
+}
107
+const UserBehaviorIndex = props => {
108
+  const [data, setData] = useState({ records: [] })
109
+  const [visibleData, setVisibleData] = useState({ visible: false, row: {} })
110
+  const [buildingId, setBuildingId] = useState('')
111
+
112
+  // 柱图
113
+  useEffect(() => {
114
+    const date = formatDate(props.startDate, props.endDate)
115
+    getUserBehaviorSummary({
116
+      ...date,
117
+      activity: props.activity,
118
+      event: props.event,
119
+      eventType: props.eventType,
120
+      buildingId: props.buildingId,
121
+    })
122
+    // getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
123
+  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType, props.buildingId])
124
+
125
+  const [recordList, setList] = useState([])
126
+  function getUserBehaviorSummary(params) {
127
+    request({
128
+      ...apis.indexEcharts.userBehavior.tsUserBehavior,
129
+      params,
130
+    }).then(data => {
131
+      setData(data || {})
132
+      // setList((data.data.records || []).filter(e => e.activity !== '客户'))
133
+    })
134
+  }
135
+
136
+
137
+  const seriesMaker = (data.selectUserBehavior || []).filter(e => e.activity !== '客户' && e.activity !== '首页').reduce((series, item) => {
138
+    let { date, activityCount, activity } = item
139
+    date = moment(date).format('YYYY-MM-DD')
140
+    if (!activityCount) activityCount = 0
141
+
142
+    // 使用对象, 可以去重
143
+    series[`${activity}`] = (series[`${activity}`] || []).concat([[date, activityCount]])
144
+
145
+    return series;
146
+  }, {})
147
+
148
+
149
+  const dataZoom = props.dataZoom ? [
150
+    {
151
+      type: 'inside',
152
+      start: 0,
153
+      end: 100,
154
+    },
155
+    {
156
+      type: 'slider',
157
+      start: 0,
158
+      end: 100,
159
+    },
160
+  ] : undefined
161
+
162
+
163
+  const options = {
164
+    title: {},
165
+    icon: 'rect',
166
+    legend: {
167
+      show: true,
168
+      zlevel: 10,
169
+      itemGap: 100,
170
+    },
171
+    color: ['#F12B3E', '#FE929C', '#647CE1', '#A2B9FF', '#FF844F', '#FFBB9D'],
172
+    tooltip: {
173
+      trigger: 'axis',
174
+    },
175
+    xAxis: { type: 'category' },
176
+    yAxis: {},
177
+    dataZoom,
178
+    series: Object.keys(seriesMaker).map(x => ({
179
+      type: 'line',
180
+      smooth: true,
181
+      name: x,
182
+      data: seriesMaker[x],
183
+    })),
184
+  }
185
+  function handleBuildingChange(e) {
186
+    const date = formatDate(props.startDate, props.endDate)
187
+    getUserBehaviorSummary({
188
+      ...date,
189
+      activity: props.activity,
190
+      event: props.event,
191
+      eventType: props.eventType,
192
+      buildingId: e,
193
+    })
194
+    setBuildingId(e)
195
+  }
196
+
197
+  function showDetails(row) {
198
+    setVisibleData({ visible: true, row })
199
+  }
200
+
201
+  function onSuccess() {
202
+    setVisibleData({ visible: false, row: {} })
203
+  }
204
+
205
+
206
+  const style = {
207
+    width: '100%',
208
+    height: '400px',
209
+
210
+  }
211
+
212
+  const columns = [
213
+    {
214
+      title: '访问事件',
215
+      dataIndex: 'eventName',
216
+      key: 'eventName',
217
+      align: 'center',
218
+      width: '16%',
219
+
220
+    },
221
+    {
222
+      title: '访问用户',
223
+      dataIndex: 'userName',
224
+      key: 'userName',
225
+      align: 'center',
226
+      width: '15%',
227
+
228
+    },
229
+    {
230
+      title: '访问次数',
231
+      dataIndex: 'accessCount',
232
+      key: 'accessCount',
233
+      align: 'center',
234
+      width: '17%',
235
+
236
+      render: (x, row) => (
237
+        <>
238
+          <span style={{ color: '#EF273A', cursor: 'pointer' }} onClick={() => showDetails(row)}> {row.accessCount}</span>
239
+        </>
240
+      ),
241
+    },
242
+    {
243
+      title: '首次访问时间',
244
+      dataIndex: 'visitTime',
245
+      key: 'visitTime',
246
+      align: 'center',
247
+      width: '18%',
248
+      render: (x, row) => (
249
+        <>
250
+          <span>{row.visitTime && moment(row.visitTime).format('YYYY-MM-DD hh:mm:ss')}</span>
251
+        </>
252
+      ),
253
+    },
254
+    {
255
+      title: '离开时间',
256
+      dataIndex: 'leaveTime',
257
+      key: 'leaveTime',
258
+      width: '18%',
259
+      align: 'center',
260
+      render: (x, row) => (
261
+        <>
262
+          <span>{row.leaveTime && moment(row.leaveTime).format('YYYY-MM-DD hh:mm:ss')}</span>
263
+        </>
264
+      ),
265
+    },
266
+  ]
267
+
268
+
269
+  return (
270
+    <>
271
+      <div>
272
+        {/* <p onClick={() => router.push('/statistical/userBehavior')} style={{cursor: 'pointer'}}> */}
273
+        <div style={{marginBottom:'40px'}}>
274
+          <span style={{ borderBottom: '1px solid #f02d40', color: '#333', fontSize: '0.12rem', fontWeight: '600' }}>用户行为</span>
275
+          {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}
276
+          {/* </p> */}
277
+          <div style={{ float: 'right' }}>
278
+            {!props.BuildSelectHide && <BuildSelect slot="action" onChange={(e => handleBuildingChange(e))} value={buildingId}></BuildSelect>}
279
+          </div>
280
+        </div>
281
+        <EChart options={options} style={style} />
282
+        {false &&
283
+          <Table rowKey="UserBehaviorTwo" dataSource={recordList} columns={columns} pagination={false} rowKey="userbehavior" scroll={{ y: 500 }} />
284
+        }
285
+      </div>
286
+      <EventcoModal visibleData={visibleData} onSuccess={() => onSuccess()} />
287
+    </>
288
+  )
289
+}
290
+
291
+export default UserBehaviorIndex

+ 139
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserConversion.jsx Parādīt failu

@@ -0,0 +1,139 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+// import styles from '../styles.less'
11
+
12
+
13
+const UserSource = props => {
14
+
15
+  const [theCurrent, setTheCurrent] = useState({ records: [] })
16
+  const [conversionRate, setConversionRate] = useState(0)
17
+  useEffect(() => {
18
+    UserConversionRate({ conversion: 'authorization_phone' })
19
+  }, [])
20
+
21
+  function UserConversionRate(params) {
22
+
23
+    request({
24
+      ...apis.indexEcharts.userConversion,
25
+      params,
26
+    }).then(data => {
27
+      console.log(data.data_count.registeredCount / data.data_count.pvNum, '1241234')
28
+      setDataset(data, params.conversion)
29
+    })
30
+  }
31
+
32
+  function setDataset(data, theStatis) {
33
+    const { pvNum, ...other } = data.data_count
34
+
35
+    // 获取第一个值
36
+    let num = 0
37
+    for (const v of Object.keys(other)) {
38
+      num = other[v]
39
+      break
40
+    }
41
+
42
+    if (pvNum < num) {
43
+      setTheCurrent([
44
+        { name: getStatisName(theStatis), value: '0' },
45
+        { name: '其余', value:  '0' },
46
+      ])
47
+    } else {
48
+
49
+      setConversionRate(num / pvNum)
50
+      setTheCurrent([
51
+        { name: getStatisName(theStatis), value: num },
52
+        { name: '其余', value: pvNum - num },
53
+      ])
54
+    }
55
+  }
56
+
57
+  function getStatisName(theStatis) {
58
+    const statisTypes = [
59
+      { label: '授权手机', value: 'authorization_phone' },
60
+      { label: '项目收藏', value: 'building_save' },
61
+      { label: '项目转发', value: 'building_share' },
62
+      { label: '活动收藏', value: 'activity_save' },
63
+      { label: '活动转发', value: 'activity_share' },
64
+      { label: '资讯收藏', value: 'news_save' },
65
+      { label: '资讯转发', value: 'news_share' },
66
+      { label: '活动报名', value: 'activity_sign' },
67
+
68
+    ]
69
+    return statisTypes.filter(x => x.value === theStatis)[0].label
70
+  }
71
+
72
+  const options = {
73
+    legend: {},
74
+    color: ['#FF7E48', '#dcdcdc'],
75
+    tooltip: {},
76
+    series: {
77
+      type: 'pie',
78
+      name: '转化率',
79
+      radius: ['34%', '52%'],
80
+      avoidLabelOverlap: false,
81
+      label: {
82
+        formatter: '{b} {@value}',
83
+        emphasis: {
84
+          show: true,
85
+          formatter: '{d}%',
86
+          textStyle: {
87
+            fontSize: '22',
88
+            fontWeight: 'bold'
89
+          }
90
+        }
91
+      },
92
+      labelLine: {
93
+        normal: {
94
+          show: false
95
+        }
96
+      },
97
+
98
+      data: theCurrent,
99
+    },
100
+  }
101
+
102
+  function onChange(e) {
103
+    UserConversionRate({ conversion: e })
104
+  }
105
+  const piestyles = {
106
+    width: '100%',
107
+    height: '400px',
108
+  }
109
+
110
+  return (
111
+    <>
112
+      <div>
113
+        <p style={{ fontSize: '0.12rem', fontWeight: '600' }}>转化率</p>
114
+
115
+        <Select
116
+          style={{ width: 200 }}
117
+          placeholder="授权手机"
118
+          onChange={onChange}
119
+        >
120
+          <Select.Option value="authorization_phone">授权手机</Select.Option>
121
+          <Select.Option value="building_save">项目收藏</Select.Option>
122
+          <Select.Option value="building_share">项目转发</Select.Option>
123
+          <Select.Option value="activity_save">活动收藏</Select.Option>
124
+          <Select.Option value="activity_share">活动转发</Select.Option>
125
+          <Select.Option value="news_save">资讯收藏</Select.Option>
126
+          <Select.Option value="news_share">资讯转发</Select.Option>
127
+          <Select.Option value="activity_sign">活动报名</Select.Option>
128
+        </Select>
129
+        <EChart options={options} style={piestyles} />
130
+
131
+
132
+      </div>
133
+
134
+
135
+    </>
136
+  )
137
+}
138
+
139
+export default UserSource

+ 92
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserSex.jsx Parādīt failu

@@ -0,0 +1,92 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+// import styles from '../styles.less'
11
+
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+
18
+const UserSource = (props) => {
19
+
20
+  const [data, setData] = useState({ records: [] })
21
+  const endDate = new Date()
22
+  const startDate = moment().subtract(7, 'day').toDate()
23
+
24
+  useEffect(() => {
25
+    UserSex(formatDate(startDate, endDate))
26
+  }, [])
27
+
28
+  function UserSex(params) {
29
+    request({
30
+      ...apis.indexEcharts.userSex,
31
+      params,
32
+    }).then((data) => {
33
+      setData(data)
34
+    })
35
+  }
36
+
37
+  const dataset = (data.selectSexUser) || []
38
+
39
+  const options = {
40
+    title: {
41
+      text: '性别比例'
42
+    },
43
+    legend: {},
44
+    color: ['#FF7E48', '#dcdcdc'],
45
+    tooltip: {
46
+      trigger: 'item',
47
+      formatter: "{b}: ({d}%)"
48
+    },
49
+    series: {
50
+      type: 'pie',
51
+      name: '性别比例',
52
+      center: ['44%', '65%'],
53
+      radius: ['34%', '52%'],
54
+      label: {
55
+        formatter: '{b} {@value}',
56
+      },
57
+      data:
58
+        dataset,
59
+    }
60
+  }
61
+
62
+
63
+  const piestyles = {
64
+    width: '100%',
65
+    height: '400px',
66
+    minWidth: '350px'
67
+
68
+  }
69
+
70
+
71
+  return (
72
+    <>
73
+      <div>
74
+        {/* <h3>性别比例</h3> */}
75
+
76
+
77
+        <EChart options={options} style={piestyles} />
78
+
79
+
80
+
81
+
82
+      </div>
83
+
84
+
85
+
86
+
87
+
88
+    </>
89
+  )
90
+}
91
+
92
+export default UserSource;

+ 123
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserSource.jsx Parādīt failu

@@ -0,0 +1,123 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+
9
+
10
+const formatDate = (start, end) => {
11
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
12
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
13
+  return { startDate, endDate }
14
+}
15
+
16
+const UserSource = (props) => {
17
+  const [xData, setxData] = useState([])
18
+  const [fromData, setFromData] = useState([])
19
+  const [registerData, setRegisterData] = useState([])
20
+  //柱图
21
+  useEffect(() => {
22
+    userResource(formatDate(props.startDate, props.endDate))
23
+  }, [props.startDate, props.endDate])
24
+
25
+  function userResource(params) {
26
+    request({
27
+      ...apis.indexEcharts.selectPersonFrom,
28
+      params,
29
+    }).then((data) => {
30
+      console.log(data,"222222")
31
+      setxData(data.tdWxDicts.map(x =>  x.sceneAlias))
32
+      setFromData(data.tdWxDicts.map(x => x.fromData))
33
+      setRegisterData(data.tdWxDicts.map(x => x.registerSum))
34
+      props.onSuccess(data)
35
+    })
36
+  }
37
+
38
+  const subtitle = '最近7天';
39
+  const baroptions = {
40
+    title: { },
41
+    xAxis: { 
42
+              type: 'category',
43
+              data: xData,
44
+              axisLabel: {rotate: 45}
45
+            },
46
+    legend: {
47
+      left: '20%',
48
+      data: ['所有用户', '注册用户']
49
+    },
50
+
51
+    tooltip: {},
52
+
53
+    yAxis: {},
54
+    series: [
55
+      {
56
+        type: 'bar', name: '所有用户', datasetIndex: 0,
57
+        barWidth: 20,
58
+        data: fromData,
59
+        itemStyle: {
60
+          normal: {
61
+            barBorderRadius: [20, 20, 0, 0],
62
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
63
+              offset: 0,
64
+              color: '#FFC4A8'
65
+            }, {
66
+              offset: 1,
67
+              color: '#FF7E49'
68
+            }]),
69
+            shadowColor: 'rgba(0, 0, 0, 0.4)',
70
+
71
+          }
72
+        }
73
+      },
74
+      {
75
+        type: 'bar',
76
+        name: '注册用户',
77
+        barWidth: 20,
78
+        data: registerData,
79
+        itemStyle: {
80
+          normal: {
81
+            barBorderRadius: [20, 20, 0, 0],
82
+            color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [{
83
+              offset: 0,
84
+              color: '#FE939D'
85
+            }, {
86
+              offset: 1,
87
+              color: '#F0293C'
88
+            }]),
89
+            shadowColor: 'rgba(0, 0, 0, 0.4)',
90
+
91
+          }
92
+        }
93
+
94
+      },
95
+    ],
96
+    // dataset: {
97
+    //   id: 'bar',
98
+    //   dimensions: ['fromName', 'userCount', 'registered'],
99
+    //   source: source,
100
+    // },
101
+  }
102
+
103
+
104
+  const barstyle = {
105
+    width: '100%',
106
+    height: '480px',
107
+    minWidth: '400px'
108
+  }
109
+
110
+  return (
111
+    <>
112
+      <div>
113
+      <p onClick={()=>router.push('/statistical/userSource')}><span style={{borderBottom:'1px solid #f02d40',cursor: 'pointer',color:'#333',fontSize:'0.12rem',fontWeight:'600'}}>用户来源</span> {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}</p>
114
+
115
+        <EChart options={baroptions} style={barstyle} />
116
+
117
+      </div>
118
+
119
+    </>
120
+  )
121
+}
122
+
123
+export default UserSource;

+ 139
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserSourceDetail.jsx Parādīt failu

@@ -0,0 +1,139 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '../../../components/EchartsTest/EChart';
4
+import request from '../../../utils/request';
5
+import apis from '../../../services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+import styles from '../styles.less'
11
+
12
+const formatDate = (start, end) => {
13
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
14
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
15
+  return { startDate, endDate }
16
+}
17
+
18
+const UserSourceDetail = (props) => {
19
+  const [xData, setxData] = useState([])
20
+  const [fromData, setFromData] = useState([])
21
+  const [registerData, setRegisterData] = useState([])
22
+  //柱图
23
+  useEffect(() => {
24
+    userResource(formatDate(props.startDate, props.endDate))
25
+  }, [props.startDate, props.endDate])
26
+
27
+  function userResource(params) {
28
+    request({
29
+      ...apis.indexEcharts.selectPersonFromGroupByDay,
30
+      params,
31
+    }).then((data) => {
32
+      setxData(data.map(x =>  x.createTime))
33
+      setFromData(data.map(x => x.fromNum))
34
+      setRegisterData(data.map(x => x.registeredNum))
35
+      props.onSuccess(data)
36
+    })
37
+  }
38
+
39
+  const subtitle = '最近7天';
40
+  const baroptions = {
41
+    title: {
42
+    },
43
+    tooltip: {
44
+        trigger: 'axis'
45
+    },
46
+    legend: {
47
+        data: ['新用户数', '授权注册']
48
+    },
49
+    toolbox: {
50
+        show: true,
51
+        feature: {
52
+            dataZoom: {
53
+                yAxisIndex: 'none'
54
+            },
55
+            dataView: {readOnly: false},
56
+            magicType: {type: ['line', 'bar']},
57
+            restore: {},
58
+            saveAsImage: {}
59
+        }
60
+    },
61
+    xAxis: {
62
+        type: 'category',
63
+        boundaryGap: false,
64
+        data: xData
65
+    },
66
+    yAxis: {
67
+        type: 'value',
68
+        axisLabel: {
69
+            formatter: '{value} °C'
70
+        }
71
+    },
72
+    series: [
73
+        {
74
+            name: '新用户数',
75
+            type: 'line',
76
+            data: fromData,
77
+            markPoint: {
78
+                data: [
79
+                    {type: 'max', name: '最大值'},
80
+                    {type: 'min', name: '最小值'}
81
+                ]
82
+            },
83
+            markLine: {
84
+                data: [
85
+                    {type: 'average', name: '平均值'}
86
+                ]
87
+            }
88
+        },
89
+        {
90
+            name: '授权注册',
91
+            type: 'line',
92
+            data: registerData,
93
+            markPoint: {
94
+                data: [
95
+                    {name: '周最低', value: -2, xAxis: 1, yAxis: -1.5}
96
+                ]
97
+            },
98
+            markLine: {
99
+                data: [
100
+                    {type: 'average', name: '平均值'},
101
+                    [{
102
+                        symbol: 'none',
103
+                        x: '90%',
104
+                        yAxis: 'max'
105
+                    }, {
106
+                        symbol: 'circle',
107
+                        label: {
108
+                            position: 'start',
109
+                            formatter: '最大值'
110
+                        },
111
+                        type: 'max',
112
+                        name: '最高点'
113
+                    }]
114
+                ]
115
+            }
116
+        }
117
+    ]
118
+}
119
+
120
+  const barstyle = {
121
+    width: '100%',
122
+    height: '480px',
123
+    minWidth: '400px'
124
+  }
125
+
126
+  return (
127
+    <>
128
+      <div>
129
+      <p onClick={()=>router.push('/statistical/userSource')}><span style={{borderBottom:'1px solid #f02d40',cursor: 'pointer',color:'#333',fontSize:'0.12rem',fontWeight:'600'}}>用户来源</span> {!props.BuildSelectHide && <span style={{ fontSize: '0.09rem', color: '#888', marginLeft: '0.06rem' }}>最近七天</span>}</p>
130
+
131
+        <EChart options={baroptions} style={barstyle} />
132
+
133
+      </div>
134
+
135
+    </>
136
+  )
137
+}
138
+
139
+export default UserSourceDetail;

+ 103
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/UserSourcepie.jsx Parādīt failu

@@ -0,0 +1,103 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import echarts from 'echarts/lib/echarts';
3
+import EChart from '@/components/EchartsTest/EChart';
4
+import request from '@/utils/request';
5
+import apis from '@/services/apis';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import { Table, Select, Row, Col, Menu, Dropdown, Button, Icon, message } from 'antd';
9
+
10
+const formatDate = (start, end) => {
11
+  const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
12
+  const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
13
+  return { startDate, endDate }
14
+}
15
+const UserSource = (props) => {
16
+  const [data, setData] = useState({ records: [] })
17
+
18
+
19
+  useEffect(() => {
20
+    userResource(formatDate(props.startDate, props.endDate))
21
+  }, [props.startDate, props.endDate])
22
+
23
+  function userResource(params) {
24
+    request({
25
+      ...apis.indexEcharts.userResource,
26
+      params,
27
+    }).then((data) => {
28
+      setData(data)
29
+    })
30
+  }
31
+
32
+  function toEdit() {
33
+    router.push({
34
+      pathname: '/statistical/userSource',
35
+    });
36
+  }
37
+
38
+  const dataset = data || {};
39
+
40
+
41
+  const { person_estate_agent = 0, person_null = 0, person_realty_consultant = 0 } = dataset.pie || {};
42
+  const pieoptions = {
43
+    color: ['#6B82E6', '#F02D40', '#FF834E'],
44
+    legend: {
45
+      orient: 'vertical',
46
+      x: 'left',
47
+      data: ['来源置业', '来源客户', '其他'],
48
+    },
49
+    tooltip: {
50
+      // trigger: 'item',
51
+      // formatter: "{a} <br/>{b} : {c} ({d}%)"
52
+    },
53
+    series: [
54
+      {
55
+        name: '用户来源',
56
+        type: 'pie',
57
+        center: ['50%', '65%'],
58
+        radius: ['25%', '40%'],
59
+        label: {
60
+          formatter: '{b} {@value}',
61
+          emphasis: {
62
+            show: true,
63
+            formatter: '{d}%',
64
+            textStyle: {
65
+              fontSize: '22',
66
+              fontWeight: 'bold'
67
+            }
68
+          },
69
+        },
70
+      },
71
+
72
+    ],
73
+
74
+    dataset: {
75
+      id: 'pie',
76
+      source: [
77
+        { '用户来源': '来源置业', value: person_realty_consultant, },
78
+        { '用户来源': '来源客户', value: person_estate_agent },
79
+        { '用户来源': '其他', value: person_null },
80
+      ]
81
+    },
82
+  }
83
+
84
+
85
+  const piestyles = {
86
+    width: '100%',
87
+    height: '400px',
88
+    minWidth: '350px',
89
+  }
90
+
91
+  return (
92
+    <>
93
+      <div>
94
+
95
+        <EChart options={pieoptions} style={piestyles} />
96
+
97
+      </div>
98
+
99
+    </>
100
+  )
101
+}
102
+
103
+export default UserSource;

+ 138
- 0
src/pages/statistical/Monitor/components/indexEcharts/components/charts/CityNums.jsx Parādīt failu

@@ -0,0 +1,138 @@
1
+import React, { useState, useEffect } from 'react';
2
+import Echart from '@/components/EchartsTest/EChart';
3
+import { fetch, apis } from '@/utils/request';
4
+
5
+const geoOptions = {
6
+  backgroundColor: '#fff',
7
+  title: {
8
+    text: '城市分布',
9
+    subtext: '数据会存在一定时间延迟',
10
+    left: 40,
11
+    top: 40
12
+  },
13
+  tooltip : {
14
+      trigger: 'item',
15
+      formatter: (params) => {
16
+        return `${params.data.name}: ${params.data.value[2]}`
17
+      }
18
+  },
19
+  geo: {
20
+      map: 'china',
21
+      roam: true,
22
+      zoom: 1.2,
23
+      label: {
24
+        normal: {
25
+          show: true,
26
+          color: '#aaa',
27
+        },
28
+        emphasis: {
29
+          show: true
30
+        }
31
+      },
32
+      itemStyle: {
33
+          normal: {
34
+              areaColor: '#f3f3f3',
35
+              borderColor: '#ddd'
36
+          },
37
+          emphasis: {
38
+              areaColor: '#eee'
39
+          }
40
+      }
41
+  },
42
+}
43
+
44
+const getCityData = fetch(apis.indexEcharts.personCity)
45
+
46
+const mapDataRange = x => {
47
+  // 映射区间 [1, 100000] => [rangeStart, rangeEnd]
48
+  const min = 1
49
+  const max = 100000
50
+  const rangeStart = 16
51
+  const rangeEnd = 24
52
+
53
+  return rangeStart + (x - min) * (rangeEnd - rangeStart) / (max - min)
54
+}
55
+
56
+const CityNums = (props) => {
57
+  const [data, setData]= useState([])
58
+
59
+  useEffect(() => {
60
+    getCityData().then(response => {
61
+      const { selectCityUser = [] } = response || {}
62
+      const data = selectCityUser.map((item) => {
63
+        return {
64
+          name: item.name,
65
+          value: [item.lng - 0, item.lat - 0, item.cityCount]
66
+        }
67
+      })
68
+      setData(data)
69
+    })
70
+  }, [])
71
+
72
+  const options = {
73
+    ...geoOptions,
74
+    series: [
75
+      {
76
+        name: '人数',
77
+        type: 'scatter',
78
+        coordinateSystem: 'geo',
79
+        data,
80
+        symbolSize: 10,
81
+        label: {
82
+            normal: {
83
+                formatter: '{b}',
84
+                position: 'right',
85
+                show: false
86
+            },
87
+            emphasis: {
88
+                show: true
89
+            }
90
+        },
91
+        itemStyle: {
92
+            normal: {
93
+                color: '#DB3C4B'
94
+            }
95
+        }
96
+      },
97
+      {
98
+          name: '前三',
99
+          type: 'effectScatter',
100
+          coordinateSystem: 'geo',
101
+          data: data.sort(function (a, b) {
102
+              return b.value[2] - a.value[2];
103
+          }).slice(0, 3),
104
+          symbolSize: function (val) {
105
+              return mapDataRange(val[2]);
106
+          },
107
+          showEffectOn: 'render',
108
+          rippleEffect: {
109
+              brushType: 'stroke'
110
+          },
111
+          hoverAnimation: true,
112
+          label: {
113
+              normal: {
114
+                  formatter: '{b}',
115
+                  position: 'right',
116
+                  show: false
117
+              }
118
+          },
119
+          itemStyle: {
120
+              normal: {
121
+                  color: '#DB3C4B',
122
+                  shadowBlur: 10,
123
+                  shadowColor: '#333'
124
+              }
125
+          },
126
+          zlevel: 1
127
+      }
128
+    ],
129
+  }
130
+
131
+  return (
132
+    <div style={{ marginBottom:'40px', width: '100%', borderRadius: '12px', boxShadow: '0px 0px 9px 1px rgba(0,0,0,0.12)', overflow: 'hidden' }}>
133
+      <Echart options={options} style={{ width: '100%', height: '600px' }} ></Echart>
134
+    </div>
135
+  )
136
+}
137
+
138
+export default CityNums;

+ 98
- 0
src/pages/statistical/Monitor/components/indexEcharts/index.jsx Parādīt failu

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

+ 191
- 0
src/pages/statistical/Monitor/components/indexEcharts/newUsers.jsx Parādīt failu

@@ -0,0 +1,191 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Radio, DatePicker, Form, Input, Button, Icon, Select, message, Table, Divider, Tag, Pagination, Modal, Breadcrumb } from 'antd';
3
+import { Row, Col, Menu, Dropdown } from 'antd';
4
+import NewUsers from './components/NewUsers'
5
+// import XForm, { FieldTypes } from '../../components/XForm';
6
+import moment from 'moment';
7
+import router from 'umi/router';
8
+import EChart from '../../components/EchartsTest/EChart';
9
+import request from '../../utils/request';
10
+import apis from '../../services/apis';
11
+
12
+
13
+// const formatDate = (start, end) => {
14
+//   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
15
+//   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
16
+//   return { startDate, endDate }
17
+// }
18
+
19
+let columns = [
20
+  {
21
+    title: '日期',
22
+    dataIndex: 'createTime',
23
+    key: 'createTime',
24
+  },
25
+]
26
+
27
+let daterange = []
28
+
29
+const header = props => {
30
+
31
+  const [tableData, setTableData] = useState([])
32
+  const [endDate, setEndDate] = useState({})
33
+  const [data, setDate] = useState({})
34
+  const [userType, setUserType] = useState({})
35
+  const [startDate, setStartDate] = useState({})
36
+
37
+
38
+  useEffect(() => {
39
+
40
+    setEndDate(new Date())
41
+    setStartDate(moment().subtract(7, 'day').toDate())
42
+    // setStartDate(moment().subtract(7, 'day').toDate())
43
+    userResource({ startDate: moment().subtract(7, 'day').toDate(), endDate: new Date() })
44
+  }, [])
45
+
46
+  const { RangePicker } = DatePicker;
47
+
48
+  function onChangetime(dates, dateStrings) {
49
+
50
+    daterange[1] = `${moment(dateStrings[1]).format('YYYY-MM-DDT00:00:00.000')}Z`
51
+    daterange[0] = `${moment(dateStrings[0]).format('YYYY-MM-DDT00:00:00.000')}Z`
52
+
53
+  }
54
+
55
+  const handleSubmit = (e, props) => {
56
+
57
+    e.preventDefault();
58
+
59
+  }
60
+
61
+  const getDataOf = (days) => () => {
62
+
63
+
64
+    setEndDate(new Date())
65
+    setStartDate(moment().subtract(days, 'day').toDate())
66
+    userResource({ startDate: moment().subtract(days, 'day').toDate(), endDate: new Date() })
67
+  }
68
+
69
+  function onChange(e) {
70
+
71
+
72
+  }
73
+
74
+  function datalist() {
75
+    setEndDate(daterange[1])
76
+    setStartDate(daterange[0])
77
+    userResource({ startDate, endDate })
78
+
79
+  }
80
+
81
+  function userResource(params) {
82
+    request({
83
+      ...apis.indexEcharts.selectPersonFrom,
84
+      params,
85
+    }).then((data) => {
86
+      setDate(data);
87
+      onTabledatas(data, "all")
88
+    })
89
+  }
90
+
91
+  const onTabledatas = (e, changeType) => {
92
+    e.tdWxDicts.map(x => {
93
+      columns = columns.filter(y => y.key != x.sceneType).concat({
94
+        title: x.sceneAlias,
95
+        dataIndex: x.sceneType,
96
+        key: x.sceneType,
97
+      })
98
+    })
99
+    const data = (e.list || []).reduce((acc, item) => {
100
+      const { sceneType, fromNum, registeredNum, createTime } = item
101
+      const num = changeType === 'registered' ? registeredNum : fromNum
102
+      acc[createTime] = { ...acc[createTime], ...item, [`${sceneType}`]: !num ? 0 : num }
103
+      return acc
104
+    }, {})
105
+
106
+    const dictData = e.tdWxDicts.reduce((acc, item, index) => {
107
+      const { sceneType } = item
108
+      acc[sceneType] = 0
109
+      return acc
110
+    }, {})
111
+
112
+    const tableData = Object.keys(data).map(k => data[k]).reduce((acc, item, index) => {
113
+      acc[index] = { ...dictData, ...item }
114
+      return acc
115
+    }, [])
116
+
117
+    setTableData(tableData)
118
+
119
+  }
120
+
121
+  function handleSelectChange(e) {
122
+    setUserType(e)
123
+    onTabledatas(data, e)
124
+  }
125
+
126
+  function exportUserStats() {
127
+    console.log(startDate, endDate, userType)
128
+    request({
129
+      ...apis.indexEcharts.exportUserStats,
130
+      params: { startDate, endDate, userType },
131
+    }).then((data) => {
132
+      if (!data) {
133
+        return
134
+      }
135
+      const url = window.URL.createObjectURL(new Blob([data]))
136
+      const link = document.createElement('a')
137
+      link.style.display = 'none'
138
+      link.href = url
139
+      link.setAttribute('download', '新增用户.xlsx')
140
+      document.body.append(link)
141
+      link.click()
142
+    })
143
+  }
144
+
145
+  const { Column, ColumnGroup } = Table;
146
+
147
+  return (<>
148
+    <div >
149
+      <Radio.Group onChange={onChange} buttonStyle="solid" defaultValue="a" style={{ marginBottom: '20px' }}>
150
+        {/* <Radio.Button value="c" onClick={getDataOf(0)}>今日</Radio.Button> */}
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' }}
156
+        ranges={{
157
+          Today: [moment(), moment()],
158
+          'This Month': [moment().startOf('month'), moment().endOf('month')],
159
+        }}
160
+        // showTime
161
+        // format="YYYY/MM/DD HH:mm:ss"
162
+        onChange={onChangetime}
163
+      />
164
+      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={datalist}>
165
+        搜索
166
+          </Button>
167
+      <Button onClick={() => router.go(-1)} style={{ float: 'right' }}>返回</Button>
168
+      <div>
169
+        <NewUsers BuildSelectHide={true} endDate={endDate} startDate={startDate} dataZoom={true} ></NewUsers>
170
+        {/* */}
171
+
172
+        <Row>
173
+          <Col span={22}>
174
+            <Select style={{ width: '180px' }} placeholder="所有用户" onChange={(e) => handleSelectChange(e)}>
175
+              <Option value='all'>所有用户</Option>
176
+              <Option value='registered'>注册用户</Option>
177
+            </Select>
178
+          </Col>
179
+          <Col span={2}>
180
+            <Button type="primary" onClick={exportUserStats}>导出</Button>
181
+          </Col>
182
+        </Row>
183
+
184
+        <Table style={{ marginTop: '20px' }} dataSource={tableData} columns={columns} pagination={false} scroll={{ y: 500 }}></Table>
185
+      </div>
186
+    </div>
187
+  </>
188
+  )
189
+}
190
+
191
+export default header

+ 37
- 0
src/pages/statistical/Monitor/components/indexEcharts/styles.less Parādīt failu

@@ -0,0 +1,37 @@
1
+.bar {
2
+  width: 70%;
3
+  min-width: 400px;
4
+  min-height: 560px;
5
+  background: rgba(255, 255, 255, 1);
6
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
7
+  border-radius: 12px;
8
+  margin-right: 30px;
9
+}
10
+
11
+.pie {
12
+  width: 30%;
13
+  min-width: 370px;
14
+  background: rgba(255, 255, 255, 1);
15
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
16
+  border-radius: 12px;
17
+
18
+}
19
+
20
+.behavior {
21
+  width: 100%;
22
+  height: 586px;
23
+  background: rgba(255, 255, 255, 1);
24
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
25
+  border-radius: 12px;
26
+  margin-bottom: 40px;
27
+  padding: 40px;
28
+}
29
+
30
+.customers {
31
+  width: 100%;
32
+  height: 718px;
33
+  background: rgba(255, 255, 255, 1);
34
+  box-shadow: 0px 0px 16px 2px rgba(0, 0, 0, 0.12);
35
+  border-radius: 12px 12px 0px 0px;
36
+  padding: 40px;
37
+}

+ 237
- 0
src/pages/statistical/Monitor/components/indexEcharts/userBehavior.jsx Parādīt failu

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

+ 207
- 0
src/pages/statistical/Monitor/components/indexEcharts/userSource.jsx Parādīt failu

@@ -0,0 +1,207 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Form, Icon, Input, Button, DatePicker, Select, Card, Row, Col, Pagination, Alert, Table, Avatar, Radio, Modal, Descriptions } from 'antd';
3
+import UserSource from './components/UserSource.jsx';
4
+import UserSourcepie from './components/UserSourcepie.jsx';
5
+// import XForm, { FieldTypes } from '../../components/XForm';
6
+import moment from 'moment';
7
+import EChart from '../../components/EchartsTest/EChart';
8
+import request from '../../utils/request';
9
+import apis from '../../services/apis';
10
+import router from 'umi/router';
11
+
12
+
13
+const { RangePicker } = DatePicker;
14
+const { Option } = Select
15
+
16
+
17
+// const formatDate = (start, end) => {
18
+//   const startDate = moment(start).format('YYYY-MM-DDT00:00:00.000') + 'Z'
19
+//   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
20
+//   return { startDate, endDate }
21
+// }
22
+
23
+let daterange = []
24
+let tableTitle = ['类型']
25
+
26
+let columns = [
27
+  {
28
+    title: '日期',
29
+    dataIndex: 'createTime',
30
+    key: 'createTime',
31
+  },
32
+  // {
33
+  //   title: '名片分享',
34
+  //   dataIndex: '名片分享',
35
+  //   key: '名片分享',
36
+  // },
37
+  // {
38
+  //   title: '生成海报',
39
+  //   dataIndex: '生成海报',
40
+  //   key: '生成海报',
41
+  // },
42
+  // {
43
+  //   title: '小程序搜索',
44
+  //   dataIndex: '小程序搜索',
45
+  //   key: '小程序搜索',
46
+  // },
47
+  // {
48
+  //   title: '好友分享',
49
+  //   dataIndex: '好友分享',
50
+  //   key: '好友分享',
51
+  // },
52
+]
53
+
54
+// let columns = [
55
+//   {
56
+//     title: '类型',
57
+//     dataIndex: 'value',
58
+//     key: 'value',
59
+//   }
60
+// ]
61
+
62
+class Header extends React.Component {
63
+
64
+  constructor(props) {
65
+    super(props)
66
+    this.state = {
67
+      dataSoures: [],
68
+      tableData: [],
69
+      userType: 'all',
70
+      endDate: {},
71
+      startDate: {}
72
+    }
73
+  }
74
+
75
+  componentDidMount() {
76
+    this.setState({ endDate: new Date(), startDate: moment().subtract(7, 'day').toDate() })
77
+  }
78
+
79
+  formatDate = (start, end) => {
80
+    const tempStartDate = `${moment(start).format('YYYY-MM-DDT00:00:00.000')}Z`
81
+    const tempEndDate = `${moment(end).format('YYYY-MM-DDT23:59:59.999')}Z`
82
+    return { startDate: tempStartDate, endDate: tempEndDate }
83
+  }
84
+
85
+  onChangetime = (_dates, dateStrings) => {
86
+    daterange[1] = dateStrings[1]
87
+    daterange[0] = dateStrings[0]
88
+  }
89
+
90
+  handleSubmit = (e, props) => {
91
+
92
+    e.preventDefault();
93
+
94
+  }
95
+
96
+  getDataOf = (days) => {
97
+    this.setState({ endDate: new Date(), startDate: moment().subtract(days, 'day').toDate() })
98
+  }
99
+
100
+  datalist = () => {
101
+    console.log()
102
+    this.setState({
103
+      endDate: daterange[1] === '' ? new Date() : daterange[1],
104
+      startDate: daterange[0] === '' ? moment().subtract(7, 'day').toDate() : daterange[0],
105
+    })
106
+  }
107
+
108
+  onSuccess = e => {
109
+    this.setState({ dataSoures: e }, () => {
110
+      this.onTabledatas(e)
111
+    })
112
+  }
113
+
114
+  onTabledatas = (e) => {
115
+    console.log('this.state.userType: ', this.state.userType)
116
+    e.tdWxDicts.map(x => {
117
+      columns = columns.filter(y => y.key != x.sceneType).concat({
118
+        title: x.sceneAlias,
119
+        dataIndex: x.sceneType,
120
+        key: x.sceneType,
121
+      })
122
+    })
123
+    const data = (e.list || []).reduce((acc, item) => {
124
+      const { sceneType, fromNum, registeredNum, createTime } = item
125
+      const num = this.state.userType === 'registered' ? registeredNum : fromNum
126
+      acc[createTime] = { ...acc[createTime], ...item, [`${sceneType}`]: !num ? 0 : num }
127
+      return acc
128
+    }, {})
129
+
130
+    const dictData = e.tdWxDicts.reduce((acc, item, index) => {
131
+      const { sceneType } = item
132
+      acc[sceneType] = 0
133
+      return acc
134
+    }, {})
135
+
136
+    const tableData = Object.keys(data).map(k => data[k]).reduce((acc, item, index) => {
137
+      acc[index] = { ...dictData, ...item }
138
+      return acc
139
+    }, [])
140
+
141
+    this.setState({ tableData })
142
+
143
+  }
144
+
145
+  handleSelectChange = (e) => {
146
+    this.setState({ userType: e }, () => {
147
+      this.onTabledatas(this.state.dataSoures)
148
+    })
149
+  }
150
+
151
+
152
+  render() {
153
+    return (
154
+      <>
155
+        <div>
156
+          <Radio.Group buttonStyle="solid" defaultValue="a">
157
+            <Radio.Button value="a" onClick={() => this.getDataOf(7)}>最近7天</Radio.Button>
158
+            <Radio.Button value="b" onClick={() => this.getDataOf(30)}>最近1月</Radio.Button>
159
+          </Radio.Group>
160
+          <RangePicker
161
+            style={{ paddingLeft: '30px' }}
162
+            ranges={{
163
+              Today: [moment(), moment()],
164
+              'This Month': [moment().startOf('month'), moment().endOf('month')],
165
+            }}
166
+            // showTime
167
+            // format="YYYY/MM/DD HH:mm:ss"
168
+            onChange={(_dates, dateStrings) => this.onChangetime(_dates, dateStrings)}
169
+          />
170
+          <Button type="primary" htmlType="submit" style={{ marginLeft: '30px' }} onClick={() => this.datalist()}>
171
+            搜索
172
+        </Button>
173
+          <Button onClick={() => router.go(-1)} style={{ float: 'right' }}>返回</Button>
174
+          <div>
175
+
176
+            <div style={{ display: 'flex' }}>
177
+              <div style={{
178
+                width: '1060px',
179
+                height: '560px',
180
+                paddingTop: '40px',
181
+                marginRight: ' 40px',
182
+              }}>
183
+                <UserSource BuildSelectHide={true} endDate={this.state.endDate} startDate={this.state.startDate} onSuccess={(e) => this.onSuccess(e)}></UserSource>
184
+              </div>
185
+              <div style={{
186
+                width: '509px',
187
+                height: '600px',
188
+                paddingTop: '40px',
189
+
190
+              }}>
191
+                <UserSourcepie endDate={this.state.endDate} startDate={this.state.startDate}></UserSourcepie>
192
+              </div>
193
+            </div>
194
+            <Select style={{ width: '180px' }} placeholder="所有用户" onChange={(e) => this.handleSelectChange(e)}>
195
+              <Option value='all'>所有用户</Option>
196
+              <Option value='registered'>注册用户</Option>
197
+            </Select>
198
+
199
+            <Table style={{ marginTop: '20px' }} dataSource={this.state.tableData} columns={columns} pagination={false} scroll={{ y: 500 }}></Table>
200
+          </div>
201
+        </div>
202
+      </>
203
+    )
204
+  }
205
+}
206
+
207
+export default Header

+ 88
- 0
src/pages/statistical/Monitor/index.jsx Parādīt failu

@@ -0,0 +1,88 @@
1
+import React, { Component, useState, useEffect } from 'react';
2
+import { Card } from 'antd';
3
+import IndexEcharts from './components/indexEcharts';
4
+// import Swiper from './swiper/index';
5
+import router from 'umi/router';
6
+import request from '@/utils/request';
7
+import apis from '@/services/apis';
8
+
9
+const Monitor = props => {
10
+
11
+  const [data, setData] = useState([])
12
+
13
+  const [checkData, setCheckData] = useState([])
14
+
15
+  useEffect(() => {
16
+    getIndexEcharts()
17
+    getBuildingReports()
18
+  }, [])
19
+
20
+  function getIndexEcharts(params) {
21
+    request({
22
+      ...apis.indexEcharts.list,
23
+      params
24
+    }).then((data) => {
25
+      setData(data)
26
+      console.log(data, '11111')
27
+    })
28
+  }
29
+
30
+  function getBuildingReports() {
31
+    request({ ...apis.system.taBuildingReports, }).then((data) => {
32
+      console.log(data,"22222222222222222")
33
+      setCheckData((data.records || []).map((x) => x.reportCode))
34
+    })
35
+  }
36
+
37
+  return (
38
+    <Card>
39
+      <div style={{ display: 'flex', marginBottom: '33px' }}>
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('total_number_of_visit_users') &&
61
+          <div style={{
62
+            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',
63
+            boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
64
+            borderRadius: '12px', width: '32%', marginRight: '2%'
65
+          }}>
66
+            <span style={{ fontSize: '24px', color: '#fff' }}>今日访问次数 </span>
67
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectVisitCount || '0'}</span>
68
+          </div>
69
+        }
70
+        {checkData.includes('number_of_new_users') &&
71
+          <div onClick={() => router.push('/statistical/newUsers')} style={{
72
+            textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',
73
+            boxShadow: '0px  0.106rem 14px -15px rgba(107,130,230,1)',
74
+            borderRadius: '12px', width: '32%',
75
+          }}>
76
+            <span style={{ fontSize: '24px', color: '#fff', borderBottom: '1px solid #fff', margin: '30px 0', cursor: 'pointer' }}>今日新增用户 </span>
77
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy', lineHeight: '100px' }}>{data.selectRecentlyCount || '0'}</span>
78
+          </div>
79
+        }
80
+      </div>
81
+      {/* <Swiper /> */}
82
+      <IndexEcharts style={{ width: '100%' }} onReData={(e) => redata(e)} checkData={checkData}></IndexEcharts>
83
+    </Card>
84
+  )
85
+
86
+}
87
+export default Monitor
88
+

+ 164
- 14
src/pages/system/Sellhouse/Edit.jsx Parādīt failu

@@ -1,21 +1,171 @@
1
-import React, {  } from 'react';
2
-// import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
-import { Card, Tabs } from 'antd';
4
-import Basic from './compents/Basic'
1
+import React, { useState, useEffect } from 'react';
2
+import { Card, message } from 'antd';
3
+import router from 'umi/router';
4
+import SelectCity from '@/components/SelectButton/CitySelect';
5
+import XForm, { FieldTypes } from '@/components/XForm';
6
+import Wangedit from '@/components/Wangedit/Wangedit';
7
+import apis from '@/services/apis';
8
+import request from '@/utils/request';
9
+import SelectPolicyType from '@/components/SelectButton/SelectPolicyType';
5 10
 
6
-const { TabPane } = Tabs;
11
+/**
12
+ *
13
+ *
14
+ * @param {*} props
15
+ * @returns
16
+ */
17
+const Edit = props => {
18
+  const policyId = props.location.query.policyId;
19
+  const [policyData, setPolicyData] = useState({});
20
+  if (policyId) {
21
+    useEffect(() => {
22
+      getPolicyData(policyId);
23
+    }, []);
24
+
25
+    // 查询列表
26
+    const getPolicyData = policyId => {
27
+      request({ ...apis.system.taPolicy, urlData: { id: policyId } }).then(data => {
28
+        console.log(data);
29
+        setPolicyData(data);
30
+      });
31
+    };
32
+  }
33
+
34
+  const cancelPage = () => {
35
+    router.go('-1');
36
+  };
37
+  const fields = [
38
+    {
39
+      label: '城市',
40
+      name: 'cityId',
41
+      render: <SelectCity />,
42
+      value: policyData.cityId,
43
+      rules: [
44
+        {
45
+          required: true,
46
+          message: '请选择城市',
47
+        },
48
+      ],
49
+    },
50
+    {
51
+      label: '类型',
52
+      name: 'policyTypeId',
53
+      render: <SelectPolicyType />,
54
+      value: policyData.policyTypeId,
55
+      rules: [
56
+        {
57
+          required: true,
58
+          message: '请选类型',
59
+        },
60
+      ],
61
+    },
62
+    {
63
+      label: '购房须知封面图',
64
+      name: 'policyImg',
65
+      type: FieldTypes.ImageUploader,
66
+      value: policyData.policyImg,
67
+      help: '建议图片尺寸:220*176px,比例5:4,格式:jpg,用于购房须知列表',
68
+      rules: [
69
+        {
70
+          required: true,
71
+          message: '请选择购房须知封面图',
72
+        },
73
+      ],
74
+    },
75
+    {
76
+      label: '购房须知标题',
77
+      name: 'title',
78
+      type: FieldTypes.Text,
79
+      value: policyData.title,
80
+      rules: [
81
+        {
82
+          required: true,
83
+          message: '请输入购房须知标题',
84
+        },
85
+      ],
86
+    },
87
+    {
88
+      label: '副标题',
89
+      name: 'subtitle',
90
+      type: FieldTypes.Text,
91
+      value: policyData.subtitle,
92
+      rules: [
93
+        {
94
+          required: true,
95
+          message: '请输入副标题',
96
+        },
97
+        {
98
+          max: 8,
99
+          message: '最大可输入8个字符',
100
+        },
101
+      ],
102
+    },
103
+    {
104
+      label: '是否热点',
105
+      name: 'isHot',
106
+      type: FieldTypes.Switch,
107
+      value: policyData.isHot === 1 ? true : false,
108
+    },
109
+    {
110
+      label: '购房须知详情',
111
+      name: 'body',
112
+      render: <Wangedit />,
113
+      value: policyData.body,
114
+      rules: [
115
+        {
116
+          required: true,
117
+          message: '请输入购房须知详情',
118
+        },
119
+      ],
120
+    },
121
+
122
+    {
123
+      label: '状态',
124
+      name: 'publishStatus',
125
+      type: FieldTypes.Select,
126
+      dict: [
127
+        { label: '未发布', value: 0 },
128
+        { label: '已发布', value: 1 },
129
+      ],
130
+      value: policyData.publishStatus != null ? policyData.publishStatus : 1,
131
+    },
132
+  ];
133
+
134
+  const handleSubmit = val => {
135
+    console.log('submit data --->', val);
136
+    console.log(val.body, 'val.body');
137
+    if (val.body == '<p><br></p>') {
138
+      message.info('购房须知详情必填');
139
+      return;
140
+    }
141
+    val.isHot = val.isHot ? 1 : 0;
142
+    if (policyId) {
143
+      val.policyId = policyId;
144
+      request({ ...apis.system.updateTaPolicy, urlData: { id: policyId }, data: val })
145
+        .then(data => {
146
+          message.info('保存成功');
147
+          cancelPage();
148
+        })
149
+        .catch(err => {
150
+          message.info(err.msg || err.message);
151
+        });
152
+    } else {
153
+      request({ ...apis.system.addTaPolicy, data: val })
154
+        .then(data => {
155
+          message.info('保存成功');
156
+          cancelPage();
157
+        })
158
+        .catch(err => {
159
+          message.info(err.msg || err.message);
160
+        });
161
+    }
162
+  };
7 163
 
8
-export default props => {
9
-    const newsId = props.location.query.newsId
10 164
   return (
11 165
     <Card>
12
-      <Tabs defaultActiveKey="1">
13
-        <TabPane tab="基本信息" key="1">
14
-          {/* <div style={{ maxWidth: 1000 }}> */}
15
-            <Basic newsId={newsId} />
16
-          {/* </div> */}
17
-        </TabPane>
18
-      </Tabs>
166
+      <XForm onSubmit={handleSubmit} onCancel={cancelPage} fields={fields}></XForm>
19 167
     </Card>
20 168
   );
21 169
 };
170
+
171
+export default Edit;

+ 0
- 148
src/pages/system/Sellhouse/compents/Basic.jsx Parādīt failu

@@ -1,148 +0,0 @@
1
-import React, { useEffect, useState } from 'react';
2
-
3
-import { message} from 'antd';
4
-import apis from '@/services/apis';
5
-import router from 'umi/router';
6
-import XForm, { FieldTypes } from '@/components/XForm';
7
-import Wangedit from '@/components/Wangedit/Wangedit';
8
-import request from '@/utils/request';
9
-import searchFields from '@/pages/building/Developers/searchFields';
10
-import QueryTable from '@/components/QueryTable'
11
-import BuildSelect from '@/components/SelectButton/BuildSelectHouse';
12
-
13
-
14
-
15
-const Basic = props => {
16
-  const { newsId } = props;
17
-  const [dynamicData, setDynamicData] = useState({});
18
-  const [changeBuildingId, setChangeBuildingIdData] = useState('');
19
-  const [newsDetailType, setNewsDetailType] = useState(1);
20
-
21
-  useEffect(() => {
22
-    if (newsId) {
23
-      getDynamicData(newsId);
24
-    }
25
-  }, [newsId]);
26
-
27
-  // 查询详情
28
-  const getDynamicData = newsId => {
29
-    request({ ...apis.news.get, urlData: { id: newsId } })
30
-      .then(data => {
31
-        setDynamicData(data);
32
-        console.log(data, 'sss');
33
-        setNewsDetailType(Number(data.newsDetailType));
34
-      })
35
-      .catch(err => {
36
-        console.log(err);
37
-        message.info(err.msg || err.message);
38
-      });
39
-  };
40
-
41
-  const handleBuildingChange = e => {
42
-    console.log(e);
43
-    setChangeBuildingIdData(e);
44
-  };
45
-
46
-
47
-  const fields = [
48
-
49
-
50
-    // {
51
-    //   label: '城市',
52
-    //   name: 'building',
53
-    //   option:[
54
-    //     {label:'南京',value:'1'},
55
-    //     {label:'北京',value:'2'},
56
-    //   ]
57
-    // },
58
-    {
59
-      label: '意向项目',
60
-      name: 'buildingId',
61
-      render: <BuildSelect  />,
62
-      // onChange={e => handleBuildingChange(e)}
63
-      // value: dynamicData.buildingId,
64
-      rules: [{ required: true, message: '请选择所属项目' }],
65
-    },
66
-    {
67
-      label: '类型',
68
-      name: 'typesId',
69
-      value: dynamicData.buildingId,
70
-      option:[
71
-        {label:'买房准备',value:'1'},
72
-        {label:'看房选房',value:'2'},
73
-        {label:'认筹签约',value:'3'},
74
-      ]
75
-    },
76
-    {
77
-      label: '购房百科封面图',
78
-      name: 'newsImg',
79
-      type: FieldTypes.ImageUploader,
80
-      value: dynamicData.newsImg,
81
-      help: '建议尺寸:220px*176px,比例5:4,格式:jpg,用于:购房百科列表',
82
-      rules: [{ required: true, message: '请选择购房百科封面图' }],
83
-    },
84
-    {
85
-      label: '政策标题',
86
-      name: 'newsName',
87
-      type: FieldTypes.Text,
88
-      value: dynamicData.newsName,
89
-      rules: [{ required: true, message: '请输入政策标题' }],
90
-    },
91
-
92
-    {
93
-      label: '政策详情',
94
-      name: 'newsDetail',
95
-      render: <Wangedit />,
96
-      hidden: newsDetailType == 0,
97
-      value: dynamicData.newsDetail,
98
-      rules: [{ required: true, message: '请输入政策详情' }],
99
-    },
100
-      {
101
-      label: '状态',
102
-      name: 'newsTypeId',
103
-      option:[
104
-        {label:'已发布',value:'1'},
105
-        {label:'未发布',value:'2'},
106
-      ]
107
-    },
108
-  ];
109
-
110
-  // const handleSubmit = val => {
111
-  //   console.log(dynamicData, '12312345');
112
-  //   let { ...submitValue } = val;
113
-
114
-  //   if (newsId) {
115
-  //     submitValue.newsId = newsId;
116
-  //     request({ ...apis.news.put, urlData: { id: newsId }, data: { ...submitValue } })
117
-  //       .then(data => {
118
-  //         // cancelPage();
119
-  //         message.info('保存成功');
120
-  //         console.log(data, 'data1');
121
-  //       })
122
-  //       .catch(err => {
123
-  //         message.info(err.msg || err.message);
124
-  //       });
125
-  //   } else {
126
-  //     request({ ...apis.news.post, data: { ...submitValue } })
127
-  //       .then(data => {
128
-  //         // cancelPage();
129
-  //         message.info('保存成功');
130
-  //         router.go(-1);
131
-  //         console.log(data, 'data2');
132
-  //       })
133
-  //       .catch(err => {
134
-  //         message.info(err.msg || err.message);
135
-  //       });
136
-  //   }
137
-  // };
138
-
139
-  const cancelPage = () => {
140
-    router.go(-1);
141
-  };
142
-
143
-  return <XForm  onCancel={cancelPage} searchFields={searchFields} fields={fields}></XForm>;
144
-  // onSubmit={handleSubmit}
145
-  
146
-};
147
-
148
-export default Basic;

+ 100
- 20
src/pages/system/Sellhouse/houseTypes/Newindex.jsx Parādīt failu

@@ -8,30 +8,110 @@ import apis from '@/services/apis';
8 8
 
9 9
 const { TextArea } = Input;
10 10
 
11
-const Backcom=()=>{
12
-  window.history.back(-1)
13
-}
11
+const Backcom = () => {
12
+  router.go('-1');
13
+};
14 14
 const Poster = props => {
15
+  const { id } = props.location.query;
16
+  const [data,setData] = useState({})
17
+
18
+  const getData = () => {
19
+
20
+    request({
21
+      ...apis.system.getPolicyTypeDetail,
22
+      urlData: { id: id },
23
+    })
24
+      .then(data => {
25
+        setData(data)
26
+      })
27
+      .catch(err => {
28
+        message.info(err.msg || err.message);
29
+      });
30
+  };
31
+
32
+
33
+
34
+  useEffect(() => {
35
+    if (id) {
36
+      getData();
37
+    }
38
+  }, [id]);
39
+
40
+  const handleSubmit = val => {
41
+    props.form.validateFields((err, values) => {
42
+      if (!err) {
43
+        if (id) {
44
+          request({
45
+            ...apis.system.upDatePolicyType,
46
+            urlData: { id: id },
47
+            data: values,
48
+          })
49
+            .then(data => {
50
+              message.info('保存成功');
51
+              router.go('-1');
52
+            })
53
+            .catch(err => {
54
+              message.info(err.msg || err.message);
55
+            });
56
+        } else {
57
+          request({ ...apis.system.addPolicyType, data: { ...values } })
58
+            .then(data => {
59
+              // cancelPage();
60
+              message.info('保存成功');
61
+              router.go('-1');
62
+            })
63
+            .catch(err => {
64
+              message.info(err.msg || err.message);
65
+            });
66
+        }
67
+      }
68
+    });
69
+
70
+    // console.log(val, '------');
71
+
72
+    // let { ...submitValue } = val;
73
+
74
+    // if (id) {
75
+    //   request({ ...apis.news.put, urlData: { id: newsId }, data: { ...submitValue } })
76
+    //     .then(data => {
77
+    //       router.go('-1');
78
+    //       message.info('保存成功');
79
+    //     })
80
+    //     .catch(err => {
81
+    //       message.info(err.msg || err.message);
82
+    //     });
83
+    // } else {
84
+    //   request({ ...apis.system.addPolicyType, data: { ...submitValue } })
85
+    //     .then(data => {
86
+    //       // cancelPage();
87
+    //       message.info('保存成功');
88
+    //       router.go('-1');
89
+    //     })
90
+    //     .catch(err => {
91
+    //       message.info(err.msg || err.message);
92
+    //     });
93
+    // }
94
+  };
95
+
15 96
   const { getFieldDecorator } = props.form;
16
-  
97
+
17 98
   return (
18 99
     <Card>
19
-      <div>
20
-        <Form >
21
-          <Form.Item label="类型名称">
22
-            {getFieldDecorator('roleName', {})(<Input  style={{width:'500px'}} />)}
23
-
24
-          </Form.Item>
25
-            <Button  type="primary" htmlType="submit">
26
-              保存
27
-          </Button>
28
-            <Button style={{marginLeft:'20px'}} onClick={Backcom} >
29
-              取消
30
-          </Button>
31
-        </Form>
32
-      </div>
100
+      <Form onSubmit={handleSubmit}>
101
+        <Form.Item label="类型名称">
102
+          {getFieldDecorator('policyTypeName', {
103
+            initialValue:data.policyTypeName,
104
+          })(<Input style={{ width: '500px' }} />)}
105
+        </Form.Item>
106
+        <Button type="primary" htmlType="submit">
107
+          保存
108
+        </Button>
109
+        <Button style={{ marginLeft: '20px' }} onClick={Backcom}>
110
+          取消
111
+        </Button>
112
+      </Form>
33 113
     </Card>
34
-  )
35
-}
114
+  );
115
+};
36 116
 const WrappedNormalLoginForm = Form.create({ name: 'Poster' })(Poster);
37 117
 export default connect(({ user }) => ({ user }))(WrappedNormalLoginForm);

+ 57
- 39
src/pages/system/Sellhouse/houseTypes/index.jsx Parādīt failu

@@ -1,33 +1,40 @@
1
-
2
-import React, { useState, useEffect } from 'react';
1
+import React, { useRef, useState, useEffect } from 'react';
3 2
 import { Button, message, Table, Modal, Card } from 'antd';
4 3
 import withActions from '@/components/ActionList';
5 4
 import EditIcon from '@/components/EditIcon';
6 5
 import router from 'umi/router';
7
-import request from '@/utils/request'
6
+import request from '@/utils/request';
8 7
 import apis from '@/services/apis';
9 8
 import AuthButton from '@/components/AuthButton';
10
-
9
+import TableList from '@/components/TableList';
11 10
 
12 11
 const header = props => {
13
-  function addRole(roleId) {
12
+  const ref = useRef();
13
+
14
+
15
+  function addHouseTypes(id) {
16
+    console.log()
14 17
     router.push({
15 18
       pathname: '/system/Sellhouse/houseTypes/Newindex',
19
+      query: {id:id},
16 20
     });
17 21
   }
18
-  function stop(ids, status) {
22
+  function onDelete(ids, status) {
19 23
     Modal.confirm({
20
-      title: "确认要删除此条内容吗",
24
+      title: '确认要删除此条内容吗',
21 25
       okText: '确认',
22 26
       cancelText: '取消',
23 27
       onOk() {
24
-        request({ ...apis.role.stop, urlData: { id: ids } }).then((data) => {
25
-          getRoleList({ pageNum: 1, pageSize: 100 })
26
-        }).catch((err) => {
27
-          console.log(err)
28
-          message.info(err.msg || err.message)
29
-        })
30
-      }
28
+        request({ ...apis.system.deletePolicyType, urlData: { id: ids } })
29
+          .then(data => {
30
+            ref.current.reload();
31
+            message.info('操作成功');
32
+          })
33
+          .catch(err => {
34
+            console.log(err);
35
+            message.info(err?.msg || err?.message);
36
+          });
37
+      },
31 38
     });
32 39
   }
33 40
 
@@ -42,10 +49,9 @@ const header = props => {
42 49
     // },
43 50
     {
44 51
       title: '类型名称',
45
-      dataIndex: 'roleName',
46
-      key: 'roleName',
52
+      dataIndex: 'policyTypeName',
53
+      key: 'policyTypeName',
47 54
       align: 'center',
48
-
49 55
     },
50 56
 
51 57
     {
@@ -54,33 +60,45 @@ const header = props => {
54 60
       key: 'status',
55 61
       align: 'center',
56 62
 
57
-      render: withActions((text, record) => {
58
-        return record.isAdmin ? [] :
59
-          [
60
-            record.status === 1 ?
61
-            <AuthButton name="admin.role.publish" noRight={null}>
62
-              <EditIcon type="delete" text="删除" onClick={() => stop(record.roleId, record.status)} />
63
-            </AuthButton> : null,
63
+      render: withActions((text, record) => [
64
+     
65
+          <AuthButton name="admin.role.publish" noRight={null}>
66
+            <EditIcon type="delete" text="删除" onClick={() => onDelete(record.policyTypeId)} />
67
+          </AuthButton>
68
+       ,
64 69
 
65
-            <AuthButton name="admin.role.put" noRight={null}>
66
-              <EditIcon text="编辑" type="edit" onClick={() => toEditRole(record.roleId)} />
67
-            </AuthButton>,
68
-          ]
69
-      }),
70
+        <AuthButton name="admin.role.put" noRight={null}>
71
+          <EditIcon text="编辑" type="edit" onClick={() => addHouseTypes(record.policyTypeId)} />
72
+        </AuthButton>,
73
+      ]),
70 74
     },
71 75
   ];
76
+  //   <AuthButton name="admin.tdBuildingType.delete" noRight={null}>
77
+  //   <EditIcon text="删除" type="delete" onClick={() => deleteType(record)} />
78
+  // </AuthButton>,
79
+  // <AuthButton name="admin.tdBuildingType.update" noRight={null}>
80
+  //   <EditIcon text="编辑" type="edit" onClick={() => toEdi(record.buildingTypeId)} />
81
+  // </AuthButton>,
72 82
 
83
+  const actionRender = () => {
84
+    return (
85
+      <AuthButton name="admin.taPolicy.post" noRight={null}>
86
+        <Button type="primary" style={{ margin: '20px 0' }} onClick={()=>addHouseTypes()}>
87
+          新增
88
+        </Button>
89
+      </AuthButton>
90
+    );
91
+  };
73 92
 
74 93
   return (
75 94
     <Card>
76
-      <AuthButton name="admin.role.add" noRight={null}>
77
-        <Button type="primary"  onClick={addRole}>新增</Button>
78
-      </AuthButton>
79
-      <div style={{marginTop:'20px'}}>
80
-        <Table rowKey="roleList"  columns={columns} />
81
-      </div>
95
+      <TableList
96
+        ref={ref}
97
+        api={apis.system.getPolicyTypeList}
98
+        columns={columns}
99
+        actionRender={actionRender}
100
+      />
82 101
     </Card>
83
-
84
-  )
85
-}
86
-export default header
102
+  );
103
+};
104
+export default header;

+ 188
- 217
src/pages/system/Sellhouse/index.jsx Parādīt failu

@@ -1,259 +1,230 @@
1
-import React, { useMemo, useRef, useCallback, useState } from 'react';
2
-// import { PageHeaderWrapper } from '@ant-design/pro-layout'
3
-import { Button, notification, Spin, Modal, message } from 'antd';
4
-import { router } from 'umi';
5
-import QueryTable from '@/components/QueryTable';
6
-import request from '@/utils/request';
7
-import apis from '@/services/apis';
8
-import SelectCity from '@/components/SelectButton/CitySelect';
9
-import NewsTypeSelect from '../../../components/SelectButton/NewTypeSelect';
10
-import BuildSelect from '@/components/SelectButton/BuildSelect';
1
+import React, { useState, useEffect } from 'react';
2
+import { Form, Button, message, Card, Table, Pagination, Modal } from 'antd';
3
+
4
+import router from 'umi/router';
11 5
 import moment from 'moment';
12
-import OperButton from '@/components/OperButton';
13 6
 import AuthButton from '@/components/AuthButton';
14 7
 import withActions from '@/components/ActionList';
15
-import { number } from 'echarts/lib/export';
8
+import EditIcon from '@/components/EditIcon';
9
+import Navigate from '@/components/Navigate';
10
+import SelectCity from '@/components/SelectButton/CitySelect';
11
+import apis from '@/services/apis';
12
+import request from '@/utils/request';
13
+// import styles from '../style/GoodsList.less';
16 14
 
17
-export default props => {
18
-  const ref = useRef();
19
-  const [loading, setLoading] = useState(false);
20
-  const [page, setPage] = useState({ current: 1, pageSize: 10 });
21
-  const onPublish = useCallback(row => {
22
-    const buidingStatus = row.status === 1 ? 2 : 1;
23
-    request({ ...apis.building.updateStatus, data: { id: row.buildingId, status: buidingStatus } })
24
-      .then(() => {
25
-        notification.success({ message: '操作成功' });
26
-        setLoading(false);
27
-        ref.current.reload();
28
-      })
29
-      .catch(err => {
30
-        console.error(err);
31
-        setLoading(false);
32
-      });
33
-  }, []);
15
+const header = (props) => {
16
+  const [data, setData] = useState({})
34 17
 
35
-  // 跳转到新增/编辑购房百科列表
36
-  const toEditList = newsId => {
18
+  useEffect(() => {
19
+    getList({ pageNum: 1, pageSize: 10, cityId: '' });
20
+  }, [])
21
+
22
+  // 查询列表
23
+  const getList = (params) => {
24
+    request({ ...apis.system.getTaPolicy, params: { ...params,...props.form.getFieldsValue() }, }).then((data) => {
25
+      console.log(data)
26
+      setData(data)
27
+    })
28
+  }
29
+
30
+  // 跳转到编辑商品
31
+  const toEditPolicy = (policyId) => () => {
37 32
     router.push({
38 33
       pathname: '/system/Sellhouse/Edit',
39 34
       query: {
40
-        newsId,
35
+        policyId
41 36
       },
42 37
     });
43
-  };
44
-
45
-  const onDelete = useCallback(row => {
46
-    setLoading(true);
47
-    request({ ...apis.building.deleteBuilding, urlData: { id: row.buildingId } })
48
-      .then(() => {
49
-        notification.success({ message: '操作成功' });
50
-        setLoading(false);
51
-        ref.current.reload();
52
-      })
53
-      .catch(err => {
54
-        console.error(err);
55
-        setLoading(false);
56
-      });
57
-  }, []);
58
-
59
-  //   置顶
60
-  const topNews = (weightParam, newsId) => {
61
-    const weight = Math.abs(weightParam - 1);
62
-    request({ ...apis.news.weight, params: { newsId: newsId, weight } })
63
-      .then(data => {
64
-        console.log(data);
65
-        message.info('操作成功!');
66
-        ref.current.reload();
67
-      })
68
-      .catch(err => {
69
-        console.log(err);
70
-        message.info(err.msg || err.message);
71
-      });
72
-  };
73
-
74
-  //发布
75
-  function cancelRelease(newsId, newsStatus, buildingId, newsTypeId) {
76
-    console.log('newsId' + newsId + 'status' + newsStatus);
77
-    if (newsStatus === 1) {
78
-      Modal.confirm({
79
-        title: '确认发布',
80
-        okText: '确认',
81
-        cancelText: '取消',
82
-        onOk() {
83
-          request({
84
-            ...apis.news.cancel,
85
-            data: { newsStatus: newsStatus, buildingId: buildingId, newsTypeId: newsTypeId },
86
-            urlData: { id: newsId },
87
-          })
88
-            .then(data => {
89
-              message.info('操作成功!');
90
-              ref.current.reload();
91
-            })
92
-            .catch(err => {
93
-              console.log(err);
94
-              message.info(err.msg || err.message);
95
-            });
96
-        },
97
-        onCancel() {
98
-          console.log('Cancel');
99
-        },
100
-      });
101
-    } else if (newsStatus === 0) {
102
-      Modal.confirm({
103
-        title: '确认发布该资讯?',
104
-        okText: '确认',
105
-        cancelText: '取消',
106
-        onOk() {
107
-          request({
108
-            ...apis.news.cancel,
109
-            data: { newsStatus: newsStatus, buildingId: buildingId, newsTypeId: newsTypeId },
110
-            urlData: { id: newsId },
111
-          })
112
-            .then(data => {
113
-              message.info('操作成功!');
114
-              ref.current.reload();
115
-            })
116
-            .catch(err => {
117
-              console.log(err);
118
-              message.info(err.msg || err.message);
119
-            });
120
-        },
121
-        onCancel() {
122
-          console.log('Cancel');
123
-        },
124
-      });
125
-    }
126 38
   }
127 39
 
128
-  const searchFields = [
40
+  /**
41
+   *
42
+   *
43
+   * @param {*} props
44
+   * @returns
45
+   */
46
+  const columns = [
129 47
     {
130
-      name:'cityId',
131
-      label:'城市',
132
-      placeholder:'请选择城市',
133
-      type:'select',
134
-      // defaultValue:1,
135
-      options:[
136
-      {label:'南京',value:'1'},
137
-      {label:'北京',value:'2'},
138
-      {label:'上海',value:'3'},
139
-      ]
140
-
48
+      title: '购房须知主图',
49
+      dataIndex: 'policyImg',
50
+      key: 'policyImg',
51
+      align: 'center',
52
+      render: (policyImg,row) =><Navigate onClick={toEditPolicy(row.policyId)} ><img src={policyImg} width={93}/></Navigate> ,
141 53
     },
142
-    // {
143
-    //   name: 'cityId',
144
-    //   label: '城市',
145
-    //   placeholder: '请选择城市',
146
-    //   render: () => <SelectCity style={{ width: 160 }} />,
147
-    // },
148
-  ];
149
-
150
-  const tableColumns = [
151 54
     {
152
-      title: '购房政策主图',
153
-      key: 'houseImg',
154
-      //newsImg
155
-      dataIndex: 'houseImg',
55
+      title: '标题',
56
+      dataIndex: 'title',
57
+      key: 'title',
156 58
       align: 'center',
157
-      // render: t => <img src={t} width={128} height={72} style={{ borderRadius: '4px' }} alt="" />,
59
+      render: (text, record) => <Navigate to={`/system/Sellhouse/Edit?policyId=${record.policyId}`}>{text}</Navigate>
158 60
     },
159 61
     {
160
-      title: '标题',
161
-      key: 'huoseName',
162
-      dataIndex: 'huoseName',
62
+      title: '副标题',
63
+      dataIndex: 'subtitle',
64
+      key: 'subtitle',
163 65
       align: 'center',
164
-      with: 300,
165
-      // ellipsis: true,
166
-      // render:(_,record)=><span>{record.houseName='高奢生活,在遇到它之前你想象不到'}</span>
167 66
     },
168 67
     {
169 68
       title: '城市',
170
-      key: 'houseType',
171
-      dataIndex: 'houseType',
69
+      dataIndex: 'cityName',
70
+      key: 'cityName',
71
+      align: 'center',
72
+    },
73
+    {
74
+      title: '类型',
75
+      dataIndex: 'policyTypeName',
76
+      key: 'policyTypeName',
172 77
       align: 'center',
173
-      // render: t => t.newsTypeName,
174
-      // render:(_,record)=><span>{record.houseType='南京'}</span>
175
-
176 78
     },
177 79
     {
178 80
       title: '创建时间',
179 81
       dataIndex: 'createDate',
180 82
       key: 'createDate',
181 83
       align: 'center',
182
-      render: t => moment(t).format('YYYY-MM-DD HH:mm'),
84
+      render: (createDate) => <><span>{moment(createDate).format('YYYY-MM-DD')}</span></>
85
+    },
86
+    {
87
+      title: '热点',
88
+      dataIndex: 'isHot',
89
+      key: 'isHot',
90
+      align: 'center',
91
+      render: (x) => <><span>{x === 1 ? '是' : '否'}</span></>
183 92
     },
184 93
     {
185 94
       title: '状态',
186
-      dataIndex: 'newsStatus',
187
-      key: 'newsStatus',
95
+      dataIndex: 'publishStatus',
96
+      key: 'publishStatus',
188 97
       align: 'center',
189
-      render: t => (t == 0 ? '已发布' : '未发布'),
98
+      render: (publishStatus) => <><span>{publishStatus === 1 ? '已发布' : '未发布'}</span></>
190 99
     },
191
-
100
+    
192 101
     {
193 102
       title: '操作',
194
-      key: 'options',
103
+      dataIndex: 'handle',
104
+      key: 'handle',
195 105
       align: 'center',
196
-      render: withActions(
197
-        (_, row) => [
198
-          <AuthButton name="admin.taNews.publish" noRight={null}>
199
-            <OperButton
200
-              onClick={() =>
201
-                cancelRelease(
202
-                  row.newsId,
203
-                  row.newsStatus === 0 ? 1 : 0,
204
-                  row.buildingId,
205
-                  row.newsType.newsTypeId,
206
-                )
207
-              }
208
-            >
209
-              {row.newsStatus === 0 ? '取消发布' : '发布'}
210
-            </OperButton>
211
-          </AuthButton>,
212
-          //   <AuthButton name="admin.taNews.top" noRight={null}>
213
-          //   <span style={{ position: 'absolute', right: '83px', top: '16px', fontSize: ' 0.106rem', zIndex: 1, color: '#FF7E48', cursor: 'pointer' }} onClick={topNews(data.weight, data.newsId)}>{data.weight === 1 ? '取消置顶' : '置顶'}</span>
214
-          // </AuthButton>
215
-          row.newsStatus === 0 && (
216
-            <AuthButton name="admin.taNews.top" noRight={null}>
217
-              <OperButton onClick={() => topNews(row.weight, row.newsId)}>
218
-                {row.weight === 1 ? '取消置顶' : '置顶'}
219
-              </OperButton>
220
-            </AuthButton>
221
-          ),
222
-
223
-          <AuthButton name="admin.taNews.id.put" noRight={null}>
224
-            <OperButton onClick={() => toEditList(row.newsId)}>编辑</OperButton>
225
-          </AuthButton>,
106
+      render: withActions((x, row) => [
107
+        <AuthButton name="admin.taPolicy.publish" noRight={null}>
108
+          <EditIcon type={row.publishStatus === 0 ? 'publish' : 'cancel'} text={row.publishStatus === 0 ? '发布' : '取消发布'} onClick={publicOrNoPublic(row)}></EditIcon>
109
+        </AuthButton>,
110
+        
111
+        <AuthButton name="admin.taPolicy.top" noRight={null}>
112
+          <EditIcon type={row.weight === 1 ? 'cancel' : 'top'} text={row.weight === 1 ? '取消置顶' : '置顶'} onClick={topPolicy(row)}></EditIcon>
113
+        </AuthButton>,
114
+        
115
+        <AuthButton name="admin.taPolicy.id.put" noRight={null}>
116
+          <EditIcon type="edit" text="编辑" onClick={toEditPolicy(row.policyId)}></EditIcon>
117
+        </AuthButton>,
226 118
 
227
-          <AuthButton name="admin.taNews.id.delete" noRight={null}>
228
-            <OperButton.Confirm
229
-              title="确认删除?"
230
-              content="删除之后不可恢复"
231
-              onClick={() => onDelete(row)}
232
-            >
233
-              删除
234
-            </OperButton.Confirm>
235
-          </AuthButton>,
236
-        ],
237
-        { noMargin: true },
238
-      ),
119
+        <AuthButton name="admin.taPolicy.id.delete" noRight={null}>
120
+          <EditIcon type="delete" text="删除" onClick={deletePolicy(row.policyId)}></EditIcon>
121
+        </AuthButton>,
122
+      ])
239 123
     },
240 124
   ];
241
-  const actionRender = () => {
242
-    return (
243
-      <Button type="primary" icon="plus" onClick={() => toEditList()}>
244
-        新增
245
-      </Button>
246
-    );
247
-  };
248 125
 
126
+  // 删除
127
+  const deletePolicy = (policyId) => () => {
128
+    Modal.confirm({
129
+      title: '购房政策会被删除,小程序端和后台都无法再看到',
130
+      okText: '确定',
131
+      cancelText: '取消',
132
+      onOk() {
133
+        request({ ...apis.system.deleteTaPolicy, urlData: { id: policyId }, }).then((data) => {
134
+          message.info('操作成功!')
135
+          getList({ pageNum: 1, pageSize: 10, cityId: '' });
136
+        }).catch((err) => {
137
+          console.log(err)
138
+          message.info(err.msg || err.message)
139
+        })
140
+      },
141
+    });
142
+  }
143
+
144
+
145
+  //   置顶
146
+  const topPolicy = (row) => () => {
147
+    const weight = Math.abs(row.weight - 1)
148
+    row.weight = weight
149
+    request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
150
+      console.log(data)
151
+      message.info('操作成功!')
152
+      getList({ pageNum: 1, pageSize: 10, cityId: '' });
153
+    }).catch((err) => {
154
+      console.log(err)
155
+      message.info(err.msg || err.message)
156
+    })
157
+  }
158
+
159
+  const publicOrNoPublic = (row) => () => {
160
+    if (row.publishStatus === 1) {
161
+      row.publishStatus = 0
162
+    } else {
163
+      row.publishStatus = 1
164
+    }
165
+    const title = row.publishStatus === 0 ? '购房政策会在小程序端隐藏,后台可继续编辑重新发布' : '确认发布此数据'
166
+    Modal.confirm({
167
+      title: title,
168
+      okText: '确定',
169
+      cancelText: '取消',
170
+      onOk() {
171
+        request({ ...apis.system.updateTaPolicy, urlData: { id: row.policyId }, data: row, }).then((data) => {
172
+          console.log(data)
173
+          message.info('操作成功!')
174
+          getList({ pageNum: 1, pageSize: 10, cityId: '' });
175
+        }).catch((err) => {
176
+          console.log(err)
177
+          message.info(err.msg || err.message)
178
+        })
179
+      },
180
+    });
181
+
182
+
183
+  }
184
+
185
+  const changePageNum = (pageNumber) => {
186
+    getList({ pageNum: pageNumber, pageSize: 10, ...props.form.getFieldsValue() })
187
+  }
188
+
189
+  // 提交事件
190
+  const handleSubmit = (e, props) => {
191
+    e.preventDefault();
192
+    props.form.validateFields((err, values) => {
193
+      if (!err) {
194
+        console.log('提交数据: ', values)
195
+        getList({ pageNum: 1, pageSize: 10, ...values })
196
+      }
197
+    });
198
+  }
199
+
200
+  const { getFieldDecorator } = props.form
249 201
   return (
250
-    <QueryTable
251
-      ref={ref}
252
-      rowKey="newsId"
253
-      api={apis.news.getList}
254
-      searchFields={searchFields}
255
-      columns={tableColumns}
256
-      actionRender={actionRender}
257
-    />
258
-  );
259
-};
202
+
203
+    <Card>
204
+      <Form layout="inline" onSubmit={e => handleSubmit(e, props)}>
205
+        <Form.Item>
206
+          {getFieldDecorator('cityId')(
207
+            <SelectCity allowClear/>,
208
+          )}
209
+        </Form.Item>
210
+        <Form.Item>
211
+          <AuthButton name="admin.taPolicy.search" noRight={null}>
212
+            <Button type="primary" htmlType="submit" >
213
+              搜索
214
+          </Button>
215
+          </AuthButton>
216
+        </Form.Item>
217
+      </Form>
218
+      <AuthButton name="admin.taPolicy.post" noRight={null}>
219
+        <Button type="primary" style={{margin:'20px 0'}} onClick={toEditPolicy()}>新增</Button>
220
+      </AuthButton>
221
+      <Table rowKey="housingPolicy" dataSource={data.records} columns={columns} pagination={false} />
222
+      <div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '30px' }}>
223
+        <Pagination showQuickJumper defaultCurrent={1} total={data.total} onChange={changePageNum} current={data.current} />
224
+      </div>
225
+    </Card>
226
+  )
227
+}
228
+const WrappedHeader = Form.create({ name: 'header' })(header);
229
+
230
+export default WrappedHeader

+ 35
- 0
src/services/apis.js Parādīt failu

@@ -910,6 +910,41 @@ export default {
910 910
       method: 'DELETE',
911 911
       action: 'admin.taPolicy.id.delete',
912 912
     },
913
+  
914
+    getPolicyTypeList:{
915
+      url: `${prefix}/taPolicyType`,
916
+      method: 'GET',
917
+      action: 'admin.taPolicyType.get',
918
+    },
919
+    addPolicyType:{
920
+      url: `${prefix}/taPolicyType`,
921
+      method: 'Post',
922
+      action: 'admin.taPolicyType.Post',
923
+    },
924
+
925
+    getPolicyTypeDetail:{
926
+      url: `${prefix}/taPolicyType/:id`,
927
+      method: 'GET',
928
+      action: 'admin.taPolicyType.id.get',
929
+    },
930
+
931
+    upDatePolicyType:{
932
+      url: `${prefix}/taPolicyType/:id`,
933
+      method: 'PUT',
934
+      action: 'admin.taPolicyType.id.put',
935
+    },
936
+    deletePolicyType:{
937
+      url: `${prefix}/taPolicyType/:id`,
938
+      method: 'DELETE',
939
+      action: 'admin.taPolicyType.id.delete',
940
+    },
941
+ 
942
+    // getPolicyTypeList:{
943
+    //   url: `${prefix}/taPolicyType`,
944
+    //   method: 'GET',
945
+    //   action: 'admin.taPolicyType.get',
946
+    // },
947
+    // GET /api/taPolicyType
913 948
     tdBizEventIntention: {
914 949
       url: `${prefix}/tdBizEventIntention`,
915 950
       method: 'GET',