feat(useconfig): 删除操作二次确定

This commit is contained in:
山田 2022-08-15 10:21:19 +08:00
parent d31601f1f6
commit 89f44375df
3 changed files with 23 additions and 4 deletions

View File

@ -5,6 +5,7 @@
"Appstore",
"koale",
"mibrc",
"Popconfirm",
"readablize",
"Sider",
"spath",

View File

@ -1,5 +1,5 @@
import {
Button, Card, Empty, message, Modal, Select, Space,
Button, Card, Empty, message, Modal, Popconfirm, Select, Space,
} from 'antd';
import {
useEffect, Key,
@ -86,8 +86,17 @@ export default function Analysis() {
align: 'center',
render: (_: any, record: BackItemType) => (
<Space>
<Button type="link" onClick={() => backupNode(record)}></Button>
<Button type="link" onClick={() => deleteNode(record)}></Button>
<Popconfirm
title="确认删除该节点?"
onConfirm={() => deleteNode(record)}
okText="是"
cancelText="否"
>
<Button type="link"></Button>
</Popconfirm>
</Space>
),
},

View File

@ -1,5 +1,5 @@
import {
Button, Card, Empty, List, Radio, RadioChangeEvent, Space, Tag,
Button, Card, Empty, List, Popconfirm, Radio, RadioChangeEvent, Space, Tag,
} from 'antd';
import { useState } from 'react';
import { PlusCircleOutlined, DeleteOutlined } from '@ant-design/icons';
@ -61,7 +61,16 @@ export default function Settings() {
dataIndex: 'actions',
key: 'actions',
align: 'center',
render: (_: any, item: BackItemType) => <Button onClick={() => deleteBackupItem(item)} type="link">Delete</Button>
render: (_: any, item: BackItemType) => (
<Popconfirm
title="确认删除该节点?"
onConfirm={() => deleteBackupItem(item)}
okText="是"
cancelText="否"
>
<Button type="link">Delete</Button>
</Popconfirm>
)
,
},
];