Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
szse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhaochengxiang
szse
Commits
5df3a06b
Commit
5df3a06b
authored
Nov 21, 2023
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
服务目录统计
parent
17ff7421
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
55 additions
and
2 deletions
+55
-2
pds.js
src/model/pds.js
+8
-0
pds.js
src/service/pds.js
+8
-0
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+39
-2
No files found.
src/model/pds.js
View file @
5df3a06b
...
...
@@ -9,10 +9,18 @@ export function* loadDataServiceCatalog() {
return
yield
call
(
pds
.
loadDataServiceCatalog
)
}
export
function
*
loadDataServiceCatalogServiceCount
()
{
return
yield
call
(
pds
.
loadDataServiceCatalogServiceCount
)
}
export
function
*
loadStateCatalog
(
payload
)
{
return
yield
call
(
pds
.
loadStateCatalog
,
payload
);
}
export
function
*
loadDataServiceStateCatalogServiceCount
()
{
return
yield
call
(
pds
.
loadDataServiceStateCatalogServiceCount
)
}
export
function
*
saveCatalog
(
payload
)
{
return
yield
call
(
pds
.
saveCatalog
,
payload
);
}
...
...
src/service/pds.js
View file @
5df3a06b
...
...
@@ -9,10 +9,18 @@ export function loadDataServiceCatalog() {
return
GetJSON
(
"/pdataservice/pdsCURD/loadDataServiceCatalog"
);
}
export
function
loadDataServiceCatalogServiceCount
()
{
return
GetJSON
(
"/pdataservice/pdsCURD/loadDataServiceCatalogServiceCount"
);
}
export
function
loadStateCatalog
(
payload
)
{
return
GetJSON
(
"/pdataservice/pdsCURD/loadDataServiceStateCatalog"
,
payload
)
}
export
function
loadDataServiceStateCatalogServiceCount
()
{
return
GetJSON
(
"/pdataservice/pdsCURD/loadDataServiceStateCatalogServiceCount"
);
}
export
function
saveCatalog
(
payload
)
{
return
PostJSON
(
"/pdataservice/pdsCURD/saveDataServiceCatalog"
,
payload
)
}
...
...
src/view/Manage/Model/Component/ModelTree.jsx
View file @
5df3a06b
import
React
,
{
useState
,
useEffect
,
useContext
}
from
"react"
;
import
React
,
{
useState
,
useEffect
,
useContext
,
useMemo
}
from
"react"
;
import
{
Tooltip
,
Tree
,
Modal
,
Spin
,
Dropdown
,
Menu
,
Button
,
AutoComplete
}
from
"antd"
;
import
{
PlusOutlined
,
SwapOutlined
,
ImportOutlined
,
UnorderedListOutlined
,
ReloadOutlined
}
from
'@ant-design/icons'
;
import
classnames
from
'classnames'
;
...
...
@@ -57,6 +57,8 @@ const ModelTree = (props) => {
const
[
dataList
,
setDataList
]
=
useState
([]);
const
[
options
,
setOptions
]
=
useState
([]);
const
[
serviceCountMapping
,
setServiceCountMapping
]
=
useState
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
timestamp
=
getQueryParam
(
AnchorTimestamp
,
props
.
location
?.
search
||
''
);
...
...
@@ -106,6 +108,10 @@ const ModelTree = (props) => {
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
keyword
])
useEffect
(()
=>
{
getServiceCount
()
},
[
viewSelectedKey
])
// const getShowSyncAndDomains = () => {
// dispatch({
// type: 'datamodel.isSetRootDomainId',
...
...
@@ -125,6 +131,28 @@ const ModelTree = (props) => {
// });
// }
const
getServiceCount
=
()
=>
{
dispatch
({
type
:
(
viewSelectedKey
===
'dir'
)
?
'pds.loadDataServiceCatalogServiceCount'
:
'pds.loadDataServiceStateCatalogServiceCount'
,
callback
:
data
=>
{
if
(
viewSelectedKey
===
'dir'
)
{
let
newData
=
{}
for
(
const
key
in
(
data
||
{}))
{
let
total
=
0
const
item
=
data
[
key
]
for
(
const
id
in
item
)
{
total
=
total
+
item
[
id
]??
0
}
newData
[
key
]
=
total
}
setServiceCountMapping
(
newData
)
}
else
{
setServiceCountMapping
(
data
)
}
}
});
}
const
getDataModelLocationThenGetDirTreeData
=
()
=>
{
setLoading
(
true
);
dispatch
({
...
...
@@ -599,7 +627,16 @@ const ModelTree = (props) => {
treeData=
{
treeData
}
selectedKeys=
{
[
item
?
item
.
key
:
''
]
}
titleRender=
{
(
nodeData
)
=>
{
return
<
span
title=
{
nodeData
?.
remark
||
''
}
className=
'cursor-pointer-contextmenu'
>
{
(
nodeData
.
status
===-
1
)?
`${nodeData?.name}_已停用`
:
nodeData
?.
name
||
''
}
</
span
>;
let
title
=
nodeData
?.
name
if
(
nodeData
.
status
===
-
1
)
{
title
=
`${title}_已停用`
}
if
(
serviceCountMapping
?.[
nodeData
.
id
]
!==
null
&&
serviceCountMapping
?.[
nodeData
.
id
]
!==
undefined
)
{
title
=
`${title} (${serviceCountMapping?.[nodeData.id]})`
}
return
<
span
title=
{
nodeData
?.
remark
||
''
}
className=
'cursor-pointer-contextmenu'
>
{
title
}
</
span
>;
}
}
onRightClick=
{
({
event
,
node
})
=>
{
if
(
viewSelectedKey
===
'dir'
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment