Commit 5aa25604 authored by 前端-钟卫鹏's avatar 前端-钟卫鹏

fix: 处理请购单转采购订单按钮权限问题

parent a86861c4
......@@ -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))
......
......@@ -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}
/>
)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment