|
|
@@ -13,8 +13,7 @@ import React, { useEffect, useRef, useState } from 'react';
|
|
|
* - GET /collect_platform_account/index?platform=&account_username=&page=&limit=
|
|
|
* - POST /collect_platform_account/set_status 启用/禁用账号
|
|
|
* - POST /collect_platform_account/handle_exceptions 处理异常
|
|
|
- *
|
|
|
- * 注意:不提供新增/编辑/删除功能,账号数据由心跳上报自动维护
|
|
|
+ * - POST /collect_platform_account/delete 硬删除账号
|
|
|
*/
|
|
|
const PlatformAccount: React.FC = () => {
|
|
|
const actionRef = useRef<ActionType>();
|
|
|
@@ -94,7 +93,7 @@ const PlatformAccount: React.FC = () => {
|
|
|
key: 'option',
|
|
|
valueType: 'option',
|
|
|
fixed: 'right',
|
|
|
- width: 180,
|
|
|
+ width: 260,
|
|
|
render: (text, record) => {
|
|
|
void text;
|
|
|
return (
|
|
|
@@ -144,6 +143,34 @@ const PlatformAccount: React.FC = () => {
|
|
|
>
|
|
|
处理异常
|
|
|
</Typography.Link>
|
|
|
+ <Typography.Link
|
|
|
+ style={{ color: 'red' }}
|
|
|
+ onClick={() => {
|
|
|
+ Modal.show({
|
|
|
+ title: '删除账号',
|
|
|
+ content: (
|
|
|
+ <p>
|
|
|
+ 确认要删除账号 <b>{record.account_username}</b> 吗?
|
|
|
+ <br />
|
|
|
+ 此操作不可恢复,将永久删除该账号。
|
|
|
+ </p>
|
|
|
+ ),
|
|
|
+ onOk: async () => {
|
|
|
+ const response = await API.CollectPlatformAccount.delete({
|
|
|
+ id: record.id,
|
|
|
+ });
|
|
|
+ if (response.code === 'success') {
|
|
|
+ message.success('删除成功');
|
|
|
+ actionRef.current?.reload();
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ throw new Error(response?.msg || '删除失败');
|
|
|
+ },
|
|
|
+ });
|
|
|
+ }}
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </Typography.Link>
|
|
|
</Space>
|
|
|
);
|
|
|
},
|