dingxin 5 anni fa
parent
commit
b8a92ed888

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

@@ -20,7 +20,7 @@ const CitySelect = (props) => {
20 20
 
21 21
   const getCityList = (e) => {
22 22
     request({
23
-        url: '/api/admin/tdCity',
23
+        url: '/api/admin/tdCityList/tdCity',
24 24
         method: 'GET',
25 25
         params: {leveltype: 2, pageNum: 1,pageSize: 999},
26 26
         action: 'select',
@@ -29,10 +29,18 @@ const CitySelect = (props) => {
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 40
   return (
33 41
       <Select 
34 42
       showSearch 
35
-      value={props.value} 
43
+      value={getValue()} 
36 44
       style={{ width: '180px' }}
37 45
       placeholder="请选择城市" 
38 46
       onChange={props.onChange} 

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

@@ -73,7 +73,10 @@ function AddBuilding(props) {
73 73
       }
74 74
 
75 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 80
       res.mapCoordinate = res.coordinate
78 81
       if (res.videoUrl) {
79 82
         res.videoUrl = [].concat(res.videoUrl)