|
@@ -44,6 +44,7 @@ function AddBuilding(props) {
|
44
|
44
|
const { getFieldDecorator } = props.form;
|
45
|
45
|
|
46
|
46
|
const [poi, setPoi] = useState([])
|
|
47
|
+ const [videoImage, setVideoImage] = useState(false)
|
47
|
48
|
|
48
|
49
|
// console.log('props.building: ', props.building)
|
49
|
50
|
const { buildingId } = props.building
|
|
@@ -75,6 +76,7 @@ function AddBuilding(props) {
|
75
|
76
|
res.mapCoordinate = res.coordinate
|
76
|
77
|
if (res.videoUrl) {
|
77
|
78
|
res.videoUrl = [].concat(res.videoUrl)
|
|
79
|
+ setVideoImage(true)
|
78
|
80
|
}
|
79
|
81
|
if (res.videoImage) {
|
80
|
82
|
res.videoImage = res.videoImage[0].url
|
|
@@ -134,6 +136,7 @@ function AddBuilding(props) {
|
134
|
136
|
// console.log('视频文件上传前 回调: ', file, fileList)
|
135
|
137
|
return new Promise((resolve, reject) => {
|
136
|
138
|
if (file.type === 'video/mp4' || file.type === '.mp4') {
|
|
139
|
+ setVideoImage(true)
|
137
|
140
|
resolve(file)
|
138
|
141
|
} else {
|
139
|
142
|
openNotificationWithIcon('error', '项目视频,仅支持MP4格式')
|
|
@@ -293,7 +296,7 @@ function AddBuilding(props) {
|
293
|
296
|
</Form.Item>
|
294
|
297
|
<Form.Item label="视频封面图" help="建议图片尺寸:750*600px,比例5:4,格式:jpg,用于视频封面" >
|
295
|
298
|
{getFieldDecorator('videoImage', {
|
296
|
|
- rules: [{ required: true, message: '请选择视频封面图' }],
|
|
299
|
+ rules: [{ required: videoImage, message: '请选择视频封面图' }],
|
297
|
300
|
})(
|
298
|
301
|
<ImageUpload />,
|
299
|
302
|
)}
|