From 29fb0b5c59c4ed16be6bec60b5c90634444e21f6 Mon Sep 17 00:00:00 2001 From: admin Date: Tue, 30 May 2023 10:24:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20basic-layouts=20=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E8=8F=9C=E5=8D=95=E6=A0=8F=E9=98=B4=E5=BD=B1?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../antdp-ui/src/ButtonGroupPro/index.css | 3 ++ .../antdp-ui/src/ButtonGroupPro/index.tsx | 34 ++++++++++++------- packages/basic-layouts/src/index.css | 4 +-- 3 files changed, 27 insertions(+), 14 deletions(-) diff --git a/packages/antdp-ui/src/ButtonGroupPro/index.css b/packages/antdp-ui/src/ButtonGroupPro/index.css index c0edd08f4..fdbb92dde 100644 --- a/packages/antdp-ui/src/ButtonGroupPro/index.css +++ b/packages/antdp-ui/src/ButtonGroupPro/index.css @@ -3,4 +3,7 @@ } .antdp-ButtonGroup .ant-btn{ margin: 0px 12px 0px 0px; + :last-child{ + margin: 0px; + } } \ No newline at end of file diff --git a/packages/antdp-ui/src/ButtonGroupPro/index.tsx b/packages/antdp-ui/src/ButtonGroupPro/index.tsx index 2204df142..c60d004c9 100644 --- a/packages/antdp-ui/src/ButtonGroupPro/index.tsx +++ b/packages/antdp-ui/src/ButtonGroupPro/index.tsx @@ -1,13 +1,13 @@ -import React, { useEffect, useState } from 'react'; -import { Button, Dropdown, Menu, Badge } from 'antd'; +import { DownOutlined } from '@ant-design/icons'; +import { AuthorizedBtn } from '@antdp/authorized'; +import { Badge, Button, Dropdown, Menu } from 'antd'; import { ButtonProps } from 'antd/es/button'; import { ButtonGroupProps, ButtonType } from 'antd/lib/button'; -import { AuthorizedBtn } from '@antdp/authorized'; -import { DownOutlined } from '@ant-design/icons'; import classNames from 'classnames'; -import './index.css'; import { MenuInfo } from 'rc-menu/lib/interface'; -import { getMenusItems } from '../utils' +import React, { useEffect, useState } from 'react'; +import { getMenusItems } from '../utils'; +import './index.css'; export interface ButtonGroupProProps { button: any[]; @@ -25,7 +25,7 @@ export interface MenusProps extends Omit { export interface MenusOptionProps extends Omit, - ButtonGroupProps { + ButtonGroupProps { path?: string; label?: string | React.ReactNode; option?: MenusOptionProps[]; @@ -72,9 +72,12 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => { menus: MenusProps[] | undefined = [], idx: number | undefined, ) => { - const items = getMenusItems(menus) + const items = getMenusItems(menus); return ( - handleMenuClick(menus, idx, e)} /> + handleMenuClick(menus, idx, e)} + /> ); }; @@ -90,7 +93,9 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => { onClick: item.onClick, disabled: item.disabled, style: { - margin: ButtonandDropdown ? '0 0 0 -3px' : '0px 12px 0px 0px', + margin: ButtonandDropdown + ? '0 0 0 -3px' + : `0px ${idx === button.length - 1 ? 0 : 12}px 0px 0px`, }, ...item, } as ButtonProps; @@ -106,7 +111,9 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => { size="middle" type={props.type || 'default'} style={{ - margin: ButtonandDropdown ? '0 0 0 -3px' : '0px 12px 0px 0px', + margin: ButtonandDropdown + ? '0 0 0 -3px' + : `0px ${idx === button.length - 1 ? 0 : 12}px 0px 0px`, }} > {menuDropdownLabel.key === idx @@ -122,7 +129,10 @@ const ButtonGroupPro = (props: ButtonGroupProProps) => { ) : ( - renderMenu(item.menu, idx)} key={idx}> + renderMenu(item.menu, idx)} + key={idx} + > {DropdownButtonDom} ); diff --git a/packages/basic-layouts/src/index.css b/packages/basic-layouts/src/index.css index 156e40cd9..a45c82141 100644 --- a/packages/basic-layouts/src/index.css +++ b/packages/basic-layouts/src/index.css @@ -17,7 +17,7 @@ body { box-sizing: border-box; min-height: 100%; background-color: #001529; - box-shadow: 2px 0 6px rgba(0, 21, 41, 0.35); + box-shadow: 2px 0 6px #9393930d; overflow: auto; z-index: 99; .ant-layout-sider-trigger{ @@ -37,7 +37,7 @@ body { display: flex; position: relative; box-sizing: border-box; - box-shadow: 0 0 8px 0 rgba(0, 0, 0, 0.1); + box-shadow: 0 0 6px 0 #9393930d; z-index: 100; } .antdp-basic-layouts-header-breadcrumb {