Преглед изворни кода

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

zhoulisen пре 5 година
родитељ
комит
ea6ca808d0

+ 1
- 1
src/components/SelectButton/AreaSelect.jsx Прегледај датотеку

@@ -48,7 +48,7 @@ const CitySelect = (props) => {
48 48
       showSearch
49 49
       value={props.value}
50 50
       style={{ width: '300px' }}
51
-      placeholder="请选择城市"
51
+      placeholder="请选择区域"
52 52
       onChange={props.onChange}
53 53
       filterOption={(input, option) =>
54 54
         option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0

+ 11
- 0
src/pages/Monitor.jsx Прегледај датотеку

@@ -31,6 +31,7 @@ const Monitor = props => {
31 31
 
32 32
   function getBuildingReports() {
33 33
     request({ ...apis.system.taBuildingReports, }).then((data) => {
34
+      console.log(data,"22222222222222222")
34 35
       setCheckData((data.records || []).map((x) => x.reportCode))
35 36
     })
36 37
   }
@@ -58,6 +59,16 @@ const Monitor = props => {
58 59
             <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectRegisteredCount || '0'}</span>
59 60
           </div>
60 61
         }
62
+        {checkData.includes('total_number_of_visit_users') &&
63
+          <div style={{
64
+            textAlign: 'center', display: 'flex', justifyContent: 'center', lineHeight: '100px', background: 'linear-gradient(144deg,rgba(255,126,74,1) 0%,rgba(255,196,168,1) 100%)', height: '100px',
65
+            boxShadow: '0px  0.106rem 14px -15px rgba(255,126,74,1)',
66
+            borderRadius: '12px', width: '32%', marginRight: '2%'
67
+          }}>
68
+            <span style={{ fontSize: '24px', color: '#fff' }}>今日访问次数 </span>
69
+            <span style={{ fontSize: '52px', color: '#fff', marginLeft: '26px', fontFamily: 'fantasy' }}>{data.selectVisitCount || '0'}</span>
70
+          </div>
71
+        }
61 72
         {checkData.includes('number_of_new_users') &&
62 73
           <div onClick={() => router.push('/statistical/newUsers')} style={{
63 74
             textAlign: 'center', display: 'flex', justifyContent: 'center', background: 'linear-gradient(137deg,rgba(107,130,230,1) 0%,rgba(152,175,251,1) 100%)', height: '100px',

+ 93
- 93
src/pages/activity/editActivity.jsx Прегледај датотеку

@@ -57,14 +57,14 @@ const BasicForm = props => {
57 57
     })
58 58
   }
59 59
 
60
-    // eslint-disable-next-line react-hooks/rules-of-hooks
61
-    useEffect(() => {
62
-      props.form.setFieldsValue({ isEnlist })
63
-      if (dynamicId) {
64
-        getDynamicData(dynamicId);
65
-      }
66
-    }, [])
67
- 
60
+  // eslint-disable-next-line react-hooks/rules-of-hooks
61
+  useEffect(() => {
62
+    props.form.setFieldsValue({ isEnlist })
63
+    if (dynamicId) {
64
+      getDynamicData(dynamicId);
65
+    }
66
+  }, [])
67
+
68 68
   const handleSubmit = e => {
69 69
     e.preventDefault();
70 70
     props.form.validateFields((err, values) => {
@@ -79,7 +79,7 @@ const BasicForm = props => {
79 79
           values.enlistStart = moment(enlistStart).format('YYYY-MM-DD HH:mm');
80 80
           values.enlistEnd = moment(enlistEnd).format('YYYY-MM-DD HH:mm');
81 81
         }
82
-        
82
+
83 83
         console.log('submit data --->', values)
84 84
         if (dynamicId) {
85 85
           values.dynamicId = dynamicId
@@ -112,97 +112,97 @@ const BasicForm = props => {
112 112
     <>
113 113
       <Form {...formItemLayout} onSubmit={handleSubmit}>
114 114
         <Form.Item label="所属项目">
115
-        {getFieldDecorator('buildingId', {
116
-          rules: [
117
-            {
118
-              required: true,
119
-              message: '请选择所属项目',
120
-            },
121
-          ],
122
-        })(<BuildSelect disabled={disable}/>)}
115
+          {getFieldDecorator('buildingId', {
116
+            rules: [
117
+              {
118
+                required: true,
119
+                message: '请选择所属项目',
120
+              },
121
+            ],
122
+          })(<BuildSelect disabled={disable} />)}
123 123
         </Form.Item>
124 124
         <Form.Item label="活动封面图1" help="建议图片尺寸:750px*420px,比例16:9,格式:jpg,用于:首页推荐/活动列表">
125 125
           {getFieldDecorator('listImgUrl', {
126
-          rules: [
127
-            {
128
-              required: true,
129
-              message: '请选择活动封面图1',
130
-            },
131
-          ],
132
-        })(<ImageUploader />)}
126
+            rules: [
127
+              {
128
+                required: true,
129
+                message: '请选择活动封面图1',
130
+              },
131
+            ],
132
+          })(<ImageUploader />)}
133 133
         </Form.Item>
134 134
         <Form.Item label="活动封面图2" help="建议图片尺寸:750*250,比例3:1,格式:jpg,用于:项目详情页">
135 135
           {getFieldDecorator('bannerListImg', {
136
-          rules: [
137
-            {
138
-              required: true,
139
-              message: '请选择活动封面图2',
140
-            },
141
-          ],
142
-        })(<ImageUploader />)}
136
+            rules: [
137
+              {
138
+                required: true,
139
+                message: '请选择活动封面图2',
140
+              },
141
+            ],
142
+          })(<ImageUploader />)}
143 143
         </Form.Item>
144 144
         <Form.Item label="活动详情主图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于:普通活动详情">
145 145
           {getFieldDecorator('imgUrl', {
146
-          rules: [
147
-            {
148
-              required: true,
149
-              message: '请选择活动详情主图',
150
-            },
151
-          ],
152
-        })(<ImageUploader />)}
146
+            rules: [
147
+              {
148
+                required: true,
149
+                message: '请选择活动详情主图',
150
+              },
151
+            ],
152
+          })(<ImageUploader />)}
153 153
         </Form.Item>
154 154
         <Form.Item label="活动标题">
155
-        {getFieldDecorator('title', {
156
-          rules: [
157
-            {
158
-              required: true,
159
-              message: '请输入活动标题',
160
-            },
161
-          ],
162
-        })(<Input/>)}
155
+          {getFieldDecorator('title', {
156
+            rules: [
157
+              {
158
+                required: true,
159
+                message: '请输入活动标题',
160
+              },
161
+            ],
162
+          })(<Input />)}
163 163
         </Form.Item>
164 164
         <Form.Item label="活动时间">
165
-        {getFieldDecorator('activityTime', {
166
-          rules: [
167
-            {
168
-              required: true,
169
-              message: '请选择活动时间',
170
-            },
171
-          ],
172
-        })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
165
+          {getFieldDecorator('activityTime', {
166
+            rules: [
167
+              {
168
+                required: true,
169
+                message: '请选择活动时间',
170
+              },
171
+            ],
172
+          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus === 0 ? true : false} />)}
173 173
         </Form.Item>
174 174
         <Form.Item label="活动地点">
175
-        {getFieldDecorator('address', {
176
-          rules: [
177
-            {
178
-              required: true,
179
-              message: '请输入活动地点',
180
-            },
181
-          ],
182
-        })(<Input disabled={activityStatus===0 ? true : false}/>)}
175
+          {getFieldDecorator('address', {
176
+            rules: [
177
+              {
178
+                required: true,
179
+                message: '请输入活动地点',
180
+              },
181
+            ],
182
+          })(<Input disabled={activityStatus === 0 ? true : false} />)}
183 183
         </Form.Item>
184
-        <Form.Item label="活动人数">
185
-        {getFieldDecorator('personNum', {
186
-          rules: [
187
-            {
188
-              required: true,
189
-              message: '请输入活动人数',
190
-            },
191
-          ],
192
-        })(<Input type="number" disabled={activityStatus===0 ? true : false}/>)}
184
+        <Form.Item label="活动人数" help="当前活动最多可报名人数">
185
+          {getFieldDecorator('personNum', {
186
+            rules: [
187
+              {
188
+                required: true,
189
+                message: '请输入活动人数',
190
+              },
191
+            ],
192
+          })(<Input type="number" disabled={activityStatus === 0 ? true : false} />)}
193 193
         </Form.Item>
194
-        <Form.Item label="最大报名人数">
195
-        {getFieldDecorator('maxEnlistByPerson', {
196
-          rules: [
197
-            {
198
-              required: true,
199
-              message: '请输入最大报名人数',
200
-            },
201
-          ],
202
-        })(<Input type="number" min={1} disabled={activityStatus===0 ? true : false}/>)}
194
+        <Form.Item label="用户携带人数" help="每个用户最多可携带参与活动的人数">
195
+          {getFieldDecorator('maxEnlistByPerson', {
196
+            rules: [
197
+              {
198
+                required: true,
199
+                message: '请输入用户携带人数',
200
+              },
201
+            ],
202
+          })(<Input type="number" min={1} disabled={activityStatus === 0 ? true : false} />)}
203 203
         </Form.Item>
204 204
         <Form.Item label="活动详情">
205
-        {getFieldDecorator('desc')(<Wangedit />)}
205
+          {getFieldDecorator('desc')(<Wangedit />)}
206 206
         </Form.Item>
207 207
         <Form.Item label="报名时间">
208 208
           {getFieldDecorator('signupTime', {
@@ -212,17 +212,17 @@ const BasicForm = props => {
212 212
                 message: '请选择报名时间',
213 213
               },
214 214
             ],
215
-          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus===0 ? true : false}/>)}
216
-        </Form.Item>  
215
+          })(<RangePicker format="YYYY-MM-DD HH:mm" disabled={activityStatus === 0 ? true : false} />)}
216
+        </Form.Item>
217 217
         <Form.Item label="权重">
218
-        {getFieldDecorator('heavy', {
219
-          rules: [
220
-            {
221
-              required: true,
222
-              message: '请输入权重',
223
-            },
224
-          ],
225
-        })(<Input type="number" style={{ width: 80}}/>)}<span style={{ marginLeft: 30, color:'grey'}}>数字越大越靠前</span>
218
+          {getFieldDecorator('heavy', {
219
+            rules: [
220
+              {
221
+                required: true,
222
+                message: '请输入权重',
223
+              },
224
+            ],
225
+          })(<Input type="number" style={{ width: 80 }} />)}<span style={{ marginLeft: 30, color: 'grey' }}>数字越大越靠前</span>
226 226
         </Form.Item>
227 227
         <Form.Item wrapperCol={{ span: 12, offset: 8 }}>
228 228
           <Button type="primary" htmlType="submit">
@@ -273,7 +273,7 @@ const Edit = props => {
273 273
         })
274 274
         getMiniappName()
275 275
       }, [])
276
-    }else{
276
+    } else {
277 277
       getMiniappName()
278 278
     }
279 279
     // 获取小程序名称
@@ -358,7 +358,7 @@ const Edit = props => {
358 358
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>活动海报图</p>
359 359
             <ImageUploader value={imgValue} onChange={e => changeImg(e)} />
360 360
           </div>
361
-          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px'}}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
361
+          <p style={{ fontSize: '0.5vw', color: '#A9A9A9', marginLeft: '230px', marginBottom: '30px' }}>建议图片尺寸:640*670px,比例64:67,格式:jpg,用于普通活动海报</p>
362 362
           <div style={{ display: 'flex', alignItems: 'center', width: '100%', marginBottom: '60px' }}>
363 363
             <p style={{ minWidth: '200px', color: '#222', textAlign: 'right', margin: '0 30px 0 0' }}>海报标题</p>
364 364
             <Input style={{ width: '20vw' }} value={inputValue} placeholder="请输入海报标题" onChange={e => changeInput(e.target.value)} />

+ 7
- 5
src/pages/building/list/add/components/base.jsx Прегледај датотеку

@@ -329,11 +329,13 @@ function AddBuilding(props) {
329 329
 
330 330
   function cityChange(e) {
331 331
     setCityId(e)
332
-    setTimeout(()=>{
333
-      props.form.setFieldsValue({
334
-          'buildingArea': buildingData.buildingArea
335
-      })
336
-  },0)
332
+    if(buildingData.cityId === e){
333
+      setTimeout(()=>{
334
+        props.form.setFieldsValue({
335
+            'buildingArea': buildingData.buildingArea
336
+        })
337
+    },0)
338
+    }
337 339
   }
338 340
 
339 341
   function setFormMapScopeTagValue(keyType, item) {

+ 1
- 0
src/pages/charts/CityNums.jsx Прегледај датотеку

@@ -6,6 +6,7 @@ const geoOptions = {
6 6
   backgroundColor: '#fff',
7 7
   title: {
8 8
     text: '城市分布',
9
+    subtext: '数据会存在一定时间延迟',
9 10
     left: 40,
10 11
     top: 40
11 12
   },

+ 7
- 6
src/pages/indexEcharts/newUsers.jsx Прегледај датотеку

@@ -24,6 +24,8 @@ let columns = [
24 24
   },
25 25
 ]
26 26
 
27
+let daterange= []
28
+
27 29
 const header = props => {
28 30
 
29 31
   const [tableData, setTableData] = useState([])
@@ -31,7 +33,7 @@ const header = props => {
31 33
   const [data, setDate] = useState({})
32 34
   const [userType, setUserType] = useState({})
33 35
   const [startDate, setStartDate] = useState({})
34
-  let daterange= []
36
+  
35 37
 
36 38
   useEffect(() => {
37 39
 
@@ -45,8 +47,8 @@ const header = props => {
45 47
 
46 48
   function onChangetime (dates, dateStrings) {
47 49
 
48
-    daterange[1]=dateStrings[1]
49
-    daterange[0]=dateStrings[0]
50
+    daterange[1]=`${moment(dateStrings[1]).format('YYYY-MM-DDT00:00:00.000')}Z`
51
+    daterange[0]=`${moment(dateStrings[0]).format('YYYY-MM-DDT00:00:00.000')}Z`
50 52
 
51 53
   }
52 54
 
@@ -70,10 +72,9 @@ const header = props => {
70 72
   }
71 73
 
72 74
   function datalist () {
73
-
74 75
     setEndDate(daterange[1])
75 76
     setStartDate(daterange[0])
76
-    userResource({startDate: daterange[0], endDate: daterange[1]})
77
+    userResource({startDate, endDate})
77 78
 
78 79
   }
79 80
 
@@ -162,7 +163,7 @@ const header = props => {
162 163
           Today: [moment(), moment()],
163 164
           'This Month': [moment().startOf('month'), moment().endOf('month')],
164 165
         }}
165
-        showTime
166
+        // showTime
166 167
         // format="YYYY/MM/DD HH:mm:ss"
167 168
         onChange={onChangetime}
168 169
       />

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

@@ -192,7 +192,7 @@ class OverView extends React.Component {
192 192
       endDate: '',
193 193
       startDate: '',
194 194
       buildingId: [],
195
-      targetType: []
195
+      targetType: [],
196 196
     }
197 197
   }
198 198
 
@@ -243,9 +243,13 @@ class OverView extends React.Component {
243 243
     const targetType = this.props.form.getFieldValue("targetType");
244 244
     if (this.props.form.getFieldValue("startDate") != undefined){
245 245
       startDate = this.props.form.getFieldValue("startDate").toDate()
246
+    }else{
247
+      startDate = moment().subtract(7, 'day').toDate()
246 248
     }
247 249
     if (this.props.form.getFieldValue("endDate") != undefined){
248 250
       endDate = this.props.form.getFieldValue("endDate").toDate()
251
+    }else{
252
+      endDate = new Date
249 253
     }
250 254
     const { formData } = this.state
251 255
     this.setState({
@@ -263,6 +267,7 @@ class OverView extends React.Component {
263 267
   //重置搜索
264 268
   handleReset = e => {
265 269
     this.props.form.resetFields()
270
+    this.getAllList()
266 271
   }
267 272
 
268 273
   exportActivityStats = () => {
@@ -347,16 +352,12 @@ class OverView extends React.Component {
347 352
         </Radio.Group>
348 353
         <Form layout="inline" onSubmit={e => this.handleSubmit(e, this.props)}>
349 354
             <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
350
-            {getFieldDecorator('startDate', {initialValue: moment(startDate)
351
-              
352
-            })(
355
+            {getFieldDecorator('startDate')(
353 356
                 <DatePicker placeholder="开始日期"/>,
354 357
             )}
355 358
             </Form.Item>
356 359
             <Form.Item style={{marginTop:'20px', marginBottom:'20px'}}>
357
-            {getFieldDecorator('endDate', {initialValue: moment(endDate)
358
-              
359
-            })(
360
+            {getFieldDecorator('endDate')(
360 361
                 <DatePicker placeholder="结束日期"/>,
361 362
             )}
362 363
             </Form.Item>
@@ -380,7 +381,10 @@ class OverView extends React.Component {
380 381
             </Button>
381 382
             <Button onClick={e => this.handleReset()} style={{ marginLeft: '30px' }}>重置</Button>
382 383
           </Form.Item>
384
+          <Icon type="question-circle" theme="filled" style={{ marginTop:'25px', fontSize: '25px', color: '#F00', marginLeft:'30px'}} onClick={() => setShowHelp(true)}/>
385
+          
383 386
           </Form>     
387
+          
384 388
         <div>
385 389
 
386 390
             <div style={{ display: 'flex', marginBottom: '33px' }}>

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

@@ -17,7 +17,7 @@ const { RangePicker } = DatePicker;
17 17
 const { Text } = Typography;
18 18
 
19 19
 function record(props) {
20
-    const [radioVal, updateRadioVal] = useState(7)
20
+    const [radioVal, updateRadioVal] = useState(6)
21 21
     const [formData, updateFormData] = useState({
22 22
         pageNum: 1,
23 23
         pageSize: 10,
@@ -332,8 +332,9 @@ function record(props) {
332 332
             <Form layout="inline">
333 333
                 <div style={{ display: 'flex', alignItems: 'center' }}>
334 334
                     <Radio.Group buttonStyle="solid" value={radioVal} onChange={setFormData} style={{ marginRight: '16px', }}>
335
-                        <Radio.Button value={7}>最近7天</Radio.Button>
336
-                        <Radio.Button value={30}>最近1月</Radio.Button>
335
+                        <Radio.Button value={0}>今日</Radio.Button>
336
+                        <Radio.Button value={6}>最近7天</Radio.Button>
337
+                        <Radio.Button value={29}>最近1月</Radio.Button>
337 338
                     </Radio.Group>
338 339
                     <Form.Item>
339 340
                         <RangePicker value={dateRange} onChange={handleDateChange} placeholder={['开始日期', '结束日期']} />
@@ -351,7 +352,7 @@ function record(props) {
351 352
 
352 353
             <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between' }}>
353 354
                 <h4 style={{ fontSize: '0.12rem', fontWeight: '600' }}>详细数据</h4>
354
-                <AuthButton name="admin.statistical.consultant.export" noRight={null}>
355
+                <AuthButton name="admin.statistical.activity.content.export" noRight={null}>
355 356
                     <Button type="primary" onClick={exportRecord} loading={btnloading} style={{ zIndex: 1 }}>
356 357
                         导出
357 358
                 </Button>

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

@@ -48,14 +48,16 @@ function EditHouse(props) {
48 48
 
49 49
   return (
50 50
     <>
51
+    
51 52
       <Tabs type="card" value={ tab } buttonStyle="solid" onChange={e => tabsCallback(e)}>
52 53
         <TabPane tab="统计总况" key="overView" ></TabPane>
53 54
         <TabPane tab="统计内容" key="content" ></TabPane>
54
-        {/* <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft:'30px'}} /> */}
55 55
       </Tabs>
56 56
       <div style={{ marginTop: '20px' }}>
57 57
         { (tab === 'overView' && <OverView />)}
58 58
         { (tab === 'content' && <Content />)}
59
+        { (tab === 'desc' && <Icon type="question-circle" theme="filled" style={{ fontSize: '25px', color: '#F00', marginLeft:'30px'}} />)}
60
+        
59 61
       </div>
60 62
     </>
61 63
   )

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

@@ -33,7 +33,7 @@ let columns = [
33 33
     key: 'shareType',
34 34
     render: (text, records) => {
35 35
       if (records.sharePersonType === 'drift') { return '游客' }
36
-      if (records.sharePersonType === 'customer') { return '客户' }
36
+      if (records.sharePersonType === 'customer') { return '普通客户' }
37 37
       if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
38 38
     },
39 39
   },

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

@@ -85,7 +85,7 @@ let columns = [
85 85
     key: 'sharePersonType',
86 86
     render: (text, records) => {
87 87
       if (records.sharePersonType === 'drift') { return '游客' }
88
-      if (records.sharePersonType === 'customer') { return '客户' }
88
+      if (records.sharePersonType === 'customer') { return '普通客户' }
89 89
       if (records.sharePersonType === 'Realty Consultant') { return '置业顾问' }
90 90
     },
91 91
   },

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

@@ -59,15 +59,10 @@ let columns = [
59 59
     key: 'realtyConsultantPhone',
60 60
   },
61 61
   {
62
-    title: '分享者',
62
+    title: '推广人',
63 63
     dataIndex: 'sharePersonName',
64 64
     key: 'sharePersonName',
65 65
   },
66
-  {
67
-    title: '分享者电话',
68
-    dataIndex: 'sharePersonPhone',
69
-    key: 'sharePersonPhone',
70
-  },
71 66
   {
72 67
     title: '访问次数',
73 68
     dataIndex: 'visitNum',

+ 3
- 0
src/pages/statistical/building/component/StatsChart.jsx Прегледај датотеку

@@ -24,6 +24,9 @@ class StatsChart extends React.Component {
24 24
         axisLabel: {rotate: 45},
25 25
         data: data.buildingNameList || []
26 26
     },
27
+    grid: {
28
+      bottom:'30%'
29
+    },  
27 30
     tooltip: {},
28 31
     yAxis: {
29 32
         type: 'value'

+ 3
- 0
src/pages/statistical/building/detail.jsx Прегледај датотеку

@@ -7,6 +7,7 @@ import apis from '../../../services/apis';
7 7
 import StatsChartLine from './component/StatsChartLine';
8 8
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
9 9
 import router from 'umi/router';
10
+import AuthButton from '@/components/AuthButton';
10 11
 
11 12
 
12 13
 const { RangePicker } = DatePicker;
@@ -167,7 +168,9 @@ class buildingDetailStats extends React.Component {
167 168
               <span>详细数据</span>
168 169
             </Col>
169 170
             <Col span={2}>
171
+            <AuthButton name="admin.statistical.building.content.export" noRight={null}>
170 172
               <Button type="primary" onClick={this.exportBuildingStats}>导出</Button>
173
+            </AuthButton>
171 174
             </Col>
172 175
         </Row>
173 176
         

+ 3
- 0
src/pages/statistical/building/index.jsx Прегледај датотеку

@@ -7,6 +7,7 @@ import apis from '../../../services/apis';
7 7
 import StatsChart from './component/StatsChart';
8 8
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
9 9
 import router from 'umi/router';
10
+import AuthButton from '@/components/AuthButton';
10 11
 
11 12
 
12 13
 const { RangePicker } = DatePicker;
@@ -211,7 +212,9 @@ class buildingStats extends React.Component {
211 212
               <BuildSelect slot='action' onChange={(e => this.handleBuildingChange(e))} value={this.state.buildingId}></BuildSelect>
212 213
             </Col>
213 214
             <Col span={2}>
215
+            <AuthButton name="admin.statistical.building.export" noRight={null}>
214 216
               <Button type="primary" onClick={this.exportBuildingStats}>导出</Button>
217
+            </AuthButton>
215 218
             </Col>
216 219
         </Row>
217 220
         

+ 74
- 19
src/pages/statistical/consultant/index.jsx Прегледај датотеку

@@ -1,5 +1,5 @@
1 1
 import React, { useState, useEffect } from 'react';
2
-import { Form, Button, DatePicker, Table, Pagination, Radio, Typography } from 'antd';
2
+import { Form, Button, DatePicker, Modal, Table, Pagination, Radio, Typography } from 'antd';
3 3
 import router from 'umi/router';
4 4
 import moment from 'moment';
5 5
 import BuildSelect from '../../../components/SelectButton/BuildSelect'
@@ -15,7 +15,7 @@ const { RangePicker } = DatePicker;
15 15
 const { Text } = Typography;
16 16
 
17 17
 function record(props) {
18
-    const [radioVal, updateRadioVal] = useState(7)
18
+    const [radioVal, updateRadioVal] = useState(6)
19 19
     const [formData, updateFormData] = useState({
20 20
         pageNum: 1,
21 21
         pageSize: 10,
@@ -31,6 +31,7 @@ function record(props) {
31 31
     const [totalRow, setTotalRow] = useState({})
32 32
     const [loading, updataLoading] = useState(true)
33 33
     const [btnloading, updataBtnloading] = useState(false)
34
+    const [visible, setVisible] = useState(false)
34 35
 
35 36
     useEffect(() => {
36 37
         getList(formData);
@@ -38,6 +39,7 @@ function record(props) {
38 39
 
39 40
     // 查询列表
40 41
     const getList = (params) => {
42
+        updataLoading(true)
41 43
         request({ ...apis.stats.consultantKPI, params: { ...params }, }).then((data) => {
42 44
             setData(data.paged)
43 45
             setTotalRow(data.total)
@@ -50,6 +52,21 @@ function record(props) {
50 52
     //重置搜索
51 53
     function handleReset() {
52 54
         props.form.resetFields();
55
+        updateFormData({
56
+            pageNum: 1,
57
+            pageSize: 10,
58
+            startDate: moment().subtract(radioVal, 'day').format('YYYYMMDD'),
59
+            endDate: moment().format('YYYYMMDD'),
60
+            buildingId: '',
61
+        })
62
+        updateRadioVal(6)
63
+        getList({
64
+            pageNum: 1,
65
+            pageSize: 10,
66
+            startDate: moment().subtract(radioVal, 'day').format('YYYYMMDD'),
67
+            endDate: moment().format('YYYYMMDD'),
68
+            buildingId: '',
69
+        });
53 70
     }
54 71
 
55 72
     // 提交事件
@@ -227,7 +244,7 @@ function record(props) {
227 244
             dataIndex: 'buildingName',
228 245
             key: 'buildingName',
229 246
             align: 'center',
230
-            // render: (txt, _, index) => index ? txt : <span>总计</span>,
247
+            render: (txt, _, index) => index ? txt : <span>总计</span>,
231 248
         },
232 249
 
233 250
         {
@@ -248,8 +265,8 @@ function record(props) {
248 265
             key: 'totalPersons',
249 266
             align: 'center',
250 267
             sorter: true,
251
-            render: (txt, record, index) => clickCon(txt, record, 'totalPersons'),
252
-            // render: (txt, record, index) => index ? clickCon(txt, record, 'totalPersons') : <strong>{txt}</strong>,
268
+            // render: (txt, record, index) => clickCon(txt, record, 'totalPersons'),
269
+            render: (txt, record, index) => index ? clickCon(txt, record, 'totalPersons') : <strong>{txt}</strong>,
253 270
         },
254 271
         {
255 272
             title: '新增客户',
@@ -257,7 +274,8 @@ function record(props) {
257 274
             key: 'newPersons',
258 275
             align: 'center',
259 276
             sorter: true,
260
-            render: (txt, record, index) => clickCon(txt, record, 'newPersons'),
277
+            // render: (txt, record, index) => clickCon(txt, record, 'newPersons'),
278
+            render: (txt, record, index) => index ? clickCon(txt, record, 'newPersons') : <strong>{txt}</strong>,
261 279
         },
262 280
         {
263 281
             title: '分享次数',
@@ -265,7 +283,8 @@ function record(props) {
265 283
             key: 'shareNum',
266 284
             align: 'center',
267 285
             sorter: true,
268
-            render: (txt, record, index) => clickCon(txt, record, 'shareNum'),
286
+            // render: (txt, record, index) => clickCon(txt, record, 'shareNum'),
287
+            render: (txt, record, index) => index ? clickCon(txt, record, 'shareNum') : <strong>{txt}</strong>,
269 288
         },
270 289
         {
271 290
             title: '分享访问人数',
@@ -273,7 +292,8 @@ function record(props) {
273 292
             key: 'visitPersons',
274 293
             align: 'center',
275 294
             sorter: true,
276
-            render: (txt, record, index) => clickCon(txt, record, 'visitPersons'),
295
+            // render: (txt, record, index) => clickCon(txt, record, 'visitPersons'),
296
+            render: (txt, record, index) => index ? clickCon(txt, record, 'visitPersons') : <strong>{txt}</strong>,
277 297
         },
278 298
         {
279 299
             title: '分享访问次数',
@@ -281,7 +301,8 @@ function record(props) {
281 301
             key: 'visitNum',
282 302
             align: 'center',
283 303
             sorter: true,
284
-            render: (txt, record, index) => clickCon(txt, record, 'visitNum'),
304
+            // render: (txt, record, index) => clickCon(txt, record, 'visitNum'),
305
+            render: (txt, record, index) => index ? clickCon(txt, record, 'visitNum') : <strong>{txt}</strong>,
285 306
         },
286 307
 
287 308
         {
@@ -290,7 +311,8 @@ function record(props) {
290 311
             key: 'sharePersons',
291 312
             align: 'center',
292 313
             sorter: true,
293
-            render: (txt, record, index) => clickCon(txt, record, 'sharePersons'),
314
+            // render: (txt, record, index) => clickCon(txt, record, 'sharePersons'),
315
+            render: (txt, record, index) => index ? clickCon(txt, record, 'sharePersons') : <strong>{txt}</strong>,
294 316
         },
295 317
         {
296 318
             title: '主页访问人数',
@@ -298,7 +320,8 @@ function record(props) {
298 320
             key: 'homePagePersons',
299 321
             align: 'center',
300 322
             sorter: true,
301
-            render: (txt, record, index) => clickCon(txt, record, 'homePagePersons'),
323
+            // render: (txt, record, index) => clickCon(txt, record, 'homePagePersons'),
324
+            render: (txt, record, index) => index ? clickCon(txt, record, 'homePagePersons') : <strong>{txt}</strong>,
302 325
         },
303 326
         {
304 327
             title: '主页访问次数',
@@ -306,7 +329,8 @@ function record(props) {
306 329
             key: 'homePageNums',
307 330
             align: 'center',
308 331
             sorter: true,
309
-            render: (txt, record, index) => clickCon(txt, record, 'homePageNums'),
332
+            // render: (txt, record, index) => clickCon(txt, record, 'homePageNums'),
333
+            render: (txt, record, index) => index ? clickCon(txt, record, 'homePageNums') : <strong>{txt}</strong>,
310 334
         },
311 335
         {
312 336
             title: '咨询数',
@@ -314,7 +338,8 @@ function record(props) {
314 338
             key: 'chatPersons',
315 339
             align: 'center',
316 340
             sorter: true,
317
-            render: (txt, record, index) => clickCon(txt, record, 'chatPersons'),
341
+            // render: (txt, record, index) => clickCon(txt, record, 'chatPersons'),
342
+            render: (txt, record, index) => index ? clickCon(txt, record, 'chatPersons') : <strong>{txt}</strong>,
318 343
         },
319 344
         {
320 345
             title: '点赞数',
@@ -322,7 +347,8 @@ function record(props) {
322 347
             key: 'favorNum',
323 348
             align: 'center',
324 349
             sorter: true,
325
-            render: (txt, record, index) => clickCon(txt, record, 'favorNum'),
350
+            // render: (txt, record, index) => clickCon(txt, record, 'favorNum'),
351
+            render: (txt, record, index) => index ? clickCon(txt, record, 'favorNum') : <strong>{txt}</strong>,
326 352
         },
327 353
     ];
328 354
     // 下载文档
@@ -354,16 +380,44 @@ function record(props) {
354 380
         moment(formData.startDate),
355 381
         moment(formData.endDate),
356 382
     ]
357
-    // const list = data.records
358
-    // const _list = list && list.length > 0 ? [totalRow, ...list] : [];
383
+    const list = data.records
384
+    const _list = list && list.length > 0 ? [totalRow, ...list] : [];
359 385
     return (
360 386
 
361 387
         <>
388
+            <p style={{ fontSize: '0.09rem', color: '#999' }} onClick={() => setVisible(true)}>指标说明</p>
389
+            <Modal
390
+                title="指标说明(数据会存在一定时间延迟)"
391
+                centered
392
+                visible={visible}
393
+                footer={null}
394
+                onCancel={() => setVisible(false)}
395
+            >
396
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>主页访问人数:</p>
397
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问置业顾问名片的用户数</p>
398
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>主页访问次数:</p>
399
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>访问置业顾问名片的用户数</p>
400
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>客户总计:</p>
401
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>当前置业顾问的所有客户数(与列表时间筛选无关)</p>
402
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>新增客户:</p>
403
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>当前时间段内置业顾问新增的客户数</p>
404
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享次数:</p>
405
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>置业顾问分享小程序内容的次数</p>
406
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享访问人数:</p>
407
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过置业顾问分享访问小程序内容的用户数</p>
408
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>分享拓客:</p>
409
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>通过置业顾问分享内容进行手机授权的用户数</p>
410
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>咨询数:</p>
411
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>在线微聊,咨询置业顾问的用户数</p>
412
+                <p style={{ fontSize: '0.106rem', color: '#333', marginBottom: '8px' }}>点赞数:</p>
413
+                <p style={{ fontSize: '0.106rem', color: '#999', marginBottom: '8px' }}>置业顾问获得的点赞数</p>
414
+            </Modal>
362 415
             <Form layout="inline">
363 416
                 <div style={{ display: 'flex', alignItems: 'center' }}>
364 417
                     <Radio.Group buttonStyle="solid" value={radioVal} onChange={setFormData} style={{ marginRight: '16px', }}>
365
-                        <Radio.Button value={7}>最近7天</Radio.Button>
366
-                        <Radio.Button value={30}>最近1月</Radio.Button>
418
+                        <Radio.Button value={0}>今日</Radio.Button>
419
+                        <Radio.Button value={6}>最近7天</Radio.Button>
420
+                        <Radio.Button value={29}>最近1月</Radio.Button>
367 421
                     </Radio.Group>
368 422
                     <Form.Item>
369 423
                         <RangePicker value={dateRange} onChange={handleDateChange} placeholder={['开始日期', '结束日期']} />
@@ -384,7 +438,8 @@ function record(props) {
384 438
             </AuthButton>
385 439
             <Table rowKey={record => (record.userId + record.buildingId || '')}
386 440
                 style={{ marginTop: '30px' }}
387
-                dataSource={data.records}
441
+                dataSource={_list}
442
+                // dataSource={data.records}
388 443
                 columns={columns}
389 444
                 pagination={false}
390 445
                 onChange={handleChange}

+ 2
- 2
src/pages/statistical/consultant/sharetable.jsx Прегледај датотеку

@@ -40,7 +40,7 @@ const typeList = [
40 40
     },
41 41
     {
42 42
         label: '首页',
43
-        value: 'mian'
43
+        value: 'main'
44 44
     },
45 45
 ]
46 46
 const showTypeList = [
@@ -128,7 +128,7 @@ function record(props) {
128 128
             dataIndex: 'targetType',
129 129
             key: 'targetType',
130 130
             align: 'center',
131
-            render: (_, record) => <><span>{getType(record.targetType)} {'【' + record.targetName + '】'}</span></>
131
+            render: (_, record) => <><span>{getType(record.targetType)} {record.targetName ? '【' + record.targetName + '】' : ''}</span></>
132 132
         },
133 133
         {
134 134
             title: '分享时间',

+ 1
- 1
src/pages/statistical/consultant/table.jsx Прегледај датотеку

@@ -138,7 +138,7 @@ function record(props) {
138 138
                         dataIndex: 'reportDate',
139 139
                         key: 'reportDate',
140 140
                         align: 'center',
141
-                        render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span>}</>,
141
+                        render: (_, record) => <><span>{record.reportDate && moment(record.reportDate).format('YYYY-MM-DD HH:mm:ss')}</span></>,
142 142
                     },
143 143
                 ]
144 144
     const columns = basicColunms.concat(lastColum)

+ 2
- 2
src/pages/statistical/consultant/visitNum.jsx Прегледај датотеку

@@ -113,7 +113,7 @@ function record(props) {
113 113
             dataIndex: 'targetType',
114 114
             key: 'targetType',
115 115
             align: 'center',
116
-            render: (_, record) => <><span>{getType(record.targetType)} {'【' + record.targetName + '】'}</span></>
116
+            render: (_, record) => <><span>{getType(record.targetType)} {record.targetName ? '【' + record.targetName + '】' : ''}</span></>
117 117
         },
118 118
         {
119 119
             title: '姓名',
@@ -146,7 +146,7 @@ function record(props) {
146 146
     ];
147 147
 
148 148
     const { getFieldDecorator } = props.form
149
-    
149
+
150 150
     let row = 0
151 151
 
152 152
     return (