fix: display image menu

This commit is contained in:
jialin
2025-11-10 10:07:25 +08:00
parent 0077d109e7
commit 285e274818
25 changed files with 91 additions and 86 deletions
@@ -16,6 +16,9 @@ const DropDownActions: React.FC<DropDownProps> = (props) => {
const items = useMemo(() => {
return menu?.items?.map((item: any) => ({
..._.omit(item, 'locale'),
icon: item.icon
? React.cloneElement(item.icon, { style: { fontSize: 14 } })
: null,
label: item.locale ? intl.formatMessage({ id: item.label }) : item.label
}));
}, [menu?.items, intl]);
+5 -7
View File
@@ -86,8 +86,8 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
handleInputChange,
handleSelectChange,
handleSearch,
handleDeleteByBatch,
handleClickPrimary,
handleDeleteByBatch = null,
handleClickPrimary = null,
rowSelection,
actionItems = [],
selectOptions,
@@ -99,8 +99,6 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
marginTop = 10,
inputHolder,
selectHolder,
showPrimaryButton = true,
showDeleteButton = true,
right,
left,
width
@@ -108,12 +106,12 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
const intl = useIntl();
const renderRight = useMemo(() => {
if (!showPrimaryButton && !showDeleteButton) {
if (!handleClickPrimary && !handleDeleteByBatch) {
return null;
}
return (
<Space size={20}>
{showPrimaryButton ? (
{handleClickPrimary ? (
actionType === 'dropdown' ? (
<DropDownActions
menu={{
@@ -139,7 +137,7 @@ export const FilterBar: React.FC<FilterBarProps> = (props) => {
</Button>
)
) : null}
{showDeleteButton && (
{handleDeleteByBatch && (
<Button
icon={<DeleteOutlined />}
danger