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
黄庭坚
jinfa-platform
Commits
e1c4efa7
Commit
e1c4efa7
authored
Jun 18, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改首页bug, 兼容当数据为空时不显示
parent
bc1ff7e4
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
35 deletions
+46
-35
Container.less
src/pages/home/components/Centers/Container.less
+4
-0
MemberCenter.tsx
src/pages/home/components/Centers/MemberCenter.tsx
+2
-1
layout.tsx
src/pages/home/components/Centers/layout.tsx
+31
-15
useViewRequest.tsx
src/pages/home/hooks/useViewRequest.tsx
+6
-5
add.tsx
src/pages/member/complaintsAndSuggests/common/schema/add.tsx
+1
-1
index.tsx
src/pages/member/memberInspection/common/columns/index.tsx
+1
-12
detail.tsx
src/pages/member/memberInspection/detail.tsx
+1
-1
No files found.
src/pages/home/components/Centers/Container.less
View file @
e1c4efa7
...
...
@@ -26,3 +26,7 @@
margin-top: 12px;
}
}
.empty {
padding: 0;
}
src/pages/home/components/Centers/MemberCenter.tsx
View file @
e1c4efa7
...
...
@@ -22,7 +22,7 @@ const KEY_TITLE = {
}
const
MemberCenter
:
React
.
FC
<
Iprops
>
=
()
=>
{
const
{
loading
,
responseData
,
filterEmptyList
,
isError
,
ref
}
=
useViewRequest
<
GetReportMemberHomeGetMemberTallyResponse
,
any
>
(
PublicApi
.
getReportMemberHomeGetMemberTally
,
{})
const
{
loading
,
responseData
,
filterEmptyList
,
isError
,
ref
,
isEmpty
}
=
useViewRequest
<
GetReportMemberHomeGetMemberTallyResponse
,
any
>
(
PublicApi
.
getReportMemberHomeGetMemberTally
,
{})
return
(
<
Layout
...
...
@@ -40,6 +40,7 @@ const MemberCenter: React.FC<Iprops> = () => {
}
loading=
{
loading
}
isError=
{
isError
}
isEmpty=
{
isEmpty
}
>
<
StaticsDataList
title=
{
KEY_TITLE
}
dataSource=
{
filterEmptyList
}
/>
</
Layout
>
...
...
src/pages/home/components/Centers/layout.tsx
View file @
e1c4efa7
...
...
@@ -6,6 +6,7 @@ import { Link } from 'umi';
import
layoutStyles
from
'./center.less'
;
import
Authorize
from
'../Authorize'
;
import
{
BellOutlined
,
RightOutlined
}
from
'@ant-design/icons'
;
import
cx
from
'classnames'
interface
LayoutType
{
StaticsDataList
:
typeof
StaticsDataList
,
...
...
@@ -16,6 +17,10 @@ interface LayoutType {
interface
Iprops
{
viewRef
:
any
,
/**
* 是否没数据
*/
isEmpty
?:
boolean
,
/**
* 标题
*/
title
?:
string
,
...
...
@@ -41,11 +46,12 @@ interface Iprops {
* 出错是的render方法
*/
customizeErrorRender
?:
(()
=>
React
.
ReactElement
)
|
null
onRefresh
?:
(
params
:
any
)
=>
void
onRefresh
?:
(
params
:
any
)
=>
void
,
};
const
Layout
:
LayoutType
&
React
.
FC
<
Iprops
>
=
(
props
)
=>
{
const
{
title
,
tips
,
extra
,
children
,
loading
,
isError
,
customizeErrorRender
,
viewRef
,
onRefresh
}
=
props
;
const
{
title
,
tips
,
extra
,
children
,
loading
,
isError
,
customizeErrorRender
,
viewRef
,
onRefresh
,
isEmpty
=
false
}
=
props
;
const
handleRefresh
=
()
=>
{
onRefresh
?.({})
...
...
@@ -68,20 +74,30 @@ const Layout: LayoutType & React.FC<Iprops> = (props) => {
return
children
;
}
const
containerCs
=
cx
(
styles
.
container
,
{
// [styles.empty]: isEmpty
})
return
(
<
div
className=
{
styles
.
container
}
ref=
{
viewRef
}
>
<
div
className=
{
styles
.
header
}
>
<
div
className=
{
styles
.
left
}
>
<
div
className=
{
styles
.
title
}
>
{
title
}
</
div
>
<
div
className=
{
styles
.
tips
}
>
{
tips
}
</
div
>
</
div
>
<
div
className=
{
styles
.
extra
}
>
{
extra
}
</
div
>
</
div
>
<
div
className=
{
styles
.
body
}
>
{
renderStatus
()
}
</
div
>
<
div
ref=
{
viewRef
}
>
{
!
isEmpty
&&
(
<
div
className=
{
containerCs
}
>
<
div
className=
{
styles
.
header
}
>
<
div
className=
{
styles
.
left
}
>
<
div
className=
{
styles
.
title
}
>
{
title
}
</
div
>
<
div
className=
{
styles
.
tips
}
>
{
tips
}
</
div
>
</
div
>
<
div
className=
{
styles
.
extra
}
>
{
extra
}
</
div
>
</
div
>
<
div
className=
{
styles
.
body
}
>
{
renderStatus
()
}
</
div
>
</
div
>
)
||
null
}
</
div
>
)
}
...
...
src/pages/home/hooks/useViewRequest.tsx
View file @
e1c4efa7
...
...
@@ -62,17 +62,18 @@ function useViewRequest<T, P>(fn: (postData: P) => Promise<ResponseDataType & {
return
result
}
Object
.
keys
(
responseData
).
forEach
((
_row
)
=>
{
// if (responseData[_row] && responseData[_row].length !== 0)
{
// result[_row] = responseData[_row];
//
}
if
(
responseData
[
_row
])
{
if
(
responseData
[
_row
]
&&
responseData
[
_row
].
length
!==
0
)
{
result
[
_row
]
=
responseData
[
_row
];
}
})
console
.
log
(
"result"
,
result
);
return
result
;
}
, [responseData])
return
{
loading
,
isError
,
ref
,
hasRequest
,
refresh
,
responseData
,
filterEmptyList
,
inViewPort
}
const isEmpty = useMemo(() =
>
{
return
filterEmptyList
&&
Object
.
keys
(
filterEmptyList
).
length
===
0
;
}
, [filterEmptyList])
return
{
loading
,
isError
,
ref
,
hasRequest
,
refresh
,
responseData
,
filterEmptyList
,
inViewPort
,
isEmpty
}
}
export default useViewRequest
src/pages/member/complaintsAndSuggests/common/schema/add.tsx
View file @
e1c4efa7
...
...
@@ -196,7 +196,7 @@ export const complaintAddSchema: ISchema = {
]
},
attachments
:
{
title
:
'
考察要求
附件'
,
title
:
'
事件
附件'
,
type
:
'object'
,
'x-component'
:
'FormilyUploadFiles'
,
}
...
...
src/pages/member/memberInspection/common/columns/index.tsx
View file @
e1c4efa7
...
...
@@ -41,20 +41,9 @@ const columns: ColumnsType<GetMemberInspectPageResponseDetail> = [
render
:
(
text
,
record
)
=>
{
const
isFail
=
+
record
.
score
<
60
return
(
<
StatusTag
type=
{
isFail
?
'danger'
:
'primary'
}
title=
{
isFail
?
'不合格'
:
'合格'
}
/>
<
StatusTag
type=
{
isFail
?
'danger'
:
'primary'
}
title=
{
record
.
result
}
/>
)
},
filters
:
[
{
text
:
'合格'
,
value
:
1
,
},
{
text
:
'不合格'
,
value
:
0
,
},
],
onFilter
:
(
_value
,
record
)
=>
_value
===
1
?
+
record
.
score
>=
60
:
+
record
.
score
<
60
,
},
// {
// title: '操作',
...
...
src/pages/member/memberInspection/detail.tsx
View file @
e1c4efa7
...
...
@@ -92,7 +92,7 @@ const InspectionDetail: React.FC<Iprops> = (props: Iprops) => {
},
{
title
:
'考察结果'
,
value
:
initialValue
?.
result
===
1
?
'合格'
:
'不合格'
value
:
initialValue
?.
result
}
],
[
initialValue
])
...
...
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