weiximei 5 years ago
parent
commit
7553b80f4f

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

13
 const saleType = [
13
 const saleType = [
14
   {
14
   {
15
     id: 1,
15
     id: 1,
16
-    name: '待',
16
+    name: '待',
17
   },
17
   },
18
   {
18
   {
19
     id: 2,
19
     id: 2,

+ 9
- 4
src/pages/building/list/add/components/modalImage.jsx View File

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