Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
TOSTUMI
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Maple
TOSTUMI
Commits
3fdf1c50
Commit
3fdf1c50
authored
Dec 16, 2020
by
Sixiang_Zzb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
用户管理 批量上传优化
parent
8ac05e07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
46 deletions
+61
-46
ResultPage.tsx
src/pages/UserManagement/LIFEUserManagement/ResultPage.tsx
+40
-39
ResultPageFailed.tsx
...es/UserManagement/LIFEUserManagement/ResultPageFailed.tsx
+21
-7
No files found.
src/pages/UserManagement/LIFEUserManagement/ResultPage.tsx
View file @
3fdf1c50
import
React
,
{
useState
,
useEffect
,
useRef
}
from
'react'
;
import
{
Input
,
Tabs
,
Table
,
Result
,
Button
}
from
'antd'
;
const
{
TabPane
}
=
Tabs
;
import
{
connect
,
history
}
from
'umi'
;
import
{
RA
}
from
'@/utils/method'
;
const
module
=
"User"
const
ResultPage
=
(
props
:
any
)
=>
{
const
{
dispatch
,
Data
}
=
props
;
const
formRef
=
useRef
(
null
)
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Result
,
Button
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
const
module
=
'User'
;
const
ResultPage
=
()
=>
{
const
[
resultTime
,
setResultTime
]
=
useState
(
3
);
function
loop
(
i
:
number
)
{
function
loop
(
i
:
number
)
{
if
(
i
<
4
)
{
console
.
log
(
i
)
console
.
log
(
i
)
;
setResultTime
(
4
-
i
)
setTimeout
(
function
(){
loop
(
++
i
)},
1000
)
setResultTime
(
4
-
i
);
setTimeout
(
function
()
{
loop
(
++
i
);
},
1000
);
}
else
{
setResultTime
(
0
)
history
.
go
(
-
1
)
setResultTime
(
0
)
;
history
.
go
(
-
1
)
;
}
}
useEffect
(()
=>
{
loop
(
1
)
},[])
const
backPage
=
()
=>
{
}
useEffect
(()
=>
{
loop
(
1
);
},
[]);
const
backPage
=
()
=>
{};
return
(
<
div
style=
{
{
width
:
"100%"
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
"#ffffff"
}
}
>
<
Result
status=
"success"
title=
"Successfully submit the file!"
subTitle=
{
<
p
>
server has been handled it ,Wait for
<
strong
>
{
resultTime
}
</
strong
>
seconds to return automatically.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
onClick=
{
backPage
}
>
Ok
</
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
</
Button
>
]
}
/>
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
<
Result
status=
"success"
title=
"Successfully submit the file!"
subTitle=
{
<
p
>
server has been handled it ,Wait for
<
strong
>
{
resultTime
}
</
strong
>
seconds to return
automatically.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
onClick=
{
backPage
}
>
Ok
</
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
</
Button
>,
]
}
/>
</
div
>
);
};
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
]
return
{
Data
}
function
map
(
state
:
any
)
{
const
{
Data
}
=
state
[
module
];
return
{
Data
};
}
export
default
connect
(
map
)(
ResultPage
);
\ No newline at end of file
export
default
connect
(
map
)(
ResultPage
);
src/pages/UserManagement/LIFEUserManagement/ResultPageFailed.tsx
View file @
3fdf1c50
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
Result
,
Button
}
from
'antd'
;
import
{
Result
,
Button
,
message
}
from
'antd'
;
import
{
connect
,
history
}
from
'umi'
;
const
module
=
'User'
;
const
ResultPageFailed
=
(
props
:
any
)
=>
{
const
[
resultId
,
setResultId
]
=
useState
(
3
);
const
ResultPageFailed
=
()
=>
{
const
[
resultId
,
setResultId
]
=
useState
(
''
);
const
[
flag
,
setFlag
]
=
useState
(
true
);
const
backPage
=
()
=>
{
history
.
go
(
-
1
);
};
useEffect
(()
=>
{
const
id
=
localStorage
.
getItem
(
'userInfo'
)
||
''
;
setResultId
(
JSON
.
parse
(
id
).
userModel
.
id
);
},
[]);
const
handleDownload
=
()
=>
{
if
(
flag
)
{
setFlag
(
false
);
}
else
{
message
.
success
(
'The file has been downloaded successfully'
);
}
};
return
(
<
div
style=
{
{
width
:
'100%'
,
minWidth
:
1020
,
padding
:
34
,
backgroundColor
:
'#ffffff'
}
}
>
<
Result
...
...
@@ -23,11 +31,17 @@ const ResultPageFailed = (props: any) => {
title=
"Error submit the file!"
subTitle=
{
<
p
>
server has been handled it ,please try again or back.
</
p
>
}
extra=
{
[
<
Button
type=
"primary"
key=
"ok"
>
<
Button
type=
"primary"
key=
"ok"
onClick=
{
handleDownload
}
>
{
flag
?
(
<
a
href=
{
'http://192.168.1.28:8651/tos/excel/down?operator_id='
+
resultId
}
>
Download
</
a
>
)
:
(
'Download'
)
}
{
/* <a href={'http://47.74.233.180: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
>
</
Button
>,
<
Button
key=
"back"
onClick=
{
backPage
}
>
Back
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment