Commit 5c36b2d7 authored by xiexiuxing's avatar xiexiuxing

fix: 修复商品的

parent ddb0d072
# btnCode 是pass 平台配置唯一表示 # btnCode 是pass 平台配置唯一表示
...@@ -22,7 +22,14 @@ ...@@ -22,7 +22,14 @@
products.add :'商品新曾' products.add :'商品新曾'
products.batch:'商品批量操作' products.batch:'商品批量操作'
products.copy:'商品拷贝' products.copy:'商品拷贝'
products.examine:'提交审核'
products.edit:'编辑'
products.del:删除
products.state 商品上下架操作 商品上下架操作按钮
products.examine 商品审核操作 商品审核操作按钮
products.copy 商品复制操作 商品复制操作按钮
products.supply 查看供应商品操作 查看供应商品操作
- 2.1.快捷修改单价 (已完成) - 2.1.快捷修改单价 (已完成)
fastModifyPrice.edit :'快捷修改单价' fastModifyPrice.edit :'快捷修改单价'
fastModifyPrice.see:'快捷修改查看' fastModifyPrice.see:'快捷修改查看'
......
...@@ -2,6 +2,7 @@ import React from 'react' ...@@ -2,6 +2,7 @@ import React from 'react'
import { Button, Dropdown, Menu } from 'antd' import { Button, Dropdown, Menu } from 'antd'
import { CaretDownOutlined } from '@ant-design/icons' import { CaretDownOutlined } from '@ant-design/icons'
import { getIntl } from 'umi'; import { getIntl } from 'umi';
import AuthButton from '@/components/AuthButton'
const intl = getIntl(); const intl = getIntl();
...@@ -27,27 +28,31 @@ export interface TableOperationProps { ...@@ -27,27 +28,31 @@ export interface TableOperationProps {
} }
const TableOperation: React.FC<TableOperationProps> = (props) => { const TableOperation: React.FC<TableOperationProps> = (props) => {
const { buttonTextFieldMap, operationHandler, buttonPermissionsMap = null, menuCode = null } = props const { buttonTextFieldMap, operationHandler, buttonPermissionsMap = null, menuCode = null } = props
const keyNames = Object.keys(buttonTextFieldMap) const keyNames = Object.keys(buttonTextFieldMap)
return (<> return (<>
{ {
Object.values(buttonTextFieldMap).filter(Boolean).length > 2 Object.values(buttonTextFieldMap).filter(Boolean).length > 2
? ?
<> <>
<AuthButton btnCode={buttonPermissionsMap[keyNames[0]]}>
<Button type='link' onClick={operationHandler[keyNames[0]]}>{keyNames[0]}</Button> <Button type='link' onClick={operationHandler[keyNames[0]]}>{keyNames[0]}</Button>
</AuthButton>
<Dropdown overlay={ <Dropdown overlay={
<Menu> <Menu>
{ {
keyNames.slice(1, keyNames.length).map((item, i) => buttonTextFieldMap[item] ? ( keyNames.slice(1, keyNames.length).map((item, i) => buttonTextFieldMap[item] ? (
<Menu.Item key={`menuItem${i}`}> <Menu.Item key={`menuItem${i}`}>
<Button type='link' onClick={operationHandler[item]}>{item}</Button> <AuthButton btnCode={buttonPermissionsMap[item]}>
<Button type='link' onClick={operationHandler[item]}>{item}</Button>
</AuthButton>
</Menu.Item> </Menu.Item>
) : null) ) : null)
} }
...@@ -58,8 +63,15 @@ const TableOperation: React.FC<TableOperationProps> = (props) => { ...@@ -58,8 +63,15 @@ const TableOperation: React.FC<TableOperationProps> = (props) => {
</a> </a>
</Dropdown> </Dropdown>
</> </>
: :
keyNames.map((item, i) => (buttonTextFieldMap[item] ? <Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button> : null)) keyNames.map((item, i) => (buttonTextFieldMap[item] ?
// <div>{buttonPermissionsMap[item]}</div>
<AuthButton btnCode={buttonPermissionsMap[item]}>
<Button key={`btnItem${i}`} type='link' onClick={operationHandler[item]}>{item}</Button>
</AuthButton>
: null))
} }
</>) </>)
} }
......
...@@ -193,8 +193,8 @@ const Products: React.FC<{}> = () => { ...@@ -193,8 +193,8 @@ const Products: React.FC<{}> = () => {
[intl.formatMessage({ id: 'commodity.products.buttonGroup.2' })]: 'products.examine', [intl.formatMessage({ id: 'commodity.products.buttonGroup.2' })]: 'products.examine',
[intl.formatMessage({ id: 'commodity.products.buttonGroup.3' })]: 'products.edit', [intl.formatMessage({ id: 'commodity.products.buttonGroup.3' })]: 'products.edit',
[intl.formatMessage({ id: 'commodity.products.buttonGroup.4' })]: 'products.del', [intl.formatMessage({ id: 'commodity.products.buttonGroup.4' })]: 'products.del',
[intl.formatMessage({ id: 'commodity.products.buttonGroup.5' })]: 'products.putaway', [intl.formatMessage({ id: 'commodity.products.buttonGroup.5' })]: 'products.state',
[intl.formatMessage({ id: 'commodity.products.buttonGroup.6' })]: 'products.pulloff', [intl.formatMessage({ id: 'commodity.products.buttonGroup.6' })]: 'products.state',
[intl.formatMessage({ id: 'commodity.products.buttonGroup.7' })]: 'products.supply', [intl.formatMessage({ id: 'commodity.products.buttonGroup.7' })]: 'products.supply',
} }
......
...@@ -150,6 +150,7 @@ const ClassProperty: React.FC<{}> = () => { ...@@ -150,6 +150,7 @@ const ClassProperty: React.FC<{}> = () => {
const clickSelect = (key, node) => { const clickSelect = (key, node) => {
handleSelect(key, node) handleSelect(key, node)
// flag = false // flag = false
} }
useEffect(() => { useEffect(() => {
......
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