|
@@ -88,8 +88,11 @@ class ModalImage extends React.Component {
|
88
|
88
|
|
89
|
89
|
// 网路请求
|
90
|
90
|
request({ ...apis.building.buildingApartmentGetById, urlData: { id: apartmentId }, params: { ...params } }).then(res => {
|
91
|
|
- // res.img = res.buildingImgList.map((item, _) => item.url)
|
92
|
|
- res.img = res.buildingImgList.map(item => item.url)
|
|
91
|
+ // res.img = res.buildingImgList.map(item => item.url)
|
|
92
|
+ if (res.buildingImgList) {
|
|
93
|
+ res.img = res.buildingImgList[0].url
|
|
94
|
+ }
|
|
95
|
+
|
93
|
96
|
this.props.form.setFieldsValue(res)
|
94
|
97
|
}).catch(err => {
|
95
|
98
|
this.openNotificationWithIcon('error', err)
|
|
@@ -116,7 +119,8 @@ class ModalImage extends React.Component {
|
116
|
119
|
|
117
|
120
|
submitData(data) {
|
118
|
121
|
// TODO 这里应该是要支持多图,但是封装的控件没有
|
119
|
|
- data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
|
|
122
|
+ // data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
|
|
123
|
+ data.img = [{ imgType: 'aparment', url: data.img, orderNo: 0 }]
|
120
|
124
|
data.buildingId = this.props.visibleData.buildingId;
|
121
|
125
|
data.apartmentType = 'apart'
|
122
|
126
|
const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
|
|
@@ -186,7 +190,8 @@ class ModalImage extends React.Component {
|
186
|
190
|
{getFieldDecorator('img', {
|
187
|
191
|
rules: [{ required: true, message: '请上传户型图片' }],
|
188
|
192
|
})(
|
189
|
|
- <ImageListUpload />,
|
|
193
|
+ // <ImageListUpload />,
|
|
194
|
+ <ImageUpload />,
|
190
|
195
|
)}
|
191
|
196
|
</Form.Item>
|
192
|
197
|
<Form.Item label="面积" help="单位 ㎡">
|