xujing пре 5 година
родитељ
комит
d04e53cd4d

+ 14
- 2
src/pages/statistical/activity/compenents/Content.jsx Прегледај датотеку

258
     this.getTableList()
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
   getTableList() {
269
   getTableList() {
262
     const { formData } = this.state
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
       console.log(data)
276
       console.log(data)
265
       this.setState({ tableData: data.records, total: data.total })
277
       this.setState({ tableData: data.records, total: data.total })
266
     }).catch()
278
     }).catch()
333
 
345
 
334
   exportActivityStats = () => {
346
   exportActivityStats = () => {
335
     const { formData } = this.state
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
       if (!data) {
349
       if (!data) {
338
         return
350
         return
339
       }
351
       }

+ 1
- 2
src/pages/statistical/activity/compenents/NewUsers.jsx Прегледај датотеку

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

+ 15
- 4
src/pages/statistical/activity/compenents/OverView.jsx Прегледај датотеку

204
     this.getTableList()
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
   getList () {
215
   getList () {
208
     const { formData } = this.state
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
       this.setState({ personData: res })
222
       this.setState({ personData: res })
212
     }).catch(err => {
223
     }).catch(err => {
213
       <Alert
224
       <Alert
223
 
234
 
224
   getTableList () {
235
   getTableList () {
225
     const { formData } = this.state
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
       console.log(data)
238
       console.log(data)
228
       this.setState({ tableData: data.records, total: data.total})
239
       this.setState({ tableData: data.records, total: data.total})
229
     }).catch()
240
     }).catch()
299
 
310
 
300
   exportActivityStats = () => {
311
   exportActivityStats = () => {
301
     const { formData } = this.state
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
       if (!data) {
314
       if (!data) {
304
         return
315
         return
305
       }
316
       }