Commit da122e60 authored by 涂茜's avatar 涂茜

fix: bug

parent b27051f5
Pipeline #28135 passed with stages
in 5 minutes 1 second
......@@ -43,7 +43,7 @@ const Demo = () => {
pageSize: 20,
// deviceTypes: '二供泵房,二供机组',
getChild: true,
// userID: 1,
userID: 1,
// queryInfo: '',
// sortFields: '',
// direction: '',
......
......@@ -22,7 +22,7 @@ const DeviceTree = (props) => {
const [treeData, setTreeData] = useState([]);
const [params, setParams] = useState({});
const [total, setTotal] = useState(0);
const [totalCount, setTotalCount] = useState(0);
const [loading, setLoading] = useState(false);
useEffect(() => {
......@@ -31,7 +31,7 @@ const DeviceTree = (props) => {
pageSize: serviceParams.pageSize || 20,
deviceTypes: serviceParams.deviceTypes || '二供泵房,二供机组',
getChild: serviceParams.getChild,
userID: serviceParams.userID || 0,
userID: serviceParams.userID || '',
queryInfo: serviceParams.queryInfo || '',
sortFields: serviceParams.sortFields || '',
direction: serviceParams.direction || '',
......@@ -61,7 +61,7 @@ const DeviceTree = (props) => {
const newData = handleData(data);
setLoading(false);
setTreeData(newData);
setTotal(response.data.totalPages);
setTotalCount(response.data.totalCount);
onTreeCheck([newData[0]]);
onTreeSelect([newData[0]]);
} else {
......@@ -118,7 +118,7 @@ const DeviceTree = (props) => {
onChange={onSearch}
onPressEnter={onSearch}
/>
<Divider />
<Divider className={classNames(`${prefixCls}-divider`)} />
<div className={classNames(`${prefixCls}-content`)}>
<Spin spinning={loading}>
{!!treeData.length && (
......@@ -143,11 +143,16 @@ const DeviceTree = (props) => {
hideOnSinglePage
current={params.pageIndex || 1}
pageSize={params.pageSize || 20}
total={total}
total={totalCount}
onChange={onPaginationChange}
/>
</div>
)}
{!pagination && (
<Divider plain className={classNames(`${prefixCls}-total`)}>
{totalCount} 记录
</Divider>
)}
</div>
);
};
......
......@@ -8,7 +8,7 @@
height: 100%;
padding: 5px;
.ant-divider {
&-divider {
margin: 6px 0 12px 0;
}
......@@ -24,8 +24,8 @@
width: 100%;
}
.ant-tree-indent {
width: 0;
.ant-tree-switcher-noop {
width: 14px;
}
.ant-tree-node-content-wrapper {
......@@ -46,4 +46,14 @@
&-pagination {
margin: 10px auto;
}
&-total.ant-divider-horizontal.ant-divider-with-text {
margin: 10px auto;
color: #a4b1c7;
}
.ant-divider-horizontal.ant-divider-with-text::before,
.ant-divider-horizontal.ant-divider-with-text::after {
top: 0;
}
}
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