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
5beb3735
Commit
5beb3735
authored
Apr 06, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产打标签
parent
d96bc940
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
91 additions
and
32 deletions
+91
-32
App.js
src/App.js
+13
-0
assetmanage.js
src/model/assetmanage.js
+8
-0
dataassetmanager.js
src/service/dataassetmanager.js
+8
-0
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+5
-1
index.jsx
src/view/Manage/DatasourceManage/index.jsx
+3
-3
VersionCompare.less
src/view/Manage/Model/Component/VersionCompare.less
+6
-5
AddTagModal.jsx
src/view/Manage/Tag/Component/AddTagModal.jsx
+40
-21
index.jsx
src/view/Manage/Tag/index.jsx
+8
-2
No files found.
src/App.js
View file @
5beb3735
...
@@ -82,6 +82,19 @@ export class App extends React.Component {
...
@@ -82,6 +82,19 @@ export class App extends React.Component {
);
);
}
}
if
(
message
===
'showDatasource'
)
{
return
(
<
AppContext
.
Provider
value
=
{{
env
:
params
?.
env
,
user
:
params
?.
user
,
setGlobalState
,
onGlobalStateChange
}}
>
<
DatasourceManage
/>
<
/AppContext.Provider
>
);
}
return
(
return
(
<
AppContext
.
Provider
value
=
{{
<
AppContext
.
Provider
value
=
{{
env
:
params
?.
env
,
env
:
params
?.
env
,
...
...
src/model/assetmanage.js
View file @
5beb3735
...
@@ -49,6 +49,10 @@ export function* addOrUpdateDataAsset(payload) {
...
@@ -49,6 +49,10 @@ export function* addOrUpdateDataAsset(payload) {
return
yield
call
(
service
.
addOrUpdateDataAsset
,
payload
);
return
yield
call
(
service
.
addOrUpdateDataAsset
,
payload
);
}
}
export
function
*
addDataAssetByDirIds
(
payload
)
{
return
yield
call
(
service
.
addDataAssetByDirIds
,
payload
);
}
export
function
*
deleteDataAssets
(
payload
)
{
export
function
*
deleteDataAssets
(
payload
)
{
return
yield
call
(
service
.
deleteDataAssets
,
payload
);
return
yield
call
(
service
.
deleteDataAssets
,
payload
);
}
}
...
@@ -109,6 +113,10 @@ export function* upDownDirectory(payload) {
...
@@ -109,6 +113,10 @@ export function* upDownDirectory(payload) {
return
yield
call
(
service
.
upDownDirectory
,
payload
);
return
yield
call
(
service
.
upDownDirectory
,
payload
);
}
}
export
function
*
listDirectoryByName
(
payload
)
{
return
yield
call
(
service
.
listDirectoryByName
,
payload
);
}
export
function
*
loadDataAssets
(
payload
)
{
export
function
*
loadDataAssets
(
payload
)
{
return
yield
call
(
service
.
loadDataAssets
,
payload
);
return
yield
call
(
service
.
loadDataAssets
,
payload
);
}
}
...
...
src/service/dataassetmanager.js
View file @
5beb3735
...
@@ -48,6 +48,10 @@ export function addOrUpdateDataAsset(payload) {
...
@@ -48,6 +48,10 @@ export function addOrUpdateDataAsset(payload) {
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addOrUpdateDataAsset"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addOrUpdateDataAsset"
,
payload
);
}
}
export
function
addDataAssetByDirIds
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/addDataAssetByDirIds"
,
payload
);
}
export
function
deleteDataAssets
(
payload
)
{
export
function
deleteDataAssets
(
payload
)
{
return
PostJSON
(
"/dataassetmanager/dataAssetApi/deleteDataAssets"
,
payload
);
return
PostJSON
(
"/dataassetmanager/dataAssetApi/deleteDataAssets"
,
payload
);
}
}
...
@@ -136,6 +140,10 @@ export function upDownDirectory(payload) {
...
@@ -136,6 +140,10 @@ export function upDownDirectory(payload) {
return
PostJSON
(
"/dataassetmanager/directoryApi/upDownDirectory"
,
payload
);
return
PostJSON
(
"/dataassetmanager/directoryApi/upDownDirectory"
,
payload
);
}
}
export
function
listDirectoryByName
(
payload
)
{
return
GetJSON
(
"/dataassetmanager/directoryApi/listDirectoryByName"
,
payload
);
}
export
function
getMetadataModelTree
()
{
export
function
getMetadataModelTree
()
{
return
GetJSON
(
"/metadatarepo/rest/model/tree"
);
return
GetJSON
(
"/metadatarepo/rest/model/tree"
);
}
}
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
5beb3735
...
@@ -232,6 +232,10 @@ const AssetAction = (props) => {
...
@@ -232,6 +232,10 @@ const AssetAction = (props) => {
})
})
}
}
const
onAssetTag
=
(
keyword
)
=>
{
}
const
formItemLayout
=
{
const
formItemLayout
=
{
labelCol
:
{
labelCol
:
{
xs
:
{
span
:
24
},
xs
:
{
span
:
24
},
...
@@ -317,7 +321,7 @@ const AssetAction = (props) => {
...
@@ -317,7 +321,7 @@ const AssetAction = (props) => {
<
AppContext
.
Consumer
>
<
AppContext
.
Consumer
>
{
{
value
=>
{
value
=>
{
return
(
currentAction
===
'add'
||
currentAction
===
'edit'
)?<
Tag
styleType=
'complex'
id=
{
id
}
creator=
{
value
?.
user
?.
userName
||
''
}
/>:<
Tag
id=
{
id
}
creator=
{
value
?.
user
?.
userName
||
''
}
/>
return
(
currentAction
===
'add'
||
currentAction
===
'edit'
)?<
Tag
styleType=
'complex'
id=
{
id
}
creator=
{
value
?.
user
?.
userName
||
''
}
onAssetTag=
{
onAssetTag
}
/>:<
Tag
id=
{
id
}
creator=
{
value
?.
user
?.
userName
||
''
}
/>
}
}
}
}
</
AppContext
.
Consumer
>
</
AppContext
.
Consumer
>
...
...
src/view/Manage/DatasourceManage/index.jsx
View file @
5beb3735
...
@@ -20,9 +20,9 @@ const DatasourceManage = (props) => {
...
@@ -20,9 +20,9 @@ const DatasourceManage = (props) => {
const
{
env
}
=
useContext
(
AppContext
);
const
{
env
}
=
useContext
(
AppContext
);
const
domainId
=
getQueryParam
(
'domainId'
,
props
.
location
.
search
);
const
domainId
=
getQueryParam
(
'domainId'
,
props
?.
location
?
.
search
);
const
catalogId
=
getQueryParam
(
'catalogId'
,
props
.
location
.
search
);
const
catalogId
=
getQueryParam
(
'catalogId'
,
props
?.
location
?
.
search
);
const
scopeId
=
getQueryParam
(
'scopeId'
,
props
.
location
.
search
);
const
scopeId
=
getQueryParam
(
'scopeId'
,
props
?.
location
?
.
search
);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeData
,
setTreeData
]
=
useState
([]);
const
[
treeValue
,
setTreeValue
]
=
useState
(
''
);
const
[
treeValue
,
setTreeValue
]
=
useState
(
''
);
...
...
src/view/Manage/Model/Component/VersionCompare.less
View file @
5beb3735
.model-version-compare {
.model-version-compare {
.delete {
.
yy-typography .delete, .
delete {
color: red;
color: red
!important
;
text-decoration: line-through;
text-decoration: line-through
!important
;
}
}
.add {
.
yy-typography .add, .
add {
color: #0069ac;
color: #0069ac
!important
;
}
}
}
}
\ No newline at end of file
src/view/Manage/Tag/Component/AddTagModal.jsx
View file @
5beb3735
...
@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => {
...
@@ -34,7 +34,7 @@ const ClassifySelect = ({ value = '', data = [], onChange, ...restProps }) => {
}
}
const
AddTagModal
=
(
props
)
=>
{
const
AddTagModal
=
(
props
)
=>
{
const
{
visible
,
onCancel
,
id
,
type
,
creator
}
=
props
;
const
{
visible
,
onCancel
,
id
,
type
,
creator
,
onAssetTag
}
=
props
;
const
[
step
,
setStep
]
=
useState
(
0
);
const
[
step
,
setStep
]
=
useState
(
0
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
...
@@ -135,29 +135,48 @@ const AddTagModal = (props) => {
...
@@ -135,29 +135,48 @@ const AddTagModal = (props) => {
return
;
return
;
}
}
if
(
selectTag
)
{
setConfirmLoading
(
true
);
setConfirmLoading
(
true
);
dispatch
({
dispatch
({
type
:
'assetmanage.listDirectoryByName'
,
type
:
'tag.batchAddTagResource'
,
payload
:
{
payload
:
{
name
:
keyword
params
:
{
},
tagId
:
selectTag
.
tagId
,
callback
:
data
=>
{
resourceIds
:
id
,
setConfirmLoading
(
false
);
type
,
creator
if
((
data
||
[]).
length
===
0
)
{
if
(
selectTag
)
{
setConfirmLoading
(
true
);
dispatch
({
type
:
'tag.batchAddTagResource'
,
payload
:
{
params
:
{
tagId
:
selectTag
.
tagId
,
resourceIds
:
id
,
type
,
creator
}
},
callback
:
()
=>
{
reset
();
onCancel
&&
onCancel
(
true
);
},
error
:
()
=>
{
setConfirmLoading
(
false
);
}
})
}
else
{
setStep
(
1
);
}
}
},
}
else
{
callback
:
()
=>
{
reset
();
reset
();
onCancel
&&
onCancel
(
true
);
onAssetTag
&&
onAssetTag
(
keyword
);
},
error
:
()
=>
{
setConfirmLoading
(
false
);
}
}
})
},
}
else
{
error
:
()
=>
{
setStep
(
1
);
setConfirmLoading
(
false
);
}
}
})
}
}
const
cancel
=
()
=>
{
const
cancel
=
()
=>
{
...
...
src/view/Manage/Tag/index.jsx
View file @
5beb3735
...
@@ -6,7 +6,7 @@ import AddTagModal from './Component/AddTagModal';
...
@@ -6,7 +6,7 @@ import AddTagModal from './Component/AddTagModal';
import
{
dispatch
}
from
'../../../model'
;
import
{
dispatch
}
from
'../../../model'
;
const
TagColumn
=
(
props
)
=>
{
const
TagColumn
=
(
props
)
=>
{
const
{
id
,
type
=
'dataAsset'
,
creator
=
''
,
styleType
=
'simple'
}
=
props
;
const
{
id
,
type
=
'dataAsset'
,
creator
=
''
,
styleType
=
'simple'
,
onAssetTag
}
=
props
;
const
[
ownTags
,
setOwnTags
]
=
useState
([]);
const
[
ownTags
,
setOwnTags
]
=
useState
([]);
const
[
addTagModalVisible
,
setAddTagModalVisible
]
=
useState
(
false
);
const
[
addTagModalVisible
,
setAddTagModalVisible
]
=
useState
(
false
);
...
@@ -50,6 +50,11 @@ const TagColumn = (props) => {
...
@@ -50,6 +50,11 @@ const TagColumn = (props) => {
refresh
&&
getTags
();
refresh
&&
getTags
();
}
}
const
onAssetTagCancel
=
(
keyword
)
=>
{
setAddTagModalVisible
(
false
);
onAssetTag
&&
onAssetTag
(
keyword
);
}
const
handleClose
=
(
index
)
=>
{
const
handleClose
=
(
index
)
=>
{
const
_tag
=
ownTags
[
index
];
const
_tag
=
ownTags
[
index
];
...
@@ -147,7 +152,8 @@ const TagColumn = (props) => {
...
@@ -147,7 +152,8 @@ const TagColumn = (props) => {
id=
{
id
}
id=
{
id
}
type=
{
type
}
type=
{
type
}
creator=
{
creator
}
creator=
{
creator
}
onCancel=
{
onAddTagModalCancel
}
onCancel=
{
onAddTagModalCancel
}
onAssetTag=
{
onAssetTagCancel
}
/>
/>
{
contextHolder
}
{
contextHolder
}
</
React
.
Fragment
>
</
React
.
Fragment
>
...
...
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