|
@@ -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', {
|