Commit 5452ce6e authored by Sixiang_Zzb's avatar Sixiang_Zzb

用户模块批量上传优化

parent 8031fe53
...@@ -24,7 +24,7 @@ const ResultPageFailed = (props: any) => { ...@@ -24,7 +24,7 @@ const ResultPageFailed = (props: any) => {
subTitle={<p>server has been handled it ,please try again or back.</p>} subTitle={<p>server has been handled it ,please try again or back.</p>}
extra={[ extra={[
<Button type="primary" key="ok"> <Button type="primary" key="ok">
{/* <a href={'http://47.74.233.180:8651/tos/excel/down?operator_id=' + getCookie('id')}> {/* <a href={'http://47.74.233.180:8651/tos/excel/down?operator_id=' + resultId}>
Download Download
</a> */} </a> */}
<a href={'http://192.168.1.28:8651/tos/excel/down?operator_id=' + resultId}>Download</a> <a href={'http://192.168.1.28:8651/tos/excel/down?operator_id=' + resultId}>Download</a>
......
...@@ -47,7 +47,7 @@ const Users = (props: any) => { ...@@ -47,7 +47,7 @@ const Users = (props: any) => {
const [loading, setLoading] = useState(false); const [loading, setLoading] = useState(false);
const [fileUploading, setFileUploading] = useState(false); const [fileUploading, setFileUploading] = useState(false);
const [compent, setCompent] = useState({ loading: false, fileUploading: false }); // const [compent, setCompent] = useState({ loading: false, fileUploading: false });
const userInfo = localStorage.getItem('userInfo') || ''; const userInfo = localStorage.getItem('userInfo') || '';
const id = JSON.parse(userInfo).userModel.id; const id = JSON.parse(userInfo).userModel.id;
...@@ -108,9 +108,12 @@ const Users = (props: any) => { ...@@ -108,9 +108,12 @@ const Users = (props: any) => {
if (info.file.status == 'uploading') { if (info.file.status == 'uploading') {
setFileUploading(true); setFileUploading(true);
} }
console.log(info);
if (info.file.status === 'done') { if (info.file.status === 'done') {
if (info.file.response.error_code == '0000') { if (info.file.response.error_code == '0000') {
history.push(location.pathname + '/Result'); history.push(location.pathname + '/Result');
} else if (info.file.response.error_code == '0002') {
message.error(info.file.response.error_msg);
} else { } else {
history.push(location.pathname + '/ResultFailed'); history.push(location.pathname + '/ResultFailed');
message.error( message.error(
...@@ -250,15 +253,17 @@ const Users = (props: any) => { ...@@ -250,15 +253,17 @@ const Users = (props: any) => {
</button> </button>
<div className={styles.buttonAdd}> <div className={styles.buttonAdd}>
<Upload {...propsUpload}> <Upload {...propsUpload}>
<Button icon={compent.fileUploading ? null : <UploadOutlined />}> <Button
{compent.fileUploading ? ( disabled={fileUploading}
<> icon={
<Spin indicator={<LoadingOutlined style={{ fontSize: 16 }} spin />} /> fileUploading ? (
Uploading <LoadingOutlined style={{ fontSize: 16 }} spin />
</> ) : (
) : ( <UploadOutlined />
'Batch Upload' )
)} }
>
{fileUploading ? 'Uploading' : 'Batch Upload'}
</Button> </Button>
</Upload> </Upload>
</div> </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