소스 검색

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

魏超 5 년 전
부모
커밋
98de4c4a7f

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

@@ -52,10 +52,8 @@ function AddBuilding(props) {
52 52
 
53 53
    // 获取详情信息
54 54
    function getById(currentId) {
55
-    const { url, method } = apis.building.buildingGetById
56
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
57 55
 
58
-    request({ url: tempUrl, method }).then(res => {
56
+    request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
59 57
       res.openingDate = moment(res.openingDate)
60 58
       res.receivedDate = moment(res.receivedDate)
61 59
       res.avatarImage = res.buildingImg.map(item => item.url)

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

@@ -51,10 +51,7 @@ function imageSet(props) {
51 51
 
52 52
   function getList(params) {
53 53
     // 网路请求
54
-    const { url, method } = apis.building.buildingApartment
55
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(props.building.buildingId)
56
-
57
-    request({ url: tempUrl, method, params: { ...params } }).then(res => {
54
+    request({ ...apis.building.buildingApartment, urlData: { id: props.building.buildingId }, params: { ...params } }).then(res => {
58 55
       setData(res)
59 56
     }).catch(err => {
60 57
       openNotificationWithIcon('error', err.message)
@@ -86,10 +83,7 @@ function imageSet(props) {
86 83
    */
87 84
   function deleteApartment(record) {
88 85
     // 网路请求
89
-    const { url, method } = apis.building.buildingApartmentDelete
90
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(record.apartmentId)
91
-
92
-    request({ url: tempUrl, method }).then(res => {
86
+    request({ ...apis.building.buildingApartmentDelete, urlData: { id: record.apartmentId } }).then(res => {
93 87
       getList()
94 88
       openNotificationWithIcon('error', '操作成功')
95 89
     }).catch(err => {

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

@@ -87,10 +87,7 @@ class ModalImage extends React.Component {
87 87
     }
88 88
 
89 89
     // 网路请求
90
-    const { url, method } = apis.building.buildingApartmentGetById
91
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(apartmentId)
92
-
93
-    request({ url: tempUrl, method, params: { ...params } }).then(res => {
90
+    request({ ...apis.building.buildingApartmentGetById, urlData: { id: apartmentId }, params: { ...params } }).then(res => {
94 91
       // res.img = res.buildingImgList.map((item, _) => item.url)
95 92
       res.img = res.buildingImgList.map(item => item.url)
96 93
       this.props.form.setFieldsValue(res)

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

@@ -51,10 +51,8 @@ const Poster = props => {
51 51
 
52 52
   // 获取详情信息
53 53
   function getById(currentId) {
54
-    const { url, method } = apis.building.buildingGetById
55
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
56
-
57
-    request({ url: tempUrl, method }).then(res => {
54
+ 
55
+    request({ ...apis.building.buildingGetById, urlData: { id: currentId } }).then(res => {
58 56
       setBuilding(res)
59 57
     })
60 58
   }

+ 1
- 5
src/pages/building/list/index.jsx 파일 보기

@@ -77,16 +77,13 @@ function CartBody(props) {
77 77
    * @param {*} record
78 78
    */
79 79
   function deleteBuilding(record) {
80
-    const { url, method } = apis.building.deleteBuilding
81
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(record.buildingId)
82
-
83 80
     const modal = Modal.confirm();
84 81
     modal.update({
85 82
       content: '确定删除此楼盘?',
86 83
       okText: '确认',
87 84
       cancelText: '关闭',
88 85
       onOk: () => {
89
-        request({ url: tempUrl, method }).then(() => {
86
+        request({ ...apis.building.deleteBuilding, urlData: { id: record.buildingId } }).then(() => {
90 87
           openNotificationWithIcon('success', '操作成功')
91 88
           props.onSuccess()
92 89
         }).catch(err => {
@@ -245,7 +242,6 @@ function body(props) {
245 242
           {getFieldDecorator('name')(
246 243
             <Input
247 244
               prefix={<Icon type="text" style={{ color: 'rgba(0,0,0,.25)' }} />}
248
-              type="password"
249 245
               placeholder="楼盘名称"
250 246
             />,
251 247
           )}

+ 1
- 4
src/pages/building/type/edi.jsx 파일 보기

@@ -31,10 +31,7 @@ function body(props) {
31 31
 
32 32
   // 获取详情信息
33 33
   function getById(currentId) {
34
-    const { url, method } = apis.buildingType.getById
35
-    const tempUrl = url.substring(0, url.lastIndexOf('id')).concat(currentId)
36
-
37
-    request({ url: tempUrl, method }).then(res => {
34
+    request({ ...apis.buildingType.getById, urlData: { id: currentId } }).then(res => {
38 35
       data = res
39 36
       props.form.setFieldsValue(res)
40 37
     })

+ 6
- 1
src/pages/customer/independentList/index.jsx 파일 보기

@@ -333,7 +333,12 @@ function body(props) {
333 333
   }
334 334
 
335 335
   function exportIndependen() {
336
+    request({ ...apis.customer.customerRecommendAgentsExport, responseType: 'blob' })
337
+    .then(response => {
338
+      download(response)
339
+    }).catch(error => {
336 340
 
341
+    })
337 342
   }
338 343
 
339 344
   function download(data) {
@@ -432,7 +437,7 @@ function body(props) {
432 437
             </Button>
433 438
         </Form.Item>
434 439
       </Form>
435
-      <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
440
+      <Button type="primary" onClick={() => exportIndependen()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
436 441
         导出数据
437 442
       </Button>
438 443
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

+ 2
- 2
src/pages/customer/recommendCustomer/index.jsx 파일 보기

@@ -86,7 +86,7 @@ function body(props) {
86 86
       ...apis.customer.customerRecommendRecommenderExport, 
87 87
       responseType: 'blob',
88 88
     }).then(response => {
89
-      // console.log('response: ', response)
89
+      console.log('exportRecommendCustomer: ', response)
90 90
       download(response)
91 91
     }).catch(error => {
92 92
 
@@ -213,7 +213,7 @@ function body(props) {
213 213
             </Button>
214 214
         </Form.Item>
215 215
       </Form>
216
-      <Button type="primary" onClick={() => exportRecommendCustomer()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
216
+      <Button type="primary" onClick={() => exportRecommendCustomer()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px' }}>
217 217
         导出数据
218 218
       </Button>
219 219
       <Table dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

+ 5
- 2
src/pages/customer/report/index.jsx 파일 보기

@@ -71,7 +71,10 @@ function body(props) {
71 71
   }
72 72
 
73 73
   function exportReport() {
74
-
74
+    request({ ...apis.customer.customerRecommendReportExport, responseType: 'blob' })
75
+    .then(response => {
76
+      download(response)
77
+    })
75 78
   }
76 79
 
77 80
   function download(data) {
@@ -176,7 +179,7 @@ function body(props) {
176 179
             </Button>
177 180
         </Form.Item>
178 181
       </Form>
179
-      <Button type="primary" onClick={() => exportReport()} className={Styles.SubmitButton} style={{ marginTop: '5px', marginBottom: '5px', display: 'none' }}>
182
+      <Button type="primary" onClick={() => exportReport()} className={Styles.SubmitButton} style={{ marginTop: '5px' }}>
180 183
         导出数据
181 184
       </Button>
182 185
       <Table style={{marginTop:'40px'}} dataSource={dataSource.records} columns={columns} pagination={{ total: dataSource.total, onChange }} />

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

@@ -24,10 +24,16 @@ const UserBehavior = (props) => {
24 24
   //柱图
25 25
 
26 26
   useEffect(() => {
27
-    getUserBehaviorSummary(formatDate(props.startDate, props.endDate))
27
+    const date = formatDate(props.startDate, props.endDate)
28
+    getUserBehaviorSummary({
29
+      ...date,
30
+      activity: props.activity,
31
+      event: props.event,
32
+      eventType: props.eventType
33
+    })
28 34
     getUserBehaviorProfile(formatDate(props.startDate, props.endDate))
29 35
 
30
-  }, [props.startDate, props.endDate])
36
+  }, [props.startDate, props.endDate, props.activity, props.event, props.eventType])
31 37
 
32 38
   function getUserBehaviorSummary(params) {
33 39
 

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

@@ -42,7 +42,10 @@ const UserSource = (props) => {
42 42
     },
43 43
     legend: {},
44 44
     color: ['#FF7E48', '#dcdcdc'],
45
-    tooltip: {},
45
+    tooltip: {
46
+      trigger: 'item',
47
+      formatter: "{b}: ({d}%)"
48
+    },
46 49
     series: {
47 50
       type: 'pie',
48 51
       name: '性别比例',

+ 20
- 17
src/pages/indexEcharts/components/UserSourcepie.jsx 파일 보기

@@ -19,18 +19,18 @@ const UserSource = (props) => {
19 19
 
20 20
   useEffect(() => {
21 21
     userResource(formatDate(props.startDate, props.endDate))
22
-   }, [props.startDate, props.endDate])
23
- 
24
-   function userResource (params) {
25
-     request({
26
-       ...apis.indexEcharts.userResource,
27
-       params,
28
-     }).then((data) => {
29
-       setData(data)
30
-     })
31
-   }
32
-
33
-  function toEdit () {
22
+  }, [props.startDate, props.endDate])
23
+
24
+  function userResource(params) {
25
+    request({
26
+      ...apis.indexEcharts.userResource,
27
+      params,
28
+    }).then((data) => {
29
+      setData(data)
30
+    })
31
+  }
32
+
33
+  function toEdit() {
34 34
     router.push({
35 35
       pathname: '/indexEcharts/userSource',
36 36
     });
@@ -47,7 +47,10 @@ const UserSource = (props) => {
47 47
       x: 'left',
48 48
       data: ['来源置业顾问', '来源全民经纪人', '自主进入'],
49 49
     },
50
-    tooltip: {},
50
+    tooltip: {
51
+      // trigger: 'item',
52
+      // formatter: "{a} <br/>{b} : {c} ({d}%)"
53
+    },
51 54
     series: [
52 55
       {
53 56
         type: 'pie',
@@ -55,24 +58,24 @@ const UserSource = (props) => {
55 58
         radius: ['34%', '52%'],
56 59
       },
57 60
     ],
61
+
58 62
     dataset: {
59 63
       id: 'pie',
60 64
       source: [
61
-        { '用户来源': '来源置业顾问', value: person_realty_consultant,},
65
+        { '用户来源': '来源置业顾问', value: person_realty_consultant, },
62 66
         { '用户来源': '来源全民经纪人', value: person_estate_agent },
63 67
         { '用户来源': '自主进入', value: person_null },
64 68
       ]
65 69
     },
66 70
   }
67
- 
71
+
68 72
 
69 73
   const piestyles = {
70 74
     width: '100%',
71 75
     height: '400px',
72
-    minWidth:'350px',
76
+    minWidth: '350px',
73 77
   }
74 78
 
75
-
76 79
   return (
77 80
     <>
78 81
       <div>

+ 88
- 41
src/pages/indexEcharts/userBehavior.jsx 파일 보기

@@ -13,6 +13,7 @@ import BuildSelect from '../../components/SelectButton/BuildSelect'
13 13
 //   const endDate = moment(end).format('YYYY-MM-DDT23:59:59.999') + 'Z'
14 14
 //   return { startDate, endDate }
15 15
 // }
16
+const { Option } = Select;
16 17
 
17 18
 const header = props => {
18 19
 
@@ -26,8 +27,42 @@ const header = props => {
26 27
 
27 28
     setEndDate(new Date())
28 29
     setStartDate(moment().subtract(7, 'day').toDate())
30
+    getBizEventType()
31
+    getBizEventList()
32
+    getProperties()
29 33
 
30 34
   }, [])
35
+  const [eventypes, setEventTypes] = useState([])
36
+  function getBizEventType(row) {
37
+
38
+    request({
39
+      ...apis.indexEcharts.bizEvent.dict,
40
+    }).then((data) => {
41
+      setEventTypes(data.records)
42
+
43
+    })
44
+  }
45
+  const [eventList, setEventList] = useState([])
46
+  function getBizEventList(row) {
47
+
48
+    request({
49
+      ...apis.indexEcharts.bizEvent.list,
50
+    }).then((data) => {
51
+      setEventList(data.records)
52
+      
53
+    })
54
+  }
55
+  const [properties, setProperties] = useState([])
56
+  function getProperties(row) {
57
+
58
+    request({
59
+      ...apis.indexEcharts.bizEvent.properties,
60
+    }).then((data) => {
61
+
62
+      setProperties(data.records)
63
+
64
+    })
65
+  }
31 66
 
32 67
   const { RangePicker } = DatePicker;
33 68
 
@@ -42,10 +77,8 @@ const header = props => {
42 77
 
43 78
     setEndDate(new Date())
44 79
     setStartDate(moment().subtract(days, 'day').toDate())
45
-
46 80
   }
47 81
 
48
-
49 82
   function datalist() {
50 83
 
51 84
     setEndDate(daterange[1])
@@ -58,8 +91,20 @@ const header = props => {
58 91
 
59 92
     console.log('行为回调数据:', e)
60 93
   }
61
-  function handleChange(value) {
62
-    console.log(`selected ${value}`);
94
+  const [eventType, setEventType] = useState('')
95
+  function handleChangeType(value) {
96
+    console.log(value,"1111111111111");
97
+    setEventType(value)
98
+  }
99
+  const [event, setEvent] = useState('')
100
+  function handleChangeEvent(value) {
101
+    console.log(value,"222222222222");
102
+    setEvent(value)
103
+  }
104
+  const [activity, setActivity] = useState('')
105
+  function handleChangeProperty(value) {
106
+    console.log(value,"33333333333333");
107
+    setActivity(value)
63 108
   }
64 109
 
65 110
   const columns = [
@@ -105,47 +150,49 @@ const header = props => {
105 150
       borderRadius: '12px',
106 151
       minHeight: '60vh'
107 152
     }}>
108
-    <div>
109
-    <Radio.Group buttonStyle="solid" defaultValue="a">
110
-        <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
111
-        <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
112
-      </Radio.Group>
113
-      <RangePicker
114
-        style={{ paddingLeft: '30px' }}
115
-        ranges={{
116
-          Today: [moment(), moment()],
117
-          'This Month': [moment().startOf('month'), moment().endOf('month')],
118
-        }}
119
-        showTime
120
-        onChange={onChangetime}
121
-      />
122
-      <Button type="primary" htmlType="submit" style={{ marginLeft: '30px',float:'right' }} onClick={datalist}>
123
-        搜索
153
+      <div>
154
+        <Radio.Group buttonStyle="solid" defaultValue="a">
155
+          <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
156
+          <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
157
+        </Radio.Group>
158
+        <RangePicker
159
+          style={{ paddingLeft: '30px' }}
160
+          ranges={{
161
+            Today: [moment(), moment()],
162
+            'This Month': [moment().startOf('month'), moment().endOf('month')],
163
+          }}
164
+          showTime
165
+          onChange={onChangetime}
166
+        />
167
+        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
168
+          搜索
124 169
       </Button>
125
-    </div>
126
-     
170
+      </div>
171
+
127 172
       <div style={{ display: 'flex', margin: '24px 0' }}>
128
-      <BuildSelect slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
129
-        <Select placeholder="所有事件组" style={{ width: '14%',minWidth:'160px',marginLeft:'2%' }} onChange={handleChange}>
130
-          <Option value="jack">Jack</Option>
131
-          <Option value="lucy">Lucy</Option>
132
-          <Option value="Yiminghe">yiminghe</Option>
133
-        </Select>
134
-        <Select placeholder="请选择事件" style={{ width: '14%',minWidth:'160px',marginLeft:'2%' }} onChange={handleChange}>
135
-          <Option value="jack">Jack</Option>
136
-          <Option value="lucy">Lucy</Option>
137
-          <Option value="Yiminghe">yiminghe</Option>
138
-        </Select>
139
-        <Select placeholder="请选择属性" style={{ width: '14%',minWidth:'160px',marginLeft:'2%' }} onChange={handleChange}>
140
-          <Option value="jack">Jack</Option>
141
-          <Option value="lucy">Lucy</Option>
142
-          <Option value="Yiminghe">yiminghe</Option>
143
-        </Select>
173
+        <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
174
+       
175
+        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
176
+          {eventypes.map(type => (
177
+            <Option key={type.typeId}>{type.typeName}</Option>
178
+          ))}
179
+      </Select>
180
+        <Select  style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
181
+          {eventList.map(event => (
182
+            <Option key={event.eventId}>{event.eventName}</Option>
183
+          ))}
184
+      </Select>
185
+        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
186
+          {properties.map(property => (
187
+            <Option key={property.propertyId}>{property.propertyName}</Option>
188
+          ))}
189
+      </Select>
190
+     
144 191
       </div>
145
-      
146
-      
192
+
193
+
147 194
       <div style={{ margin: '24px 0' }}>
148
-        <UserBehavior BuildSelectHide={true} endDate={endDate} startDate={startDate} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
195
+        <UserBehavior BuildSelectHide={true} endDate={endDate} startDate={startDate}  eventType={eventType} activity={activity}  event={event} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
149 196
       </div>
150 197
 
151 198
       <Table dataSource={dataSource} columns={columns} pagination={false} scroll={{ y: 500 }} />

+ 136
- 123
src/pages/indexEcharts/userSource.jsx 파일 보기

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

+ 2
- 1
src/pages/staff/list/addRole.jsx 파일 보기

@@ -29,7 +29,7 @@ const Poster = props => {
29 29
   const [dataMenuId, setDataMenuId] = useState([])
30 30
   const [dataButtonId, setDataButtonId] = useState([])
31 31
 
32
-  const [loading, setLoading] = useState(true);
32
+  const [loading, setLoading] = useState(false);
33 33
 
34 34
   useEffect(() => {
35 35
     // 新增和编辑用一个页面
@@ -64,6 +64,7 @@ const Poster = props => {
64 64
 
65 65
   // 根据角色id查询当前的菜单及其按钮
66 66
   function buttonAndMenuList(params, ids) {
67
+    setLoading(true)
67 68
     request({ ...apis.role.buttonAndMenuList, urlData: { id: ids }, params: { ...params } }).then(data => {
68 69
       setLoading(false)
69 70
       props.form.setFieldsValue({ roleName: data.roleName })

+ 36
- 9
src/services/apis.js 파일 보기

@@ -55,22 +55,22 @@ export default {
55 55
     },
56 56
     buildingGetById: {
57 57
       method: 'GET',
58
-      url: `${prefix}/buildingSelectId/id`,
58
+      url: `${prefix}/buildingSelectId/:id`,
59 59
       action: 'admin.buildingSelectId.id.get',
60 60
     },
61 61
     deleteBuilding: {
62 62
       method: 'DELETE',
63
-      url: `${prefix}/building/delete/id`,
63
+      url: `${prefix}/building/delete/:id`,
64 64
       action: 'admin.building.delete.id.delete',
65 65
     },
66 66
     buildingApartment: {
67 67
       method: 'GET',
68
-      url: `${prefix}/buildingApartment/buildingId/id`,
68
+      url: `${prefix}/buildingApartment/buildingId/:id`,
69 69
       action: 'admin.buildingApartment.buildingId.id.get',
70 70
     },
71 71
     buildingApartmentGetById: {
72 72
       method: 'GET',
73
-      url: `${prefix}/buildingApartment/id`,
73
+      url: `${prefix}/buildingApartment/:id`,
74 74
       action: 'admin.buildingApartment.id.get',
75 75
     },
76 76
     buildingApartmentUpdate: {
@@ -85,7 +85,7 @@ export default {
85 85
     },
86 86
     buildingApartmentDelete: {
87 87
       method: 'DELETE',
88
-      url: `${prefix}/apartment/deleted/id`,
88
+      url: `${prefix}/apartment/deleted/:id`,
89 89
       action: 'admin.apartment.deleted.id.delete',
90 90
     },
91 91
     buildingSelect: {
@@ -102,12 +102,12 @@ export default {
102 102
     },
103 103
     delete: {
104 104
       method: 'DELETE',
105
-      url: `${prefix}/tdBuildingType/id`,
105
+      url: `${prefix}/tdBuildingType/:id`,
106 106
       action: 'admin.tdBuildingType.id.delete',
107 107
     },
108 108
     update: {
109 109
       method: 'PUT',
110
-      url: `${prefix}/tdBuildingType/id`,
110
+      url: `${prefix}/tdBuildingType/:id`,
111 111
       action: 'admin.tdBuildingType.id.put',
112 112
     },
113 113
     add: {
@@ -117,7 +117,7 @@ export default {
117 117
     },
118 118
     getById: {
119 119
       method: 'GET',
120
-      url: `${prefix}/tdBuildingType/id`,
120
+      url: `${prefix}/tdBuildingType/:id`,
121 121
       action: 'admin.tdBuildingType.id.get',
122 122
     },
123 123
   },
@@ -246,6 +246,16 @@ export default {
246 246
       url: `${prefix}/customer/recommend/recommender/export`,
247 247
       action: 'admin.customer.recommend.recommender.export.get',
248 248
     },
249
+    customerRecommendReportExport: { // 导出数据(报备客户)
250
+      method: 'GET',
251
+      url: `${prefix}/customer/recommend/report/export`,
252
+      action: 'admin.customer.recommend.report.export.get',
253
+    },
254
+    customerRecommendAgentsExport: { // 导出数据(经纪人)
255
+      method: 'GET',
256
+      url: `${prefix}/customer/recommend/agents/export`,
257
+      action: 'admin.customer.recommend.agents.export.get',
258
+    },
249 259
   },
250 260
   indexEcharts: {
251 261
     userResource: {
@@ -265,6 +275,23 @@ export default {
265 275
         action: 'behaviorIncident',
266 276
       },
267 277
     },
278
+    bizEvent: {
279
+      dict: {
280
+        method:'get',
281
+        url: `${prefix}/tdBizEventType`,
282
+        action:'select',
283
+      },
284
+      list: {
285
+        method:'get',
286
+        url: `${prefix}/tdBizEvent`,
287
+        action:'select',
288
+      },
289
+      properties: {
290
+        method:'get',
291
+        url: `${prefix}/taEventProperties`,
292
+        action:'select',
293
+      },
294
+    },
268 295
     userActive: {
269 296
       method: 'GET',
270 297
       url: `${prefix}/selectActiveUserCount`,
@@ -571,7 +598,7 @@ export default {
571 598
     getListInvite: {
572 599
       url: `${prefix}/channel/InviteClientsList`,
573 600
       method: 'GET',
574
-      action: 'admin.InviteClientsList.get',
601
+      action: 'admin.channel.InviteClientsList.get',
575 602
     },
576 603
  },
577 604
  role: {

+ 7
- 3
src/utils/request.js 파일 보기

@@ -58,7 +58,7 @@ request.interceptors.request.use((url, options) => {
58 58
         requestType: data instanceof FormData ? 'form' : 'json',
59 59
         credentials: 'include', // 带 cookie
60 60
         interceptors: true,
61
-        getResponse: true
61
+        getResponse: true,
62 62
       },
63 63
     }
64 64
   );
@@ -76,8 +76,12 @@ request.interceptors.response.use(async (response, options) => {
76 76
       });
77 77
       throw new Error(response.statusText);
78 78
     } else {
79
-      // console.log('response: ', response)
80
-      // console.log('response.headers: ', response.headers)
79
+      console.log('response.headers: ', response.headers)
80
+      console.log('response.headers.Content-Type: ', response.headers.get('Content-Type'))
81
+      if (response.headers.get('Content-Type') === 'application/octet-stream;charset=utf-8') {
82
+        return await response.clone().blob();
83
+      }
84
+
81 85
       const { code, data, message } = await response.clone().json();
82 86
       if (code != 1000) {
83 87
         notification.error({