Commit 02ff7601 authored by XieZhiXiong's avatar XieZhiXiong

chore: 修改 beforeUpload 返回值

parent bab59ea8
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd'; import { Button, Card, Spin, Badge, message, Upload } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { ArrayTable } from '@formily/antd-components'; import { ArrayTable } from '@formily/antd-components';
import { history, Link, Prompt } from 'umi'; import { history, Link, Prompt } from 'umi';
...@@ -554,8 +554,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({ ...@@ -554,8 +554,9 @@ const ExchangeForm: React.FC<BillsFormProps> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 20) { if (file.size / 1024 / 1024 > 20) {
message.warning('图片大小超过20M'); message.warning('图片大小超过20M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const handleGoodsConfirm = values => { const handleGoodsConfirm = values => {
......
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd'; import { Button, Card, Spin, Badge, message, Upload } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { DeleteOutlined } from '@ant-design/icons'; import { DeleteOutlined } from '@ant-design/icons';
import { ArrayTable } from '@formily/antd-components'; import { ArrayTable } from '@formily/antd-components';
...@@ -483,8 +483,9 @@ const RepairForm: React.FC<BillsFormProps> = ({ ...@@ -483,8 +483,9 @@ const RepairForm: React.FC<BillsFormProps> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 20) { if (file.size / 1024 / 1024 > 20) {
message.warning('图片大小超过20M'); message.warning('图片大小超过20M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const handleGoodsConfirm = values => { const handleGoodsConfirm = values => {
......
import React, { useState, useEffect, useMemo } from 'react'; import React, { useState, useEffect, useMemo } from 'react';
import { Button, Card, Spin, Badge, message } from 'antd'; import { Button, Card, Spin, Badge, message, Upload } from 'antd';
import { ColumnType } from 'antd/lib/table/interface'; import { ColumnType } from 'antd/lib/table/interface';
import { ArrayTable } from '@formily/antd-components'; import { ArrayTable } from '@formily/antd-components';
import { history, Prompt, Link } from 'umi'; import { history, Prompt, Link } from 'umi';
...@@ -573,8 +573,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({ ...@@ -573,8 +573,9 @@ const ReturnForm: React.FC<BillsFormProps> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 20) { if (file.size / 1024 / 1024 > 20) {
message.warning('图片大小超过20M'); message.warning('图片大小超过20M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const handleGoodsConfirm = values => { const handleGoodsConfirm = values => {
......
...@@ -121,8 +121,9 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({ ...@@ -121,8 +121,9 @@ const QuotaApplicationInfo: React.FC<QuotaApplicationInfo> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 20) { if (file.size / 1024 / 1024 > 20) {
message.warning('图片大小超过20M'); message.warning('图片大小超过20M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
return ( return (
......
...@@ -2,11 +2,11 @@ ...@@ -2,11 +2,11 @@
* @Author: XieZhiXiong * @Author: XieZhiXiong
* @Date: 2021-01-13 13:46:08 * @Date: 2021-01-13 13:46:08
* @LastEditors: XieZhiXiong * @LastEditors: XieZhiXiong
* @LastEditTime: 2021-01-22 15:24:39 * @LastEditTime: 2021-06-17 10:22:59
* @Description: 上传凭证弹窗 * @Description: 上传凭证弹窗
*/ */
import React, { useState, useEffect } from 'react'; import React, { useState, useEffect } from 'react';
import { Modal, message } from 'antd'; import { Modal, message, Upload } from 'antd';
import styled from 'styled-components'; import styled from 'styled-components';
import { createFormActions } from '@formily/antd'; import { createFormActions } from '@formily/antd';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
...@@ -101,8 +101,9 @@ const UploadVoucherModal: React.FC<UploadVoucherModalProps> = (props: UploadVouc ...@@ -101,8 +101,9 @@ const UploadVoucherModal: React.FC<UploadVoucherModalProps> = (props: UploadVouc
const beforeUploadVoucher = file => { const beforeUploadVoucher = file => {
if (file.size / 1024 > 200) { if (file.size / 1024 > 200) {
message.warning('图片大小超过200K'); message.warning('图片大小超过200K');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const handleUploadVoucherSubmit = values => { const handleUploadVoucherSubmit = values => {
......
...@@ -2,27 +2,21 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,27 +2,21 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, message,
message, Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import moment from 'moment'; import { createFormActions } from '@formily/antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { usePageStatus } from '@/hooks/usePageStatus';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi'; import { normalizeFiledata, FileData } from '@/utils';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../components/EvaluationList'; import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -97,8 +91,9 @@ const ReceivedDetail: React.FC = () => { ...@@ -97,8 +91,9 @@ const ReceivedDetail: React.FC = () => {
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
...@@ -2,26 +2,22 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,26 +2,22 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, Button,
message, message,
Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons'; import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi'; import { normalizeFiledata, FileData } from '@/utils';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../../components/EvaluationList'; import EvaluationList from '../../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -143,8 +139,9 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -143,8 +139,9 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
...@@ -2,27 +2,25 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,27 +2,25 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, Button,
message, message,
Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons'; import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history, Prompt } from 'umi'; import { history, Prompt } from 'umi';
import moment from 'moment'; import moment from 'moment';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi'; import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi';
import { normalizeFiledata } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../utils'; import { normalizeUnevaluatedList } from '../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../components/EvaluationList'; import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -129,8 +127,9 @@ const EvaluateOrder: React.FC = () => { ...@@ -129,8 +127,9 @@ const EvaluateOrder: React.FC = () => {
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
...@@ -2,27 +2,21 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,27 +2,21 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, message,
message, Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import moment from 'moment'; import { createFormActions } from '@formily/antd';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { usePageStatus } from '@/hooks/usePageStatus';
import { usePageStatus, PageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils'; import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../components/EvaluationList'; import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
...@@ -100,8 +94,9 @@ const ReceivedDetail: React.FC = () => { ...@@ -100,8 +94,9 @@ const ReceivedDetail: React.FC = () => {
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
...@@ -2,25 +2,22 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,25 +2,22 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, Button,
message, message,
Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons'; import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history } from 'umi'; import { history } from 'umi';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi'; import { normalizeFiledata, FileData } from '@/utils';
import { normalizeFiledata, FileData, isJSONStr } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../../components/EvaluationList'; import EvaluationList from '../../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -142,8 +139,9 @@ const DetailInfo: React.FC<DetailInfoProps> = ({ ...@@ -142,8 +139,9 @@ const DetailInfo: React.FC<DetailInfoProps> = ({
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
...@@ -2,27 +2,25 @@ import React, { useState, useEffect } from 'react'; ...@@ -2,27 +2,25 @@ import React, { useState, useEffect } from 'react';
import { import {
PageHeader, PageHeader,
Descriptions, Descriptions,
Card,
Spin, Spin,
Button, Button,
message, message,
Upload,
} from 'antd'; } from 'antd';
import { FormOutlined } from '@ant-design/icons'; import { FormOutlined } from '@ant-design/icons';
import { PageHeaderWrapper } from '@ant-design/pro-layout'; import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { history, Prompt } from 'umi'; import { history, Prompt } from 'umi';
import moment from 'moment'; import moment from 'moment';
import { createFormActions, FormEffectHooks, FormPath } from '@formily/antd'; import { createFormActions, FormEffectHooks } from '@formily/antd';
import { usePageStatus } from '@/hooks/usePageStatus'; import { usePageStatus } from '@/hooks/usePageStatus';
import { PublicApi } from '@/services/api'; import { PublicApi } from '@/services/api';
import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi'; import { GetOrderPurchaseOrderDetailsResponse } from '@/services/OrderApi';
import { normalizeFiledata } from '@/utils';
import AvatarWrap from '@/components/AvatarWrap'; import AvatarWrap from '@/components/AvatarWrap';
import NiceForm from '@/components/NiceForm'; import NiceForm from '@/components/NiceForm';
import { normalizeUnevaluatedList } from '../../utils'; import { normalizeUnevaluatedList } from '../../utils';
import { evaluateSchema } from './schema'; import { evaluateSchema } from './schema';
import { createEffects } from './effects'; import { createEffects } from './effects';
import EvaluationList from '../../components/EvaluationList'; import EvaluationList from '../../components/EvaluationList';
import styles from './index.less';
const formActions = createFormActions(); const formActions = createFormActions();
const { const {
...@@ -129,8 +127,9 @@ const EvaluateOrder: React.FC = () => { ...@@ -129,8 +127,9 @@ const EvaluateOrder: React.FC = () => {
const beforeUpload = file => { const beforeUpload = file => {
if (file.size / 1024 / 1024 > 10) { if (file.size / 1024 / 1024 > 10) {
message.warning('图片大小超过10M'); message.warning('图片大小超过10M');
return Promise.reject(); return Upload.LIST_IGNORE;
} }
return Promise.resolve();
}; };
const UploadTip = ( const UploadTip = (
......
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