Commit 1b18a0bc authored by XieZhiXiong's avatar XieZhiXiong

feat: 添加省略展示

parent 26738ceb
@import '../../global/styles/utils.less';
.steps {
padding-top: 2px;
overflow: auto;
......@@ -7,5 +9,9 @@
max-width: 100px;
// margin-right: 8px;
text-align: center;
&.ellipsis {
.textOverflow();
}
}
}
......@@ -10,6 +10,7 @@ import {
Steps,
Tooltip,
} from 'antd';
import classNames from 'classnames';
import ButtonTabs, { ButtonTabsProps } from '../ButtonTabs';
import styles from './index.less';
......@@ -57,6 +58,10 @@ interface AuditProcessProp extends Omit<ButtonTabsProps, 'options'> {
* 自定义item key键名
*/
customKey?: string
/**
* 是否省略title超出的内容,默认为 false
*/
ellipsis?: boolean
};
const AuditProcess: React.FC<AuditProcessProp> = ({
......@@ -66,6 +71,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
innerVerifySteps,
customTitleKey,
customKey,
ellipsis = false,
...rest
}) => {
const [radioValue, setRadioValue] = useState<('inner' | 'outer')>('inner');
......@@ -108,7 +114,7 @@ const AuditProcess: React.FC<AuditProcessProp> = ({
}
return (
<Tooltip placement="top" title={stepTitle}>
<span className={styles.title}>{`${stepTitle}`}</span>
<span className={classNames(styles.title, { [styles.ellipsis]: ellipsis })}>{`${stepTitle}`}</span>
</Tooltip>
)
}
......
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