| | |
| | | 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; |
| | |
| | | ...currentFile, |
| | | url: URL.createObjectURL(currentFile.originFile), |
| | | }); |
| | | setScanContent(fileView.response.data.ocrResult.wordsResult[0]) |
| | | |
| | | |
| | | }; |
| | | |
| | | const handleScaned = () => { |
| | | setScaned(true) |
| | | formRef.current.setFieldValue('scanContent', scanContent) |
| | | |
| | | const content = fileView.response.data.ocrResult.wordsResult.join('\n') |
| | | setTimeout(() => { |
| | | console.log(formRef.current, content); |
| | | formRef.current.setFieldValue('scanContent', content) |
| | | }, 0) |
| | | setScanContent(content) |
| | | } |
| | | |
| | | const handleText = () => { |
| | |
| | | setScanFile(false); |
| | | setScanImage(false); |
| | | setScaned(false); |
| | | |
| | | } |
| | | |
| | | |
| | | console.log(fileView, 'fileView') |
| | | console.log(scanContent, 'scanContent') |
| | | |
| | | return ( |
| | | <> |
| | | <Modal style={{ width: '1200px' }} visible={visible} onCancel={onCancel} title='识别上传材料' centered footer={null}> |
| | | |
| | | <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} |
| | | onCancel={onCancel} |
| | | title='识别上传材料' |
| | | centered |
| | | footer={null} |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | > |
| | | <Form |
| | | layout='vertical' |
| | | requiredSymbol={false} |
| | |
| | | |
| | | </Form> |
| | | |
| | | </Modal> |
| | | <Modal style={{ width: '944px' }} visible={scanImage} onCancel={() => setScanImage(false)} footer={null} title='选择识别范围' centered> |
| | | <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={scaned} onCancel={() => setScaned(false)} footer={null} title='识别上传材料' centered> |
| | | </Modal > |
| | | <Modal |
| | | className='scan-modal' |
| | | // style={{ width: '1200px' }} |
| | | wrapStyle={{ zIndex: 1002 }} |
| | | visible={scaned} |
| | | onCancel={() => setScaned(false)} |
| | | footer={null} |
| | | title='识别上传材料' |
| | | centered |
| | | unmountOnExit={true} |
| | | maskClosable={false} |
| | | mountOnEnter={false} |
| | | > |
| | | <Form |
| | | ref={formRef} |
| | | layout='vertical' |
| | |
| | | wrapperStyle={{ width: '100%' }} |
| | | onChange={(v) => console.log(v, 'vvvvvv')} |
| | | /> |
| | | <div style={{ marginTop: '24px' }}><Button type="primary" onClick={() => { handleText() }}>使用文字</Button></div> |
| | | </FormItem> |
| | | |
| | | <div style={{ marginTop: '24px' }}><Button type="primary" onClick={() => { handleText() }}>使用文字</Button></div> |
| | | </Form> |
| | | </Modal> |
| | | |