Browse Source

fix multiple image in report k3

pull/2/head
ardhi 2 years ago
parent
commit
2fd03fccb6
  1. 25
      src/views/Report/k3/DialogForm.js

25
src/views/Report/k3/DialogForm.js

@ -1,7 +1,7 @@
import React, { Component } from 'react' import React, { Component } from 'react'
import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap'; import { Modal, ModalHeader, ModalBody, ModalFooter } from 'reactstrap';
import { Col, Row, Button, Form, FormGroup, Label, Input } from 'reactstrap'; import { Button, Form, FormGroup, Label, Input } from 'reactstrap';
import { Image } from 'antd'; import { Image, Col, Row } from 'antd';
import 'antd/dist/antd.css'; import 'antd/dist/antd.css';
import { BASE_SIMPRO_LUMEN_IMAGE } from '../../../const/ApiConst.js'; import { BASE_SIMPRO_LUMEN_IMAGE } from '../../../const/ApiConst.js';
export default class DialogForm extends Component { export default class DialogForm extends Component {
@ -43,12 +43,25 @@ export default class DialogForm extends Component {
} }
renderForm = () => { renderForm = () => {
const { dataImage } = this.props;
return( return(
<div style={{width:"100%",display:'flex',justifyContent:'center',textAlign:'center'}}> <div style={{justifyContent:'center'}}>
<Row gutter={[16, 16]}>
<Image.PreviewGroup>
{
dataImage && dataImage.length > 0 && dataImage.map((item, idx) =>
<Col span={8}>
<Image <Image
width={200} style={{width: 150, height: 200}}
src={`${BASE_SIMPRO_LUMEN_IMAGE}/${this.state.url}`} src={`${BASE_SIMPRO_LUMEN_IMAGE}/${item.image}`}
/> />
</Col>
)
}
</Image.PreviewGroup>
{ !dataImage || (dataImage && dataImage.length < 1) && <div style={{textAlign: 'center', color: 'red', flex: 1, padding: 20}}>No image available</div> }
</Row>
</div> </div>
) )
} }
@ -63,7 +76,7 @@ export default class DialogForm extends Component {
: null} : null}
</ModalBody> </ModalBody>
<ModalFooter> <ModalFooter>
<Button color="secondary" onClick={() => this.handleCancel()}>Close</Button>
</ModalFooter> </ModalFooter>
</Modal> </Modal>
) )

Loading…
Cancel
Save