Explorar el Código

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

魏超 hace 5 años
padre
commit
995b946174
Se han modificado 1 ficheros con 5 adiciones y 3 borrados
  1. 5
    3
      src/pages/building/list/add/components/base.jsx

+ 5
- 3
src/pages/building/list/add/components/base.jsx Ver fichero

@@ -55,7 +55,6 @@ function AddBuilding(props) {
55 55
      useEffect(() => {
56 56
       if (buildingId !== '') {
57 57
         getById(buildingId)
58
-        setPoi(POI_TYPES)
59 58
       }
60 59
     }, [])
61 60
   }
@@ -84,7 +83,7 @@ function AddBuilding(props) {
84 83
       if (res.videoImage) {
85 84
         res.videoImage = res.videoImage[0].url
86 85
       }
87
-      setPoi(res.mapJson || [])
86
+      // setPoi(res.mapJson || [])
88 87
       props.form.setFieldsValue(res)
89 88
       props.onSuccess(res)
90 89
     })
@@ -101,7 +100,10 @@ function AddBuilding(props) {
101 100
 
102 101
   function addBuilding(data) {
103 102
     // console.log('poi: ', poi)
104
-    data.mapJson = poi
103
+    if (poi.length !== 0) {
104
+      data.mapJson = poi
105
+    }
106
+    
105 107
     data.openingDate = moment(data.openingDate, 'yyyy-MM-dd HH:mm:ss')
106 108
     data.receivedDate = moment(data.receivedDate, 'yyyy-MM-dd HH:mm:ss')
107 109
     // 项目主图