xujing 5 years ago
parent
commit
d04e53cd4d

+ 14
- 2
src/pages/statistical/activity/compenents/Content.jsx View File

@@ -258,9 +258,21 @@ class OverView extends React.Component {
258 258
     this.getTableList()
259 259
   }
260 260
 
261
+  getFormatedParams = ( params ) => {
262
+    return {
263
+      ...params,
264
+      startDate: getDayBegin(params.startDate),
265
+      endDate: getDayEnd(params.endDate),
266
+    }
267
+  }
268
+
261 269
   getTableList() {
262 270
     const { formData } = this.state
263
-    request({ ...apis.activityDataStatis.activityDetailTableData, params: formData }).then(data => {
271
+
272
+    request({
273
+      ...apis.activityDataStatis.activityDetailTableData,
274
+      params: this.getFormatedParams(formData),
275
+    }).then(data => {
264 276
       console.log(data)
265 277
       this.setState({ tableData: data.records, total: data.total })
266 278
     }).catch()
@@ -333,7 +345,7 @@ class OverView extends React.Component {
333 345
 
334 346
   exportActivityStats = () => {
335 347
     const { formData } = this.state
336
-    request({ ...apis.activityDataStatis.activityDetailTableDataExport, params: formData }).then(data => {
348
+    request({ ...apis.activityDataStatis.activityDetailTableDataExport, params: this.getFormatedParams(formData) }).then(data => {
337 349
       if (!data) {
338 350
         return
339 351
       }

+ 1
- 2
src/pages/statistical/activity/compenents/NewUsers.jsx View File

@@ -19,8 +19,7 @@ const NewUsers = (props) => {
19 19
 
20 20
   useEffect(() => {
21 21
     NewsUserCount({
22
-      startDate: props.startDate, 
23
-      endDate: props.endDate, 
22
+      ...formatDate(props.startDate, props.endDate),
24 23
       buildingId: props.buildingId, 
25 24
       targetType: props.targetType
26 25
     })

+ 15
- 4
src/pages/statistical/activity/compenents/OverView.jsx View File

@@ -204,10 +204,21 @@ class OverView extends React.Component {
204 204
     this.getTableList()
205 205
   }
206 206
 
207
+  getFormatedParams = ( params ) => {
208
+    return {
209
+      ...params,
210
+      startDate: getDayBegin(params.startDate),
211
+      endDate: getDayEnd(params.endDate),
212
+    }
213
+  }
214
+
207 215
   getList () {
208 216
     const { formData } = this.state
209
-    console.log(formData,'formData')
210
-    request({ ...apis.activityDataStatis.total, params: formData }).then(res => {
217
+
218
+    request({
219
+      ...apis.activityDataStatis.total,
220
+      params: this.getFormatedParams(formData),
221
+    }).then(res => {
211 222
       this.setState({ personData: res })
212 223
     }).catch(err => {
213 224
       <Alert
@@ -223,7 +234,7 @@ class OverView extends React.Component {
223 234
 
224 235
   getTableList () {
225 236
     const { formData } = this.state
226
-    request({ ...apis.activityDataStatis.tableData, params: formData }).then(data => {
237
+    request({ ...apis.activityDataStatis.tableData, params: this.getFormatedParams(formData) }).then(data => {
227 238
       console.log(data)
228 239
       this.setState({ tableData: data.records, total: data.total})
229 240
     }).catch()
@@ -299,7 +310,7 @@ class OverView extends React.Component {
299 310
 
300 311
   exportActivityStats = () => {
301 312
     const { formData } = this.state
302
-    request({ ...apis.activityDataStatis.tableDataExport, params: formData }).then(data => {
313
+    request({ ...apis.activityDataStatis.tableDataExport, params: this.getFormatedParams(formData) }).then(data => {
303 314
       if (!data) {
304 315
         return
305 316
       }