Commit 7a26031b authored by 李纪文's avatar 李纪文

fix: 组件优化

parent be355bb1
...@@ -50,8 +50,8 @@ const Demo = () => { ...@@ -50,8 +50,8 @@ const Demo = () => {
<BasicTable <BasicTable
dataSource={dataSource} dataSource={dataSource}
columns={columns} columns={columns}
bordered bordered={false}
pagination={{ current: 1, pageSize: 20, size: 'default' }} pagination={{ pageSize: 20, size: 'default' }}
/> />
)} )}
{!dataSource.length && <Empty description={'暂无数据'} />} {!dataSource.length && <Empty description={'暂无数据'} />}
......
...@@ -9,7 +9,6 @@ const BasicTable = (props) => { ...@@ -9,7 +9,6 @@ const BasicTable = (props) => {
const prefixCls = getPrefixCls('basic-table'); const prefixCls = getPrefixCls('basic-table');
const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {}; const pagination = typeof props.pagination !== 'undefined' ? props.pagination : {};
const showTotal = (total) => { const showTotal = (total) => {
debugger;
return `共 ${Math.ceil( return `共 ${Math.ceil(
total / (props.pagination ? props.pagination.pageSize || 10 : 10), total / (props.pagination ? props.pagination.pageSize || 10 : 10),
)} 页 / 共 ${total} 条记录`; )} 页 / 共 ${total} 条记录`;
......
...@@ -125,11 +125,20 @@ ...@@ -125,11 +125,20 @@
border-left: 0; border-left: 0;
} }
.ant-table-header, .ant-table.ant-table-bordered .ant-table-header,
.ant-table-body { .ant-table.ant-table-bordered .ant-table-body {
border-left: 1px solid #dbe7fb; border-left: 1px solid #dbe7fb;
} }
.ant-table-body {
overflow-y: auto !important;
}
.ant-table-cell-scrollbar {
border-left: 0px;
box-shadow: none;
}
.ant-table-summary { .ant-table-summary {
tr td { tr td {
position: sticky; position: sticky;
......
...@@ -105,6 +105,7 @@ const Demo = () => { ...@@ -105,6 +105,7 @@ const Demo = () => {
<h3>无 user, 无“保存修改”按钮</h3> <h3>无 user, 无“保存修改”按钮</h3>
<PandaQuotaSelect <PandaQuotaSelect
buttonProps={{}} buttonProps={{}}
// defaultSelect={'all'}
deviceList={deviceList} deviceList={deviceList}
quotaListService={getQuotaList} quotaListService={getQuotaList}
pointType={pointType} pointType={pointType}
......
...@@ -44,12 +44,13 @@ const QuotaSelect = ({ ...@@ -44,12 +44,13 @@ const QuotaSelect = ({
maximum, maximum,
user, user,
treeProps, treeProps,
defaultSelect,
}) => { }) => {
const { getPrefixCls } = useContext(ConfigProvider.ConfigContext); const { getPrefixCls } = useContext(ConfigProvider.ConfigContext);
const prefixCls = getPrefixCls('ec-quota-select'); const prefixCls = getPrefixCls('ec-quota-select');
const [visible, setVisible] = useState(false); const [visible, setVisible] = useState(false);
const [targetValue, setTargetValue] = useState('emphasis'); const [targetValue, setTargetValue] = useState(defaultSelect);
const [allQuotaList, setAllQuotaList] = useState([]); const [allQuotaList, setAllQuotaList] = useState([]);
const [quotaList, setQuotaList] = useState([]); const [quotaList, setQuotaList] = useState([]);
const [groupQuotaList, setGroupQuotaList] = useState([]); const [groupQuotaList, setGroupQuotaList] = useState([]);
...@@ -463,6 +464,7 @@ QuotaSelect.defaultProps = { ...@@ -463,6 +464,7 @@ QuotaSelect.defaultProps = {
onModalCancel: () => {}, onModalCancel: () => {},
onModalOk: () => {}, onModalOk: () => {},
onModalClose: () => {}, onModalClose: () => {},
defaultSelect: 'emphasis',
}; };
QuotaSelect.propTypes = { QuotaSelect.propTypes = {
...@@ -485,6 +487,7 @@ QuotaSelect.propTypes = { ...@@ -485,6 +487,7 @@ QuotaSelect.propTypes = {
onModalCancel: PropTypes.func, onModalCancel: PropTypes.func,
onModalOk: PropTypes.func, onModalOk: PropTypes.func,
onModalClose: PropTypes.func, onModalClose: PropTypes.func,
defaultSelect: PropTypes.string,
}; };
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