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
65b166ad
Commit
65b166ad
authored
Jun 18, 2021
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产全文检索
parent
b0579fa4
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
165 additions
and
23 deletions
+165
-23
App.js
src/App.js
+2
-0
assetmanage.js
src/model/assetmanage.js
+5
-0
routes.js
src/routes.js
+1
-1
dataassetmanager.js
src/service/dataassetmanager.js
+4
-0
constant.js
src/util/constant.js
+0
-3
AssetDetail.jsx
src/view/Manage/AssetManage/Component/AssetDetail.jsx
+15
-5
AssetDetailItem.jsx
src/view/Manage/AssetManage/Component/AssetDetailItem.jsx
+88
-0
AssetTable.jsx
src/view/Manage/AssetManage/Component/AssetTable.jsx
+22
-6
AssetTree.jsx
src/view/Manage/AssetManage/Component/AssetTree.jsx
+26
-6
ModelTree.jsx
src/view/Manage/Model/Component/ModelTree.jsx
+2
-2
No files found.
src/App.js
View file @
65b166ad
...
@@ -28,6 +28,8 @@ export default class App extends React.Component {
...
@@ -28,6 +28,8 @@ export default class App extends React.Component {
id
=
params
.
id
||
''
;
id
=
params
.
id
||
''
;
}
}
console
.
log
(
'params'
,
params
);
if
(
message
===
'showDataModelDetail'
)
{
if
(
message
===
'showDataModelDetail'
)
{
return
(
return
(
<
ImportModal
<
ImportModal
...
...
src/model/assetmanage.js
View file @
65b166ad
...
@@ -94,3 +94,7 @@ export function* loadDataAssets(payload) {
...
@@ -94,3 +94,7 @@ export function* loadDataAssets(payload) {
export
function
*
unloadDataAssets
(
payload
)
{
export
function
*
unloadDataAssets
(
payload
)
{
return
yield
call
(
service
.
unloadDataAssets
,
payload
);
return
yield
call
(
service
.
unloadDataAssets
,
payload
);
}
}
export
function
*
getDataAssetLocation
(
payload
)
{
return
yield
call
(
service
.
getDataAssetLocation
,
payload
);
}
\ No newline at end of file
src/routes.js
View file @
65b166ad
...
@@ -9,7 +9,7 @@ export const routes = [
...
@@ -9,7 +9,7 @@ export const routes = [
{
{
name
:
'manage'
,
name
:
'manage'
,
text
:
'数据管理'
,
text
:
'数据管理'
,
redirect
:
'map'
,
redirect
:
'
asset-
map'
,
children
:
[
children
:
[
{
{
name
:
'datasource-manage'
,
name
:
'datasource-manage'
,
...
...
src/service/dataassetmanager.js
View file @
65b166ad
...
@@ -60,6 +60,10 @@ export function unloadDataAssets(payload) {
...
@@ -60,6 +60,10 @@ export function unloadDataAssets(payload) {
return
PostJSON
(
"/dataassetmanager/dataAssetApi/unloadDataAssets"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/unloadDataAssets"
,
payload
);
}
}
export
function
getDataAssetLocation
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/dataAssetApi/locateDataAssetById"
,
payload
);
}
export
function
addOrUpdateDirectory
(
payload
)
{
export
function
addOrUpdateDirectory
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/directoryApi/addOrUpdateDirectory"
,
payload
);
return
PostJSON
(
"/dataassetmanager/directoryApi/addOrUpdateDirectory"
,
payload
);
}
}
...
...
src/util/constant.js
View file @
65b166ad
export
const
AnchorId
=
'id'
;
export
const
AnchorId
=
'id'
;
export
const
AnchorTimestamp
=
'timestamp'
;
export
const
AnchorTimestamp
=
'timestamp'
;
export
const
AnchorDid
=
'did'
;
export
const
AnchorLocation
=
'location'
;
\ No newline at end of file
src/view/Manage/AssetManage/Component/AssetDetail.jsx
View file @
65b166ad
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
React
,
{
useEffect
,
useState
}
from
"react"
;
import
{
Modal
,
Typography
}
from
"antd"
;
import
{
Modal
,
Typography
,
Spin
}
from
"antd"
;
import
Asset
Item
from
'./Asset
Item'
;
import
Asset
DetailItem
from
'./AssetDetail
Item'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
const
AssetDetail
=
(
props
)
=>
{
const
AssetDetail
=
(
props
)
=>
{
...
@@ -9,6 +9,7 @@ const AssetDetail = (props)=>{
...
@@ -9,6 +9,7 @@ const AssetDetail = (props)=>{
const
{
onCancel
,
visible
,
id
,
reference
=
null
}
=
props
;
const
{
onCancel
,
visible
,
id
,
reference
=
null
}
=
props
;
const
[
asset
,
setAsset
]
=
useState
(
''
);
const
[
asset
,
setAsset
]
=
useState
(
''
);
const
[
assetName
,
setAssetName
]
=
useState
(
''
);
const
[
assetName
,
setAssetName
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
@@ -16,17 +17,22 @@ const AssetDetail = (props)=>{
...
@@ -16,17 +17,22 @@ const AssetDetail = (props)=>{
getAssetThenGetAssetName
();
getAssetThenGetAssetName
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
visible
])
},
[
visible
,
id
])
const
getAssetThenGetAssetName
=
()
=>
{
const
getAssetThenGetAssetName
=
()
=>
{
setLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.getDataAssetDetail'
,
type
:
'assetmanage.getDataAssetDetail'
,
payload
:
{
payload
:
{
dataAssetId
:
id
dataAssetId
:
id
},
},
callback
:
data
=>
{
callback
:
data
=>
{
setLoading
(
false
);
setAsset
(
data
);
setAsset
(
data
);
getAssetName
(
data
);
getAssetName
(
data
);
},
error
:
()
=>
{
setLoading
(
false
);
}
}
})
})
}
}
...
@@ -57,11 +63,15 @@ const AssetDetail = (props)=>{
...
@@ -57,11 +63,15 @@ const AssetDetail = (props)=>{
onCancel=
{
()
=>
{
onCancel
&&
onCancel
()}
}
onCancel=
{
()
=>
{
onCancel
&&
onCancel
()}
}
footer=
{
null
}
footer=
{
null
}
>
>
<
AssetItem
data=
{
asset
}
/>
<
Spin
spinning=
{
loading
}
>
<
AssetDetailItem
data=
{
asset
}
/>
</
Spin
>
</
Modal
>
</
Modal
>
}
}
{
{
reference
&&
<
AssetItem
data=
{
asset
}
/>
reference
&&
<
Spin
spinning=
{
loading
}
>
<
AssetDetailItem
data=
{
asset
}
/>
</
Spin
>
}
}
</>
</>
)
)
...
...
src/view/Manage/AssetManage/Component/AssetDetailItem.jsx
0 → 100644
View file @
65b166ad
import
React
,
{
useEffect
,
useState
}
from
'react'
;
import
{
Avatar
,
Row
,
Col
,
Typography
,
Divider
}
from
'antd'
;
import
'./AssetItem.less'
;
const
colors
=
[
'#BDD2FD'
,
'#C2C8D5'
,
'#FBE5A2'
,
'#F6C3B7'
,
'#B6E3F5'
,
'#D3C6EA'
,
'#FFD8B8'
,
'#AAD8D8'
,
'#FFD6E7'
,
];
const
AssetItem
=
(
props
)
=>
{
const
{
data
}
=
props
;
const
[
typesOfElements
,
setTypesOfElements
]
=
useState
([]);
useEffect
(()
=>
{
if
(
data
)
{
convertData
();
}
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
data
]);
const
convertData
=
()
=>
{
const
_typesOfElements
=
[];
const
_types
=
[];
data
&&
(
data
.
elements
||
[]).
forEach
(
element
=>
{
if
(
_types
.
indexOf
(
element
.
type
||
''
)
===
-
1
)
{
_types
.
push
(
element
.
type
||
''
);
const
_elements
=
(
data
.
elements
||
[]).
filter
(
_element
=>
(
_element
.
type
||
''
)
===
(
element
.
type
||
''
));
_typesOfElements
.
push
({
type
:
element
.
type
||
''
,
elements
:
_elements
||
[]
});
}
})
setTypesOfElements
(
_typesOfElements
);
}
return
(
<
div
className=
'asset-item'
>
{
(
typesOfElements
||
[]).
map
((
typeOfElements
,
index
)
=>
{
const
_type
=
typeOfElements
.
type
||
''
;
return
(
<
div
key=
{
index
}
className=
'd-flex'
style=
{
{
alignItems
:
'center'
}
}
>
<
Avatar
className=
'mr-3'
title=
{
_type
}
style=
{
{
backgroundColor
:
colors
[
index
%
colors
.
length
]
}
}
>
{
_type
===
''
?
'无'
:
_type
.
slice
(
0
,
2
)
}
</
Avatar
>
<
div
className=
'textOverflow'
style=
{
{
flex
:
1
}
}
>
<
Row
className=
'mb-3'
>
{
typeOfElements
&&
typeOfElements
.
elements
&&
typeOfElements
.
elements
.
map
((
element
,
_index
)
=>
{
return
(
<
Col
className=
'mt-3'
key=
{
_index
}
md=
{
8
}
>
<
Typography
.
Paragraph
title=
{
`${element.name||''}: ${element.value||''}`
}
ellipsis
>
{
`${element.name||''}: ${element.value||''}`
}
</
Typography
.
Paragraph
>
</
Col
>
);
})
}
</
Row
>
{
index
!==
((
typesOfElements
||
[]).
length
-
1
)
&&
<
Divider
/>
}
</
div
>
</
div
>
)
})
}
</
div
>
);
}
export
default
AssetItem
;
src/view/Manage/AssetManage/Component/AssetTable.jsx
View file @
65b166ad
...
@@ -12,7 +12,7 @@ import AssetDetail from "./AssetDetail"
...
@@ -12,7 +12,7 @@ import AssetDetail from "./AssetDetail"
import
AssetItem
from
'./AssetItem'
;
import
AssetItem
from
'./AssetItem'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
dispatch
}
from
'../../../../model'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
}
from
'../../../../util'
;
import
{
showMessage
,
showNotifaction
,
getQueryParam
}
from
'../../../../util'
;
import
{
AnchorId
,
Anchor
Location
}
from
'../../../../util/constant'
;
import
{
AnchorId
,
Anchor
Timestamp
}
from
'../../../../util/constant'
;
import
"./AssetTable.less"
;
import
"./AssetTable.less"
;
...
@@ -40,7 +40,7 @@ const AssetTable = (props) => {
...
@@ -40,7 +40,7 @@ const AssetTable = (props) => {
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
anchorId
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
const
anchorId
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
const
anchorLocation
=
Number
(
getQueryParam
(
AnchorLocation
,
props
.
location
.
search
)
);
const
timestamp
=
getQueryParam
(
AnchorTimestamp
,
props
.
location
.
search
);
const
shouldScrollRef
=
useRef
(
false
);
const
shouldScrollRef
=
useRef
(
false
);
...
@@ -49,8 +49,7 @@ const AssetTable = (props) => {
...
@@ -49,8 +49,7 @@ const AssetTable = (props) => {
if
(
shouldScrollRef
.
current
===
true
)
{
if
(
shouldScrollRef
.
current
===
true
)
{
const
_pageNum
=
parseInt
(
anchorLocation
/
pageSize
+
((
anchorLocation
%
pageSize
===
0
)?
0
:
1
));
getDataAssetLocation
();
setPagination
({
...
pagination
,
pageNum
:
_pageNum
});
}
else
{
}
else
{
...
@@ -72,8 +71,7 @@ const AssetTable = (props) => {
...
@@ -72,8 +71,7 @@ const AssetTable = (props) => {
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
anchorId
])
},
[
timestamp
])
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
nodeId
||
''
)
!==
''
)
{
if
((
nodeId
||
''
)
!==
''
)
{
...
@@ -105,6 +103,24 @@ const AssetTable = (props) => {
...
@@ -105,6 +103,24 @@ const AssetTable = (props) => {
}
}
})
})
const
getDataAssetLocation
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getDataAssetLocation'
,
payload
:
{
dataAssetId
:
anchorId
},
callback
:
data
=>
{
const
anchorLocation
=
data
.
offset
;
const
_pageNum
=
parseInt
(
anchorLocation
/
pageSize
+
((
anchorLocation
%
pageSize
===
0
)?
0
:
1
));
setPagination
({
...
pagination
,
pageNum
:
_pageNum
});
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
const
changeCurrent
=
(
page
,
size
)
=>
{
const
changeCurrent
=
(
page
,
size
)
=>
{
setCheckAllValue
(
false
);
setCheckAllValue
(
false
);
setSelectedKeys
([]);
setSelectedKeys
([]);
...
...
src/view/Manage/AssetManage/Component/AssetTree.jsx
View file @
65b166ad
...
@@ -8,12 +8,12 @@ import ImportDirectory from './ImportDirectory';
...
@@ -8,12 +8,12 @@ import ImportDirectory from './ImportDirectory';
import
UpdateDirectoryModal
from
'./UpdateDirectoryModal'
;
import
UpdateDirectoryModal
from
'./UpdateDirectoryModal'
;
import
CustomDirectoryModal
from
'./CustomDirectoryModal'
;
import
CustomDirectoryModal
from
'./CustomDirectoryModal'
;
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
showMessage
,
getQueryParam
}
from
'../../../../util'
;
import
{
Anchor
Di
d
}
from
'../../../../util/constant'
;
import
{
Anchor
Timestamp
,
AnchorI
d
}
from
'../../../../util/constant'
;
import
'./AssetTree.less'
;
import
'./AssetTree.less'
;
const
AssetTree
=
(
props
)
=>
{
const
AssetTree
=
(
props
)
=>
{
const
{
readOnly
=
false
,
onSelect
,
className
,
...
restProps
}
=
props
;
const
{
readOnly
=
false
,
onSelect
,
className
}
=
props
;
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeData
,
setTreeData
]
=
useState
([]);
...
@@ -30,12 +30,33 @@ const AssetTree = (props) => {
...
@@ -30,12 +30,33 @@ const AssetTree = (props) => {
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
[
modal
,
contextHolder
]
=
Modal
.
useModal
();
const
did
=
getQueryParam
(
AnchorDid
,
props
.
location
.
search
);
const
timestamp
=
getQueryParam
(
AnchorTimestamp
,
props
.
location
.
search
);
const
id
=
getQueryParam
(
AnchorId
,
props
.
location
.
search
);
useEffect
(()
=>
{
useEffect
(()
=>
{
getAllDirectoryAsTree
(
true
,
did
);
if
((
id
||
''
)
!==
''
)
{
getDataAssetLocationThenGetTreeData
();
}
else
{
getAllDirectoryAsTree
(
true
);
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
did
])
},
[
timestamp
])
const
getDataAssetLocationThenGetTreeData
=
()
=>
{
setLoading
(
true
);
dispatch
({
type
:
'assetmanage.getDataAssetLocation'
,
payload
:
{
dataAssetId
:
id
},
callback
:
data
=>
{
getAllDirectoryAsTree
(
true
,
data
.
dirId
||
''
);
},
error
:
()
=>
{
setLoading
(
false
);
}
});
}
const
getAllDirectoryAsTree
=
(
resetCurrentDirId
=
true
,
defaultSelectedId
=
''
)
=>
{
const
getAllDirectoryAsTree
=
(
resetCurrentDirId
=
true
,
defaultSelectedId
=
''
)
=>
{
setLoading
(
true
);
setLoading
(
true
);
...
@@ -365,7 +386,6 @@ const AssetTree = (props) => {
...
@@ -365,7 +386,6 @@ const AssetTree = (props) => {
bodyStyle=
{
{
padding
:
10
}
}
bodyStyle=
{
{
padding
:
10
}
}
headStyle=
{
{
padding
:
10
}
}
headStyle=
{
{
padding
:
10
}
}
style=
{
{
width
:
'100%'
}
}
style=
{
{
width
:
'100%'
}
}
{
...
restProps
}
>
>
<
Spin
spinning=
{
loading
}
>
<
Spin
spinning=
{
loading
}
>
<
Input
<
Input
...
...
src/view/Manage/Model/Component/ModelTree.jsx
View file @
65b166ad
...
@@ -31,14 +31,14 @@ const ModelTree = (props) => {
...
@@ -31,14 +31,14 @@ const ModelTree = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
((
id
||
''
)
!==
''
)
{
if
((
id
||
''
)
!==
''
)
{
getDataModelLocation
();
getDataModelLocation
ThenGetTreeData
();
}
else
{
}
else
{
getTreeData
();
getTreeData
();
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
timestamp
])
},
[
timestamp
])
const
getDataModelLocation
=
()
=>
{
const
getDataModelLocation
ThenGetTreeData
=
()
=>
{
setLoading
(
true
);
setLoading
(
true
);
dispatch
({
dispatch
({
type
:
'datamodel.getDataModelLocation'
,
type
:
'datamodel.getDataModelLocation'
,
...
...
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