dingxin 5 years ago
parent
commit
b8a92ed888

+ 10
- 2
src/components/SelectButton/CitySelect.jsx View File

20
 
20
 
21
   const getCityList = (e) => {
21
   const getCityList = (e) => {
22
     request({
22
     request({
23
-        url: '/api/admin/tdCity',
23
+        url: '/api/admin/tdCityList/tdCity',
24
         method: 'GET',
24
         method: 'GET',
25
         params: {leveltype: 2, pageNum: 1,pageSize: 999},
25
         params: {leveltype: 2, pageNum: 1,pageSize: 999},
26
         action: 'select',
26
         action: 'select',
29
     })
29
     })
30
   }
30
   }
31
 
31
 
32
+  const getValue = () => {
33
+    const tempData = data.filter(f => f.id == props.value)
34
+    console.log("城市组价:", tempData)
35
+    const va = (tempData.length > 0) ? props.value : undefined
36
+    // props.onChange(va)
37
+    return va
38
+  }
39
+
32
   return (
40
   return (
33
       <Select 
41
       <Select 
34
       showSearch 
42
       showSearch 
35
-      value={props.value} 
43
+      value={getValue()} 
36
       style={{ width: '180px' }}
44
       style={{ width: '180px' }}
37
       placeholder="请选择城市" 
45
       placeholder="请选择城市" 
38
       onChange={props.onChange} 
46
       onChange={props.onChange} 

+ 4
- 1
src/pages/building/list/add/components/base.jsx View File

73
       }
73
       }
74
 
74
 
75
       res.avatarImage = res.buildingImg.map(item => item.url)
75
       res.avatarImage = res.buildingImg.map(item => item.url)
76
-      res.listImage = res.buildingListImg.map(item => item.url)
76
+      
77
+      if (res.buildingListImg) {
78
+        res.listImage = res.buildingListImg.map(item => item.url)
79
+      }
77
       res.mapCoordinate = res.coordinate
80
       res.mapCoordinate = res.coordinate
78
       if (res.videoUrl) {
81
       if (res.videoUrl) {
79
         res.videoUrl = [].concat(res.videoUrl)
82
         res.videoUrl = [].concat(res.videoUrl)