Browse Source

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

魏超 5 years ago
parent
commit
7e7654dfe7

+ 63
- 0
src/components/SelectButton/AreaSelect.jsx View File

@@ -0,0 +1,63 @@
1
+import React, { useState, useEffect } from 'react';
2
+import { Select } from 'antd';
3
+
4
+import request from '../../utils/request'
5
+
6
+const { Option } = Select;
7
+
8
+/**
9
+ *
10
+ *
11
+ * @param {*} props
12
+ * @returns
13
+ */
14
+const CitySelect = (props) => {
15
+  const [ data, setData ] = useState([])
16
+  const cityId = typeof props.cityId === 'function' ? props.cityId() : props.cityId
17
+
18
+  useEffect(() => {
19
+    getCityAreaList();
20
+    getValue();
21
+  },[cityId])
22
+
23
+  const getCityAreaList = (e) => {
24
+    request({
25
+        url: '/api/admin/tdCityList/tdAreaCity',
26
+        method: 'GET',
27
+        params: {leveltype: 3, cityId},
28
+        action: 'select',
29
+    }).then((data) => {
30
+        setData(data)
31
+    })
32
+  }
33
+
34
+  /**
35
+   * 因为 有个需求是,如果这个城市被删除了,那么就直接展示为空,不能展示 cityId
36
+   */
37
+  const getValue = () => {
38
+    if (props.value) {
39
+      const tempData = data.filter(f => f.id == props.value)
40
+      const va = (tempData.length > 0) ? props.value : undefined
41
+      props.onChange(va)
42
+    }
43
+  }
44
+
45
+  return (
46
+      <Select
47
+      {...props}
48
+      showSearch
49
+      value={props.value}
50
+      style={{ width: '300px' }}
51
+      placeholder="请选择城市"
52
+      onChange={props.onChange}
53
+      filterOption={(input, option) =>
54
+        option.props.children.toLowerCase().indexOf(input.toLowerCase()) >= 0
55
+      }
56
+      >
57
+          {data.map(city => (
58
+            <Option key={city.id} value={city.name}>{city.name}</Option>
59
+          ))}
60
+      </Select>
61
+  )
62
+}
63
+export default CitySelect

+ 5
- 5
src/pages/Index.jsx View File

@@ -29,32 +29,32 @@ const index = (props) => {
29 29
         {
30 30
             title: '客户列表',
31 31
             img: customerImg,
32
-            path: '',
32
+            path: '/customer/customerlist/list',
33 33
             value: '2',
34 34
         },
35 35
         {
36 36
             title: '数据报表',
37 37
             img: reportImg,
38
-            path: '',
38
+            path: '/statistical/monitor',
39 39
             value: '3',
40 40
         },
41 41
 
42 42
         {
43 43
             title: '项目统计',
44 44
             img: projectImg,
45
-            path: '',
45
+            path: '/statistical/building',
46 46
             value: '4',
47 47
         },
48 48
         {
49 49
             title: '活动统计',
50 50
             img: statisticsImg,
51
-            path: '',
51
+            path: '/statistical/activity',
52 52
             value: '5',
53 53
         },
54 54
         {
55 55
             title: '置业顾问KPI',
56 56
             img: consultantImg,
57
-            path: '',
57
+            path: '/statistical/consultant',
58 58
             value: '6',
59 59
         },
60 60
 

+ 14
- 2
src/pages/building/list/add/components/base.jsx View File

@@ -15,6 +15,7 @@ import Amap from './amap'
15 15
 import BudildingProjectType from './buildingProjectType'
16 16
 import DragableUploadImageList from '@/components/DragableUploadImageList'
17 17
 import SelectCity from '../../../../../components/SelectButton/CitySelect'
18
+import AreaSelect from '../../../../../components/SelectButton/AreaSelect'
18 19
 import FileUpload from '@/components/XForm/FileUpload';
19 20
 import { POI_TYPES_KETY, getAroundData, getPOIType, POI_TYPES } from './amapAroundData'
20 21
 
@@ -48,6 +49,7 @@ function AddBuilding(props) {
48 49
   const [poi, setPoi] = useState([])
49 50
   const [videoImage, setVideoImage] = useState(false)
50 51
   const [typeState, setTypeState] = useState("rich")
52
+  const [cityId, setCityId] = useState("")
51 53
 
52 54
   // 存放所以 buildingData 基础信息
53 55
   const [buildingData, setBuildingData] = useState({})
@@ -121,6 +123,7 @@ function AddBuilding(props) {
121 123
       res.buildingRestaurant = stringHandleTag(res.buildingRestaurant)
122 124
 
123 125
       setBuildingData(res)
126
+
124 127
       props.form.setFieldsValue(res)
125 128
       // console.log('mapJson: ', JSON.parse(res.mapJson))
126 129
       setPoi((res.mapJson && JSON.parse(res.mapJson)) || [])
@@ -324,6 +327,15 @@ function AddBuilding(props) {
324 327
     return newPoi
325 328
   }
326 329
 
330
+  function cityChange(e) {
331
+    setCityId(e)
332
+    setTimeout(()=>{
333
+      props.form.setFieldsValue({
334
+          'buildingArea': buildingData.buildingArea
335
+      })
336
+  },0)
337
+  }
338
+
327 339
   function setFormMapScopeTagValue(keyType, item) {
328 340
     const tag = item.data.map(t => ({ tagName: t.name, delete: true, automatic: true }))
329 341
     switch (keyType) {
@@ -487,13 +499,13 @@ function AddBuilding(props) {
487 499
             {getFieldDecorator('cityId', {
488 500
               rules: [{ required: true, message: '请选择城市' }],
489 501
             })(
490
-              <SelectCity />,
502
+              <SelectCity onChange={(e) => cityChange(e)}/>,
491 503
             )}
492 504
           </Form.Item>
493 505
           <Form.Item label="楼盘区域" >
494 506
             {getFieldDecorator('buildingArea', {
495 507
               rules: [{ required: true, message: '请输入楼盘区域' }],
496
-            })(<Input />)}
508
+            })(<AreaSelect cityId={cityId}/>)}
497 509
           </Form.Item>
498 510
           <Form.Item label="项目地址" >
499 511
             {getFieldDecorator('address', {

+ 1
- 0
src/pages/carouselFigure/advertisingList.jsx View File

@@ -210,6 +210,7 @@ const handleSubmit = (e, props) => {
210 210
    //重置搜索
211 211
    function handleReset() {
212 212
     props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'screen' });
213 214
   }
214 215
 
215 216
 

+ 1
- 0
src/pages/carouselFigure/carouselFigureList.jsx View File

@@ -208,6 +208,7 @@ const handleSubmit = (e, props) => {
208 208
    //重置搜索
209 209
    function handleReset() {
210 210
     props.form.resetFields();
211
+    getList({ pageNum: 1, pageSize: 10, showType: 'banner' });
211 212
   }
212 213
 
213 214
   const { getFieldDecorator } = props.form

+ 1
- 0
src/pages/carouselFigure/propagandaList.jsx View File

@@ -210,6 +210,7 @@ const handleSubmit = (e, props) => {
210 210
    //重置搜索
211 211
    function handleReset() {
212 212
     props.form.resetFields();
213
+    getList({ pageNum: 1, pageSize: 10, showType: 'propaganda' });
213 214
   }
214 215
 
215 216
 

+ 1
- 1
src/pages/charts/CityNums.jsx View File

@@ -40,7 +40,7 @@ const geoOptions = {
40 40
   },
41 41
 }
42 42
 
43
-const getCityData = fetch(apis.indexEcharts.userCity)
43
+const getCityData = fetch(apis.indexEcharts.personCity)
44 44
 
45 45
 const mapDataRange = x => {
46 46
   // 映射区间 [1, 100000] => [rangeStart, rangeEnd]

+ 1
- 0
src/pages/news/list/NewsList.jsx View File

@@ -255,6 +255,7 @@ function body(props) {
255 255
   //重置搜索
256 256
   function handleReset() {
257 257
     props.form.resetFields();
258
+    getList({ pageNum: 1, pageSize: 6 })
258 259
   }
259 260
 
260 261
   function getDate(value, dateString) {

+ 5
- 0
src/services/apis.js View File

@@ -424,6 +424,11 @@ export default {
424 424
       url: `${prefix}/selectCityUser`,
425 425
       action: 'admin.selectCityUser.get',
426 426
     },
427
+    personCity: {
428
+      method: 'get',
429
+      url: `${prefix}/selectCityPerson`,
430
+      action: 'admin.selectCityPerson.get',
431
+    },
427 432
     indexBanner: {
428 433
       method: 'get',
429 434
       url: `${prefix}/listNoticeByCondition`,