weiximei 5 years ago
parent
commit
cfa59e557e

+ 6
- 1
src/components/XForm/ImageListUpload.jsx View File

3
 import './style.less';
3
 import './style.less';
4
 import { uploaderProps } from '../../utils/upload';
4
 import { uploaderProps } from '../../utils/upload';
5
 
5
 
6
+/**
7
+ * unlimited  属性表示上传图片无限制
8
+ * 例子: <ImageListUpload unlimited/>
9
+ */
6
 class ImageListUpload extends React.Component {
10
 class ImageListUpload extends React.Component {
7
   state = {
11
   state = {
8
     previewVisible: false,
12
     previewVisible: false,
79
           { ...uploaderProps }
83
           { ...uploaderProps }
80
           onSuccess={this.handleUploadSucess}
84
           onSuccess={this.handleUploadSucess}
81
         >
85
         >
82
-          {(fileList || images).length >= 8 ? null : uploadButton}
86
+          {/* unlimited 表示上传无限制数量 */}
87
+          {(this.props.unlimited && uploadButton) || ((fileList || images).length >= 8 ? null : uploadButton)}
83
         </Upload>
88
         </Upload>
84
         <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
89
         <Modal visible={previewVisible} footer={null} onCancel={this.handleCancel}>
85
           <img alt="example" style={{ width: '100%' }} src={previewImage} />
90
           <img alt="example" style={{ width: '100%' }} src={previewImage} />

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

16
       <span>效果图(10)</span>
16
       <span>效果图(10)</span>
17
       <Button type="link" style={{ color: 'blue' }}>重命名</Button>
17
       <Button type="link" style={{ color: 'blue' }}>重命名</Button>
18
       <Button type="link" style={{ color: 'blue' }}>删除相册</Button>
18
       <Button type="link" style={{ color: 'blue' }}>删除相册</Button>
19
-      <ImageListUpload value={imageList} onChange={onImageChange}/>
19
+      <ImageListUpload value={imageList} onChange={onImageChange} unlimited/>
20
     </>
20
     </>
21
   )
21
   )
22
 }
22
 }

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

118
     // TODO 这里应该是要支持多图,但是封装的控件没有
118
     // TODO 这里应该是要支持多图,但是封装的控件没有
119
     data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
119
     data.img = data.img.map((item, index) => ({ imgType: 'aparment', url: item, orderNo: index }))
120
     data.buildingId = this.props.visibleData.buildingId;
120
     data.buildingId = this.props.visibleData.buildingId;
121
+    data.apartmentType = 'apart'
121
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
122
     const api = data.apartmentId !== undefined ? apis.building.buildingApartmentUpdate : apis.building.buildingApartmentAdd;
122
 
123
 
123
     // 网路请求
124
     // 网路请求