Bladeren bron

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

魏熙美 5 jaren geleden
bovenliggende
commit
68cf99a5e6
2 gewijzigde bestanden met toevoegingen van 90 en 36 verwijderingen
  1. 73
    36
      src/pages/indexEcharts/userBehavior.jsx
  2. 17
    0
      src/services/apis.js

+ 73
- 36
src/pages/indexEcharts/userBehavior.jsx Bestand weergeven

@@ -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, setEventType] = useState([])
36
+  function getBizEventType(row) {
37
+
38
+    request({
39
+      ...apis.indexEcharts.bizEvent.dict,
40
+    }).then((data) => {
41
+      setEventType(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
 
@@ -105,45 +140,47 @@ const header = props => {
105 140
       borderRadius: '12px',
106 141
       minHeight: '60vh'
107 142
     }}>
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
-        搜索
143
+      <div>
144
+        <Radio.Group buttonStyle="solid" defaultValue="a">
145
+          <Radio.Button value="a" onClick={getDataOf(7)}>最近7天</Radio.Button>
146
+          <Radio.Button value="b" onClick={getDataOf(30)}>最近1月</Radio.Button>
147
+        </Radio.Group>
148
+        <RangePicker
149
+          style={{ paddingLeft: '30px' }}
150
+          ranges={{
151
+            Today: [moment(), moment()],
152
+            'This Month': [moment().startOf('month'), moment().endOf('month')],
153
+          }}
154
+          showTime
155
+          onChange={onChangetime}
156
+        />
157
+        <Button type="primary" htmlType="submit" style={{ marginLeft: '30px', float: 'right' }} onClick={datalist}>
158
+          搜索
124 159
       </Button>
125
-    </div>
126
-     
160
+      </div>
161
+
127 162
       <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>
163
+        <BuildSelect style={{ width: '14%', minWidth: '160px' }} slot='action' onChange={(e => handleBuildingChange(e))}></BuildSelect>
164
+       
165
+        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="所有事件组" onChange={handleChange}>
166
+          {eventypes.map(type => (
167
+            <Option key={type.typeId}>{type.typeName}</Option>
168
+          ))}
169
+      </Select>
170
+        <Select  style={{ width: '14%', minWidth: '200px', marginLeft: '2%' }} placeholder="请选择事件" onChange={handleChange}>
171
+          {eventList.map(event => (
172
+            <Option key={event.eventId}>{event.eventName}</Option>
173
+          ))}
174
+      </Select>
175
+        <Select  style={{ width: '14%', minWidth: '160px', marginLeft: '2%' }} placeholder="请选择属性" onChange={handleChange}>
176
+          {properties.map(property => (
177
+            <Option key={property.propertyId}>{property.propertyName}</Option>
178
+          ))}
179
+      </Select>
180
+     
144 181
       </div>
145
-      
146
-      
182
+
183
+
147 184
       <div style={{ margin: '24px 0' }}>
148 185
         <UserBehavior BuildSelectHide={true} endDate={endDate} startDate={startDate} dataZoom={true} onReData={(e) => redata(e)}></UserBehavior>
149 186
       </div>

+ 17
- 0
src/services/apis.js Bestand weergeven

@@ -250,6 +250,23 @@ export default {
250 250
         action: 'behaviorIncident',
251 251
       },
252 252
     },
253
+    bizEvent: {
254
+      dict: {
255
+        method:'get',
256
+        url: `${prefix}/tdBizEventType`,
257
+        action:'select',
258
+      },
259
+      list: {
260
+        method:'get',
261
+        url: `${prefix}/tdBizEvent`,
262
+        action:'select',
263
+      },
264
+      properties: {
265
+        method:'get',
266
+        url: `${prefix}/taEventProperties`,
267
+        action:'select',
268
+      },
269
+    },
253 270
     userActive: {
254 271
       method: 'GET',
255 272
       url: `${prefix}/selectActiveUserCount`,