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
3ec1f59e
Commit
3ec1f59e
authored
Mar 10, 2022
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
没有资产,详情内容清空
parent
c414404c
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
18 deletions
+14
-18
datasourcemanager.js
src/service/datasourcemanager.js
+1
-1
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+11
-11
UpdateDatasourceModal.jsx
...nage/DatasourceManage/Component/UpdateDatasourceModal.jsx
+2
-6
No files found.
src/service/datasourcemanager.js
View file @
3ec1f59e
...
@@ -21,7 +21,7 @@ export function saveDatasource(payload) {
...
@@ -21,7 +21,7 @@ export function saveDatasource(payload) {
}
}
export
function
validateDatasource
(
payload
)
{
export
function
validateDatasource
(
payload
)
{
return
Post
(
"/metadataharvester/datasource/validateDatasource"
,
payload
);
return
Post
JSON
(
"/metadataharvester/datasource/validateDatasource"
,
payload
);
}
}
export
function
getDatasource
(
payload
)
{
export
function
getDatasource
(
payload
)
{
...
...
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
3ec1f59e
...
@@ -17,7 +17,7 @@ const AssetAction = (props) => {
...
@@ -17,7 +17,7 @@ const AssetAction = (props) => {
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
readOnly
=
false
,
form
,
onMetadataChange
,
onElementsChange
}
=
props
;
const
{
id
,
dirId
,
action
,
terms
,
onChange
,
readOnly
=
false
,
form
,
onMetadataChange
,
onElementsChange
}
=
props
;
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
currentAction
,
setCurrentAction
]
=
useState
(
action
);
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
[]
,
attributes
:
[],
attributesFoldMap
:
{}
});
const
[
assetParams
,
setAssetParams
]
=
useState
({
assets
:
{}
,
attributes
:
[],
attributesFoldMap
:
{}
});
const
[
elements
,
setElements
]
=
useState
([]);
const
[
elements
,
setElements
]
=
useState
([]);
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
metadataId
,
setMetadataId
]
=
useState
(
''
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
const
[
loading
,
setLoading
]
=
useState
(
false
);
...
@@ -29,9 +29,15 @@ const AssetAction = (props) => {
...
@@ -29,9 +29,15 @@ const AssetAction = (props) => {
useEffect
(()
=>
{
useEffect
(()
=>
{
if
(
action
===
'add'
)
{
if
(
action
===
'add'
)
{
getElements
();
getElements
();
}
else
if
((
id
||
''
)
!==
''
)
{
}
else
{
setCurrentAction
(
'detail'
);
setCurrentAction
(
'detail'
);
getAsset
();
if
((
id
||
''
)
!==
''
)
{
getAsset
();
}
else
{
setMetadataId
(
''
);
setAssetParams
({...
assetParams
,
...{
assets
:
{},
attributes
:
[]}});
setElements
([]);
}
}
}
//eslint-disable-next-line react-hooks/exhaustive-deps
//eslint-disable-next-line react-hooks/exhaustive-deps
},
[
id
])
},
[
id
])
...
@@ -60,7 +66,7 @@ const AssetAction = (props) => {
...
@@ -60,7 +66,7 @@ const AssetAction = (props) => {
}
}
})
})
setAssetParams
({
assets
:
[]
,
attributes
:
_attributes
,
attributesFoldMap
:
newAttributesFoldMap
});
setAssetParams
({
assets
:
{}
,
attributes
:
_attributes
,
attributesFoldMap
:
newAttributesFoldMap
});
form
?.
resetFields
();
form
?.
resetFields
();
}
}
...
@@ -324,13 +330,7 @@ const AssetAction = (props) => {
...
@@ -324,13 +330,7 @@ const AssetAction = (props) => {
>
>
{
{
(
attributes
||
[]).
map
((
attribute
,
index
)
=>
{
(
attributes
||
[]).
map
((
attribute
,
index
)
=>
{
let
sameAttributeElements
=
[];
let
sameAttributeElements
=
(
elements
||
[]).
filter
(
element
=>
element
.
type
===
attribute
);
if
(
currentAction
===
'add'
||
currentAction
===
'edit'
)
{
sameAttributeElements
=
(
elements
||
[]).
filter
(
element
=>
element
.
type
===
attribute
);
}
else
{
sameAttributeElements
=
(
assets
?.
elements
||
[]).
filter
(
element
=>
element
.
type
===
attribute
);
}
if
(
currentAction
!==
'add'
&&
!
fullScreen
&&
attributesFoldMap
[
attribute
])
{
if
(
currentAction
!==
'add'
&&
!
fullScreen
&&
attributesFoldMap
[
attribute
])
{
sameAttributeElements
=
(
sameAttributeElements
||
[]).
filter
(
element
=>
unfoldedElements
.
indexOf
(
element
?.
name
||
''
)
!==-
1
);
sameAttributeElements
=
(
sameAttributeElements
||
[]).
filter
(
element
=>
unfoldedElements
.
indexOf
(
element
?.
name
||
''
)
!==-
1
);
...
...
src/view/Manage/DatasourceManage/Component/UpdateDatasourceModal.jsx
View file @
3ec1f59e
...
@@ -166,13 +166,9 @@ const UpdateDatasourceModal = (props) => {
...
@@ -166,13 +166,9 @@ const UpdateDatasourceModal = (props) => {
payload
:
{
payload
:
{
data
:
newDatasource
data
:
newDatasource
},
},
callback
:
data
=>
{
callback
:
()
=>
{
setValidateLoading
(
false
);
setValidateLoading
(
false
);
if
(
data
===
'true'
)
{
showMessage
(
'success'
,
'测试成功'
);
showMessage
(
'success'
,
'测试成功'
);
}
else
if
(
data
===
'false'
)
{
showMessage
(
'error'
,
'测试失败'
);
}
},
},
error
:
()
=>
{
error
:
()
=>
{
setValidateLoading
(
false
);
setValidateLoading
(
false
);
...
...
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