1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- import React, { Component } from "react";
- import { Modal, Icon, Upload } from "antd";
- import { timingSafeEqual } from "crypto";
- import ImgList from "../../../../common/imgList";
- class PicturesWall extends Component {
- constructor(props) {
- super(props);
- this.state = {
- previewVisible: false,
- previewImage: "",
- fileList: this.props.pictureUrl
- };
- this.handleCancel = this.handleCancel.bind(this);
- this.handleChange = this.handleChange.bind(this);
- this.handlePreview = this.handlePreview.bind(this);
- }
- handleCancel() {
- this.setState({
- previewVisible: false
- });
- }
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true
- });
- }
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({
- fileList
- });
- this.props.fileList(fileList);
- }
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- this.state.pojectApplicationUrl = undefined;
- }
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
- <div>
- <Icon type="plus" />
- <div className="ant-upload-text">点击上传</div>
- </div>
- );
- return (
- <div style={{ display: "inline-block" }}>
- <ImgList
- domId={this.props.domId}
- uploadConfig={{
- action:globalConfig.context + this.props.url,
- data:{ sign: this.props.sign },
- multiple:true,
- listType:"picture-card",
- }}
- onChange={(infor)=>{
- this.handleChange(infor)
- }}
- fileList={fileList}
- />
- </div>
- );
- }
- }
- export default PicturesWall;
|