魏熙美 5 år sedan
förälder
incheckning
a126d2962e

+ 8
- 1
src/pages/indexEcharts/components/UserBehavior.jsx Visa fil

182
       })),
182
       })),
183
   }
183
   }
184
   function handleBuildingChange(e) {
184
   function handleBuildingChange(e) {
185
-    getUserBehaviorSummary({ buildingId: e })
185
+    const date = formatDate(props.startDate, props.endDate)
186
+    getUserBehaviorSummary({
187
+      ...date,
188
+      activity: props.activity,
189
+      event: props.event,
190
+      eventType: props.eventType,
191
+      buildingId: e,
192
+    })
186
   }
193
   }
187
 
194
 
188
   function showDetails(row) {
195
   function showDetails(row) {

+ 5
- 21
src/pages/indexEcharts/userBehavior.jsx Visa fil

34
     
34
     
35
   }, [])
35
   }, [])
36
  
36
  
37
-
38
-function getUserBehaviorSummary(params) {
39
-
40
-
41
-  request({
42
-    ...apis.indexEcharts.userBehavior.summary,
43
-    params
44
-  }).then((data) => {
45
-    setData(data || {})
46
-
47
-  })
48
-}
49
   const [eventypes, setEventTypes] = useState([])
37
   const [eventypes, setEventTypes] = useState([])
50
   function getBizEventType(row) {
38
   function getBizEventType(row) {
51
 
39
 
101
   }
89
   }
102
 
90
 
103
   function redata(e) {
91
   function redata(e) {
104
-
105
-
106
     console.log('行为回调数据:', e)
92
     console.log('行为回调数据:', e)
107
   }
93
   }
108
   const [eventType, setEventType] = useState('')
94
   const [eventType, setEventType] = useState('')
109
   function handleChangeType(value) {
95
   function handleChangeType(value) {
110
-    console.log(value,"1111111111111");
111
     setEventType(value)
96
     setEventType(value)
112
   }
97
   }
113
   const [event, setEvent] = useState('')
98
   const [event, setEvent] = useState('')
114
   function handleChangeEvent(value) {
99
   function handleChangeEvent(value) {
115
-    console.log(value,"222222222222");
116
     setEvent(value)
100
     setEvent(value)
117
   }
101
   }
118
   const [activity, setActivity] = useState('')
102
   const [activity, setActivity] = useState('')
119
   function handleChangeProperty(value) {
103
   function handleChangeProperty(value) {
120
-    console.log(value,"33333333333333");
121
     setActivity(value)
104
     setActivity(value)
122
   }
105
   }
123
 
106
 
169
           <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
152
           <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
170
         </Radio.Group>
153
         </Radio.Group>
171
         <RangePicker
154
         <RangePicker
172
-          style={{ paddingLeft: '30px' }}
155
+          style={{ paddingLeft: '30px', width: '400px' }}
173
           ranges={{
156
           ranges={{
174
             Today: [moment(), moment()],
157
             Today: [moment(), moment()],
175
             'This Month': [moment().startOf('month'), moment().endOf('month')],
158
             'This Month': [moment().startOf('month'), moment().endOf('month')],
176
           }}
159
           }}
160
+          // defaultValue={[moment(new Date(new Date().setDate((new Date().getDate() - 6))), 'YYYY-MM-DD HH:MM:SS'), moment(new Date(), 'YYYY-MM-DD HH:MM:SS')]}
177
           showTime
161
           showTime
178
           onChange={onChangetime}
162
           onChange={onChangetime}
179
         />
163
         />
185
       <div style={{ display: 'flex', margin: '24px 0' }}>
169
       <div style={{ display: 'flex', margin: '24px 0' }}>
186
         <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
170
         <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
187
        
171
        
188
-        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
172
+        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChangeType}>
189
           {eventypes.map(type => (
173
           {eventypes.map(type => (
190
             <Option key={type.typeId}>{type.typeName}</Option>
174
             <Option key={type.typeId}>{type.typeName}</Option>
191
           ))}
175
           ))}
192
       </Select>
176
       </Select>
193
-        <Select  style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
177
+        <Select style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChangeEvent}>
194
           {eventList.map(event => (
178
           {eventList.map(event => (
195
             <Option key={event.eventId}>{event.eventName}</Option>
179
             <Option key={event.eventId}>{event.eventName}</Option>
196
           ))}
180
           ))}
197
       </Select>
181
       </Select>
198
-        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
182
+        <Select style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChangeProperty}>
199
           {properties.map(property => (
183
           {properties.map(property => (
200
             <Option key={property.propertyId}>{property.propertyName}</Option>
184
             <Option key={property.propertyId}>{property.propertyName}</Option>
201
           ))}
185
           ))}