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
5aa25604
Commit
5aa25604
authored
Apr 15, 2022
by
前端-钟卫鹏
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 处理请购单转采购订单按钮权限问题
parent
a86861c4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
13 deletions
+10
-13
index.tsx
src/components/TableOperation/index.tsx
+5
-5
useRequisitionOrder.tsx
...equisition/requisitionOrder/model/useRequisitionOrder.tsx
+5
-8
No files found.
src/components/TableOperation/index.tsx
View file @
5aa25604
...
...
@@ -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/model/useRequisitionOrder.tsx
View file @
5aa25604
...
...
@@ -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
=
()
=>
{
...
...
@@ -28,13 +27,11 @@ export const useSelfTable = () => {
}
return
(
<
AuthButton
btnCode=
'readyRequisitionOrder.submit'
>
<
TableOperation
buttonTextFieldMap=
{
buttonGroup
}
operationHandler=
{
operationHandler
}
buttonPermissionsMap=
{
buttonPermissionsMap
}
/>
</
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