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
7de5bf81
Commit
7de5bf81
authored
Oct 24, 2025
by
放生的三文鱼
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
删除草稿
parent
5a71127e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
11 deletions
+31
-11
dataassetmanager.js
src/service/dataassetmanager.js
+5
-0
assetData.jsx
src/view/Manage/AssetDraft/hooks/assetData.jsx
+26
-11
No files found.
src/service/dataassetmanager.js
View file @
7de5bf81
...
...
@@ -341,5 +341,10 @@ export function getDraftDataAsset(payload) {
return
GetJSON
(
'/dataassetmanager/draftApi/listDataAssetsByPage'
,
payload
);
}
// /draftApi/deleteDrafts
export
function
deleteDraftDataAsset
(
payload
)
{
return
PostJSON
(
'/dataassetmanager/draftApi/deleteDrafts'
,
payload
);
}
src/view/Manage/AssetDraft/hooks/assetData.jsx
View file @
7de5bf81
import
{
useEffect
,
useState
}
from
"react"
;
import
{
Tooltip
,
Typography
,
Button
,
Tag
}
from
"antd"
;
import
{
Tooltip
,
Typography
,
Button
,
Tag
,
Popconfirm
,
message
}
from
"antd"
;
import
{
getTemplates
,
getDraftDataAsset
,
listFilterElementsGroupByType
,
deleteDraftDataAsset
,
}
from
"../../../../service/dataassetmanager"
;
import
{
AssetItem
}
from
"../../AssetManage/Component/AssetTable"
;
import
{
showMessage
}
from
"../../../../util"
;
const
{
Text
}
=
Typography
;
// ../standardmanage/hooks/sourceMap
...
...
@@ -188,9 +190,21 @@ export function useGetAssetDraft() {
// 编辑操作逻辑
console
.
log
(
"编辑记录:"
,
record
);
};
const
handleDelete
=
(
)
=>
{
const
handleDelete
=
async
(
record
)
=>
{
// 删除操作逻辑
console
.
log
(
"删除记录:"
,
record
);
console
.
log
(
"record:"
,
record
);
try
{
await
deleteDraftDataAsset
({
data
:
[
record
?.
id
],
});
showMessage
(
"success"
,
"删除成功"
);
getDraftData
();
}
catch
(
error
)
{
console
.
log
(
"error"
,
error
);
let
message
=
error
?.
ApiError
?.
cnMessage
||
"操作失败,请稍后再试"
;
showMessage
(
"warn"
,
message
);
}
};
return
(
...
...
@@ -212,15 +226,16 @@ export function useGetAssetDraft() {
>
编辑
</
Button
>
<
Button
disabled=
{
disabled
}
size=
"small"
type=
"link"
danger
onClick=
{
handleDelete
}
<
Popconfirm
title=
"确认删除草稿?"
onConfirm=
{
()
=>
{
handleDelete
(
record
);
}
}
>
删除
</
Button
>
<
Button
disabled=
{
disabled
}
size=
"small"
type=
"link"
danger
>
删除
</
Button
>
</
Popconfirm
>
</
div
>
);
},
...
...
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