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

fix: 优化机构站点树显示

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