Commit d9716c7c authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

Merge branch 'dev-srm' of http://10.0.0.22:3000/lingxi/lingxi-business-paltform into dev-srm

parents 2a6d1e50 a06d1609
......@@ -284,6 +284,7 @@ export const formSchema: ISchema = {
},
beforeUpload: '{{beforeUpload}}',
onChange: '{{onUploadChange}}',
headers: '{{ token }}',
accept: '.xls, .xlsx, .doc, .docx, .wps, .pdf, .jpg, .png, .jpeg',
},
'x-rules': [
......
......@@ -12,6 +12,7 @@ import { usePageStatus, PageStatus } from '@/hooks/usePageStatus'
import NiceForm from '@/components/NiceForm'
import ReutrnEle from '@/components/ReturnEle';
import { formatTimeString } from '@/utils'
import { getAuth } from '@/utils/auth'
import { formSchema } from './schema'
......@@ -32,7 +33,8 @@ const SignUpForm = () => {
const [formLoading, setFormLoading] = useState(false);
const [btnLoading, setBtnLoading] = useState(false);
const [refundDisabled, setRefundDisabled] = useState(false);
const [formValue, setFormValue] = useState<any>({areas: []});
const [formValue, setFormValue] = useState<any>({ areas: [] });
const { token } = getAuth() || {}
const getCountryCodeId = async () => {
......@@ -141,6 +143,7 @@ const SignUpForm = () => {
expressionScope={{
beforeUpload,
onUploadChange: handleUploadChange,
token: { token }
}}
/>
</Card>
......
......@@ -3,6 +3,8 @@ import { Modal, Form, Input, Upload, Button, message } from 'antd';
import { UPLOAD_TYPE } from '@/constants'
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
import { getAuth } from '@/utils/auth'
import styles from './index.less';
......@@ -13,11 +15,13 @@ interface SubmitResultModalProps {
onOk?: Function,
}
const SubmitResultModal:React.FC<SubmitResultModalProps> = (props: any) => {
const SubmitResultModal: React.FC<SubmitResultModalProps> = (props: any) => {
const { title, visible, onCancel, onOk } = props;
const [form] = Form.useForm();
const [files, setFiles] = useState([]);
const [loading, setloading] = useState(false);
const { token } = getAuth() || {}
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
......@@ -52,7 +56,7 @@ const SubmitResultModal:React.FC<SubmitResultModalProps> = (props: any) => {
const formSubmit = () => {
form.validateFields().then(res => {
onOk && onOk(res.opinion,files);
onOk && onOk(res.opinion, files);
})
}
......@@ -104,6 +108,7 @@ const SubmitResultModal:React.FC<SubmitResultModalProps> = (props: any) => {
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
headers={{ token }}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
......
......@@ -11,6 +11,7 @@ import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons'
import moment from 'moment';
import { UPLOAD_TYPE } from '@/constants'
import { getAuth } from '@/utils/auth'
import styles from './index.less';
......@@ -34,6 +35,8 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
const [files, setFiles] = useState<any>([]);
const [loading, setloading] = useState(false);
const [form] = Form.useForm();
const { token } = getAuth() || {}
useEffect(() => {
currentRef.current = {
......@@ -170,6 +173,7 @@ const BidRequirement: React.FC<Iprops> = (props: any) => {
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
headers={{ token }}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
......
......@@ -3,6 +3,8 @@ import { Form, Button, Upload, message } from 'antd';
import { UploadOutlined, DeleteOutlined, LinkOutlined } from '@ant-design/icons';
import { UPLOAD_TYPE } from '@/constants'
import { getAuth } from '@/utils/auth'
import styles from './index.less';
const layout: any = {
......@@ -22,6 +24,8 @@ const File: React.FC<IProps> = (props) => {
const [form] = Form.useForm();
const [files, setFiles] = useState(fetchdata || []);
const [loading, setloading] = useState(false);
const { token } = getAuth() || {}
/**判断文件类型和大小 */
const beforeDocUpload = (file: any) => {
const isLt20M = file.size / 1024 / 1024 < 20;
......@@ -103,6 +107,7 @@ const File: React.FC<IProps> = (props) => {
accept='.doc,.docx,.pdf,.ppt,.pptx,.xls,.xlsx'
beforeUpload={beforeDocUpload}
onChange={handleChange}
headers={{ token }}
>
<Button loading={loading} icon={<UploadOutlined />}>上传文件</Button>
<div style={{ marginTop: '8px' }}>一次上传一个文件,每个附件大小不能超过 20M</div>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment