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
5b5a1ff1
Commit
5b5a1ff1
authored
Apr 15, 2022
by
Bill
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'fix418' into 'v2-220418'
处理请购单转采购订单按钮权限问题 See merge request linkseeks-design/pro-platform!334
parents
81c6e17c
5aa25604
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
14 deletions
+17
-14
index.tsx
src/components/TableOperation/index.tsx
+5
-5
index.tsx
...ion/purchaseRequisition/requisitionOrder/detail/index.tsx
+3
-2
useRequisitionOrder.tsx
...equisition/requisitionOrder/model/useRequisitionOrder.tsx
+9
-7
No files found.
src/components/TableOperation/index.tsx
View file @
5b5a1ff1
...
...
@@ -27,8 +27,8 @@ export interface TableOperationProps {
menuCode
?:
string
,
}
const
TableOperation
:
React
.
FC
<
TableOperationProps
>
=
(
props
)
=>
{
const
TableOperation
:
React
.
FC
<
TableOperationProps
>
=
(
props
)
=>
{
const
{
buttonTextFieldMap
,
operationHandler
,
buttonPermissionsMap
=
null
,
menuCode
=
null
}
=
props
const
keyNames
=
Object
.
keys
(
buttonTextFieldMap
)
...
...
@@ -38,7 +38,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
Object
.
values
(
buttonTextFieldMap
).
filter
(
Boolean
).
length
>
2
?
<>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
keyNames
[
0
]])
||
'
DevTest
'
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
keyNames
[
0
]])
||
''
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
keyNames
[
0
]]
}
>
{
keyNames
[
0
]
}
</
Button
>
</
AuthButton
>
...
...
@@ -49,7 +49,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
keyNames
.
slice
(
1
,
keyNames
.
length
).
map
((
item
,
i
)
=>
buttonTextFieldMap
[
item
]
?
(
<
Menu
.
Item
key=
{
`menuItem${i}`
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
'
DevTest
'
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
''
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
item
]
}
>
{
item
}
</
Button
>
</
AuthButton
>
</
Menu
.
Item
>
...
...
@@ -65,7 +65,7 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
:
keyNames
.
map
((
item
,
i
)
=>
(
buttonTextFieldMap
[
item
]
?
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
'
DevTest
'
}
key=
{
`btnItem${i}`
}
>
<
AuthButton
btnCode=
{
(
buttonPermissionsMap
&&
buttonPermissionsMap
[
item
])
||
''
}
key=
{
`btnItem${i}`
}
>
<
Button
type=
'link'
onClick=
{
operationHandler
[
item
]
}
>
{
item
}
</
Button
>
</
AuthButton
>
:
null
))
...
...
src/pages/transaction/purchaseRequisition/requisitionOrder/detail/index.tsx
View file @
5b5a1ff1
...
...
@@ -8,6 +8,7 @@ import BillDetailWrapper from '../../components/billDetailWrapper';
import
BillDetailSection
from
'../../components/billDetailSection'
;
import
{
Button
}
from
'antd'
;
import
{
usePageStatus
}
from
'@/hooks/usePageStatus'
;
import
AuthButton
from
'@/components/AuthButton'
;
const
RequisitionOrderDetail
:
React
.
FC
=
()
=>
{
const
{
formContext
}
=
useBillDetail
({
type
:
'transformBill'
})
...
...
@@ -29,9 +30,9 @@ const RequisitionOrderDetail: React.FC = () => {
formContext=
{
formContext
}
anchorList=
{
anchorTitleList
}
extraRight=
{
action
&&
<
Button
type=
'primary'
onClick=
{
handleClick
}
>
action
&&
<
AuthButton
btnCode=
"requisitionOrderDetail.zhuandan"
><
Button
type=
'primary'
onClick=
{
handleClick
}
>
{
intl
.
formatMessage
({
id
:
'purchaseRequisition.zhuancaigoudan'
,
defaultMessage
:
'转采购单'
})
}
</
Button
>
</
Button
>
</
AuthButton
>
}
/>
<
BillDetailWrapper
>
...
...
src/pages/transaction/purchaseRequisition/requisitionOrder/model/useRequisitionOrder.tsx
View file @
5b5a1ff1
...
...
@@ -3,7 +3,6 @@ import { baseOrderListColumns } from '../../constant'
import
{
useRowSelectionTable
}
from
'@/hooks/useRowSelectionTable'
import
{
history
,
useIntl
}
from
'umi'
import
TableOperation
from
'@/components/TableOperation'
import
AuthButton
from
'@/components/AuthButton'
// 请购单转订单 Hook
export
const
useSelfTable
=
()
=>
{
...
...
@@ -23,13 +22,16 @@ export const useSelfTable = () => {
[
intl
.
formatMessage
({
id
:
'purchaseRequisition.zhuancaigoudingdan'
,
defaultMessage
:
'转采购订单'
})]:
()
=>
handleSubmit
(
record
.
id
),
}
const
buttonPermissionsMap
=
{
[
intl
.
formatMessage
({
id
:
'purchaseRequisition.zhuancaigoudingdan'
,
defaultMessage
:
'转采购订单'
})]:
'readyRequisitionOrder.submit'
,
}
return
(
<
AuthButton
btnCode=
'readyRequisitionOrder.submit'
>
<
TableOperation
buttonTextFieldMap=
{
buttonGroup
}
operationHandler=
{
operationHandler
}
/>
</
AuthButton
>
<
TableOperation
buttonTextFieldMap=
{
buttonGroup
}
operationHandler=
{
operationHandler
}
buttonPermissionsMap=
{
buttonPermissionsMap
}
/>
)
}
...
...
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