Commit bb194039 authored by 周宏民's avatar 周宏民

fix: 修改指标选择业务组件,添加可显示指标名称

parent 5e0b8a2c
...@@ -106,6 +106,7 @@ const Demo = () => { ...@@ -106,6 +106,7 @@ const Demo = () => {
<h3>无 user, 无“保存修改”按钮</h3> <h3>无 user, 无“保存修改”按钮</h3>
<PandaQuotaSelect <PandaQuotaSelect
buttonProps={{}} buttonProps={{}}
showQuotaName={true}
// defaultSelect={'all'} // defaultSelect={'all'}
deviceList={deviceList} deviceList={deviceList}
pointType={pointType} pointType={pointType}
......
...@@ -48,6 +48,7 @@ const QuotaSelect = ({ ...@@ -48,6 +48,7 @@ const QuotaSelect = ({
defaultSelect, defaultSelect,
disabledList, disabledList,
isCommonTag, isCommonTag,
showQuotaName,
}) => { }) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-quota-select'); const prefixCls = getPrefixCls('ec-quota-select');
...@@ -344,7 +345,7 @@ const QuotaSelect = ({ ...@@ -344,7 +345,7 @@ const QuotaSelect = ({
> >
{buttonProps.children {buttonProps.children
? buttonProps.children ? buttonProps.children
: `${item.deviceName}(${item.confList ? item.confList.length : 0})`} : `${item.deviceName}(${item.confList ?showQuotaName?item.confList.join(','): item.confList.length : 0})`}
</Button> </Button>
))} ))}
</div> </div>
...@@ -505,6 +506,7 @@ QuotaSelect.defaultProps = { ...@@ -505,6 +506,7 @@ QuotaSelect.defaultProps = {
defaultSelect: 'emphasis', defaultSelect: 'emphasis',
disabledList: [], disabledList: [],
isCommonTag: false, isCommonTag: false,
showQuotaName: false,
}; };
QuotaSelect.propTypes = { QuotaSelect.propTypes = {
...@@ -528,6 +530,7 @@ QuotaSelect.propTypes = { ...@@ -528,6 +530,7 @@ QuotaSelect.propTypes = {
defaultSelect: PropTypes.string, defaultSelect: PropTypes.string,
disabledList: PropTypes.array, disabledList: PropTypes.array,
isCommonTag: PropTypes.bool, isCommonTag: PropTypes.bool,
showQuotaName: PropTypes.bool,
}; };
export default QuotaSelect; export default QuotaSelect;
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