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
3006feaa
Commit
3006feaa
authored
Jan 16, 2024
by
zhaochengxiang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
管理员编辑资产直接保存
parent
26ccf916
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
4 deletions
+27
-4
AssetAction.jsx
src/view/Manage/AssetManage/Component/AssetAction.jsx
+27
-4
No files found.
src/view/Manage/AssetManage/Component/AssetAction.jsx
View file @
3006feaa
...
@@ -52,6 +52,7 @@ const AssetAction = (props) => {
...
@@ -52,6 +52,7 @@ const AssetAction = (props) => {
const
[
treeDataMap
,
setTreeDataMap
]
=
useState
(
undefined
);
const
[
treeDataMap
,
setTreeDataMap
]
=
useState
(
undefined
);
const
[
currentDomainGroup
,
setCurrentDomainGroup
]
=
useState
(
undefined
);
const
[
currentDomainGroup
,
setCurrentDomainGroup
]
=
useState
(
undefined
);
const
[
currentBussinessDomain
,
setCurrentBussinessDomain
]
=
useState
(
undefined
);
const
[
currentBussinessDomain
,
setCurrentBussinessDomain
]
=
useState
(
undefined
);
const
[
loadingEditPermission
,
setLoadingEditPermission
]
=
useState
(
false
);
const
[
canEdit
,
setEdit
]
=
useState
(
false
);
const
[
canEdit
,
setEdit
]
=
useState
(
false
);
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
metadata
,
setMetadata
]
=
useState
(
undefined
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
const
[
loadingMetadataColumnList
,
setLoadingMetadataColumnList
]
=
useState
(
false
);
...
@@ -70,6 +71,8 @@ const AssetAction = (props) => {
...
@@ -70,6 +71,8 @@ const AssetAction = (props) => {
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
keyword
,
setKeyword
]
=
useState
(
''
);
const
[
publishedAsset
,
setPublishedAsset
]
=
useState
();
const
[
publishedAsset
,
setPublishedAsset
]
=
useState
();
const
[
isMetadataEdit
,
setMetadataEdit
]
=
useState
(
false
);
const
[
isMetadataEdit
,
setMetadataEdit
]
=
useState
(
false
);
const
[
loadingAdmin
,
setLoadingAdmin
]
=
useState
(
false
);
const
[
isAdmin
,
setAdmin
]
=
React
.
useState
()
const
app
=
useContext
(
AppContext
);
const
app
=
useContext
(
AppContext
);
const
uploadRef
=
useRef
(
undefined
);
const
uploadRef
=
useRef
(
undefined
);
...
@@ -402,6 +405,7 @@ const AssetAction = (props) => {
...
@@ -402,6 +405,7 @@ const AssetAction = (props) => {
setPagination
({...
pagination
,
pageNum
:
1
});
setPagination
({...
pagination
,
pageNum
:
1
});
getAssetPaths
();
getAssetPaths
();
checkDataAssetEditable
();
checkDataAssetEditable
();
getAdmin
();
getAsset
();
getAsset
();
}
else
{
}
else
{
...
@@ -579,13 +583,33 @@ const AssetAction = (props) => {
...
@@ -579,13 +583,33 @@ const AssetAction = (props) => {
draftId
:
id
,
draftId
:
id
,
}
}
}
}
setLoadingEditPermission
(
true
);
dispatch
({
dispatch
({
type
:
(
reference
===
AssetDraftReference
)?
'assetmanage.checkDraftEditable'
:
'assetmanage.checkDataAssetEditable'
,
type
:
(
reference
===
AssetDraftReference
)?
'assetmanage.checkDraftEditable'
:
'assetmanage.checkDataAssetEditable'
,
payload
:
{
payload
:
{
params
params
},
},
callback
:
value
=>
{
callback
:
value
=>
{
setLoadingEditPermission
(
false
);
setEdit
(
value
===
'true'
?
true
:
false
);
setEdit
(
value
===
'true'
?
true
:
false
);
},
error
:
()
=>
{
setLoadingEditPermission
(
false
);
}
})
}
const
getAdmin
=
()
=>
{
setLoadingAdmin
(
true
)
dispatch
({
type
:
'assetmanage.checkAdmin'
,
callback
:
(
data
)
=>
{
setLoadingAdmin
(
false
)
setAdmin
((
data
===
'true'
)?
true
:
false
)
},
error
:
()
=>
{
setLoadingAdmin
(
false
)
}
}
})
})
}
}
...
@@ -843,7 +867,6 @@ const AssetAction = (props) => {
...
@@ -843,7 +867,6 @@ const AssetAction = (props) => {
setConfirmLoading(false);
setConfirmLoading(false);
showMessage('warn', '已存在相同的资产目录编号,请重新输入');
showMessage('warn', '已存在相同的资产目录编号,请重新输入');
} else {
} else {
let url = 'assetmanage.saveAsDraft'
let params = {
let params = {
dirId,
dirId,
metadataId: metadataId??'',
metadataId: metadataId??'',
...
@@ -851,7 +874,7 @@ const AssetAction = (props) => {
...
@@ -851,7 +874,7 @@ const AssetAction = (props) => {
}
}
dispatch({
dispatch({
type:
url
,
type:
isAdmin?'assetmanage.addOrUpdateDataAsset':'assetmanage.saveAsDraft'
,
payload: {
payload: {
params,
params,
data: action==='add' ? { elements: newElements } : { ...assets, elements: newElements }
data: action==='add' ? { elements: newElements } : { ...assets, elements: newElements }
...
@@ -1157,7 +1180,7 @@ const AssetAction = (props) => {
...
@@ -1157,7 +1180,7 @@ const AssetAction = (props) => {
flexDirection: 'column',
flexDirection: 'column',
}}
}}
>
>
<Spin spinning={loading}>
<Spin spinning={loading
||loadingAdmin||loadingEditPermission
}>
{
{
(action!=='add' && (id||'')!=='') && <div>
(action!=='add' && (id||'')!=='') && <div>
<div className='mb-3'>
<div className='mb-3'>
...
@@ -1200,7 +1223,7 @@ const AssetAction = (props) => {
...
@@ -1200,7 +1223,7 @@ const AssetAction = (props) => {
{
{
currentAction==='detail' ? <Button onClick={onActionButtonClick}>编辑</Button> : <React.Fragment>
currentAction==='detail' ? <Button onClick={onActionButtonClick}>编辑</Button> : <React.Fragment>
<Button onClick={onCancelButtonClick}>取消</Button>
<Button onClick={onCancelButtonClick}>取消</Button>
<Button onClick={onActionButtonClick}>
保存
</Button>
<Button onClick={onActionButtonClick}>
{(reference===AssetDraftReference||isAdmin)?'保存':'保存草稿'}
</Button>
</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