Commit 82780f73 by zhaochengxiang

接口修改

parent f5744b71
...@@ -370,11 +370,13 @@ const FC = (props) => { ...@@ -370,11 +370,13 @@ const FC = (props) => {
<UpdateAsset <UpdateAsset
{...updateAssetParams} {...updateAssetParams}
reference={AssetDraftReference} reference={AssetDraftReference}
onCancel={() => { onCancel={(refresh) => {
setUpdateAssetParams({ setUpdateAssetParams({
visible: false, visible: false,
id: undefined, id: undefined,
}) })
refresh && getDrafts()
}} }}
/> />
{contextHolder} {contextHolder}
......
...@@ -221,6 +221,8 @@ const AssetAction = (props) => { ...@@ -221,6 +221,8 @@ const AssetAction = (props) => {
getAssetPaths(); getAssetPaths();
if (reference !== AssetDraftReference) { if (reference !== AssetDraftReference) {
checkDataAssetEditable(); checkDataAssetEditable();
} else {
setEdit(true);
} }
getAsset(); getAsset();
...@@ -591,14 +593,6 @@ const AssetAction = (props) => { ...@@ -591,14 +593,6 @@ const AssetAction = (props) => {
} }
}); });
const params = {
dirId,
}
if ((metadataId||'')!=='') {
params.metadataId = metadataId;
}
setConfirmLoading(true); setConfirmLoading(true);
dispatch({ dispatch({
...@@ -611,8 +605,22 @@ const AssetAction = (props) => { ...@@ -611,8 +605,22 @@ const AssetAction = (props) => {
setConfirmLoading(false); setConfirmLoading(false);
showMessage('warn', '已存在相同的资产目录编号,请重新输入'); showMessage('warn', '已存在相同的资产目录编号,请重新输入');
} else { } else {
let url = 'assetmanage.saveAsDraft'
let params = {
dirId,
metadataId: metadataId??'',
operation: 'change',
}
if (reference === AssetDraftReference) {
url = 'assetmanage.updateDraft'
params = {
isAdmin: true,
}
}
dispatch({ dispatch({
type: 'assetmanage.addOrUpdateDataAsset', type: url,
payload: { payload: {
params, params,
data: action==='add' ? { elements: newElements } : { ...assets, elements: newElements } data: action==='add' ? { elements: newElements } : { ...assets, elements: newElements }
...@@ -890,7 +898,9 @@ const AssetAction = (props) => { ...@@ -890,7 +898,9 @@ const AssetAction = (props) => {
<Button type='primary' onClick={onActionButtonClick}>保存</Button> <Button type='primary' onClick={onActionButtonClick}>保存</Button>
</React.Fragment> </React.Fragment>
} }
<Button type='primary' onClick={onAuthorizationButtonClick}>授权</Button> {
reference!==AssetDraftReference && <Button type='primary' onClick={onAuthorizationButtonClick}>授权</Button>
}
{ {
currentAction === 'detail' && <Button onClick={shareAsset}>分享</Button> currentAction === 'detail' && <Button onClick={shareAsset}>分享</Button>
} }
......
...@@ -698,7 +698,7 @@ const AssetTable = (props) => { ...@@ -698,7 +698,7 @@ const AssetTable = (props) => {
} }
dispatch({ dispatch({
type: (reference===AssetManageReference)?'assetmanage.unloadDataAssetsFromAllDirs':'assetmanage.deleteDataAssets', type: (reference===AssetManageReference)?'assetmanage.offlineAsDraft':'assetmanage.deleteDataAssets',
payload, payload,
callback: () => { callback: () => {
showMessage("success","删除成功"); showMessage("success","删除成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment