-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
80c20e1
commit 4e7e838
Showing
3 changed files
with
55 additions
and
16 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
src/pages/CommunityAdmin/DriedFish/components/Delete/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import { deletePlan } from '@/services/dried-fish'; | ||
import { ExclamationCircleOutlined } from '@ant-design/icons'; | ||
import { Modal, Space } from 'antd'; | ||
|
||
const Delete = ({ open, setDeleteVisible, actionRef, currentDriedFish }: any) => { | ||
const handleDelete = async () => { | ||
const success = await deletePlan({ planId: currentDriedFish }); | ||
if (success) { | ||
setDeleteVisible(false); | ||
if (actionRef.current) { | ||
actionRef.current.reload(); | ||
} | ||
} | ||
}; | ||
|
||
const handleCancel = () => { | ||
setDeleteVisible(false); | ||
}; | ||
|
||
return ( | ||
<Modal | ||
title={ | ||
<Space> | ||
<ExclamationCircleOutlined /> | ||
删除小鱼干计划 | ||
</Space> | ||
} | ||
open={open} | ||
okText="确认" | ||
okType="danger" | ||
cancelText="取消" | ||
centered | ||
onOk={handleDelete} | ||
onCancel={handleCancel} | ||
> | ||
确定删除这条小鱼干计划吗? | ||
</Modal> | ||
); | ||
}; | ||
|
||
export default Delete; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters