Commit 49b95372 authored by 邓超's avatar 邓超

fix: 优化机构站点树显示

parent 04344e81
Pipeline #67485 passed with stages
......@@ -86,6 +86,7 @@ const SiteManageV2 = () => {
const [keepTree, setKeepTree] = useState([]); // 保存所有一级id用于控制只展开一项一级菜单
const [indeterminate, setIndeterminate] = useState(new Map());
const [searchTreeValue, setSearchTreeValue] = useState('');
const [treeTotal, setTreeTotal] = useState();
let a = [];
......@@ -164,7 +165,8 @@ const SiteManageV2 = () => {
getSiteTree({ selectNode: -1, keyword: value }).then(res => {
if (res.code === 0) {
setTreeLoading(false);
setTreeData(res.data);
setTreeData(res.data.list);
setTreeTotal(res.data.count);
let aa = [];
if (res.data.length > 0) {
res.data.forEach(i => {
......@@ -749,18 +751,19 @@ const SiteManageV2 = () => {
[styles.orgContainerHide]: !treeVisible,
})}
>
<span style={{ margin: '0 187px 0 7px', fontSize: '15px ', fontWeight: 'bold' }}>
站点列表
</span>
<Tooltip title="添加顶级站点">
<PlusSquareFilled
onClick={() => addTopStation()}
style={{
color: '#1890FF',
fontSize: '25px',
}}
/>
</Tooltip>
<div style={{ width: '100%', display: 'flex', justifyContent: 'space-between' }}>
<span style={{ fontSize: '15px ', fontWeight: 'bold' }}>站点列表({treeTotal}个)</span>
<Tooltip title="添加顶级站点">
<PlusSquareFilled
onClick={() => addTopStation()}
style={{
color: '#1890FF',
fontSize: '25px',
}}
/>
</Tooltip>
</div>
<hr style={{ width: '97%', color: '#eeecec', marginLeft: '8px' }} />
<Search
style={{
......
......@@ -185,6 +185,7 @@ const UserManage = () => {
const [total, setTotal] = useState(0);
const [pageSize, setPageSize] = useState(20);
const [currentPage, setCurrentPage] = useState(1);
const [treeDataTotal, setTreeDataTotal] = useState();
// 用户表列名
const columns = [
{
......@@ -664,7 +665,8 @@ const UserManage = () => {
.then(newres => {
setTreeLoading(false);
if (newres.code === 0) {
let res = newres.data;
let res = newres.data.list;
setTreeDataTotal(newres.data.count);
console.log(res);
setTreeData(res);
......@@ -701,7 +703,8 @@ const UserManage = () => {
GetOUTreeNew({ selectOU: -1 })
.then(newres => {
if (newres.code === 0) {
let res = newres.data;
let res = newres.data.list;
setTreeDataTotal(newres.data.count);
console.log(res);
setTreeLoading(false);
setTreeData(res);
......@@ -1616,7 +1619,9 @@ const UserManage = () => {
})}
>
<div style={{ display: 'flex', flexDirection: 'column', height: '100%' }}>
<div style={{ display: 'flex' }}>
<div
style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}
>
<span
style={{
fontSize: '15px ',
......@@ -1624,7 +1629,7 @@ const UserManage = () => {
marginLeft: '7px',
}}
>
机构列表
机构列表({treeDataTotal}个)
</span>
<Tooltip title="添加顶级机构">
<PlusSquareFilled
......@@ -1632,8 +1637,7 @@ const UserManage = () => {
style={{
color: '#1890FF',
fontSize: '25px',
marginTop: '4px',
marginLeft: '67%',
// marginLeft: '51%',
}}
/>
</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