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
linweijiong
jinfa-platform
Commits
6089d04c
Commit
6089d04c
authored
Aug 25, 2021
by
Bill
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 首页权限问题
parent
d3657e68
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
7 deletions
+8
-7
Contract.tsx
src/pages/home/components/Centers/Contract.tsx
+3
-3
PurchaseCenter.tsx
src/pages/home/components/Centers/PurchaseCenter.tsx
+5
-4
No files found.
src/pages/home/components/Centers/Contract.tsx
View file @
6089d04c
...
...
@@ -21,7 +21,7 @@ const KEY_TITLE = {
// 如果当前用户有电子签章申请菜单权限,但还未申请电子签章,则显示:您还没有申请电子签章,请先申请电子签章,点击申请电子签章按钮,跳转合同能力--电子签章-电子签章申请页
const
Constract
:
React
.
FC
<
Iprops
>
=
(
props
:
Iprops
)
=>
{
const
{
loading
,
isError
,
hasRequest
,
responseData
,
ref
,
inViewPort
}
=
useViewRequest
<
GetReportMemberHomeGetContractTallyResponse
,
any
>
(
PublicApi
.
getReportMemberHomeGetContractTally
,
{})
const
{
loading
,
isError
,
hasRequest
,
responseData
,
ref
,
inViewPort
,
filterEmptyList
}
=
useViewRequest
<
GetReportMemberHomeGetContractTallyResponse
,
any
>
(
PublicApi
.
getReportMemberHomeGetContractTally
,
{})
const
[
hasConstract
,
setHasConstract
]
=
useState
<
boolean
>
(
false
);
const
{
userAuth
,
hasAbilityFunc
,
isConsumer
}
=
useGetAuth
();
const
[
hasFetchData
,
setHasFetchData
]
=
useState
(
false
)
...
...
@@ -62,14 +62,14 @@ const Constract: React.FC<Iprops> = (props: Iprops) => {
>
<
Fragment
>
{
(
!
hasConstract
)
&&
(
isConsumer
&&
(
!
hasConstract
)
&&
(
<
AlertTip
url=
"/memberCenter/contract/ElectronicSignature/apply"
content=
"您还没有申请电子签章,请先申请电子签章"
/>
)
}
<
StaticsDataList
title=
{
KEY_TITLE
}
dataSource=
{
responseData
as
unknown
as
IDataListProps
[
"dataSource"
]
}
/>
<
StaticsDataList
title=
{
KEY_TITLE
}
dataSource=
{
filterEmptyList
as
unknown
as
IDataListProps
[
"dataSource"
]
}
/>
</
Fragment
>
</
Layout
>
...
...
src/pages/home/components/Centers/PurchaseCenter.tsx
View file @
6089d04c
...
...
@@ -36,13 +36,14 @@ const PurchaseCenter: React.FC<Iprops> = () => {
const
{
loading
,
filterEmptyList
,
isError
,
ref
,
inViewPort
,
refresh
}
=
useViewRequest
<
GetReportMemberHomeGetPurchaseTallyResponse
,
any
>
(
PublicApi
.
getReportMemberHomeGetPurchaseTally
,
{})
const
{
userAuth
,
hasAbilityFunc
,
isConsumer
}
=
useGetAuth
();
const
hasAbility
=
hasAbilityFunc
(
'procurementAbility'
);
/** 是否有权限 */
/** 是否
是消费者即服务消费者
有权限 */
const
hasPurchaseAuth
=
(
isBusiness
.
includes
(
userAuth
.
memberType
))
&&
isConsumer
/** 是否有采购门户 */
const
[
hasPurchase
,
setHasPurchase
]
=
useState
<
boolean
>
(
hasPurchaseAuth
);
const
[
hasPurchase
,
setHasPurchase
]
=
useState
<
boolean
>
(
false
);
const
[
hasFetchData
,
setHasFetchData
]
=
useState
(
false
)
useEffect
(()
=>
{
console
.
log
(
"hasPurchaseAuth"
,
hasPurchaseAuth
);
if
(
!
inViewPort
||
(
!
hasPurchaseAuth
)
||
hasFetchData
)
{
return
;
}
...
...
@@ -50,7 +51,7 @@ const PurchaseCenter: React.FC<Iprops> = () => {
const
{
data
,
code
}
=
await
PublicApi
.
getTemplateWebMemberPurchaseWebFindCurrMemberPurchase
();
setHasFetchData
(
true
)
if
(
code
===
1000
)
{
return
setHasPurchase
(
data
?.
id
?
true
:
false
)
setHasPurchase
(
data
?.
id
?
true
:
false
)
}
}
findCurrMemberPurchase
()
...
...
@@ -79,7 +80,7 @@ const PurchaseCenter: React.FC<Iprops> = () => {
>
<
Fragment
>
{
!
hasPurchase
&&
(
hasPurchaseAuth
&&
!
hasPurchase
&&
(
<
div
className=
{
styles
.
ding_tips
}
>
<
div
>
<
BellOutlined
/>
...
...
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