| | |
| | | import * as $$ from '@/utils/utility'; |
| | | import { Form, Input, Modal, Upload } from '@arco-design/web-react'; |
| | | import { IconLink } from '@arco-design/web-react/icon'; |
| | | |
| | | import './index.less' |
| | | |
| | | const FormItem = Form.Item; |
| | | const appUrl = $$.appUrl; |
| | |
| | | const handleScaned = () => { |
| | | setScaned(true) |
| | | const content = fileView.response.data.ocrResult.wordsResult.join('\n') |
| | | |
| | | setTimeout(() => { |
| | | console.log(formRef.current, content); |
| | | formRef.current.setFieldValue('scanContent', content) |
| | |
| | | |
| | | return ( |
| | | <> |
| | | |
| | | <Modal |
| | | style={{ width: '944px' }} |
| | | visible={scanImage} |
| | | onCancel={() => setScanImage(false)} |
| | | footer={null} |
| | | title='选择识别范围' |
| | | centered |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | > |
| | | <img |
| | | src={fileView?.url} |
| | | alt="" |
| | | style={{ |
| | | display: 'block', |
| | | margin: 'auto', |
| | | maxWidth: '100%', |
| | | maxHeight: '100%', |
| | | objectFit: 'contain', |
| | | }} |
| | | /> |
| | | <div><Button type="primary" onClick={() => handleScaned()} style={{ marginTop: '20px' }}>开始识别</Button></div> |
| | | </Modal> |
| | | <Modal |
| | | style={{ width: '1200px' }} |
| | | visible={visible} |
| | |
| | | }} |
| | | tip='支持png、 jpg、pdf等格式文件上传,每次上传大小不超过10M' |
| | | showUploadList={{ |
| | | // Please dont remove this comment |
| | | fileIcon: <IconLink style={{ color: '#1D2129' }} />, |
| | | }} |
| | | // onChange={(info, currentFile) => { |
| | |
| | | |
| | | </Form> |
| | | |
| | | </Modal> |
| | | </Modal > |
| | | <Modal |
| | | style={{ width: '944px' }} |
| | | visible={scanImage} |
| | | onCancel={() => setScanImage(false)} |
| | | footer={null} |
| | | title='选择识别范围' |
| | | centered |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | > |
| | | <img |
| | | src={fileView?.url} |
| | | alt="" |
| | | style={{ |
| | | display: 'block', |
| | | margin: 'auto', |
| | | maxWidth: '100%', |
| | | maxHeight: '100%', |
| | | objectFit: 'contain', |
| | | }} |
| | | /> |
| | | <div><Button type="primary" onClick={() => handleScaned()} style={{ marginTop: '20px' }}>开始识别</Button></div> |
| | | </Modal> |
| | | <Modal |
| | | className='scan-modal' |
| | | style={{ width: '1200px' }} |
| | | wrapStyle={{ zIndex: 1002 }} |
| | | visible={scaned} |
| | | onCancel={() => setScaned(false)} |
| | | footer={null} |