Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
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
shenshaokai
jinfa-platform
Commits
a612c784
Commit
a612c784
authored
Apr 21, 2022
by
XieZhiXiong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: 完善没有数据时的展示
parent
f28a2ef4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
27 additions
and
8 deletions
+27
-8
im_noData.png
src/assets/imgs/im_noData.png
+0
-0
index.less
src/pages/srmHome/components/TodoCard/index.less
+7
-0
index.tsx
src/pages/srmHome/components/TodoCard/index.tsx
+20
-8
No files found.
src/assets/imgs/im_noData.png
0 → 100644
View file @
a612c784
9.29 KB
src/pages/srmHome/components/TodoCard/index.less
View file @
a612c784
...
...
@@ -49,6 +49,7 @@
&-content {
margin-left: -@margin-md;
min-height: 184px;
}
&-group {
...
...
@@ -91,5 +92,10 @@
background-color: rgba(37,45,55,0.08);;
}
}
&-noData {
margin-top: 20px;
color: @text-color-secondary;
}
}
}
\ No newline at end of file
src/pages/srmHome/components/TodoCard/index.tsx
View file @
a612c784
...
...
@@ -2,7 +2,7 @@
* @Description 欢迎卡片
*/
import
React
,
{
useState
,
useEffect
}
from
'react'
;
import
{
message
,
Spin
}
from
'antd'
;
import
{
message
,
Spin
,
Empty
}
from
'antd'
;
import
classNames
from
'classnames'
;
import
{
history
}
from
'umi'
;
import
{
SRM_HOME_TODO
}
from
'@/constants/home'
;
...
...
@@ -19,6 +19,7 @@ import {
getReportMemberHomeGetSettleAccountTally
,
}
from
'@/services/ReportV2Api'
;
import
MellowCard
from
'@/components/MellowCard'
;
import
NODATA_IMG
from
'@/assets/imgs/im_noData.png'
;
import
styles
from
'./index.less'
;
type
Apikeys
=
keyof
typeof
SRM_HOME_TODO
...
...
@@ -130,11 +131,14 @@ const normalizeTodoList = (dataSource: TallyReseponseType): TodoType[][] => {
const
todos
:
TallyType
[]
=
dataSource
[
item
];
if
(
todos
)
{
todos
.
forEach
((
todo
,
todoIndex
)
=>
{
group
.
push
({
name
:
todo
.
name
,
url
:
todo
.
link
,
total
:
todo
.
count
,
});
// 待办数大于 0 才展示
if
(
todo
.
count
>
0
)
{
group
.
push
({
name
:
todo
.
name
,
url
:
todo
.
link
,
total
:
todo
.
count
,
});
}
if
(
group
.
length
===
GROUP_MAX_LEN
)
{
ret
.
push
(
group
);
group
=
[];
...
...
@@ -194,6 +198,11 @@ const TodoCard: React.FC = () => {
history
.
push
(
url
);
};
console
.
log
(
'todoList'
,
todoList
)
const
noTodoItem
=
todoList
.
every
((
item
)
=>
!
item
.
length
);
console
.
log
(
'noTodoItem'
,
noTodoItem
)
return
(
<
MellowCard
title=
{
(<
div
className=
{
styles
[
'todo-title'
]
}
>
今日待办
</
div
>)
}
>
<
ul
className=
{
styles
[
'todo-tag-list'
]
}
>
...
...
@@ -215,7 +224,7 @@ const TodoCard: React.FC = () => {
<
Spin
spinning=
{
listLoading
}
>
<
div
className=
{
styles
[
'todo-list'
]
}
>
<
div
className=
{
styles
[
'todo-list-content'
]
}
>
{
todoList
.
map
((
group
,
index
)
=>
(
{
todoList
.
map
((
group
,
index
)
=>
group
.
length
?
(
<
div
key=
{
index
}
className=
{
styles
[
'todo-list-group'
]
}
>
{
group
.
map
((
item
,
groupItemIndex
)
=>
(
<
div
...
...
@@ -232,7 +241,10 @@ const TodoCard: React.FC = () => {
</
div
>
))
}
</
div
>
))
}
)
:
null
)
}
{
noTodoItem
?
(
<
Empty
image=
{
NODATA_IMG
}
description=
{
<
div
className=
{
styles
[
'todo-list-noData'
]
}
>
暂无待办
</
div
>
}
/>
)
:
null
}
</
div
>
</
div
>
</
Spin
>
...
...
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